require-backend.min.js 656 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062
  1. /*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
  2. !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){
  3. return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ia={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qa[0].contentDocument,b.write(),b.close(),c=sa(a,b),qa.detach()),ra[a]=c),c}var ua=/^margin/,va=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wa=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)};function xa(a,b,c){var d,e,f,g,h=a.style;return c=c||wa(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),va.test(g)&&ua.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function ya(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),f.removeChild(c),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var za=/^(none|table(?!-c[ea]).+)/,Aa=new RegExp("^("+Q+")(.*)$","i"),Ba=new RegExp("^([+-])=("+Q+")","i"),Ca={position:"absolute",visibility:"hidden",display:"block"},Da={letterSpacing:"0",fontWeight:"400"},Ea=["Webkit","O","Moz","ms"];function Fa(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Ea.length;while(e--)if(b=Ea[e]+c,b in a)return b;return d}function Ga(a,b,c){var d=Aa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Ha(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ia(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wa(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xa(a,b,f),(0>e||null==e)&&(e=a.style[b]),va.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Ha(a,b,c||(g?"border":"content"),d,f)+"px"}function Ja(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",ta(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xa(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fa(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Ba.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fa(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xa(a,b,d)),"normal"===e&&b in Da&&(e=Da[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?za.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Ca,function(){return Ia(a,b,d)}):Ia(a,b,d):void 0},set:function(a,c,d){var e=d&&wa(a);return Ga(a,c,d?Ha(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=ya(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ua.test(a)||(n.cssHooks[a+b].set=Ga)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wa(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Ja(this,!0)},hide:function(){return Ja(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Ka(a,b,c,d,e){return new Ka.prototype.init(a,b,c,d,e)}n.Tween=Ka,Ka.prototype={constructor:Ka,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ka.propHooks[this.prop];return a&&a.get?a.get(this):Ka.propHooks._default.get(this)},run:function(a){var b,c=Ka.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ka.propHooks._default.set(this),this}},Ka.prototype.init.prototype=Ka.prototype,Ka.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Ka.propHooks.scrollTop=Ka.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Ka.prototype.init,n.fx.step={};var La,Ma,Na=/^(?:toggle|show|hide)$/,Oa=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pa=/queueHooks$/,Qa=[Va],Ra={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Oa.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Oa.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sa(){return setTimeout(function(){La=void 0}),La=n.now()}function Ta(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ua(a,b,c){for(var d,e=(Ra[b]||[]).concat(Ra["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Va(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||ta(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Na.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?ta(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ua(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wa(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xa(a,b,c){var d,e,f=0,g=Qa.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=La||Sa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:La||Sa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wa(k,j.opts.specialEasing);g>f;f++)if(d=Qa[f].call(j,a,k,j.opts))return d;return n.map(k,Ua,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xa,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Ra[c]=Ra[c]||[],Ra[c].unshift(b)},prefilter:function(a,b){b?Qa.unshift(a):Qa.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xa(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pa.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Ta(b,!0),a,d,e)}}),n.each({slideDown:Ta("show"),slideUp:Ta("hide"),slideToggle:Ta("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(La=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),La=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ma||(Ma=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Ma),Ma=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Ya,Za,$a=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Za:Ya)),
  4. void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Za={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$a[b]||n.find.attr;$a[b]=function(a,b,d){var e,f;return d||(f=$a[b],$a[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$a[b]=f),e}});var _a=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_a.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ab=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ab," ").indexOf(b)>=0)return!0;return!1}});var bb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cb=n.now(),db=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var eb=/#.*$/,fb=/([?&])_=[^&]*/,gb=/^(.*?):[ \t]*([^\r\n]*)$/gm,hb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ib=/^(?:GET|HEAD)$/,jb=/^\/\//,kb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lb={},mb={},nb="*/".concat("*"),ob=a.location.href,pb=kb.exec(ob.toLowerCase())||[];function qb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function rb(a,b,c,d){var e={},f=a===mb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function sb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function tb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function ub(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ob,type:"GET",isLocal:hb.test(pb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?sb(sb(a,n.ajaxSettings),b):sb(n.ajaxSettings,a)},ajaxPrefilter:qb(lb),ajaxTransport:qb(mb),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=gb.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||ob)+"").replace(eb,"").replace(jb,pb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=kb.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===pb[1]&&h[2]===pb[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(pb[3]||("http:"===pb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),rb(lb,k,b,v),2===t)return v;i=n.event&&k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!ib.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(db.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=fb.test(d)?d.replace(fb,"$1_="+cb++):d+(db.test(d)?"&":"?")+"_="+cb++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+nb+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=rb(mb,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=tb(k,v,f)),u=ub(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var vb=/%20/g,wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&").replace(vb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bb=0,Cb={},Db={0:200,1223:204},Eb=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Cb)Cb[a]()}),k.cors=!!Eb&&"withCredentials"in Eb,k.ajax=Eb=!!Eb,n.ajaxTransport(function(a){var b;return k.cors||Eb&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cb[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Db[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cb[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Fb=[],Gb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Fb.pop()||n.expando+"_"+cb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Gb.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Gb,"$1"+e):b.jsonp!==!1&&(b.url+=(db.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Fb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Hb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Hb)return Hb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Ib=a.document.documentElement;function Jb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Jb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Ib;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ib})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Jb(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=ya(k.pixelPosition,function(a,c){return c?(c=xa(a,b),va.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Kb=a.jQuery,Lb=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Lb),b&&a.jQuery===n&&(a.jQuery=Kb),n},typeof b===U&&(a.jQuery=a.$=n),n});
  5. //# sourceMappingURL=jquery.min.map;
  6. /*!
  7. * Bootstrap v3.3.7 (http://getbootstrap.com)
  8. * Copyright 2011-2016 Twitter, Inc.
  9. * Licensed under the MIT license
  10. */
  11. 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){
  12. 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);
  13. define("bootstrap", ["jquery"], function(){});
  14. define('config',['module'], function (module) {
  15. return module.config();
  16. });
  17. require.config({
  18. urlArgs: "v=" + requirejs.s.contexts._.config.config.config.site.version,
  19. packages: [{
  20. name: 'moment',
  21. location: '../libs/moment',
  22. main: 'moment'
  23. }],
  24. //在打包压缩时将会把include中的模块合并到主文件中
  25. include: ['css', 'layer', 'toastr', 'backend', 'table', 'form', 'dragsort', 'drag', 'drop', 'addtabs'],
  26. paths: {
  27. 'lang': "empty:",
  28. 'config': 'require-config',
  29. 'bootstrap-checkbox': 'bootstrap-checkbox',
  30. 'bootstrap-radio': 'bootstrap-radio',
  31. 'bootstrap-switch': 'bootstrap-switch',
  32. 'form': 'require-form',
  33. 'table': 'require-table',
  34. 'upload': 'require-upload',
  35. 'drag': 'jquery.drag.min',
  36. 'drop': 'jquery.drop.min',
  37. 'echarts-theme': 'echarts-theme',
  38. 'adminlte': 'adminlte',
  39. //
  40. // 以下的包从bower的libs目录加载
  41. 'jquery': '../libs/jquery/dist/jquery.min',
  42. 'bootstrap': '../libs/bootstrap/dist/js/bootstrap.min',
  43. 'bootstrap-validator': '../libs/bootstrap-validator/dist/validator.min',
  44. 'bootstrap-typeahead': '../libs/bootstrap3-typeahead/bootstrap3-typeahead.min',
  45. 'bootstrap-tagsinput': '../libs/bootstrap-tagsinput/dist/bootstrap-tagsinput.min',
  46. 'bootstrap-dialog': '../libs/bootstrap3-dialog/dist/js/bootstrap-dialog.min',
  47. 'bootstrap-datetimepicker': '../libs/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min',
  48. 'bootstrap-select': '../libs/bootstrap-select/dist/js/bootstrap-select.min',
  49. 'bootstrap-table': '../libs/bootstrap-table/dist/bootstrap-table.min',
  50. 'bootstrap-table-export': '../libs/bootstrap-table/dist/extensions/export/bootstrap-table-export.min',
  51. 'bootstrap-table-mobile': '../libs/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile',
  52. 'bootstrap-table-advancedsearch': 'bootstrap-table-advancedsearch',
  53. 'bootstrap-table-lang': '../libs/bootstrap-table/dist/locale/bootstrap-table-zh-CN',
  54. 'typeahead': '../libs/typeahead.js/dist/typeahead.jquery.min',
  55. 'bloodhound': '../libs/typeahead.js/dist/bloodhound.min',
  56. 'tableexport': '../libs/tableExport.jquery.plugin/tableExport.min',
  57. 'dropzone': '../libs/dropzone/dist/min/dropzone-amd-module.min',
  58. 'less': '../libs/less/dist/less.min',
  59. 'dragsort': '../libs/dragsort/jquery.dragsort',
  60. 'sortable': '../libs/Sortable/Sortable.min',
  61. 'addtabs': '../libs/jquery-addtabs/jquery.addtabs',
  62. 'slimscroll': '../libs/jquery-slimscroll/jquery.slimscroll',
  63. 'crontab': '../libs/jqcron/src/jqCron.cn',
  64. 'summernote': '../libs/summernote/dist/lang/summernote-zh-CN.min',
  65. 'validator': '../libs/nice-validator/dist/local/zh-CN',
  66. 'plupload': '../libs/plupload/js/plupload.min',
  67. 'toastr': '../libs/toastr/toastr',
  68. 'jstree': '../libs/jstree/dist/jstree.min',
  69. 'layer': '../libs/layer/src/layer',
  70. 'echarts': '../libs/echarts/dist/echarts.min',
  71. 'cookie': '../libs/jquery.cookie/jquery.cookie',
  72. 'template': '../libs/art-template/dist/template-native',
  73. },
  74. // shim依赖配置
  75. shim: {
  76. 'bootstrap': ['jquery'],
  77. 'bootstrap-table': {
  78. deps: ['bootstrap', 'css!../libs/bootstrap-table/dist/bootstrap-table.min.css'],
  79. exports: '$.fn.bootstrapTable'
  80. },
  81. 'bootstrap-table-lang': {
  82. deps: ['bootstrap-table'],
  83. exports: '$.fn.bootstrapTable.defaults'
  84. },
  85. 'bootstrap-table-export': {
  86. deps: ['bootstrap-table', 'tableexport'],
  87. exports: '$.fn.bootstrapTable.defaults'
  88. },
  89. 'bootstrap-table-mobile': {
  90. deps: ['bootstrap-table'],
  91. exports: '$.fn.bootstrapTable.defaults'
  92. },
  93. 'bootstrap-table-advancedsearch': {
  94. deps: ['bootstrap-table'],
  95. exports: '$.fn.bootstrapTable.defaults'
  96. },
  97. 'tableexport': {
  98. deps: ['jquery'],
  99. exports: '$.fn.extend'
  100. },
  101. 'slimscroll': {
  102. deps: ['jquery'],
  103. exports: '$.fn.extend'
  104. },
  105. 'adminlte': {
  106. deps: ['bootstrap', 'slimscroll'],
  107. exports: '$.AdminLTE'
  108. },
  109. 'typeahead': {
  110. deps: ['jquery'],
  111. init: function ($) {
  112. return require.s.contexts._.registry['typeahead.js'].factory($);
  113. }
  114. },
  115. 'crontab': ['../libs/jqcron/src/jqCron', 'css!../libs/jqcron/src/jqCron.css'],
  116. 'bootstrap-checkbox': ['jquery'],
  117. 'bootstrap-radio': ['jquery'],
  118. 'bootstrap-switch': ['jquery'],
  119. 'bootstrap-dialog': ['css!../libs/bootstrap3-dialog/dist/css/bootstrap-dialog.min.css'],
  120. 'bootstrap-datetimepicker': [
  121. 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',
  122. 'moment/locale/zh-cn'
  123. ],
  124. 'bootstrap-tagsinput': [
  125. 'css!../libs/bootstrap-tagsinput/dist/bootstrap-tagsinput-typeahead.css',
  126. 'css!../libs/bootstrap-tagsinput/dist/bootstrap-tagsinput.css',
  127. 'jquery',
  128. 'typeahead'
  129. ],
  130. 'bootstrap-select': ['css!../libs/bootstrap-select/dist/css/bootstrap-select.min.css', ],
  131. 'summernote': ['../libs/summernote/dist/summernote.min', 'css!../libs/summernote/dist/summernote.css'],
  132. // 'toastr': ['css!../libs/toastr/toastr.min.css'],
  133. 'jstree': ['css!../libs/jstree/dist/themes/default/style.css', ],
  134. 'plupload': {
  135. deps: [
  136. '../libs/plupload/js/moxie.min'
  137. ],
  138. exports: "plupload"
  139. },
  140. // 'layer': ['css!../libs/layer/build/skin/default/layer.css'],
  141. validator: {
  142. deps: ['../libs/nice-validator/dist/jquery.validator', 'css!../libs/nice-validator/dist/jquery.validator.css']
  143. }
  144. },
  145. baseUrl: requirejs.s.contexts._.config.config.config.site.cdnurl + '/assets/js/', //资源基础路径
  146. map: {
  147. '*': {
  148. 'css': '../libs/require-css/css.min'
  149. }
  150. },
  151. charset: 'utf-8' // 文件编码
  152. });
  153. require(['jquery', 'bootstrap', 'config'], function ($, undefined, Config) {
  154. // 配置语言包的路径
  155. var paths = {};
  156. paths['lang'] = Config.moduleurl + '/ajax/lang?callback=define&controllername=' + Config.controllername;
  157. // 避免目录冲突
  158. paths['backend/'] = 'backend/';
  159. require.config({paths: paths});
  160. // 初始化
  161. $(function () {
  162. require(['backend'], function (Module) {
  163. // 对相对地址进行处理
  164. $.ajaxSetup({
  165. beforeSend: function (xhr, setting) {
  166. setting.url = Module.api.fixurl(setting.url);
  167. }
  168. });
  169. // 绑定ESC关闭窗口事件
  170. $(window).keyup(function (e) {
  171. if (e.keyCode == 27) {
  172. if ($(".layui-layer").size() > 0) {
  173. var index = 0;
  174. $(".layui-layer").each(function () {
  175. index = Math.max(index, parseInt($(this).attr("times")));
  176. });
  177. if (index) {
  178. Module.api.layer.close(index);
  179. }
  180. }
  181. }
  182. });
  183. //加载相应模块
  184. require([Config.jsname], function (Controller) {
  185. Controller[Config.actionname] != undefined && Controller[Config.actionname]();
  186. }, function (e) {
  187. // 这里可捕获模块加载的错误
  188. });
  189. });
  190. });
  191. });
  192. define("require-backend", function(){});
  193. define('../libs/require-css/css.min',[],function(){if("undefined"==typeof window)return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0],t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,n=!1,r=!0;t[1]||t[7]?n=parseInt(t[1])<6||parseInt(t[7])<=9:t[2]||t[8]?r=!1:t[4]&&(n=parseInt(t[4])<18);var o={};o.pluginBuilder="./css-builder";var a,i,s,l=function(){a=document.createElement("style"),e.appendChild(a),i=a.styleSheet||a.sheet},u=0,d=[],c=function(e){u++,32==u&&(l(),u=0),i.addImport(e),a.onload=function(){f()}},f=function(){s();var e=d.shift();return e?(s=e[1],void c(e[0])):void(s=null)},h=function(e,t){if(i&&i.addImport||l(),i&&i.addImport)s?d.push([e,t]):(c(e),s=t);else{a.textContent='@import "'+e+'";';var n=setInterval(function(){try{a.sheet.cssRules,clearInterval(n),t()}catch(e){}},10)}},p=function(t,n){var o=document.createElement("link");if(o.type="text/css",o.rel="stylesheet",r)o.onload=function(){o.onload=function(){},setTimeout(n,7)};else var a=setInterval(function(){for(var e=0;e<document.styleSheets.length;e++){var t=document.styleSheets[e];if(t.href==o.href)return clearInterval(a),n()}},10);o.href=t,e.appendChild(o)};return o.normalize=function(e,t){return".css"==e.substr(e.length-4,4)&&(e=e.substr(0,e.length-4)),t(e)},o.load=function(e,t,r){(n?h:p)(t.toUrl(e+".css"),r)},o});
  194. /**
  195. @Name:layer v3.0.1 Web弹层组件
  196. @Author:贤心
  197. @Site:http://layer.layui.com
  198. @License:LGPL
  199. */
  200. ;!function(window, undefined){
  201. "use strict";
  202. var isLayui = window.layui && layui.define, $, win, ready = {
  203. getPath: function(){
  204. var js = document.scripts, script = js[js.length - 1], jsPath = script.src;
  205. if(script.getAttribute('merge')) return;
  206. return jsPath.substring(0, jsPath.lastIndexOf("/") + 1);
  207. }(),
  208. config: {}, end: {}, minIndex: 0, minLeft: [],
  209. btn: ['&#x786E;&#x5B9A;', '&#x53D6;&#x6D88;'],
  210. //五种原始层模式
  211. type: ['dialog', 'page', 'iframe', 'loading', 'tips']
  212. };
  213. //默认内置方法。
  214. var layer = {
  215. v: '3.0.1',
  216. ie: function(){ //ie版本
  217. var agent = navigator.userAgent.toLowerCase();
  218. return (!!window.ActiveXObject || "ActiveXObject" in window) ? (
  219. (agent.match(/msie\s(\d+)/) || [])[1] || '11' //由于ie11并没有msie的标识
  220. ) : false;
  221. }(),
  222. index: (window.layer && window.layer.v) ? 100000 : 0,
  223. path: ready.getPath,
  224. config: function(options, fn){
  225. options = options || {};
  226. layer.cache = ready.config = $.extend({}, ready.config, options);
  227. layer.path = ready.config.path || layer.path;
  228. typeof options.extend === 'string' && (options.extend = [options.extend]);
  229. if(ready.config.path) layer.ready();
  230. if(!options.extend) return this;
  231. isLayui
  232. ? layui.addcss('modules/layer/' + options.extend)
  233. : layer.link('skin/' + options.extend);
  234. return this;
  235. },
  236. //载入CSS配件
  237. link: function(href, fn, cssname){
  238. //未设置路径,则不主动加载css
  239. if(!layer.path) return;
  240. var head = $('head')[0], link = document.createElement('link');
  241. if(typeof fn === 'string') cssname = fn;
  242. var app = (cssname || href).replace(/\.|\//g, '');
  243. var id = 'layuicss-'+app, timeout = 0;
  244. link.rel = 'stylesheet';
  245. link.href = layer.path + href;
  246. link.id = id;
  247. if(!$('#'+ id)[0]){
  248. head.appendChild(link);
  249. }
  250. if(typeof fn !== 'function') return;
  251. //轮询css是否加载完毕
  252. (function poll() {
  253. if(++timeout > 8 * 1000 / 100){
  254. return window.console && console.error('layer.css: Invalid');
  255. };
  256. parseInt($('#'+id).css('width')) === 1989 ? fn() : setTimeout(poll, 100);
  257. }());
  258. },
  259. ready: function(callback){
  260. var cssname = 'skinlayercss', ver = '1110';
  261. isLayui ? layui.addcss('modules/layer/default/layer.css?v='+layer.v+ver, callback, cssname)
  262. : layer.link('skin/default/layer.css?v='+layer.v+ver, callback, cssname);
  263. return this;
  264. },
  265. //各种快捷引用
  266. alert: function(content, options, yes){
  267. var type = typeof options === 'function';
  268. if(type) yes = options;
  269. return layer.open($.extend({
  270. content: content,
  271. yes: yes
  272. }, type ? {} : options));
  273. },
  274. confirm: function(content, options, yes, cancel){
  275. var type = typeof options === 'function';
  276. if(type){
  277. cancel = yes;
  278. yes = options;
  279. }
  280. return layer.open($.extend({
  281. content: content,
  282. btn: ready.btn,
  283. yes: yes,
  284. btn2: cancel
  285. }, type ? {} : options));
  286. },
  287. msg: function(content, options, end){ //最常用提示层
  288. var type = typeof options === 'function', rskin = ready.config.skin;
  289. var skin = (rskin ? rskin + ' ' + rskin + '-msg' : '')||'layui-layer-msg';
  290. var anim = doms.anim.length - 1;
  291. if(type) end = options;
  292. return layer.open($.extend({
  293. content: content,
  294. time: 3000,
  295. shade: false,
  296. skin: skin,
  297. title: false,
  298. closeBtn: false,
  299. btn: false,
  300. resize: false,
  301. end: end
  302. }, (type && !ready.config.skin) ? {
  303. skin: skin + ' layui-layer-hui',
  304. anim: anim
  305. } : function(){
  306. options = options || {};
  307. if(options.icon === -1 || options.icon === undefined && !ready.config.skin){
  308. options.skin = skin + ' ' + (options.skin||'layui-layer-hui');
  309. }
  310. return options;
  311. }()));
  312. },
  313. load: function(icon, options){
  314. return layer.open($.extend({
  315. type: 3,
  316. icon: icon || 0,
  317. resize: false,
  318. shade: 0.01
  319. }, options));
  320. },
  321. tips: function(content, follow, options){
  322. return layer.open($.extend({
  323. type: 4,
  324. content: [content, follow],
  325. closeBtn: false,
  326. time: 3000,
  327. shade: false,
  328. resize: false,
  329. fixed: false,
  330. maxWidth: 210
  331. }, options));
  332. }
  333. };
  334. var Class = function(setings){
  335. var that = this;
  336. that.index = ++layer.index;
  337. that.config = $.extend({}, that.config, ready.config, setings);
  338. document.body ? that.creat() : setTimeout(function(){
  339. that.creat();
  340. }, 50);
  341. };
  342. Class.pt = Class.prototype;
  343. //缓存常用字符
  344. var doms = ['layui-layer', '.layui-layer-title', '.layui-layer-main', '.layui-layer-dialog', 'layui-layer-iframe', 'layui-layer-content', 'layui-layer-btn', 'layui-layer-close'];
  345. doms.anim = ['layer-anim', 'layer-anim-01', 'layer-anim-02', 'layer-anim-03', 'layer-anim-04', 'layer-anim-05', 'layer-anim-06'];
  346. //默认配置
  347. Class.pt.config = {
  348. type: 0,
  349. shade: 0.3,
  350. fixed: true,
  351. move: doms[1],
  352. title: '&#x4FE1;&#x606F;',
  353. offset: 'auto',
  354. area: 'auto',
  355. closeBtn: 1,
  356. time: 0, //0表示不自动关闭
  357. zIndex: 19891014,
  358. maxWidth: 360,
  359. anim: 0,
  360. icon: -1,
  361. moveType: 1,
  362. resize: true,
  363. scrollbar: true, //是否允许浏览器滚动条
  364. tips: 2
  365. };
  366. //容器
  367. Class.pt.vessel = function(conType, callback){
  368. var that = this, times = that.index, config = that.config;
  369. var zIndex = config.zIndex + times, titype = typeof config.title === 'object';
  370. var ismax = config.maxmin && (config.type === 1 || config.type === 2);
  371. var titleHTML = (config.title ? '<div class="layui-layer-title" style="'+ (titype ? config.title[1] : '') +'">'
  372. + (titype ? config.title[0] : config.title)
  373. + '</div>' : '');
  374. config.zIndex = zIndex;
  375. callback([
  376. //遮罩
  377. config.shade ? ('<div class="layui-layer-shade" id="layui-layer-shade'+ times +'" times="'+ times +'" style="'+ ('z-index:'+ (zIndex-1) +'; background-color:'+ (config.shade[1]||'#000') +'; opacity:'+ (config.shade[0]||config.shade) +'; filter:alpha(opacity='+ (config.shade[0]*100||config.shade*100) +');') +'"></div>') : '',
  378. //主体
  379. '<div class="'+ doms[0] + (' layui-layer-'+ready.type[config.type]) + (((config.type == 0 || config.type == 2) && !config.shade) ? ' layui-layer-border' : '') + ' ' + (config.skin||'') +'" id="'+ doms[0] + times +'" type="'+ ready.type[config.type] +'" times="'+ times +'" showtime="'+ config.time +'" conType="'+ (conType ? 'object' : 'string') +'" style="z-index: '+ zIndex +'; width:'+ config.area[0] + ';height:' + config.area[1] + (config.fixed ? '' : ';position:absolute;') +'">'
  380. + (conType && config.type != 2 ? '' : titleHTML)
  381. + '<div id="'+ (config.id||'') +'" class="layui-layer-content'+ ((config.type == 0 && config.icon !== -1) ? ' layui-layer-padding' :'') + (config.type == 3 ? ' layui-layer-loading'+config.icon : '') +'">'
  382. + (config.type == 0 && config.icon !== -1 ? '<i class="layui-layer-ico layui-layer-ico'+ config.icon +'"></i>' : '')
  383. + (config.type == 1 && conType ? '' : (config.content||''))
  384. + '</div>'
  385. + '<span class="layui-layer-setwin">'+ function(){
  386. var closebtn = ismax ? '<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>' : '';
  387. config.closeBtn && (closebtn += '<a class="layui-layer-ico '+ doms[7] +' '+ doms[7] + (config.title ? config.closeBtn : (config.type == 4 ? '1' : '2')) +'" href="javascript:;"></a>');
  388. return closebtn;
  389. }() + '</span>'
  390. + (config.btn ? function(){
  391. var button = '';
  392. typeof config.btn === 'string' && (config.btn = [config.btn]);
  393. for(var i = 0, len = config.btn.length; i < len; i++){
  394. button += '<a class="'+ doms[6] +''+ i +'">'+ config.btn[i] +'</a>'
  395. }
  396. return '<div class="'+ doms[6] +' layui-layer-btn-'+ (config.btnAlign||'') +'">'+ button +'</div>'
  397. }() : '')
  398. + (config.resize ? '<span class="layui-layer-resize"></span>' : '')
  399. + '</div>'
  400. ], titleHTML, $('<div class="layui-layer-move"></div>'));
  401. return that;
  402. };
  403. //创建骨架
  404. Class.pt.creat = function(){
  405. var that = this
  406. ,config = that.config
  407. ,times = that.index, nodeIndex
  408. ,content = config.content
  409. ,conType = typeof content === 'object'
  410. ,body = $('body');
  411. if($('#'+config.id)[0]) return;
  412. if(typeof config.area === 'string'){
  413. config.area = config.area === 'auto' ? ['', ''] : [config.area, ''];
  414. }
  415. //anim兼容旧版shift
  416. if(config.shift){
  417. config.anim = config.shift;
  418. }
  419. if(layer.ie == 6){
  420. config.fixed = false;
  421. }
  422. switch(config.type){
  423. case 0:
  424. config.btn = ('btn' in config) ? config.btn : ready.btn[0];
  425. layer.closeAll('dialog');
  426. break;
  427. case 2:
  428. var content = config.content = conType ? config.content : [config.content||'http://layer.layui.com', 'auto'];
  429. config.content = '<iframe scrolling="'+ (config.content[1]||'auto') +'" allowtransparency="true" id="'+ doms[4] +''+ times +'" name="'+ doms[4] +''+ times +'" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="' + config.content[0] + '"></iframe>';
  430. break;
  431. case 3:
  432. delete config.title;
  433. delete config.closeBtn;
  434. config.icon === -1 && (config.icon === 0);
  435. layer.closeAll('loading');
  436. break;
  437. case 4:
  438. conType || (config.content = [config.content, 'body']);
  439. config.follow = config.content[1];
  440. config.content = config.content[0] + '<i class="layui-layer-TipsG"></i>';
  441. delete config.title;
  442. config.tips = typeof config.tips === 'object' ? config.tips : [config.tips, true];
  443. config.tipsMore || layer.closeAll('tips');
  444. break;
  445. }
  446. //建立容器
  447. that.vessel(conType, function(html, titleHTML, moveElem){
  448. body.append(html[0]);
  449. conType ? function(){
  450. (config.type == 2 || config.type == 4) ? function(){
  451. $('body').append(html[1]);
  452. }() : function(){
  453. if(!content.parents('.'+doms[0])[0]){
  454. content.data('display', content.css('display')).show().addClass('layui-layer-wrap').wrap(html[1]);
  455. $('#'+ doms[0] + times).find('.'+doms[5]).before(titleHTML);
  456. }
  457. }();
  458. }() : body.append(html[1]);
  459. $('.layui-layer-move')[0] || body.append(ready.moveElem = moveElem);
  460. that.layero = $('#'+ doms[0] + times);
  461. config.scrollbar || doms.html.css('overflow', 'hidden').attr('layer-full', times);
  462. }).auto(times);
  463. config.type == 2 && layer.ie == 6 && that.layero.find('iframe').attr('src', content[0]);
  464. //坐标自适应浏览器窗口尺寸
  465. config.type == 4 ? that.tips() : that.offset();
  466. if(config.fixed){
  467. win.on('resize', function(){
  468. that.offset();
  469. (/^\d+%$/.test(config.area[0]) || /^\d+%$/.test(config.area[1])) && that.auto(times);
  470. config.type == 4 && that.tips();
  471. });
  472. }
  473. config.time <= 0 || setTimeout(function(){
  474. layer.close(that.index)
  475. }, config.time);
  476. that.move().callback();
  477. //为兼容jQuery3.0的css动画影响元素尺寸计算
  478. if(doms.anim[config.anim]){
  479. that.layero.addClass(doms.anim[config.anim]).data('anim', true);
  480. };
  481. };
  482. //自适应
  483. Class.pt.auto = function(index){
  484. var that = this, config = that.config, layero = $('#'+ doms[0] + index);
  485. if(config.area[0] === '' && config.maxWidth > 0){
  486. //为了修复IE7下一个让人难以理解的bug
  487. if(layer.ie && layer.ie < 8 && config.btn){
  488. layero.width(layero.innerWidth());
  489. }
  490. layero.outerWidth() > config.maxWidth && layero.width(config.maxWidth);
  491. }
  492. var area = [layero.innerWidth(), layero.innerHeight()];
  493. var titHeight = layero.find(doms[1]).outerHeight() || 0;
  494. var btnHeight = layero.find('.'+doms[6]).outerHeight() || 0;
  495. function setHeight(elem){
  496. elem = layero.find(elem);
  497. elem.height(area[1] - titHeight - btnHeight - 2*(parseFloat(elem.css('padding'))|0));
  498. }
  499. switch(config.type){
  500. case 2:
  501. setHeight('iframe');
  502. break;
  503. default:
  504. if(config.area[1] === ''){
  505. if(config.fixed && area[1] >= win.height()){
  506. area[1] = win.height();
  507. setHeight('.'+doms[5]);
  508. }
  509. } else {
  510. setHeight('.'+doms[5]);
  511. }
  512. break;
  513. }
  514. return that;
  515. };
  516. //计算坐标
  517. Class.pt.offset = function(){
  518. var that = this, config = that.config, layero = that.layero;
  519. var area = [layero.outerWidth(), layero.outerHeight()];
  520. var type = typeof config.offset === 'object';
  521. that.offsetTop = (win.height() - area[1])/2;
  522. that.offsetLeft = (win.width() - area[0])/2;
  523. if(type){
  524. that.offsetTop = config.offset[0];
  525. that.offsetLeft = config.offset[1]||that.offsetLeft;
  526. } else if(config.offset !== 'auto'){
  527. if(config.offset === 't'){ //上
  528. that.offsetTop = 0;
  529. } else if(config.offset === 'r'){ //右
  530. that.offsetLeft = win.width() - area[0];
  531. } else if(config.offset === 'b'){ //下
  532. that.offsetTop = win.height() - area[1];
  533. } else if(config.offset === 'l'){ //左
  534. that.offsetLeft = 0;
  535. } else if(config.offset === 'lt'){ //左上角
  536. that.offsetTop = 0;
  537. that.offsetLeft = 0;
  538. } else if(config.offset === 'lb'){ //左下角
  539. that.offsetTop = win.height() - area[1];
  540. that.offsetLeft = 0;
  541. } else if(config.offset === 'rt'){ //右上角
  542. that.offsetTop = 0;
  543. that.offsetLeft = win.width() - area[0];
  544. } else if(config.offset === 'rb'){ //右下角
  545. that.offsetTop = win.height() - area[1];
  546. that.offsetLeft = win.width() - area[0];
  547. } else {
  548. that.offsetTop = config.offset;
  549. }
  550. }
  551. if(!config.fixed){
  552. that.offsetTop = /%$/.test(that.offsetTop) ?
  553. win.height()*parseFloat(that.offsetTop)/100
  554. : parseFloat(that.offsetTop);
  555. that.offsetLeft = /%$/.test(that.offsetLeft) ?
  556. win.width()*parseFloat(that.offsetLeft)/100
  557. : parseFloat(that.offsetLeft);
  558. that.offsetTop += win.scrollTop();
  559. that.offsetLeft += win.scrollLeft();
  560. }
  561. if(layero.attr('minLeft')){
  562. that.offsetTop = win.height() - (layero.find(doms[1]).outerHeight() || 0);
  563. that.offsetLeft = layero.css('left');
  564. }
  565. layero.css({top: that.offsetTop, left: that.offsetLeft});
  566. };
  567. //Tips
  568. Class.pt.tips = function(){
  569. var that = this, config = that.config, layero = that.layero;
  570. var layArea = [layero.outerWidth(), layero.outerHeight()], follow = $(config.follow);
  571. if(!follow[0]) follow = $('body');
  572. var goal = {
  573. width: follow.outerWidth(),
  574. height: follow.outerHeight(),
  575. top: follow.offset().top,
  576. left: follow.offset().left
  577. }, tipsG = layero.find('.layui-layer-TipsG');
  578. var guide = config.tips[0];
  579. config.tips[1] || tipsG.remove();
  580. goal.autoLeft = function(){
  581. if(goal.left + layArea[0] - win.width() > 0){
  582. goal.tipLeft = goal.left + goal.width - layArea[0];
  583. tipsG.css({right: 12, left: 'auto'});
  584. } else {
  585. goal.tipLeft = goal.left;
  586. };
  587. };
  588. //辨别tips的方位
  589. goal.where = [function(){ //上
  590. goal.autoLeft();
  591. goal.tipTop = goal.top - layArea[1] - 10;
  592. tipsG.removeClass('layui-layer-TipsB').addClass('layui-layer-TipsT').css('border-right-color', config.tips[1]);
  593. }, function(){ //右
  594. goal.tipLeft = goal.left + goal.width + 10;
  595. goal.tipTop = goal.top;
  596. tipsG.removeClass('layui-layer-TipsL').addClass('layui-layer-TipsR').css('border-bottom-color', config.tips[1]);
  597. }, function(){ //下
  598. goal.autoLeft();
  599. goal.tipTop = goal.top + goal.height + 10;
  600. tipsG.removeClass('layui-layer-TipsT').addClass('layui-layer-TipsB').css('border-right-color', config.tips[1]);
  601. }, function(){ //左
  602. goal.tipLeft = goal.left - layArea[0] - 10;
  603. goal.tipTop = goal.top;
  604. tipsG.removeClass('layui-layer-TipsR').addClass('layui-layer-TipsL').css('border-bottom-color', config.tips[1]);
  605. }];
  606. goal.where[guide-1]();
  607. /* 8*2为小三角形占据的空间 */
  608. if(guide === 1){
  609. goal.top - (win.scrollTop() + layArea[1] + 8*2) < 0 && goal.where[2]();
  610. } else if(guide === 2){
  611. win.width() - (goal.left + goal.width + layArea[0] + 8*2) > 0 || goal.where[3]()
  612. } else if(guide === 3){
  613. (goal.top - win.scrollTop() + goal.height + layArea[1] + 8*2) - win.height() > 0 && goal.where[0]();
  614. } else if(guide === 4){
  615. layArea[0] + 8*2 - goal.left > 0 && goal.where[1]()
  616. }
  617. layero.find('.'+doms[5]).css({
  618. 'background-color': config.tips[1],
  619. 'padding-right': (config.closeBtn ? '30px' : '')
  620. });
  621. layero.css({
  622. left: goal.tipLeft - (config.fixed ? win.scrollLeft() : 0),
  623. top: goal.tipTop - (config.fixed ? win.scrollTop() : 0)
  624. });
  625. }
  626. //拖拽层
  627. Class.pt.move = function(){
  628. var that = this
  629. ,config = that.config
  630. ,_DOC = $(document)
  631. ,layero = that.layero
  632. ,moveElem = layero.find(config.move)
  633. ,resizeElem = layero.find('.layui-layer-resize')
  634. ,dict = {};
  635. if(config.move){
  636. moveElem.css('cursor', 'move');
  637. }
  638. moveElem.on('mousedown', function(e){
  639. e.preventDefault();
  640. if(config.move){
  641. dict.moveStart = true;
  642. dict.offset = [
  643. e.clientX - parseFloat(layero.css('left'))
  644. ,e.clientY - parseFloat(layero.css('top'))
  645. ];
  646. ready.moveElem.css('cursor', 'move').show();
  647. }
  648. });
  649. resizeElem.on('mousedown', function(e){
  650. e.preventDefault();
  651. dict.resizeStart = true;
  652. dict.offset = [e.clientX, e.clientY];
  653. dict.area = [
  654. layero.outerWidth()
  655. ,layero.outerHeight()
  656. ];
  657. ready.moveElem.css('cursor', 'se-resize').show();
  658. });
  659. _DOC.on('mousemove', function(e){
  660. //拖拽移动
  661. if(dict.moveStart){
  662. var X = e.clientX - dict.offset[0]
  663. ,Y = e.clientY - dict.offset[1]
  664. ,fixed = layero.css('position') === 'fixed';
  665. e.preventDefault();
  666. dict.stX = fixed ? 0 : win.scrollLeft();
  667. dict.stY = fixed ? 0 : win.scrollTop();
  668. //控制元素不被拖出窗口外
  669. if(!config.moveOut){
  670. var setRig = win.width() - layero.outerWidth() + dict.stX
  671. ,setBot = win.height() - layero.outerHeight() + dict.stY;
  672. X < dict.stX && (X = dict.stX);
  673. X > setRig && (X = setRig);
  674. Y < dict.stY && (Y = dict.stY);
  675. Y > setBot && (Y = setBot);
  676. }
  677. layero.css({
  678. left: X
  679. ,top: Y
  680. });
  681. }
  682. //Resize
  683. if(config.resize && dict.resizeStart){
  684. var X = e.clientX - dict.offset[0]
  685. ,Y = e.clientY - dict.offset[1];
  686. e.preventDefault();
  687. layer.style(that.index, {
  688. width: dict.area[0] + X
  689. ,height: dict.area[1] + Y
  690. })
  691. dict.isResize = true;
  692. }
  693. }).on('mouseup', function(e){
  694. if(dict.moveStart){
  695. delete dict.moveStart;
  696. ready.moveElem.hide();
  697. config.moveEnd && config.moveEnd();
  698. }
  699. if(dict.resizeStart){
  700. delete dict.resizeStart;
  701. ready.moveElem.hide();
  702. }
  703. });
  704. return that;
  705. };
  706. Class.pt.callback = function(){
  707. var that = this, layero = that.layero, config = that.config;
  708. that.openLayer();
  709. if(config.success){
  710. if(config.type == 2){
  711. layero.find('iframe').on('load', function(){
  712. config.success(layero, that.index);
  713. });
  714. } else {
  715. config.success(layero, that.index);
  716. }
  717. }
  718. layer.ie == 6 && that.IE6(layero);
  719. //按钮
  720. layero.find('.'+ doms[6]).children('a').on('click', function(){
  721. var index = $(this).index();
  722. if(index === 0){
  723. if(config.yes){
  724. config.yes(that.index, layero)
  725. } else if(config['btn1']){
  726. config['btn1'](that.index, layero)
  727. } else {
  728. layer.close(that.index);
  729. }
  730. } else {
  731. var close = config['btn'+(index+1)] && config['btn'+(index+1)](that.index, layero);
  732. close === false || layer.close(that.index);
  733. }
  734. });
  735. //取消
  736. function cancel(){
  737. var close = config.cancel && config.cancel(that.index, layero);
  738. close === false || layer.close(that.index);
  739. }
  740. //右上角关闭回调
  741. layero.find('.'+ doms[7]).on('click', cancel);
  742. //点遮罩关闭
  743. if(config.shadeClose){
  744. $('#layui-layer-shade'+ that.index).on('click', function(){
  745. layer.close(that.index);
  746. });
  747. }
  748. //最小化
  749. layero.find('.layui-layer-min').on('click', function(){
  750. var min = config.min && config.min(layero);
  751. min === false || layer.min(that.index, config);
  752. });
  753. //全屏/还原
  754. layero.find('.layui-layer-max').on('click', function(){
  755. if($(this).hasClass('layui-layer-maxmin')){
  756. layer.restore(that.index);
  757. config.restore && config.restore(layero);
  758. } else {
  759. layer.full(that.index, config);
  760. setTimeout(function(){
  761. config.full && config.full(layero);
  762. }, 100);
  763. }
  764. });
  765. config.end && (ready.end[that.index] = config.end);
  766. };
  767. //for ie6 恢复select
  768. ready.reselect = function(){
  769. $.each($('select'), function(index , value){
  770. var sthis = $(this);
  771. if(!sthis.parents('.'+doms[0])[0]){
  772. (sthis.attr('layer') == 1 && $('.'+doms[0]).length < 1) && sthis.removeAttr('layer').show();
  773. }
  774. sthis = null;
  775. });
  776. };
  777. Class.pt.IE6 = function(layero){
  778. //隐藏select
  779. $('select').each(function(index , value){
  780. var sthis = $(this);
  781. if(!sthis.parents('.'+doms[0])[0]){
  782. sthis.css('display') === 'none' || sthis.attr({'layer' : '1'}).hide();
  783. }
  784. sthis = null;
  785. });
  786. };
  787. //需依赖原型的对外方法
  788. Class.pt.openLayer = function(){
  789. var that = this;
  790. //置顶当前窗口
  791. layer.zIndex = that.config.zIndex;
  792. layer.setTop = function(layero){
  793. var setZindex = function(){
  794. layer.zIndex++;
  795. layero.css('z-index', layer.zIndex + 1);
  796. };
  797. layer.zIndex = parseInt(layero[0].style.zIndex);
  798. layero.on('mousedown', setZindex);
  799. return layer.zIndex;
  800. };
  801. };
  802. ready.record = function(layero){
  803. var area = [
  804. layero.width(),
  805. layero.height(),
  806. layero.position().top,
  807. layero.position().left + parseFloat(layero.css('margin-left'))
  808. ];
  809. layero.find('.layui-layer-max').addClass('layui-layer-maxmin');
  810. layero.attr({area: area});
  811. };
  812. ready.rescollbar = function(index){
  813. if(doms.html.attr('layer-full') == index){
  814. if(doms.html[0].style.removeProperty){
  815. doms.html[0].style.removeProperty('overflow');
  816. } else {
  817. doms.html[0].style.removeAttribute('overflow');
  818. }
  819. doms.html.removeAttr('layer-full');
  820. }
  821. };
  822. /** 内置成员 */
  823. window.layer = layer;
  824. //获取子iframe的DOM
  825. layer.getChildFrame = function(selector, index){
  826. index = index || $('.'+doms[4]).attr('times');
  827. return $('#'+ doms[0] + index).find('iframe').contents().find(selector);
  828. };
  829. //得到当前iframe层的索引,子iframe时使用
  830. layer.getFrameIndex = function(name){
  831. return $('#'+ name).parents('.'+doms[4]).attr('times');
  832. };
  833. //iframe层自适应宽高
  834. layer.iframeAuto = function(index){
  835. if(!index) return;
  836. var heg = layer.getChildFrame('html', index).outerHeight();
  837. var layero = $('#'+ doms[0] + index);
  838. var titHeight = layero.find(doms[1]).outerHeight() || 0;
  839. var btnHeight = layero.find('.'+doms[6]).outerHeight() || 0;
  840. layero.css({height: heg + titHeight + btnHeight});
  841. layero.find('iframe').css({height: heg});
  842. };
  843. //重置iframe url
  844. layer.iframeSrc = function(index, url){
  845. $('#'+ doms[0] + index).find('iframe').attr('src', url);
  846. };
  847. //设定层的样式
  848. layer.style = function(index, options, limit){
  849. var layero = $('#'+ doms[0] + index)
  850. ,contElem = layero.find('.layui-layer-content')
  851. ,type = layero.attr('type')
  852. ,titHeight = layero.find(doms[1]).outerHeight() || 0
  853. ,btnHeight = layero.find('.'+doms[6]).outerHeight() || 0
  854. ,minLeft = layero.attr('minLeft');
  855. if(type === ready.type[3] || type === ready.type[4]){
  856. return;
  857. }
  858. if(!limit){
  859. if(parseFloat(options.width) <= 260){
  860. options.width = 260;
  861. };
  862. if(parseFloat(options.height) - titHeight - btnHeight <= 64){
  863. options.height = 64 + titHeight + btnHeight;
  864. };
  865. }
  866. layero.css(options);
  867. btnHeight = layero.find('.'+doms[6]).outerHeight();
  868. if(type === ready.type[2]){
  869. layero.find('iframe').css({
  870. height: parseFloat(options.height) - titHeight - btnHeight
  871. });
  872. } else {
  873. contElem.css({
  874. height: parseFloat(options.height) - titHeight - btnHeight
  875. - parseFloat(contElem.css('padding-top'))
  876. - parseFloat(contElem.css('padding-bottom'))
  877. })
  878. }
  879. };
  880. //最小化
  881. layer.min = function(index, options){
  882. var layero = $('#'+ doms[0] + index)
  883. ,titHeight = layero.find(doms[1]).outerHeight() || 0
  884. ,left = layero.attr('minLeft') || (181*ready.minIndex)+'px'
  885. ,position = layero.css('position');
  886. ready.record(layero);
  887. if(ready.minLeft[0]){
  888. left = ready.minLeft[0];
  889. ready.minLeft.shift();
  890. }
  891. layero.attr('position', position);
  892. layer.style(index, {
  893. width: 180
  894. ,height: titHeight
  895. ,left: left
  896. ,top: win.height() - titHeight
  897. ,position: 'fixed'
  898. ,overflow: 'hidden'
  899. }, true);
  900. layero.find('.layui-layer-min').hide();
  901. layero.attr('type') === 'page' && layero.find(doms[4]).hide();
  902. ready.rescollbar(index);
  903. if(!layero.attr('minLeft')){
  904. ready.minIndex++;
  905. }
  906. layero.attr('minLeft', left);
  907. };
  908. //还原
  909. layer.restore = function(index){
  910. var layero = $('#'+ doms[0] + index), area = layero.attr('area').split(',');
  911. var type = layero.attr('type');
  912. layer.style(index, {
  913. width: parseFloat(area[0]),
  914. height: parseFloat(area[1]),
  915. top: parseFloat(area[2]),
  916. left: parseFloat(area[3]),
  917. position: layero.attr('position'),
  918. overflow: 'visible'
  919. }, true);
  920. layero.find('.layui-layer-max').removeClass('layui-layer-maxmin');
  921. layero.find('.layui-layer-min').show();
  922. layero.attr('type') === 'page' && layero.find(doms[4]).show();
  923. ready.rescollbar(index);
  924. };
  925. //全屏
  926. layer.full = function(index){
  927. var layero = $('#'+ doms[0] + index), timer;
  928. ready.record(layero);
  929. if(!doms.html.attr('layer-full')){
  930. doms.html.css('overflow','hidden').attr('layer-full', index);
  931. }
  932. clearTimeout(timer);
  933. timer = setTimeout(function(){
  934. var isfix = layero.css('position') === 'fixed';
  935. layer.style(index, {
  936. top: isfix ? 0 : win.scrollTop(),
  937. left: isfix ? 0 : win.scrollLeft(),
  938. width: win.width(),
  939. height: win.height()
  940. }, true);
  941. layero.find('.layui-layer-min').hide();
  942. }, 100);
  943. };
  944. //改变title
  945. layer.title = function(name, index){
  946. var title = $('#'+ doms[0] + (index||layer.index)).find(doms[1]);
  947. title.html(name);
  948. };
  949. //关闭layer总方法
  950. layer.close = function(index){
  951. var layero = $('#'+ doms[0] + index), type = layero.attr('type'), closeAnim = 'layer-anim-close';
  952. if(!layero[0]) return;
  953. var WRAP = 'layui-layer-wrap', remove = function(){
  954. if(type === ready.type[1] && layero.attr('conType') === 'object'){
  955. layero.children(':not(.'+ doms[5] +')').remove();
  956. var wrap = layero.find('.'+WRAP);
  957. for(var i = 0; i < 2; i++){
  958. wrap.unwrap();
  959. }
  960. wrap.css('display', wrap.data('display')).removeClass(WRAP);
  961. } else {
  962. //低版本IE 回收 iframe
  963. if(type === ready.type[2]){
  964. try {
  965. var iframe = $('#'+doms[4]+index)[0];
  966. iframe.contentWindow.document.write('');
  967. iframe.contentWindow.close();
  968. layero.find('.'+doms[5])[0].removeChild(iframe);
  969. } catch(e){}
  970. }
  971. layero[0].innerHTML = '';
  972. layero.remove();
  973. }
  974. };
  975. if(layero.data('anim')){
  976. layero.addClass(closeAnim);
  977. }
  978. $('#layui-layer-moves, #layui-layer-shade' + index).remove();
  979. layer.ie == 6 && ready.reselect();
  980. ready.rescollbar(index);
  981. typeof ready.end[index] === 'function' && ready.end[index]();
  982. delete ready.end[index];
  983. if(layero.attr('minLeft')){
  984. ready.minIndex--;
  985. ready.minLeft.push(layero.attr('minLeft'));
  986. }
  987. setTimeout(function(){
  988. remove();
  989. }, ((layer.ie && layer.ie < 10) || !layero.data('anim')) ? 0 : 200);
  990. };
  991. //关闭所有层
  992. layer.closeAll = function(type){
  993. $.each($('.'+doms[0]), function(){
  994. var othis = $(this);
  995. var is = type ? (othis.attr('type') === type) : 1;
  996. is && layer.close(othis.attr('times'));
  997. is = null;
  998. });
  999. };
  1000. /**
  1001. 拓展模块,layui开始合并在一起
  1002. */
  1003. var cache = layer.cache||{}, skin = function(type){
  1004. return (cache.skin ? (' ' + cache.skin + ' ' + cache.skin + '-'+type) : '');
  1005. };
  1006. //仿系统prompt
  1007. layer.prompt = function(options, yes){
  1008. var style = '';
  1009. options = options || {};
  1010. if(typeof options === 'function') yes = options;
  1011. if(options.area){
  1012. var area = options.area;
  1013. style = 'style="width: '+ area[0] +'; height: '+ area[1] + ';"';
  1014. delete options.area;
  1015. }
  1016. var prompt, content = options.formType == 2 ? '<textarea class="layui-layer-input"' + style +'>' + (options.value||'') +'</textarea>' : function(){
  1017. return '<input type="'+ (options.formType == 1 ? 'password' : 'text') +'" class="layui-layer-input" value="'+ (options.value||'') +'">';
  1018. }();
  1019. return layer.open($.extend({
  1020. type: 1
  1021. ,btn: ['&#x786E;&#x5B9A;','&#x53D6;&#x6D88;']
  1022. ,content: content
  1023. ,skin: 'layui-layer-prompt' + skin('prompt')
  1024. ,maxWidth: win.width()
  1025. ,success: function(layero){
  1026. prompt = layero.find('.layui-layer-input');
  1027. prompt.focus();
  1028. }
  1029. ,resize: false
  1030. ,yes: function(index){
  1031. var value = prompt.val();
  1032. if(value === ''){
  1033. prompt.focus();
  1034. } else if(value.length > (options.maxlength||500)) {
  1035. layer.tips('&#x6700;&#x591A;&#x8F93;&#x5165;'+ (options.maxlength || 500) +'&#x4E2A;&#x5B57;&#x6570;', prompt, {tips: 1});
  1036. } else {
  1037. yes && yes(value, index, prompt);
  1038. }
  1039. }
  1040. }, options));
  1041. };
  1042. //tab层
  1043. layer.tab = function(options){
  1044. options = options || {};
  1045. var tab = options.tab || {};
  1046. return layer.open($.extend({
  1047. type: 1,
  1048. skin: 'layui-layer-tab' + skin('tab'),
  1049. resize: false,
  1050. title: function(){
  1051. var len = tab.length, ii = 1, str = '';
  1052. if(len > 0){
  1053. str = '<span class="layui-layer-tabnow">'+ tab[0].title +'</span>';
  1054. for(; ii < len; ii++){
  1055. str += '<span>'+ tab[ii].title +'</span>';
  1056. }
  1057. }
  1058. return str;
  1059. }(),
  1060. content: '<ul class="layui-layer-tabmain">'+ function(){
  1061. var len = tab.length, ii = 1, str = '';
  1062. if(len > 0){
  1063. str = '<li class="layui-layer-tabli xubox_tab_layer">'+ (tab[0].content || 'no content') +'</li>';
  1064. for(; ii < len; ii++){
  1065. str += '<li class="layui-layer-tabli">'+ (tab[ii].content || 'no content') +'</li>';
  1066. }
  1067. }
  1068. return str;
  1069. }() +'</ul>',
  1070. success: function(layero){
  1071. var btn = layero.find('.layui-layer-title').children();
  1072. var main = layero.find('.layui-layer-tabmain').children();
  1073. btn.on('mousedown', function(e){
  1074. e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;
  1075. var othis = $(this), index = othis.index();
  1076. othis.addClass('layui-layer-tabnow').siblings().removeClass('layui-layer-tabnow');
  1077. main.eq(index).show().siblings().hide();
  1078. typeof options.change === 'function' && options.change(index);
  1079. });
  1080. }
  1081. }, options));
  1082. };
  1083. //相册层
  1084. layer.photos = function(options, loop, key){
  1085. var dict = {};
  1086. options = options || {};
  1087. if(!options.photos) return;
  1088. var type = options.photos.constructor === Object;
  1089. var photos = type ? options.photos : {}, data = photos.data || [];
  1090. var start = photos.start || 0;
  1091. dict.imgIndex = (start|0) + 1;
  1092. options.img = options.img || 'img';
  1093. if(!type){ //页面直接获取
  1094. var parent = $(options.photos), pushData = function(){
  1095. data = [];
  1096. parent.find(options.img).each(function(index){
  1097. var othis = $(this);
  1098. othis.attr('layer-index', index);
  1099. data.push({
  1100. alt: othis.attr('alt'),
  1101. pid: othis.attr('layer-pid'),
  1102. src: othis.attr('layer-src') || othis.attr('src'),
  1103. thumb: othis.attr('src')
  1104. });
  1105. })
  1106. };
  1107. pushData();
  1108. if (data.length === 0) return;
  1109. loop || parent.on('click', options.img, function(){
  1110. var othis = $(this), index = othis.attr('layer-index');
  1111. layer.photos($.extend(options, {
  1112. photos: {
  1113. start: index,
  1114. data: data,
  1115. tab: options.tab
  1116. },
  1117. full: options.full
  1118. }), true);
  1119. pushData();
  1120. })
  1121. //不直接弹出
  1122. if(!loop) return;
  1123. } else if (data.length === 0){
  1124. return layer.msg('&#x6CA1;&#x6709;&#x56FE;&#x7247;');
  1125. }
  1126. //上一张
  1127. dict.imgprev = function(key){
  1128. dict.imgIndex--;
  1129. if(dict.imgIndex < 1){
  1130. dict.imgIndex = data.length;
  1131. }
  1132. dict.tabimg(key);
  1133. };
  1134. //下一张
  1135. dict.imgnext = function(key,errorMsg){
  1136. dict.imgIndex++;
  1137. if(dict.imgIndex > data.length){
  1138. dict.imgIndex = 1;
  1139. if (errorMsg) {return};
  1140. }
  1141. dict.tabimg(key)
  1142. };
  1143. //方向键
  1144. dict.keyup = function(event){
  1145. if(!dict.end){
  1146. var code = event.keyCode;
  1147. event.preventDefault();
  1148. if(code === 37){
  1149. dict.imgprev(true);
  1150. } else if(code === 39) {
  1151. dict.imgnext(true);
  1152. } else if(code === 27) {
  1153. layer.close(dict.index);
  1154. }
  1155. }
  1156. }
  1157. //切换
  1158. dict.tabimg = function(key){
  1159. if(data.length <= 1) return;
  1160. photos.start = dict.imgIndex - 1;
  1161. layer.close(dict.index);
  1162. layer.photos(options, true, key);
  1163. }
  1164. //一些动作
  1165. dict.event = function(){
  1166. dict.bigimg.hover(function(){
  1167. dict.imgsee.show();
  1168. }, function(){
  1169. dict.imgsee.hide();
  1170. });
  1171. dict.bigimg.find('.layui-layer-imgprev').on('click', function(event){
  1172. event.preventDefault();
  1173. dict.imgprev();
  1174. });
  1175. dict.bigimg.find('.layui-layer-imgnext').on('click', function(event){
  1176. event.preventDefault();
  1177. dict.imgnext();
  1178. });
  1179. $(document).on('keyup', dict.keyup);
  1180. };
  1181. //图片预加载
  1182. function loadImage(url, callback, error) {
  1183. var img = new Image();
  1184. img.src = url;
  1185. if(img.complete){
  1186. return callback(img);
  1187. }
  1188. img.onload = function(){
  1189. img.onload = null;
  1190. callback(img);
  1191. };
  1192. img.onerror = function(e){
  1193. img.onerror = null;
  1194. error(e);
  1195. };
  1196. };
  1197. dict.loadi = layer.load(1, {
  1198. shade: 'shade' in options ? false : 0.9,
  1199. scrollbar: false
  1200. });
  1201. loadImage(data[start].src, function(img){
  1202. layer.close(dict.loadi);
  1203. dict.index = layer.open($.extend({
  1204. type: 1,
  1205. area: function(){
  1206. var imgarea = [img.width, img.height];
  1207. var winarea = [$(window).width() - 100, $(window).height() - 100];
  1208. //如果 实际图片的宽或者高比 屏幕大(那么进行缩放)
  1209. if(!options.full && (imgarea[0]>winarea[0]||imgarea[1]>winarea[1])){
  1210. var wh = [imgarea[0]/winarea[0],imgarea[1]/winarea[1]];//取宽度缩放比例、高度缩放比例
  1211. if(wh[0] > wh[1]){//取缩放比例最大的进行缩放
  1212. imgarea[0] = imgarea[0]/wh[0];
  1213. imgarea[1] = imgarea[1]/wh[0];
  1214. } else if(wh[0] < wh[1]){
  1215. imgarea[0] = imgarea[0]/wh[1];
  1216. imgarea[1] = imgarea[1]/wh[1];
  1217. }
  1218. }
  1219. return [imgarea[0]+'px', imgarea[1]+'px'];
  1220. }(),
  1221. title: false,
  1222. shade: 0.9,
  1223. shadeClose: true,
  1224. closeBtn: false,
  1225. move: '.layui-layer-phimg img',
  1226. moveType: 1,
  1227. scrollbar: false,
  1228. moveOut: true,
  1229. anim: Math.random()*5|0,
  1230. skin: 'layui-layer-photos' + skin('photos'),
  1231. content: '<div class="layui-layer-phimg">'
  1232. +'<img src="'+ data[start].src +'" alt="'+ (data[start].alt||'') +'" layer-pid="'+ data[start].pid +'">'
  1233. +'<div class="layui-layer-imgsee">'
  1234. +(data.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>' : '')
  1235. +'<div class="layui-layer-imgbar" style="display:'+ (key ? 'block' : '') +'"><span class="layui-layer-imgtit"><a href="javascript:;">'+ (data[start].alt||'') +'</a><em>'+ dict.imgIndex +'/'+ data.length +'</em></span></div>'
  1236. +'</div>'
  1237. +'</div>',
  1238. success: function(layero, index){
  1239. dict.bigimg = layero.find('.layui-layer-phimg');
  1240. dict.imgsee = layero.find('.layui-layer-imguide,.layui-layer-imgbar');
  1241. dict.event(layero);
  1242. options.tab && options.tab(data[start], layero);
  1243. }, end: function(){
  1244. dict.end = true;
  1245. $(document).off('keyup', dict.keyup);
  1246. }
  1247. }, options));
  1248. }, function(){
  1249. layer.close(dict.loadi);
  1250. layer.msg('&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;<br>&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x67E5;&#x770B;&#x4E0B;&#x4E00;&#x5F20;&#xFF1F;', {
  1251. time: 30000,
  1252. btn: ['&#x4E0B;&#x4E00;&#x5F20;', '&#x4E0D;&#x770B;&#x4E86;'],
  1253. yes: function(){
  1254. data.length > 1 && dict.imgnext(true,true);
  1255. }
  1256. });
  1257. });
  1258. };
  1259. //主入口
  1260. ready.run = function(_$){
  1261. $ = _$;
  1262. win = $(window);
  1263. doms.html = $('html');
  1264. layer.open = function(deliver){
  1265. var o = new Class(deliver);
  1266. return o.index;
  1267. };
  1268. };
  1269. //加载方式
  1270. window.layui && layui.define ? (
  1271. layer.ready()
  1272. ,layui.define('jquery', function(exports){ //layui加载
  1273. layer.path = layui.cache.dir;
  1274. ready.run(layui.jquery);
  1275. //暴露模块
  1276. window.layer = layer;
  1277. exports('layer', layer);
  1278. })
  1279. ) : (
  1280. typeof define === 'function' ? define('layer',['jquery'], function(){ //requirejs加载
  1281. ready.run(window.jQuery);
  1282. return layer;
  1283. }) : function(){ //普通script标签加载
  1284. ready.run(window.jQuery);
  1285. layer.ready();
  1286. }()
  1287. );
  1288. }(window);
  1289. /*
  1290. * Toastr
  1291. * Copyright 2012-2015
  1292. * Authors: John Papa, Hans Fjällemark, and Tim Ferrell.
  1293. * All Rights Reserved.
  1294. * Use, reproduction, distribution, and modification of this code is subject to the terms and
  1295. * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php
  1296. *
  1297. * ARIA Support: Greta Krafsig
  1298. *
  1299. * Project: https://github.com/CodeSeven/toastr
  1300. */
  1301. /* global define */
  1302. (function (define) {
  1303. define('toastr',['jquery'], function ($) {
  1304. return (function () {
  1305. var $container;
  1306. var listener;
  1307. var toastId = 0;
  1308. var toastType = {
  1309. error: 'error',
  1310. info: 'info',
  1311. success: 'success',
  1312. warning: 'warning'
  1313. };
  1314. var toastr = {
  1315. clear: clear,
  1316. remove: remove,
  1317. error: error,
  1318. getContainer: getContainer,
  1319. info: info,
  1320. options: {},
  1321. subscribe: subscribe,
  1322. success: success,
  1323. version: '2.1.3',
  1324. warning: warning
  1325. };
  1326. var previousToast;
  1327. return toastr;
  1328. ////////////////
  1329. function error(message, title, optionsOverride) {
  1330. return notify({
  1331. type: toastType.error,
  1332. iconClass: getOptions().iconClasses.error,
  1333. message: message,
  1334. optionsOverride: optionsOverride,
  1335. title: title
  1336. });
  1337. }
  1338. function getContainer(options, create) {
  1339. if (!options) { options = getOptions(); }
  1340. $container = $('#' + options.containerId);
  1341. if ($container.length) {
  1342. return $container;
  1343. }
  1344. if (create) {
  1345. $container = createContainer(options);
  1346. }
  1347. return $container;
  1348. }
  1349. function info(message, title, optionsOverride) {
  1350. return notify({
  1351. type: toastType.info,
  1352. iconClass: getOptions().iconClasses.info,
  1353. message: message,
  1354. optionsOverride: optionsOverride,
  1355. title: title
  1356. });
  1357. }
  1358. function subscribe(callback) {
  1359. listener = callback;
  1360. }
  1361. function success(message, title, optionsOverride) {
  1362. return notify({
  1363. type: toastType.success,
  1364. iconClass: getOptions().iconClasses.success,
  1365. message: message,
  1366. optionsOverride: optionsOverride,
  1367. title: title
  1368. });
  1369. }
  1370. function warning(message, title, optionsOverride) {
  1371. return notify({
  1372. type: toastType.warning,
  1373. iconClass: getOptions().iconClasses.warning,
  1374. message: message,
  1375. optionsOverride: optionsOverride,
  1376. title: title
  1377. });
  1378. }
  1379. function clear($toastElement, clearOptions) {
  1380. var options = getOptions();
  1381. if (!$container) { getContainer(options); }
  1382. if (!clearToast($toastElement, options, clearOptions)) {
  1383. clearContainer(options);
  1384. }
  1385. }
  1386. function remove($toastElement) {
  1387. var options = getOptions();
  1388. if (!$container) { getContainer(options); }
  1389. if ($toastElement && $(':focus', $toastElement).length === 0) {
  1390. removeToast($toastElement);
  1391. return;
  1392. }
  1393. if ($container.children().length) {
  1394. $container.remove();
  1395. }
  1396. }
  1397. // internal functions
  1398. function clearContainer (options) {
  1399. var toastsToClear = $container.children();
  1400. for (var i = toastsToClear.length - 1; i >= 0; i--) {
  1401. clearToast($(toastsToClear[i]), options);
  1402. }
  1403. }
  1404. function clearToast ($toastElement, options, clearOptions) {
  1405. var force = clearOptions && clearOptions.force ? clearOptions.force : false;
  1406. if ($toastElement && (force || $(':focus', $toastElement).length === 0)) {
  1407. $toastElement[options.hideMethod]({
  1408. duration: options.hideDuration,
  1409. easing: options.hideEasing,
  1410. complete: function () { removeToast($toastElement); }
  1411. });
  1412. return true;
  1413. }
  1414. return false;
  1415. }
  1416. function createContainer(options) {
  1417. $container = $('<div/>')
  1418. .attr('id', options.containerId)
  1419. .addClass(options.positionClass);
  1420. $container.appendTo($(options.target));
  1421. return $container;
  1422. }
  1423. function getDefaults() {
  1424. return {
  1425. tapToDismiss: true,
  1426. toastClass: 'toast',
  1427. containerId: 'toast-container',
  1428. debug: false,
  1429. showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery
  1430. showDuration: 300,
  1431. showEasing: 'swing', //swing and linear are built into jQuery
  1432. onShown: undefined,
  1433. hideMethod: 'fadeOut',
  1434. hideDuration: 1000,
  1435. hideEasing: 'swing',
  1436. onHidden: undefined,
  1437. closeMethod: false,
  1438. closeDuration: false,
  1439. closeEasing: false,
  1440. closeOnHover: true,
  1441. extendedTimeOut: 1000,
  1442. iconClasses: {
  1443. error: 'toast-error',
  1444. info: 'toast-info',
  1445. success: 'toast-success',
  1446. warning: 'toast-warning'
  1447. },
  1448. iconClass: 'toast-info',
  1449. positionClass: 'toast-top-right',
  1450. timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky
  1451. titleClass: 'toast-title',
  1452. messageClass: 'toast-message',
  1453. escapeHtml: false,
  1454. target: 'body',
  1455. closeHtml: '<button type="button">&times;</button>',
  1456. closeClass: 'toast-close-button',
  1457. newestOnTop: true,
  1458. preventDuplicates: false,
  1459. progressBar: false,
  1460. progressClass: 'toast-progress',
  1461. rtl: false
  1462. };
  1463. }
  1464. function publish(args) {
  1465. if (!listener) { return; }
  1466. listener(args);
  1467. }
  1468. function notify(map) {
  1469. var options = getOptions();
  1470. var iconClass = map.iconClass || options.iconClass;
  1471. if (typeof (map.optionsOverride) !== 'undefined') {
  1472. options = $.extend(options, map.optionsOverride);
  1473. iconClass = map.optionsOverride.iconClass || iconClass;
  1474. }
  1475. if (shouldExit(options, map)) { return; }
  1476. toastId++;
  1477. $container = getContainer(options, true);
  1478. var intervalId = null;
  1479. var $toastElement = $('<div/>');
  1480. var $titleElement = $('<div/>');
  1481. var $messageElement = $('<div/>');
  1482. var $progressElement = $('<div/>');
  1483. var $closeElement = $(options.closeHtml);
  1484. var progressBar = {
  1485. intervalId: null,
  1486. hideEta: null,
  1487. maxHideTime: null
  1488. };
  1489. var response = {
  1490. toastId: toastId,
  1491. state: 'visible',
  1492. startTime: new Date(),
  1493. options: options,
  1494. map: map
  1495. };
  1496. personalizeToast();
  1497. displayToast();
  1498. handleEvents();
  1499. publish(response);
  1500. if (options.debug && console) {
  1501. console.log(response);
  1502. }
  1503. return $toastElement;
  1504. function escapeHtml(source) {
  1505. if (source == null) {
  1506. source = '';
  1507. }
  1508. return source
  1509. .replace(/&/g, '&amp;')
  1510. .replace(/"/g, '&quot;')
  1511. .replace(/'/g, '&#39;')
  1512. .replace(/</g, '&lt;')
  1513. .replace(/>/g, '&gt;');
  1514. }
  1515. function personalizeToast() {
  1516. setIcon();
  1517. setTitle();
  1518. setMessage();
  1519. setCloseButton();
  1520. setProgressBar();
  1521. setRTL();
  1522. setSequence();
  1523. setAria();
  1524. }
  1525. function setAria() {
  1526. var ariaValue = '';
  1527. switch (map.iconClass) {
  1528. case 'toast-success':
  1529. case 'toast-info':
  1530. ariaValue = 'polite';
  1531. break;
  1532. default:
  1533. ariaValue = 'assertive';
  1534. }
  1535. $toastElement.attr('aria-live', ariaValue);
  1536. }
  1537. function handleEvents() {
  1538. if (options.closeOnHover) {
  1539. $toastElement.hover(stickAround, delayedHideToast);
  1540. }
  1541. if (!options.onclick && options.tapToDismiss) {
  1542. $toastElement.click(hideToast);
  1543. }
  1544. if (options.closeButton && $closeElement) {
  1545. $closeElement.click(function (event) {
  1546. if (event.stopPropagation) {
  1547. event.stopPropagation();
  1548. } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {
  1549. event.cancelBubble = true;
  1550. }
  1551. if (options.onCloseClick) {
  1552. options.onCloseClick(event);
  1553. }
  1554. hideToast(true);
  1555. });
  1556. }
  1557. if (options.onclick) {
  1558. $toastElement.click(function (event) {
  1559. options.onclick(event);
  1560. hideToast();
  1561. });
  1562. }
  1563. }
  1564. function displayToast() {
  1565. $toastElement.hide();
  1566. $toastElement[options.showMethod](
  1567. {duration: options.showDuration, easing: options.showEasing, complete: options.onShown}
  1568. );
  1569. if (options.timeOut > 0) {
  1570. intervalId = setTimeout(hideToast, options.timeOut);
  1571. progressBar.maxHideTime = parseFloat(options.timeOut);
  1572. progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
  1573. if (options.progressBar) {
  1574. progressBar.intervalId = setInterval(updateProgress, 10);
  1575. }
  1576. }
  1577. }
  1578. function setIcon() {
  1579. if (map.iconClass) {
  1580. $toastElement.addClass(options.toastClass).addClass(iconClass);
  1581. }
  1582. }
  1583. function setSequence() {
  1584. if (options.newestOnTop) {
  1585. $container.prepend($toastElement);
  1586. } else {
  1587. $container.append($toastElement);
  1588. }
  1589. }
  1590. function setTitle() {
  1591. if (map.title) {
  1592. var suffix = map.title;
  1593. if (options.escapeHtml) {
  1594. suffix = escapeHtml(map.title);
  1595. }
  1596. $titleElement.append(suffix).addClass(options.titleClass);
  1597. $toastElement.append($titleElement);
  1598. }
  1599. }
  1600. function setMessage() {
  1601. if (map.message) {
  1602. var suffix = map.message;
  1603. if (options.escapeHtml) {
  1604. suffix = escapeHtml(map.message);
  1605. }
  1606. $messageElement.append(suffix).addClass(options.messageClass);
  1607. $toastElement.append($messageElement);
  1608. }
  1609. }
  1610. function setCloseButton() {
  1611. if (options.closeButton) {
  1612. $closeElement.addClass(options.closeClass).attr('role', 'button');
  1613. $toastElement.prepend($closeElement);
  1614. }
  1615. }
  1616. function setProgressBar() {
  1617. if (options.progressBar) {
  1618. $progressElement.addClass(options.progressClass);
  1619. $toastElement.prepend($progressElement);
  1620. }
  1621. }
  1622. function setRTL() {
  1623. if (options.rtl) {
  1624. $toastElement.addClass('rtl');
  1625. }
  1626. }
  1627. function shouldExit(options, map) {
  1628. if (options.preventDuplicates) {
  1629. if (map.message === previousToast) {
  1630. return true;
  1631. } else {
  1632. previousToast = map.message;
  1633. }
  1634. }
  1635. return false;
  1636. }
  1637. function hideToast(override) {
  1638. var method = override && options.closeMethod !== false ? options.closeMethod : options.hideMethod;
  1639. var duration = override && options.closeDuration !== false ?
  1640. options.closeDuration : options.hideDuration;
  1641. var easing = override && options.closeEasing !== false ? options.closeEasing : options.hideEasing;
  1642. if ($(':focus', $toastElement).length && !override) {
  1643. return;
  1644. }
  1645. clearTimeout(progressBar.intervalId);
  1646. return $toastElement[method]({
  1647. duration: duration,
  1648. easing: easing,
  1649. complete: function () {
  1650. removeToast($toastElement);
  1651. clearTimeout(intervalId);
  1652. if (options.onHidden && response.state !== 'hidden') {
  1653. options.onHidden();
  1654. }
  1655. response.state = 'hidden';
  1656. response.endTime = new Date();
  1657. publish(response);
  1658. }
  1659. });
  1660. }
  1661. function delayedHideToast() {
  1662. if (options.timeOut > 0 || options.extendedTimeOut > 0) {
  1663. intervalId = setTimeout(hideToast, options.extendedTimeOut);
  1664. progressBar.maxHideTime = parseFloat(options.extendedTimeOut);
  1665. progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
  1666. }
  1667. }
  1668. function stickAround() {
  1669. clearTimeout(intervalId);
  1670. progressBar.hideEta = 0;
  1671. $toastElement.stop(true, true)[options.showMethod](
  1672. {duration: options.showDuration, easing: options.showEasing}
  1673. );
  1674. }
  1675. function updateProgress() {
  1676. var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100;
  1677. $progressElement.width(percentage + '%');
  1678. }
  1679. }
  1680. function getOptions() {
  1681. return $.extend({}, getDefaults(), toastr.options);
  1682. }
  1683. function removeToast($toastElement) {
  1684. if (!$container) { $container = getContainer(); }
  1685. if ($toastElement.is(':visible')) {
  1686. return;
  1687. }
  1688. $toastElement.remove();
  1689. $toastElement = null;
  1690. if ($container.children().length === 0) {
  1691. $container.remove();
  1692. previousToast = undefined;
  1693. }
  1694. }
  1695. })();
  1696. });
  1697. }(typeof define === 'function' && define.amd ? define : function (deps, factory) {
  1698. if (typeof module !== 'undefined' && module.exports) { //Node
  1699. module.exports = factory(require('jquery'));
  1700. } else {
  1701. window.toastr = factory(window.jQuery);
  1702. }
  1703. }));
  1704. define('backend',['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'config'], function ($, undefined, Toastr, Layer, Lang, Config) {
  1705. var Backend = {
  1706. config: {
  1707. //toastr默认配置
  1708. toastr: {
  1709. "closeButton": true,
  1710. "debug": false,
  1711. "newestOnTop": false,
  1712. "progressBar": false,
  1713. "positionClass": "toast-top-center",
  1714. "preventDuplicates": false,
  1715. "onclick": null,
  1716. "showDuration": "300",
  1717. "hideDuration": "1000",
  1718. "timeOut": "5000",
  1719. "extendedTimeOut": "1000",
  1720. "showEasing": "swing",
  1721. "hideEasing": "linear",
  1722. "showMethod": "fadeIn",
  1723. "hideMethod": "fadeOut"
  1724. }
  1725. },
  1726. api: {
  1727. ajax: function (options, success, failure) {
  1728. var index = Backend.api.layer.load();
  1729. options = $.extend({
  1730. type: "POST",
  1731. dataType: 'json',
  1732. success: function (ret) {
  1733. Backend.api.layer.close(index);
  1734. if (ret.hasOwnProperty("code")) {
  1735. var data = ret.hasOwnProperty("data") && ret.data != "" ? ret.data : null;
  1736. var msg = ret.hasOwnProperty("msg") && ret.msg != "" ? ret.msg : "";
  1737. if (ret.code === 1) {
  1738. if (typeof success == 'function') {
  1739. var onAfterResult = success.call(undefined, data);
  1740. if (!onAfterResult) {
  1741. return false;
  1742. }
  1743. }
  1744. Toastr.success(msg ? msg : __('Operation completed'));
  1745. } else {
  1746. Toastr.error(msg ? msg : __('Operation failed'));
  1747. }
  1748. } else {
  1749. Toastr.error(__('Unknown data format'));
  1750. }
  1751. }, error: function () {
  1752. Backend.api.layer.close(index);
  1753. Toastr.error(__('Network error'));
  1754. }
  1755. }, options);
  1756. $.ajax(options);
  1757. },
  1758. //修复URL
  1759. fixurl: function (url) {
  1760. if (url.substr(0, 1) !== "/") {
  1761. var r = new RegExp('^(?:[a-z]+:)?//', 'i');
  1762. if (!r.test(url)) {
  1763. url = Config.moduleurl + "/" + url;
  1764. }
  1765. }
  1766. return url;
  1767. },
  1768. //查询Url参数
  1769. query: function (name, url) {
  1770. if (!url) {
  1771. url = window.location.href;
  1772. }
  1773. name = name.replace(/[\[\]]/g, "\\$&");
  1774. var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
  1775. results = regex.exec(url);
  1776. if (!results)
  1777. return null;
  1778. if (!results[2])
  1779. return '';
  1780. return decodeURIComponent(results[2].replace(/\+/g, " "));
  1781. },
  1782. //上传文件
  1783. upload: function (file, callback) {
  1784. var data = new FormData();
  1785. data.append("file", file);
  1786. $.ajax({
  1787. url: "ajax/upload",
  1788. data: data,
  1789. cache: false,
  1790. contentType: false,
  1791. processData: false,
  1792. type: 'POST',
  1793. dataType: 'json',
  1794. success: function (ret) {
  1795. if (ret.hasOwnProperty("code")) {
  1796. var data = ret.hasOwnProperty("data") && ret.data != "" ? ret.data : null;
  1797. var msg = ret.hasOwnProperty("msg") && ret.msg != "" ? ret.msg : "";
  1798. if (ret.code === 1) {
  1799. if (typeof callback == 'function') {
  1800. var onAfterResult = success.call(undefined, data);
  1801. if (!onAfterResult) {
  1802. return false;
  1803. }
  1804. }
  1805. if ($('.summernote').size() > 0 && data && typeof data.url !== 'undefined') {
  1806. $('.summernote').summernote("insertImage", data.url, 'filename');
  1807. }
  1808. Toastr.success(__('Operation completed'));
  1809. } else {
  1810. Toastr.error(msg ? msg : __('Operation failed'));
  1811. }
  1812. } else {
  1813. Toastr.error(__('Unknown data format'));
  1814. }
  1815. }, error: function () {
  1816. Toastr.error(__('Network error'));
  1817. }
  1818. });
  1819. },
  1820. open: function (url, title, options) {
  1821. title = title == undefined ? "" : title;
  1822. url = Backend.api.fixurl(url);
  1823. url = url + (url.indexOf("?") > -1 ? "&" : "?") + "dialog=1";
  1824. var area;
  1825. if ($(window).width() < 800) {
  1826. area = ["95%", "95%"];
  1827. } else {
  1828. area = ['800px', '600px'];
  1829. }
  1830. Backend.api.layer.open($.extend({
  1831. type: 2,
  1832. title: title,
  1833. shadeClose: true,
  1834. shade: false,
  1835. maxmin: true,
  1836. moveOut: true,
  1837. area: area,
  1838. content: url,
  1839. zIndex: Backend.api.layer.zIndex,
  1840. skin: 'layui-layer-noborder',
  1841. success: function (layero, index) {
  1842. //$(layero).removeClass("layui-layer-border");
  1843. Backend.api.layer.setTop(layero);
  1844. var frame = Backend.api.layer.getChildFrame('html', index);
  1845. var layerfooter = frame.find(".layer-footer");
  1846. Backend.api.layerfooter(layero, index);
  1847. //绑定事件
  1848. if (layerfooter.size() > 0) {
  1849. // 监听窗口内的元素及属性变化
  1850. // Firefox和Chrome早期版本中带有前缀
  1851. var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver
  1852. // 选择目标节点
  1853. var target = layerfooter[0];
  1854. // 创建观察者对象
  1855. var observer = new MutationObserver(function (mutations) {
  1856. Backend.api.layerfooter(layero, index);
  1857. mutations.forEach(function (mutation) {
  1858. });
  1859. });
  1860. // 配置观察选项:
  1861. var config = {attributes: true, childList: true, characterData: true, subtree: true}
  1862. // 传入目标节点和观察选项
  1863. observer.observe(target, config);
  1864. // 随后,你还可以停止观察
  1865. // observer.disconnect();
  1866. }
  1867. }
  1868. }, options ? options : {}));
  1869. return false;
  1870. },
  1871. layerfooter: function (layero, index) {
  1872. var frame = Backend.api.layer.getChildFrame('html', index);
  1873. var layerfooter = frame.find(".layer-footer");
  1874. if (layerfooter.size() > 0) {
  1875. $(".layui-layer-footer", layero).remove();
  1876. var footer = $("<div />").addClass('layui-layer-btn layui-layer-footer');
  1877. footer.html(layerfooter.html());
  1878. if ($(".row", footer).size() === 0) {
  1879. $(">", footer).wrapAll("<div class='row'></div>");
  1880. }
  1881. footer.insertAfter(layero.find('.layui-layer-content'));
  1882. }
  1883. var heg = frame.outerHeight();
  1884. var titHeight = layero.find('.layui-layer-title').outerHeight() || 0;
  1885. var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0;
  1886. var oldheg = heg + titHeight + btnHeight;
  1887. var maxheg = 600;
  1888. if (frame.outerWidth() < 768) {
  1889. maxheg = $(window).height() - 28;
  1890. }
  1891. // 如果有.layer-footer或窗口小于600则重新排
  1892. if (layerfooter.size() > 0 || oldheg < maxheg) {
  1893. var footerHeight = layero.find('.layui-layer-footer').outerHeight() || 0;
  1894. footerHeight = 0;
  1895. if (oldheg >= maxheg) {
  1896. heg = Math.min(maxheg, oldheg) - titHeight - btnHeight - footerHeight;
  1897. }
  1898. layero.css({height: heg + titHeight + btnHeight + footerHeight});
  1899. layero.find("iframe").css({height: heg});
  1900. }
  1901. if (layerfooter.size() > 0) {
  1902. footer.on("click", ".btn", function () {
  1903. if ($(this).hasClass("disabled") || $(this).parent().hasClass("disabled")) {
  1904. //return;
  1905. }
  1906. $(".btn:eq(" + $(this).index() + ")", layerfooter).trigger("click");
  1907. });
  1908. }
  1909. },
  1910. sidebar: function (params) {
  1911. colorArr = ['red', 'green', 'yellow', 'blue', 'teal', 'orange', 'purple'];
  1912. $colorNums = colorArr.length;
  1913. badgeList = {};
  1914. $.each(params, function (k, v) {
  1915. if (k.indexOf('/') > -1)
  1916. {
  1917. $url = Backend.api.fixurl(k);
  1918. } else
  1919. {
  1920. $url = k;
  1921. }
  1922. if ($.isArray(v))
  1923. {
  1924. $nums = typeof v[0] !== 'undefined' ? v[0] : 0;
  1925. $color = typeof v[1] !== 'undefined' ? v[1] : colorArr[(!isNaN($nums) ? $nums : $nums.length) % $colorNums];
  1926. $class = typeof v[2] !== 'undefined' ? v[2] : 'label';
  1927. } else
  1928. {
  1929. $nums = v;
  1930. $color = colorArr[(!isNaN($nums) ? $nums : $nums.length) % $colorNums];
  1931. $class = 'label';
  1932. }
  1933. //必须nums大于0才显示
  1934. badgeList[$url] = $nums > 0 ? '<small class="' + $class + ' pull-right bg-' + $color + '">' + $nums + '</small>' : '';
  1935. });
  1936. $.each(badgeList, function (k, v) {
  1937. var anchor = $(".treeview li a[addtabs][url='" + k + "']");
  1938. if (anchor) {
  1939. $(".pull-right-container", anchor).html(v);
  1940. $(".nav-addtabs li a[node-id='" + anchor.attr("addtabs") + "'] .pull-right-container").html(v);
  1941. }
  1942. });
  1943. },
  1944. success: function (options, callback) {
  1945. var type = typeof options === 'function';
  1946. if (type) {
  1947. callback = options;
  1948. }
  1949. return Backend.api.layer.msg(__('Operation completed'), $.extend({
  1950. offset: 0, icon: 1
  1951. }, type ? {} : options), callback);
  1952. },
  1953. error: function (options, callback) {
  1954. var type = typeof options === 'function';
  1955. if (type) {
  1956. callback = options;
  1957. }
  1958. return Backend.api.layer.msg(__('Operation failed'), $.extend({
  1959. offset: 0, icon: 2
  1960. }, type ? {} : options), callback);
  1961. },
  1962. toastr: Toastr,
  1963. layer: Layer
  1964. },
  1965. lang: function () {
  1966. var args = arguments,
  1967. string = args[0],
  1968. i = 1;
  1969. string = string.toLowerCase();
  1970. //string = typeof Lang[string] != 'undefined' ? Lang[string] : string;
  1971. if (typeof Lang[string] != 'undefined') {
  1972. if (typeof Lang[string] == 'object')
  1973. return Lang[string];
  1974. string = Lang[string];
  1975. } else if (string.indexOf('.') !== -1) {
  1976. var arr = string.split('.');
  1977. var current = Lang[arr[0]];
  1978. for (var i = 1; i < arr.length; i++) {
  1979. current = typeof current[arr[i]] != 'undefined' ? current[arr[i]] : '';
  1980. if (typeof current != 'object')
  1981. break;
  1982. }
  1983. if (typeof current == 'object')
  1984. return current;
  1985. string = current;
  1986. } else {
  1987. string = args[0];
  1988. }
  1989. return string.replace(/%((%)|s|d)/g, function (m) {
  1990. // m is the matched format, e.g. %s, %d
  1991. var val = null;
  1992. if (m[2]) {
  1993. val = m[2];
  1994. } else {
  1995. val = args[i];
  1996. // A switch statement so that the formatter can be extended. Default is %s
  1997. switch (m) {
  1998. case '%d':
  1999. val = parseFloat(val);
  2000. if (isNaN(val)) {
  2001. val = 0;
  2002. }
  2003. break;
  2004. }
  2005. i++;
  2006. }
  2007. return val;
  2008. });
  2009. }
  2010. };
  2011. //将Layer暴露到全局中去
  2012. window.Layer = Layer;
  2013. //将Toastr暴露到全局中去
  2014. window.Toastr = Toastr;
  2015. //将语言方法暴露到全局中去
  2016. window.__ = Backend.lang;
  2017. //将Backend渲染至全局,以便于在子框架中调用
  2018. window.Backend = Backend;
  2019. //Toastr定义
  2020. Toastr.options = Backend.config.toastr;
  2021. //点击包含.btn-dialog的元素时弹出dialog
  2022. $(document).on('click', '.btn-dialog', function (e) {
  2023. Backend.api.open(Backend.api.fixurl($(this).attr('href')), $(this).attr('title'));
  2024. e.preventDefault();
  2025. });
  2026. return Backend;
  2027. });
  2028. //! moment.js
  2029. //! version : 2.15.2
  2030. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  2031. //! license : MIT
  2032. //! momentjs.com
  2033. ;(function (global, factory) {
  2034. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  2035. typeof define === 'function' && define.amd ? define('moment/moment',factory) :
  2036. global.moment = factory()
  2037. }(this, function () { 'use strict';
  2038. var hookCallback;
  2039. function utils_hooks__hooks () {
  2040. return hookCallback.apply(null, arguments);
  2041. }
  2042. // This is done to register the method called with moment()
  2043. // without creating circular dependencies.
  2044. function setHookCallback (callback) {
  2045. hookCallback = callback;
  2046. }
  2047. function isArray(input) {
  2048. return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
  2049. }
  2050. function isObject(input) {
  2051. // IE8 will treat undefined and null as object if it wasn't for
  2052. // input != null
  2053. return input != null && Object.prototype.toString.call(input) === '[object Object]';
  2054. }
  2055. function isObjectEmpty(obj) {
  2056. var k;
  2057. for (k in obj) {
  2058. // even if its not own property I'd still call it non-empty
  2059. return false;
  2060. }
  2061. return true;
  2062. }
  2063. function isDate(input) {
  2064. return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
  2065. }
  2066. function map(arr, fn) {
  2067. var res = [], i;
  2068. for (i = 0; i < arr.length; ++i) {
  2069. res.push(fn(arr[i], i));
  2070. }
  2071. return res;
  2072. }
  2073. function hasOwnProp(a, b) {
  2074. return Object.prototype.hasOwnProperty.call(a, b);
  2075. }
  2076. function extend(a, b) {
  2077. for (var i in b) {
  2078. if (hasOwnProp(b, i)) {
  2079. a[i] = b[i];
  2080. }
  2081. }
  2082. if (hasOwnProp(b, 'toString')) {
  2083. a.toString = b.toString;
  2084. }
  2085. if (hasOwnProp(b, 'valueOf')) {
  2086. a.valueOf = b.valueOf;
  2087. }
  2088. return a;
  2089. }
  2090. function create_utc__createUTC (input, format, locale, strict) {
  2091. return createLocalOrUTC(input, format, locale, strict, true).utc();
  2092. }
  2093. function defaultParsingFlags() {
  2094. // We need to deep clone this object.
  2095. return {
  2096. empty : false,
  2097. unusedTokens : [],
  2098. unusedInput : [],
  2099. overflow : -2,
  2100. charsLeftOver : 0,
  2101. nullInput : false,
  2102. invalidMonth : null,
  2103. invalidFormat : false,
  2104. userInvalidated : false,
  2105. iso : false,
  2106. parsedDateParts : [],
  2107. meridiem : null
  2108. };
  2109. }
  2110. function getParsingFlags(m) {
  2111. if (m._pf == null) {
  2112. m._pf = defaultParsingFlags();
  2113. }
  2114. return m._pf;
  2115. }
  2116. var some;
  2117. if (Array.prototype.some) {
  2118. some = Array.prototype.some;
  2119. } else {
  2120. some = function (fun) {
  2121. var t = Object(this);
  2122. var len = t.length >>> 0;
  2123. for (var i = 0; i < len; i++) {
  2124. if (i in t && fun.call(this, t[i], i, t)) {
  2125. return true;
  2126. }
  2127. }
  2128. return false;
  2129. };
  2130. }
  2131. function valid__isValid(m) {
  2132. if (m._isValid == null) {
  2133. var flags = getParsingFlags(m);
  2134. var parsedParts = some.call(flags.parsedDateParts, function (i) {
  2135. return i != null;
  2136. });
  2137. var isNowValid = !isNaN(m._d.getTime()) &&
  2138. flags.overflow < 0 &&
  2139. !flags.empty &&
  2140. !flags.invalidMonth &&
  2141. !flags.invalidWeekday &&
  2142. !flags.nullInput &&
  2143. !flags.invalidFormat &&
  2144. !flags.userInvalidated &&
  2145. (!flags.meridiem || (flags.meridiem && parsedParts));
  2146. if (m._strict) {
  2147. isNowValid = isNowValid &&
  2148. flags.charsLeftOver === 0 &&
  2149. flags.unusedTokens.length === 0 &&
  2150. flags.bigHour === undefined;
  2151. }
  2152. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  2153. m._isValid = isNowValid;
  2154. }
  2155. else {
  2156. return isNowValid;
  2157. }
  2158. }
  2159. return m._isValid;
  2160. }
  2161. function valid__createInvalid (flags) {
  2162. var m = create_utc__createUTC(NaN);
  2163. if (flags != null) {
  2164. extend(getParsingFlags(m), flags);
  2165. }
  2166. else {
  2167. getParsingFlags(m).userInvalidated = true;
  2168. }
  2169. return m;
  2170. }
  2171. function isUndefined(input) {
  2172. return input === void 0;
  2173. }
  2174. // Plugins that add properties should also add the key here (null value),
  2175. // so we can properly clone ourselves.
  2176. var momentProperties = utils_hooks__hooks.momentProperties = [];
  2177. function copyConfig(to, from) {
  2178. var i, prop, val;
  2179. if (!isUndefined(from._isAMomentObject)) {
  2180. to._isAMomentObject = from._isAMomentObject;
  2181. }
  2182. if (!isUndefined(from._i)) {
  2183. to._i = from._i;
  2184. }
  2185. if (!isUndefined(from._f)) {
  2186. to._f = from._f;
  2187. }
  2188. if (!isUndefined(from._l)) {
  2189. to._l = from._l;
  2190. }
  2191. if (!isUndefined(from._strict)) {
  2192. to._strict = from._strict;
  2193. }
  2194. if (!isUndefined(from._tzm)) {
  2195. to._tzm = from._tzm;
  2196. }
  2197. if (!isUndefined(from._isUTC)) {
  2198. to._isUTC = from._isUTC;
  2199. }
  2200. if (!isUndefined(from._offset)) {
  2201. to._offset = from._offset;
  2202. }
  2203. if (!isUndefined(from._pf)) {
  2204. to._pf = getParsingFlags(from);
  2205. }
  2206. if (!isUndefined(from._locale)) {
  2207. to._locale = from._locale;
  2208. }
  2209. if (momentProperties.length > 0) {
  2210. for (i in momentProperties) {
  2211. prop = momentProperties[i];
  2212. val = from[prop];
  2213. if (!isUndefined(val)) {
  2214. to[prop] = val;
  2215. }
  2216. }
  2217. }
  2218. return to;
  2219. }
  2220. var updateInProgress = false;
  2221. // Moment prototype object
  2222. function Moment(config) {
  2223. copyConfig(this, config);
  2224. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  2225. // Prevent infinite loop in case updateOffset creates new moment
  2226. // objects.
  2227. if (updateInProgress === false) {
  2228. updateInProgress = true;
  2229. utils_hooks__hooks.updateOffset(this);
  2230. updateInProgress = false;
  2231. }
  2232. }
  2233. function isMoment (obj) {
  2234. return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
  2235. }
  2236. function absFloor (number) {
  2237. if (number < 0) {
  2238. // -0 -> 0
  2239. return Math.ceil(number) || 0;
  2240. } else {
  2241. return Math.floor(number);
  2242. }
  2243. }
  2244. function toInt(argumentForCoercion) {
  2245. var coercedNumber = +argumentForCoercion,
  2246. value = 0;
  2247. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  2248. value = absFloor(coercedNumber);
  2249. }
  2250. return value;
  2251. }
  2252. // compare two arrays, return the number of differences
  2253. function compareArrays(array1, array2, dontConvert) {
  2254. var len = Math.min(array1.length, array2.length),
  2255. lengthDiff = Math.abs(array1.length - array2.length),
  2256. diffs = 0,
  2257. i;
  2258. for (i = 0; i < len; i++) {
  2259. if ((dontConvert && array1[i] !== array2[i]) ||
  2260. (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
  2261. diffs++;
  2262. }
  2263. }
  2264. return diffs + lengthDiff;
  2265. }
  2266. function warn(msg) {
  2267. if (utils_hooks__hooks.suppressDeprecationWarnings === false &&
  2268. (typeof console !== 'undefined') && console.warn) {
  2269. console.warn('Deprecation warning: ' + msg);
  2270. }
  2271. }
  2272. function deprecate(msg, fn) {
  2273. var firstTime = true;
  2274. return extend(function () {
  2275. if (utils_hooks__hooks.deprecationHandler != null) {
  2276. utils_hooks__hooks.deprecationHandler(null, msg);
  2277. }
  2278. if (firstTime) {
  2279. var args = [];
  2280. var arg;
  2281. for (var i = 0; i < arguments.length; i++) {
  2282. arg = '';
  2283. if (typeof arguments[i] === 'object') {
  2284. arg += '\n[' + i + '] ';
  2285. for (var key in arguments[0]) {
  2286. arg += key + ': ' + arguments[0][key] + ', ';
  2287. }
  2288. arg = arg.slice(0, -2); // Remove trailing comma and space
  2289. } else {
  2290. arg = arguments[i];
  2291. }
  2292. args.push(arg);
  2293. }
  2294. warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
  2295. firstTime = false;
  2296. }
  2297. return fn.apply(this, arguments);
  2298. }, fn);
  2299. }
  2300. var deprecations = {};
  2301. function deprecateSimple(name, msg) {
  2302. if (utils_hooks__hooks.deprecationHandler != null) {
  2303. utils_hooks__hooks.deprecationHandler(name, msg);
  2304. }
  2305. if (!deprecations[name]) {
  2306. warn(msg);
  2307. deprecations[name] = true;
  2308. }
  2309. }
  2310. utils_hooks__hooks.suppressDeprecationWarnings = false;
  2311. utils_hooks__hooks.deprecationHandler = null;
  2312. function isFunction(input) {
  2313. return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
  2314. }
  2315. function locale_set__set (config) {
  2316. var prop, i;
  2317. for (i in config) {
  2318. prop = config[i];
  2319. if (isFunction(prop)) {
  2320. this[i] = prop;
  2321. } else {
  2322. this['_' + i] = prop;
  2323. }
  2324. }
  2325. this._config = config;
  2326. // Lenient ordinal parsing accepts just a number in addition to
  2327. // number + (possibly) stuff coming from _ordinalParseLenient.
  2328. this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
  2329. }
  2330. function mergeConfigs(parentConfig, childConfig) {
  2331. var res = extend({}, parentConfig), prop;
  2332. for (prop in childConfig) {
  2333. if (hasOwnProp(childConfig, prop)) {
  2334. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  2335. res[prop] = {};
  2336. extend(res[prop], parentConfig[prop]);
  2337. extend(res[prop], childConfig[prop]);
  2338. } else if (childConfig[prop] != null) {
  2339. res[prop] = childConfig[prop];
  2340. } else {
  2341. delete res[prop];
  2342. }
  2343. }
  2344. }
  2345. for (prop in parentConfig) {
  2346. if (hasOwnProp(parentConfig, prop) &&
  2347. !hasOwnProp(childConfig, prop) &&
  2348. isObject(parentConfig[prop])) {
  2349. // make sure changes to properties don't modify parent config
  2350. res[prop] = extend({}, res[prop]);
  2351. }
  2352. }
  2353. return res;
  2354. }
  2355. function Locale(config) {
  2356. if (config != null) {
  2357. this.set(config);
  2358. }
  2359. }
  2360. var keys;
  2361. if (Object.keys) {
  2362. keys = Object.keys;
  2363. } else {
  2364. keys = function (obj) {
  2365. var i, res = [];
  2366. for (i in obj) {
  2367. if (hasOwnProp(obj, i)) {
  2368. res.push(i);
  2369. }
  2370. }
  2371. return res;
  2372. };
  2373. }
  2374. var defaultCalendar = {
  2375. sameDay : '[Today at] LT',
  2376. nextDay : '[Tomorrow at] LT',
  2377. nextWeek : 'dddd [at] LT',
  2378. lastDay : '[Yesterday at] LT',
  2379. lastWeek : '[Last] dddd [at] LT',
  2380. sameElse : 'L'
  2381. };
  2382. function locale_calendar__calendar (key, mom, now) {
  2383. var output = this._calendar[key] || this._calendar['sameElse'];
  2384. return isFunction(output) ? output.call(mom, now) : output;
  2385. }
  2386. var defaultLongDateFormat = {
  2387. LTS : 'h:mm:ss A',
  2388. LT : 'h:mm A',
  2389. L : 'MM/DD/YYYY',
  2390. LL : 'MMMM D, YYYY',
  2391. LLL : 'MMMM D, YYYY h:mm A',
  2392. LLLL : 'dddd, MMMM D, YYYY h:mm A'
  2393. };
  2394. function longDateFormat (key) {
  2395. var format = this._longDateFormat[key],
  2396. formatUpper = this._longDateFormat[key.toUpperCase()];
  2397. if (format || !formatUpper) {
  2398. return format;
  2399. }
  2400. this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
  2401. return val.slice(1);
  2402. });
  2403. return this._longDateFormat[key];
  2404. }
  2405. var defaultInvalidDate = 'Invalid date';
  2406. function invalidDate () {
  2407. return this._invalidDate;
  2408. }
  2409. var defaultOrdinal = '%d';
  2410. var defaultOrdinalParse = /\d{1,2}/;
  2411. function ordinal (number) {
  2412. return this._ordinal.replace('%d', number);
  2413. }
  2414. var defaultRelativeTime = {
  2415. future : 'in %s',
  2416. past : '%s ago',
  2417. s : 'a few seconds',
  2418. m : 'a minute',
  2419. mm : '%d minutes',
  2420. h : 'an hour',
  2421. hh : '%d hours',
  2422. d : 'a day',
  2423. dd : '%d days',
  2424. M : 'a month',
  2425. MM : '%d months',
  2426. y : 'a year',
  2427. yy : '%d years'
  2428. };
  2429. function relative__relativeTime (number, withoutSuffix, string, isFuture) {
  2430. var output = this._relativeTime[string];
  2431. return (isFunction(output)) ?
  2432. output(number, withoutSuffix, string, isFuture) :
  2433. output.replace(/%d/i, number);
  2434. }
  2435. function pastFuture (diff, output) {
  2436. var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  2437. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  2438. }
  2439. var aliases = {};
  2440. function addUnitAlias (unit, shorthand) {
  2441. var lowerCase = unit.toLowerCase();
  2442. aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
  2443. }
  2444. function normalizeUnits(units) {
  2445. return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
  2446. }
  2447. function normalizeObjectUnits(inputObject) {
  2448. var normalizedInput = {},
  2449. normalizedProp,
  2450. prop;
  2451. for (prop in inputObject) {
  2452. if (hasOwnProp(inputObject, prop)) {
  2453. normalizedProp = normalizeUnits(prop);
  2454. if (normalizedProp) {
  2455. normalizedInput[normalizedProp] = inputObject[prop];
  2456. }
  2457. }
  2458. }
  2459. return normalizedInput;
  2460. }
  2461. var priorities = {};
  2462. function addUnitPriority(unit, priority) {
  2463. priorities[unit] = priority;
  2464. }
  2465. function getPrioritizedUnits(unitsObj) {
  2466. var units = [];
  2467. for (var u in unitsObj) {
  2468. units.push({unit: u, priority: priorities[u]});
  2469. }
  2470. units.sort(function (a, b) {
  2471. return a.priority - b.priority;
  2472. });
  2473. return units;
  2474. }
  2475. function makeGetSet (unit, keepTime) {
  2476. return function (value) {
  2477. if (value != null) {
  2478. get_set__set(this, unit, value);
  2479. utils_hooks__hooks.updateOffset(this, keepTime);
  2480. return this;
  2481. } else {
  2482. return get_set__get(this, unit);
  2483. }
  2484. };
  2485. }
  2486. function get_set__get (mom, unit) {
  2487. return mom.isValid() ?
  2488. mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
  2489. }
  2490. function get_set__set (mom, unit, value) {
  2491. if (mom.isValid()) {
  2492. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
  2493. }
  2494. }
  2495. // MOMENTS
  2496. function stringGet (units) {
  2497. units = normalizeUnits(units);
  2498. if (isFunction(this[units])) {
  2499. return this[units]();
  2500. }
  2501. return this;
  2502. }
  2503. function stringSet (units, value) {
  2504. if (typeof units === 'object') {
  2505. units = normalizeObjectUnits(units);
  2506. var prioritized = getPrioritizedUnits(units);
  2507. for (var i = 0; i < prioritized.length; i++) {
  2508. this[prioritized[i].unit](units[prioritized[i].unit]);
  2509. }
  2510. } else {
  2511. units = normalizeUnits(units);
  2512. if (isFunction(this[units])) {
  2513. return this[units](value);
  2514. }
  2515. }
  2516. return this;
  2517. }
  2518. function zeroFill(number, targetLength, forceSign) {
  2519. var absNumber = '' + Math.abs(number),
  2520. zerosToFill = targetLength - absNumber.length,
  2521. sign = number >= 0;
  2522. return (sign ? (forceSign ? '+' : '') : '-') +
  2523. Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
  2524. }
  2525. 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;
  2526. var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
  2527. var formatFunctions = {};
  2528. var formatTokenFunctions = {};
  2529. // token: 'M'
  2530. // padded: ['MM', 2]
  2531. // ordinal: 'Mo'
  2532. // callback: function () { this.month() + 1 }
  2533. function addFormatToken (token, padded, ordinal, callback) {
  2534. var func = callback;
  2535. if (typeof callback === 'string') {
  2536. func = function () {
  2537. return this[callback]();
  2538. };
  2539. }
  2540. if (token) {
  2541. formatTokenFunctions[token] = func;
  2542. }
  2543. if (padded) {
  2544. formatTokenFunctions[padded[0]] = function () {
  2545. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  2546. };
  2547. }
  2548. if (ordinal) {
  2549. formatTokenFunctions[ordinal] = function () {
  2550. return this.localeData().ordinal(func.apply(this, arguments), token);
  2551. };
  2552. }
  2553. }
  2554. function removeFormattingTokens(input) {
  2555. if (input.match(/\[[\s\S]/)) {
  2556. return input.replace(/^\[|\]$/g, '');
  2557. }
  2558. return input.replace(/\\/g, '');
  2559. }
  2560. function makeFormatFunction(format) {
  2561. var array = format.match(formattingTokens), i, length;
  2562. for (i = 0, length = array.length; i < length; i++) {
  2563. if (formatTokenFunctions[array[i]]) {
  2564. array[i] = formatTokenFunctions[array[i]];
  2565. } else {
  2566. array[i] = removeFormattingTokens(array[i]);
  2567. }
  2568. }
  2569. return function (mom) {
  2570. var output = '', i;
  2571. for (i = 0; i < length; i++) {
  2572. output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
  2573. }
  2574. return output;
  2575. };
  2576. }
  2577. // format date using native date object
  2578. function formatMoment(m, format) {
  2579. if (!m.isValid()) {
  2580. return m.localeData().invalidDate();
  2581. }
  2582. format = expandFormat(format, m.localeData());
  2583. formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
  2584. return formatFunctions[format](m);
  2585. }
  2586. function expandFormat(format, locale) {
  2587. var i = 5;
  2588. function replaceLongDateFormatTokens(input) {
  2589. return locale.longDateFormat(input) || input;
  2590. }
  2591. localFormattingTokens.lastIndex = 0;
  2592. while (i >= 0 && localFormattingTokens.test(format)) {
  2593. format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
  2594. localFormattingTokens.lastIndex = 0;
  2595. i -= 1;
  2596. }
  2597. return format;
  2598. }
  2599. var match1 = /\d/; // 0 - 9
  2600. var match2 = /\d\d/; // 00 - 99
  2601. var match3 = /\d{3}/; // 000 - 999
  2602. var match4 = /\d{4}/; // 0000 - 9999
  2603. var match6 = /[+-]?\d{6}/; // -999999 - 999999
  2604. var match1to2 = /\d\d?/; // 0 - 99
  2605. var match3to4 = /\d\d\d\d?/; // 999 - 9999
  2606. var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
  2607. var match1to3 = /\d{1,3}/; // 0 - 999
  2608. var match1to4 = /\d{1,4}/; // 0 - 9999
  2609. var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
  2610. var matchUnsigned = /\d+/; // 0 - inf
  2611. var matchSigned = /[+-]?\d+/; // -inf - inf
  2612. var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
  2613. var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  2614. var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
  2615. // any word (or two) characters or numbers including two/three word month in arabic.
  2616. // includes scottish gaelic two word and hyphenated months
  2617. var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
  2618. var regexes = {};
  2619. function addRegexToken (token, regex, strictRegex) {
  2620. regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
  2621. return (isStrict && strictRegex) ? strictRegex : regex;
  2622. };
  2623. }
  2624. function getParseRegexForToken (token, config) {
  2625. if (!hasOwnProp(regexes, token)) {
  2626. return new RegExp(unescapeFormat(token));
  2627. }
  2628. return regexes[token](config._strict, config._locale);
  2629. }
  2630. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  2631. function unescapeFormat(s) {
  2632. return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
  2633. return p1 || p2 || p3 || p4;
  2634. }));
  2635. }
  2636. function regexEscape(s) {
  2637. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  2638. }
  2639. var tokens = {};
  2640. function addParseToken (token, callback) {
  2641. var i, func = callback;
  2642. if (typeof token === 'string') {
  2643. token = [token];
  2644. }
  2645. if (typeof callback === 'number') {
  2646. func = function (input, array) {
  2647. array[callback] = toInt(input);
  2648. };
  2649. }
  2650. for (i = 0; i < token.length; i++) {
  2651. tokens[token[i]] = func;
  2652. }
  2653. }
  2654. function addWeekParseToken (token, callback) {
  2655. addParseToken(token, function (input, array, config, token) {
  2656. config._w = config._w || {};
  2657. callback(input, config._w, config, token);
  2658. });
  2659. }
  2660. function addTimeToArrayFromToken(token, input, config) {
  2661. if (input != null && hasOwnProp(tokens, token)) {
  2662. tokens[token](input, config._a, config, token);
  2663. }
  2664. }
  2665. var YEAR = 0;
  2666. var MONTH = 1;
  2667. var DATE = 2;
  2668. var HOUR = 3;
  2669. var MINUTE = 4;
  2670. var SECOND = 5;
  2671. var MILLISECOND = 6;
  2672. var WEEK = 7;
  2673. var WEEKDAY = 8;
  2674. var indexOf;
  2675. if (Array.prototype.indexOf) {
  2676. indexOf = Array.prototype.indexOf;
  2677. } else {
  2678. indexOf = function (o) {
  2679. // I know
  2680. var i;
  2681. for (i = 0; i < this.length; ++i) {
  2682. if (this[i] === o) {
  2683. return i;
  2684. }
  2685. }
  2686. return -1;
  2687. };
  2688. }
  2689. function daysInMonth(year, month) {
  2690. return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
  2691. }
  2692. // FORMATTING
  2693. addFormatToken('M', ['MM', 2], 'Mo', function () {
  2694. return this.month() + 1;
  2695. });
  2696. addFormatToken('MMM', 0, 0, function (format) {
  2697. return this.localeData().monthsShort(this, format);
  2698. });
  2699. addFormatToken('MMMM', 0, 0, function (format) {
  2700. return this.localeData().months(this, format);
  2701. });
  2702. // ALIASES
  2703. addUnitAlias('month', 'M');
  2704. // PRIORITY
  2705. addUnitPriority('month', 8);
  2706. // PARSING
  2707. addRegexToken('M', match1to2);
  2708. addRegexToken('MM', match1to2, match2);
  2709. addRegexToken('MMM', function (isStrict, locale) {
  2710. return locale.monthsShortRegex(isStrict);
  2711. });
  2712. addRegexToken('MMMM', function (isStrict, locale) {
  2713. return locale.monthsRegex(isStrict);
  2714. });
  2715. addParseToken(['M', 'MM'], function (input, array) {
  2716. array[MONTH] = toInt(input) - 1;
  2717. });
  2718. addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
  2719. var month = config._locale.monthsParse(input, token, config._strict);
  2720. // if we didn't find a month name, mark the date as invalid.
  2721. if (month != null) {
  2722. array[MONTH] = month;
  2723. } else {
  2724. getParsingFlags(config).invalidMonth = input;
  2725. }
  2726. });
  2727. // LOCALES
  2728. var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
  2729. var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
  2730. function localeMonths (m, format) {
  2731. if (!m) {
  2732. return this._months;
  2733. }
  2734. return isArray(this._months) ? this._months[m.month()] :
  2735. this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
  2736. }
  2737. var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
  2738. function localeMonthsShort (m, format) {
  2739. if (!m) {
  2740. return this._monthsShort;
  2741. }
  2742. return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
  2743. this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
  2744. }
  2745. function units_month__handleStrictParse(monthName, format, strict) {
  2746. var i, ii, mom, llc = monthName.toLocaleLowerCase();
  2747. if (!this._monthsParse) {
  2748. // this is not used
  2749. this._monthsParse = [];
  2750. this._longMonthsParse = [];
  2751. this._shortMonthsParse = [];
  2752. for (i = 0; i < 12; ++i) {
  2753. mom = create_utc__createUTC([2000, i]);
  2754. this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
  2755. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  2756. }
  2757. }
  2758. if (strict) {
  2759. if (format === 'MMM') {
  2760. ii = indexOf.call(this._shortMonthsParse, llc);
  2761. return ii !== -1 ? ii : null;
  2762. } else {
  2763. ii = indexOf.call(this._longMonthsParse, llc);
  2764. return ii !== -1 ? ii : null;
  2765. }
  2766. } else {
  2767. if (format === 'MMM') {
  2768. ii = indexOf.call(this._shortMonthsParse, llc);
  2769. if (ii !== -1) {
  2770. return ii;
  2771. }
  2772. ii = indexOf.call(this._longMonthsParse, llc);
  2773. return ii !== -1 ? ii : null;
  2774. } else {
  2775. ii = indexOf.call(this._longMonthsParse, llc);
  2776. if (ii !== -1) {
  2777. return ii;
  2778. }
  2779. ii = indexOf.call(this._shortMonthsParse, llc);
  2780. return ii !== -1 ? ii : null;
  2781. }
  2782. }
  2783. }
  2784. function localeMonthsParse (monthName, format, strict) {
  2785. var i, mom, regex;
  2786. if (this._monthsParseExact) {
  2787. return units_month__handleStrictParse.call(this, monthName, format, strict);
  2788. }
  2789. if (!this._monthsParse) {
  2790. this._monthsParse = [];
  2791. this._longMonthsParse = [];
  2792. this._shortMonthsParse = [];
  2793. }
  2794. // TODO: add sorting
  2795. // Sorting makes sure if one month (or abbr) is a prefix of another
  2796. // see sorting in computeMonthsParse
  2797. for (i = 0; i < 12; i++) {
  2798. // make the regex if we don't have it already
  2799. mom = create_utc__createUTC([2000, i]);
  2800. if (strict && !this._longMonthsParse[i]) {
  2801. this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
  2802. this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
  2803. }
  2804. if (!strict && !this._monthsParse[i]) {
  2805. regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
  2806. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  2807. }
  2808. // test the regex
  2809. if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
  2810. return i;
  2811. } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
  2812. return i;
  2813. } else if (!strict && this._monthsParse[i].test(monthName)) {
  2814. return i;
  2815. }
  2816. }
  2817. }
  2818. // MOMENTS
  2819. function setMonth (mom, value) {
  2820. var dayOfMonth;
  2821. if (!mom.isValid()) {
  2822. // No op
  2823. return mom;
  2824. }
  2825. if (typeof value === 'string') {
  2826. if (/^\d+$/.test(value)) {
  2827. value = toInt(value);
  2828. } else {
  2829. value = mom.localeData().monthsParse(value);
  2830. // TODO: Another silent failure?
  2831. if (typeof value !== 'number') {
  2832. return mom;
  2833. }
  2834. }
  2835. }
  2836. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  2837. mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  2838. return mom;
  2839. }
  2840. function getSetMonth (value) {
  2841. if (value != null) {
  2842. setMonth(this, value);
  2843. utils_hooks__hooks.updateOffset(this, true);
  2844. return this;
  2845. } else {
  2846. return get_set__get(this, 'Month');
  2847. }
  2848. }
  2849. function getDaysInMonth () {
  2850. return daysInMonth(this.year(), this.month());
  2851. }
  2852. var defaultMonthsShortRegex = matchWord;
  2853. function monthsShortRegex (isStrict) {
  2854. if (this._monthsParseExact) {
  2855. if (!hasOwnProp(this, '_monthsRegex')) {
  2856. computeMonthsParse.call(this);
  2857. }
  2858. if (isStrict) {
  2859. return this._monthsShortStrictRegex;
  2860. } else {
  2861. return this._monthsShortRegex;
  2862. }
  2863. } else {
  2864. if (!hasOwnProp(this, '_monthsShortRegex')) {
  2865. this._monthsShortRegex = defaultMonthsShortRegex;
  2866. }
  2867. return this._monthsShortStrictRegex && isStrict ?
  2868. this._monthsShortStrictRegex : this._monthsShortRegex;
  2869. }
  2870. }
  2871. var defaultMonthsRegex = matchWord;
  2872. function monthsRegex (isStrict) {
  2873. if (this._monthsParseExact) {
  2874. if (!hasOwnProp(this, '_monthsRegex')) {
  2875. computeMonthsParse.call(this);
  2876. }
  2877. if (isStrict) {
  2878. return this._monthsStrictRegex;
  2879. } else {
  2880. return this._monthsRegex;
  2881. }
  2882. } else {
  2883. if (!hasOwnProp(this, '_monthsRegex')) {
  2884. this._monthsRegex = defaultMonthsRegex;
  2885. }
  2886. return this._monthsStrictRegex && isStrict ?
  2887. this._monthsStrictRegex : this._monthsRegex;
  2888. }
  2889. }
  2890. function computeMonthsParse () {
  2891. function cmpLenRev(a, b) {
  2892. return b.length - a.length;
  2893. }
  2894. var shortPieces = [], longPieces = [], mixedPieces = [],
  2895. i, mom;
  2896. for (i = 0; i < 12; i++) {
  2897. // make the regex if we don't have it already
  2898. mom = create_utc__createUTC([2000, i]);
  2899. shortPieces.push(this.monthsShort(mom, ''));
  2900. longPieces.push(this.months(mom, ''));
  2901. mixedPieces.push(this.months(mom, ''));
  2902. mixedPieces.push(this.monthsShort(mom, ''));
  2903. }
  2904. // Sorting makes sure if one month (or abbr) is a prefix of another it
  2905. // will match the longer piece.
  2906. shortPieces.sort(cmpLenRev);
  2907. longPieces.sort(cmpLenRev);
  2908. mixedPieces.sort(cmpLenRev);
  2909. for (i = 0; i < 12; i++) {
  2910. shortPieces[i] = regexEscape(shortPieces[i]);
  2911. longPieces[i] = regexEscape(longPieces[i]);
  2912. }
  2913. for (i = 0; i < 24; i++) {
  2914. mixedPieces[i] = regexEscape(mixedPieces[i]);
  2915. }
  2916. this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  2917. this._monthsShortRegex = this._monthsRegex;
  2918. this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  2919. this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  2920. }
  2921. // FORMATTING
  2922. addFormatToken('Y', 0, 0, function () {
  2923. var y = this.year();
  2924. return y <= 9999 ? '' + y : '+' + y;
  2925. });
  2926. addFormatToken(0, ['YY', 2], 0, function () {
  2927. return this.year() % 100;
  2928. });
  2929. addFormatToken(0, ['YYYY', 4], 0, 'year');
  2930. addFormatToken(0, ['YYYYY', 5], 0, 'year');
  2931. addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  2932. // ALIASES
  2933. addUnitAlias('year', 'y');
  2934. // PRIORITIES
  2935. addUnitPriority('year', 1);
  2936. // PARSING
  2937. addRegexToken('Y', matchSigned);
  2938. addRegexToken('YY', match1to2, match2);
  2939. addRegexToken('YYYY', match1to4, match4);
  2940. addRegexToken('YYYYY', match1to6, match6);
  2941. addRegexToken('YYYYYY', match1to6, match6);
  2942. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  2943. addParseToken('YYYY', function (input, array) {
  2944. array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input);
  2945. });
  2946. addParseToken('YY', function (input, array) {
  2947. array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input);
  2948. });
  2949. addParseToken('Y', function (input, array) {
  2950. array[YEAR] = parseInt(input, 10);
  2951. });
  2952. // HELPERS
  2953. function daysInYear(year) {
  2954. return isLeapYear(year) ? 366 : 365;
  2955. }
  2956. function isLeapYear(year) {
  2957. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  2958. }
  2959. // HOOKS
  2960. utils_hooks__hooks.parseTwoDigitYear = function (input) {
  2961. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  2962. };
  2963. // MOMENTS
  2964. var getSetYear = makeGetSet('FullYear', true);
  2965. function getIsLeapYear () {
  2966. return isLeapYear(this.year());
  2967. }
  2968. function createDate (y, m, d, h, M, s, ms) {
  2969. //can't just apply() to create a date:
  2970. //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
  2971. var date = new Date(y, m, d, h, M, s, ms);
  2972. //the date constructor remaps years 0-99 to 1900-1999
  2973. if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
  2974. date.setFullYear(y);
  2975. }
  2976. return date;
  2977. }
  2978. function createUTCDate (y) {
  2979. var date = new Date(Date.UTC.apply(null, arguments));
  2980. //the Date.UTC function remaps years 0-99 to 1900-1999
  2981. if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
  2982. date.setUTCFullYear(y);
  2983. }
  2984. return date;
  2985. }
  2986. // start-of-first-week - start-of-year
  2987. function firstWeekOffset(year, dow, doy) {
  2988. var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  2989. fwd = 7 + dow - doy,
  2990. // first-week day local weekday -- which local weekday is fwd
  2991. fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  2992. return -fwdlw + fwd - 1;
  2993. }
  2994. //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  2995. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  2996. var localWeekday = (7 + weekday - dow) % 7,
  2997. weekOffset = firstWeekOffset(year, dow, doy),
  2998. dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
  2999. resYear, resDayOfYear;
  3000. if (dayOfYear <= 0) {
  3001. resYear = year - 1;
  3002. resDayOfYear = daysInYear(resYear) + dayOfYear;
  3003. } else if (dayOfYear > daysInYear(year)) {
  3004. resYear = year + 1;
  3005. resDayOfYear = dayOfYear - daysInYear(year);
  3006. } else {
  3007. resYear = year;
  3008. resDayOfYear = dayOfYear;
  3009. }
  3010. return {
  3011. year: resYear,
  3012. dayOfYear: resDayOfYear
  3013. };
  3014. }
  3015. function weekOfYear(mom, dow, doy) {
  3016. var weekOffset = firstWeekOffset(mom.year(), dow, doy),
  3017. week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
  3018. resWeek, resYear;
  3019. if (week < 1) {
  3020. resYear = mom.year() - 1;
  3021. resWeek = week + weeksInYear(resYear, dow, doy);
  3022. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  3023. resWeek = week - weeksInYear(mom.year(), dow, doy);
  3024. resYear = mom.year() + 1;
  3025. } else {
  3026. resYear = mom.year();
  3027. resWeek = week;
  3028. }
  3029. return {
  3030. week: resWeek,
  3031. year: resYear
  3032. };
  3033. }
  3034. function weeksInYear(year, dow, doy) {
  3035. var weekOffset = firstWeekOffset(year, dow, doy),
  3036. weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  3037. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  3038. }
  3039. // FORMATTING
  3040. addFormatToken('w', ['ww', 2], 'wo', 'week');
  3041. addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  3042. // ALIASES
  3043. addUnitAlias('week', 'w');
  3044. addUnitAlias('isoWeek', 'W');
  3045. // PRIORITIES
  3046. addUnitPriority('week', 5);
  3047. addUnitPriority('isoWeek', 5);
  3048. // PARSING
  3049. addRegexToken('w', match1to2);
  3050. addRegexToken('ww', match1to2, match2);
  3051. addRegexToken('W', match1to2);
  3052. addRegexToken('WW', match1to2, match2);
  3053. addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
  3054. week[token.substr(0, 1)] = toInt(input);
  3055. });
  3056. // HELPERS
  3057. // LOCALES
  3058. function localeWeek (mom) {
  3059. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  3060. }
  3061. var defaultLocaleWeek = {
  3062. dow : 0, // Sunday is the first day of the week.
  3063. doy : 6 // The week that contains Jan 1st is the first week of the year.
  3064. };
  3065. function localeFirstDayOfWeek () {
  3066. return this._week.dow;
  3067. }
  3068. function localeFirstDayOfYear () {
  3069. return this._week.doy;
  3070. }
  3071. // MOMENTS
  3072. function getSetWeek (input) {
  3073. var week = this.localeData().week(this);
  3074. return input == null ? week : this.add((input - week) * 7, 'd');
  3075. }
  3076. function getSetISOWeek (input) {
  3077. var week = weekOfYear(this, 1, 4).week;
  3078. return input == null ? week : this.add((input - week) * 7, 'd');
  3079. }
  3080. // FORMATTING
  3081. addFormatToken('d', 0, 'do', 'day');
  3082. addFormatToken('dd', 0, 0, function (format) {
  3083. return this.localeData().weekdaysMin(this, format);
  3084. });
  3085. addFormatToken('ddd', 0, 0, function (format) {
  3086. return this.localeData().weekdaysShort(this, format);
  3087. });
  3088. addFormatToken('dddd', 0, 0, function (format) {
  3089. return this.localeData().weekdays(this, format);
  3090. });
  3091. addFormatToken('e', 0, 0, 'weekday');
  3092. addFormatToken('E', 0, 0, 'isoWeekday');
  3093. // ALIASES
  3094. addUnitAlias('day', 'd');
  3095. addUnitAlias('weekday', 'e');
  3096. addUnitAlias('isoWeekday', 'E');
  3097. // PRIORITY
  3098. addUnitPriority('day', 11);
  3099. addUnitPriority('weekday', 11);
  3100. addUnitPriority('isoWeekday', 11);
  3101. // PARSING
  3102. addRegexToken('d', match1to2);
  3103. addRegexToken('e', match1to2);
  3104. addRegexToken('E', match1to2);
  3105. addRegexToken('dd', function (isStrict, locale) {
  3106. return locale.weekdaysMinRegex(isStrict);
  3107. });
  3108. addRegexToken('ddd', function (isStrict, locale) {
  3109. return locale.weekdaysShortRegex(isStrict);
  3110. });
  3111. addRegexToken('dddd', function (isStrict, locale) {
  3112. return locale.weekdaysRegex(isStrict);
  3113. });
  3114. addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
  3115. var weekday = config._locale.weekdaysParse(input, token, config._strict);
  3116. // if we didn't get a weekday name, mark the date as invalid
  3117. if (weekday != null) {
  3118. week.d = weekday;
  3119. } else {
  3120. getParsingFlags(config).invalidWeekday = input;
  3121. }
  3122. });
  3123. addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
  3124. week[token] = toInt(input);
  3125. });
  3126. // HELPERS
  3127. function parseWeekday(input, locale) {
  3128. if (typeof input !== 'string') {
  3129. return input;
  3130. }
  3131. if (!isNaN(input)) {
  3132. return parseInt(input, 10);
  3133. }
  3134. input = locale.weekdaysParse(input);
  3135. if (typeof input === 'number') {
  3136. return input;
  3137. }
  3138. return null;
  3139. }
  3140. function parseIsoWeekday(input, locale) {
  3141. if (typeof input === 'string') {
  3142. return locale.weekdaysParse(input) % 7 || 7;
  3143. }
  3144. return isNaN(input) ? null : input;
  3145. }
  3146. // LOCALES
  3147. var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
  3148. function localeWeekdays (m, format) {
  3149. if (!m) {
  3150. return this._weekdays;
  3151. }
  3152. return isArray(this._weekdays) ? this._weekdays[m.day()] :
  3153. this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
  3154. }
  3155. var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
  3156. function localeWeekdaysShort (m) {
  3157. return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
  3158. }
  3159. var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
  3160. function localeWeekdaysMin (m) {
  3161. return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
  3162. }
  3163. function day_of_week__handleStrictParse(weekdayName, format, strict) {
  3164. var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
  3165. if (!this._weekdaysParse) {
  3166. this._weekdaysParse = [];
  3167. this._shortWeekdaysParse = [];
  3168. this._minWeekdaysParse = [];
  3169. for (i = 0; i < 7; ++i) {
  3170. mom = create_utc__createUTC([2000, 1]).day(i);
  3171. this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
  3172. this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
  3173. this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
  3174. }
  3175. }
  3176. if (strict) {
  3177. if (format === 'dddd') {
  3178. ii = indexOf.call(this._weekdaysParse, llc);
  3179. return ii !== -1 ? ii : null;
  3180. } else if (format === 'ddd') {
  3181. ii = indexOf.call(this._shortWeekdaysParse, llc);
  3182. return ii !== -1 ? ii : null;
  3183. } else {
  3184. ii = indexOf.call(this._minWeekdaysParse, llc);
  3185. return ii !== -1 ? ii : null;
  3186. }
  3187. } else {
  3188. if (format === 'dddd') {
  3189. ii = indexOf.call(this._weekdaysParse, llc);
  3190. if (ii !== -1) {
  3191. return ii;
  3192. }
  3193. ii = indexOf.call(this._shortWeekdaysParse, llc);
  3194. if (ii !== -1) {
  3195. return ii;
  3196. }
  3197. ii = indexOf.call(this._minWeekdaysParse, llc);
  3198. return ii !== -1 ? ii : null;
  3199. } else if (format === 'ddd') {
  3200. ii = indexOf.call(this._shortWeekdaysParse, llc);
  3201. if (ii !== -1) {
  3202. return ii;
  3203. }
  3204. ii = indexOf.call(this._weekdaysParse, llc);
  3205. if (ii !== -1) {
  3206. return ii;
  3207. }
  3208. ii = indexOf.call(this._minWeekdaysParse, llc);
  3209. return ii !== -1 ? ii : null;
  3210. } else {
  3211. ii = indexOf.call(this._minWeekdaysParse, llc);
  3212. if (ii !== -1) {
  3213. return ii;
  3214. }
  3215. ii = indexOf.call(this._weekdaysParse, llc);
  3216. if (ii !== -1) {
  3217. return ii;
  3218. }
  3219. ii = indexOf.call(this._shortWeekdaysParse, llc);
  3220. return ii !== -1 ? ii : null;
  3221. }
  3222. }
  3223. }
  3224. function localeWeekdaysParse (weekdayName, format, strict) {
  3225. var i, mom, regex;
  3226. if (this._weekdaysParseExact) {
  3227. return day_of_week__handleStrictParse.call(this, weekdayName, format, strict);
  3228. }
  3229. if (!this._weekdaysParse) {
  3230. this._weekdaysParse = [];
  3231. this._minWeekdaysParse = [];
  3232. this._shortWeekdaysParse = [];
  3233. this._fullWeekdaysParse = [];
  3234. }
  3235. for (i = 0; i < 7; i++) {
  3236. // make the regex if we don't have it already
  3237. mom = create_utc__createUTC([2000, 1]).day(i);
  3238. if (strict && !this._fullWeekdaysParse[i]) {
  3239. this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
  3240. this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
  3241. this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
  3242. }
  3243. if (!this._weekdaysParse[i]) {
  3244. regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
  3245. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  3246. }
  3247. // test the regex
  3248. if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
  3249. return i;
  3250. } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
  3251. return i;
  3252. } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
  3253. return i;
  3254. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  3255. return i;
  3256. }
  3257. }
  3258. }
  3259. // MOMENTS
  3260. function getSetDayOfWeek (input) {
  3261. if (!this.isValid()) {
  3262. return input != null ? this : NaN;
  3263. }
  3264. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  3265. if (input != null) {
  3266. input = parseWeekday(input, this.localeData());
  3267. return this.add(input - day, 'd');
  3268. } else {
  3269. return day;
  3270. }
  3271. }
  3272. function getSetLocaleDayOfWeek (input) {
  3273. if (!this.isValid()) {
  3274. return input != null ? this : NaN;
  3275. }
  3276. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  3277. return input == null ? weekday : this.add(input - weekday, 'd');
  3278. }
  3279. function getSetISODayOfWeek (input) {
  3280. if (!this.isValid()) {
  3281. return input != null ? this : NaN;
  3282. }
  3283. // behaves the same as moment#day except
  3284. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  3285. // as a setter, sunday should belong to the previous week.
  3286. if (input != null) {
  3287. var weekday = parseIsoWeekday(input, this.localeData());
  3288. return this.day(this.day() % 7 ? weekday : weekday - 7);
  3289. } else {
  3290. return this.day() || 7;
  3291. }
  3292. }
  3293. var defaultWeekdaysRegex = matchWord;
  3294. function weekdaysRegex (isStrict) {
  3295. if (this._weekdaysParseExact) {
  3296. if (!hasOwnProp(this, '_weekdaysRegex')) {
  3297. computeWeekdaysParse.call(this);
  3298. }
  3299. if (isStrict) {
  3300. return this._weekdaysStrictRegex;
  3301. } else {
  3302. return this._weekdaysRegex;
  3303. }
  3304. } else {
  3305. if (!hasOwnProp(this, '_weekdaysRegex')) {
  3306. this._weekdaysRegex = defaultWeekdaysRegex;
  3307. }
  3308. return this._weekdaysStrictRegex && isStrict ?
  3309. this._weekdaysStrictRegex : this._weekdaysRegex;
  3310. }
  3311. }
  3312. var defaultWeekdaysShortRegex = matchWord;
  3313. function weekdaysShortRegex (isStrict) {
  3314. if (this._weekdaysParseExact) {
  3315. if (!hasOwnProp(this, '_weekdaysRegex')) {
  3316. computeWeekdaysParse.call(this);
  3317. }
  3318. if (isStrict) {
  3319. return this._weekdaysShortStrictRegex;
  3320. } else {
  3321. return this._weekdaysShortRegex;
  3322. }
  3323. } else {
  3324. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  3325. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  3326. }
  3327. return this._weekdaysShortStrictRegex && isStrict ?
  3328. this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
  3329. }
  3330. }
  3331. var defaultWeekdaysMinRegex = matchWord;
  3332. function weekdaysMinRegex (isStrict) {
  3333. if (this._weekdaysParseExact) {
  3334. if (!hasOwnProp(this, '_weekdaysRegex')) {
  3335. computeWeekdaysParse.call(this);
  3336. }
  3337. if (isStrict) {
  3338. return this._weekdaysMinStrictRegex;
  3339. } else {
  3340. return this._weekdaysMinRegex;
  3341. }
  3342. } else {
  3343. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  3344. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  3345. }
  3346. return this._weekdaysMinStrictRegex && isStrict ?
  3347. this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
  3348. }
  3349. }
  3350. function computeWeekdaysParse () {
  3351. function cmpLenRev(a, b) {
  3352. return b.length - a.length;
  3353. }
  3354. var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
  3355. i, mom, minp, shortp, longp;
  3356. for (i = 0; i < 7; i++) {
  3357. // make the regex if we don't have it already
  3358. mom = create_utc__createUTC([2000, 1]).day(i);
  3359. minp = this.weekdaysMin(mom, '');
  3360. shortp = this.weekdaysShort(mom, '');
  3361. longp = this.weekdays(mom, '');
  3362. minPieces.push(minp);
  3363. shortPieces.push(shortp);
  3364. longPieces.push(longp);
  3365. mixedPieces.push(minp);
  3366. mixedPieces.push(shortp);
  3367. mixedPieces.push(longp);
  3368. }
  3369. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  3370. // will match the longer piece.
  3371. minPieces.sort(cmpLenRev);
  3372. shortPieces.sort(cmpLenRev);
  3373. longPieces.sort(cmpLenRev);
  3374. mixedPieces.sort(cmpLenRev);
  3375. for (i = 0; i < 7; i++) {
  3376. shortPieces[i] = regexEscape(shortPieces[i]);
  3377. longPieces[i] = regexEscape(longPieces[i]);
  3378. mixedPieces[i] = regexEscape(mixedPieces[i]);
  3379. }
  3380. this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  3381. this._weekdaysShortRegex = this._weekdaysRegex;
  3382. this._weekdaysMinRegex = this._weekdaysRegex;
  3383. this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  3384. this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  3385. this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
  3386. }
  3387. // FORMATTING
  3388. function hFormat() {
  3389. return this.hours() % 12 || 12;
  3390. }
  3391. function kFormat() {
  3392. return this.hours() || 24;
  3393. }
  3394. addFormatToken('H', ['HH', 2], 0, 'hour');
  3395. addFormatToken('h', ['hh', 2], 0, hFormat);
  3396. addFormatToken('k', ['kk', 2], 0, kFormat);
  3397. addFormatToken('hmm', 0, 0, function () {
  3398. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  3399. });
  3400. addFormatToken('hmmss', 0, 0, function () {
  3401. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
  3402. zeroFill(this.seconds(), 2);
  3403. });
  3404. addFormatToken('Hmm', 0, 0, function () {
  3405. return '' + this.hours() + zeroFill(this.minutes(), 2);
  3406. });
  3407. addFormatToken('Hmmss', 0, 0, function () {
  3408. return '' + this.hours() + zeroFill(this.minutes(), 2) +
  3409. zeroFill(this.seconds(), 2);
  3410. });
  3411. function meridiem (token, lowercase) {
  3412. addFormatToken(token, 0, 0, function () {
  3413. return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
  3414. });
  3415. }
  3416. meridiem('a', true);
  3417. meridiem('A', false);
  3418. // ALIASES
  3419. addUnitAlias('hour', 'h');
  3420. // PRIORITY
  3421. addUnitPriority('hour', 13);
  3422. // PARSING
  3423. function matchMeridiem (isStrict, locale) {
  3424. return locale._meridiemParse;
  3425. }
  3426. addRegexToken('a', matchMeridiem);
  3427. addRegexToken('A', matchMeridiem);
  3428. addRegexToken('H', match1to2);
  3429. addRegexToken('h', match1to2);
  3430. addRegexToken('HH', match1to2, match2);
  3431. addRegexToken('hh', match1to2, match2);
  3432. addRegexToken('hmm', match3to4);
  3433. addRegexToken('hmmss', match5to6);
  3434. addRegexToken('Hmm', match3to4);
  3435. addRegexToken('Hmmss', match5to6);
  3436. addParseToken(['H', 'HH'], HOUR);
  3437. addParseToken(['a', 'A'], function (input, array, config) {
  3438. config._isPm = config._locale.isPM(input);
  3439. config._meridiem = input;
  3440. });
  3441. addParseToken(['h', 'hh'], function (input, array, config) {
  3442. array[HOUR] = toInt(input);
  3443. getParsingFlags(config).bigHour = true;
  3444. });
  3445. addParseToken('hmm', function (input, array, config) {
  3446. var pos = input.length - 2;
  3447. array[HOUR] = toInt(input.substr(0, pos));
  3448. array[MINUTE] = toInt(input.substr(pos));
  3449. getParsingFlags(config).bigHour = true;
  3450. });
  3451. addParseToken('hmmss', function (input, array, config) {
  3452. var pos1 = input.length - 4;
  3453. var pos2 = input.length - 2;
  3454. array[HOUR] = toInt(input.substr(0, pos1));
  3455. array[MINUTE] = toInt(input.substr(pos1, 2));
  3456. array[SECOND] = toInt(input.substr(pos2));
  3457. getParsingFlags(config).bigHour = true;
  3458. });
  3459. addParseToken('Hmm', function (input, array, config) {
  3460. var pos = input.length - 2;
  3461. array[HOUR] = toInt(input.substr(0, pos));
  3462. array[MINUTE] = toInt(input.substr(pos));
  3463. });
  3464. addParseToken('Hmmss', function (input, array, config) {
  3465. var pos1 = input.length - 4;
  3466. var pos2 = input.length - 2;
  3467. array[HOUR] = toInt(input.substr(0, pos1));
  3468. array[MINUTE] = toInt(input.substr(pos1, 2));
  3469. array[SECOND] = toInt(input.substr(pos2));
  3470. });
  3471. // LOCALES
  3472. function localeIsPM (input) {
  3473. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  3474. // Using charAt should be more compatible.
  3475. return ((input + '').toLowerCase().charAt(0) === 'p');
  3476. }
  3477. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
  3478. function localeMeridiem (hours, minutes, isLower) {
  3479. if (hours > 11) {
  3480. return isLower ? 'pm' : 'PM';
  3481. } else {
  3482. return isLower ? 'am' : 'AM';
  3483. }
  3484. }
  3485. // MOMENTS
  3486. // Setting the hour should keep the time, because the user explicitly
  3487. // specified which hour he wants. So trying to maintain the same hour (in
  3488. // a new timezone) makes sense. Adding/subtracting hours does not follow
  3489. // this rule.
  3490. var getSetHour = makeGetSet('Hours', true);
  3491. var baseConfig = {
  3492. calendar: defaultCalendar,
  3493. longDateFormat: defaultLongDateFormat,
  3494. invalidDate: defaultInvalidDate,
  3495. ordinal: defaultOrdinal,
  3496. ordinalParse: defaultOrdinalParse,
  3497. relativeTime: defaultRelativeTime,
  3498. months: defaultLocaleMonths,
  3499. monthsShort: defaultLocaleMonthsShort,
  3500. week: defaultLocaleWeek,
  3501. weekdays: defaultLocaleWeekdays,
  3502. weekdaysMin: defaultLocaleWeekdaysMin,
  3503. weekdaysShort: defaultLocaleWeekdaysShort,
  3504. meridiemParse: defaultLocaleMeridiemParse
  3505. };
  3506. // internal storage for locale config files
  3507. var locales = {};
  3508. var globalLocale;
  3509. function normalizeLocale(key) {
  3510. return key ? key.toLowerCase().replace('_', '-') : key;
  3511. }
  3512. // pick the locale from the array
  3513. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  3514. // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
  3515. function chooseLocale(names) {
  3516. var i = 0, j, next, locale, split;
  3517. while (i < names.length) {
  3518. split = normalizeLocale(names[i]).split('-');
  3519. j = split.length;
  3520. next = normalizeLocale(names[i + 1]);
  3521. next = next ? next.split('-') : null;
  3522. while (j > 0) {
  3523. locale = loadLocale(split.slice(0, j).join('-'));
  3524. if (locale) {
  3525. return locale;
  3526. }
  3527. if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
  3528. //the next array item is better than a shallower substring of this one
  3529. break;
  3530. }
  3531. j--;
  3532. }
  3533. i++;
  3534. }
  3535. return null;
  3536. }
  3537. function loadLocale(name) {
  3538. var oldLocale = null;
  3539. // TODO: Find a better way to register and load all the locales in Node
  3540. if (!locales[name] && (typeof module !== 'undefined') &&
  3541. module && module.exports) {
  3542. try {
  3543. oldLocale = globalLocale._abbr;
  3544. require('./locale/' + name);
  3545. // because defineLocale currently also sets the global locale, we
  3546. // want to undo that for lazy loaded locales
  3547. locale_locales__getSetGlobalLocale(oldLocale);
  3548. } catch (e) { }
  3549. }
  3550. return locales[name];
  3551. }
  3552. // This function will load locale and then set the global locale. If
  3553. // no arguments are passed in, it will simply return the current global
  3554. // locale key.
  3555. function locale_locales__getSetGlobalLocale (key, values) {
  3556. var data;
  3557. if (key) {
  3558. if (isUndefined(values)) {
  3559. data = locale_locales__getLocale(key);
  3560. }
  3561. else {
  3562. data = defineLocale(key, values);
  3563. }
  3564. if (data) {
  3565. // moment.duration._locale = moment._locale = data;
  3566. globalLocale = data;
  3567. }
  3568. }
  3569. return globalLocale._abbr;
  3570. }
  3571. function defineLocale (name, config) {
  3572. if (config !== null) {
  3573. var parentConfig = baseConfig;
  3574. config.abbr = name;
  3575. if (locales[name] != null) {
  3576. deprecateSimple('defineLocaleOverride',
  3577. 'use moment.updateLocale(localeName, config) to change ' +
  3578. 'an existing locale. moment.defineLocale(localeName, ' +
  3579. 'config) should only be used for creating a new locale ' +
  3580. 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
  3581. parentConfig = locales[name]._config;
  3582. } else if (config.parentLocale != null) {
  3583. if (locales[config.parentLocale] != null) {
  3584. parentConfig = locales[config.parentLocale]._config;
  3585. } else {
  3586. // treat as if there is no base config
  3587. deprecateSimple('parentLocaleUndefined',
  3588. 'specified parentLocale is not defined yet. See http://momentjs.com/guides/#/warnings/parent-locale/');
  3589. }
  3590. }
  3591. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  3592. // backwards compat for now: also set the locale
  3593. locale_locales__getSetGlobalLocale(name);
  3594. return locales[name];
  3595. } else {
  3596. // useful for testing
  3597. delete locales[name];
  3598. return null;
  3599. }
  3600. }
  3601. function updateLocale(name, config) {
  3602. if (config != null) {
  3603. var locale, parentConfig = baseConfig;
  3604. // MERGE
  3605. if (locales[name] != null) {
  3606. parentConfig = locales[name]._config;
  3607. }
  3608. config = mergeConfigs(parentConfig, config);
  3609. locale = new Locale(config);
  3610. locale.parentLocale = locales[name];
  3611. locales[name] = locale;
  3612. // backwards compat for now: also set the locale
  3613. locale_locales__getSetGlobalLocale(name);
  3614. } else {
  3615. // pass null for config to unupdate, useful for tests
  3616. if (locales[name] != null) {
  3617. if (locales[name].parentLocale != null) {
  3618. locales[name] = locales[name].parentLocale;
  3619. } else if (locales[name] != null) {
  3620. delete locales[name];
  3621. }
  3622. }
  3623. }
  3624. return locales[name];
  3625. }
  3626. // returns locale data
  3627. function locale_locales__getLocale (key) {
  3628. var locale;
  3629. if (key && key._locale && key._locale._abbr) {
  3630. key = key._locale._abbr;
  3631. }
  3632. if (!key) {
  3633. return globalLocale;
  3634. }
  3635. if (!isArray(key)) {
  3636. //short-circuit everything else
  3637. locale = loadLocale(key);
  3638. if (locale) {
  3639. return locale;
  3640. }
  3641. key = [key];
  3642. }
  3643. return chooseLocale(key);
  3644. }
  3645. function locale_locales__listLocales() {
  3646. return keys(locales);
  3647. }
  3648. function checkOverflow (m) {
  3649. var overflow;
  3650. var a = m._a;
  3651. if (a && getParsingFlags(m).overflow === -2) {
  3652. overflow =
  3653. a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
  3654. a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
  3655. a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
  3656. a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
  3657. a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
  3658. a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
  3659. -1;
  3660. if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
  3661. overflow = DATE;
  3662. }
  3663. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  3664. overflow = WEEK;
  3665. }
  3666. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  3667. overflow = WEEKDAY;
  3668. }
  3669. getParsingFlags(m).overflow = overflow;
  3670. }
  3671. return m;
  3672. }
  3673. // iso 8601 regex
  3674. // 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)
  3675. 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)?)?/;
  3676. 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)?)?/;
  3677. var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
  3678. var isoDates = [
  3679. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  3680. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  3681. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  3682. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  3683. ['YYYY-DDD', /\d{4}-\d{3}/],
  3684. ['YYYY-MM', /\d{4}-\d\d/, false],
  3685. ['YYYYYYMMDD', /[+-]\d{10}/],
  3686. ['YYYYMMDD', /\d{8}/],
  3687. // YYYYMM is NOT allowed by the standard
  3688. ['GGGG[W]WWE', /\d{4}W\d{3}/],
  3689. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  3690. ['YYYYDDD', /\d{7}/]
  3691. ];
  3692. // iso time formats and regexes
  3693. var isoTimes = [
  3694. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  3695. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  3696. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  3697. ['HH:mm', /\d\d:\d\d/],
  3698. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  3699. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  3700. ['HHmmss', /\d\d\d\d\d\d/],
  3701. ['HHmm', /\d\d\d\d/],
  3702. ['HH', /\d\d/]
  3703. ];
  3704. var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
  3705. // date from iso format
  3706. function configFromISO(config) {
  3707. var i, l,
  3708. string = config._i,
  3709. match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  3710. allowTime, dateFormat, timeFormat, tzFormat;
  3711. if (match) {
  3712. getParsingFlags(config).iso = true;
  3713. for (i = 0, l = isoDates.length; i < l; i++) {
  3714. if (isoDates[i][1].exec(match[1])) {
  3715. dateFormat = isoDates[i][0];
  3716. allowTime = isoDates[i][2] !== false;
  3717. break;
  3718. }
  3719. }
  3720. if (dateFormat == null) {
  3721. config._isValid = false;
  3722. return;
  3723. }
  3724. if (match[3]) {
  3725. for (i = 0, l = isoTimes.length; i < l; i++) {
  3726. if (isoTimes[i][1].exec(match[3])) {
  3727. // match[2] should be 'T' or space
  3728. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  3729. break;
  3730. }
  3731. }
  3732. if (timeFormat == null) {
  3733. config._isValid = false;
  3734. return;
  3735. }
  3736. }
  3737. if (!allowTime && timeFormat != null) {
  3738. config._isValid = false;
  3739. return;
  3740. }
  3741. if (match[4]) {
  3742. if (tzRegex.exec(match[4])) {
  3743. tzFormat = 'Z';
  3744. } else {
  3745. config._isValid = false;
  3746. return;
  3747. }
  3748. }
  3749. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  3750. configFromStringAndFormat(config);
  3751. } else {
  3752. config._isValid = false;
  3753. }
  3754. }
  3755. // date from iso format or fallback
  3756. function configFromString(config) {
  3757. var matched = aspNetJsonRegex.exec(config._i);
  3758. if (matched !== null) {
  3759. config._d = new Date(+matched[1]);
  3760. return;
  3761. }
  3762. configFromISO(config);
  3763. if (config._isValid === false) {
  3764. delete config._isValid;
  3765. utils_hooks__hooks.createFromInputFallback(config);
  3766. }
  3767. }
  3768. utils_hooks__hooks.createFromInputFallback = deprecate(
  3769. 'value provided is not in a recognized ISO format. moment construction falls back to js Date(), ' +
  3770. 'which is not reliable across all browsers and versions. Non ISO date formats are ' +
  3771. 'discouraged and will be removed in an upcoming major release. Please refer to ' +
  3772. 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  3773. function (config) {
  3774. config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  3775. }
  3776. );
  3777. // Pick the first defined of two or three arguments.
  3778. function defaults(a, b, c) {
  3779. if (a != null) {
  3780. return a;
  3781. }
  3782. if (b != null) {
  3783. return b;
  3784. }
  3785. return c;
  3786. }
  3787. function currentDateArray(config) {
  3788. // hooks is actually the exported moment object
  3789. var nowValue = new Date(utils_hooks__hooks.now());
  3790. if (config._useUTC) {
  3791. return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
  3792. }
  3793. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  3794. }
  3795. // convert an array to a date.
  3796. // the array should mirror the parameters below
  3797. // note: all values past the year are optional and will default to the lowest possible value.
  3798. // [year, month, day , hour, minute, second, millisecond]
  3799. function configFromArray (config) {
  3800. var i, date, input = [], currentDate, yearToUse;
  3801. if (config._d) {
  3802. return;
  3803. }
  3804. currentDate = currentDateArray(config);
  3805. //compute day of the year from weeks and weekdays
  3806. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  3807. dayOfYearFromWeekInfo(config);
  3808. }
  3809. //if the day of the year is set, figure out what it is
  3810. if (config._dayOfYear) {
  3811. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  3812. if (config._dayOfYear > daysInYear(yearToUse)) {
  3813. getParsingFlags(config)._overflowDayOfYear = true;
  3814. }
  3815. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  3816. config._a[MONTH] = date.getUTCMonth();
  3817. config._a[DATE] = date.getUTCDate();
  3818. }
  3819. // Default to current date.
  3820. // * if no year, month, day of month are given, default to today
  3821. // * if day of month is given, default month and year
  3822. // * if month is given, default only year
  3823. // * if year is given, don't default anything
  3824. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  3825. config._a[i] = input[i] = currentDate[i];
  3826. }
  3827. // Zero out whatever was not defaulted, including time
  3828. for (; i < 7; i++) {
  3829. config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
  3830. }
  3831. // Check for 24:00:00.000
  3832. if (config._a[HOUR] === 24 &&
  3833. config._a[MINUTE] === 0 &&
  3834. config._a[SECOND] === 0 &&
  3835. config._a[MILLISECOND] === 0) {
  3836. config._nextDay = true;
  3837. config._a[HOUR] = 0;
  3838. }
  3839. config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
  3840. // Apply timezone offset from input. The actual utcOffset can be changed
  3841. // with parseZone.
  3842. if (config._tzm != null) {
  3843. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  3844. }
  3845. if (config._nextDay) {
  3846. config._a[HOUR] = 24;
  3847. }
  3848. }
  3849. function dayOfYearFromWeekInfo(config) {
  3850. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
  3851. w = config._w;
  3852. if (w.GG != null || w.W != null || w.E != null) {
  3853. dow = 1;
  3854. doy = 4;
  3855. // TODO: We need to take the current isoWeekYear, but that depends on
  3856. // how we interpret now (local, utc, fixed offset). So create
  3857. // a now version of current config (take local/utc/offset flags, and
  3858. // create now).
  3859. weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year);
  3860. week = defaults(w.W, 1);
  3861. weekday = defaults(w.E, 1);
  3862. if (weekday < 1 || weekday > 7) {
  3863. weekdayOverflow = true;
  3864. }
  3865. } else {
  3866. dow = config._locale._week.dow;
  3867. doy = config._locale._week.doy;
  3868. weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year);
  3869. week = defaults(w.w, 1);
  3870. if (w.d != null) {
  3871. // weekday -- low day numbers are considered next week
  3872. weekday = w.d;
  3873. if (weekday < 0 || weekday > 6) {
  3874. weekdayOverflow = true;
  3875. }
  3876. } else if (w.e != null) {
  3877. // local weekday -- counting starts from begining of week
  3878. weekday = w.e + dow;
  3879. if (w.e < 0 || w.e > 6) {
  3880. weekdayOverflow = true;
  3881. }
  3882. } else {
  3883. // default to begining of week
  3884. weekday = dow;
  3885. }
  3886. }
  3887. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  3888. getParsingFlags(config)._overflowWeeks = true;
  3889. } else if (weekdayOverflow != null) {
  3890. getParsingFlags(config)._overflowWeekday = true;
  3891. } else {
  3892. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  3893. config._a[YEAR] = temp.year;
  3894. config._dayOfYear = temp.dayOfYear;
  3895. }
  3896. }
  3897. // constant that refers to the ISO standard
  3898. utils_hooks__hooks.ISO_8601 = function () {};
  3899. // date from string and format string
  3900. function configFromStringAndFormat(config) {
  3901. // TODO: Move this to another part of the creation flow to prevent circular deps
  3902. if (config._f === utils_hooks__hooks.ISO_8601) {
  3903. configFromISO(config);
  3904. return;
  3905. }
  3906. config._a = [];
  3907. getParsingFlags(config).empty = true;
  3908. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  3909. var string = '' + config._i,
  3910. i, parsedInput, tokens, token, skipped,
  3911. stringLength = string.length,
  3912. totalParsedInputLength = 0;
  3913. tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
  3914. for (i = 0; i < tokens.length; i++) {
  3915. token = tokens[i];
  3916. parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
  3917. // console.log('token', token, 'parsedInput', parsedInput,
  3918. // 'regex', getParseRegexForToken(token, config));
  3919. if (parsedInput) {
  3920. skipped = string.substr(0, string.indexOf(parsedInput));
  3921. if (skipped.length > 0) {
  3922. getParsingFlags(config).unusedInput.push(skipped);
  3923. }
  3924. string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
  3925. totalParsedInputLength += parsedInput.length;
  3926. }
  3927. // don't parse if it's not a known token
  3928. if (formatTokenFunctions[token]) {
  3929. if (parsedInput) {
  3930. getParsingFlags(config).empty = false;
  3931. }
  3932. else {
  3933. getParsingFlags(config).unusedTokens.push(token);
  3934. }
  3935. addTimeToArrayFromToken(token, parsedInput, config);
  3936. }
  3937. else if (config._strict && !parsedInput) {
  3938. getParsingFlags(config).unusedTokens.push(token);
  3939. }
  3940. }
  3941. // add remaining unparsed input length to the string
  3942. getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
  3943. if (string.length > 0) {
  3944. getParsingFlags(config).unusedInput.push(string);
  3945. }
  3946. // clear _12h flag if hour is <= 12
  3947. if (config._a[HOUR] <= 12 &&
  3948. getParsingFlags(config).bigHour === true &&
  3949. config._a[HOUR] > 0) {
  3950. getParsingFlags(config).bigHour = undefined;
  3951. }
  3952. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  3953. getParsingFlags(config).meridiem = config._meridiem;
  3954. // handle meridiem
  3955. config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
  3956. configFromArray(config);
  3957. checkOverflow(config);
  3958. }
  3959. function meridiemFixWrap (locale, hour, meridiem) {
  3960. var isPm;
  3961. if (meridiem == null) {
  3962. // nothing to do
  3963. return hour;
  3964. }
  3965. if (locale.meridiemHour != null) {
  3966. return locale.meridiemHour(hour, meridiem);
  3967. } else if (locale.isPM != null) {
  3968. // Fallback
  3969. isPm = locale.isPM(meridiem);
  3970. if (isPm && hour < 12) {
  3971. hour += 12;
  3972. }
  3973. if (!isPm && hour === 12) {
  3974. hour = 0;
  3975. }
  3976. return hour;
  3977. } else {
  3978. // this is not supposed to happen
  3979. return hour;
  3980. }
  3981. }
  3982. // date from string and array of format strings
  3983. function configFromStringAndArray(config) {
  3984. var tempConfig,
  3985. bestMoment,
  3986. scoreToBeat,
  3987. i,
  3988. currentScore;
  3989. if (config._f.length === 0) {
  3990. getParsingFlags(config).invalidFormat = true;
  3991. config._d = new Date(NaN);
  3992. return;
  3993. }
  3994. for (i = 0; i < config._f.length; i++) {
  3995. currentScore = 0;
  3996. tempConfig = copyConfig({}, config);
  3997. if (config._useUTC != null) {
  3998. tempConfig._useUTC = config._useUTC;
  3999. }
  4000. tempConfig._f = config._f[i];
  4001. configFromStringAndFormat(tempConfig);
  4002. if (!valid__isValid(tempConfig)) {
  4003. continue;
  4004. }
  4005. // if there is any input that was not parsed add a penalty for that format
  4006. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  4007. //or tokens
  4008. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  4009. getParsingFlags(tempConfig).score = currentScore;
  4010. if (scoreToBeat == null || currentScore < scoreToBeat) {
  4011. scoreToBeat = currentScore;
  4012. bestMoment = tempConfig;
  4013. }
  4014. }
  4015. extend(config, bestMoment || tempConfig);
  4016. }
  4017. function configFromObject(config) {
  4018. if (config._d) {
  4019. return;
  4020. }
  4021. var i = normalizeObjectUnits(config._i);
  4022. config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
  4023. return obj && parseInt(obj, 10);
  4024. });
  4025. configFromArray(config);
  4026. }
  4027. function createFromConfig (config) {
  4028. var res = new Moment(checkOverflow(prepareConfig(config)));
  4029. if (res._nextDay) {
  4030. // Adding is smart enough around DST
  4031. res.add(1, 'd');
  4032. res._nextDay = undefined;
  4033. }
  4034. return res;
  4035. }
  4036. function prepareConfig (config) {
  4037. var input = config._i,
  4038. format = config._f;
  4039. config._locale = config._locale || locale_locales__getLocale(config._l);
  4040. if (input === null || (format === undefined && input === '')) {
  4041. return valid__createInvalid({nullInput: true});
  4042. }
  4043. if (typeof input === 'string') {
  4044. config._i = input = config._locale.preparse(input);
  4045. }
  4046. if (isMoment(input)) {
  4047. return new Moment(checkOverflow(input));
  4048. } else if (isArray(format)) {
  4049. configFromStringAndArray(config);
  4050. } else if (isDate(input)) {
  4051. config._d = input;
  4052. } else if (format) {
  4053. configFromStringAndFormat(config);
  4054. } else {
  4055. configFromInput(config);
  4056. }
  4057. if (!valid__isValid(config)) {
  4058. config._d = null;
  4059. }
  4060. return config;
  4061. }
  4062. function configFromInput(config) {
  4063. var input = config._i;
  4064. if (input === undefined) {
  4065. config._d = new Date(utils_hooks__hooks.now());
  4066. } else if (isDate(input)) {
  4067. config._d = new Date(input.valueOf());
  4068. } else if (typeof input === 'string') {
  4069. configFromString(config);
  4070. } else if (isArray(input)) {
  4071. config._a = map(input.slice(0), function (obj) {
  4072. return parseInt(obj, 10);
  4073. });
  4074. configFromArray(config);
  4075. } else if (typeof(input) === 'object') {
  4076. configFromObject(config);
  4077. } else if (typeof(input) === 'number') {
  4078. // from milliseconds
  4079. config._d = new Date(input);
  4080. } else {
  4081. utils_hooks__hooks.createFromInputFallback(config);
  4082. }
  4083. }
  4084. function createLocalOrUTC (input, format, locale, strict, isUTC) {
  4085. var c = {};
  4086. if (typeof(locale) === 'boolean') {
  4087. strict = locale;
  4088. locale = undefined;
  4089. }
  4090. if ((isObject(input) && isObjectEmpty(input)) ||
  4091. (isArray(input) && input.length === 0)) {
  4092. input = undefined;
  4093. }
  4094. // object construction must be done this way.
  4095. // https://github.com/moment/moment/issues/1423
  4096. c._isAMomentObject = true;
  4097. c._useUTC = c._isUTC = isUTC;
  4098. c._l = locale;
  4099. c._i = input;
  4100. c._f = format;
  4101. c._strict = strict;
  4102. return createFromConfig(c);
  4103. }
  4104. function local__createLocal (input, format, locale, strict) {
  4105. return createLocalOrUTC(input, format, locale, strict, false);
  4106. }
  4107. var prototypeMin = deprecate(
  4108. 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
  4109. function () {
  4110. var other = local__createLocal.apply(null, arguments);
  4111. if (this.isValid() && other.isValid()) {
  4112. return other < this ? this : other;
  4113. } else {
  4114. return valid__createInvalid();
  4115. }
  4116. }
  4117. );
  4118. var prototypeMax = deprecate(
  4119. 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
  4120. function () {
  4121. var other = local__createLocal.apply(null, arguments);
  4122. if (this.isValid() && other.isValid()) {
  4123. return other > this ? this : other;
  4124. } else {
  4125. return valid__createInvalid();
  4126. }
  4127. }
  4128. );
  4129. // Pick a moment m from moments so that m[fn](other) is true for all
  4130. // other. This relies on the function fn to be transitive.
  4131. //
  4132. // moments should either be an array of moment objects or an array, whose
  4133. // first element is an array of moment objects.
  4134. function pickBy(fn, moments) {
  4135. var res, i;
  4136. if (moments.length === 1 && isArray(moments[0])) {
  4137. moments = moments[0];
  4138. }
  4139. if (!moments.length) {
  4140. return local__createLocal();
  4141. }
  4142. res = moments[0];
  4143. for (i = 1; i < moments.length; ++i) {
  4144. if (!moments[i].isValid() || moments[i][fn](res)) {
  4145. res = moments[i];
  4146. }
  4147. }
  4148. return res;
  4149. }
  4150. // TODO: Use [].sort instead?
  4151. function min () {
  4152. var args = [].slice.call(arguments, 0);
  4153. return pickBy('isBefore', args);
  4154. }
  4155. function max () {
  4156. var args = [].slice.call(arguments, 0);
  4157. return pickBy('isAfter', args);
  4158. }
  4159. var now = function () {
  4160. return Date.now ? Date.now() : +(new Date());
  4161. };
  4162. function Duration (duration) {
  4163. var normalizedInput = normalizeObjectUnits(duration),
  4164. years = normalizedInput.year || 0,
  4165. quarters = normalizedInput.quarter || 0,
  4166. months = normalizedInput.month || 0,
  4167. weeks = normalizedInput.week || 0,
  4168. days = normalizedInput.day || 0,
  4169. hours = normalizedInput.hour || 0,
  4170. minutes = normalizedInput.minute || 0,
  4171. seconds = normalizedInput.second || 0,
  4172. milliseconds = normalizedInput.millisecond || 0;
  4173. // representation for dateAddRemove
  4174. this._milliseconds = +milliseconds +
  4175. seconds * 1e3 + // 1000
  4176. minutes * 6e4 + // 1000 * 60
  4177. hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  4178. // Because of dateAddRemove treats 24 hours as different from a
  4179. // day when working around DST, we need to store them separately
  4180. this._days = +days +
  4181. weeks * 7;
  4182. // It is impossible translate months into days without knowing
  4183. // which months you are are talking about, so we have to store
  4184. // it separately.
  4185. this._months = +months +
  4186. quarters * 3 +
  4187. years * 12;
  4188. this._data = {};
  4189. this._locale = locale_locales__getLocale();
  4190. this._bubble();
  4191. }
  4192. function isDuration (obj) {
  4193. return obj instanceof Duration;
  4194. }
  4195. function absRound (number) {
  4196. if (number < 0) {
  4197. return Math.round(-1 * number) * -1;
  4198. } else {
  4199. return Math.round(number);
  4200. }
  4201. }
  4202. // FORMATTING
  4203. function offset (token, separator) {
  4204. addFormatToken(token, 0, 0, function () {
  4205. var offset = this.utcOffset();
  4206. var sign = '+';
  4207. if (offset < 0) {
  4208. offset = -offset;
  4209. sign = '-';
  4210. }
  4211. return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
  4212. });
  4213. }
  4214. offset('Z', ':');
  4215. offset('ZZ', '');
  4216. // PARSING
  4217. addRegexToken('Z', matchShortOffset);
  4218. addRegexToken('ZZ', matchShortOffset);
  4219. addParseToken(['Z', 'ZZ'], function (input, array, config) {
  4220. config._useUTC = true;
  4221. config._tzm = offsetFromString(matchShortOffset, input);
  4222. });
  4223. // HELPERS
  4224. // timezone chunker
  4225. // '+10:00' > ['10', '00']
  4226. // '-1530' > ['-15', '30']
  4227. var chunkOffset = /([\+\-]|\d\d)/gi;
  4228. function offsetFromString(matcher, string) {
  4229. var matches = ((string || '').match(matcher) || []);
  4230. var chunk = matches[matches.length - 1] || [];
  4231. var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
  4232. var minutes = +(parts[1] * 60) + toInt(parts[2]);
  4233. return parts[0] === '+' ? minutes : -minutes;
  4234. }
  4235. // Return a moment from input, that is local/utc/zone equivalent to model.
  4236. function cloneWithOffset(input, model) {
  4237. var res, diff;
  4238. if (model._isUTC) {
  4239. res = model.clone();
  4240. diff = (isMoment(input) || isDate(input) ? input.valueOf() : local__createLocal(input).valueOf()) - res.valueOf();
  4241. // Use low-level api, because this fn is low-level api.
  4242. res._d.setTime(res._d.valueOf() + diff);
  4243. utils_hooks__hooks.updateOffset(res, false);
  4244. return res;
  4245. } else {
  4246. return local__createLocal(input).local();
  4247. }
  4248. }
  4249. function getDateOffset (m) {
  4250. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  4251. // https://github.com/moment/moment/pull/1871
  4252. return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
  4253. }
  4254. // HOOKS
  4255. // This function will be called whenever a moment is mutated.
  4256. // It is intended to keep the offset in sync with the timezone.
  4257. utils_hooks__hooks.updateOffset = function () {};
  4258. // MOMENTS
  4259. // keepLocalTime = true means only change the timezone, without
  4260. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  4261. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  4262. // +0200, so we adjust the time as needed, to be valid.
  4263. //
  4264. // Keeping the time actually adds/subtracts (one hour)
  4265. // from the actual represented time. That is why we call updateOffset
  4266. // a second time. In case it wants us to change the offset again
  4267. // _changeInProgress == true case, then we have to adjust, because
  4268. // there is no such time in the given timezone.
  4269. function getSetOffset (input, keepLocalTime) {
  4270. var offset = this._offset || 0,
  4271. localAdjust;
  4272. if (!this.isValid()) {
  4273. return input != null ? this : NaN;
  4274. }
  4275. if (input != null) {
  4276. if (typeof input === 'string') {
  4277. input = offsetFromString(matchShortOffset, input);
  4278. } else if (Math.abs(input) < 16) {
  4279. input = input * 60;
  4280. }
  4281. if (!this._isUTC && keepLocalTime) {
  4282. localAdjust = getDateOffset(this);
  4283. }
  4284. this._offset = input;
  4285. this._isUTC = true;
  4286. if (localAdjust != null) {
  4287. this.add(localAdjust, 'm');
  4288. }
  4289. if (offset !== input) {
  4290. if (!keepLocalTime || this._changeInProgress) {
  4291. add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);
  4292. } else if (!this._changeInProgress) {
  4293. this._changeInProgress = true;
  4294. utils_hooks__hooks.updateOffset(this, true);
  4295. this._changeInProgress = null;
  4296. }
  4297. }
  4298. return this;
  4299. } else {
  4300. return this._isUTC ? offset : getDateOffset(this);
  4301. }
  4302. }
  4303. function getSetZone (input, keepLocalTime) {
  4304. if (input != null) {
  4305. if (typeof input !== 'string') {
  4306. input = -input;
  4307. }
  4308. this.utcOffset(input, keepLocalTime);
  4309. return this;
  4310. } else {
  4311. return -this.utcOffset();
  4312. }
  4313. }
  4314. function setOffsetToUTC (keepLocalTime) {
  4315. return this.utcOffset(0, keepLocalTime);
  4316. }
  4317. function setOffsetToLocal (keepLocalTime) {
  4318. if (this._isUTC) {
  4319. this.utcOffset(0, keepLocalTime);
  4320. this._isUTC = false;
  4321. if (keepLocalTime) {
  4322. this.subtract(getDateOffset(this), 'm');
  4323. }
  4324. }
  4325. return this;
  4326. }
  4327. function setOffsetToParsedOffset () {
  4328. if (this._tzm) {
  4329. this.utcOffset(this._tzm);
  4330. } else if (typeof this._i === 'string') {
  4331. var tZone = offsetFromString(matchOffset, this._i);
  4332. if (tZone === 0) {
  4333. this.utcOffset(0, true);
  4334. } else {
  4335. this.utcOffset(offsetFromString(matchOffset, this._i));
  4336. }
  4337. }
  4338. return this;
  4339. }
  4340. function hasAlignedHourOffset (input) {
  4341. if (!this.isValid()) {
  4342. return false;
  4343. }
  4344. input = input ? local__createLocal(input).utcOffset() : 0;
  4345. return (this.utcOffset() - input) % 60 === 0;
  4346. }
  4347. function isDaylightSavingTime () {
  4348. return (
  4349. this.utcOffset() > this.clone().month(0).utcOffset() ||
  4350. this.utcOffset() > this.clone().month(5).utcOffset()
  4351. );
  4352. }
  4353. function isDaylightSavingTimeShifted () {
  4354. if (!isUndefined(this._isDSTShifted)) {
  4355. return this._isDSTShifted;
  4356. }
  4357. var c = {};
  4358. copyConfig(c, this);
  4359. c = prepareConfig(c);
  4360. if (c._a) {
  4361. var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a);
  4362. this._isDSTShifted = this.isValid() &&
  4363. compareArrays(c._a, other.toArray()) > 0;
  4364. } else {
  4365. this._isDSTShifted = false;
  4366. }
  4367. return this._isDSTShifted;
  4368. }
  4369. function isLocal () {
  4370. return this.isValid() ? !this._isUTC : false;
  4371. }
  4372. function isUtcOffset () {
  4373. return this.isValid() ? this._isUTC : false;
  4374. }
  4375. function isUtc () {
  4376. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  4377. }
  4378. // ASP.NET json date format regex
  4379. var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
  4380. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  4381. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  4382. // and further modified to allow for strings containing both week and day
  4383. 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)?)?$/;
  4384. function create__createDuration (input, key) {
  4385. var duration = input,
  4386. // matching against regexp is expensive, do it on demand
  4387. match = null,
  4388. sign,
  4389. ret,
  4390. diffRes;
  4391. if (isDuration(input)) {
  4392. duration = {
  4393. ms : input._milliseconds,
  4394. d : input._days,
  4395. M : input._months
  4396. };
  4397. } else if (typeof input === 'number') {
  4398. duration = {};
  4399. if (key) {
  4400. duration[key] = input;
  4401. } else {
  4402. duration.milliseconds = input;
  4403. }
  4404. } else if (!!(match = aspNetRegex.exec(input))) {
  4405. sign = (match[1] === '-') ? -1 : 1;
  4406. duration = {
  4407. y : 0,
  4408. d : toInt(match[DATE]) * sign,
  4409. h : toInt(match[HOUR]) * sign,
  4410. m : toInt(match[MINUTE]) * sign,
  4411. s : toInt(match[SECOND]) * sign,
  4412. ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
  4413. };
  4414. } else if (!!(match = isoRegex.exec(input))) {
  4415. sign = (match[1] === '-') ? -1 : 1;
  4416. duration = {
  4417. y : parseIso(match[2], sign),
  4418. M : parseIso(match[3], sign),
  4419. w : parseIso(match[4], sign),
  4420. d : parseIso(match[5], sign),
  4421. h : parseIso(match[6], sign),
  4422. m : parseIso(match[7], sign),
  4423. s : parseIso(match[8], sign)
  4424. };
  4425. } else if (duration == null) {// checks for null or undefined
  4426. duration = {};
  4427. } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
  4428. diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to));
  4429. duration = {};
  4430. duration.ms = diffRes.milliseconds;
  4431. duration.M = diffRes.months;
  4432. }
  4433. ret = new Duration(duration);
  4434. if (isDuration(input) && hasOwnProp(input, '_locale')) {
  4435. ret._locale = input._locale;
  4436. }
  4437. return ret;
  4438. }
  4439. create__createDuration.fn = Duration.prototype;
  4440. function parseIso (inp, sign) {
  4441. // We'd normally use ~~inp for this, but unfortunately it also
  4442. // converts floats to ints.
  4443. // inp may be undefined, so careful calling replace on it.
  4444. var res = inp && parseFloat(inp.replace(',', '.'));
  4445. // apply sign while we're at it
  4446. return (isNaN(res) ? 0 : res) * sign;
  4447. }
  4448. function positiveMomentsDifference(base, other) {
  4449. var res = {milliseconds: 0, months: 0};
  4450. res.months = other.month() - base.month() +
  4451. (other.year() - base.year()) * 12;
  4452. if (base.clone().add(res.months, 'M').isAfter(other)) {
  4453. --res.months;
  4454. }
  4455. res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
  4456. return res;
  4457. }
  4458. function momentsDifference(base, other) {
  4459. var res;
  4460. if (!(base.isValid() && other.isValid())) {
  4461. return {milliseconds: 0, months: 0};
  4462. }
  4463. other = cloneWithOffset(other, base);
  4464. if (base.isBefore(other)) {
  4465. res = positiveMomentsDifference(base, other);
  4466. } else {
  4467. res = positiveMomentsDifference(other, base);
  4468. res.milliseconds = -res.milliseconds;
  4469. res.months = -res.months;
  4470. }
  4471. return res;
  4472. }
  4473. // TODO: remove 'name' arg after deprecation is removed
  4474. function createAdder(direction, name) {
  4475. return function (val, period) {
  4476. var dur, tmp;
  4477. //invert the arguments, but complain about it
  4478. if (period !== null && !isNaN(+period)) {
  4479. deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
  4480. 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
  4481. tmp = val; val = period; period = tmp;
  4482. }
  4483. val = typeof val === 'string' ? +val : val;
  4484. dur = create__createDuration(val, period);
  4485. add_subtract__addSubtract(this, dur, direction);
  4486. return this;
  4487. };
  4488. }
  4489. function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) {
  4490. var milliseconds = duration._milliseconds,
  4491. days = absRound(duration._days),
  4492. months = absRound(duration._months);
  4493. if (!mom.isValid()) {
  4494. // No op
  4495. return;
  4496. }
  4497. updateOffset = updateOffset == null ? true : updateOffset;
  4498. if (milliseconds) {
  4499. mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
  4500. }
  4501. if (days) {
  4502. get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding);
  4503. }
  4504. if (months) {
  4505. setMonth(mom, get_set__get(mom, 'Month') + months * isAdding);
  4506. }
  4507. if (updateOffset) {
  4508. utils_hooks__hooks.updateOffset(mom, days || months);
  4509. }
  4510. }
  4511. var add_subtract__add = createAdder(1, 'add');
  4512. var add_subtract__subtract = createAdder(-1, 'subtract');
  4513. function getCalendarFormat(myMoment, now) {
  4514. var diff = myMoment.diff(now, 'days', true);
  4515. return diff < -6 ? 'sameElse' :
  4516. diff < -1 ? 'lastWeek' :
  4517. diff < 0 ? 'lastDay' :
  4518. diff < 1 ? 'sameDay' :
  4519. diff < 2 ? 'nextDay' :
  4520. diff < 7 ? 'nextWeek' : 'sameElse';
  4521. }
  4522. function moment_calendar__calendar (time, formats) {
  4523. // We want to compare the start of today, vs this.
  4524. // Getting start-of-today depends on whether we're local/utc/offset or not.
  4525. var now = time || local__createLocal(),
  4526. sod = cloneWithOffset(now, this).startOf('day'),
  4527. format = utils_hooks__hooks.calendarFormat(this, sod) || 'sameElse';
  4528. var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
  4529. return this.format(output || this.localeData().calendar(format, this, local__createLocal(now)));
  4530. }
  4531. function clone () {
  4532. return new Moment(this);
  4533. }
  4534. function isAfter (input, units) {
  4535. var localInput = isMoment(input) ? input : local__createLocal(input);
  4536. if (!(this.isValid() && localInput.isValid())) {
  4537. return false;
  4538. }
  4539. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  4540. if (units === 'millisecond') {
  4541. return this.valueOf() > localInput.valueOf();
  4542. } else {
  4543. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  4544. }
  4545. }
  4546. function isBefore (input, units) {
  4547. var localInput = isMoment(input) ? input : local__createLocal(input);
  4548. if (!(this.isValid() && localInput.isValid())) {
  4549. return false;
  4550. }
  4551. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  4552. if (units === 'millisecond') {
  4553. return this.valueOf() < localInput.valueOf();
  4554. } else {
  4555. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  4556. }
  4557. }
  4558. function isBetween (from, to, units, inclusivity) {
  4559. inclusivity = inclusivity || '()';
  4560. return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&
  4561. (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
  4562. }
  4563. function isSame (input, units) {
  4564. var localInput = isMoment(input) ? input : local__createLocal(input),
  4565. inputMs;
  4566. if (!(this.isValid() && localInput.isValid())) {
  4567. return false;
  4568. }
  4569. units = normalizeUnits(units || 'millisecond');
  4570. if (units === 'millisecond') {
  4571. return this.valueOf() === localInput.valueOf();
  4572. } else {
  4573. inputMs = localInput.valueOf();
  4574. return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
  4575. }
  4576. }
  4577. function isSameOrAfter (input, units) {
  4578. return this.isSame(input, units) || this.isAfter(input,units);
  4579. }
  4580. function isSameOrBefore (input, units) {
  4581. return this.isSame(input, units) || this.isBefore(input,units);
  4582. }
  4583. function diff (input, units, asFloat) {
  4584. var that,
  4585. zoneDelta,
  4586. delta, output;
  4587. if (!this.isValid()) {
  4588. return NaN;
  4589. }
  4590. that = cloneWithOffset(input, this);
  4591. if (!that.isValid()) {
  4592. return NaN;
  4593. }
  4594. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  4595. units = normalizeUnits(units);
  4596. if (units === 'year' || units === 'month' || units === 'quarter') {
  4597. output = monthDiff(this, that);
  4598. if (units === 'quarter') {
  4599. output = output / 3;
  4600. } else if (units === 'year') {
  4601. output = output / 12;
  4602. }
  4603. } else {
  4604. delta = this - that;
  4605. output = units === 'second' ? delta / 1e3 : // 1000
  4606. units === 'minute' ? delta / 6e4 : // 1000 * 60
  4607. units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
  4608. units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
  4609. units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
  4610. delta;
  4611. }
  4612. return asFloat ? output : absFloor(output);
  4613. }
  4614. function monthDiff (a, b) {
  4615. // difference in months
  4616. var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
  4617. // b is in (anchor - 1 month, anchor + 1 month)
  4618. anchor = a.clone().add(wholeMonthDiff, 'months'),
  4619. anchor2, adjust;
  4620. if (b - anchor < 0) {
  4621. anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
  4622. // linear across the month
  4623. adjust = (b - anchor) / (anchor - anchor2);
  4624. } else {
  4625. anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
  4626. // linear across the month
  4627. adjust = (b - anchor) / (anchor2 - anchor);
  4628. }
  4629. //check for negative zero, return zero if negative zero
  4630. return -(wholeMonthDiff + adjust) || 0;
  4631. }
  4632. utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  4633. utils_hooks__hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  4634. function toString () {
  4635. return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  4636. }
  4637. function moment_format__toISOString () {
  4638. var m = this.clone().utc();
  4639. if (0 < m.year() && m.year() <= 9999) {
  4640. if (isFunction(Date.prototype.toISOString)) {
  4641. // native implementation is ~50x faster, use it when we can
  4642. return this.toDate().toISOString();
  4643. } else {
  4644. return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  4645. }
  4646. } else {
  4647. return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  4648. }
  4649. }
  4650. function format (inputString) {
  4651. if (!inputString) {
  4652. inputString = this.isUtc() ? utils_hooks__hooks.defaultFormatUtc : utils_hooks__hooks.defaultFormat;
  4653. }
  4654. var output = formatMoment(this, inputString);
  4655. return this.localeData().postformat(output);
  4656. }
  4657. function from (time, withoutSuffix) {
  4658. if (this.isValid() &&
  4659. ((isMoment(time) && time.isValid()) ||
  4660. local__createLocal(time).isValid())) {
  4661. return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
  4662. } else {
  4663. return this.localeData().invalidDate();
  4664. }
  4665. }
  4666. function fromNow (withoutSuffix) {
  4667. return this.from(local__createLocal(), withoutSuffix);
  4668. }
  4669. function to (time, withoutSuffix) {
  4670. if (this.isValid() &&
  4671. ((isMoment(time) && time.isValid()) ||
  4672. local__createLocal(time).isValid())) {
  4673. return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
  4674. } else {
  4675. return this.localeData().invalidDate();
  4676. }
  4677. }
  4678. function toNow (withoutSuffix) {
  4679. return this.to(local__createLocal(), withoutSuffix);
  4680. }
  4681. // If passed a locale key, it will set the locale for this
  4682. // instance. Otherwise, it will return the locale configuration
  4683. // variables for this instance.
  4684. function locale (key) {
  4685. var newLocaleData;
  4686. if (key === undefined) {
  4687. return this._locale._abbr;
  4688. } else {
  4689. newLocaleData = locale_locales__getLocale(key);
  4690. if (newLocaleData != null) {
  4691. this._locale = newLocaleData;
  4692. }
  4693. return this;
  4694. }
  4695. }
  4696. var lang = deprecate(
  4697. 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
  4698. function (key) {
  4699. if (key === undefined) {
  4700. return this.localeData();
  4701. } else {
  4702. return this.locale(key);
  4703. }
  4704. }
  4705. );
  4706. function localeData () {
  4707. return this._locale;
  4708. }
  4709. function startOf (units) {
  4710. units = normalizeUnits(units);
  4711. // the following switch intentionally omits break keywords
  4712. // to utilize falling through the cases.
  4713. switch (units) {
  4714. case 'year':
  4715. this.month(0);
  4716. /* falls through */
  4717. case 'quarter':
  4718. case 'month':
  4719. this.date(1);
  4720. /* falls through */
  4721. case 'week':
  4722. case 'isoWeek':
  4723. case 'day':
  4724. case 'date':
  4725. this.hours(0);
  4726. /* falls through */
  4727. case 'hour':
  4728. this.minutes(0);
  4729. /* falls through */
  4730. case 'minute':
  4731. this.seconds(0);
  4732. /* falls through */
  4733. case 'second':
  4734. this.milliseconds(0);
  4735. }
  4736. // weeks are a special case
  4737. if (units === 'week') {
  4738. this.weekday(0);
  4739. }
  4740. if (units === 'isoWeek') {
  4741. this.isoWeekday(1);
  4742. }
  4743. // quarters are also special
  4744. if (units === 'quarter') {
  4745. this.month(Math.floor(this.month() / 3) * 3);
  4746. }
  4747. return this;
  4748. }
  4749. function endOf (units) {
  4750. units = normalizeUnits(units);
  4751. if (units === undefined || units === 'millisecond') {
  4752. return this;
  4753. }
  4754. // 'date' is an alias for 'day', so it should be considered as such.
  4755. if (units === 'date') {
  4756. units = 'day';
  4757. }
  4758. return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
  4759. }
  4760. function to_type__valueOf () {
  4761. return this._d.valueOf() - ((this._offset || 0) * 60000);
  4762. }
  4763. function unix () {
  4764. return Math.floor(this.valueOf() / 1000);
  4765. }
  4766. function toDate () {
  4767. return new Date(this.valueOf());
  4768. }
  4769. function toArray () {
  4770. var m = this;
  4771. return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
  4772. }
  4773. function toObject () {
  4774. var m = this;
  4775. return {
  4776. years: m.year(),
  4777. months: m.month(),
  4778. date: m.date(),
  4779. hours: m.hours(),
  4780. minutes: m.minutes(),
  4781. seconds: m.seconds(),
  4782. milliseconds: m.milliseconds()
  4783. };
  4784. }
  4785. function toJSON () {
  4786. // new Date(NaN).toJSON() === null
  4787. return this.isValid() ? this.toISOString() : null;
  4788. }
  4789. function moment_valid__isValid () {
  4790. return valid__isValid(this);
  4791. }
  4792. function parsingFlags () {
  4793. return extend({}, getParsingFlags(this));
  4794. }
  4795. function invalidAt () {
  4796. return getParsingFlags(this).overflow;
  4797. }
  4798. function creationData() {
  4799. return {
  4800. input: this._i,
  4801. format: this._f,
  4802. locale: this._locale,
  4803. isUTC: this._isUTC,
  4804. strict: this._strict
  4805. };
  4806. }
  4807. // FORMATTING
  4808. addFormatToken(0, ['gg', 2], 0, function () {
  4809. return this.weekYear() % 100;
  4810. });
  4811. addFormatToken(0, ['GG', 2], 0, function () {
  4812. return this.isoWeekYear() % 100;
  4813. });
  4814. function addWeekYearFormatToken (token, getter) {
  4815. addFormatToken(0, [token, token.length], 0, getter);
  4816. }
  4817. addWeekYearFormatToken('gggg', 'weekYear');
  4818. addWeekYearFormatToken('ggggg', 'weekYear');
  4819. addWeekYearFormatToken('GGGG', 'isoWeekYear');
  4820. addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  4821. // ALIASES
  4822. addUnitAlias('weekYear', 'gg');
  4823. addUnitAlias('isoWeekYear', 'GG');
  4824. // PRIORITY
  4825. addUnitPriority('weekYear', 1);
  4826. addUnitPriority('isoWeekYear', 1);
  4827. // PARSING
  4828. addRegexToken('G', matchSigned);
  4829. addRegexToken('g', matchSigned);
  4830. addRegexToken('GG', match1to2, match2);
  4831. addRegexToken('gg', match1to2, match2);
  4832. addRegexToken('GGGG', match1to4, match4);
  4833. addRegexToken('gggg', match1to4, match4);
  4834. addRegexToken('GGGGG', match1to6, match6);
  4835. addRegexToken('ggggg', match1to6, match6);
  4836. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
  4837. week[token.substr(0, 2)] = toInt(input);
  4838. });
  4839. addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  4840. week[token] = utils_hooks__hooks.parseTwoDigitYear(input);
  4841. });
  4842. // MOMENTS
  4843. function getSetWeekYear (input) {
  4844. return getSetWeekYearHelper.call(this,
  4845. input,
  4846. this.week(),
  4847. this.weekday(),
  4848. this.localeData()._week.dow,
  4849. this.localeData()._week.doy);
  4850. }
  4851. function getSetISOWeekYear (input) {
  4852. return getSetWeekYearHelper.call(this,
  4853. input, this.isoWeek(), this.isoWeekday(), 1, 4);
  4854. }
  4855. function getISOWeeksInYear () {
  4856. return weeksInYear(this.year(), 1, 4);
  4857. }
  4858. function getWeeksInYear () {
  4859. var weekInfo = this.localeData()._week;
  4860. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  4861. }
  4862. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  4863. var weeksTarget;
  4864. if (input == null) {
  4865. return weekOfYear(this, dow, doy).year;
  4866. } else {
  4867. weeksTarget = weeksInYear(input, dow, doy);
  4868. if (week > weeksTarget) {
  4869. week = weeksTarget;
  4870. }
  4871. return setWeekAll.call(this, input, week, weekday, dow, doy);
  4872. }
  4873. }
  4874. function setWeekAll(weekYear, week, weekday, dow, doy) {
  4875. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
  4876. date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  4877. this.year(date.getUTCFullYear());
  4878. this.month(date.getUTCMonth());
  4879. this.date(date.getUTCDate());
  4880. return this;
  4881. }
  4882. // FORMATTING
  4883. addFormatToken('Q', 0, 'Qo', 'quarter');
  4884. // ALIASES
  4885. addUnitAlias('quarter', 'Q');
  4886. // PRIORITY
  4887. addUnitPriority('quarter', 7);
  4888. // PARSING
  4889. addRegexToken('Q', match1);
  4890. addParseToken('Q', function (input, array) {
  4891. array[MONTH] = (toInt(input) - 1) * 3;
  4892. });
  4893. // MOMENTS
  4894. function getSetQuarter (input) {
  4895. return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
  4896. }
  4897. // FORMATTING
  4898. addFormatToken('D', ['DD', 2], 'Do', 'date');
  4899. // ALIASES
  4900. addUnitAlias('date', 'D');
  4901. // PRIOROITY
  4902. addUnitPriority('date', 9);
  4903. // PARSING
  4904. addRegexToken('D', match1to2);
  4905. addRegexToken('DD', match1to2, match2);
  4906. addRegexToken('Do', function (isStrict, locale) {
  4907. return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
  4908. });
  4909. addParseToken(['D', 'DD'], DATE);
  4910. addParseToken('Do', function (input, array) {
  4911. array[DATE] = toInt(input.match(match1to2)[0], 10);
  4912. });
  4913. // MOMENTS
  4914. var getSetDayOfMonth = makeGetSet('Date', true);
  4915. // FORMATTING
  4916. addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  4917. // ALIASES
  4918. addUnitAlias('dayOfYear', 'DDD');
  4919. // PRIORITY
  4920. addUnitPriority('dayOfYear', 4);
  4921. // PARSING
  4922. addRegexToken('DDD', match1to3);
  4923. addRegexToken('DDDD', match3);
  4924. addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  4925. config._dayOfYear = toInt(input);
  4926. });
  4927. // HELPERS
  4928. // MOMENTS
  4929. function getSetDayOfYear (input) {
  4930. var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
  4931. return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
  4932. }
  4933. // FORMATTING
  4934. addFormatToken('m', ['mm', 2], 0, 'minute');
  4935. // ALIASES
  4936. addUnitAlias('minute', 'm');
  4937. // PRIORITY
  4938. addUnitPriority('minute', 14);
  4939. // PARSING
  4940. addRegexToken('m', match1to2);
  4941. addRegexToken('mm', match1to2, match2);
  4942. addParseToken(['m', 'mm'], MINUTE);
  4943. // MOMENTS
  4944. var getSetMinute = makeGetSet('Minutes', false);
  4945. // FORMATTING
  4946. addFormatToken('s', ['ss', 2], 0, 'second');
  4947. // ALIASES
  4948. addUnitAlias('second', 's');
  4949. // PRIORITY
  4950. addUnitPriority('second', 15);
  4951. // PARSING
  4952. addRegexToken('s', match1to2);
  4953. addRegexToken('ss', match1to2, match2);
  4954. addParseToken(['s', 'ss'], SECOND);
  4955. // MOMENTS
  4956. var getSetSecond = makeGetSet('Seconds', false);
  4957. // FORMATTING
  4958. addFormatToken('S', 0, 0, function () {
  4959. return ~~(this.millisecond() / 100);
  4960. });
  4961. addFormatToken(0, ['SS', 2], 0, function () {
  4962. return ~~(this.millisecond() / 10);
  4963. });
  4964. addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  4965. addFormatToken(0, ['SSSS', 4], 0, function () {
  4966. return this.millisecond() * 10;
  4967. });
  4968. addFormatToken(0, ['SSSSS', 5], 0, function () {
  4969. return this.millisecond() * 100;
  4970. });
  4971. addFormatToken(0, ['SSSSSS', 6], 0, function () {
  4972. return this.millisecond() * 1000;
  4973. });
  4974. addFormatToken(0, ['SSSSSSS', 7], 0, function () {
  4975. return this.millisecond() * 10000;
  4976. });
  4977. addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
  4978. return this.millisecond() * 100000;
  4979. });
  4980. addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  4981. return this.millisecond() * 1000000;
  4982. });
  4983. // ALIASES
  4984. addUnitAlias('millisecond', 'ms');
  4985. // PRIORITY
  4986. addUnitPriority('millisecond', 16);
  4987. // PARSING
  4988. addRegexToken('S', match1to3, match1);
  4989. addRegexToken('SS', match1to3, match2);
  4990. addRegexToken('SSS', match1to3, match3);
  4991. var token;
  4992. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  4993. addRegexToken(token, matchUnsigned);
  4994. }
  4995. function parseMs(input, array) {
  4996. array[MILLISECOND] = toInt(('0.' + input) * 1000);
  4997. }
  4998. for (token = 'S'; token.length <= 9; token += 'S') {
  4999. addParseToken(token, parseMs);
  5000. }
  5001. // MOMENTS
  5002. var getSetMillisecond = makeGetSet('Milliseconds', false);
  5003. // FORMATTING
  5004. addFormatToken('z', 0, 0, 'zoneAbbr');
  5005. addFormatToken('zz', 0, 0, 'zoneName');
  5006. // MOMENTS
  5007. function getZoneAbbr () {
  5008. return this._isUTC ? 'UTC' : '';
  5009. }
  5010. function getZoneName () {
  5011. return this._isUTC ? 'Coordinated Universal Time' : '';
  5012. }
  5013. var momentPrototype__proto = Moment.prototype;
  5014. momentPrototype__proto.add = add_subtract__add;
  5015. momentPrototype__proto.calendar = moment_calendar__calendar;
  5016. momentPrototype__proto.clone = clone;
  5017. momentPrototype__proto.diff = diff;
  5018. momentPrototype__proto.endOf = endOf;
  5019. momentPrototype__proto.format = format;
  5020. momentPrototype__proto.from = from;
  5021. momentPrototype__proto.fromNow = fromNow;
  5022. momentPrototype__proto.to = to;
  5023. momentPrototype__proto.toNow = toNow;
  5024. momentPrototype__proto.get = stringGet;
  5025. momentPrototype__proto.invalidAt = invalidAt;
  5026. momentPrototype__proto.isAfter = isAfter;
  5027. momentPrototype__proto.isBefore = isBefore;
  5028. momentPrototype__proto.isBetween = isBetween;
  5029. momentPrototype__proto.isSame = isSame;
  5030. momentPrototype__proto.isSameOrAfter = isSameOrAfter;
  5031. momentPrototype__proto.isSameOrBefore = isSameOrBefore;
  5032. momentPrototype__proto.isValid = moment_valid__isValid;
  5033. momentPrototype__proto.lang = lang;
  5034. momentPrototype__proto.locale = locale;
  5035. momentPrototype__proto.localeData = localeData;
  5036. momentPrototype__proto.max = prototypeMax;
  5037. momentPrototype__proto.min = prototypeMin;
  5038. momentPrototype__proto.parsingFlags = parsingFlags;
  5039. momentPrototype__proto.set = stringSet;
  5040. momentPrototype__proto.startOf = startOf;
  5041. momentPrototype__proto.subtract = add_subtract__subtract;
  5042. momentPrototype__proto.toArray = toArray;
  5043. momentPrototype__proto.toObject = toObject;
  5044. momentPrototype__proto.toDate = toDate;
  5045. momentPrototype__proto.toISOString = moment_format__toISOString;
  5046. momentPrototype__proto.toJSON = toJSON;
  5047. momentPrototype__proto.toString = toString;
  5048. momentPrototype__proto.unix = unix;
  5049. momentPrototype__proto.valueOf = to_type__valueOf;
  5050. momentPrototype__proto.creationData = creationData;
  5051. // Year
  5052. momentPrototype__proto.year = getSetYear;
  5053. momentPrototype__proto.isLeapYear = getIsLeapYear;
  5054. // Week Year
  5055. momentPrototype__proto.weekYear = getSetWeekYear;
  5056. momentPrototype__proto.isoWeekYear = getSetISOWeekYear;
  5057. // Quarter
  5058. momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter;
  5059. // Month
  5060. momentPrototype__proto.month = getSetMonth;
  5061. momentPrototype__proto.daysInMonth = getDaysInMonth;
  5062. // Week
  5063. momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek;
  5064. momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek;
  5065. momentPrototype__proto.weeksInYear = getWeeksInYear;
  5066. momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear;
  5067. // Day
  5068. momentPrototype__proto.date = getSetDayOfMonth;
  5069. momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek;
  5070. momentPrototype__proto.weekday = getSetLocaleDayOfWeek;
  5071. momentPrototype__proto.isoWeekday = getSetISODayOfWeek;
  5072. momentPrototype__proto.dayOfYear = getSetDayOfYear;
  5073. // Hour
  5074. momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour;
  5075. // Minute
  5076. momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute;
  5077. // Second
  5078. momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond;
  5079. // Millisecond
  5080. momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond;
  5081. // Offset
  5082. momentPrototype__proto.utcOffset = getSetOffset;
  5083. momentPrototype__proto.utc = setOffsetToUTC;
  5084. momentPrototype__proto.local = setOffsetToLocal;
  5085. momentPrototype__proto.parseZone = setOffsetToParsedOffset;
  5086. momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset;
  5087. momentPrototype__proto.isDST = isDaylightSavingTime;
  5088. momentPrototype__proto.isLocal = isLocal;
  5089. momentPrototype__proto.isUtcOffset = isUtcOffset;
  5090. momentPrototype__proto.isUtc = isUtc;
  5091. momentPrototype__proto.isUTC = isUtc;
  5092. // Timezone
  5093. momentPrototype__proto.zoneAbbr = getZoneAbbr;
  5094. momentPrototype__proto.zoneName = getZoneName;
  5095. // Deprecations
  5096. momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
  5097. momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
  5098. momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
  5099. momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
  5100. momentPrototype__proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
  5101. var momentPrototype = momentPrototype__proto;
  5102. function moment__createUnix (input) {
  5103. return local__createLocal(input * 1000);
  5104. }
  5105. function moment__createInZone () {
  5106. return local__createLocal.apply(null, arguments).parseZone();
  5107. }
  5108. function preParsePostFormat (string) {
  5109. return string;
  5110. }
  5111. var prototype__proto = Locale.prototype;
  5112. prototype__proto.calendar = locale_calendar__calendar;
  5113. prototype__proto.longDateFormat = longDateFormat;
  5114. prototype__proto.invalidDate = invalidDate;
  5115. prototype__proto.ordinal = ordinal;
  5116. prototype__proto.preparse = preParsePostFormat;
  5117. prototype__proto.postformat = preParsePostFormat;
  5118. prototype__proto.relativeTime = relative__relativeTime;
  5119. prototype__proto.pastFuture = pastFuture;
  5120. prototype__proto.set = locale_set__set;
  5121. // Month
  5122. prototype__proto.months = localeMonths;
  5123. prototype__proto.monthsShort = localeMonthsShort;
  5124. prototype__proto.monthsParse = localeMonthsParse;
  5125. prototype__proto.monthsRegex = monthsRegex;
  5126. prototype__proto.monthsShortRegex = monthsShortRegex;
  5127. // Week
  5128. prototype__proto.week = localeWeek;
  5129. prototype__proto.firstDayOfYear = localeFirstDayOfYear;
  5130. prototype__proto.firstDayOfWeek = localeFirstDayOfWeek;
  5131. // Day of Week
  5132. prototype__proto.weekdays = localeWeekdays;
  5133. prototype__proto.weekdaysMin = localeWeekdaysMin;
  5134. prototype__proto.weekdaysShort = localeWeekdaysShort;
  5135. prototype__proto.weekdaysParse = localeWeekdaysParse;
  5136. prototype__proto.weekdaysRegex = weekdaysRegex;
  5137. prototype__proto.weekdaysShortRegex = weekdaysShortRegex;
  5138. prototype__proto.weekdaysMinRegex = weekdaysMinRegex;
  5139. // Hours
  5140. prototype__proto.isPM = localeIsPM;
  5141. prototype__proto.meridiem = localeMeridiem;
  5142. function lists__get (format, index, field, setter) {
  5143. var locale = locale_locales__getLocale();
  5144. var utc = create_utc__createUTC().set(setter, index);
  5145. return locale[field](utc, format);
  5146. }
  5147. function listMonthsImpl (format, index, field) {
  5148. if (typeof format === 'number') {
  5149. index = format;
  5150. format = undefined;
  5151. }
  5152. format = format || '';
  5153. if (index != null) {
  5154. return lists__get(format, index, field, 'month');
  5155. }
  5156. var i;
  5157. var out = [];
  5158. for (i = 0; i < 12; i++) {
  5159. out[i] = lists__get(format, i, field, 'month');
  5160. }
  5161. return out;
  5162. }
  5163. // ()
  5164. // (5)
  5165. // (fmt, 5)
  5166. // (fmt)
  5167. // (true)
  5168. // (true, 5)
  5169. // (true, fmt, 5)
  5170. // (true, fmt)
  5171. function listWeekdaysImpl (localeSorted, format, index, field) {
  5172. if (typeof localeSorted === 'boolean') {
  5173. if (typeof format === 'number') {
  5174. index = format;
  5175. format = undefined;
  5176. }
  5177. format = format || '';
  5178. } else {
  5179. format = localeSorted;
  5180. index = format;
  5181. localeSorted = false;
  5182. if (typeof format === 'number') {
  5183. index = format;
  5184. format = undefined;
  5185. }
  5186. format = format || '';
  5187. }
  5188. var locale = locale_locales__getLocale(),
  5189. shift = localeSorted ? locale._week.dow : 0;
  5190. if (index != null) {
  5191. return lists__get(format, (index + shift) % 7, field, 'day');
  5192. }
  5193. var i;
  5194. var out = [];
  5195. for (i = 0; i < 7; i++) {
  5196. out[i] = lists__get(format, (i + shift) % 7, field, 'day');
  5197. }
  5198. return out;
  5199. }
  5200. function lists__listMonths (format, index) {
  5201. return listMonthsImpl(format, index, 'months');
  5202. }
  5203. function lists__listMonthsShort (format, index) {
  5204. return listMonthsImpl(format, index, 'monthsShort');
  5205. }
  5206. function lists__listWeekdays (localeSorted, format, index) {
  5207. return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  5208. }
  5209. function lists__listWeekdaysShort (localeSorted, format, index) {
  5210. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  5211. }
  5212. function lists__listWeekdaysMin (localeSorted, format, index) {
  5213. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  5214. }
  5215. locale_locales__getSetGlobalLocale('en', {
  5216. ordinalParse: /\d{1,2}(th|st|nd|rd)/,
  5217. ordinal : function (number) {
  5218. var b = number % 10,
  5219. output = (toInt(number % 100 / 10) === 1) ? 'th' :
  5220. (b === 1) ? 'st' :
  5221. (b === 2) ? 'nd' :
  5222. (b === 3) ? 'rd' : 'th';
  5223. return number + output;
  5224. }
  5225. });
  5226. // Side effect imports
  5227. utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale);
  5228. utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale);
  5229. var mathAbs = Math.abs;
  5230. function duration_abs__abs () {
  5231. var data = this._data;
  5232. this._milliseconds = mathAbs(this._milliseconds);
  5233. this._days = mathAbs(this._days);
  5234. this._months = mathAbs(this._months);
  5235. data.milliseconds = mathAbs(data.milliseconds);
  5236. data.seconds = mathAbs(data.seconds);
  5237. data.minutes = mathAbs(data.minutes);
  5238. data.hours = mathAbs(data.hours);
  5239. data.months = mathAbs(data.months);
  5240. data.years = mathAbs(data.years);
  5241. return this;
  5242. }
  5243. function duration_add_subtract__addSubtract (duration, input, value, direction) {
  5244. var other = create__createDuration(input, value);
  5245. duration._milliseconds += direction * other._milliseconds;
  5246. duration._days += direction * other._days;
  5247. duration._months += direction * other._months;
  5248. return duration._bubble();
  5249. }
  5250. // supports only 2.0-style add(1, 's') or add(duration)
  5251. function duration_add_subtract__add (input, value) {
  5252. return duration_add_subtract__addSubtract(this, input, value, 1);
  5253. }
  5254. // supports only 2.0-style subtract(1, 's') or subtract(duration)
  5255. function duration_add_subtract__subtract (input, value) {
  5256. return duration_add_subtract__addSubtract(this, input, value, -1);
  5257. }
  5258. function absCeil (number) {
  5259. if (number < 0) {
  5260. return Math.floor(number);
  5261. } else {
  5262. return Math.ceil(number);
  5263. }
  5264. }
  5265. function bubble () {
  5266. var milliseconds = this._milliseconds;
  5267. var days = this._days;
  5268. var months = this._months;
  5269. var data = this._data;
  5270. var seconds, minutes, hours, years, monthsFromDays;
  5271. // if we have a mix of positive and negative values, bubble down first
  5272. // check: https://github.com/moment/moment/issues/2166
  5273. if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
  5274. (milliseconds <= 0 && days <= 0 && months <= 0))) {
  5275. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  5276. days = 0;
  5277. months = 0;
  5278. }
  5279. // The following code bubbles up values, see the tests for
  5280. // examples of what that means.
  5281. data.milliseconds = milliseconds % 1000;
  5282. seconds = absFloor(milliseconds / 1000);
  5283. data.seconds = seconds % 60;
  5284. minutes = absFloor(seconds / 60);
  5285. data.minutes = minutes % 60;
  5286. hours = absFloor(minutes / 60);
  5287. data.hours = hours % 24;
  5288. days += absFloor(hours / 24);
  5289. // convert days to months
  5290. monthsFromDays = absFloor(daysToMonths(days));
  5291. months += monthsFromDays;
  5292. days -= absCeil(monthsToDays(monthsFromDays));
  5293. // 12 months -> 1 year
  5294. years = absFloor(months / 12);
  5295. months %= 12;
  5296. data.days = days;
  5297. data.months = months;
  5298. data.years = years;
  5299. return this;
  5300. }
  5301. function daysToMonths (days) {
  5302. // 400 years have 146097 days (taking into account leap year rules)
  5303. // 400 years have 12 months === 4800
  5304. return days * 4800 / 146097;
  5305. }
  5306. function monthsToDays (months) {
  5307. // the reverse of daysToMonths
  5308. return months * 146097 / 4800;
  5309. }
  5310. function as (units) {
  5311. var days;
  5312. var months;
  5313. var milliseconds = this._milliseconds;
  5314. units = normalizeUnits(units);
  5315. if (units === 'month' || units === 'year') {
  5316. days = this._days + milliseconds / 864e5;
  5317. months = this._months + daysToMonths(days);
  5318. return units === 'month' ? months : months / 12;
  5319. } else {
  5320. // handle milliseconds separately because of floating point math errors (issue #1867)
  5321. days = this._days + Math.round(monthsToDays(this._months));
  5322. switch (units) {
  5323. case 'week' : return days / 7 + milliseconds / 6048e5;
  5324. case 'day' : return days + milliseconds / 864e5;
  5325. case 'hour' : return days * 24 + milliseconds / 36e5;
  5326. case 'minute' : return days * 1440 + milliseconds / 6e4;
  5327. case 'second' : return days * 86400 + milliseconds / 1000;
  5328. // Math.floor prevents floating point math errors here
  5329. case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
  5330. default: throw new Error('Unknown unit ' + units);
  5331. }
  5332. }
  5333. }
  5334. // TODO: Use this.as('ms')?
  5335. function duration_as__valueOf () {
  5336. return (
  5337. this._milliseconds +
  5338. this._days * 864e5 +
  5339. (this._months % 12) * 2592e6 +
  5340. toInt(this._months / 12) * 31536e6
  5341. );
  5342. }
  5343. function makeAs (alias) {
  5344. return function () {
  5345. return this.as(alias);
  5346. };
  5347. }
  5348. var asMilliseconds = makeAs('ms');
  5349. var asSeconds = makeAs('s');
  5350. var asMinutes = makeAs('m');
  5351. var asHours = makeAs('h');
  5352. var asDays = makeAs('d');
  5353. var asWeeks = makeAs('w');
  5354. var asMonths = makeAs('M');
  5355. var asYears = makeAs('y');
  5356. function duration_get__get (units) {
  5357. units = normalizeUnits(units);
  5358. return this[units + 's']();
  5359. }
  5360. function makeGetter(name) {
  5361. return function () {
  5362. return this._data[name];
  5363. };
  5364. }
  5365. var milliseconds = makeGetter('milliseconds');
  5366. var seconds = makeGetter('seconds');
  5367. var minutes = makeGetter('minutes');
  5368. var hours = makeGetter('hours');
  5369. var days = makeGetter('days');
  5370. var months = makeGetter('months');
  5371. var years = makeGetter('years');
  5372. function weeks () {
  5373. return absFloor(this.days() / 7);
  5374. }
  5375. var round = Math.round;
  5376. var thresholds = {
  5377. s: 45, // seconds to minute
  5378. m: 45, // minutes to hour
  5379. h: 22, // hours to day
  5380. d: 26, // days to month
  5381. M: 11 // months to year
  5382. };
  5383. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  5384. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
  5385. return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  5386. }
  5387. function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) {
  5388. var duration = create__createDuration(posNegDuration).abs();
  5389. var seconds = round(duration.as('s'));
  5390. var minutes = round(duration.as('m'));
  5391. var hours = round(duration.as('h'));
  5392. var days = round(duration.as('d'));
  5393. var months = round(duration.as('M'));
  5394. var years = round(duration.as('y'));
  5395. var a = seconds < thresholds.s && ['s', seconds] ||
  5396. minutes <= 1 && ['m'] ||
  5397. minutes < thresholds.m && ['mm', minutes] ||
  5398. hours <= 1 && ['h'] ||
  5399. hours < thresholds.h && ['hh', hours] ||
  5400. days <= 1 && ['d'] ||
  5401. days < thresholds.d && ['dd', days] ||
  5402. months <= 1 && ['M'] ||
  5403. months < thresholds.M && ['MM', months] ||
  5404. years <= 1 && ['y'] || ['yy', years];
  5405. a[2] = withoutSuffix;
  5406. a[3] = +posNegDuration > 0;
  5407. a[4] = locale;
  5408. return substituteTimeAgo.apply(null, a);
  5409. }
  5410. // This function allows you to set the rounding function for relative time strings
  5411. function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {
  5412. if (roundingFunction === undefined) {
  5413. return round;
  5414. }
  5415. if (typeof(roundingFunction) === 'function') {
  5416. round = roundingFunction;
  5417. return true;
  5418. }
  5419. return false;
  5420. }
  5421. // This function allows you to set a threshold for relative time strings
  5422. function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {
  5423. if (thresholds[threshold] === undefined) {
  5424. return false;
  5425. }
  5426. if (limit === undefined) {
  5427. return thresholds[threshold];
  5428. }
  5429. thresholds[threshold] = limit;
  5430. return true;
  5431. }
  5432. function humanize (withSuffix) {
  5433. var locale = this.localeData();
  5434. var output = duration_humanize__relativeTime(this, !withSuffix, locale);
  5435. if (withSuffix) {
  5436. output = locale.pastFuture(+this, output);
  5437. }
  5438. return locale.postformat(output);
  5439. }
  5440. var iso_string__abs = Math.abs;
  5441. function iso_string__toISOString() {
  5442. // for ISO strings we do not use the normal bubbling rules:
  5443. // * milliseconds bubble up until they become hours
  5444. // * days do not bubble at all
  5445. // * months bubble up until they become years
  5446. // This is because there is no context-free conversion between hours and days
  5447. // (think of clock changes)
  5448. // and also not between days and months (28-31 days per month)
  5449. var seconds = iso_string__abs(this._milliseconds) / 1000;
  5450. var days = iso_string__abs(this._days);
  5451. var months = iso_string__abs(this._months);
  5452. var minutes, hours, years;
  5453. // 3600 seconds -> 60 minutes -> 1 hour
  5454. minutes = absFloor(seconds / 60);
  5455. hours = absFloor(minutes / 60);
  5456. seconds %= 60;
  5457. minutes %= 60;
  5458. // 12 months -> 1 year
  5459. years = absFloor(months / 12);
  5460. months %= 12;
  5461. // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
  5462. var Y = years;
  5463. var M = months;
  5464. var D = days;
  5465. var h = hours;
  5466. var m = minutes;
  5467. var s = seconds;
  5468. var total = this.asSeconds();
  5469. if (!total) {
  5470. // this is the same as C#'s (Noda) and python (isodate)...
  5471. // but not other JS (goog.date)
  5472. return 'P0D';
  5473. }
  5474. return (total < 0 ? '-' : '') +
  5475. 'P' +
  5476. (Y ? Y + 'Y' : '') +
  5477. (M ? M + 'M' : '') +
  5478. (D ? D + 'D' : '') +
  5479. ((h || m || s) ? 'T' : '') +
  5480. (h ? h + 'H' : '') +
  5481. (m ? m + 'M' : '') +
  5482. (s ? s + 'S' : '');
  5483. }
  5484. var duration_prototype__proto = Duration.prototype;
  5485. duration_prototype__proto.abs = duration_abs__abs;
  5486. duration_prototype__proto.add = duration_add_subtract__add;
  5487. duration_prototype__proto.subtract = duration_add_subtract__subtract;
  5488. duration_prototype__proto.as = as;
  5489. duration_prototype__proto.asMilliseconds = asMilliseconds;
  5490. duration_prototype__proto.asSeconds = asSeconds;
  5491. duration_prototype__proto.asMinutes = asMinutes;
  5492. duration_prototype__proto.asHours = asHours;
  5493. duration_prototype__proto.asDays = asDays;
  5494. duration_prototype__proto.asWeeks = asWeeks;
  5495. duration_prototype__proto.asMonths = asMonths;
  5496. duration_prototype__proto.asYears = asYears;
  5497. duration_prototype__proto.valueOf = duration_as__valueOf;
  5498. duration_prototype__proto._bubble = bubble;
  5499. duration_prototype__proto.get = duration_get__get;
  5500. duration_prototype__proto.milliseconds = milliseconds;
  5501. duration_prototype__proto.seconds = seconds;
  5502. duration_prototype__proto.minutes = minutes;
  5503. duration_prototype__proto.hours = hours;
  5504. duration_prototype__proto.days = days;
  5505. duration_prototype__proto.weeks = weeks;
  5506. duration_prototype__proto.months = months;
  5507. duration_prototype__proto.years = years;
  5508. duration_prototype__proto.humanize = humanize;
  5509. duration_prototype__proto.toISOString = iso_string__toISOString;
  5510. duration_prototype__proto.toString = iso_string__toISOString;
  5511. duration_prototype__proto.toJSON = iso_string__toISOString;
  5512. duration_prototype__proto.locale = locale;
  5513. duration_prototype__proto.localeData = localeData;
  5514. // Deprecations
  5515. duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString);
  5516. duration_prototype__proto.lang = lang;
  5517. // Side effect imports
  5518. // FORMATTING
  5519. addFormatToken('X', 0, 0, 'unix');
  5520. addFormatToken('x', 0, 0, 'valueOf');
  5521. // PARSING
  5522. addRegexToken('x', matchSigned);
  5523. addRegexToken('X', matchTimestamp);
  5524. addParseToken('X', function (input, array, config) {
  5525. config._d = new Date(parseFloat(input, 10) * 1000);
  5526. });
  5527. addParseToken('x', function (input, array, config) {
  5528. config._d = new Date(toInt(input));
  5529. });
  5530. // Side effect imports
  5531. utils_hooks__hooks.version = '2.15.2';
  5532. setHookCallback(local__createLocal);
  5533. utils_hooks__hooks.fn = momentPrototype;
  5534. utils_hooks__hooks.min = min;
  5535. utils_hooks__hooks.max = max;
  5536. utils_hooks__hooks.now = now;
  5537. utils_hooks__hooks.utc = create_utc__createUTC;
  5538. utils_hooks__hooks.unix = moment__createUnix;
  5539. utils_hooks__hooks.months = lists__listMonths;
  5540. utils_hooks__hooks.isDate = isDate;
  5541. utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale;
  5542. utils_hooks__hooks.invalid = valid__createInvalid;
  5543. utils_hooks__hooks.duration = create__createDuration;
  5544. utils_hooks__hooks.isMoment = isMoment;
  5545. utils_hooks__hooks.weekdays = lists__listWeekdays;
  5546. utils_hooks__hooks.parseZone = moment__createInZone;
  5547. utils_hooks__hooks.localeData = locale_locales__getLocale;
  5548. utils_hooks__hooks.isDuration = isDuration;
  5549. utils_hooks__hooks.monthsShort = lists__listMonthsShort;
  5550. utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin;
  5551. utils_hooks__hooks.defineLocale = defineLocale;
  5552. utils_hooks__hooks.updateLocale = updateLocale;
  5553. utils_hooks__hooks.locales = locale_locales__listLocales;
  5554. utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort;
  5555. utils_hooks__hooks.normalizeUnits = normalizeUnits;
  5556. utils_hooks__hooks.relativeTimeRounding = duration_humanize__getSetRelativeTimeRounding;
  5557. utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold;
  5558. utils_hooks__hooks.calendarFormat = getCalendarFormat;
  5559. utils_hooks__hooks.prototype = momentPrototype;
  5560. var _moment = utils_hooks__hooks;
  5561. return _moment;
  5562. }));
  5563. define('moment', ['moment/moment'], function (main) { return main; });
  5564. /*
  5565. * css.normalize.js
  5566. *
  5567. * CSS Normalization
  5568. *
  5569. * CSS paths are normalized based on an optional basePath and the RequireJS config
  5570. *
  5571. * Usage:
  5572. * normalize(css, fromBasePath, toBasePath);
  5573. *
  5574. * css: the stylesheet content to normalize
  5575. * fromBasePath: the absolute base path of the css relative to any root (but without ../ backtracking)
  5576. * toBasePath: the absolute new base path of the css relative to the same root
  5577. *
  5578. * Absolute dependencies are left untouched.
  5579. *
  5580. * Urls in the CSS are picked up by regular expressions.
  5581. * These will catch all statements of the form:
  5582. *
  5583. * url(*)
  5584. * url('*')
  5585. * url("*")
  5586. *
  5587. * @import '*'
  5588. * @import "*"
  5589. *
  5590. * (and so also @import url(*) variations)
  5591. *
  5592. * For urls needing normalization
  5593. *
  5594. */
  5595. define('../libs/require-css/normalize',[],function() {
  5596. // regular expression for removing double slashes
  5597. // eg http://www.example.com//my///url/here -> http://www.example.com/my/url/here
  5598. var slashes = /([^:])\/+/g
  5599. var removeDoubleSlashes = function(uri) {
  5600. return uri.replace(slashes, '$1/');
  5601. }
  5602. // given a relative URI, and two absolute base URIs, convert it from one base to another
  5603. var protocolRegEx = /[^\:\/]*:\/\/([^\/])*/;
  5604. var absUrlRegEx = /^(\/|data:)/;
  5605. function convertURIBase(uri, fromBase, toBase) {
  5606. if (uri.match(absUrlRegEx) || uri.match(protocolRegEx))
  5607. return uri;
  5608. uri = removeDoubleSlashes(uri);
  5609. // if toBase specifies a protocol path, ensure this is the same protocol as fromBase, if not
  5610. // use absolute path at fromBase
  5611. var toBaseProtocol = toBase.match(protocolRegEx);
  5612. var fromBaseProtocol = fromBase.match(protocolRegEx);
  5613. if (fromBaseProtocol && (!toBaseProtocol || toBaseProtocol[1] != fromBaseProtocol[1] || toBaseProtocol[2] != fromBaseProtocol[2]))
  5614. return absoluteURI(uri, fromBase);
  5615. else {
  5616. return relativeURI(absoluteURI(uri, fromBase), toBase);
  5617. }
  5618. };
  5619. // given a relative URI, calculate the absolute URI
  5620. function absoluteURI(uri, base) {
  5621. if (uri.substr(0, 2) == './')
  5622. uri = uri.substr(2);
  5623. // absolute urls are left in tact
  5624. if (uri.match(absUrlRegEx) || uri.match(protocolRegEx))
  5625. return uri;
  5626. var baseParts = base.split('/');
  5627. var uriParts = uri.split('/');
  5628. baseParts.pop();
  5629. while (curPart = uriParts.shift())
  5630. if (curPart == '..')
  5631. baseParts.pop();
  5632. else
  5633. baseParts.push(curPart);
  5634. return baseParts.join('/');
  5635. };
  5636. // given an absolute URI, calculate the relative URI
  5637. function relativeURI(uri, base) {
  5638. // reduce base and uri strings to just their difference string
  5639. var baseParts = base.split('/');
  5640. baseParts.pop();
  5641. base = baseParts.join('/') + '/';
  5642. i = 0;
  5643. while (base.substr(i, 1) == uri.substr(i, 1))
  5644. i++;
  5645. while (base.substr(i, 1) != '/')
  5646. i--;
  5647. base = base.substr(i + 1);
  5648. uri = uri.substr(i + 1);
  5649. // each base folder difference is thus a backtrack
  5650. baseParts = base.split('/');
  5651. var uriParts = uri.split('/');
  5652. out = '';
  5653. while (baseParts.shift())
  5654. out += '../';
  5655. // finally add uri parts
  5656. while (curPart = uriParts.shift())
  5657. out += curPart + '/';
  5658. return out.substr(0, out.length - 1);
  5659. };
  5660. var normalizeCSS = function(source, fromBase, toBase) {
  5661. fromBase = removeDoubleSlashes(fromBase);
  5662. toBase = removeDoubleSlashes(toBase);
  5663. var urlRegEx = /@import\s*("([^"]*)"|'([^']*)')|url\s*\((?!#)\s*(\s*"([^"]*)"|'([^']*)'|[^\)]*\s*)\s*\)/ig;
  5664. var result, url, source;
  5665. while (result = urlRegEx.exec(source)) {
  5666. url = result[3] || result[2] || result[5] || result[6] || result[4];
  5667. var newUrl;
  5668. newUrl = convertURIBase(url, fromBase, toBase);
  5669. var quoteLen = result[5] || result[6] ? 1 : 0;
  5670. source = source.substr(0, urlRegEx.lastIndex - url.length - quoteLen - 1) + newUrl + source.substr(urlRegEx.lastIndex - quoteLen - 1);
  5671. urlRegEx.lastIndex = urlRegEx.lastIndex + (newUrl.length - url.length);
  5672. }
  5673. return source;
  5674. };
  5675. normalizeCSS.convertURIBase = convertURIBase;
  5676. normalizeCSS.absoluteURI = absoluteURI;
  5677. normalizeCSS.relativeURI = relativeURI;
  5678. return normalizeCSS;
  5679. });
  5680. ;
  5681. define('../libs/require-css/css.min!../libs/bootstrap-table/dist/bootstrap-table.min',[],function(){});
  5682. /*
  5683. * bootstrap-table - v1.11.0 - 2016-07-02
  5684. * https://github.com/wenzhixin/bootstrap-table
  5685. * Copyright (c) 2016 zhixin wen
  5686. * Licensed MIT License
  5687. */
  5688. !function(a){"use strict";var b=null,c=function(a){var b=arguments,c=!0,d=1;return a=a.replace(/%s/g,function(){var a=b[d++];return"undefined"==typeof a?(c=!1,""):a}),c?a:""},d=function(b,c,d,e){var f="";return a.each(b,function(a,b){return b[c]===e?(f=b[d],!1):!0}),f},e=function(b,c){var d=-1;return a.each(b,function(a,b){return b.field===c?(d=a,!1):!0}),d},f=function(b){var c,d,e,f=0,g=[];for(c=0;c<b[0].length;c++)f+=b[0][c].colspan||1;for(c=0;c<b.length;c++)for(g[c]=[],d=0;f>d;d++)g[c][d]=!1;for(c=0;c<b.length;c++)for(d=0;d<b[c].length;d++){var h=b[c][d],i=h.rowspan||1,j=h.colspan||1,k=a.inArray(!1,g[c]);for(1===j&&(h.fieldIndex=k,"undefined"==typeof h.field&&(h.field=k)),e=0;i>e;e++)g[c+e][k]=!0;for(e=0;j>e;e++)g[c][k+e]=!0}},g=function(){if(null===b){var c,d,e=a("<p/>").addClass("fixed-table-scroll-inner"),f=a("<div/>").addClass("fixed-table-scroll-outer");f.append(e),a("body").append(f),c=e[0].offsetWidth,f.css("overflow","scroll"),d=e[0].offsetWidth,c===d&&(d=f[0].clientWidth),f.remove(),b=c-d}return b},h=function(b,d,e,f){var g=d;if("string"==typeof d){var h=d.split(".");h.length>1?(g=window,a.each(h,function(a,b){g=g[b]})):g=window[d]}return"object"==typeof g?g:"function"==typeof g?g.apply(b,e):!g&&"string"==typeof d&&c.apply(this,[d].concat(e))?c.apply(this,[d].concat(e)):f},i=function(b,c,d){var e=Object.getOwnPropertyNames(b),f=Object.getOwnPropertyNames(c),g="";if(d&&e.length!==f.length)return!1;for(var h=0;h<e.length;h++)if(g=e[h],a.inArray(g,f)>-1&&b[g]!==c[g])return!1;return!0},j=function(a){return"string"==typeof a?a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/`/g,"&#x60;"):a},k=function(b){var c=0;return b.children().each(function(){c<a(this).outerHeight(!0)&&(c=a(this).outerHeight(!0))}),c},l=function(a){for(var b in a){var c=b.split(/(?=[A-Z])/).join("-").toLowerCase();c!==b&&(a[c]=a[b],delete a[b])}return a},m=function(a,b,c){var d=a;if("string"!=typeof b||a.hasOwnProperty(b))return c?j(a[b]):a[b];var e=b.split(".");for(var f in e)d=d&&d[e[f]];return c?j(d):d},n=function(){return!!(navigator.userAgent.indexOf("MSIE ")>0||navigator.userAgent.match(/Trident.*rv\:11\./))},o=function(){Object.keys||(Object.keys=function(){var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=c.length;return function(e){if("object"!=typeof e&&("function"!=typeof e||null===e))throw new TypeError("Object.keys called on non-object");var f,g,h=[];for(f in e)a.call(e,f)&&h.push(f);if(b)for(g=0;d>g;g++)a.call(e,c[g])&&h.push(c[g]);return h}}())},p=function(b,c){this.options=c,this.$el=a(b),this.$el_=this.$el.clone(),this.timeoutId_=0,this.timeoutFooter_=0,this.init()};p.DEFAULTS={classes:"table table-hover",locale:void 0,height:void 0,undefinedText:"-",sortName:void 0,sortOrder:"asc",sortStable:!1,striped:!1,columns:[[]],data:[],dataField:"rows",method:"get",url:void 0,ajax:void 0,cache:!0,contentType:"application/json",dataType:"json",ajaxOptions:{},queryParams:function(a){return a},queryParamsType:"limit",responseHandler:function(a){return a},pagination:!1,onlyInfoPagination:!1,sidePagination:"client",totalRows:0,pageNumber:1,pageSize:10,pageList:[10,25,50,100],paginationHAlign:"right",paginationVAlign:"bottom",paginationDetailHAlign:"left",paginationPreText:"&lsaquo;",paginationNextText:"&rsaquo;",search:!1,searchOnEnterKey:!1,strictSearch:!1,searchAlign:"right",selectItemName:"btSelectItem",showHeader:!0,showFooter:!1,showColumns:!1,showPaginationSwitch:!1,showRefresh:!1,showToggle:!1,buttonsAlign:"right",smartDisplay:!0,escape:!1,minimumCountColumns:1,idField:void 0,uniqueId:void 0,cardView:!1,detailView:!1,detailFormatter:function(){return""},trimOnSearch:!0,clickToSelect:!1,singleSelect:!1,toolbar:void 0,toolbarAlign:"left",checkboxHeader:!0,sortable:!0,silentSort:!0,maintainSelected:!1,searchTimeOut:500,searchText:"",iconSize:void 0,buttonsClass:"default",iconsPrefix:"glyphicon",icons:{paginationSwitchDown:"glyphicon-collapse-down icon-chevron-down",paginationSwitchUp:"glyphicon-collapse-up icon-chevron-up",refresh:"glyphicon-refresh icon-refresh",toggle:"glyphicon-list-alt icon-list-alt",columns:"glyphicon-th icon-th",detailOpen:"glyphicon-plus icon-plus",detailClose:"glyphicon-minus icon-minus"},customSearch:a.noop,customSort:a.noop,rowStyle:function(){return{}},rowAttributes:function(){return{}},footerStyle:function(){return{}},onAll:function(){return!1},onClickCell:function(){return!1},onDblClickCell:function(){return!1},onClickRow:function(){return!1},onDblClickRow:function(){return!1},onSort:function(){return!1},onCheck:function(){return!1},onUncheck:function(){return!1},onCheckAll:function(){return!1},onUncheckAll:function(){return!1},onCheckSome:function(){return!1},onUncheckSome:function(){return!1},onLoadSuccess:function(){return!1},onLoadError:function(){return!1},onColumnSwitch:function(){return!1},onPageChange:function(){return!1},onSearch:function(){return!1},onToggle:function(){return!1},onPreBody:function(){return!1},onPostBody:function(){return!1},onPostHeader:function(){return!1},onExpandRow:function(){return!1},onCollapseRow:function(){return!1},onRefreshOptions:function(){return!1},onRefresh:function(){return!1},onResetView:function(){return!1}},p.LOCALES={},p.LOCALES["en-US"]=p.LOCALES.en={formatLoadingMessage:function(){return"Loading, please wait..."},formatRecordsPerPage:function(a){return c("%s rows per page",a)},formatShowingRows:function(a,b,d){return c("Showing %s to %s of %s rows",a,b,d)},formatDetailPagination:function(a){return c("Showing %s rows",a)},formatSearch:function(){return"Search"},formatNoMatches:function(){return"No matching records found"},formatPaginationSwitch:function(){return"Hide/Show pagination"},formatRefresh:function(){return"Refresh"},formatToggle:function(){return"Toggle"},formatColumns:function(){return"Columns"},formatAllRows:function(){return"All"}},a.extend(p.DEFAULTS,p.LOCALES["en-US"]),p.COLUMN_DEFAULTS={radio:!1,checkbox:!1,checkboxEnabled:!0,field:void 0,title:void 0,titleTooltip:void 0,"class":void 0,align:void 0,halign:void 0,falign:void 0,valign:void 0,width:void 0,sortable:!1,order:"asc",visible:!0,switchable:!0,clickToSelect:!0,formatter:void 0,footerFormatter:void 0,events:void 0,sorter:void 0,sortName:void 0,cellStyle:void 0,searchable:!0,searchFormatter:!0,cardVisible:!0},p.EVENTS={"all.bs.table":"onAll","click-cell.bs.table":"onClickCell","dbl-click-cell.bs.table":"onDblClickCell","click-row.bs.table":"onClickRow","dbl-click-row.bs.table":"onDblClickRow","sort.bs.table":"onSort","check.bs.table":"onCheck","uncheck.bs.table":"onUncheck","check-all.bs.table":"onCheckAll","uncheck-all.bs.table":"onUncheckAll","check-some.bs.table":"onCheckSome","uncheck-some.bs.table":"onUncheckSome","load-success.bs.table":"onLoadSuccess","load-error.bs.table":"onLoadError","column-switch.bs.table":"onColumnSwitch","page-change.bs.table":"onPageChange","search.bs.table":"onSearch","toggle.bs.table":"onToggle","pre-body.bs.table":"onPreBody","post-body.bs.table":"onPostBody","post-header.bs.table":"onPostHeader","expand-row.bs.table":"onExpandRow","collapse-row.bs.table":"onCollapseRow","refresh-options.bs.table":"onRefreshOptions","reset-view.bs.table":"onResetView","refresh.bs.table":"onRefresh"},p.prototype.init=function(){this.initLocale(),this.initContainer(),this.initTable(),this.initHeader(),this.initData(),this.initFooter(),this.initToolbar(),this.initPagination(),this.initBody(),this.initSearchText(),this.initServer()},p.prototype.initLocale=function(){if(this.options.locale){var b=this.options.locale.split(/-|_/);b[0].toLowerCase(),b[1]&&b[1].toUpperCase(),a.fn.bootstrapTable.locales[this.options.locale]?a.extend(this.options,a.fn.bootstrapTable.locales[this.options.locale]):a.fn.bootstrapTable.locales[b.join("-")]?a.extend(this.options,a.fn.bootstrapTable.locales[b.join("-")]):a.fn.bootstrapTable.locales[b[0]]&&a.extend(this.options,a.fn.bootstrapTable.locales[b[0]])}},p.prototype.initContainer=function(){this.$container=a(['<div class="bootstrap-table">','<div class="fixed-table-toolbar"></div>',"top"===this.options.paginationVAlign||"both"===this.options.paginationVAlign?'<div class="fixed-table-pagination" style="clear: both;"></div>':"",'<div class="fixed-table-container">','<div class="fixed-table-header"><table></table></div>','<div class="fixed-table-body">','<div class="fixed-table-loading">',this.options.formatLoadingMessage(),"</div>","</div>",'<div class="fixed-table-footer"><table><tr></tr></table></div>',"bottom"===this.options.paginationVAlign||"both"===this.options.paginationVAlign?'<div class="fixed-table-pagination"></div>':"","</div>","</div>"].join("")),this.$container.insertAfter(this.$el),this.$tableContainer=this.$container.find(".fixed-table-container"),this.$tableHeader=this.$container.find(".fixed-table-header"),this.$tableBody=this.$container.find(".fixed-table-body"),this.$tableLoading=this.$container.find(".fixed-table-loading"),this.$tableFooter=this.$container.find(".fixed-table-footer"),this.$toolbar=this.$container.find(".fixed-table-toolbar"),this.$pagination=this.$container.find(".fixed-table-pagination"),this.$tableBody.append(this.$el),this.$container.after('<div class="clearfix"></div>'),this.$el.addClass(this.options.classes),this.options.striped&&this.$el.addClass("table-striped"),-1!==a.inArray("table-no-bordered",this.options.classes.split(" "))&&this.$tableContainer.addClass("table-no-bordered")},p.prototype.initTable=function(){var b=this,c=[],d=[];if(this.$header=this.$el.find(">thead"),this.$header.length||(this.$header=a("<thead></thead>").appendTo(this.$el)),this.$header.find("tr").each(function(){var b=[];a(this).find("th").each(function(){"undefined"!=typeof a(this).data("field")&&a(this).data("field",a(this).data("field")+""),b.push(a.extend({},{title:a(this).html(),"class":a(this).attr("class"),titleTooltip:a(this).attr("title"),rowspan:a(this).attr("rowspan")?+a(this).attr("rowspan"):void 0,colspan:a(this).attr("colspan")?+a(this).attr("colspan"):void 0},a(this).data()))}),c.push(b)}),a.isArray(this.options.columns[0])||(this.options.columns=[this.options.columns]),this.options.columns=a.extend(!0,[],c,this.options.columns),this.columns=[],f(this.options.columns),a.each(this.options.columns,function(c,d){a.each(d,function(d,e){e=a.extend({},p.COLUMN_DEFAULTS,e),"undefined"!=typeof e.fieldIndex&&(b.columns[e.fieldIndex]=e),b.options.columns[c][d]=e})}),!this.options.data.length){var e=[];this.$el.find(">tbody>tr").each(function(c){var f={};f._id=a(this).attr("id"),f._class=a(this).attr("class"),f._data=l(a(this).data()),a(this).find(">td").each(function(d){for(var g,h,i=a(this),j=+i.attr("colspan")||1,k=+i.attr("rowspan")||1;e[c]&&e[c][d];d++);for(g=d;d+j>g;g++)for(h=c;c+k>h;h++)e[h]||(e[h]=[]),e[h][g]=!0;var m=b.columns[d].field;f[m]=a(this).html(),f["_"+m+"_id"]=a(this).attr("id"),f["_"+m+"_class"]=a(this).attr("class"),f["_"+m+"_rowspan"]=a(this).attr("rowspan"),f["_"+m+"_colspan"]=a(this).attr("colspan"),f["_"+m+"_title"]=a(this).attr("title"),f["_"+m+"_data"]=l(a(this).data())}),d.push(f)}),this.options.data=d,d.length&&(this.fromHtml=!0)}},p.prototype.initHeader=function(){var b=this,d={},e=[];this.header={fields:[],styles:[],classes:[],formatters:[],events:[],sorters:[],sortNames:[],cellStyles:[],searchables:[]},a.each(this.options.columns,function(f,g){e.push("<tr>"),0===f&&!b.options.cardView&&b.options.detailView&&e.push(c('<th class="detail" rowspan="%s"><div class="fht-cell"></div></th>',b.options.columns.length)),a.each(g,function(a,f){var g="",h="",i="",j="",k=c(' class="%s"',f["class"]),l=(b.options.sortOrder||f.order,"px"),m=f.width;if(void 0===f.width||b.options.cardView||"string"==typeof f.width&&-1!==f.width.indexOf("%")&&(l="%"),f.width&&"string"==typeof f.width&&(m=f.width.replace("%","").replace("px","")),h=c("text-align: %s; ",f.halign?f.halign:f.align),i=c("text-align: %s; ",f.align),j=c("vertical-align: %s; ",f.valign),j+=c("width: %s; ",!f.checkbox&&!f.radio||m?m?m+l:void 0:"36px"),"undefined"!=typeof f.fieldIndex){if(b.header.fields[f.fieldIndex]=f.field,b.header.styles[f.fieldIndex]=i+j,b.header.classes[f.fieldIndex]=k,b.header.formatters[f.fieldIndex]=f.formatter,b.header.events[f.fieldIndex]=f.events,b.header.sorters[f.fieldIndex]=f.sorter,b.header.sortNames[f.fieldIndex]=f.sortName,b.header.cellStyles[f.fieldIndex]=f.cellStyle,b.header.searchables[f.fieldIndex]=f.searchable,!f.visible)return;if(b.options.cardView&&!f.cardVisible)return;d[f.field]=f}e.push("<th"+c(' title="%s"',f.titleTooltip),f.checkbox||f.radio?c(' class="bs-checkbox %s"',f["class"]||""):k,c(' style="%s"',h+j),c(' rowspan="%s"',f.rowspan),c(' colspan="%s"',f.colspan),c(' data-field="%s"',f.field),"tabindex='0'",">"),e.push(c('<div class="th-inner %s">',b.options.sortable&&f.sortable?"sortable both":"")),g=f.title,f.checkbox&&(!b.options.singleSelect&&b.options.checkboxHeader&&(g='<input name="btSelectAll" type="checkbox" />'),b.header.stateField=f.field),f.radio&&(g="",b.header.stateField=f.field,b.options.singleSelect=!0),e.push(g),e.push("</div>"),e.push('<div class="fht-cell"></div>'),e.push("</div>"),e.push("</th>")}),e.push("</tr>")}),this.$header.html(e.join("")),this.$header.find("th[data-field]").each(function(){a(this).data(d[a(this).data("field")])}),this.$container.off("click",".th-inner").on("click",".th-inner",function(c){var d=a(this);return b.options.detailView&&d.closest(".bootstrap-table")[0]!==b.$container[0]?!1:void(b.options.sortable&&d.parent().data().sortable&&b.onSort(c))}),this.$header.children().children().off("keypress").on("keypress",function(c){if(b.options.sortable&&a(this).data().sortable){var d=c.keyCode||c.which;13==d&&b.onSort(c)}}),a(window).off("resize.bootstrap-table"),!this.options.showHeader||this.options.cardView?(this.$header.hide(),this.$tableHeader.hide(),this.$tableLoading.css("top",0)):(this.$header.show(),this.$tableHeader.show(),this.$tableLoading.css("top",this.$header.outerHeight()+1),this.getCaret(),a(window).on("resize.bootstrap-table",a.proxy(this.resetWidth,this))),this.$selectAll=this.$header.find('[name="btSelectAll"]'),this.$selectAll.off("click").on("click",function(){var c=a(this).prop("checked");b[c?"checkAll":"uncheckAll"](),b.updateSelected()})},p.prototype.initFooter=function(){!this.options.showFooter||this.options.cardView?this.$tableFooter.hide():this.$tableFooter.show()},p.prototype.initData=function(a,b){this.data="append"===b?this.data.concat(a):"prepend"===b?[].concat(a).concat(this.data):a||this.options.data,this.options.data="append"===b?this.options.data.concat(a):"prepend"===b?[].concat(a).concat(this.options.data):this.data,"server"!==this.options.sidePagination&&this.initSort()},p.prototype.initSort=function(){var b=this,c=this.options.sortName,d="desc"===this.options.sortOrder?-1:1,e=a.inArray(this.options.sortName,this.header.fields);return this.options.customSort!==a.noop?void this.options.customSort.apply(this,[this.options.sortName,this.options.sortOrder]):void(-1!==e&&(this.options.sortStable&&a.each(this.data,function(a,b){b.hasOwnProperty("_position")||(b._position=a)}),this.data.sort(function(f,g){b.header.sortNames[e]&&(c=b.header.sortNames[e]);var i=m(f,c,b.options.escape),j=m(g,c,b.options.escape),k=h(b.header,b.header.sorters[e],[i,j]);return void 0!==k?d*k:((void 0===i||null===i)&&(i=""),(void 0===j||null===j)&&(j=""),b.options.sortStable&&i===j&&(i=f._position,j=g._position),a.isNumeric(i)&&a.isNumeric(j)?(i=parseFloat(i),j=parseFloat(j),j>i?-1*d:d):i===j?0:("string"!=typeof i&&(i=i.toString()),-1===i.localeCompare(j)?-1*d:d))})))},p.prototype.onSort=function(b){var c="keypress"===b.type?a(b.currentTarget):a(b.currentTarget).parent(),d=this.$header.find("th").eq(c.index());return this.$header.add(this.$header_).find("span.order").remove(),this.options.sortName===c.data("field")?this.options.sortOrder="asc"===this.options.sortOrder?"desc":"asc":(this.options.sortName=c.data("field"),this.options.sortOrder="asc"===c.data("order")?"desc":"asc"),this.trigger("sort",this.options.sortName,this.options.sortOrder),c.add(d).data("order",this.options.sortOrder),this.getCaret(),"server"===this.options.sidePagination?void this.initServer(this.options.silentSort):(this.initSort(),void this.initBody())},p.prototype.initToolbar=function(){var b,d,e=this,f=[],g=0,i=0;this.$toolbar.find(".bs-bars").children().length&&a("body").append(a(this.options.toolbar)),this.$toolbar.html(""),("string"==typeof this.options.toolbar||"object"==typeof this.options.toolbar)&&a(c('<div class="bs-bars pull-%s"></div>',this.options.toolbarAlign)).appendTo(this.$toolbar).append(a(this.options.toolbar)),f=[c('<div class="columns columns-%s btn-group pull-%s">',this.options.buttonsAlign,this.options.buttonsAlign)],"string"==typeof this.options.icons&&(this.options.icons=h(null,this.options.icons)),this.options.showPaginationSwitch&&f.push(c('<button class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+'" type="button" name="paginationSwitch" title="%s">',this.options.formatPaginationSwitch()),c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.paginationSwitchDown),"</button>"),this.options.showRefresh&&f.push(c('<button class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+'" type="button" name="refresh" title="%s">',this.options.formatRefresh()),c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.refresh),"</button>"),this.options.showToggle&&f.push(c('<button class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+'" type="button" name="toggle" title="%s">',this.options.formatToggle()),c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.toggle),"</button>"),this.options.showColumns&&(f.push(c('<div class="keep-open btn-group" title="%s">',this.options.formatColumns()),'<button type="button" class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+' dropdown-toggle" data-toggle="dropdown">',c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.columns),' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">'),a.each(this.columns,function(a,b){if(!(b.radio||b.checkbox||e.options.cardView&&!b.cardVisible)){var d=b.visible?' checked="checked"':"";b.switchable&&(f.push(c('<li><label><input type="checkbox" data-field="%s" value="%s"%s> %s</label></li>',b.field,a,d,b.title)),i++)}}),f.push("</ul>","</div>")),f.push("</div>"),(this.showToolbar||f.length>2)&&this.$toolbar.append(f.join("")),this.options.showPaginationSwitch&&this.$toolbar.find('button[name="paginationSwitch"]').off("click").on("click",a.proxy(this.togglePagination,this)),this.options.showRefresh&&this.$toolbar.find('button[name="refresh"]').off("click").on("click",a.proxy(this.refresh,this)),this.options.showToggle&&this.$toolbar.find('button[name="toggle"]').off("click").on("click",function(){e.toggleView()}),this.options.showColumns&&(b=this.$toolbar.find(".keep-open"),i<=this.options.minimumCountColumns&&b.find("input").prop("disabled",!0),b.find("li").off("click").on("click",function(a){a.stopImmediatePropagation()}),b.find("input").off("click").on("click",function(){var b=a(this);e.toggleColumn(a(this).val(),b.prop("checked"),!1),e.trigger("column-switch",a(this).data("field"),b.prop("checked"))})),this.options.search&&(f=[],f.push('<div class="pull-'+this.options.searchAlign+' search">',c('<input class="form-control'+c(" input-%s",this.options.iconSize)+'" type="text" placeholder="%s">',this.options.formatSearch()),"</div>"),this.$toolbar.append(f.join("")),d=this.$toolbar.find(".search input"),d.off("keyup drop").on("keyup drop",function(b){e.options.searchOnEnterKey&&13!==b.keyCode||a.inArray(b.keyCode,[37,38,39,40])>-1||(clearTimeout(g),g=setTimeout(function(){e.onSearch(b)},e.options.searchTimeOut))}),n()&&d.off("mouseup").on("mouseup",function(a){clearTimeout(g),g=setTimeout(function(){e.onSearch(a)},e.options.searchTimeOut)}))},p.prototype.onSearch=function(b){var c=a.trim(a(b.currentTarget).val());this.options.trimOnSearch&&a(b.currentTarget).val()!==c&&a(b.currentTarget).val(c),c!==this.searchText&&(this.searchText=c,this.options.searchText=c,this.options.pageNumber=1,this.initSearch(),this.updatePagination(),this.trigger("search",c))},p.prototype.initSearch=function(){var b=this;if("server"!==this.options.sidePagination){if(this.options.customSearch!==a.noop)return void this.options.customSearch.apply(this,[this.searchText]);var c=this.searchText&&(this.options.escape?j(this.searchText):this.searchText).toLowerCase(),d=a.isEmptyObject(this.filterColumns)?null:this.filterColumns;this.data=d?a.grep(this.options.data,function(b){for(var c in d)if(a.isArray(d[c])&&-1===a.inArray(b[c],d[c])||b[c]!==d[c])return!1;return!0}):this.options.data,this.data=c?a.grep(this.data,function(d,f){for(var g=0;g<b.header.fields.length;g++)if(b.header.searchables[g]){var i,j=a.isNumeric(b.header.fields[g])?parseInt(b.header.fields[g],10):b.header.fields[g],k=b.columns[e(b.columns,j)];if("string"==typeof j){i=d;for(var l=j.split("."),m=0;m<l.length;m++)i=i[l[m]];k&&k.searchFormatter&&(i=h(k,b.header.formatters[g],[i,d,f],i))}else i=d[j];if("string"==typeof i||"number"==typeof i)if(b.options.strictSearch){if((i+"").toLowerCase()===c)return!0}else if(-1!==(i+"").toLowerCase().indexOf(c))return!0}return!1}):this.data}},p.prototype.initPagination=function(){if(!this.options.pagination)return void this.$pagination.hide();this.$pagination.show();var b,d,e,f,g,h,i,j,k,l=this,m=[],n=!1,o=this.getData(),p=this.options.pageList;if("server"!==this.options.sidePagination&&(this.options.totalRows=o.length),this.totalPages=0,this.options.totalRows){if(this.options.pageSize===this.options.formatAllRows())this.options.pageSize=this.options.totalRows,n=!0;else if(this.options.pageSize===this.options.totalRows){var q="string"==typeof this.options.pageList?this.options.pageList.replace("[","").replace("]","").replace(/ /g,"").toLowerCase().split(","):this.options.pageList;a.inArray(this.options.formatAllRows().toLowerCase(),q)>-1&&(n=!0)}this.totalPages=~~((this.options.totalRows-1)/this.options.pageSize)+1,this.options.totalPages=this.totalPages}if(this.totalPages>0&&this.options.pageNumber>this.totalPages&&(this.options.pageNumber=this.totalPages),this.pageFrom=(this.options.pageNumber-1)*this.options.pageSize+1,this.pageTo=this.options.pageNumber*this.options.pageSize,this.pageTo>this.options.totalRows&&(this.pageTo=this.options.totalRows),m.push('<div class="pull-'+this.options.paginationDetailHAlign+' pagination-detail">','<span class="pagination-info">',this.options.onlyInfoPagination?this.options.formatDetailPagination(this.options.totalRows):this.options.formatShowingRows(this.pageFrom,this.pageTo,this.options.totalRows),"</span>"),!this.options.onlyInfoPagination){m.push('<span class="page-list">');var r=[c('<span class="btn-group %s">',"top"===this.options.paginationVAlign||"both"===this.options.paginationVAlign?"dropdown":"dropup"),'<button type="button" class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+' dropdown-toggle" data-toggle="dropdown">','<span class="page-size">',n?this.options.formatAllRows():this.options.pageSize,"</span>",' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">'];if("string"==typeof this.options.pageList){var s=this.options.pageList.replace("[","").replace("]","").replace(/ /g,"").split(",");p=[],a.each(s,function(a,b){p.push(b.toUpperCase()===l.options.formatAllRows().toUpperCase()?l.options.formatAllRows():+b)})}for(a.each(p,function(a,b){if(!l.options.smartDisplay||0===a||p[a-1]<=l.options.totalRows){var d;d=n?b===l.options.formatAllRows()?' class="active"':"":b===l.options.pageSize?' class="active"':"",r.push(c('<li%s><a href="javascript:void(0)">%s</a></li>',d,b))}}),r.push("</ul></span>"),m.push(this.options.formatRecordsPerPage(r.join(""))),m.push("</span>"),m.push("</div>",'<div class="pull-'+this.options.paginationHAlign+' pagination">','<ul class="pagination'+c(" pagination-%s",this.options.iconSize)+'">','<li class="page-pre"><a href="javascript:void(0)">'+this.options.paginationPreText+"</a></li>"),this.totalPages<5?(d=1,e=this.totalPages):(d=this.options.pageNumber-2,e=d+4,1>d&&(d=1,e=5),e>this.totalPages&&(e=this.totalPages,d=e-4)),this.totalPages>=6&&(this.options.pageNumber>=3&&(m.push('<li class="page-first'+(1===this.options.pageNumber?" active":"")+'">','<a href="javascript:void(0)">',1,"</a>","</li>"),d++),this.options.pageNumber>=4&&(4==this.options.pageNumber||6==this.totalPages||7==this.totalPages?d--:m.push('<li class="page-first-separator disabled">','<a href="javascript:void(0)">...</a>',"</li>"),e--)),this.totalPages>=7&&this.options.pageNumber>=this.totalPages-2&&d--,6==this.totalPages?this.options.pageNumber>=this.totalPages-2&&e++:this.totalPages>=7&&(7==this.totalPages||this.options.pageNumber>=this.totalPages-3)&&e++,b=d;e>=b;b++)m.push('<li class="page-number'+(b===this.options.pageNumber?" active":"")+'">','<a href="javascript:void(0)">',b,"</a>","</li>");this.totalPages>=8&&this.options.pageNumber<=this.totalPages-4&&m.push('<li class="page-last-separator disabled">','<a href="javascript:void(0)">...</a>',"</li>"),this.totalPages>=6&&this.options.pageNumber<=this.totalPages-3&&m.push('<li class="page-last'+(this.totalPages===this.options.pageNumber?" active":"")+'">','<a href="javascript:void(0)">',this.totalPages,"</a>","</li>"),m.push('<li class="page-next"><a href="javascript:void(0)">'+this.options.paginationNextText+"</a></li>","</ul>","</div>")}this.$pagination.html(m.join("")),this.options.onlyInfoPagination||(f=this.$pagination.find(".page-list a"),g=this.$pagination.find(".page-first"),h=this.$pagination.find(".page-pre"),i=this.$pagination.find(".page-next"),j=this.$pagination.find(".page-last"),k=this.$pagination.find(".page-number"),this.options.smartDisplay&&(this.totalPages<=1&&this.$pagination.find("div.pagination").hide(),(p.length<2||this.options.totalRows<=p[0])&&this.$pagination.find("span.page-list").hide(),this.$pagination[this.getData().length?"show":"hide"]()),n&&(this.options.pageSize=this.options.formatAllRows()),f.off("click").on("click",a.proxy(this.onPageListChange,this)),g.off("click").on("click",a.proxy(this.onPageFirst,this)),h.off("click").on("click",a.proxy(this.onPagePre,this)),i.off("click").on("click",a.proxy(this.onPageNext,this)),j.off("click").on("click",a.proxy(this.onPageLast,this)),k.off("click").on("click",a.proxy(this.onPageNumber,this)))},p.prototype.updatePagination=function(b){b&&a(b.currentTarget).hasClass("disabled")||(this.options.maintainSelected||this.resetRows(),this.initPagination(),"server"===this.options.sidePagination?this.initServer():this.initBody(),this.trigger("page-change",this.options.pageNumber,this.options.pageSize))},p.prototype.onPageListChange=function(b){var c=a(b.currentTarget);c.parent().addClass("active").siblings().removeClass("active"),this.options.pageSize=c.text().toUpperCase()===this.options.formatAllRows().toUpperCase()?this.options.formatAllRows():+c.text(),this.$toolbar.find(".page-size").text(this.options.pageSize),this.updatePagination(b)},p.prototype.onPageFirst=function(a){this.options.pageNumber=1,this.updatePagination(a)},p.prototype.onPagePre=function(a){this.options.pageNumber-1===0?this.options.pageNumber=this.options.totalPages:this.options.pageNumber--,this.updatePagination(a)},p.prototype.onPageNext=function(a){this.options.pageNumber+1>this.options.totalPages?this.options.pageNumber=1:this.options.pageNumber++,this.updatePagination(a)},p.prototype.onPageLast=function(a){this.options.pageNumber=this.totalPages,this.updatePagination(a)},p.prototype.onPageNumber=function(b){this.options.pageNumber!==+a(b.currentTarget).text()&&(this.options.pageNumber=+a(b.currentTarget).text(),this.updatePagination(b))},p.prototype.initBody=function(b){var f=this,g=[],i=this.getData();this.trigger("pre-body",i),this.$body=this.$el.find(">tbody"),this.$body.length||(this.$body=a("<tbody></tbody>").appendTo(this.$el)),this.options.pagination&&"server"!==this.options.sidePagination||(this.pageFrom=1,this.pageTo=i.length);for(var k=this.pageFrom-1;k<this.pageTo;k++){var l,n=i[k],o={},p=[],q="",r={},s=[];if(o=h(this.options,this.options.rowStyle,[n,k],o),o&&o.css)for(l in o.css)p.push(l+": "+o.css[l]);if(r=h(this.options,this.options.rowAttributes,[n,k],r))for(l in r)s.push(c('%s="%s"',l,j(r[l])));n._data&&!a.isEmptyObject(n._data)&&a.each(n._data,function(a,b){"index"!==a&&(q+=c(' data-%s="%s"',a,b))}),g.push("<tr",c(" %s",s.join(" ")),c(' id="%s"',a.isArray(n)?void 0:n._id),c(' class="%s"',o.classes||(a.isArray(n)?void 0:n._class)),c(' data-index="%s"',k),c(' data-uniqueid="%s"',n[this.options.uniqueId]),c("%s",q),">"),this.options.cardView&&g.push(c('<td colspan="%s"><div class="card-views">',this.header.fields.length)),!this.options.cardView&&this.options.detailView&&g.push("<td>",'<a class="detail-icon" href="javascript:">',c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.detailOpen),"</a>","</td>"),a.each(this.header.fields,function(b,e){var i="",j=m(n,e,f.options.escape),l="",q={},r="",s=f.header.classes[b],t="",u="",v="",w="",x=f.columns[b];if(!(f.fromHtml&&"undefined"==typeof j||!x.visible||f.options.cardView&&!x.cardVisible)){if(o=c('style="%s"',p.concat(f.header.styles[b]).join("; ")),n["_"+e+"_id"]&&(r=c(' id="%s"',n["_"+e+"_id"])),n["_"+e+"_class"]&&(s=c(' class="%s"',n["_"+e+"_class"])),n["_"+e+"_rowspan"]&&(u=c(' rowspan="%s"',n["_"+e+"_rowspan"])),n["_"+e+"_colspan"]&&(v=c(' colspan="%s"',n["_"+e+"_colspan"])),n["_"+e+"_title"]&&(w=c(' title="%s"',n["_"+e+"_title"])),q=h(f.header,f.header.cellStyles[b],[j,n,k,e],q),q.classes&&(s=c(' class="%s"',q.classes)),q.css){var y=[];for(var z in q.css)y.push(z+": "+q.css[z]);o=c('style="%s"',y.concat(f.header.styles[b]).join("; "))}j=h(x,f.header.formatters[b],[j,n,k],j),n["_"+e+"_data"]&&!a.isEmptyObject(n["_"+e+"_data"])&&a.each(n["_"+e+"_data"],function(a,b){"index"!==a&&(t+=c(' data-%s="%s"',a,b))}),x.checkbox||x.radio?(l=x.checkbox?"checkbox":l,l=x.radio?"radio":l,i=[c(f.options.cardView?'<div class="card-view %s">':'<td class="bs-checkbox %s">',x["class"]||""),"<input"+c(' data-index="%s"',k)+c(' name="%s"',f.options.selectItemName)+c(' type="%s"',l)+c(' value="%s"',n[f.options.idField])+c(' checked="%s"',j===!0||j&&j.checked?"checked":void 0)+c(' disabled="%s"',!x.checkboxEnabled||j&&j.disabled?"disabled":void 0)+" />",f.header.formatters[b]&&"string"==typeof j?j:"",f.options.cardView?"</div>":"</td>"].join(""),n[f.header.stateField]=j===!0||j&&j.checked):(j="undefined"==typeof j||null===j?f.options.undefinedText:j,i=f.options.cardView?['<div class="card-view">',f.options.showHeader?c('<span class="title" %s>%s</span>',o,d(f.columns,"field","title",e)):"",c('<span class="value">%s</span>',j),"</div>"].join(""):[c("<td%s %s %s %s %s %s %s>",r,s,o,t,u,v,w),j,"</td>"].join(""),f.options.cardView&&f.options.smartDisplay&&""===j&&(i='<div class="card-view"></div>')),g.push(i)}}),this.options.cardView&&g.push("</div></td>"),g.push("</tr>")}g.length||g.push('<tr class="no-records-found">',c('<td colspan="%s">%s</td>',this.$header.find("th").length,this.options.formatNoMatches()),"</tr>"),this.$body.html(g.join("")),b||this.scrollTo(0),this.$body.find("> tr[data-index] > td").off("click dblclick").on("click dblclick",function(b){var d=a(this),g=d.parent(),h=f.data[g.data("index")],i=d[0].cellIndex,j=f.getVisibleFields(),k=j[f.options.detailView&&!f.options.cardView?i-1:i],l=f.columns[e(f.columns,k)],n=m(h,k,f.options.escape);if(!d.find(".detail-icon").length&&(f.trigger("click"===b.type?"click-cell":"dbl-click-cell",k,n,h,d),f.trigger("click"===b.type?"click-row":"dbl-click-row",h,g,k),
  5689. "click"===b.type&&f.options.clickToSelect&&l.clickToSelect)){var o=g.find(c('[name="%s"]',f.options.selectItemName));o.length&&o[0].click()}}),this.$body.find("> tr[data-index] > td > .detail-icon").off("click").on("click",function(){var b=a(this),d=b.parent().parent(),e=d.data("index"),g=i[e];if(d.next().is("tr.detail-view"))b.find("i").attr("class",c("%s %s",f.options.iconsPrefix,f.options.icons.detailOpen)),d.next().remove(),f.trigger("collapse-row",e,g);else{b.find("i").attr("class",c("%s %s",f.options.iconsPrefix,f.options.icons.detailClose)),d.after(c('<tr class="detail-view"><td colspan="%s"></td></tr>',d.find("td").length));var j=d.next().find("td"),k=h(f.options,f.options.detailFormatter,[e,g,j],"");1===j.length&&j.append(k),f.trigger("expand-row",e,g,j)}f.resetView()}),this.$selectItem=this.$body.find(c('[name="%s"]',this.options.selectItemName)),this.$selectItem.off("click").on("click",function(b){b.stopImmediatePropagation();var c=a(this),d=c.prop("checked"),e=f.data[c.data("index")];f.options.maintainSelected&&a(this).is(":radio")&&a.each(f.options.data,function(a,b){b[f.header.stateField]=!1}),e[f.header.stateField]=d,f.options.singleSelect&&(f.$selectItem.not(this).each(function(){f.data[a(this).data("index")][f.header.stateField]=!1}),f.$selectItem.filter(":checked").not(this).prop("checked",!1)),f.updateSelected(),f.trigger(d?"check":"uncheck",e,c)}),a.each(this.header.events,function(b,c){if(c){"string"==typeof c&&(c=h(null,c));var d=f.header.fields[b],e=a.inArray(d,f.getVisibleFields());f.options.detailView&&!f.options.cardView&&(e+=1);for(var g in c)f.$body.find(">tr:not(.no-records-found)").each(function(){var b=a(this),h=b.find(f.options.cardView?".card-view":"td").eq(e),i=g.indexOf(" "),j=g.substring(0,i),k=g.substring(i+1),l=c[g];h.find(k).off(j).on(j,function(a){var c=b.data("index"),e=f.data[c],g=e[d];l.apply(this,[a,g,e,c])})})}}),this.updateSelected(),this.resetView(),this.trigger("post-body",i)},p.prototype.initServer=function(b,c,d){var e,f=this,g={},i={searchText:this.searchText,sortName:this.options.sortName,sortOrder:this.options.sortOrder};this.options.pagination&&(i.pageSize=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize,i.pageNumber=this.options.pageNumber),(d||this.options.url||this.options.ajax)&&("limit"===this.options.queryParamsType&&(i={search:i.searchText,sort:i.sortName,order:i.sortOrder},this.options.pagination&&(i.offset=this.options.pageSize===this.options.formatAllRows()?0:this.options.pageSize*(this.options.pageNumber-1),i.limit=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize)),a.isEmptyObject(this.filterColumnsPartial)||(i.filter=JSON.stringify(this.filterColumnsPartial,null)),g=h(this.options,this.options.queryParams,[i],g),a.extend(g,c||{}),g!==!1&&(b||this.$tableLoading.show(),e=a.extend({},h(null,this.options.ajaxOptions),{type:this.options.method,url:d||this.options.url,data:"application/json"===this.options.contentType&&"post"===this.options.method?JSON.stringify(g):g,cache:this.options.cache,contentType:this.options.contentType,dataType:this.options.dataType,success:function(a){a=h(f.options,f.options.responseHandler,[a],a),f.load(a),f.trigger("load-success",a),b||f.$tableLoading.hide()},error:function(a){f.trigger("load-error",a.status,a),b||f.$tableLoading.hide()}}),this.options.ajax?h(this,this.options.ajax,[e],null):(this._xhr&&4!==this._xhr.readyState&&this._xhr.abort(),this._xhr=a.ajax(e))))},p.prototype.initSearchText=function(){if(this.options.search&&""!==this.options.searchText){var a=this.$toolbar.find(".search input");a.val(this.options.searchText),this.onSearch({currentTarget:a})}},p.prototype.getCaret=function(){var b=this;a.each(this.$header.find("th"),function(c,d){a(d).find(".sortable").removeClass("desc asc").addClass(a(d).data("field")===b.options.sortName?b.options.sortOrder:"both")})},p.prototype.updateSelected=function(){var b=this.$selectItem.filter(":enabled").length&&this.$selectItem.filter(":enabled").length===this.$selectItem.filter(":enabled").filter(":checked").length;this.$selectAll.add(this.$selectAll_).prop("checked",b),this.$selectItem.each(function(){a(this).closest("tr")[a(this).prop("checked")?"addClass":"removeClass"]("selected")})},p.prototype.updateRows=function(){var b=this;this.$selectItem.each(function(){b.data[a(this).data("index")][b.header.stateField]=a(this).prop("checked")})},p.prototype.resetRows=function(){var b=this;a.each(this.data,function(a,c){b.$selectAll.prop("checked",!1),b.$selectItem.prop("checked",!1),b.header.stateField&&(c[b.header.stateField]=!1)})},p.prototype.trigger=function(b){var c=Array.prototype.slice.call(arguments,1);b+=".bs.table",this.options[p.EVENTS[b]].apply(this.options,c),this.$el.trigger(a.Event(b),c),this.options.onAll(b,c),this.$el.trigger(a.Event("all.bs.table"),[b,c])},p.prototype.resetHeader=function(){clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(a.proxy(this.fitHeader,this),this.$el.is(":hidden")?100:0)},p.prototype.fitHeader=function(){var b,d,e,f,h=this;if(h.$el.is(":hidden"))return void(h.timeoutId_=setTimeout(a.proxy(h.fitHeader,h),100));if(b=this.$tableBody.get(0),d=b.scrollWidth>b.clientWidth&&b.scrollHeight>b.clientHeight+this.$header.outerHeight()?g():0,this.$el.css("margin-top",-this.$header.outerHeight()),e=a(":focus"),e.length>0){var i=e.parents("th");if(i.length>0){var j=i.attr("data-field");if(void 0!==j){var k=this.$header.find("[data-field='"+j+"']");k.length>0&&k.find(":input").addClass("focus-temp")}}}this.$header_=this.$header.clone(!0,!0),this.$selectAll_=this.$header_.find('[name="btSelectAll"]'),this.$tableHeader.css({"margin-right":d}).find("table").css("width",this.$el.outerWidth()).html("").attr("class",this.$el.attr("class")).append(this.$header_),f=a(".focus-temp:visible:eq(0)"),f.length>0&&(f.focus(),this.$header.find(".focus-temp").removeClass("focus-temp")),this.$header.find("th[data-field]").each(function(){h.$header_.find(c('th[data-field="%s"]',a(this).data("field"))).data(a(this).data())});var l=this.getVisibleFields(),m=this.$header_.find("th");this.$body.find(">tr:first-child:not(.no-records-found) > *").each(function(b){var d=a(this),e=b;h.options.detailView&&!h.options.cardView&&(0===b&&h.$header_.find("th.detail").find(".fht-cell").width(d.innerWidth()),e=b-1);var f=h.$header_.find(c('th[data-field="%s"]',l[e]));f.length>1&&(f=a(m[d[0].cellIndex])),f.find(".fht-cell").width(d.innerWidth())}),this.$tableBody.off("scroll").on("scroll",function(){h.$tableHeader.scrollLeft(a(this).scrollLeft()),h.options.showFooter&&!h.options.cardView&&h.$tableFooter.scrollLeft(a(this).scrollLeft())}),h.trigger("post-header")},p.prototype.resetFooter=function(){var b=this,d=b.getData(),e=[];this.options.showFooter&&!this.options.cardView&&(!this.options.cardView&&this.options.detailView&&e.push('<td><div class="th-inner">&nbsp;</div><div class="fht-cell"></div></td>'),a.each(this.columns,function(a,f){var g,i="",j="",k=[],l={},m=c(' class="%s"',f["class"]);if(f.visible&&(!b.options.cardView||f.cardVisible)){if(i=c("text-align: %s; ",f.falign?f.falign:f.align),j=c("vertical-align: %s; ",f.valign),l=h(null,b.options.footerStyle),l&&l.css)for(g in l.css)k.push(g+": "+l.css[g]);e.push("<td",m,c(' style="%s"',i+j+k.concat().join("; ")),">"),e.push('<div class="th-inner">'),e.push(h(f,f.footerFormatter,[d],"&nbsp;")||"&nbsp;"),e.push("</div>"),e.push('<div class="fht-cell"></div>'),e.push("</div>"),e.push("</td>")}}),this.$tableFooter.find("tr").html(e.join("")),this.$tableFooter.show(),clearTimeout(this.timeoutFooter_),this.timeoutFooter_=setTimeout(a.proxy(this.fitFooter,this),this.$el.is(":hidden")?100:0))},p.prototype.fitFooter=function(){var b,c,d;return clearTimeout(this.timeoutFooter_),this.$el.is(":hidden")?void(this.timeoutFooter_=setTimeout(a.proxy(this.fitFooter,this),100)):(c=this.$el.css("width"),d=c>this.$tableBody.width()?g():0,this.$tableFooter.css({"margin-right":d}).find("table").css("width",c).attr("class",this.$el.attr("class")),b=this.$tableFooter.find("td"),void this.$body.find(">tr:first-child:not(.no-records-found) > *").each(function(c){var d=a(this);b.eq(c).find(".fht-cell").width(d.innerWidth())}))},p.prototype.toggleColumn=function(a,b,d){if(-1!==a&&(this.columns[a].visible=b,this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns)){var e=this.$toolbar.find(".keep-open input").prop("disabled",!1);d&&e.filter(c('[value="%s"]',a)).prop("checked",b),e.filter(":checked").length<=this.options.minimumCountColumns&&e.filter(":checked").prop("disabled",!0)}},p.prototype.toggleRow=function(a,b,d){-1!==a&&this.$body.find("undefined"!=typeof a?c('tr[data-index="%s"]',a):c('tr[data-uniqueid="%s"]',b))[d?"show":"hide"]()},p.prototype.getVisibleFields=function(){var b=this,c=[];return a.each(this.header.fields,function(a,d){var f=b.columns[e(b.columns,d)];f.visible&&c.push(d)}),c},p.prototype.resetView=function(a){var b=0;if(a&&a.height&&(this.options.height=a.height),this.$selectAll.prop("checked",this.$selectItem.length>0&&this.$selectItem.length===this.$selectItem.filter(":checked").length),this.options.height){var c=k(this.$toolbar),d=k(this.$pagination),e=this.options.height-c-d;this.$tableContainer.css("height",e+"px")}return this.options.cardView?(this.$el.css("margin-top","0"),this.$tableContainer.css("padding-bottom","0"),void this.$tableFooter.hide()):(this.options.showHeader&&this.options.height?(this.$tableHeader.show(),this.resetHeader(),b+=this.$header.outerHeight()):(this.$tableHeader.hide(),this.trigger("post-header")),this.options.showFooter&&(this.resetFooter(),this.options.height&&(b+=this.$tableFooter.outerHeight()+1)),this.getCaret(),this.$tableContainer.css("padding-bottom",b+"px"),void this.trigger("reset-view"))},p.prototype.getData=function(b){return!this.searchText&&a.isEmptyObject(this.filterColumns)&&a.isEmptyObject(this.filterColumnsPartial)?b?this.options.data.slice(this.pageFrom-1,this.pageTo):this.options.data:b?this.data.slice(this.pageFrom-1,this.pageTo):this.data},p.prototype.load=function(b){var c=!1;"server"===this.options.sidePagination?(this.options.totalRows=b.total,c=b.fixedScroll,b=b[this.options.dataField]):a.isArray(b)||(c=b.fixedScroll,b=b.data),this.initData(b),this.initSearch(),this.initPagination(),this.initBody(c)},p.prototype.append=function(a){this.initData(a,"append"),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0)},p.prototype.prepend=function(a){this.initData(a,"prepend"),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0)},p.prototype.remove=function(b){var c,d,e=this.options.data.length;if(b.hasOwnProperty("field")&&b.hasOwnProperty("values")){for(c=e-1;c>=0;c--)d=this.options.data[c],d.hasOwnProperty(b.field)&&-1!==a.inArray(d[b.field],b.values)&&this.options.data.splice(c,1);e!==this.options.data.length&&(this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))}},p.prototype.removeAll=function(){this.options.data.length>0&&(this.options.data.splice(0,this.options.data.length),this.initSearch(),this.initPagination(),this.initBody(!0))},p.prototype.getRowByUniqueId=function(a){var b,c,d,e=this.options.uniqueId,f=this.options.data.length,g=null;for(b=f-1;b>=0;b--){if(c=this.options.data[b],c.hasOwnProperty(e))d=c[e];else{if(!c._data.hasOwnProperty(e))continue;d=c._data[e]}if("string"==typeof d?a=a.toString():"number"==typeof d&&(Number(d)===d&&d%1===0?a=parseInt(a):d===Number(d)&&0!==d&&(a=parseFloat(a))),d===a){g=c;break}}return g},p.prototype.removeByUniqueId=function(a){var b=this.options.data.length,c=this.getRowByUniqueId(a);c&&this.options.data.splice(this.options.data.indexOf(c),1),b!==this.options.data.length&&(this.initSearch(),this.initPagination(),this.initBody(!0))},p.prototype.updateByUniqueId=function(b){var c=this,d=a.isArray(b)?b:[b];a.each(d,function(b,d){var e;d.hasOwnProperty("id")&&d.hasOwnProperty("row")&&(e=a.inArray(c.getRowByUniqueId(d.id),c.options.data),-1!==e&&a.extend(c.options.data[e],d.row))}),this.initSearch(),this.initSort(),this.initBody(!0)},p.prototype.insertRow=function(a){a.hasOwnProperty("index")&&a.hasOwnProperty("row")&&(this.data.splice(a.index,0,a.row),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))},p.prototype.updateRow=function(b){var c=this,d=a.isArray(b)?b:[b];a.each(d,function(b,d){d.hasOwnProperty("index")&&d.hasOwnProperty("row")&&a.extend(c.options.data[d.index],d.row)}),this.initSearch(),this.initSort(),this.initBody(!0)},p.prototype.showRow=function(a){(a.hasOwnProperty("index")||a.hasOwnProperty("uniqueId"))&&this.toggleRow(a.index,a.uniqueId,!0)},p.prototype.hideRow=function(a){(a.hasOwnProperty("index")||a.hasOwnProperty("uniqueId"))&&this.toggleRow(a.index,a.uniqueId,!1)},p.prototype.getRowsHidden=function(b){var c=a(this.$body[0]).children().filter(":hidden"),d=0;if(b)for(;d<c.length;d++)a(c[d]).show();return c},p.prototype.mergeCells=function(b){var c,d,e,f=b.index,g=a.inArray(b.field,this.getVisibleFields()),h=b.rowspan||1,i=b.colspan||1,j=this.$body.find(">tr");if(this.options.detailView&&!this.options.cardView&&(g+=1),e=j.eq(f).find(">td").eq(g),!(0>f||0>g||f>=this.data.length)){for(c=f;f+h>c;c++)for(d=g;g+i>d;d++)j.eq(c).find(">td").eq(d).hide();e.attr("rowspan",h).attr("colspan",i).show()}},p.prototype.updateCell=function(a){a.hasOwnProperty("index")&&a.hasOwnProperty("field")&&a.hasOwnProperty("value")&&(this.data[a.index][a.field]=a.value,a.reinit!==!1&&(this.initSort(),this.initBody(!0)))},p.prototype.getOptions=function(){return this.options},p.prototype.getSelections=function(){var b=this;return a.grep(this.options.data,function(a){return a[b.header.stateField]})},p.prototype.getAllSelections=function(){var b=this;return a.grep(this.options.data,function(a){return a[b.header.stateField]})},p.prototype.checkAll=function(){this.checkAll_(!0)},p.prototype.uncheckAll=function(){this.checkAll_(!1)},p.prototype.checkInvert=function(){var b=this,c=b.$selectItem.filter(":enabled"),d=c.filter(":checked");c.each(function(){a(this).prop("checked",!a(this).prop("checked"))}),b.updateRows(),b.updateSelected(),b.trigger("uncheck-some",d),d=b.getSelections(),b.trigger("check-some",d)},p.prototype.checkAll_=function(a){var b;a||(b=this.getSelections()),this.$selectAll.add(this.$selectAll_).prop("checked",a),this.$selectItem.filter(":enabled").prop("checked",a),this.updateRows(),a&&(b=this.getSelections()),this.trigger(a?"check-all":"uncheck-all",b)},p.prototype.check=function(a){this.check_(!0,a)},p.prototype.uncheck=function(a){this.check_(!1,a)},p.prototype.check_=function(a,b){var d=this.$selectItem.filter(c('[data-index="%s"]',b)).prop("checked",a);this.data[b][this.header.stateField]=a,this.updateSelected(),this.trigger(a?"check":"uncheck",this.data[b],d)},p.prototype.checkBy=function(a){this.checkBy_(!0,a)},p.prototype.uncheckBy=function(a){this.checkBy_(!1,a)},p.prototype.checkBy_=function(b,d){if(d.hasOwnProperty("field")&&d.hasOwnProperty("values")){var e=this,f=[];a.each(this.options.data,function(g,h){if(!h.hasOwnProperty(d.field))return!1;if(-1!==a.inArray(h[d.field],d.values)){var i=e.$selectItem.filter(":enabled").filter(c('[data-index="%s"]',g)).prop("checked",b);h[e.header.stateField]=b,f.push(h),e.trigger(b?"check":"uncheck",h,i)}}),this.updateSelected(),this.trigger(b?"check-some":"uncheck-some",f)}},p.prototype.destroy=function(){this.$el.insertBefore(this.$container),a(this.options.toolbar).insertBefore(this.$el),this.$container.next().remove(),this.$container.remove(),this.$el.html(this.$el_.html()).css("margin-top","0").attr("class",this.$el_.attr("class")||"")},p.prototype.showLoading=function(){this.$tableLoading.show()},p.prototype.hideLoading=function(){this.$tableLoading.hide()},p.prototype.togglePagination=function(){this.options.pagination=!this.options.pagination;var a=this.$toolbar.find('button[name="paginationSwitch"] i');this.options.pagination?a.attr("class",this.options.iconsPrefix+" "+this.options.icons.paginationSwitchDown):a.attr("class",this.options.iconsPrefix+" "+this.options.icons.paginationSwitchUp),this.updatePagination()},p.prototype.refresh=function(a){a&&a.url&&(this.options.pageNumber=1),this.initServer(a&&a.silent,a&&a.query,a&&a.url),this.trigger("refresh",a)},p.prototype.resetWidth=function(){this.options.showHeader&&this.options.height&&this.fitHeader(),this.options.showFooter&&this.fitFooter()},p.prototype.showColumn=function(a){this.toggleColumn(e(this.columns,a),!0,!0)},p.prototype.hideColumn=function(a){this.toggleColumn(e(this.columns,a),!1,!0)},p.prototype.getHiddenColumns=function(){return a.grep(this.columns,function(a){return!a.visible})},p.prototype.getVisibleColumns=function(){return a.grep(this.columns,function(a){return a.visible})},p.prototype.toggleAllColumns=function(b){if(a.each(this.columns,function(a){this.columns[a].visible=b}),this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns){var c=this.$toolbar.find(".keep-open input").prop("disabled",!1);c.filter(":checked").length<=this.options.minimumCountColumns&&c.filter(":checked").prop("disabled",!0)}},p.prototype.showAllColumns=function(){this.toggleAllColumns(!0)},p.prototype.hideAllColumns=function(){this.toggleAllColumns(!1)},p.prototype.filterBy=function(b){this.filterColumns=a.isEmptyObject(b)?{}:b,this.options.pageNumber=1,this.initSearch(),this.updatePagination()},p.prototype.scrollTo=function(a){return"string"==typeof a&&(a="bottom"===a?this.$tableBody[0].scrollHeight:0),"number"==typeof a&&this.$tableBody.scrollTop(a),"undefined"==typeof a?this.$tableBody.scrollTop():void 0},p.prototype.getScrollPosition=function(){return this.scrollTo()},p.prototype.selectPage=function(a){a>0&&a<=this.options.totalPages&&(this.options.pageNumber=a,this.updatePagination())},p.prototype.prevPage=function(){this.options.pageNumber>1&&(this.options.pageNumber--,this.updatePagination())},p.prototype.nextPage=function(){this.options.pageNumber<this.options.totalPages&&(this.options.pageNumber++,this.updatePagination())},p.prototype.toggleView=function(){this.options.cardView=!this.options.cardView,this.initHeader(),this.initBody(),this.trigger("toggle",this.options.cardView)},p.prototype.refreshOptions=function(b){i(this.options,b,!0)||(this.options=a.extend(this.options,b),this.trigger("refresh-options",this.options),this.destroy(),this.init())},p.prototype.resetSearch=function(a){var b=this.$toolbar.find(".search input");b.val(a||""),this.onSearch({currentTarget:b})},p.prototype.expandRow_=function(a,b){var d=this.$body.find(c('> tr[data-index="%s"]',b));d.next().is("tr.detail-view")===(a?!1:!0)&&d.find("> td > .detail-icon").click()},p.prototype.expandRow=function(a){this.expandRow_(!0,a)},p.prototype.collapseRow=function(a){this.expandRow_(!1,a)},p.prototype.expandAllRows=function(b){if(b){var d=this.$body.find(c('> tr[data-index="%s"]',0)),e=this,f=null,g=!1,h=-1;if(d.next().is("tr.detail-view")?d.next().next().is("tr.detail-view")||(d.next().find(".detail-icon").click(),g=!0):(d.find("> td > .detail-icon").click(),g=!0),g)try{h=setInterval(function(){f=e.$body.find("tr.detail-view").last().find(".detail-icon"),f.length>0?f.click():clearInterval(h)},1)}catch(i){clearInterval(h)}}else for(var j=this.$body.children(),k=0;k<j.length;k++)this.expandRow_(!0,a(j[k]).data("index"))},p.prototype.collapseAllRows=function(b){if(b)this.expandRow_(!1,0);else for(var c=this.$body.children(),d=0;d<c.length;d++)this.expandRow_(!1,a(c[d]).data("index"))},p.prototype.updateFormatText=function(a,b){this.options[c("format%s",a)]&&("string"==typeof b?this.options[c("format%s",a)]=function(){return b}:"function"==typeof b&&(this.options[c("format%s",a)]=b)),this.initToolbar(),this.initPagination(),this.initBody()};var q=["getOptions","getSelections","getAllSelections","getData","load","append","prepend","remove","removeAll","insertRow","updateRow","updateCell","updateByUniqueId","removeByUniqueId","getRowByUniqueId","showRow","hideRow","getRowsHidden","mergeCells","checkAll","uncheckAll","checkInvert","check","uncheck","checkBy","uncheckBy","refresh","resetView","resetWidth","destroy","showLoading","hideLoading","showColumn","hideColumn","getHiddenColumns","getVisibleColumns","showAllColumns","hideAllColumns","filterBy","scrollTo","getScrollPosition","selectPage","prevPage","nextPage","togglePagination","toggleView","refreshOptions","resetSearch","expandRow","collapseRow","expandAllRows","collapseAllRows","updateFormatText"];a.fn.bootstrapTable=function(b){var c,d=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=a(this),f=e.data("bootstrap.table"),g=a.extend({},p.DEFAULTS,e.data(),"object"==typeof b&&b);if("string"==typeof b){if(a.inArray(b,q)<0)throw new Error("Unknown method: "+b);if(!f)return;c=f[b].apply(f,d),"destroy"===b&&e.removeData("bootstrap.table")}f||e.data("bootstrap.table",f=new p(this,g))}),"undefined"==typeof c?this:c},a.fn.bootstrapTable.Constructor=p,a.fn.bootstrapTable.defaults=p.DEFAULTS,a.fn.bootstrapTable.columnDefaults=p.COLUMN_DEFAULTS,a.fn.bootstrapTable.locales=p.LOCALES,a.fn.bootstrapTable.methods=q,a.fn.bootstrapTable.utils={sprintf:c,getFieldIndex:e,compareObjects:i,calculateObjectValue:h,getItemField:m,objectKeys:o,isIEBrowser:n},a(function(){a('[data-toggle="table"]').bootstrapTable()})}(jQuery);
  5690. define("bootstrap-table", ["bootstrap","css!../libs/bootstrap-table/dist/bootstrap-table.min.css"], (function (global) {
  5691. return function () {
  5692. var ret, fn;
  5693. return ret || global.$.fn.bootstrapTable;
  5694. };
  5695. }(this)));
  5696. /**
  5697. * Bootstrap Table Chinese translation
  5698. * Author: Zhixin Wen<wenzhixin2010@gmail.com>
  5699. */
  5700. (function ($) {
  5701. 'use strict';
  5702. $.fn.bootstrapTable.locales['zh-CN'] = {
  5703. formatLoadingMessage: function () {
  5704. return '正在努力地加载数据中,请稍候……';
  5705. },
  5706. formatRecordsPerPage: function (pageNumber) {
  5707. return '每页显示 ' + pageNumber + ' 条记录';
  5708. },
  5709. formatShowingRows: function (pageFrom, pageTo, totalRows) {
  5710. return '显示第 ' + pageFrom + ' 到第 ' + pageTo + ' 条记录,总共 ' + totalRows + ' 条记录';
  5711. },
  5712. formatSearch: function () {
  5713. return '搜索';
  5714. },
  5715. formatNoMatches: function () {
  5716. return '没有找到匹配的记录';
  5717. },
  5718. formatPaginationSwitch: function () {
  5719. return '隐藏/显示分页';
  5720. },
  5721. formatRefresh: function () {
  5722. return '刷新';
  5723. },
  5724. formatToggle: function () {
  5725. return '切换';
  5726. },
  5727. formatColumns: function () {
  5728. return '列';
  5729. },
  5730. formatExport: function () {
  5731. return '导出数据';
  5732. },
  5733. formatClearFilters: function () {
  5734. return '清空过滤';
  5735. }
  5736. };
  5737. $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']);
  5738. })(jQuery);
  5739. define("bootstrap-table-lang", ["bootstrap-table"], (function (global) {
  5740. return function () {
  5741. var ret, fn;
  5742. return ret || global.$.fn.bootstrapTable.defaults;
  5743. };
  5744. }(this)));
  5745. /**
  5746. * @author: Dennis Hernández
  5747. * @webSite: http://djhvscf.github.io/Blog
  5748. * @version: v1.1.0
  5749. */
  5750. !function ($) {
  5751. 'use strict';
  5752. var showHideColumns = function (that, checked) {
  5753. if (that.options.columnsHidden.length > 0 ) {
  5754. $.each(that.columns, function (i, column) {
  5755. if (that.options.columnsHidden.indexOf(column.field) !== -1) {
  5756. if (column.visible !== checked) {
  5757. that.toggleColumn($.fn.bootstrapTable.utils.getFieldIndex(that.columns, column.field), checked, true);
  5758. }
  5759. }
  5760. });
  5761. }
  5762. };
  5763. var resetView = function (that) {
  5764. if (that.options.height || that.options.showFooter) {
  5765. setTimeout(function(){
  5766. that.resetView.call(that);
  5767. }, 1);
  5768. }
  5769. };
  5770. var changeView = function (that, width, height) {
  5771. if (that.options.minHeight) {
  5772. if ((width <= that.options.minWidth) && (height <= that.options.minHeight)) {
  5773. conditionCardView(that);
  5774. } else if ((width > that.options.minWidth) && (height > that.options.minHeight)) {
  5775. conditionFullView(that);
  5776. }
  5777. } else {
  5778. if (width <= that.options.minWidth) {
  5779. conditionCardView(that);
  5780. } else if (width > that.options.minWidth) {
  5781. conditionFullView(that);
  5782. }
  5783. }
  5784. resetView(that);
  5785. };
  5786. var conditionCardView = function (that) {
  5787. changeTableView(that, false);
  5788. showHideColumns(that, false);
  5789. };
  5790. var conditionFullView = function (that) {
  5791. changeTableView(that, true);
  5792. showHideColumns(that, true);
  5793. };
  5794. var changeTableView = function (that, cardViewState) {
  5795. that.options.cardView = cardViewState;
  5796. that.toggleView();
  5797. };
  5798. var debounce = function(func,wait) {
  5799. var timeout;
  5800. return function() {
  5801. var context = this,
  5802. args = arguments;
  5803. var later = function() {
  5804. timeout = null;
  5805. func.apply(context,args);
  5806. };
  5807. clearTimeout(timeout);
  5808. timeout = setTimeout(later, wait);
  5809. };
  5810. };
  5811. $.extend($.fn.bootstrapTable.defaults, {
  5812. mobileResponsive: false,
  5813. minWidth: 562,
  5814. minHeight: undefined,
  5815. heightThreshold: 100, // just slightly larger than mobile chrome's auto-hiding toolbar
  5816. checkOnInit: true,
  5817. columnsHidden: []
  5818. });
  5819. var BootstrapTable = $.fn.bootstrapTable.Constructor,
  5820. _init = BootstrapTable.prototype.init;
  5821. BootstrapTable.prototype.init = function () {
  5822. _init.apply(this, Array.prototype.slice.apply(arguments));
  5823. if (!this.options.mobileResponsive) {
  5824. return;
  5825. }
  5826. if (!this.options.minWidth) {
  5827. return;
  5828. }
  5829. if (this.options.minWidth < 100 && this.options.resizable) {
  5830. console.log("The minWidth when the resizable extension is active should be greater or equal than 100");
  5831. this.options.minWidth = 100;
  5832. }
  5833. var that = this,
  5834. old = {
  5835. width: $(window).width(),
  5836. height: $(window).height()
  5837. };
  5838. $(window).on('resize orientationchange',debounce(function (evt) {
  5839. // reset view if height has only changed by at least the threshold.
  5840. var height = $(this).height(),
  5841. width = $(this).width();
  5842. if (Math.abs(old.height - height) > that.options.heightThreshold || old.width != width) {
  5843. changeView(that, width, height);
  5844. old = {
  5845. width: width,
  5846. height: height
  5847. };
  5848. }
  5849. },200));
  5850. if (this.options.checkOnInit) {
  5851. var height = $(window).height(),
  5852. width = $(window).width();
  5853. changeView(this, width, height);
  5854. old = {
  5855. width: width,
  5856. height: height
  5857. };
  5858. }
  5859. };
  5860. }(jQuery);
  5861. define("bootstrap-table-mobile", ["bootstrap-table"], (function (global) {
  5862. return function () {
  5863. var ret, fn;
  5864. return ret || global.$.fn.bootstrapTable.defaults;
  5865. };
  5866. }(this)));
  5867. /*
  5868. tableExport.jquery.plugin
  5869. Copyright (c) 2015-2017 hhurz, https://github.com/hhurz/tableExport.jquery.plugin
  5870. Original work Copyright (c) 2014 Giri Raj, https://github.com/kayalshri/
  5871. Licensed under the MIT License, http://opensource.org/licenses/mit-license
  5872. */
  5873. (function(c){c.fn.extend({tableExport:function(u){function S(b){var a=[];c(b).find("thead").first().find("th").each(function(b,d){void 0!==c(d).attr("data-field")?a[b]=c(d).attr("data-field"):a[b]=b.toString()});return a}function z(b,h,e,d,w){if(-1==c.inArray(e,a.ignoreRow)&&-1==c.inArray(e-d,a.ignoreRow)){var q=c(b).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display")||"always"==c(this).closest("table").data("tableexport-display"))}).find(h),
  5874. l=0;q.each(function(b){if("always"==c(this).data("tableexport-display")||"none"!=c(this).css("display")&&"hidden"!=c(this).css("visibility")&&"none"!=c(this).data("tableexport-display")){var d=b,h=!1;0<a.ignoreColumn.length&&("string"==typeof a.ignoreColumn[0]?H.length>d&&"undefined"!=typeof H[d]&&-1!=c.inArray(H[d],a.ignoreColumn)&&(h=!0):"number"!=typeof a.ignoreColumn[0]||-1==c.inArray(d,a.ignoreColumn)&&-1==c.inArray(d-q.length,a.ignoreColumn)||(h=!0));if(!1===h&&"function"===typeof w){var h=
  5875. 0,r,f=0;if("undefined"!=typeof A[e]&&0<A[e].length)for(d=0;d<=b;d++)"undefined"!=typeof A[e][d]&&(w(null,e,d),delete A[e][d],b++);c(this).is("[colspan]")&&(h=parseInt(c(this).attr("colspan")),l+=0<h?h-1:0);c(this).is("[rowspan]")&&(f=parseInt(c(this).attr("rowspan")));w(this,e,b);for(d=0;d<h-1;d++)w(null,e,b+d);if(f)for(r=1;r<f;r++)for("undefined"==typeof A[e+r]&&(A[e+r]=[]),A[e+r][b+l]="",d=1;d<h;d++)A[e+r][b+l-d]=""}}});if("undefined"!=typeof A[e]&&0<A[e].length)for(b=0;b<=A[e].length;b++)"undefined"!=
  5876. typeof A[e][b]&&(w(null,e,b),delete A[e][b])}}function Z(b,h){!0===a.consoleLog&&console.log(b.output());if("string"===a.outputMode)return b.output();if("base64"===a.outputMode)return F(b.output());if("window"===a.outputMode)window.open(URL.createObjectURL(b.output("blob")));else try{var e=b.output("blob");saveAs(e,a.fileName+".pdf")}catch(d){C(a.fileName+".pdf","data:application/pdf"+(h?"":";base64")+",",h?e:b.output())}}function aa(b,a,e){var d=0;"undefined"!=typeof e&&(d=e.colspan);if(0<=d){for(var h=
  5877. b.width,c=b.textPos.x,l=a.table.columns.indexOf(a.column),r=1;r<d;r++)h+=a.table.columns[l+r].width;1<d&&("right"===b.styles.halign?c=b.textPos.x+h-b.width:"center"===b.styles.halign&&(c=b.textPos.x+(h-b.width)/2));b.width=h;b.textPos.x=c;"undefined"!=typeof e&&1<e.rowspan&&(b.height*=e.rowspan);if("middle"===b.styles.valign||"bottom"===b.styles.valign)e=("string"===typeof b.text?b.text.split(/\r\n|\r|\n/g):b.text).length||1,2<e&&(b.textPos.y-=(2-1.15)/2*a.row.styles.fontSize*(e-2)/3);return!0}return!1}
  5878. function ba(b,a,e){"undefined"!=typeof e.images&&a.each(function(){var a=c(this).children();if(c(this).is("img")){var h=ca(this.src);e.images[h]={url:this.src,src:this.src}}"undefined"!=typeof a&&0<a.length&&ba(b,a,e)})}function ka(b,a){function h(b){if(b.url){var d=new Image;c=++q;d.crossOrigin="Anonymous";d.onerror=d.onload=function(){if(d.complete&&(0===d.src.indexOf("data:image/")&&(d.width=b.width||d.width||0,d.height=b.height||d.height||0),d.width+d.height)){var h=document.createElement("canvas"),
  5879. e=h.getContext("2d");h.width=d.width;h.height=d.height;e.drawImage(d,0,0);b.src=h.toDataURL("image/jpeg")}--q||a(c)};d.src=b.url}}var d,c=0,q=0;if("undefined"!=typeof b.images)for(d in b.images)b.images.hasOwnProperty(d)&&h(b.images[d]);(d=q)||(a(c),d=void 0);return d}function da(b,h,e){h.each(function(){var d=c(this).children();if(c(this).is("div")){var h=N(E(this,"background-color"),[255,255,255]),q=N(E(this,"border-top-color"),[0,0,0]),l=O(this,"border-top-width",a.jspdf.unit),r=this.getBoundingClientRect(),
  5880. f=this.offsetLeft*e.dw,g=this.offsetTop*e.dh,k=r.width*e.dw,r=r.height*e.dh;e.doc.setDrawColor.apply(void 0,q);e.doc.setFillColor.apply(void 0,h);e.doc.setLineWidth(l);e.doc.rect(b.x+f,b.y+g,k,r,l?"FD":"F")}else if(c(this).is("img")&&"undefined"!=typeof e.images&&(g=ca(this.src),h=e.images[g],"undefined"!=typeof h)){q=b.width/b.height;l=this.width/this.height;f=b.width;k=b.height;g=0;l<q?(k=Math.min(b.height,this.height),f=this.width*k/this.height):l>q&&(f=Math.min(b.width,this.width),k=this.height*
  5881. f/this.width);k<b.height&&(g=(b.height-k)/2);try{e.doc.addImage(h.src,b.textPos.x,b.y+g,f,k)}catch(oa){}b.textPos.x+=f}"undefined"!=typeof d&&0<d.length&&da(b,d,e)})}function P(b,a,e){return b.replace(new RegExp(a.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),e)}function ea(b){b=P(b||"0",a.numbers.html.thousandsSeparator,"");b=P(b,a.numbers.html.decimalMark,".");return"number"===typeof b||!1!==jQuery.isNumeric(b)?b:!1}function x(b,h,e){var d="";if(null!==b){var w=c(b),q;if(w[0].hasAttribute("data-tableexport-value"))q=
  5882. w.data("tableexport-value");else if(q=w.html(),"function"===typeof a.onCellHtmlData)q=a.onCellHtmlData(w,h,e,q);else if(""!=q){b=c.parseHTML(q);var l=0,r=0;q="";c.each(b,function(){if(c(this).is("input"))q+=w.find("input").eq(l++).val();else if(c(this).is("select"))q+=w.find("select option:selected").eq(r++).text();else if("undefined"===typeof c(this).html())q+=c(this).text();else if(void 0===jQuery().bootstrapTable||!0!==c(this).hasClass("filterControl"))q+=c(this).html()})}if(!0===a.htmlContent)d=
  5883. c.trim(q);else if(""!=q){var f=q.replace(/\n/g,"\u2028").replace(/<br\s*[\/]?>/gi,"\u2060");b=c("<div/>").html(f).contents();f="";c.each(b.text().split("\u2028"),function(b,a){0<b&&(f+=" ");f+=c.trim(a)});c.each(f.split("\u2060"),function(b,a){0<b&&(d+="\n");d+=c.trim(a).replace(/\u00AD/g,"")});if("json"==a.type||!1===a.numbers.output)b=ea(d),!1!==b&&(d=Number(b));else if(a.numbers.html.decimalMark!=a.numbers.output.decimalMark||a.numbers.html.thousandsSeparator!=a.numbers.output.thousandsSeparator)if(b=
  5884. ea(d),!1!==b){var g=(""+b).split(".");1==g.length&&(g[1]="");var k=3<g[0].length?g[0].length%3:0,d=(0>b?"-":"")+(a.numbers.output.thousandsSeparator?(k?g[0].substr(0,k)+a.numbers.output.thousandsSeparator:"")+g[0].substr(k).replace(/(\d{3})(?=\d)/g,"$1"+a.numbers.output.thousandsSeparator):g[0])+(g[1].length?a.numbers.output.decimalMark+g[1]:"")}}!0===a.escape&&(d=escape(d));"function"===typeof a.onCellData&&(d=a.onCellData(w,h,e,d))}return d}function la(b,a,e){return a+"-"+e.toLowerCase()}function N(b,
  5885. a){var h=/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.exec(b),d=a;h&&(d=[parseInt(h[1]),parseInt(h[2]),parseInt(h[3])]);return d}function fa(b){var a=E(b,"text-align"),e=E(b,"font-weight"),d=E(b,"font-style"),w="";"start"==a&&(a="rtl"==E(b,"direction")?"right":"left");700<=e&&(w="bold");"italic"==d&&(w+=d);""===w&&(w="normal");a={style:{align:a,bcolor:N(E(b,"background-color"),[255,255,255]),color:N(E(b,"color"),[0,0,0]),fstyle:w},colspan:parseInt(c(b).attr("colspan"))||0,rowspan:parseInt(c(b).attr("rowspan"))||
  5886. 0};null!==b&&(b=b.getBoundingClientRect(),a.rect={width:b.width,height:b.height});return a}function E(b,a){try{return window.getComputedStyle?(a=a.replace(/([a-z])([A-Z])/,la),window.getComputedStyle(b,null).getPropertyValue(a)):b.currentStyle?b.currentStyle[a]:b.style[a]}catch(e){}return""}function O(b,a,e){a=E(b,a).match(/\d+/);if(null!==a){a=a[0];b=b.parentElement;var d=document.createElement("div");d.style.overflow="hidden";d.style.visibility="hidden";b.appendChild(d);d.style.width=100+e;e=100/
  5887. d.offsetWidth;b.removeChild(d);return a*e}return 0}function T(){if(!(this instanceof T))return new T;this.SheetNames=[];this.Sheets={}}function ma(a){for(var b=new ArrayBuffer(a.length),e=new Uint8Array(b),d=0;d!=a.length;++d)e[d]=a.charCodeAt(d)&255;return b}function na(a){for(var b={},e={s:{c:1E7,r:1E7},e:{c:0,r:0}},d=0;d!=a.length;++d)for(var c=0;c!=a[d].length;++c){e.s.r>d&&(e.s.r=d);e.s.c>c&&(e.s.c=c);e.e.r<d&&(e.e.r=d);e.e.c<c&&(e.e.c=c);var f={v:a[d][c]};if(null!==f.v){var l=XLSX.utils.encode_cell({c:c,
  5888. r:d});if("number"===typeof f.v)f.t="n";else if("boolean"===typeof f.v)f.t="b";else if(f.v instanceof Date){f.t="n";f.z=XLSX.SSF._table[14];var r=f,g;g=(Date.parse(f.v)-new Date(Date.UTC(1899,11,30)))/864E5;r.v=g}else f.t="s";b[l]=f}}1E7>e.s.c&&(b["!ref"]=XLSX.utils.encode_range(e));return b}function ca(a){var b=0,c,d,f;if(0===a.length)return b;c=0;for(f=a.length;c<f;c++)d=a.charCodeAt(c),b=(b<<5)-b+d,b|=0;return b}function C(a,c,e){var b=window.navigator.userAgent;if(!1!==a&&(0<b.indexOf("MSIE ")||
  5889. b.match(/Trident.*rv\:11\./)))if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(new Blob([e]),a);else{if(c=document.createElement("iframe"))document.body.appendChild(c),c.setAttribute("style","display:none"),c.contentDocument.open("txt/html","replace"),c.contentDocument.write(e),c.contentDocument.close(),c.focus(),c.contentDocument.execCommand("SaveAs",!0,a),document.body.removeChild(c)}else if(b=document.createElement("a")){var h=null;b.style.display="none";!1!==a?b.download=
  5890. a:b.target="_blank";"object"==typeof e?(h=window.URL.createObjectURL(e),b.href=h):0<=c.toLowerCase().indexOf("base64,")?b.href=c+F(e):b.href=c+encodeURIComponent(e);document.body.appendChild(b);if(document.createEvent)null===Q&&(Q=document.createEvent("MouseEvents")),Q.initEvent("click",!0,!1),b.dispatchEvent(Q);else if(document.createEventObject)b.fireEvent("onclick");else if("function"==typeof b.onclick)b.onclick();h&&window.URL.revokeObjectURL(h);document.body.removeChild(b)}}function F(a){var b=
  5891. "",c,d,f,g,l,r,k=0;a=a.replace(/\x0d\x0a/g,"\n");d="";for(f=0;f<a.length;f++)g=a.charCodeAt(f),128>g?d+=String.fromCharCode(g):(127<g&&2048>g?d+=String.fromCharCode(g>>6|192):(d+=String.fromCharCode(g>>12|224),d+=String.fromCharCode(g>>6&63|128)),d+=String.fromCharCode(g&63|128));for(a=d;k<a.length;)c=a.charCodeAt(k++),d=a.charCodeAt(k++),f=a.charCodeAt(k++),g=c>>2,c=(c&3)<<4|d>>4,l=(d&15)<<2|f>>6,r=f&63,isNaN(d)?l=r=64:isNaN(f)&&(r=64),b=b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)+
  5892. "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(r);return b}var a={consoleLog:!1,csvEnclosure:'"',csvSeparator:",",csvUseBOM:!0,displayTableName:!1,escape:!1,excelstyles:[],fileName:"tableExport",htmlContent:!1,ignoreColumn:[],ignoreRow:[],jsonScope:"all",jspdf:{orientation:"p",unit:"pt",format:"a4",margins:{left:20,
  5893. right:10,top:10,bottom:10},autotable:{styles:{cellPadding:2,rowHeight:12,fontSize:8,fillColor:255,textColor:50,fontStyle:"normal",overflow:"ellipsize",halign:"left",valign:"middle"},headerStyles:{fillColor:[52,73,94],textColor:255,fontStyle:"bold",halign:"center"},alternateRowStyles:{fillColor:245},tableExport:{onAfterAutotable:null,onBeforeAutotable:null,onTable:null,outputImages:!0}}},numbers:{html:{decimalMark:".",thousandsSeparator:","},output:{decimalMark:".",thousandsSeparator:","}},onCellData:null,
  5894. onCellHtmlData:null,outputMode:"file",pdfmake:{enabled:!1},tbodySelector:"tr",tfootSelector:"tr",theadSelector:"tr",tableName:"myTableName",type:"csv",worksheetName:"xlsWorksheetName"},t=this,Q=null,n=[],g=[],k=0,A=[],m="",H=[],y;c.extend(!0,a,u);H=S(t);if("csv"==a.type||"tsv"==a.type||"txt"==a.type){var D="",I=0,k=0,U=function(b,h,e){b.each(function(){m="";z(this,h,k,e+b.length,function(b,c,e){var d=m,h="";if(null!==b)if(b=x(b,c,e),c=null===b||""===b?"":b.toString(),"tsv"==a.type)b instanceof Date&&
  5895. b.toLocaleString(),h=P(c,"\t"," ");else if(b instanceof Date)h=a.csvEnclosure+b.toLocaleString()+a.csvEnclosure;else if(h=P(c,a.csvEnclosure,a.csvEnclosure+a.csvEnclosure),0<=h.indexOf(a.csvSeparator)||/[\r\n ]/g.test(h))h=a.csvEnclosure+h+a.csvEnclosure;m=d+(h+("tsv"==a.type?"\t":a.csvSeparator))});m=c.trim(m).substring(0,m.length-1);0<m.length&&(0<D.length&&(D+="\n"),D+=m);k++});return b.length},I=I+U(c(t).find("thead").first().find(a.theadSelector),"th,td",I);c(t).find("tbody").each(function(){I+=
  5896. U(c(this).find(a.tbodySelector),"td,th",I)});a.tfootSelector.length&&U(c(t).find("tfoot").first().find(a.tfootSelector),"td,th",I);D+="\n";!0===a.consoleLog&&console.log(D);if("string"===a.outputMode)return D;if("base64"===a.outputMode)return F(D);if("window"===a.outputMode){C(!1,"data:text/"+("csv"==a.type?"csv":"plain")+";charset=utf-8,",D);return}try{y=new Blob([D],{type:"text/"+("csv"==a.type?"csv":"plain")+";charset=utf-8"}),saveAs(y,a.fileName+"."+a.type,"csv"!=a.type||!1===a.csvUseBOM)}catch(b){C(a.fileName+
  5897. "."+a.type,"data:text/"+("csv"==a.type?"csv":"plain")+";charset=utf-8,"+("csv"==a.type&&a.csvUseBOM?"\ufeff":""),D)}}else if("sql"==a.type){var k=0,v="INSERT INTO `"+a.tableName+"` (",n=c(t).find("thead").first().find(a.theadSelector);n.each(function(){z(this,"th,td",k,n.length,function(a,c,e){v+="'"+x(a,c,e)+"',"});k++;v=c.trim(v);v=c.trim(v).substring(0,v.length-1)});v+=") VALUES ";c(t).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,
  5898. c(t).find("tfoot").find(a.tfootSelector));c(g).each(function(){m="";z(this,"td,th",k,n.length+g.length,function(a,c,e){m+="'"+x(a,c,e)+"',"});3<m.length&&(v+="("+m,v=c.trim(v).substring(0,v.length-1),v+="),");k++});v=c.trim(v).substring(0,v.length-1);v+=";";!0===a.consoleLog&&console.log(v);if("string"===a.outputMode)return v;if("base64"===a.outputMode)return F(v);try{y=new Blob([v],{type:"text/plain;charset=utf-8"}),saveAs(y,a.fileName+".sql")}catch(b){C(a.fileName+".sql","data:application/sql;charset=utf-8,",
  5899. v)}}else if("json"==a.type){var J=[],n=c(t).find("thead").first().find(a.theadSelector);n.each(function(){var a=[];z(this,"th,td",k,n.length,function(b,c,d){a.push(x(b,c,d))});J.push(a)});var V=[];c(t).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(t).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a={},h=0;z(this,"td,th",k,n.length+g.length,function(b,c,f){J.length?a[J[J.length-1][h]]=x(b,c,f):a[h]=x(b,c,f);h++});
  5900. !1===c.isEmptyObject(a)&&V.push(a);k++});u="";u="head"==a.jsonScope?JSON.stringify(J):"data"==a.jsonScope?JSON.stringify(V):JSON.stringify({header:J,data:V});!0===a.consoleLog&&console.log(u);if("string"===a.outputMode)return u;if("base64"===a.outputMode)return F(u);try{y=new Blob([u],{type:"application/json;charset=utf-8"}),saveAs(y,a.fileName+".json")}catch(b){C(a.fileName+".json","data:application/json;charset=utf-8;base64,",u)}}else if("xml"===a.type){var k=0,B='<?xml version="1.0" encoding="utf-8"?>',
  5901. B=B+"<tabledata><fields>",n=c(t).find("thead").first().find(a.theadSelector);n.each(function(){z(this,"th,td",k,n.length,function(a,c,e){B+="<field>"+x(a,c,e)+"</field>"});k++});var B=B+"</fields><data>",ga=1;c(t).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(t).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a=1;m="";z(this,"td,th",k,n.length+g.length,function(b,c,d){m+="<column-"+a+">"+x(b,c,d)+"</column-"+a+
  5902. ">";a++});0<m.length&&"<column-1></column-1>"!=m&&(B+='<row id="'+ga+'">'+m+"</row>",ga++);k++});B+="</data></tabledata>";!0===a.consoleLog&&console.log(B);if("string"===a.outputMode)return B;if("base64"===a.outputMode)return F(B);try{y=new Blob([B],{type:"application/xml;charset=utf-8"}),saveAs(y,a.fileName+".xml")}catch(b){C(a.fileName+".xml","data:application/xml;charset=utf-8;base64,",B)}}else if("excel"==a.type||"xls"==a.type||"word"==a.type||"doc"==a.type){u="excel"==a.type||"xls"==a.type?"excel":
  5903. "word";var K="excel"==u?"xls":"doc",p='xmlns:x="urn:schemas-microsoft-com:office:'+u+'"',G="";c(t).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display"))}).each(function(){var b=c(this);k=0;H=S(this);G+="<table><thead>";n=b.find("thead").first().find(a.theadSelector);n.each(function(){m="";z(this,"th,td",k,n.length,function(b,e,d){if(null!==b){var h="";m+="<th";for(var f in a.excelstyles)if(a.excelstyles.hasOwnProperty(f)){var l=
  5904. c(b).css(a.excelstyles[f]);""!==l&&"0px none rgb(0, 0, 0)"!=l&&"rgba(0, 0, 0, 0)"!=l&&(h+=""===h?'style="':";",h+=a.excelstyles[f]+":"+l)}""!==h&&(m+=" "+h+'"');c(b).is("[colspan]")&&(m+=' colspan="'+c(b).attr("colspan")+'"');c(b).is("[rowspan]")&&(m+=' rowspan="'+c(b).attr("rowspan")+'"');m+=">"+x(b,e,d)+"</th>"}});0<m.length&&(G+="<tr>"+m+"</tr>");k++});G+="</thead><tbody>";b.find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,b.find("tfoot").find(a.tfootSelector));
  5905. c(g).each(function(){var b=c(this);m="";z(this,"td,th",k,n.length+g.length,function(e,d,h){if(null!==e){var f="",l=c(e).data("tableexport-msonumberformat");"undefined"==typeof l&&"function"===typeof a.onMsoNumberFormat&&(l=a.onMsoNumberFormat(e,d,h));"undefined"!=typeof l&&""!==l&&(f="style=\"mso-number-format:'"+l+"'");for(var g in a.excelstyles)a.excelstyles.hasOwnProperty(g)&&(l=c(e).css(a.excelstyles[g]),""===l&&(l=b.css(a.excelstyles[g])),""!==l&&"0px none rgb(0, 0, 0)"!=l&&"rgba(0, 0, 0, 0)"!=
  5906. l&&(f+=""===f?'style="':";",f+=a.excelstyles[g]+":"+l));m+="<td";""!==f&&(m+=" "+f+'"');c(e).is("[colspan]")&&(m+=' colspan="'+c(e).attr("colspan")+'"');c(e).is("[rowspan]")&&(m+=' rowspan="'+c(e).attr("rowspan")+'"');m+=">"+x(e,d,h).replace(/\n/g,"<br>")+"</td>"}});0<m.length&&(G+="<tr>"+m+"</tr>");k++});a.displayTableName&&(G+="<tr><td></td></tr><tr><td></td></tr><tr><td>"+x(c("<p>"+a.tableName+"</p>"))+"</td></tr>");G+="</tbody></table>";!0===a.consoleLog&&console.log(G)});p='<html xmlns:o="urn:schemas-microsoft-com:office:office" '+
  5907. p+' xmlns="http://www.w3.org/TR/REC-html40">'+('<meta http-equiv="content-type" content="application/vnd.ms-'+u+'; charset=UTF-8">')+"<head>";"excel"===u&&(p+="\x3c!--[if gte mso 9]>",p+="<xml>",p+="<x:ExcelWorkbook>",p+="<x:ExcelWorksheets>",p+="<x:ExcelWorksheet>",p+="<x:Name>",p+=a.worksheetName,p+="</x:Name>",p+="<x:WorksheetOptions>",p+="<x:DisplayGridlines/>",p+="</x:WorksheetOptions>",p+="</x:ExcelWorksheet>",p+="</x:ExcelWorksheets>",p+="</x:ExcelWorkbook>",p+="</xml>",p+="<![endif]--\x3e");
  5908. p+="<style>br {mso-data-placement:same-cell;}</style>";p+="</head>";p+="<body>";p+=G;p+="</body>";p+="</html>";!0===a.consoleLog&&console.log(p);if("string"===a.outputMode)return p;if("base64"===a.outputMode)return F(p);try{y=new Blob([p],{type:"application/vnd.ms-"+a.type}),saveAs(y,a.fileName+"."+K)}catch(b){C(a.fileName+"."+K,"data:application/vnd.ms-"+u+";base64,",p)}}else if("xlsx"==a.type){var ha=[],W=[],k=0,g=c(t).find("thead").first().find(a.theadSelector);c(t).find("tbody").each(function(){g.push.apply(g,
  5909. c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(t).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a=[];z(this,"th,td",k,g.length,function(b,c,d){if("undefined"!==typeof b&&null!==b){var e=parseInt(b.getAttribute("colspan")),f=parseInt(b.getAttribute("rowspan"));b=x(b,c,d);""!==b&&b==+b&&(b=+b);W.forEach(function(b){if(k>=b.s.r&&k<=b.e.r&&a.length>=b.s.c&&a.length<=b.e.c)for(var c=0;c<=b.e.c-b.s.c;++c)a.push(null)});if(f||e)e=e||1,W.push({s:{r:k,c:a.length},
  5910. e:{r:k+(f||1)-1,c:a.length+e-1}});a.push(""!==b?b:null);if(e)for(f=0;f<e-1;++f)a.push(null)}});ha.push(a);k++});u=new T;K=na(ha);K["!merges"]=W;u.SheetNames.push(a.worksheetName);u.Sheets[a.worksheetName]=K;u=XLSX.write(u,{bookType:a.type,bookSST:!1,type:"binary"});try{y=new Blob([ma(u)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"}),saveAs(y,a.fileName+"."+a.type)}catch(b){C(a.fileName+"."+a.type,"data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8,",
  5911. y)}}else if("png"==a.type)html2canvas(c(t)[0]).then(function(b){b=b.toDataURL();for(var c=atob(b.substring(22)),e=new ArrayBuffer(c.length),d=new Uint8Array(e),f=0;f<c.length;f++)d[f]=c.charCodeAt(f);!0===a.consoleLog&&console.log(c);if("string"===a.outputMode)return c;if("base64"===a.outputMode)return F(b);if("window"===a.outputMode)window.open(b);else try{y=new Blob([e],{type:"image/png"}),saveAs(y,a.fileName+".png")}catch(q){C(a.fileName+".png","data:image/png,",y)}});else if("pdf"==a.type)if(!0===
  5912. a.pdfmake.enabled){var X=[],Y=[],k=0,n=c(this).find("thead").first().find(a.theadSelector);n.each(function(){var a=[];z(this,"th,td",k,n.length,function(b,c,f){a.push(x(b,c,f))});a.length&&Y.push(a);for(var c=X.length;c<a.length;c++)X.push("*");k++});c(this).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(this).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a=[];z(this,"td,th",k,n.length+g.length,function(b,c,d){a.push(x(b,
  5913. c,d))});a.length&&Y.push(a);k++});pdfMake.createPdf({pageOrientation:"landscape",content:[{table:{headerRows:n.length,widths:X,body:Y}}]}).getBuffer(function(b){try{var c=new Blob([b],{type:"application/pdf"});saveAs(c,a.fileName+".pdf")}catch(e){C(a.fileName+".pdf","data:application/pdf;base64,",b)}})}else if(!1===a.jspdf.autotable){u={dim:{w:O(c(t).first().get(0),"width","mm"),h:O(c(t).first().get(0),"height","mm")},pagesplit:!1};var ia=new jsPDF(a.jspdf.orientation,a.jspdf.unit,a.jspdf.format);
  5914. ia.addHTML(c(t).first(),a.jspdf.margins.left,a.jspdf.margins.top,u,function(){Z(ia,!1)})}else{var f=a.jspdf.autotable.tableExport;if("string"===typeof a.jspdf.format&&"bestfit"===a.jspdf.format.toLowerCase()){var L={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89]},R="",M="",ja=0;c(t).filter(":visible").each(function(){if("none"!=c(this).css("display")){var a=O(c(this).get(0),"width","pt");if(a>ja){a>L.a0[0]&&(R="a0",M="l");for(var f in L)L.hasOwnProperty(f)&&
  5915. L[f][1]>a&&(R=f,M="l",L[f][0]>a&&(M="p"));ja=a}}});a.jspdf.format=""===R?"a4":R;a.jspdf.orientation=""===M?"w":M}f.doc=new jsPDF(a.jspdf.orientation,a.jspdf.unit,a.jspdf.format);!0===f.outputImages&&(f.images={});"undefined"!=typeof f.images&&(c(t).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display"))}).each(function(){var b=0;n=c(this).find("thead").find(a.theadSelector);c(this).find("tbody").each(function(){g.push.apply(g,
  5916. c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(this).find("tfoot").find(a.tfootSelector));c(g).each(function(){z(this,"td,th",n.length+b,n.length+g.length,function(a,b,d){"undefined"!==typeof a&&null!==a&&(b=c(a).children(),"undefined"!=typeof b&&0<b.length&&ba(a,b,f))});b++})}),n=[],g=[]);ka(f,function(b){c(t).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display"))}).each(function(){var b,
  5917. e=0;H=S(this);f.columns=[];f.rows=[];f.rowoptions={};if("function"===typeof f.onTable&&!1===f.onTable(c(this),a))return!0;a.jspdf.autotable.tableExport=null;var d=c.extend(!0,{},a.jspdf.autotable);a.jspdf.autotable.tableExport=f;d.margin={};c.extend(!0,d.margin,a.jspdf.margins);d.tableExport=f;"function"!==typeof d.beforePageContent&&(d.beforePageContent=function(a){1==a.pageCount&&a.table.rows.concat(a.table.headerRow).forEach(function(b){0<b.height&&(b.height+=(2-1.15)/2*b.styles.fontSize,a.table.height+=
  5918. (2-1.15)/2*b.styles.fontSize)})});"function"!==typeof d.createdHeaderCell&&(d.createdHeaderCell=function(a,b){a.styles=c.extend({},b.row.styles);if("undefined"!=typeof f.columns[b.column.dataKey]){var e=f.columns[b.column.dataKey];if("undefined"!=typeof e.rect){var g;a.contentWidth=e.rect.width;if("undefined"==typeof f.heightRatio||0===f.heightRatio)g=b.row.raw[b.column.dataKey].rowspan?b.row.raw[b.column.dataKey].rect.height/b.row.raw[b.column.dataKey].rowspan:b.row.raw[b.column.dataKey].rect.height,
  5919. f.heightRatio=a.styles.rowHeight/g;g=b.row.raw[b.column.dataKey].rect.height*f.heightRatio;g>a.styles.rowHeight&&(a.styles.rowHeight=g)}"undefined"!=typeof e.style&&!0!==e.style.hidden&&(a.styles.halign=e.style.align,"inherit"===d.styles.fillColor&&(a.styles.fillColor=e.style.bcolor),"inherit"===d.styles.textColor&&(a.styles.textColor=e.style.color),"inherit"===d.styles.fontStyle&&(a.styles.fontStyle=e.style.fstyle))}});"function"!==typeof d.createdCell&&(d.createdCell=function(a,b){var c=f.rowoptions[b.row.index+
  5920. ":"+b.column.dataKey];"undefined"!=typeof c&&"undefined"!=typeof c.style&&!0!==c.style.hidden&&(a.styles.halign=c.style.align,"inherit"===d.styles.fillColor&&(a.styles.fillColor=c.style.bcolor),"inherit"===d.styles.textColor&&(a.styles.textColor=c.style.color),"inherit"===d.styles.fontStyle&&(a.styles.fontStyle=c.style.fstyle))});"function"!==typeof d.drawHeaderCell&&(d.drawHeaderCell=function(a,b){var c=f.columns[b.column.dataKey];return(!0!==c.style.hasOwnProperty("hidden")||!0!==c.style.hidden)&&
  5921. 0<=c.rowIndex?aa(a,b,c):!1});"function"!==typeof d.drawCell&&(d.drawCell=function(a,b){var c=f.rowoptions[b.row.index+":"+b.column.dataKey];if(aa(a,b,c)){f.doc.rect(a.x,a.y,a.width,a.height,a.styles.fillStyle);if("undefined"!=typeof c&&"undefined"!=typeof c.kids&&0<c.kids.length){var d=a.height/c.rect.height;if(d>f.dh||"undefined"==typeof f.dh)f.dh=d;f.dw=a.width/c.rect.width;da(a,c.kids,f)}f.doc.autoTableText(a.text,a.textPos.x,a.textPos.y,{halign:a.styles.halign,valign:a.styles.valign})}return!1});
  5922. f.headerrows=[];n=c(this).find("thead").find(a.theadSelector);n.each(function(){b=0;f.headerrows[e]=[];z(this,"th,td",e,n.length,function(a,c,d){var g=fa(a);g.title=x(a,c,d);g.key=b++;g.rowIndex=e;f.headerrows[e].push(g)});e++});if(0<e)for(var k=e-1;0<=k;)c.each(f.headerrows[k],function(){var a=this;0<k&&null===this.rect&&(a=f.headerrows[k-1][this.key]);null!==a&&0<=a.rowIndex&&(!0!==a.style.hasOwnProperty("hidden")||!0!==a.style.hidden)&&f.columns.push(a)}),k=0<f.columns.length?-1:k-1;var m=0;g=
  5923. [];c(this).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(this).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a=[];b=0;z(this,"td,th",e,n.length+g.length,function(d,e,g){if("undefined"===typeof f.columns[b]){var h={title:"",key:b,style:{hidden:!0}};f.columns.push(h)}"undefined"!==typeof d&&null!==d?(h=fa(d),h.kids=c(d).children()):(h=c.extend(!0,{},f.rowoptions[m+":"+(b-1)]),h.colspan=-1);f.rowoptions[m+":"+b++]=
  5924. h;a.push(x(d,e,g))});a.length&&(f.rows.push(a),m++);e++});if("function"===typeof f.onBeforeAutotable)f.onBeforeAutotable(c(this),f.columns,f.rows,d);f.doc.autoTable(f.columns,f.rows,d);if("function"===typeof f.onAfterAutotable)f.onAfterAutotable(c(this),d);a.jspdf.autotable.startY=f.doc.autoTableEndPosY()+d.margin.top});Z(f.doc,"undefined"!=typeof f.images&&!1===jQuery.isEmptyObject(f.images));"undefined"!=typeof f.headerrows&&(f.headerrows.length=0);"undefined"!=typeof f.columns&&(f.columns.length=
  5925. 0);"undefined"!=typeof f.rows&&(f.rows.length=0);delete f.doc;f.doc=null})}return this}})})(jQuery);
  5926. define("tableexport", ["jquery"], (function (global) {
  5927. return function () {
  5928. var ret, fn;
  5929. return ret || global.$.fn.extend;
  5930. };
  5931. }(this)));
  5932. /*
  5933. * bootstrap-table - v1.11.0 - 2016-07-02
  5934. * https://github.com/wenzhixin/bootstrap-table
  5935. * Copyright (c) 2016 zhixin wen
  5936. * Licensed MIT License
  5937. */
  5938. !function(a){"use strict";var b=a.fn.bootstrapTable.utils.sprintf,c={json:"JSON",xml:"XML",png:"PNG",csv:"CSV",txt:"TXT",sql:"SQL",doc:"MS-Word",excel:"MS-Excel",powerpoint:"MS-Powerpoint",pdf:"PDF"};a.extend(a.fn.bootstrapTable.defaults,{showExport:!1,exportDataType:"basic",exportTypes:["json","xml","csv","txt","sql","excel"],exportOptions:{}}),a.extend(a.fn.bootstrapTable.defaults.icons,{"export":"glyphicon-export icon-share"}),a.extend(a.fn.bootstrapTable.locales,{formatExport:function(){return"Export data"}}),a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales);var d=a.fn.bootstrapTable.Constructor,e=d.prototype.initToolbar;d.prototype.initToolbar=function(){if(this.showToolbar=this.options.showExport,e.apply(this,Array.prototype.slice.apply(arguments)),this.options.showExport){var d=this,f=this.$toolbar.find(">.btn-group"),g=f.find("div.export");if(!g.length){g=a(['<div class="export btn-group">','<button class="btn'+b(" btn-%s",this.options.buttonsClass)+b(" btn-%s",this.options.iconSize)+' dropdown-toggle" title="'+this.options.formatExport()+'" data-toggle="dropdown" type="button">',b('<i class="%s %s"></i> ',this.options.iconsPrefix,this.options.icons["export"]),'<span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">',"</ul>","</div>"].join("")).appendTo(f);var h=g.find(".dropdown-menu"),i=this.options.exportTypes;if("string"==typeof this.options.exportTypes){var j=this.options.exportTypes.slice(1,-1).replace(/ /g,"").split(",");i=[],a.each(j,function(a,b){i.push(b.slice(1,-1))})}a.each(i,function(a,b){c.hasOwnProperty(b)&&h.append(['<li data-type="'+b+'">','<a href="javascript:void(0)">',c[b],"</a>","</li>"].join(""))}),h.find("li").click(function(){var b=a(this).data("type"),c=function(){d.$el.tableExport(a.extend({},d.options.exportOptions,{type:b,escape:!1}))};if("all"===d.options.exportDataType&&d.options.pagination)d.$el.one("server"===d.options.sidePagination?"post-body.bs.table":"page-change.bs.table",function(){c(),d.togglePagination()}),d.togglePagination();else if("selected"===d.options.exportDataType){var e=d.getData(),f=d.getAllSelections();d.load(f),c(),d.load(e)}else c()})}}}}(jQuery);
  5939. define("bootstrap-table-export", ["bootstrap-table","tableexport"], (function (global) {
  5940. return function () {
  5941. var ret, fn;
  5942. return ret || global.$.fn.bootstrapTable.defaults;
  5943. };
  5944. }(this)));
  5945. /**
  5946. * @author: aperez <aperez@datadec.es>
  5947. * @version: v2.0.0
  5948. *
  5949. * @update Dennis Hernández <http://djhvscf.github.io/Blog>
  5950. */
  5951. !function ($) {
  5952. 'use strict';
  5953. var firstLoad = false;
  5954. var sprintf = $.fn.bootstrapTable.utils.sprintf;
  5955. var showAvdSearch = function (pColumns, that) {
  5956. var searchTitle = that.options.formatAdvancedSearch();
  5957. if (!$("#avdSearchModal" + "_" + that.options.idTable).hasClass("modal")) {
  5958. var vModal = sprintf("<div id=\"avdSearchModal%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"mySmallModalLabel\" aria-hidden=\"true\">", "_" + that.options.idTable);
  5959. vModal += "<div class=\"modal-dialog modal-xs\">";
  5960. vModal += " <div class=\"modal-content\">";
  5961. vModal += " <div class=\"modal-header\">";
  5962. vModal += " <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\" >&times;</button>";
  5963. vModal += sprintf(" <h4 class=\"modal-title\">%s</h4>", searchTitle);
  5964. vModal += " </div>";
  5965. vModal += " <div class=\"modal-body modal-body-custom\">";
  5966. vModal += sprintf(" <div class=\"container-fluid\" id=\"avdSearchModalContent%s\" style=\"padding-right: 0px;padding-left: 0px;\" >", "_" + that.options.idTable);
  5967. vModal += " </div>";
  5968. vModal += " </div>";
  5969. vModal += " <div class=\"modal-footer\">";
  5970. vModal += createFormBtn(that).join('');
  5971. vModal += " </div>";
  5972. vModal += " </div>";
  5973. vModal += " </div>";
  5974. vModal += "</div>";
  5975. $("body").append($(vModal));
  5976. var vFormAvd = createFormAvd(pColumns, that),
  5977. timeoutId = 0;
  5978. ;
  5979. $('#avdSearchModalContent' + "_" + that.options.idTable).append(vFormAvd.join(''));
  5980. if (that.options.sidePagination != 'server' || !that.options.url) {
  5981. $('#' + that.options.idForm).off('keyup blur', 'input').on('keyup blur', 'input', function (event) {
  5982. clearTimeout(timeoutId);
  5983. timeoutId = setTimeout(function () {
  5984. that.onColumnAdvancedSearch(event);
  5985. }, that.options.searchTimeOut);
  5986. });
  5987. } else {
  5988. }
  5989. // 提交搜索
  5990. $("#btnSubmitAvd" + "_" + that.options.idTable).click(function (event) {
  5991. that.onColumnAdvancedSearch();
  5992. });
  5993. // 重置搜索
  5994. $("#btnResetAvd" + "_" + that.options.idTable).click(function () {
  5995. $("#avdSearchModal" + "_" + that.options.idTable + " form")[0].reset();
  5996. that.onColumnAdvancedSearch();
  5997. });
  5998. $("#avdSearchModal" + "_" + that.options.idTable).modal();
  5999. } else {
  6000. $("#avdSearchModal" + "_" + that.options.idTable).modal();
  6001. }
  6002. };
  6003. var createFormAvd = function (pColumns, that) {
  6004. var htmlForm = [];
  6005. var opList = ['=', '>', '>=', '<', '<=', '!=', 'LIKE', 'LIKE %...%', 'NOT LIKE', 'IN(...)', 'NOT IN(...)', 'BETWEEN', 'NOT BETWEEN', 'IS NULL', 'IS NOT NULL'];
  6006. var selectList = [];
  6007. for (var i = 0; i < opList.length; i++) {
  6008. selectList.push("<option value='" + opList[i] + "'>" + opList[i] + "</option>");
  6009. }
  6010. var selectHtml = selectList.join('');
  6011. htmlForm.push(sprintf('<form class="form-horizontal" id="%s" action="%s" >', that.options.idForm, that.options.actionForm));
  6012. for (var i in pColumns) {
  6013. var vObjCol = pColumns[i];
  6014. if (!vObjCol.checkbox && vObjCol.field != 'operate' && vObjCol.visible && vObjCol.searchable) {
  6015. htmlForm.push('<div class="form-group">');
  6016. htmlForm.push(sprintf('<label class="col-sm-3 control-label">%s</label>', vObjCol.title));
  6017. if (that.options.sidePagination == 'server' && that.options.url) {
  6018. htmlForm.push('<div class="col-sm-2">');
  6019. htmlForm.push(sprintf('<select class="form-control" name="field-%s" data-name="%s">%s</select>', vObjCol.field, vObjCol.field, selectHtml));
  6020. htmlForm.push('</div>');
  6021. }
  6022. htmlForm.push('<div class="col-sm-6">');
  6023. htmlForm.push(sprintf('<input type="text" class="form-control input-md" name="%s" placeholder="%s" id="%s">', vObjCol.field, vObjCol.title, vObjCol.field));
  6024. htmlForm.push('</div>');
  6025. htmlForm.push('</div>');
  6026. }
  6027. }
  6028. htmlForm.push('</form>');
  6029. return htmlForm;
  6030. };
  6031. var createFormBtn = function (that) {
  6032. var htmlBtn = [];
  6033. var searchSubmit = that.options.formatAdvancedSubmitButton();
  6034. var searchReset = that.options.formatAdvancedResetButton();
  6035. var searchClose = that.options.formatAdvancedCloseButton();
  6036. htmlBtn.push('<div class="form-group">');
  6037. htmlBtn.push('<div class="col-sm-12 text-center">');
  6038. if (that.options.sidePagination == 'server' && that.options.url) {
  6039. htmlBtn.push(sprintf('<button type="button" id="btnSubmitAvd%s" class="btn btn-success" >%s</button> ', "_" + that.options.idTable, searchSubmit));
  6040. htmlBtn.push(sprintf('<button type="button" id="btnResetAvd%s" class="btn btn-default" >%s</button> ', "_" + that.options.idTable, searchReset));
  6041. } else {
  6042. htmlBtn.push(sprintf('<button type="button" id="btnCloseAvd%s" data-dismiss="modal" class="btn btn-default" >%s</button> ', "_" + that.options.idTable, searchClose));
  6043. }
  6044. htmlBtn.push('</div>');
  6045. htmlBtn.push('</div>');
  6046. return htmlBtn;
  6047. };
  6048. $.extend($.fn.bootstrapTable.defaults, {
  6049. advancedSearch: false,
  6050. idForm: 'advancedSearch',
  6051. actionForm: '',
  6052. idTable: undefined,
  6053. onColumnAdvancedSearch: function (field, text) {
  6054. return false;
  6055. }
  6056. });
  6057. $.extend($.fn.bootstrapTable.defaults.icons, {
  6058. advancedSearchIcon: 'glyphicon-search'
  6059. });
  6060. $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
  6061. 'column-advanced-search.bs.table': 'onColumnAdvancedSearch'
  6062. });
  6063. $.extend($.fn.bootstrapTable.locales, {
  6064. formatAdvancedSearch: function () {
  6065. return 'Advanced search';
  6066. },
  6067. formatAdvancedSubmitButton: function () {
  6068. return "Submit";
  6069. },
  6070. formatAdvancedResetButton: function () {
  6071. return "Reset";
  6072. },
  6073. formatAdvancedCloseButton: function () {
  6074. return "Close";
  6075. }
  6076. });
  6077. $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
  6078. var BootstrapTable = $.fn.bootstrapTable.Constructor,
  6079. _initToolbar = BootstrapTable.prototype.initToolbar,
  6080. _load = BootstrapTable.prototype.load,
  6081. _initSearch = BootstrapTable.prototype.initSearch;
  6082. BootstrapTable.prototype.initToolbar = function () {
  6083. _initToolbar.apply(this, Array.prototype.slice.apply(arguments));
  6084. if (!this.options.search) {
  6085. return;
  6086. }
  6087. if (!this.options.advancedSearch) {
  6088. return;
  6089. }
  6090. if (!this.options.idTable) {
  6091. return;
  6092. }
  6093. var that = this,
  6094. html = [];
  6095. html.push(sprintf('<div class="columns columns-%s btn-group pull-%s" role="group">', this.options.buttonsAlign, this.options.buttonsAlign));
  6096. html.push(sprintf('<button class="btn btn-default%s' + '" type="button" name="advancedSearch" title="%s">', that.options.iconSize === undefined ? '' : ' btn-' + that.options.iconSize, that.options.formatAdvancedSearch()));
  6097. html.push(sprintf('<i class="%s %s"></i>', that.options.iconsPrefix, that.options.icons.advancedSearchIcon))
  6098. html.push('</button></div>');
  6099. that.$toolbar.prepend(html.join(''));
  6100. that.$toolbar.find('button[name="advancedSearch"]')
  6101. .off('click').on('click', function () {
  6102. showAvdSearch(that.columns, that);
  6103. });
  6104. };
  6105. BootstrapTable.prototype.load = function (data) {
  6106. _load.apply(this, Array.prototype.slice.apply(arguments));
  6107. if (!this.options.advancedSearch) {
  6108. return;
  6109. }
  6110. if (typeof this.options.idTable === 'undefined') {
  6111. return;
  6112. } else {
  6113. if (!firstLoad) {
  6114. var height = parseInt($(".bootstrap-table").height());
  6115. height += 10;
  6116. $("#" + this.options.idTable).bootstrapTable("resetView", {height: height});
  6117. firstLoad = true;
  6118. }
  6119. }
  6120. };
  6121. BootstrapTable.prototype.initSearch = function () {
  6122. _initSearch.apply(this, Array.prototype.slice.apply(arguments));
  6123. if (!this.options.advancedSearch) {
  6124. return;
  6125. }
  6126. var that = this;
  6127. var fp = $.isEmptyObject(this.filterColumnsPartial) ? null : this.filterColumnsPartial;
  6128. this.data = fp ? $.grep(this.data, function (item, i) {
  6129. for (var key in fp) {
  6130. var fval = fp[key].toLowerCase();
  6131. var value = item[key];
  6132. value = $.fn.bootstrapTable.utils.calculateObjectValue(that.header,
  6133. that.header.formatters[$.inArray(key, that.header.fields)],
  6134. [value, item, i], value);
  6135. if (!($.inArray(key, that.header.fields) !== -1 &&
  6136. (typeof value === 'string' || typeof value === 'number') &&
  6137. (value + '').toLowerCase().indexOf(fval) !== -1)) {
  6138. return false;
  6139. }
  6140. }
  6141. return true;
  6142. }) : this.data;
  6143. };
  6144. BootstrapTable.prototype.onColumnAdvancedSearch = function (event) {
  6145. if (typeof event == 'undefined') {
  6146. var op = {};
  6147. var filter = {};
  6148. $("#avdSearchModalContent_" + this.options.idTable + " select").each(function () {
  6149. var name = $(this).data("name");
  6150. var sym = $(this).val();
  6151. var value = $("input[name='" + name + "']").val();
  6152. if (value == '' && sym.indexOf("NULL") == -1) {
  6153. return true;
  6154. }
  6155. op[name] = sym;
  6156. filter[name] = value;
  6157. });
  6158. // 追加查询关键字
  6159. this.options.pageNumber = 1;
  6160. this.refresh({query: {filter: JSON.stringify(filter), op: JSON.stringify(op)}});
  6161. } else {
  6162. var text = $.trim($(event.currentTarget).val());
  6163. var $field = $(event.currentTarget)[0].id;
  6164. if ($.isEmptyObject(this.filterColumnsPartial)) {
  6165. this.filterColumnsPartial = {};
  6166. }
  6167. if (text) {
  6168. this.filterColumnsPartial[$field] = text;
  6169. } else {
  6170. delete this.filterColumnsPartial[$field];
  6171. }
  6172. this.options.pageNumber = 1;
  6173. this.onSearch(event);
  6174. // this.updatePagination();
  6175. this.trigger('column-advanced-search', $field, text);
  6176. }
  6177. };
  6178. }(jQuery);
  6179. define("bootstrap-table-advancedsearch", ["bootstrap-table"], (function (global) {
  6180. return function () {
  6181. var ret, fn;
  6182. return ret || global.$.fn.bootstrapTable.defaults;
  6183. };
  6184. }(this)));
  6185. define('table',['jquery', 'bootstrap', 'backend', 'config', 'toastr', 'moment', 'bootstrap-table', 'bootstrap-table-lang', 'bootstrap-table-mobile', 'bootstrap-table-export', 'bootstrap-table-advancedsearch'], function ($, undefined, Backend, Config, Toastr, Moment) {
  6186. var Table = {
  6187. list: {},
  6188. // Bootstrap-table 基础配置
  6189. defaults: {
  6190. url: '',
  6191. sidePagination: 'server',
  6192. method: 'get',
  6193. toolbar: "#toolbar",
  6194. search: true,
  6195. advancedSearch: true,
  6196. idTable: 'advancedTable',
  6197. showExport: true,
  6198. pagination: true,
  6199. clickToSelect: true,
  6200. showRefresh: false,
  6201. locale: Config.language.replace('_', '-'),
  6202. showToggle: true,
  6203. showColumns: true,
  6204. sortName: 'id',
  6205. sortOrder: 'desc',
  6206. paginationFirstText: __("First"),
  6207. paginationPreText: __("Previous"),
  6208. paginationNextText: __("Next"),
  6209. paginationLastText: __("Last"),
  6210. mobileResponsive: true,
  6211. cardView: true,
  6212. checkOnInit: true,
  6213. extend: {
  6214. index_url: '',
  6215. add_url: '',
  6216. edit_url: '',
  6217. del_url: '',
  6218. multi_url: '',
  6219. dragsort_url: 'ajax/weigh',
  6220. }
  6221. },
  6222. // Bootstrap-table 列配置
  6223. columnDefaults: {
  6224. align: 'center',
  6225. valign: 'middle',
  6226. },
  6227. config: {
  6228. firsttd: 'tbody tr td:first-child:not(:has(div.card-views))',
  6229. toolbar: '.toolbar',
  6230. refreshbtn: '.btn-refresh',
  6231. addbtn: '.btn-add',
  6232. editbtn: '.btn-edit',
  6233. delbtn: '.btn-del',
  6234. multibtn: '.btn-multi',
  6235. disabledbtn: '.btn-disabled',
  6236. editonebtn: '.btn-editone',
  6237. dragsortfield: 'weigh',
  6238. },
  6239. api: {
  6240. init: function (defaults, columnDefaults, locales) {
  6241. defaults = defaults ? defaults : {};
  6242. columnDefaults = columnDefaults ? columnDefaults : {};
  6243. locales = locales ? locales : {};
  6244. // 写入bootstrap-table默认配置
  6245. $.extend(true, $.fn.bootstrapTable.defaults, Table.defaults, defaults);
  6246. // 写入bootstrap-table column配置
  6247. $.extend($.fn.bootstrapTable.columnDefaults, Table.columnDefaults, columnDefaults);
  6248. // 写入bootstrap-table locale配置
  6249. $.extend($.fn.bootstrapTable.locales[Table.defaults.locale], {
  6250. formatAdvancedSearch: function () {
  6251. return __('Advanced search');
  6252. },
  6253. formatAdvancedSubmitButton: function () {
  6254. return __("Submit");
  6255. },
  6256. formatAdvancedResetButton: function () {
  6257. return __("Reset");
  6258. },
  6259. formatAdvancedCloseButton: function () {
  6260. return __("Close");
  6261. }
  6262. }, locales);
  6263. },
  6264. // 绑定事件
  6265. bindevent: function (table) {
  6266. //Bootstrap-table的父元素,包含table,toolbar,pagnation
  6267. var parenttable = table.closest('.bootstrap-table');
  6268. //Bootstrap-table配置
  6269. var options = table.bootstrapTable('getOptions');
  6270. //Bootstrap操作区
  6271. var toolbar = $(options.toolbar, parenttable);
  6272. //当刷新表格时
  6273. table.on('load-error.bs.table', function (status, res) {
  6274. Toastr.error(__('Unknown data format'));
  6275. });
  6276. //当刷新表格时
  6277. table.on('refresh.bs.table', function (e, settings, data) {
  6278. $(Table.config.refreshbtn, toolbar).find(".fa").addClass("fa-spin");
  6279. });
  6280. //当双击单元格时
  6281. table.on('dbl-click-row.bs.table', function (e, row, element, field) {
  6282. $(Table.config.editonebtn, element).trigger("click");
  6283. });
  6284. //当内容渲染完成后
  6285. table.on('post-body.bs.table', function (e, settings, json, xhr) {
  6286. $(Table.config.refreshbtn, toolbar).find(".fa").removeClass("fa-spin");
  6287. // 挺拽选择,需要重新绑定事件
  6288. require(['drag', 'drop'], function () {
  6289. $(Table.config.firsttd, table).drag("start", function (ev, dd) {
  6290. return $('<div class="selection" />').css('opacity', .65).appendTo(document.body);
  6291. }).drag(function (ev, dd) {
  6292. $(dd.proxy).css({
  6293. top: Math.min(ev.pageY, dd.startY),
  6294. left: Math.min(ev.pageX, dd.startX),
  6295. height: Math.abs(ev.pageY - dd.startY),
  6296. width: Math.abs(ev.pageX - dd.startX)
  6297. });
  6298. }).drag("end", function (ev, dd) {
  6299. $(dd.proxy).remove();
  6300. });
  6301. $(Table.config.firsttd, table).drop("start", function () {
  6302. Table.api.toggleattr(this);
  6303. }).drop(function () {
  6304. Table.api.toggleattr(this);
  6305. }).drop("end", function () {
  6306. Table.api.toggleattr(this);
  6307. });
  6308. $.drop({
  6309. multi: true
  6310. });
  6311. });
  6312. });
  6313. // 处理选中筛选框后按钮的状态统一变更
  6314. table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table', function () {
  6315. $(Table.config.disabledbtn, toolbar).toggleClass('disabled', !table.bootstrapTable('getSelections').length);
  6316. });
  6317. // 刷新按钮事件
  6318. $(toolbar).on('click', Table.config.refreshbtn, function () {
  6319. table.bootstrapTable('refresh');
  6320. });
  6321. // 添加按钮事件
  6322. $(toolbar).on('click', Table.config.addbtn, function () {
  6323. var ids = Table.api.selectedids(table);
  6324. Backend.api.open(options.extend.add_url + "/ids/" + ids.join(","), __('Add'));
  6325. });
  6326. // 编辑按钮事件
  6327. $(toolbar).on('click', Table.config.editbtn, function () {
  6328. var ids = Table.api.selectedids(table);
  6329. //循环弹出多个编辑框
  6330. $.each(ids, function (i, j) {
  6331. Backend.api.open(options.extend.edit_url + "/ids/" + j, __('Edit'));
  6332. });
  6333. });
  6334. // 批量操作按钮事件
  6335. $(toolbar).on('click', Table.config.multibtn, function () {
  6336. var ids = Table.api.selectedids(table);
  6337. Table.api.multi($(this).data("action"), ids, table, this);
  6338. });
  6339. // 批量删除按钮事件
  6340. $(toolbar).on('click', Table.config.delbtn, function () {
  6341. var that = this;
  6342. var ids = Table.api.selectedids(table);
  6343. var index = Backend.api.layer.confirm(
  6344. __('Are you sure you want to delete the %s selected item?', ids.length),
  6345. {icon: 3, title: __('Warning'), offset: 0, shadeClose: true},
  6346. function () {
  6347. Table.api.multi("del", ids, table, that);
  6348. Backend.api.layer.close(index);
  6349. }
  6350. );
  6351. });
  6352. // 拖拽排序
  6353. require(['dragsort'], function () {
  6354. //绑定拖动排序
  6355. $("tbody", table).dragsort({
  6356. itemSelector: 'tr',
  6357. dragSelector: "a.btn-dragsort",
  6358. dragEnd: function () {
  6359. var data = table.bootstrapTable('getData');
  6360. var current = data[parseInt($(this).data("index"))];
  6361. //改变的值和改变的ID集合
  6362. var ids = $.map($("tbody tr:visible", table), function (tr) {
  6363. return data[parseInt($(tr).data("index"))].id;
  6364. });
  6365. var changeid = current.id;
  6366. var pid = typeof current.pid != 'undefined' ? current.pid : '';
  6367. var options = {
  6368. url: table.bootstrapTable('getOptions').extend.dragsort_url,
  6369. data: {
  6370. ids: ids.join(','),
  6371. changeid: changeid,
  6372. pid: pid,
  6373. field: Table.config.dragsortfield,
  6374. orderway: table.bootstrapTable('getOptions').sortOrder,
  6375. table: table.bootstrapTable('getOptions').extend.table
  6376. }
  6377. };
  6378. Backend.api.ajax(options, function (data) {
  6379. Toastr.success(__('Operation completed'));
  6380. table.bootstrapTable('refresh');
  6381. });
  6382. },
  6383. placeHolderTemplate: ""
  6384. });
  6385. });
  6386. var id = table.attr("id");
  6387. Table.list[id] = table;
  6388. return table;
  6389. },
  6390. // 批量操作请求
  6391. multi: function (action, ids, table, element) {
  6392. var options = table.bootstrapTable('getOptions');
  6393. var url = action == "del" ? options.extend.del_url : options.extend.multi_url;
  6394. url = url + "/ids/" + ($.isArray(ids) ? ids.join(",") : ids);
  6395. var options = {url: url, data: {action: action, ids: ids, params: element ? $(element).data("params") : ''}};
  6396. Backend.api.ajax(options, function (data) {
  6397. Toastr.success(__('Operation completed'));
  6398. table.bootstrapTable('refresh');
  6399. });
  6400. },
  6401. // 单元格元素事件
  6402. events: {
  6403. operate: {
  6404. 'click .btn-editone': function (e, value, row, index) {
  6405. var options = $(this).closest('table').bootstrapTable('getOptions');
  6406. Backend.api.open(options.extend.edit_url + "/ids/" + row.id, __('Edit'));
  6407. },
  6408. 'click .btn-delone': function (e, value, row, index) {
  6409. var that = this;
  6410. var top = $(that).offset().top - $(window).scrollTop();
  6411. var left = $(that).offset().left - $(window).scrollLeft() - 260;
  6412. if (top + 154 > $(window).height()) {
  6413. top = top - 154;
  6414. }
  6415. if ($(window).width() < 480) {
  6416. top = left = undefined;
  6417. }
  6418. var index = Backend.api.layer.confirm(
  6419. __('Are you sure you want to delete this item?'),
  6420. {icon: 3, title: __('Warning'), offset: [top, left], shadeClose: true},
  6421. function () {
  6422. var table = $(that).closest('table');
  6423. Table.api.multi("del", row.id, table, that);
  6424. Backend.api.layer.close(index);
  6425. }
  6426. );
  6427. }
  6428. }
  6429. },
  6430. // 单元格数据格式化
  6431. formatter: {
  6432. icon: function (value, row, index) {
  6433. if (!value)
  6434. return '';
  6435. value = value.indexOf(" ") > -1 ? value : "fa fa-" + value;
  6436. //渲染fontawesome图标
  6437. return '<i class="' + value + '"></i> ' + value;
  6438. },
  6439. image: function (value, row, index) {
  6440. return '<img class="img-rounded img-sm" src="' + (value.indexOf("http") === 0 ? '' : Config.upload.cdnurl) + value + '" />';
  6441. },
  6442. status: function (value, row, index, custom) {
  6443. //颜色状态数组,可使用red/yellow/aqua/blue/navy/teal/olive/lime/fuchsia/purple/maroon
  6444. var colorArr = {normal: 'success', hidden: 'grey', deleted: 'danger', locked: 'info'};
  6445. //如果有自定义状态,可以按需传入
  6446. if (typeof custom !== 'undefined') {
  6447. colorArr = $.extend(colorArr, custom);
  6448. }
  6449. var color = value && typeof colorArr[value] !== 'undefined' ? colorArr[value] : 'primary';
  6450. value = value[0].toUpperCase() + value.substr(1);
  6451. //渲染状态
  6452. var html = '<span class="text-' + color + '"><i class="fa fa-circle"></i> ' + __(value) + '</span>';
  6453. return html;
  6454. },
  6455. url: function (value, row, index) {
  6456. return '<a href="' + value + '" target="_blank" class="label bg-green">' + value + '</a>';
  6457. },
  6458. flag: function (value, row, index) {
  6459. var flagstext = __('Flags');
  6460. var flagscolor = {t: 'red', i: 'blue', r: 'green', h: 'yellow'};
  6461. if (!value)
  6462. return value;
  6463. //渲染Flag
  6464. var html = [];
  6465. var arr = value.split(',');
  6466. arr.forEach(function (value) {
  6467. html.push('<span class="label bg-' + (typeof flagscolor[value] != 'undefined' ? flagscolor[value] : 'primary') + '">' + (typeof flagstext[value] !== 'undefined' ? flagstext[value] : '') + '</span>');
  6468. });
  6469. return html.join(' ');
  6470. },
  6471. datetime: function (value, row, index) {
  6472. return value ? Moment(parseInt(value) * 1000).format("YYYY-MM-DD HH:mm:ss") : __('None');
  6473. },
  6474. operate: function (value, row, index, table) {
  6475. var showweigh = true;
  6476. var showedit = true;
  6477. var showdel = true;
  6478. if (typeof table != 'undefined') {
  6479. var options = table.bootstrapTable('getOptions');
  6480. if (options.extend.del_url == '')
  6481. showdel = false;
  6482. if (options.extend.edit_url == '')
  6483. showedit = false;
  6484. }
  6485. showweigh = typeof row[Table.config.dragsortfield] != 'undefined' ? true : false;
  6486. //行操作
  6487. var html = [];
  6488. if (showweigh)
  6489. html.push('<a href="javascript:;" class="btn btn-primary btn-dragsort btn-xs"><i class="fa fa-arrows"></i></a>');
  6490. if (showedit)
  6491. html.push('<a href="javascript:;" class="btn btn-success btn-editone btn-xs"><i class="fa fa-pencil"></i></a>');
  6492. if (showdel)
  6493. html.push('<a href="javascript:;" class="btn btn-danger btn-delone btn-xs"><i class="fa fa-trash"></i></a>');
  6494. return html.join(' ');
  6495. }
  6496. },
  6497. // 获取选中的条目ID集合
  6498. selectedids: function (table) {
  6499. return $.map(table.bootstrapTable('getSelections'), function (row) {
  6500. return row.id
  6501. });
  6502. },
  6503. // 切换复选框状态
  6504. toggleattr: function (table) {
  6505. $("input[type='checkbox']", table).trigger('click');
  6506. }
  6507. },
  6508. };
  6509. return Table;
  6510. });
  6511. /**
  6512. * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
  6513. * v1.5.1
  6514. *
  6515. * Copyright 2013, Moxiecode Systems AB
  6516. * Released under GPL License.
  6517. *
  6518. * License: http://www.plupload.com/license
  6519. * Contributing: http://www.plupload.com/contributing
  6520. *
  6521. * Date: 2016-11-14
  6522. */
  6523. !function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.moxie};"function"==typeof define&&define.amd?define("moxie",[],i):"object"==typeof module&&module.exports?module.exports=i():e.moxie=i()}(this||window,function(){!function(e,t){"use strict";function i(e,t){for(var i,n=[],r=0;r<e.length;++r){if(i=s[e[r]]||o(e[r]),!i)throw"module definition dependecy not found: "+e[r];n.push(i)}t.apply(null,n)}function n(e,n,r){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(n===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";i(n,function(){s[e]=r.apply(null,arguments)})}function r(e){return!!s[e]}function o(t){for(var i=e,n=t.split(/[.\/]/),r=0;r<n.length;++r){if(!i[n[r]])return;i=i[n[r]]}return i}function a(i){for(var n=0;n<i.length;n++){for(var r=e,o=i[n],a=o.split(/[.\/]/),u=0;u<a.length-1;++u)r[a[u]]===t&&(r[a[u]]={}),r=r[a[u]];r[a[a.length-1]]=s[o]}}var s={};n("moxie/core/utils/Basic",[],function(){function e(e){var t;return e===t?"undefined":null===e?"null":e.nodeType?"node":{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()}function t(){return n(!1,arguments)}function i(){return n(!0,arguments)}function n(t,i){var r,a=i[0];return o(i,function(i,s){s>0&&o(i,function(i,o){return i===r||t&&a[o]===r?!0:(e(a[o])===e(i)&&-1!==c(e(i),["array","object"])?n(t,[a[o],i]):a[o]=i,void 0)})}),a}function r(e,t){function i(){this.constructor=e}for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__parent__=t.prototype,e}function o(e,t){var i,n,r,o;if(e){try{i=e.length}catch(a){i=o}if(i===o||"number"!=typeof i){for(n in e)if(e.hasOwnProperty(n)&&t(e[n],n)===!1)return}else for(r=0;i>r;r++)if(t(e[r],r)===!1)return}}function a(t){var i;if(!t||"object"!==e(t))return!0;for(i in t)return!1;return!0}function s(t,i){function n(r){"function"===e(t[r])&&t[r](function(e){++r<o&&!e?n(r):i(e)})}var r=0,o=t.length;"function"!==e(i)&&(i=function(){}),t&&t.length||i(),n(r)}function u(e,t){var i=0,n=e.length,r=new Array(n);o(e,function(e,o){e(function(e){if(e)return t(e);var a=[].slice.call(arguments);a.shift(),r[o]=a,i++,i===n&&(r.unshift(null),t.apply(this,r))})})}function c(e,t){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e);for(var i=0,n=t.length;n>i;i++)if(t[i]===e)return i}return-1}function l(t,i){var n=[];"array"!==e(t)&&(t=[t]),"array"!==e(i)&&(i=[i]);for(var r in t)-1===c(t[r],i)&&n.push(t[r]);return n.length?n:!1}function d(e,t){var i=[];return o(e,function(e){-1!==c(e,t)&&i.push(e)}),i.length?i:null}function m(e){var t,i=[];for(t=0;t<e.length;t++)i[t]=e[t];return i}function h(e){return e?String.prototype.trim?String.prototype.trim.call(e):e.toString().replace(/^\s*/,"").replace(/\s*$/,""):e}function f(e){if("string"!=typeof e)return e;var t,i={t:1099511627776,g:1073741824,m:1048576,k:1024};return e=/^([0-9\.]+)([tmgk]?)$/.exec(e.toLowerCase().replace(/[^0-9\.tmkg]/g,"")),t=e[2],e=+e[1],i.hasOwnProperty(t)&&(e*=i[t]),Math.floor(e)}function p(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e(t)?t:""})}function g(e,t){var i=this;setTimeout(function(){e.call(i)},t||1)}var x=function(){var e=0;return function(t){var i,n=(new Date).getTime().toString(32);for(i=0;5>i;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}();return{guid:x,typeOf:e,extend:t,extendIf:i,inherit:r,each:o,isEmptyObj:a,inSeries:s,inParallel:u,inArray:c,arrayDiff:l,arrayIntersect:d,toArray:m,trim:h,sprintf:p,parseSizeStr:f,delay:g}}),n("moxie/core/utils/Encode",[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},i=function(e,i){if("function"==typeof window.atob)return i?t(window.atob(e)):window.atob(e);var n,r,o,a,s,u,c,l,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,h=0,f="",p=[];if(!e)return e;e+="";do a=d.indexOf(e.charAt(m++)),s=d.indexOf(e.charAt(m++)),u=d.indexOf(e.charAt(m++)),c=d.indexOf(e.charAt(m++)),l=a<<18|s<<12|u<<6|c,n=255&l>>16,r=255&l>>8,o=255&l,p[h++]=64==u?String.fromCharCode(n):64==c?String.fromCharCode(n,r):String.fromCharCode(n,r,o);while(m<e.length);return f=p.join(""),i?t(f):f},n=function(t,i){if(i&&(t=e(t)),"function"==typeof window.btoa)return window.btoa(t);var n,r,o,a,s,u,c,l,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,h=0,f="",p=[];if(!t)return t;do n=t.charCodeAt(m++),r=t.charCodeAt(m++),o=t.charCodeAt(m++),l=n<<16|r<<8|o,a=63&l>>18,s=63&l>>12,u=63&l>>6,c=63&l,p[h++]=d.charAt(a)+d.charAt(s)+d.charAt(u)+d.charAt(c);while(m<t.length);f=p.join("");var g=t.length%3;return(g?f.slice(0,g-3):f)+"===".slice(g||3)};return{utf8_encode:e,utf8_decode:t,atob:i,btoa:n}}),n("moxie/core/utils/Env",["moxie/core/utils/Basic"],function(e){function t(e,t,i){var n=0,r=0,o=0,a={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},s=function(e){return e=(""+e).replace(/[_\-+]/g,"."),e=e.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,"."),e.length?e.split("."):[-8]},u=function(e){return e?isNaN(e)?a[e]||-7:parseInt(e,10):0};for(e=s(e),t=s(t),r=Math.max(e.length,t.length),n=0;r>n;n++)if(e[n]!=t[n]){if(e[n]=u(e[n]),t[n]=u(t[n]),e[n]<t[n]){o=-1;break}if(e[n]>t[n]){o=1;break}}if(!i)return o;switch(i){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var i=function(e){var t="",i="?",n="function",r="undefined",o="object",a="name",s="version",u={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},c={rgx:function(){for(var t,i,a,s,u,c,l,d=0,m=arguments;d<m.length;d+=2){var h=m[d],f=m[d+1];if(typeof t===r){t={};for(s in f)u=f[s],typeof u===o?t[u[0]]=e:t[u]=e}for(i=a=0;i<h.length;i++)if(c=h[i].exec(this.getUA())){for(s=0;s<f.length;s++)l=c[++a],u=f[s],typeof u===o&&u.length>0?2==u.length?t[u[0]]=typeof u[1]==n?u[1].call(this,l):u[1]:3==u.length?t[u[0]]=typeof u[1]!==n||u[1].exec&&u[1].test?l?l.replace(u[1],u[2]):e:l?u[1].call(this,l,u[2]):e:4==u.length&&(t[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):e):t[u]=l?l:e;break}if(c)break}return t},str:function(t,n){for(var r in n)if(typeof n[r]===o&&n[r].length>0){for(var a=0;a<n[r].length;a++)if(u.has(n[r][a],t))return r===i?e:r}else if(u.has(n[r],t))return r===i?e:r;return t}},l={browser:{oldsafari:{major:{1:["/8","/1","/3"],2:"/4","?":"/"},version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2000:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",RT:"ARM"}}}},d={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[a,s],[/\s(opr)\/([\w\.]+)/i],[[a,"Opera"],s],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i],[a,s],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[a,"IE"],s],[/(edge)\/((\d+)?[\w\.]+)/i],[a,s],[/(yabrowser)\/([\w\.]+)/i],[[a,"Yandex"],s],[/(comodo_dragon)\/([\w\.]+)/i],[[a,/_/g," "],s],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i],[a,s],[/(dolfin)\/([\w\.]+)/i],[[a,"Dolphin"],s],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[a,"Chrome"],s],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],[s,[a,"MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],[s,[a,"Android Browser"]],[/FBAV\/([\w\.]+);/i],[s,[a,"Facebook"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[s,[a,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[s,a],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[a,[s,c.str,l.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[a,s],[/(navigator|netscape)\/([\w\.-]+)/i],[[a,"Netscape"],s],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[a,s]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[s,[a,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[a,s],[/rv\:([\w\.]+).*(gecko)/i],[s,a]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[a,s],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[a,[s,c.str,l.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[a,"Windows"],[s,c.str,l.os.windows.version]],[/\((bb)(10);/i],[[a,"BlackBerry"],s],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[a,s],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[a,"Symbian"],s],[/\((series40);/i],[a],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[a,"Firefox OS"],s],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[a,s],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[a,"Chromium OS"],s],[/(sunos)\s?([\w\.]+\d)*/i],[[a,"Solaris"],s],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[a,s],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[a,"iOS"],[s,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[a,"Mac OS"],[s,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[a,s]]},m=function(e){var i=e||(window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:t);this.getBrowser=function(){return c.rgx.apply(this,d.browser)},this.getEngine=function(){return c.rgx.apply(this,d.engine)},this.getOS=function(){return c.rgx.apply(this,d.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS()}},this.getUA=function(){return i},this.setUA=function(e){return i=e,this},this.setUA(i)};return m}(),n=function(){var t={define_property:function(){return!1}(),create_canvas:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))}(),return_response_type:function(t){try{if(-1!==e.inArray(t,["","text","document"]))return!0;if(window.XMLHttpRequest){var i=new XMLHttpRequest;if(i.open("get","/"),"responseType"in i)return i.responseType=t,i.responseType!==t?!1:!0}}catch(n){}return!1},use_data_uri:function(){var e=new Image;return e.onload=function(){t.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return t.use_data_uri&&("IE"!==o.browser||o.version>=9)},use_data_uri_of:function(e){return t.use_data_uri&&33e3>e||t.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var e=document.createElement("input");return e.setAttribute("type","file"),!e.disabled}};return function(i){var n=[].slice.call(arguments);return n.shift(),"function"===e.typeOf(t[i])?t[i].apply(this,n):!!t[i]}}(),r=(new i).getResult(),o={can:n,uaParser:i,browser:r.browser.name,version:r.browser.version,os:r.os.name,osVersion:r.os.version,verComp:t,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return o.OS=o.os,o}),n("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(e){function t(e,t){var i;for(i in e)if(e[i]===t)return i;return null}return{RuntimeError:function(){function i(e,i){this.code=e,this.name=t(n,e),this.message=this.name+(i||": RuntimeError "+this.code)}var n={NOT_INIT_ERR:1,EXCEPTION_ERR:3,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(i,n),i.prototype=Error.prototype,i}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": ImageError "+this.code}var n={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3};return e.extend(i,n),i.prototype=Error.prototype,i}(),FileException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": FileException "+this.code}var n={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(i,n),i.prototype=Error.prototype,i}(),DOMException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": DOMException "+this.code}var n={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(i,n),i.prototype=Error.prototype,i}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),n("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},i=function(e,t){if(!e.className)return!1;var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return i.test(e.className)},n=function(e,t){i(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(i,function(e,t,i){return" "===t&&" "===i?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,i){function n(e){var t,i,n=0,r=0;return e&&(i=e.getBoundingClientRect(),t="CSS1Compat"===c.compatMode?c.documentElement:c.body,n=i.left+t.scrollLeft,r=i.top+t.scrollTop),{x:n,y:r}}var r,o,a,s=0,u=0,c=document;if(t=t,i=i||c.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!c.documentMode||c.documentMode<8))return o=n(t),a=n(i),{x:o.x-a.x,y:o.y-a.y};for(r=t;r&&r!=i&&r.nodeType;)s+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!=i&&r.nodeType;)s-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;return{x:s,y:u}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:i,addClass:n,removeClass:r,getStyle:o,getPos:a,getSize:s}}),n("moxie/core/EventTarget",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(e,t,i){function n(){this.uid=i.guid()}var r={};return i.extend(n.prototype,{init:function(){this.uid||(this.uid=i.guid("uid_"))},addEventListener:function(e,t,n,o){var a,s=this;return this.hasOwnProperty("uid")||(this.uid=i.guid("uid_")),e=i.trim(e),/\s/.test(e)?(i.each(e.split(/\s+/),function(e){s.addEventListener(e,t,n,o)}),void 0):(e=e.toLowerCase(),n=parseInt(n,10)||0,a=r[this.uid]&&r[this.uid][e]||[],a.push({fn:t,priority:n,scope:o||this}),r[this.uid]||(r[this.uid]={}),r[this.uid][e]=a,void 0)},hasEventListener:function(e){var t=e?r[this.uid]&&r[this.uid][e]:r[this.uid];return t?t:!1},removeEventListener:function(e,t){var n,o,a=this;if(e=e.toLowerCase(),/\s/.test(e))return i.each(e.split(/\s+/),function(e){a.removeEventListener(e,t)}),void 0;if(n=r[this.uid]&&r[this.uid][e]){if(t){for(o=n.length-1;o>=0;o--)if(n[o].fn===t){n.splice(o,1);break}}else n=[];n.length||(delete r[this.uid][e],i.isEmptyObj(r[this.uid])&&delete r[this.uid])}},removeAllEventListeners:function(){r[this.uid]&&delete r[this.uid]},dispatchEvent:function(e){var n,o,a,s,u,c={},l=!0;if("string"!==i.typeOf(e)){if(s=e,"string"!==i.typeOf(s.type))throw new t.EventException(t.EventException.UNSPECIFIED_EVENT_TYPE_ERR);e=s.type,s.total!==u&&s.loaded!==u&&(c.total=s.total,c.loaded=s.loaded),c.async=s.async||!1}if(-1!==e.indexOf("::")?function(t){n=t[0],e=t[1]}(e.split("::")):n=this.uid,e=e.toLowerCase(),o=r[n]&&r[n][e]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),c.type=e,a.unshift(c);var d=[];i.each(o,function(e){a[0].target=e.scope,c.async?d.push(function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}):d.push(function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&i.inSeries(d,function(e){l=!e})}return l},bindOnce:function(e,t,i,n){var r=this;r.bind.call(this,e,function o(){return r.unbind(e,o),t.apply(this,arguments)},i,n)},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(e){var t=this;this.bind(e.join(" "),function(e){var t="on"+e.type.toLowerCase();"function"===i.typeOf(this[t])&&this[t].apply(this,arguments)}),i.each(e,function(e){e="on"+e.toLowerCase(e),"undefined"===i.typeOf(t[e])&&(t[e]=null)})}}),n.instance=new n,n}),n("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(e,t,i,n){function r(e,n,o,s,u){var c,l=this,d=t.guid(n+"_"),m=u||"browser";e=e||{},a[d]=this,o=t.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},o),e.preferred_caps&&(m=r.getMode(s,e.preferred_caps,m)),c=function(){var e={};return{exec:function(t,i,n,r){return c[i]&&(e[t]||(e[t]={context:this,instance:new c[i]}),e[t].instance[n])?e[t].instance[n].apply(this,r):void 0},removeInstance:function(t){delete e[t]},removeAllInstances:function(){var i=this;t.each(e,function(e,n){"function"===t.typeOf(e.instance.destroy)&&e.instance.destroy.call(e.context),i.removeInstance(n)})}}}(),t.extend(this,{initialized:!1,uid:d,type:n,mode:r.getMode(s,e.required_caps,m),shimid:d+"_container",clients:0,options:e,can:function(e,i){var n=arguments[2]||o;if("string"===t.typeOf(e)&&"undefined"===t.typeOf(i)&&(e=r.parseCaps(e)),"object"===t.typeOf(e)){for(var a in e)if(!this.can(a,e[a],n))return!1;return!0}return"function"===t.typeOf(n[e])?n[e].call(this,i):i===n[e]},getShimContainer:function(){var e,n=i.get(this.shimid);return n||(e=i.get(this.options.container)||document.body,n=document.createElement("div"),n.id=this.shimid,n.className="moxie-shim moxie-shim-"+this.type,t.extend(n.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),e.appendChild(n),e=null),n},getShim:function(){return c},shimExec:function(e,t){var i=[].slice.call(arguments,2);return l.getShim().exec.call(this,this.uid,e,t,i)},exec:function(e,t){var i=[].slice.call(arguments,2);return l[e]&&l[e][t]?l[e][t].apply(this,i):l.shimExec.apply(this,arguments)},destroy:function(){if(l){var e=i.get(this.shimid);e&&e.parentNode.removeChild(e),c&&c.removeAllInstances(),this.unbindAll(),delete a[this.uid],this.uid=null,d=l=c=e=null}}}),this.mode&&e.required_caps&&!this.can(e.required_caps)&&(this.mode=!1)}var o={},a={};return r.order="html5,flash,silverlight,html4",r.getRuntime=function(e){return a[e]?a[e]:!1},r.addConstructor=function(e,t){t.prototype=n.instance,o[e]=t},r.getConstructor=function(e){return o[e]||null},r.getInfo=function(e){var t=r.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},r.parseCaps=function(e){var i={};return"string"!==t.typeOf(e)?e||{}:(t.each(e.split(","),function(e){i[e]=!0}),i)},r.can=function(e,t){var i,n,o=r.getConstructor(e);return o?(i=new o({required_caps:t}),n=i.mode,i.destroy(),!!n):!1},r.thatCan=function(e,t){var i=(t||r.order).split(/\s*,\s*/);for(var n in i)if(r.can(i[n],e))return i[n];return null},r.getMode=function(e,i,n){var r=null;if("undefined"===t.typeOf(n)&&(n="browser"),i&&!t.isEmptyObj(e)){if(t.each(i,function(i,n){if(e.hasOwnProperty(n)){var o=e[n](i);if("string"==typeof o&&(o=[o]),r){if(!(r=t.arrayIntersect(r,o)))return r=!1}else r=o}}),r)return-1!==t.inArray(n,r)?n:r[0];if(r===!1)return!1}return n},r.capTrue=function(){return!0},r.capFalse=function(){return!1},r.capTest=function(e){return function(){return!!e}},r}),n("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(e,t,i,n){return function(){var e;i.extend(this,{connectRuntime:function(r){function o(i){var a,u;return i.length?(a=i.shift().toLowerCase(),(u=n.getConstructor(a))?(e=new u(r),e.bind("Init",function(){e.initialized=!0,setTimeout(function(){e.clients++,s.ruid=e.uid,s.trigger("RuntimeInit",e)},1)}),e.bind("Error",function(){e.destroy(),o(i)}),e.bind("Exception",function(e,i){var n=i.name+"(#"+i.code+")"+(i.message?", from: "+i.message:"");s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.EXCEPTION_ERR,n))}),e.mode?(e.init(),void 0):(e.trigger("Error"),void 0)):(o(i),void 0)):(s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)),e=null,void 0)}var a,s=this;if("string"===i.typeOf(r)?a=r:"string"===i.typeOf(r.ruid)&&(a=r.ruid),a){if(e=n.getRuntime(a))return s.ruid=a,e.clients++,e;throw new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||n.order).split(/\s*,\s*/))},disconnectRuntime:function(){e&&--e.clients<=0&&e.destroy(),e=null},getRuntime:function(){return e&&e.uid?e:e=null},exec:function(){return e?e.exec.apply(this,arguments):null},can:function(t){return e?e.can(t):!1}})}}),n("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(e,t,i){function n(o,a){function s(t,i,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new n(null,{type:o,size:i-t}),a.detach(s.substr(t,a.size)),a):null}i.call(this),o&&this.connectRuntime(o),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,i){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,i)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){if(this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),e=e||"","data:"==e.substr(0,5)){var i=e.indexOf(";base64,");this.type=e.substring(5,i),e=t.atob(e.substring(i+8))}this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return n}),n("moxie/core/I18n",["moxie/core/utils/Basic"],function(e){var t={};return{addI18n:function(i){return e.extend(t,i)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),n("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(e,t){var i="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",n={mimes:{},extensions:{},addMimeType:function(e){var t,i,n,r=e.split(/,/);for(t=0;t<r.length;t+=2){for(n=r[t+1].split(/ /),i=0;i<n.length;i++)this.mimes[n[i]]=r[t];this.extensions[r[t]]=n}},extList2mimes:function(t,i){var n,r,o,a,s=this,u=[];for(r=0;r<t.length;r++)for(n=t[r].extensions.split(/\s*,\s*/),o=0;o<n.length;o++){if("*"===n[o])return[];if(a=s.mimes[n[o]],a&&-1===e.inArray(a,u)&&u.push(a),i&&/^\w+$/.test(n[o]))u.push("."+n[o]);else if(!a)return[]}return u},mimes2exts:function(t){var i=this,n=[];return e.each(t,function(t){if("*"===t)return n=[],!1;var r=t.match(/^(\w+)\/(\*|\w+)$/);r&&("*"===r[2]?e.each(i.extensions,function(e,t){new RegExp("^"+r[1]+"/").test(t)&&[].push.apply(n,i.extensions[t])}):i.extensions[t]&&[].push.apply(n,i.extensions[t]))}),n},mimes2extList:function(i){var n=[],r=[];return"string"===e.typeOf(i)&&(i=e.trim(i).split(/\s*,\s*/)),r=this.mimes2exts(i),n.push({title:t.translate("Files"),extensions:r.length?r.join(","):"*"}),n.mimes=i,n},getFileExtension:function(e){var t=e&&e.match(/\.([^.]+)$/);return t?t[1].toLowerCase():""},getFileMime:function(e){return this.mimes[this.getFileExtension(e)]||""}};return n.addMimeType(i),n}),n("moxie/file/FileInput",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/I18n","moxie/runtime/Runtime","moxie/runtime/RuntimeClient"],function(e,t,i,n,r,o,a,s,u){function c(t){var o,c,d;if(-1!==e.inArray(e.typeOf(t),["string","node"])&&(t={browse_button:t}),c=n.get(t.browse_button),!c)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR);d={accept:[{title:a.translate("All Files"),extensions:"*"}],multiple:!1,required_caps:!1,container:c.parentNode||document.body},t=e.extend({},d,t),"string"==typeof t.required_caps&&(t.required_caps=s.parseCaps(t.required_caps)),"string"==typeof t.accept&&(t.accept=i.mimes2extList(t.accept)),o=n.get(t.container),o||(o=document.body),"static"===n.getStyle(o,"position")&&(o.style.position="relative"),o=c=null,u.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,shimid:null,files:null,init:function(){var i=this;i.bind("RuntimeInit",function(r,o){i.ruid=o.uid,i.shimid=o.shimid,i.bind("Ready",function(){i.trigger("Refresh")},999),i.bind("Refresh",function(){var i,r,a,s,u;a=n.get(t.browse_button),s=n.get(o.shimid),a&&(i=n.getPos(a,n.get(t.container)),r=n.getSize(a),u=parseInt(n.getStyle(a,"z-index"),10)||0,s&&e.extend(s.style,{top:i.y+"px",left:i.x+"px",width:r.w+"px",height:r.h+"px",zIndex:u+1})),s=a=null}),o.exec.call(i,"FileInput","init",t)}),i.connectRuntime(e.extend({},t,{required_caps:{select_file:!0}}))},getOption:function(e){return t[e]},setOption:function(e,n){if(t.hasOwnProperty(e)){var o=t[e];switch(e){case"accept":"string"==typeof n&&(n=i.mimes2extList(n));break;case"container":case"required_caps":throw new r.FileException(r.FileException.NO_MODIFICATION_ALLOWED_ERR)}t[e]=n,this.exec("FileInput","setOption",e,n),this.trigger("OptionChanged",e,n,o)}},disable:function(t){var i=this.getRuntime();i&&this.exec("FileInput","disable","undefined"===e.typeOf(t)?!0:t)},refresh:function(){this.trigger("Refresh")},destroy:function(){var t=this.getRuntime();t&&(t.exec.call(this,"FileInput","destroy"),this.disconnectRuntime()),"array"===e.typeOf(this.files)&&e.each(this.files,function(e){e.destroy()}),this.files=null,this.unbindAll()}}),this.handleEventProps(l)}var l=["ready","change","cancel","mouseenter","mouseleave","mousedown","mouseup"];return c.prototype=o.instance,c}),n("moxie/file/File",["moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/file/Blob"],function(e,t,i){function n(n,r){r||(r={}),i.apply(this,arguments),this.type||(this.type=t.getFileMime(r.name));var o;if(r.name)o=r.name.replace(/\\/g,"/"),o=o.substr(o.lastIndexOf("/")+1);else if(this.type){var a=this.type.split("/")[0];o=e.guid((""!==a?a:"file")+"_"),t.extensions[this.type]&&(o+="."+t.extensions[this.type][0])}e.extend(this,{name:o||e.guid("file_"),relativePath:"",lastModifiedDate:r.lastModifiedDate||(new Date).toLocaleString()})}return n.prototype=i.prototype,n}),n("moxie/file/FileDrop",["moxie/core/I18n","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/core/utils/Env","moxie/file/File","moxie/runtime/RuntimeClient","moxie/core/EventTarget","moxie/core/utils/Mime"],function(e,t,i,n,r,o,a,s,u){function c(i){var r,o=this;"string"==typeof i&&(i={drop_zone:i}),r={accept:[{title:e.translate("All Files"),extensions:"*"}],required_caps:{drag_and_drop:!0}},i="object"==typeof i?n.extend({},r,i):r,i.container=t.get(i.drop_zone)||document.body,"static"===t.getStyle(i.container,"position")&&(i.container.style.position="relative"),"string"==typeof i.accept&&(i.accept=u.mimes2extList(i.accept)),a.call(o),n.extend(o,{uid:n.guid("uid_"),ruid:null,files:null,init:function(){o.bind("RuntimeInit",function(e,t){o.ruid=t.uid,t.exec.call(o,"FileDrop","init",i),o.dispatchEvent("ready")}),o.connectRuntime(i)},destroy:function(){var e=this.getRuntime();e&&(e.exec.call(this,"FileDrop","destroy"),this.disconnectRuntime()),this.files=null,this.unbindAll()}}),this.handleEventProps(l)}var l=["ready","dragenter","dragleave","drop","error"];return c.prototype=s.instance,c}),n("moxie/file/FileReader",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/Exceptions","moxie/core/EventTarget","moxie/file/Blob","moxie/runtime/RuntimeClient"],function(e,t,i,n,r,o){function a(){function n(e,n){if(this.trigger("loadstart"),this.readyState===a.LOADING)return this.trigger("error",new i.DOMException(i.DOMException.INVALID_STATE_ERR)),this.trigger("loadend"),void 0;if(!(n instanceof r))return this.trigger("error",new i.DOMException(i.DOMException.NOT_FOUND_ERR)),this.trigger("loadend"),void 0;
  6524. if(this.result=null,this.readyState=a.LOADING,n.isDetached()){var o=n.getSource();switch(e){case"readAsText":case"readAsBinaryString":this.result=o;break;case"readAsDataURL":this.result="data:"+n.type+";base64,"+t.btoa(o)}this.readyState=a.DONE,this.trigger("load"),this.trigger("loadend")}else this.connectRuntime(n.ruid),this.exec("FileReader","read",e,n)}o.call(this),e.extend(this,{uid:e.guid("uid_"),readyState:a.EMPTY,result:null,error:null,readAsBinaryString:function(e){n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){n.call(this,"readAsDataURL",e)},readAsText:function(e){n.call(this,"readAsText",e)},abort:function(){this.result=null,-1===e.inArray(this.readyState,[a.EMPTY,a.DONE])&&(this.readyState===a.LOADING&&(this.readyState=a.DONE),this.exec("FileReader","abort"),this.trigger("abort"),this.trigger("loadend"))},destroy:function(){this.abort(),this.exec("FileReader","destroy"),this.disconnectRuntime(),this.unbindAll()}}),this.handleEventProps(s),this.bind("Error",function(e,t){this.readyState=a.DONE,this.error=t},999),this.bind("Load",function(){this.readyState=a.DONE},999)}var s=["loadstart","progress","load","abort","error","loadend"];return a.EMPTY=0,a.LOADING=1,a.DONE=2,a.prototype=n.instance,a}),n("moxie/core/utils/Url",[],function(){var e=function(t,i){for(var n=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],r=n.length,o={http:80,https:443},a={},s=/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,u=s.exec(t||"");r--;)u[r]&&(a[n[r]]=u[r]);if(!a.scheme){i&&"string"!=typeof i||(i=e(i||document.location.href)),a.scheme=i.scheme,a.host=i.host,a.port=i.port;var c="";/^[^\/]/.test(a.path)&&(c=i.path,c=/\/[^\/]*\.[^\/]*$/.test(c)?c.replace(/\/[^\/]+$/,"/"):c.replace(/\/?$/,"/")),a.path=c+(a.path||"")}return a.port||(a.port=o[a.scheme]||80),a.port=parseInt(a.port,10),a.path||(a.path="/"),delete a.source,a},t=function(t){var i={http:80,https:443},n="object"==typeof t?t:e(t);return n.scheme+"://"+n.host+(n.port!==i[n.scheme]?":"+n.port:"")+n.path+(n.query?n.query:"")},i=function(t){function i(e){return[e.scheme,e.host,e.port].join("/")}return"string"==typeof t&&(t=e(t)),i(e())===i(t)};return{parseUrl:e,resolveUrl:t,hasSameOrigin:i}}),n("moxie/runtime/RuntimeTarget",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i){function n(){this.uid=e.guid("uid_"),t.call(this),this.destroy=function(){this.disconnectRuntime(),this.unbindAll()}}return n.prototype=i.instance,n}),n("moxie/file/FileReaderSync",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/utils/Encode"],function(e,t,i){return function(){function n(e,t){if(!t.isDetached()){var n=this.connectRuntime(t.ruid).exec.call(this,"FileReaderSync","read",e,t);return this.disconnectRuntime(),n}var r=t.getSource();switch(e){case"readAsBinaryString":return r;case"readAsDataURL":return"data:"+t.type+";base64,"+i.btoa(r);case"readAsText":for(var o="",a=0,s=r.length;s>a;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return n.call(this,"readAsDataURL",e)},readAsText:function(e){return n.call(this,"readAsText",e)}})}}),n("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(e,t,i){function n(){var e,n=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof i?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):n.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(i){t.each(n,function(e){i(e.value,e.name)}),e&&i(e.value,e.name)},destroy:function(){e=null,n=[]}})}return n}),n("moxie/xhr/XMLHttpRequest",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/Runtime","moxie/runtime/RuntimeTarget","moxie/file/Blob","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/core/utils/Env","moxie/core/utils/Mime"],function(e,t,i,n,r,o,a,s,u,c,l,d){function m(){this.uid=e.guid("uid_")}function h(){function i(e,t){return I.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?I[e]:A[e]:(l.can("define_property")?I[e]=t:A[e]=t,void 0):void 0}function u(t){function n(){R&&(R.destroy(),R=null),s.dispatchEvent("loadend"),s=null}function r(r){R.bind("LoadStart",function(e){i("readyState",h.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),L&&s.upload.dispatchEvent(e)}),R.bind("Progress",function(e){i("readyState")!==h.LOADING&&(i("readyState",h.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),R.bind("UploadProgress",function(e){L&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),R.bind("Load",function(t){i("readyState",h.DONE),i("status",Number(r.exec.call(R,"XMLHttpRequest","getStatus")||0)),i("statusText",f[i("status")]||""),i("response",r.exec.call(R,"XMLHttpRequest","getResponse",i("responseType"))),~e.inArray(i("responseType"),["text",""])?i("responseText",i("response")):"document"===i("responseType")&&i("responseXML",i("response")),U=r.exec.call(R,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),i("status")>0?(L&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(F=!0,s.dispatchEvent("error")),n()}),R.bind("Abort",function(e){s.dispatchEvent(e),n()}),R.bind("Error",function(e){F=!0,i("readyState",h.DONE),s.dispatchEvent("readystatechange"),M=!0,s.dispatchEvent(e),n()}),r.exec.call(R,"XMLHttpRequest","send",{url:x,method:v,async:T,user:y,password:w,headers:S,mimeType:D,encoding:O,responseType:s.responseType,withCredentials:s.withCredentials,options:k},t)}var s=this;E=(new Date).getTime(),R=new a,"string"==typeof k.required_caps&&(k.required_caps=o.parseCaps(k.required_caps)),k.required_caps=e.extend({},k.required_caps,{return_response_type:s.responseType}),t instanceof c&&(k.required_caps.send_multipart=!0),e.isEmptyObj(S)||(k.required_caps.send_custom_headers=!0),B||(k.required_caps.do_cors=!0),k.ruid?r(R.connectRuntime(k)):(R.bind("RuntimeInit",function(e,t){r(t)}),R.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),R.connectRuntime(k))}function g(){i("responseText",""),i("responseXML",null),i("response",null),i("status",0),i("statusText",""),E=b=null}var x,v,y,w,E,b,R,_,A=this,I={timeout:0,readyState:h.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},T=!0,S={},O=null,D=null,N=!1,C=!1,L=!1,M=!1,F=!1,B=!1,P=null,H=null,k={},U="";e.extend(this,I,{uid:e.guid("uid_"),upload:new m,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||n.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(v=o.toUpperCase()),~e.inArray(v,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=n.utf8_encode(a),l=r.parseUrl(a),B=r.hasSameOrigin(l),x=r.resolveUrl(a),(u||c)&&!B)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(y=u||l.user,w=c||l.pass,T=s||!0,T===!1&&(i("timeout")||i("withCredentials")||""!==i("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);N=!T,C=!1,S={},g.call(this),i("readyState",h.OPENED),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(i("readyState")!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||n.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),~e.inArray(r,a)||/^(proxy\-|sec\-)/.test(r)?!1:(S[r]?S[r]+=", "+o:S[r]=o,!0)},getAllResponseHeaders:function(){return U||""},getResponseHeader:function(t){return t=t.toLowerCase(),F||~e.inArray(t,["set-cookie","set-cookie2"])?null:U&&""!==U&&(_||(_={},e.each(U.split(/\r\n/),function(t){var i=t.split(/:\s+/);2===i.length&&(i[0]=e.trim(i[0]),_[i[0].toLowerCase()]={header:i[0],value:e.trim(i[1])})})),_.hasOwnProperty(t))?_[t].header+": "+_[t].value:null},overrideMimeType:function(n){var r,o;if(~e.inArray(i("readyState"),[h.LOADING,h.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n=e.trim(n.toLowerCase()),/;/.test(n)&&(r=n.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(n=r[1],r[2]&&(o=r[2])),!d.mimes[n])throw new t.DOMException(t.DOMException.SYNTAX_ERR);P=n,H=o},send:function(i,r){if(k="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.readyState!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i instanceof s)k.ruid=i.ruid,D=i.type||"application/octet-stream";else if(i instanceof c){if(i.hasBlob()){var o=i.getBlob();k.ruid=o.ruid,D=o.type||"application/octet-stream"}}else"string"==typeof i&&(O="UTF-8",D="text/plain;charset=UTF-8",i=n.utf8_encode(i));this.withCredentials||(this.withCredentials=k.required_caps&&k.required_caps.send_browser_cookies&&!B),L=!N&&this.upload.hasEventListener(),F=!1,M=!i,N||(C=!0),u.call(this,i)},abort:function(){if(F=!0,N=!1,~e.inArray(i("readyState"),[h.UNSENT,h.OPENED,h.DONE]))i("readyState",h.UNSENT);else{if(i("readyState",h.DONE),C=!1,!R)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);R.getRuntime().exec.call(R,"XMLHttpRequest","abort",M),M=!0}},destroy:function(){R&&("function"===e.typeOf(R.destroy)&&R.destroy(),R=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}}),this.handleEventProps(p.concat(["readystatechange"])),this.upload.handleEventProps(p)}var f={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};m.prototype=i.instance;var p=["loadstart","progress","abort","error","load","timeout","loadend"];return h.UNSENT=0,h.OPENED=1,h.HEADERS_RECEIVED=2,h.LOADING=3,h.DONE=4,h.prototype=i.instance,h}),n("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i,n){function r(){function n(){l=d=0,c=this.result=null}function o(t,i){var n=this;u=i,n.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(n.state,[r.IDLE,r.DONE])&&a.call(n)},999),n.bind("TransportingComplete",function(){d=l,n.state=r.DONE,c=null,n.result=u.exec.call(n,"Transporter","getAsBlob",t||"")},999),n.state=r.BUSY,n.trigger("TransportingStarted"),a.call(n)}function a(){var e,i=this,n=l-d;m>n&&(m=n),e=t.btoa(c.substr(d,m)),u.exec.call(i,"Transporter","receive",e,l)}var s,u,c,l,d,m;i.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,i,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),m=r.chunk_size,n.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,i,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,i,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),n.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),n.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=n.instance,r}),n("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(e,t,i,n,r,o,a,s,u,c,l,d,m){function h(){function n(e){e||(e=this.exec("Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name)}function c(t){var n=e.typeOf(t);try{if(t instanceof h){if(!t.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);p.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new i.ImageError(i.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(n,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===n)"data:"===t.substr(0,5)?c.call(this,new l(null,{data:t}),arguments[1]):x.apply(this,arguments);else{if("node"!==n||"img"!==t.nodeName.toLowerCase())throw new i.DOMException(i.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r.code)}}function p(t,i){var n=this.connectRuntime(t.ruid);this.ruid=n.uid,n.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(i)?!0:i)}function g(t,i){function n(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){n(t)}),i&&"string"==typeof i.required_caps&&(i.required_caps=o.parseCaps(i.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},i))):n(this.connectRuntime(t.ruid))}function x(e,t){var i,n=this;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){c.apply(this,arguments)},resize:function(t){var n,r,o=this,a={x:0,y:0,width:o.width,height:o.height},s=e.extendIf({width:o.width,height:o.height,type:o.type||"image/jpeg",quality:90,crop:!1,fit:!0,preserveHeaders:!0,resample:"default",multipass:!0},t);try{if(!o.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);if(o.width>h.MAX_RESIZE_WIDTH||o.height>h.MAX_RESIZE_HEIGHT)throw new i.ImageError(i.ImageError.MAX_RESOLUTION_ERR);if(n=o.meta&&o.meta.tiff&&o.meta.tiff.Orientation||1,-1!==e.inArray(n,[5,6,7,8])){var u=s.width;s.width=s.height,s.height=u}if(s.crop){switch(r=Math.max(s.width/o.width,s.height/o.height),t.fit?(a.width=Math.min(Math.ceil(s.width/r),o.width),a.height=Math.min(Math.ceil(s.height/r),o.height),r=s.width/a.width):(a.width=Math.min(s.width,o.width),a.height=Math.min(s.height,o.height),r=1),"boolean"==typeof s.crop&&(s.crop="cc"),s.crop.toLowerCase().replace(/_/,"-")){case"rb":case"right-bottom":a.x=o.width-a.width,a.y=o.height-a.height;break;case"cb":case"center-bottom":a.x=Math.floor((o.width-a.width)/2),a.y=o.height-a.height;break;case"lb":case"left-bottom":a.x=0,a.y=o.height-a.height;break;case"lt":case"left-top":a.x=0,a.y=0;break;case"ct":case"center-top":a.x=Math.floor((o.width-a.width)/2),a.y=0;break;case"rt":case"right-top":a.x=o.width-a.width,a.y=0;break;case"rc":case"right-center":case"right-middle":a.x=o.width-a.width,a.y=Math.floor((o.height-a.height)/2);break;case"lc":case"left-center":case"left-middle":a.x=0,a.y=Math.floor((o.height-a.height)/2);break;case"cc":case"center-center":case"center-middle":default:a.x=Math.floor((o.width-a.width)/2),a.y=Math.floor((o.height-a.height)/2)}a.x=Math.max(a.x,0),a.y=Math.max(a.y,0)}else r=Math.min(s.width/o.width,s.height/o.height);this.exec("Image","resize",a,r,s)}catch(c){o.trigger("error",c.code)}},downsize:function(t){var i,n={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:!1,preserveHeaders:!0,resample:"default"};i="object"==typeof t?e.extend(n,t):e.extend(n,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]}),this.resize(i)},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);var e=this.connectRuntime(this.ruid);return e.exec.call(this,"Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){var i=this.getAsDataURL(e,t);return m.atob(i.substring(i.indexOf("base64,")+7))},embed:function(n,r){function o(t,r){var o=this;if(u.can("create_canvas")){var l=o.getAsCanvas();if(l)return n.appendChild(l),l=null,o.destroy(),c.trigger("embedded"),void 0}var d=o.getAsDataURL(t,r);if(!d)throw new i.ImageError(i.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",d.length))n.innerHTML='<img src="'+d+'" width="'+o.width+'" height="'+o.height+'" />',o.destroy(),c.trigger("embedded");else{var h=new s;h.bind("TransportingComplete",function(){a=c.connectRuntime(this.result.ruid),c.bind("Embedded",function(){e.extend(a.getShimContainer().style,{top:"0px",left:"0px",width:o.width+"px",height:o.height+"px"}),a=null},999),a.exec.call(c,"ImageView","display",this.result.uid,width,height),o.destroy()}),h.transport(m.atob(d.substring(d.indexOf("base64,")+7)),t,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:n})}}var a,c=this,l=e.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90},r);try{if(!(n=t.get(n)))throw new i.DOMException(i.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT;var d=new h;return d.bind("Resize",function(){o.call(this,l.type,l.quality)}),d.bind("Load",function(){d.downsize(l)}),this.meta.thumb&&this.meta.thumb.width>=l.width&&this.meta.thumb.height>=l.height?d.load(this.meta.thumb.data):d.clone(this,!1),d}catch(f){this.trigger("error",f.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}}),this.handleEventProps(f),this.bind("Load Resize",function(){n.call(this)},999)}var f=["progress","load","error","resize","embedded"];return h.MAX_RESIZE_WIDTH=8192,h.MAX_RESIZE_HEIGHT=8192,h.prototype=c.instance,h}),n("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue,l=e.extend({access_binary:u(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return o.can("access_binary")&&!!s.Image},display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:u(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:u(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==n.browser||n.verComp(n.version,9,">"))}()),filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),return_response_headers:c,return_response_type:function(e){return"json"===e&&window.JSON?!0:n.can("return_response_type",e)},return_status_code:c,report_upload_progress:u(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return o.can("access_binary")&&n.can("create_canvas")},select_file:function(){return n.can("use_fileinput")&&window.File},select_folder:function(){return o.can("select_file")&&("Chrome"===n.browser&&n.verComp(n.version,21,">=")||"Firefox"===n.browser&&n.verComp(n.version,42,">="))},select_multiple:function(){return!(!o.can("select_file")||"Safari"===n.browser&&"Windows"===n.os||"iOS"===n.os&&n.verComp(n.osVersion,"7.0.0",">")&&n.verComp(n.osVersion,"8.0.0","<"))},send_binary_string:u(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:u(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||o.can("send_binary_string")},slice_blob:u(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return o.can("slice_blob")&&o.can("send_multipart")},summon_file_dialog:function(){return o.can("select_file")&&("Firefox"===n.browser&&n.verComp(n.version,4,">=")||"Opera"===n.browser&&n.verComp(n.version,12,">=")||"IE"===n.browser&&n.verComp(n.version,10,">=")||!!~e.inArray(n.browser,["Chrome","Safari","Edge"]))},upload_filesize:c,use_http_method:c},arguments[2]);i.call(this,t,arguments[1]||a,l),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html5",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){function i(){function e(e,t,i){var n;if(!window.File.prototype.slice)return(n=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?n.call(e,t,i):null;try{return e.slice(),e.slice(t,i)}catch(r){return e.slice(t,i-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))}}return e.Blob=i}),n("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(e){function t(){this.returnValue=!1}function i(){this.cancelBubble=!0}var n={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=i,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),n.hasOwnProperty(o[r])||(n[o[r]]={}),l=n[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,i,o){var a,s;if(i=i.toLowerCase(),t[r]&&n[t[r]]&&n[t[r]][i]){a=n[t[r]][i];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(i,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+i,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete n[t[r]][i],e.isEmptyObj(n[t[r]])){delete n[t[r]];try{delete t[r]}catch(c){t[r]=s}}}},s=function(t,i){t&&t[r]&&e.each(n[t[r]],function(e,n){a(t,n,i)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),n("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){var e,s;i.extend(this,{init:function(u){var c,l,d,m,h,f,p=this,g=p.getRuntime();e=u,d=e.accept.mimes||o.extList2mimes(e.accept,g.can("filter_by_extension")),l=g.getShimContainer(),l.innerHTML='<input id="'+g.uid+'" type="file" style="font-size:999px;opacity:0;"'+(e.multiple&&g.can("select_multiple")?"multiple":"")+(e.directory&&g.can("select_folder")?"webkitdirectory directory":"")+(d?' accept="'+d.join(",")+'"':"")+" />",c=n.get(g.uid),i.extend(c.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),m=n.get(e.browse_button),s=n.getStyle(m,"z-index")||"auto",g.can("summon_file_dialog")&&("static"===n.getStyle(m,"position")&&(m.style.position="relative"),r.addEvent(m,"click",function(e){var t=n.get(g.uid);t&&!t.disabled&&t.click(),e.preventDefault()},p.uid),p.bind("Refresh",function(){h=parseInt(s,10)||1,n.get(e.browse_button).style.zIndex=h,this.getRuntime().getShimContainer().style.zIndex=h-1})),f=g.can("summon_file_dialog")?m:l,r.addEvent(f,"mouseover",function(){p.trigger("mouseenter")},p.uid),r.addEvent(f,"mouseout",function(){p.trigger("mouseleave")},p.uid),r.addEvent(f,"mousedown",function(){p.trigger("mousedown")},p.uid),r.addEvent(n.get(e.container),"mouseup",function(){p.trigger("mouseup")},p.uid),c.onchange=function x(){if(p.files=[],i.each(this.files,function(i){var n="";return e.directory&&"."==i.name?!0:(i.webkitRelativePath&&(n="/"+i.webkitRelativePath.replace(/^\//,"")),i=new t(g.uid,i),i.relativePath=n,p.files.push(i),void 0)}),"IE"!==a.browser&&"IEMobile"!==a.browser)this.value="";else{var n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=x}p.files.length&&p.trigger("change")},p.trigger({type:"ready",async:!0}),l=null},setOption:function(e,t){var i=this.getRuntime(),r=n.get(i.uid);switch(e){case"accept":if(t){var a=t.mimes||o.extList2mimes(t,i.can("filter_by_extension"));r.setAttribute("accept",a.join(","))}else r.removeAttribute("accept");break;case"directory":t&&i.can("select_folder")?(r.setAttribute("directory",""),r.setAttribute("webkitdirectory","")):(r.removeAttribute("directory"),r.removeAttribute("webkitdirectory"));break;case"multiple":t&&i.can("select_multiple")?r.setAttribute("multiple",""):r.removeAttribute("multiple")}},disable:function(e){var t,i=this.getRuntime();(t=n.get(i.uid))&&(t.disabled=!!e)},destroy:function(){var t=this.getRuntime(),i=t.getShim(),o=t.getShimContainer(),a=e&&n.get(e.container),u=e&&n.get(e.browse_button);a&&r.removeAllEvents(a,this.uid),u&&(r.removeAllEvents(u,this.uid),u.style.zIndex=s),o&&(r.removeAllEvents(o,this.uid),o.innerHTML=""),i.removeInstance(this.uid),e=o=a=u=i=null}})}return e.FileInput=s}),n("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,t,i,n,r,o){function a(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var t=i.toArray(e.dataTransfer.types||[]);return-1!==i.inArray("Files",t)||-1!==i.inArray("public.file-url",t)||-1!==i.inArray("application/x-moz-file",t)}function a(e,i){if(u(e)){var n=new t(f,e);n.relativePath=i||"",p.push(n)}}function s(e){for(var t=[],n=0;n<e.length;n++)[].push.apply(t,e[n].extensions.split(/\s*,\s*/));return-1===i.inArray("*",t)?t:[]}function u(e){if(!g.length)return!0;var t=o.getFileExtension(e.name);return!t||-1!==i.inArray(t,g)}function c(e,t){var n=[];i.each(e,function(e){var t=e.webkitGetAsEntry();t&&(t.isFile?a(e.getAsFile(),t.fullPath):n.push(t))}),n.length?l(n,t):t()}function l(e,t){var n=[];i.each(e,function(e){n.push(function(t){d(e,t)})}),i.inSeries(n,function(){t()})}function d(e,t){e.isFile?e.file(function(i){a(i,e.fullPath),t()},function(){t()}):e.isDirectory?m(e,t):t()}function m(e,t){function i(e){r.readEntries(function(t){t.length?([].push.apply(n,t),i(e)):e()},e)}var n=[],r=e.createReader();i(function(){l(n,t)})}var h,f,p=[],g=[];i.extend(this,{init:function(t){var n,o=this;h=t,f=o.ruid,g=s(h.accept),n=h.container,r.addEvent(n,"dragover",function(t){e(t)&&(t.preventDefault(),t.dataTransfer.dropEffect="copy")},o.uid),r.addEvent(n,"drop",function(t){e(t)&&(t.preventDefault(),p=[],t.dataTransfer.items&&t.dataTransfer.items[0].webkitGetAsEntry?c(t.dataTransfer.items,function(){o.files=p,o.trigger("drop")}):(i.each(t.dataTransfer.files,function(e){a(e)}),o.files=p,o.trigger("drop")))},o.uid),r.addEvent(n,"dragenter",function(){o.trigger("dragenter")},o.uid),r.addEvent(n,"dragleave",function(){o.trigger("dragleave")},o.uid)},destroy:function(){r.removeAllEvents(h&&n.get(h.container),this.uid),f=p=g=h=null}})}return e.FileDrop=a}),n("moxie/runtime/html5/file/FileReader",["moxie/runtime/html5/Runtime","moxie/core/utils/Encode","moxie/core/utils/Basic"],function(e,t,i){function n(){function e(e){return t.atob(e.substring(e.indexOf("base64,")+7))}var n,r=!1;i.extend(this,{read:function(t,o){var a=this;a.result="",n=new window.FileReader,n.addEventListener("progress",function(e){a.trigger(e)}),n.addEventListener("load",function(t){a.result=r?e(n.result):n.result,a.trigger(t)}),n.addEventListener("error",function(e){a.trigger(e,n.error)}),n.addEventListener("loadend",function(e){n=null,a.trigger(e)}),"function"===i.typeOf(n[t])?(r=!1,n[t](o.getSource())):"readAsBinaryString"===t&&(r=!0,n.readAsDataURL(o.getSource()))},abort:function(){n&&n.abort()},destroy:function(){n=null}})}return e.FileReader=n}),n("moxie/runtime/html5/xhr/XMLHttpRequest",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/core/utils/Url","moxie/file/File","moxie/file/Blob","moxie/xhr/FormData","moxie/core/Exceptions","moxie/core/utils/Env"],function(e,t,i,n,r,o,a,s,u){function c(){function e(e,t){var i,n,r=this;i=t.getBlob().getSource(),n=new window.FileReader,n.onload=function(){t.append(t.getBlobName(),new o(null,{type:i.type,data:n.result})),f.send.call(r,e,t)},n.readAsBinaryString(i)}function c(){return!window.XMLHttpRequest||"IE"===u.browser&&u.verComp(u.version,8,"<")?function(){for(var e=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],t=0;t<e.length;t++)try{return new ActiveXObject(e[t])}catch(i){}}():new window.XMLHttpRequest}function l(e){var t=e.responseXML,i=e.responseText;return"IE"===u.browser&&i&&t&&!t.documentElement&&/[^\/]+\/[^\+]+\+xml/.test(e.getResponseHeader("Content-Type"))&&(t=new window.ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.validateOnParse=!1,t.loadXML(i)),t&&("IE"===u.browser&&0!==t.parseError||!t.documentElement||"parsererror"===t.documentElement.tagName)?null:t}function d(e){var t="----moxieboundary"+(new Date).getTime(),i="--",n="\r\n",r="",a=this.getRuntime();if(!a.can("send_binary_string"))throw new s.RuntimeError(s.RuntimeError.NOT_SUPPORTED_ERR);return m.setRequestHeader("Content-Type","multipart/form-data; boundary="+t),e.each(function(e,a){r+=e instanceof o?i+t+n+'Content-Disposition: form-data; name="'+a+'"; filename="'+unescape(encodeURIComponent(e.name||"blob"))+'"'+n+"Content-Type: "+(e.type||"application/octet-stream")+n+n+e.getSource()+n:i+t+n+'Content-Disposition: form-data; name="'+a+'"'+n+n+unescape(encodeURIComponent(e))+n}),r+=i+t+i+n}var m,h,f=this;t.extend(this,{send:function(i,r){var s=this,l="Mozilla"===u.browser&&u.verComp(u.version,4,">=")&&u.verComp(u.version,7,"<"),f="Android Browser"===u.browser,p=!1;if(h=i.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),m=c(),m.open(i.method,i.url,i.async,i.user,i.password),r instanceof o)r.isDetached()&&(p=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),p=!0;else if((l||f)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return e.call(s,i,r),void 0;if(r instanceof a){var g=new window.FormData;
  6525. r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}m.upload?(i.withCredentials&&(m.withCredentials=!0),m.addEventListener("load",function(e){s.trigger(e)}),m.addEventListener("error",function(e){s.trigger(e)}),m.addEventListener("progress",function(e){s.trigger(e)}),m.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):m.onreadystatechange=function(){switch(m.readyState){case 1:break;case 2:break;case 3:var e,t;try{n.hasSameOrigin(i.url)&&(e=m.getResponseHeader("Content-Length")||0),m.responseText&&(t=m.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:m.onreadystatechange=function(){},0===m.status?s.trigger("error"):s.trigger("load")}},t.isEmptyObj(i.headers)||t.each(i.headers,function(e,t){m.setRequestHeader(t,e)}),""!==i.responseType&&"responseType"in m&&(m.responseType="json"!==i.responseType||u.can("return_response_type","json")?i.responseType:"text"),p?m.sendAsBinary?m.sendAsBinary(r):function(){for(var e=new Uint8Array(r.length),t=0;t<r.length;t++)e[t]=255&r.charCodeAt(t);m.send(e.buffer)}():m.send(r),s.trigger("loadstart")},getStatus:function(){try{if(m)return m.status}catch(e){}return 0},getResponse:function(e){var t=this.getRuntime();try{switch(e){case"blob":var n=new r(t.uid,m.response),o=m.getResponseHeader("Content-Disposition");if(o){var a=o.match(/filename=([\'\"'])([^\1]+)\1/);a&&(h=a[2])}return n.name=h,n.type||(n.type=i.getFileMime(h)),n;case"json":return u.can("return_response_type","json")?m.response:200===m.status&&window.JSON?JSON.parse(m.responseText):null;case"document":return l(m);default:return""!==m.responseText?m.responseText:null}}catch(s){return null}},getAllResponseHeaders:function(){try{return m.getAllResponseHeaders()}catch(e){}return""},abort:function(){m&&m.abort()},destroy:function(){f=h=null}})}return e.XMLHttpRequest=c}),n("moxie/runtime/html5/utils/BinaryReader",["moxie/core/utils/Basic"],function(e){function t(e){e instanceof ArrayBuffer?i.apply(this,arguments):n.apply(this,arguments)}function i(t){var i=new DataView(t);e.extend(this,{readByteAt:function(e){return i.getUint8(e)},writeByteAt:function(e,t){i.setUint8(e,t)},SEGMENT:function(e,n,r){switch(arguments.length){case 2:return t.slice(e,e+n);case 1:return t.slice(e);case 3:if(null===r&&(r=new ArrayBuffer),r instanceof ArrayBuffer){var o=new Uint8Array(this.length()-n+r.byteLength);e>0&&o.set(new Uint8Array(t.slice(0,e)),0),o.set(new Uint8Array(r),e),o.set(new Uint8Array(t.slice(e+n)),e+r.byteLength),this.clear(),t=o.buffer,i=new DataView(t);break}default:return t}},length:function(){return t?t.byteLength:0},clear:function(){i=t=null}})}function n(t){function i(e,i,n){n=3===arguments.length?n:t.length-i-1,t=t.substr(0,i)+e+t.substr(n+i)}e.extend(this,{readByteAt:function(e){return t.charCodeAt(e)},writeByteAt:function(e,t){i(String.fromCharCode(t),e,1)},SEGMENT:function(e,n,r){switch(arguments.length){case 1:return t.substr(e);case 2:return t.substr(e,n);case 3:i(null!==r?r:"",e,n);break;default:return t}},length:function(){return t?t.length:0},clear:function(){t=null}})}return e.extend(t.prototype,{littleEndian:!1,read:function(e,t){var i,n,r;if(e+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),r=0,i=0;t>r;r++)i|=this.readByteAt(e+r)<<Math.abs(n+8*r);return i},write:function(e,t,i){var n,r;if(e>this.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;i>r;r++)this.writeByteAt(e+r,255&t>>Math.abs(n+8*r))},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){var t=this.read(e,4);return t>2147483647?t-4294967296:t},CHAR:function(e){return String.fromCharCode(this.read(e,1))},STRING:function(e,t){return this.asArray("CHAR",e,t).join("")},asArray:function(e,t,i){for(var n=[],r=0;i>r;r++)n[r]=this[e](t+r);return n}}),t}),n("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,t){return function i(n){var r,o,a,s=[],u=0;if(r=new e(n),65496!==r.SHORT(0))throw r.clear(),new t.ImageError(t.ImageError.WRONG_FORMAT);for(o=2;o<=r.length();)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;u=r.SHORT(o+2)+2,a>=65505&&65519>=a&&s.push({hex:a,name:"APP"+(15&a),start:o,length:u,segment:r.SEGMENT(o,u)}),o+=u}return r.clear(),{headers:s,restore:function(t){var i,n,r;for(r=new e(t),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,i=s.length;i>n;n++)r.SEGMENT(o,0,s[n].segment),o+=s[n].length;return t=r.SEGMENT(),r.clear(),t},strip:function(t){var n,r,o,a;for(o=new i(t),r=o.headers,o.purge(),n=new e(t),a=r.length;a--;)n.SEGMENT(r[a].start,r[a].length,"");return t=n.SEGMENT(),n.clear(),t},get:function(e){for(var t=[],i=0,n=s.length;n>i;i++)s[i].name===e.toUpperCase()&&t.push(s[i].segment);return t},set:function(e,t){var i,n,r,o=[];for("string"==typeof t?o.push(t):o=t,i=n=0,r=s.length;r>i&&(s[i].name===e.toUpperCase()&&(s[i].segment=o[n],s[i].length=o[n].length,n++),!(n>=o.length));i++);},purge:function(){this.headers=s=[]}}}}),n("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,i,n){function r(o){function a(i,r){var o,a,s,u,c,m,h,f,p=this,g=[],x={},v={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},y={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};for(o=p.SHORT(i),a=0;o>a;a++)if(g=[],h=i+2+12*a,s=r[p.SHORT(h)],s!==t){if(u=v[p.SHORT(h+=2)],c=p.LONG(h+=2),m=y[u],!m)throw new n.ImageError(n.ImageError.INVALID_META_ERR);if(h+=4,m*c>4&&(h=p.LONG(h)+d.tiffHeader),h+m*c>=this.length())throw new n.ImageError(n.ImageError.INVALID_META_ERR);"ASCII"!==u?(g=p.asArray(u,h,c),f=1==c?g[0]:g,x[s]=l.hasOwnProperty(s)&&"object"!=typeof f?l[s][f]:f):x[s]=e.trim(p.STRING(h,c).replace(/\0$/,""))}return x}function s(e,t,i){var n,r,o,a=0;if("string"==typeof t){var s=c[e.toLowerCase()];for(var u in s)if(s[u]===t){t=u;break}}n=d[e.toLowerCase()+"IFD"],r=this.SHORT(n);for(var l=0;r>l;l++)if(o=n+12*l+2,this.SHORT(o)==t){a=o+8;break}if(!a)return!1;try{this.write(a,i,4)}catch(m){return!1}return!0}var u,c,l,d,m,h;if(i.call(this,o),c={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},l={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},d={tiffHeader:10},m=d.tiffHeader,u={clear:this.clear},e.extend(this,{read:function(){try{return r.prototype.read.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},write:function(){try{return r.prototype.write.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return h||null},EXIF:function(){var t=null;if(d.exifIFD){try{t=a.call(this,d.exifIFD,c.exif)}catch(i){return null}if(t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n<t.ExifVersion.length;n++)r+=String.fromCharCode(t.ExifVersion[n]);t.ExifVersion=r}}return t},GPS:function(){var t=null;if(d.gpsIFD){try{t=a.call(this,d.gpsIFD,c.gps)}catch(i){return null}t.GPSVersionID&&"array"===e.typeOf(t.GPSVersionID)&&(t.GPSVersionID=t.GPSVersionID.join("."))}return t},thumb:function(){if(d.IFD1)try{var e=a.call(this,d.IFD1,c.thumb);if("JPEGInterchangeFormat"in e)return this.SEGMENT(d.tiffHeader+e.JPEGInterchangeFormat,e.JPEGInterchangeFormatLength)}catch(t){}return null},setExif:function(e,t){return"PixelXDimension"!==e&&"PixelYDimension"!==e?!1:s.call(this,"exif",e,t)},clear:function(){u.clear(),o=c=l=h=d=u=null}}),65505!==this.SHORT(0)||"EXIF\0"!==this.STRING(4,5).toUpperCase())throw new n.ImageError(n.ImageError.INVALID_META_ERR);if(this.littleEndian=18761==this.SHORT(m),42!==this.SHORT(m+=2))throw new n.ImageError(n.ImageError.INVALID_META_ERR);d.IFD0=d.tiffHeader+this.LONG(m+=2),h=a.call(this,d.IFD0,c.tiff),"ExifIFDPointer"in h&&(d.exifIFD=d.tiffHeader+h.ExifIFDPointer,delete h.ExifIFDPointer),"GPSInfoIFDPointer"in h&&(d.gpsIFD=d.tiffHeader+h.GPSInfoIFDPointer,delete h.GPSInfoIFDPointer),e.isEmptyObj(h)&&(h=null);var f=this.LONG(d.IFD0+12*this.SHORT(d.IFD0)+2);f&&(d.IFD1=d.tiffHeader+f)}return r.prototype=i.prototype,r}),n("moxie/runtime/html5/image/JPEG",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEGHeaders","moxie/runtime/html5/utils/BinaryReader","moxie/runtime/html5/image/ExifParser"],function(e,t,i,n,r){function o(o){function a(e){var t,i,n=0;for(e||(e=c);n<=e.length();){if(t=e.SHORT(n+=2),t>=65472&&65475>=t)return n+=5,{height:e.SHORT(n),width:e.SHORT(n+=2)};i=e.SHORT(n+=2),n+=i-2}return null}function s(){var e,t,i=d.thumb();return i&&(e=new n(i),t=a(e),e.clear(),t)?(t.data=i,t):null}function u(){d&&l&&c&&(d.clear(),l.purge(),c.clear(),m=l=d=c=null)}var c,l,d,m;if(c=new n(o),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new i(o);try{d=new r(l.get("app1")[0])}catch(h){}m=a.call(this),e.extend(this,{type:"image/jpeg",size:c.length(),width:m&&m.width||0,height:m&&m.height||0,setExif:function(t,i){return d?("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,i),l.set("app1",d.SEGMENT()),void 0):!1},writeHeaders:function(){return arguments.length?l.restore(arguments[0]):l.restore(o)},stripHeaders:function(e){return l.strip(e)},purge:function(){u.call(this)}}),d&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS(),thumb:s()})}return o}),n("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(e,t,i){function n(n){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:s.LONG(t),height:s.LONG(t+=4)}):null}function o(){s&&(s.clear(),n=l=u=c=s=null)}function a(e){var t,i,n,r;return t=s.LONG(e),i=s.STRING(e+=4,4),n=e+=4,r=s.LONG(e+t),{length:t,type:i,start:n,CRC:r}}var s,u,c,l;s=new i(n),function(){var t=0,i=0,n=[35152,20039,3338,6666];for(i=0;i<n.length;i++,t+=2)if(n[i]!=s.SHORT(t))throw new e.ImageError(e.ImageError.WRONG_FORMAT)}(),l=r.call(this),t.extend(this,{type:"image/png",size:s.length(),width:l.width,height:l.height,purge:function(){o.call(this)}}),o.call(this)}return n}),n("moxie/runtime/html5/image/ImageInfo",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEG","moxie/runtime/html5/image/PNG"],function(e,t,i,n){return function(r){var o,a=[i,n];o=function(){for(var e=0;e<a.length;e++)try{return new a[e](r)}catch(i){}throw new t.ImageError(t.ImageError.WRONG_FORMAT)}(),e.extend(this,{type:"",size:0,width:0,height:0,setExif:function(){},writeHeaders:function(e){return e},stripHeaders:function(e){return e},purge:function(){r=null}}),e.extend(this,o),this.purge=function(){o.purge(),o=null}}}),n("moxie/runtime/html5/image/ResizerCanvas",[],function(){function e(i,n){var r=i.width,o=Math.floor(r*n),a=!1;(.5>n||n>2)&&(n=.5>n?.5:2,a=!0);var s=t(i,n);return a?e(s,o/s.width):s}function t(e,t){var i=e.width,n=e.height,r=Math.floor(i*t),o=Math.floor(n*t),a=document.createElement("canvas");return a.width=r,a.height=o,a.getContext("2d").drawImage(e,0,0,i,n,0,0,r,o),e=null,a}return{scale:e}}),n("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/ResizerCanvas","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a,s,u){function c(){function e(){if(!v&&!g)throw new i.ImageError(i.DOMException.INVALID_STATE_ERR);return v||g}function c(){var t=e();return"canvas"==t.nodeName.toLowerCase()?t:(v=document.createElement("canvas"),v.width=t.width,v.height=t.height,v.getContext("2d").drawImage(t,0,0),v)}function l(e){return n.atob(e.substring(e.indexOf("base64,")+7))}function d(e,t){return"data:"+(t||"")+";base64,"+n.btoa(e)}function m(e){var t=this;g=new Image,g.onerror=function(){p.call(this),t.trigger("error",i.ImageError.WRONG_FORMAT)},g.onload=function(){t.trigger("load")},g.src="data:"==e.substr(0,5)?e:d(e,w.type)}function h(e,t){var n,r=this;return window.FileReader?(n=new FileReader,n.onload=function(){t(this.result)},n.onerror=function(){r.trigger("error",i.ImageError.WRONG_FORMAT)},n.readAsDataURL(e),void 0):t(e.getAsDataURL())}function f(e,i,n){t.inArray(n,[5,6,7,8])>-1&&(v.width=i,v.height=e);var r=v.getContext("2d");switch(n){case 2:r.translate(e,0),r.scale(-1,1);break;case 3:r.translate(e,i),r.rotate(Math.PI);break;case 4:r.translate(0,i),r.scale(1,-1);break;case 5:r.rotate(.5*Math.PI),r.scale(1,-1);break;case 6:r.rotate(.5*Math.PI),r.translate(0,-i);break;case 7:r.rotate(.5*Math.PI),r.translate(e,-i),r.scale(-1,1);break;case 8:r.rotate(-.5*Math.PI),r.translate(-e,0)}}function p(){x&&(x.purge(),x=null),g&&(g.src=""),y=g=v=w=null,b=!1}var g,x,v,y,w,E=this,b=!1,R=!0;t.extend(this,{loadFromBlob:function(e){var t=this,n=t.getRuntime(),r=arguments.length>1?arguments[1]:!0;if(!n.can("access_binary"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return w=e,e.isDetached()?(y=e.getSource(),m.call(this,y),void 0):(h.call(this,e.getSource(),function(e){r&&(y=l(e)),m.call(t,e)}),void 0)},loadFromImage:function(e,t){this.meta=e.meta,w=new o(null,{name:e.name,size:e.size,type:e.type}),m.call(this,t?y=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t,i=this.getRuntime();return!x&&y&&i.can("access_image_binary")&&(x=new a(y)),t={width:e().width||0,height:e().height||0,type:w.type||u.getFileMime(w.name),size:y&&y.length||w.size||0,name:w.name||"",meta:null},R&&(t.meta=x&&x.meta||this.meta||{},!t.meta||!t.meta.thumb||t.meta.thumb.data instanceof r||(t.meta.thumb.data=new r(null,{type:"image/jpeg",data:t.meta.thumb.data}))),t},resize:function(t,i,n){var r=document.createElement("canvas");if(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(e(),t.x,t.y,t.width,t.height,0,0,r.width,r.height),v=s.scale(r,i),R=n.preserveHeaders,!R){var o=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1;f(v.width,v.height,o)}this.width=v.width,this.height=v.height,b=!0,this.trigger("Resize")},getAsCanvas:function(){return v||(v=c()),v.id=this.uid+"_canvas",v},getAsBlob:function(e,t){return e!==this.type?(b=!0,new o(null,{name:w.name||"",type:e,data:E.getAsDataURL(e,t)})):new o(null,{name:w.name||"",type:e,data:E.getAsBinaryString(e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!b)return g.src;if(c(),"image/jpeg"!==e)return v.toDataURL("image/png");try{return v.toDataURL("image/jpeg",t/100)}catch(i){return v.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!b)return y||(y=l(E.getAsDataURL(e,t))),y;if("image/jpeg"!==e)y=l(E.getAsDataURL(e,t));else{var i;t||(t=90),c();try{i=v.toDataURL("image/jpeg",t/100)}catch(n){i=v.toDataURL("image/jpeg")}y=l(i),x&&(y=x.stripHeaders(y),R&&(x.meta&&x.meta.exif&&x.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),y=x.writeHeaders(y)),x.purge(),x=null)}return b=!1,y},destroy:function(){E=null,p.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),n("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function s(e){var n=i.get(e);n&&"OBJECT"==n.nodeName&&("IE"===t.browser?(n.style.display="none",function r(){4==n.readyState?u(e):setTimeout(r,10)}()):n.parentNode.removeChild(n))}function u(e){var t=i.get(e);if(t){for(var n in t)"function"==typeof t[n]&&(t[n]=null);t.parentNode.removeChild(t)}}function c(u){var c,m=this;u=e.extend({swf_url:t.swf_url},u),o.call(this,u,l,{access_binary:function(e){return e&&"browser"===m.mode},access_image_binary:function(e){return e&&"browser"===m.mode},display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===m.mode},resize_image:o.capTrue,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!e.arrayDiff(t,["","text","document"])||"browser"===m.mode},return_status_code:function(t){return"browser"===m.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:function(e){return e&&"browser"===m.mode},send_browser_cookies:function(e){return e&&"browser"===m.mode},send_custom_headers:function(e){return e&&"browser"===m.mode},send_multipart:o.capTrue,slice_blob:function(e){return e&&"browser"===m.mode},stream_upload:function(e){return e&&"browser"===m.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===m.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},slice_blob:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),a()<11.3&&(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid)},shimExec:function(e,t){var i=[].slice.call(arguments,2);return m.getShim().exec(this.uid,e,t,i)},init:function(){var i,r,o;o=this.getShimContainer(),e.extend(o.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),i='<object id="'+this.uid+'" type="application/x-shockwave-flash" data="'+u.swf_url+'" ',"IE"===t.browser&&(i+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '),i+='width="100%" height="100%" style="outline:0"><param name="movie" value="'+u.swf_url+'" />'+'<param name="flashvars" value="uid='+escape(this.uid)+"&target="+t.global_event_dispatcher+'" />'+'<param name="wmode" value="transparent" />'+'<param name="allowscriptaccess" value="always" />'+"</object>","IE"===t.browser?(r=document.createElement("div"),o.appendChild(r),r.outerHTML=i,r=o=null):o.innerHTML=i,c=setTimeout(function(){m&&!m.initialized&&m.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){s(m.uid),e.call(m),clearTimeout(c),u=c=e=m=null}}(this.destroy)},d)}var l="flash",d={};return o.addConstructor(l,c),d}),n("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={slice:function(e,i,n,r){var o=this.getRuntime();return 0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),e=o.shimExec.call(this,"Blob","slice",i,n,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=i}),n("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime","moxie/file/File","moxie/core/utils/Basic"],function(e,t,i){var n={init:function(e){var n=this,r=this.getRuntime();this.bind("Change",function(){var e=r.shimExec.call(n,"FileInput","getFiles");n.files=[],i.each(e,function(e){n.files.push(new t(r.uid,e))})},999),this.getRuntime().shimExec.call(this,"FileInput","init",{accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=n}),n("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n=this;return n.result="","readAsDataURL"===e&&(n.result="data:"+(t.type||"")+";base64,"),n.bind("Progress",function(t,r){r&&(n.result+=i(r,e))},999),n.getRuntime().shimExec.call(this,"FileReader","readAsBase64",t.uid)}};return e.FileReader=n}),n("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n,r=this.getRuntime();return(n=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(n="data:"+(t.type||"")+";base64,"+n),i(n,e,t.type)):null}};return e.FileReaderSync=n}),n("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={getAsBlob:function(e){var i=this.getRuntime(),n=i.shimExec.call(this,"Transporter","getAsBlob",e);return n?new t(i.uid,n):null}};return e.Transporter=i}),n("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/runtime/flash/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter","moxie/runtime/flash/runtime/Transporter"],function(e,t,i,n,r,o,a,s){var u={send:function(e,n){function r(){e.transport=l.mode,l.shimExec.call(c,"XMLHttpRequest","send",e,n)}function o(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),n=null,r()}function u(e,t){var i=new s;i.bind("TransportingComplete",function(){t(this.result)}),i.transport(e.getSource(),e.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),n instanceof a){var d;if(n.each(function(e,t){e instanceof i?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),n.hasBlob()){var m=n.getBlob();m.isDetached()?u(m,function(e){m.destroy(),o(d,e)}):o(d,m)}else n=null,r()}else n instanceof i?n.isDetached()?u(n,function(e){n.destroy(),n=e.uid,r()}):(n=n.uid,r()):r()},getResponse:function(e){var i,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new n(a.uid,o),"blob"===e)return o;try{if(i=new r,~t.inArray(e,["","text"]))return i.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(i.readAsText(o))}finally{o.destroy()}}return null},abort:function(){var e=this.getRuntime();e.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=u}),n("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(e,t,i,n,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(n,"Image","loadFromBlob",e.uid),n=r=null}var n=this,r=n.getRuntime();if(e.isDetached()){var o=new i;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getInfo:function(){var e=this.getRuntime(),t=e.shimExec.call(this,"Image","getInfo");return!t.meta||!t.meta.thumb||t.meta.thumb.data instanceof n||(t.meta.thumb.data=new n(e.uid,t.meta.thumb.data)),t},getAsBlob:function(e,t){var i=this.getRuntime(),r=i.shimExec.call(this,"Image","getAsBlob",e,t);return r?new n(i.uid,r):null},getAsDataURL:function(){var e,t=this.getRuntime(),i=t.Image.getAsBlob.apply(this,arguments);return i?(e=new r,e.readAsDataURL(i)):null}};return e.Image=o}),n("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(e){var t,i,n,r,o,a=!1,s=null,u=0;try{try{s=new ActiveXObject("AgControl.AgControl"),s.IsVersionSupported(e)&&(a=!0),s=null}catch(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(t=l.description,"1.0.30226.2"===t&&(t="2.0.30226.2"),i=t.split(".");i.length>3;)i.pop();for(;i.length<4;)i.push(0);for(n=e.split(".");n.length>4;)n.pop();do r=parseInt(n[u],10),o=parseInt(i[u],10),u++;while(u<n.length&&r===o);o>=r&&!isNaN(r)&&(a=!0)}}}catch(d){a=!1}return a}function s(s){var l,d=this;s=e.extend({xap_url:t.xap_url},s),o.call(this,s,u,{access_binary:o.capTrue,access_image_binary:o.capTrue,display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:o.capTrue,resize_image:o.capTrue,return_response_headers:function(e){return e&&"client"===d.mode},return_response_type:function(e){return"json"!==e?!0:!!window.JSON},return_status_code:function(t){return"client"===d.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:o.capTrue,send_browser_cookies:function(e){return e&&"browser"===d.mode},send_custom_headers:function(e){return e&&"client"===d.mode},send_multipart:o.capTrue,slice_blob:o.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:o.capTrue,use_http_method:function(t){return"client"===d.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),a("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid).content.Moxie},shimExec:function(e,t){var i=[].slice.call(arguments,2);return d.getShim().exec(this.uid,e,t,i)},init:function(){var e;e=this.getShimContainer(),e.innerHTML='<object id="'+this.uid+'" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;">'+'<param name="source" value="'+s.xap_url+'"/>'+'<param name="background" value="Transparent"/>'+'<param name="windowless" value="true"/>'+'<param name="enablehtmlaccess" value="true"/>'+'<param name="initParams" value="uid='+this.uid+",target="+t.global_event_dispatcher+'"/>'+"</object>",l=setTimeout(function(){d&&!d.initialized&&d.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(d),clearTimeout(l),s=l=e=d=null}}(this.destroy)},c)}var u="silverlight",c={};return o.addConstructor(u,s),c}),n("moxie/runtime/silverlight/file/Blob",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/Blob"],function(e,t,i){return e.Blob=t.extend({},i)}),n("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime","moxie/file/File","moxie/core/utils/Basic"],function(e,t,i){function n(e){for(var t="",i=0;i<e.length;i++)t+=(""!==t?"|":"")+e[i].title+" | *."+e[i].extensions.replace(/,/g,";*.");return t}var r={init:function(e){var r=this,o=this.getRuntime();this.bind("Change",function(){var e=o.shimExec.call(r,"FileInput","getFiles");r.files=[],i.each(e,function(e){r.files.push(new t(o.uid,e))})},999),o.shimExec.call(this,"FileInput","init",n(e.accept),e.multiple),this.trigger("ready")},setOption:function(e,t){"accept"==e&&(t=n(t)),this.getRuntime().shimExec.call(this,"FileInput","setOption",e,t)}};return e.FileInput=r}),n("moxie/runtime/silverlight/file/FileDrop",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Dom","moxie/core/utils/Events"],function(e,t,i){var n={init:function(){var e,n=this,r=n.getRuntime();return e=r.getShimContainer(),i.addEvent(e,"dragover",function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy"},n.uid),i.addEvent(e,"dragenter",function(e){e.preventDefault();var i=t.get(r.uid).dragEnter(e);i&&e.stopPropagation()},n.uid),i.addEvent(e,"drop",function(e){e.preventDefault();var i=t.get(r.uid).dragDrop(e);i&&e.stopPropagation()},n.uid),r.shimExec.call(this,"FileDrop","init")}};return e.FileDrop=n}),n("moxie/runtime/silverlight/file/FileReader",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/FileReader"],function(e,t,i){return e.FileReader=t.extend({},i)}),n("moxie/runtime/silverlight/file/FileReaderSync",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/FileReaderSync"],function(e,t,i){return e.FileReaderSync=t.extend({},i)}),n("moxie/runtime/silverlight/runtime/Transporter",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/runtime/Transporter"],function(e,t,i){return e.Transporter=t.extend({},i)
  6526. }),n("moxie/runtime/silverlight/xhr/XMLHttpRequest",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/xhr/XMLHttpRequest","moxie/runtime/silverlight/file/FileReaderSync","moxie/runtime/silverlight/runtime/Transporter"],function(e,t,i){return e.XMLHttpRequest=t.extend({},i)}),n("moxie/runtime/silverlight/image/Image",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/runtime/flash/image/Image"],function(e,t,i,n){return e.Image=t.extend({},n,{getInfo:function(){var e=this.getRuntime(),n=["tiff","exif","gps","thumb"],r={meta:{}},o=e.shimExec.call(this,"Image","getInfo");return o.meta&&(t.each(n,function(e){var t,i,n,a,s=o.meta[e];if(s&&s.keys)for(r.meta[e]={},i=0,n=s.keys.length;n>i;i++)t=s.keys[i],a=s[t],a&&(/^(\d|[1-9]\d+)$/.test(a)?a=parseInt(a,10):/^\d*\.\d+$/.test(a)&&(a=parseFloat(a)),r.meta[e][t]=a)}),!r.meta||!r.meta.thumb||r.meta.thumb.data instanceof i||(r.meta.thumb.data=new i(e.uid,r.meta.thumb.data))),r.width=parseInt(o.width,10),r.height=parseInt(o.height,10),r.size=parseInt(o.size,10),r.type=o.type,r.name=o.name,r},resize:function(e,t,i){this.getRuntime().shimExec.call(this,"Image","resize",e.x,e.y,e.width,e.height,t,i.preserveHeaders,i.resample)}})}),n("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue;i.call(this,t,a,{access_binary:u(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:!1,drag_and_drop:!1,filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),resize_image:function(){return s.Image&&o.can("access_binary")&&n.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return n.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return o.can("select_file")},summon_file_dialog:function(){return o.can("select_file")&&("Firefox"===n.browser&&n.verComp(n.version,4,">=")||"Opera"===n.browser&&n.verComp(n.version,12,">=")||"IE"===n.browser&&n.verComp(n.version,10,">=")||!!~e.inArray(n.browser,["Chrome","Safari"]))},upload_filesize:c,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html4",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){function e(){var o,c,d,m,h,f,p=this,g=p.getRuntime();f=i.guid("uid_"),o=g.getShimContainer(),s&&(d=n.get(s+"_form"),d&&i.extend(d.style,{top:"100%"})),m=document.createElement("form"),m.setAttribute("id",f+"_form"),m.setAttribute("method","post"),m.setAttribute("enctype","multipart/form-data"),m.setAttribute("encoding","multipart/form-data"),i.extend(m.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),h=document.createElement("input"),h.setAttribute("id",f),h.setAttribute("type","file"),h.setAttribute("accept",l.join(",")),i.extend(h.style,{fontSize:"999px",opacity:0}),m.appendChild(h),o.appendChild(m),i.extend(h.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===a.browser&&a.verComp(a.version,10,"<")&&i.extend(h.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),h.onchange=function(){var i;if(this.value){if(this.files){if(i=this.files[0],0===i.size)return m.parentNode.removeChild(m),void 0}else i={name:this.value};i=new t(g.uid,i),this.onchange=function(){},e.call(p),p.files=[i],h.setAttribute("id",i.uid),m.setAttribute("id",i.uid+"_form"),p.trigger("change"),h=m=null}},g.can("summon_file_dialog")&&(c=n.get(u.browse_button),r.removeEvent(c,"click",p.uid),r.addEvent(c,"click",function(e){h&&!h.disabled&&h.click(),e.preventDefault()},p.uid)),s=f,o=d=c=null}var s,u,c,l=[];i.extend(this,{init:function(t){var i,a=this,s=a.getRuntime();u=t,l=t.accept.mimes||o.extList2mimes(t.accept,s.can("filter_by_extension")),i=s.getShimContainer(),function(){var e,o,l;e=n.get(t.browse_button),c=n.getStyle(e,"z-index")||"auto",s.can("summon_file_dialog")&&("static"===n.getStyle(e,"position")&&(e.style.position="relative"),a.bind("Refresh",function(){o=parseInt(c,10)||1,n.get(u.browse_button).style.zIndex=o,this.getRuntime().getShimContainer().style.zIndex=o-1})),l=s.can("summon_file_dialog")?e:i,r.addEvent(l,"mouseover",function(){a.trigger("mouseenter")},a.uid),r.addEvent(l,"mouseout",function(){a.trigger("mouseleave")},a.uid),r.addEvent(l,"mousedown",function(){a.trigger("mousedown")},a.uid),r.addEvent(n.get(t.container),"mouseup",function(){a.trigger("mouseup")},a.uid),e=null}(),e.call(this),i=null,a.trigger({type:"ready",async:!0})},setOption:function(e,t){var i,r=this.getRuntime();"accept"==e&&(l=t.mimes||o.extList2mimes(t,r.can("filter_by_extension"))),i=n.get(s),i&&i.setAttribute("accept",l.join(","))},disable:function(e){var t;(t=n.get(s))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer(),o=u&&n.get(u.container),a=u&&n.get(u.browse_button);o&&r.removeAllEvents(o,this.uid),a&&(r.removeAllEvents(a,this.uid),a.style.zIndex=c),i&&(r.removeAllEvents(i,this.uid),i.innerHTML=""),t.removeInstance(this.uid),s=l=u=i=o=a=t=null}})}return e.FileInput=s}),n("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),n("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,t,i,n,r,o,a,s){function u(){function e(e){var t,n,r,a,s=this,u=!1;if(l){if(t=l.id.replace(/_iframe$/,""),n=i.get(t+"_form")){for(r=n.getElementsByTagName("input"),a=r.length;a--;)switch(r[a].getAttribute("type")){case"hidden":r[a].parentNode.removeChild(r[a]);break;case"file":u=!0}r=[],u||n.parentNode.removeChild(n),n=null}setTimeout(function(){o.removeEvent(l,"load",s.uid),l.parentNode&&l.parentNode.removeChild(l);var t=s.getRuntime().getShimContainer();t.children.length||t.parentNode.removeChild(t),t=l=null,e()},1)}}var u,c,l;t.extend(this,{send:function(d,m){function h(){var i=y.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='<iframe id="'+f+'_iframe" name="'+f+'_iframe" src="javascript:&quot;&quot;" style="display:none"></iframe>',l=r.firstChild,i.appendChild(l),o.addEvent(l,"load",function(){var i;try{i=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(i.title)?u=i.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(i.body.innerHTML),v.trigger({type:"progress",loaded:c.length,total:c.length}),x&&v.trigger({type:"uploadprogress",loaded:x.size||1025,total:x.size||1025}))}catch(r){if(!n.hasSameOrigin(d.url))return e.call(v,function(){v.trigger("error")}),void 0;u=404}e.call(v,function(){v.trigger("load")})},v.uid)}var f,p,g,x,v=this,y=v.getRuntime();if(u=c=null,m instanceof s&&m.hasBlob()){if(x=m.getBlob(),f=x.uid,g=i.get(f),p=i.get(f+"_form"),!p)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else f=t.guid("uid_"),p=document.createElement("form"),p.setAttribute("id",f+"_form"),p.setAttribute("method",d.method),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),y.getShimContainer().appendChild(p);p.setAttribute("target",f+"_iframe"),m instanceof s&&m.each(function(e,i){if(e instanceof a)g&&g.setAttribute("name",i);else{var n=document.createElement("input");t.extend(n,{type:"hidden",name:i,value:e}),g?p.insertBefore(n,g):p.appendChild(n)}}),p.setAttribute("action",d.url),h(),p.submit(),v.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*<pre[^>]*>/,"").replace(/<\/pre>\s*$/,""))}catch(i){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})}})}return e.XMLHttpRequest=u}),n("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),a(["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Dom","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/core/I18n","moxie/core/utils/Mime","moxie/file/FileInput","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events","moxie/runtime/html5/image/ResizerCanvas"])}(this)});
  6527. define("../libs/plupload/js/moxie.min", function(){});
  6528. /**
  6529. * Plupload - multi-runtime File Uploader
  6530. * v2.2.0
  6531. *
  6532. * Copyright 2013, Moxiecode Systems AB
  6533. * Released under GPL License.
  6534. *
  6535. * License: http://www.plupload.com/license
  6536. * Contributing: http://www.plupload.com/contributing
  6537. *
  6538. * Date: 2016-11-14
  6539. */
  6540. !function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.plupload};"function"==typeof define&&define.amd?define("plupload",["./moxie"],i):"object"==typeof module&&module.exports?module.exports=i(require("./moxie")):e.plupload=i(e.moxie)}(this||window,function(e){!function(e,t,i){function n(e){function t(e,t,i){var r={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};r[e]?n[r[e]]=t:i||(n[e]=t)}var i=e.required_features,n={};return"string"==typeof i?l.each(i.split(/\s*,\s*/),function(e){t(e,!0)}):"object"==typeof i?l.each(i,function(e,i){t(i,e)}):i===!0&&(e.chunk_size>0&&(n.slice_blob=!0),l.isEmptyObj(e.resize)&&e.multipart||(n.send_binary_string=!0),l.each(e,function(e,i){t(i,!!e,!0)})),n}var r=window.setTimeout,s={},a=t.core.utils,o=t.runtime.Runtime,l={VERSION:"2.2.0",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:a.Mime.mimes,ua:a.Env,typeOf:a.Basic.typeOf,extend:a.Basic.extend,guid:a.Basic.guid,getAll:function(e){var t,i=[];"array"!==l.typeOf(e)&&(e=[e]);for(var n=e.length;n--;)t=l.get(e[n]),t&&i.push(t);return i.length?i:null},get:a.Dom.get,each:a.Basic.each,getPos:a.Dom.getPos,getSize:a.Dom.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g;return e?(""+e).replace(i,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:a.Basic.toArray,inArray:a.Basic.inArray,inSeries:a.Basic.inSeries,addI18n:t.core.I18n.addI18n,translate:t.core.I18n.translate,sprintf:a.Basic.sprintf,isEmptyObj:a.Basic.isEmptyObj,hasClass:a.Dom.hasClass,addClass:a.Dom.addClass,removeClass:a.Dom.removeClass,getStyle:a.Dom.getStyle,addEvent:a.Events.addEvent,removeEvent:a.Events.removeEvent,removeAllEvents:a.Events.removeAllEvents,cleanName:function(e){var t,i;for(i=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],t=0;t<i.length;t+=2)e=e.replace(i[t],i[t+1]);return e=e.replace(/\s+/g,"_"),e=e.replace(/[^a-z0-9_\-\.]+/gi,"")},buildUrl:function(e,t){var i="";return l.each(t,function(e,t){i+=(i?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(e)}),i&&(e+=(e.indexOf("?")>0?"&":"?")+i),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===i||/\D/.test(e))return l.translate("N/A");var n=Math.pow(1024,4);return e>n?t(e/n,1)+" "+l.translate("tb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("gb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("mb"):e>1024?Math.round(e/1024)+" "+l.translate("kb"):e+" "+l.translate("b")},parseSize:a.Basic.parseSizeStr,predictRuntime:function(e,t){var i,n;return i=new l.Uploader(e),n=o.thatCan(i.getOption().required_features,t||e.runtimes),i.destroy(),n},addFileFilter:function(e,t){s[e]=t}};l.addFileFilter("mime_types",function(e,t,i){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:l.FILE_EXTENSION_ERROR,message:l.translate("File extension error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("max_file_size",function(e,t,i){var n;e=l.parseSize(e),t.size!==n&&e&&t.size>e?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("prevent_duplicates",function(e,t,i){if(e)for(var n=this.files.length;n--;)if(t.name===this.files[n].name&&t.size===this.files[n].size)return this.trigger("Error",{code:l.FILE_DUPLICATE_ERROR,message:l.translate("Duplicate file error."),file:t}),i(!1),void 0;i(!0)}),l.Uploader=function(e){function a(){var e,t,i=0;if(this.state==l.STARTED){for(t=0;t<T.length;t++)e||T[t].status!=l.QUEUED?i++:(e=T[t],this.trigger("BeforeUpload",e)&&(e.status=l.UPLOADING,this.trigger("UploadFile",e)));i==T.length&&(this.state!==l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged")),this.trigger("UploadComplete",T))}}function u(e){e.percent=e.size>0?Math.ceil(100*(e.loaded/e.size)):100,d()}function d(){var e,t;for(w.reset(),e=0;e<T.length;e++)t=T[e],t.size!==i?(w.size+=t.origSize,w.loaded+=t.loaded*t.origSize/t.size):w.size=i,t.status==l.DONE?w.uploaded++:t.status==l.FAILED?w.failed++:w.queued++;w.size===i?w.percent=T.length>0?Math.ceil(100*(w.uploaded/T.length)):0:(w.bytesPerSec=Math.ceil(w.loaded/((+new Date-S||1)/1e3)),w.percent=w.size>0?Math.ceil(100*(w.loaded/w.size)):0)}function c(){var e=A[0]||P[0];return e?e.getRuntime().uid:!1}function f(e,t){if(e.ruid){var i=o.getInfo(e.ruid);if(i)return i.can(t)}return!1}function p(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",y),this.bind("BeforeUpload",m),this.bind("UploadFile",E),this.bind("UploadProgress",v),this.bind("StateChanged",b),this.bind("QueueChanged",d),this.bind("Error",z),this.bind("FileUploaded",R),this.bind("Destroy",O)}function g(e,i){var n=this,r=0,s=[],a={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:F,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};l.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(a[t]=e[t])}),e.browse_button&&l.each(e.browse_button,function(i){s.push(function(s){var u=new t.file.FileInput(l.extend({},a,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:i}));u.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),r++,A.push(this),s()},u.onchange=function(){n.addFile(this.files)},u.bind("mouseenter mouseleave mousedown mouseup",function(t){U||(e.browse_button_hover&&("mouseenter"===t.type?l.addClass(i,e.browse_button_hover):"mouseleave"===t.type&&l.removeClass(i,e.browse_button_hover)),e.browse_button_active&&("mousedown"===t.type?l.addClass(i,e.browse_button_active):"mouseup"===t.type&&l.removeClass(i,e.browse_button_active)))}),u.bind("mousedown",function(){n.trigger("Browse")}),u.bind("error runtimeerror",function(){u=null,s()}),u.init()})}),e.drop_element&&l.each(e.drop_element,function(e){s.push(function(i){var s=new t.file.FileDrop(l.extend({},a,{drop_zone:e}));s.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),dragdrop:e.can("drag_and_drop")}),r++,P.push(this),i()},s.ondrop=function(){n.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,i()}),s.init()})}),l.inSeries(s,function(){"function"==typeof i&&i(r)})}function h(e,n,r){var s=new t.image.Image;try{s.onload=function(){return n.width>this.width&&n.height>this.height&&n.quality===i&&n.preserve_headers&&!n.crop?(this.destroy(),r(e)):(s.downsize(n.width,n.height,n.crop,n.preserve_headers),void 0)},s.onresize=function(){r(this.getAsBlob(e.type,n.quality)),this.destroy()},s.onerror=function(){r(e)},s.load(e)}catch(a){r(e)}}function _(e,i,r){function s(e,i,n){var r=I[e];switch(e){case"max_file_size":"max_file_size"===e&&(I.max_file_size=I.filters.max_file_size=i);break;case"chunk_size":(i=l.parseSize(i))&&(I[e]=i,I.send_file_name=!0);break;case"multipart":I[e]=i,i||(I.send_file_name=!0);break;case"unique_names":I[e]=i,i&&(I.send_file_name=!0);break;case"filters":"array"===l.typeOf(i)&&(i={mime_types:i}),n?l.extend(I.filters,i):I.filters=i,i.mime_types&&("string"===l.typeOf(i.mime_types)&&(i.mime_types=t.core.utils.Mime.mimes2extList(i.mime_types)),i.mime_types.regexp=function(e){var t=[];return l.each(e,function(e){l.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(i.mime_types),I.filters.mime_types=i.mime_types);break;case"resize":I.resize=i?l.extend({preserve_headers:!0,crop:!1},i):!1;break;case"prevent_duplicates":I.prevent_duplicates=I.filters.prevent_duplicates=!!i;break;case"container":case"browse_button":case"drop_element":i="container"===e?l.get(i):l.getAll(i);case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":I[e]=i,n||(u=!0);break;default:I[e]=i}n||a.trigger("OptionChanged",e,i,r)}var a=this,u=!1;"object"==typeof e?l.each(e,function(e,t){s(t,e,r)}):s(e,i,r),r?(I.required_features=n(l.extend({},I)),F=n(l.extend({},I,{required_features:!0}))):u&&(a.trigger("Destroy"),g.call(a,I,function(e){e?(a.runtime=o.getInfo(c()).type,a.trigger("Init",{runtime:a.runtime}),a.trigger("PostInit")):a.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}))}function m(e,t){if(e.settings.unique_names){var i=t.name.match(/\.([^.]+)$/),n="part";i&&(n=i[1]),t.target_name=t.id+"."+n}}function E(e,i){function n(){d-->0?r(s,1e3):(i.loaded=p,e.trigger("Error",{code:l.HTTP_ERROR,message:l.translate("HTTP Error."),file:i,response:D.responseText,status:D.status,responseHeaders:D.getAllResponseHeaders()}))}function s(){var f,g,h,_={};i.status===l.UPLOADING&&e.state!==l.STOPPED&&(e.settings.send_file_name&&(_.name=i.target_name||i.name),u&&c.chunks&&a.size>u?(h=Math.min(u,a.size-p),f=a.slice(p,p+h)):(h=a.size,f=a),u&&c.chunks&&(e.settings.send_chunk_number?(_.chunk=Math.ceil(p/u),_.chunks=Math.ceil(a.size/u)):(_.offset=p,_.total=a.size)),D=new t.xhr.XMLHttpRequest,D.upload&&(D.upload.onprogress=function(t){i.loaded=Math.min(i.size,p+t.loaded),e.trigger("UploadProgress",i)}),D.onload=function(){return D.status>=400?(n(),void 0):(d=e.settings.max_retries,h<a.size?(f.destroy(),p+=h,i.loaded=Math.min(p,a.size),e.trigger("ChunkUploaded",i,{offset:i.loaded,total:a.size,response:D.responseText,status:D.status,responseHeaders:D.getAllResponseHeaders()}),"Android Browser"===l.ua.browser&&e.trigger("UploadProgress",i)):i.loaded=i.size,f=g=null,!p||p>=a.size?(i.size!=i.origSize&&(a.destroy(),a=null),e.trigger("UploadProgress",i),i.status=l.DONE,e.trigger("FileUploaded",i,{response:D.responseText,status:D.status,responseHeaders:D.getAllResponseHeaders()})):r(s,1),void 0)},D.onerror=function(){n()},D.onloadend=function(){this.destroy(),D=null},e.settings.multipart&&c.multipart?(D.open("post",o,!0),l.each(e.settings.headers,function(e,t){D.setRequestHeader(t,e)}),g=new t.xhr.FormData,l.each(l.extend(_,e.settings.multipart_params),function(e,t){g.append(t,e)}),g.append(e.settings.file_data_name,f),D.send(g,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:F,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})):(o=l.buildUrl(e.settings.url,l.extend(_,e.settings.multipart_params)),D.open("post",o,!0),D.setRequestHeader("Content-Type","application/octet-stream"),l.each(e.settings.headers,function(e,t){D.setRequestHeader(t,e)}),D.send(f,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:F,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})))}var a,o=e.settings.url,u=e.settings.chunk_size,d=e.settings.max_retries,c=e.features,p=0;i.loaded&&(p=i.loaded=u?u*Math.floor(i.loaded/u):0),a=i.getSource(),!l.isEmptyObj(e.settings.resize)&&f(a,"send_binary_string")&&-1!==l.inArray(a.type,["image/jpeg","image/png"])?h.call(this,a,e.settings.resize,function(e){a=e,i.size=e.size,s()}):s()}function v(e,t){u(t)}function b(e){if(e.state==l.STARTED)S=+new Date;else if(e.state==l.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==l.UPLOADING&&(e.files[t].status=l.QUEUED,d())}function y(){D&&D.abort()}function R(e){d(),r(function(){a.call(e)},1)}function z(e,t){t.code===l.INIT_ERROR?e.destroy():t.code===l.HTTP_ERROR&&(t.file.status=l.FAILED,u(t.file),e.state==l.STARTED&&(e.trigger("CancelUpload"),r(function(){a.call(e)},1)))}function O(e){e.stop(),l.each(T,function(e){e.destroy()}),T=[],A.length&&(l.each(A,function(e){e.destroy()}),A=[]),P.length&&(l.each(P,function(e){e.destroy()}),P=[]),F={},U=!1,S=D=null,w.reset()}var I,S,w,D,x=l.guid(),T=[],F={},A=[],P=[],U=!1;I={runtimes:o.order,max_retries:0,chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:"file",flash_swf_url:"js/Moxie.swf",silverlight_xap_url:"js/Moxie.xap",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},resize:!1,send_file_name:!0,send_chunk_number:!0},_.call(this,e,null,!0),w=new l.QueueProgress,l.extend(this,{id:x,uid:x,state:l.STOPPED,features:{},runtime:null,files:T,settings:I,total:w,init:function(){var e,t,i=this;return e=i.getOption("preinit"),"function"==typeof e?e(i):l.each(e,function(e,t){i.bind(t,e)}),p.call(i),l.each(["container","browse_button","drop_element"],function(e){return null===i.getOption(e)?(t={code:l.INIT_ERROR,message:l.sprintf(l.translate("%s specified, but cannot be found."),e)},!1):void 0}),t?i.trigger("Error",t):I.browse_button||I.drop_element?(g.call(i,I,function(e){var t=i.getOption("init");"function"==typeof t?t(i):l.each(t,function(e,t){i.bind(t,e)}),e?(i.runtime=o.getInfo(c()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}),void 0):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("You must specify either browse_button or drop_element.")})},setOption:function(e,t){_.call(this,e,t,!this.runtime)},getOption:function(e){return e?I[e]:I},refresh:function(){A.length&&l.each(A,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=l.STARTED&&(this.state=l.STARTED,this.trigger("StateChanged"),a.call(this))},stop:function(){this.state!=l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){U=arguments[0]!==i?arguments[0]:!0,A.length&&l.each(A,function(e){e.disable(U)}),this.trigger("DisableBrowse",U)},getFile:function(e){var t;for(t=T.length-1;t>=0;t--)if(T[t].id===e)return T[t]},addFile:function(e,i){function n(e,t){var i=[];l.each(u.settings.filters,function(t,n){s[n]&&i.push(function(i){s[n].call(u,t,e,function(e){i(!e)})})}),l.inSeries(i,t)}function a(e){var s=l.typeOf(e);if(e instanceof t.file.File){if(!e.ruid&&!e.isDetached()){if(!o)return!1;e.ruid=o,e.connectRuntime(o)}a(new l.File(e))}else e instanceof t.file.Blob?(a(e.getSource()),e.destroy()):e instanceof l.File?(i&&(e.name=i),d.push(function(t){n(e,function(i){i||(T.push(e),f.push(e),u.trigger("FileFiltered",e)),r(t,1)})})):-1!==l.inArray(s,["file","blob"])?a(new t.file.File(null,e)):"node"===s&&"filelist"===l.typeOf(e.files)?l.each(e.files,a):"array"===s&&(i=null,l.each(e,a))}var o,u=this,d=[],f=[];o=c(),a(e),d.length&&l.inSeries(d,function(){f.length&&u.trigger("FilesAdded",f)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,i=T.length-1;i>=0;i--)if(T[i].id===t)return this.splice(i,1)[0]},splice:function(e,t){var n=T.splice(e===i?0:e,t===i?T.length:t),r=!1;return this.state==l.STARTED&&(l.each(n,function(e){return e.status===l.UPLOADING?(r=!0,!1):void 0}),r&&this.stop()),this.trigger("FilesRemoved",n),l.each(n,function(e){e.destroy()}),r&&this.start(),n},dispatchEvent:function(e){var t,i;if(e=e.toLowerCase(),t=this.hasEventListener(e)){t.sort(function(e,t){return t.priority-e.priority}),i=[].slice.call(arguments),i.shift(),i.unshift(this);for(var n=0;n<t.length;n++)if(t[n].fn.apply(t[n].scope,i)===!1)return!1}return!0},bind:function(e,t,i,n){l.Uploader.prototype.bind.call(this,e,t,n,i)},destroy:function(){this.trigger("Destroy"),I=w=null,this.unbindAll()}})},l.Uploader.prototype=t.core.EventTarget.instance,l.File=function(){function e(e){l.extend(this,{id:l.guid(),name:e.name||e.fileName,type:e.type||"",size:e.size||e.fileSize,origSize:e.size||e.fileSize,loaded:0,percent:0,status:l.QUEUED,lastModifiedDate:e.lastModifiedDate||(new Date).toLocaleString(),getNative:function(){var e=this.getSource().getSource();return-1!==l.inArray(l.typeOf(e),["blob","file"])?e:null},getSource:function(){return t[this.id]?t[this.id]:null},destroy:function(){var e=this.getSource();e&&(e.destroy(),delete t[this.id])}}),t[this.id]=e}var t={};return e}(),l.QueueProgress=function(){var e=this;e.size=0,e.loaded=0,e.uploaded=0,e.failed=0,e.queued=0,e.percent=0,e.bytesPerSec=0,e.reset=function(){e.size=e.loaded=e.uploaded=e.failed=e.queued=e.percent=e.bytesPerSec=0}},e.plupload=l}(this,e)});
  6541. define('upload',['jquery', 'bootstrap', 'backend', 'config', 'plupload'], function ($, undefined, Backend, Config, Plupload) {
  6542. var Upload = {
  6543. list: {},
  6544. config: {
  6545. container: document.body,
  6546. classname: '.plupload',
  6547. },
  6548. api: {
  6549. //Plupload上传
  6550. plupload: function (element, onAfterUpload) {
  6551. element = typeof element == 'undefined' ? Upload.config.classname : element;
  6552. $(element, Upload.config.container).each(function () {
  6553. var id = $(this).prop("id");
  6554. var url = $(this).data("url");
  6555. var maxsize = $(this).data("maxsize");
  6556. var mimetype = $(this).data("mimetype");
  6557. var multipart = $(this).data("multipart");
  6558. var multiple = $(this).data("multiple");
  6559. //上传URL
  6560. url = url ? url : Config.upload.uploadurl;
  6561. //最大可上传
  6562. maxsize = maxsize ? maxsize : Config.upload.maxsize;
  6563. //文件类型
  6564. mimetype = mimetype ? mimetype : Config.upload.mimetype;
  6565. //请求的表单参数
  6566. multipart = multipart ? multipart : Config.upload.multipart;
  6567. //是否支持批量上传
  6568. multiple = multiple ? multiple : Config.upload.multiple;
  6569. //生成Plupload实例
  6570. Upload.list[id] = new Plupload.Uploader({
  6571. runtimes: 'html5,flash,silverlight,html4',
  6572. multi_selection: multiple, //是否允许多选批量上传
  6573. browse_button: id, // 浏览按钮的ID
  6574. container: $(this).parent().get(0), //取按钮的上级元素
  6575. flash_swf_url: '/assets/libs/plupload/js/Moxie.swf',
  6576. silverlight_xap_url: '/assets/libs/plupload/js/Moxie.xap',
  6577. filters: {
  6578. max_file_size: maxsize,
  6579. mime_types: mimetype
  6580. },
  6581. url: url,
  6582. multipart_params: multipart,
  6583. init: {
  6584. PostInit: function () {
  6585. },
  6586. FilesAdded: function (up, files) {
  6587. Plupload.each(files, function (file) {
  6588. //这里可以改成其它的表现形式
  6589. //document.getElementById('filelist').innerHTML += '<div id="' + file.id + '">' + file.name + ' (' + plupload.formatSize(file.size) + ') <b></b></div>';
  6590. });
  6591. $("#" + id).data("bakup-html", $("#" + id).html());
  6592. //添加后立即上传
  6593. setTimeout(function () {
  6594. Upload.list[id].start();
  6595. }, 1);
  6596. },
  6597. UploadProgress: function (up, file) {
  6598. //这里可以改成其它的表现形式
  6599. //document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '<span>' + file.percent + "%</span>";
  6600. $("#" + id).prop("disabled", true).html("<i class='fa fa-upload'></i> 上传" + file.percent + "%");
  6601. },
  6602. FileUploaded: function (up, file, info) {
  6603. //还原按钮文字及状态
  6604. $("#" + id).prop("disabled", false).html($("#" + id).data("bakup-html"));
  6605. //这里可以改成其它的表现形式
  6606. //document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML += (' [Url]: ' + '<a href="' + url + '" target="_blank">' + url + '</a>');
  6607. //这里建议不修改
  6608. try {
  6609. var ret = JSON.parse(info.response);
  6610. if (ret.hasOwnProperty('code')) {
  6611. ret.data = ret.code == 200 ? ret : ret.data;
  6612. ret.code = ret.code == 200 ? 1 : ret.code;
  6613. var data = ret.hasOwnProperty("data") && ret.data != "" ? ret.data : null;
  6614. var msg = ret.hasOwnProperty("msg") && ret.msg != "" ? ret.msg : "";
  6615. $("input[data-plupload-id='" + id + "-text']").val(data.url);
  6616. var afterUpload = $("#" + id).data("after-upload");
  6617. if (afterUpload && typeof Upload.api.custom[afterUpload] == 'function') {
  6618. Upload.api.custom[afterUpload].call(info, id, data);
  6619. }
  6620. if (typeof onAfterUpload == 'function') {
  6621. onAfterUpload.call(info, id, data);
  6622. }
  6623. } else {
  6624. Toastr.error(e.message + "(code:-2)");
  6625. }
  6626. } catch (e) {
  6627. Toastr.error(e.message + "(code:-1)");
  6628. }
  6629. },
  6630. Error: function (up, err) {
  6631. Toastr.error(err.message + "(code:" + err.code + ")");
  6632. }
  6633. }
  6634. });
  6635. Upload.list[id].init();
  6636. });
  6637. },
  6638. // AJAX异步上传,主要用于Summernote上传回调
  6639. send: function (file, callback) {
  6640. var data = new FormData();
  6641. data.append("file", file);
  6642. $.each(Config.upload.multipart, function (k, v) {
  6643. data.append(k, v);
  6644. });
  6645. $.ajax({
  6646. url: Config.upload.uploadurl,
  6647. data: data,
  6648. cache: false,
  6649. contentType: false,
  6650. processData: false,
  6651. type: 'POST',
  6652. dataType: 'json',
  6653. success: function (ret) {
  6654. if (ret.hasOwnProperty("code")) {
  6655. ret.data = ret.code == 200 ? ret : ret.data;
  6656. ret.code = ret.code == 200 ? 1 : ret.code;
  6657. var data = ret.hasOwnProperty("data") && ret.data != "" ? ret.data : null;
  6658. var msg = ret.hasOwnProperty("msg") && ret.msg != "" ? ret.msg : "";
  6659. if (ret.code === 1) {
  6660. // 如果回调存在,则直接调用回调
  6661. if (typeof callback == 'function') {
  6662. callback.call(this, data);
  6663. } else {
  6664. Toastr.success(msg ? msg : __('Operation completed'));
  6665. }
  6666. } else {
  6667. Toastr.error(msg ? msg : __('Operation failed'));
  6668. }
  6669. } else {
  6670. Toastr.error(__('Unknown data format'));
  6671. }
  6672. }, error: function () {
  6673. Toastr.error(__('Network error'));
  6674. }
  6675. });
  6676. },
  6677. custom: {
  6678. //自定义上传完成回调
  6679. afteruploadcallback: function (id, response) {
  6680. console.log(this, id, response);
  6681. alert("Custom Callback,Response URL:" + response.url);
  6682. },
  6683. },
  6684. }
  6685. };
  6686. return Upload;
  6687. });
  6688. /*!
  6689. * Validator v0.11.9 for Bootstrap 3, by @1000hz
  6690. * Copyright 2017 Cina Saffary
  6691. * Licensed under http://opensource.org/licenses/MIT
  6692. *
  6693. * https://github.com/1000hz/bootstrap-validator
  6694. */
  6695. +function(a){"use strict";function b(b){return b.is('[type="checkbox"]')?b.prop("checked"):b.is('[type="radio"]')?!!a('[name="'+b.attr("name")+'"]:checked').length:b.is("select[multiple]")?(b.val()||[]).length:b.val()}function c(b){return this.each(function(){var c=a(this),e=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b),f=c.data("bs.validator");(f||"destroy"!=b)&&(f||c.data("bs.validator",f=new d(this,e)),"string"==typeof b&&f[b]())})}var d=function(c,e){this.options=e,this.validators=a.extend({},d.VALIDATORS,e.custom),this.$element=a(c),this.$btn=a('button[type="submit"], input[type="submit"]').filter('[form="'+this.$element.attr("id")+'"]').add(this.$element.find('input[type="submit"], button[type="submit"]')),this.update(),this.$element.on("input.bs.validator change.bs.validator focusout.bs.validator",a.proxy(this.onInput,this)),this.$element.on("submit.bs.validator",a.proxy(this.onSubmit,this)),this.$element.on("reset.bs.validator",a.proxy(this.reset,this)),this.$element.find("[data-match]").each(function(){var c=a(this),d=c.attr("data-match");a(d).on("input.bs.validator",function(){b(c)&&c.trigger("input.bs.validator")})}),this.$inputs.filter(function(){return b(a(this))&&!a(this).closest(".has-error").length}).trigger("focusout"),this.$element.attr("novalidate",!0)};d.VERSION="0.11.9",d.INPUT_SELECTOR=':input:not([type="hidden"], [type="submit"], [type="reset"], button)',d.FOCUS_OFFSET=20,d.DEFAULTS={delay:500,html:!1,disable:!0,focus:!0,custom:{},errors:{match:"Does not match",minlength:"Not long enough"},feedback:{success:"glyphicon-ok",error:"glyphicon-remove"}},d.VALIDATORS={"native":function(a){var b=a[0];return b.checkValidity?!b.checkValidity()&&!b.validity.valid&&(b.validationMessage||"error!"):void 0},match:function(b){var c=b.attr("data-match");return b.val()!==a(c).val()&&d.DEFAULTS.errors.match},minlength:function(a){var b=a.attr("data-minlength");return a.val().length<b&&d.DEFAULTS.errors.minlength}},d.prototype.update=function(){var b=this;return this.$inputs=this.$element.find(d.INPUT_SELECTOR).add(this.$element.find('[data-validate="true"]')).not(this.$element.find('[data-validate="false"]').each(function(){b.clearErrors(a(this))})),this.toggleSubmit(),this},d.prototype.onInput=function(b){var c=this,d=a(b.target),e="focusout"!==b.type;this.$inputs.is(d)&&this.validateInput(d,e).done(function(){c.toggleSubmit()})},d.prototype.validateInput=function(c,d){var e=(b(c),c.data("bs.validator.errors"));c.is('[type="radio"]')&&(c=this.$element.find('input[name="'+c.attr("name")+'"]'));var f=a.Event("validate.bs.validator",{relatedTarget:c[0]});if(this.$element.trigger(f),!f.isDefaultPrevented()){var g=this;return this.runValidators(c).done(function(b){c.data("bs.validator.errors",b),b.length?d?g.defer(c,g.showErrors):g.showErrors(c):g.clearErrors(c),e&&b.toString()===e.toString()||(f=b.length?a.Event("invalid.bs.validator",{relatedTarget:c[0],detail:b}):a.Event("valid.bs.validator",{relatedTarget:c[0],detail:e}),g.$element.trigger(f)),g.toggleSubmit(),g.$element.trigger(a.Event("validated.bs.validator",{relatedTarget:c[0]}))})}},d.prototype.runValidators=function(c){function d(a){return c.attr("data-"+a+"-error")}function e(){var a=c[0].validity;return a.typeMismatch?c.attr("data-type-error"):a.patternMismatch?c.attr("data-pattern-error"):a.stepMismatch?c.attr("data-step-error"):a.rangeOverflow?c.attr("data-max-error"):a.rangeUnderflow?c.attr("data-min-error"):a.valueMissing?c.attr("data-required-error"):null}function f(){return c.attr("data-error")}function g(a){return d(a)||e()||f()}var h=[],i=a.Deferred();return c.data("bs.validator.deferred")&&c.data("bs.validator.deferred").reject(),c.data("bs.validator.deferred",i),a.each(this.validators,a.proxy(function(a,d){var e=null;!b(c)&&!c.attr("required")||void 0===c.attr("data-"+a)&&"native"!=a||!(e=d.call(this,c))||(e=g(a)||e,!~h.indexOf(e)&&h.push(e))},this)),!h.length&&b(c)&&c.attr("data-remote")?this.defer(c,function(){var d={};d[c.attr("name")]=b(c),a.get(c.attr("data-remote"),d).fail(function(a,b,c){h.push(g("remote")||c)}).always(function(){i.resolve(h)})}):i.resolve(h),i.promise()},d.prototype.validate=function(){var b=this;return a.when(this.$inputs.map(function(){return b.validateInput(a(this),!1)})).then(function(){b.toggleSubmit(),b.focusError()}),this},d.prototype.focusError=function(){if(this.options.focus){var b=this.$element.find(".has-error:first :input");0!==b.length&&(a("html, body").animate({scrollTop:b.offset().top-d.FOCUS_OFFSET},250),b.focus())}},d.prototype.showErrors=function(b){var c=this.options.html?"html":"text",d=b.data("bs.validator.errors"),e=b.closest(".form-group"),f=e.find(".help-block.with-errors"),g=e.find(".form-control-feedback");d.length&&(d=a("<ul/>").addClass("list-unstyled").append(a.map(d,function(b){return a("<li/>")[c](b)})),void 0===f.data("bs.validator.originalContent")&&f.data("bs.validator.originalContent",f.html()),f.empty().append(d),e.addClass("has-error has-danger"),e.hasClass("has-feedback")&&g.removeClass(this.options.feedback.success)&&g.addClass(this.options.feedback.error)&&e.removeClass("has-success"))},d.prototype.clearErrors=function(a){var c=a.closest(".form-group"),d=c.find(".help-block.with-errors"),e=c.find(".form-control-feedback");d.html(d.data("bs.validator.originalContent")),c.removeClass("has-error has-danger has-success"),c.hasClass("has-feedback")&&e.removeClass(this.options.feedback.error)&&e.removeClass(this.options.feedback.success)&&b(a)&&e.addClass(this.options.feedback.success)&&c.addClass("has-success")},d.prototype.hasErrors=function(){function b(){return!!(a(this).data("bs.validator.errors")||[]).length}return!!this.$inputs.filter(b).length},d.prototype.isIncomplete=function(){function c(){var c=b(a(this));return!("string"==typeof c?a.trim(c):c)}return!!this.$inputs.filter("[required]").filter(c).length},d.prototype.onSubmit=function(a){this.validate(),(this.isIncomplete()||this.hasErrors())&&a.preventDefault()},d.prototype.toggleSubmit=function(){this.options.disable&&this.$btn.toggleClass("disabled",this.isIncomplete()||this.hasErrors())},d.prototype.defer=function(b,c){return c=a.proxy(c,this,b),this.options.delay?(window.clearTimeout(b.data("bs.validator.timeout")),void b.data("bs.validator.timeout",window.setTimeout(c,this.options.delay))):c()},d.prototype.reset=function(){return this.$element.find(".form-control-feedback").removeClass(this.options.feedback.error).removeClass(this.options.feedback.success),this.$inputs.removeData(["bs.validator.errors","bs.validator.deferred"]).each(function(){var b=a(this),c=b.data("bs.validator.timeout");window.clearTimeout(c)&&b.removeData("bs.validator.timeout")}),this.$element.find(".help-block.with-errors").each(function(){var b=a(this),c=b.data("bs.validator.originalContent");b.removeData("bs.validator.originalContent").html(c)}),this.$btn.removeClass("disabled"),this.$element.find(".has-error, .has-danger, .has-success").removeClass("has-error has-danger has-success"),this},d.prototype.destroy=function(){return this.reset(),this.$element.removeAttr("novalidate").removeData("bs.validator").off(".bs.validator"),this.$inputs.off(".bs.validator"),this.options=null,this.validators=null,this.$element=null,this.$btn=null,this.$inputs=null,this};var e=a.fn.validator;a.fn.validator=c,a.fn.validator.Constructor=d,a.fn.validator.noConflict=function(){return a.fn.validator=e,this},a(window).on("load",function(){a('form[data-toggle="validator"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery);
  6696. define("bootstrap-validator", function(){});
  6697. !function ($) {
  6698. /* CHECKBOX PUBLIC CLASS DEFINITION
  6699. * ============================== */
  6700. var Checkbox = function (element, options) {
  6701. this.init(element, options);
  6702. }
  6703. Checkbox.prototype = {
  6704. constructor: Checkbox
  6705. , init: function (element, options) {
  6706. var $el = this.$element = $(element)
  6707. this.options = $.extend({}, $.fn.checkbox.defaults, options);
  6708. $el.before(this.options.template);
  6709. this.setState();
  6710. }
  6711. , setState: function () {
  6712. var $el = this.$element
  6713. , $parent = $el.closest('.checkbox');
  6714. $el.prop('disabled') && $parent.addClass('disabled');
  6715. $el.prop('checked') && $parent.addClass('checked');
  6716. }
  6717. , toggle: function () {
  6718. var ch = 'checked'
  6719. , $el = this.$element
  6720. , $parent = $el.closest('.checkbox')
  6721. , checked = $el.prop(ch)
  6722. , e = $.Event('toggle')
  6723. if ($el.prop('disabled') == false) {
  6724. $parent.toggleClass(ch) && checked ? $el.removeAttr(ch) : $el.prop(ch, ch);
  6725. $el.trigger(e).trigger('change');
  6726. }
  6727. }
  6728. , setCheck: function (option) {
  6729. var d = 'disabled'
  6730. , ch = 'checked'
  6731. , $el = this.$element
  6732. , $parent = $el.closest('.checkbox')
  6733. , checkAction = option == 'check' ? true : false
  6734. , e = $.Event(option)
  6735. $parent[checkAction ? 'addClass' : 'removeClass' ](ch) && checkAction ? $el.prop(ch, ch) : $el.removeAttr(ch);
  6736. $el.trigger(e).trigger('change');
  6737. }
  6738. }
  6739. /* CHECKBOX PLUGIN DEFINITION
  6740. * ======================== */
  6741. var old = $.fn.checkbox
  6742. $.fn.checkbox = function (option) {
  6743. return this.each(function () {
  6744. var $this = $(this)
  6745. , data = $this.data('checkbox')
  6746. , options = $.extend({}, $.fn.checkbox.defaults, $this.data(), typeof option == 'object' && option);
  6747. if (!data)
  6748. $this.data('checkbox', (data = new Checkbox(this, options)));
  6749. if (option == 'toggle')
  6750. data.toggle()
  6751. if (option == 'check' || option == 'uncheck')
  6752. data.setCheck(option)
  6753. else if (option)
  6754. data.setState();
  6755. });
  6756. }
  6757. $.fn.checkbox.defaults = {
  6758. template: '<span class="icons"><span class="first-icon fa fa-square-o"></span><span class="second-icon fa fa-check-square-o"></span></span>'
  6759. }
  6760. /* CHECKBOX NO CONFLICT
  6761. * ================== */
  6762. $.fn.checkbox.noConflict = function () {
  6763. $.fn.checkbox = old;
  6764. return this;
  6765. }
  6766. /* CHECKBOX DATA-API
  6767. * =============== */
  6768. $(document).on('click.checkbox.data-api', '[data-toggle^=checkbox], .checkbox', function (e) {
  6769. var $checkbox = $(e.target);
  6770. if (e.target.tagName != "A") {
  6771. e && e.preventDefault() && e.stopPropagation();
  6772. if (!$checkbox.hasClass('checkbox'))
  6773. $checkbox = $checkbox.closest('.checkbox');
  6774. $checkbox.find(':checkbox').checkbox('toggle');
  6775. }
  6776. });
  6777. $(function () {
  6778. $('[data-toggle="checkbox"]').each(function () {
  6779. var $checkbox = $(this);
  6780. $checkbox.checkbox();
  6781. });
  6782. });
  6783. }(window.jQuery);
  6784. define("bootstrap-checkbox", ["jquery"], function(){});
  6785. /* =============================================================
  6786. * flatui-radio v0.0.3
  6787. * ============================================================ */
  6788. !function ($) {
  6789. /* RADIO PUBLIC CLASS DEFINITION
  6790. * ============================== */
  6791. var Radio = function (element, options) {
  6792. this.init(element, options);
  6793. }
  6794. Radio.prototype = {
  6795. constructor: Radio
  6796. , init: function (element, options) {
  6797. var $el = this.$element = $(element)
  6798. this.options = $.extend({}, $.fn.radio.defaults, options);
  6799. $el.before(this.options.template);
  6800. this.setState();
  6801. }
  6802. , setState: function () {
  6803. var $el = this.$element
  6804. , $parent = $el.closest('.radio');
  6805. $el.prop('disabled') && $parent.addClass('disabled');
  6806. $el.prop('checked') && $parent.addClass('checked');
  6807. }
  6808. , toggle: function () {
  6809. var d = 'disabled'
  6810. , ch = 'checked'
  6811. , $el = this.$element
  6812. , checked = $el.prop(ch)
  6813. , $parent = $el.closest('.radio')
  6814. , $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
  6815. , $elemGroup = $parentWrap.find(':radio[name="' + $el.attr('name') + '"]')
  6816. , e = $.Event('toggle')
  6817. if ($el.prop(d) == false) {
  6818. $elemGroup.not($el).each(function () {
  6819. var $el = $(this)
  6820. , $parent = $(this).closest('.radio');
  6821. if ($el.prop(d) == false) {
  6822. $parent.removeClass(ch) && $el.removeAttr(ch).trigger('change');
  6823. }
  6824. });
  6825. if (checked == false)
  6826. $parent.addClass(ch) && $el.prop(ch, true);
  6827. $el.trigger(e);
  6828. if (checked !== $el.prop(ch)) {
  6829. $el.trigger('change');
  6830. }
  6831. }
  6832. }
  6833. , setCheck: function (option) {
  6834. var ch = 'checked'
  6835. , $el = this.$element
  6836. , $parent = $el.closest('.radio')
  6837. , checkAction = option == 'check' ? true : false
  6838. , checked = $el.prop(ch)
  6839. , $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
  6840. , $elemGroup = $parentWrap.find(':radio[name="' + $el['attr']('name') + '"]')
  6841. , e = $.Event(option)
  6842. $elemGroup.not($el).each(function () {
  6843. var $el = $(this)
  6844. , $parent = $(this).closest('.radio');
  6845. $parent.removeClass(ch) && $el.removeAttr(ch);
  6846. });
  6847. $parent[checkAction ? 'addClass' : 'removeClass'](ch) && checkAction ? $el.prop(ch, ch) : $el.removeAttr(ch);
  6848. $el.trigger(e);
  6849. if (checked !== $el.prop(ch)) {
  6850. $el.trigger('change');
  6851. }
  6852. }
  6853. }
  6854. /* RADIO PLUGIN DEFINITION
  6855. * ======================== */
  6856. var old = $.fn.radio
  6857. $.fn.radio = function (option) {
  6858. return this.each(function () {
  6859. var $this = $(this)
  6860. , data = $this.data('radio')
  6861. , options = $.extend({}, $.fn.radio.defaults, $this.data(), typeof option == 'object' && option);
  6862. if (!data)
  6863. $this.data('radio', (data = new Radio(this, options)));
  6864. if (option == 'toggle')
  6865. data.toggle()
  6866. if (option == 'check' || option == 'uncheck')
  6867. data.setCheck(option)
  6868. else if (option)
  6869. data.setState();
  6870. });
  6871. }
  6872. $.fn.radio.defaults = {
  6873. template: '<span class="icons"><span class="first-icon fa fa-circle-o"></span><span class="second-icon fa fa-dot-circle-o"></span></span>'
  6874. }
  6875. /* RADIO NO CONFLICT
  6876. * ================== */
  6877. $.fn.radio.noConflict = function () {
  6878. $.fn.radio = old;
  6879. return this;
  6880. }
  6881. /* RADIO DATA-API
  6882. * =============== */
  6883. $(document).on('click.radio.data-api', '[data-toggle^=radio], .radio', function (e) {
  6884. var $radio = $(e.target);
  6885. e && e.preventDefault() && e.stopPropagation();
  6886. if (!$radio.hasClass('radio'))
  6887. $radio = $radio.closest('.radio');
  6888. $radio.find(':radio').radio('toggle');
  6889. });
  6890. $(function () {
  6891. $('[data-toggle="radio"]').each(function () {
  6892. var $radio = $(this);
  6893. $radio.radio();
  6894. });
  6895. });
  6896. }(window.jQuery);
  6897. define("bootstrap-radio", ["jquery"], function(){});
  6898. /* ============================================================
  6899. * bootstrapSwitch v1.3 by Larentis Mattia @spiritualGuru
  6900. * http://www.larentis.eu/switch/
  6901. * ============================================================
  6902. * Licensed under the Apache License, Version 2.0
  6903. * http://www.apache.org/licenses/LICENSE-2.0
  6904. * ============================================================ */
  6905. !function ($) {
  6906. "use strict";
  6907. $.fn['bootstrapSwitch'] = function (method) {
  6908. var methods = {
  6909. init: function () {
  6910. return this.each(function () {
  6911. var $element = $(this)
  6912. , $div
  6913. , $switchLeft
  6914. , $switchRight
  6915. , $label
  6916. , myClasses = ""
  6917. , classes = $element.attr('class')
  6918. , color
  6919. , moving
  6920. , onLabel = "开"
  6921. , offLabel = "关"
  6922. , icon = false;
  6923. $.each(['switch-mini', 'switch-small', 'switch-large'], function (i, el) {
  6924. if (classes.indexOf(el) >= 0)
  6925. myClasses = el;
  6926. });
  6927. $element.addClass('has-switch');
  6928. if ($element.data('on') !== undefined)
  6929. color = "switch-" + $element.data('on');
  6930. if ($element.data('on-label') !== undefined)
  6931. onLabel = $element.data('on-label');
  6932. if ($element.data('off-label') !== undefined)
  6933. offLabel = $element.data('off-label');
  6934. if ($element.data('icon') !== undefined)
  6935. icon = $element.data('icon');
  6936. $switchLeft = $('<span>')
  6937. .addClass("switch-left")
  6938. .addClass(myClasses)
  6939. .addClass(color)
  6940. .html(onLabel);
  6941. color = '';
  6942. if ($element.data('off') !== undefined)
  6943. color = "switch-" + $element.data('off');
  6944. $switchRight = $('<span>')
  6945. .addClass("switch-right")
  6946. .addClass(myClasses)
  6947. .addClass(color)
  6948. .html(offLabel);
  6949. $label = $('<label>')
  6950. .html("&nbsp;")
  6951. .addClass(myClasses)
  6952. .attr('for', $element.find('input').attr('id'));
  6953. if (icon) {
  6954. $label.html('<i class="' + icon + '"></i>');
  6955. }
  6956. $div = $element.find(':checkbox').wrap($('<div>')).parent().data('animated', false);
  6957. if ($element.data('animated') !== false)
  6958. $div.addClass('switch-animate').data('animated', true);
  6959. $div
  6960. .append($switchLeft)
  6961. .append($label)
  6962. .append($switchRight);
  6963. $element.find('>div').addClass(
  6964. $element.find('input').is(':checked') ? 'switch-on' : 'switch-off'
  6965. );
  6966. if ($element.find('input').is(':disabled'))
  6967. $(this).addClass('deactivate');
  6968. var changeStatus = function ($this) {
  6969. $this.siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
  6970. };
  6971. $element.on('keydown', function (e) {
  6972. if (e.keyCode === 32) {
  6973. e.stopImmediatePropagation();
  6974. e.preventDefault();
  6975. changeStatus($(e.target).find('span:first'));
  6976. }
  6977. });
  6978. $switchLeft.on('click', function (e) {
  6979. changeStatus($(this));
  6980. });
  6981. $switchRight.on('click', function (e) {
  6982. changeStatus($(this));
  6983. });
  6984. $element.find('input').on('change', function (e) {
  6985. var $this = $(this)
  6986. , $element = $this.parent()
  6987. , thisState = $this.is(':checked')
  6988. , state = $element.is('.switch-off');
  6989. e.preventDefault();
  6990. $element.css('left', '');
  6991. if (state === thisState) {
  6992. if (thisState)
  6993. $element.removeClass('switch-off').addClass('switch-on');
  6994. else
  6995. $element.removeClass('switch-on').addClass('switch-off');
  6996. if ($element.data('animated') !== false)
  6997. $element.addClass("switch-animate");
  6998. $element.parent().trigger('switch-change', {'el': $this, 'value': thisState})
  6999. }
  7000. });
  7001. $element.find('label').on('mousedown touchstart', function (e) {
  7002. var $this = $(this);
  7003. moving = false;
  7004. e.preventDefault();
  7005. e.stopImmediatePropagation();
  7006. $this.closest('div').removeClass('switch-animate');
  7007. if ($this.closest('.has-switch').is('.deactivate'))
  7008. $this.unbind('click');
  7009. else {
  7010. $this.on('mousemove touchmove', function (e) {
  7011. var $element = $(this).closest('.switch')
  7012. , relativeX = (e.pageX || e.originalEvent.targetTouches[0].pageX) - $element.offset().left
  7013. , percent = (relativeX / $element.width()) * 100
  7014. , left = 25
  7015. , right = 75;
  7016. moving = true;
  7017. if (percent < left)
  7018. percent = left;
  7019. else if (percent > right)
  7020. percent = right;
  7021. $element.find('>div').css('left', (percent - right) + "%")
  7022. });
  7023. $this.on('click touchend', function (e) {
  7024. var $this = $(this)
  7025. , $target = $(e.target)
  7026. , $myCheckBox = $target.siblings('input');
  7027. e.stopImmediatePropagation();
  7028. e.preventDefault();
  7029. $this.unbind('mouseleave');
  7030. if (moving)
  7031. $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25));
  7032. else
  7033. $myCheckBox.prop("checked", !$myCheckBox.is(":checked"));
  7034. moving = false;
  7035. $myCheckBox.trigger('change');
  7036. });
  7037. $this.on('mouseleave', function (e) {
  7038. var $this = $(this)
  7039. , $myCheckBox = $this.siblings('input');
  7040. e.preventDefault();
  7041. e.stopImmediatePropagation();
  7042. $this.unbind('mouseleave');
  7043. $this.trigger('mouseup');
  7044. $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25)).trigger('change');
  7045. });
  7046. $this.on('mouseup', function (e) {
  7047. e.stopImmediatePropagation();
  7048. e.preventDefault();
  7049. $(this).unbind('mousemove');
  7050. });
  7051. }
  7052. });
  7053. }
  7054. );
  7055. },
  7056. toggleActivation: function () {
  7057. $(this).toggleClass('deactivate');
  7058. },
  7059. isActive: function () {
  7060. return !$(this).hasClass('deactivate');
  7061. },
  7062. setActive: function (active) {
  7063. if (active)
  7064. $(this).removeClass('deactivate');
  7065. else
  7066. $(this).addClass('deactivate');
  7067. },
  7068. toggleState: function (skipOnChange) {
  7069. var $input = $(this).find('input:checkbox');
  7070. $input.prop('checked', !$input.is(':checked')).trigger('change', skipOnChange);
  7071. },
  7072. setState: function (value, skipOnChange) {
  7073. $(this).find('input:checkbox').prop('checked', value).trigger('change', skipOnChange);
  7074. },
  7075. status: function () {
  7076. return $(this).find('input:checkbox').is(':checked');
  7077. },
  7078. destroy: function () {
  7079. var $div = $(this).find('div')
  7080. , $checkbox;
  7081. $div.find(':not(input:checkbox)').remove();
  7082. $checkbox = $div.children();
  7083. $checkbox.unwrap().unwrap();
  7084. $checkbox.unbind('change');
  7085. return $checkbox;
  7086. }
  7087. };
  7088. if (methods[method])
  7089. return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
  7090. else if (typeof method === 'object' || !method)
  7091. return methods.init.apply(this, arguments);
  7092. else
  7093. $.error('Method ' + method + ' does not exist!');
  7094. };
  7095. }(jQuery);
  7096. define("bootstrap-switch", ["jquery"], function(){});
  7097. define('form',['jquery', 'bootstrap', 'backend', 'config', 'toastr', 'upload', 'bootstrap-validator', 'bootstrap-checkbox', 'bootstrap-radio', 'bootstrap-switch'], function ($, undefined, Backend, Config, Toastr, Upload, undefined) {
  7098. var Form = {
  7099. config: {
  7100. },
  7101. api: {
  7102. submit: function (form, onBeforeSubmit, onAfterSubmit) {
  7103. if (form.size() == 0)
  7104. return Toastr.error("表单未初始化完成,无法提交");
  7105. //提交前事件
  7106. var beforeSubmit = form.data("before-submit");
  7107. //元素绑定函数
  7108. if (beforeSubmit && typeof Form.api.custom[beforeSubmit] == 'function') {
  7109. if (!Form.api.custom[beforeSubmit].call(form)) {
  7110. return false;
  7111. }
  7112. }
  7113. //自定义函数
  7114. if (typeof onBeforeSubmit == 'function') {
  7115. if (!onBeforeSubmit.call(form)) {
  7116. return false;
  7117. }
  7118. }
  7119. var type = form.attr("method");
  7120. type = type && (type == 'GET' || type == 'POST') ? type : 'GET';
  7121. url = form.attr("action");
  7122. url = url ? url : location.href;
  7123. $.ajax({
  7124. type: type,
  7125. url: url,
  7126. data: form.serialize(),
  7127. dataType: 'json',
  7128. success: function (ret) {
  7129. if (ret.hasOwnProperty("code")) {
  7130. var data = ret.hasOwnProperty("data") && ret.data != "" ? ret.data : null;
  7131. var msg = ret.hasOwnProperty("msg") && ret.msg != "" ? ret.msg : "";
  7132. if (ret.code === 1) {
  7133. $('.form-group', form).removeClass('has-feedback has-success has-error');
  7134. //成功提交后事件
  7135. var afterSubmit = form.data("after-submit");
  7136. //元素绑定函数
  7137. if (afterSubmit && typeof Form.api.custom[afterSubmit] == 'function') {
  7138. if (!Form.api.custom[afterSubmit].call(form, data)) {
  7139. return false;
  7140. }
  7141. }
  7142. //自定义函数
  7143. if (typeof onAfterSubmit == 'function') {
  7144. if (!onAfterSubmit.call(form, data)) {
  7145. return false;
  7146. }
  7147. }
  7148. Toastr.success(msg ? msg : __('Operation completed'));
  7149. } else {
  7150. Toastr.error(msg ? msg : __('Operation failed'));
  7151. }
  7152. } else {
  7153. Toastr.error(__('Unknown data format'));
  7154. }
  7155. }, error: function () {
  7156. Toastr.error(__('Network error'));
  7157. }, complete: function (e) {
  7158. }
  7159. });
  7160. return false;
  7161. },
  7162. bindevent: function (form, onBeforeSubmit, onAfterSubmit) {
  7163. form.validator().on('submit', function (e) {
  7164. if (e.isDefaultPrevented()) {
  7165. //验证不通过
  7166. Toastr.error("验证失败,请检查表单输入是否正确");
  7167. } else {
  7168. //验证通过提交表单
  7169. Form.api.submit(form, onBeforeSubmit, function (data) {
  7170. if (typeof onAfterSubmit == 'function') {
  7171. if (!onAfterSubmit.call(form, data)) {
  7172. return false;
  7173. }
  7174. }
  7175. //提示及关闭当前窗口
  7176. parent.Toastr.success(__('Operation completed'));
  7177. parent.$(".btn-refresh").trigger("click");
  7178. var index = parent.Layer.getFrameIndex(window.name);
  7179. parent.Layer.close(index);
  7180. });
  7181. return false;
  7182. }
  7183. });
  7184. // Activate the switches with icons
  7185. if ($('.switch').length != 0) {
  7186. $('.switch')['bootstrapSwitch']();
  7187. }
  7188. // Activate regular switches
  7189. if ($("[data-toggle='switch']").length != 0) {
  7190. $("[data-toggle='switch']").wrap('<div class="switch" />').parent().bootstrapSwitch();
  7191. }
  7192. //绑定select元素事件
  7193. if ($(".selectpicker", form).size() > 0) {
  7194. require(['bootstrap-select'], function () {
  7195. $('.selectpicker', form).selectpicker();
  7196. });
  7197. }
  7198. if ($(".typeahead").size() > 0 || $(".tagsinput").size() > 0) {
  7199. require(['bloodhound'], function () {
  7200. var remotesource = function (input) {
  7201. return new Bloodhound({
  7202. datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'),
  7203. queryTokenizer: Bloodhound.tokenizers.whitespace,
  7204. remote: {
  7205. url: '/ajax/typeahead?search=%QUERY&field=' + $(input).attr("name"),
  7206. wildcard: '%QUERY',
  7207. transform: function (ret) {
  7208. return ret.data.searchlist;
  7209. }
  7210. }
  7211. });
  7212. };
  7213. //绑定typeahead事件
  7214. if ($(".typeahead", form).size() > 0) {
  7215. require(['typeahead'], function () {
  7216. $(".typeahead", form).each(function () {
  7217. $(this).typeahead({
  7218. hint: true,
  7219. highlight: true,
  7220. minLength: 0
  7221. }, {
  7222. name: 'typeahead',
  7223. limit: 20,
  7224. displayKey: 'id',
  7225. source: remotesource(this),
  7226. templates: {
  7227. empty: '<li class="notfound">' + __('No matches found') + '</li>',
  7228. suggestion: function (item) {
  7229. return '<li>' + item.name + '</li>';
  7230. }
  7231. }
  7232. });
  7233. });
  7234. });
  7235. }
  7236. //绑定tagsinput事件
  7237. if ($(".tagsinput", form).size() > 0) {
  7238. require(['bootstrap-tagsinput'], function () {
  7239. $('.tagsinput', form).each(function () {
  7240. $(this).tagsinput({
  7241. freeInput: false,
  7242. typeaheadjs: {
  7243. name: 'tagsinput',
  7244. limit: 20,
  7245. displayKey: 'name',
  7246. valueKey: 'id',
  7247. source: remotesource(this),
  7248. templates: {
  7249. empty: '<li class="notfound">' + __('No matches found') + '</li>',
  7250. suggestion: function (item) {
  7251. return '<li>' + item.name + '</li>';
  7252. }
  7253. }
  7254. }
  7255. });
  7256. });
  7257. $('.bootstrap-tagsinput .twitter-typeahead').css('display', 'inline');
  7258. });
  7259. }
  7260. });
  7261. }
  7262. //绑定日期时间元素事件
  7263. if ($(".datetimepicker", form).size() > 0) {
  7264. require(['bootstrap-datetimepicker'], function () {
  7265. $('.datetimepicker', form).parent().css('position', 'relative');
  7266. $('.datetimepicker', form)
  7267. .datetimepicker({
  7268. format: 'YYYY-MM-DD HH:mm:ss',
  7269. icons: {
  7270. time: 'fa fa-clock-o',
  7271. date: 'fa fa-calendar',
  7272. up: 'fa fa-chevron-up',
  7273. down: 'fa fa-chevron-down',
  7274. previous: 'fa fa-chevron-left',
  7275. next: 'fa fa-chevron-right',
  7276. today: 'fa fa-history',
  7277. clear: 'fa fa-trash',
  7278. close: 'fa fa-remove'
  7279. },
  7280. showTodayButton: true,
  7281. showClose: true
  7282. });
  7283. });
  7284. }
  7285. //绑定summernote事件
  7286. if ($(".summernote", form).size() > 0) {
  7287. require(['summernote'], function () {
  7288. $(".summernote", form).summernote({
  7289. height: 250,
  7290. lang: 'zh-CN',
  7291. dialogsInBody: true,
  7292. callbacks: {
  7293. onChange: function (contents) {
  7294. $(this).val(contents);
  7295. $(this).trigger('change');
  7296. },
  7297. onInit: function () {
  7298. },
  7299. onImageUpload: function (files) {
  7300. var that = this;
  7301. //依次上传图片
  7302. for (var i = 0; i < files.length; i++) {
  7303. Upload.api.send(files[i], function (data) {
  7304. var url = Config.upload.cdnurl + data.url;
  7305. $(that).summernote("insertImage", url, 'filename');
  7306. });
  7307. }
  7308. }
  7309. }
  7310. });
  7311. });
  7312. }
  7313. //绑定plupload上传元素事件
  7314. if ($(".plupload", form).size() > 0) {
  7315. Upload.api.plupload();
  7316. }
  7317. },
  7318. custom: {}
  7319. },
  7320. };
  7321. return Form;
  7322. });
  7323. // jQuery List DragSort v0.5.2
  7324. // Website: http://dragsort.codeplex.com/
  7325. // License: http://dragsort.codeplex.com/license
  7326. (function($) {
  7327. $.fn.dragsort = function(options) {
  7328. if (options == "destroy") {
  7329. $(this.selector).trigger("dragsort-uninit");
  7330. return;
  7331. }
  7332. var opts = $.extend({}, $.fn.dragsort.defaults, options);
  7333. var lists = [];
  7334. var list = null, lastPos = null;
  7335. this.each(function(i, cont) {
  7336. //if list container is table, the browser automatically wraps rows in tbody if not specified so change list container to tbody so that children returns rows as user expected
  7337. if ($(cont).is("table") && $(cont).children().size() == 1 && $(cont).children().is("tbody"))
  7338. cont = $(cont).children().get(0);
  7339. var newList = {
  7340. draggedItem: null,
  7341. placeHolderItem: null,
  7342. pos: null,
  7343. offset: null,
  7344. offsetLimit: null,
  7345. scroll: null,
  7346. container: cont,
  7347. init: function() {
  7348. //set options to default values if not set
  7349. opts.tagName = $(this.container).children().size() == 0 ? "li" : $(this.container).children().get(0).tagName.toLowerCase();
  7350. if (opts.itemSelector == "")
  7351. opts.itemSelector = opts.tagName;
  7352. if (opts.dragSelector == "")
  7353. opts.dragSelector = opts.tagName;
  7354. if (opts.placeHolderTemplate == "")
  7355. opts.placeHolderTemplate = "<" + opts.tagName + ">&nbsp;</" + opts.tagName + ">";
  7356. //listidx allows reference back to correct list variable instance
  7357. $(this.container).attr("data-listidx", i).mousedown(this.grabItem).bind("dragsort-uninit", this.uninit);
  7358. this.styleDragHandlers(true);
  7359. },
  7360. uninit: function() {
  7361. var list = lists[$(this).attr("data-listidx")];
  7362. $(list.container).unbind("mousedown", list.grabItem).unbind("dragsort-uninit");
  7363. list.styleDragHandlers(false);
  7364. },
  7365. getItems: function() {
  7366. return $(this.container).children(opts.itemSelector);
  7367. },
  7368. styleDragHandlers: function(cursor) {
  7369. this.getItems().map(function() { return $(this).is(opts.dragSelector) ? this : $(this).find(opts.dragSelector).get(); }).css("cursor", cursor ? "pointer" : "");
  7370. },
  7371. grabItem: function(e) {
  7372. var list = lists[$(this).attr("data-listidx")];
  7373. var item = $(e.target).closest("[data-listidx] > " + opts.tagName).get(0);
  7374. var insideMoveableItem = list.getItems().filter(function() { return this == item; }).size() > 0;
  7375. //if not left click or if clicked on excluded element (e.g. text box) or not a moveable list item return
  7376. if (e.which != 1 || $(e.target).is(opts.dragSelectorExclude) || $(e.target).closest(opts.dragSelectorExclude).size() > 0 || !insideMoveableItem)
  7377. return;
  7378. //prevents selection, stops issue on Fx where dragging hyperlink doesn't work and on IE where it triggers mousemove even though mouse hasn't moved,
  7379. //does also stop being able to click text boxes hence dragging on text boxes by default is disabled in dragSelectorExclude
  7380. //e.preventDefault();
  7381. //change cursor to move while dragging
  7382. var dragHandle = e.target;
  7383. while (!$(dragHandle).is(opts.dragSelector)) {
  7384. if (dragHandle == this) return;
  7385. dragHandle = dragHandle.parentNode;
  7386. }
  7387. $(dragHandle).attr("data-cursor", $(dragHandle).css("cursor"));
  7388. $(dragHandle).css("cursor", "move");
  7389. //on mousedown wait for movement of mouse before triggering dragsort script (dragStart) to allow clicking of hyperlinks to work
  7390. var listElem = this;
  7391. var trigger = function() {
  7392. list.dragStart.call(listElem, e);
  7393. $(list.container).unbind("mousemove", trigger);
  7394. };
  7395. $(list.container).mousemove(trigger).mouseup(function() { $(list.container).unbind("mousemove", trigger); $(dragHandle).css("cursor", $(dragHandle).attr("data-cursor")); });
  7396. },
  7397. dragStart: function(e) {
  7398. if (list != null && list.draggedItem != null)
  7399. list.dropItem();
  7400. list = lists[$(this).attr("data-listidx")];
  7401. list.draggedItem = $(e.target).closest("[data-listidx] > " + opts.tagName)
  7402. //record current position so on dragend we know if the dragged item changed position or not, not using getItems to allow dragsort to restore dragged item to original location in relation to fixed items
  7403. list.draggedItem.attr("data-origpos", $(this).attr("data-listidx") + "-" + $(list.container).children().index(list.draggedItem));
  7404. //calculate mouse offset relative to draggedItem
  7405. var mt = parseInt(list.draggedItem.css("marginTop"));
  7406. var ml = parseInt(list.draggedItem.css("marginLeft"));
  7407. list.offset = list.draggedItem.offset();
  7408. list.offset.top = e.pageY - list.offset.top + (isNaN(mt) ? 0 : mt) - 1;
  7409. list.offset.left = e.pageX - list.offset.left + (isNaN(ml) ? 0 : ml) - 1;
  7410. //calculate box the dragged item can't be dragged outside of
  7411. if (!opts.dragBetween) {
  7412. var containerHeight = $(list.container).outerHeight() == 0 ? Math.max(1, Math.round(0.5 + list.getItems().size() * list.draggedItem.outerWidth() / $(list.container).outerWidth())) * list.draggedItem.outerHeight() : $(list.container).outerHeight();
  7413. list.offsetLimit = $(list.container).offset();
  7414. list.offsetLimit.right = list.offsetLimit.left + $(list.container).outerWidth() - list.draggedItem.outerWidth();
  7415. list.offsetLimit.bottom = list.offsetLimit.top + containerHeight - list.draggedItem.outerHeight();
  7416. }
  7417. //create placeholder item
  7418. var h = list.draggedItem.height();
  7419. var w = list.draggedItem.width();
  7420. if (opts.tagName == "tr") {
  7421. list.draggedItem.children().each(function() { $(this).width($(this).width()); });
  7422. list.placeHolderItem = list.draggedItem.clone().attr("data-placeholder", true);
  7423. list.draggedItem.after(list.placeHolderItem);
  7424. //list.placeHolderItem.children().each(function() { $(this).css({ borderWidth:0, width: $(this).width() + 1, height: $(this).height() + 1 }).html("&nbsp;"); });
  7425. list.placeHolderItem.children().each(function() { $(this).html("&nbsp;"); });
  7426. } else {
  7427. list.draggedItem.after(opts.placeHolderTemplate);
  7428. list.placeHolderItem = list.draggedItem.next().css({ height: h, width: w }).attr("data-placeholder", true);
  7429. }
  7430. if (opts.tagName == "td") {
  7431. var listTable = list.draggedItem.closest("table").get(0);
  7432. $("<table id='" + listTable.id + "' style='border-width: 0px;' class='dragSortItem " + listTable.className + "'><tr></tr></table>").appendTo("body").children().append(list.draggedItem);
  7433. }
  7434. //style draggedItem while dragging
  7435. var orig = list.draggedItem.attr("style");
  7436. list.draggedItem.attr("data-origstyle", orig ? orig : "");
  7437. list.draggedItem.css({ position: "absolute", opacity: 0.8, "z-index": 999, height: h, width: w });
  7438. //auto-scroll setup
  7439. list.scroll = { moveX: 0, moveY: 0, maxX: $(document).width() - $(window).width(), maxY: $(document).height() - $(window).height() };
  7440. list.scroll.scrollY = window.setInterval(function() {
  7441. if (opts.scrollContainer != window) {
  7442. $(opts.scrollContainer).scrollTop($(opts.scrollContainer).scrollTop() + list.scroll.moveY);
  7443. return;
  7444. }
  7445. var t = $(opts.scrollContainer).scrollTop();
  7446. if (list.scroll.moveY > 0 && t < list.scroll.maxY || list.scroll.moveY < 0 && t > 0) {
  7447. $(opts.scrollContainer).scrollTop(t + list.scroll.moveY);
  7448. list.draggedItem.css("top", list.draggedItem.offset().top + list.scroll.moveY + 1);
  7449. }
  7450. }, 10);
  7451. list.scroll.scrollX = window.setInterval(function() {
  7452. if (opts.scrollContainer != window) {
  7453. $(opts.scrollContainer).scrollLeft($(opts.scrollContainer).scrollLeft() + list.scroll.moveX);
  7454. return;
  7455. }
  7456. var l = $(opts.scrollContainer).scrollLeft();
  7457. if (list.scroll.moveX > 0 && l < list.scroll.maxX || list.scroll.moveX < 0 && l > 0) {
  7458. $(opts.scrollContainer).scrollLeft(l + list.scroll.moveX);
  7459. list.draggedItem.css("left", list.draggedItem.offset().left + list.scroll.moveX + 1);
  7460. }
  7461. }, 10);
  7462. //misc
  7463. $(lists).each(function(i, l) { l.createDropTargets(); l.buildPositionTable(); });
  7464. list.setPos(e.pageX, e.pageY);
  7465. $(document).bind("mousemove", list.swapItems);
  7466. $(document).bind("mouseup", list.dropItem);
  7467. if (opts.scrollContainer != window)
  7468. $(window).bind("wheel", list.wheel);
  7469. },
  7470. //set position of draggedItem
  7471. setPos: function(x, y) {
  7472. //remove mouse offset so mouse cursor remains in same place on draggedItem instead of top left corner
  7473. var top = y - this.offset.top;
  7474. var left = x - this.offset.left;
  7475. //limit top, left to within box draggedItem can't be dragged outside of
  7476. if (!opts.dragBetween) {
  7477. top = Math.min(this.offsetLimit.bottom, Math.max(top, this.offsetLimit.top));
  7478. left = Math.min(this.offsetLimit.right, Math.max(left, this.offsetLimit.left));
  7479. }
  7480. //adjust top & left calculations to parent offset
  7481. var parent = this.draggedItem.offsetParent().not("body").offset(); //offsetParent returns body even when it's static, if not static offset is only factoring margin
  7482. if (parent != null) {
  7483. top -= parent.top;
  7484. left -= parent.left;
  7485. }
  7486. //set x or y auto-scroll amount
  7487. if (opts.scrollContainer == window) {
  7488. y -= $(window).scrollTop();
  7489. x -= $(window).scrollLeft();
  7490. y = Math.max(0, y - $(window).height() + 5) + Math.min(0, y - 5);
  7491. x = Math.max(0, x - $(window).width() + 5) + Math.min(0, x - 5);
  7492. } else {
  7493. var cont = $(opts.scrollContainer);
  7494. var offset = cont.offset();
  7495. y = Math.max(0, y - cont.height() - offset.top) + Math.min(0, y - offset.top);
  7496. x = Math.max(0, x - cont.width() - offset.left) + Math.min(0, x - offset.left);
  7497. }
  7498. list.scroll.moveX = x == 0 ? 0 : x * opts.scrollSpeed / Math.abs(x);
  7499. list.scroll.moveY = y == 0 ? 0 : y * opts.scrollSpeed / Math.abs(y);
  7500. //move draggedItem to new mouse cursor location
  7501. this.draggedItem.css({ top: top, left: left });
  7502. },
  7503. //if scroll container is a div allow mouse wheel to scroll div instead of window when mouse is hovering over
  7504. wheel: function(e) {
  7505. if (list && opts.scrollContainer != window) {
  7506. var cont = $(opts.scrollContainer);
  7507. var offset = cont.offset();
  7508. e = e.originalEvent;
  7509. if (e.clientX > offset.left && e.clientX < offset.left + cont.width() && e.clientY > offset.top && e.clientY < offset.top + cont.height()) {
  7510. var deltaY = (e.deltaMode == 0 ? 1 : 10) * e.deltaY;
  7511. cont.scrollTop(cont.scrollTop() + deltaY);
  7512. e.preventDefault();
  7513. }
  7514. }
  7515. },
  7516. //build a table recording all the positions of the moveable list items
  7517. buildPositionTable: function() {
  7518. var pos = [];
  7519. this.getItems().not([list.draggedItem[0], list.placeHolderItem[0]]).each(function(i) {
  7520. var loc = $(this).offset();
  7521. loc.right = loc.left + $(this).outerWidth();
  7522. loc.bottom = loc.top + $(this).outerHeight();
  7523. loc.elm = this;
  7524. pos[i] = loc;
  7525. });
  7526. this.pos = pos;
  7527. },
  7528. dropItem: function() {
  7529. if (list.draggedItem == null)
  7530. return;
  7531. //list.draggedItem.attr("style", "") doesn't work on IE8 and jQuery 1.5 or lower
  7532. //list.draggedItem.removeAttr("style") doesn't work on chrome and jQuery 1.6 (works jQuery 1.5 or lower)
  7533. var orig = list.draggedItem.attr("data-origstyle");
  7534. list.draggedItem.attr("style", orig);
  7535. if (orig == "")
  7536. list.draggedItem.removeAttr("style");
  7537. list.draggedItem.removeAttr("data-origstyle");
  7538. list.styleDragHandlers(true);
  7539. list.placeHolderItem.before(list.draggedItem);
  7540. list.placeHolderItem.remove();
  7541. $("[data-droptarget], .dragSortItem").remove();
  7542. window.clearInterval(list.scroll.scrollY);
  7543. window.clearInterval(list.scroll.scrollX);
  7544. //if position changed call dragEnd
  7545. if (list.draggedItem.attr("data-origpos") != $(lists).index(list) + "-" + $(list.container).children().index(list.draggedItem))
  7546. if (opts.dragEnd.apply(list.draggedItem) == false) { //if dragEnd returns false revert order
  7547. var pos = list.draggedItem.attr("data-origpos").split('-');
  7548. var nextItem = $(lists[pos[0]].container).children().not(list.draggedItem).eq(pos[1]);
  7549. if (nextItem.size() > 0)
  7550. nextItem.before(list.draggedItem);
  7551. else if (pos[1] == 0) //was the only item in list
  7552. $(lists[pos[0]].container).prepend(list.draggedItem);
  7553. else //was the last item in list
  7554. $(lists[pos[0]].container).append(list.draggedItem);
  7555. }
  7556. list.draggedItem.removeAttr("data-origpos");
  7557. list.draggedItem = null;
  7558. $(document).unbind("mousemove", list.swapItems);
  7559. $(document).unbind("mouseup", list.dropItem);
  7560. if (opts.scrollContainer != window)
  7561. $(window).unbind("wheel", list.wheel);
  7562. return false;
  7563. },
  7564. //swap the draggedItem (represented visually by placeholder) with the list item the it has been dragged on top of
  7565. swapItems: function(e) {
  7566. if (list.draggedItem == null)
  7567. return false;
  7568. //move draggedItem to mouse location
  7569. list.setPos(e.pageX, e.pageY);
  7570. //retrieve list and item position mouse cursor is over
  7571. var ei = list.findPos(e.pageX, e.pageY);
  7572. var nlist = list;
  7573. for (var i = 0; ei == -1 && opts.dragBetween && i < lists.length; i++) {
  7574. ei = lists[i].findPos(e.pageX, e.pageY);
  7575. nlist = lists[i];
  7576. }
  7577. //if not over another moveable list item return
  7578. if (ei == -1)
  7579. return false;
  7580. //save fixed items locations
  7581. var children = function() { return $(nlist.container).children().not(nlist.draggedItem); };
  7582. var fixed = children().not(opts.itemSelector).each(function(i) { this.idx = children().index(this); });
  7583. //if moving draggedItem up or left place placeHolder before list item the dragged item is hovering over otherwise place it after
  7584. if (lastPos == null || lastPos.top > list.draggedItem.offset().top || lastPos.left > list.draggedItem.offset().left)
  7585. $(nlist.pos[ei].elm).before(list.placeHolderItem);
  7586. else
  7587. $(nlist.pos[ei].elm).after(list.placeHolderItem);
  7588. //restore fixed items location
  7589. fixed.each(function() {
  7590. var elm = children().eq(this.idx).get(0);
  7591. if (this != elm && children().index(this) < this.idx)
  7592. $(this).insertAfter(elm);
  7593. else if (this != elm)
  7594. $(this).insertBefore(elm);
  7595. });
  7596. //misc
  7597. $(lists).each(function(i, l) { l.createDropTargets(); l.buildPositionTable(); });
  7598. lastPos = list.draggedItem.offset();
  7599. return false;
  7600. },
  7601. //returns the index of the list item the mouse is over
  7602. findPos: function(x, y) {
  7603. for (var i = 0; i < this.pos.length; i++) {
  7604. if (this.pos[i].left < x && this.pos[i].right > x && this.pos[i].top < y && this.pos[i].bottom > y)
  7605. return i;
  7606. }
  7607. return -1;
  7608. },
  7609. //create drop targets which are placeholders at the end of other lists to allow dragging straight to the last position
  7610. createDropTargets: function() {
  7611. if (!opts.dragBetween)
  7612. return;
  7613. $(lists).each(function() {
  7614. var ph = $(this.container).find("[data-placeholder]");
  7615. var dt = $(this.container).find("[data-droptarget]");
  7616. if (ph.size() > 0 && dt.size() > 0)
  7617. dt.remove();
  7618. else if (ph.size() == 0 && dt.size() == 0) {
  7619. if (opts.tagName == "td")
  7620. $(opts.placeHolderTemplate).attr("data-droptarget", true).appendTo(this.container);
  7621. else
  7622. //list.placeHolderItem.clone().removeAttr("data-placeholder") crashes in IE7 and jquery 1.5.1 (doesn't in jquery 1.4.2 or IE8)
  7623. $(this.container).append(list.placeHolderItem.removeAttr("data-placeholder").clone().attr("data-droptarget", true));
  7624. list.placeHolderItem.attr("data-placeholder", true);
  7625. }
  7626. });
  7627. }
  7628. };
  7629. newList.init();
  7630. lists.push(newList);
  7631. });
  7632. return this;
  7633. };
  7634. $.fn.dragsort.defaults = {
  7635. itemSelector: "",
  7636. dragSelector: "",
  7637. dragSelectorExclude: "input, textarea",
  7638. dragEnd: function() { },
  7639. dragBetween: false,
  7640. placeHolderTemplate: "",
  7641. scrollContainer: window,
  7642. scrollSpeed: 5
  7643. };
  7644. })(jQuery);
  7645. define("dragsort", function(){});
  7646. /*!
  7647. * jquery.event.drag - v 2.2
  7648. * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com
  7649. * Open Source MIT License - http://threedubmedia.com/code/license
  7650. */
  7651. ;(function(e){e.fn.drag=function(k,g,j){var i=typeof k=="string"?k:"",h=e.isFunction(k)?k:e.isFunction(g)?g:null;if(i.indexOf("drag")!==0){i="drag"+i}j=(k==h?g:j)||{};return h?this.bind(i,j,h):this.trigger(i)};var b=e.event,a=b.special,d=a.drag={defaults:{which:1,distance:0,not:":input",handle:null,relative:false,drop:true,click:false},datakey:"dragdata",noBubble:true,add:function(i){var h=e.data(this,d.datakey),g=i.data||{};h.related+=1;e.each(d.defaults,function(j,k){if(g[j]!==undefined){h[j]=g[j]}})},remove:function(){e.data(this,d.datakey).related-=1},setup:function(){if(e.data(this,d.datakey)){return}var g=e.extend({related:0},d.defaults);e.data(this,d.datakey,g);b.add(this,"touchstart mousedown",d.init,g);if(this.attachEvent){this.attachEvent("ondragstart",d.dontstart)}},teardown:function(){var g=e.data(this,d.datakey)||{};if(g.related){return}e.removeData(this,d.datakey);b.remove(this,"touchstart mousedown",d.init);d.textselect(true);if(this.detachEvent){this.detachEvent("ondragstart",d.dontstart)}},init:function(i){if(d.touched){return}var g=i.data,h;if(i.which!=0&&g.which>0&&i.which!=g.which){return}if(e(i.target).is(g.not)){return}if(g.handle&&!e(i.target).closest(g.handle,i.currentTarget).length){return}d.touched=i.type=="touchstart"?this:null;g.propagates=1;g.mousedown=this;g.interactions=[d.interaction(this,g)];g.target=i.target;g.pageX=i.pageX;g.pageY=i.pageY;g.dragging=null;h=d.hijack(i,"draginit",g);if(!g.propagates){return}h=d.flatten(h);if(h&&h.length){g.interactions=[];e.each(h,function(){g.interactions.push(d.interaction(this,g))})}g.propagates=g.interactions.length;if(g.drop!==false&&a.drop){a.drop.handler(i,g)}d.textselect(false);if(d.touched){b.add(d.touched,"touchmove touchend",d.handler,g)}else{b.add(document,"mousemove mouseup",d.handler,g)}if(!d.touched||g.live){return false}},interaction:function(h,g){var i=e(h)[g.relative?"position":"offset"]()||{top:0,left:0};return{drag:h,callback:new d.callback(),droppable:[],offset:i}},handler:function(h){var g=h.data;switch(h.type){case !g.dragging&&"touchmove":h.preventDefault();case !g.dragging&&"mousemove":if(Math.pow(h.pageX-g.pageX,2)+Math.pow(h.pageY-g.pageY,2)<Math.pow(g.distance,2)){break}h.target=g.target;d.hijack(h,"dragstart",g);if(g.propagates){g.dragging=true}case"touchmove":h.preventDefault();case"mousemove":if(g.dragging){d.hijack(h,"drag",g);if(g.propagates){if(g.drop!==false&&a.drop){a.drop.handler(h,g)}break}h.type="mouseup"}case"touchend":case"mouseup":default:if(d.touched){b.remove(d.touched,"touchmove touchend",d.handler)}else{b.remove(document,"mousemove mouseup",d.handler)}if(g.dragging){if(g.drop!==false&&a.drop){a.drop.handler(h,g)}d.hijack(h,"dragend",g)}d.textselect(true);if(g.click===false&&g.dragging){e.data(g.mousedown,"suppress.click",new Date().getTime()+5)}g.dragging=d.touched=false;break}},hijack:function(h,o,r,p,k){if(!r){return}var q={event:h.originalEvent,type:h.type},m=o.indexOf("drop")?"drag":"drop",t,l=p||0,j,g,s,n=!isNaN(p)?p:r.interactions.length;h.type=o;h.originalEvent=null;r.results=[];do{if(j=r.interactions[l]){if(o!=="dragend"&&j.cancelled){continue}s=d.properties(h,r,j);j.results=[];e(k||j[m]||r.droppable).each(function(u,i){s.target=i;h.isPropagationStopped=function(){return false};t=i?b.dispatch.call(i,h,s):null;if(t===false){if(m=="drag"){j.cancelled=true;r.propagates-=1}if(o=="drop"){j[m][u]=null}}else{if(o=="dropinit"){j.droppable.push(d.element(t)||i)}}if(o=="dragstart"){j.proxy=e(d.element(t)||j.drag)[0]}j.results.push(t);delete h.result;if(o!=="dropinit"){return t}});r.results[l]=d.flatten(j.results);if(o=="dropinit"){j.droppable=d.flatten(j.droppable)}if(o=="dragstart"&&!j.cancelled){s.update()}}}while(++l<n);h.type=q.type;h.originalEvent=q.event;return d.flatten(r.results)},properties:function(i,g,h){var j=h.callback;j.drag=h.drag;j.proxy=h.proxy||h.drag;j.startX=g.pageX;j.startY=g.pageY;j.deltaX=i.pageX-g.pageX;j.deltaY=i.pageY-g.pageY;j.originalX=h.offset.left;j.originalY=h.offset.top;j.offsetX=j.originalX+j.deltaX;j.offsetY=j.originalY+j.deltaY;j.drop=d.flatten((h.drop||[]).slice());j.available=d.flatten((h.droppable||[]).slice());return j},element:function(g){if(g&&(g.jquery||g.nodeType==1)){return g}},flatten:function(g){return e.map(g,function(h){return h&&h.jquery?e.makeArray(h):h&&h.length?d.flatten(h):h})},textselect:function(g){e(document)[g?"unbind":"bind"]("selectstart",d.dontstart).css("MozUserSelect",g?"":"none");document.unselectable=g?"off":"on"},dontstart:function(){return false},callback:function(){}};d.callback.prototype={update:function(){if(a.drop&&this.available.length){e.each(this.available,function(g){a.drop.locate(this,g)})}}};var f=b.dispatch;b.dispatch=function(g){if(e.data(this,"suppress."+g.type)-new Date().getTime()>0){e.removeData(this,"suppress."+g.type);return}return f.apply(this,arguments)};var c=b.fixHooks.touchstart=b.fixHooks.touchmove=b.fixHooks.touchend=b.fixHooks.touchcancel={props:"clientX clientY pageX pageY screenX screenY".split(" "),filter:function(h,i){if(i){var g=(i.touches&&i.touches[0])||(i.changedTouches&&i.changedTouches[0])||null;if(g){e.each(c.props,function(j,k){h[k]=g[k]})}}return h}};a.draginit=a.dragstart=a.dragend=d})(jQuery);
  7652. define("drag", function(){});
  7653. /*!
  7654. * jquery.event.drop - v 2.2
  7655. * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com
  7656. * Open Source MIT License - http://threedubmedia.com/code/license
  7657. */
  7658. ;(function(d){d.fn.drop=function(i,e,h){var g=typeof i=="string"?i:"",f=d.isFunction(i)?i:d.isFunction(e)?e:null;if(g.indexOf("drop")!==0){g="drop"+g}h=(i==f?e:h)||{};return f?this.bind(g,h,f):this.trigger(g)};d.drop=function(e){e=e||{};b.multi=e.multi===true?Infinity:e.multi===false?1:!isNaN(e.multi)?e.multi:b.multi;b.delay=e.delay||b.delay;b.tolerance=d.isFunction(e.tolerance)?e.tolerance:e.tolerance===null?null:b.tolerance;b.mode=e.mode||b.mode||"intersect"};var c=d.event,a=c.special,b=d.event.special.drop={multi:1,delay:20,mode:"overlap",targets:[],datakey:"dropdata",noBubble:true,add:function(f){var e=d.data(this,b.datakey);e.related+=1},remove:function(){d.data(this,b.datakey).related-=1},setup:function(){if(d.data(this,b.datakey)){return}var e={related:0,active:[],anyactive:0,winner:0,location:{}};d.data(this,b.datakey,e);b.targets.push(this);return false},teardown:function(){var f=d.data(this,b.datakey)||{};if(f.related){return}d.removeData(this,b.datakey);var e=this;b.targets=d.grep(b.targets,function(g){return(g!==e)})},handler:function(g,e){var f,h;if(!e){return}switch(g.type){case"mousedown":case"touchstart":h=d(b.targets);if(typeof e.drop=="string"){h=h.filter(e.drop)}h.each(function(){var i=d.data(this,b.datakey);i.active=[];i.anyactive=0;i.winner=0});e.droppable=h;a.drag.hijack(g,"dropinit",e);break;case"mousemove":case"touchmove":b.event=g;if(!b.timer){b.tolerate(e)}break;case"mouseup":case"touchend":b.timer=clearTimeout(b.timer);if(e.propagates){a.drag.hijack(g,"drop",e);a.drag.hijack(g,"dropend",e)}break}},locate:function(k,h){var l=d.data(k,b.datakey),g=d(k),i=g.offset()||{},e=g.outerHeight(),j=g.outerWidth(),f={elem:k,width:j,height:e,top:i.top,left:i.left,right:i.left+j,bottom:i.top+e};if(l){l.location=f;l.index=h;l.elem=k}return f},contains:function(e,f){return((f[0]||f.left)>=e.left&&(f[0]||f.right)<=e.right&&(f[1]||f.top)>=e.top&&(f[1]||f.bottom)<=e.bottom)},modes:{intersect:function(f,e,g){return this.contains(g,[f.pageX,f.pageY])?1000000000:this.modes.overlap.apply(this,arguments)},overlap:function(f,e,g){return Math.max(0,Math.min(g.bottom,e.bottom)-Math.max(g.top,e.top))*Math.max(0,Math.min(g.right,e.right)-Math.max(g.left,e.left))},fit:function(f,e,g){return this.contains(g,e)?1:0},middle:function(f,e,g){return this.contains(g,[e.left+e.width*0.5,e.top+e.height*0.5])?1:0}},sort:function(f,e){return(e.winner-f.winner)||(f.index-e.index)},tolerate:function(q){var k,e,n,j,l,m,g,p=0,f,h=q.interactions.length,r=[b.event.pageX,b.event.pageY],o=b.tolerance||b.modes[b.mode];do{if(f=q.interactions[p]){if(!f){return}f.drop=[];l=[];m=f.droppable.length;if(o){n=b.locate(f.proxy)}k=0;do{if(g=f.droppable[k]){j=d.data(g,b.datakey);e=j.location;if(!e){continue}j.winner=o?o.call(b,b.event,n,e):b.contains(e,r)?1:0;l.push(j)}}while(++k<m);l.sort(b.sort);k=0;do{if(j=l[k]){if(j.winner&&f.drop.length<b.multi){if(!j.active[p]&&!j.anyactive){if(a.drag.hijack(b.event,"dropstart",q,p,j.elem)[0]!==false){j.active[p]=1;j.anyactive+=1}else{j.winner=0}}if(j.winner){f.drop.push(j.elem)}}else{if(j.active[p]&&j.anyactive==1){a.drag.hijack(b.event,"dropend",q,p,j.elem);j.active[p]=0;j.anyactive-=1}}}}while(++k<m)}}while(++p<h);if(b.last&&r[0]==b.last.pageX&&r[1]==b.last.pageY){delete b.timer}else{b.timer=setTimeout(function(){b.tolerate(q)},b.delay)}b.last=b.event}};a.dropinit=a.dropstart=a.dropend=b})(jQuery);
  7659. define("drop", function(){});
  7660. /**
  7661. * http://git.oschina.net/hbbcs/bootStrap-addTabs
  7662. * Created by joe on 2015-12-19.
  7663. * @param {type} options {
  7664. * content string||html 直接指定内容
  7665. * close bool 是否可以关闭
  7666. * monitor 监视的区域
  7667. * }
  7668. *
  7669. * @returns
  7670. */
  7671. $.fn.addtabs = function (options) {
  7672. var obj = $(this);
  7673. options = $.extend({
  7674. content: '', //直接指定所有页面TABS内容
  7675. close: true, //是否可以关闭
  7676. monitor: 'body', //监视的区域
  7677. nav: '.nav-addtabs',
  7678. tab: '.tab-addtabs',
  7679. iframeUse: true, //使用iframe还是ajax
  7680. iframeHeight: $(window).height() - 50, //固定TAB中IFRAME高度,根据需要自己修改
  7681. callback: function () {
  7682. //关闭后回调函数
  7683. }
  7684. }, options || {});
  7685. var navobj = $(options.nav);
  7686. var tabobj = $(options.tab);
  7687. if (history.pushState) {
  7688. //浏览器前进后退事件
  7689. $(window).on("popstate", function (e) {
  7690. var state = e.originalEvent.state;
  7691. $("a[addtabs=" + state.id + "]", options.monitor).data("pushstate", true).trigger("click");
  7692. });
  7693. }
  7694. $(options.monitor).on('click', '[addtabs]', function (e) {
  7695. if ($(this).attr('url').indexOf("javascript") !== 0) {
  7696. if ($(this).is("a")) {
  7697. e.preventDefault();
  7698. }
  7699. var id = $(this).attr('addtabs');
  7700. var title = $(this).attr('title') ? $(this).attr('title') : $.trim($(this).text());
  7701. var url = $(this).attr('url');
  7702. var content = options.content ? options.content : $(this).attr('content');
  7703. var ajax = $(this).attr('ajax') ? true : false;
  7704. var state = ({
  7705. url: url, title: title, id: id, content: content, ajax: ajax
  7706. });
  7707. document.title = title;
  7708. if (history.pushState && !$(this).data("pushstate")) {
  7709. window.history.pushState(state, title, url);
  7710. }
  7711. $(this).data("pushstate", null);
  7712. _add({
  7713. id: id,
  7714. title: $(this).attr('title') ? $(this).attr('title') : $(this).html(),
  7715. content: content,
  7716. url: url,
  7717. ajax: ajax
  7718. });
  7719. }
  7720. });
  7721. navobj.on('click', '.close-tab', function (e) {
  7722. id = $(this).prev("a").attr("aria-controls");
  7723. _close(id);
  7724. return false;
  7725. });
  7726. navobj.on('dblclick', 'li[role=presentation]', function (e) {
  7727. $(this).find(".close-tab").trigger("click");
  7728. });
  7729. navobj.on('click', 'li[role=presentation]', function (e) {
  7730. $("a[addtabs=" + $("a", this).attr("node-id") + "]").trigger("click");
  7731. });
  7732. $(window).resize(function () {
  7733. $("#nav").width($("#header > .navbar").width() - $(".sidebar-toggle").outerWidth() - $(".navbar-custom-menu").outerWidth() - 20);
  7734. _drop();
  7735. });
  7736. _add = function (opts) {
  7737. id = 'tab_' + opts.id;
  7738. url = opts.url;
  7739. url += (opts.url.indexOf("?") > -1 ? "&addtabs=1" : "?addtabs=1");
  7740. navobj.find("[role='presentation']").removeClass('active');
  7741. tabobj.find("[role='tabpanel']").removeClass('active');
  7742. //如果TAB不存在,创建一个新的TAB
  7743. if ($("#" + id).size() == 0) {
  7744. //创建新TAB的title
  7745. title = $('<li role="presentation" id="tab_' + id + '"><a href="#' + id + '" node-id="' + opts.id + '" aria-controls="' + id + '" role="tab" data-toggle="tab">' + opts.title + '</a></li>');
  7746. //是否允许关闭
  7747. if (options.close) {
  7748. title.append(' <i class="close-tab fa fa-remove"></i>');
  7749. }
  7750. //创建新TAB的内容
  7751. content = $('<div role="tabpanel" class="tab-pane" id="' + id + '"></div>');
  7752. //是否指定TAB内容
  7753. if (opts.content) {
  7754. content.append(opts.content);
  7755. } else if (options.iframeUse && !opts.ajax) {//没有内容,使用IFRAME打开链接
  7756. var height = options.iframeHeight;
  7757. content.append('<iframe src="' + url + '" width="100%" height="' + height + '" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe></div>');
  7758. } else {
  7759. $.get(url, function (data) {
  7760. content.append(data);
  7761. });
  7762. }
  7763. //加入TABS
  7764. if ($('.tabdrop li').size() > 0) {
  7765. $('.tabdrop ul').append(title);
  7766. } else {
  7767. navobj.append(title);
  7768. }
  7769. tabobj.append(content);
  7770. }
  7771. //激活TAB
  7772. $("#tab_" + id).addClass('active');
  7773. $("#" + id).addClass("active");
  7774. _drop();
  7775. };
  7776. _close = function (id) {
  7777. //如果关闭的是当前激活的TAB,激活他的前一个TAB
  7778. if (obj.find("li.active").attr('id') == "tab_" + id) {
  7779. if ($("#tab_" + id).prev().not(".tabdrop").size() > 0) {
  7780. $("#tab_" + id).prev().not(".tabdrop").find("a").trigger("click");
  7781. } else if ($("#tab_" + id).next().size() > 0) {
  7782. $("#tab_" + id).next().trigger("click");
  7783. }
  7784. }
  7785. //关闭TAB
  7786. $("#tab_" + id).remove();
  7787. $("#" + id).remove();
  7788. _drop();
  7789. options.callback();
  7790. };
  7791. _drop = function () {
  7792. //创建下拉标签
  7793. var dropdown = $('<li class="dropdown pull-right hide tabdrop"><a class="dropdown-toggle" data-toggle="dropdown" href="javascript:;">' +
  7794. '<i class="glyphicon glyphicon-align-justify"></i>' +
  7795. ' <b class="caret"></b></a><ul class="dropdown-menu"></ul></li>');
  7796. //检测是否已增加
  7797. if (!$('.tabdrop').html()) {
  7798. dropdown.prependTo(navobj);
  7799. } else {
  7800. dropdown = navobj.find('.tabdrop');
  7801. }
  7802. //检测是否有下拉样式
  7803. if (navobj.parent().is('.tabs-below')) {
  7804. dropdown.addClass('dropup');
  7805. }
  7806. var collection = 0;
  7807. var maxwidth = navobj.width() - 60;
  7808. var liwidth = 0;
  7809. //检查超过一行的标签页
  7810. var litabs = navobj.append(dropdown.find('li')).find('>li').not('.tabdrop');
  7811. var lisize = litabs.size();
  7812. litabs.each(function (i, j) {
  7813. liwidth += $(this).width();
  7814. if (collection == 0 && i == lisize - 1 && liwidth <= navobj.width()) {
  7815. return true;
  7816. }
  7817. if (liwidth > maxwidth) {
  7818. dropdown.find('ul').append($(this));
  7819. collection++;
  7820. }
  7821. });
  7822. //如果有超出的,显示下拉标签
  7823. if (collection > 0) {
  7824. dropdown.removeClass('hide');
  7825. if (dropdown.find('.active').length == 1) {
  7826. dropdown.addClass('active');
  7827. } else {
  7828. dropdown.removeClass('active');
  7829. }
  7830. } else {
  7831. dropdown.addClass('hide');
  7832. }
  7833. };
  7834. };
  7835. define("addtabs", function(){});
  7836. (function(c){var d=document,a='appendChild',i='styleSheet',s=d.createElement('style');s.type='text/css';d.getElementsByTagName('head')[0][a](s);s[i]?s[i].cssText=c:s[a](d.createTextNode(c));})
  7837. ('.fixed-table-container .bs-checkbox,.fixed-table-container .no-records-found{text-align:center}.fixed-table-body thead th .th-inner,.table td,.table th{box-sizing:border-box}.bootstrap-table .table{margin-bottom:0!important;border-bottom:1px solid #ddd;border-collapse:collapse!important;border-radius:1px}.bootstrap-table .table:not(.table-condensed),.bootstrap-table .table:not(.table-condensed)>tbody>tr>td,.bootstrap-table .table:not(.table-condensed)>tbody>tr>th,.bootstrap-table .table:not(.table-condensed)>tfoot>tr>td,.bootstrap-table .table:not(.table-condensed)>tfoot>tr>th,.bootstrap-table .table:not(.table-condensed)>thead>tr>td{padding:8px}.bootstrap-table .table.table-no-bordered>tbody>tr>td,.bootstrap-table .table.table-no-bordered>thead>tr>th{border-right:2px solid transparent}.bootstrap-table .table.table-no-bordered>tbody>tr>td:last-child{border-right:none}.fixed-table-container{position:relative;clear:both;border:1px solid #ddd;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.fixed-table-container.table-no-bordered{border:1px solid transparent}.fixed-table-footer,.fixed-table-header{overflow:hidden}.fixed-table-footer{border-top:1px solid #ddd}.fixed-table-body{overflow-x:auto;overflow-y:auto;height:100%}.fixed-table-container table{width:100%}.fixed-table-container thead th{height:0;padding:0;margin:0;border-left:1px solid #ddd}.fixed-table-container thead th:focus{outline:transparent solid 0}.fixed-table-container thead th:first-child{border-left:none;border-top-left-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px}.fixed-table-container tbody td .th-inner,.fixed-table-container thead th .th-inner{padding:8px;line-height:24px;vertical-align:top;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fixed-table-container thead th .sortable{cursor:pointer;background-position:right;background-repeat:no-repeat;padding-right:30px}.fixed-table-container thead th .both{background-image:url(\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC\')}.fixed-table-container thead th .asc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==)}.fixed-table-container thead th .desc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII=)}.fixed-table-container th.detail{width:30px}.fixed-table-container tbody td{border-left:1px solid #ddd}.fixed-table-container tbody tr:first-child td{border-top:none}.fixed-table-container tbody td:first-child{border-left:none}.fixed-table-container tbody .selected td{background-color:#f5f5f5}.fixed-table-container .bs-checkbox .th-inner{padding:8px 0}.fixed-table-container input[type=radio],.fixed-table-container input[type=checkbox]{margin:0 auto!important}.fixed-table-pagination .pagination-detail,.fixed-table-pagination div.pagination{margin-top:10px;margin-bottom:10px}.fixed-table-pagination div.pagination .pagination{margin:0}.fixed-table-pagination .pagination a{padding:6px 12px;line-height:1.428571429}.fixed-table-pagination .pagination-info{line-height:34px;margin-right:5px}.fixed-table-pagination .btn-group{position:relative;display:inline-block;vertical-align:middle}.fixed-table-pagination .dropup .dropdown-menu{margin-bottom:0}.fixed-table-pagination .page-list{display:inline-block}.fixed-table-toolbar .columns-left{margin-right:5px}.fixed-table-toolbar .columns-right{margin-left:5px}.fixed-table-toolbar .columns label{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.428571429}.fixed-table-toolbar .bs-bars,.fixed-table-toolbar .columns,.fixed-table-toolbar .search{position:relative;margin-top:10px;margin-bottom:10px;line-height:34px}.fixed-table-pagination li.disabled a{pointer-events:none;cursor:default}.fixed-table-loading{display:none;position:absolute;top:42px;right:0;bottom:0;left:0;z-index:99;background-color:#fff;text-align:center}.fixed-table-body .card-view .title{font-weight:700;display:inline-block;min-width:30%;text-align:left!important}.table td,.table th{vertical-align:middle}.fixed-table-toolbar .dropdown-menu{text-align:left;max-height:300px;overflow:auto}.fixed-table-toolbar .btn-group>.btn-group{display:inline-block;margin-left:-1px!important}.fixed-table-toolbar .btn-group>.btn-group>.btn{border-radius:0}.fixed-table-toolbar .btn-group>.btn-group:first-child>.btn{border-top-left-radius:4px;border-bottom-left-radius:4px}.fixed-table-toolbar .btn-group>.btn-group:last-child>.btn{border-top-right-radius:4px;border-bottom-right-radius:4px}.bootstrap-table .table>thead>tr>th{vertical-align:bottom;border-bottom:1px solid #ddd}.bootstrap-table .table thead>tr>th{padding:0;margin:0}.bootstrap-table .fixed-table-footer tbody>tr>td{padding:0!important}.bootstrap-table .fixed-table-footer .table{border-bottom:none;border-radius:0;padding:0!important}.pull-right .dropdown-menu{right:0;left:auto}p.fixed-table-scroll-inner{width:100%;height:200px}div.fixed-table-scroll-outer{top:0;left:0;visibility:hidden;width:200px;height:150px;overflow:hidden}');