require-frontend.min.js 364 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772
  1. /*! jQuery v2.2.4 | (c) jQuery Foundation | jquery.org/license */
  2. !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="2.2.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isPlainObject:function(a){var b;if("object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype||{},"isPrototypeOf"))return!1;for(b in a);return void 0===b||k.call(a,b)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=d.createElement("script"),b.text=a,d.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:h.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(d=e.call(arguments,2),f=function(){return a.apply(b||this,d.concat(e.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=R.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return h.call(b,a)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?void 0!==c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?h.call(n(a),this[0]):h.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||n.uniqueSort(e),D.test(a)&&e.reverse()),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.removeEventListener("DOMContentLoaded",J),a.removeEventListener("load",J),n.ready()}n.ready.promise=function(b){return I||(I=n.Deferred(),"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(n.ready):(d.addEventListener("DOMContentLoaded",J),a.addEventListener("load",J))),I.promise(b)},n.ready.promise();var K=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)K(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},L=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function M(){this.expando=n.expando+M.uid++}M.uid=1,M.prototype={register:function(a,b){var c=b||{};return a.nodeType?a[this.expando]=c:Object.defineProperty(a,this.expando,{value:c,writable:!0,configurable:!0}),a[this.expando]},cache:function(a){if(!L(a))return{};var b=a[this.expando];return b||(b={},L(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[b]=c;else for(d in b)e[d]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=a[this.expando];if(void 0!==f){if(void 0===b)this.register(a);else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in f?d=[b,e]:(d=e,d=d in f?[d]:d.match(G)||[])),c=d.length;while(c--)delete f[d[c]]}(void 0===b||n.isEmptyObject(f))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!n.isEmptyObject(b)}};var N=new M,O=new M,P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function R(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Q,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:P.test(c)?n.parseJSON(c):c;
  3. }catch(e){}O.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return O.hasData(a)||N.hasData(a)},data:function(a,b,c){return O.access(a,b,c)},removeData:function(a,b){O.remove(a,b)},_data:function(a,b,c){return N.access(a,b,c)},_removeData:function(a,b){N.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=O.get(f),1===f.nodeType&&!N.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):K(this,function(b){var c,d;if(f&&void 0===b){if(c=O.get(f,a)||O.get(f,a.replace(Q,"-$&").toLowerCase()),void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),a.indexOf("-")>-1&&void 0!==c&&O.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){O.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=N.get(a,b),c&&(!d||n.isArray(c)?d=N.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return N.get(a,c)||N.access(a,c,{empty:n.Callbacks("once memory").add(function(){N.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=N.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function W(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&T.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,Z=/^$|\/(?:java|ecma)script/i,$={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};$.optgroup=$.option,$.tbody=$.tfoot=$.colgroup=$.caption=$.thead,$.th=$.td;function _(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function aa(a,b){for(var c=0,d=a.length;d>c;c++)N.set(a[c],"globalEval",!b||N.get(b[c],"globalEval"))}var ba=/<|&#?\w+;/;function ca(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],o=0,p=a.length;p>o;o++)if(f=a[o],f||0===f)if("object"===n.type(f))n.merge(m,f.nodeType?[f]:f);else if(ba.test(f)){g=g||l.appendChild(b.createElement("div")),h=(Y.exec(f)||["",""])[1].toLowerCase(),i=$[h]||$._default,g.innerHTML=i[1]+n.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;n.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",o=0;while(f=m[o++])if(d&&n.inArray(f,d)>-1)e&&e.push(f);else if(j=n.contains(f.ownerDocument,f),g=_(l.appendChild(f),"script"),j&&aa(g),c){k=0;while(f=g[k++])Z.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var da=/^key/,ea=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,fa=/^([^.]*)(?:\.(.+)|)/;function ga(){return!0}function ha(){return!1}function ia(){try{return d.activeElement}catch(a){}}function ja(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ja(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ha;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return"undefined"!=typeof n&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(G)||[""],j=b.length;while(j--)h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=N.hasData(a)&&N.get(a);if(r&&(i=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=fa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&N.remove(a,"handle events")}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(N.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||d,e=c.documentElement,f=c.body,a.pageX=b.clientX+(e&&e.scrollLeft||f&&f.scrollLeft||0)-(e&&e.clientLeft||f&&f.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||f&&f.scrollTop||0)-(e&&e.clientTop||f&&f.clientTop||0)),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ea.test(f)?this.mouseHooks:da.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=d),3===a.target.nodeType&&(a.target=a.target.parentNode),h.filter?h.filter(a,g):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==ia()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===ia()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ga:ha):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:ha,isPropagationStopped:ha,isImmediatePropagationStopped:ha,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ga,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ga,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ga,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||n.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),n.fn.extend({on:function(a,b,c,d){return ja(this,a,b,c,d)},one:function(a,b,c,d){return ja(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=ha),this.each(function(){n.event.remove(this,a,c,b)})}});var ka=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,la=/<script|<style|<link/i,ma=/checked\s*(?:[^=]|=\s*.checked.)/i,na=/^true\/(.*)/,oa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function pa(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function qa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function ra(a){var b=na.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function sa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(N.hasData(a)&&(f=N.access(a),g=N.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}O.hasData(a)&&(h=O.access(a),i=n.extend({},h),O.set(b,i))}}function ta(a,b){var c=b.nodeName.toLowerCase();"input"===c&&X.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function ua(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&ma.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),ua(f,b,c,d)});if(o&&(e=ca(b,a[0].ownerDocument,!1,a,d),g=e.firstChild,1===e.childNodes.length&&(e=g),g||d)){for(h=n.map(_(e,"script"),qa),i=h.length;o>m;m++)j=e,m!==p&&(j=n.clone(j,!0,!0),i&&n.merge(h,_(j,"script"))),c.call(a[m],j,m);if(i)for(k=h[h.length-1].ownerDocument,n.map(h,ra),m=0;i>m;m++)j=h[m],Z.test(j.type||"")&&!N.access(j,"globalEval")&&n.contains(k,j)&&(j.src?n._evalUrl&&n._evalUrl(j.src):n.globalEval(j.textContent.replace(oa,"")))}return a}function va(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(_(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&aa(_(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(ka,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=_(h),f=_(a),d=0,e=f.length;e>d;d++)ta(f[d],g[d]);if(b)if(c)for(f=f||_(a),g=g||_(h),d=0,e=f.length;e>d;d++)sa(f[d],g[d]);else sa(a,h);return g=_(h,"script"),g.length>0&&aa(g,!i&&_(a,"script")),h},cleanData:function(a){for(var b,c,d,e=n.event.special,f=0;void 0!==(c=a[f]);f++)if(L(c)){if(b=c[N.expando]){if(b.events)for(d in b.events)e[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);c[N.expando]=void 0}c[O.expando]&&(c[O.expando]=void 0)}}}),n.fn.extend({domManip:ua,detach:function(a){return va(this,a,!0)},remove:function(a){return va(this,a)},text:function(a){return K(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.appendChild(a)}})},prepend:function(){return ua(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=pa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return ua(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(_(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return K(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!la.test(a)&&!$[(Y.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(_(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return ua(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(_(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),f=e.length-1,h=0;f>=h;h++)c=h===f?this:this.clone(!0),n(e[h])[b](c),g.apply(d,c.get());return this.pushStack(d)}});var wa,xa={HTML:"block",BODY:"block"};function ya(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function za(a){var b=d,c=xa[a];return c||(c=ya(a,b),"none"!==c&&c||(wa=(wa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=wa[0].contentDocument,b.write(),b.close(),c=ya(a,b),wa.detach()),xa[a]=c),c}var Aa=/^margin/,Ba=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ca=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)},Da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Ea=d.documentElement;!function(){var b,c,e,f,g=d.createElement("div"),h=d.createElement("div");if(h.style){h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,g.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",g.appendChild(h);function i(){h.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",h.innerHTML="",Ea.appendChild(g);var d=a.getComputedStyle(h);b="1%"!==d.top,f="2px"===d.marginLeft,c="4px"===d.width,h.style.marginRight="50%",e="4px"===d.marginRight,Ea.removeChild(g)}n.extend(l,{pixelPosition:function(){return i(),b},boxSizingReliable:function(){return null==c&&i(),c},pixelMarginRight:function(){return null==c&&i(),e},reliableMarginLeft:function(){return null==c&&i(),f},reliableMarginRight:function(){var b,c=h.appendChild(d.createElement("div"));return c.style.cssText=h.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",h.style.width="1px",Ea.appendChild(g),b=!parseFloat(a.getComputedStyle(c).marginRight),Ea.removeChild(g),h.removeChild(c),b}})}}();function Fa(a,b,c){var d,e,f,g,h=a.style;return c=c||Ca(a),g=c?c.getPropertyValue(b)||c[b]:void 0,""!==g&&void 0!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),c&&!l.pixelMarginRight()&&Ba.test(g)&&Aa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f),void 0!==g?g+"":g}function Ga(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Ha=/^(none|table(?!-c[ea]).+)/,Ia={position:"absolute",visibility:"hidden",display:"block"},Ja={letterSpacing:"0",fontWeight:"400"},Ka=["Webkit","O","Moz","ms"],La=d.createElement("div").style;function Ma(a){if(a in La)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ka.length;while(c--)if(a=Ka[c]+b,a in La)return a}function Na(a,b,c){var d=T.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Oa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Pa(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ca(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Fa(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ba.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Oa(a,b,c||(g?"border":"content"),d,f)+"px"}function Qa(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=N.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=N.access(d,"olddisplay",za(d.nodeName)))):(e=V(d),"none"===c&&e||N.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Fa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=T.exec(c))&&e[1]&&(c=W(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Ma(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Fa(a,b,d)),"normal"===e&&b in Ja&&(e=Ja[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Ha.test(n.css(a,"display"))&&0===a.offsetWidth?Da(a,Ia,function(){return Pa(a,b,d)}):Pa(a,b,d):void 0},set:function(a,c,d){var e,f=d&&Ca(a),g=d&&Oa(a,b,d,"border-box"===n.css(a,"boxSizing",!1,f),f);return g&&(e=T.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=n.css(a,b)),Na(a,c,g)}}}),n.cssHooks.marginLeft=Ga(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Fa(a,"marginLeft"))||a.getBoundingClientRect().left-Da(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px":void 0}),n.cssHooks.marginRight=Ga(l.reliableMarginRight,function(a,b){return b?Da(a,{display:"inline-block"},Fa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Aa.test(a)||(n.cssHooks[a+b].set=Na)}),n.fn.extend({css:function(a,b){return K(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ca(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Qa(this,!0)},hide:function(){return Qa(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function Ra(a,b,c,d,e){return new Ra.prototype.init(a,b,c,d,e)}n.Tween=Ra,Ra.prototype={constructor:Ra,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ra.propHooks[this.prop];return a&&a.get?a.get(this):Ra.propHooks._default.get(this)},run:function(a){var b,c=Ra.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ra.propHooks._default.set(this),this}},Ra.prototype.init.prototype=Ra.prototype,Ra.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},Ra.propHooks.scrollTop=Ra.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=Ra.prototype.init,n.fx.step={};var Sa,Ta,Ua=/^(?:toggle|show|hide)$/,Va=/queueHooks$/;function Wa(){return a.setTimeout(function(){Sa=void 0}),Sa=n.now()}function Xa(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=U[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ya(a,b,c){for(var d,e=(_a.tweeners[b]||[]).concat(_a.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Za(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&V(a),q=N.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?N.get(a,"olddisplay")||za(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Ua.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?za(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=N.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;N.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ya(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function $a(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function _a(a,b,c){var d,e,f=0,g=_a.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Sa||Wa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:Sa||Wa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for($a(k,j.opts.specialEasing);g>f;f++)if(d=_a.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,Ya,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(_a,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return W(c.elem,a,T.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],_a.tweeners[c]=_a.tweeners[c]||[],_a.tweeners[c].unshift(b)},prefilters:[Za],prefilter:function(a,b){b?_a.prefilters.unshift(a):_a.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=_a(this,n.extend({},a),f);(e||N.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=N.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Va.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=N.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Xa(b,!0),a,d,e)}}),n.each({slideDown:Xa("show"),slideUp:Xa("hide"),slideToggle:Xa("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Sa=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Sa=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ta||(Ta=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(Ta),Ta=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",l.checkOn=""!==a.value,l.optSelected=c.selected,b.disabled=!0,l.optDisabled=!c.disabled,a=d.createElement("input"),a.value="t",a.type="radio",l.radioValue="t"===a.value}();var ab,bb=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return K(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?ab:void 0)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)}}),ab={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=bb[b]||n.find.attr;bb[b]=function(a,b,d){var e,f;return d||(f=bb[b],bb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,bb[b]=f),e}});var cb=/^(?:input|select|textarea|button)$/i,db=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return K(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),
  4. void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):cb.test(a.nodeName)||db.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var eb=/[\t\r\n\f]/g;function fb(a){return a.getAttribute&&a.getAttribute("class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,fb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,fb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=fb(c),d=1===c.nodeType&&(" "+e+" ").replace(eb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,fb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=fb(this),b&&N.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":N.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+fb(c)+" ").replace(eb," ").indexOf(b)>-1)return!0;return!1}});var gb=/\r/g,hb=/[\x20\t\r\n\f]+/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(gb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a)).replace(hb," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(n.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var ib=/^(?:focusinfocus|focusoutblur)$/;n.extend(n.event,{trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!ib.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),l=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},f||!o.trigger||o.trigger.apply(e,c)!==!1)){if(!f&&!o.noBubble&&!n.isWindow(e)){for(j=o.delegateType||q,ib.test(j+q)||(h=h.parentNode);h;h=h.parentNode)p.push(h),i=h;i===(e.ownerDocument||d)&&p.push(i.defaultView||i.parentWindow||a)}g=0;while((h=p[g++])&&!b.isPropagationStopped())b.type=g>1?j:o.bindType||q,m=(N.get(h,"events")||{})[b.type]&&N.get(h,"handle"),m&&m.apply(h,c),m=l&&h[l],m&&m.apply&&L(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=q,f||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!L(e)||l&&n.isFunction(e[q])&&!n.isWindow(e)&&(i=e[l],i&&(e[l]=null),n.event.triggered=q,e[q](),n.event.triggered=void 0,i&&(e[l]=i)),b.result}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b)}}),n.fn.extend({trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),l.focusin="onfocusin"in a,l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=N.access(d,b);e||d.addEventListener(a,c,!0),N.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=N.access(d,b)-1;e?N.access(d,b,e):(d.removeEventListener(a,c,!0),N.remove(d,b))}}});var jb=a.location,kb=n.now(),lb=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var mb=/#.*$/,nb=/([?&])_=[^&]*/,ob=/^(.*?):[ \t]*([^\r\n]*)$/gm,pb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,qb=/^(?:GET|HEAD)$/,rb=/^\/\//,sb={},tb={},ub="*/".concat("*"),vb=d.createElement("a");vb.href=jb.href;function wb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function xb(a,b,c,d){var e={},f=a===tb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function yb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function zb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Ab(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:jb.href,type:"GET",isLocal:pb.test(jb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ub,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?yb(yb(a,n.ajaxSettings),b):yb(n.ajaxSettings,a)},ajaxPrefilter:wb(sb),ajaxTransport:wb(tb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m=n.ajaxSetup({},c),o=m.context||m,p=m.context&&(o.nodeType||o.jquery)?n(o):n.event,q=n.Deferred(),r=n.Callbacks("once memory"),s=m.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,getResponseHeader:function(a){var b;if(2===v){if(!h){h={};while(b=ob.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===v?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return v||(a=u[c]=u[c]||a,t[a]=b),this},overrideMimeType:function(a){return v||(m.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>v)for(b in a)s[b]=[s[b],a[b]];else x.always(a[x.status]);return this},abort:function(a){var b=a||w;return e&&e.abort(b),z(0,b),this}};if(q.promise(x).complete=r.add,x.success=x.done,x.error=x.fail,m.url=((b||m.url||jb.href)+"").replace(mb,"").replace(rb,jb.protocol+"//"),m.type=c.method||c.type||m.method||m.type,m.dataTypes=n.trim(m.dataType||"*").toLowerCase().match(G)||[""],null==m.crossDomain){j=d.createElement("a");try{j.href=m.url,j.href=j.href,m.crossDomain=vb.protocol+"//"+vb.host!=j.protocol+"//"+j.host}catch(y){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=n.param(m.data,m.traditional)),xb(sb,m,c,x),2===v)return x;k=n.event&&m.global,k&&0===n.active++&&n.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!qb.test(m.type),f=m.url,m.hasContent||(m.data&&(f=m.url+=(lb.test(f)?"&":"?")+m.data,delete m.data),m.cache===!1&&(m.url=nb.test(f)?f.replace(nb,"$1_="+kb++):f+(lb.test(f)?"&":"?")+"_="+kb++)),m.ifModified&&(n.lastModified[f]&&x.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&x.setRequestHeader("If-None-Match",n.etag[f])),(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",m.contentType),x.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+ub+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)x.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(o,x,m)===!1||2===v))return x.abort();w="abort";for(l in{success:1,error:1,complete:1})x[l](m[l]);if(e=xb(tb,m,c,x)){if(x.readyState=1,k&&p.trigger("ajaxSend",[x,m]),2===v)return x;m.async&&m.timeout>0&&(i=a.setTimeout(function(){x.abort("timeout")},m.timeout));try{v=1,e.send(t,z)}catch(y){if(!(2>v))throw y;z(-1,y)}}else z(-1,"No Transport");function z(b,c,d,h){var j,l,t,u,w,y=c;2!==v&&(v=2,i&&a.clearTimeout(i),e=void 0,g=h||"",x.readyState=b>0?4:0,j=b>=200&&300>b||304===b,d&&(u=zb(m,x,d)),u=Ab(m,u,x,j),j?(m.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(n.lastModified[f]=w),w=x.getResponseHeader("etag"),w&&(n.etag[f]=w)),204===b||"HEAD"===m.type?y="nocontent":304===b?y="notmodified":(y=u.state,l=u.data,t=u.error,j=!t)):(t=y,!b&&y||(y="error",0>b&&(b=0))),x.status=b,x.statusText=(c||y)+"",j?q.resolveWith(o,[l,y,x]):q.rejectWith(o,[x,y,t]),x.statusCode(s),s=void 0,k&&p.trigger(j?"ajaxSuccess":"ajaxError",[x,m,j?l:t]),r.fireWith(o,[x,y]),k&&(p.trigger("ajaxComplete",[x,m]),--n.active||n.event.trigger("ajaxStop")))}return x},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return!n.expr.filters.visible(a)},n.expr.filters.visible=function(a){return a.offsetWidth>0||a.offsetHeight>0||a.getClientRects().length>0};var Bb=/%20/g,Cb=/\[\]$/,Db=/\r?\n/g,Eb=/^(?:submit|button|image|reset|file)$/i,Fb=/^(?:input|select|textarea|keygen)/i;function Gb(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Cb.test(a)?d(a,e):Gb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Gb(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Gb(c,a[c],b,e);return d.join("&").replace(Bb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Fb.test(this.nodeName)&&!Eb.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Db,"\r\n")}}):{name:b.name,value:c.replace(Db,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Hb={0:200,1223:204},Ib=n.ajaxSettings.xhr();l.cors=!!Ib&&"withCredentials"in Ib,l.ajax=Ib=!!Ib,n.ajaxTransport(function(b){var c,d;return l.cors||Ib&&!b.crossDomain?{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Hb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=n("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Jb=[],Kb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Jb.pop()||n.expando+"_"+kb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Kb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Kb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Kb,"$1"+e):b.jsonp!==!1&&(b.url+=(lb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Jb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||d;var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ca([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var Lb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Lb)return Lb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function Mb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(e=d.getBoundingClientRect(),c=Mb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ea})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;n.fn[a]=function(d){return K(this,function(a,d,e){var f=Mb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ga(l.pixelPosition,function(a,c){return c?(c=Fa(a,b),Ba.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return K(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)},size:function(){return this.length}}),n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Nb=a.jQuery,Ob=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Ob),b&&a.jQuery===n&&(a.jQuery=Nb),n},b||(a.jQuery=a.$=n),n});
  5. /*!
  6. * Bootstrap v3.4.1 (https://getbootstrap.com/)
  7. * Copyright 2011-2019 Twitter, Inc.
  8. * Licensed under the MIT license
  9. */
  10. if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(t){"use strict";var e=jQuery.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||3<e[0])throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(),function(n){"use strict";n.fn.emulateTransitionEnd=function(t){var e=!1,i=this;n(this).one("bsTransitionEnd",function(){e=!0});return setTimeout(function(){e||n(i).trigger(n.support.transition.end)},t),this},n(function(){n.support.transition=function o(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(t.style[i]!==undefined)return{end:e[i]};return!1}(),n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(s){"use strict";var e='[data-dismiss="alert"]',a=function(t){s(t).on("click",e,this.close)};a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.close=function(t){var e=s(this),i=e.attr("data-target");i||(i=(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),i="#"===i?[]:i;var o=s(document).find(i);function n(){o.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),o.length||(o=e.closest(".alert")),o.trigger(t=s.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),s.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",n).emulateTransitionEnd(a.TRANSITION_DURATION):n())};var t=s.fn.alert;s.fn.alert=function o(i){return this.each(function(){var t=s(this),e=t.data("bs.alert");e||t.data("bs.alert",e=new a(this)),"string"==typeof i&&e[i].call(t)})},s.fn.alert.Constructor=a,s.fn.alert.noConflict=function(){return s.fn.alert=t,this},s(document).on("click.bs.alert.data-api",e,a.prototype.close)}(jQuery),function(s){"use strict";var n=function(t,e){this.$element=s(t),this.options=s.extend({},n.DEFAULTS,e),this.isLoading=!1};function i(o){return this.each(function(){var t=s(this),e=t.data("bs.button"),i="object"==typeof o&&o;e||t.data("bs.button",e=new n(this,i)),"toggle"==o?e.toggle():o&&e.setState(o)})}n.VERSION="3.4.1",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(t){var e="disabled",i=this.$element,o=i.is("input")?"val":"html",n=i.data();t+="Text",null==n.resetText&&i.data("resetText",i[o]()),setTimeout(s.proxy(function(){i[o](null==n[t]?this.options[t]:n[t]),"loadingText"==t?(this.isLoading=!0,i.addClass(e).attr(e,e).prop(e,!0)):this.isLoading&&(this.isLoading=!1,i.removeClass(e).removeAttr(e).prop(e,!1))},this),0)},n.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var t=s.fn.button;s.fn.button=i,s.fn.button.Constructor=n,s.fn.button.noConflict=function(){return s.fn.button=t,this},s(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var e=s(t.target).closest(".btn");i.call(e,"toggle"),s(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),e.is("input,button")?e.trigger("focus"):e.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){s(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),function(p){"use strict";var c=function(t,e){this.$element=p(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=e,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",p.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",p.proxy(this.pause,this)).on("mouseleave.bs.carousel",p.proxy(this.cycle,this))};function r(n){return this.each(function(){var t=p(this),e=t.data("bs.carousel"),i=p.extend({},c.DEFAULTS,t.data(),"object"==typeof n&&n),o="string"==typeof n?n:i.slide;e||t.data("bs.carousel",e=new c(this,i)),"number"==typeof n?e.to(n):o?e[o]():i.interval&&e.pause().cycle()})}c.VERSION="3.4.1",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},c.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(p.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},c.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e);if(("prev"==t&&0===i||"next"==t&&i==this.$items.length-1)&&!this.options.wrap)return e;var o=(i+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(o)},c.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(i<t?"next":"prev",this.$items.eq(t))},c.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&p.support.transition&&(this.$element.trigger(p.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(t,e){var i=this.$element.find(".item.active"),o=e||this.getItemForDirection(t,i),n=this.interval,s="next"==t?"left":"right",a=this;if(o.hasClass("active"))return this.sliding=!1;var r=o[0],l=p.Event("slide.bs.carousel",{relatedTarget:r,direction:s});if(this.$element.trigger(l),!l.isDefaultPrevented()){if(this.sliding=!0,n&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var h=p(this.$indicators.children()[this.getItemIndex(o)]);h&&h.addClass("active")}var d=p.Event("slid.bs.carousel",{relatedTarget:r,direction:s});return p.support.transition&&this.$element.hasClass("slide")?(o.addClass(t),"object"==typeof o&&o.length&&o[0].offsetWidth,i.addClass(s),o.addClass(s),i.one("bsTransitionEnd",function(){o.removeClass([t,s].join(" ")).addClass("active"),i.removeClass(["active",s].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger(d)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(i.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(d)),n&&this.cycle(),this}};var t=p.fn.carousel;p.fn.carousel=r,p.fn.carousel.Constructor=c,p.fn.carousel.noConflict=function(){return p.fn.carousel=t,this};var e=function(t){var e=p(this),i=e.attr("href");i&&(i=i.replace(/.*(?=#[^\s]+$)/,""));var o=e.attr("data-target")||i,n=p(document).find(o);if(n.hasClass("carousel")){var s=p.extend({},n.data(),e.data()),a=e.attr("data-slide-to");a&&(s.interval=!1),r.call(n,s),a&&n.data("bs.carousel").to(a),t.preventDefault()}};p(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),p(window).on("load",function(){p('[data-ride="carousel"]').each(function(){var t=p(this);r.call(t,t.data())})})}(jQuery),function(a){"use strict";var r=function(t,e){this.$element=a(t),this.options=a.extend({},r.DEFAULTS,e),this.$trigger=a('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function n(t){var e,i=t.attr("data-target")||(e=t.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"");return a(document).find(i)}function l(o){return this.each(function(){var t=a(this),e=t.data("bs.collapse"),i=a.extend({},r.DEFAULTS,t.data(),"object"==typeof o&&o);!e&&i.toggle&&/show|hide/.test(o)&&(i.toggle=!1),e||t.data("bs.collapse",e=new r(this,i)),"string"==typeof o&&e[o]()})}r.VERSION="3.4.1",r.TRANSITION_DURATION=350,r.DEFAULTS={toggle:!0},r.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},r.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(t=e.data("bs.collapse"))&&t.transitioning)){var i=a.Event("show.bs.collapse");if(this.$element.trigger(i),!i.isDefaultPrevented()){e&&e.length&&(l.call(e,"hide"),t||e.data("bs.collapse",null));var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var n=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return n.call(this);var s=a.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",a.proxy(n,this)).emulateTransitionEnd(r.TRANSITION_DURATION)[o](this.$element[0][s])}}}},r.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=a.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var e=this.dimension();this.$element[e](this.$element[e]())[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 i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!a.support.transition)return i.call(this);this.$element[e](0).one("bsTransitionEnd",a.proxy(i,this)).emulateTransitionEnd(r.TRANSITION_DURATION)}}},r.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},r.prototype.getParent=function(){return a(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(t,e){var i=a(e);this.addAriaAndCollapsedClass(n(i),i)},this)).end()},r.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var t=a.fn.collapse;a.fn.collapse=l,a.fn.collapse.Constructor=r,a.fn.collapse.noConflict=function(){return a.fn.collapse=t,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var e=a(this);e.attr("data-target")||t.preventDefault();var i=n(e),o=i.data("bs.collapse")?"toggle":e.data();l.call(i,o)})}(jQuery),function(a){"use strict";var r='[data-toggle="dropdown"]',o=function(t){a(t).on("click.bs.dropdown",this.toggle)};function l(t){var e=t.attr("data-target");e||(e=(e=t.attr("href"))&&/#[A-Za-z]/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var i="#"!==e?a(document).find(e):null;return i&&i.length?i:t.parent()}function s(o){o&&3===o.which||(a(".dropdown-backdrop").remove(),a(r).each(function(){var t=a(this),e=l(t),i={relatedTarget:this};e.hasClass("open")&&(o&&"click"==o.type&&/input|textarea/i.test(o.target.tagName)&&a.contains(e[0],o.target)||(e.trigger(o=a.Event("hide.bs.dropdown",i)),o.isDefaultPrevented()||(t.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",i)))))}))}o.VERSION="3.4.1",o.prototype.toggle=function(t){var e=a(this);if(!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(s(),!o){"ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",s);var n={relatedTarget:this};if(i.trigger(t=a.Event("show.bs.dropdown",n)),t.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),i.toggleClass("open").trigger(a.Event("shown.bs.dropdown",n))}return!1}},o.prototype.keydown=function(t){if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)){var e=a(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(!o&&27!=t.which||o&&27==t.which)return 27==t.which&&i.find(r).trigger("focus"),e.trigger("click");var n=i.find(".dropdown-menu li:not(.disabled):visible a");if(n.length){var s=n.index(t.target);38==t.which&&0<s&&s--,40==t.which&&s<n.length-1&&s++,~s||(s=0),n.eq(s).trigger("focus")}}}};var t=a.fn.dropdown;a.fn.dropdown=function e(i){return this.each(function(){var t=a(this),e=t.data("bs.dropdown");e||t.data("bs.dropdown",e=new o(this)),"string"==typeof i&&e[i].call(t)})},a.fn.dropdown.Constructor=o,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=t,this},a(document).on("click.bs.dropdown.data-api",s).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",r,o.prototype.toggle).on("keydown.bs.dropdown.data-api",r,o.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",o.prototype.keydown)}(jQuery),function(a){"use strict";var s=function(t,e){this.options=e,this.$body=a(document.body),this.$element=a(t),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom",this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};function r(o,n){return this.each(function(){var t=a(this),e=t.data("bs.modal"),i=a.extend({},s.DEFAULTS,t.data(),"object"==typeof o&&o);e||t.data("bs.modal",e=new s(this,i)),"string"==typeof o?e[o](n):i.show&&e.show(n)})}s.VERSION="3.4.1",s.TRANSITION_DURATION=300,s.BACKDROP_TRANSITION_DURATION=150,s.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},s.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},s.prototype.show=function(i){var o=this,t=a.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(t),this.isShown||t.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(){o.$element.one("mouseup.dismiss.bs.modal",function(t){a(t.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var t=a.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),o.adjustDialog(),t&&o.$element[0].offsetWidth,o.$element.addClass("in"),o.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:i});t?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(e)}).emulateTransitionEnd(s.TRANSITION_DURATION):o.$element.trigger("focus").trigger(e)}))},s.prototype.hide=function(t){t&&t.preventDefault(),t=a.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.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(s.TRANSITION_DURATION):this.hideModal())},s.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(t){document===t.target||this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},s.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},s.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},s.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},s.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},s.prototype.backdrop=function(t){var e=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=a.support.transition&&i;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(t){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;o?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var n=function(){e.removeBackdrop(),t&&t()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",n).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):n()}else t&&t()},s.prototype.handleUpdate=function(){this.adjustDialog()},s.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},s.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},s.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},s.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";var n=this.scrollbarWidth;this.bodyIsOverflowing&&(this.$body.css("padding-right",t+n),a(this.fixedContent).each(function(t,e){var i=e.style.paddingRight,o=a(e).css("padding-right");a(e).data("padding-right",i).css("padding-right",parseFloat(o)+n+"px")}))},s.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad),a(this.fixedContent).each(function(t,e){var i=a(e).data("padding-right");a(e).removeData("padding-right"),e.style.paddingRight=i||""})},s.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var t=a.fn.modal;a.fn.modal=r,a.fn.modal.Constructor=s,a.fn.modal.noConflict=function(){return a.fn.modal=t,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var e=a(this),i=e.attr("href"),o=e.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,""),n=a(document).find(o),s=n.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(i)&&i},n.data(),e.data());e.is("a")&&t.preventDefault(),n.one("show.bs.modal",function(t){t.isDefaultPrevented()||n.one("hidden.bs.modal",function(){e.is(":visible")&&e.trigger("focus")})}),r.call(n,s,this)})}(jQuery),function(g){"use strict";var o=["sanitize","whiteList","sanitizeFn"],a=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],t={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,l=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function u(t,e){var i=t.nodeName.toLowerCase();if(-1!==g.inArray(i,e))return-1===g.inArray(i,a)||Boolean(t.nodeValue.match(r)||t.nodeValue.match(l));for(var o=g(e).filter(function(t,e){return e instanceof RegExp}),n=0,s=o.length;n<s;n++)if(i.match(o[n]))return!0;return!1}function n(t,e,i){if(0===t.length)return t;if(i&&"function"==typeof i)return i(t);if(!document.implementation||!document.implementation.createHTMLDocument)return t;var o=document.implementation.createHTMLDocument("sanitization");o.body.innerHTML=t;for(var n=g.map(e,function(t,e){return e}),s=g(o.body).find("*"),a=0,r=s.length;a<r;a++){var l=s[a],h=l.nodeName.toLowerCase();if(-1!==g.inArray(h,n))for(var d=g.map(l.attributes,function(t){return t}),p=[].concat(e["*"]||[],e[h]||[]),c=0,f=d.length;c<f;c++)u(d[c],p)||l.removeAttribute(d[c].nodeName);else l.parentNode.removeChild(l)}return o.body.innerHTML}var m=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};m.VERSION="3.4.1",m.TRANSITION_DURATION=150,m.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},sanitize:!0,sanitizeFn:null,whiteList:t},m.prototype.init=function(t,e,i){if(this.enabled=!0,this.type=t,this.$element=g(e),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&g(document).find(g.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 o=this.options.trigger.split(" "),n=o.length;n--;){var s=o[n];if("click"==s)this.$element.on("click."+this.type,this.options.selector,g.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",r="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,g.proxy(this.enter,this)),this.$element.on(r+"."+this.type,this.options.selector,g.proxy(this.leave,this))}}this.options.selector?this._options=g.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},m.prototype.getDefaults=function(){return m.DEFAULTS},m.prototype.getOptions=function(t){var e=this.$element.data();for(var i in e)e.hasOwnProperty(i)&&-1!==g.inArray(i,o)&&delete e[i];return(t=g.extend({},this.getDefaults(),e,t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t.sanitize&&(t.template=n(t.template,t.whiteList,t.sanitizeFn)),t},m.prototype.getDelegateOptions=function(){var i={},o=this.getDefaults();return this._options&&g.each(this._options,function(t,e){o[t]!=e&&(i[t]=e)}),i},m.prototype.enter=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusin"==t.type?"focus":"hover"]=!0),e.tip().hasClass("in")||"in"==e.hoverState)e.hoverState="in";else{if(clearTimeout(e.timeout),e.hoverState="in",!e.options.delay||!e.options.delay.show)return e.show();e.timeout=setTimeout(function(){"in"==e.hoverState&&e.show()},e.options.delay.show)}},m.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},m.prototype.leave=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusout"==t.type?"focus":"hover"]=!1),!e.isInStateTrue()){if(clearTimeout(e.timeout),e.hoverState="out",!e.options.delay||!e.options.delay.hide)return e.hide();e.timeout=setTimeout(function(){"out"==e.hoverState&&e.hide()},e.options.delay.hide)}},m.prototype.show=function(){var t=g.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var e=g.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!e)return;var i=this,o=this.tip(),n=this.getUID(this.type);this.setContent(),o.attr("id",n),this.$element.attr("aria-describedby",n),this.options.animation&&o.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,r=a.test(s);r&&(s=s.replace(a,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?o.appendTo(g(document).find(this.options.container)):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var l=this.getPosition(),h=o[0].offsetWidth,d=o[0].offsetHeight;if(r){var p=s,c=this.getPosition(this.$viewport);s="bottom"==s&&l.bottom+d>c.bottom?"top":"top"==s&&l.top-d<c.top?"bottom":"right"==s&&l.right+h>c.width?"left":"left"==s&&l.left-h<c.left?"right":s,o.removeClass(p).addClass(s)}var f=this.getCalculatedOffset(s,l,h,d);this.applyPlacement(f,s);var u=function(){var t=i.hoverState;i.$element.trigger("shown.bs."+i.type),i.hoverState=null,"out"==t&&i.leave(i)};g.support.transition&&this.$tip.hasClass("fade")?o.one("bsTransitionEnd",u).emulateTransitionEnd(m.TRANSITION_DURATION):u()}},m.prototype.applyPlacement=function(t,e){var i=this.tip(),o=i[0].offsetWidth,n=i[0].offsetHeight,s=parseInt(i.css("margin-top"),10),a=parseInt(i.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(a)&&(a=0),t.top+=s,t.left+=a,g.offset.setOffset(i[0],g.extend({using:function(t){i.css({top:Math.round(t.top),left:Math.round(t.left)})}},t),0),i.addClass("in");var r=i[0].offsetWidth,l=i[0].offsetHeight;"top"==e&&l!=n&&(t.top=t.top+n-l);var h=this.getViewportAdjustedDelta(e,t,r,l);h.left?t.left+=h.left:t.top+=h.top;var d=/top|bottom/.test(e),p=d?2*h.left-o+r:2*h.top-n+l,c=d?"offsetWidth":"offsetHeight";i.offset(t),this.replaceArrow(p,i[0][c],d)},m.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},m.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();this.options.html?(this.options.sanitize&&(e=n(e,this.options.whiteList,this.options.sanitizeFn)),t.find(".tooltip-inner").html(e)):t.find(".tooltip-inner").text(e),t.removeClass("fade in top bottom left right")},m.prototype.hide=function(t){var e=this,i=g(this.$tip),o=g.Event("hide.bs."+this.type);function n(){"in"!=e.hoverState&&i.detach(),e.$element&&e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),t&&t()}if(this.$element.trigger(o),!o.isDefaultPrevented())return i.removeClass("in"),g.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",n).emulateTransitionEnd(m.TRANSITION_DURATION):n(),this.hoverState=null,this},m.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},m.prototype.hasContent=function(){return this.getTitle()},m.prototype.getPosition=function(t){var e=(t=t||this.$element)[0],i="BODY"==e.tagName,o=e.getBoundingClientRect();null==o.width&&(o=g.extend({},o,{width:o.right-o.left,height:o.bottom-o.top}));var n=window.SVGElement&&e instanceof window.SVGElement,s=i?{top:0,left:0}:n?null:t.offset(),a={scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},r=i?{width:g(window).width(),height:g(window).height()}:null;return g.extend({},o,a,r,s)},m.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},m.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;h<a.left?n.left=a.left-h:d>a.right&&(n.left=a.left+a.width-d)}return n},m.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},m.prototype.getUID=function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},m.prototype.tip=function(){if(!this.$tip&&(this.$tip=g(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},m.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},m.prototype.enable=function(){this.enabled=!0},m.prototype.disable=function(){this.enabled=!1},m.prototype.toggleEnabled=function(){this.enabled=!this.enabled},m.prototype.toggle=function(t){var e=this;t&&((e=g(t.currentTarget).data("bs."+this.type))||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e))),t?(e.inState.click=!e.inState.click,e.isInStateTrue()?e.enter(e):e.leave(e)):e.tip().hasClass("in")?e.leave(e):e.enter(e)},m.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})},m.prototype.sanitizeHtml=function(t){return n(t,this.options.whiteList,this.options.sanitizeFn)};var e=g.fn.tooltip;g.fn.tooltip=function i(o){return this.each(function(){var t=g(this),e=t.data("bs.tooltip"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.tooltip",e=new m(this,i)),"string"==typeof o&&e[o]())})},g.fn.tooltip.Constructor=m,g.fn.tooltip.noConflict=function(){return g.fn.tooltip=e,this}}(jQuery),function(n){"use strict";var s=function(t,e){this.init("popover",t,e)};if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");s.VERSION="3.4.1",s.DEFAULTS=n.extend({},n.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>'}),((s.prototype=n.extend({},n.fn.tooltip.Constructor.prototype)).constructor=s).prototype.getDefaults=function(){return s.DEFAULTS},s.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();if(this.options.html){var o=typeof i;this.options.sanitize&&(e=this.sanitizeHtml(e),"string"===o&&(i=this.sanitizeHtml(i))),t.find(".popover-title").html(e),t.find(".popover-content").children().detach().end()["string"===o?"html":"append"](i)}else t.find(".popover-title").text(e),t.find(".popover-content").children().detach().end().text(i);t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},s.prototype.hasContent=function(){return this.getTitle()||this.getContent()},s.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},s.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var t=n.fn.popover;n.fn.popover=function e(o){return this.each(function(){var t=n(this),e=t.data("bs.popover"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.popover",e=new s(this,i)),"string"==typeof o&&e[o]())})},n.fn.popover.Constructor=s,n.fn.popover.noConflict=function(){return n.fn.popover=t,this}}(jQuery),function(s){"use strict";function n(t,e){this.$body=s(document.body),this.$scrollElement=s(t).is(document.body)?s(window):s(t),this.options=s.extend({},n.DEFAULTS,e),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",s.proxy(this.process,this)),this.refresh(),this.process()}function e(o){return this.each(function(){var t=s(this),e=t.data("bs.scrollspy"),i="object"==typeof o&&o;e||t.data("bs.scrollspy",e=new n(this,i)),"string"==typeof o&&e[o]()})}n.VERSION="3.4.1",n.DEFAULTS={offset:10},n.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},n.prototype.refresh=function(){var t=this,o="offset",n=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),s.isWindow(this.$scrollElement[0])||(o="position",n=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=s(this),e=t.data("target")||t.attr("href"),i=/^#./.test(e)&&s(e);return i&&i.length&&i.is(":visible")&&[[i[o]().top+n,e]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},n.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),o<=e)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e<n[0])return this.activeTarget=null,this.clear();for(t=n.length;t--;)a!=s[t]&&e>=n[t]&&(n[t+1]===undefined||e<n[t+1])&&this.activate(s[t])},n.prototype.activate=function(t){this.activeTarget=t,this.clear();var e=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=s(e).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate.bs.scrollspy")},n.prototype.clear=function(){s(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var t=s.fn.scrollspy;s.fn.scrollspy=e,s.fn.scrollspy.Constructor=n,s.fn.scrollspy.noConflict=function(){return s.fn.scrollspy=t,this},s(window).on("load.bs.scrollspy.data-api",function(){s('[data-spy="scroll"]').each(function(){var t=s(this);e.call(t,t.data())})})}(jQuery),function(r){"use strict";var a=function(t){this.element=r(t)};function e(i){return this.each(function(){var t=r(this),e=t.data("bs.tab");e||t.data("bs.tab",e=new a(this)),"string"==typeof i&&e[i]()})}a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target");if(i||(i=(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var o=e.find(".active:last a"),n=r.Event("hide.bs.tab",{relatedTarget:t[0]}),s=r.Event("show.bs.tab",{relatedTarget:o[0]});if(o.trigger(n),t.trigger(s),!s.isDefaultPrevented()&&!n.isDefaultPrevented()){var a=r(document).find(i);this.activate(t.closest("li"),e),this.activate(a,a.parent(),function(){o.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:o[0]})})}}},a.prototype.activate=function(t,e,i){var o=e.find("> .active"),n=i&&r.support.transition&&(o.length&&o.hasClass("fade")||!!e.find("> .fade").length);function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),n?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}o.length&&n?o.one("bsTransitionEnd",s).emulateTransitionEnd(a.TRANSITION_DURATION):s(),o.removeClass("in")};var t=r.fn.tab;r.fn.tab=e,r.fn.tab.Constructor=a,r.fn.tab.noConflict=function(){return r.fn.tab=t,this};var i=function(t){t.preventDefault(),e.call(r(this),"show")};r(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(l){"use strict";var h=function(t,e){this.options=l.extend({},h.DEFAULTS,e);var i=this.options.target===h.DEFAULTS.target?l(this.options.target):l(document).find(this.options.target);this.$target=i.on("scroll.bs.affix.data-api",l.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",l.proxy(this.checkPositionWithEventLoop,this)),this.$element=l(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function i(o){return this.each(function(){var t=l(this),e=t.data("bs.affix"),i="object"==typeof o&&o;e||t.data("bs.affix",e=new h(this,i)),"string"==typeof o&&e[o]()})}h.VERSION="3.4.1",h.RESET="affix affix-top affix-bottom",h.DEFAULTS={offset:0,target:window},h.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return n<i&&"top";if("bottom"==this.affixed)return null!=i?!(n+this.unpin<=s.top)&&"bottom":!(n+a<=t-o)&&"bottom";var r=null==this.affixed,l=r?n:s.top;return null!=i&&n<=i?"top":null!=o&&t-o<=l+(r?a:e)&&"bottom"},h.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(h.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},h.prototype.checkPositionWithEventLoop=function(){setTimeout(l.proxy(this.checkPosition,this),1)},h.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),e=this.options.offset,i=e.top,o=e.bottom,n=Math.max(l(document).height(),l(document.body).height());"object"!=typeof e&&(o=i=e),"function"==typeof i&&(i=e.top(this.$element)),"function"==typeof o&&(o=e.bottom(this.$element));var s=this.getState(n,t,i,o);if(this.affixed!=s){null!=this.unpin&&this.$element.css("top","");var a="affix"+(s?"-"+s:""),r=l.Event(a+".bs.affix");if(this.$element.trigger(r),r.isDefaultPrevented())return;this.affixed=s,this.unpin="bottom"==s?this.getPinnedOffset():null,this.$element.removeClass(h.RESET).addClass(a).trigger(a.replace("affix","affixed")+".bs.affix")}"bottom"==s&&this.$element.offset({top:n-t-o})}};var t=l.fn.affix;l.fn.affix=i,l.fn.affix.Constructor=h,l.fn.affix.noConflict=function(){return l.fn.affix=t,this},l(window).on("load",function(){l('[data-spy="affix"]').each(function(){var t=l(this),e=t.data();e.offset=e.offset||{},null!=e.offsetBottom&&(e.offset.bottom=e.offsetBottom),null!=e.offsetTop&&(e.offset.top=e.offsetTop),i.call(t,e)})})}(jQuery);
  11. define("bootstrap", ["jquery"], function(){});
  12. require.config({
  13. urlArgs: "v=" + requirejs.s.contexts._.config.config.site.version,
  14. packages: [{
  15. name: 'moment',
  16. location: '../libs/moment',
  17. main: 'moment'
  18. }],
  19. //在打包压缩时将会把include中的模块合并到主文件中
  20. include: ['css', 'layer', 'toastr', 'fast', 'frontend', 'frontend-init'],
  21. paths: {
  22. 'lang': "empty:",
  23. 'form': 'require-form',
  24. 'table': 'require-table',
  25. 'upload': 'require-upload',
  26. 'validator': 'require-validator',
  27. 'drag': 'jquery.drag.min',
  28. 'drop': 'jquery.drop.min',
  29. 'dropzone': 'dropzone.min',
  30. 'echarts': 'echarts.min',
  31. 'echarts-theme': 'echarts-theme',
  32. 'adminlte': 'adminlte',
  33. 'bootstrap-table-commonsearch': 'bootstrap-table-commonsearch',
  34. 'bootstrap-table-template': 'bootstrap-table-template',
  35. //
  36. // 以下的包从bower的libs目录加载
  37. 'jquery': '../libs/jquery/dist/jquery.min',
  38. 'bootstrap': '../libs/bootstrap/dist/js/bootstrap.min',
  39. 'bootstrap-datetimepicker': '../libs/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min',
  40. 'bootstrap-daterangepicker': '../libs/bootstrap-daterangepicker/daterangepicker',
  41. 'bootstrap-select': '../libs/bootstrap-select/dist/js/bootstrap-select.min',
  42. 'bootstrap-select-lang': '../libs/bootstrap-select/dist/js/i18n/defaults-zh_CN',
  43. 'bootstrap-table': '../libs/bootstrap-table/dist/bootstrap-table.min',
  44. 'bootstrap-table-export': '../libs/bootstrap-table/dist/extensions/export/bootstrap-table-export.min',
  45. 'bootstrap-table-mobile': '../libs/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile',
  46. 'bootstrap-table-lang': '../libs/bootstrap-table/dist/locale/bootstrap-table-zh-CN',
  47. 'bootstrap-table-jumpto': '../libs/bootstrap-table/dist/extensions/page-jumpto/bootstrap-table-jumpto',
  48. 'tableexport': '../libs/tableExport.jquery.plugin/tableExport.min',
  49. 'dragsort': '../libs/fastadmin-dragsort/jquery.dragsort',
  50. 'sortable': '../libs/Sortable/Sortable.min',
  51. 'addtabs': '../libs/fastadmin-addtabs/jquery.addtabs',
  52. 'slimscroll': '../libs/jquery-slimscroll/jquery.slimscroll',
  53. 'validator-core': '../libs/nice-validator/dist/jquery.validator',
  54. 'validator-lang': '../libs/nice-validator/dist/local/zh-CN',
  55. 'toastr': '../libs/toastr/toastr',
  56. 'jstree': '../libs/jstree/dist/jstree.min',
  57. 'layer': '../libs/fastadmin-layer/dist/layer',
  58. 'cookie': '../libs/jquery.cookie/jquery.cookie',
  59. 'cxselect': '../libs/fastadmin-cxselect/js/jquery.cxselect',
  60. 'template': '../libs/art-template/dist/template-native',
  61. 'selectpage': '../libs/fastadmin-selectpage/selectpage',
  62. 'citypicker': '../libs/fastadmin-citypicker/dist/js/city-picker.min',
  63. 'citypicker-data': '../libs/fastadmin-citypicker/dist/js/city-picker.data'
  64. },
  65. // shim依赖配置
  66. shim: {
  67. 'addons': ['frontend'],
  68. 'bootstrap': ['jquery'],
  69. 'bootstrap-table': {
  70. deps: [
  71. 'bootstrap',
  72. // 'css!../libs/bootstrap-table/dist/bootstrap-table.min.css'
  73. ],
  74. exports: '$.fn.bootstrapTable'
  75. },
  76. 'bootstrap-table-lang': {
  77. deps: ['bootstrap-table'],
  78. exports: '$.fn.bootstrapTable.defaults'
  79. },
  80. 'bootstrap-table-export': {
  81. deps: ['bootstrap-table', 'tableexport'],
  82. exports: '$.fn.bootstrapTable.defaults'
  83. },
  84. 'bootstrap-table-mobile': {
  85. deps: ['bootstrap-table'],
  86. exports: '$.fn.bootstrapTable.defaults'
  87. },
  88. 'bootstrap-table-advancedsearch': {
  89. deps: ['bootstrap-table'],
  90. exports: '$.fn.bootstrapTable.defaults'
  91. },
  92. 'bootstrap-table-commonsearch': {
  93. deps: ['bootstrap-table'],
  94. exports: '$.fn.bootstrapTable.defaults'
  95. },
  96. 'bootstrap-table-template': {
  97. deps: ['bootstrap-table', 'template'],
  98. exports: '$.fn.bootstrapTable.defaults'
  99. },
  100. 'bootstrap-table-jumpto': {
  101. deps: ['bootstrap-table'],
  102. exports: '$.fn.bootstrapTable.defaults'
  103. },
  104. 'tableexport': {
  105. deps: ['jquery'],
  106. exports: '$.fn.extend'
  107. },
  108. 'slimscroll': {
  109. deps: ['jquery'],
  110. exports: '$.fn.extend'
  111. },
  112. 'adminlte': {
  113. deps: ['bootstrap', 'slimscroll'],
  114. exports: '$.AdminLTE'
  115. },
  116. 'bootstrap-daterangepicker': [
  117. 'moment/locale/zh-cn'
  118. ],
  119. 'bootstrap-datetimepicker': [
  120. 'moment/locale/zh-cn',
  121. // 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',
  122. ],
  123. // 'bootstrap-select': ['css!../libs/bootstrap-select/dist/css/bootstrap-select.min.css', ],
  124. 'bootstrap-select-lang': ['bootstrap-select'],
  125. // 'toastr': ['css!../libs/toastr/toastr.min.css'],
  126. 'jstree': ['css!../libs/jstree/dist/themes/default/style.css'],
  127. // 'layer': ['css!../libs/fastadmin-layer/dist/theme/default/layer.css'],
  128. // 'validator-core': ['css!../libs/nice-validator/dist/jquery.validator.css'],
  129. 'validator-lang': ['validator-core'],
  130. // 'selectpage': ['css!../libs/fastadmin-selectpage/selectpage.css'],
  131. 'citypicker': ['citypicker-data', 'css!../libs/fastadmin-citypicker/dist/css/city-picker.css']
  132. },
  133. baseUrl: requirejs.s.contexts._.config.config.site.cdnurl + '/assets/js/', //资源基础路径
  134. map: {
  135. '*': {
  136. 'css': '../libs/require-css/css.min'
  137. }
  138. },
  139. waitSeconds: 30,
  140. charset: 'utf-8' // 文件编码
  141. });
  142. require(['jquery', 'bootstrap'], function ($, undefined) {
  143. //初始配置
  144. var Config = requirejs.s.contexts._.config.config;
  145. //将Config渲染到全局
  146. window.Config = Config;
  147. // 配置语言包的路径
  148. var paths = {};
  149. paths['lang'] = Config.moduleurl + '/ajax/lang?callback=define&controllername=' + Config.controllername + '&lang=' + Config.language + '&v=' + Config.site.version;
  150. // 避免目录冲突
  151. paths['frontend/'] = 'frontend/';
  152. require.config({paths: paths});
  153. // 初始化
  154. $(function () {
  155. require(['fast'], function (Fast) {
  156. require(['frontend', 'frontend-init', 'addons'], function (Frontend, Addons) {
  157. //加载相应模块
  158. if (Config.jsname) {
  159. require([Config.jsname], function (Controller) {
  160. Controller[Config.actionname] != undefined && Controller[Config.actionname]();
  161. }, function (e) {
  162. console.error(e);
  163. // 这里可捕获模块加载的错误
  164. });
  165. }
  166. });
  167. });
  168. });
  169. });
  170. define("require-frontend", function(){});
  171. define('../libs/require-css/css.min',[],function(){if("undefined"==typeof window)return{load:function(a,b,c){c()}};var a=document.getElementsByTagName("head")[0],b=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,c=!1,d=!0;b[1]||b[7]?c=parseInt(b[1])<6||parseInt(b[7])<=9:b[2]||b[8]?d=!1:b[4]&&(c=parseInt(b[4])<18);var e={};e.pluginBuilder="./css-builder";var f,g,h,i=function(){f=document.createElement("style"),a.appendChild(f),g=f.styleSheet||f.sheet},j=0,k=[],l=function(a){g.addImport(a),f.onload=function(){m()},j++,31==j&&(i(),j=0)},m=function(){h();var a=k.shift();return a?(h=a[1],void l(a[0])):void(h=null)},n=function(a,b){if(g&&g.addImport||i(),g&&g.addImport)h?k.push([a,b]):(l(a),h=b);else{f.textContent='@import "'+a+'";';var c=setInterval(function(){try{f.sheet.cssRules,clearInterval(c),b()}catch(a){}},10)}},o=function(b,c){var e=document.createElement("link");if(e.type="text/css",e.rel="stylesheet",d)e.onload=function(){e.onload=function(){},setTimeout(c,7)};else var f=setInterval(function(){for(var a=0;a<document.styleSheets.length;a++){var b=document.styleSheets[a];if(b.href==e.href)return clearInterval(f),c()}},10);e.href=b,a.appendChild(e)};return e.normalize=function(a,b){return".css"==a.substr(a.length-4,4)&&(a=a.substr(0,a.length-4)),b(a)},e.load=function(a,b,d,e){(c?n:o)(b.toUrl(a+".css"),d)},e});
  172. /*! layer-v3.1.4 Web弹层组件 MIT License http://layer.layui.com/ By 贤心 */
  173. ;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(r.path){var a=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,document.getElementById(f)||a.appendChild(s),"function"==typeof i&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(o.getStyle(document.getElementById(f),"width"))?i():setTimeout(u,100))}()}}},r={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},f=r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):o.link("theme/"+e.extend),this):this},ready:function(e){var t="layer",i="",n=(a?"modules/layer/":"theme/")+"default/layer.css?v="+r.v+i;return a?layui.addcss(n,e,t):o.link(n,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},n.icon!==-1&&n.icon!==t||(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"&#x4FE1;&#x606F;",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,focusBtn:0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?'<div class="layui-layer-title" style="'+(f?r.title[1]:"")+'">'+(f?r.title[0]:r.title)+"</div>":"";return r.zIndex=s,t([r.shade?'<div class="layui-layer-shade" id="layui-layer-shade'+a+'" times="'+a+'" style="'+("z-index:"+(s-1)+"; ")+'"></div>':"",'<div class="'+l[0]+(" layui-layer-"+o.type[r.type])+(0!=r.type&&2!=r.type||r.shade?"":" layui-layer-border")+" "+(r.skin||"")+'" id="'+l[0]+a+'" type="'+o.type[r.type]+'" times="'+a+'" showtime="'+r.time+'" conType="'+(e?"object":"string")+'" style="z-index: '+s+"; width:"+r.area[0]+";height:"+r.area[1]+(r.fixed?"":";position:absolute;")+'">'+(e&&2!=r.type?"":u)+'<div id="'+(r.id||"")+'" class="layui-layer-content'+(0==r.type&&r.icon!==-1?" layui-layer-padding":"")+(3==r.type?" layui-layer-loading"+r.icon:"")+'">'+(0==r.type&&r.icon!==-1?'<i class="layui-layer-ico layui-layer-ico'+r.icon+'"></i>':"")+(1==r.type&&e?"":r.content||"")+'</div><span class="layui-layer-setwin">'+function(){var e=c?'<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>':"";return r.closeBtn&&(e+='<a class="layui-layer-ico '+l[7]+" "+l[7]+(r.title?r.closeBtn:4==r.type?"1":"2")+'" href="javascript:;"></a>'),e}()+"</span>"+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t<i;t++)e+='<a class="'+l[6]+t+'" href="javascript:;">'+r.btn[t]+"</a>";return'<div class="'+l[6]+" layui-layer-btn-"+(r.btnAlign||"")+'">'+e+"</div>"}():"")+(r.resize?'<span class="layui-layer-resize"></span>':"")+"</div>"],u,i('<div class="layui-layer-move"></div>')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content||"http://layer.layui.com","auto"];t.content='<iframe scrolling="'+(t.content[1]||"auto")+'" allowtransparency="true" id="'+l[4]+a+'" name="'+l[4]+a+'" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="'+t.content[0]+'"></iframe>';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'<i class="layui-layer-TipsG"></i>',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}if(e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var u="layer-anim "+l.anim[t.anim];e.layero.addClass(u).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(u)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,a=t.config,o=i("#"+l[0]+e);""===a.area[0]&&a.maxWidth>0&&(r.ie&&r.ie<8&&a.btn&&o.width(o.innerWidth()),o.outerWidth()>a.maxWidth&&o.width(a.maxWidth));var s=[o.innerWidth(),o.innerHeight()],f=o.find(l[1]).outerHeight()||0,c=o.find("."+l[6]).outerHeight()||0,u=function(e){e=o.find(e),e.height(s[1]-f-c-2*(0|parseFloat(e.css("padding-top"))))};switch(a.type){case 2:u("iframe");break;default:""===a.area[1]?a.maxHeight>0&&o.outerHeight()>a.maxHeight?(s[1]=a.maxHeight,u("."+l[5])):a.fixed&&s[1]>=n.height()&&(s[1]=n.height(),u("."+l[5])):u("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;a<c.stX&&(a=c.stX),a>f&&(a=f),o<c.stY&&(o=c.stY),o>u&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;if(t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),"number"==typeof a.focusBtn){var s=n.find("."+l[6]).children("a").eq(a.focusBtn);if(s.size()>0){var f=s.position(),c={width:s.outerWidth(),height:s.outerHeight(),left:f.left,top:f.top,marginTop:s.css("marginTop"),marginLeft:s.css("marginLeft")},u=i("<button class='layui-layer-confirm'></button>").css(c);n.find("."+l[6]).after(u),u.focus().click(function(){return s.trigger("click"),!1}).on("focus blur",function(e){s.toggleClass("focus","focus"===e.type)})}}n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim "+a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'<textarea class="layui-layer-input"'+a+">"+(e.value||"")+"</textarea>":function(){return'<input type="'+(1==e.formType?"password":"text")+'" class="layui-layer-input" value="'+(e.value||"")+'">'}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){s=e.find(".layui-layer-input"),s.focus(),"function"==typeof f&&f(e)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("&#x6700;&#x591A;&#x8F93;&#x5165;"+(e.maxlength||500)+"&#x4E2A;&#x5B57;&#x6570;",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",a=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,a="";if(e>0)for(a='<span class="'+n+'">'+t[0].title+"</span>";i<e;i++)a+="<span>"+t[i].title+"</span>";return a}(),content:'<ul class="layui-layer-tabmain">'+function(){var e=t.length,i=1,a="";if(e>0)for(a='<li class="layui-layer-tabli '+n+'">'+(t[0].content||"no content")+"</li>";i<e;i++)a+='<li class="layui-layer-tabli">'+(t[i].content||"no content")+"</li>";return a}()+"</ul>",success:function(t){var o=t.find(".layui-layer-title").children(),r=t.find(".layui-layer-tabmain").children();o.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var a=i(this),o=a.index();a.addClass(n).siblings().removeClass(n),r.eq(o).show().siblings().hide(),"function"==typeof e.change&&e.change(o)}),"function"==typeof a&&a(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("&#x6CA1;&#x6709;&#x56FE;&#x7247;")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:"shade"in t?t.shade:.9,scrollbar:"scrollbar"in t&&t.scrollbar}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0]<r[1]&&(a[0]=a[0]/r[1],a[1]=a[1]/r[1])}return[a[0]+"px",a[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,isOutAnim:!1,skin:"layui-layer-photos"+c("photos"),content:'<div class="layui-layer-phimg"><img src="'+u[d].src+'" alt="'+(u[d].alt||"")+'" layer-pid="'+u[d].pid+'"><div class="layui-layer-imgsee">'+(u.length>1?'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>':"")+'<div class="layui-layer-imgbar" style="display:'+(a?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(u[d].alt||"")+"</a><em>"+s.imgIndex+"/"+u.length+"</em></span></div></div></div>",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;<br>&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x67E5;&#x770B;&#x4E0B;&#x4E00;&#x5F20;&#xFF1F;",{time:3e4,btn:["&#x4E0B;&#x4E00;&#x5F20;","&#x4E0D;&#x770B;&#x4E86;"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.$),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define('layer',["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window);
  174. /*
  175. * Toastr
  176. * Copyright 2012-2015
  177. * Authors: John Papa, Hans Fjällemark, and Tim Ferrell.
  178. * All Rights Reserved.
  179. * Use, reproduction, distribution, and modification of this code is subject to the terms and
  180. * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php
  181. *
  182. * ARIA Support: Greta Krafsig
  183. *
  184. * Project: https://github.com/CodeSeven/toastr
  185. */
  186. /* global define */
  187. (function (define) {
  188. define('toastr',['jquery'], function ($) {
  189. return (function () {
  190. var $container;
  191. var listener;
  192. var toastId = 0;
  193. var toastType = {
  194. error: 'error',
  195. info: 'info',
  196. success: 'success',
  197. warning: 'warning'
  198. };
  199. var toastr = {
  200. clear: clear,
  201. remove: remove,
  202. error: error,
  203. getContainer: getContainer,
  204. info: info,
  205. options: {},
  206. subscribe: subscribe,
  207. success: success,
  208. version: '2.1.3',
  209. warning: warning
  210. };
  211. var previousToast;
  212. return toastr;
  213. ////////////////
  214. function error(message, title, optionsOverride) {
  215. return notify({
  216. type: toastType.error,
  217. iconClass: getOptions().iconClasses.error,
  218. message: message,
  219. optionsOverride: optionsOverride,
  220. title: title
  221. });
  222. }
  223. function getContainer(options, create) {
  224. if (!options) { options = getOptions(); }
  225. $container = $('#' + options.containerId);
  226. if ($container.length) {
  227. return $container;
  228. }
  229. if (create) {
  230. $container = createContainer(options);
  231. }
  232. return $container;
  233. }
  234. function info(message, title, optionsOverride) {
  235. return notify({
  236. type: toastType.info,
  237. iconClass: getOptions().iconClasses.info,
  238. message: message,
  239. optionsOverride: optionsOverride,
  240. title: title
  241. });
  242. }
  243. function subscribe(callback) {
  244. listener = callback;
  245. }
  246. function success(message, title, optionsOverride) {
  247. return notify({
  248. type: toastType.success,
  249. iconClass: getOptions().iconClasses.success,
  250. message: message,
  251. optionsOverride: optionsOverride,
  252. title: title
  253. });
  254. }
  255. function warning(message, title, optionsOverride) {
  256. return notify({
  257. type: toastType.warning,
  258. iconClass: getOptions().iconClasses.warning,
  259. message: message,
  260. optionsOverride: optionsOverride,
  261. title: title
  262. });
  263. }
  264. function clear($toastElement, clearOptions) {
  265. var options = getOptions();
  266. if (!$container) { getContainer(options); }
  267. if (!clearToast($toastElement, options, clearOptions)) {
  268. clearContainer(options);
  269. }
  270. }
  271. function remove($toastElement) {
  272. var options = getOptions();
  273. if (!$container) { getContainer(options); }
  274. if ($toastElement && $(':focus', $toastElement).length === 0) {
  275. removeToast($toastElement);
  276. return;
  277. }
  278. if ($container.children().length) {
  279. $container.remove();
  280. }
  281. }
  282. // internal functions
  283. function clearContainer (options) {
  284. var toastsToClear = $container.children();
  285. for (var i = toastsToClear.length - 1; i >= 0; i--) {
  286. clearToast($(toastsToClear[i]), options);
  287. }
  288. }
  289. function clearToast ($toastElement, options, clearOptions) {
  290. var force = clearOptions && clearOptions.force ? clearOptions.force : false;
  291. if ($toastElement && (force || $(':focus', $toastElement).length === 0)) {
  292. $toastElement[options.hideMethod]({
  293. duration: options.hideDuration,
  294. easing: options.hideEasing,
  295. complete: function () { removeToast($toastElement); }
  296. });
  297. return true;
  298. }
  299. return false;
  300. }
  301. function createContainer(options) {
  302. $container = $('<div/>')
  303. .attr('id', options.containerId)
  304. .addClass(options.positionClass);
  305. $container.appendTo($(options.target));
  306. return $container;
  307. }
  308. function getDefaults() {
  309. return {
  310. tapToDismiss: true,
  311. toastClass: 'toast',
  312. containerId: 'toast-container',
  313. debug: false,
  314. showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery
  315. showDuration: 300,
  316. showEasing: 'swing', //swing and linear are built into jQuery
  317. onShown: undefined,
  318. hideMethod: 'fadeOut',
  319. hideDuration: 1000,
  320. hideEasing: 'swing',
  321. onHidden: undefined,
  322. closeMethod: false,
  323. closeDuration: false,
  324. closeEasing: false,
  325. closeOnHover: true,
  326. extendedTimeOut: 1000,
  327. iconClasses: {
  328. error: 'toast-error',
  329. info: 'toast-info',
  330. success: 'toast-success',
  331. warning: 'toast-warning'
  332. },
  333. iconClass: 'toast-info',
  334. positionClass: 'toast-top-right',
  335. timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky
  336. titleClass: 'toast-title',
  337. messageClass: 'toast-message',
  338. escapeHtml: false,
  339. target: 'body',
  340. closeHtml: '<button type="button">&times;</button>',
  341. closeClass: 'toast-close-button',
  342. newestOnTop: true,
  343. preventDuplicates: false,
  344. progressBar: false,
  345. progressClass: 'toast-progress',
  346. rtl: false
  347. };
  348. }
  349. function publish(args) {
  350. if (!listener) { return; }
  351. listener(args);
  352. }
  353. function notify(map) {
  354. var options = getOptions();
  355. var iconClass = map.iconClass || options.iconClass;
  356. if (typeof (map.optionsOverride) !== 'undefined') {
  357. options = $.extend(options, map.optionsOverride);
  358. iconClass = map.optionsOverride.iconClass || iconClass;
  359. }
  360. if (shouldExit(options, map)) { return; }
  361. toastId++;
  362. $container = getContainer(options, true);
  363. var intervalId = null;
  364. var $toastElement = $('<div/>');
  365. var $titleElement = $('<div/>');
  366. var $messageElement = $('<div/>');
  367. var $progressElement = $('<div/>');
  368. var $closeElement = $(options.closeHtml);
  369. var progressBar = {
  370. intervalId: null,
  371. hideEta: null,
  372. maxHideTime: null
  373. };
  374. var response = {
  375. toastId: toastId,
  376. state: 'visible',
  377. startTime: new Date(),
  378. options: options,
  379. map: map
  380. };
  381. personalizeToast();
  382. displayToast();
  383. handleEvents();
  384. publish(response);
  385. if (options.debug && console) {
  386. console.log(response);
  387. }
  388. return $toastElement;
  389. function escapeHtml(source) {
  390. if (source == null) {
  391. source = '';
  392. }
  393. return source
  394. .replace(/&/g, '&amp;')
  395. .replace(/"/g, '&quot;')
  396. .replace(/'/g, '&#39;')
  397. .replace(/</g, '&lt;')
  398. .replace(/>/g, '&gt;');
  399. }
  400. function personalizeToast() {
  401. setIcon();
  402. setTitle();
  403. setMessage();
  404. setCloseButton();
  405. setProgressBar();
  406. setRTL();
  407. setSequence();
  408. setAria();
  409. }
  410. function setAria() {
  411. var ariaValue = '';
  412. switch (map.iconClass) {
  413. case 'toast-success':
  414. case 'toast-info':
  415. ariaValue = 'polite';
  416. break;
  417. default:
  418. ariaValue = 'assertive';
  419. }
  420. $toastElement.attr('aria-live', ariaValue);
  421. }
  422. function handleEvents() {
  423. if (options.closeOnHover) {
  424. $toastElement.hover(stickAround, delayedHideToast);
  425. }
  426. if (!options.onclick && options.tapToDismiss) {
  427. $toastElement.click(hideToast);
  428. }
  429. if (options.closeButton && $closeElement) {
  430. $closeElement.click(function (event) {
  431. if (event.stopPropagation) {
  432. event.stopPropagation();
  433. } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {
  434. event.cancelBubble = true;
  435. }
  436. if (options.onCloseClick) {
  437. options.onCloseClick(event);
  438. }
  439. hideToast(true);
  440. });
  441. }
  442. if (options.onclick) {
  443. $toastElement.click(function (event) {
  444. options.onclick(event);
  445. hideToast();
  446. });
  447. }
  448. }
  449. function displayToast() {
  450. $toastElement.hide();
  451. $toastElement[options.showMethod](
  452. {duration: options.showDuration, easing: options.showEasing, complete: options.onShown}
  453. );
  454. if (options.timeOut > 0) {
  455. intervalId = setTimeout(hideToast, options.timeOut);
  456. progressBar.maxHideTime = parseFloat(options.timeOut);
  457. progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
  458. if (options.progressBar) {
  459. progressBar.intervalId = setInterval(updateProgress, 10);
  460. }
  461. }
  462. }
  463. function setIcon() {
  464. if (map.iconClass) {
  465. $toastElement.addClass(options.toastClass).addClass(iconClass);
  466. }
  467. }
  468. function setSequence() {
  469. if (options.newestOnTop) {
  470. $container.prepend($toastElement);
  471. } else {
  472. $container.append($toastElement);
  473. }
  474. }
  475. function setTitle() {
  476. if (map.title) {
  477. var suffix = map.title;
  478. if (options.escapeHtml) {
  479. suffix = escapeHtml(map.title);
  480. }
  481. $titleElement.append(suffix).addClass(options.titleClass);
  482. $toastElement.append($titleElement);
  483. }
  484. }
  485. function setMessage() {
  486. if (map.message) {
  487. var suffix = map.message;
  488. if (options.escapeHtml) {
  489. suffix = escapeHtml(map.message);
  490. }
  491. $messageElement.append(suffix).addClass(options.messageClass);
  492. $toastElement.append($messageElement);
  493. }
  494. }
  495. function setCloseButton() {
  496. if (options.closeButton) {
  497. $closeElement.addClass(options.closeClass).attr('role', 'button');
  498. $toastElement.prepend($closeElement);
  499. }
  500. }
  501. function setProgressBar() {
  502. if (options.progressBar) {
  503. $progressElement.addClass(options.progressClass);
  504. $toastElement.prepend($progressElement);
  505. }
  506. }
  507. function setRTL() {
  508. if (options.rtl) {
  509. $toastElement.addClass('rtl');
  510. }
  511. }
  512. function shouldExit(options, map) {
  513. if (options.preventDuplicates) {
  514. if (map.message === previousToast) {
  515. return true;
  516. } else {
  517. previousToast = map.message;
  518. }
  519. }
  520. return false;
  521. }
  522. function hideToast(override) {
  523. var method = override && options.closeMethod !== false ? options.closeMethod : options.hideMethod;
  524. var duration = override && options.closeDuration !== false ?
  525. options.closeDuration : options.hideDuration;
  526. var easing = override && options.closeEasing !== false ? options.closeEasing : options.hideEasing;
  527. if ($(':focus', $toastElement).length && !override) {
  528. return;
  529. }
  530. clearTimeout(progressBar.intervalId);
  531. return $toastElement[method]({
  532. duration: duration,
  533. easing: easing,
  534. complete: function () {
  535. removeToast($toastElement);
  536. clearTimeout(intervalId);
  537. if (options.onHidden && response.state !== 'hidden') {
  538. options.onHidden();
  539. }
  540. response.state = 'hidden';
  541. response.endTime = new Date();
  542. publish(response);
  543. }
  544. });
  545. }
  546. function delayedHideToast() {
  547. if (options.timeOut > 0 || options.extendedTimeOut > 0) {
  548. intervalId = setTimeout(hideToast, options.extendedTimeOut);
  549. progressBar.maxHideTime = parseFloat(options.extendedTimeOut);
  550. progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
  551. }
  552. }
  553. function stickAround() {
  554. clearTimeout(intervalId);
  555. progressBar.hideEta = 0;
  556. $toastElement.stop(true, true)[options.showMethod](
  557. {duration: options.showDuration, easing: options.showEasing}
  558. );
  559. }
  560. function updateProgress() {
  561. var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100;
  562. $progressElement.width(percentage + '%');
  563. }
  564. }
  565. function getOptions() {
  566. return $.extend({}, getDefaults(), toastr.options);
  567. }
  568. function removeToast($toastElement) {
  569. if (!$container) { $container = getContainer(); }
  570. if ($toastElement.is(':visible')) {
  571. return;
  572. }
  573. $toastElement.remove();
  574. $toastElement = null;
  575. if ($container.children().length === 0) {
  576. $container.remove();
  577. previousToast = undefined;
  578. }
  579. }
  580. })();
  581. });
  582. }(typeof define === 'function' && define.amd ? define : function (deps, factory) {
  583. if (typeof module !== 'undefined' && module.exports) { //Node
  584. module.exports = factory(require('jquery'));
  585. } else {
  586. window.toastr = factory(window.jQuery);
  587. }
  588. }));
  589. define('fast',['jquery', 'bootstrap', 'toastr', 'layer', 'lang'], function ($, undefined, Toastr, Layer, Lang) {
  590. var Fast = {
  591. config: {
  592. //toastr默认配置
  593. toastr: {
  594. "closeButton": true,
  595. "debug": false,
  596. "newestOnTop": false,
  597. "progressBar": false,
  598. "positionClass": "toast-top-center",
  599. "preventDuplicates": false,
  600. "onclick": null,
  601. "showDuration": "300",
  602. "hideDuration": "1000",
  603. "timeOut": "5000",
  604. "extendedTimeOut": "1000",
  605. "showEasing": "swing",
  606. "hideEasing": "linear",
  607. "showMethod": "fadeIn",
  608. "hideMethod": "fadeOut"
  609. }
  610. },
  611. events: {
  612. //请求成功的回调
  613. onAjaxSuccess: function (ret, onAjaxSuccess) {
  614. var data = typeof ret.data !== 'undefined' ? ret.data : null;
  615. var msg = typeof ret.msg !== 'undefined' && ret.msg ? ret.msg : __('Operation completed');
  616. if (typeof onAjaxSuccess === 'function') {
  617. var result = onAjaxSuccess.call(this, data, ret);
  618. if (result === false)
  619. return;
  620. }
  621. Toastr.success(msg);
  622. },
  623. //请求错误的回调
  624. onAjaxError: function (ret, onAjaxError) {
  625. var data = typeof ret.data !== 'undefined' ? ret.data : null;
  626. if (typeof onAjaxError === 'function') {
  627. var result = onAjaxError.call(this, data, ret);
  628. if (result === false) {
  629. return;
  630. }
  631. }
  632. Toastr.error(ret.msg);
  633. },
  634. //服务器响应数据后
  635. onAjaxResponse: function (response) {
  636. try {
  637. var ret = typeof response === 'object' ? response : JSON.parse(response);
  638. if (!ret.hasOwnProperty('code')) {
  639. $.extend(ret, {code: -2, msg: response, data: null});
  640. }
  641. } catch (e) {
  642. var ret = {code: -1, msg: e.message, data: null};
  643. }
  644. return ret;
  645. }
  646. },
  647. api: {
  648. //发送Ajax请求
  649. ajax: function (options, success, error) {
  650. options = typeof options === 'string' ? {url: options} : options;
  651. var index;
  652. if (typeof options.loading === 'undefined' || options.loading) {
  653. index = Layer.load(options.loading || 0);
  654. }
  655. options = $.extend({
  656. type: "POST",
  657. dataType: "json",
  658. xhrFields: {
  659. withCredentials: true
  660. },
  661. success: function (ret) {
  662. index && Layer.close(index);
  663. ret = Fast.events.onAjaxResponse(ret);
  664. if (ret.code === 1) {
  665. Fast.events.onAjaxSuccess(ret, success);
  666. } else {
  667. Fast.events.onAjaxError(ret, error);
  668. }
  669. },
  670. error: function (xhr) {
  671. index && Layer.close(index);
  672. var ret = {code: xhr.status, msg: xhr.statusText, data: null};
  673. Fast.events.onAjaxError(ret, error);
  674. }
  675. }, options);
  676. return $.ajax(options);
  677. },
  678. //修复URL
  679. fixurl: function (url) {
  680. if (url.substr(0, 1) !== "/") {
  681. var r = new RegExp('^(?:[a-z]+:)?//', 'i');
  682. if (!r.test(url)) {
  683. url = Config.moduleurl + "/" + url;
  684. }
  685. } else if (url.substr(0, 8) === "/addons/") {
  686. url = Config.__PUBLIC__.replace(/(\/*$)/g, "") + url;
  687. }
  688. return url;
  689. },
  690. //获取修复后可访问的cdn链接
  691. cdnurl: function (url, domain) {
  692. var rule = new RegExp("^((?:[a-z]+:)?\\/\\/|data:image\\/)", "i");
  693. var url = rule.test(url) ? url : Config.upload.cdnurl + url;
  694. if (domain && !rule.test(url)) {
  695. domain = typeof domain === 'string' ? domain : location.origin;
  696. url = domain + url;
  697. }
  698. return url;
  699. },
  700. //查询Url参数
  701. query: function (name, url) {
  702. if (!url) {
  703. url = window.location.href;
  704. }
  705. name = name.replace(/[\[\]]/g, "\\$&");
  706. var regex = new RegExp("[?&/]" + name + "([=/]([^&#/?]*)|&|#|$)"),
  707. results = regex.exec(url);
  708. if (!results)
  709. return null;
  710. if (!results[2])
  711. return '';
  712. return decodeURIComponent(results[2].replace(/\+/g, " "));
  713. },
  714. //打开一个弹出窗口
  715. open: function (url, title, options) {
  716. title = options && options.title ? options.title : (title ? title : "");
  717. url = Fast.api.fixurl(url);
  718. url = url + (url.indexOf("?") > -1 ? "&" : "?") + "dialog=1";
  719. var area = Fast.config.openArea != undefined ? Fast.config.openArea : [$(window).width() > 800 ? '800px' : '95%', $(window).height() > 600 ? '600px' : '95%'];
  720. options = $.extend({
  721. type: 2,
  722. title: title,
  723. shadeClose: true,
  724. shade: false,
  725. maxmin: true,
  726. moveOut: true,
  727. area: area,
  728. content: url,
  729. zIndex: Layer.zIndex,
  730. success: function (layero, index) {
  731. var that = this;
  732. //存储callback事件
  733. $(layero).data("callback", that.callback);
  734. //$(layero).removeClass("layui-layer-border");
  735. Layer.setTop(layero);
  736. try {
  737. var frame = Layer.getChildFrame('html', index);
  738. var layerfooter = frame.find(".layer-footer");
  739. Fast.api.layerfooter(layero, index, that);
  740. //绑定事件
  741. if (layerfooter.size() > 0) {
  742. // 监听窗口内的元素及属性变化
  743. // Firefox和Chrome早期版本中带有前缀
  744. var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  745. if (MutationObserver) {
  746. // 选择目标节点
  747. var target = layerfooter[0];
  748. // 创建观察者对象
  749. var observer = new MutationObserver(function (mutations) {
  750. Fast.api.layerfooter(layero, index, that);
  751. mutations.forEach(function (mutation) {
  752. });
  753. });
  754. // 配置观察选项:
  755. var config = {attributes: true, childList: true, characterData: true, subtree: true}
  756. // 传入目标节点和观察选项
  757. observer.observe(target, config);
  758. // 随后,你还可以停止观察
  759. // observer.disconnect();
  760. }
  761. }
  762. } catch (e) {
  763. }
  764. if ($(layero).height() > $(window).height()) {
  765. //当弹出窗口大于浏览器可视高度时,重定位
  766. Layer.style(index, {
  767. top: 0,
  768. height: $(window).height()
  769. });
  770. }
  771. }
  772. }, options ? options : {});
  773. if ($(window).width() < 480 || (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream && top.$(".tab-pane.active").size() > 0)) {
  774. options.area = [top.$(".tab-pane.active").width() + "px", top.$(".tab-pane.active").height() + "px"];
  775. options.offset = [top.$(".tab-pane.active").scrollTop() + "px", "0px"];
  776. }
  777. return Layer.open(options);
  778. },
  779. //关闭窗口并回传数据
  780. close: function (data) {
  781. var index = parent.Layer.getFrameIndex(window.name);
  782. var callback = parent.$("#layui-layer" + index).data("callback");
  783. //再执行关闭
  784. parent.Layer.close(index);
  785. //再调用回传函数
  786. if (typeof callback === 'function') {
  787. callback.call(undefined, data);
  788. }
  789. },
  790. layerfooter: function (layero, index, that) {
  791. var frame = Layer.getChildFrame('html', index);
  792. var layerfooter = frame.find(".layer-footer");
  793. if (layerfooter.size() > 0) {
  794. $(".layui-layer-footer", layero).remove();
  795. var footer = $("<div />").addClass('layui-layer-btn layui-layer-footer');
  796. footer.html(layerfooter.html());
  797. if ($(".row", footer).size() === 0) {
  798. $(">", footer).wrapAll("<div class='row'></div>");
  799. }
  800. footer.insertAfter(layero.find('.layui-layer-content'));
  801. //绑定事件
  802. footer.on("click", ".btn", function () {
  803. if ($(this).hasClass("disabled") || $(this).parent().hasClass("disabled")) {
  804. return;
  805. }
  806. var index = footer.find('.btn').index(this);
  807. $(".btn:eq(" + index + ")", layerfooter).trigger("click");
  808. });
  809. var titHeight = layero.find('.layui-layer-title').outerHeight() || 0;
  810. var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0;
  811. //重设iframe高度
  812. $("iframe", layero).height(layero.height() - titHeight - btnHeight);
  813. }
  814. //修复iOS下弹出窗口的高度和iOS下iframe无法滚动的BUG
  815. if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
  816. var titHeight = layero.find('.layui-layer-title').outerHeight() || 0;
  817. var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0;
  818. $("iframe", layero).parent().css("height", layero.height() - titHeight - btnHeight);
  819. $("iframe", layero).css("height", "100%");
  820. }
  821. },
  822. success: function (options, callback) {
  823. var type = typeof options === 'function';
  824. if (type) {
  825. callback = options;
  826. }
  827. return Layer.msg(__('Operation completed'), $.extend({
  828. offset: 0, icon: 1
  829. }, type ? {} : options), callback);
  830. },
  831. error: function (options, callback) {
  832. var type = typeof options === 'function';
  833. if (type) {
  834. callback = options;
  835. }
  836. return Layer.msg(__('Operation failed'), $.extend({
  837. offset: 0, icon: 2
  838. }, type ? {} : options), callback);
  839. },
  840. msg: function (message, url) {
  841. var callback = typeof url === 'function' ? url : function () {
  842. if (typeof url !== 'undefined' && url) {
  843. location.href = url;
  844. }
  845. };
  846. Layer.msg(message, {
  847. time: 2000
  848. }, callback);
  849. },
  850. toastr: Toastr,
  851. layer: Layer
  852. },
  853. lang: function () {
  854. var args = arguments,
  855. string = args[0],
  856. i = 1;
  857. string = string.toLowerCase();
  858. //string = typeof Lang[string] != 'undefined' ? Lang[string] : string;
  859. if (typeof Lang !== 'undefined' && typeof Lang[string] !== 'undefined') {
  860. if (typeof Lang[string] == 'object')
  861. return Lang[string];
  862. string = Lang[string];
  863. } else if (string.indexOf('.') !== -1 && false) {
  864. var arr = string.split('.');
  865. var current = Lang[arr[0]];
  866. for (var i = 1; i < arr.length; i++) {
  867. current = typeof current[arr[i]] != 'undefined' ? current[arr[i]] : '';
  868. if (typeof current != 'object')
  869. break;
  870. }
  871. if (typeof current == 'object')
  872. return current;
  873. string = current;
  874. } else {
  875. string = args[0];
  876. }
  877. return string.replace(/%((%)|s|d)/g, function (m) {
  878. // m is the matched format, e.g. %s, %d
  879. var val = null;
  880. if (m[2]) {
  881. val = m[2];
  882. } else {
  883. val = args[i];
  884. // A switch statement so that the formatter can be extended. Default is %s
  885. switch (m) {
  886. case '%d':
  887. val = parseFloat(val);
  888. if (isNaN(val)) {
  889. val = 0;
  890. }
  891. break;
  892. }
  893. i++;
  894. }
  895. return val;
  896. });
  897. },
  898. init: function () {
  899. // 对相对地址进行处理
  900. $.ajaxSetup({
  901. beforeSend: function (xhr, setting) {
  902. setting.url = Fast.api.fixurl(setting.url);
  903. }
  904. });
  905. Layer.config({
  906. skin: 'layui-layer-fast'
  907. });
  908. // 绑定ESC关闭窗口事件
  909. $(window).keyup(function (e) {
  910. if (e.keyCode == 27) {
  911. if ($(".layui-layer").size() > 0) {
  912. var index = 0;
  913. $(".layui-layer").each(function () {
  914. index = Math.max(index, parseInt($(this).attr("times")));
  915. });
  916. if (index) {
  917. Layer.close(index);
  918. }
  919. }
  920. }
  921. });
  922. //公共代码
  923. //配置Toastr的参数
  924. Toastr.options = Fast.config.toastr;
  925. }
  926. };
  927. //将Layer暴露到全局中去
  928. window.Layer = Layer;
  929. //将Toastr暴露到全局中去
  930. window.Toastr = Toastr;
  931. //将语言方法暴露到全局中去
  932. window.__ = Fast.lang;
  933. //将Fast渲染至全局
  934. window.Fast = Fast;
  935. //默认初始化执行的代码
  936. Fast.init();
  937. return Fast;
  938. });
  939. /*!art-template - Template Engine | http://aui.github.com/artTemplate/*/
  940. !function(){function a(a){return a.replace(t,"").replace(u,",").replace(v,"").replace(w,"").replace(x,"").split(y)}function b(a){return"'"+a.replace(/('|\\)/g,"\\$1").replace(/\r/g,"\\r").replace(/\n/g,"\\n")+"'"}function c(c,d){function e(a){return m+=a.split(/\n/).length-1,k&&(a=a.replace(/\s+/g," ").replace(/<!--[\w\W]*?-->/g,"")),a&&(a=s[1]+b(a)+s[2]+"\n"),a}function f(b){var c=m;if(j?b=j(b,d):g&&(b=b.replace(/\n/g,function(){return m++,"$line="+m+";"})),0===b.indexOf("=")){var e=l&&!/^=[=#]/.test(b);if(b=b.replace(/^=[=#]?|[\s;]*$/g,""),e){var f=b.replace(/\s*\([^\)]+\)/,"");n[f]||/^(include|print)$/.test(f)||(b="$escape("+b+")")}else b="$string("+b+")";b=s[1]+b+s[2]}return g&&(b="$line="+c+";"+b),r(a(b),function(a){if(a&&!p[a]){var b;b="print"===a?u:"include"===a?v:n[a]?"$utils."+a:o[a]?"$helpers."+a:"$data."+a,w+=a+"="+b+",",p[a]=!0}}),b+"\n"}var g=d.debug,h=d.openTag,i=d.closeTag,j=d.parser,k=d.compress,l=d.escape,m=1,p={$data:1,$filename:1,$utils:1,$helpers:1,$out:1,$line:1},q="".trim,s=q?["$out='';","$out+=",";","$out"]:["$out=[];","$out.push(",");","$out.join('')"],t=q?"$out+=text;return $out;":"$out.push(text);",u="function(){var text=''.concat.apply('',arguments);"+t+"}",v="function(filename,data){data=data||$data;var text=$utils.$include(filename,data,$filename);"+t+"}",w="'use strict';var $utils=this,$helpers=$utils.$helpers,"+(g?"$line=0,":""),x=s[0],y="return new String("+s[3]+");";r(c.split(h),function(a){a=a.split(i);var b=a[0],c=a[1];1===a.length?x+=e(b):(x+=f(b),c&&(x+=e(c)))});var z=w+x+y;g&&(z="try{"+z+"}catch(e){throw {filename:$filename,name:'Render Error',message:e.message,line:$line,source:"+b(c)+".split(/\\n/)[$line-1].replace(/^\\s+/,'')};}");try{var A=new Function("$data","$filename",z);return A.prototype=n,A}catch(a){throw a.temp="function anonymous($data,$filename) {"+z+"}",a}}var d=function(a,b){return"string"==typeof b?q(b,{filename:a}):g(a,b)};d.version="3.0.0",d.config=function(a,b){e[a]=b};var e=d.defaults={openTag:"<%",closeTag:"%>",escape:!0,cache:!0,compress:!1,parser:null},f=d.cache={};d.render=function(a,b){return q(a)(b)};var g=d.renderFile=function(a,b){var c=d.get(a)||p({filename:a,name:"Render Error",message:"Template not found"});return b?c(b):c};d.get=function(a){var b;if(f[a])b=f[a];else if("object"==typeof document){var c=document.getElementById(a);if(c){var d=(c.value||c.innerHTML).replace(/^\s*|\s*$/g,"");b=q(d,{filename:a})}}return b};var h=function(a,b){return"string"!=typeof a&&(b=typeof a,"number"===b?a+="":a="function"===b?h(a.call(a)):""),a},i={"<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","&":"&#38;"},j=function(a){return i[a]},k=function(a){return h(a).replace(/&(?![\w#]+;)|[<>"']/g,j)},l=Array.isArray||function(a){return"[object Array]"==={}.toString.call(a)},m=function(a,b){var c,d;if(l(a))for(c=0,d=a.length;c<d;c++)b.call(a,a[c],c,a);else for(c in a)b.call(a,a[c],c)},n=d.utils={$helpers:{},$include:g,$string:h,$escape:k,$each:m};d.helper=function(a,b){o[a]=b};var o=d.helpers=n.$helpers;d.onerror=function(a){var b="Template Error\n\n";for(var c in a)b+="<"+c+">\n"+a[c]+"\n\n";"object"==typeof console&&console.error(b)};var p=function(a){return d.onerror(a),function(){return"{Template Error}"}},q=d.compile=function(a,b){function d(c){try{return new i(c,h)+""}catch(d){return b.debug?p(d)():(b.debug=!0,q(a,b)(c))}}b=b||{};for(var g in e)void 0===b[g]&&(b[g]=e[g]);var h=b.filename;try{var i=c(a,b)}catch(a){return a.filename=h||"anonymous",a.name="Syntax Error",p(a)}return d.prototype=i.prototype,d.toString=function(){return i.toString()},h&&b.cache&&(f[h]=d),d},r=n.$each,s="break,case,catch,continue,debugger,default,delete,do,else,false,finally,for,function,if,in,instanceof,new,null,return,switch,this,throw,true,try,typeof,var,void,while,with,abstract,boolean,byte,char,class,const,double,enum,export,extends,final,float,goto,implements,import,int,interface,long,native,package,private,protected,public,short,static,super,synchronized,throws,transient,volatile,arguments,let,yield,undefined",t=/\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|\s*\.\s*[$\w\.]+/g,u=/[^\w$]+/g,v=new RegExp(["\\b"+s.replace(/,/g,"\\b|\\b")+"\\b"].join("|"),"g"),w=/^\d[^,]*|,\d[^,]*/g,x=/^,+|,+$/g,y=/^$|,+/;"object"==typeof exports&&"undefined"!=typeof module?module.exports=d:"function"==typeof define?define('template',[],function(){return d}):this.template=d}();
  941. //! moment.js
  942. //! version : 2.26.0
  943. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  944. //! license : MIT
  945. //! momentjs.com
  946. ;(function (global, factory) {
  947. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  948. typeof define === 'function' && define.amd ? define('moment/moment',factory) :
  949. global.moment = factory()
  950. }(this, (function () { 'use strict';
  951. var hookCallback;
  952. function hooks() {
  953. return hookCallback.apply(null, arguments);
  954. }
  955. // This is done to register the method called with moment()
  956. // without creating circular dependencies.
  957. function setHookCallback(callback) {
  958. hookCallback = callback;
  959. }
  960. function isArray(input) {
  961. return (
  962. input instanceof Array ||
  963. Object.prototype.toString.call(input) === '[object Array]'
  964. );
  965. }
  966. function isObject(input) {
  967. // IE8 will treat undefined and null as object if it wasn't for
  968. // input != null
  969. return (
  970. input != null &&
  971. Object.prototype.toString.call(input) === '[object Object]'
  972. );
  973. }
  974. function hasOwnProp(a, b) {
  975. return Object.prototype.hasOwnProperty.call(a, b);
  976. }
  977. function isObjectEmpty(obj) {
  978. if (Object.getOwnPropertyNames) {
  979. return Object.getOwnPropertyNames(obj).length === 0;
  980. } else {
  981. var k;
  982. for (k in obj) {
  983. if (hasOwnProp(obj, k)) {
  984. return false;
  985. }
  986. }
  987. return true;
  988. }
  989. }
  990. function isUndefined(input) {
  991. return input === void 0;
  992. }
  993. function isNumber(input) {
  994. return (
  995. typeof input === 'number' ||
  996. Object.prototype.toString.call(input) === '[object Number]'
  997. );
  998. }
  999. function isDate(input) {
  1000. return (
  1001. input instanceof Date ||
  1002. Object.prototype.toString.call(input) === '[object Date]'
  1003. );
  1004. }
  1005. function map(arr, fn) {
  1006. var res = [],
  1007. i;
  1008. for (i = 0; i < arr.length; ++i) {
  1009. res.push(fn(arr[i], i));
  1010. }
  1011. return res;
  1012. }
  1013. function extend(a, b) {
  1014. for (var i in b) {
  1015. if (hasOwnProp(b, i)) {
  1016. a[i] = b[i];
  1017. }
  1018. }
  1019. if (hasOwnProp(b, 'toString')) {
  1020. a.toString = b.toString;
  1021. }
  1022. if (hasOwnProp(b, 'valueOf')) {
  1023. a.valueOf = b.valueOf;
  1024. }
  1025. return a;
  1026. }
  1027. function createUTC(input, format, locale, strict) {
  1028. return createLocalOrUTC(input, format, locale, strict, true).utc();
  1029. }
  1030. function defaultParsingFlags() {
  1031. // We need to deep clone this object.
  1032. return {
  1033. empty: false,
  1034. unusedTokens: [],
  1035. unusedInput: [],
  1036. overflow: -2,
  1037. charsLeftOver: 0,
  1038. nullInput: false,
  1039. invalidEra: null,
  1040. invalidMonth: null,
  1041. invalidFormat: false,
  1042. userInvalidated: false,
  1043. iso: false,
  1044. parsedDateParts: [],
  1045. era: null,
  1046. meridiem: null,
  1047. rfc2822: false,
  1048. weekdayMismatch: false,
  1049. };
  1050. }
  1051. function getParsingFlags(m) {
  1052. if (m._pf == null) {
  1053. m._pf = defaultParsingFlags();
  1054. }
  1055. return m._pf;
  1056. }
  1057. var some;
  1058. if (Array.prototype.some) {
  1059. some = Array.prototype.some;
  1060. } else {
  1061. some = function (fun) {
  1062. var t = Object(this),
  1063. len = t.length >>> 0,
  1064. i;
  1065. for (i = 0; i < len; i++) {
  1066. if (i in t && fun.call(this, t[i], i, t)) {
  1067. return true;
  1068. }
  1069. }
  1070. return false;
  1071. };
  1072. }
  1073. function isValid(m) {
  1074. if (m._isValid == null) {
  1075. var flags = getParsingFlags(m),
  1076. parsedParts = some.call(flags.parsedDateParts, function (i) {
  1077. return i != null;
  1078. }),
  1079. isNowValid =
  1080. !isNaN(m._d.getTime()) &&
  1081. flags.overflow < 0 &&
  1082. !flags.empty &&
  1083. !flags.invalidEra &&
  1084. !flags.invalidMonth &&
  1085. !flags.invalidWeekday &&
  1086. !flags.weekdayMismatch &&
  1087. !flags.nullInput &&
  1088. !flags.invalidFormat &&
  1089. !flags.userInvalidated &&
  1090. (!flags.meridiem || (flags.meridiem && parsedParts));
  1091. if (m._strict) {
  1092. isNowValid =
  1093. isNowValid &&
  1094. flags.charsLeftOver === 0 &&
  1095. flags.unusedTokens.length === 0 &&
  1096. flags.bigHour === undefined;
  1097. }
  1098. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  1099. m._isValid = isNowValid;
  1100. } else {
  1101. return isNowValid;
  1102. }
  1103. }
  1104. return m._isValid;
  1105. }
  1106. function createInvalid(flags) {
  1107. var m = createUTC(NaN);
  1108. if (flags != null) {
  1109. extend(getParsingFlags(m), flags);
  1110. } else {
  1111. getParsingFlags(m).userInvalidated = true;
  1112. }
  1113. return m;
  1114. }
  1115. // Plugins that add properties should also add the key here (null value),
  1116. // so we can properly clone ourselves.
  1117. var momentProperties = (hooks.momentProperties = []),
  1118. updateInProgress = false;
  1119. function copyConfig(to, from) {
  1120. var i, prop, val;
  1121. if (!isUndefined(from._isAMomentObject)) {
  1122. to._isAMomentObject = from._isAMomentObject;
  1123. }
  1124. if (!isUndefined(from._i)) {
  1125. to._i = from._i;
  1126. }
  1127. if (!isUndefined(from._f)) {
  1128. to._f = from._f;
  1129. }
  1130. if (!isUndefined(from._l)) {
  1131. to._l = from._l;
  1132. }
  1133. if (!isUndefined(from._strict)) {
  1134. to._strict = from._strict;
  1135. }
  1136. if (!isUndefined(from._tzm)) {
  1137. to._tzm = from._tzm;
  1138. }
  1139. if (!isUndefined(from._isUTC)) {
  1140. to._isUTC = from._isUTC;
  1141. }
  1142. if (!isUndefined(from._offset)) {
  1143. to._offset = from._offset;
  1144. }
  1145. if (!isUndefined(from._pf)) {
  1146. to._pf = getParsingFlags(from);
  1147. }
  1148. if (!isUndefined(from._locale)) {
  1149. to._locale = from._locale;
  1150. }
  1151. if (momentProperties.length > 0) {
  1152. for (i = 0; i < momentProperties.length; i++) {
  1153. prop = momentProperties[i];
  1154. val = from[prop];
  1155. if (!isUndefined(val)) {
  1156. to[prop] = val;
  1157. }
  1158. }
  1159. }
  1160. return to;
  1161. }
  1162. // Moment prototype object
  1163. function Moment(config) {
  1164. copyConfig(this, config);
  1165. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  1166. if (!this.isValid()) {
  1167. this._d = new Date(NaN);
  1168. }
  1169. // Prevent infinite loop in case updateOffset creates new moment
  1170. // objects.
  1171. if (updateInProgress === false) {
  1172. updateInProgress = true;
  1173. hooks.updateOffset(this);
  1174. updateInProgress = false;
  1175. }
  1176. }
  1177. function isMoment(obj) {
  1178. return (
  1179. obj instanceof Moment || (obj != null && obj._isAMomentObject != null)
  1180. );
  1181. }
  1182. function warn(msg) {
  1183. if (
  1184. hooks.suppressDeprecationWarnings === false &&
  1185. typeof console !== 'undefined' &&
  1186. console.warn
  1187. ) {
  1188. console.warn('Deprecation warning: ' + msg);
  1189. }
  1190. }
  1191. function deprecate(msg, fn) {
  1192. var firstTime = true;
  1193. return extend(function () {
  1194. if (hooks.deprecationHandler != null) {
  1195. hooks.deprecationHandler(null, msg);
  1196. }
  1197. if (firstTime) {
  1198. var args = [],
  1199. arg,
  1200. i,
  1201. key;
  1202. for (i = 0; i < arguments.length; i++) {
  1203. arg = '';
  1204. if (typeof arguments[i] === 'object') {
  1205. arg += '\n[' + i + '] ';
  1206. for (key in arguments[0]) {
  1207. if (hasOwnProp(arguments[0], key)) {
  1208. arg += key + ': ' + arguments[0][key] + ', ';
  1209. }
  1210. }
  1211. arg = arg.slice(0, -2); // Remove trailing comma and space
  1212. } else {
  1213. arg = arguments[i];
  1214. }
  1215. args.push(arg);
  1216. }
  1217. warn(
  1218. msg +
  1219. '\nArguments: ' +
  1220. Array.prototype.slice.call(args).join('') +
  1221. '\n' +
  1222. new Error().stack
  1223. );
  1224. firstTime = false;
  1225. }
  1226. return fn.apply(this, arguments);
  1227. }, fn);
  1228. }
  1229. var deprecations = {};
  1230. function deprecateSimple(name, msg) {
  1231. if (hooks.deprecationHandler != null) {
  1232. hooks.deprecationHandler(name, msg);
  1233. }
  1234. if (!deprecations[name]) {
  1235. warn(msg);
  1236. deprecations[name] = true;
  1237. }
  1238. }
  1239. hooks.suppressDeprecationWarnings = false;
  1240. hooks.deprecationHandler = null;
  1241. function isFunction(input) {
  1242. return (
  1243. (typeof Function !== 'undefined' && input instanceof Function) ||
  1244. Object.prototype.toString.call(input) === '[object Function]'
  1245. );
  1246. }
  1247. function set(config) {
  1248. var prop, i;
  1249. for (i in config) {
  1250. if (hasOwnProp(config, i)) {
  1251. prop = config[i];
  1252. if (isFunction(prop)) {
  1253. this[i] = prop;
  1254. } else {
  1255. this['_' + i] = prop;
  1256. }
  1257. }
  1258. }
  1259. this._config = config;
  1260. // Lenient ordinal parsing accepts just a number in addition to
  1261. // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
  1262. // TODO: Remove "ordinalParse" fallback in next major release.
  1263. this._dayOfMonthOrdinalParseLenient = new RegExp(
  1264. (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
  1265. '|' +
  1266. /\d{1,2}/.source
  1267. );
  1268. }
  1269. function mergeConfigs(parentConfig, childConfig) {
  1270. var res = extend({}, parentConfig),
  1271. prop;
  1272. for (prop in childConfig) {
  1273. if (hasOwnProp(childConfig, prop)) {
  1274. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  1275. res[prop] = {};
  1276. extend(res[prop], parentConfig[prop]);
  1277. extend(res[prop], childConfig[prop]);
  1278. } else if (childConfig[prop] != null) {
  1279. res[prop] = childConfig[prop];
  1280. } else {
  1281. delete res[prop];
  1282. }
  1283. }
  1284. }
  1285. for (prop in parentConfig) {
  1286. if (
  1287. hasOwnProp(parentConfig, prop) &&
  1288. !hasOwnProp(childConfig, prop) &&
  1289. isObject(parentConfig[prop])
  1290. ) {
  1291. // make sure changes to properties don't modify parent config
  1292. res[prop] = extend({}, res[prop]);
  1293. }
  1294. }
  1295. return res;
  1296. }
  1297. function Locale(config) {
  1298. if (config != null) {
  1299. this.set(config);
  1300. }
  1301. }
  1302. var keys;
  1303. if (Object.keys) {
  1304. keys = Object.keys;
  1305. } else {
  1306. keys = function (obj) {
  1307. var i,
  1308. res = [];
  1309. for (i in obj) {
  1310. if (hasOwnProp(obj, i)) {
  1311. res.push(i);
  1312. }
  1313. }
  1314. return res;
  1315. };
  1316. }
  1317. var defaultCalendar = {
  1318. sameDay: '[Today at] LT',
  1319. nextDay: '[Tomorrow at] LT',
  1320. nextWeek: 'dddd [at] LT',
  1321. lastDay: '[Yesterday at] LT',
  1322. lastWeek: '[Last] dddd [at] LT',
  1323. sameElse: 'L',
  1324. };
  1325. function calendar(key, mom, now) {
  1326. var output = this._calendar[key] || this._calendar['sameElse'];
  1327. return isFunction(output) ? output.call(mom, now) : output;
  1328. }
  1329. function zeroFill(number, targetLength, forceSign) {
  1330. var absNumber = '' + Math.abs(number),
  1331. zerosToFill = targetLength - absNumber.length,
  1332. sign = number >= 0;
  1333. return (
  1334. (sign ? (forceSign ? '+' : '') : '-') +
  1335. Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +
  1336. absNumber
  1337. );
  1338. }
  1339. var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
  1340. localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
  1341. formatFunctions = {},
  1342. formatTokenFunctions = {};
  1343. // token: 'M'
  1344. // padded: ['MM', 2]
  1345. // ordinal: 'Mo'
  1346. // callback: function () { this.month() + 1 }
  1347. function addFormatToken(token, padded, ordinal, callback) {
  1348. var func = callback;
  1349. if (typeof callback === 'string') {
  1350. func = function () {
  1351. return this[callback]();
  1352. };
  1353. }
  1354. if (token) {
  1355. formatTokenFunctions[token] = func;
  1356. }
  1357. if (padded) {
  1358. formatTokenFunctions[padded[0]] = function () {
  1359. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  1360. };
  1361. }
  1362. if (ordinal) {
  1363. formatTokenFunctions[ordinal] = function () {
  1364. return this.localeData().ordinal(
  1365. func.apply(this, arguments),
  1366. token
  1367. );
  1368. };
  1369. }
  1370. }
  1371. function removeFormattingTokens(input) {
  1372. if (input.match(/\[[\s\S]/)) {
  1373. return input.replace(/^\[|\]$/g, '');
  1374. }
  1375. return input.replace(/\\/g, '');
  1376. }
  1377. function makeFormatFunction(format) {
  1378. var array = format.match(formattingTokens),
  1379. i,
  1380. length;
  1381. for (i = 0, length = array.length; i < length; i++) {
  1382. if (formatTokenFunctions[array[i]]) {
  1383. array[i] = formatTokenFunctions[array[i]];
  1384. } else {
  1385. array[i] = removeFormattingTokens(array[i]);
  1386. }
  1387. }
  1388. return function (mom) {
  1389. var output = '',
  1390. i;
  1391. for (i = 0; i < length; i++) {
  1392. output += isFunction(array[i])
  1393. ? array[i].call(mom, format)
  1394. : array[i];
  1395. }
  1396. return output;
  1397. };
  1398. }
  1399. // format date using native date object
  1400. function formatMoment(m, format) {
  1401. if (!m.isValid()) {
  1402. return m.localeData().invalidDate();
  1403. }
  1404. format = expandFormat(format, m.localeData());
  1405. formatFunctions[format] =
  1406. formatFunctions[format] || makeFormatFunction(format);
  1407. return formatFunctions[format](m);
  1408. }
  1409. function expandFormat(format, locale) {
  1410. var i = 5;
  1411. function replaceLongDateFormatTokens(input) {
  1412. return locale.longDateFormat(input) || input;
  1413. }
  1414. localFormattingTokens.lastIndex = 0;
  1415. while (i >= 0 && localFormattingTokens.test(format)) {
  1416. format = format.replace(
  1417. localFormattingTokens,
  1418. replaceLongDateFormatTokens
  1419. );
  1420. localFormattingTokens.lastIndex = 0;
  1421. i -= 1;
  1422. }
  1423. return format;
  1424. }
  1425. var defaultLongDateFormat = {
  1426. LTS: 'h:mm:ss A',
  1427. LT: 'h:mm A',
  1428. L: 'MM/DD/YYYY',
  1429. LL: 'MMMM D, YYYY',
  1430. LLL: 'MMMM D, YYYY h:mm A',
  1431. LLLL: 'dddd, MMMM D, YYYY h:mm A',
  1432. };
  1433. function longDateFormat(key) {
  1434. var format = this._longDateFormat[key],
  1435. formatUpper = this._longDateFormat[key.toUpperCase()];
  1436. if (format || !formatUpper) {
  1437. return format;
  1438. }
  1439. this._longDateFormat[key] = formatUpper
  1440. .match(formattingTokens)
  1441. .map(function (tok) {
  1442. if (
  1443. tok === 'MMMM' ||
  1444. tok === 'MM' ||
  1445. tok === 'DD' ||
  1446. tok === 'dddd'
  1447. ) {
  1448. return tok.slice(1);
  1449. }
  1450. return tok;
  1451. })
  1452. .join('');
  1453. return this._longDateFormat[key];
  1454. }
  1455. var defaultInvalidDate = 'Invalid date';
  1456. function invalidDate() {
  1457. return this._invalidDate;
  1458. }
  1459. var defaultOrdinal = '%d',
  1460. defaultDayOfMonthOrdinalParse = /\d{1,2}/;
  1461. function ordinal(number) {
  1462. return this._ordinal.replace('%d', number);
  1463. }
  1464. var defaultRelativeTime = {
  1465. future: 'in %s',
  1466. past: '%s ago',
  1467. s: 'a few seconds',
  1468. ss: '%d seconds',
  1469. m: 'a minute',
  1470. mm: '%d minutes',
  1471. h: 'an hour',
  1472. hh: '%d hours',
  1473. d: 'a day',
  1474. dd: '%d days',
  1475. w: 'a week',
  1476. ww: '%d weeks',
  1477. M: 'a month',
  1478. MM: '%d months',
  1479. y: 'a year',
  1480. yy: '%d years',
  1481. };
  1482. function relativeTime(number, withoutSuffix, string, isFuture) {
  1483. var output = this._relativeTime[string];
  1484. return isFunction(output)
  1485. ? output(number, withoutSuffix, string, isFuture)
  1486. : output.replace(/%d/i, number);
  1487. }
  1488. function pastFuture(diff, output) {
  1489. var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  1490. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  1491. }
  1492. var aliases = {};
  1493. function addUnitAlias(unit, shorthand) {
  1494. var lowerCase = unit.toLowerCase();
  1495. aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
  1496. }
  1497. function normalizeUnits(units) {
  1498. return typeof units === 'string'
  1499. ? aliases[units] || aliases[units.toLowerCase()]
  1500. : undefined;
  1501. }
  1502. function normalizeObjectUnits(inputObject) {
  1503. var normalizedInput = {},
  1504. normalizedProp,
  1505. prop;
  1506. for (prop in inputObject) {
  1507. if (hasOwnProp(inputObject, prop)) {
  1508. normalizedProp = normalizeUnits(prop);
  1509. if (normalizedProp) {
  1510. normalizedInput[normalizedProp] = inputObject[prop];
  1511. }
  1512. }
  1513. }
  1514. return normalizedInput;
  1515. }
  1516. var priorities = {};
  1517. function addUnitPriority(unit, priority) {
  1518. priorities[unit] = priority;
  1519. }
  1520. function getPrioritizedUnits(unitsObj) {
  1521. var units = [],
  1522. u;
  1523. for (u in unitsObj) {
  1524. if (hasOwnProp(unitsObj, u)) {
  1525. units.push({ unit: u, priority: priorities[u] });
  1526. }
  1527. }
  1528. units.sort(function (a, b) {
  1529. return a.priority - b.priority;
  1530. });
  1531. return units;
  1532. }
  1533. function isLeapYear(year) {
  1534. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  1535. }
  1536. function absFloor(number) {
  1537. if (number < 0) {
  1538. // -0 -> 0
  1539. return Math.ceil(number) || 0;
  1540. } else {
  1541. return Math.floor(number);
  1542. }
  1543. }
  1544. function toInt(argumentForCoercion) {
  1545. var coercedNumber = +argumentForCoercion,
  1546. value = 0;
  1547. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  1548. value = absFloor(coercedNumber);
  1549. }
  1550. return value;
  1551. }
  1552. function makeGetSet(unit, keepTime) {
  1553. return function (value) {
  1554. if (value != null) {
  1555. set$1(this, unit, value);
  1556. hooks.updateOffset(this, keepTime);
  1557. return this;
  1558. } else {
  1559. return get(this, unit);
  1560. }
  1561. };
  1562. }
  1563. function get(mom, unit) {
  1564. return mom.isValid()
  1565. ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()
  1566. : NaN;
  1567. }
  1568. function set$1(mom, unit, value) {
  1569. if (mom.isValid() && !isNaN(value)) {
  1570. if (
  1571. unit === 'FullYear' &&
  1572. isLeapYear(mom.year()) &&
  1573. mom.month() === 1 &&
  1574. mom.date() === 29
  1575. ) {
  1576. value = toInt(value);
  1577. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](
  1578. value,
  1579. mom.month(),
  1580. daysInMonth(value, mom.month())
  1581. );
  1582. } else {
  1583. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
  1584. }
  1585. }
  1586. }
  1587. // MOMENTS
  1588. function stringGet(units) {
  1589. units = normalizeUnits(units);
  1590. if (isFunction(this[units])) {
  1591. return this[units]();
  1592. }
  1593. return this;
  1594. }
  1595. function stringSet(units, value) {
  1596. if (typeof units === 'object') {
  1597. units = normalizeObjectUnits(units);
  1598. var prioritized = getPrioritizedUnits(units),
  1599. i;
  1600. for (i = 0; i < prioritized.length; i++) {
  1601. this[prioritized[i].unit](units[prioritized[i].unit]);
  1602. }
  1603. } else {
  1604. units = normalizeUnits(units);
  1605. if (isFunction(this[units])) {
  1606. return this[units](value);
  1607. }
  1608. }
  1609. return this;
  1610. }
  1611. var match1 = /\d/, // 0 - 9
  1612. match2 = /\d\d/, // 00 - 99
  1613. match3 = /\d{3}/, // 000 - 999
  1614. match4 = /\d{4}/, // 0000 - 9999
  1615. match6 = /[+-]?\d{6}/, // -999999 - 999999
  1616. match1to2 = /\d\d?/, // 0 - 99
  1617. match3to4 = /\d\d\d\d?/, // 999 - 9999
  1618. match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999
  1619. match1to3 = /\d{1,3}/, // 0 - 999
  1620. match1to4 = /\d{1,4}/, // 0 - 9999
  1621. match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999
  1622. matchUnsigned = /\d+/, // 0 - inf
  1623. matchSigned = /[+-]?\d+/, // -inf - inf
  1624. matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
  1625. matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  1626. matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
  1627. // any word (or two) characters or numbers including two/three word month in arabic.
  1628. // includes scottish gaelic two word and hyphenated months
  1629. matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
  1630. regexes;
  1631. regexes = {};
  1632. function addRegexToken(token, regex, strictRegex) {
  1633. regexes[token] = isFunction(regex)
  1634. ? regex
  1635. : function (isStrict, localeData) {
  1636. return isStrict && strictRegex ? strictRegex : regex;
  1637. };
  1638. }
  1639. function getParseRegexForToken(token, config) {
  1640. if (!hasOwnProp(regexes, token)) {
  1641. return new RegExp(unescapeFormat(token));
  1642. }
  1643. return regexes[token](config._strict, config._locale);
  1644. }
  1645. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  1646. function unescapeFormat(s) {
  1647. return regexEscape(
  1648. s
  1649. .replace('\\', '')
  1650. .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (
  1651. matched,
  1652. p1,
  1653. p2,
  1654. p3,
  1655. p4
  1656. ) {
  1657. return p1 || p2 || p3 || p4;
  1658. })
  1659. );
  1660. }
  1661. function regexEscape(s) {
  1662. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  1663. }
  1664. var tokens = {};
  1665. function addParseToken(token, callback) {
  1666. var i,
  1667. func = callback;
  1668. if (typeof token === 'string') {
  1669. token = [token];
  1670. }
  1671. if (isNumber(callback)) {
  1672. func = function (input, array) {
  1673. array[callback] = toInt(input);
  1674. };
  1675. }
  1676. for (i = 0; i < token.length; i++) {
  1677. tokens[token[i]] = func;
  1678. }
  1679. }
  1680. function addWeekParseToken(token, callback) {
  1681. addParseToken(token, function (input, array, config, token) {
  1682. config._w = config._w || {};
  1683. callback(input, config._w, config, token);
  1684. });
  1685. }
  1686. function addTimeToArrayFromToken(token, input, config) {
  1687. if (input != null && hasOwnProp(tokens, token)) {
  1688. tokens[token](input, config._a, config, token);
  1689. }
  1690. }
  1691. var YEAR = 0,
  1692. MONTH = 1,
  1693. DATE = 2,
  1694. HOUR = 3,
  1695. MINUTE = 4,
  1696. SECOND = 5,
  1697. MILLISECOND = 6,
  1698. WEEK = 7,
  1699. WEEKDAY = 8;
  1700. function mod(n, x) {
  1701. return ((n % x) + x) % x;
  1702. }
  1703. var indexOf;
  1704. if (Array.prototype.indexOf) {
  1705. indexOf = Array.prototype.indexOf;
  1706. } else {
  1707. indexOf = function (o) {
  1708. // I know
  1709. var i;
  1710. for (i = 0; i < this.length; ++i) {
  1711. if (this[i] === o) {
  1712. return i;
  1713. }
  1714. }
  1715. return -1;
  1716. };
  1717. }
  1718. function daysInMonth(year, month) {
  1719. if (isNaN(year) || isNaN(month)) {
  1720. return NaN;
  1721. }
  1722. var modMonth = mod(month, 12);
  1723. year += (month - modMonth) / 12;
  1724. return modMonth === 1
  1725. ? isLeapYear(year)
  1726. ? 29
  1727. : 28
  1728. : 31 - ((modMonth % 7) % 2);
  1729. }
  1730. // FORMATTING
  1731. addFormatToken('M', ['MM', 2], 'Mo', function () {
  1732. return this.month() + 1;
  1733. });
  1734. addFormatToken('MMM', 0, 0, function (format) {
  1735. return this.localeData().monthsShort(this, format);
  1736. });
  1737. addFormatToken('MMMM', 0, 0, function (format) {
  1738. return this.localeData().months(this, format);
  1739. });
  1740. // ALIASES
  1741. addUnitAlias('month', 'M');
  1742. // PRIORITY
  1743. addUnitPriority('month', 8);
  1744. // PARSING
  1745. addRegexToken('M', match1to2);
  1746. addRegexToken('MM', match1to2, match2);
  1747. addRegexToken('MMM', function (isStrict, locale) {
  1748. return locale.monthsShortRegex(isStrict);
  1749. });
  1750. addRegexToken('MMMM', function (isStrict, locale) {
  1751. return locale.monthsRegex(isStrict);
  1752. });
  1753. addParseToken(['M', 'MM'], function (input, array) {
  1754. array[MONTH] = toInt(input) - 1;
  1755. });
  1756. addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
  1757. var month = config._locale.monthsParse(input, token, config._strict);
  1758. // if we didn't find a month name, mark the date as invalid.
  1759. if (month != null) {
  1760. array[MONTH] = month;
  1761. } else {
  1762. getParsingFlags(config).invalidMonth = input;
  1763. }
  1764. });
  1765. // LOCALES
  1766. var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  1767. '_'
  1768. ),
  1769. defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(
  1770. '_'
  1771. ),
  1772. MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
  1773. defaultMonthsShortRegex = matchWord,
  1774. defaultMonthsRegex = matchWord;
  1775. function localeMonths(m, format) {
  1776. if (!m) {
  1777. return isArray(this._months)
  1778. ? this._months
  1779. : this._months['standalone'];
  1780. }
  1781. return isArray(this._months)
  1782. ? this._months[m.month()]
  1783. : this._months[
  1784. (this._months.isFormat || MONTHS_IN_FORMAT).test(format)
  1785. ? 'format'
  1786. : 'standalone'
  1787. ][m.month()];
  1788. }
  1789. function localeMonthsShort(m, format) {
  1790. if (!m) {
  1791. return isArray(this._monthsShort)
  1792. ? this._monthsShort
  1793. : this._monthsShort['standalone'];
  1794. }
  1795. return isArray(this._monthsShort)
  1796. ? this._monthsShort[m.month()]
  1797. : this._monthsShort[
  1798. MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'
  1799. ][m.month()];
  1800. }
  1801. function handleStrictParse(monthName, format, strict) {
  1802. var i,
  1803. ii,
  1804. mom,
  1805. llc = monthName.toLocaleLowerCase();
  1806. if (!this._monthsParse) {
  1807. // this is not used
  1808. this._monthsParse = [];
  1809. this._longMonthsParse = [];
  1810. this._shortMonthsParse = [];
  1811. for (i = 0; i < 12; ++i) {
  1812. mom = createUTC([2000, i]);
  1813. this._shortMonthsParse[i] = this.monthsShort(
  1814. mom,
  1815. ''
  1816. ).toLocaleLowerCase();
  1817. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  1818. }
  1819. }
  1820. if (strict) {
  1821. if (format === 'MMM') {
  1822. ii = indexOf.call(this._shortMonthsParse, llc);
  1823. return ii !== -1 ? ii : null;
  1824. } else {
  1825. ii = indexOf.call(this._longMonthsParse, llc);
  1826. return ii !== -1 ? ii : null;
  1827. }
  1828. } else {
  1829. if (format === 'MMM') {
  1830. ii = indexOf.call(this._shortMonthsParse, llc);
  1831. if (ii !== -1) {
  1832. return ii;
  1833. }
  1834. ii = indexOf.call(this._longMonthsParse, llc);
  1835. return ii !== -1 ? ii : null;
  1836. } else {
  1837. ii = indexOf.call(this._longMonthsParse, llc);
  1838. if (ii !== -1) {
  1839. return ii;
  1840. }
  1841. ii = indexOf.call(this._shortMonthsParse, llc);
  1842. return ii !== -1 ? ii : null;
  1843. }
  1844. }
  1845. }
  1846. function localeMonthsParse(monthName, format, strict) {
  1847. var i, mom, regex;
  1848. if (this._monthsParseExact) {
  1849. return handleStrictParse.call(this, monthName, format, strict);
  1850. }
  1851. if (!this._monthsParse) {
  1852. this._monthsParse = [];
  1853. this._longMonthsParse = [];
  1854. this._shortMonthsParse = [];
  1855. }
  1856. // TODO: add sorting
  1857. // Sorting makes sure if one month (or abbr) is a prefix of another
  1858. // see sorting in computeMonthsParse
  1859. for (i = 0; i < 12; i++) {
  1860. // make the regex if we don't have it already
  1861. mom = createUTC([2000, i]);
  1862. if (strict && !this._longMonthsParse[i]) {
  1863. this._longMonthsParse[i] = new RegExp(
  1864. '^' + this.months(mom, '').replace('.', '') + '$',
  1865. 'i'
  1866. );
  1867. this._shortMonthsParse[i] = new RegExp(
  1868. '^' + this.monthsShort(mom, '').replace('.', '') + '$',
  1869. 'i'
  1870. );
  1871. }
  1872. if (!strict && !this._monthsParse[i]) {
  1873. regex =
  1874. '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
  1875. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  1876. }
  1877. // test the regex
  1878. if (
  1879. strict &&
  1880. format === 'MMMM' &&
  1881. this._longMonthsParse[i].test(monthName)
  1882. ) {
  1883. return i;
  1884. } else if (
  1885. strict &&
  1886. format === 'MMM' &&
  1887. this._shortMonthsParse[i].test(monthName)
  1888. ) {
  1889. return i;
  1890. } else if (!strict && this._monthsParse[i].test(monthName)) {
  1891. return i;
  1892. }
  1893. }
  1894. }
  1895. // MOMENTS
  1896. function setMonth(mom, value) {
  1897. var dayOfMonth;
  1898. if (!mom.isValid()) {
  1899. // No op
  1900. return mom;
  1901. }
  1902. if (typeof value === 'string') {
  1903. if (/^\d+$/.test(value)) {
  1904. value = toInt(value);
  1905. } else {
  1906. value = mom.localeData().monthsParse(value);
  1907. // TODO: Another silent failure?
  1908. if (!isNumber(value)) {
  1909. return mom;
  1910. }
  1911. }
  1912. }
  1913. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  1914. mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  1915. return mom;
  1916. }
  1917. function getSetMonth(value) {
  1918. if (value != null) {
  1919. setMonth(this, value);
  1920. hooks.updateOffset(this, true);
  1921. return this;
  1922. } else {
  1923. return get(this, 'Month');
  1924. }
  1925. }
  1926. function getDaysInMonth() {
  1927. return daysInMonth(this.year(), this.month());
  1928. }
  1929. function monthsShortRegex(isStrict) {
  1930. if (this._monthsParseExact) {
  1931. if (!hasOwnProp(this, '_monthsRegex')) {
  1932. computeMonthsParse.call(this);
  1933. }
  1934. if (isStrict) {
  1935. return this._monthsShortStrictRegex;
  1936. } else {
  1937. return this._monthsShortRegex;
  1938. }
  1939. } else {
  1940. if (!hasOwnProp(this, '_monthsShortRegex')) {
  1941. this._monthsShortRegex = defaultMonthsShortRegex;
  1942. }
  1943. return this._monthsShortStrictRegex && isStrict
  1944. ? this._monthsShortStrictRegex
  1945. : this._monthsShortRegex;
  1946. }
  1947. }
  1948. function monthsRegex(isStrict) {
  1949. if (this._monthsParseExact) {
  1950. if (!hasOwnProp(this, '_monthsRegex')) {
  1951. computeMonthsParse.call(this);
  1952. }
  1953. if (isStrict) {
  1954. return this._monthsStrictRegex;
  1955. } else {
  1956. return this._monthsRegex;
  1957. }
  1958. } else {
  1959. if (!hasOwnProp(this, '_monthsRegex')) {
  1960. this._monthsRegex = defaultMonthsRegex;
  1961. }
  1962. return this._monthsStrictRegex && isStrict
  1963. ? this._monthsStrictRegex
  1964. : this._monthsRegex;
  1965. }
  1966. }
  1967. function computeMonthsParse() {
  1968. function cmpLenRev(a, b) {
  1969. return b.length - a.length;
  1970. }
  1971. var shortPieces = [],
  1972. longPieces = [],
  1973. mixedPieces = [],
  1974. i,
  1975. mom;
  1976. for (i = 0; i < 12; i++) {
  1977. // make the regex if we don't have it already
  1978. mom = createUTC([2000, i]);
  1979. shortPieces.push(this.monthsShort(mom, ''));
  1980. longPieces.push(this.months(mom, ''));
  1981. mixedPieces.push(this.months(mom, ''));
  1982. mixedPieces.push(this.monthsShort(mom, ''));
  1983. }
  1984. // Sorting makes sure if one month (or abbr) is a prefix of another it
  1985. // will match the longer piece.
  1986. shortPieces.sort(cmpLenRev);
  1987. longPieces.sort(cmpLenRev);
  1988. mixedPieces.sort(cmpLenRev);
  1989. for (i = 0; i < 12; i++) {
  1990. shortPieces[i] = regexEscape(shortPieces[i]);
  1991. longPieces[i] = regexEscape(longPieces[i]);
  1992. }
  1993. for (i = 0; i < 24; i++) {
  1994. mixedPieces[i] = regexEscape(mixedPieces[i]);
  1995. }
  1996. this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  1997. this._monthsShortRegex = this._monthsRegex;
  1998. this._monthsStrictRegex = new RegExp(
  1999. '^(' + longPieces.join('|') + ')',
  2000. 'i'
  2001. );
  2002. this._monthsShortStrictRegex = new RegExp(
  2003. '^(' + shortPieces.join('|') + ')',
  2004. 'i'
  2005. );
  2006. }
  2007. // FORMATTING
  2008. addFormatToken('Y', 0, 0, function () {
  2009. var y = this.year();
  2010. return y <= 9999 ? zeroFill(y, 4) : '+' + y;
  2011. });
  2012. addFormatToken(0, ['YY', 2], 0, function () {
  2013. return this.year() % 100;
  2014. });
  2015. addFormatToken(0, ['YYYY', 4], 0, 'year');
  2016. addFormatToken(0, ['YYYYY', 5], 0, 'year');
  2017. addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  2018. // ALIASES
  2019. addUnitAlias('year', 'y');
  2020. // PRIORITIES
  2021. addUnitPriority('year', 1);
  2022. // PARSING
  2023. addRegexToken('Y', matchSigned);
  2024. addRegexToken('YY', match1to2, match2);
  2025. addRegexToken('YYYY', match1to4, match4);
  2026. addRegexToken('YYYYY', match1to6, match6);
  2027. addRegexToken('YYYYYY', match1to6, match6);
  2028. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  2029. addParseToken('YYYY', function (input, array) {
  2030. array[YEAR] =
  2031. input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
  2032. });
  2033. addParseToken('YY', function (input, array) {
  2034. array[YEAR] = hooks.parseTwoDigitYear(input);
  2035. });
  2036. addParseToken('Y', function (input, array) {
  2037. array[YEAR] = parseInt(input, 10);
  2038. });
  2039. // HELPERS
  2040. function daysInYear(year) {
  2041. return isLeapYear(year) ? 366 : 365;
  2042. }
  2043. // HOOKS
  2044. hooks.parseTwoDigitYear = function (input) {
  2045. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  2046. };
  2047. // MOMENTS
  2048. var getSetYear = makeGetSet('FullYear', true);
  2049. function getIsLeapYear() {
  2050. return isLeapYear(this.year());
  2051. }
  2052. function createDate(y, m, d, h, M, s, ms) {
  2053. // can't just apply() to create a date:
  2054. // https://stackoverflow.com/q/181348
  2055. var date;
  2056. // the date constructor remaps years 0-99 to 1900-1999
  2057. if (y < 100 && y >= 0) {
  2058. // preserve leap years using a full 400 year cycle, then reset
  2059. date = new Date(y + 400, m, d, h, M, s, ms);
  2060. if (isFinite(date.getFullYear())) {
  2061. date.setFullYear(y);
  2062. }
  2063. } else {
  2064. date = new Date(y, m, d, h, M, s, ms);
  2065. }
  2066. return date;
  2067. }
  2068. function createUTCDate(y) {
  2069. var date, args;
  2070. // the Date.UTC function remaps years 0-99 to 1900-1999
  2071. if (y < 100 && y >= 0) {
  2072. args = Array.prototype.slice.call(arguments);
  2073. // preserve leap years using a full 400 year cycle, then reset
  2074. args[0] = y + 400;
  2075. date = new Date(Date.UTC.apply(null, args));
  2076. if (isFinite(date.getUTCFullYear())) {
  2077. date.setUTCFullYear(y);
  2078. }
  2079. } else {
  2080. date = new Date(Date.UTC.apply(null, arguments));
  2081. }
  2082. return date;
  2083. }
  2084. // start-of-first-week - start-of-year
  2085. function firstWeekOffset(year, dow, doy) {
  2086. var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  2087. fwd = 7 + dow - doy,
  2088. // first-week day local weekday -- which local weekday is fwd
  2089. fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  2090. return -fwdlw + fwd - 1;
  2091. }
  2092. // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  2093. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  2094. var localWeekday = (7 + weekday - dow) % 7,
  2095. weekOffset = firstWeekOffset(year, dow, doy),
  2096. dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
  2097. resYear,
  2098. resDayOfYear;
  2099. if (dayOfYear <= 0) {
  2100. resYear = year - 1;
  2101. resDayOfYear = daysInYear(resYear) + dayOfYear;
  2102. } else if (dayOfYear > daysInYear(year)) {
  2103. resYear = year + 1;
  2104. resDayOfYear = dayOfYear - daysInYear(year);
  2105. } else {
  2106. resYear = year;
  2107. resDayOfYear = dayOfYear;
  2108. }
  2109. return {
  2110. year: resYear,
  2111. dayOfYear: resDayOfYear,
  2112. };
  2113. }
  2114. function weekOfYear(mom, dow, doy) {
  2115. var weekOffset = firstWeekOffset(mom.year(), dow, doy),
  2116. week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
  2117. resWeek,
  2118. resYear;
  2119. if (week < 1) {
  2120. resYear = mom.year() - 1;
  2121. resWeek = week + weeksInYear(resYear, dow, doy);
  2122. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  2123. resWeek = week - weeksInYear(mom.year(), dow, doy);
  2124. resYear = mom.year() + 1;
  2125. } else {
  2126. resYear = mom.year();
  2127. resWeek = week;
  2128. }
  2129. return {
  2130. week: resWeek,
  2131. year: resYear,
  2132. };
  2133. }
  2134. function weeksInYear(year, dow, doy) {
  2135. var weekOffset = firstWeekOffset(year, dow, doy),
  2136. weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  2137. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  2138. }
  2139. // FORMATTING
  2140. addFormatToken('w', ['ww', 2], 'wo', 'week');
  2141. addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  2142. // ALIASES
  2143. addUnitAlias('week', 'w');
  2144. addUnitAlias('isoWeek', 'W');
  2145. // PRIORITIES
  2146. addUnitPriority('week', 5);
  2147. addUnitPriority('isoWeek', 5);
  2148. // PARSING
  2149. addRegexToken('w', match1to2);
  2150. addRegexToken('ww', match1to2, match2);
  2151. addRegexToken('W', match1to2);
  2152. addRegexToken('WW', match1to2, match2);
  2153. addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
  2154. input,
  2155. week,
  2156. config,
  2157. token
  2158. ) {
  2159. week[token.substr(0, 1)] = toInt(input);
  2160. });
  2161. // HELPERS
  2162. // LOCALES
  2163. function localeWeek(mom) {
  2164. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  2165. }
  2166. var defaultLocaleWeek = {
  2167. dow: 0, // Sunday is the first day of the week.
  2168. doy: 6, // The week that contains Jan 6th is the first week of the year.
  2169. };
  2170. function localeFirstDayOfWeek() {
  2171. return this._week.dow;
  2172. }
  2173. function localeFirstDayOfYear() {
  2174. return this._week.doy;
  2175. }
  2176. // MOMENTS
  2177. function getSetWeek(input) {
  2178. var week = this.localeData().week(this);
  2179. return input == null ? week : this.add((input - week) * 7, 'd');
  2180. }
  2181. function getSetISOWeek(input) {
  2182. var week = weekOfYear(this, 1, 4).week;
  2183. return input == null ? week : this.add((input - week) * 7, 'd');
  2184. }
  2185. // FORMATTING
  2186. addFormatToken('d', 0, 'do', 'day');
  2187. addFormatToken('dd', 0, 0, function (format) {
  2188. return this.localeData().weekdaysMin(this, format);
  2189. });
  2190. addFormatToken('ddd', 0, 0, function (format) {
  2191. return this.localeData().weekdaysShort(this, format);
  2192. });
  2193. addFormatToken('dddd', 0, 0, function (format) {
  2194. return this.localeData().weekdays(this, format);
  2195. });
  2196. addFormatToken('e', 0, 0, 'weekday');
  2197. addFormatToken('E', 0, 0, 'isoWeekday');
  2198. // ALIASES
  2199. addUnitAlias('day', 'd');
  2200. addUnitAlias('weekday', 'e');
  2201. addUnitAlias('isoWeekday', 'E');
  2202. // PRIORITY
  2203. addUnitPriority('day', 11);
  2204. addUnitPriority('weekday', 11);
  2205. addUnitPriority('isoWeekday', 11);
  2206. // PARSING
  2207. addRegexToken('d', match1to2);
  2208. addRegexToken('e', match1to2);
  2209. addRegexToken('E', match1to2);
  2210. addRegexToken('dd', function (isStrict, locale) {
  2211. return locale.weekdaysMinRegex(isStrict);
  2212. });
  2213. addRegexToken('ddd', function (isStrict, locale) {
  2214. return locale.weekdaysShortRegex(isStrict);
  2215. });
  2216. addRegexToken('dddd', function (isStrict, locale) {
  2217. return locale.weekdaysRegex(isStrict);
  2218. });
  2219. addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
  2220. var weekday = config._locale.weekdaysParse(input, token, config._strict);
  2221. // if we didn't get a weekday name, mark the date as invalid
  2222. if (weekday != null) {
  2223. week.d = weekday;
  2224. } else {
  2225. getParsingFlags(config).invalidWeekday = input;
  2226. }
  2227. });
  2228. addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
  2229. week[token] = toInt(input);
  2230. });
  2231. // HELPERS
  2232. function parseWeekday(input, locale) {
  2233. if (typeof input !== 'string') {
  2234. return input;
  2235. }
  2236. if (!isNaN(input)) {
  2237. return parseInt(input, 10);
  2238. }
  2239. input = locale.weekdaysParse(input);
  2240. if (typeof input === 'number') {
  2241. return input;
  2242. }
  2243. return null;
  2244. }
  2245. function parseIsoWeekday(input, locale) {
  2246. if (typeof input === 'string') {
  2247. return locale.weekdaysParse(input) % 7 || 7;
  2248. }
  2249. return isNaN(input) ? null : input;
  2250. }
  2251. // LOCALES
  2252. function shiftWeekdays(ws, n) {
  2253. return ws.slice(n, 7).concat(ws.slice(0, n));
  2254. }
  2255. var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  2256. '_'
  2257. ),
  2258. defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  2259. defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  2260. defaultWeekdaysRegex = matchWord,
  2261. defaultWeekdaysShortRegex = matchWord,
  2262. defaultWeekdaysMinRegex = matchWord;
  2263. function localeWeekdays(m, format) {
  2264. var weekdays = isArray(this._weekdays)
  2265. ? this._weekdays
  2266. : this._weekdays[
  2267. m && m !== true && this._weekdays.isFormat.test(format)
  2268. ? 'format'
  2269. : 'standalone'
  2270. ];
  2271. return m === true
  2272. ? shiftWeekdays(weekdays, this._week.dow)
  2273. : m
  2274. ? weekdays[m.day()]
  2275. : weekdays;
  2276. }
  2277. function localeWeekdaysShort(m) {
  2278. return m === true
  2279. ? shiftWeekdays(this._weekdaysShort, this._week.dow)
  2280. : m
  2281. ? this._weekdaysShort[m.day()]
  2282. : this._weekdaysShort;
  2283. }
  2284. function localeWeekdaysMin(m) {
  2285. return m === true
  2286. ? shiftWeekdays(this._weekdaysMin, this._week.dow)
  2287. : m
  2288. ? this._weekdaysMin[m.day()]
  2289. : this._weekdaysMin;
  2290. }
  2291. function handleStrictParse$1(weekdayName, format, strict) {
  2292. var i,
  2293. ii,
  2294. mom,
  2295. llc = weekdayName.toLocaleLowerCase();
  2296. if (!this._weekdaysParse) {
  2297. this._weekdaysParse = [];
  2298. this._shortWeekdaysParse = [];
  2299. this._minWeekdaysParse = [];
  2300. for (i = 0; i < 7; ++i) {
  2301. mom = createUTC([2000, 1]).day(i);
  2302. this._minWeekdaysParse[i] = this.weekdaysMin(
  2303. mom,
  2304. ''
  2305. ).toLocaleLowerCase();
  2306. this._shortWeekdaysParse[i] = this.weekdaysShort(
  2307. mom,
  2308. ''
  2309. ).toLocaleLowerCase();
  2310. this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
  2311. }
  2312. }
  2313. if (strict) {
  2314. if (format === 'dddd') {
  2315. ii = indexOf.call(this._weekdaysParse, llc);
  2316. return ii !== -1 ? ii : null;
  2317. } else if (format === 'ddd') {
  2318. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2319. return ii !== -1 ? ii : null;
  2320. } else {
  2321. ii = indexOf.call(this._minWeekdaysParse, llc);
  2322. return ii !== -1 ? ii : null;
  2323. }
  2324. } else {
  2325. if (format === 'dddd') {
  2326. ii = indexOf.call(this._weekdaysParse, llc);
  2327. if (ii !== -1) {
  2328. return ii;
  2329. }
  2330. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2331. if (ii !== -1) {
  2332. return ii;
  2333. }
  2334. ii = indexOf.call(this._minWeekdaysParse, llc);
  2335. return ii !== -1 ? ii : null;
  2336. } else if (format === 'ddd') {
  2337. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2338. if (ii !== -1) {
  2339. return ii;
  2340. }
  2341. ii = indexOf.call(this._weekdaysParse, llc);
  2342. if (ii !== -1) {
  2343. return ii;
  2344. }
  2345. ii = indexOf.call(this._minWeekdaysParse, llc);
  2346. return ii !== -1 ? ii : null;
  2347. } else {
  2348. ii = indexOf.call(this._minWeekdaysParse, llc);
  2349. if (ii !== -1) {
  2350. return ii;
  2351. }
  2352. ii = indexOf.call(this._weekdaysParse, llc);
  2353. if (ii !== -1) {
  2354. return ii;
  2355. }
  2356. ii = indexOf.call(this._shortWeekdaysParse, llc);
  2357. return ii !== -1 ? ii : null;
  2358. }
  2359. }
  2360. }
  2361. function localeWeekdaysParse(weekdayName, format, strict) {
  2362. var i, mom, regex;
  2363. if (this._weekdaysParseExact) {
  2364. return handleStrictParse$1.call(this, weekdayName, format, strict);
  2365. }
  2366. if (!this._weekdaysParse) {
  2367. this._weekdaysParse = [];
  2368. this._minWeekdaysParse = [];
  2369. this._shortWeekdaysParse = [];
  2370. this._fullWeekdaysParse = [];
  2371. }
  2372. for (i = 0; i < 7; i++) {
  2373. // make the regex if we don't have it already
  2374. mom = createUTC([2000, 1]).day(i);
  2375. if (strict && !this._fullWeekdaysParse[i]) {
  2376. this._fullWeekdaysParse[i] = new RegExp(
  2377. '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$',
  2378. 'i'
  2379. );
  2380. this._shortWeekdaysParse[i] = new RegExp(
  2381. '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$',
  2382. 'i'
  2383. );
  2384. this._minWeekdaysParse[i] = new RegExp(
  2385. '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$',
  2386. 'i'
  2387. );
  2388. }
  2389. if (!this._weekdaysParse[i]) {
  2390. regex =
  2391. '^' +
  2392. this.weekdays(mom, '') +
  2393. '|^' +
  2394. this.weekdaysShort(mom, '') +
  2395. '|^' +
  2396. this.weekdaysMin(mom, '');
  2397. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  2398. }
  2399. // test the regex
  2400. if (
  2401. strict &&
  2402. format === 'dddd' &&
  2403. this._fullWeekdaysParse[i].test(weekdayName)
  2404. ) {
  2405. return i;
  2406. } else if (
  2407. strict &&
  2408. format === 'ddd' &&
  2409. this._shortWeekdaysParse[i].test(weekdayName)
  2410. ) {
  2411. return i;
  2412. } else if (
  2413. strict &&
  2414. format === 'dd' &&
  2415. this._minWeekdaysParse[i].test(weekdayName)
  2416. ) {
  2417. return i;
  2418. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  2419. return i;
  2420. }
  2421. }
  2422. }
  2423. // MOMENTS
  2424. function getSetDayOfWeek(input) {
  2425. if (!this.isValid()) {
  2426. return input != null ? this : NaN;
  2427. }
  2428. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  2429. if (input != null) {
  2430. input = parseWeekday(input, this.localeData());
  2431. return this.add(input - day, 'd');
  2432. } else {
  2433. return day;
  2434. }
  2435. }
  2436. function getSetLocaleDayOfWeek(input) {
  2437. if (!this.isValid()) {
  2438. return input != null ? this : NaN;
  2439. }
  2440. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  2441. return input == null ? weekday : this.add(input - weekday, 'd');
  2442. }
  2443. function getSetISODayOfWeek(input) {
  2444. if (!this.isValid()) {
  2445. return input != null ? this : NaN;
  2446. }
  2447. // behaves the same as moment#day except
  2448. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  2449. // as a setter, sunday should belong to the previous week.
  2450. if (input != null) {
  2451. var weekday = parseIsoWeekday(input, this.localeData());
  2452. return this.day(this.day() % 7 ? weekday : weekday - 7);
  2453. } else {
  2454. return this.day() || 7;
  2455. }
  2456. }
  2457. function weekdaysRegex(isStrict) {
  2458. if (this._weekdaysParseExact) {
  2459. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2460. computeWeekdaysParse.call(this);
  2461. }
  2462. if (isStrict) {
  2463. return this._weekdaysStrictRegex;
  2464. } else {
  2465. return this._weekdaysRegex;
  2466. }
  2467. } else {
  2468. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2469. this._weekdaysRegex = defaultWeekdaysRegex;
  2470. }
  2471. return this._weekdaysStrictRegex && isStrict
  2472. ? this._weekdaysStrictRegex
  2473. : this._weekdaysRegex;
  2474. }
  2475. }
  2476. function weekdaysShortRegex(isStrict) {
  2477. if (this._weekdaysParseExact) {
  2478. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2479. computeWeekdaysParse.call(this);
  2480. }
  2481. if (isStrict) {
  2482. return this._weekdaysShortStrictRegex;
  2483. } else {
  2484. return this._weekdaysShortRegex;
  2485. }
  2486. } else {
  2487. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  2488. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  2489. }
  2490. return this._weekdaysShortStrictRegex && isStrict
  2491. ? this._weekdaysShortStrictRegex
  2492. : this._weekdaysShortRegex;
  2493. }
  2494. }
  2495. function weekdaysMinRegex(isStrict) {
  2496. if (this._weekdaysParseExact) {
  2497. if (!hasOwnProp(this, '_weekdaysRegex')) {
  2498. computeWeekdaysParse.call(this);
  2499. }
  2500. if (isStrict) {
  2501. return this._weekdaysMinStrictRegex;
  2502. } else {
  2503. return this._weekdaysMinRegex;
  2504. }
  2505. } else {
  2506. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  2507. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  2508. }
  2509. return this._weekdaysMinStrictRegex && isStrict
  2510. ? this._weekdaysMinStrictRegex
  2511. : this._weekdaysMinRegex;
  2512. }
  2513. }
  2514. function computeWeekdaysParse() {
  2515. function cmpLenRev(a, b) {
  2516. return b.length - a.length;
  2517. }
  2518. var minPieces = [],
  2519. shortPieces = [],
  2520. longPieces = [],
  2521. mixedPieces = [],
  2522. i,
  2523. mom,
  2524. minp,
  2525. shortp,
  2526. longp;
  2527. for (i = 0; i < 7; i++) {
  2528. // make the regex if we don't have it already
  2529. mom = createUTC([2000, 1]).day(i);
  2530. minp = regexEscape(this.weekdaysMin(mom, ''));
  2531. shortp = regexEscape(this.weekdaysShort(mom, ''));
  2532. longp = regexEscape(this.weekdays(mom, ''));
  2533. minPieces.push(minp);
  2534. shortPieces.push(shortp);
  2535. longPieces.push(longp);
  2536. mixedPieces.push(minp);
  2537. mixedPieces.push(shortp);
  2538. mixedPieces.push(longp);
  2539. }
  2540. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  2541. // will match the longer piece.
  2542. minPieces.sort(cmpLenRev);
  2543. shortPieces.sort(cmpLenRev);
  2544. longPieces.sort(cmpLenRev);
  2545. mixedPieces.sort(cmpLenRev);
  2546. this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  2547. this._weekdaysShortRegex = this._weekdaysRegex;
  2548. this._weekdaysMinRegex = this._weekdaysRegex;
  2549. this._weekdaysStrictRegex = new RegExp(
  2550. '^(' + longPieces.join('|') + ')',
  2551. 'i'
  2552. );
  2553. this._weekdaysShortStrictRegex = new RegExp(
  2554. '^(' + shortPieces.join('|') + ')',
  2555. 'i'
  2556. );
  2557. this._weekdaysMinStrictRegex = new RegExp(
  2558. '^(' + minPieces.join('|') + ')',
  2559. 'i'
  2560. );
  2561. }
  2562. // FORMATTING
  2563. function hFormat() {
  2564. return this.hours() % 12 || 12;
  2565. }
  2566. function kFormat() {
  2567. return this.hours() || 24;
  2568. }
  2569. addFormatToken('H', ['HH', 2], 0, 'hour');
  2570. addFormatToken('h', ['hh', 2], 0, hFormat);
  2571. addFormatToken('k', ['kk', 2], 0, kFormat);
  2572. addFormatToken('hmm', 0, 0, function () {
  2573. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  2574. });
  2575. addFormatToken('hmmss', 0, 0, function () {
  2576. return (
  2577. '' +
  2578. hFormat.apply(this) +
  2579. zeroFill(this.minutes(), 2) +
  2580. zeroFill(this.seconds(), 2)
  2581. );
  2582. });
  2583. addFormatToken('Hmm', 0, 0, function () {
  2584. return '' + this.hours() + zeroFill(this.minutes(), 2);
  2585. });
  2586. addFormatToken('Hmmss', 0, 0, function () {
  2587. return (
  2588. '' +
  2589. this.hours() +
  2590. zeroFill(this.minutes(), 2) +
  2591. zeroFill(this.seconds(), 2)
  2592. );
  2593. });
  2594. function meridiem(token, lowercase) {
  2595. addFormatToken(token, 0, 0, function () {
  2596. return this.localeData().meridiem(
  2597. this.hours(),
  2598. this.minutes(),
  2599. lowercase
  2600. );
  2601. });
  2602. }
  2603. meridiem('a', true);
  2604. meridiem('A', false);
  2605. // ALIASES
  2606. addUnitAlias('hour', 'h');
  2607. // PRIORITY
  2608. addUnitPriority('hour', 13);
  2609. // PARSING
  2610. function matchMeridiem(isStrict, locale) {
  2611. return locale._meridiemParse;
  2612. }
  2613. addRegexToken('a', matchMeridiem);
  2614. addRegexToken('A', matchMeridiem);
  2615. addRegexToken('H', match1to2);
  2616. addRegexToken('h', match1to2);
  2617. addRegexToken('k', match1to2);
  2618. addRegexToken('HH', match1to2, match2);
  2619. addRegexToken('hh', match1to2, match2);
  2620. addRegexToken('kk', match1to2, match2);
  2621. addRegexToken('hmm', match3to4);
  2622. addRegexToken('hmmss', match5to6);
  2623. addRegexToken('Hmm', match3to4);
  2624. addRegexToken('Hmmss', match5to6);
  2625. addParseToken(['H', 'HH'], HOUR);
  2626. addParseToken(['k', 'kk'], function (input, array, config) {
  2627. var kInput = toInt(input);
  2628. array[HOUR] = kInput === 24 ? 0 : kInput;
  2629. });
  2630. addParseToken(['a', 'A'], function (input, array, config) {
  2631. config._isPm = config._locale.isPM(input);
  2632. config._meridiem = input;
  2633. });
  2634. addParseToken(['h', 'hh'], function (input, array, config) {
  2635. array[HOUR] = toInt(input);
  2636. getParsingFlags(config).bigHour = true;
  2637. });
  2638. addParseToken('hmm', function (input, array, config) {
  2639. var pos = input.length - 2;
  2640. array[HOUR] = toInt(input.substr(0, pos));
  2641. array[MINUTE] = toInt(input.substr(pos));
  2642. getParsingFlags(config).bigHour = true;
  2643. });
  2644. addParseToken('hmmss', function (input, array, config) {
  2645. var pos1 = input.length - 4,
  2646. pos2 = input.length - 2;
  2647. array[HOUR] = toInt(input.substr(0, pos1));
  2648. array[MINUTE] = toInt(input.substr(pos1, 2));
  2649. array[SECOND] = toInt(input.substr(pos2));
  2650. getParsingFlags(config).bigHour = true;
  2651. });
  2652. addParseToken('Hmm', function (input, array, config) {
  2653. var pos = input.length - 2;
  2654. array[HOUR] = toInt(input.substr(0, pos));
  2655. array[MINUTE] = toInt(input.substr(pos));
  2656. });
  2657. addParseToken('Hmmss', function (input, array, config) {
  2658. var pos1 = input.length - 4,
  2659. pos2 = input.length - 2;
  2660. array[HOUR] = toInt(input.substr(0, pos1));
  2661. array[MINUTE] = toInt(input.substr(pos1, 2));
  2662. array[SECOND] = toInt(input.substr(pos2));
  2663. });
  2664. // LOCALES
  2665. function localeIsPM(input) {
  2666. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  2667. // Using charAt should be more compatible.
  2668. return (input + '').toLowerCase().charAt(0) === 'p';
  2669. }
  2670. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i,
  2671. // Setting the hour should keep the time, because the user explicitly
  2672. // specified which hour they want. So trying to maintain the same hour (in
  2673. // a new timezone) makes sense. Adding/subtracting hours does not follow
  2674. // this rule.
  2675. getSetHour = makeGetSet('Hours', true);
  2676. function localeMeridiem(hours, minutes, isLower) {
  2677. if (hours > 11) {
  2678. return isLower ? 'pm' : 'PM';
  2679. } else {
  2680. return isLower ? 'am' : 'AM';
  2681. }
  2682. }
  2683. var baseConfig = {
  2684. calendar: defaultCalendar,
  2685. longDateFormat: defaultLongDateFormat,
  2686. invalidDate: defaultInvalidDate,
  2687. ordinal: defaultOrdinal,
  2688. dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
  2689. relativeTime: defaultRelativeTime,
  2690. months: defaultLocaleMonths,
  2691. monthsShort: defaultLocaleMonthsShort,
  2692. week: defaultLocaleWeek,
  2693. weekdays: defaultLocaleWeekdays,
  2694. weekdaysMin: defaultLocaleWeekdaysMin,
  2695. weekdaysShort: defaultLocaleWeekdaysShort,
  2696. meridiemParse: defaultLocaleMeridiemParse,
  2697. };
  2698. // internal storage for locale config files
  2699. var locales = {},
  2700. localeFamilies = {},
  2701. globalLocale;
  2702. function commonPrefix(arr1, arr2) {
  2703. var i,
  2704. minl = Math.min(arr1.length, arr2.length);
  2705. for (i = 0; i < minl; i += 1) {
  2706. if (arr1[i] !== arr2[i]) {
  2707. return i;
  2708. }
  2709. }
  2710. return minl;
  2711. }
  2712. function normalizeLocale(key) {
  2713. return key ? key.toLowerCase().replace('_', '-') : key;
  2714. }
  2715. // pick the locale from the array
  2716. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  2717. // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
  2718. function chooseLocale(names) {
  2719. var i = 0,
  2720. j,
  2721. next,
  2722. locale,
  2723. split;
  2724. while (i < names.length) {
  2725. split = normalizeLocale(names[i]).split('-');
  2726. j = split.length;
  2727. next = normalizeLocale(names[i + 1]);
  2728. next = next ? next.split('-') : null;
  2729. while (j > 0) {
  2730. locale = loadLocale(split.slice(0, j).join('-'));
  2731. if (locale) {
  2732. return locale;
  2733. }
  2734. if (
  2735. next &&
  2736. next.length >= j &&
  2737. commonPrefix(split, next) >= j - 1
  2738. ) {
  2739. //the next array item is better than a shallower substring of this one
  2740. break;
  2741. }
  2742. j--;
  2743. }
  2744. i++;
  2745. }
  2746. return globalLocale;
  2747. }
  2748. function loadLocale(name) {
  2749. var oldLocale = null,
  2750. aliasedRequire;
  2751. // TODO: Find a better way to register and load all the locales in Node
  2752. if (
  2753. locales[name] === undefined &&
  2754. typeof module !== 'undefined' &&
  2755. module &&
  2756. module.exports
  2757. ) {
  2758. try {
  2759. oldLocale = globalLocale._abbr;
  2760. aliasedRequire = require;
  2761. aliasedRequire('./locale/' + name);
  2762. getSetGlobalLocale(oldLocale);
  2763. } catch (e) {
  2764. // mark as not found to avoid repeating expensive file require call causing high CPU
  2765. // when trying to find en-US, en_US, en-us for every format call
  2766. locales[name] = null; // null means not found
  2767. }
  2768. }
  2769. return locales[name];
  2770. }
  2771. // This function will load locale and then set the global locale. If
  2772. // no arguments are passed in, it will simply return the current global
  2773. // locale key.
  2774. function getSetGlobalLocale(key, values) {
  2775. var data;
  2776. if (key) {
  2777. if (isUndefined(values)) {
  2778. data = getLocale(key);
  2779. } else {
  2780. data = defineLocale(key, values);
  2781. }
  2782. if (data) {
  2783. // moment.duration._locale = moment._locale = data;
  2784. globalLocale = data;
  2785. } else {
  2786. if (typeof console !== 'undefined' && console.warn) {
  2787. //warn user if arguments are passed but the locale could not be set
  2788. console.warn(
  2789. 'Locale ' + key + ' not found. Did you forget to load it?'
  2790. );
  2791. }
  2792. }
  2793. }
  2794. return globalLocale._abbr;
  2795. }
  2796. function defineLocale(name, config) {
  2797. if (config !== null) {
  2798. var locale,
  2799. parentConfig = baseConfig;
  2800. config.abbr = name;
  2801. if (locales[name] != null) {
  2802. deprecateSimple(
  2803. 'defineLocaleOverride',
  2804. 'use moment.updateLocale(localeName, config) to change ' +
  2805. 'an existing locale. moment.defineLocale(localeName, ' +
  2806. 'config) should only be used for creating a new locale ' +
  2807. 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'
  2808. );
  2809. parentConfig = locales[name]._config;
  2810. } else if (config.parentLocale != null) {
  2811. if (locales[config.parentLocale] != null) {
  2812. parentConfig = locales[config.parentLocale]._config;
  2813. } else {
  2814. locale = loadLocale(config.parentLocale);
  2815. if (locale != null) {
  2816. parentConfig = locale._config;
  2817. } else {
  2818. if (!localeFamilies[config.parentLocale]) {
  2819. localeFamilies[config.parentLocale] = [];
  2820. }
  2821. localeFamilies[config.parentLocale].push({
  2822. name: name,
  2823. config: config,
  2824. });
  2825. return null;
  2826. }
  2827. }
  2828. }
  2829. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  2830. if (localeFamilies[name]) {
  2831. localeFamilies[name].forEach(function (x) {
  2832. defineLocale(x.name, x.config);
  2833. });
  2834. }
  2835. // backwards compat for now: also set the locale
  2836. // make sure we set the locale AFTER all child locales have been
  2837. // created, so we won't end up with the child locale set.
  2838. getSetGlobalLocale(name);
  2839. return locales[name];
  2840. } else {
  2841. // useful for testing
  2842. delete locales[name];
  2843. return null;
  2844. }
  2845. }
  2846. function updateLocale(name, config) {
  2847. if (config != null) {
  2848. var locale,
  2849. tmpLocale,
  2850. parentConfig = baseConfig;
  2851. if (locales[name] != null && locales[name].parentLocale != null) {
  2852. // Update existing child locale in-place to avoid memory-leaks
  2853. locales[name].set(mergeConfigs(locales[name]._config, config));
  2854. } else {
  2855. // MERGE
  2856. tmpLocale = loadLocale(name);
  2857. if (tmpLocale != null) {
  2858. parentConfig = tmpLocale._config;
  2859. }
  2860. config = mergeConfigs(parentConfig, config);
  2861. if (tmpLocale == null) {
  2862. // updateLocale is called for creating a new locale
  2863. // Set abbr so it will have a name (getters return
  2864. // undefined otherwise).
  2865. config.abbr = name;
  2866. }
  2867. locale = new Locale(config);
  2868. locale.parentLocale = locales[name];
  2869. locales[name] = locale;
  2870. }
  2871. // backwards compat for now: also set the locale
  2872. getSetGlobalLocale(name);
  2873. } else {
  2874. // pass null for config to unupdate, useful for tests
  2875. if (locales[name] != null) {
  2876. if (locales[name].parentLocale != null) {
  2877. locales[name] = locales[name].parentLocale;
  2878. if (name === getSetGlobalLocale()) {
  2879. getSetGlobalLocale(name);
  2880. }
  2881. } else if (locales[name] != null) {
  2882. delete locales[name];
  2883. }
  2884. }
  2885. }
  2886. return locales[name];
  2887. }
  2888. // returns locale data
  2889. function getLocale(key) {
  2890. var locale;
  2891. if (key && key._locale && key._locale._abbr) {
  2892. key = key._locale._abbr;
  2893. }
  2894. if (!key) {
  2895. return globalLocale;
  2896. }
  2897. if (!isArray(key)) {
  2898. //short-circuit everything else
  2899. locale = loadLocale(key);
  2900. if (locale) {
  2901. return locale;
  2902. }
  2903. key = [key];
  2904. }
  2905. return chooseLocale(key);
  2906. }
  2907. function listLocales() {
  2908. return keys(locales);
  2909. }
  2910. function checkOverflow(m) {
  2911. var overflow,
  2912. a = m._a;
  2913. if (a && getParsingFlags(m).overflow === -2) {
  2914. overflow =
  2915. a[MONTH] < 0 || a[MONTH] > 11
  2916. ? MONTH
  2917. : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
  2918. ? DATE
  2919. : a[HOUR] < 0 ||
  2920. a[HOUR] > 24 ||
  2921. (a[HOUR] === 24 &&
  2922. (a[MINUTE] !== 0 ||
  2923. a[SECOND] !== 0 ||
  2924. a[MILLISECOND] !== 0))
  2925. ? HOUR
  2926. : a[MINUTE] < 0 || a[MINUTE] > 59
  2927. ? MINUTE
  2928. : a[SECOND] < 0 || a[SECOND] > 59
  2929. ? SECOND
  2930. : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
  2931. ? MILLISECOND
  2932. : -1;
  2933. if (
  2934. getParsingFlags(m)._overflowDayOfYear &&
  2935. (overflow < YEAR || overflow > DATE)
  2936. ) {
  2937. overflow = DATE;
  2938. }
  2939. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  2940. overflow = WEEK;
  2941. }
  2942. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  2943. overflow = WEEKDAY;
  2944. }
  2945. getParsingFlags(m).overflow = overflow;
  2946. }
  2947. return m;
  2948. }
  2949. // iso 8601 regex
  2950. // 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)
  2951. 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)?)?$/,
  2952. 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)?)?$/,
  2953. tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
  2954. isoDates = [
  2955. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  2956. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  2957. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  2958. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  2959. ['YYYY-DDD', /\d{4}-\d{3}/],
  2960. ['YYYY-MM', /\d{4}-\d\d/, false],
  2961. ['YYYYYYMMDD', /[+-]\d{10}/],
  2962. ['YYYYMMDD', /\d{8}/],
  2963. ['GGGG[W]WWE', /\d{4}W\d{3}/],
  2964. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  2965. ['YYYYDDD', /\d{7}/],
  2966. ['YYYYMM', /\d{6}/, false],
  2967. ['YYYY', /\d{4}/, false],
  2968. ],
  2969. // iso time formats and regexes
  2970. isoTimes = [
  2971. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  2972. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  2973. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  2974. ['HH:mm', /\d\d:\d\d/],
  2975. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  2976. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  2977. ['HHmmss', /\d\d\d\d\d\d/],
  2978. ['HHmm', /\d\d\d\d/],
  2979. ['HH', /\d\d/],
  2980. ],
  2981. aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
  2982. // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
  2983. rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
  2984. obsOffsets = {
  2985. UT: 0,
  2986. GMT: 0,
  2987. EDT: -4 * 60,
  2988. EST: -5 * 60,
  2989. CDT: -5 * 60,
  2990. CST: -6 * 60,
  2991. MDT: -6 * 60,
  2992. MST: -7 * 60,
  2993. PDT: -7 * 60,
  2994. PST: -8 * 60,
  2995. };
  2996. // date from iso format
  2997. function configFromISO(config) {
  2998. var i,
  2999. l,
  3000. string = config._i,
  3001. match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  3002. allowTime,
  3003. dateFormat,
  3004. timeFormat,
  3005. tzFormat;
  3006. if (match) {
  3007. getParsingFlags(config).iso = true;
  3008. for (i = 0, l = isoDates.length; i < l; i++) {
  3009. if (isoDates[i][1].exec(match[1])) {
  3010. dateFormat = isoDates[i][0];
  3011. allowTime = isoDates[i][2] !== false;
  3012. break;
  3013. }
  3014. }
  3015. if (dateFormat == null) {
  3016. config._isValid = false;
  3017. return;
  3018. }
  3019. if (match[3]) {
  3020. for (i = 0, l = isoTimes.length; i < l; i++) {
  3021. if (isoTimes[i][1].exec(match[3])) {
  3022. // match[2] should be 'T' or space
  3023. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  3024. break;
  3025. }
  3026. }
  3027. if (timeFormat == null) {
  3028. config._isValid = false;
  3029. return;
  3030. }
  3031. }
  3032. if (!allowTime && timeFormat != null) {
  3033. config._isValid = false;
  3034. return;
  3035. }
  3036. if (match[4]) {
  3037. if (tzRegex.exec(match[4])) {
  3038. tzFormat = 'Z';
  3039. } else {
  3040. config._isValid = false;
  3041. return;
  3042. }
  3043. }
  3044. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  3045. configFromStringAndFormat(config);
  3046. } else {
  3047. config._isValid = false;
  3048. }
  3049. }
  3050. function extractFromRFC2822Strings(
  3051. yearStr,
  3052. monthStr,
  3053. dayStr,
  3054. hourStr,
  3055. minuteStr,
  3056. secondStr
  3057. ) {
  3058. var result = [
  3059. untruncateYear(yearStr),
  3060. defaultLocaleMonthsShort.indexOf(monthStr),
  3061. parseInt(dayStr, 10),
  3062. parseInt(hourStr, 10),
  3063. parseInt(minuteStr, 10),
  3064. ];
  3065. if (secondStr) {
  3066. result.push(parseInt(secondStr, 10));
  3067. }
  3068. return result;
  3069. }
  3070. function untruncateYear(yearStr) {
  3071. var year = parseInt(yearStr, 10);
  3072. if (year <= 49) {
  3073. return 2000 + year;
  3074. } else if (year <= 999) {
  3075. return 1900 + year;
  3076. }
  3077. return year;
  3078. }
  3079. function preprocessRFC2822(s) {
  3080. // Remove comments and folding whitespace and replace multiple-spaces with a single space
  3081. return s
  3082. .replace(/\([^)]*\)|[\n\t]/g, ' ')
  3083. .replace(/(\s\s+)/g, ' ')
  3084. .replace(/^\s\s*/, '')
  3085. .replace(/\s\s*$/, '');
  3086. }
  3087. function checkWeekday(weekdayStr, parsedInput, config) {
  3088. if (weekdayStr) {
  3089. // TODO: Replace the vanilla JS Date object with an independent day-of-week check.
  3090. var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
  3091. weekdayActual = new Date(
  3092. parsedInput[0],
  3093. parsedInput[1],
  3094. parsedInput[2]
  3095. ).getDay();
  3096. if (weekdayProvided !== weekdayActual) {
  3097. getParsingFlags(config).weekdayMismatch = true;
  3098. config._isValid = false;
  3099. return false;
  3100. }
  3101. }
  3102. return true;
  3103. }
  3104. function calculateOffset(obsOffset, militaryOffset, numOffset) {
  3105. if (obsOffset) {
  3106. return obsOffsets[obsOffset];
  3107. } else if (militaryOffset) {
  3108. // the only allowed military tz is Z
  3109. return 0;
  3110. } else {
  3111. var hm = parseInt(numOffset, 10),
  3112. m = hm % 100,
  3113. h = (hm - m) / 100;
  3114. return h * 60 + m;
  3115. }
  3116. }
  3117. // date and time from ref 2822 format
  3118. function configFromRFC2822(config) {
  3119. var match = rfc2822.exec(preprocessRFC2822(config._i)),
  3120. parsedArray;
  3121. if (match) {
  3122. parsedArray = extractFromRFC2822Strings(
  3123. match[4],
  3124. match[3],
  3125. match[2],
  3126. match[5],
  3127. match[6],
  3128. match[7]
  3129. );
  3130. if (!checkWeekday(match[1], parsedArray, config)) {
  3131. return;
  3132. }
  3133. config._a = parsedArray;
  3134. config._tzm = calculateOffset(match[8], match[9], match[10]);
  3135. config._d = createUTCDate.apply(null, config._a);
  3136. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  3137. getParsingFlags(config).rfc2822 = true;
  3138. } else {
  3139. config._isValid = false;
  3140. }
  3141. }
  3142. // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict
  3143. function configFromString(config) {
  3144. var matched = aspNetJsonRegex.exec(config._i);
  3145. if (matched !== null) {
  3146. config._d = new Date(+matched[1]);
  3147. return;
  3148. }
  3149. configFromISO(config);
  3150. if (config._isValid === false) {
  3151. delete config._isValid;
  3152. } else {
  3153. return;
  3154. }
  3155. configFromRFC2822(config);
  3156. if (config._isValid === false) {
  3157. delete config._isValid;
  3158. } else {
  3159. return;
  3160. }
  3161. if (config._strict) {
  3162. config._isValid = false;
  3163. } else {
  3164. // Final attempt, use Input Fallback
  3165. hooks.createFromInputFallback(config);
  3166. }
  3167. }
  3168. hooks.createFromInputFallback = deprecate(
  3169. 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
  3170. 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
  3171. 'discouraged and will be removed in an upcoming major release. Please refer to ' +
  3172. 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  3173. function (config) {
  3174. config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  3175. }
  3176. );
  3177. // Pick the first defined of two or three arguments.
  3178. function defaults(a, b, c) {
  3179. if (a != null) {
  3180. return a;
  3181. }
  3182. if (b != null) {
  3183. return b;
  3184. }
  3185. return c;
  3186. }
  3187. function currentDateArray(config) {
  3188. // hooks is actually the exported moment object
  3189. var nowValue = new Date(hooks.now());
  3190. if (config._useUTC) {
  3191. return [
  3192. nowValue.getUTCFullYear(),
  3193. nowValue.getUTCMonth(),
  3194. nowValue.getUTCDate(),
  3195. ];
  3196. }
  3197. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  3198. }
  3199. // convert an array to a date.
  3200. // the array should mirror the parameters below
  3201. // note: all values past the year are optional and will default to the lowest possible value.
  3202. // [year, month, day , hour, minute, second, millisecond]
  3203. function configFromArray(config) {
  3204. var i,
  3205. date,
  3206. input = [],
  3207. currentDate,
  3208. expectedWeekday,
  3209. yearToUse;
  3210. if (config._d) {
  3211. return;
  3212. }
  3213. currentDate = currentDateArray(config);
  3214. //compute day of the year from weeks and weekdays
  3215. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  3216. dayOfYearFromWeekInfo(config);
  3217. }
  3218. //if the day of the year is set, figure out what it is
  3219. if (config._dayOfYear != null) {
  3220. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  3221. if (
  3222. config._dayOfYear > daysInYear(yearToUse) ||
  3223. config._dayOfYear === 0
  3224. ) {
  3225. getParsingFlags(config)._overflowDayOfYear = true;
  3226. }
  3227. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  3228. config._a[MONTH] = date.getUTCMonth();
  3229. config._a[DATE] = date.getUTCDate();
  3230. }
  3231. // Default to current date.
  3232. // * if no year, month, day of month are given, default to today
  3233. // * if day of month is given, default month and year
  3234. // * if month is given, default only year
  3235. // * if year is given, don't default anything
  3236. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  3237. config._a[i] = input[i] = currentDate[i];
  3238. }
  3239. // Zero out whatever was not defaulted, including time
  3240. for (; i < 7; i++) {
  3241. config._a[i] = input[i] =
  3242. config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];
  3243. }
  3244. // Check for 24:00:00.000
  3245. if (
  3246. config._a[HOUR] === 24 &&
  3247. config._a[MINUTE] === 0 &&
  3248. config._a[SECOND] === 0 &&
  3249. config._a[MILLISECOND] === 0
  3250. ) {
  3251. config._nextDay = true;
  3252. config._a[HOUR] = 0;
  3253. }
  3254. config._d = (config._useUTC ? createUTCDate : createDate).apply(
  3255. null,
  3256. input
  3257. );
  3258. expectedWeekday = config._useUTC
  3259. ? config._d.getUTCDay()
  3260. : config._d.getDay();
  3261. // Apply timezone offset from input. The actual utcOffset can be changed
  3262. // with parseZone.
  3263. if (config._tzm != null) {
  3264. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  3265. }
  3266. if (config._nextDay) {
  3267. config._a[HOUR] = 24;
  3268. }
  3269. // check for mismatching day of week
  3270. if (
  3271. config._w &&
  3272. typeof config._w.d !== 'undefined' &&
  3273. config._w.d !== expectedWeekday
  3274. ) {
  3275. getParsingFlags(config).weekdayMismatch = true;
  3276. }
  3277. }
  3278. function dayOfYearFromWeekInfo(config) {
  3279. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
  3280. w = config._w;
  3281. if (w.GG != null || w.W != null || w.E != null) {
  3282. dow = 1;
  3283. doy = 4;
  3284. // TODO: We need to take the current isoWeekYear, but that depends on
  3285. // how we interpret now (local, utc, fixed offset). So create
  3286. // a now version of current config (take local/utc/offset flags, and
  3287. // create now).
  3288. weekYear = defaults(
  3289. w.GG,
  3290. config._a[YEAR],
  3291. weekOfYear(createLocal(), 1, 4).year
  3292. );
  3293. week = defaults(w.W, 1);
  3294. weekday = defaults(w.E, 1);
  3295. if (weekday < 1 || weekday > 7) {
  3296. weekdayOverflow = true;
  3297. }
  3298. } else {
  3299. dow = config._locale._week.dow;
  3300. doy = config._locale._week.doy;
  3301. curWeek = weekOfYear(createLocal(), dow, doy);
  3302. weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
  3303. // Default to current week.
  3304. week = defaults(w.w, curWeek.week);
  3305. if (w.d != null) {
  3306. // weekday -- low day numbers are considered next week
  3307. weekday = w.d;
  3308. if (weekday < 0 || weekday > 6) {
  3309. weekdayOverflow = true;
  3310. }
  3311. } else if (w.e != null) {
  3312. // local weekday -- counting starts from beginning of week
  3313. weekday = w.e + dow;
  3314. if (w.e < 0 || w.e > 6) {
  3315. weekdayOverflow = true;
  3316. }
  3317. } else {
  3318. // default to beginning of week
  3319. weekday = dow;
  3320. }
  3321. }
  3322. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  3323. getParsingFlags(config)._overflowWeeks = true;
  3324. } else if (weekdayOverflow != null) {
  3325. getParsingFlags(config)._overflowWeekday = true;
  3326. } else {
  3327. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  3328. config._a[YEAR] = temp.year;
  3329. config._dayOfYear = temp.dayOfYear;
  3330. }
  3331. }
  3332. // constant that refers to the ISO standard
  3333. hooks.ISO_8601 = function () {};
  3334. // constant that refers to the RFC 2822 form
  3335. hooks.RFC_2822 = function () {};
  3336. // date from string and format string
  3337. function configFromStringAndFormat(config) {
  3338. // TODO: Move this to another part of the creation flow to prevent circular deps
  3339. if (config._f === hooks.ISO_8601) {
  3340. configFromISO(config);
  3341. return;
  3342. }
  3343. if (config._f === hooks.RFC_2822) {
  3344. configFromRFC2822(config);
  3345. return;
  3346. }
  3347. config._a = [];
  3348. getParsingFlags(config).empty = true;
  3349. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  3350. var string = '' + config._i,
  3351. i,
  3352. parsedInput,
  3353. tokens,
  3354. token,
  3355. skipped,
  3356. stringLength = string.length,
  3357. totalParsedInputLength = 0,
  3358. era;
  3359. tokens =
  3360. expandFormat(config._f, config._locale).match(formattingTokens) || [];
  3361. for (i = 0; i < tokens.length; i++) {
  3362. token = tokens[i];
  3363. parsedInput = (string.match(getParseRegexForToken(token, config)) ||
  3364. [])[0];
  3365. if (parsedInput) {
  3366. skipped = string.substr(0, string.indexOf(parsedInput));
  3367. if (skipped.length > 0) {
  3368. getParsingFlags(config).unusedInput.push(skipped);
  3369. }
  3370. string = string.slice(
  3371. string.indexOf(parsedInput) + parsedInput.length
  3372. );
  3373. totalParsedInputLength += parsedInput.length;
  3374. }
  3375. // don't parse if it's not a known token
  3376. if (formatTokenFunctions[token]) {
  3377. if (parsedInput) {
  3378. getParsingFlags(config).empty = false;
  3379. } else {
  3380. getParsingFlags(config).unusedTokens.push(token);
  3381. }
  3382. addTimeToArrayFromToken(token, parsedInput, config);
  3383. } else if (config._strict && !parsedInput) {
  3384. getParsingFlags(config).unusedTokens.push(token);
  3385. }
  3386. }
  3387. // add remaining unparsed input length to the string
  3388. getParsingFlags(config).charsLeftOver =
  3389. stringLength - totalParsedInputLength;
  3390. if (string.length > 0) {
  3391. getParsingFlags(config).unusedInput.push(string);
  3392. }
  3393. // clear _12h flag if hour is <= 12
  3394. if (
  3395. config._a[HOUR] <= 12 &&
  3396. getParsingFlags(config).bigHour === true &&
  3397. config._a[HOUR] > 0
  3398. ) {
  3399. getParsingFlags(config).bigHour = undefined;
  3400. }
  3401. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  3402. getParsingFlags(config).meridiem = config._meridiem;
  3403. // handle meridiem
  3404. config._a[HOUR] = meridiemFixWrap(
  3405. config._locale,
  3406. config._a[HOUR],
  3407. config._meridiem
  3408. );
  3409. // handle era
  3410. era = getParsingFlags(config).era;
  3411. if (era !== null) {
  3412. config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
  3413. }
  3414. configFromArray(config);
  3415. checkOverflow(config);
  3416. }
  3417. function meridiemFixWrap(locale, hour, meridiem) {
  3418. var isPm;
  3419. if (meridiem == null) {
  3420. // nothing to do
  3421. return hour;
  3422. }
  3423. if (locale.meridiemHour != null) {
  3424. return locale.meridiemHour(hour, meridiem);
  3425. } else if (locale.isPM != null) {
  3426. // Fallback
  3427. isPm = locale.isPM(meridiem);
  3428. if (isPm && hour < 12) {
  3429. hour += 12;
  3430. }
  3431. if (!isPm && hour === 12) {
  3432. hour = 0;
  3433. }
  3434. return hour;
  3435. } else {
  3436. // this is not supposed to happen
  3437. return hour;
  3438. }
  3439. }
  3440. // date from string and array of format strings
  3441. function configFromStringAndArray(config) {
  3442. var tempConfig,
  3443. bestMoment,
  3444. scoreToBeat,
  3445. i,
  3446. currentScore,
  3447. validFormatFound,
  3448. bestFormatIsValid = false;
  3449. if (config._f.length === 0) {
  3450. getParsingFlags(config).invalidFormat = true;
  3451. config._d = new Date(NaN);
  3452. return;
  3453. }
  3454. for (i = 0; i < config._f.length; i++) {
  3455. currentScore = 0;
  3456. validFormatFound = false;
  3457. tempConfig = copyConfig({}, config);
  3458. if (config._useUTC != null) {
  3459. tempConfig._useUTC = config._useUTC;
  3460. }
  3461. tempConfig._f = config._f[i];
  3462. configFromStringAndFormat(tempConfig);
  3463. if (isValid(tempConfig)) {
  3464. validFormatFound = true;
  3465. }
  3466. // if there is any input that was not parsed add a penalty for that format
  3467. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  3468. //or tokens
  3469. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  3470. getParsingFlags(tempConfig).score = currentScore;
  3471. if (!bestFormatIsValid) {
  3472. if (
  3473. scoreToBeat == null ||
  3474. currentScore < scoreToBeat ||
  3475. validFormatFound
  3476. ) {
  3477. scoreToBeat = currentScore;
  3478. bestMoment = tempConfig;
  3479. if (validFormatFound) {
  3480. bestFormatIsValid = true;
  3481. }
  3482. }
  3483. } else {
  3484. if (currentScore < scoreToBeat) {
  3485. scoreToBeat = currentScore;
  3486. bestMoment = tempConfig;
  3487. }
  3488. }
  3489. }
  3490. extend(config, bestMoment || tempConfig);
  3491. }
  3492. function configFromObject(config) {
  3493. if (config._d) {
  3494. return;
  3495. }
  3496. var i = normalizeObjectUnits(config._i),
  3497. dayOrDate = i.day === undefined ? i.date : i.day;
  3498. config._a = map(
  3499. [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
  3500. function (obj) {
  3501. return obj && parseInt(obj, 10);
  3502. }
  3503. );
  3504. configFromArray(config);
  3505. }
  3506. function createFromConfig(config) {
  3507. var res = new Moment(checkOverflow(prepareConfig(config)));
  3508. if (res._nextDay) {
  3509. // Adding is smart enough around DST
  3510. res.add(1, 'd');
  3511. res._nextDay = undefined;
  3512. }
  3513. return res;
  3514. }
  3515. function prepareConfig(config) {
  3516. var input = config._i,
  3517. format = config._f;
  3518. config._locale = config._locale || getLocale(config._l);
  3519. if (input === null || (format === undefined && input === '')) {
  3520. return createInvalid({ nullInput: true });
  3521. }
  3522. if (typeof input === 'string') {
  3523. config._i = input = config._locale.preparse(input);
  3524. }
  3525. if (isMoment(input)) {
  3526. return new Moment(checkOverflow(input));
  3527. } else if (isDate(input)) {
  3528. config._d = input;
  3529. } else if (isArray(format)) {
  3530. configFromStringAndArray(config);
  3531. } else if (format) {
  3532. configFromStringAndFormat(config);
  3533. } else {
  3534. configFromInput(config);
  3535. }
  3536. if (!isValid(config)) {
  3537. config._d = null;
  3538. }
  3539. return config;
  3540. }
  3541. function configFromInput(config) {
  3542. var input = config._i;
  3543. if (isUndefined(input)) {
  3544. config._d = new Date(hooks.now());
  3545. } else if (isDate(input)) {
  3546. config._d = new Date(input.valueOf());
  3547. } else if (typeof input === 'string') {
  3548. configFromString(config);
  3549. } else if (isArray(input)) {
  3550. config._a = map(input.slice(0), function (obj) {
  3551. return parseInt(obj, 10);
  3552. });
  3553. configFromArray(config);
  3554. } else if (isObject(input)) {
  3555. configFromObject(config);
  3556. } else if (isNumber(input)) {
  3557. // from milliseconds
  3558. config._d = new Date(input);
  3559. } else {
  3560. hooks.createFromInputFallback(config);
  3561. }
  3562. }
  3563. function createLocalOrUTC(input, format, locale, strict, isUTC) {
  3564. var c = {};
  3565. if (format === true || format === false) {
  3566. strict = format;
  3567. format = undefined;
  3568. }
  3569. if (locale === true || locale === false) {
  3570. strict = locale;
  3571. locale = undefined;
  3572. }
  3573. if (
  3574. (isObject(input) && isObjectEmpty(input)) ||
  3575. (isArray(input) && input.length === 0)
  3576. ) {
  3577. input = undefined;
  3578. }
  3579. // object construction must be done this way.
  3580. // https://github.com/moment/moment/issues/1423
  3581. c._isAMomentObject = true;
  3582. c._useUTC = c._isUTC = isUTC;
  3583. c._l = locale;
  3584. c._i = input;
  3585. c._f = format;
  3586. c._strict = strict;
  3587. return createFromConfig(c);
  3588. }
  3589. function createLocal(input, format, locale, strict) {
  3590. return createLocalOrUTC(input, format, locale, strict, false);
  3591. }
  3592. var prototypeMin = deprecate(
  3593. 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
  3594. function () {
  3595. var other = createLocal.apply(null, arguments);
  3596. if (this.isValid() && other.isValid()) {
  3597. return other < this ? this : other;
  3598. } else {
  3599. return createInvalid();
  3600. }
  3601. }
  3602. ),
  3603. prototypeMax = deprecate(
  3604. 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
  3605. function () {
  3606. var other = createLocal.apply(null, arguments);
  3607. if (this.isValid() && other.isValid()) {
  3608. return other > this ? this : other;
  3609. } else {
  3610. return createInvalid();
  3611. }
  3612. }
  3613. );
  3614. // Pick a moment m from moments so that m[fn](other) is true for all
  3615. // other. This relies on the function fn to be transitive.
  3616. //
  3617. // moments should either be an array of moment objects or an array, whose
  3618. // first element is an array of moment objects.
  3619. function pickBy(fn, moments) {
  3620. var res, i;
  3621. if (moments.length === 1 && isArray(moments[0])) {
  3622. moments = moments[0];
  3623. }
  3624. if (!moments.length) {
  3625. return createLocal();
  3626. }
  3627. res = moments[0];
  3628. for (i = 1; i < moments.length; ++i) {
  3629. if (!moments[i].isValid() || moments[i][fn](res)) {
  3630. res = moments[i];
  3631. }
  3632. }
  3633. return res;
  3634. }
  3635. // TODO: Use [].sort instead?
  3636. function min() {
  3637. var args = [].slice.call(arguments, 0);
  3638. return pickBy('isBefore', args);
  3639. }
  3640. function max() {
  3641. var args = [].slice.call(arguments, 0);
  3642. return pickBy('isAfter', args);
  3643. }
  3644. var now = function () {
  3645. return Date.now ? Date.now() : +new Date();
  3646. };
  3647. var ordering = [
  3648. 'year',
  3649. 'quarter',
  3650. 'month',
  3651. 'week',
  3652. 'day',
  3653. 'hour',
  3654. 'minute',
  3655. 'second',
  3656. 'millisecond',
  3657. ];
  3658. function isDurationValid(m) {
  3659. var key,
  3660. unitHasDecimal = false,
  3661. i;
  3662. for (key in m) {
  3663. if (
  3664. hasOwnProp(m, key) &&
  3665. !(
  3666. indexOf.call(ordering, key) !== -1 &&
  3667. (m[key] == null || !isNaN(m[key]))
  3668. )
  3669. ) {
  3670. return false;
  3671. }
  3672. }
  3673. for (i = 0; i < ordering.length; ++i) {
  3674. if (m[ordering[i]]) {
  3675. if (unitHasDecimal) {
  3676. return false; // only allow non-integers for smallest unit
  3677. }
  3678. if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
  3679. unitHasDecimal = true;
  3680. }
  3681. }
  3682. }
  3683. return true;
  3684. }
  3685. function isValid$1() {
  3686. return this._isValid;
  3687. }
  3688. function createInvalid$1() {
  3689. return createDuration(NaN);
  3690. }
  3691. function Duration(duration) {
  3692. var normalizedInput = normalizeObjectUnits(duration),
  3693. years = normalizedInput.year || 0,
  3694. quarters = normalizedInput.quarter || 0,
  3695. months = normalizedInput.month || 0,
  3696. weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
  3697. days = normalizedInput.day || 0,
  3698. hours = normalizedInput.hour || 0,
  3699. minutes = normalizedInput.minute || 0,
  3700. seconds = normalizedInput.second || 0,
  3701. milliseconds = normalizedInput.millisecond || 0;
  3702. this._isValid = isDurationValid(normalizedInput);
  3703. // representation for dateAddRemove
  3704. this._milliseconds =
  3705. +milliseconds +
  3706. seconds * 1e3 + // 1000
  3707. minutes * 6e4 + // 1000 * 60
  3708. hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  3709. // Because of dateAddRemove treats 24 hours as different from a
  3710. // day when working around DST, we need to store them separately
  3711. this._days = +days + weeks * 7;
  3712. // It is impossible to translate months into days without knowing
  3713. // which months you are are talking about, so we have to store
  3714. // it separately.
  3715. this._months = +months + quarters * 3 + years * 12;
  3716. this._data = {};
  3717. this._locale = getLocale();
  3718. this._bubble();
  3719. }
  3720. function isDuration(obj) {
  3721. return obj instanceof Duration;
  3722. }
  3723. function absRound(number) {
  3724. if (number < 0) {
  3725. return Math.round(-1 * number) * -1;
  3726. } else {
  3727. return Math.round(number);
  3728. }
  3729. }
  3730. // compare two arrays, return the number of differences
  3731. function compareArrays(array1, array2, dontConvert) {
  3732. var len = Math.min(array1.length, array2.length),
  3733. lengthDiff = Math.abs(array1.length - array2.length),
  3734. diffs = 0,
  3735. i;
  3736. for (i = 0; i < len; i++) {
  3737. if (
  3738. (dontConvert && array1[i] !== array2[i]) ||
  3739. (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))
  3740. ) {
  3741. diffs++;
  3742. }
  3743. }
  3744. return diffs + lengthDiff;
  3745. }
  3746. // FORMATTING
  3747. function offset(token, separator) {
  3748. addFormatToken(token, 0, 0, function () {
  3749. var offset = this.utcOffset(),
  3750. sign = '+';
  3751. if (offset < 0) {
  3752. offset = -offset;
  3753. sign = '-';
  3754. }
  3755. return (
  3756. sign +
  3757. zeroFill(~~(offset / 60), 2) +
  3758. separator +
  3759. zeroFill(~~offset % 60, 2)
  3760. );
  3761. });
  3762. }
  3763. offset('Z', ':');
  3764. offset('ZZ', '');
  3765. // PARSING
  3766. addRegexToken('Z', matchShortOffset);
  3767. addRegexToken('ZZ', matchShortOffset);
  3768. addParseToken(['Z', 'ZZ'], function (input, array, config) {
  3769. config._useUTC = true;
  3770. config._tzm = offsetFromString(matchShortOffset, input);
  3771. });
  3772. // HELPERS
  3773. // timezone chunker
  3774. // '+10:00' > ['10', '00']
  3775. // '-1530' > ['-15', '30']
  3776. var chunkOffset = /([\+\-]|\d\d)/gi;
  3777. function offsetFromString(matcher, string) {
  3778. var matches = (string || '').match(matcher),
  3779. chunk,
  3780. parts,
  3781. minutes;
  3782. if (matches === null) {
  3783. return null;
  3784. }
  3785. chunk = matches[matches.length - 1] || [];
  3786. parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
  3787. minutes = +(parts[1] * 60) + toInt(parts[2]);
  3788. return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
  3789. }
  3790. // Return a moment from input, that is local/utc/zone equivalent to model.
  3791. function cloneWithOffset(input, model) {
  3792. var res, diff;
  3793. if (model._isUTC) {
  3794. res = model.clone();
  3795. diff =
  3796. (isMoment(input) || isDate(input)
  3797. ? input.valueOf()
  3798. : createLocal(input).valueOf()) - res.valueOf();
  3799. // Use low-level api, because this fn is low-level api.
  3800. res._d.setTime(res._d.valueOf() + diff);
  3801. hooks.updateOffset(res, false);
  3802. return res;
  3803. } else {
  3804. return createLocal(input).local();
  3805. }
  3806. }
  3807. function getDateOffset(m) {
  3808. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  3809. // https://github.com/moment/moment/pull/1871
  3810. return -Math.round(m._d.getTimezoneOffset());
  3811. }
  3812. // HOOKS
  3813. // This function will be called whenever a moment is mutated.
  3814. // It is intended to keep the offset in sync with the timezone.
  3815. hooks.updateOffset = function () {};
  3816. // MOMENTS
  3817. // keepLocalTime = true means only change the timezone, without
  3818. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  3819. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  3820. // +0200, so we adjust the time as needed, to be valid.
  3821. //
  3822. // Keeping the time actually adds/subtracts (one hour)
  3823. // from the actual represented time. That is why we call updateOffset
  3824. // a second time. In case it wants us to change the offset again
  3825. // _changeInProgress == true case, then we have to adjust, because
  3826. // there is no such time in the given timezone.
  3827. function getSetOffset(input, keepLocalTime, keepMinutes) {
  3828. var offset = this._offset || 0,
  3829. localAdjust;
  3830. if (!this.isValid()) {
  3831. return input != null ? this : NaN;
  3832. }
  3833. if (input != null) {
  3834. if (typeof input === 'string') {
  3835. input = offsetFromString(matchShortOffset, input);
  3836. if (input === null) {
  3837. return this;
  3838. }
  3839. } else if (Math.abs(input) < 16 && !keepMinutes) {
  3840. input = input * 60;
  3841. }
  3842. if (!this._isUTC && keepLocalTime) {
  3843. localAdjust = getDateOffset(this);
  3844. }
  3845. this._offset = input;
  3846. this._isUTC = true;
  3847. if (localAdjust != null) {
  3848. this.add(localAdjust, 'm');
  3849. }
  3850. if (offset !== input) {
  3851. if (!keepLocalTime || this._changeInProgress) {
  3852. addSubtract(
  3853. this,
  3854. createDuration(input - offset, 'm'),
  3855. 1,
  3856. false
  3857. );
  3858. } else if (!this._changeInProgress) {
  3859. this._changeInProgress = true;
  3860. hooks.updateOffset(this, true);
  3861. this._changeInProgress = null;
  3862. }
  3863. }
  3864. return this;
  3865. } else {
  3866. return this._isUTC ? offset : getDateOffset(this);
  3867. }
  3868. }
  3869. function getSetZone(input, keepLocalTime) {
  3870. if (input != null) {
  3871. if (typeof input !== 'string') {
  3872. input = -input;
  3873. }
  3874. this.utcOffset(input, keepLocalTime);
  3875. return this;
  3876. } else {
  3877. return -this.utcOffset();
  3878. }
  3879. }
  3880. function setOffsetToUTC(keepLocalTime) {
  3881. return this.utcOffset(0, keepLocalTime);
  3882. }
  3883. function setOffsetToLocal(keepLocalTime) {
  3884. if (this._isUTC) {
  3885. this.utcOffset(0, keepLocalTime);
  3886. this._isUTC = false;
  3887. if (keepLocalTime) {
  3888. this.subtract(getDateOffset(this), 'm');
  3889. }
  3890. }
  3891. return this;
  3892. }
  3893. function setOffsetToParsedOffset() {
  3894. if (this._tzm != null) {
  3895. this.utcOffset(this._tzm, false, true);
  3896. } else if (typeof this._i === 'string') {
  3897. var tZone = offsetFromString(matchOffset, this._i);
  3898. if (tZone != null) {
  3899. this.utcOffset(tZone);
  3900. } else {
  3901. this.utcOffset(0, true);
  3902. }
  3903. }
  3904. return this;
  3905. }
  3906. function hasAlignedHourOffset(input) {
  3907. if (!this.isValid()) {
  3908. return false;
  3909. }
  3910. input = input ? createLocal(input).utcOffset() : 0;
  3911. return (this.utcOffset() - input) % 60 === 0;
  3912. }
  3913. function isDaylightSavingTime() {
  3914. return (
  3915. this.utcOffset() > this.clone().month(0).utcOffset() ||
  3916. this.utcOffset() > this.clone().month(5).utcOffset()
  3917. );
  3918. }
  3919. function isDaylightSavingTimeShifted() {
  3920. if (!isUndefined(this._isDSTShifted)) {
  3921. return this._isDSTShifted;
  3922. }
  3923. var c = {},
  3924. other;
  3925. copyConfig(c, this);
  3926. c = prepareConfig(c);
  3927. if (c._a) {
  3928. other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
  3929. this._isDSTShifted =
  3930. this.isValid() && compareArrays(c._a, other.toArray()) > 0;
  3931. } else {
  3932. this._isDSTShifted = false;
  3933. }
  3934. return this._isDSTShifted;
  3935. }
  3936. function isLocal() {
  3937. return this.isValid() ? !this._isUTC : false;
  3938. }
  3939. function isUtcOffset() {
  3940. return this.isValid() ? this._isUTC : false;
  3941. }
  3942. function isUtc() {
  3943. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  3944. }
  3945. // ASP.NET json date format regex
  3946. var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
  3947. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  3948. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  3949. // and further modified to allow for strings containing both week and day
  3950. isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
  3951. function createDuration(input, key) {
  3952. var duration = input,
  3953. // matching against regexp is expensive, do it on demand
  3954. match = null,
  3955. sign,
  3956. ret,
  3957. diffRes;
  3958. if (isDuration(input)) {
  3959. duration = {
  3960. ms: input._milliseconds,
  3961. d: input._days,
  3962. M: input._months,
  3963. };
  3964. } else if (isNumber(input) || !isNaN(+input)) {
  3965. duration = {};
  3966. if (key) {
  3967. duration[key] = +input;
  3968. } else {
  3969. duration.milliseconds = +input;
  3970. }
  3971. } else if ((match = aspNetRegex.exec(input))) {
  3972. sign = match[1] === '-' ? -1 : 1;
  3973. duration = {
  3974. y: 0,
  3975. d: toInt(match[DATE]) * sign,
  3976. h: toInt(match[HOUR]) * sign,
  3977. m: toInt(match[MINUTE]) * sign,
  3978. s: toInt(match[SECOND]) * sign,
  3979. ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match
  3980. };
  3981. } else if ((match = isoRegex.exec(input))) {
  3982. sign = match[1] === '-' ? -1 : 1;
  3983. duration = {
  3984. y: parseIso(match[2], sign),
  3985. M: parseIso(match[3], sign),
  3986. w: parseIso(match[4], sign),
  3987. d: parseIso(match[5], sign),
  3988. h: parseIso(match[6], sign),
  3989. m: parseIso(match[7], sign),
  3990. s: parseIso(match[8], sign),
  3991. };
  3992. } else if (duration == null) {
  3993. // checks for null or undefined
  3994. duration = {};
  3995. } else if (
  3996. typeof duration === 'object' &&
  3997. ('from' in duration || 'to' in duration)
  3998. ) {
  3999. diffRes = momentsDifference(
  4000. createLocal(duration.from),
  4001. createLocal(duration.to)
  4002. );
  4003. duration = {};
  4004. duration.ms = diffRes.milliseconds;
  4005. duration.M = diffRes.months;
  4006. }
  4007. ret = new Duration(duration);
  4008. if (isDuration(input) && hasOwnProp(input, '_locale')) {
  4009. ret._locale = input._locale;
  4010. }
  4011. if (isDuration(input) && hasOwnProp(input, '_isValid')) {
  4012. ret._isValid = input._isValid;
  4013. }
  4014. return ret;
  4015. }
  4016. createDuration.fn = Duration.prototype;
  4017. createDuration.invalid = createInvalid$1;
  4018. function parseIso(inp, sign) {
  4019. // We'd normally use ~~inp for this, but unfortunately it also
  4020. // converts floats to ints.
  4021. // inp may be undefined, so careful calling replace on it.
  4022. var res = inp && parseFloat(inp.replace(',', '.'));
  4023. // apply sign while we're at it
  4024. return (isNaN(res) ? 0 : res) * sign;
  4025. }
  4026. function positiveMomentsDifference(base, other) {
  4027. var res = {};
  4028. res.months =
  4029. other.month() - base.month() + (other.year() - base.year()) * 12;
  4030. if (base.clone().add(res.months, 'M').isAfter(other)) {
  4031. --res.months;
  4032. }
  4033. res.milliseconds = +other - +base.clone().add(res.months, 'M');
  4034. return res;
  4035. }
  4036. function momentsDifference(base, other) {
  4037. var res;
  4038. if (!(base.isValid() && other.isValid())) {
  4039. return { milliseconds: 0, months: 0 };
  4040. }
  4041. other = cloneWithOffset(other, base);
  4042. if (base.isBefore(other)) {
  4043. res = positiveMomentsDifference(base, other);
  4044. } else {
  4045. res = positiveMomentsDifference(other, base);
  4046. res.milliseconds = -res.milliseconds;
  4047. res.months = -res.months;
  4048. }
  4049. return res;
  4050. }
  4051. // TODO: remove 'name' arg after deprecation is removed
  4052. function createAdder(direction, name) {
  4053. return function (val, period) {
  4054. var dur, tmp;
  4055. //invert the arguments, but complain about it
  4056. if (period !== null && !isNaN(+period)) {
  4057. deprecateSimple(
  4058. name,
  4059. 'moment().' +
  4060. name +
  4061. '(period, number) is deprecated. Please use moment().' +
  4062. name +
  4063. '(number, period). ' +
  4064. 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'
  4065. );
  4066. tmp = val;
  4067. val = period;
  4068. period = tmp;
  4069. }
  4070. dur = createDuration(val, period);
  4071. addSubtract(this, dur, direction);
  4072. return this;
  4073. };
  4074. }
  4075. function addSubtract(mom, duration, isAdding, updateOffset) {
  4076. var milliseconds = duration._milliseconds,
  4077. days = absRound(duration._days),
  4078. months = absRound(duration._months);
  4079. if (!mom.isValid()) {
  4080. // No op
  4081. return;
  4082. }
  4083. updateOffset = updateOffset == null ? true : updateOffset;
  4084. if (months) {
  4085. setMonth(mom, get(mom, 'Month') + months * isAdding);
  4086. }
  4087. if (days) {
  4088. set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
  4089. }
  4090. if (milliseconds) {
  4091. mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
  4092. }
  4093. if (updateOffset) {
  4094. hooks.updateOffset(mom, days || months);
  4095. }
  4096. }
  4097. var add = createAdder(1, 'add'),
  4098. subtract = createAdder(-1, 'subtract');
  4099. function isString(input) {
  4100. return typeof input === 'string' || input instanceof String;
  4101. }
  4102. // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
  4103. function isMomentInput(input) {
  4104. return (
  4105. isMoment(input) ||
  4106. isDate(input) ||
  4107. isString(input) ||
  4108. isNumber(input) ||
  4109. isNumberOrStringArray(input) ||
  4110. isMomentInputObject(input) ||
  4111. input === null ||
  4112. input === undefined
  4113. );
  4114. }
  4115. function isMomentInputObject(input) {
  4116. var objectTest = isObject(input) && !isObjectEmpty(input),
  4117. propertyTest = false,
  4118. properties = [
  4119. 'years',
  4120. 'year',
  4121. 'y',
  4122. 'months',
  4123. 'month',
  4124. 'M',
  4125. 'days',
  4126. 'day',
  4127. 'd',
  4128. 'dates',
  4129. 'date',
  4130. 'D',
  4131. 'hours',
  4132. 'hour',
  4133. 'h',
  4134. 'minutes',
  4135. 'minute',
  4136. 'm',
  4137. 'seconds',
  4138. 'second',
  4139. 's',
  4140. 'milliseconds',
  4141. 'millisecond',
  4142. 'ms',
  4143. ],
  4144. i,
  4145. property;
  4146. for (i = 0; i < properties.length; i += 1) {
  4147. property = properties[i];
  4148. propertyTest = propertyTest || hasOwnProp(input, property);
  4149. }
  4150. return objectTest && propertyTest;
  4151. }
  4152. function isNumberOrStringArray(input) {
  4153. var arrayTest = isArray(input),
  4154. dataTypeTest = false;
  4155. if (arrayTest) {
  4156. dataTypeTest =
  4157. input.filter(function (item) {
  4158. return !isNumber(item) && isString(input);
  4159. }).length === 0;
  4160. }
  4161. return arrayTest && dataTypeTest;
  4162. }
  4163. function isCalendarSpec(input) {
  4164. var objectTest = isObject(input) && !isObjectEmpty(input),
  4165. propertyTest = false,
  4166. properties = [
  4167. 'sameDay',
  4168. 'nextDay',
  4169. 'lastDay',
  4170. 'nextWeek',
  4171. 'lastWeek',
  4172. 'sameElse',
  4173. ],
  4174. i,
  4175. property;
  4176. for (i = 0; i < properties.length; i += 1) {
  4177. property = properties[i];
  4178. propertyTest = propertyTest || hasOwnProp(input, property);
  4179. }
  4180. return objectTest && propertyTest;
  4181. }
  4182. function getCalendarFormat(myMoment, now) {
  4183. var diff = myMoment.diff(now, 'days', true);
  4184. return diff < -6
  4185. ? 'sameElse'
  4186. : diff < -1
  4187. ? 'lastWeek'
  4188. : diff < 0
  4189. ? 'lastDay'
  4190. : diff < 1
  4191. ? 'sameDay'
  4192. : diff < 2
  4193. ? 'nextDay'
  4194. : diff < 7
  4195. ? 'nextWeek'
  4196. : 'sameElse';
  4197. }
  4198. function calendar$1(time, formats) {
  4199. // Support for single parameter, formats only overload to the calendar function
  4200. if (arguments.length === 1) {
  4201. if (isMomentInput(arguments[0])) {
  4202. time = arguments[0];
  4203. formats = undefined;
  4204. } else if (isCalendarSpec(arguments[0])) {
  4205. formats = arguments[0];
  4206. time = undefined;
  4207. }
  4208. }
  4209. // We want to compare the start of today, vs this.
  4210. // Getting start-of-today depends on whether we're local/utc/offset or not.
  4211. var now = time || createLocal(),
  4212. sod = cloneWithOffset(now, this).startOf('day'),
  4213. format = hooks.calendarFormat(this, sod) || 'sameElse',
  4214. output =
  4215. formats &&
  4216. (isFunction(formats[format])
  4217. ? formats[format].call(this, now)
  4218. : formats[format]);
  4219. return this.format(
  4220. output || this.localeData().calendar(format, this, createLocal(now))
  4221. );
  4222. }
  4223. function clone() {
  4224. return new Moment(this);
  4225. }
  4226. function isAfter(input, units) {
  4227. var localInput = isMoment(input) ? input : createLocal(input);
  4228. if (!(this.isValid() && localInput.isValid())) {
  4229. return false;
  4230. }
  4231. units = normalizeUnits(units) || 'millisecond';
  4232. if (units === 'millisecond') {
  4233. return this.valueOf() > localInput.valueOf();
  4234. } else {
  4235. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  4236. }
  4237. }
  4238. function isBefore(input, units) {
  4239. var localInput = isMoment(input) ? input : createLocal(input);
  4240. if (!(this.isValid() && localInput.isValid())) {
  4241. return false;
  4242. }
  4243. units = normalizeUnits(units) || 'millisecond';
  4244. if (units === 'millisecond') {
  4245. return this.valueOf() < localInput.valueOf();
  4246. } else {
  4247. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  4248. }
  4249. }
  4250. function isBetween(from, to, units, inclusivity) {
  4251. var localFrom = isMoment(from) ? from : createLocal(from),
  4252. localTo = isMoment(to) ? to : createLocal(to);
  4253. if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
  4254. return false;
  4255. }
  4256. inclusivity = inclusivity || '()';
  4257. return (
  4258. (inclusivity[0] === '('
  4259. ? this.isAfter(localFrom, units)
  4260. : !this.isBefore(localFrom, units)) &&
  4261. (inclusivity[1] === ')'
  4262. ? this.isBefore(localTo, units)
  4263. : !this.isAfter(localTo, units))
  4264. );
  4265. }
  4266. function isSame(input, units) {
  4267. var localInput = isMoment(input) ? input : createLocal(input),
  4268. inputMs;
  4269. if (!(this.isValid() && localInput.isValid())) {
  4270. return false;
  4271. }
  4272. units = normalizeUnits(units) || 'millisecond';
  4273. if (units === 'millisecond') {
  4274. return this.valueOf() === localInput.valueOf();
  4275. } else {
  4276. inputMs = localInput.valueOf();
  4277. return (
  4278. this.clone().startOf(units).valueOf() <= inputMs &&
  4279. inputMs <= this.clone().endOf(units).valueOf()
  4280. );
  4281. }
  4282. }
  4283. function isSameOrAfter(input, units) {
  4284. return this.isSame(input, units) || this.isAfter(input, units);
  4285. }
  4286. function isSameOrBefore(input, units) {
  4287. return this.isSame(input, units) || this.isBefore(input, units);
  4288. }
  4289. function diff(input, units, asFloat) {
  4290. var that, zoneDelta, output;
  4291. if (!this.isValid()) {
  4292. return NaN;
  4293. }
  4294. that = cloneWithOffset(input, this);
  4295. if (!that.isValid()) {
  4296. return NaN;
  4297. }
  4298. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  4299. units = normalizeUnits(units);
  4300. switch (units) {
  4301. case 'year':
  4302. output = monthDiff(this, that) / 12;
  4303. break;
  4304. case 'month':
  4305. output = monthDiff(this, that);
  4306. break;
  4307. case 'quarter':
  4308. output = monthDiff(this, that) / 3;
  4309. break;
  4310. case 'second':
  4311. output = (this - that) / 1e3;
  4312. break; // 1000
  4313. case 'minute':
  4314. output = (this - that) / 6e4;
  4315. break; // 1000 * 60
  4316. case 'hour':
  4317. output = (this - that) / 36e5;
  4318. break; // 1000 * 60 * 60
  4319. case 'day':
  4320. output = (this - that - zoneDelta) / 864e5;
  4321. break; // 1000 * 60 * 60 * 24, negate dst
  4322. case 'week':
  4323. output = (this - that - zoneDelta) / 6048e5;
  4324. break; // 1000 * 60 * 60 * 24 * 7, negate dst
  4325. default:
  4326. output = this - that;
  4327. }
  4328. return asFloat ? output : absFloor(output);
  4329. }
  4330. function monthDiff(a, b) {
  4331. if (a.date() < b.date()) {
  4332. // end-of-month calculations work correct when the start month has more
  4333. // days than the end month.
  4334. return -monthDiff(b, a);
  4335. }
  4336. // difference in months
  4337. var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
  4338. // b is in (anchor - 1 month, anchor + 1 month)
  4339. anchor = a.clone().add(wholeMonthDiff, 'months'),
  4340. anchor2,
  4341. adjust;
  4342. if (b - anchor < 0) {
  4343. anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
  4344. // linear across the month
  4345. adjust = (b - anchor) / (anchor - anchor2);
  4346. } else {
  4347. anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
  4348. // linear across the month
  4349. adjust = (b - anchor) / (anchor2 - anchor);
  4350. }
  4351. //check for negative zero, return zero if negative zero
  4352. return -(wholeMonthDiff + adjust) || 0;
  4353. }
  4354. hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  4355. hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  4356. function toString() {
  4357. return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  4358. }
  4359. function toISOString(keepOffset) {
  4360. if (!this.isValid()) {
  4361. return null;
  4362. }
  4363. var utc = keepOffset !== true,
  4364. m = utc ? this.clone().utc() : this;
  4365. if (m.year() < 0 || m.year() > 9999) {
  4366. return formatMoment(
  4367. m,
  4368. utc
  4369. ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'
  4370. : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'
  4371. );
  4372. }
  4373. if (isFunction(Date.prototype.toISOString)) {
  4374. // native implementation is ~50x faster, use it when we can
  4375. if (utc) {
  4376. return this.toDate().toISOString();
  4377. } else {
  4378. return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)
  4379. .toISOString()
  4380. .replace('Z', formatMoment(m, 'Z'));
  4381. }
  4382. }
  4383. return formatMoment(
  4384. m,
  4385. utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'
  4386. );
  4387. }
  4388. /**
  4389. * Return a human readable representation of a moment that can
  4390. * also be evaluated to get a new moment which is the same
  4391. *
  4392. * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
  4393. */
  4394. function inspect() {
  4395. if (!this.isValid()) {
  4396. return 'moment.invalid(/* ' + this._i + ' */)';
  4397. }
  4398. var func = 'moment',
  4399. zone = '',
  4400. prefix,
  4401. year,
  4402. datetime,
  4403. suffix;
  4404. if (!this.isLocal()) {
  4405. func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
  4406. zone = 'Z';
  4407. }
  4408. prefix = '[' + func + '("]';
  4409. year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
  4410. datetime = '-MM-DD[T]HH:mm:ss.SSS';
  4411. suffix = zone + '[")]';
  4412. return this.format(prefix + year + datetime + suffix);
  4413. }
  4414. function format(inputString) {
  4415. if (!inputString) {
  4416. inputString = this.isUtc()
  4417. ? hooks.defaultFormatUtc
  4418. : hooks.defaultFormat;
  4419. }
  4420. var output = formatMoment(this, inputString);
  4421. return this.localeData().postformat(output);
  4422. }
  4423. function from(time, withoutSuffix) {
  4424. if (
  4425. this.isValid() &&
  4426. ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
  4427. ) {
  4428. return createDuration({ to: this, from: time })
  4429. .locale(this.locale())
  4430. .humanize(!withoutSuffix);
  4431. } else {
  4432. return this.localeData().invalidDate();
  4433. }
  4434. }
  4435. function fromNow(withoutSuffix) {
  4436. return this.from(createLocal(), withoutSuffix);
  4437. }
  4438. function to(time, withoutSuffix) {
  4439. if (
  4440. this.isValid() &&
  4441. ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
  4442. ) {
  4443. return createDuration({ from: this, to: time })
  4444. .locale(this.locale())
  4445. .humanize(!withoutSuffix);
  4446. } else {
  4447. return this.localeData().invalidDate();
  4448. }
  4449. }
  4450. function toNow(withoutSuffix) {
  4451. return this.to(createLocal(), withoutSuffix);
  4452. }
  4453. // If passed a locale key, it will set the locale for this
  4454. // instance. Otherwise, it will return the locale configuration
  4455. // variables for this instance.
  4456. function locale(key) {
  4457. var newLocaleData;
  4458. if (key === undefined) {
  4459. return this._locale._abbr;
  4460. } else {
  4461. newLocaleData = getLocale(key);
  4462. if (newLocaleData != null) {
  4463. this._locale = newLocaleData;
  4464. }
  4465. return this;
  4466. }
  4467. }
  4468. var lang = deprecate(
  4469. 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
  4470. function (key) {
  4471. if (key === undefined) {
  4472. return this.localeData();
  4473. } else {
  4474. return this.locale(key);
  4475. }
  4476. }
  4477. );
  4478. function localeData() {
  4479. return this._locale;
  4480. }
  4481. var MS_PER_SECOND = 1000,
  4482. MS_PER_MINUTE = 60 * MS_PER_SECOND,
  4483. MS_PER_HOUR = 60 * MS_PER_MINUTE,
  4484. MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
  4485. // actual modulo - handles negative numbers (for dates before 1970):
  4486. function mod$1(dividend, divisor) {
  4487. return ((dividend % divisor) + divisor) % divisor;
  4488. }
  4489. function localStartOfDate(y, m, d) {
  4490. // the date constructor remaps years 0-99 to 1900-1999
  4491. if (y < 100 && y >= 0) {
  4492. // preserve leap years using a full 400 year cycle, then reset
  4493. return new Date(y + 400, m, d) - MS_PER_400_YEARS;
  4494. } else {
  4495. return new Date(y, m, d).valueOf();
  4496. }
  4497. }
  4498. function utcStartOfDate(y, m, d) {
  4499. // Date.UTC remaps years 0-99 to 1900-1999
  4500. if (y < 100 && y >= 0) {
  4501. // preserve leap years using a full 400 year cycle, then reset
  4502. return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
  4503. } else {
  4504. return Date.UTC(y, m, d);
  4505. }
  4506. }
  4507. function startOf(units) {
  4508. var time, startOfDate;
  4509. units = normalizeUnits(units);
  4510. if (units === undefined || units === 'millisecond' || !this.isValid()) {
  4511. return this;
  4512. }
  4513. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  4514. switch (units) {
  4515. case 'year':
  4516. time = startOfDate(this.year(), 0, 1);
  4517. break;
  4518. case 'quarter':
  4519. time = startOfDate(
  4520. this.year(),
  4521. this.month() - (this.month() % 3),
  4522. 1
  4523. );
  4524. break;
  4525. case 'month':
  4526. time = startOfDate(this.year(), this.month(), 1);
  4527. break;
  4528. case 'week':
  4529. time = startOfDate(
  4530. this.year(),
  4531. this.month(),
  4532. this.date() - this.weekday()
  4533. );
  4534. break;
  4535. case 'isoWeek':
  4536. time = startOfDate(
  4537. this.year(),
  4538. this.month(),
  4539. this.date() - (this.isoWeekday() - 1)
  4540. );
  4541. break;
  4542. case 'day':
  4543. case 'date':
  4544. time = startOfDate(this.year(), this.month(), this.date());
  4545. break;
  4546. case 'hour':
  4547. time = this._d.valueOf();
  4548. time -= mod$1(
  4549. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  4550. MS_PER_HOUR
  4551. );
  4552. break;
  4553. case 'minute':
  4554. time = this._d.valueOf();
  4555. time -= mod$1(time, MS_PER_MINUTE);
  4556. break;
  4557. case 'second':
  4558. time = this._d.valueOf();
  4559. time -= mod$1(time, MS_PER_SECOND);
  4560. break;
  4561. }
  4562. this._d.setTime(time);
  4563. hooks.updateOffset(this, true);
  4564. return this;
  4565. }
  4566. function endOf(units) {
  4567. var time, startOfDate;
  4568. units = normalizeUnits(units);
  4569. if (units === undefined || units === 'millisecond' || !this.isValid()) {
  4570. return this;
  4571. }
  4572. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  4573. switch (units) {
  4574. case 'year':
  4575. time = startOfDate(this.year() + 1, 0, 1) - 1;
  4576. break;
  4577. case 'quarter':
  4578. time =
  4579. startOfDate(
  4580. this.year(),
  4581. this.month() - (this.month() % 3) + 3,
  4582. 1
  4583. ) - 1;
  4584. break;
  4585. case 'month':
  4586. time = startOfDate(this.year(), this.month() + 1, 1) - 1;
  4587. break;
  4588. case 'week':
  4589. time =
  4590. startOfDate(
  4591. this.year(),
  4592. this.month(),
  4593. this.date() - this.weekday() + 7
  4594. ) - 1;
  4595. break;
  4596. case 'isoWeek':
  4597. time =
  4598. startOfDate(
  4599. this.year(),
  4600. this.month(),
  4601. this.date() - (this.isoWeekday() - 1) + 7
  4602. ) - 1;
  4603. break;
  4604. case 'day':
  4605. case 'date':
  4606. time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
  4607. break;
  4608. case 'hour':
  4609. time = this._d.valueOf();
  4610. time +=
  4611. MS_PER_HOUR -
  4612. mod$1(
  4613. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  4614. MS_PER_HOUR
  4615. ) -
  4616. 1;
  4617. break;
  4618. case 'minute':
  4619. time = this._d.valueOf();
  4620. time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
  4621. break;
  4622. case 'second':
  4623. time = this._d.valueOf();
  4624. time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
  4625. break;
  4626. }
  4627. this._d.setTime(time);
  4628. hooks.updateOffset(this, true);
  4629. return this;
  4630. }
  4631. function valueOf() {
  4632. return this._d.valueOf() - (this._offset || 0) * 60000;
  4633. }
  4634. function unix() {
  4635. return Math.floor(this.valueOf() / 1000);
  4636. }
  4637. function toDate() {
  4638. return new Date(this.valueOf());
  4639. }
  4640. function toArray() {
  4641. var m = this;
  4642. return [
  4643. m.year(),
  4644. m.month(),
  4645. m.date(),
  4646. m.hour(),
  4647. m.minute(),
  4648. m.second(),
  4649. m.millisecond(),
  4650. ];
  4651. }
  4652. function toObject() {
  4653. var m = this;
  4654. return {
  4655. years: m.year(),
  4656. months: m.month(),
  4657. date: m.date(),
  4658. hours: m.hours(),
  4659. minutes: m.minutes(),
  4660. seconds: m.seconds(),
  4661. milliseconds: m.milliseconds(),
  4662. };
  4663. }
  4664. function toJSON() {
  4665. // new Date(NaN).toJSON() === null
  4666. return this.isValid() ? this.toISOString() : null;
  4667. }
  4668. function isValid$2() {
  4669. return isValid(this);
  4670. }
  4671. function parsingFlags() {
  4672. return extend({}, getParsingFlags(this));
  4673. }
  4674. function invalidAt() {
  4675. return getParsingFlags(this).overflow;
  4676. }
  4677. function creationData() {
  4678. return {
  4679. input: this._i,
  4680. format: this._f,
  4681. locale: this._locale,
  4682. isUTC: this._isUTC,
  4683. strict: this._strict,
  4684. };
  4685. }
  4686. addFormatToken('N', 0, 0, 'eraAbbr');
  4687. addFormatToken('NN', 0, 0, 'eraAbbr');
  4688. addFormatToken('NNN', 0, 0, 'eraAbbr');
  4689. addFormatToken('NNNN', 0, 0, 'eraName');
  4690. addFormatToken('NNNNN', 0, 0, 'eraNarrow');
  4691. addFormatToken('y', ['y', 1], 'yo', 'eraYear');
  4692. addFormatToken('y', ['yy', 2], 0, 'eraYear');
  4693. addFormatToken('y', ['yyy', 3], 0, 'eraYear');
  4694. addFormatToken('y', ['yyyy', 4], 0, 'eraYear');
  4695. addRegexToken('N', matchEraAbbr);
  4696. addRegexToken('NN', matchEraAbbr);
  4697. addRegexToken('NNN', matchEraAbbr);
  4698. addRegexToken('NNNN', matchEraName);
  4699. addRegexToken('NNNNN', matchEraNarrow);
  4700. addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (
  4701. input,
  4702. array,
  4703. config,
  4704. token
  4705. ) {
  4706. var era = config._locale.erasParse(input, token, config._strict);
  4707. if (era) {
  4708. getParsingFlags(config).era = era;
  4709. } else {
  4710. getParsingFlags(config).invalidEra = input;
  4711. }
  4712. });
  4713. addRegexToken('y', matchUnsigned);
  4714. addRegexToken('yy', matchUnsigned);
  4715. addRegexToken('yyy', matchUnsigned);
  4716. addRegexToken('yyyy', matchUnsigned);
  4717. addRegexToken('yo', matchEraYearOrdinal);
  4718. addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);
  4719. addParseToken(['yo'], function (input, array, config, token) {
  4720. var match;
  4721. if (config._locale._eraYearOrdinalRegex) {
  4722. match = input.match(config._locale._eraYearOrdinalRegex);
  4723. }
  4724. if (config._locale.eraYearOrdinalParse) {
  4725. array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
  4726. } else {
  4727. array[YEAR] = parseInt(input, 10);
  4728. }
  4729. });
  4730. function localeEras(m, format) {
  4731. var i,
  4732. l,
  4733. date,
  4734. eras = this._eras || getLocale('en')._eras;
  4735. for (i = 0, l = eras.length; i < l; ++i) {
  4736. switch (typeof eras[i].since) {
  4737. case 'string':
  4738. // truncate time
  4739. date = hooks(eras[i].since).startOf('day');
  4740. eras[i].since = date.valueOf();
  4741. break;
  4742. }
  4743. switch (typeof eras[i].until) {
  4744. case 'undefined':
  4745. eras[i].until = +Infinity;
  4746. break;
  4747. case 'string':
  4748. // truncate time
  4749. date = hooks(eras[i].until).startOf('day').valueOf();
  4750. eras[i].until = date.valueOf();
  4751. break;
  4752. }
  4753. }
  4754. return eras;
  4755. }
  4756. function localeErasParse(eraName, format, strict) {
  4757. var i,
  4758. l,
  4759. eras = this.eras(),
  4760. name,
  4761. abbr,
  4762. narrow;
  4763. eraName = eraName.toUpperCase();
  4764. for (i = 0, l = eras.length; i < l; ++i) {
  4765. name = eras[i].name.toUpperCase();
  4766. abbr = eras[i].abbr.toUpperCase();
  4767. narrow = eras[i].narrow.toUpperCase();
  4768. if (strict) {
  4769. switch (format) {
  4770. case 'N':
  4771. case 'NN':
  4772. case 'NNN':
  4773. if (abbr === eraName) {
  4774. return eras[i];
  4775. }
  4776. break;
  4777. case 'NNNN':
  4778. if (name === eraName) {
  4779. return eras[i];
  4780. }
  4781. break;
  4782. case 'NNNNN':
  4783. if (narrow === eraName) {
  4784. return eras[i];
  4785. }
  4786. break;
  4787. }
  4788. } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
  4789. return eras[i];
  4790. }
  4791. }
  4792. }
  4793. function localeErasConvertYear(era, year) {
  4794. var dir = era.since <= era.until ? +1 : -1;
  4795. if (year === undefined) {
  4796. return hooks(era.since).year();
  4797. } else {
  4798. return hooks(era.since).year() + (year - era.offset) * dir;
  4799. }
  4800. }
  4801. function getEraName() {
  4802. var i,
  4803. l,
  4804. val,
  4805. eras = this.localeData().eras();
  4806. for (i = 0, l = eras.length; i < l; ++i) {
  4807. // truncate time
  4808. val = this.startOf('day').valueOf();
  4809. if (eras[i].since <= val && val <= eras[i].until) {
  4810. return eras[i].name;
  4811. }
  4812. if (eras[i].until <= val && val <= eras[i].since) {
  4813. return eras[i].name;
  4814. }
  4815. }
  4816. return '';
  4817. }
  4818. function getEraNarrow() {
  4819. var i,
  4820. l,
  4821. val,
  4822. eras = this.localeData().eras();
  4823. for (i = 0, l = eras.length; i < l; ++i) {
  4824. // truncate time
  4825. val = this.startOf('day').valueOf();
  4826. if (eras[i].since <= val && val <= eras[i].until) {
  4827. return eras[i].narrow;
  4828. }
  4829. if (eras[i].until <= val && val <= eras[i].since) {
  4830. return eras[i].narrow;
  4831. }
  4832. }
  4833. return '';
  4834. }
  4835. function getEraAbbr() {
  4836. var i,
  4837. l,
  4838. val,
  4839. eras = this.localeData().eras();
  4840. for (i = 0, l = eras.length; i < l; ++i) {
  4841. // truncate time
  4842. val = this.startOf('day').valueOf();
  4843. if (eras[i].since <= val && val <= eras[i].until) {
  4844. return eras[i].abbr;
  4845. }
  4846. if (eras[i].until <= val && val <= eras[i].since) {
  4847. return eras[i].abbr;
  4848. }
  4849. }
  4850. return '';
  4851. }
  4852. function getEraYear() {
  4853. var i,
  4854. l,
  4855. dir,
  4856. val,
  4857. eras = this.localeData().eras();
  4858. for (i = 0, l = eras.length; i < l; ++i) {
  4859. dir = eras[i].since <= eras[i].until ? +1 : -1;
  4860. // truncate time
  4861. val = this.startOf('day').valueOf();
  4862. if (
  4863. (eras[i].since <= val && val <= eras[i].until) ||
  4864. (eras[i].until <= val && val <= eras[i].since)
  4865. ) {
  4866. return (
  4867. (this.year() - hooks(eras[i].since).year()) * dir +
  4868. eras[i].offset
  4869. );
  4870. }
  4871. }
  4872. return this.year();
  4873. }
  4874. function erasNameRegex(isStrict) {
  4875. if (!hasOwnProp(this, '_erasNameRegex')) {
  4876. computeErasParse.call(this);
  4877. }
  4878. return isStrict ? this._erasNameRegex : this._erasRegex;
  4879. }
  4880. function erasAbbrRegex(isStrict) {
  4881. if (!hasOwnProp(this, '_erasAbbrRegex')) {
  4882. computeErasParse.call(this);
  4883. }
  4884. return isStrict ? this._erasAbbrRegex : this._erasRegex;
  4885. }
  4886. function erasNarrowRegex(isStrict) {
  4887. if (!hasOwnProp(this, '_erasNarrowRegex')) {
  4888. computeErasParse.call(this);
  4889. }
  4890. return isStrict ? this._erasNarrowRegex : this._erasRegex;
  4891. }
  4892. function matchEraAbbr(isStrict, locale) {
  4893. return locale.erasAbbrRegex(isStrict);
  4894. }
  4895. function matchEraName(isStrict, locale) {
  4896. return locale.erasNameRegex(isStrict);
  4897. }
  4898. function matchEraNarrow(isStrict, locale) {
  4899. return locale.erasNarrowRegex(isStrict);
  4900. }
  4901. function matchEraYearOrdinal(isStrict, locale) {
  4902. return locale._eraYearOrdinalRegex || matchUnsigned;
  4903. }
  4904. function computeErasParse() {
  4905. var abbrPieces = [],
  4906. namePieces = [],
  4907. narrowPieces = [],
  4908. mixedPieces = [],
  4909. i,
  4910. l,
  4911. eras = this.eras();
  4912. for (i = 0, l = eras.length; i < l; ++i) {
  4913. namePieces.push(regexEscape(eras[i].name));
  4914. abbrPieces.push(regexEscape(eras[i].abbr));
  4915. narrowPieces.push(regexEscape(eras[i].narrow));
  4916. mixedPieces.push(regexEscape(eras[i].name));
  4917. mixedPieces.push(regexEscape(eras[i].abbr));
  4918. mixedPieces.push(regexEscape(eras[i].narrow));
  4919. }
  4920. this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  4921. this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
  4922. this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');
  4923. this._erasNarrowRegex = new RegExp(
  4924. '^(' + narrowPieces.join('|') + ')',
  4925. 'i'
  4926. );
  4927. }
  4928. // FORMATTING
  4929. addFormatToken(0, ['gg', 2], 0, function () {
  4930. return this.weekYear() % 100;
  4931. });
  4932. addFormatToken(0, ['GG', 2], 0, function () {
  4933. return this.isoWeekYear() % 100;
  4934. });
  4935. function addWeekYearFormatToken(token, getter) {
  4936. addFormatToken(0, [token, token.length], 0, getter);
  4937. }
  4938. addWeekYearFormatToken('gggg', 'weekYear');
  4939. addWeekYearFormatToken('ggggg', 'weekYear');
  4940. addWeekYearFormatToken('GGGG', 'isoWeekYear');
  4941. addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  4942. // ALIASES
  4943. addUnitAlias('weekYear', 'gg');
  4944. addUnitAlias('isoWeekYear', 'GG');
  4945. // PRIORITY
  4946. addUnitPriority('weekYear', 1);
  4947. addUnitPriority('isoWeekYear', 1);
  4948. // PARSING
  4949. addRegexToken('G', matchSigned);
  4950. addRegexToken('g', matchSigned);
  4951. addRegexToken('GG', match1to2, match2);
  4952. addRegexToken('gg', match1to2, match2);
  4953. addRegexToken('GGGG', match1to4, match4);
  4954. addRegexToken('gggg', match1to4, match4);
  4955. addRegexToken('GGGGG', match1to6, match6);
  4956. addRegexToken('ggggg', match1to6, match6);
  4957. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
  4958. input,
  4959. week,
  4960. config,
  4961. token
  4962. ) {
  4963. week[token.substr(0, 2)] = toInt(input);
  4964. });
  4965. addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  4966. week[token] = hooks.parseTwoDigitYear(input);
  4967. });
  4968. // MOMENTS
  4969. function getSetWeekYear(input) {
  4970. return getSetWeekYearHelper.call(
  4971. this,
  4972. input,
  4973. this.week(),
  4974. this.weekday(),
  4975. this.localeData()._week.dow,
  4976. this.localeData()._week.doy
  4977. );
  4978. }
  4979. function getSetISOWeekYear(input) {
  4980. return getSetWeekYearHelper.call(
  4981. this,
  4982. input,
  4983. this.isoWeek(),
  4984. this.isoWeekday(),
  4985. 1,
  4986. 4
  4987. );
  4988. }
  4989. function getISOWeeksInYear() {
  4990. return weeksInYear(this.year(), 1, 4);
  4991. }
  4992. function getISOWeeksInISOWeekYear() {
  4993. return weeksInYear(this.isoWeekYear(), 1, 4);
  4994. }
  4995. function getWeeksInYear() {
  4996. var weekInfo = this.localeData()._week;
  4997. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  4998. }
  4999. function getWeeksInWeekYear() {
  5000. var weekInfo = this.localeData()._week;
  5001. return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
  5002. }
  5003. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  5004. var weeksTarget;
  5005. if (input == null) {
  5006. return weekOfYear(this, dow, doy).year;
  5007. } else {
  5008. weeksTarget = weeksInYear(input, dow, doy);
  5009. if (week > weeksTarget) {
  5010. week = weeksTarget;
  5011. }
  5012. return setWeekAll.call(this, input, week, weekday, dow, doy);
  5013. }
  5014. }
  5015. function setWeekAll(weekYear, week, weekday, dow, doy) {
  5016. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
  5017. date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  5018. this.year(date.getUTCFullYear());
  5019. this.month(date.getUTCMonth());
  5020. this.date(date.getUTCDate());
  5021. return this;
  5022. }
  5023. // FORMATTING
  5024. addFormatToken('Q', 0, 'Qo', 'quarter');
  5025. // ALIASES
  5026. addUnitAlias('quarter', 'Q');
  5027. // PRIORITY
  5028. addUnitPriority('quarter', 7);
  5029. // PARSING
  5030. addRegexToken('Q', match1);
  5031. addParseToken('Q', function (input, array) {
  5032. array[MONTH] = (toInt(input) - 1) * 3;
  5033. });
  5034. // MOMENTS
  5035. function getSetQuarter(input) {
  5036. return input == null
  5037. ? Math.ceil((this.month() + 1) / 3)
  5038. : this.month((input - 1) * 3 + (this.month() % 3));
  5039. }
  5040. // FORMATTING
  5041. addFormatToken('D', ['DD', 2], 'Do', 'date');
  5042. // ALIASES
  5043. addUnitAlias('date', 'D');
  5044. // PRIORITY
  5045. addUnitPriority('date', 9);
  5046. // PARSING
  5047. addRegexToken('D', match1to2);
  5048. addRegexToken('DD', match1to2, match2);
  5049. addRegexToken('Do', function (isStrict, locale) {
  5050. // TODO: Remove "ordinalParse" fallback in next major release.
  5051. return isStrict
  5052. ? locale._dayOfMonthOrdinalParse || locale._ordinalParse
  5053. : locale._dayOfMonthOrdinalParseLenient;
  5054. });
  5055. addParseToken(['D', 'DD'], DATE);
  5056. addParseToken('Do', function (input, array) {
  5057. array[DATE] = toInt(input.match(match1to2)[0]);
  5058. });
  5059. // MOMENTS
  5060. var getSetDayOfMonth = makeGetSet('Date', true);
  5061. // FORMATTING
  5062. addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  5063. // ALIASES
  5064. addUnitAlias('dayOfYear', 'DDD');
  5065. // PRIORITY
  5066. addUnitPriority('dayOfYear', 4);
  5067. // PARSING
  5068. addRegexToken('DDD', match1to3);
  5069. addRegexToken('DDDD', match3);
  5070. addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  5071. config._dayOfYear = toInt(input);
  5072. });
  5073. // HELPERS
  5074. // MOMENTS
  5075. function getSetDayOfYear(input) {
  5076. var dayOfYear =
  5077. Math.round(
  5078. (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5
  5079. ) + 1;
  5080. return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
  5081. }
  5082. // FORMATTING
  5083. addFormatToken('m', ['mm', 2], 0, 'minute');
  5084. // ALIASES
  5085. addUnitAlias('minute', 'm');
  5086. // PRIORITY
  5087. addUnitPriority('minute', 14);
  5088. // PARSING
  5089. addRegexToken('m', match1to2);
  5090. addRegexToken('mm', match1to2, match2);
  5091. addParseToken(['m', 'mm'], MINUTE);
  5092. // MOMENTS
  5093. var getSetMinute = makeGetSet('Minutes', false);
  5094. // FORMATTING
  5095. addFormatToken('s', ['ss', 2], 0, 'second');
  5096. // ALIASES
  5097. addUnitAlias('second', 's');
  5098. // PRIORITY
  5099. addUnitPriority('second', 15);
  5100. // PARSING
  5101. addRegexToken('s', match1to2);
  5102. addRegexToken('ss', match1to2, match2);
  5103. addParseToken(['s', 'ss'], SECOND);
  5104. // MOMENTS
  5105. var getSetSecond = makeGetSet('Seconds', false);
  5106. // FORMATTING
  5107. addFormatToken('S', 0, 0, function () {
  5108. return ~~(this.millisecond() / 100);
  5109. });
  5110. addFormatToken(0, ['SS', 2], 0, function () {
  5111. return ~~(this.millisecond() / 10);
  5112. });
  5113. addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  5114. addFormatToken(0, ['SSSS', 4], 0, function () {
  5115. return this.millisecond() * 10;
  5116. });
  5117. addFormatToken(0, ['SSSSS', 5], 0, function () {
  5118. return this.millisecond() * 100;
  5119. });
  5120. addFormatToken(0, ['SSSSSS', 6], 0, function () {
  5121. return this.millisecond() * 1000;
  5122. });
  5123. addFormatToken(0, ['SSSSSSS', 7], 0, function () {
  5124. return this.millisecond() * 10000;
  5125. });
  5126. addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
  5127. return this.millisecond() * 100000;
  5128. });
  5129. addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  5130. return this.millisecond() * 1000000;
  5131. });
  5132. // ALIASES
  5133. addUnitAlias('millisecond', 'ms');
  5134. // PRIORITY
  5135. addUnitPriority('millisecond', 16);
  5136. // PARSING
  5137. addRegexToken('S', match1to3, match1);
  5138. addRegexToken('SS', match1to3, match2);
  5139. addRegexToken('SSS', match1to3, match3);
  5140. var token, getSetMillisecond;
  5141. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  5142. addRegexToken(token, matchUnsigned);
  5143. }
  5144. function parseMs(input, array) {
  5145. array[MILLISECOND] = toInt(('0.' + input) * 1000);
  5146. }
  5147. for (token = 'S'; token.length <= 9; token += 'S') {
  5148. addParseToken(token, parseMs);
  5149. }
  5150. getSetMillisecond = makeGetSet('Milliseconds', false);
  5151. // FORMATTING
  5152. addFormatToken('z', 0, 0, 'zoneAbbr');
  5153. addFormatToken('zz', 0, 0, 'zoneName');
  5154. // MOMENTS
  5155. function getZoneAbbr() {
  5156. return this._isUTC ? 'UTC' : '';
  5157. }
  5158. function getZoneName() {
  5159. return this._isUTC ? 'Coordinated Universal Time' : '';
  5160. }
  5161. var proto = Moment.prototype;
  5162. proto.add = add;
  5163. proto.calendar = calendar$1;
  5164. proto.clone = clone;
  5165. proto.diff = diff;
  5166. proto.endOf = endOf;
  5167. proto.format = format;
  5168. proto.from = from;
  5169. proto.fromNow = fromNow;
  5170. proto.to = to;
  5171. proto.toNow = toNow;
  5172. proto.get = stringGet;
  5173. proto.invalidAt = invalidAt;
  5174. proto.isAfter = isAfter;
  5175. proto.isBefore = isBefore;
  5176. proto.isBetween = isBetween;
  5177. proto.isSame = isSame;
  5178. proto.isSameOrAfter = isSameOrAfter;
  5179. proto.isSameOrBefore = isSameOrBefore;
  5180. proto.isValid = isValid$2;
  5181. proto.lang = lang;
  5182. proto.locale = locale;
  5183. proto.localeData = localeData;
  5184. proto.max = prototypeMax;
  5185. proto.min = prototypeMin;
  5186. proto.parsingFlags = parsingFlags;
  5187. proto.set = stringSet;
  5188. proto.startOf = startOf;
  5189. proto.subtract = subtract;
  5190. proto.toArray = toArray;
  5191. proto.toObject = toObject;
  5192. proto.toDate = toDate;
  5193. proto.toISOString = toISOString;
  5194. proto.inspect = inspect;
  5195. if (typeof Symbol !== 'undefined' && Symbol.for != null) {
  5196. proto[Symbol.for('nodejs.util.inspect.custom')] = function () {
  5197. return 'Moment<' + this.format() + '>';
  5198. };
  5199. }
  5200. proto.toJSON = toJSON;
  5201. proto.toString = toString;
  5202. proto.unix = unix;
  5203. proto.valueOf = valueOf;
  5204. proto.creationData = creationData;
  5205. proto.eraName = getEraName;
  5206. proto.eraNarrow = getEraNarrow;
  5207. proto.eraAbbr = getEraAbbr;
  5208. proto.eraYear = getEraYear;
  5209. proto.year = getSetYear;
  5210. proto.isLeapYear = getIsLeapYear;
  5211. proto.weekYear = getSetWeekYear;
  5212. proto.isoWeekYear = getSetISOWeekYear;
  5213. proto.quarter = proto.quarters = getSetQuarter;
  5214. proto.month = getSetMonth;
  5215. proto.daysInMonth = getDaysInMonth;
  5216. proto.week = proto.weeks = getSetWeek;
  5217. proto.isoWeek = proto.isoWeeks = getSetISOWeek;
  5218. proto.weeksInYear = getWeeksInYear;
  5219. proto.weeksInWeekYear = getWeeksInWeekYear;
  5220. proto.isoWeeksInYear = getISOWeeksInYear;
  5221. proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
  5222. proto.date = getSetDayOfMonth;
  5223. proto.day = proto.days = getSetDayOfWeek;
  5224. proto.weekday = getSetLocaleDayOfWeek;
  5225. proto.isoWeekday = getSetISODayOfWeek;
  5226. proto.dayOfYear = getSetDayOfYear;
  5227. proto.hour = proto.hours = getSetHour;
  5228. proto.minute = proto.minutes = getSetMinute;
  5229. proto.second = proto.seconds = getSetSecond;
  5230. proto.millisecond = proto.milliseconds = getSetMillisecond;
  5231. proto.utcOffset = getSetOffset;
  5232. proto.utc = setOffsetToUTC;
  5233. proto.local = setOffsetToLocal;
  5234. proto.parseZone = setOffsetToParsedOffset;
  5235. proto.hasAlignedHourOffset = hasAlignedHourOffset;
  5236. proto.isDST = isDaylightSavingTime;
  5237. proto.isLocal = isLocal;
  5238. proto.isUtcOffset = isUtcOffset;
  5239. proto.isUtc = isUtc;
  5240. proto.isUTC = isUtc;
  5241. proto.zoneAbbr = getZoneAbbr;
  5242. proto.zoneName = getZoneName;
  5243. proto.dates = deprecate(
  5244. 'dates accessor is deprecated. Use date instead.',
  5245. getSetDayOfMonth
  5246. );
  5247. proto.months = deprecate(
  5248. 'months accessor is deprecated. Use month instead',
  5249. getSetMonth
  5250. );
  5251. proto.years = deprecate(
  5252. 'years accessor is deprecated. Use year instead',
  5253. getSetYear
  5254. );
  5255. proto.zone = deprecate(
  5256. 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',
  5257. getSetZone
  5258. );
  5259. proto.isDSTShifted = deprecate(
  5260. 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',
  5261. isDaylightSavingTimeShifted
  5262. );
  5263. function createUnix(input) {
  5264. return createLocal(input * 1000);
  5265. }
  5266. function createInZone() {
  5267. return createLocal.apply(null, arguments).parseZone();
  5268. }
  5269. function preParsePostFormat(string) {
  5270. return string;
  5271. }
  5272. var proto$1 = Locale.prototype;
  5273. proto$1.calendar = calendar;
  5274. proto$1.longDateFormat = longDateFormat;
  5275. proto$1.invalidDate = invalidDate;
  5276. proto$1.ordinal = ordinal;
  5277. proto$1.preparse = preParsePostFormat;
  5278. proto$1.postformat = preParsePostFormat;
  5279. proto$1.relativeTime = relativeTime;
  5280. proto$1.pastFuture = pastFuture;
  5281. proto$1.set = set;
  5282. proto$1.eras = localeEras;
  5283. proto$1.erasParse = localeErasParse;
  5284. proto$1.erasConvertYear = localeErasConvertYear;
  5285. proto$1.erasAbbrRegex = erasAbbrRegex;
  5286. proto$1.erasNameRegex = erasNameRegex;
  5287. proto$1.erasNarrowRegex = erasNarrowRegex;
  5288. proto$1.months = localeMonths;
  5289. proto$1.monthsShort = localeMonthsShort;
  5290. proto$1.monthsParse = localeMonthsParse;
  5291. proto$1.monthsRegex = monthsRegex;
  5292. proto$1.monthsShortRegex = monthsShortRegex;
  5293. proto$1.week = localeWeek;
  5294. proto$1.firstDayOfYear = localeFirstDayOfYear;
  5295. proto$1.firstDayOfWeek = localeFirstDayOfWeek;
  5296. proto$1.weekdays = localeWeekdays;
  5297. proto$1.weekdaysMin = localeWeekdaysMin;
  5298. proto$1.weekdaysShort = localeWeekdaysShort;
  5299. proto$1.weekdaysParse = localeWeekdaysParse;
  5300. proto$1.weekdaysRegex = weekdaysRegex;
  5301. proto$1.weekdaysShortRegex = weekdaysShortRegex;
  5302. proto$1.weekdaysMinRegex = weekdaysMinRegex;
  5303. proto$1.isPM = localeIsPM;
  5304. proto$1.meridiem = localeMeridiem;
  5305. function get$1(format, index, field, setter) {
  5306. var locale = getLocale(),
  5307. utc = createUTC().set(setter, index);
  5308. return locale[field](utc, format);
  5309. }
  5310. function listMonthsImpl(format, index, field) {
  5311. if (isNumber(format)) {
  5312. index = format;
  5313. format = undefined;
  5314. }
  5315. format = format || '';
  5316. if (index != null) {
  5317. return get$1(format, index, field, 'month');
  5318. }
  5319. var i,
  5320. out = [];
  5321. for (i = 0; i < 12; i++) {
  5322. out[i] = get$1(format, i, field, 'month');
  5323. }
  5324. return out;
  5325. }
  5326. // ()
  5327. // (5)
  5328. // (fmt, 5)
  5329. // (fmt)
  5330. // (true)
  5331. // (true, 5)
  5332. // (true, fmt, 5)
  5333. // (true, fmt)
  5334. function listWeekdaysImpl(localeSorted, format, index, field) {
  5335. if (typeof localeSorted === 'boolean') {
  5336. if (isNumber(format)) {
  5337. index = format;
  5338. format = undefined;
  5339. }
  5340. format = format || '';
  5341. } else {
  5342. format = localeSorted;
  5343. index = format;
  5344. localeSorted = false;
  5345. if (isNumber(format)) {
  5346. index = format;
  5347. format = undefined;
  5348. }
  5349. format = format || '';
  5350. }
  5351. var locale = getLocale(),
  5352. shift = localeSorted ? locale._week.dow : 0,
  5353. i,
  5354. out = [];
  5355. if (index != null) {
  5356. return get$1(format, (index + shift) % 7, field, 'day');
  5357. }
  5358. for (i = 0; i < 7; i++) {
  5359. out[i] = get$1(format, (i + shift) % 7, field, 'day');
  5360. }
  5361. return out;
  5362. }
  5363. function listMonths(format, index) {
  5364. return listMonthsImpl(format, index, 'months');
  5365. }
  5366. function listMonthsShort(format, index) {
  5367. return listMonthsImpl(format, index, 'monthsShort');
  5368. }
  5369. function listWeekdays(localeSorted, format, index) {
  5370. return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  5371. }
  5372. function listWeekdaysShort(localeSorted, format, index) {
  5373. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  5374. }
  5375. function listWeekdaysMin(localeSorted, format, index) {
  5376. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  5377. }
  5378. getSetGlobalLocale('en', {
  5379. eras: [
  5380. {
  5381. since: '0001-01-01',
  5382. until: +Infinity,
  5383. offset: 1,
  5384. name: 'Anno Domini',
  5385. narrow: 'AD',
  5386. abbr: 'AD',
  5387. },
  5388. {
  5389. since: '0000-12-31',
  5390. until: -Infinity,
  5391. offset: 1,
  5392. name: 'Before Christ',
  5393. narrow: 'BC',
  5394. abbr: 'BC',
  5395. },
  5396. ],
  5397. dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  5398. ordinal: function (number) {
  5399. var b = number % 10,
  5400. output =
  5401. toInt((number % 100) / 10) === 1
  5402. ? 'th'
  5403. : b === 1
  5404. ? 'st'
  5405. : b === 2
  5406. ? 'nd'
  5407. : b === 3
  5408. ? 'rd'
  5409. : 'th';
  5410. return number + output;
  5411. },
  5412. });
  5413. // Side effect imports
  5414. hooks.lang = deprecate(
  5415. 'moment.lang is deprecated. Use moment.locale instead.',
  5416. getSetGlobalLocale
  5417. );
  5418. hooks.langData = deprecate(
  5419. 'moment.langData is deprecated. Use moment.localeData instead.',
  5420. getLocale
  5421. );
  5422. var mathAbs = Math.abs;
  5423. function abs() {
  5424. var data = this._data;
  5425. this._milliseconds = mathAbs(this._milliseconds);
  5426. this._days = mathAbs(this._days);
  5427. this._months = mathAbs(this._months);
  5428. data.milliseconds = mathAbs(data.milliseconds);
  5429. data.seconds = mathAbs(data.seconds);
  5430. data.minutes = mathAbs(data.minutes);
  5431. data.hours = mathAbs(data.hours);
  5432. data.months = mathAbs(data.months);
  5433. data.years = mathAbs(data.years);
  5434. return this;
  5435. }
  5436. function addSubtract$1(duration, input, value, direction) {
  5437. var other = createDuration(input, value);
  5438. duration._milliseconds += direction * other._milliseconds;
  5439. duration._days += direction * other._days;
  5440. duration._months += direction * other._months;
  5441. return duration._bubble();
  5442. }
  5443. // supports only 2.0-style add(1, 's') or add(duration)
  5444. function add$1(input, value) {
  5445. return addSubtract$1(this, input, value, 1);
  5446. }
  5447. // supports only 2.0-style subtract(1, 's') or subtract(duration)
  5448. function subtract$1(input, value) {
  5449. return addSubtract$1(this, input, value, -1);
  5450. }
  5451. function absCeil(number) {
  5452. if (number < 0) {
  5453. return Math.floor(number);
  5454. } else {
  5455. return Math.ceil(number);
  5456. }
  5457. }
  5458. function bubble() {
  5459. var milliseconds = this._milliseconds,
  5460. days = this._days,
  5461. months = this._months,
  5462. data = this._data,
  5463. seconds,
  5464. minutes,
  5465. hours,
  5466. years,
  5467. monthsFromDays;
  5468. // if we have a mix of positive and negative values, bubble down first
  5469. // check: https://github.com/moment/moment/issues/2166
  5470. if (
  5471. !(
  5472. (milliseconds >= 0 && days >= 0 && months >= 0) ||
  5473. (milliseconds <= 0 && days <= 0 && months <= 0)
  5474. )
  5475. ) {
  5476. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  5477. days = 0;
  5478. months = 0;
  5479. }
  5480. // The following code bubbles up values, see the tests for
  5481. // examples of what that means.
  5482. data.milliseconds = milliseconds % 1000;
  5483. seconds = absFloor(milliseconds / 1000);
  5484. data.seconds = seconds % 60;
  5485. minutes = absFloor(seconds / 60);
  5486. data.minutes = minutes % 60;
  5487. hours = absFloor(minutes / 60);
  5488. data.hours = hours % 24;
  5489. days += absFloor(hours / 24);
  5490. // convert days to months
  5491. monthsFromDays = absFloor(daysToMonths(days));
  5492. months += monthsFromDays;
  5493. days -= absCeil(monthsToDays(monthsFromDays));
  5494. // 12 months -> 1 year
  5495. years = absFloor(months / 12);
  5496. months %= 12;
  5497. data.days = days;
  5498. data.months = months;
  5499. data.years = years;
  5500. return this;
  5501. }
  5502. function daysToMonths(days) {
  5503. // 400 years have 146097 days (taking into account leap year rules)
  5504. // 400 years have 12 months === 4800
  5505. return (days * 4800) / 146097;
  5506. }
  5507. function monthsToDays(months) {
  5508. // the reverse of daysToMonths
  5509. return (months * 146097) / 4800;
  5510. }
  5511. function as(units) {
  5512. if (!this.isValid()) {
  5513. return NaN;
  5514. }
  5515. var days,
  5516. months,
  5517. milliseconds = this._milliseconds;
  5518. units = normalizeUnits(units);
  5519. if (units === 'month' || units === 'quarter' || units === 'year') {
  5520. days = this._days + milliseconds / 864e5;
  5521. months = this._months + daysToMonths(days);
  5522. switch (units) {
  5523. case 'month':
  5524. return months;
  5525. case 'quarter':
  5526. return months / 3;
  5527. case 'year':
  5528. return months / 12;
  5529. }
  5530. } else {
  5531. // handle milliseconds separately because of floating point math errors (issue #1867)
  5532. days = this._days + Math.round(monthsToDays(this._months));
  5533. switch (units) {
  5534. case 'week':
  5535. return days / 7 + milliseconds / 6048e5;
  5536. case 'day':
  5537. return days + milliseconds / 864e5;
  5538. case 'hour':
  5539. return days * 24 + milliseconds / 36e5;
  5540. case 'minute':
  5541. return days * 1440 + milliseconds / 6e4;
  5542. case 'second':
  5543. return days * 86400 + milliseconds / 1000;
  5544. // Math.floor prevents floating point math errors here
  5545. case 'millisecond':
  5546. return Math.floor(days * 864e5) + milliseconds;
  5547. default:
  5548. throw new Error('Unknown unit ' + units);
  5549. }
  5550. }
  5551. }
  5552. // TODO: Use this.as('ms')?
  5553. function valueOf$1() {
  5554. if (!this.isValid()) {
  5555. return NaN;
  5556. }
  5557. return (
  5558. this._milliseconds +
  5559. this._days * 864e5 +
  5560. (this._months % 12) * 2592e6 +
  5561. toInt(this._months / 12) * 31536e6
  5562. );
  5563. }
  5564. function makeAs(alias) {
  5565. return function () {
  5566. return this.as(alias);
  5567. };
  5568. }
  5569. var asMilliseconds = makeAs('ms'),
  5570. asSeconds = makeAs('s'),
  5571. asMinutes = makeAs('m'),
  5572. asHours = makeAs('h'),
  5573. asDays = makeAs('d'),
  5574. asWeeks = makeAs('w'),
  5575. asMonths = makeAs('M'),
  5576. asQuarters = makeAs('Q'),
  5577. asYears = makeAs('y');
  5578. function clone$1() {
  5579. return createDuration(this);
  5580. }
  5581. function get$2(units) {
  5582. units = normalizeUnits(units);
  5583. return this.isValid() ? this[units + 's']() : NaN;
  5584. }
  5585. function makeGetter(name) {
  5586. return function () {
  5587. return this.isValid() ? this._data[name] : NaN;
  5588. };
  5589. }
  5590. var milliseconds = makeGetter('milliseconds'),
  5591. seconds = makeGetter('seconds'),
  5592. minutes = makeGetter('minutes'),
  5593. hours = makeGetter('hours'),
  5594. days = makeGetter('days'),
  5595. months = makeGetter('months'),
  5596. years = makeGetter('years');
  5597. function weeks() {
  5598. return absFloor(this.days() / 7);
  5599. }
  5600. var round = Math.round,
  5601. thresholds = {
  5602. ss: 44, // a few seconds to seconds
  5603. s: 45, // seconds to minute
  5604. m: 45, // minutes to hour
  5605. h: 22, // hours to day
  5606. d: 26, // days to month/week
  5607. w: null, // weeks to month
  5608. M: 11, // months to year
  5609. };
  5610. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  5611. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
  5612. return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  5613. }
  5614. function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {
  5615. var duration = createDuration(posNegDuration).abs(),
  5616. seconds = round(duration.as('s')),
  5617. minutes = round(duration.as('m')),
  5618. hours = round(duration.as('h')),
  5619. days = round(duration.as('d')),
  5620. months = round(duration.as('M')),
  5621. weeks = round(duration.as('w')),
  5622. years = round(duration.as('y')),
  5623. a =
  5624. (seconds <= thresholds.ss && ['s', seconds]) ||
  5625. (seconds < thresholds.s && ['ss', seconds]) ||
  5626. (minutes <= 1 && ['m']) ||
  5627. (minutes < thresholds.m && ['mm', minutes]) ||
  5628. (hours <= 1 && ['h']) ||
  5629. (hours < thresholds.h && ['hh', hours]) ||
  5630. (days <= 1 && ['d']) ||
  5631. (days < thresholds.d && ['dd', days]);
  5632. if (thresholds.w != null) {
  5633. a =
  5634. a ||
  5635. (weeks <= 1 && ['w']) ||
  5636. (weeks < thresholds.w && ['ww', weeks]);
  5637. }
  5638. a = a ||
  5639. (months <= 1 && ['M']) ||
  5640. (months < thresholds.M && ['MM', months]) ||
  5641. (years <= 1 && ['y']) || ['yy', years];
  5642. a[2] = withoutSuffix;
  5643. a[3] = +posNegDuration > 0;
  5644. a[4] = locale;
  5645. return substituteTimeAgo.apply(null, a);
  5646. }
  5647. // This function allows you to set the rounding function for relative time strings
  5648. function getSetRelativeTimeRounding(roundingFunction) {
  5649. if (roundingFunction === undefined) {
  5650. return round;
  5651. }
  5652. if (typeof roundingFunction === 'function') {
  5653. round = roundingFunction;
  5654. return true;
  5655. }
  5656. return false;
  5657. }
  5658. // This function allows you to set a threshold for relative time strings
  5659. function getSetRelativeTimeThreshold(threshold, limit) {
  5660. if (thresholds[threshold] === undefined) {
  5661. return false;
  5662. }
  5663. if (limit === undefined) {
  5664. return thresholds[threshold];
  5665. }
  5666. thresholds[threshold] = limit;
  5667. if (threshold === 's') {
  5668. thresholds.ss = limit - 1;
  5669. }
  5670. return true;
  5671. }
  5672. function humanize(argWithSuffix, argThresholds) {
  5673. if (!this.isValid()) {
  5674. return this.localeData().invalidDate();
  5675. }
  5676. var withSuffix = false,
  5677. th = thresholds,
  5678. locale,
  5679. output;
  5680. if (typeof argWithSuffix === 'object') {
  5681. argThresholds = argWithSuffix;
  5682. argWithSuffix = false;
  5683. }
  5684. if (typeof argWithSuffix === 'boolean') {
  5685. withSuffix = argWithSuffix;
  5686. }
  5687. if (typeof argThresholds === 'object') {
  5688. th = Object.assign({}, thresholds, argThresholds);
  5689. if (argThresholds.s != null && argThresholds.ss == null) {
  5690. th.ss = argThresholds.s - 1;
  5691. }
  5692. }
  5693. locale = this.localeData();
  5694. output = relativeTime$1(this, !withSuffix, th, locale);
  5695. if (withSuffix) {
  5696. output = locale.pastFuture(+this, output);
  5697. }
  5698. return locale.postformat(output);
  5699. }
  5700. var abs$1 = Math.abs;
  5701. function sign(x) {
  5702. return (x > 0) - (x < 0) || +x;
  5703. }
  5704. function toISOString$1() {
  5705. // for ISO strings we do not use the normal bubbling rules:
  5706. // * milliseconds bubble up until they become hours
  5707. // * days do not bubble at all
  5708. // * months bubble up until they become years
  5709. // This is because there is no context-free conversion between hours and days
  5710. // (think of clock changes)
  5711. // and also not between days and months (28-31 days per month)
  5712. if (!this.isValid()) {
  5713. return this.localeData().invalidDate();
  5714. }
  5715. var seconds = abs$1(this._milliseconds) / 1000,
  5716. days = abs$1(this._days),
  5717. months = abs$1(this._months),
  5718. minutes,
  5719. hours,
  5720. years,
  5721. s,
  5722. total = this.asSeconds(),
  5723. totalSign,
  5724. ymSign,
  5725. daysSign,
  5726. hmsSign;
  5727. if (!total) {
  5728. // this is the same as C#'s (Noda) and python (isodate)...
  5729. // but not other JS (goog.date)
  5730. return 'P0D';
  5731. }
  5732. // 3600 seconds -> 60 minutes -> 1 hour
  5733. minutes = absFloor(seconds / 60);
  5734. hours = absFloor(minutes / 60);
  5735. seconds %= 60;
  5736. minutes %= 60;
  5737. // 12 months -> 1 year
  5738. years = absFloor(months / 12);
  5739. months %= 12;
  5740. // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
  5741. s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
  5742. totalSign = total < 0 ? '-' : '';
  5743. ymSign = sign(this._months) !== sign(total) ? '-' : '';
  5744. daysSign = sign(this._days) !== sign(total) ? '-' : '';
  5745. hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
  5746. return (
  5747. totalSign +
  5748. 'P' +
  5749. (years ? ymSign + years + 'Y' : '') +
  5750. (months ? ymSign + months + 'M' : '') +
  5751. (days ? daysSign + days + 'D' : '') +
  5752. (hours || minutes || seconds ? 'T' : '') +
  5753. (hours ? hmsSign + hours + 'H' : '') +
  5754. (minutes ? hmsSign + minutes + 'M' : '') +
  5755. (seconds ? hmsSign + s + 'S' : '')
  5756. );
  5757. }
  5758. var proto$2 = Duration.prototype;
  5759. proto$2.isValid = isValid$1;
  5760. proto$2.abs = abs;
  5761. proto$2.add = add$1;
  5762. proto$2.subtract = subtract$1;
  5763. proto$2.as = as;
  5764. proto$2.asMilliseconds = asMilliseconds;
  5765. proto$2.asSeconds = asSeconds;
  5766. proto$2.asMinutes = asMinutes;
  5767. proto$2.asHours = asHours;
  5768. proto$2.asDays = asDays;
  5769. proto$2.asWeeks = asWeeks;
  5770. proto$2.asMonths = asMonths;
  5771. proto$2.asQuarters = asQuarters;
  5772. proto$2.asYears = asYears;
  5773. proto$2.valueOf = valueOf$1;
  5774. proto$2._bubble = bubble;
  5775. proto$2.clone = clone$1;
  5776. proto$2.get = get$2;
  5777. proto$2.milliseconds = milliseconds;
  5778. proto$2.seconds = seconds;
  5779. proto$2.minutes = minutes;
  5780. proto$2.hours = hours;
  5781. proto$2.days = days;
  5782. proto$2.weeks = weeks;
  5783. proto$2.months = months;
  5784. proto$2.years = years;
  5785. proto$2.humanize = humanize;
  5786. proto$2.toISOString = toISOString$1;
  5787. proto$2.toString = toISOString$1;
  5788. proto$2.toJSON = toISOString$1;
  5789. proto$2.locale = locale;
  5790. proto$2.localeData = localeData;
  5791. proto$2.toIsoString = deprecate(
  5792. 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',
  5793. toISOString$1
  5794. );
  5795. proto$2.lang = lang;
  5796. // FORMATTING
  5797. addFormatToken('X', 0, 0, 'unix');
  5798. addFormatToken('x', 0, 0, 'valueOf');
  5799. // PARSING
  5800. addRegexToken('x', matchSigned);
  5801. addRegexToken('X', matchTimestamp);
  5802. addParseToken('X', function (input, array, config) {
  5803. config._d = new Date(parseFloat(input) * 1000);
  5804. });
  5805. addParseToken('x', function (input, array, config) {
  5806. config._d = new Date(toInt(input));
  5807. });
  5808. //! moment.js
  5809. hooks.version = '2.26.0';
  5810. setHookCallback(createLocal);
  5811. hooks.fn = proto;
  5812. hooks.min = min;
  5813. hooks.max = max;
  5814. hooks.now = now;
  5815. hooks.utc = createUTC;
  5816. hooks.unix = createUnix;
  5817. hooks.months = listMonths;
  5818. hooks.isDate = isDate;
  5819. hooks.locale = getSetGlobalLocale;
  5820. hooks.invalid = createInvalid;
  5821. hooks.duration = createDuration;
  5822. hooks.isMoment = isMoment;
  5823. hooks.weekdays = listWeekdays;
  5824. hooks.parseZone = createInZone;
  5825. hooks.localeData = getLocale;
  5826. hooks.isDuration = isDuration;
  5827. hooks.monthsShort = listMonthsShort;
  5828. hooks.weekdaysMin = listWeekdaysMin;
  5829. hooks.defineLocale = defineLocale;
  5830. hooks.updateLocale = updateLocale;
  5831. hooks.locales = listLocales;
  5832. hooks.weekdaysShort = listWeekdaysShort;
  5833. hooks.normalizeUnits = normalizeUnits;
  5834. hooks.relativeTimeRounding = getSetRelativeTimeRounding;
  5835. hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
  5836. hooks.calendarFormat = getCalendarFormat;
  5837. hooks.prototype = proto;
  5838. // currently HTML5 input type only supports 24-hour formats
  5839. hooks.HTML5_FMT = {
  5840. DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
  5841. DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
  5842. DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
  5843. DATE: 'YYYY-MM-DD', // <input type="date" />
  5844. TIME: 'HH:mm', // <input type="time" />
  5845. TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
  5846. TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
  5847. WEEK: 'GGGG-[W]WW', // <input type="week" />
  5848. MONTH: 'YYYY-MM', // <input type="month" />
  5849. };
  5850. return hooks;
  5851. })));
  5852. define('moment', ['moment/moment'], function (main) { return main; });
  5853. define('frontend',['fast', 'template', 'moment'], function (Fast, Template, Moment) {
  5854. var Frontend = {
  5855. api: Fast.api,
  5856. init: function () {
  5857. var si = {};
  5858. //发送验证码
  5859. $(document).on("click", ".btn-captcha", function (e) {
  5860. var type = $(this).data("type") ? $(this).data("type") : 'mobile';
  5861. var btn = this;
  5862. Frontend.api.sendcaptcha = function (btn, type, data, callback) {
  5863. $(btn).addClass("disabled", true).text("发送中...");
  5864. Frontend.api.ajax({url: $(btn).data("url"), data: data}, function (data, ret) {
  5865. clearInterval(si[type]);
  5866. var seconds = 60;
  5867. si[type] = setInterval(function () {
  5868. seconds--;
  5869. if (seconds <= 0) {
  5870. clearInterval(si);
  5871. $(btn).removeClass("disabled").text("发送验证码");
  5872. } else {
  5873. $(btn).addClass("disabled").text(seconds + "秒后可再次发送");
  5874. }
  5875. }, 1000);
  5876. if (typeof callback == 'function') {
  5877. callback.call(this, data, ret);
  5878. }
  5879. }, function () {
  5880. $(btn).removeClass("disabled").text('发送验证码');
  5881. });
  5882. };
  5883. if (['mobile', 'email'].indexOf(type) > -1) {
  5884. var element = $(this).data("input-id") ? $("#" + $(this).data("input-id")) : $("input[name='" + type + "']", $(this).closest("form"));
  5885. var text = type === 'email' ? '邮箱' : '手机号码';
  5886. if (element.val() === "") {
  5887. Layer.msg(text + "不能为空!");
  5888. element.focus();
  5889. return false;
  5890. } else if (type === 'mobile' && !element.val().match(/^1[3-9]\d{9}$/)) {
  5891. Layer.msg("请输入正确的" + text + "!");
  5892. element.focus();
  5893. return false;
  5894. } else if (type === 'email' && !element.val().match(/^[\w\+\-]+(\.[\w\+\-]+)*@[a-z\d\-]+(\.[a-z\d\-]+)*\.([a-z]{2,4})$/)) {
  5895. Layer.msg("请输入正确的" + text + "!");
  5896. element.focus();
  5897. return false;
  5898. }
  5899. element.isValid(function (v) {
  5900. if (v) {
  5901. var data = {event: $(btn).data("event")};
  5902. data[type] = element.val();
  5903. Frontend.api.sendcaptcha(btn, type, data);
  5904. } else {
  5905. Layer.msg("请确认已经输入了正确的" + text + "!");
  5906. }
  5907. });
  5908. } else {
  5909. var data = {event: $(btn).data("event")};
  5910. Frontend.api.sendcaptcha(btn, type, data, function (data, ret) {
  5911. Layer.open({title: false, area: ["400px", "430px"], content: "<img src='" + data.image + "' width='400' height='400' /><div class='text-center panel-title'>扫一扫关注公众号获取验证码</div>", type: 1});
  5912. });
  5913. }
  5914. return false;
  5915. });
  5916. //tooltip和popover
  5917. if (!('ontouchstart' in document.documentElement)) {
  5918. $('body').tooltip({selector: '[data-toggle="tooltip"]'});
  5919. }
  5920. $('body').popover({selector: '[data-toggle="popover"]'});
  5921. }
  5922. };
  5923. Frontend.api = $.extend(Fast.api, Frontend.api);
  5924. //将Template渲染至全局,以便于在子框架中调用
  5925. window.Template = Template;
  5926. //将Moment渲染至全局,以便于在子框架中调用
  5927. window.Moment = Moment;
  5928. //将Frontend渲染至全局,以便于在子框架中调用
  5929. window.Frontend = Frontend;
  5930. Frontend.init();
  5931. return Frontend;
  5932. });
  5933. define('frontend-init',['frontend'], function (Frontend) {
  5934. });