require-frontend.min.js 326 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301
  1. /*! jQuery v2.2.4 | (c) jQuery Foundation | 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=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.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 e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.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()},push:g,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){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},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?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.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){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[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):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.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,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"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=ga(),z=ga(),A=ga(),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="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),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")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=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)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){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 fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(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 la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(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 oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.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]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);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"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' 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(".#.+[+~]")}),ia(function(a){var b=n.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=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.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===n||a.ownerDocument===v&&t(v,a)?-1:b===n||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,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!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 fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.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},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.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=fa.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=fa.selectors={cacheLength:50,createPseudo:ha,match:W,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(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===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]||fa.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]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.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(ba,ca).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=fa.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(P," ")+" ").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,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(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:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(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:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).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 Y.test(a.nodeName)},input:function(a){return X.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:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(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]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.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=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[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?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(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,k=[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(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(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 ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(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 va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(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=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(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=[ra(sa(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 va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.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(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.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(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(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}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=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},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(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(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==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(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};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=w.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.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.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.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(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 u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(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&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},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().progress(c.notify).done(c.resolve).fail(c.reject):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=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;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||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=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)K(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},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][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=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c;
  3. }catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.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=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.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 N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.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=N.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function W(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&T.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,Z=/^$|\/(?:java|ecma)script/i,$={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,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.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"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.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)),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=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.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)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.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.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!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&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(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)>-1: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 detail 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,e,f,g=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||d,e=c.documentElement,f=c.body,a.pageX=b.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ea.test(f)?this.mouseHooks:da.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=d),3===a.target.nodeType&&(a.target=a.target.parentNode),h.filter?h.filter(a,g):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==ia()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===ia()&&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)}}}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},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?ga:ha):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={constructor:n.Event,isDefaultPrevented:ha,isPropagationStopped:ha,isImmediatePropagationStopped:ha,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ga,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ga,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ga,a&&!this.isSimulated&&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}}}),n.fn.extend({on:function(a,b,c,d){return ja(this,a,b,c,d)},one:function(a,b,c,d){return ja(this,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=ha),this.each(function(){n.event.remove(this,a,c,b)})}});var ka=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,la=/<script|<style|<link/i,ma=/checked\s*(?:[^=]|=\s*.checked.)/i,na=/^true\/(.*)/,oa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function pa(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 qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.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])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(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 ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(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 K(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&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),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),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=wa[0].contentDocument,b.write(),b.close(),c=ya(a,b),wa.detach()),xa[a]=c),c}var Aa=/^margin/,Ba=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ca=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Da=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},Ea=d.documentElement;!function(){var b,c,e,f,g=d.createElement("div"),h=d.createElement("div");if(h.style){h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,g.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",g.appendChild(h);function i(){h.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",h.innerHTML="",Ea.appendChild(g);var d=a.getComputedStyle(h);b="1%"!==d.top,f="2px"===d.marginLeft,c="4px"===d.width,h.style.marginRight="50%",e="4px"===d.marginRight,Ea.removeChild(g)}n.extend(l,{pixelPosition:function(){return i(),b},boxSizingReliable:function(){return null==c&&i(),c},pixelMarginRight:function(){return null==c&&i(),e},reliableMarginLeft:function(){return null==c&&i(),f},reliableMarginRight:function(){var b,c=h.appendChild(d.createElement("div"));return c.style.cssText=h.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",h.style.width="1px",Ea.appendChild(g),b=!parseFloat(a.getComputedStyle(c).marginRight),Ea.removeChild(g),h.removeChild(c),b}})}}();function Fa(a,b,c){var d,e,f,g,h=a.style;return c=c||Ca(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Ba.test(g)&&Aa.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 Ga(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Ha=/^(none|table(?!-c[ea]).+)/,Ia={position:"absolute",visibility:"hidden",display:"block"},Ja={letterSpacing:"0",fontWeight:"400"},Ka=["Webkit","O","Moz","ms"],La=d.createElement("div").style;function Ma(a){if(a in La)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ka.length;while(c--)if(a=Ka[c]+b,a in La)return a}function Na(a,b,c){var d=T.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Oa(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+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Pa(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ca(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Fa(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ba.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Oa(a,b,c||(g?"border":"content"),d,f)+"px"}function Qa(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=N.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=N.access(d,"olddisplay",za(d.nodeName)))):(e=V(d),"none"===c&&e||N.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=Fa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,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]=Ma(h)||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=T.exec(c))&&e[1]&&(c=W(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.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]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Fa(a,b,d)),"normal"===e&&b in Ja&&(e=Ja[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Ha.test(n.css(a,"display"))&&0===a.offsetWidth?Da(a,Ia,function(){return Pa(a,b,d)}):Pa(a,b,d):void 0},set:function(a,c,d){var e,f=d&&Ca(a),g=d&&Oa(a,b,d,"border-box"===n.css(a,"boxSizing",!1,f),f);return g&&(e=T.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=n.css(a,b)),Na(a,c,g)}}}),n.cssHooks.marginLeft=Ga(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Fa(a,"marginLeft"))||a.getBoundingClientRect().left-Da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),n.cssHooks.marginRight=Ga(l.reliableMarginRight,function(a,b){return b?Da(a,{display:"inline-block"},Fa,[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+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Aa.test(a)||(n.cssHooks[a+b].set=Na)}),n.fn.extend({css:function(a,b){return K(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ca(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 Qa(this,!0)},hide:function(){return Qa(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function Ra(a,b,c,d,e){return new Ra.prototype.init(a,b,c,d,e)}n.Tween=Ra,Ra.prototype={constructor:Ra,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ra.propHooks[this.prop];return a&&a.get?a.get(this):Ra.propHooks._default.get(this)},run:function(a){var b,c=Ra.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):Ra.propHooks._default.set(this),this}},Ra.prototype.init.prototype=Ra.prototype,Ra.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},Ra.propHooks.scrollTop=Ra.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},_default:"swing"},n.fx=Ra.prototype.init,n.fx.step={};var Sa,Ta,Ua=/^(?:toggle|show|hide)$/,Va=/queueHooks$/;function Wa(){return a.setTimeout(function(){Sa=void 0}),Sa=n.now()}function Xa(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=U[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ya(a,b,c){for(var d,e=(_a.tweeners[b]||[]).concat(_a.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Za(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&V(a),q=N.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?N.get(a,"olddisplay")||za(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],Ua.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?za(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=N.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;N.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ya(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 $a(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 _a(a,b,c){var d,e,f=0,g=_a.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Sa||Wa(),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:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:Sa||Wa(),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.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for($a(k,j.opts.specialEasing);g>f;f++)if(d=_a.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,Ya,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(_a,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return W(c.elem,a,T.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],_a.tweeners[c]=_a.tweeners[c]||[],_a.tweeners[c].unshift(b)},prefilters:[Za],prefilter:function(a,b){b?_a.prefilters.unshift(a):_a.prefilters.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(V).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=_a(this,n.extend({},a),f);(e||N.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=N.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Va.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=N.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(Xa(b,!0),a,d,e)}}),n.each({slideDown:Xa("show"),slideUp:Xa("hide"),slideToggle:Xa("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(Sa=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Sa=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(){Ta||(Ta=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(Ta),Ta=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=d.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var ab,bb=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return K(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(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ab:void 0)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);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)}}),ab={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=bb[b]||n.find.attr;bb[b]=function(a,b,d){var e,f;return d||(f=bb[b],bb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,bb[b]=f),e}});var cb=/^(?:input|select|textarea|button)$/i,db=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return K(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),
  4. 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){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):cb.test(a.nodeName)||db.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var eb=/[\t\r\n\f]/g;function fb(a){return a.getAttribute&&a.getAttribute("class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,fb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,fb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,fb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=fb(this),b&&N.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":N.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+fb(c)+" ").replace(eb," ").indexOf(b)>-1)return!0;return!1}});var gb=/\r/g,hb=/[\x20\t\r\n\f]+/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(gb,""):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)).replace(hb," ")}},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)&&(l.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(n.valHooks.option.get(d),f)>-1)&&(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)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var ib=/^(?:focusinfocus|focusoutblur)$/;n.extend(n.event,{trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!ib.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),l=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},f||!o.trigger||o.trigger.apply(e,c)!==!1)){if(!f&&!o.noBubble&&!n.isWindow(e)){for(j=o.delegateType||q,ib.test(j+q)||(h=h.parentNode);h;h=h.parentNode)p.push(h),i=h;i===(e.ownerDocument||d)&&p.push(i.defaultView||i.parentWindow||a)}g=0;while((h=p[g++])&&!b.isPropagationStopped())b.type=g>1?j:o.bindType||q,m=(N.get(h,"events")||{})[b.type]&&N.get(h,"handle"),m&&m.apply(h,c),m=l&&h[l],m&&m.apply&&L(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=q,f||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!L(e)||l&&n.isFunction(e[q])&&!n.isWindow(e)&&(i=e[l],i&&(e[l]=null),n.event.triggered=q,e[q](),n.event.triggered=void 0,i&&(e[l]=i)),b.result}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b)}}),n.fn.extend({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}}),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)}}),l.focusin="onfocusin"in a,l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=N.access(d,b);e||d.addEventListener(a,c,!0),N.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=N.access(d,b)-1;e?N.access(d,b,e):(d.removeEventListener(a,c,!0),N.remove(d,b))}}});var jb=a.location,kb=n.now(),lb=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var mb=/#.*$/,nb=/([?&])_=[^&]*/,ob=/^(.*?):[ \t]*([^\r\n]*)$/gm,pb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,qb=/^(?:GET|HEAD)$/,rb=/^\/\//,sb={},tb={},ub="*/".concat("*"),vb=d.createElement("a");vb.href=jb.href;function wb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];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 xb(a,b,c,d){var e={},f=a===tb;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 yb(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 zb(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 Ab(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:jb.href,type:"GET",isLocal:pb.test(jb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ub,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},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?yb(yb(a,n.ajaxSettings),b):yb(n.ajaxSettings,a)},ajaxPrefilter:wb(sb),ajaxTransport:wb(tb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=n.ajaxSetup({},c),o=m.context||m,p=m.context&&(o.nodeType||o.jquery)?n(o):n.event,q=n.Deferred(),r=n.Callbacks("once memory"),s=m.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,getResponseHeader:function(a){var b;if(2===v){if(!h){h={};while(b=ob.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===v?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return v||(a=u[c]=u[c]||a,t[a]=b),this},overrideMimeType:function(a){return v||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>v)for(b in a)s[b]=[s[b],a[b]];else x.always(a[x.status]);return this},abort:function(a){var b=a||w;return e&&e.abort(b),z(0,b),this}};if(q.promise(x).complete=r.add,x.success=x.done,x.error=x.fail,m.url=((b||m.url||jb.href)+"").replace(mb,"").replace(rb,jb.protocol+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=n.trim(m.dataType||"*").toLowerCase().match(G)||[""],null==m.crossDomain){j=d.createElement("a");try{j.href=m.url,j.href=j.href,m.crossDomain=vb.protocol+"//"+vb.host!=j.protocol+"//"+j.host}catch(y){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=n.param(m.data,m.traditional)),xb(sb,m,c,x),2===v)return x;k=n.event&&m.global,k&&0===n.active++&&n.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!qb.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(lb.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=nb.test(f)?f.replace(nb,"$1_="+kb++):f+(lb.test(f)?"&":"?")+"_="+kb++)),m.ifModified&&(n.lastModified[f]&&x.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&x.setRequestHeader("If-None-Match",n.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",m.contentType),x.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+ub+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)x.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(o,x,m)===!1||2===v))return x.abort();w="abort";for(l in{success:1,error:1,complete:1})x[l](m[l]);if(e=xb(tb,m,c,x)){if(x.readyState=1,k&&p.trigger("ajaxSend",[x,m]),2===v)return x;m.async&&m.timeout>0&&(i=a.setTimeout(function(){x.abort("timeout")},m.timeout));try{v=1,e.send(t,z)}catch(y){if(!(2>v))throw y;z(-1,y)}}else z(-1,"No Transport");function z(b,c,d,h){var j,l,t,u,w,y=c;2!==v&&(v=2,i&&a.clearTimeout(i),e=void 0,g=h||"",x.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(u=zb(m,x,d)),u=Ab(m,u,x,j),j?(m.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(n.lastModified[f]=w),w=x.getResponseHeader("etag"),w&&(n.etag[f]=w)),204===b||"HEAD"===m.type?y="nocontent":304===b?y="notmodified":(y=u.state,l=u.data,t=u.error,j=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),x.status=b,x.statusText=(c||y)+"",j?q.resolveWith(o,[l,y,x]):q.rejectWith(o,[x,y,t]),x.statusCode(s),s=void 0,k&&p.trigger(j?"ajaxSuccess":"ajaxError",[x,m,j?l:t]),r.fireWith(o,[x,y]),k&&(p.trigger("ajaxComplete",[x,m]),--n.active||n.event.trigger("ajaxStop")))}return x},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(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),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 n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(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!n.expr.filters.visible(a)},n.expr.filters.visible=function(a){return a.offsetWidth>0||a.offsetHeight>0||a.getClientRects().length>0};var Bb=/%20/g,Cb=/\[\]$/,Db=/\r?\n/g,Eb=/^(?:submit|button|image|reset|file)$/i,Fb=/^(?:input|select|textarea|keygen)/i;function Gb(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Cb.test(a)?d(a,e):Gb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Gb(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)Gb(c,a[c],b,e);return d.join("&").replace(Bb,"+")},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")&&Fb.test(this.nodeName)&&!Eb.test(a)&&(this.checked||!X.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(Db,"\r\n")}}):{name:b.name,value:c.replace(Db,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Hb={0:200,1223:204},Ib=n.ajaxSettings.xhr();l.cors=!!Ib&&"withCredentials"in Ib,l.ajax=Ib=!!Ib,n.ajaxTransport(function(b){var c,d;return l.cors||Ib&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Hb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},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(e,f){b=n("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Jb=[],Kb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Jb.pop()||n.expando+"_"+kb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Kb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Kb.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(Kb,"$1"+e):b.jsonp!==!1&&(b.url+=(lb.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(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Jb.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||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ca([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var Lb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Lb)return Lb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(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||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,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};function Mb(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,n.extend({},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)?(e=d.getBoundingClientRect(),c=Mb(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;while(a&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ea})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;n.fn[a]=function(d){return K(this,function(a,d,e){var f=Mb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ga(l.pixelPosition,function(a,c){return c?(c=Fa(a,b),Ba.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 K(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.extend({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)},size:function(){return this.length}}),n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Nb=a.jQuery,Ob=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Ob),b&&a.jQuery===n&&(a.jQuery=Nb),n},b||(a.jQuery=a.$=n),n});
  5. /*!
  6. * Bootstrap v3.3.7 (http://getbootstrap.com)
  7. * Copyright 2011-2016 Twitter, Inc.
  8. * Licensed under the MIT license
  9. */
  10. if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){document===a.target||this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.7",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element&&e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);if(this.$element.trigger(g),!g.isDefaultPrevented())return f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=window.SVGElement&&c instanceof window.SVGElement,g=d?{top:0,left:0}:f?null:b.offset(),h={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},i=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,h,i,g)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){
  11. this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.7",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e<c&&"top";if("bottom"==this.affixed)return null!=c?!(e+this.unpin<=f.top)&&"bottom":!(e+g<=a-d)&&"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&e<=c?"top":null!=d&&i+j>=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
  12. define("bootstrap", ["jquery"], function(){});
  13. require.config({
  14. urlArgs: "v=" + requirejs.s.contexts._.config.config.site.version,
  15. packages: [{
  16. name: 'moment',
  17. location: '../libs/moment',
  18. main: 'moment'
  19. }
  20. ],
  21. //在打包压缩时将会把include中的模块合并到主文件中
  22. include: ['css', 'layer', 'toastr', 'fast', 'frontend', 'frontend-init'],
  23. paths: {
  24. 'lang': "empty:",
  25. 'form': 'require-form',
  26. 'table': 'require-table',
  27. 'upload': 'require-upload',
  28. 'validator': 'require-validator',
  29. 'drag': 'jquery.drag.min',
  30. 'drop': 'jquery.drop.min',
  31. 'echarts': 'echarts.min',
  32. 'echarts-theme': 'echarts-theme',
  33. 'adminlte': 'adminlte',
  34. 'bootstrap-table-commonsearch': 'bootstrap-table-commonsearch',
  35. 'bootstrap-table-template': 'bootstrap-table-template',
  36. //
  37. // 以下的包从bower的libs目录加载
  38. 'jquery': '../libs/jquery/dist/jquery.min',
  39. 'bootstrap': '../libs/bootstrap/dist/js/bootstrap.min',
  40. 'bootstrap-datetimepicker': '../libs/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min',
  41. 'bootstrap-daterangepicker': '../libs/bootstrap-daterangepicker/daterangepicker',
  42. 'bootstrap-select': '../libs/bootstrap-select/dist/js/bootstrap-select.min',
  43. 'bootstrap-select-lang': '../libs/bootstrap-select/dist/js/i18n/defaults-zh_CN',
  44. 'bootstrap-table': '../libs/bootstrap-table/dist/bootstrap-table.min',
  45. 'bootstrap-table-export': '../libs/bootstrap-table/dist/extensions/export/bootstrap-table-export.min',
  46. 'bootstrap-table-mobile': '../libs/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile',
  47. 'bootstrap-table-lang': '../libs/bootstrap-table/dist/locale/bootstrap-table-zh-CN',
  48. 'tableexport': '../libs/tableExport.jquery.plugin/tableExport.min',
  49. 'dragsort': '../libs/fastadmin-dragsort/jquery.dragsort',
  50. 'sortable': '../libs/Sortable/Sortable.min',
  51. 'addtabs': '../libs/fastadmin-addtabs/jquery.addtabs',
  52. 'slimscroll': '../libs/jquery-slimscroll/jquery.slimscroll',
  53. 'validator-core': '../libs/nice-validator/dist/jquery.validator',
  54. 'validator-lang': '../libs/nice-validator/dist/local/zh-CN',
  55. 'plupload': '../libs/plupload/js/plupload.min',
  56. 'toastr': '../libs/toastr/toastr',
  57. 'jstree': '../libs/jstree/dist/jstree.min',
  58. 'layer': '../libs/fastadmin-layer/dist/layer',
  59. 'cookie': '../libs/jquery.cookie/jquery.cookie',
  60. 'cxselect': '../libs/fastadmin-cxselect/js/jquery.cxselect',
  61. 'template': '../libs/art-template/dist/template-native',
  62. 'selectpage': '../libs/fastadmin-selectpage/selectpage',
  63. 'citypicker': '../libs/fastadmin-citypicker/dist/js/city-picker.min',
  64. 'citypicker-data': '../libs/fastadmin-citypicker/dist/js/city-picker.data'
  65. },
  66. // shim依赖配置
  67. shim: {
  68. 'addons': ['frontend'],
  69. 'bootstrap': ['jquery'],
  70. 'bootstrap-table': {
  71. deps: [
  72. 'bootstrap',
  73. // 'css!../libs/bootstrap-table/dist/bootstrap-table.min.css'
  74. ],
  75. exports: '$.fn.bootstrapTable'
  76. },
  77. 'bootstrap-table-lang': {
  78. deps: ['bootstrap-table'],
  79. exports: '$.fn.bootstrapTable.defaults'
  80. },
  81. 'bootstrap-table-export': {
  82. deps: ['bootstrap-table', 'tableexport'],
  83. exports: '$.fn.bootstrapTable.defaults'
  84. },
  85. 'bootstrap-table-mobile': {
  86. deps: ['bootstrap-table'],
  87. exports: '$.fn.bootstrapTable.defaults'
  88. },
  89. 'bootstrap-table-advancedsearch': {
  90. deps: ['bootstrap-table'],
  91. exports: '$.fn.bootstrapTable.defaults'
  92. },
  93. 'bootstrap-table-commonsearch': {
  94. deps: ['bootstrap-table'],
  95. exports: '$.fn.bootstrapTable.defaults'
  96. },
  97. 'bootstrap-table-template': {
  98. deps: ['bootstrap-table', 'template'],
  99. exports: '$.fn.bootstrapTable.defaults'
  100. },
  101. 'tableexport': {
  102. deps: ['jquery'],
  103. exports: '$.fn.extend'
  104. },
  105. 'slimscroll': {
  106. deps: ['jquery'],
  107. exports: '$.fn.extend'
  108. },
  109. 'adminlte': {
  110. deps: ['bootstrap', 'slimscroll'],
  111. exports: '$.AdminLTE'
  112. },
  113. 'bootstrap-datetimepicker': [
  114. 'moment/locale/zh-cn',
  115. // 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',
  116. ],
  117. // 'bootstrap-select': ['css!../libs/bootstrap-select/dist/css/bootstrap-select.min.css', ],
  118. 'bootstrap-select-lang': ['bootstrap-select'],
  119. // 'toastr': ['css!../libs/toastr/toastr.min.css'],
  120. 'jstree': ['css!../libs/jstree/dist/themes/default/style.css', ],
  121. 'plupload': {
  122. deps: ['../libs/plupload/js/moxie.min'],
  123. exports: "plupload"
  124. },
  125. // 'layer': ['css!../libs/fastadmin-layer/dist/theme/default/layer.css'],
  126. // 'validator-core': ['css!../libs/nice-validator/dist/jquery.validator.css'],
  127. 'validator-lang': ['validator-core'],
  128. // 'selectpage': ['css!../libs/fastadmin-selectpage/selectpage.css'],
  129. 'citypicker': ['citypicker-data', 'css!../libs/fastadmin-citypicker/dist/css/city-picker.css']
  130. },
  131. baseUrl: requirejs.s.contexts._.config.config.site.cdnurl + '/assets/js/', //资源基础路径
  132. map: {
  133. '*': {
  134. 'css': '../libs/require-css/css.min'
  135. }
  136. },
  137. waitSeconds: 30,
  138. charset: 'utf-8' // 文件编码
  139. });
  140. require(['jquery', 'bootstrap'], function ($, undefined) {
  141. //初始配置
  142. var Config = requirejs.s.contexts._.config.config;
  143. //将Config渲染到全局
  144. window.Config = Config;
  145. // 配置语言包的路径
  146. var paths = {};
  147. paths['lang'] = Config.moduleurl + '/ajax/lang?callback=define&controllername=' + Config.controllername;
  148. // 避免目录冲突
  149. paths['frontend/'] = 'frontend/';
  150. require.config({paths: paths});
  151. // 初始化
  152. $(function () {
  153. require(['fast'], function (Fast) {
  154. require(['frontend', 'frontend-init', 'addons'], function (Frontend, Addons) {
  155. //加载相应模块
  156. if (Config.jsname) {
  157. require([Config.jsname], function (Controller) {
  158. Controller[Config.actionname] != undefined && Controller[Config.actionname]();
  159. }, function (e) {
  160. console.error(e);
  161. // 这里可捕获模块加载的错误
  162. });
  163. }
  164. });
  165. });
  166. });
  167. });
  168. define("require-frontend", function(){});
  169. define('../libs/require-css/css.min',[],function(){if("undefined"==typeof window)return{load:function(a,b,c){c()}};var a=document.getElementsByTagName("head")[0],b=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,c=!1,d=!0;b[1]||b[7]?c=parseInt(b[1])<6||parseInt(b[7])<=9:b[2]||b[8]?d=!1:b[4]&&(c=parseInt(b[4])<18);var e={};e.pluginBuilder="./css-builder";var f,g,h,i=function(){f=document.createElement("style"),a.appendChild(f),g=f.styleSheet||f.sheet},j=0,k=[],l=function(a){g.addImport(a),f.onload=function(){m()},j++,31==j&&(i(),j=0)},m=function(){h();var a=k.shift();return a?(h=a[1],void l(a[0])):void(h=null)},n=function(a,b){if(g&&g.addImport||i(),g&&g.addImport)h?k.push([a,b]):(l(a),h=b);else{f.textContent='@import "'+a+'";';var c=setInterval(function(){try{f.sheet.cssRules,clearInterval(c),b()}catch(a){}},10)}},o=function(b,c){var e=document.createElement("link");if(e.type="text/css",e.rel="stylesheet",d)e.onload=function(){e.onload=function(){},setTimeout(c,7)};else var f=setInterval(function(){for(var a=0;a<document.styleSheets.length;a++){var b=document.styleSheets[a];if(b.href==e.href)return clearInterval(f),c()}},10);e.href=b,a.appendChild(e)};return e.normalize=function(a,b){return".css"==a.substr(a.length-4,4)&&(a=a.substr(0,a.length-4)),b(a)},e.load=function(a,b,d,e){(c?n:o)(b.toUrl(a+".css"),d)},e});
  170. /*! layer-v3.1.1 Web弹层组件 MIT License http://layer.layui.com/ By 贤心 */
  171. ;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},f=r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},n.icon!==-1&&n.icon!==t||(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"&#x4FE1;&#x606F;",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'<div class="layui-layer-title" style="'+(f?r.title[1]:"")+'">'+(f?r.title[0]:r.title)+"</div>":"";return r.zIndex=s,t([r.shade?'<div class="layui-layer-shade" id="layui-layer-shade'+a+'" times="'+a+'" style="'+("z-index:"+(s-1)+"; ")+'"></div>':"",'<div class="'+l[0]+(" layui-layer-"+o.type[r.type])+(0!=r.type&&2!=r.type||r.shade?"":" layui-layer-border")+" "+(r.skin||"")+'" id="'+l[0]+a+'" type="'+o.type[r.type]+'" times="'+a+'" showtime="'+r.time+'" conType="'+(e?"object":"string")+'" style="z-index: '+s+"; width:"+r.area[0]+";height:"+r.area[1]+(r.fixed?"":";position:absolute;")+'">'+(e&&2!=r.type?"":u)+'<div id="'+(r.id||"")+'" class="layui-layer-content'+(0==r.type&&r.icon!==-1?" layui-layer-padding":"")+(3==r.type?" layui-layer-loading"+r.icon:"")+'">'+(0==r.type&&r.icon!==-1?'<i class="layui-layer-ico layui-layer-ico'+r.icon+'"></i>':"")+(1==r.type&&e?"":r.content||"")+'</div><span class="layui-layer-setwin">'+function(){var e=c?'<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>':"";return r.closeBtn&&(e+='<a class="layui-layer-ico '+l[7]+" "+l[7]+(r.title?r.closeBtn:4==r.type?"1":"2")+'" href="javascript:;"></a>'),e}()+"</span>"+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t<i;t++)e+='<a class="'+l[6]+t+'">'+r.btn[t]+"</a>";return'<div class="'+l[6]+" layui-layer-btn-"+(r.btnAlign||"")+'">'+e+"</div>"}():"")+(r.resize?'<span class="layui-layer-resize"></span>':"")+"</div>"],u,i('<div class="layui-layer-move"></div>')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='<iframe scrolling="'+(t.content[1]||"auto")+'" allowtransparency="true" id="'+l[4]+a+'" name="'+l[4]+a+'" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="'+t.content[0]+'"></iframe>';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'<i class="layui-layer-TipsG"></i>',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;a<c.stX&&(a=c.stX),a>f&&(a=f),o<c.stY&&(o=c.stY),o>u&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'<textarea class="layui-layer-input"'+a+">"+(e.value||"")+"</textarea>":function(){return'<input type="'+(1==e.formType?"password":"text")+'" class="layui-layer-input" value="'+(e.value||"")+'">'}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){s=e.find(".layui-layer-input"),s.focus(),"function"==typeof f&&f(e)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("&#x6700;&#x591A;&#x8F93;&#x5165;"+(e.maxlength||500)+"&#x4E2A;&#x5B57;&#x6570;",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a='<span class="'+n+'">'+t[0].title+"</span>";i<e;i++)a+="<span>"+t[i].title+"</span>";return a}(),content:'<ul class="layui-layer-tabmain">'+function(){var e=t.length,i=1,a="";if(e>0)for(a='<li class="layui-layer-tabli '+n+'">'+(t[0].content||"no content")+"</li>";i<e;i++)a+='<li class="layui-layer-tabli">'+(t[i].content||"no content")+"</li>";return a}()+"</ul>",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("&#x6CA1;&#x6709;&#x56FE;&#x7247;")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]<r[1]&&(a[0]=a[0]/r[1],a[1]=a[1]/r[1])}return[a[0]+"px",a[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,isOutAnim:!1,skin:"layui-layer-photos"+c("photos"),content:'<div class="layui-layer-phimg"><img src="'+u[d].src+'" alt="'+(u[d].alt||"")+'" layer-pid="'+u[d].pid+'"><div class="layui-layer-imgsee">'+(u.length>1?'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>':"")+'<div class="layui-layer-imgbar" style="display:'+(a?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(u[d].alt||"")+"</a><em>"+s.imgIndex+"/"+u.length+"</em></span></div></div></div>",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;<br>&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x67E5;&#x770B;&#x4E0B;&#x4E00;&#x5F20;&#xFF1F;",{time:3e4,btn:["&#x4E0B;&#x4E00;&#x5F20;","&#x4E0D;&#x770B;&#x4E86;"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define('layer',["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window);
  172. /*
  173. * Toastr
  174. * Copyright 2012-2015
  175. * Authors: John Papa, Hans Fjällemark, and Tim Ferrell.
  176. * All Rights Reserved.
  177. * Use, reproduction, distribution, and modification of this code is subject to the terms and
  178. * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php
  179. *
  180. * ARIA Support: Greta Krafsig
  181. *
  182. * Project: https://github.com/CodeSeven/toastr
  183. */
  184. /* global define */
  185. (function (define) {
  186. define('toastr',['jquery'], function ($) {
  187. return (function () {
  188. var $container;
  189. var listener;
  190. var toastId = 0;
  191. var toastType = {
  192. error: 'error',
  193. info: 'info',
  194. success: 'success',
  195. warning: 'warning'
  196. };
  197. var toastr = {
  198. clear: clear,
  199. remove: remove,
  200. error: error,
  201. getContainer: getContainer,
  202. info: info,
  203. options: {},
  204. subscribe: subscribe,
  205. success: success,
  206. version: '2.1.3',
  207. warning: warning
  208. };
  209. var previousToast;
  210. return toastr;
  211. ////////////////
  212. function error(message, title, optionsOverride) {
  213. return notify({
  214. type: toastType.error,
  215. iconClass: getOptions().iconClasses.error,
  216. message: message,
  217. optionsOverride: optionsOverride,
  218. title: title
  219. });
  220. }
  221. function getContainer(options, create) {
  222. if (!options) { options = getOptions(); }
  223. $container = $('#' + options.containerId);
  224. if ($container.length) {
  225. return $container;
  226. }
  227. if (create) {
  228. $container = createContainer(options);
  229. }
  230. return $container;
  231. }
  232. function info(message, title, optionsOverride) {
  233. return notify({
  234. type: toastType.info,
  235. iconClass: getOptions().iconClasses.info,
  236. message: message,
  237. optionsOverride: optionsOverride,
  238. title: title
  239. });
  240. }
  241. function subscribe(callback) {
  242. listener = callback;
  243. }
  244. function success(message, title, optionsOverride) {
  245. return notify({
  246. type: toastType.success,
  247. iconClass: getOptions().iconClasses.success,
  248. message: message,
  249. optionsOverride: optionsOverride,
  250. title: title
  251. });
  252. }
  253. function warning(message, title, optionsOverride) {
  254. return notify({
  255. type: toastType.warning,
  256. iconClass: getOptions().iconClasses.warning,
  257. message: message,
  258. optionsOverride: optionsOverride,
  259. title: title
  260. });
  261. }
  262. function clear($toastElement, clearOptions) {
  263. var options = getOptions();
  264. if (!$container) { getContainer(options); }
  265. if (!clearToast($toastElement, options, clearOptions)) {
  266. clearContainer(options);
  267. }
  268. }
  269. function remove($toastElement) {
  270. var options = getOptions();
  271. if (!$container) { getContainer(options); }
  272. if ($toastElement && $(':focus', $toastElement).length === 0) {
  273. removeToast($toastElement);
  274. return;
  275. }
  276. if ($container.children().length) {
  277. $container.remove();
  278. }
  279. }
  280. // internal functions
  281. function clearContainer (options) {
  282. var toastsToClear = $container.children();
  283. for (var i = toastsToClear.length - 1; i >= 0; i--) {
  284. clearToast($(toastsToClear[i]), options);
  285. }
  286. }
  287. function clearToast ($toastElement, options, clearOptions) {
  288. var force = clearOptions && clearOptions.force ? clearOptions.force : false;
  289. if ($toastElement && (force || $(':focus', $toastElement).length === 0)) {
  290. $toastElement[options.hideMethod]({
  291. duration: options.hideDuration,
  292. easing: options.hideEasing,
  293. complete: function () { removeToast($toastElement); }
  294. });
  295. return true;
  296. }
  297. return false;
  298. }
  299. function createContainer(options) {
  300. $container = $('<div/>')
  301. .attr('id', options.containerId)
  302. .addClass(options.positionClass);
  303. $container.appendTo($(options.target));
  304. return $container;
  305. }
  306. function getDefaults() {
  307. return {
  308. tapToDismiss: true,
  309. toastClass: 'toast',
  310. containerId: 'toast-container',
  311. debug: false,
  312. showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery
  313. showDuration: 300,
  314. showEasing: 'swing', //swing and linear are built into jQuery
  315. onShown: undefined,
  316. hideMethod: 'fadeOut',
  317. hideDuration: 1000,
  318. hideEasing: 'swing',
  319. onHidden: undefined,
  320. closeMethod: false,
  321. closeDuration: false,
  322. closeEasing: false,
  323. closeOnHover: true,
  324. extendedTimeOut: 1000,
  325. iconClasses: {
  326. error: 'toast-error',
  327. info: 'toast-info',
  328. success: 'toast-success',
  329. warning: 'toast-warning'
  330. },
  331. iconClass: 'toast-info',
  332. positionClass: 'toast-top-right',
  333. timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky
  334. titleClass: 'toast-title',
  335. messageClass: 'toast-message',
  336. escapeHtml: false,
  337. target: 'body',
  338. closeHtml: '<button type="button">&times;</button>',
  339. closeClass: 'toast-close-button',
  340. newestOnTop: true,
  341. preventDuplicates: false,
  342. progressBar: false,
  343. progressClass: 'toast-progress',
  344. rtl: false
  345. };
  346. }
  347. function publish(args) {
  348. if (!listener) { return; }
  349. listener(args);
  350. }
  351. function notify(map) {
  352. var options = getOptions();
  353. var iconClass = map.iconClass || options.iconClass;
  354. if (typeof (map.optionsOverride) !== 'undefined') {
  355. options = $.extend(options, map.optionsOverride);
  356. iconClass = map.optionsOverride.iconClass || iconClass;
  357. }
  358. if (shouldExit(options, map)) { return; }
  359. toastId++;
  360. $container = getContainer(options, true);
  361. var intervalId = null;
  362. var $toastElement = $('<div/>');
  363. var $titleElement = $('<div/>');
  364. var $messageElement = $('<div/>');
  365. var $progressElement = $('<div/>');
  366. var $closeElement = $(options.closeHtml);
  367. var progressBar = {
  368. intervalId: null,
  369. hideEta: null,
  370. maxHideTime: null
  371. };
  372. var response = {
  373. toastId: toastId,
  374. state: 'visible',
  375. startTime: new Date(),
  376. options: options,
  377. map: map
  378. };
  379. personalizeToast();
  380. displayToast();
  381. handleEvents();
  382. publish(response);
  383. if (options.debug && console) {
  384. console.log(response);
  385. }
  386. return $toastElement;
  387. function escapeHtml(source) {
  388. if (source == null) {
  389. source = '';
  390. }
  391. return source
  392. .replace(/&/g, '&amp;')
  393. .replace(/"/g, '&quot;')
  394. .replace(/'/g, '&#39;')
  395. .replace(/</g, '&lt;')
  396. .replace(/>/g, '&gt;');
  397. }
  398. function personalizeToast() {
  399. setIcon();
  400. setTitle();
  401. setMessage();
  402. setCloseButton();
  403. setProgressBar();
  404. setRTL();
  405. setSequence();
  406. setAria();
  407. }
  408. function setAria() {
  409. var ariaValue = '';
  410. switch (map.iconClass) {
  411. case 'toast-success':
  412. case 'toast-info':
  413. ariaValue = 'polite';
  414. break;
  415. default:
  416. ariaValue = 'assertive';
  417. }
  418. $toastElement.attr('aria-live', ariaValue);
  419. }
  420. function handleEvents() {
  421. if (options.closeOnHover) {
  422. $toastElement.hover(stickAround, delayedHideToast);
  423. }
  424. if (!options.onclick && options.tapToDismiss) {
  425. $toastElement.click(hideToast);
  426. }
  427. if (options.closeButton && $closeElement) {
  428. $closeElement.click(function (event) {
  429. if (event.stopPropagation) {
  430. event.stopPropagation();
  431. } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {
  432. event.cancelBubble = true;
  433. }
  434. if (options.onCloseClick) {
  435. options.onCloseClick(event);
  436. }
  437. hideToast(true);
  438. });
  439. }
  440. if (options.onclick) {
  441. $toastElement.click(function (event) {
  442. options.onclick(event);
  443. hideToast();
  444. });
  445. }
  446. }
  447. function displayToast() {
  448. $toastElement.hide();
  449. $toastElement[options.showMethod](
  450. {duration: options.showDuration, easing: options.showEasing, complete: options.onShown}
  451. );
  452. if (options.timeOut > 0) {
  453. intervalId = setTimeout(hideToast, options.timeOut);
  454. progressBar.maxHideTime = parseFloat(options.timeOut);
  455. progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
  456. if (options.progressBar) {
  457. progressBar.intervalId = setInterval(updateProgress, 10);
  458. }
  459. }
  460. }
  461. function setIcon() {
  462. if (map.iconClass) {
  463. $toastElement.addClass(options.toastClass).addClass(iconClass);
  464. }
  465. }
  466. function setSequence() {
  467. if (options.newestOnTop) {
  468. $container.prepend($toastElement);
  469. } else {
  470. $container.append($toastElement);
  471. }
  472. }
  473. function setTitle() {
  474. if (map.title) {
  475. var suffix = map.title;
  476. if (options.escapeHtml) {
  477. suffix = escapeHtml(map.title);
  478. }
  479. $titleElement.append(suffix).addClass(options.titleClass);
  480. $toastElement.append($titleElement);
  481. }
  482. }
  483. function setMessage() {
  484. if (map.message) {
  485. var suffix = map.message;
  486. if (options.escapeHtml) {
  487. suffix = escapeHtml(map.message);
  488. }
  489. $messageElement.append(suffix).addClass(options.messageClass);
  490. $toastElement.append($messageElement);
  491. }
  492. }
  493. function setCloseButton() {
  494. if (options.closeButton) {
  495. $closeElement.addClass(options.closeClass).attr('role', 'button');
  496. $toastElement.prepend($closeElement);
  497. }
  498. }
  499. function setProgressBar() {
  500. if (options.progressBar) {
  501. $progressElement.addClass(options.progressClass);
  502. $toastElement.prepend($progressElement);
  503. }
  504. }
  505. function setRTL() {
  506. if (options.rtl) {
  507. $toastElement.addClass('rtl');
  508. }
  509. }
  510. function shouldExit(options, map) {
  511. if (options.preventDuplicates) {
  512. if (map.message === previousToast) {
  513. return true;
  514. } else {
  515. previousToast = map.message;
  516. }
  517. }
  518. return false;
  519. }
  520. function hideToast(override) {
  521. var method = override && options.closeMethod !== false ? options.closeMethod : options.hideMethod;
  522. var duration = override && options.closeDuration !== false ?
  523. options.closeDuration : options.hideDuration;
  524. var easing = override && options.closeEasing !== false ? options.closeEasing : options.hideEasing;
  525. if ($(':focus', $toastElement).length && !override) {
  526. return;
  527. }
  528. clearTimeout(progressBar.intervalId);
  529. return $toastElement[method]({
  530. duration: duration,
  531. easing: easing,
  532. complete: function () {
  533. removeToast($toastElement);
  534. clearTimeout(intervalId);
  535. if (options.onHidden && response.state !== 'hidden') {
  536. options.onHidden();
  537. }
  538. response.state = 'hidden';
  539. response.endTime = new Date();
  540. publish(response);
  541. }
  542. });
  543. }
  544. function delayedHideToast() {
  545. if (options.timeOut > 0 || options.extendedTimeOut > 0) {
  546. intervalId = setTimeout(hideToast, options.extendedTimeOut);
  547. progressBar.maxHideTime = parseFloat(options.extendedTimeOut);
  548. progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
  549. }
  550. }
  551. function stickAround() {
  552. clearTimeout(intervalId);
  553. progressBar.hideEta = 0;
  554. $toastElement.stop(true, true)[options.showMethod](
  555. {duration: options.showDuration, easing: options.showEasing}
  556. );
  557. }
  558. function updateProgress() {
  559. var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100;
  560. $progressElement.width(percentage + '%');
  561. }
  562. }
  563. function getOptions() {
  564. return $.extend({}, getDefaults(), toastr.options);
  565. }
  566. function removeToast($toastElement) {
  567. if (!$container) { $container = getContainer(); }
  568. if ($toastElement.is(':visible')) {
  569. return;
  570. }
  571. $toastElement.remove();
  572. $toastElement = null;
  573. if ($container.children().length === 0) {
  574. $container.remove();
  575. previousToast = undefined;
  576. }
  577. }
  578. })();
  579. });
  580. }(typeof define === 'function' && define.amd ? define : function (deps, factory) {
  581. if (typeof module !== 'undefined' && module.exports) { //Node
  582. module.exports = factory(require('jquery'));
  583. } else {
  584. window.toastr = factory(window.jQuery);
  585. }
  586. }));
  587. define('fast',['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, undefined, Toastr, Layer, Lang) {
  588. var Fast = {
  589. config: {
  590. //toastr默认配置
  591. toastr: {
  592. "closeButton": true,
  593. "debug": false,
  594. "newestOnTop": false,
  595. "progressBar": false,
  596. "positionClass": "toast-top-center",
  597. "preventDuplicates": false,
  598. "onclick": null,
  599. "showDuration": "300",
  600. "hideDuration": "1000",
  601. "timeOut": "5000",
  602. "extendedTimeOut": "1000",
  603. "showEasing": "swing",
  604. "hideEasing": "linear",
  605. "showMethod": "fadeIn",
  606. "hideMethod": "fadeOut"
  607. }
  608. },
  609. events: {
  610. //请求成功的回调
  611. onAjaxSuccess: function (ret, onAjaxSuccess) {
  612. var data = typeof ret.data !== 'undefined' ? ret.data : null;
  613. var msg = typeof ret.msg !== 'undefined' && ret.msg ? ret.msg : __('Operation completed');
  614. if (typeof onAjaxSuccess === 'function') {
  615. var result = onAjaxSuccess.call(this, data, ret);
  616. if (result === false)
  617. return;
  618. }
  619. Toastr.success(msg);
  620. },
  621. //请求错误的回调
  622. onAjaxError: function (ret, onAjaxError) {
  623. var data = typeof ret.data !== 'undefined' ? ret.data : null;
  624. if (typeof onAjaxError === 'function') {
  625. var result = onAjaxError.call(this, data, ret);
  626. if (result === false) {
  627. return;
  628. }
  629. }
  630. Toastr.error(ret.msg);
  631. },
  632. //服务器响应数据后
  633. onAjaxResponse: function (response) {
  634. try {
  635. var ret = typeof response === 'object' ? response : JSON.parse(response);
  636. if (!ret.hasOwnProperty('code')) {
  637. $.extend(ret, {code: -2, msg: response, data: null});
  638. }
  639. } catch (e) {
  640. var ret = {code: -1, msg: e.message, data: null};
  641. }
  642. return ret;
  643. }
  644. },
  645. api: {
  646. //发送Ajax请求
  647. ajax: function (options, success, error) {
  648. options = typeof options === 'string' ? {url: options} : options;
  649. var index = Layer.load();
  650. options = $.extend({
  651. type: "POST",
  652. dataType: "json",
  653. success: function (ret) {
  654. Layer.close(index);
  655. ret = Fast.events.onAjaxResponse(ret);
  656. if (ret.code === 1) {
  657. Fast.events.onAjaxSuccess(ret, success);
  658. } else {
  659. Fast.events.onAjaxError(ret, error);
  660. }
  661. },
  662. error: function (xhr) {
  663. Layer.close(index);
  664. var ret = {code: xhr.status, msg: xhr.statusText, data: null};
  665. Fast.events.onAjaxError(ret, error);
  666. }
  667. }, options);
  668. $.ajax(options);
  669. },
  670. //修复URL
  671. fixurl: function (url) {
  672. if (url.substr(0, 1) !== "/") {
  673. var r = new RegExp('^(?:[a-z]+:)?//', 'i');
  674. if (!r.test(url)) {
  675. url = Config.moduleurl + "/" + url;
  676. }
  677. } else if (url.substr(0, 8) === "/addons/") {
  678. url = Config.__PUBLIC__.replace(/(\/*$)/g, "") + url;
  679. }
  680. return url;
  681. },
  682. //获取修复后可访问的cdn链接
  683. cdnurl: function (url) {
  684. return /^(?:[a-z]+:)?\/\//i.test(url) ? url : Config.upload.cdnurl + url;
  685. },
  686. //查询Url参数
  687. query: function (name, url) {
  688. if (!url) {
  689. url = window.location.href;
  690. }
  691. name = name.replace(/[\[\]]/g, "\\$&");
  692. var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
  693. results = regex.exec(url);
  694. if (!results)
  695. return null;
  696. if (!results[2])
  697. return '';
  698. return decodeURIComponent(results[2].replace(/\+/g, " "));
  699. },
  700. //打开一个弹出窗口
  701. open: function (url, title, options) {
  702. title = title ? title : "";
  703. url = Fast.api.fixurl(url);
  704. url = url + (url.indexOf("?") > -1 ? "&" : "?") + "dialog=1";
  705. var area = [$(window).width() > 800 ? '800px' : '95%', $(window).height() > 600 ? '600px' : '95%'];
  706. options = $.extend({
  707. type: 2,
  708. title: title,
  709. shadeClose: true,
  710. shade: false,
  711. maxmin: true,
  712. moveOut: true,
  713. area: area,
  714. content: url,
  715. zIndex: Layer.zIndex,
  716. success: function (layero, index) {
  717. var that = this;
  718. //存储callback事件
  719. $(layero).data("callback", that.callback);
  720. //$(layero).removeClass("layui-layer-border");
  721. Layer.setTop(layero);
  722. try {
  723. var frame = Layer.getChildFrame('html', index);
  724. var layerfooter = frame.find(".layer-footer");
  725. Fast.api.layerfooter(layero, index, that);
  726. //绑定事件
  727. if (layerfooter.size() > 0) {
  728. // 监听窗口内的元素及属性变化
  729. // Firefox和Chrome早期版本中带有前缀
  730. var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  731. if (MutationObserver) {
  732. // 选择目标节点
  733. var target = layerfooter[0];
  734. // 创建观察者对象
  735. var observer = new MutationObserver(function (mutations) {
  736. Fast.api.layerfooter(layero, index, that);
  737. mutations.forEach(function (mutation) {
  738. });
  739. });
  740. // 配置观察选项:
  741. var config = {attributes: true, childList: true, characterData: true, subtree: true}
  742. // 传入目标节点和观察选项
  743. observer.observe(target, config);
  744. // 随后,你还可以停止观察
  745. // observer.disconnect();
  746. }
  747. }
  748. } catch (e) {
  749. }
  750. if ($(layero).height() > $(window).height()) {
  751. //当弹出窗口大于浏览器可视高度时,重定位
  752. Layer.style(index, {
  753. top: 0,
  754. height: $(window).height()
  755. });
  756. }
  757. }
  758. }, options ? options : {});
  759. if ($(window).width() < 480 || (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream && top.$(".tab-pane.active").size() > 0)) {
  760. options.area = [top.$(".tab-pane.active").width() + "px", top.$(".tab-pane.active").height() + "px"];
  761. options.offset = [top.$(".tab-pane.active").scrollTop() + "px", "0px"];
  762. }
  763. return Layer.open(options);
  764. },
  765. //关闭窗口并回传数据
  766. close: function (data) {
  767. var index = parent.Layer.getFrameIndex(window.name);
  768. var callback = parent.$("#layui-layer" + index).data("callback");
  769. //再执行关闭
  770. parent.Layer.close(index);
  771. //再调用回传函数
  772. if (typeof callback === 'function') {
  773. callback.call(undefined, data);
  774. }
  775. },
  776. layerfooter: function (layero, index, that) {
  777. var frame = Layer.getChildFrame('html', index);
  778. var layerfooter = frame.find(".layer-footer");
  779. if (layerfooter.size() > 0) {
  780. $(".layui-layer-footer", layero).remove();
  781. var footer = $("<div />").addClass('layui-layer-btn layui-layer-footer');
  782. footer.html(layerfooter.html());
  783. if ($(".row", footer).size() === 0) {
  784. $(">", footer).wrapAll("<div class='row'></div>");
  785. }
  786. footer.insertAfter(layero.find('.layui-layer-content'));
  787. //绑定事件
  788. footer.on("click", ".btn", function () {
  789. if ($(this).hasClass("disabled") || $(this).parent().hasClass("disabled")) {
  790. return;
  791. }
  792. var index = footer.find('.btn').index(this);
  793. $(".btn:eq(" + index + ")", layerfooter).trigger("click");
  794. });
  795. var titHeight = layero.find('.layui-layer-title').outerHeight() || 0;
  796. var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0;
  797. //重设iframe高度
  798. $("iframe", layero).height(layero.height() - titHeight - btnHeight);
  799. }
  800. //修复iOS下弹出窗口的高度和iOS下iframe无法滚动的BUG
  801. if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
  802. var titHeight = layero.find('.layui-layer-title').outerHeight() || 0;
  803. var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0;
  804. $("iframe", layero).parent().css("height", layero.height() - titHeight - btnHeight);
  805. $("iframe", layero).css("height", "100%");
  806. }
  807. },
  808. success: function (options, callback) {
  809. var type = typeof options === 'function';
  810. if (type) {
  811. callback = options;
  812. }
  813. return Layer.msg(__('Operation completed'), $.extend({
  814. offset: 0, icon: 1
  815. }, type ? {} : options), callback);
  816. },
  817. error: function (options, callback) {
  818. var type = typeof options === 'function';
  819. if (type) {
  820. callback = options;
  821. }
  822. return Layer.msg(__('Operation failed'), $.extend({
  823. offset: 0, icon: 2
  824. }, type ? {} : options), callback);
  825. },
  826. toastr: Toastr,
  827. layer: Layer
  828. },
  829. lang: function () {
  830. var args = arguments,
  831. string = args[0],
  832. i = 1;
  833. string = string.toLowerCase();
  834. //string = typeof Lang[string] != 'undefined' ? Lang[string] : string;
  835. if (typeof Lang !== 'undefined' && typeof Lang[string] !== 'undefined') {
  836. if (typeof Lang[string] == 'object')
  837. return Lang[string];
  838. string = Lang[string];
  839. } else if (string.indexOf('.') !== -1 && false) {
  840. var arr = string.split('.');
  841. var current = Lang[arr[0]];
  842. for (var i = 1; i < arr.length; i++) {
  843. current = typeof current[arr[i]] != 'undefined' ? current[arr[i]] : '';
  844. if (typeof current != 'object')
  845. break;
  846. }
  847. if (typeof current == 'object')
  848. return current;
  849. string = current;
  850. } else {
  851. string = args[0];
  852. }
  853. return string.replace(/%((%)|s|d)/g, function (m) {
  854. // m is the matched format, e.g. %s, %d
  855. var val = null;
  856. if (m[2]) {
  857. val = m[2];
  858. } else {
  859. val = args[i];
  860. // A switch statement so that the formatter can be extended. Default is %s
  861. switch (m) {
  862. case '%d':
  863. val = parseFloat(val);
  864. if (isNaN(val)) {
  865. val = 0;
  866. }
  867. break;
  868. }
  869. i++;
  870. }
  871. return val;
  872. });
  873. },
  874. init: function () {
  875. // 对相对地址进行处理
  876. $.ajaxSetup({
  877. beforeSend: function (xhr, setting) {
  878. setting.url = Fast.api.fixurl(setting.url);
  879. }
  880. });
  881. Layer.config({
  882. skin: 'layui-layer-fast'
  883. });
  884. // 绑定ESC关闭窗口事件
  885. $(window).keyup(function (e) {
  886. if (e.keyCode == 27) {
  887. if ($(".layui-layer").size() > 0) {
  888. var index = 0;
  889. $(".layui-layer").each(function () {
  890. index = Math.max(index, parseInt($(this).attr("times")));
  891. });
  892. if (index) {
  893. Layer.close(index);
  894. }
  895. }
  896. }
  897. });
  898. //公共代码
  899. //配置Toastr的参数
  900. Toastr.options = Fast.config.toastr;
  901. }
  902. };
  903. //将Layer暴露到全局中去
  904. window.Layer = Layer;
  905. //将Toastr暴露到全局中去
  906. window.Toastr = Toastr;
  907. //将语言方法暴露到全局中去
  908. window.__ = Fast.lang;
  909. //将Fast渲染至全局
  910. window.Fast = Fast;
  911. //默认初始化执行的代码
  912. Fast.init();
  913. return Fast;
  914. });
  915. /*!art-template - Template Engine | http://aui.github.com/artTemplate/*/
  916. !function(){function a(a){return a.replace(t,"").replace(u,",").replace(v,"").replace(w,"").replace(x,"").split(y)}function b(a){return"'"+a.replace(/('|\\)/g,"\\$1").replace(/\r/g,"\\r").replace(/\n/g,"\\n")+"'"}function c(c,d){function e(a){return m+=a.split(/\n/).length-1,k&&(a=a.replace(/\s+/g," ").replace(/<!--[\w\W]*?-->/g,"")),a&&(a=s[1]+b(a)+s[2]+"\n"),a}function f(b){var c=m;if(j?b=j(b,d):g&&(b=b.replace(/\n/g,function(){return m++,"$line="+m+";"})),0===b.indexOf("=")){var e=l&&!/^=[=#]/.test(b);if(b=b.replace(/^=[=#]?|[\s;]*$/g,""),e){var f=b.replace(/\s*\([^\)]+\)/,"");n[f]||/^(include|print)$/.test(f)||(b="$escape("+b+")")}else b="$string("+b+")";b=s[1]+b+s[2]}return g&&(b="$line="+c+";"+b),r(a(b),function(a){if(a&&!p[a]){var b;b="print"===a?u:"include"===a?v:n[a]?"$utils."+a:o[a]?"$helpers."+a:"$data."+a,w+=a+"="+b+",",p[a]=!0}}),b+"\n"}var g=d.debug,h=d.openTag,i=d.closeTag,j=d.parser,k=d.compress,l=d.escape,m=1,p={$data:1,$filename:1,$utils:1,$helpers:1,$out:1,$line:1},q="".trim,s=q?["$out='';","$out+=",";","$out"]:["$out=[];","$out.push(",");","$out.join('')"],t=q?"$out+=text;return $out;":"$out.push(text);",u="function(){var text=''.concat.apply('',arguments);"+t+"}",v="function(filename,data){data=data||$data;var text=$utils.$include(filename,data,$filename);"+t+"}",w="'use strict';var $utils=this,$helpers=$utils.$helpers,"+(g?"$line=0,":""),x=s[0],y="return new String("+s[3]+");";r(c.split(h),function(a){a=a.split(i);var b=a[0],c=a[1];1===a.length?x+=e(b):(x+=f(b),c&&(x+=e(c)))});var z=w+x+y;g&&(z="try{"+z+"}catch(e){throw {filename:$filename,name:'Render Error',message:e.message,line:$line,source:"+b(c)+".split(/\\n/)[$line-1].replace(/^\\s+/,'')};}");try{var A=new Function("$data","$filename",z);return A.prototype=n,A}catch(a){throw a.temp="function anonymous($data,$filename) {"+z+"}",a}}var d=function(a,b){return"string"==typeof b?q(b,{filename:a}):g(a,b)};d.version="3.0.0",d.config=function(a,b){e[a]=b};var e=d.defaults={openTag:"<%",closeTag:"%>",escape:!0,cache:!0,compress:!1,parser:null},f=d.cache={};d.render=function(a,b){return q(a)(b)};var g=d.renderFile=function(a,b){var c=d.get(a)||p({filename:a,name:"Render Error",message:"Template not found"});return b?c(b):c};d.get=function(a){var b;if(f[a])b=f[a];else if("object"==typeof document){var c=document.getElementById(a);if(c){var d=(c.value||c.innerHTML).replace(/^\s*|\s*$/g,"");b=q(d,{filename:a})}}return b};var h=function(a,b){return"string"!=typeof a&&(b=typeof a,"number"===b?a+="":a="function"===b?h(a.call(a)):""),a},i={"<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","&":"&#38;"},j=function(a){return i[a]},k=function(a){return h(a).replace(/&(?![\w#]+;)|[<>"']/g,j)},l=Array.isArray||function(a){return"[object Array]"==={}.toString.call(a)},m=function(a,b){var c,d;if(l(a))for(c=0,d=a.length;c<d;c++)b.call(a,a[c],c,a);else for(c in a)b.call(a,a[c],c)},n=d.utils={$helpers:{},$include:g,$string:h,$escape:k,$each:m};d.helper=function(a,b){o[a]=b};var o=d.helpers=n.$helpers;d.onerror=function(a){var b="Template Error\n\n";for(var c in a)b+="<"+c+">\n"+a[c]+"\n\n";"object"==typeof console&&console.error(b)};var p=function(a){return d.onerror(a),function(){return"{Template Error}"}},q=d.compile=function(a,b){function d(c){try{return new i(c,h)+""}catch(d){return b.debug?p(d)():(b.debug=!0,q(a,b)(c))}}b=b||{};for(var g in e)void 0===b[g]&&(b[g]=e[g]);var h=b.filename;try{var i=c(a,b)}catch(a){return a.filename=h||"anonymous",a.name="Syntax Error",p(a)}return d.prototype=i.prototype,d.toString=function(){return i.toString()},h&&b.cache&&(f[h]=d),d},r=n.$each,s="break,case,catch,continue,debugger,default,delete,do,else,false,finally,for,function,if,in,instanceof,new,null,return,switch,this,throw,true,try,typeof,var,void,while,with,abstract,boolean,byte,char,class,const,double,enum,export,extends,final,float,goto,implements,import,int,interface,long,native,package,private,protected,public,short,static,super,synchronized,throws,transient,volatile,arguments,let,yield,undefined",t=/\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|\s*\.\s*[$\w\.]+/g,u=/[^\w$]+/g,v=new RegExp(["\\b"+s.replace(/,/g,"\\b|\\b")+"\\b"].join("|"),"g"),w=/^\d[^,]*|,\d[^,]*/g,x=/^,+|,+$/g,y=/^$|,+/;"object"==typeof exports&&"undefined"!=typeof module?module.exports=d:"function"==typeof define?define('template',[],function(){return d}):this.template=d}();
  917. //! moment.js
  918. //! version : 2.15.2
  919. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  920. //! license : MIT
  921. //! momentjs.com
  922. ;(function (global, factory) {
  923. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  924. typeof define === 'function' && define.amd ? define('moment/moment',factory) :
  925. global.moment = factory()
  926. }(this, function () { 'use strict';
  927. var hookCallback;
  928. function utils_hooks__hooks () {
  929. return hookCallback.apply(null, arguments);
  930. }
  931. // This is done to register the method called with moment()
  932. // without creating circular dependencies.
  933. function setHookCallback (callback) {
  934. hookCallback = callback;
  935. }
  936. function isArray(input) {
  937. return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
  938. }
  939. function isObject(input) {
  940. // IE8 will treat undefined and null as object if it wasn't for
  941. // input != null
  942. return input != null && Object.prototype.toString.call(input) === '[object Object]';
  943. }
  944. function isObjectEmpty(obj) {
  945. var k;
  946. for (k in obj) {
  947. // even if its not own property I'd still call it non-empty
  948. return false;
  949. }
  950. return true;
  951. }
  952. function isDate(input) {
  953. return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
  954. }
  955. function map(arr, fn) {
  956. var res = [], i;
  957. for (i = 0; i < arr.length; ++i) {
  958. res.push(fn(arr[i], i));
  959. }
  960. return res;
  961. }
  962. function hasOwnProp(a, b) {
  963. return Object.prototype.hasOwnProperty.call(a, b);
  964. }
  965. function extend(a, b) {
  966. for (var i in b) {
  967. if (hasOwnProp(b, i)) {
  968. a[i] = b[i];
  969. }
  970. }
  971. if (hasOwnProp(b, 'toString')) {
  972. a.toString = b.toString;
  973. }
  974. if (hasOwnProp(b, 'valueOf')) {
  975. a.valueOf = b.valueOf;
  976. }
  977. return a;
  978. }
  979. function create_utc__createUTC (input, format, locale, strict) {
  980. return createLocalOrUTC(input, format, locale, strict, true).utc();
  981. }
  982. function defaultParsingFlags() {
  983. // We need to deep clone this object.
  984. return {
  985. empty : false,
  986. unusedTokens : [],
  987. unusedInput : [],
  988. overflow : -2,
  989. charsLeftOver : 0,
  990. nullInput : false,
  991. invalidMonth : null,
  992. invalidFormat : false,
  993. userInvalidated : false,
  994. iso : false,
  995. parsedDateParts : [],
  996. meridiem : null
  997. };
  998. }
  999. function getParsingFlags(m) {
  1000. if (m._pf == null) {
  1001. m._pf = defaultParsingFlags();
  1002. }
  1003. return m._pf;
  1004. }
  1005. var some;
  1006. if (Array.prototype.some) {
  1007. some = Array.prototype.some;
  1008. } else {
  1009. some = function (fun) {
  1010. var t = Object(this);
  1011. var len = t.length >>> 0;
  1012. for (var i = 0; i < len; i++) {
  1013. if (i in t && fun.call(this, t[i], i, t)) {
  1014. return true;
  1015. }
  1016. }
  1017. return false;
  1018. };
  1019. }
  1020. function valid__isValid(m) {
  1021. if (m._isValid == null) {
  1022. var flags = getParsingFlags(m);
  1023. var parsedParts = some.call(flags.parsedDateParts, function (i) {
  1024. return i != null;
  1025. });
  1026. var isNowValid = !isNaN(m._d.getTime()) &&
  1027. flags.overflow < 0 &&
  1028. !flags.empty &&
  1029. !flags.invalidMonth &&
  1030. !flags.invalidWeekday &&
  1031. !flags.nullInput &&
  1032. !flags.invalidFormat &&
  1033. !flags.userInvalidated &&
  1034. (!flags.meridiem || (flags.meridiem && parsedParts));
  1035. if (m._strict) {
  1036. isNowValid = isNowValid &&
  1037. flags.charsLeftOver === 0 &&
  1038. flags.unusedTokens.length === 0 &&
  1039. flags.bigHour === undefined;
  1040. }
  1041. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  1042. m._isValid = isNowValid;
  1043. }
  1044. else {
  1045. return isNowValid;
  1046. }
  1047. }
  1048. return m._isValid;
  1049. }
  1050. function valid__createInvalid (flags) {
  1051. var m = create_utc__createUTC(NaN);
  1052. if (flags != null) {
  1053. extend(getParsingFlags(m), flags);
  1054. }
  1055. else {
  1056. getParsingFlags(m).userInvalidated = true;
  1057. }
  1058. return m;
  1059. }
  1060. function isUndefined(input) {
  1061. return input === void 0;
  1062. }
  1063. // Plugins that add properties should also add the key here (null value),
  1064. // so we can properly clone ourselves.
  1065. var momentProperties = utils_hooks__hooks.momentProperties = [];
  1066. function copyConfig(to, from) {
  1067. var i, prop, val;
  1068. if (!isUndefined(from._isAMomentObject)) {
  1069. to._isAMomentObject = from._isAMomentObject;
  1070. }
  1071. if (!isUndefined(from._i)) {
  1072. to._i = from._i;
  1073. }
  1074. if (!isUndefined(from._f)) {
  1075. to._f = from._f;
  1076. }
  1077. if (!isUndefined(from._l)) {
  1078. to._l = from._l;
  1079. }
  1080. if (!isUndefined(from._strict)) {
  1081. to._strict = from._strict;
  1082. }
  1083. if (!isUndefined(from._tzm)) {
  1084. to._tzm = from._tzm;
  1085. }
  1086. if (!isUndefined(from._isUTC)) {
  1087. to._isUTC = from._isUTC;
  1088. }
  1089. if (!isUndefined(from._offset)) {
  1090. to._offset = from._offset;
  1091. }
  1092. if (!isUndefined(from._pf)) {
  1093. to._pf = getParsingFlags(from);
  1094. }
  1095. if (!isUndefined(from._locale)) {
  1096. to._locale = from._locale;
  1097. }
  1098. if (momentProperties.length > 0) {
  1099. for (i in momentProperties) {
  1100. prop = momentProperties[i];
  1101. val = from[prop];
  1102. if (!isUndefined(val)) {
  1103. to[prop] = val;
  1104. }
  1105. }
  1106. }
  1107. return to;
  1108. }
  1109. var updateInProgress = false;
  1110. // Moment prototype object
  1111. function Moment(config) {
  1112. copyConfig(this, config);
  1113. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  1114. // Prevent infinite loop in case updateOffset creates new moment
  1115. // objects.
  1116. if (updateInProgress === false) {
  1117. updateInProgress = true;
  1118. utils_hooks__hooks.updateOffset(this);
  1119. updateInProgress = false;
  1120. }
  1121. }
  1122. function isMoment (obj) {
  1123. return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
  1124. }
  1125. function absFloor (number) {
  1126. if (number < 0) {
  1127. // -0 -> 0
  1128. return Math.ceil(number) || 0;
  1129. } else {
  1130. return Math.floor(number);
  1131. }
  1132. }
  1133. function toInt(argumentForCoercion) {
  1134. var coercedNumber = +argumentForCoercion,
  1135. value = 0;
  1136. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  1137. value = absFloor(coercedNumber);
  1138. }
  1139. return value;
  1140. }
  1141. // compare two arrays, return the number of differences
  1142. function compareArrays(array1, array2, dontConvert) {
  1143. var len = Math.min(array1.length, array2.length),
  1144. lengthDiff = Math.abs(array1.length - array2.length),
  1145. diffs = 0,
  1146. i;
  1147. for (i = 0; i < len; i++) {
  1148. if ((dontConvert && array1[i] !== array2[i]) ||
  1149. (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
  1150. diffs++;
  1151. }
  1152. }
  1153. return diffs + lengthDiff;
  1154. }
  1155. function warn(msg) {
  1156. if (utils_hooks__hooks.suppressDeprecationWarnings === false &&
  1157. (typeof console !== 'undefined') && console.warn) {
  1158. console.warn('Deprecation warning: ' + msg);
  1159. }
  1160. }
  1161. function deprecate(msg, fn) {
  1162. var firstTime = true;
  1163. return extend(function () {
  1164. if (utils_hooks__hooks.deprecationHandler != null) {
  1165. utils_hooks__hooks.deprecationHandler(null, msg);
  1166. }
  1167. if (firstTime) {
  1168. var args = [];
  1169. var arg;
  1170. for (var i = 0; i < arguments.length; i++) {
  1171. arg = '';
  1172. if (typeof arguments[i] === 'object') {
  1173. arg += '\n[' + i + '] ';
  1174. for (var key in arguments[0]) {
  1175. arg += key + ': ' + arguments[0][key] + ', ';
  1176. }
  1177. arg = arg.slice(0, -2); // Remove trailing comma and space
  1178. } else {
  1179. arg = arguments[i];
  1180. }
  1181. args.push(arg);
  1182. }
  1183. warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
  1184. firstTime = false;
  1185. }
  1186. return fn.apply(this, arguments);
  1187. }, fn);
  1188. }
  1189. var deprecations = {};
  1190. function deprecateSimple(name, msg) {
  1191. if (utils_hooks__hooks.deprecationHandler != null) {
  1192. utils_hooks__hooks.deprecationHandler(name, msg);
  1193. }
  1194. if (!deprecations[name]) {
  1195. warn(msg);
  1196. deprecations[name] = true;
  1197. }
  1198. }
  1199. utils_hooks__hooks.suppressDeprecationWarnings = false;
  1200. utils_hooks__hooks.deprecationHandler = null;
  1201. function isFunction(input) {
  1202. return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
  1203. }
  1204. function locale_set__set (config) {
  1205. var prop, i;
  1206. for (i in config) {
  1207. prop = config[i];
  1208. if (isFunction(prop)) {
  1209. this[i] = prop;
  1210. } else {
  1211. this['_' + i] = prop;
  1212. }
  1213. }
  1214. this._config = config;
  1215. // Lenient ordinal parsing accepts just a number in addition to
  1216. // number + (possibly) stuff coming from _ordinalParseLenient.
  1217. this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
  1218. }
  1219. function mergeConfigs(parentConfig, childConfig) {
  1220. var res = extend({}, parentConfig), prop;
  1221. for (prop in childConfig) {
  1222. if (hasOwnProp(childConfig, prop)) {
  1223. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  1224. res[prop] = {};
  1225. extend(res[prop], parentConfig[prop]);
  1226. extend(res[prop], childConfig[prop]);
  1227. } else if (childConfig[prop] != null) {
  1228. res[prop] = childConfig[prop];
  1229. } else {
  1230. delete res[prop];
  1231. }
  1232. }
  1233. }
  1234. for (prop in parentConfig) {
  1235. if (hasOwnProp(parentConfig, prop) &&
  1236. !hasOwnProp(childConfig, prop) &&
  1237. isObject(parentConfig[prop])) {
  1238. // make sure changes to properties don't modify parent config
  1239. res[prop] = extend({}, res[prop]);
  1240. }
  1241. }
  1242. return res;
  1243. }
  1244. function Locale(config) {
  1245. if (config != null) {
  1246. this.set(config);
  1247. }
  1248. }
  1249. var keys;
  1250. if (Object.keys) {
  1251. keys = Object.keys;
  1252. } else {
  1253. keys = function (obj) {
  1254. var i, res = [];
  1255. for (i in obj) {
  1256. if (hasOwnProp(obj, i)) {
  1257. res.push(i);
  1258. }
  1259. }
  1260. return res;
  1261. };
  1262. }
  1263. var defaultCalendar = {
  1264. sameDay : '[Today at] LT',
  1265. nextDay : '[Tomorrow at] LT',
  1266. nextWeek : 'dddd [at] LT',
  1267. lastDay : '[Yesterday at] LT',
  1268. lastWeek : '[Last] dddd [at] LT',
  1269. sameElse : 'L'
  1270. };
  1271. function locale_calendar__calendar (key, mom, now) {
  1272. var output = this._calendar[key] || this._calendar['sameElse'];
  1273. return isFunction(output) ? output.call(mom, now) : output;
  1274. }
  1275. var defaultLongDateFormat = {
  1276. LTS : 'h:mm:ss A',
  1277. LT : 'h:mm A',
  1278. L : 'MM/DD/YYYY',
  1279. LL : 'MMMM D, YYYY',
  1280. LLL : 'MMMM D, YYYY h:mm A',
  1281. LLLL : 'dddd, MMMM D, YYYY h:mm A'
  1282. };
  1283. function longDateFormat (key) {
  1284. var format = this._longDateFormat[key],
  1285. formatUpper = this._longDateFormat[key.toUpperCase()];
  1286. if (format || !formatUpper) {
  1287. return format;
  1288. }
  1289. this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
  1290. return val.slice(1);
  1291. });
  1292. return this._longDateFormat[key];
  1293. }
  1294. var defaultInvalidDate = 'Invalid date';
  1295. function invalidDate () {
  1296. return this._invalidDate;
  1297. }
  1298. var defaultOrdinal = '%d';
  1299. var defaultOrdinalParse = /\d{1,2}/;
  1300. function ordinal (number) {
  1301. return this._ordinal.replace('%d', number);
  1302. }
  1303. var defaultRelativeTime = {
  1304. future : 'in %s',
  1305. past : '%s ago',
  1306. s : 'a few seconds',
  1307. m : 'a minute',
  1308. mm : '%d minutes',
  1309. h : 'an hour',
  1310. hh : '%d hours',
  1311. d : 'a day',
  1312. dd : '%d days',
  1313. M : 'a month',
  1314. MM : '%d months',
  1315. y : 'a year',
  1316. yy : '%d years'
  1317. };
  1318. function relative__relativeTime (number, withoutSuffix, string, isFuture) {
  1319. var output = this._relativeTime[string];
  1320. return (isFunction(output)) ?
  1321. output(number, withoutSuffix, string, isFuture) :
  1322. output.replace(/%d/i, number);
  1323. }
  1324. function pastFuture (diff, output) {
  1325. var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  1326. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  1327. }
  1328. var aliases = {};
  1329. function addUnitAlias (unit, shorthand) {
  1330. var lowerCase = unit.toLowerCase();
  1331. aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
  1332. }
  1333. function normalizeUnits(units) {
  1334. return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
  1335. }
  1336. function normalizeObjectUnits(inputObject) {
  1337. var normalizedInput = {},
  1338. normalizedProp,
  1339. prop;
  1340. for (prop in inputObject) {
  1341. if (hasOwnProp(inputObject, prop)) {
  1342. normalizedProp = normalizeUnits(prop);
  1343. if (normalizedProp) {
  1344. normalizedInput[normalizedProp] = inputObject[prop];
  1345. }
  1346. }
  1347. }
  1348. return normalizedInput;
  1349. }
  1350. var priorities = {};
  1351. function addUnitPriority(unit, priority) {
  1352. priorities[unit] = priority;
  1353. }
  1354. function getPrioritizedUnits(unitsObj) {
  1355. var units = [];
  1356. for (var u in unitsObj) {
  1357. units.push({unit: u, priority: priorities[u]});
  1358. }
  1359. units.sort(function (a, b) {
  1360. return a.priority - b.priority;
  1361. });
  1362. return units;
  1363. }
  1364. function makeGetSet (unit, keepTime) {
  1365. return function (value) {
  1366. if (value != null) {
  1367. get_set__set(this, unit, value);
  1368. utils_hooks__hooks.updateOffset(this, keepTime);
  1369. return this;
  1370. } else {
  1371. return get_set__get(this, unit);
  1372. }
  1373. };
  1374. }
  1375. function get_set__get (mom, unit) {
  1376. return mom.isValid() ?
  1377. mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
  1378. }
  1379. function get_set__set (mom, unit, value) {
  1380. if (mom.isValid()) {
  1381. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
  1382. }
  1383. }
  1384. // MOMENTS
  1385. function stringGet (units) {
  1386. units = normalizeUnits(units);
  1387. if (isFunction(this[units])) {
  1388. return this[units]();
  1389. }
  1390. return this;
  1391. }
  1392. function stringSet (units, value) {
  1393. if (typeof units === 'object') {
  1394. units = normalizeObjectUnits(units);
  1395. var prioritized = getPrioritizedUnits(units);
  1396. for (var i = 0; i < prioritized.length; i++) {
  1397. this[prioritized[i].unit](units[prioritized[i].unit]);
  1398. }
  1399. } else {
  1400. units = normalizeUnits(units);
  1401. if (isFunction(this[units])) {
  1402. return this[units](value);
  1403. }
  1404. }
  1405. return this;
  1406. }
  1407. function zeroFill(number, targetLength, forceSign) {
  1408. var absNumber = '' + Math.abs(number),
  1409. zerosToFill = targetLength - absNumber.length,
  1410. sign = number >= 0;
  1411. return (sign ? (forceSign ? '+' : '') : '-') +
  1412. Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
  1413. }
  1414. var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
  1415. var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
  1416. var formatFunctions = {};
  1417. var formatTokenFunctions = {};
  1418. // token: 'M'
  1419. // padded: ['MM', 2]
  1420. // ordinal: 'Mo'
  1421. // callback: function () { this.month() + 1 }
  1422. function addFormatToken (token, padded, ordinal, callback) {
  1423. var func = callback;
  1424. if (typeof callback === 'string') {
  1425. func = function () {
  1426. return this[callback]();
  1427. };
  1428. }
  1429. if (token) {
  1430. formatTokenFunctions[token] = func;
  1431. }
  1432. if (padded) {
  1433. formatTokenFunctions[padded[0]] = function () {
  1434. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  1435. };
  1436. }
  1437. if (ordinal) {
  1438. formatTokenFunctions[ordinal] = function () {
  1439. return this.localeData().ordinal(func.apply(this, arguments), token);
  1440. };
  1441. }
  1442. }
  1443. function removeFormattingTokens(input) {
  1444. if (input.match(/\[[\s\S]/)) {
  1445. return input.replace(/^\[|\]$/g, '');
  1446. }
  1447. return input.replace(/\\/g, '');
  1448. }
  1449. function makeFormatFunction(format) {
  1450. var array = format.match(formattingTokens), i, length;
  1451. for (i = 0, length = array.length; i < length; i++) {
  1452. if (formatTokenFunctions[array[i]]) {
  1453. array[i] = formatTokenFunctions[array[i]];
  1454. } else {
  1455. array[i] = removeFormattingTokens(array[i]);
  1456. }
  1457. }
  1458. return function (mom) {
  1459. var output = '', i;
  1460. for (i = 0; i < length; i++) {
  1461. output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
  1462. }
  1463. return output;
  1464. };
  1465. }
  1466. // format date using native date object
  1467. function formatMoment(m, format) {
  1468. if (!m.isValid()) {
  1469. return m.localeData().invalidDate();
  1470. }
  1471. format = expandFormat(format, m.localeData());
  1472. formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
  1473. return formatFunctions[format](m);
  1474. }
  1475. function expandFormat(format, locale) {
  1476. var i = 5;
  1477. function replaceLongDateFormatTokens(input) {
  1478. return locale.longDateFormat(input) || input;
  1479. }
  1480. localFormattingTokens.lastIndex = 0;
  1481. while (i >= 0 && localFormattingTokens.test(format)) {
  1482. format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
  1483. localFormattingTokens.lastIndex = 0;
  1484. i -= 1;
  1485. }
  1486. return format;
  1487. }
  1488. var match1 = /\d/; // 0 - 9
  1489. var match2 = /\d\d/; // 00 - 99
  1490. var match3 = /\d{3}/; // 000 - 999
  1491. var match4 = /\d{4}/; // 0000 - 9999
  1492. var match6 = /[+-]?\d{6}/; // -999999 - 999999
  1493. var match1to2 = /\d\d?/; // 0 - 99
  1494. var match3to4 = /\d\d\d\d?/; // 999 - 9999
  1495. var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
  1496. var match1to3 = /\d{1,3}/; // 0 - 999
  1497. var match1to4 = /\d{1,4}/; // 0 - 9999
  1498. var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
  1499. var matchUnsigned = /\d+/; // 0 - inf
  1500. var matchSigned = /[+-]?\d+/; // -inf - inf
  1501. var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
  1502. var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  1503. var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
  1504. // any word (or two) characters or numbers including two/three word month in arabic.
  1505. // includes scottish gaelic two word and hyphenated months
  1506. var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
  1507. var regexes = {};
  1508. function addRegexToken (token, regex, strictRegex) {
  1509. regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
  1510. return (isStrict && strictRegex) ? strictRegex : regex;
  1511. };
  1512. }
  1513. function getParseRegexForToken (token, config) {
  1514. if (!hasOwnProp(regexes, token)) {
  1515. return new RegExp(unescapeFormat(token));
  1516. }
  1517. return regexes[token](config._strict, config._locale);
  1518. }
  1519. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  1520. function unescapeFormat(s) {
  1521. return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
  1522. return p1 || p2 || p3 || p4;
  1523. }));
  1524. }
  1525. function regexEscape(s) {
  1526. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  1527. }
  1528. var tokens = {};
  1529. function addParseToken (token, callback) {
  1530. var i, func = callback;
  1531. if (typeof token === 'string') {
  1532. token = [token];
  1533. }
  1534. if (typeof callback === 'number') {
  1535. func = function (input, array) {
  1536. array[callback] = toInt(input);
  1537. };
  1538. }
  1539. for (i = 0; i < token.length; i++) {
  1540. tokens[token[i]] = func;
  1541. }
  1542. }
  1543. function addWeekParseToken (token, callback) {
  1544. addParseToken(token, function (input, array, config, token) {
  1545. config._w = config._w || {};
  1546. callback(input, config._w, config, token);
  1547. });
  1548. }
  1549. function addTimeToArrayFromToken(token, input, config) {
  1550. if (input != null && hasOwnProp(tokens, token)) {
  1551. tokens[token](input, config._a, config, token);
  1552. }
  1553. }
  1554. var YEAR = 0;
  1555. var MONTH = 1;
  1556. var DATE = 2;
  1557. var HOUR = 3;
  1558. var MINUTE = 4;
  1559. var SECOND = 5;
  1560. var MILLISECOND = 6;
  1561. var WEEK = 7;
  1562. var WEEKDAY = 8;
  1563. var indexOf;
  1564. if (Array.prototype.indexOf) {
  1565. indexOf = Array.prototype.indexOf;
  1566. } else {
  1567. indexOf = function (o) {
  1568. // I know
  1569. var i;
  1570. for (i = 0; i < this.length; ++i) {
  1571. if (this[i] === o) {
  1572. return i;
  1573. }
  1574. }
  1575. return -1;
  1576. };
  1577. }
  1578. function daysInMonth(year, month) {
  1579. return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
  1580. }
  1581. // FORMATTING
  1582. addFormatToken('M', ['MM', 2], 'Mo', function () {
  1583. return this.month() + 1;
  1584. });
  1585. addFormatToken('MMM', 0, 0, function (format) {
  1586. return this.localeData().monthsShort(this, format);
  1587. });
  1588. addFormatToken('MMMM', 0, 0, function (format) {
  1589. return this.localeData().months(this, format);
  1590. });
  1591. // ALIASES
  1592. addUnitAlias('month', 'M');
  1593. // PRIORITY
  1594. addUnitPriority('month', 8);
  1595. // PARSING
  1596. addRegexToken('M', match1to2);
  1597. addRegexToken('MM', match1to2, match2);
  1598. addRegexToken('MMM', function (isStrict, locale) {
  1599. return locale.monthsShortRegex(isStrict);
  1600. });
  1601. addRegexToken('MMMM', function (isStrict, locale) {
  1602. return locale.monthsRegex(isStrict);
  1603. });
  1604. addParseToken(['M', 'MM'], function (input, array) {
  1605. array[MONTH] = toInt(input) - 1;
  1606. });
  1607. addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
  1608. var month = config._locale.monthsParse(input, token, config._strict);
  1609. // if we didn't find a month name, mark the date as invalid.
  1610. if (month != null) {
  1611. array[MONTH] = month;
  1612. } else {
  1613. getParsingFlags(config).invalidMonth = input;
  1614. }
  1615. });
  1616. // LOCALES
  1617. var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
  1618. var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
  1619. function localeMonths (m, format) {
  1620. if (!m) {
  1621. return this._months;
  1622. }
  1623. return isArray(this._months) ? this._months[m.month()] :
  1624. this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
  1625. }
  1626. var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
  1627. function localeMonthsShort (m, format) {
  1628. if (!m) {
  1629. return this._monthsShort;
  1630. }
  1631. return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
  1632. this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
  1633. }
  1634. function units_month__handleStrictParse(monthName, format, strict) {
  1635. var i, ii, mom, llc = monthName.toLocaleLowerCase();
  1636. if (!this._monthsParse) {
  1637. // this is not used
  1638. this._monthsParse = [];
  1639. this._longMonthsParse = [];
  1640. this._shortMonthsParse = [];
  1641. for (i = 0; i < 12; ++i) {
  1642. mom = create_utc__createUTC([2000, i]);
  1643. this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
  1644. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  1645. }
  1646. }
  1647. if (strict) {
  1648. if (format === 'MMM') {
  1649. ii = indexOf.call(this._shortMonthsParse, llc);
  1650. return ii !== -1 ? ii : null;
  1651. } else {
  1652. ii = indexOf.call(this._longMonthsParse, llc);
  1653. return ii !== -1 ? ii : null;
  1654. }
  1655. } else {
  1656. if (format === 'MMM') {
  1657. ii = indexOf.call(this._shortMonthsParse, llc);
  1658. if (ii !== -1) {
  1659. return ii;
  1660. }
  1661. ii = indexOf.call(this._longMonthsParse, llc);
  1662. return ii !== -1 ? ii : null;
  1663. } else {
  1664. ii = indexOf.call(this._longMonthsParse, llc);
  1665. if (ii !== -1) {
  1666. return ii;
  1667. }
  1668. ii = indexOf.call(this._shortMonthsParse, llc);
  1669. return ii !== -1 ? ii : null;
  1670. }
  1671. }
  1672. }
  1673. function localeMonthsParse (monthName, format, strict) {
  1674. var i, mom, regex;
  1675. if (this._monthsParseExact) {
  1676. return units_month__handleStrictParse.call(this, monthName, format, strict);
  1677. }
  1678. if (!this._monthsParse) {
  1679. this._monthsParse = [];
  1680. this._longMonthsParse = [];
  1681. this._shortMonthsParse = [];
  1682. }
  1683. // TODO: add sorting
  1684. // Sorting makes sure if one month (or abbr) is a prefix of another
  1685. // see sorting in computeMonthsParse
  1686. for (i = 0; i < 12; i++) {
  1687. // make the regex if we don't have it already
  1688. mom = create_utc__createUTC([2000, i]);
  1689. if (strict && !this._longMonthsParse[i]) {
  1690. this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
  1691. this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
  1692. }
  1693. if (!strict && !this._monthsParse[i]) {
  1694. regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
  1695. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  1696. }
  1697. // test the regex
  1698. if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
  1699. return i;
  1700. } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
  1701. return i;
  1702. } else if (!strict && this._monthsParse[i].test(monthName)) {
  1703. return i;
  1704. }
  1705. }
  1706. }
  1707. // MOMENTS
  1708. function setMonth (mom, value) {
  1709. var dayOfMonth;
  1710. if (!mom.isValid()) {
  1711. // No op
  1712. return mom;
  1713. }
  1714. if (typeof value === 'string') {
  1715. if (/^\d+$/.test(value)) {
  1716. value = toInt(value);
  1717. } else {
  1718. value = mom.localeData().monthsParse(value);
  1719. // TODO: Another silent failure?
  1720. if (typeof value !== 'number') {
  1721. return mom;
  1722. }
  1723. }
  1724. }
  1725. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  1726. mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  1727. return mom;
  1728. }
  1729. function getSetMonth (value) {
  1730. if (value != null) {
  1731. setMonth(this, value);
  1732. utils_hooks__hooks.updateOffset(this, true);
  1733. return this;
  1734. } else {
  1735. return get_set__get(this, 'Month');
  1736. }
  1737. }
  1738. function getDaysInMonth () {
  1739. return daysInMonth(this.year(), this.month());
  1740. }
  1741. var defaultMonthsShortRegex = matchWord;
  1742. function monthsShortRegex (isStrict) {
  1743. if (this._monthsParseExact) {
  1744. if (!hasOwnProp(this, '_monthsRegex')) {
  1745. computeMonthsParse.call(this);
  1746. }
  1747. if (isStrict) {
  1748. return this._monthsShortStrictRegex;
  1749. } else {
  1750. return this._monthsShortRegex;
  1751. }
  1752. } else {
  1753. if (!hasOwnProp(this, '_monthsShortRegex')) {
  1754. this._monthsShortRegex = defaultMonthsShortRegex;
  1755. }
  1756. return this._monthsShortStrictRegex && isStrict ?
  1757. this._monthsShortStrictRegex : this._monthsShortRegex;
  1758. }
  1759. }
  1760. var defaultMonthsRegex = matchWord;
  1761. function monthsRegex (isStrict) {
  1762. if (this._monthsParseExact) {
  1763. if (!hasOwnProp(this, '_monthsRegex')) {
  1764. computeMonthsParse.call(this);
  1765. }
  1766. if (isStrict) {
  1767. return this._monthsStrictRegex;
  1768. } else {
  1769. return this._monthsRegex;
  1770. }
  1771. } else {
  1772. if (!hasOwnProp(this, '_monthsRegex')) {
  1773. this._monthsRegex = defaultMonthsRegex;
  1774. }
  1775. return this._monthsStrictRegex && isStrict ?
  1776. this._monthsStrictRegex : this._monthsRegex;
  1777. }
  1778. }
  1779. function computeMonthsParse () {
  1780. function cmpLenRev(a, b) {
  1781. return b.length - a.length;
  1782. }
  1783. var shortPieces = [], longPieces = [], mixedPieces = [],
  1784. i, mom;
  1785. for (i = 0; i < 12; i++) {
  1786. // make the regex if we don't have it already
  1787. mom = create_utc__createUTC([2000, i]);
  1788. shortPieces.push(this.monthsShort(mom, ''));
  1789. longPieces.push(this.months(mom, ''));
  1790. mixedPieces.push(this.months(mom, ''));
  1791. mixedPieces.push(this.monthsShort(mom, ''));
  1792. }
  1793. // Sorting makes sure if one month (or abbr) is a prefix of another it
  1794. // will match the longer piece.
  1795. shortPieces.sort(cmpLenRev);
  1796. longPieces.sort(cmpLenRev);
  1797. mixedPieces.sort(cmpLenRev);
  1798. for (i = 0; i < 12; i++) {
  1799. shortPieces[i] = regexEscape(shortPieces[i]);
  1800. longPieces[i] = regexEscape(longPieces[i]);
  1801. }
  1802. for (i = 0; i < 24; i++) {
  1803. mixedPieces[i] = regexEscape(mixedPieces[i]);
  1804. }
  1805. this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  1806. this._monthsShortRegex = this._monthsRegex;
  1807. this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  1808. this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  1809. }
  1810. // FORMATTING
  1811. addFormatToken('Y', 0, 0, function () {
  1812. var y = this.year();
  1813. return y <= 9999 ? '' + y : '+' + y;
  1814. });
  1815. addFormatToken(0, ['YY', 2], 0, function () {
  1816. return this.year() % 100;
  1817. });
  1818. addFormatToken(0, ['YYYY', 4], 0, 'year');
  1819. addFormatToken(0, ['YYYYY', 5], 0, 'year');
  1820. addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  1821. // ALIASES
  1822. addUnitAlias('year', 'y');
  1823. // PRIORITIES
  1824. addUnitPriority('year', 1);
  1825. // PARSING
  1826. addRegexToken('Y', matchSigned);
  1827. addRegexToken('YY', match1to2, match2);
  1828. addRegexToken('YYYY', match1to4, match4);
  1829. addRegexToken('YYYYY', match1to6, match6);
  1830. addRegexToken('YYYYYY', match1to6, match6);
  1831. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  1832. addParseToken('YYYY', function (input, array) {
  1833. array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input);
  1834. });
  1835. addParseToken('YY', function (input, array) {
  1836. array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input);
  1837. });
  1838. addParseToken('Y', function (input, array) {
  1839. array[YEAR] = parseInt(input, 10);
  1840. });
  1841. // HELPERS
  1842. function daysInYear(year) {
  1843. return isLeapYear(year) ? 366 : 365;
  1844. }
  1845. function isLeapYear(year) {
  1846. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  1847. }
  1848. // HOOKS
  1849. utils_hooks__hooks.parseTwoDigitYear = function (input) {
  1850. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  1851. };
  1852. // MOMENTS
  1853. var getSetYear = makeGetSet('FullYear', true);
  1854. function getIsLeapYear () {
  1855. return isLeapYear(this.year());
  1856. }
  1857. function createDate (y, m, d, h, M, s, ms) {
  1858. //can't just apply() to create a date:
  1859. //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
  1860. var date = new Date(y, m, d, h, M, s, ms);
  1861. //the date constructor remaps years 0-99 to 1900-1999
  1862. if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
  1863. date.setFullYear(y);
  1864. }
  1865. return date;
  1866. }
  1867. function createUTCDate (y) {
  1868. var date = new Date(Date.UTC.apply(null, arguments));
  1869. //the Date.UTC function remaps years 0-99 to 1900-1999
  1870. if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
  1871. date.setUTCFullYear(y);
  1872. }
  1873. return date;
  1874. }
  1875. // start-of-first-week - start-of-year
  1876. function firstWeekOffset(year, dow, doy) {
  1877. var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  1878. fwd = 7 + dow - doy,
  1879. // first-week day local weekday -- which local weekday is fwd
  1880. fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  1881. return -fwdlw + fwd - 1;
  1882. }
  1883. //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  1884. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  1885. var localWeekday = (7 + weekday - dow) % 7,
  1886. weekOffset = firstWeekOffset(year, dow, doy),
  1887. dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
  1888. resYear, resDayOfYear;
  1889. if (dayOfYear <= 0) {
  1890. resYear = year - 1;
  1891. resDayOfYear = daysInYear(resYear) + dayOfYear;
  1892. } else if (dayOfYear > daysInYear(year)) {
  1893. resYear = year + 1;
  1894. resDayOfYear = dayOfYear - daysInYear(year);
  1895. } else {
  1896. resYear = year;
  1897. resDayOfYear = dayOfYear;
  1898. }
  1899. return {
  1900. year: resYear,
  1901. dayOfYear: resDayOfYear
  1902. };
  1903. }
  1904. function weekOfYear(mom, dow, doy) {
  1905. var weekOffset = firstWeekOffset(mom.year(), dow, doy),
  1906. week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
  1907. resWeek, resYear;
  1908. if (week < 1) {
  1909. resYear = mom.year() - 1;
  1910. resWeek = week + weeksInYear(resYear, dow, doy);
  1911. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  1912. resWeek = week - weeksInYear(mom.year(), dow, doy);
  1913. resYear = mom.year() + 1;
  1914. } else {
  1915. resYear = mom.year();
  1916. resWeek = week;
  1917. }
  1918. return {
  1919. week: resWeek,
  1920. year: resYear
  1921. };
  1922. }
  1923. function weeksInYear(year, dow, doy) {
  1924. var weekOffset = firstWeekOffset(year, dow, doy),
  1925. weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  1926. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  1927. }
  1928. // FORMATTING
  1929. addFormatToken('w', ['ww', 2], 'wo', 'week');
  1930. addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  1931. // ALIASES
  1932. addUnitAlias('week', 'w');
  1933. addUnitAlias('isoWeek', 'W');
  1934. // PRIORITIES
  1935. addUnitPriority('week', 5);
  1936. addUnitPriority('isoWeek', 5);
  1937. // PARSING
  1938. addRegexToken('w', match1to2);
  1939. addRegexToken('ww', match1to2, match2);
  1940. addRegexToken('W', match1to2);
  1941. addRegexToken('WW', match1to2, match2);
  1942. addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
  1943. week[token.substr(0, 1)] = toInt(input);
  1944. });
  1945. // HELPERS
  1946. // LOCALES
  1947. function localeWeek (mom) {
  1948. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  1949. }
  1950. var defaultLocaleWeek = {
  1951. dow : 0, // Sunday is the first day of the week.
  1952. doy : 6 // The week that contains Jan 1st is the first week of the year.
  1953. };
  1954. function localeFirstDayOfWeek () {
  1955. return this._week.dow;
  1956. }
  1957. function localeFirstDayOfYear () {
  1958. return this._week.doy;
  1959. }
  1960. // MOMENTS
  1961. function getSetWeek (input) {
  1962. var week = this.localeData().week(this);
  1963. return input == null ? week : this.add((input - week) * 7, 'd');
  1964. }
  1965. function getSetISOWeek (input) {
  1966. var week = weekOfYear(this, 1, 4).week;
  1967. return input == null ? week : this.add((input - week) * 7, 'd');
  1968. }
  1969. // FORMATTING
  1970. addFormatToken('d', 0, 'do', 'day');
  1971. addFormatToken('dd', 0, 0, function (format) {
  1972. return this.localeData().weekdaysMin(this, format);
  1973. });
  1974. addFormatToken('ddd', 0, 0, function (format) {
  1975. return this.localeData().weekdaysShort(this, format);
  1976. });
  1977. addFormatToken('dddd', 0, 0, function (format) {
  1978. return this.localeData().weekdays(this, format);
  1979. });
  1980. addFormatToken('e', 0, 0, 'weekday');
  1981. addFormatToken('E', 0, 0, 'isoWeekday');
  1982. // ALIASES
  1983. addUnitAlias('day', 'd');
  1984. addUnitAlias('weekday', 'e');
  1985. addUnitAlias('isoWeekday', 'E');
  1986. // PRIORITY
  1987. addUnitPriority('day', 11);
  1988. addUnitPriority('weekday', 11);
  1989. addUnitPriority('isoWeekday', 11);
  1990. // PARSING
  1991. addRegexToken('d', match1to2);
  1992. addRegexToken('e', match1to2);
  1993. addRegexToken('E', match1to2);
  1994. addRegexToken('dd', function (isStrict, locale) {
  1995. return locale.weekdaysMinRegex(isStrict);
  1996. });
  1997. addRegexToken('ddd', function (isStrict, locale) {
  1998. return locale.weekdaysShortRegex(isStrict);
  1999. });
  2000. addRegexToken('dddd', function (isStrict, locale) {
  2001. return locale.weekdaysRegex(isStrict);
  2002. });
  2003. addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
  2004. var weekday = config._locale.weekdaysParse(input, token, config._strict);
  2005. // if we didn't get a weekday name, mark the date as invalid
  2006. if (weekday != null) {
  2007. week.d = weekday;
  2008. } else {
  2009. getParsingFlags(config).invalidWeekday = input;
  2010. }
  2011. });
  2012. addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
  2013. week[token] = toInt(input);
  2014. });
  2015. // HELPERS
  2016. function parseWeekday(input, locale) {
  2017. if (typeof input !== 'string') {
  2018. return input;
  2019. }
  2020. if (!isNaN(input)) {
  2021. return parseInt(input, 10);
  2022. }
  2023. input = locale.weekdaysParse(input);
  2024. if (typeof input === 'number') {
  2025. return input;
  2026. }
  2027. return null;
  2028. }
  2029. function parseIsoWeekday(input, locale) {
  2030. if (typeof input === 'string') {
  2031. return locale.weekdaysParse(input) % 7 || 7;
  2032. }
  2033. return isNaN(input) ? null : input;
  2034. }
  2035. // LOCALES
  2036. var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
  2037. function localeWeekdays (m, format) {
  2038. if (!m) {
  2039. return this._weekdays;
  2040. }
  2041. return isArray(this._weekdays) ? this._weekdays[m.day()] :
  2042. this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
  2043. }
  2044. var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
  2045. function localeWeekdaysShort (m) {
  2046. return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
  2047. }
  2048. var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
  2049. function localeWeekdaysMin (m) {
  2050. return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
  2051. }
  2052. function day_of_week__handleStrictParse(weekdayName, format, strict) {
  2053. var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
  2054. if (!this._weekdaysParse) {
  2055. this._weekdaysParse = [];
  2056. this._shortWeekdaysParse = [];
  2057. this._minWeekdaysParse = [];
  2058. for (i = 0; i < 7; ++i) {
  2059. mom = create_utc__createUTC([2000, 1]).day(i);
  2060. this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
  2061. this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
  2062. this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
  2063. }
  2064. }
  2065. if (strict) {
  2066. if (format === 'dddd') {
  2067. ii = indexOf.call(this._weekdaysParse, llc);
  2068. return ii !== -1 ? ii : null;
  2069. } else if (format === 'ddd') {
  2070. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2071. return ii !== -1 ? ii : null;
  2072. } else {
  2073. ii = indexOf.call(this._minWeekdaysParse, llc);
  2074. return ii !== -1 ? ii : null;
  2075. }
  2076. } else {
  2077. if (format === 'dddd') {
  2078. ii = indexOf.call(this._weekdaysParse, llc);
  2079. if (ii !== -1) {
  2080. return ii;
  2081. }
  2082. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2083. if (ii !== -1) {
  2084. return ii;
  2085. }
  2086. ii = indexOf.call(this._minWeekdaysParse, llc);
  2087. return ii !== -1 ? ii : null;
  2088. } else if (format === 'ddd') {
  2089. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2090. if (ii !== -1) {
  2091. return ii;
  2092. }
  2093. ii = indexOf.call(this._weekdaysParse, llc);
  2094. if (ii !== -1) {
  2095. return ii;
  2096. }
  2097. ii = indexOf.call(this._minWeekdaysParse, llc);
  2098. return ii !== -1 ? ii : null;
  2099. } else {
  2100. ii = indexOf.call(this._minWeekdaysParse, llc);
  2101. if (ii !== -1) {
  2102. return ii;
  2103. }
  2104. ii = indexOf.call(this._weekdaysParse, llc);
  2105. if (ii !== -1) {
  2106. return ii;
  2107. }
  2108. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2109. return ii !== -1 ? ii : null;
  2110. }
  2111. }
  2112. }
  2113. function localeWeekdaysParse (weekdayName, format, strict) {
  2114. var i, mom, regex;
  2115. if (this._weekdaysParseExact) {
  2116. return day_of_week__handleStrictParse.call(this, weekdayName, format, strict);
  2117. }
  2118. if (!this._weekdaysParse) {
  2119. this._weekdaysParse = [];
  2120. this._minWeekdaysParse = [];
  2121. this._shortWeekdaysParse = [];
  2122. this._fullWeekdaysParse = [];
  2123. }
  2124. for (i = 0; i < 7; i++) {
  2125. // make the regex if we don't have it already
  2126. mom = create_utc__createUTC([2000, 1]).day(i);
  2127. if (strict && !this._fullWeekdaysParse[i]) {
  2128. this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
  2129. this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
  2130. this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
  2131. }
  2132. if (!this._weekdaysParse[i]) {
  2133. regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
  2134. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  2135. }
  2136. // test the regex
  2137. if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
  2138. return i;
  2139. } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
  2140. return i;
  2141. } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
  2142. return i;
  2143. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  2144. return i;
  2145. }
  2146. }
  2147. }
  2148. // MOMENTS
  2149. function getSetDayOfWeek (input) {
  2150. if (!this.isValid()) {
  2151. return input != null ? this : NaN;
  2152. }
  2153. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  2154. if (input != null) {
  2155. input = parseWeekday(input, this.localeData());
  2156. return this.add(input - day, 'd');
  2157. } else {
  2158. return day;
  2159. }
  2160. }
  2161. function getSetLocaleDayOfWeek (input) {
  2162. if (!this.isValid()) {
  2163. return input != null ? this : NaN;
  2164. }
  2165. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  2166. return input == null ? weekday : this.add(input - weekday, 'd');
  2167. }
  2168. function getSetISODayOfWeek (input) {
  2169. if (!this.isValid()) {
  2170. return input != null ? this : NaN;
  2171. }
  2172. // behaves the same as moment#day except
  2173. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  2174. // as a setter, sunday should belong to the previous week.
  2175. if (input != null) {
  2176. var weekday = parseIsoWeekday(input, this.localeData());
  2177. return this.day(this.day() % 7 ? weekday : weekday - 7);
  2178. } else {
  2179. return this.day() || 7;
  2180. }
  2181. }
  2182. var defaultWeekdaysRegex = matchWord;
  2183. function weekdaysRegex (isStrict) {
  2184. if (this._weekdaysParseExact) {
  2185. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2186. computeWeekdaysParse.call(this);
  2187. }
  2188. if (isStrict) {
  2189. return this._weekdaysStrictRegex;
  2190. } else {
  2191. return this._weekdaysRegex;
  2192. }
  2193. } else {
  2194. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2195. this._weekdaysRegex = defaultWeekdaysRegex;
  2196. }
  2197. return this._weekdaysStrictRegex && isStrict ?
  2198. this._weekdaysStrictRegex : this._weekdaysRegex;
  2199. }
  2200. }
  2201. var defaultWeekdaysShortRegex = matchWord;
  2202. function weekdaysShortRegex (isStrict) {
  2203. if (this._weekdaysParseExact) {
  2204. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2205. computeWeekdaysParse.call(this);
  2206. }
  2207. if (isStrict) {
  2208. return this._weekdaysShortStrictRegex;
  2209. } else {
  2210. return this._weekdaysShortRegex;
  2211. }
  2212. } else {
  2213. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  2214. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  2215. }
  2216. return this._weekdaysShortStrictRegex && isStrict ?
  2217. this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
  2218. }
  2219. }
  2220. var defaultWeekdaysMinRegex = matchWord;
  2221. function weekdaysMinRegex (isStrict) {
  2222. if (this._weekdaysParseExact) {
  2223. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2224. computeWeekdaysParse.call(this);
  2225. }
  2226. if (isStrict) {
  2227. return this._weekdaysMinStrictRegex;
  2228. } else {
  2229. return this._weekdaysMinRegex;
  2230. }
  2231. } else {
  2232. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  2233. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  2234. }
  2235. return this._weekdaysMinStrictRegex && isStrict ?
  2236. this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
  2237. }
  2238. }
  2239. function computeWeekdaysParse () {
  2240. function cmpLenRev(a, b) {
  2241. return b.length - a.length;
  2242. }
  2243. var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
  2244. i, mom, minp, shortp, longp;
  2245. for (i = 0; i < 7; i++) {
  2246. // make the regex if we don't have it already
  2247. mom = create_utc__createUTC([2000, 1]).day(i);
  2248. minp = this.weekdaysMin(mom, '');
  2249. shortp = this.weekdaysShort(mom, '');
  2250. longp = this.weekdays(mom, '');
  2251. minPieces.push(minp);
  2252. shortPieces.push(shortp);
  2253. longPieces.push(longp);
  2254. mixedPieces.push(minp);
  2255. mixedPieces.push(shortp);
  2256. mixedPieces.push(longp);
  2257. }
  2258. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  2259. // will match the longer piece.
  2260. minPieces.sort(cmpLenRev);
  2261. shortPieces.sort(cmpLenRev);
  2262. longPieces.sort(cmpLenRev);
  2263. mixedPieces.sort(cmpLenRev);
  2264. for (i = 0; i < 7; i++) {
  2265. shortPieces[i] = regexEscape(shortPieces[i]);
  2266. longPieces[i] = regexEscape(longPieces[i]);
  2267. mixedPieces[i] = regexEscape(mixedPieces[i]);
  2268. }
  2269. this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  2270. this._weekdaysShortRegex = this._weekdaysRegex;
  2271. this._weekdaysMinRegex = this._weekdaysRegex;
  2272. this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  2273. this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  2274. this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
  2275. }
  2276. // FORMATTING
  2277. function hFormat() {
  2278. return this.hours() % 12 || 12;
  2279. }
  2280. function kFormat() {
  2281. return this.hours() || 24;
  2282. }
  2283. addFormatToken('H', ['HH', 2], 0, 'hour');
  2284. addFormatToken('h', ['hh', 2], 0, hFormat);
  2285. addFormatToken('k', ['kk', 2], 0, kFormat);
  2286. addFormatToken('hmm', 0, 0, function () {
  2287. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  2288. });
  2289. addFormatToken('hmmss', 0, 0, function () {
  2290. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
  2291. zeroFill(this.seconds(), 2);
  2292. });
  2293. addFormatToken('Hmm', 0, 0, function () {
  2294. return '' + this.hours() + zeroFill(this.minutes(), 2);
  2295. });
  2296. addFormatToken('Hmmss', 0, 0, function () {
  2297. return '' + this.hours() + zeroFill(this.minutes(), 2) +
  2298. zeroFill(this.seconds(), 2);
  2299. });
  2300. function meridiem (token, lowercase) {
  2301. addFormatToken(token, 0, 0, function () {
  2302. return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
  2303. });
  2304. }
  2305. meridiem('a', true);
  2306. meridiem('A', false);
  2307. // ALIASES
  2308. addUnitAlias('hour', 'h');
  2309. // PRIORITY
  2310. addUnitPriority('hour', 13);
  2311. // PARSING
  2312. function matchMeridiem (isStrict, locale) {
  2313. return locale._meridiemParse;
  2314. }
  2315. addRegexToken('a', matchMeridiem);
  2316. addRegexToken('A', matchMeridiem);
  2317. addRegexToken('H', match1to2);
  2318. addRegexToken('h', match1to2);
  2319. addRegexToken('HH', match1to2, match2);
  2320. addRegexToken('hh', match1to2, match2);
  2321. addRegexToken('hmm', match3to4);
  2322. addRegexToken('hmmss', match5to6);
  2323. addRegexToken('Hmm', match3to4);
  2324. addRegexToken('Hmmss', match5to6);
  2325. addParseToken(['H', 'HH'], HOUR);
  2326. addParseToken(['a', 'A'], function (input, array, config) {
  2327. config._isPm = config._locale.isPM(input);
  2328. config._meridiem = input;
  2329. });
  2330. addParseToken(['h', 'hh'], function (input, array, config) {
  2331. array[HOUR] = toInt(input);
  2332. getParsingFlags(config).bigHour = true;
  2333. });
  2334. addParseToken('hmm', function (input, array, config) {
  2335. var pos = input.length - 2;
  2336. array[HOUR] = toInt(input.substr(0, pos));
  2337. array[MINUTE] = toInt(input.substr(pos));
  2338. getParsingFlags(config).bigHour = true;
  2339. });
  2340. addParseToken('hmmss', function (input, array, config) {
  2341. var pos1 = input.length - 4;
  2342. var pos2 = input.length - 2;
  2343. array[HOUR] = toInt(input.substr(0, pos1));
  2344. array[MINUTE] = toInt(input.substr(pos1, 2));
  2345. array[SECOND] = toInt(input.substr(pos2));
  2346. getParsingFlags(config).bigHour = true;
  2347. });
  2348. addParseToken('Hmm', function (input, array, config) {
  2349. var pos = input.length - 2;
  2350. array[HOUR] = toInt(input.substr(0, pos));
  2351. array[MINUTE] = toInt(input.substr(pos));
  2352. });
  2353. addParseToken('Hmmss', function (input, array, config) {
  2354. var pos1 = input.length - 4;
  2355. var pos2 = input.length - 2;
  2356. array[HOUR] = toInt(input.substr(0, pos1));
  2357. array[MINUTE] = toInt(input.substr(pos1, 2));
  2358. array[SECOND] = toInt(input.substr(pos2));
  2359. });
  2360. // LOCALES
  2361. function localeIsPM (input) {
  2362. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  2363. // Using charAt should be more compatible.
  2364. return ((input + '').toLowerCase().charAt(0) === 'p');
  2365. }
  2366. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
  2367. function localeMeridiem (hours, minutes, isLower) {
  2368. if (hours > 11) {
  2369. return isLower ? 'pm' : 'PM';
  2370. } else {
  2371. return isLower ? 'am' : 'AM';
  2372. }
  2373. }
  2374. // MOMENTS
  2375. // Setting the hour should keep the time, because the user explicitly
  2376. // specified which hour he wants. So trying to maintain the same hour (in
  2377. // a new timezone) makes sense. Adding/subtracting hours does not follow
  2378. // this rule.
  2379. var getSetHour = makeGetSet('Hours', true);
  2380. var baseConfig = {
  2381. calendar: defaultCalendar,
  2382. longDateFormat: defaultLongDateFormat,
  2383. invalidDate: defaultInvalidDate,
  2384. ordinal: defaultOrdinal,
  2385. ordinalParse: defaultOrdinalParse,
  2386. relativeTime: defaultRelativeTime,
  2387. months: defaultLocaleMonths,
  2388. monthsShort: defaultLocaleMonthsShort,
  2389. week: defaultLocaleWeek,
  2390. weekdays: defaultLocaleWeekdays,
  2391. weekdaysMin: defaultLocaleWeekdaysMin,
  2392. weekdaysShort: defaultLocaleWeekdaysShort,
  2393. meridiemParse: defaultLocaleMeridiemParse
  2394. };
  2395. // internal storage for locale config files
  2396. var locales = {};
  2397. var globalLocale;
  2398. function normalizeLocale(key) {
  2399. return key ? key.toLowerCase().replace('_', '-') : key;
  2400. }
  2401. // pick the locale from the array
  2402. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  2403. // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
  2404. function chooseLocale(names) {
  2405. var i = 0, j, next, locale, split;
  2406. while (i < names.length) {
  2407. split = normalizeLocale(names[i]).split('-');
  2408. j = split.length;
  2409. next = normalizeLocale(names[i + 1]);
  2410. next = next ? next.split('-') : null;
  2411. while (j > 0) {
  2412. locale = loadLocale(split.slice(0, j).join('-'));
  2413. if (locale) {
  2414. return locale;
  2415. }
  2416. if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
  2417. //the next array item is better than a shallower substring of this one
  2418. break;
  2419. }
  2420. j--;
  2421. }
  2422. i++;
  2423. }
  2424. return null;
  2425. }
  2426. function loadLocale(name) {
  2427. var oldLocale = null;
  2428. // TODO: Find a better way to register and load all the locales in Node
  2429. if (!locales[name] && (typeof module !== 'undefined') &&
  2430. module && module.exports) {
  2431. try {
  2432. oldLocale = globalLocale._abbr;
  2433. require('./locale/' + name);
  2434. // because defineLocale currently also sets the global locale, we
  2435. // want to undo that for lazy loaded locales
  2436. locale_locales__getSetGlobalLocale(oldLocale);
  2437. } catch (e) { }
  2438. }
  2439. return locales[name];
  2440. }
  2441. // This function will load locale and then set the global locale. If
  2442. // no arguments are passed in, it will simply return the current global
  2443. // locale key.
  2444. function locale_locales__getSetGlobalLocale (key, values) {
  2445. var data;
  2446. if (key) {
  2447. if (isUndefined(values)) {
  2448. data = locale_locales__getLocale(key);
  2449. }
  2450. else {
  2451. data = defineLocale(key, values);
  2452. }
  2453. if (data) {
  2454. // moment.duration._locale = moment._locale = data;
  2455. globalLocale = data;
  2456. }
  2457. }
  2458. return globalLocale._abbr;
  2459. }
  2460. function defineLocale (name, config) {
  2461. if (config !== null) {
  2462. var parentConfig = baseConfig;
  2463. config.abbr = name;
  2464. if (locales[name] != null) {
  2465. deprecateSimple('defineLocaleOverride',
  2466. 'use moment.updateLocale(localeName, config) to change ' +
  2467. 'an existing locale. moment.defineLocale(localeName, ' +
  2468. 'config) should only be used for creating a new locale ' +
  2469. 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
  2470. parentConfig = locales[name]._config;
  2471. } else if (config.parentLocale != null) {
  2472. if (locales[config.parentLocale] != null) {
  2473. parentConfig = locales[config.parentLocale]._config;
  2474. } else {
  2475. // treat as if there is no base config
  2476. deprecateSimple('parentLocaleUndefined',
  2477. 'specified parentLocale is not defined yet. See http://momentjs.com/guides/#/warnings/parent-locale/');
  2478. }
  2479. }
  2480. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  2481. // backwards compat for now: also set the locale
  2482. locale_locales__getSetGlobalLocale(name);
  2483. return locales[name];
  2484. } else {
  2485. // useful for testing
  2486. delete locales[name];
  2487. return null;
  2488. }
  2489. }
  2490. function updateLocale(name, config) {
  2491. if (config != null) {
  2492. var locale, parentConfig = baseConfig;
  2493. // MERGE
  2494. if (locales[name] != null) {
  2495. parentConfig = locales[name]._config;
  2496. }
  2497. config = mergeConfigs(parentConfig, config);
  2498. locale = new Locale(config);
  2499. locale.parentLocale = locales[name];
  2500. locales[name] = locale;
  2501. // backwards compat for now: also set the locale
  2502. locale_locales__getSetGlobalLocale(name);
  2503. } else {
  2504. // pass null for config to unupdate, useful for tests
  2505. if (locales[name] != null) {
  2506. if (locales[name].parentLocale != null) {
  2507. locales[name] = locales[name].parentLocale;
  2508. } else if (locales[name] != null) {
  2509. delete locales[name];
  2510. }
  2511. }
  2512. }
  2513. return locales[name];
  2514. }
  2515. // returns locale data
  2516. function locale_locales__getLocale (key) {
  2517. var locale;
  2518. if (key && key._locale && key._locale._abbr) {
  2519. key = key._locale._abbr;
  2520. }
  2521. if (!key) {
  2522. return globalLocale;
  2523. }
  2524. if (!isArray(key)) {
  2525. //short-circuit everything else
  2526. locale = loadLocale(key);
  2527. if (locale) {
  2528. return locale;
  2529. }
  2530. key = [key];
  2531. }
  2532. return chooseLocale(key);
  2533. }
  2534. function locale_locales__listLocales() {
  2535. return keys(locales);
  2536. }
  2537. function checkOverflow (m) {
  2538. var overflow;
  2539. var a = m._a;
  2540. if (a && getParsingFlags(m).overflow === -2) {
  2541. overflow =
  2542. a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
  2543. a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
  2544. a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
  2545. a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
  2546. a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
  2547. a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
  2548. -1;
  2549. if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
  2550. overflow = DATE;
  2551. }
  2552. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  2553. overflow = WEEK;
  2554. }
  2555. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  2556. overflow = WEEKDAY;
  2557. }
  2558. getParsingFlags(m).overflow = overflow;
  2559. }
  2560. return m;
  2561. }
  2562. // iso 8601 regex
  2563. // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
  2564. var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/;
  2565. var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/;
  2566. var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
  2567. var isoDates = [
  2568. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  2569. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  2570. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  2571. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  2572. ['YYYY-DDD', /\d{4}-\d{3}/],
  2573. ['YYYY-MM', /\d{4}-\d\d/, false],
  2574. ['YYYYYYMMDD', /[+-]\d{10}/],
  2575. ['YYYYMMDD', /\d{8}/],
  2576. // YYYYMM is NOT allowed by the standard
  2577. ['GGGG[W]WWE', /\d{4}W\d{3}/],
  2578. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  2579. ['YYYYDDD', /\d{7}/]
  2580. ];
  2581. // iso time formats and regexes
  2582. var isoTimes = [
  2583. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  2584. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  2585. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  2586. ['HH:mm', /\d\d:\d\d/],
  2587. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  2588. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  2589. ['HHmmss', /\d\d\d\d\d\d/],
  2590. ['HHmm', /\d\d\d\d/],
  2591. ['HH', /\d\d/]
  2592. ];
  2593. var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
  2594. // date from iso format
  2595. function configFromISO(config) {
  2596. var i, l,
  2597. string = config._i,
  2598. match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  2599. allowTime, dateFormat, timeFormat, tzFormat;
  2600. if (match) {
  2601. getParsingFlags(config).iso = true;
  2602. for (i = 0, l = isoDates.length; i < l; i++) {
  2603. if (isoDates[i][1].exec(match[1])) {
  2604. dateFormat = isoDates[i][0];
  2605. allowTime = isoDates[i][2] !== false;
  2606. break;
  2607. }
  2608. }
  2609. if (dateFormat == null) {
  2610. config._isValid = false;
  2611. return;
  2612. }
  2613. if (match[3]) {
  2614. for (i = 0, l = isoTimes.length; i < l; i++) {
  2615. if (isoTimes[i][1].exec(match[3])) {
  2616. // match[2] should be 'T' or space
  2617. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  2618. break;
  2619. }
  2620. }
  2621. if (timeFormat == null) {
  2622. config._isValid = false;
  2623. return;
  2624. }
  2625. }
  2626. if (!allowTime && timeFormat != null) {
  2627. config._isValid = false;
  2628. return;
  2629. }
  2630. if (match[4]) {
  2631. if (tzRegex.exec(match[4])) {
  2632. tzFormat = 'Z';
  2633. } else {
  2634. config._isValid = false;
  2635. return;
  2636. }
  2637. }
  2638. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  2639. configFromStringAndFormat(config);
  2640. } else {
  2641. config._isValid = false;
  2642. }
  2643. }
  2644. // date from iso format or fallback
  2645. function configFromString(config) {
  2646. var matched = aspNetJsonRegex.exec(config._i);
  2647. if (matched !== null) {
  2648. config._d = new Date(+matched[1]);
  2649. return;
  2650. }
  2651. configFromISO(config);
  2652. if (config._isValid === false) {
  2653. delete config._isValid;
  2654. utils_hooks__hooks.createFromInputFallback(config);
  2655. }
  2656. }
  2657. utils_hooks__hooks.createFromInputFallback = deprecate(
  2658. 'value provided is not in a recognized ISO format. moment construction falls back to js Date(), ' +
  2659. 'which is not reliable across all browsers and versions. Non ISO date formats are ' +
  2660. 'discouraged and will be removed in an upcoming major release. Please refer to ' +
  2661. 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  2662. function (config) {
  2663. config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  2664. }
  2665. );
  2666. // Pick the first defined of two or three arguments.
  2667. function defaults(a, b, c) {
  2668. if (a != null) {
  2669. return a;
  2670. }
  2671. if (b != null) {
  2672. return b;
  2673. }
  2674. return c;
  2675. }
  2676. function currentDateArray(config) {
  2677. // hooks is actually the exported moment object
  2678. var nowValue = new Date(utils_hooks__hooks.now());
  2679. if (config._useUTC) {
  2680. return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
  2681. }
  2682. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  2683. }
  2684. // convert an array to a date.
  2685. // the array should mirror the parameters below
  2686. // note: all values past the year are optional and will default to the lowest possible value.
  2687. // [year, month, day , hour, minute, second, millisecond]
  2688. function configFromArray (config) {
  2689. var i, date, input = [], currentDate, yearToUse;
  2690. if (config._d) {
  2691. return;
  2692. }
  2693. currentDate = currentDateArray(config);
  2694. //compute day of the year from weeks and weekdays
  2695. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  2696. dayOfYearFromWeekInfo(config);
  2697. }
  2698. //if the day of the year is set, figure out what it is
  2699. if (config._dayOfYear) {
  2700. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  2701. if (config._dayOfYear > daysInYear(yearToUse)) {
  2702. getParsingFlags(config)._overflowDayOfYear = true;
  2703. }
  2704. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  2705. config._a[MONTH] = date.getUTCMonth();
  2706. config._a[DATE] = date.getUTCDate();
  2707. }
  2708. // Default to current date.
  2709. // * if no year, month, day of month are given, default to today
  2710. // * if day of month is given, default month and year
  2711. // * if month is given, default only year
  2712. // * if year is given, don't default anything
  2713. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  2714. config._a[i] = input[i] = currentDate[i];
  2715. }
  2716. // Zero out whatever was not defaulted, including time
  2717. for (; i < 7; i++) {
  2718. config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
  2719. }
  2720. // Check for 24:00:00.000
  2721. if (config._a[HOUR] === 24 &&
  2722. config._a[MINUTE] === 0 &&
  2723. config._a[SECOND] === 0 &&
  2724. config._a[MILLISECOND] === 0) {
  2725. config._nextDay = true;
  2726. config._a[HOUR] = 0;
  2727. }
  2728. config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
  2729. // Apply timezone offset from input. The actual utcOffset can be changed
  2730. // with parseZone.
  2731. if (config._tzm != null) {
  2732. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  2733. }
  2734. if (config._nextDay) {
  2735. config._a[HOUR] = 24;
  2736. }
  2737. }
  2738. function dayOfYearFromWeekInfo(config) {
  2739. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
  2740. w = config._w;
  2741. if (w.GG != null || w.W != null || w.E != null) {
  2742. dow = 1;
  2743. doy = 4;
  2744. // TODO: We need to take the current isoWeekYear, but that depends on
  2745. // how we interpret now (local, utc, fixed offset). So create
  2746. // a now version of current config (take local/utc/offset flags, and
  2747. // create now).
  2748. weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year);
  2749. week = defaults(w.W, 1);
  2750. weekday = defaults(w.E, 1);
  2751. if (weekday < 1 || weekday > 7) {
  2752. weekdayOverflow = true;
  2753. }
  2754. } else {
  2755. dow = config._locale._week.dow;
  2756. doy = config._locale._week.doy;
  2757. weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year);
  2758. week = defaults(w.w, 1);
  2759. if (w.d != null) {
  2760. // weekday -- low day numbers are considered next week
  2761. weekday = w.d;
  2762. if (weekday < 0 || weekday > 6) {
  2763. weekdayOverflow = true;
  2764. }
  2765. } else if (w.e != null) {
  2766. // local weekday -- counting starts from begining of week
  2767. weekday = w.e + dow;
  2768. if (w.e < 0 || w.e > 6) {
  2769. weekdayOverflow = true;
  2770. }
  2771. } else {
  2772. // default to begining of week
  2773. weekday = dow;
  2774. }
  2775. }
  2776. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  2777. getParsingFlags(config)._overflowWeeks = true;
  2778. } else if (weekdayOverflow != null) {
  2779. getParsingFlags(config)._overflowWeekday = true;
  2780. } else {
  2781. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  2782. config._a[YEAR] = temp.year;
  2783. config._dayOfYear = temp.dayOfYear;
  2784. }
  2785. }
  2786. // constant that refers to the ISO standard
  2787. utils_hooks__hooks.ISO_8601 = function () {};
  2788. // date from string and format string
  2789. function configFromStringAndFormat(config) {
  2790. // TODO: Move this to another part of the creation flow to prevent circular deps
  2791. if (config._f === utils_hooks__hooks.ISO_8601) {
  2792. configFromISO(config);
  2793. return;
  2794. }
  2795. config._a = [];
  2796. getParsingFlags(config).empty = true;
  2797. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  2798. var string = '' + config._i,
  2799. i, parsedInput, tokens, token, skipped,
  2800. stringLength = string.length,
  2801. totalParsedInputLength = 0;
  2802. tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
  2803. for (i = 0; i < tokens.length; i++) {
  2804. token = tokens[i];
  2805. parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
  2806. // console.log('token', token, 'parsedInput', parsedInput,
  2807. // 'regex', getParseRegexForToken(token, config));
  2808. if (parsedInput) {
  2809. skipped = string.substr(0, string.indexOf(parsedInput));
  2810. if (skipped.length > 0) {
  2811. getParsingFlags(config).unusedInput.push(skipped);
  2812. }
  2813. string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
  2814. totalParsedInputLength += parsedInput.length;
  2815. }
  2816. // don't parse if it's not a known token
  2817. if (formatTokenFunctions[token]) {
  2818. if (parsedInput) {
  2819. getParsingFlags(config).empty = false;
  2820. }
  2821. else {
  2822. getParsingFlags(config).unusedTokens.push(token);
  2823. }
  2824. addTimeToArrayFromToken(token, parsedInput, config);
  2825. }
  2826. else if (config._strict && !parsedInput) {
  2827. getParsingFlags(config).unusedTokens.push(token);
  2828. }
  2829. }
  2830. // add remaining unparsed input length to the string
  2831. getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
  2832. if (string.length > 0) {
  2833. getParsingFlags(config).unusedInput.push(string);
  2834. }
  2835. // clear _12h flag if hour is <= 12
  2836. if (config._a[HOUR] <= 12 &&
  2837. getParsingFlags(config).bigHour === true &&
  2838. config._a[HOUR] > 0) {
  2839. getParsingFlags(config).bigHour = undefined;
  2840. }
  2841. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  2842. getParsingFlags(config).meridiem = config._meridiem;
  2843. // handle meridiem
  2844. config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
  2845. configFromArray(config);
  2846. checkOverflow(config);
  2847. }
  2848. function meridiemFixWrap (locale, hour, meridiem) {
  2849. var isPm;
  2850. if (meridiem == null) {
  2851. // nothing to do
  2852. return hour;
  2853. }
  2854. if (locale.meridiemHour != null) {
  2855. return locale.meridiemHour(hour, meridiem);
  2856. } else if (locale.isPM != null) {
  2857. // Fallback
  2858. isPm = locale.isPM(meridiem);
  2859. if (isPm && hour < 12) {
  2860. hour += 12;
  2861. }
  2862. if (!isPm && hour === 12) {
  2863. hour = 0;
  2864. }
  2865. return hour;
  2866. } else {
  2867. // this is not supposed to happen
  2868. return hour;
  2869. }
  2870. }
  2871. // date from string and array of format strings
  2872. function configFromStringAndArray(config) {
  2873. var tempConfig,
  2874. bestMoment,
  2875. scoreToBeat,
  2876. i,
  2877. currentScore;
  2878. if (config._f.length === 0) {
  2879. getParsingFlags(config).invalidFormat = true;
  2880. config._d = new Date(NaN);
  2881. return;
  2882. }
  2883. for (i = 0; i < config._f.length; i++) {
  2884. currentScore = 0;
  2885. tempConfig = copyConfig({}, config);
  2886. if (config._useUTC != null) {
  2887. tempConfig._useUTC = config._useUTC;
  2888. }
  2889. tempConfig._f = config._f[i];
  2890. configFromStringAndFormat(tempConfig);
  2891. if (!valid__isValid(tempConfig)) {
  2892. continue;
  2893. }
  2894. // if there is any input that was not parsed add a penalty for that format
  2895. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  2896. //or tokens
  2897. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  2898. getParsingFlags(tempConfig).score = currentScore;
  2899. if (scoreToBeat == null || currentScore < scoreToBeat) {
  2900. scoreToBeat = currentScore;
  2901. bestMoment = tempConfig;
  2902. }
  2903. }
  2904. extend(config, bestMoment || tempConfig);
  2905. }
  2906. function configFromObject(config) {
  2907. if (config._d) {
  2908. return;
  2909. }
  2910. var i = normalizeObjectUnits(config._i);
  2911. config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
  2912. return obj && parseInt(obj, 10);
  2913. });
  2914. configFromArray(config);
  2915. }
  2916. function createFromConfig (config) {
  2917. var res = new Moment(checkOverflow(prepareConfig(config)));
  2918. if (res._nextDay) {
  2919. // Adding is smart enough around DST
  2920. res.add(1, 'd');
  2921. res._nextDay = undefined;
  2922. }
  2923. return res;
  2924. }
  2925. function prepareConfig (config) {
  2926. var input = config._i,
  2927. format = config._f;
  2928. config._locale = config._locale || locale_locales__getLocale(config._l);
  2929. if (input === null || (format === undefined && input === '')) {
  2930. return valid__createInvalid({nullInput: true});
  2931. }
  2932. if (typeof input === 'string') {
  2933. config._i = input = config._locale.preparse(input);
  2934. }
  2935. if (isMoment(input)) {
  2936. return new Moment(checkOverflow(input));
  2937. } else if (isArray(format)) {
  2938. configFromStringAndArray(config);
  2939. } else if (isDate(input)) {
  2940. config._d = input;
  2941. } else if (format) {
  2942. configFromStringAndFormat(config);
  2943. } else {
  2944. configFromInput(config);
  2945. }
  2946. if (!valid__isValid(config)) {
  2947. config._d = null;
  2948. }
  2949. return config;
  2950. }
  2951. function configFromInput(config) {
  2952. var input = config._i;
  2953. if (input === undefined) {
  2954. config._d = new Date(utils_hooks__hooks.now());
  2955. } else if (isDate(input)) {
  2956. config._d = new Date(input.valueOf());
  2957. } else if (typeof input === 'string') {
  2958. configFromString(config);
  2959. } else if (isArray(input)) {
  2960. config._a = map(input.slice(0), function (obj) {
  2961. return parseInt(obj, 10);
  2962. });
  2963. configFromArray(config);
  2964. } else if (typeof(input) === 'object') {
  2965. configFromObject(config);
  2966. } else if (typeof(input) === 'number') {
  2967. // from milliseconds
  2968. config._d = new Date(input);
  2969. } else {
  2970. utils_hooks__hooks.createFromInputFallback(config);
  2971. }
  2972. }
  2973. function createLocalOrUTC (input, format, locale, strict, isUTC) {
  2974. var c = {};
  2975. if (typeof(locale) === 'boolean') {
  2976. strict = locale;
  2977. locale = undefined;
  2978. }
  2979. if ((isObject(input) && isObjectEmpty(input)) ||
  2980. (isArray(input) && input.length === 0)) {
  2981. input = undefined;
  2982. }
  2983. // object construction must be done this way.
  2984. // https://github.com/moment/moment/issues/1423
  2985. c._isAMomentObject = true;
  2986. c._useUTC = c._isUTC = isUTC;
  2987. c._l = locale;
  2988. c._i = input;
  2989. c._f = format;
  2990. c._strict = strict;
  2991. return createFromConfig(c);
  2992. }
  2993. function local__createLocal (input, format, locale, strict) {
  2994. return createLocalOrUTC(input, format, locale, strict, false);
  2995. }
  2996. var prototypeMin = deprecate(
  2997. 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
  2998. function () {
  2999. var other = local__createLocal.apply(null, arguments);
  3000. if (this.isValid() && other.isValid()) {
  3001. return other < this ? this : other;
  3002. } else {
  3003. return valid__createInvalid();
  3004. }
  3005. }
  3006. );
  3007. var prototypeMax = deprecate(
  3008. 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
  3009. function () {
  3010. var other = local__createLocal.apply(null, arguments);
  3011. if (this.isValid() && other.isValid()) {
  3012. return other > this ? this : other;
  3013. } else {
  3014. return valid__createInvalid();
  3015. }
  3016. }
  3017. );
  3018. // Pick a moment m from moments so that m[fn](other) is true for all
  3019. // other. This relies on the function fn to be transitive.
  3020. //
  3021. // moments should either be an array of moment objects or an array, whose
  3022. // first element is an array of moment objects.
  3023. function pickBy(fn, moments) {
  3024. var res, i;
  3025. if (moments.length === 1 && isArray(moments[0])) {
  3026. moments = moments[0];
  3027. }
  3028. if (!moments.length) {
  3029. return local__createLocal();
  3030. }
  3031. res = moments[0];
  3032. for (i = 1; i < moments.length; ++i) {
  3033. if (!moments[i].isValid() || moments[i][fn](res)) {
  3034. res = moments[i];
  3035. }
  3036. }
  3037. return res;
  3038. }
  3039. // TODO: Use [].sort instead?
  3040. function min () {
  3041. var args = [].slice.call(arguments, 0);
  3042. return pickBy('isBefore', args);
  3043. }
  3044. function max () {
  3045. var args = [].slice.call(arguments, 0);
  3046. return pickBy('isAfter', args);
  3047. }
  3048. var now = function () {
  3049. return Date.now ? Date.now() : +(new Date());
  3050. };
  3051. function Duration (duration) {
  3052. var normalizedInput = normalizeObjectUnits(duration),
  3053. years = normalizedInput.year || 0,
  3054. quarters = normalizedInput.quarter || 0,
  3055. months = normalizedInput.month || 0,
  3056. weeks = normalizedInput.week || 0,
  3057. days = normalizedInput.day || 0,
  3058. hours = normalizedInput.hour || 0,
  3059. minutes = normalizedInput.minute || 0,
  3060. seconds = normalizedInput.second || 0,
  3061. milliseconds = normalizedInput.millisecond || 0;
  3062. // representation for dateAddRemove
  3063. this._milliseconds = +milliseconds +
  3064. seconds * 1e3 + // 1000
  3065. minutes * 6e4 + // 1000 * 60
  3066. hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  3067. // Because of dateAddRemove treats 24 hours as different from a
  3068. // day when working around DST, we need to store them separately
  3069. this._days = +days +
  3070. weeks * 7;
  3071. // It is impossible translate months into days without knowing
  3072. // which months you are are talking about, so we have to store
  3073. // it separately.
  3074. this._months = +months +
  3075. quarters * 3 +
  3076. years * 12;
  3077. this._data = {};
  3078. this._locale = locale_locales__getLocale();
  3079. this._bubble();
  3080. }
  3081. function isDuration (obj) {
  3082. return obj instanceof Duration;
  3083. }
  3084. function absRound (number) {
  3085. if (number < 0) {
  3086. return Math.round(-1 * number) * -1;
  3087. } else {
  3088. return Math.round(number);
  3089. }
  3090. }
  3091. // FORMATTING
  3092. function offset (token, separator) {
  3093. addFormatToken(token, 0, 0, function () {
  3094. var offset = this.utcOffset();
  3095. var sign = '+';
  3096. if (offset < 0) {
  3097. offset = -offset;
  3098. sign = '-';
  3099. }
  3100. return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
  3101. });
  3102. }
  3103. offset('Z', ':');
  3104. offset('ZZ', '');
  3105. // PARSING
  3106. addRegexToken('Z', matchShortOffset);
  3107. addRegexToken('ZZ', matchShortOffset);
  3108. addParseToken(['Z', 'ZZ'], function (input, array, config) {
  3109. config._useUTC = true;
  3110. config._tzm = offsetFromString(matchShortOffset, input);
  3111. });
  3112. // HELPERS
  3113. // timezone chunker
  3114. // '+10:00' > ['10', '00']
  3115. // '-1530' > ['-15', '30']
  3116. var chunkOffset = /([\+\-]|\d\d)/gi;
  3117. function offsetFromString(matcher, string) {
  3118. var matches = ((string || '').match(matcher) || []);
  3119. var chunk = matches[matches.length - 1] || [];
  3120. var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
  3121. var minutes = +(parts[1] * 60) + toInt(parts[2]);
  3122. return parts[0] === '+' ? minutes : -minutes;
  3123. }
  3124. // Return a moment from input, that is local/utc/zone equivalent to model.
  3125. function cloneWithOffset(input, model) {
  3126. var res, diff;
  3127. if (model._isUTC) {
  3128. res = model.clone();
  3129. diff = (isMoment(input) || isDate(input) ? input.valueOf() : local__createLocal(input).valueOf()) - res.valueOf();
  3130. // Use low-level api, because this fn is low-level api.
  3131. res._d.setTime(res._d.valueOf() + diff);
  3132. utils_hooks__hooks.updateOffset(res, false);
  3133. return res;
  3134. } else {
  3135. return local__createLocal(input).local();
  3136. }
  3137. }
  3138. function getDateOffset (m) {
  3139. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  3140. // https://github.com/moment/moment/pull/1871
  3141. return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
  3142. }
  3143. // HOOKS
  3144. // This function will be called whenever a moment is mutated.
  3145. // It is intended to keep the offset in sync with the timezone.
  3146. utils_hooks__hooks.updateOffset = function () {};
  3147. // MOMENTS
  3148. // keepLocalTime = true means only change the timezone, without
  3149. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  3150. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  3151. // +0200, so we adjust the time as needed, to be valid.
  3152. //
  3153. // Keeping the time actually adds/subtracts (one hour)
  3154. // from the actual represented time. That is why we call updateOffset
  3155. // a second time. In case it wants us to change the offset again
  3156. // _changeInProgress == true case, then we have to adjust, because
  3157. // there is no such time in the given timezone.
  3158. function getSetOffset (input, keepLocalTime) {
  3159. var offset = this._offset || 0,
  3160. localAdjust;
  3161. if (!this.isValid()) {
  3162. return input != null ? this : NaN;
  3163. }
  3164. if (input != null) {
  3165. if (typeof input === 'string') {
  3166. input = offsetFromString(matchShortOffset, input);
  3167. } else if (Math.abs(input) < 16) {
  3168. input = input * 60;
  3169. }
  3170. if (!this._isUTC && keepLocalTime) {
  3171. localAdjust = getDateOffset(this);
  3172. }
  3173. this._offset = input;
  3174. this._isUTC = true;
  3175. if (localAdjust != null) {
  3176. this.add(localAdjust, 'm');
  3177. }
  3178. if (offset !== input) {
  3179. if (!keepLocalTime || this._changeInProgress) {
  3180. add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);
  3181. } else if (!this._changeInProgress) {
  3182. this._changeInProgress = true;
  3183. utils_hooks__hooks.updateOffset(this, true);
  3184. this._changeInProgress = null;
  3185. }
  3186. }
  3187. return this;
  3188. } else {
  3189. return this._isUTC ? offset : getDateOffset(this);
  3190. }
  3191. }
  3192. function getSetZone (input, keepLocalTime) {
  3193. if (input != null) {
  3194. if (typeof input !== 'string') {
  3195. input = -input;
  3196. }
  3197. this.utcOffset(input, keepLocalTime);
  3198. return this;
  3199. } else {
  3200. return -this.utcOffset();
  3201. }
  3202. }
  3203. function setOffsetToUTC (keepLocalTime) {
  3204. return this.utcOffset(0, keepLocalTime);
  3205. }
  3206. function setOffsetToLocal (keepLocalTime) {
  3207. if (this._isUTC) {
  3208. this.utcOffset(0, keepLocalTime);
  3209. this._isUTC = false;
  3210. if (keepLocalTime) {
  3211. this.subtract(getDateOffset(this), 'm');
  3212. }
  3213. }
  3214. return this;
  3215. }
  3216. function setOffsetToParsedOffset () {
  3217. if (this._tzm) {
  3218. this.utcOffset(this._tzm);
  3219. } else if (typeof this._i === 'string') {
  3220. var tZone = offsetFromString(matchOffset, this._i);
  3221. if (tZone === 0) {
  3222. this.utcOffset(0, true);
  3223. } else {
  3224. this.utcOffset(offsetFromString(matchOffset, this._i));
  3225. }
  3226. }
  3227. return this;
  3228. }
  3229. function hasAlignedHourOffset (input) {
  3230. if (!this.isValid()) {
  3231. return false;
  3232. }
  3233. input = input ? local__createLocal(input).utcOffset() : 0;
  3234. return (this.utcOffset() - input) % 60 === 0;
  3235. }
  3236. function isDaylightSavingTime () {
  3237. return (
  3238. this.utcOffset() > this.clone().month(0).utcOffset() ||
  3239. this.utcOffset() > this.clone().month(5).utcOffset()
  3240. );
  3241. }
  3242. function isDaylightSavingTimeShifted () {
  3243. if (!isUndefined(this._isDSTShifted)) {
  3244. return this._isDSTShifted;
  3245. }
  3246. var c = {};
  3247. copyConfig(c, this);
  3248. c = prepareConfig(c);
  3249. if (c._a) {
  3250. var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a);
  3251. this._isDSTShifted = this.isValid() &&
  3252. compareArrays(c._a, other.toArray()) > 0;
  3253. } else {
  3254. this._isDSTShifted = false;
  3255. }
  3256. return this._isDSTShifted;
  3257. }
  3258. function isLocal () {
  3259. return this.isValid() ? !this._isUTC : false;
  3260. }
  3261. function isUtcOffset () {
  3262. return this.isValid() ? this._isUTC : false;
  3263. }
  3264. function isUtc () {
  3265. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  3266. }
  3267. // ASP.NET json date format regex
  3268. var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
  3269. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  3270. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  3271. // and further modified to allow for strings containing both week and day
  3272. var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;
  3273. function create__createDuration (input, key) {
  3274. var duration = input,
  3275. // matching against regexp is expensive, do it on demand
  3276. match = null,
  3277. sign,
  3278. ret,
  3279. diffRes;
  3280. if (isDuration(input)) {
  3281. duration = {
  3282. ms : input._milliseconds,
  3283. d : input._days,
  3284. M : input._months
  3285. };
  3286. } else if (typeof input === 'number') {
  3287. duration = {};
  3288. if (key) {
  3289. duration[key] = input;
  3290. } else {
  3291. duration.milliseconds = input;
  3292. }
  3293. } else if (!!(match = aspNetRegex.exec(input))) {
  3294. sign = (match[1] === '-') ? -1 : 1;
  3295. duration = {
  3296. y : 0,
  3297. d : toInt(match[DATE]) * sign,
  3298. h : toInt(match[HOUR]) * sign,
  3299. m : toInt(match[MINUTE]) * sign,
  3300. s : toInt(match[SECOND]) * sign,
  3301. ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
  3302. };
  3303. } else if (!!(match = isoRegex.exec(input))) {
  3304. sign = (match[1] === '-') ? -1 : 1;
  3305. duration = {
  3306. y : parseIso(match[2], sign),
  3307. M : parseIso(match[3], sign),
  3308. w : parseIso(match[4], sign),
  3309. d : parseIso(match[5], sign),
  3310. h : parseIso(match[6], sign),
  3311. m : parseIso(match[7], sign),
  3312. s : parseIso(match[8], sign)
  3313. };
  3314. } else if (duration == null) {// checks for null or undefined
  3315. duration = {};
  3316. } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
  3317. diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to));
  3318. duration = {};
  3319. duration.ms = diffRes.milliseconds;
  3320. duration.M = diffRes.months;
  3321. }
  3322. ret = new Duration(duration);
  3323. if (isDuration(input) && hasOwnProp(input, '_locale')) {
  3324. ret._locale = input._locale;
  3325. }
  3326. return ret;
  3327. }
  3328. create__createDuration.fn = Duration.prototype;
  3329. function parseIso (inp, sign) {
  3330. // We'd normally use ~~inp for this, but unfortunately it also
  3331. // converts floats to ints.
  3332. // inp may be undefined, so careful calling replace on it.
  3333. var res = inp && parseFloat(inp.replace(',', '.'));
  3334. // apply sign while we're at it
  3335. return (isNaN(res) ? 0 : res) * sign;
  3336. }
  3337. function positiveMomentsDifference(base, other) {
  3338. var res = {milliseconds: 0, months: 0};
  3339. res.months = other.month() - base.month() +
  3340. (other.year() - base.year()) * 12;
  3341. if (base.clone().add(res.months, 'M').isAfter(other)) {
  3342. --res.months;
  3343. }
  3344. res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
  3345. return res;
  3346. }
  3347. function momentsDifference(base, other) {
  3348. var res;
  3349. if (!(base.isValid() && other.isValid())) {
  3350. return {milliseconds: 0, months: 0};
  3351. }
  3352. other = cloneWithOffset(other, base);
  3353. if (base.isBefore(other)) {
  3354. res = positiveMomentsDifference(base, other);
  3355. } else {
  3356. res = positiveMomentsDifference(other, base);
  3357. res.milliseconds = -res.milliseconds;
  3358. res.months = -res.months;
  3359. }
  3360. return res;
  3361. }
  3362. // TODO: remove 'name' arg after deprecation is removed
  3363. function createAdder(direction, name) {
  3364. return function (val, period) {
  3365. var dur, tmp;
  3366. //invert the arguments, but complain about it
  3367. if (period !== null && !isNaN(+period)) {
  3368. deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
  3369. 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
  3370. tmp = val; val = period; period = tmp;
  3371. }
  3372. val = typeof val === 'string' ? +val : val;
  3373. dur = create__createDuration(val, period);
  3374. add_subtract__addSubtract(this, dur, direction);
  3375. return this;
  3376. };
  3377. }
  3378. function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) {
  3379. var milliseconds = duration._milliseconds,
  3380. days = absRound(duration._days),
  3381. months = absRound(duration._months);
  3382. if (!mom.isValid()) {
  3383. // No op
  3384. return;
  3385. }
  3386. updateOffset = updateOffset == null ? true : updateOffset;
  3387. if (milliseconds) {
  3388. mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
  3389. }
  3390. if (days) {
  3391. get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding);
  3392. }
  3393. if (months) {
  3394. setMonth(mom, get_set__get(mom, 'Month') + months * isAdding);
  3395. }
  3396. if (updateOffset) {
  3397. utils_hooks__hooks.updateOffset(mom, days || months);
  3398. }
  3399. }
  3400. var add_subtract__add = createAdder(1, 'add');
  3401. var add_subtract__subtract = createAdder(-1, 'subtract');
  3402. function getCalendarFormat(myMoment, now) {
  3403. var diff = myMoment.diff(now, 'days', true);
  3404. return diff < -6 ? 'sameElse' :
  3405. diff < -1 ? 'lastWeek' :
  3406. diff < 0 ? 'lastDay' :
  3407. diff < 1 ? 'sameDay' :
  3408. diff < 2 ? 'nextDay' :
  3409. diff < 7 ? 'nextWeek' : 'sameElse';
  3410. }
  3411. function moment_calendar__calendar (time, formats) {
  3412. // We want to compare the start of today, vs this.
  3413. // Getting start-of-today depends on whether we're local/utc/offset or not.
  3414. var now = time || local__createLocal(),
  3415. sod = cloneWithOffset(now, this).startOf('day'),
  3416. format = utils_hooks__hooks.calendarFormat(this, sod) || 'sameElse';
  3417. var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
  3418. return this.format(output || this.localeData().calendar(format, this, local__createLocal(now)));
  3419. }
  3420. function clone () {
  3421. return new Moment(this);
  3422. }
  3423. function isAfter (input, units) {
  3424. var localInput = isMoment(input) ? input : local__createLocal(input);
  3425. if (!(this.isValid() && localInput.isValid())) {
  3426. return false;
  3427. }
  3428. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  3429. if (units === 'millisecond') {
  3430. return this.valueOf() > localInput.valueOf();
  3431. } else {
  3432. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  3433. }
  3434. }
  3435. function isBefore (input, units) {
  3436. var localInput = isMoment(input) ? input : local__createLocal(input);
  3437. if (!(this.isValid() && localInput.isValid())) {
  3438. return false;
  3439. }
  3440. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  3441. if (units === 'millisecond') {
  3442. return this.valueOf() < localInput.valueOf();
  3443. } else {
  3444. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  3445. }
  3446. }
  3447. function isBetween (from, to, units, inclusivity) {
  3448. inclusivity = inclusivity || '()';
  3449. return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&
  3450. (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
  3451. }
  3452. function isSame (input, units) {
  3453. var localInput = isMoment(input) ? input : local__createLocal(input),
  3454. inputMs;
  3455. if (!(this.isValid() && localInput.isValid())) {
  3456. return false;
  3457. }
  3458. units = normalizeUnits(units || 'millisecond');
  3459. if (units === 'millisecond') {
  3460. return this.valueOf() === localInput.valueOf();
  3461. } else {
  3462. inputMs = localInput.valueOf();
  3463. return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
  3464. }
  3465. }
  3466. function isSameOrAfter (input, units) {
  3467. return this.isSame(input, units) || this.isAfter(input,units);
  3468. }
  3469. function isSameOrBefore (input, units) {
  3470. return this.isSame(input, units) || this.isBefore(input,units);
  3471. }
  3472. function diff (input, units, asFloat) {
  3473. var that,
  3474. zoneDelta,
  3475. delta, output;
  3476. if (!this.isValid()) {
  3477. return NaN;
  3478. }
  3479. that = cloneWithOffset(input, this);
  3480. if (!that.isValid()) {
  3481. return NaN;
  3482. }
  3483. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  3484. units = normalizeUnits(units);
  3485. if (units === 'year' || units === 'month' || units === 'quarter') {
  3486. output = monthDiff(this, that);
  3487. if (units === 'quarter') {
  3488. output = output / 3;
  3489. } else if (units === 'year') {
  3490. output = output / 12;
  3491. }
  3492. } else {
  3493. delta = this - that;
  3494. output = units === 'second' ? delta / 1e3 : // 1000
  3495. units === 'minute' ? delta / 6e4 : // 1000 * 60
  3496. units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
  3497. units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
  3498. units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
  3499. delta;
  3500. }
  3501. return asFloat ? output : absFloor(output);
  3502. }
  3503. function monthDiff (a, b) {
  3504. // difference in months
  3505. var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
  3506. // b is in (anchor - 1 month, anchor + 1 month)
  3507. anchor = a.clone().add(wholeMonthDiff, 'months'),
  3508. anchor2, adjust;
  3509. if (b - anchor < 0) {
  3510. anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
  3511. // linear across the month
  3512. adjust = (b - anchor) / (anchor - anchor2);
  3513. } else {
  3514. anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
  3515. // linear across the month
  3516. adjust = (b - anchor) / (anchor2 - anchor);
  3517. }
  3518. //check for negative zero, return zero if negative zero
  3519. return -(wholeMonthDiff + adjust) || 0;
  3520. }
  3521. utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  3522. utils_hooks__hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  3523. function toString () {
  3524. return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  3525. }
  3526. function moment_format__toISOString () {
  3527. var m = this.clone().utc();
  3528. if (0 < m.year() && m.year() <= 9999) {
  3529. if (isFunction(Date.prototype.toISOString)) {
  3530. // native implementation is ~50x faster, use it when we can
  3531. return this.toDate().toISOString();
  3532. } else {
  3533. return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  3534. }
  3535. } else {
  3536. return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  3537. }
  3538. }
  3539. function format (inputString) {
  3540. if (!inputString) {
  3541. inputString = this.isUtc() ? utils_hooks__hooks.defaultFormatUtc : utils_hooks__hooks.defaultFormat;
  3542. }
  3543. var output = formatMoment(this, inputString);
  3544. return this.localeData().postformat(output);
  3545. }
  3546. function from (time, withoutSuffix) {
  3547. if (this.isValid() &&
  3548. ((isMoment(time) && time.isValid()) ||
  3549. local__createLocal(time).isValid())) {
  3550. return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
  3551. } else {
  3552. return this.localeData().invalidDate();
  3553. }
  3554. }
  3555. function fromNow (withoutSuffix) {
  3556. return this.from(local__createLocal(), withoutSuffix);
  3557. }
  3558. function to (time, withoutSuffix) {
  3559. if (this.isValid() &&
  3560. ((isMoment(time) && time.isValid()) ||
  3561. local__createLocal(time).isValid())) {
  3562. return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
  3563. } else {
  3564. return this.localeData().invalidDate();
  3565. }
  3566. }
  3567. function toNow (withoutSuffix) {
  3568. return this.to(local__createLocal(), withoutSuffix);
  3569. }
  3570. // If passed a locale key, it will set the locale for this
  3571. // instance. Otherwise, it will return the locale configuration
  3572. // variables for this instance.
  3573. function locale (key) {
  3574. var newLocaleData;
  3575. if (key === undefined) {
  3576. return this._locale._abbr;
  3577. } else {
  3578. newLocaleData = locale_locales__getLocale(key);
  3579. if (newLocaleData != null) {
  3580. this._locale = newLocaleData;
  3581. }
  3582. return this;
  3583. }
  3584. }
  3585. var lang = deprecate(
  3586. 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
  3587. function (key) {
  3588. if (key === undefined) {
  3589. return this.localeData();
  3590. } else {
  3591. return this.locale(key);
  3592. }
  3593. }
  3594. );
  3595. function localeData () {
  3596. return this._locale;
  3597. }
  3598. function startOf (units) {
  3599. units = normalizeUnits(units);
  3600. // the following switch intentionally omits break keywords
  3601. // to utilize falling through the cases.
  3602. switch (units) {
  3603. case 'year':
  3604. this.month(0);
  3605. /* falls through */
  3606. case 'quarter':
  3607. case 'month':
  3608. this.date(1);
  3609. /* falls through */
  3610. case 'week':
  3611. case 'isoWeek':
  3612. case 'day':
  3613. case 'date':
  3614. this.hours(0);
  3615. /* falls through */
  3616. case 'hour':
  3617. this.minutes(0);
  3618. /* falls through */
  3619. case 'minute':
  3620. this.seconds(0);
  3621. /* falls through */
  3622. case 'second':
  3623. this.milliseconds(0);
  3624. }
  3625. // weeks are a special case
  3626. if (units === 'week') {
  3627. this.weekday(0);
  3628. }
  3629. if (units === 'isoWeek') {
  3630. this.isoWeekday(1);
  3631. }
  3632. // quarters are also special
  3633. if (units === 'quarter') {
  3634. this.month(Math.floor(this.month() / 3) * 3);
  3635. }
  3636. return this;
  3637. }
  3638. function endOf (units) {
  3639. units = normalizeUnits(units);
  3640. if (units === undefined || units === 'millisecond') {
  3641. return this;
  3642. }
  3643. // 'date' is an alias for 'day', so it should be considered as such.
  3644. if (units === 'date') {
  3645. units = 'day';
  3646. }
  3647. return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
  3648. }
  3649. function to_type__valueOf () {
  3650. return this._d.valueOf() - ((this._offset || 0) * 60000);
  3651. }
  3652. function unix () {
  3653. return Math.floor(this.valueOf() / 1000);
  3654. }
  3655. function toDate () {
  3656. return new Date(this.valueOf());
  3657. }
  3658. function toArray () {
  3659. var m = this;
  3660. return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
  3661. }
  3662. function toObject () {
  3663. var m = this;
  3664. return {
  3665. years: m.year(),
  3666. months: m.month(),
  3667. date: m.date(),
  3668. hours: m.hours(),
  3669. minutes: m.minutes(),
  3670. seconds: m.seconds(),
  3671. milliseconds: m.milliseconds()
  3672. };
  3673. }
  3674. function toJSON () {
  3675. // new Date(NaN).toJSON() === null
  3676. return this.isValid() ? this.toISOString() : null;
  3677. }
  3678. function moment_valid__isValid () {
  3679. return valid__isValid(this);
  3680. }
  3681. function parsingFlags () {
  3682. return extend({}, getParsingFlags(this));
  3683. }
  3684. function invalidAt () {
  3685. return getParsingFlags(this).overflow;
  3686. }
  3687. function creationData() {
  3688. return {
  3689. input: this._i,
  3690. format: this._f,
  3691. locale: this._locale,
  3692. isUTC: this._isUTC,
  3693. strict: this._strict
  3694. };
  3695. }
  3696. // FORMATTING
  3697. addFormatToken(0, ['gg', 2], 0, function () {
  3698. return this.weekYear() % 100;
  3699. });
  3700. addFormatToken(0, ['GG', 2], 0, function () {
  3701. return this.isoWeekYear() % 100;
  3702. });
  3703. function addWeekYearFormatToken (token, getter) {
  3704. addFormatToken(0, [token, token.length], 0, getter);
  3705. }
  3706. addWeekYearFormatToken('gggg', 'weekYear');
  3707. addWeekYearFormatToken('ggggg', 'weekYear');
  3708. addWeekYearFormatToken('GGGG', 'isoWeekYear');
  3709. addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  3710. // ALIASES
  3711. addUnitAlias('weekYear', 'gg');
  3712. addUnitAlias('isoWeekYear', 'GG');
  3713. // PRIORITY
  3714. addUnitPriority('weekYear', 1);
  3715. addUnitPriority('isoWeekYear', 1);
  3716. // PARSING
  3717. addRegexToken('G', matchSigned);
  3718. addRegexToken('g', matchSigned);
  3719. addRegexToken('GG', match1to2, match2);
  3720. addRegexToken('gg', match1to2, match2);
  3721. addRegexToken('GGGG', match1to4, match4);
  3722. addRegexToken('gggg', match1to4, match4);
  3723. addRegexToken('GGGGG', match1to6, match6);
  3724. addRegexToken('ggggg', match1to6, match6);
  3725. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
  3726. week[token.substr(0, 2)] = toInt(input);
  3727. });
  3728. addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  3729. week[token] = utils_hooks__hooks.parseTwoDigitYear(input);
  3730. });
  3731. // MOMENTS
  3732. function getSetWeekYear (input) {
  3733. return getSetWeekYearHelper.call(this,
  3734. input,
  3735. this.week(),
  3736. this.weekday(),
  3737. this.localeData()._week.dow,
  3738. this.localeData()._week.doy);
  3739. }
  3740. function getSetISOWeekYear (input) {
  3741. return getSetWeekYearHelper.call(this,
  3742. input, this.isoWeek(), this.isoWeekday(), 1, 4);
  3743. }
  3744. function getISOWeeksInYear () {
  3745. return weeksInYear(this.year(), 1, 4);
  3746. }
  3747. function getWeeksInYear () {
  3748. var weekInfo = this.localeData()._week;
  3749. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  3750. }
  3751. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  3752. var weeksTarget;
  3753. if (input == null) {
  3754. return weekOfYear(this, dow, doy).year;
  3755. } else {
  3756. weeksTarget = weeksInYear(input, dow, doy);
  3757. if (week > weeksTarget) {
  3758. week = weeksTarget;
  3759. }
  3760. return setWeekAll.call(this, input, week, weekday, dow, doy);
  3761. }
  3762. }
  3763. function setWeekAll(weekYear, week, weekday, dow, doy) {
  3764. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
  3765. date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  3766. this.year(date.getUTCFullYear());
  3767. this.month(date.getUTCMonth());
  3768. this.date(date.getUTCDate());
  3769. return this;
  3770. }
  3771. // FORMATTING
  3772. addFormatToken('Q', 0, 'Qo', 'quarter');
  3773. // ALIASES
  3774. addUnitAlias('quarter', 'Q');
  3775. // PRIORITY
  3776. addUnitPriority('quarter', 7);
  3777. // PARSING
  3778. addRegexToken('Q', match1);
  3779. addParseToken('Q', function (input, array) {
  3780. array[MONTH] = (toInt(input) - 1) * 3;
  3781. });
  3782. // MOMENTS
  3783. function getSetQuarter (input) {
  3784. return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
  3785. }
  3786. // FORMATTING
  3787. addFormatToken('D', ['DD', 2], 'Do', 'date');
  3788. // ALIASES
  3789. addUnitAlias('date', 'D');
  3790. // PRIOROITY
  3791. addUnitPriority('date', 9);
  3792. // PARSING
  3793. addRegexToken('D', match1to2);
  3794. addRegexToken('DD', match1to2, match2);
  3795. addRegexToken('Do', function (isStrict, locale) {
  3796. return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
  3797. });
  3798. addParseToken(['D', 'DD'], DATE);
  3799. addParseToken('Do', function (input, array) {
  3800. array[DATE] = toInt(input.match(match1to2)[0], 10);
  3801. });
  3802. // MOMENTS
  3803. var getSetDayOfMonth = makeGetSet('Date', true);
  3804. // FORMATTING
  3805. addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  3806. // ALIASES
  3807. addUnitAlias('dayOfYear', 'DDD');
  3808. // PRIORITY
  3809. addUnitPriority('dayOfYear', 4);
  3810. // PARSING
  3811. addRegexToken('DDD', match1to3);
  3812. addRegexToken('DDDD', match3);
  3813. addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  3814. config._dayOfYear = toInt(input);
  3815. });
  3816. // HELPERS
  3817. // MOMENTS
  3818. function getSetDayOfYear (input) {
  3819. var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
  3820. return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
  3821. }
  3822. // FORMATTING
  3823. addFormatToken('m', ['mm', 2], 0, 'minute');
  3824. // ALIASES
  3825. addUnitAlias('minute', 'm');
  3826. // PRIORITY
  3827. addUnitPriority('minute', 14);
  3828. // PARSING
  3829. addRegexToken('m', match1to2);
  3830. addRegexToken('mm', match1to2, match2);
  3831. addParseToken(['m', 'mm'], MINUTE);
  3832. // MOMENTS
  3833. var getSetMinute = makeGetSet('Minutes', false);
  3834. // FORMATTING
  3835. addFormatToken('s', ['ss', 2], 0, 'second');
  3836. // ALIASES
  3837. addUnitAlias('second', 's');
  3838. // PRIORITY
  3839. addUnitPriority('second', 15);
  3840. // PARSING
  3841. addRegexToken('s', match1to2);
  3842. addRegexToken('ss', match1to2, match2);
  3843. addParseToken(['s', 'ss'], SECOND);
  3844. // MOMENTS
  3845. var getSetSecond = makeGetSet('Seconds', false);
  3846. // FORMATTING
  3847. addFormatToken('S', 0, 0, function () {
  3848. return ~~(this.millisecond() / 100);
  3849. });
  3850. addFormatToken(0, ['SS', 2], 0, function () {
  3851. return ~~(this.millisecond() / 10);
  3852. });
  3853. addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  3854. addFormatToken(0, ['SSSS', 4], 0, function () {
  3855. return this.millisecond() * 10;
  3856. });
  3857. addFormatToken(0, ['SSSSS', 5], 0, function () {
  3858. return this.millisecond() * 100;
  3859. });
  3860. addFormatToken(0, ['SSSSSS', 6], 0, function () {
  3861. return this.millisecond() * 1000;
  3862. });
  3863. addFormatToken(0, ['SSSSSSS', 7], 0, function () {
  3864. return this.millisecond() * 10000;
  3865. });
  3866. addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
  3867. return this.millisecond() * 100000;
  3868. });
  3869. addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  3870. return this.millisecond() * 1000000;
  3871. });
  3872. // ALIASES
  3873. addUnitAlias('millisecond', 'ms');
  3874. // PRIORITY
  3875. addUnitPriority('millisecond', 16);
  3876. // PARSING
  3877. addRegexToken('S', match1to3, match1);
  3878. addRegexToken('SS', match1to3, match2);
  3879. addRegexToken('SSS', match1to3, match3);
  3880. var token;
  3881. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  3882. addRegexToken(token, matchUnsigned);
  3883. }
  3884. function parseMs(input, array) {
  3885. array[MILLISECOND] = toInt(('0.' + input) * 1000);
  3886. }
  3887. for (token = 'S'; token.length <= 9; token += 'S') {
  3888. addParseToken(token, parseMs);
  3889. }
  3890. // MOMENTS
  3891. var getSetMillisecond = makeGetSet('Milliseconds', false);
  3892. // FORMATTING
  3893. addFormatToken('z', 0, 0, 'zoneAbbr');
  3894. addFormatToken('zz', 0, 0, 'zoneName');
  3895. // MOMENTS
  3896. function getZoneAbbr () {
  3897. return this._isUTC ? 'UTC' : '';
  3898. }
  3899. function getZoneName () {
  3900. return this._isUTC ? 'Coordinated Universal Time' : '';
  3901. }
  3902. var momentPrototype__proto = Moment.prototype;
  3903. momentPrototype__proto.add = add_subtract__add;
  3904. momentPrototype__proto.calendar = moment_calendar__calendar;
  3905. momentPrototype__proto.clone = clone;
  3906. momentPrototype__proto.diff = diff;
  3907. momentPrototype__proto.endOf = endOf;
  3908. momentPrototype__proto.format = format;
  3909. momentPrototype__proto.from = from;
  3910. momentPrototype__proto.fromNow = fromNow;
  3911. momentPrototype__proto.to = to;
  3912. momentPrototype__proto.toNow = toNow;
  3913. momentPrototype__proto.get = stringGet;
  3914. momentPrototype__proto.invalidAt = invalidAt;
  3915. momentPrototype__proto.isAfter = isAfter;
  3916. momentPrototype__proto.isBefore = isBefore;
  3917. momentPrototype__proto.isBetween = isBetween;
  3918. momentPrototype__proto.isSame = isSame;
  3919. momentPrototype__proto.isSameOrAfter = isSameOrAfter;
  3920. momentPrototype__proto.isSameOrBefore = isSameOrBefore;
  3921. momentPrototype__proto.isValid = moment_valid__isValid;
  3922. momentPrototype__proto.lang = lang;
  3923. momentPrototype__proto.locale = locale;
  3924. momentPrototype__proto.localeData = localeData;
  3925. momentPrototype__proto.max = prototypeMax;
  3926. momentPrototype__proto.min = prototypeMin;
  3927. momentPrototype__proto.parsingFlags = parsingFlags;
  3928. momentPrototype__proto.set = stringSet;
  3929. momentPrototype__proto.startOf = startOf;
  3930. momentPrototype__proto.subtract = add_subtract__subtract;
  3931. momentPrototype__proto.toArray = toArray;
  3932. momentPrototype__proto.toObject = toObject;
  3933. momentPrototype__proto.toDate = toDate;
  3934. momentPrototype__proto.toISOString = moment_format__toISOString;
  3935. momentPrototype__proto.toJSON = toJSON;
  3936. momentPrototype__proto.toString = toString;
  3937. momentPrototype__proto.unix = unix;
  3938. momentPrototype__proto.valueOf = to_type__valueOf;
  3939. momentPrototype__proto.creationData = creationData;
  3940. // Year
  3941. momentPrototype__proto.year = getSetYear;
  3942. momentPrototype__proto.isLeapYear = getIsLeapYear;
  3943. // Week Year
  3944. momentPrototype__proto.weekYear = getSetWeekYear;
  3945. momentPrototype__proto.isoWeekYear = getSetISOWeekYear;
  3946. // Quarter
  3947. momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter;
  3948. // Month
  3949. momentPrototype__proto.month = getSetMonth;
  3950. momentPrototype__proto.daysInMonth = getDaysInMonth;
  3951. // Week
  3952. momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek;
  3953. momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek;
  3954. momentPrototype__proto.weeksInYear = getWeeksInYear;
  3955. momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear;
  3956. // Day
  3957. momentPrototype__proto.date = getSetDayOfMonth;
  3958. momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek;
  3959. momentPrototype__proto.weekday = getSetLocaleDayOfWeek;
  3960. momentPrototype__proto.isoWeekday = getSetISODayOfWeek;
  3961. momentPrototype__proto.dayOfYear = getSetDayOfYear;
  3962. // Hour
  3963. momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour;
  3964. // Minute
  3965. momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute;
  3966. // Second
  3967. momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond;
  3968. // Millisecond
  3969. momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond;
  3970. // Offset
  3971. momentPrototype__proto.utcOffset = getSetOffset;
  3972. momentPrototype__proto.utc = setOffsetToUTC;
  3973. momentPrototype__proto.local = setOffsetToLocal;
  3974. momentPrototype__proto.parseZone = setOffsetToParsedOffset;
  3975. momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset;
  3976. momentPrototype__proto.isDST = isDaylightSavingTime;
  3977. momentPrototype__proto.isLocal = isLocal;
  3978. momentPrototype__proto.isUtcOffset = isUtcOffset;
  3979. momentPrototype__proto.isUtc = isUtc;
  3980. momentPrototype__proto.isUTC = isUtc;
  3981. // Timezone
  3982. momentPrototype__proto.zoneAbbr = getZoneAbbr;
  3983. momentPrototype__proto.zoneName = getZoneName;
  3984. // Deprecations
  3985. momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
  3986. momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
  3987. momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
  3988. momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
  3989. momentPrototype__proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
  3990. var momentPrototype = momentPrototype__proto;
  3991. function moment__createUnix (input) {
  3992. return local__createLocal(input * 1000);
  3993. }
  3994. function moment__createInZone () {
  3995. return local__createLocal.apply(null, arguments).parseZone();
  3996. }
  3997. function preParsePostFormat (string) {
  3998. return string;
  3999. }
  4000. var prototype__proto = Locale.prototype;
  4001. prototype__proto.calendar = locale_calendar__calendar;
  4002. prototype__proto.longDateFormat = longDateFormat;
  4003. prototype__proto.invalidDate = invalidDate;
  4004. prototype__proto.ordinal = ordinal;
  4005. prototype__proto.preparse = preParsePostFormat;
  4006. prototype__proto.postformat = preParsePostFormat;
  4007. prototype__proto.relativeTime = relative__relativeTime;
  4008. prototype__proto.pastFuture = pastFuture;
  4009. prototype__proto.set = locale_set__set;
  4010. // Month
  4011. prototype__proto.months = localeMonths;
  4012. prototype__proto.monthsShort = localeMonthsShort;
  4013. prototype__proto.monthsParse = localeMonthsParse;
  4014. prototype__proto.monthsRegex = monthsRegex;
  4015. prototype__proto.monthsShortRegex = monthsShortRegex;
  4016. // Week
  4017. prototype__proto.week = localeWeek;
  4018. prototype__proto.firstDayOfYear = localeFirstDayOfYear;
  4019. prototype__proto.firstDayOfWeek = localeFirstDayOfWeek;
  4020. // Day of Week
  4021. prototype__proto.weekdays = localeWeekdays;
  4022. prototype__proto.weekdaysMin = localeWeekdaysMin;
  4023. prototype__proto.weekdaysShort = localeWeekdaysShort;
  4024. prototype__proto.weekdaysParse = localeWeekdaysParse;
  4025. prototype__proto.weekdaysRegex = weekdaysRegex;
  4026. prototype__proto.weekdaysShortRegex = weekdaysShortRegex;
  4027. prototype__proto.weekdaysMinRegex = weekdaysMinRegex;
  4028. // Hours
  4029. prototype__proto.isPM = localeIsPM;
  4030. prototype__proto.meridiem = localeMeridiem;
  4031. function lists__get (format, index, field, setter) {
  4032. var locale = locale_locales__getLocale();
  4033. var utc = create_utc__createUTC().set(setter, index);
  4034. return locale[field](utc, format);
  4035. }
  4036. function listMonthsImpl (format, index, field) {
  4037. if (typeof format === 'number') {
  4038. index = format;
  4039. format = undefined;
  4040. }
  4041. format = format || '';
  4042. if (index != null) {
  4043. return lists__get(format, index, field, 'month');
  4044. }
  4045. var i;
  4046. var out = [];
  4047. for (i = 0; i < 12; i++) {
  4048. out[i] = lists__get(format, i, field, 'month');
  4049. }
  4050. return out;
  4051. }
  4052. // ()
  4053. // (5)
  4054. // (fmt, 5)
  4055. // (fmt)
  4056. // (true)
  4057. // (true, 5)
  4058. // (true, fmt, 5)
  4059. // (true, fmt)
  4060. function listWeekdaysImpl (localeSorted, format, index, field) {
  4061. if (typeof localeSorted === 'boolean') {
  4062. if (typeof format === 'number') {
  4063. index = format;
  4064. format = undefined;
  4065. }
  4066. format = format || '';
  4067. } else {
  4068. format = localeSorted;
  4069. index = format;
  4070. localeSorted = false;
  4071. if (typeof format === 'number') {
  4072. index = format;
  4073. format = undefined;
  4074. }
  4075. format = format || '';
  4076. }
  4077. var locale = locale_locales__getLocale(),
  4078. shift = localeSorted ? locale._week.dow : 0;
  4079. if (index != null) {
  4080. return lists__get(format, (index + shift) % 7, field, 'day');
  4081. }
  4082. var i;
  4083. var out = [];
  4084. for (i = 0; i < 7; i++) {
  4085. out[i] = lists__get(format, (i + shift) % 7, field, 'day');
  4086. }
  4087. return out;
  4088. }
  4089. function lists__listMonths (format, index) {
  4090. return listMonthsImpl(format, index, 'months');
  4091. }
  4092. function lists__listMonthsShort (format, index) {
  4093. return listMonthsImpl(format, index, 'monthsShort');
  4094. }
  4095. function lists__listWeekdays (localeSorted, format, index) {
  4096. return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  4097. }
  4098. function lists__listWeekdaysShort (localeSorted, format, index) {
  4099. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  4100. }
  4101. function lists__listWeekdaysMin (localeSorted, format, index) {
  4102. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  4103. }
  4104. locale_locales__getSetGlobalLocale('en', {
  4105. ordinalParse: /\d{1,2}(th|st|nd|rd)/,
  4106. ordinal : function (number) {
  4107. var b = number % 10,
  4108. output = (toInt(number % 100 / 10) === 1) ? 'th' :
  4109. (b === 1) ? 'st' :
  4110. (b === 2) ? 'nd' :
  4111. (b === 3) ? 'rd' : 'th';
  4112. return number + output;
  4113. }
  4114. });
  4115. // Side effect imports
  4116. utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale);
  4117. utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale);
  4118. var mathAbs = Math.abs;
  4119. function duration_abs__abs () {
  4120. var data = this._data;
  4121. this._milliseconds = mathAbs(this._milliseconds);
  4122. this._days = mathAbs(this._days);
  4123. this._months = mathAbs(this._months);
  4124. data.milliseconds = mathAbs(data.milliseconds);
  4125. data.seconds = mathAbs(data.seconds);
  4126. data.minutes = mathAbs(data.minutes);
  4127. data.hours = mathAbs(data.hours);
  4128. data.months = mathAbs(data.months);
  4129. data.years = mathAbs(data.years);
  4130. return this;
  4131. }
  4132. function duration_add_subtract__addSubtract (duration, input, value, direction) {
  4133. var other = create__createDuration(input, value);
  4134. duration._milliseconds += direction * other._milliseconds;
  4135. duration._days += direction * other._days;
  4136. duration._months += direction * other._months;
  4137. return duration._bubble();
  4138. }
  4139. // supports only 2.0-style add(1, 's') or add(duration)
  4140. function duration_add_subtract__add (input, value) {
  4141. return duration_add_subtract__addSubtract(this, input, value, 1);
  4142. }
  4143. // supports only 2.0-style subtract(1, 's') or subtract(duration)
  4144. function duration_add_subtract__subtract (input, value) {
  4145. return duration_add_subtract__addSubtract(this, input, value, -1);
  4146. }
  4147. function absCeil (number) {
  4148. if (number < 0) {
  4149. return Math.floor(number);
  4150. } else {
  4151. return Math.ceil(number);
  4152. }
  4153. }
  4154. function bubble () {
  4155. var milliseconds = this._milliseconds;
  4156. var days = this._days;
  4157. var months = this._months;
  4158. var data = this._data;
  4159. var seconds, minutes, hours, years, monthsFromDays;
  4160. // if we have a mix of positive and negative values, bubble down first
  4161. // check: https://github.com/moment/moment/issues/2166
  4162. if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
  4163. (milliseconds <= 0 && days <= 0 && months <= 0))) {
  4164. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  4165. days = 0;
  4166. months = 0;
  4167. }
  4168. // The following code bubbles up values, see the tests for
  4169. // examples of what that means.
  4170. data.milliseconds = milliseconds % 1000;
  4171. seconds = absFloor(milliseconds / 1000);
  4172. data.seconds = seconds % 60;
  4173. minutes = absFloor(seconds / 60);
  4174. data.minutes = minutes % 60;
  4175. hours = absFloor(minutes / 60);
  4176. data.hours = hours % 24;
  4177. days += absFloor(hours / 24);
  4178. // convert days to months
  4179. monthsFromDays = absFloor(daysToMonths(days));
  4180. months += monthsFromDays;
  4181. days -= absCeil(monthsToDays(monthsFromDays));
  4182. // 12 months -> 1 year
  4183. years = absFloor(months / 12);
  4184. months %= 12;
  4185. data.days = days;
  4186. data.months = months;
  4187. data.years = years;
  4188. return this;
  4189. }
  4190. function daysToMonths (days) {
  4191. // 400 years have 146097 days (taking into account leap year rules)
  4192. // 400 years have 12 months === 4800
  4193. return days * 4800 / 146097;
  4194. }
  4195. function monthsToDays (months) {
  4196. // the reverse of daysToMonths
  4197. return months * 146097 / 4800;
  4198. }
  4199. function as (units) {
  4200. var days;
  4201. var months;
  4202. var milliseconds = this._milliseconds;
  4203. units = normalizeUnits(units);
  4204. if (units === 'month' || units === 'year') {
  4205. days = this._days + milliseconds / 864e5;
  4206. months = this._months + daysToMonths(days);
  4207. return units === 'month' ? months : months / 12;
  4208. } else {
  4209. // handle milliseconds separately because of floating point math errors (issue #1867)
  4210. days = this._days + Math.round(monthsToDays(this._months));
  4211. switch (units) {
  4212. case 'week' : return days / 7 + milliseconds / 6048e5;
  4213. case 'day' : return days + milliseconds / 864e5;
  4214. case 'hour' : return days * 24 + milliseconds / 36e5;
  4215. case 'minute' : return days * 1440 + milliseconds / 6e4;
  4216. case 'second' : return days * 86400 + milliseconds / 1000;
  4217. // Math.floor prevents floating point math errors here
  4218. case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
  4219. default: throw new Error('Unknown unit ' + units);
  4220. }
  4221. }
  4222. }
  4223. // TODO: Use this.as('ms')?
  4224. function duration_as__valueOf () {
  4225. return (
  4226. this._milliseconds +
  4227. this._days * 864e5 +
  4228. (this._months % 12) * 2592e6 +
  4229. toInt(this._months / 12) * 31536e6
  4230. );
  4231. }
  4232. function makeAs (alias) {
  4233. return function () {
  4234. return this.as(alias);
  4235. };
  4236. }
  4237. var asMilliseconds = makeAs('ms');
  4238. var asSeconds = makeAs('s');
  4239. var asMinutes = makeAs('m');
  4240. var asHours = makeAs('h');
  4241. var asDays = makeAs('d');
  4242. var asWeeks = makeAs('w');
  4243. var asMonths = makeAs('M');
  4244. var asYears = makeAs('y');
  4245. function duration_get__get (units) {
  4246. units = normalizeUnits(units);
  4247. return this[units + 's']();
  4248. }
  4249. function makeGetter(name) {
  4250. return function () {
  4251. return this._data[name];
  4252. };
  4253. }
  4254. var milliseconds = makeGetter('milliseconds');
  4255. var seconds = makeGetter('seconds');
  4256. var minutes = makeGetter('minutes');
  4257. var hours = makeGetter('hours');
  4258. var days = makeGetter('days');
  4259. var months = makeGetter('months');
  4260. var years = makeGetter('years');
  4261. function weeks () {
  4262. return absFloor(this.days() / 7);
  4263. }
  4264. var round = Math.round;
  4265. var thresholds = {
  4266. s: 45, // seconds to minute
  4267. m: 45, // minutes to hour
  4268. h: 22, // hours to day
  4269. d: 26, // days to month
  4270. M: 11 // months to year
  4271. };
  4272. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  4273. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
  4274. return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  4275. }
  4276. function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) {
  4277. var duration = create__createDuration(posNegDuration).abs();
  4278. var seconds = round(duration.as('s'));
  4279. var minutes = round(duration.as('m'));
  4280. var hours = round(duration.as('h'));
  4281. var days = round(duration.as('d'));
  4282. var months = round(duration.as('M'));
  4283. var years = round(duration.as('y'));
  4284. var a = seconds < thresholds.s && ['s', seconds] ||
  4285. minutes <= 1 && ['m'] ||
  4286. minutes < thresholds.m && ['mm', minutes] ||
  4287. hours <= 1 && ['h'] ||
  4288. hours < thresholds.h && ['hh', hours] ||
  4289. days <= 1 && ['d'] ||
  4290. days < thresholds.d && ['dd', days] ||
  4291. months <= 1 && ['M'] ||
  4292. months < thresholds.M && ['MM', months] ||
  4293. years <= 1 && ['y'] || ['yy', years];
  4294. a[2] = withoutSuffix;
  4295. a[3] = +posNegDuration > 0;
  4296. a[4] = locale;
  4297. return substituteTimeAgo.apply(null, a);
  4298. }
  4299. // This function allows you to set the rounding function for relative time strings
  4300. function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {
  4301. if (roundingFunction === undefined) {
  4302. return round;
  4303. }
  4304. if (typeof(roundingFunction) === 'function') {
  4305. round = roundingFunction;
  4306. return true;
  4307. }
  4308. return false;
  4309. }
  4310. // This function allows you to set a threshold for relative time strings
  4311. function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {
  4312. if (thresholds[threshold] === undefined) {
  4313. return false;
  4314. }
  4315. if (limit === undefined) {
  4316. return thresholds[threshold];
  4317. }
  4318. thresholds[threshold] = limit;
  4319. return true;
  4320. }
  4321. function humanize (withSuffix) {
  4322. var locale = this.localeData();
  4323. var output = duration_humanize__relativeTime(this, !withSuffix, locale);
  4324. if (withSuffix) {
  4325. output = locale.pastFuture(+this, output);
  4326. }
  4327. return locale.postformat(output);
  4328. }
  4329. var iso_string__abs = Math.abs;
  4330. function iso_string__toISOString() {
  4331. // for ISO strings we do not use the normal bubbling rules:
  4332. // * milliseconds bubble up until they become hours
  4333. // * days do not bubble at all
  4334. // * months bubble up until they become years
  4335. // This is because there is no context-free conversion between hours and days
  4336. // (think of clock changes)
  4337. // and also not between days and months (28-31 days per month)
  4338. var seconds = iso_string__abs(this._milliseconds) / 1000;
  4339. var days = iso_string__abs(this._days);
  4340. var months = iso_string__abs(this._months);
  4341. var minutes, hours, years;
  4342. // 3600 seconds -> 60 minutes -> 1 hour
  4343. minutes = absFloor(seconds / 60);
  4344. hours = absFloor(minutes / 60);
  4345. seconds %= 60;
  4346. minutes %= 60;
  4347. // 12 months -> 1 year
  4348. years = absFloor(months / 12);
  4349. months %= 12;
  4350. // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
  4351. var Y = years;
  4352. var M = months;
  4353. var D = days;
  4354. var h = hours;
  4355. var m = minutes;
  4356. var s = seconds;
  4357. var total = this.asSeconds();
  4358. if (!total) {
  4359. // this is the same as C#'s (Noda) and python (isodate)...
  4360. // but not other JS (goog.date)
  4361. return 'P0D';
  4362. }
  4363. return (total < 0 ? '-' : '') +
  4364. 'P' +
  4365. (Y ? Y + 'Y' : '') +
  4366. (M ? M + 'M' : '') +
  4367. (D ? D + 'D' : '') +
  4368. ((h || m || s) ? 'T' : '') +
  4369. (h ? h + 'H' : '') +
  4370. (m ? m + 'M' : '') +
  4371. (s ? s + 'S' : '');
  4372. }
  4373. var duration_prototype__proto = Duration.prototype;
  4374. duration_prototype__proto.abs = duration_abs__abs;
  4375. duration_prototype__proto.add = duration_add_subtract__add;
  4376. duration_prototype__proto.subtract = duration_add_subtract__subtract;
  4377. duration_prototype__proto.as = as;
  4378. duration_prototype__proto.asMilliseconds = asMilliseconds;
  4379. duration_prototype__proto.asSeconds = asSeconds;
  4380. duration_prototype__proto.asMinutes = asMinutes;
  4381. duration_prototype__proto.asHours = asHours;
  4382. duration_prototype__proto.asDays = asDays;
  4383. duration_prototype__proto.asWeeks = asWeeks;
  4384. duration_prototype__proto.asMonths = asMonths;
  4385. duration_prototype__proto.asYears = asYears;
  4386. duration_prototype__proto.valueOf = duration_as__valueOf;
  4387. duration_prototype__proto._bubble = bubble;
  4388. duration_prototype__proto.get = duration_get__get;
  4389. duration_prototype__proto.milliseconds = milliseconds;
  4390. duration_prototype__proto.seconds = seconds;
  4391. duration_prototype__proto.minutes = minutes;
  4392. duration_prototype__proto.hours = hours;
  4393. duration_prototype__proto.days = days;
  4394. duration_prototype__proto.weeks = weeks;
  4395. duration_prototype__proto.months = months;
  4396. duration_prototype__proto.years = years;
  4397. duration_prototype__proto.humanize = humanize;
  4398. duration_prototype__proto.toISOString = iso_string__toISOString;
  4399. duration_prototype__proto.toString = iso_string__toISOString;
  4400. duration_prototype__proto.toJSON = iso_string__toISOString;
  4401. duration_prototype__proto.locale = locale;
  4402. duration_prototype__proto.localeData = localeData;
  4403. // Deprecations
  4404. duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString);
  4405. duration_prototype__proto.lang = lang;
  4406. // Side effect imports
  4407. // FORMATTING
  4408. addFormatToken('X', 0, 0, 'unix');
  4409. addFormatToken('x', 0, 0, 'valueOf');
  4410. // PARSING
  4411. addRegexToken('x', matchSigned);
  4412. addRegexToken('X', matchTimestamp);
  4413. addParseToken('X', function (input, array, config) {
  4414. config._d = new Date(parseFloat(input, 10) * 1000);
  4415. });
  4416. addParseToken('x', function (input, array, config) {
  4417. config._d = new Date(toInt(input));
  4418. });
  4419. // Side effect imports
  4420. utils_hooks__hooks.version = '2.15.2';
  4421. setHookCallback(local__createLocal);
  4422. utils_hooks__hooks.fn = momentPrototype;
  4423. utils_hooks__hooks.min = min;
  4424. utils_hooks__hooks.max = max;
  4425. utils_hooks__hooks.now = now;
  4426. utils_hooks__hooks.utc = create_utc__createUTC;
  4427. utils_hooks__hooks.unix = moment__createUnix;
  4428. utils_hooks__hooks.months = lists__listMonths;
  4429. utils_hooks__hooks.isDate = isDate;
  4430. utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale;
  4431. utils_hooks__hooks.invalid = valid__createInvalid;
  4432. utils_hooks__hooks.duration = create__createDuration;
  4433. utils_hooks__hooks.isMoment = isMoment;
  4434. utils_hooks__hooks.weekdays = lists__listWeekdays;
  4435. utils_hooks__hooks.parseZone = moment__createInZone;
  4436. utils_hooks__hooks.localeData = locale_locales__getLocale;
  4437. utils_hooks__hooks.isDuration = isDuration;
  4438. utils_hooks__hooks.monthsShort = lists__listMonthsShort;
  4439. utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin;
  4440. utils_hooks__hooks.defineLocale = defineLocale;
  4441. utils_hooks__hooks.updateLocale = updateLocale;
  4442. utils_hooks__hooks.locales = locale_locales__listLocales;
  4443. utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort;
  4444. utils_hooks__hooks.normalizeUnits = normalizeUnits;
  4445. utils_hooks__hooks.relativeTimeRounding = duration_humanize__getSetRelativeTimeRounding;
  4446. utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold;
  4447. utils_hooks__hooks.calendarFormat = getCalendarFormat;
  4448. utils_hooks__hooks.prototype = momentPrototype;
  4449. var _moment = utils_hooks__hooks;
  4450. return _moment;
  4451. }));
  4452. define('moment', ['moment/moment'], function (main) { return main; });
  4453. define('frontend',['fast', 'template', 'moment'], function (Fast, Template, Moment) {
  4454. var Frontend = {
  4455. api: Fast.api,
  4456. init: function () {
  4457. var si = {};
  4458. //发送验证码
  4459. $(document).on("click", ".btn-captcha", function (e) {
  4460. var type = $(this).data("type") ? $(this).data("type") : 'mobile';
  4461. var element = $(this).data("input-id") ? $("#" + $(this).data("input-id")) : $("input[name='" + type + "']", $(this).closest("form"));
  4462. var text = type === 'email' ? '邮箱' : '手机号码';
  4463. if (element.val() === "") {
  4464. Layer.msg(text + "不能为空!");
  4465. element.focus();
  4466. return false;
  4467. } else if (type === 'mobile' && !element.val().match(/^1[3-9]\d{9}$/)) {
  4468. Layer.msg("请输入正确的" + text + "!");
  4469. element.focus();
  4470. return false;
  4471. } else if (type === 'email' && !element.val().match(/^[\w\+\-]+(\.[\w\+\-]+)*@[a-z\d\-]+(\.[a-z\d\-]+)*\.([a-z]{2,4})$/)) {
  4472. Layer.msg("请输入正确的" + text + "!");
  4473. element.focus();
  4474. return false;
  4475. }
  4476. var that = this;
  4477. element.isValid(function (v) {
  4478. if (v) {
  4479. $(that).addClass("disabled", true).text("发送中...");
  4480. var data = {event: $(that).data("event")};
  4481. data[type] = element.val();
  4482. Frontend.api.ajax({url: $(that).data("url"), data: data}, function () {
  4483. clearInterval(si[type]);
  4484. var seconds = 60;
  4485. si[type] = setInterval(function () {
  4486. seconds--;
  4487. if (seconds <= 0) {
  4488. clearInterval(si);
  4489. $(that).removeClass("disabled").text("发送验证码");
  4490. } else {
  4491. $(that).addClass("disabled").text(seconds + "秒后可再次发送");
  4492. }
  4493. }, 1000);
  4494. }, function () {
  4495. $(that).removeClass("disabled").text('发送验证码');
  4496. });
  4497. } else {
  4498. Layer.msg("请确认已经输入了正确的" + text + "!");
  4499. }
  4500. });
  4501. return false;
  4502. });
  4503. //tooltip和popover
  4504. if (!('ontouchstart' in document.documentElement)) {
  4505. $('body').tooltip({selector: '[data-toggle="tooltip"]'});
  4506. }
  4507. $('body').popover({selector: '[data-toggle="popover"]'});
  4508. }
  4509. };
  4510. Frontend.api = $.extend(Fast.api, Frontend.api);
  4511. //将Template渲染至全局,以便于在子框架中调用
  4512. window.Template = Template;
  4513. //将Moment渲染至全局,以便于在子框架中调用
  4514. window.Moment = Moment;
  4515. //将Frontend渲染至全局,以便于在子框架中调用
  4516. window.Frontend = Frontend;
  4517. Frontend.init();
  4518. return Frontend;
  4519. });
  4520. define('frontend-init',['frontend'], function (Frontend) {
  4521. });