require-backend.min.js 656 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049
  1. /*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
  2. !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){
  3. return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ia={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qa[0].contentDocument,b.write(),b.close(),c=sa(a,b),qa.detach()),ra[a]=c),c}var ua=/^margin/,va=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wa=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)};function xa(a,b,c){var d,e,f,g,h=a.style;return c=c||wa(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),va.test(g)&&ua.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function ya(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),f.removeChild(c),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var za=/^(none|table(?!-c[ea]).+)/,Aa=new RegExp("^("+Q+")(.*)$","i"),Ba=new RegExp("^([+-])=("+Q+")","i"),Ca={position:"absolute",visibility:"hidden",display:"block"},Da={letterSpacing:"0",fontWeight:"400"},Ea=["Webkit","O","Moz","ms"];function Fa(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Ea.length;while(e--)if(b=Ea[e]+c,b in a)return b;return d}function Ga(a,b,c){var d=Aa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Ha(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ia(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wa(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xa(a,b,f),(0>e||null==e)&&(e=a.style[b]),va.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Ha(a,b,c||(g?"border":"content"),d,f)+"px"}function Ja(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",ta(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xa(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fa(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Ba.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fa(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xa(a,b,d)),"normal"===e&&b in Da&&(e=Da[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?za.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Ca,function(){return Ia(a,b,d)}):Ia(a,b,d):void 0},set:function(a,c,d){var e=d&&wa(a);return Ga(a,c,d?Ha(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=ya(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ua.test(a)||(n.cssHooks[a+b].set=Ga)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wa(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Ja(this,!0)},hide:function(){return Ja(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Ka(a,b,c,d,e){return new Ka.prototype.init(a,b,c,d,e)}n.Tween=Ka,Ka.prototype={constructor:Ka,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ka.propHooks[this.prop];return a&&a.get?a.get(this):Ka.propHooks._default.get(this)},run:function(a){var b,c=Ka.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ka.propHooks._default.set(this),this}},Ka.prototype.init.prototype=Ka.prototype,Ka.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Ka.propHooks.scrollTop=Ka.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Ka.prototype.init,n.fx.step={};var La,Ma,Na=/^(?:toggle|show|hide)$/,Oa=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pa=/queueHooks$/,Qa=[Va],Ra={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Oa.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Oa.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sa(){return setTimeout(function(){La=void 0}),La=n.now()}function Ta(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ua(a,b,c){for(var d,e=(Ra[b]||[]).concat(Ra["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Va(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||ta(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Na.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?ta(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ua(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wa(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xa(a,b,c){var d,e,f=0,g=Qa.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=La||Sa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:La||Sa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wa(k,j.opts.specialEasing);g>f;f++)if(d=Qa[f].call(j,a,k,j.opts))return d;return n.map(k,Ua,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xa,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Ra[c]=Ra[c]||[],Ra[c].unshift(b)},prefilter:function(a,b){b?Qa.unshift(a):Qa.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xa(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pa.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Ta(b,!0),a,d,e)}}),n.each({slideDown:Ta("show"),slideUp:Ta("hide"),slideToggle:Ta("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(La=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),La=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ma||(Ma=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Ma),Ma=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Ya,Za,$a=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Za:Ya)),
  4. void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Za={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$a[b]||n.find.attr;$a[b]=function(a,b,d){var e,f;return d||(f=$a[b],$a[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$a[b]=f),e}});var _a=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_a.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ab=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ab," ").indexOf(b)>=0)return!0;return!1}});var bb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cb=n.now(),db=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var eb=/#.*$/,fb=/([?&])_=[^&]*/,gb=/^(.*?):[ \t]*([^\r\n]*)$/gm,hb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ib=/^(?:GET|HEAD)$/,jb=/^\/\//,kb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lb={},mb={},nb="*/".concat("*"),ob=a.location.href,pb=kb.exec(ob.toLowerCase())||[];function qb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function rb(a,b,c,d){var e={},f=a===mb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function sb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function tb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function ub(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ob,type:"GET",isLocal:hb.test(pb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?sb(sb(a,n.ajaxSettings),b):sb(n.ajaxSettings,a)},ajaxPrefilter:qb(lb),ajaxTransport:qb(mb),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=gb.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||ob)+"").replace(eb,"").replace(jb,pb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=kb.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===pb[1]&&h[2]===pb[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(pb[3]||("http:"===pb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),rb(lb,k,b,v),2===t)return v;i=n.event&&k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!ib.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(db.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=fb.test(d)?d.replace(fb,"$1_="+cb++):d+(db.test(d)?"&":"?")+"_="+cb++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+nb+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=rb(mb,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=tb(k,v,f)),u=ub(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var vb=/%20/g,wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&").replace(vb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bb=0,Cb={},Db={0:200,1223:204},Eb=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Cb)Cb[a]()}),k.cors=!!Eb&&"withCredentials"in Eb,k.ajax=Eb=!!Eb,n.ajaxTransport(function(a){var b;return k.cors||Eb&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cb[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Db[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cb[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Fb=[],Gb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Fb.pop()||n.expando+"_"+cb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Gb.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Gb,"$1"+e):b.jsonp!==!1&&(b.url+=(db.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Fb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Hb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Hb)return Hb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Ib=a.document.documentElement;function Jb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Jb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Ib;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ib})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Jb(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=ya(k.pixelPosition,function(a,c){return c?(c=xa(a,b),va.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Kb=a.jQuery,Lb=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Lb),b&&a.jQuery===n&&(a.jQuery=Kb),n},typeof b===U&&(a.jQuery=a.$=n),n});
  5. //# sourceMappingURL=jquery.min.map;
  6. /*!
  7. * Bootstrap v3.3.7 (http://getbootstrap.com)
  8. * Copyright 2011-2016 Twitter, Inc.
  9. * Licensed under the MIT license
  10. */
  11. if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){d.$element.one("mouseup.dismiss.bs.modal",function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){document===a.target||this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.7",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element&&e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);if(this.$element.trigger(g),!g.isDefaultPrevented())return f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=window.SVGElement&&c instanceof window.SVGElement,g=d?{top:0,left:0}:f?null:b.offset(),h={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},i=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,h,i,g)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){
  12. this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.7",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e<c&&"top";if("bottom"==this.affixed)return null!=c?!(e+this.unpin<=f.top)&&"bottom":!(e+g<=a-d)&&"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&e<=c?"top":null!=d&&i+j>=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
  13. define("bootstrap", ["jquery"], function(){});
  14. define('config',['module'], function (module) {
  15. return module.config();
  16. });
  17. require.config({
  18. urlArgs: "v=" + requirejs.s.contexts._.config.config.config.site.version,
  19. packages: [{
  20. name: 'moment',
  21. location: '../libs/moment',
  22. main: 'moment'
  23. }],
  24. //在打包压缩时将会把include中的模块合并到主文件中
  25. include: ['css', 'layer', 'toastr', 'backend', 'table', 'form', 'dragsort', 'drag', 'drop', 'addtabs'],
  26. paths: {
  27. 'lang': "empty:",
  28. 'config': 'require-config',
  29. 'bootstrap-checkbox': 'bootstrap-checkbox',
  30. 'bootstrap-radio': 'bootstrap-radio',
  31. 'bootstrap-switch': 'bootstrap-switch',
  32. 'form': 'require-form',
  33. 'table': 'require-table',
  34. 'upload': 'require-upload',
  35. 'drag': 'jquery.drag.min',
  36. 'drop': 'jquery.drop.min',
  37. 'echarts-theme': 'echarts-theme',
  38. 'adminlte': 'adminlte',
  39. //
  40. // 以下的包从bower的libs目录加载
  41. 'jquery': '../libs/jquery/dist/jquery.min',
  42. 'bootstrap': '../libs/bootstrap/dist/js/bootstrap.min',
  43. 'bootstrap-validator': '../libs/bootstrap-validator/dist/validator.min',
  44. 'bootstrap-typeahead': '../libs/bootstrap3-typeahead/bootstrap3-typeahead.min',
  45. 'bootstrap-tagsinput': '../libs/bootstrap-tagsinput/dist/bootstrap-tagsinput.min',
  46. 'bootstrap-dialog': '../libs/bootstrap3-dialog/dist/js/bootstrap-dialog.min',
  47. 'bootstrap-datetimepicker': '../libs/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min',
  48. 'bootstrap-select': '../libs/bootstrap-select/dist/js/bootstrap-select.min',
  49. 'bootstrap-table': '../libs/bootstrap-table/dist/bootstrap-table.min',
  50. 'bootstrap-table-export': '../libs/bootstrap-table/dist/extensions/export/bootstrap-table-export.min',
  51. 'bootstrap-table-mobile': '../libs/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile',
  52. 'bootstrap-table-advancedsearch': 'bootstrap-table-advancedsearch',
  53. 'bootstrap-table-lang': '../libs/bootstrap-table/dist/locale/bootstrap-table-zh-CN',
  54. 'typeahead': '../libs/typeahead.js/dist/typeahead.jquery.min',
  55. 'bloodhound': '../libs/typeahead.js/dist/bloodhound.min',
  56. 'tableexport': '../libs/tableExport.jquery.plugin/tableExport.min',
  57. 'dropzone': '../libs/dropzone/dist/min/dropzone-amd-module.min',
  58. 'less': '../libs/less/dist/less.min',
  59. 'dragsort': '../libs/dragsort/jquery.dragsort',
  60. 'sortable': '../libs/Sortable/Sortable.min',
  61. 'addtabs': '../libs/jquery-addtabs/jquery.addtabs',
  62. 'slimscroll': '../libs/jquery-slimscroll/jquery.slimscroll',
  63. 'crontab': '../libs/jqcron/src/jqCron.cn',
  64. 'summernote': '../libs/summernote/dist/lang/summernote-zh-CN.min',
  65. 'validator': '../libs/nice-validator/dist/local/zh-CN',
  66. 'plupload': '../libs/plupload/js/plupload.min',
  67. 'toastr': '../libs/toastr/toastr',
  68. 'jstree': '../libs/jstree/dist/jstree.min',
  69. 'layer': '../libs/layer/src/layer',
  70. 'echarts': '../libs/echarts/dist/echarts.min',
  71. 'cookie': '../libs/jquery.cookie/jquery.cookie',
  72. 'template': '../libs/art-template/dist/template-native',
  73. },
  74. // shim依赖配置
  75. shim: {
  76. 'bootstrap': ['jquery'],
  77. 'bootstrap-table': {
  78. deps: ['bootstrap', 'css!../libs/bootstrap-table/dist/bootstrap-table.min.css'],
  79. exports: '$.fn.bootstrapTable'
  80. },
  81. 'bootstrap-table-lang': {
  82. deps: ['bootstrap-table'],
  83. exports: '$.fn.bootstrapTable.defaults'
  84. },
  85. 'bootstrap-table-export': {
  86. deps: ['bootstrap-table', 'tableexport'],
  87. exports: '$.fn.bootstrapTable.defaults'
  88. },
  89. 'bootstrap-table-mobile': {
  90. deps: ['bootstrap-table'],
  91. exports: '$.fn.bootstrapTable.defaults'
  92. },
  93. 'bootstrap-table-advancedsearch': {
  94. deps: ['bootstrap-table'],
  95. exports: '$.fn.bootstrapTable.defaults'
  96. },
  97. 'tableexport': {
  98. deps: ['jquery'],
  99. exports: '$.fn.extend'
  100. },
  101. 'slimscroll': {
  102. deps: ['jquery'],
  103. exports: '$.fn.extend'
  104. },
  105. 'adminlte': {
  106. deps: ['bootstrap', 'slimscroll'],
  107. exports: '$.AdminLTE'
  108. },
  109. 'typeahead': {
  110. deps: ['jquery'],
  111. init: function ($) {
  112. return require.s.contexts._.registry['typeahead.js'].factory($);
  113. }
  114. },
  115. 'crontab': ['../libs/jqcron/src/jqCron', 'css!../libs/jqcron/src/jqCron.css'],
  116. 'bootstrap-checkbox': ['jquery'],
  117. 'bootstrap-radio': ['jquery'],
  118. 'bootstrap-switch': ['jquery'],
  119. 'bootstrap-dialog': ['css!../libs/bootstrap3-dialog/dist/css/bootstrap-dialog.min.css'],
  120. 'bootstrap-datetimepicker': [
  121. 'css!../libs/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css',
  122. 'moment/locale/zh-cn'
  123. ],
  124. 'bootstrap-tagsinput': [
  125. 'css!../libs/bootstrap-tagsinput/dist/bootstrap-tagsinput-typeahead.css',
  126. 'css!../libs/bootstrap-tagsinput/dist/bootstrap-tagsinput.css',
  127. 'jquery',
  128. 'typeahead'
  129. ],
  130. 'bootstrap-select': ['css!../libs/bootstrap-select/dist/css/bootstrap-select.min.css', ],
  131. 'summernote': ['../libs/summernote/dist/summernote.min', 'css!../libs/summernote/dist/summernote.css'],
  132. // 'toastr': ['css!../libs/toastr/toastr.min.css'],
  133. 'jstree': ['css!../libs/jstree/dist/themes/default/style.css', ],
  134. 'plupload': {
  135. deps: [
  136. '../libs/plupload/js/moxie.min'
  137. ],
  138. exports: "plupload"
  139. },
  140. // 'layer': ['css!../libs/layer/build/skin/default/layer.css'],
  141. validator: {
  142. deps: ['../libs/nice-validator/dist/jquery.validator', 'css!../libs/nice-validator/dist/jquery.validator.css']
  143. }
  144. },
  145. baseUrl: requirejs.s.contexts._.config.config.config.site.cdnurl + '/assets/js/', //资源基础路径
  146. map: {
  147. '*': {
  148. 'css': '../libs/require-css/css.min'
  149. }
  150. },
  151. charset: 'utf-8' // 文件编码
  152. });
  153. require(['jquery', 'bootstrap', 'config'], function ($, undefined, Config) {
  154. // 配置语言包的路径
  155. var paths = {};
  156. paths['lang'] = Config.moduleurl + '/ajax/lang?callback=define&controllername=' + Config.controllername;
  157. // 避免目录冲突
  158. paths['backend/'] = 'backend/';
  159. require.config({paths: paths});
  160. // 初始化
  161. $(function () {
  162. require(['backend'], function (Module) {
  163. // 对相对地址进行处理
  164. $.ajaxSetup({
  165. beforeSend: function (xhr, setting) {
  166. setting.url = Module.api.fixurl(setting.url);
  167. }
  168. });
  169. // 绑定ESC关闭窗口事件
  170. $(window).keyup(function (e) {
  171. if (e.keyCode == 27) {
  172. if ($(".layui-layer").size() > 0) {
  173. var index = 0;
  174. $(".layui-layer").each(function () {
  175. index = Math.max(index, parseInt($(this).attr("times")));
  176. });
  177. if (index) {
  178. Module.api.layer.close(index);
  179. }
  180. }
  181. }
  182. });
  183. //加载相应模块
  184. require([Config.jsname], function (Controller) {
  185. Controller[Config.actionname] != undefined && Controller[Config.actionname]();
  186. }, function (e) {
  187. // 这里可捕获模块加载的错误
  188. });
  189. });
  190. });
  191. });
  192. define("require-backend", function(){});
  193. define('../libs/require-css/css.min',[],function(){if("undefined"==typeof window)return{load:function(e,t,n){n()}};var e=document.getElementsByTagName("head")[0],t=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)|AndroidWebKit\/([^ ;]*)/)||0,n=!1,r=!0;t[1]||t[7]?n=parseInt(t[1])<6||parseInt(t[7])<=9:t[2]||t[8]?r=!1:t[4]&&(n=parseInt(t[4])<18);var o={};o.pluginBuilder="./css-builder";var a,i,s,l=function(){a=document.createElement("style"),e.appendChild(a),i=a.styleSheet||a.sheet},u=0,d=[],c=function(e){u++,32==u&&(l(),u=0),i.addImport(e),a.onload=function(){f()}},f=function(){s();var e=d.shift();return e?(s=e[1],void c(e[0])):void(s=null)},h=function(e,t){if(i&&i.addImport||l(),i&&i.addImport)s?d.push([e,t]):(c(e),s=t);else{a.textContent='@import "'+e+'";';var n=setInterval(function(){try{a.sheet.cssRules,clearInterval(n),t()}catch(e){}},10)}},p=function(t,n){var o=document.createElement("link");if(o.type="text/css",o.rel="stylesheet",r)o.onload=function(){o.onload=function(){},setTimeout(n,7)};else var a=setInterval(function(){for(var e=0;e<document.styleSheets.length;e++){var t=document.styleSheets[e];if(t.href==o.href)return clearInterval(a),n()}},10);o.href=t,e.appendChild(o)};return o.normalize=function(e,t){return".css"==e.substr(e.length-4,4)&&(e=e.substr(0,e.length-4)),t(e)},o.load=function(e,t,r){(n?h:p)(t.toUrl(e+".css"),r)},o});
  194. /**
  195. @Name:layer v3.0.1 Web弹层组件
  196. @Author:贤心
  197. @Site:http://layer.layui.com
  198. @License:LGPL
  199. */
  200. ;!function(window, undefined){
  201. "use strict";
  202. var isLayui = window.layui && layui.define, $, win, ready = {
  203. getPath: function(){
  204. var js = document.scripts, script = js[js.length - 1], jsPath = script.src;
  205. if(script.getAttribute('merge')) return;
  206. return jsPath.substring(0, jsPath.lastIndexOf("/") + 1);
  207. }(),
  208. config: {}, end: {}, minIndex: 0, minLeft: [],
  209. btn: ['&#x786E;&#x5B9A;', '&#x53D6;&#x6D88;'],
  210. //五种原始层模式
  211. type: ['dialog', 'page', 'iframe', 'loading', 'tips']
  212. };
  213. //默认内置方法。
  214. var layer = {
  215. v: '3.0.1',
  216. ie: function(){ //ie版本
  217. var agent = navigator.userAgent.toLowerCase();
  218. return (!!window.ActiveXObject || "ActiveXObject" in window) ? (
  219. (agent.match(/msie\s(\d+)/) || [])[1] || '11' //由于ie11并没有msie的标识
  220. ) : false;
  221. }(),
  222. index: (window.layer && window.layer.v) ? 100000 : 0,
  223. path: ready.getPath,
  224. config: function(options, fn){
  225. options = options || {};
  226. layer.cache = ready.config = $.extend({}, ready.config, options);
  227. layer.path = ready.config.path || layer.path;
  228. typeof options.extend === 'string' && (options.extend = [options.extend]);
  229. if(ready.config.path) layer.ready();
  230. if(!options.extend) return this;
  231. isLayui
  232. ? layui.addcss('modules/layer/' + options.extend)
  233. : layer.link('skin/' + options.extend);
  234. return this;
  235. },
  236. //载入CSS配件
  237. link: function(href, fn, cssname){
  238. //未设置路径,则不主动加载css
  239. if(!layer.path) return;
  240. var head = $('head')[0], link = document.createElement('link');
  241. if(typeof fn === 'string') cssname = fn;
  242. var app = (cssname || href).replace(/\.|\//g, '');
  243. var id = 'layuicss-'+app, timeout = 0;
  244. link.rel = 'stylesheet';
  245. link.href = layer.path + href;
  246. link.id = id;
  247. if(!$('#'+ id)[0]){
  248. head.appendChild(link);
  249. }
  250. if(typeof fn !== 'function') return;
  251. //轮询css是否加载完毕
  252. (function poll() {
  253. if(++timeout > 8 * 1000 / 100){
  254. return window.console && console.error('layer.css: Invalid');
  255. };
  256. parseInt($('#'+id).css('width')) === 1989 ? fn() : setTimeout(poll, 100);
  257. }());
  258. },
  259. ready: function(callback){
  260. var cssname = 'skinlayercss', ver = '1110';
  261. isLayui ? layui.addcss('modules/layer/default/layer.css?v='+layer.v+ver, callback, cssname)
  262. : layer.link('skin/default/layer.css?v='+layer.v+ver, callback, cssname);
  263. return this;
  264. },
  265. //各种快捷引用
  266. alert: function(content, options, yes){
  267. var type = typeof options === 'function';
  268. if(type) yes = options;
  269. return layer.open($.extend({
  270. content: content,
  271. yes: yes
  272. }, type ? {} : options));
  273. },
  274. confirm: function(content, options, yes, cancel){
  275. var type = typeof options === 'function';
  276. if(type){
  277. cancel = yes;
  278. yes = options;
  279. }
  280. return layer.open($.extend({
  281. content: content,
  282. btn: ready.btn,
  283. yes: yes,
  284. btn2: cancel
  285. }, type ? {} : options));
  286. },
  287. msg: function(content, options, end){ //最常用提示层
  288. var type = typeof options === 'function', rskin = ready.config.skin;
  289. var skin = (rskin ? rskin + ' ' + rskin + '-msg' : '')||'layui-layer-msg';
  290. var anim = doms.anim.length - 1;
  291. if(type) end = options;
  292. return layer.open($.extend({
  293. content: content,
  294. time: 3000,
  295. shade: false,
  296. skin: skin,
  297. title: false,
  298. closeBtn: false,
  299. btn: false,
  300. resize: false,
  301. end: end
  302. }, (type && !ready.config.skin) ? {
  303. skin: skin + ' layui-layer-hui',
  304. anim: anim
  305. } : function(){
  306. options = options || {};
  307. if(options.icon === -1 || options.icon === undefined && !ready.config.skin){
  308. options.skin = skin + ' ' + (options.skin||'layui-layer-hui');
  309. }
  310. return options;
  311. }()));
  312. },
  313. load: function(icon, options){
  314. return layer.open($.extend({
  315. type: 3,
  316. icon: icon || 0,
  317. resize: false,
  318. shade: 0.01
  319. }, options));
  320. },
  321. tips: function(content, follow, options){
  322. return layer.open($.extend({
  323. type: 4,
  324. content: [content, follow],
  325. closeBtn: false,
  326. time: 3000,
  327. shade: false,
  328. resize: false,
  329. fixed: false,
  330. maxWidth: 210
  331. }, options));
  332. }
  333. };
  334. var Class = function(setings){
  335. var that = this;
  336. that.index = ++layer.index;
  337. that.config = $.extend({}, that.config, ready.config, setings);
  338. document.body ? that.creat() : setTimeout(function(){
  339. that.creat();
  340. }, 50);
  341. };
  342. Class.pt = Class.prototype;
  343. //缓存常用字符
  344. var doms = ['layui-layer', '.layui-layer-title', '.layui-layer-main', '.layui-layer-dialog', 'layui-layer-iframe', 'layui-layer-content', 'layui-layer-btn', 'layui-layer-close'];
  345. doms.anim = ['layer-anim', 'layer-anim-01', 'layer-anim-02', 'layer-anim-03', 'layer-anim-04', 'layer-anim-05', 'layer-anim-06'];
  346. //默认配置
  347. Class.pt.config = {
  348. type: 0,
  349. shade: 0.3,
  350. fixed: true,
  351. move: doms[1],
  352. title: '&#x4FE1;&#x606F;',
  353. offset: 'auto',
  354. area: 'auto',
  355. closeBtn: 1,
  356. time: 0, //0表示不自动关闭
  357. zIndex: 19891014,
  358. maxWidth: 360,
  359. anim: 0,
  360. icon: -1,
  361. moveType: 1,
  362. resize: true,
  363. scrollbar: true, //是否允许浏览器滚动条
  364. tips: 2
  365. };
  366. //容器
  367. Class.pt.vessel = function(conType, callback){
  368. var that = this, times = that.index, config = that.config;
  369. var zIndex = config.zIndex + times, titype = typeof config.title === 'object';
  370. var ismax = config.maxmin && (config.type === 1 || config.type === 2);
  371. var titleHTML = (config.title ? '<div class="layui-layer-title" style="'+ (titype ? config.title[1] : '') +'">'
  372. + (titype ? config.title[0] : config.title)
  373. + '</div>' : '');
  374. config.zIndex = zIndex;
  375. callback([
  376. //遮罩
  377. config.shade ? ('<div class="layui-layer-shade" id="layui-layer-shade'+ times +'" times="'+ times +'" style="'+ ('z-index:'+ (zIndex-1) +'; background-color:'+ (config.shade[1]||'#000') +'; opacity:'+ (config.shade[0]||config.shade) +'; filter:alpha(opacity='+ (config.shade[0]*100||config.shade*100) +');') +'"></div>') : '',
  378. //主体
  379. '<div class="'+ doms[0] + (' layui-layer-'+ready.type[config.type]) + (((config.type == 0 || config.type == 2) && !config.shade) ? ' layui-layer-border' : '') + ' ' + (config.skin||'') +'" id="'+ doms[0] + times +'" type="'+ ready.type[config.type] +'" times="'+ times +'" showtime="'+ config.time +'" conType="'+ (conType ? 'object' : 'string') +'" style="z-index: '+ zIndex +'; width:'+ config.area[0] + ';height:' + config.area[1] + (config.fixed ? '' : ';position:absolute;') +'">'
  380. + (conType && config.type != 2 ? '' : titleHTML)
  381. + '<div id="'+ (config.id||'') +'" class="layui-layer-content'+ ((config.type == 0 && config.icon !== -1) ? ' layui-layer-padding' :'') + (config.type == 3 ? ' layui-layer-loading'+config.icon : '') +'">'
  382. + (config.type == 0 && config.icon !== -1 ? '<i class="layui-layer-ico layui-layer-ico'+ config.icon +'"></i>' : '')
  383. + (config.type == 1 && conType ? '' : (config.content||''))
  384. + '</div>'
  385. + '<span class="layui-layer-setwin">'+ function(){
  386. var closebtn = ismax ? '<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>' : '';
  387. config.closeBtn && (closebtn += '<a class="layui-layer-ico '+ doms[7] +' '+ doms[7] + (config.title ? config.closeBtn : (config.type == 4 ? '1' : '2')) +'" href="javascript:;"></a>');
  388. return closebtn;
  389. }() + '</span>'
  390. + (config.btn ? function(){
  391. var button = '';
  392. typeof config.btn === 'string' && (config.btn = [config.btn]);
  393. for(var i = 0, len = config.btn.length; i < len; i++){
  394. button += '<a class="'+ doms[6] +''+ i +'">'+ config.btn[i] +'</a>'
  395. }
  396. return '<div class="'+ doms[6] +' layui-layer-btn-'+ (config.btnAlign||'') +'">'+ button +'</div>'
  397. }() : '')
  398. + (config.resize ? '<span class="layui-layer-resize"></span>' : '')
  399. + '</div>'
  400. ], titleHTML, $('<div class="layui-layer-move"></div>'));
  401. return that;
  402. };
  403. //创建骨架
  404. Class.pt.creat = function(){
  405. var that = this
  406. ,config = that.config
  407. ,times = that.index, nodeIndex
  408. ,content = config.content
  409. ,conType = typeof content === 'object'
  410. ,body = $('body');
  411. if($('#'+config.id)[0]) return;
  412. if(typeof config.area === 'string'){
  413. config.area = config.area === 'auto' ? ['', ''] : [config.area, ''];
  414. }
  415. //anim兼容旧版shift
  416. if(config.shift){
  417. config.anim = config.shift;
  418. }
  419. if(layer.ie == 6){
  420. config.fixed = false;
  421. }
  422. switch(config.type){
  423. case 0:
  424. config.btn = ('btn' in config) ? config.btn : ready.btn[0];
  425. layer.closeAll('dialog');
  426. break;
  427. case 2:
  428. var content = config.content = conType ? config.content : [config.content||'http://layer.layui.com', 'auto'];
  429. config.content = '<iframe scrolling="'+ (config.content[1]||'auto') +'" allowtransparency="true" id="'+ doms[4] +''+ times +'" name="'+ doms[4] +''+ times +'" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="' + config.content[0] + '"></iframe>';
  430. break;
  431. case 3:
  432. delete config.title;
  433. delete config.closeBtn;
  434. config.icon === -1 && (config.icon === 0);
  435. layer.closeAll('loading');
  436. break;
  437. case 4:
  438. conType || (config.content = [config.content, 'body']);
  439. config.follow = config.content[1];
  440. config.content = config.content[0] + '<i class="layui-layer-TipsG"></i>';
  441. delete config.title;
  442. config.tips = typeof config.tips === 'object' ? config.tips : [config.tips, true];
  443. config.tipsMore || layer.closeAll('tips');
  444. break;
  445. }
  446. //建立容器
  447. that.vessel(conType, function(html, titleHTML, moveElem){
  448. body.append(html[0]);
  449. conType ? function(){
  450. (config.type == 2 || config.type == 4) ? function(){
  451. $('body').append(html[1]);
  452. }() : function(){
  453. if(!content.parents('.'+doms[0])[0]){
  454. content.data('display', content.css('display')).show().addClass('layui-layer-wrap').wrap(html[1]);
  455. $('#'+ doms[0] + times).find('.'+doms[5]).before(titleHTML);
  456. }
  457. }();
  458. }() : body.append(html[1]);
  459. $('.layui-layer-move')[0] || body.append(ready.moveElem = moveElem);
  460. that.layero = $('#'+ doms[0] + times);
  461. config.scrollbar || doms.html.css('overflow', 'hidden').attr('layer-full', times);
  462. }).auto(times);
  463. config.type == 2 && layer.ie == 6 && that.layero.find('iframe').attr('src', content[0]);
  464. //坐标自适应浏览器窗口尺寸
  465. config.type == 4 ? that.tips() : that.offset();
  466. if(config.fixed){
  467. win.on('resize', function(){
  468. that.offset();
  469. (/^\d+%$/.test(config.area[0]) || /^\d+%$/.test(config.area[1])) && that.auto(times);
  470. config.type == 4 && that.tips();
  471. });
  472. }
  473. config.time <= 0 || setTimeout(function(){
  474. layer.close(that.index)
  475. }, config.time);
  476. that.move().callback();
  477. //为兼容jQuery3.0的css动画影响元素尺寸计算
  478. if(doms.anim[config.anim]){
  479. that.layero.addClass(doms.anim[config.anim]).data('anim', true);
  480. };
  481. };
  482. //自适应
  483. Class.pt.auto = function(index){
  484. var that = this, config = that.config, layero = $('#'+ doms[0] + index);
  485. if(config.area[0] === '' && config.maxWidth > 0){
  486. //为了修复IE7下一个让人难以理解的bug
  487. if(layer.ie && layer.ie < 8 && config.btn){
  488. layero.width(layero.innerWidth());
  489. }
  490. layero.outerWidth() > config.maxWidth && layero.width(config.maxWidth);
  491. }
  492. var area = [layero.innerWidth(), layero.innerHeight()];
  493. var titHeight = layero.find(doms[1]).outerHeight() || 0;
  494. var btnHeight = layero.find('.'+doms[6]).outerHeight() || 0;
  495. function setHeight(elem){
  496. elem = layero.find(elem);
  497. elem.height(area[1] - titHeight - btnHeight - 2*(parseFloat(elem.css('padding'))|0));
  498. }
  499. switch(config.type){
  500. case 2:
  501. setHeight('iframe');
  502. break;
  503. default:
  504. if(config.area[1] === ''){
  505. if(config.fixed && area[1] >= win.height()){
  506. area[1] = win.height();
  507. setHeight('.'+doms[5]);
  508. }
  509. } else {
  510. setHeight('.'+doms[5]);
  511. }
  512. break;
  513. }
  514. return that;
  515. };
  516. //计算坐标
  517. Class.pt.offset = function(){
  518. var that = this, config = that.config, layero = that.layero;
  519. var area = [layero.outerWidth(), layero.outerHeight()];
  520. var type = typeof config.offset === 'object';
  521. that.offsetTop = (win.height() - area[1])/2;
  522. that.offsetLeft = (win.width() - area[0])/2;
  523. if(type){
  524. that.offsetTop = config.offset[0];
  525. that.offsetLeft = config.offset[1]||that.offsetLeft;
  526. } else if(config.offset !== 'auto'){
  527. if(config.offset === 't'){ //上
  528. that.offsetTop = 0;
  529. } else if(config.offset === 'r'){ //右
  530. that.offsetLeft = win.width() - area[0];
  531. } else if(config.offset === 'b'){ //下
  532. that.offsetTop = win.height() - area[1];
  533. } else if(config.offset === 'l'){ //左
  534. that.offsetLeft = 0;
  535. } else if(config.offset === 'lt'){ //左上角
  536. that.offsetTop = 0;
  537. that.offsetLeft = 0;
  538. } else if(config.offset === 'lb'){ //左下角
  539. that.offsetTop = win.height() - area[1];
  540. that.offsetLeft = 0;
  541. } else if(config.offset === 'rt'){ //右上角
  542. that.offsetTop = 0;
  543. that.offsetLeft = win.width() - area[0];
  544. } else if(config.offset === 'rb'){ //右下角
  545. that.offsetTop = win.height() - area[1];
  546. that.offsetLeft = win.width() - area[0];
  547. } else {
  548. that.offsetTop = config.offset;
  549. }
  550. }
  551. if(!config.fixed){
  552. that.offsetTop = /%$/.test(that.offsetTop) ?
  553. win.height()*parseFloat(that.offsetTop)/100
  554. : parseFloat(that.offsetTop);
  555. that.offsetLeft = /%$/.test(that.offsetLeft) ?
  556. win.width()*parseFloat(that.offsetLeft)/100
  557. : parseFloat(that.offsetLeft);
  558. that.offsetTop += win.scrollTop();
  559. that.offsetLeft += win.scrollLeft();
  560. }
  561. if(layero.attr('minLeft')){
  562. that.offsetTop = win.height() - (layero.find(doms[1]).outerHeight() || 0);
  563. that.offsetLeft = layero.css('left');
  564. }
  565. layero.css({top: that.offsetTop, left: that.offsetLeft});
  566. };
  567. //Tips
  568. Class.pt.tips = function(){
  569. var that = this, config = that.config, layero = that.layero;
  570. var layArea = [layero.outerWidth(), layero.outerHeight()], follow = $(config.follow);
  571. if(!follow[0]) follow = $('body');
  572. var goal = {
  573. width: follow.outerWidth(),
  574. height: follow.outerHeight(),
  575. top: follow.offset().top,
  576. left: follow.offset().left
  577. }, tipsG = layero.find('.layui-layer-TipsG');
  578. var guide = config.tips[0];
  579. config.tips[1] || tipsG.remove();
  580. goal.autoLeft = function(){
  581. if(goal.left + layArea[0] - win.width() > 0){
  582. goal.tipLeft = goal.left + goal.width - layArea[0];
  583. tipsG.css({right: 12, left: 'auto'});
  584. } else {
  585. goal.tipLeft = goal.left;
  586. };
  587. };
  588. //辨别tips的方位
  589. goal.where = [function(){ //上
  590. goal.autoLeft();
  591. goal.tipTop = goal.top - layArea[1] - 10;
  592. tipsG.removeClass('layui-layer-TipsB').addClass('layui-layer-TipsT').css('border-right-color', config.tips[1]);
  593. }, function(){ //右
  594. goal.tipLeft = goal.left + goal.width + 10;
  595. goal.tipTop = goal.top;
  596. tipsG.removeClass('layui-layer-TipsL').addClass('layui-layer-TipsR').css('border-bottom-color', config.tips[1]);
  597. }, function(){ //下
  598. goal.autoLeft();
  599. goal.tipTop = goal.top + goal.height + 10;
  600. tipsG.removeClass('layui-layer-TipsT').addClass('layui-layer-TipsB').css('border-right-color', config.tips[1]);
  601. }, function(){ //左
  602. goal.tipLeft = goal.left - layArea[0] - 10;
  603. goal.tipTop = goal.top;
  604. tipsG.removeClass('layui-layer-TipsR').addClass('layui-layer-TipsL').css('border-bottom-color', config.tips[1]);
  605. }];
  606. goal.where[guide-1]();
  607. /* 8*2为小三角形占据的空间 */
  608. if(guide === 1){
  609. goal.top - (win.scrollTop() + layArea[1] + 8*2) < 0 && goal.where[2]();
  610. } else if(guide === 2){
  611. win.width() - (goal.left + goal.width + layArea[0] + 8*2) > 0 || goal.where[3]()
  612. } else if(guide === 3){
  613. (goal.top - win.scrollTop() + goal.height + layArea[1] + 8*2) - win.height() > 0 && goal.where[0]();
  614. } else if(guide === 4){
  615. layArea[0] + 8*2 - goal.left > 0 && goal.where[1]()
  616. }
  617. layero.find('.'+doms[5]).css({
  618. 'background-color': config.tips[1],
  619. 'padding-right': (config.closeBtn ? '30px' : '')
  620. });
  621. layero.css({
  622. left: goal.tipLeft - (config.fixed ? win.scrollLeft() : 0),
  623. top: goal.tipTop - (config.fixed ? win.scrollTop() : 0)
  624. });
  625. }
  626. //拖拽层
  627. Class.pt.move = function(){
  628. var that = this
  629. ,config = that.config
  630. ,_DOC = $(document)
  631. ,layero = that.layero
  632. ,moveElem = layero.find(config.move)
  633. ,resizeElem = layero.find('.layui-layer-resize')
  634. ,dict = {};
  635. if(config.move){
  636. moveElem.css('cursor', 'move');
  637. }
  638. moveElem.on('mousedown', function(e){
  639. e.preventDefault();
  640. if(config.move){
  641. dict.moveStart = true;
  642. dict.offset = [
  643. e.clientX - parseFloat(layero.css('left'))
  644. ,e.clientY - parseFloat(layero.css('top'))
  645. ];
  646. ready.moveElem.css('cursor', 'move').show();
  647. }
  648. });
  649. resizeElem.on('mousedown', function(e){
  650. e.preventDefault();
  651. dict.resizeStart = true;
  652. dict.offset = [e.clientX, e.clientY];
  653. dict.area = [
  654. layero.outerWidth()
  655. ,layero.outerHeight()
  656. ];
  657. ready.moveElem.css('cursor', 'se-resize').show();
  658. });
  659. _DOC.on('mousemove', function(e){
  660. //拖拽移动
  661. if(dict.moveStart){
  662. var X = e.clientX - dict.offset[0]
  663. ,Y = e.clientY - dict.offset[1]
  664. ,fixed = layero.css('position') === 'fixed';
  665. e.preventDefault();
  666. dict.stX = fixed ? 0 : win.scrollLeft();
  667. dict.stY = fixed ? 0 : win.scrollTop();
  668. //控制元素不被拖出窗口外
  669. if(!config.moveOut){
  670. var setRig = win.width() - layero.outerWidth() + dict.stX
  671. ,setBot = win.height() - layero.outerHeight() + dict.stY;
  672. X < dict.stX && (X = dict.stX);
  673. X > setRig && (X = setRig);
  674. Y < dict.stY && (Y = dict.stY);
  675. Y > setBot && (Y = setBot);
  676. }
  677. layero.css({
  678. left: X
  679. ,top: Y
  680. });
  681. }
  682. //Resize
  683. if(config.resize && dict.resizeStart){
  684. var X = e.clientX - dict.offset[0]
  685. ,Y = e.clientY - dict.offset[1];
  686. e.preventDefault();
  687. layer.style(that.index, {
  688. width: dict.area[0] + X
  689. ,height: dict.area[1] + Y
  690. })
  691. dict.isResize = true;
  692. }
  693. }).on('mouseup', function(e){
  694. if(dict.moveStart){
  695. delete dict.moveStart;
  696. ready.moveElem.hide();
  697. config.moveEnd && config.moveEnd();
  698. }
  699. if(dict.resizeStart){
  700. delete dict.resizeStart;
  701. ready.moveElem.hide();
  702. }
  703. });
  704. return that;
  705. };
  706. Class.pt.callback = function(){
  707. var that = this, layero = that.layero, config = that.config;
  708. that.openLayer();
  709. if(config.success){
  710. if(config.type == 2){
  711. layero.find('iframe').on('load', function(){
  712. config.success(layero, that.index);
  713. });
  714. } else {
  715. config.success(layero, that.index);
  716. }
  717. }
  718. layer.ie == 6 && that.IE6(layero);
  719. //按钮
  720. layero.find('.'+ doms[6]).children('a').on('click', function(){
  721. var index = $(this).index();
  722. if(index === 0){
  723. if(config.yes){
  724. config.yes(that.index, layero)
  725. } else if(config['btn1']){
  726. config['btn1'](that.index, layero)
  727. } else {
  728. layer.close(that.index);
  729. }
  730. } else {
  731. var close = config['btn'+(index+1)] && config['btn'+(index+1)](that.index, layero);
  732. close === false || layer.close(that.index);
  733. }
  734. });
  735. //取消
  736. function cancel(){
  737. var close = config.cancel && config.cancel(that.index, layero);
  738. close === false || layer.close(that.index);
  739. }
  740. //右上角关闭回调
  741. layero.find('.'+ doms[7]).on('click', cancel);
  742. //点遮罩关闭
  743. if(config.shadeClose){
  744. $('#layui-layer-shade'+ that.index).on('click', function(){
  745. layer.close(that.index);
  746. });
  747. }
  748. //最小化
  749. layero.find('.layui-layer-min').on('click', function(){
  750. var min = config.min && config.min(layero);
  751. min === false || layer.min(that.index, config);
  752. });
  753. //全屏/还原
  754. layero.find('.layui-layer-max').on('click', function(){
  755. if($(this).hasClass('layui-layer-maxmin')){
  756. layer.restore(that.index);
  757. config.restore && config.restore(layero);
  758. } else {
  759. layer.full(that.index, config);
  760. setTimeout(function(){
  761. config.full && config.full(layero);
  762. }, 100);
  763. }
  764. });
  765. config.end && (ready.end[that.index] = config.end);
  766. };
  767. //for ie6 恢复select
  768. ready.reselect = function(){
  769. $.each($('select'), function(index , value){
  770. var sthis = $(this);
  771. if(!sthis.parents('.'+doms[0])[0]){
  772. (sthis.attr('layer') == 1 && $('.'+doms[0]).length < 1) && sthis.removeAttr('layer').show();
  773. }
  774. sthis = null;
  775. });
  776. };
  777. Class.pt.IE6 = function(layero){
  778. //隐藏select
  779. $('select').each(function(index , value){
  780. var sthis = $(this);
  781. if(!sthis.parents('.'+doms[0])[0]){
  782. sthis.css('display') === 'none' || sthis.attr({'layer' : '1'}).hide();
  783. }
  784. sthis = null;
  785. });
  786. };
  787. //需依赖原型的对外方法
  788. Class.pt.openLayer = function(){
  789. var that = this;
  790. //置顶当前窗口
  791. layer.zIndex = that.config.zIndex;
  792. layer.setTop = function(layero){
  793. var setZindex = function(){
  794. layer.zIndex++;
  795. layero.css('z-index', layer.zIndex + 1);
  796. };
  797. layer.zIndex = parseInt(layero[0].style.zIndex);
  798. layero.on('mousedown', setZindex);
  799. return layer.zIndex;
  800. };
  801. };
  802. ready.record = function(layero){
  803. var area = [
  804. layero.width(),
  805. layero.height(),
  806. layero.position().top,
  807. layero.position().left + parseFloat(layero.css('margin-left'))
  808. ];
  809. layero.find('.layui-layer-max').addClass('layui-layer-maxmin');
  810. layero.attr({area: area});
  811. };
  812. ready.rescollbar = function(index){
  813. if(doms.html.attr('layer-full') == index){
  814. if(doms.html[0].style.removeProperty){
  815. doms.html[0].style.removeProperty('overflow');
  816. } else {
  817. doms.html[0].style.removeAttribute('overflow');
  818. }
  819. doms.html.removeAttr('layer-full');
  820. }
  821. };
  822. /** 内置成员 */
  823. window.layer = layer;
  824. //获取子iframe的DOM
  825. layer.getChildFrame = function(selector, index){
  826. index = index || $('.'+doms[4]).attr('times');
  827. return $('#'+ doms[0] + index).find('iframe').contents().find(selector);
  828. };
  829. //得到当前iframe层的索引,子iframe时使用
  830. layer.getFrameIndex = function(name){
  831. return $('#'+ name).parents('.'+doms[4]).attr('times');
  832. };
  833. //iframe层自适应宽高
  834. layer.iframeAuto = function(index){
  835. if(!index) return;
  836. var heg = layer.getChildFrame('html', index).outerHeight();
  837. var layero = $('#'+ doms[0] + index);
  838. var titHeight = layero.find(doms[1]).outerHeight() || 0;
  839. var btnHeight = layero.find('.'+doms[6]).outerHeight() || 0;
  840. layero.css({height: heg + titHeight + btnHeight});
  841. layero.find('iframe').css({height: heg});
  842. };
  843. //重置iframe url
  844. layer.iframeSrc = function(index, url){
  845. $('#'+ doms[0] + index).find('iframe').attr('src', url);
  846. };
  847. //设定层的样式
  848. layer.style = function(index, options, limit){
  849. var layero = $('#'+ doms[0] + index)
  850. ,contElem = layero.find('.layui-layer-content')
  851. ,type = layero.attr('type')
  852. ,titHeight = layero.find(doms[1]).outerHeight() || 0
  853. ,btnHeight = layero.find('.'+doms[6]).outerHeight() || 0
  854. ,minLeft = layero.attr('minLeft');
  855. if(type === ready.type[3] || type === ready.type[4]){
  856. return;
  857. }
  858. if(!limit){
  859. if(parseFloat(options.width) <= 260){
  860. options.width = 260;
  861. };
  862. if(parseFloat(options.height) - titHeight - btnHeight <= 64){
  863. options.height = 64 + titHeight + btnHeight;
  864. };
  865. }
  866. layero.css(options);
  867. btnHeight = layero.find('.'+doms[6]).outerHeight();
  868. if(type === ready.type[2]){
  869. layero.find('iframe').css({
  870. height: parseFloat(options.height) - titHeight - btnHeight
  871. });
  872. } else {
  873. contElem.css({
  874. height: parseFloat(options.height) - titHeight - btnHeight
  875. - parseFloat(contElem.css('padding-top'))
  876. - parseFloat(contElem.css('padding-bottom'))
  877. })
  878. }
  879. };
  880. //最小化
  881. layer.min = function(index, options){
  882. var layero = $('#'+ doms[0] + index)
  883. ,titHeight = layero.find(doms[1]).outerHeight() || 0
  884. ,left = layero.attr('minLeft') || (181*ready.minIndex)+'px'
  885. ,position = layero.css('position');
  886. ready.record(layero);
  887. if(ready.minLeft[0]){
  888. left = ready.minLeft[0];
  889. ready.minLeft.shift();
  890. }
  891. layero.attr('position', position);
  892. layer.style(index, {
  893. width: 180
  894. ,height: titHeight
  895. ,left: left
  896. ,top: win.height() - titHeight
  897. ,position: 'fixed'
  898. ,overflow: 'hidden'
  899. }, true);
  900. layero.find('.layui-layer-min').hide();
  901. layero.attr('type') === 'page' && layero.find(doms[4]).hide();
  902. ready.rescollbar(index);
  903. if(!layero.attr('minLeft')){
  904. ready.minIndex++;
  905. }
  906. layero.attr('minLeft', left);
  907. };
  908. //还原
  909. layer.restore = function(index){
  910. var layero = $('#'+ doms[0] + index), area = layero.attr('area').split(',');
  911. var type = layero.attr('type');
  912. layer.style(index, {
  913. width: parseFloat(area[0]),
  914. height: parseFloat(area[1]),
  915. top: parseFloat(area[2]),
  916. left: parseFloat(area[3]),
  917. position: layero.attr('position'),
  918. overflow: 'visible'
  919. }, true);
  920. layero.find('.layui-layer-max').removeClass('layui-layer-maxmin');
  921. layero.find('.layui-layer-min').show();
  922. layero.attr('type') === 'page' && layero.find(doms[4]).show();
  923. ready.rescollbar(index);
  924. };
  925. //全屏
  926. layer.full = function(index){
  927. var layero = $('#'+ doms[0] + index), timer;
  928. ready.record(layero);
  929. if(!doms.html.attr('layer-full')){
  930. doms.html.css('overflow','hidden').attr('layer-full', index);
  931. }
  932. clearTimeout(timer);
  933. timer = setTimeout(function(){
  934. var isfix = layero.css('position') === 'fixed';
  935. layer.style(index, {
  936. top: isfix ? 0 : win.scrollTop(),
  937. left: isfix ? 0 : win.scrollLeft(),
  938. width: win.width(),
  939. height: win.height()
  940. }, true);
  941. layero.find('.layui-layer-min').hide();
  942. }, 100);
  943. };
  944. //改变title
  945. layer.title = function(name, index){
  946. var title = $('#'+ doms[0] + (index||layer.index)).find(doms[1]);
  947. title.html(name);
  948. };
  949. //关闭layer总方法
  950. layer.close = function(index){
  951. var layero = $('#'+ doms[0] + index), type = layero.attr('type'), closeAnim = 'layer-anim-close';
  952. if(!layero[0]) return;
  953. var WRAP = 'layui-layer-wrap', remove = function(){
  954. if(type === ready.type[1] && layero.attr('conType') === 'object'){
  955. layero.children(':not(.'+ doms[5] +')').remove();
  956. var wrap = layero.find('.'+WRAP);
  957. for(var i = 0; i < 2; i++){
  958. wrap.unwrap();
  959. }
  960. wrap.css('display', wrap.data('display')).removeClass(WRAP);
  961. } else {
  962. //低版本IE 回收 iframe
  963. if(type === ready.type[2]){
  964. try {
  965. var iframe = $('#'+doms[4]+index)[0];
  966. iframe.contentWindow.document.write('');
  967. iframe.contentWindow.close();
  968. layero.find('.'+doms[5])[0].removeChild(iframe);
  969. } catch(e){}
  970. }
  971. layero[0].innerHTML = '';
  972. layero.remove();
  973. }
  974. };
  975. if(layero.data('anim')){
  976. layero.addClass(closeAnim);
  977. }
  978. $('#layui-layer-moves, #layui-layer-shade' + index).remove();
  979. layer.ie == 6 && ready.reselect();
  980. ready.rescollbar(index);
  981. typeof ready.end[index] === 'function' && ready.end[index]();
  982. delete ready.end[index];
  983. if(layero.attr('minLeft')){
  984. ready.minIndex--;
  985. ready.minLeft.push(layero.attr('minLeft'));
  986. }
  987. setTimeout(function(){
  988. remove();
  989. }, ((layer.ie && layer.ie < 10) || !layero.data('anim')) ? 0 : 200);
  990. };
  991. //关闭所有层
  992. layer.closeAll = function(type){
  993. $.each($('.'+doms[0]), function(){
  994. var othis = $(this);
  995. var is = type ? (othis.attr('type') === type) : 1;
  996. is && layer.close(othis.attr('times'));
  997. is = null;
  998. });
  999. };
  1000. /**
  1001. 拓展模块,layui开始合并在一起
  1002. */
  1003. var cache = layer.cache||{}, skin = function(type){
  1004. return (cache.skin ? (' ' + cache.skin + ' ' + cache.skin + '-'+type) : '');
  1005. };
  1006. //仿系统prompt
  1007. layer.prompt = function(options, yes){
  1008. var style = '';
  1009. options = options || {};
  1010. if(typeof options === 'function') yes = options;
  1011. if(options.area){
  1012. var area = options.area;
  1013. style = 'style="width: '+ area[0] +'; height: '+ area[1] + ';"';
  1014. delete options.area;
  1015. }
  1016. var prompt, content = options.formType == 2 ? '<textarea class="layui-layer-input"' + style +'>' + (options.value||'') +'</textarea>' : function(){
  1017. return '<input type="'+ (options.formType == 1 ? 'password' : 'text') +'" class="layui-layer-input" value="'+ (options.value||'') +'">';
  1018. }();
  1019. return layer.open($.extend({
  1020. type: 1
  1021. ,btn: ['&#x786E;&#x5B9A;','&#x53D6;&#x6D88;']
  1022. ,content: content
  1023. ,skin: 'layui-layer-prompt' + skin('prompt')
  1024. ,maxWidth: win.width()
  1025. ,success: function(layero){
  1026. prompt = layero.find('.layui-layer-input');
  1027. prompt.focus();
  1028. }
  1029. ,resize: false
  1030. ,yes: function(index){
  1031. var value = prompt.val();
  1032. if(value === ''){
  1033. prompt.focus();
  1034. } else if(value.length > (options.maxlength||500)) {
  1035. layer.tips('&#x6700;&#x591A;&#x8F93;&#x5165;'+ (options.maxlength || 500) +'&#x4E2A;&#x5B57;&#x6570;', prompt, {tips: 1});
  1036. } else {
  1037. yes && yes(value, index, prompt);
  1038. }
  1039. }
  1040. }, options));
  1041. };
  1042. //tab层
  1043. layer.tab = function(options){
  1044. options = options || {};
  1045. var tab = options.tab || {};
  1046. return layer.open($.extend({
  1047. type: 1,
  1048. skin: 'layui-layer-tab' + skin('tab'),
  1049. resize: false,
  1050. title: function(){
  1051. var len = tab.length, ii = 1, str = '';
  1052. if(len > 0){
  1053. str = '<span class="layui-layer-tabnow">'+ tab[0].title +'</span>';
  1054. for(; ii < len; ii++){
  1055. str += '<span>'+ tab[ii].title +'</span>';
  1056. }
  1057. }
  1058. return str;
  1059. }(),
  1060. content: '<ul class="layui-layer-tabmain">'+ function(){
  1061. var len = tab.length, ii = 1, str = '';
  1062. if(len > 0){
  1063. str = '<li class="layui-layer-tabli xubox_tab_layer">'+ (tab[0].content || 'no content') +'</li>';
  1064. for(; ii < len; ii++){
  1065. str += '<li class="layui-layer-tabli">'+ (tab[ii].content || 'no content') +'</li>';
  1066. }
  1067. }
  1068. return str;
  1069. }() +'</ul>',
  1070. success: function(layero){
  1071. var btn = layero.find('.layui-layer-title').children();
  1072. var main = layero.find('.layui-layer-tabmain').children();
  1073. btn.on('mousedown', function(e){
  1074. e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;
  1075. var othis = $(this), index = othis.index();
  1076. othis.addClass('layui-layer-tabnow').siblings().removeClass('layui-layer-tabnow');
  1077. main.eq(index).show().siblings().hide();
  1078. typeof options.change === 'function' && options.change(index);
  1079. });
  1080. }
  1081. }, options));
  1082. };
  1083. //相册层
  1084. layer.photos = function(options, loop, key){
  1085. var dict = {};
  1086. options = options || {};
  1087. if(!options.photos) return;
  1088. var type = options.photos.constructor === Object;
  1089. var photos = type ? options.photos : {}, data = photos.data || [];
  1090. var start = photos.start || 0;
  1091. dict.imgIndex = (start|0) + 1;
  1092. options.img = options.img || 'img';
  1093. if(!type){ //页面直接获取
  1094. var parent = $(options.photos), pushData = function(){
  1095. data = [];
  1096. parent.find(options.img).each(function(index){
  1097. var othis = $(this);
  1098. othis.attr('layer-index', index);
  1099. data.push({
  1100. alt: othis.attr('alt'),
  1101. pid: othis.attr('layer-pid'),
  1102. src: othis.attr('layer-src') || othis.attr('src'),
  1103. thumb: othis.attr('src')
  1104. });
  1105. })
  1106. };
  1107. pushData();
  1108. if (data.length === 0) return;
  1109. loop || parent.on('click', options.img, function(){
  1110. var othis = $(this), index = othis.attr('layer-index');
  1111. layer.photos($.extend(options, {
  1112. photos: {
  1113. start: index,
  1114. data: data,
  1115. tab: options.tab
  1116. },
  1117. full: options.full
  1118. }), true);
  1119. pushData();
  1120. })
  1121. //不直接弹出
  1122. if(!loop) return;
  1123. } else if (data.length === 0){
  1124. return layer.msg('&#x6CA1;&#x6709;&#x56FE;&#x7247;');
  1125. }
  1126. //上一张
  1127. dict.imgprev = function(key){
  1128. dict.imgIndex--;
  1129. if(dict.imgIndex < 1){
  1130. dict.imgIndex = data.length;
  1131. }
  1132. dict.tabimg(key);
  1133. };
  1134. //下一张
  1135. dict.imgnext = function(key,errorMsg){
  1136. dict.imgIndex++;
  1137. if(dict.imgIndex > data.length){
  1138. dict.imgIndex = 1;
  1139. if (errorMsg) {return};
  1140. }
  1141. dict.tabimg(key)
  1142. };
  1143. //方向键
  1144. dict.keyup = function(event){
  1145. if(!dict.end){
  1146. var code = event.keyCode;
  1147. event.preventDefault();
  1148. if(code === 37){
  1149. dict.imgprev(true);
  1150. } else if(code === 39) {
  1151. dict.imgnext(true);
  1152. } else if(code === 27) {
  1153. layer.close(dict.index);
  1154. }
  1155. }
  1156. }
  1157. //切换
  1158. dict.tabimg = function(key){
  1159. if(data.length <= 1) return;
  1160. photos.start = dict.imgIndex - 1;
  1161. layer.close(dict.index);
  1162. layer.photos(options, true, key);
  1163. }
  1164. //一些动作
  1165. dict.event = function(){
  1166. dict.bigimg.hover(function(){
  1167. dict.imgsee.show();
  1168. }, function(){
  1169. dict.imgsee.hide();
  1170. });
  1171. dict.bigimg.find('.layui-layer-imgprev').on('click', function(event){
  1172. event.preventDefault();
  1173. dict.imgprev();
  1174. });
  1175. dict.bigimg.find('.layui-layer-imgnext').on('click', function(event){
  1176. event.preventDefault();
  1177. dict.imgnext();
  1178. });
  1179. $(document).on('keyup', dict.keyup);
  1180. };
  1181. //图片预加载
  1182. function loadImage(url, callback, error) {
  1183. var img = new Image();
  1184. img.src = url;
  1185. if(img.complete){
  1186. return callback(img);
  1187. }
  1188. img.onload = function(){
  1189. img.onload = null;
  1190. callback(img);
  1191. };
  1192. img.onerror = function(e){
  1193. img.onerror = null;
  1194. error(e);
  1195. };
  1196. };
  1197. dict.loadi = layer.load(1, {
  1198. shade: 'shade' in options ? false : 0.9,
  1199. scrollbar: false
  1200. });
  1201. loadImage(data[start].src, function(img){
  1202. layer.close(dict.loadi);
  1203. dict.index = layer.open($.extend({
  1204. type: 1,
  1205. area: function(){
  1206. var imgarea = [img.width, img.height];
  1207. var winarea = [$(window).width() - 100, $(window).height() - 100];
  1208. //如果 实际图片的宽或者高比 屏幕大(那么进行缩放)
  1209. if(!options.full && (imgarea[0]>winarea[0]||imgarea[1]>winarea[1])){
  1210. var wh = [imgarea[0]/winarea[0],imgarea[1]/winarea[1]];//取宽度缩放比例、高度缩放比例
  1211. if(wh[0] > wh[1]){//取缩放比例最大的进行缩放
  1212. imgarea[0] = imgarea[0]/wh[0];
  1213. imgarea[1] = imgarea[1]/wh[0];
  1214. } else if(wh[0] < wh[1]){
  1215. imgarea[0] = imgarea[0]/wh[1];
  1216. imgarea[1] = imgarea[1]/wh[1];
  1217. }
  1218. }
  1219. return [imgarea[0]+'px', imgarea[1]+'px'];
  1220. }(),
  1221. title: false,
  1222. shade: 0.9,
  1223. shadeClose: true,
  1224. closeBtn: false,
  1225. move: '.layui-layer-phimg img',
  1226. moveType: 1,
  1227. scrollbar: false,
  1228. moveOut: true,
  1229. anim: Math.random()*5|0,
  1230. skin: 'layui-layer-photos' + skin('photos'),
  1231. content: '<div class="layui-layer-phimg">'
  1232. +'<img src="'+ data[start].src +'" alt="'+ (data[start].alt||'') +'" layer-pid="'+ data[start].pid +'">'
  1233. +'<div class="layui-layer-imgsee">'
  1234. +(data.length > 1 ? '<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>' : '')
  1235. +'<div class="layui-layer-imgbar" style="display:'+ (key ? 'block' : '') +'"><span class="layui-layer-imgtit"><a href="javascript:;">'+ (data[start].alt||'') +'</a><em>'+ dict.imgIndex +'/'+ data.length +'</em></span></div>'
  1236. +'</div>'
  1237. +'</div>',
  1238. success: function(layero, index){
  1239. dict.bigimg = layero.find('.layui-layer-phimg');
  1240. dict.imgsee = layero.find('.layui-layer-imguide,.layui-layer-imgbar');
  1241. dict.event(layero);
  1242. options.tab && options.tab(data[start], layero);
  1243. }, end: function(){
  1244. dict.end = true;
  1245. $(document).off('keyup', dict.keyup);
  1246. }
  1247. }, options));
  1248. }, function(){
  1249. layer.close(dict.loadi);
  1250. layer.msg('&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;<br>&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x67E5;&#x770B;&#x4E0B;&#x4E00;&#x5F20;&#xFF1F;', {
  1251. time: 30000,
  1252. btn: ['&#x4E0B;&#x4E00;&#x5F20;', '&#x4E0D;&#x770B;&#x4E86;'],
  1253. yes: function(){
  1254. data.length > 1 && dict.imgnext(true,true);
  1255. }
  1256. });
  1257. });
  1258. };
  1259. //主入口
  1260. ready.run = function(_$){
  1261. $ = _$;
  1262. win = $(window);
  1263. doms.html = $('html');
  1264. layer.open = function(deliver){
  1265. var o = new Class(deliver);
  1266. return o.index;
  1267. };
  1268. };
  1269. //加载方式
  1270. window.layui && layui.define ? (
  1271. layer.ready()
  1272. ,layui.define('jquery', function(exports){ //layui加载
  1273. layer.path = layui.cache.dir;
  1274. ready.run(layui.jquery);
  1275. //暴露模块
  1276. window.layer = layer;
  1277. exports('layer', layer);
  1278. })
  1279. ) : (
  1280. typeof define === 'function' ? define('layer',['jquery'], function(){ //requirejs加载
  1281. ready.run(window.jQuery);
  1282. return layer;
  1283. }) : function(){ //普通script标签加载
  1284. ready.run(window.jQuery);
  1285. layer.ready();
  1286. }()
  1287. );
  1288. }(window);
  1289. /*
  1290. * Toastr
  1291. * Copyright 2012-2015
  1292. * Authors: John Papa, Hans Fjällemark, and Tim Ferrell.
  1293. * All Rights Reserved.
  1294. * Use, reproduction, distribution, and modification of this code is subject to the terms and
  1295. * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php
  1296. *
  1297. * ARIA Support: Greta Krafsig
  1298. *
  1299. * Project: https://github.com/CodeSeven/toastr
  1300. */
  1301. /* global define */
  1302. (function (define) {
  1303. define('toastr',['jquery'], function ($) {
  1304. return (function () {
  1305. var $container;
  1306. var listener;
  1307. var toastId = 0;
  1308. var toastType = {
  1309. error: 'error',
  1310. info: 'info',
  1311. success: 'success',
  1312. warning: 'warning'
  1313. };
  1314. var toastr = {
  1315. clear: clear,
  1316. remove: remove,
  1317. error: error,
  1318. getContainer: getContainer,
  1319. info: info,
  1320. options: {},
  1321. subscribe: subscribe,
  1322. success: success,
  1323. version: '2.1.3',
  1324. warning: warning
  1325. };
  1326. var previousToast;
  1327. return toastr;
  1328. ////////////////
  1329. function error(message, title, optionsOverride) {
  1330. return notify({
  1331. type: toastType.error,
  1332. iconClass: getOptions().iconClasses.error,
  1333. message: message,
  1334. optionsOverride: optionsOverride,
  1335. title: title
  1336. });
  1337. }
  1338. function getContainer(options, create) {
  1339. if (!options) { options = getOptions(); }
  1340. $container = $('#' + options.containerId);
  1341. if ($container.length) {
  1342. return $container;
  1343. }
  1344. if (create) {
  1345. $container = createContainer(options);
  1346. }
  1347. return $container;
  1348. }
  1349. function info(message, title, optionsOverride) {
  1350. return notify({
  1351. type: toastType.info,
  1352. iconClass: getOptions().iconClasses.info,
  1353. message: message,
  1354. optionsOverride: optionsOverride,
  1355. title: title
  1356. });
  1357. }
  1358. function subscribe(callback) {
  1359. listener = callback;
  1360. }
  1361. function success(message, title, optionsOverride) {
  1362. return notify({
  1363. type: toastType.success,
  1364. iconClass: getOptions().iconClasses.success,
  1365. message: message,
  1366. optionsOverride: optionsOverride,
  1367. title: title
  1368. });
  1369. }
  1370. function warning(message, title, optionsOverride) {
  1371. return notify({
  1372. type: toastType.warning,
  1373. iconClass: getOptions().iconClasses.warning,
  1374. message: message,
  1375. optionsOverride: optionsOverride,
  1376. title: title
  1377. });
  1378. }
  1379. function clear($toastElement, clearOptions) {
  1380. var options = getOptions();
  1381. if (!$container) { getContainer(options); }
  1382. if (!clearToast($toastElement, options, clearOptions)) {
  1383. clearContainer(options);
  1384. }
  1385. }
  1386. function remove($toastElement) {
  1387. var options = getOptions();
  1388. if (!$container) { getContainer(options); }
  1389. if ($toastElement && $(':focus', $toastElement).length === 0) {
  1390. removeToast($toastElement);
  1391. return;
  1392. }
  1393. if ($container.children().length) {
  1394. $container.remove();
  1395. }
  1396. }
  1397. // internal functions
  1398. function clearContainer (options) {
  1399. var toastsToClear = $container.children();
  1400. for (var i = toastsToClear.length - 1; i >= 0; i--) {
  1401. clearToast($(toastsToClear[i]), options);
  1402. }
  1403. }
  1404. function clearToast ($toastElement, options, clearOptions) {
  1405. var force = clearOptions && clearOptions.force ? clearOptions.force : false;
  1406. if ($toastElement && (force || $(':focus', $toastElement).length === 0)) {
  1407. $toastElement[options.hideMethod]({
  1408. duration: options.hideDuration,
  1409. easing: options.hideEasing,
  1410. complete: function () { removeToast($toastElement); }
  1411. });
  1412. return true;
  1413. }
  1414. return false;
  1415. }
  1416. function createContainer(options) {
  1417. $container = $('<div/>')
  1418. .attr('id', options.containerId)
  1419. .addClass(options.positionClass);
  1420. $container.appendTo($(options.target));
  1421. return $container;
  1422. }
  1423. function getDefaults() {
  1424. return {
  1425. tapToDismiss: true,
  1426. toastClass: 'toast',
  1427. containerId: 'toast-container',
  1428. debug: false,
  1429. showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery
  1430. showDuration: 300,
  1431. showEasing: 'swing', //swing and linear are built into jQuery
  1432. onShown: undefined,
  1433. hideMethod: 'fadeOut',
  1434. hideDuration: 1000,
  1435. hideEasing: 'swing',
  1436. onHidden: undefined,
  1437. closeMethod: false,
  1438. closeDuration: false,
  1439. closeEasing: false,
  1440. closeOnHover: true,
  1441. extendedTimeOut: 1000,
  1442. iconClasses: {
  1443. error: 'toast-error',
  1444. info: 'toast-info',
  1445. success: 'toast-success',
  1446. warning: 'toast-warning'
  1447. },
  1448. iconClass: 'toast-info',
  1449. positionClass: 'toast-top-right',
  1450. timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky
  1451. titleClass: 'toast-title',
  1452. messageClass: 'toast-message',
  1453. escapeHtml: false,
  1454. target: 'body',
  1455. closeHtml: '<button type="button">&times;</button>',
  1456. closeClass: 'toast-close-button',
  1457. newestOnTop: true,
  1458. preventDuplicates: false,
  1459. progressBar: false,
  1460. progressClass: 'toast-progress',
  1461. rtl: false
  1462. };
  1463. }
  1464. function publish(args) {
  1465. if (!listener) { return; }
  1466. listener(args);
  1467. }
  1468. function notify(map) {
  1469. var options = getOptions();
  1470. var iconClass = map.iconClass || options.iconClass;
  1471. if (typeof (map.optionsOverride) !== 'undefined') {
  1472. options = $.extend(options, map.optionsOverride);
  1473. iconClass = map.optionsOverride.iconClass || iconClass;
  1474. }
  1475. if (shouldExit(options, map)) { return; }
  1476. toastId++;
  1477. $container = getContainer(options, true);
  1478. var intervalId = null;
  1479. var $toastElement = $('<div/>');
  1480. var $titleElement = $('<div/>');
  1481. var $messageElement = $('<div/>');
  1482. var $progressElement = $('<div/>');
  1483. var $closeElement = $(options.closeHtml);
  1484. var progressBar = {
  1485. intervalId: null,
  1486. hideEta: null,
  1487. maxHideTime: null
  1488. };
  1489. var response = {
  1490. toastId: toastId,
  1491. state: 'visible',
  1492. startTime: new Date(),
  1493. options: options,
  1494. map: map
  1495. };
  1496. personalizeToast();
  1497. displayToast();
  1498. handleEvents();
  1499. publish(response);
  1500. if (options.debug && console) {
  1501. console.log(response);
  1502. }
  1503. return $toastElement;
  1504. function escapeHtml(source) {
  1505. if (source == null) {
  1506. source = '';
  1507. }
  1508. return source
  1509. .replace(/&/g, '&amp;')
  1510. .replace(/"/g, '&quot;')
  1511. .replace(/'/g, '&#39;')
  1512. .replace(/</g, '&lt;')
  1513. .replace(/>/g, '&gt;');
  1514. }
  1515. function personalizeToast() {
  1516. setIcon();
  1517. setTitle();
  1518. setMessage();
  1519. setCloseButton();
  1520. setProgressBar();
  1521. setRTL();
  1522. setSequence();
  1523. setAria();
  1524. }
  1525. function setAria() {
  1526. var ariaValue = '';
  1527. switch (map.iconClass) {
  1528. case 'toast-success':
  1529. case 'toast-info':
  1530. ariaValue = 'polite';
  1531. break;
  1532. default:
  1533. ariaValue = 'assertive';
  1534. }
  1535. $toastElement.attr('aria-live', ariaValue);
  1536. }
  1537. function handleEvents() {
  1538. if (options.closeOnHover) {
  1539. $toastElement.hover(stickAround, delayedHideToast);
  1540. }
  1541. if (!options.onclick && options.tapToDismiss) {
  1542. $toastElement.click(hideToast);
  1543. }
  1544. if (options.closeButton && $closeElement) {
  1545. $closeElement.click(function (event) {
  1546. if (event.stopPropagation) {
  1547. event.stopPropagation();
  1548. } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {
  1549. event.cancelBubble = true;
  1550. }
  1551. if (options.onCloseClick) {
  1552. options.onCloseClick(event);
  1553. }
  1554. hideToast(true);
  1555. });
  1556. }
  1557. if (options.onclick) {
  1558. $toastElement.click(function (event) {
  1559. options.onclick(event);
  1560. hideToast();
  1561. });
  1562. }
  1563. }
  1564. function displayToast() {
  1565. $toastElement.hide();
  1566. $toastElement[options.showMethod](
  1567. {duration: options.showDuration, easing: options.showEasing, complete: options.onShown}
  1568. );
  1569. if (options.timeOut > 0) {
  1570. intervalId = setTimeout(hideToast, options.timeOut);
  1571. progressBar.maxHideTime = parseFloat(options.timeOut);
  1572. progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
  1573. if (options.progressBar) {
  1574. progressBar.intervalId = setInterval(updateProgress, 10);
  1575. }
  1576. }
  1577. }
  1578. function setIcon() {
  1579. if (map.iconClass) {
  1580. $toastElement.addClass(options.toastClass).addClass(iconClass);
  1581. }
  1582. }
  1583. function setSequence() {
  1584. if (options.newestOnTop) {
  1585. $container.prepend($toastElement);
  1586. } else {
  1587. $container.append($toastElement);
  1588. }
  1589. }
  1590. function setTitle() {
  1591. if (map.title) {
  1592. var suffix = map.title;
  1593. if (options.escapeHtml) {
  1594. suffix = escapeHtml(map.title);
  1595. }
  1596. $titleElement.append(suffix).addClass(options.titleClass);
  1597. $toastElement.append($titleElement);
  1598. }
  1599. }
  1600. function setMessage() {
  1601. if (map.message) {
  1602. var suffix = map.message;
  1603. if (options.escapeHtml) {
  1604. suffix = escapeHtml(map.message);
  1605. }
  1606. $messageElement.append(suffix).addClass(options.messageClass);
  1607. $toastElement.append($messageElement);
  1608. }
  1609. }
  1610. function setCloseButton() {
  1611. if (options.closeButton) {
  1612. $closeElement.addClass(options.closeClass).attr('role', 'button');
  1613. $toastElement.prepend($closeElement);
  1614. }
  1615. }
  1616. function setProgressBar() {
  1617. if (options.progressBar) {
  1618. $progressElement.addClass(options.progressClass);
  1619. $toastElement.prepend($progressElement);
  1620. }
  1621. }
  1622. function setRTL() {
  1623. if (options.rtl) {
  1624. $toastElement.addClass('rtl');
  1625. }
  1626. }
  1627. function shouldExit(options, map) {
  1628. if (options.preventDuplicates) {
  1629. if (map.message === previousToast) {
  1630. return true;
  1631. } else {
  1632. previousToast = map.message;
  1633. }
  1634. }
  1635. return false;
  1636. }
  1637. function hideToast(override) {
  1638. var method = override && options.closeMethod !== false ? options.closeMethod : options.hideMethod;
  1639. var duration = override && options.closeDuration !== false ?
  1640. options.closeDuration : options.hideDuration;
  1641. var easing = override && options.closeEasing !== false ? options.closeEasing : options.hideEasing;
  1642. if ($(':focus', $toastElement).length && !override) {
  1643. return;
  1644. }
  1645. clearTimeout(progressBar.intervalId);
  1646. return $toastElement[method]({
  1647. duration: duration,
  1648. easing: easing,
  1649. complete: function () {
  1650. removeToast($toastElement);
  1651. clearTimeout(intervalId);
  1652. if (options.onHidden && response.state !== 'hidden') {
  1653. options.onHidden();
  1654. }
  1655. response.state = 'hidden';
  1656. response.endTime = new Date();
  1657. publish(response);
  1658. }
  1659. });
  1660. }
  1661. function delayedHideToast() {
  1662. if (options.timeOut > 0 || options.extendedTimeOut > 0) {
  1663. intervalId = setTimeout(hideToast, options.extendedTimeOut);
  1664. progressBar.maxHideTime = parseFloat(options.extendedTimeOut);
  1665. progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
  1666. }
  1667. }
  1668. function stickAround() {
  1669. clearTimeout(intervalId);
  1670. progressBar.hideEta = 0;
  1671. $toastElement.stop(true, true)[options.showMethod](
  1672. {duration: options.showDuration, easing: options.showEasing}
  1673. );
  1674. }
  1675. function updateProgress() {
  1676. var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100;
  1677. $progressElement.width(percentage + '%');
  1678. }
  1679. }
  1680. function getOptions() {
  1681. return $.extend({}, getDefaults(), toastr.options);
  1682. }
  1683. function removeToast($toastElement) {
  1684. if (!$container) { $container = getContainer(); }
  1685. if ($toastElement.is(':visible')) {
  1686. return;
  1687. }
  1688. $toastElement.remove();
  1689. $toastElement = null;
  1690. if ($container.children().length === 0) {
  1691. $container.remove();
  1692. previousToast = undefined;
  1693. }
  1694. }
  1695. })();
  1696. });
  1697. }(typeof define === 'function' && define.amd ? define : function (deps, factory) {
  1698. if (typeof module !== 'undefined' && module.exports) { //Node
  1699. module.exports = factory(require('jquery'));
  1700. } else {
  1701. window.toastr = factory(window.jQuery);
  1702. }
  1703. }));
  1704. define('backend',['jquery', 'bootstrap', 'toastr', 'layer', 'lang', 'config'], function ($, undefined, Toastr, Layer, Lang, Config) {
  1705. var Backend = {
  1706. config: {
  1707. //toastr默认配置
  1708. toastr: {
  1709. "closeButton": true,
  1710. "debug": false,
  1711. "newestOnTop": false,
  1712. "progressBar": false,
  1713. "positionClass": "toast-top-center",
  1714. "preventDuplicates": false,
  1715. "onclick": null,
  1716. "showDuration": "300",
  1717. "hideDuration": "1000",
  1718. "timeOut": "5000",
  1719. "extendedTimeOut": "1000",
  1720. "showEasing": "swing",
  1721. "hideEasing": "linear",
  1722. "showMethod": "fadeIn",
  1723. "hideMethod": "fadeOut"
  1724. }
  1725. },
  1726. api: {
  1727. ajax: function (options, success, failure) {
  1728. var index = Backend.api.layer.load();
  1729. options = $.extend({
  1730. type: "POST",
  1731. dataType: 'json',
  1732. success: function (data) {
  1733. Backend.api.layer.close(index);
  1734. if (data.hasOwnProperty("code")) {
  1735. var content = data.hasOwnProperty("content") && data.content != "" ? data.content : "";
  1736. if (data.code === 1) {
  1737. if (typeof success == 'function') {
  1738. var onAfterResult = success.call(undefined, content);
  1739. if (!onAfterResult) {
  1740. return false;
  1741. }
  1742. }
  1743. Toastr.success(content ? content : __('Operation completed'));
  1744. } else {
  1745. Toastr.error(content ? content : __('Operation failed'));
  1746. }
  1747. } else {
  1748. Toastr.error(__('Unknown data format'));
  1749. }
  1750. }, error: function () {
  1751. Backend.api.layer.close(index);
  1752. Toastr.error(__('Network error'));
  1753. }
  1754. }, options);
  1755. $.ajax(options);
  1756. },
  1757. //修复URL
  1758. fixurl: function (url) {
  1759. if (url.substr(0, 1) !== "/") {
  1760. var r = new RegExp('^(?:[a-z]+:)?//', 'i');
  1761. if (!r.test(url)) {
  1762. url = Config.moduleurl + "/" + url;
  1763. }
  1764. }
  1765. return url;
  1766. },
  1767. //查询Url参数
  1768. query: function (name, url) {
  1769. if (!url) {
  1770. url = window.location.href;
  1771. }
  1772. name = name.replace(/[\[\]]/g, "\\$&");
  1773. var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
  1774. results = regex.exec(url);
  1775. if (!results)
  1776. return null;
  1777. if (!results[2])
  1778. return '';
  1779. return decodeURIComponent(results[2].replace(/\+/g, " "));
  1780. },
  1781. //上传文件
  1782. upload: function (file, callback) {
  1783. var data = new FormData();
  1784. data.append("file", file);
  1785. $.ajax({
  1786. url: "ajax/upload",
  1787. data: data,
  1788. cache: false,
  1789. contentType: false,
  1790. processData: false,
  1791. type: 'POST',
  1792. dataType: 'json',
  1793. success: function (data) {
  1794. if (data.hasOwnProperty("code")) {
  1795. var content = data.hasOwnProperty("content") && data.content != "" ? data.content : "";
  1796. if (data.code === 1) {
  1797. $('.summernote').summernote("insertImage", data.content, 'filename');
  1798. Toastr.success(__('Operation completed'));
  1799. } else {
  1800. Toastr.error(content ? content : __('Operation failed'));
  1801. }
  1802. } else {
  1803. Toastr.error(__('Unknown data format'));
  1804. }
  1805. }, error: function () {
  1806. Toastr.error(__('Network error'));
  1807. }
  1808. });
  1809. },
  1810. open: function (url, title, options) {
  1811. title = title == undefined ? "" : title;
  1812. url = Backend.api.fixurl(url);
  1813. url = url + (url.indexOf("?") > -1 ? "&" : "?") + "dialog=1";
  1814. var area;
  1815. if ($(window).width() < 800) {
  1816. area = ["95%", "95%"];
  1817. } else {
  1818. area = ['800px', '600px'];
  1819. }
  1820. Backend.api.layer.open($.extend({
  1821. type: 2,
  1822. title: title,
  1823. shadeClose: true,
  1824. shade: false,
  1825. maxmin: true,
  1826. moveOut: true,
  1827. area: area,
  1828. content: url,
  1829. zIndex: Backend.api.layer.zIndex,
  1830. skin: 'layui-layer-noborder',
  1831. success: function (layero, index) {
  1832. //$(layero).removeClass("layui-layer-border");
  1833. Backend.api.layer.setTop(layero);
  1834. var frame = Backend.api.layer.getChildFrame('html', index);
  1835. var layerfooter = frame.find(".layer-footer");
  1836. Backend.api.layerfooter(layero, index);
  1837. //绑定事件
  1838. if (layerfooter.size() > 0) {
  1839. // 监听窗口内的元素及属性变化
  1840. // Firefox和Chrome早期版本中带有前缀
  1841. var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver
  1842. // 选择目标节点
  1843. var target = layerfooter[0];
  1844. // 创建观察者对象
  1845. var observer = new MutationObserver(function (mutations) {
  1846. Backend.api.layerfooter(layero, index);
  1847. mutations.forEach(function (mutation) {
  1848. });
  1849. });
  1850. // 配置观察选项:
  1851. var config = {attributes: true, childList: true, characterData: true, subtree: true}
  1852. // 传入目标节点和观察选项
  1853. observer.observe(target, config);
  1854. // 随后,你还可以停止观察
  1855. // observer.disconnect();
  1856. }
  1857. }
  1858. }, options ? options : {}));
  1859. return false;
  1860. },
  1861. layerfooter: function (layero, index) {
  1862. var frame = Backend.api.layer.getChildFrame('html', index);
  1863. var layerfooter = frame.find(".layer-footer");
  1864. if (layerfooter.size() > 0) {
  1865. $(".layui-layer-footer", layero).remove();
  1866. var footer = $("<div />").addClass('layui-layer-btn layui-layer-footer');
  1867. footer.html(layerfooter.html());
  1868. if ($(".row", footer).size() === 0) {
  1869. $(">", footer).wrapAll("<div class='row'></div>");
  1870. }
  1871. footer.insertAfter(layero.find('.layui-layer-content'));
  1872. }
  1873. var heg = frame.outerHeight();
  1874. var titHeight = layero.find('.layui-layer-title').outerHeight() || 0;
  1875. var btnHeight = layero.find('.layui-layer-btn').outerHeight() || 0;
  1876. var oldheg = heg + titHeight + btnHeight;
  1877. var maxheg = 600;
  1878. if (frame.outerWidth() < 768) {
  1879. maxheg = $(window).height() - 28;
  1880. }
  1881. // 如果有.layer-footer或窗口小于600则重新排
  1882. if (layerfooter.size() > 0 || oldheg < maxheg) {
  1883. var footerHeight = layero.find('.layui-layer-footer').outerHeight() || 0;
  1884. footerHeight = 0;
  1885. if (oldheg >= maxheg) {
  1886. heg = Math.min(maxheg, oldheg) - titHeight - btnHeight - footerHeight;
  1887. }
  1888. layero.css({height: heg + titHeight + btnHeight + footerHeight});
  1889. layero.find("iframe").css({height: heg});
  1890. }
  1891. if (layerfooter.size() > 0) {
  1892. footer.on("click", ".btn", function () {
  1893. if ($(this).hasClass("disabled") || $(this).parent().hasClass("disabled")) {
  1894. //return;
  1895. }
  1896. $(".btn:eq(" + $(this).index() + ")", layerfooter).trigger("click");
  1897. });
  1898. }
  1899. },
  1900. sidebar: function (params) {
  1901. colorArr = ['red', 'green', 'yellow', 'blue', 'teal', 'orange', 'purple'];
  1902. $colorNums = colorArr.length;
  1903. badgeList = {};
  1904. $.each(params, function (k, v) {
  1905. if (k.indexOf('/') > -1)
  1906. {
  1907. $url = Backend.api.fixurl(k);
  1908. } else
  1909. {
  1910. $url = k;
  1911. }
  1912. if ($.isArray(v))
  1913. {
  1914. $nums = typeof v[0] !== 'undefined' ? v[0] : 0;
  1915. $color = typeof v[1] !== 'undefined' ? v[1] : colorArr[(!isNaN($nums) ? $nums : $nums.length) % $colorNums];
  1916. $class = typeof v[2] !== 'undefined' ? v[2] : 'label';
  1917. } else
  1918. {
  1919. $nums = v;
  1920. $color = colorArr[(!isNaN($nums) ? $nums : $nums.length) % $colorNums];
  1921. $class = 'label';
  1922. }
  1923. //必须nums大于0才显示
  1924. badgeList[$url] = $nums > 0 ? '<small class="' + $class + ' pull-right bg-' + $color + '">' + $nums + '</small>' : '';
  1925. });
  1926. $.each(badgeList, function (k, v) {
  1927. var anchor = $(".treeview li a[addtabs][url='" + k + "']");
  1928. if (anchor) {
  1929. $(".pull-right-container", anchor).html(v);
  1930. $(".nav-addtabs li a[node-id='" + anchor.attr("addtabs") + "'] .pull-right-container").html(v);
  1931. }
  1932. });
  1933. },
  1934. success: function (options, callback) {
  1935. var type = typeof options === 'function';
  1936. if (type) {
  1937. callback = options;
  1938. }
  1939. return Backend.api.layer.msg(__('Operation completed'), $.extend({
  1940. offset: 0, icon: 1
  1941. }, type ? {} : options), callback);
  1942. },
  1943. error: function (options, callback) {
  1944. var type = typeof options === 'function';
  1945. if (type) {
  1946. callback = options;
  1947. }
  1948. return Backend.api.layer.msg(__('Operation failed'), $.extend({
  1949. offset: 0, icon: 2
  1950. }, type ? {} : options), callback);
  1951. },
  1952. toastr: Toastr,
  1953. layer: Layer
  1954. },
  1955. lang: function () {
  1956. var args = arguments,
  1957. string = args[0],
  1958. i = 1;
  1959. string = string.toLowerCase();
  1960. //string = typeof Lang[string] != 'undefined' ? Lang[string] : string;
  1961. if (typeof Lang[string] != 'undefined') {
  1962. if (typeof Lang[string] == 'object')
  1963. return Lang[string];
  1964. string = Lang[string];
  1965. } else if (string.indexOf('.') !== -1) {
  1966. var arr = string.split('.');
  1967. var current = Lang[arr[0]];
  1968. for (var i = 1; i < arr.length; i++) {
  1969. current = typeof current[arr[i]] != 'undefined' ? current[arr[i]] : '';
  1970. if (typeof current != 'object')
  1971. break;
  1972. }
  1973. if (typeof current == 'object')
  1974. return current;
  1975. string = current;
  1976. } else {
  1977. string = args[0];
  1978. }
  1979. return string.replace(/%((%)|s|d)/g, function (m) {
  1980. // m is the matched format, e.g. %s, %d
  1981. var val = null;
  1982. if (m[2]) {
  1983. val = m[2];
  1984. } else {
  1985. val = args[i];
  1986. // A switch statement so that the formatter can be extended. Default is %s
  1987. switch (m) {
  1988. case '%d':
  1989. val = parseFloat(val);
  1990. if (isNaN(val)) {
  1991. val = 0;
  1992. }
  1993. break;
  1994. }
  1995. i++;
  1996. }
  1997. return val;
  1998. });
  1999. }
  2000. };
  2001. //将Layer暴露到全局中去
  2002. window.Layer = Layer;
  2003. //将Toastr暴露到全局中去
  2004. window.Toastr = Toastr;
  2005. //将语言方法暴露到全局中去
  2006. window.__ = Backend.lang;
  2007. //将Backend渲染至全局,以便于在子框架中调用
  2008. window.Backend = Backend;
  2009. //Toastr定义
  2010. Toastr.options = Backend.config.toastr;
  2011. //点击包含.btn-dialog的元素时弹出dialog
  2012. $(document).on('click', '.btn-dialog', function (e) {
  2013. Backend.api.open(Backend.api.fixurl($(this).attr('href')), $(this).attr('title'));
  2014. e.preventDefault();
  2015. });
  2016. return Backend;
  2017. });
  2018. //! moment.js
  2019. //! version : 2.15.2
  2020. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  2021. //! license : MIT
  2022. //! momentjs.com
  2023. ;(function (global, factory) {
  2024. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  2025. typeof define === 'function' && define.amd ? define('moment/moment',factory) :
  2026. global.moment = factory()
  2027. }(this, function () { 'use strict';
  2028. var hookCallback;
  2029. function utils_hooks__hooks () {
  2030. return hookCallback.apply(null, arguments);
  2031. }
  2032. // This is done to register the method called with moment()
  2033. // without creating circular dependencies.
  2034. function setHookCallback (callback) {
  2035. hookCallback = callback;
  2036. }
  2037. function isArray(input) {
  2038. return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';
  2039. }
  2040. function isObject(input) {
  2041. // IE8 will treat undefined and null as object if it wasn't for
  2042. // input != null
  2043. return input != null && Object.prototype.toString.call(input) === '[object Object]';
  2044. }
  2045. function isObjectEmpty(obj) {
  2046. var k;
  2047. for (k in obj) {
  2048. // even if its not own property I'd still call it non-empty
  2049. return false;
  2050. }
  2051. return true;
  2052. }
  2053. function isDate(input) {
  2054. return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
  2055. }
  2056. function map(arr, fn) {
  2057. var res = [], i;
  2058. for (i = 0; i < arr.length; ++i) {
  2059. res.push(fn(arr[i], i));
  2060. }
  2061. return res;
  2062. }
  2063. function hasOwnProp(a, b) {
  2064. return Object.prototype.hasOwnProperty.call(a, b);
  2065. }
  2066. function extend(a, b) {
  2067. for (var i in b) {
  2068. if (hasOwnProp(b, i)) {
  2069. a[i] = b[i];
  2070. }
  2071. }
  2072. if (hasOwnProp(b, 'toString')) {
  2073. a.toString = b.toString;
  2074. }
  2075. if (hasOwnProp(b, 'valueOf')) {
  2076. a.valueOf = b.valueOf;
  2077. }
  2078. return a;
  2079. }
  2080. function create_utc__createUTC (input, format, locale, strict) {
  2081. return createLocalOrUTC(input, format, locale, strict, true).utc();
  2082. }
  2083. function defaultParsingFlags() {
  2084. // We need to deep clone this object.
  2085. return {
  2086. empty : false,
  2087. unusedTokens : [],
  2088. unusedInput : [],
  2089. overflow : -2,
  2090. charsLeftOver : 0,
  2091. nullInput : false,
  2092. invalidMonth : null,
  2093. invalidFormat : false,
  2094. userInvalidated : false,
  2095. iso : false,
  2096. parsedDateParts : [],
  2097. meridiem : null
  2098. };
  2099. }
  2100. function getParsingFlags(m) {
  2101. if (m._pf == null) {
  2102. m._pf = defaultParsingFlags();
  2103. }
  2104. return m._pf;
  2105. }
  2106. var some;
  2107. if (Array.prototype.some) {
  2108. some = Array.prototype.some;
  2109. } else {
  2110. some = function (fun) {
  2111. var t = Object(this);
  2112. var len = t.length >>> 0;
  2113. for (var i = 0; i < len; i++) {
  2114. if (i in t && fun.call(this, t[i], i, t)) {
  2115. return true;
  2116. }
  2117. }
  2118. return false;
  2119. };
  2120. }
  2121. function valid__isValid(m) {
  2122. if (m._isValid == null) {
  2123. var flags = getParsingFlags(m);
  2124. var parsedParts = some.call(flags.parsedDateParts, function (i) {
  2125. return i != null;
  2126. });
  2127. var isNowValid = !isNaN(m._d.getTime()) &&
  2128. flags.overflow < 0 &&
  2129. !flags.empty &&
  2130. !flags.invalidMonth &&
  2131. !flags.invalidWeekday &&
  2132. !flags.nullInput &&
  2133. !flags.invalidFormat &&
  2134. !flags.userInvalidated &&
  2135. (!flags.meridiem || (flags.meridiem && parsedParts));
  2136. if (m._strict) {
  2137. isNowValid = isNowValid &&
  2138. flags.charsLeftOver === 0 &&
  2139. flags.unusedTokens.length === 0 &&
  2140. flags.bigHour === undefined;
  2141. }
  2142. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  2143. m._isValid = isNowValid;
  2144. }
  2145. else {
  2146. return isNowValid;
  2147. }
  2148. }
  2149. return m._isValid;
  2150. }
  2151. function valid__createInvalid (flags) {
  2152. var m = create_utc__createUTC(NaN);
  2153. if (flags != null) {
  2154. extend(getParsingFlags(m), flags);
  2155. }
  2156. else {
  2157. getParsingFlags(m).userInvalidated = true;
  2158. }
  2159. return m;
  2160. }
  2161. function isUndefined(input) {
  2162. return input === void 0;
  2163. }
  2164. // Plugins that add properties should also add the key here (null value),
  2165. // so we can properly clone ourselves.
  2166. var momentProperties = utils_hooks__hooks.momentProperties = [];
  2167. function copyConfig(to, from) {
  2168. var i, prop, val;
  2169. if (!isUndefined(from._isAMomentObject)) {
  2170. to._isAMomentObject = from._isAMomentObject;
  2171. }
  2172. if (!isUndefined(from._i)) {
  2173. to._i = from._i;
  2174. }
  2175. if (!isUndefined(from._f)) {
  2176. to._f = from._f;
  2177. }
  2178. if (!isUndefined(from._l)) {
  2179. to._l = from._l;
  2180. }
  2181. if (!isUndefined(from._strict)) {
  2182. to._strict = from._strict;
  2183. }
  2184. if (!isUndefined(from._tzm)) {
  2185. to._tzm = from._tzm;
  2186. }
  2187. if (!isUndefined(from._isUTC)) {
  2188. to._isUTC = from._isUTC;
  2189. }
  2190. if (!isUndefined(from._offset)) {
  2191. to._offset = from._offset;
  2192. }
  2193. if (!isUndefined(from._pf)) {
  2194. to._pf = getParsingFlags(from);
  2195. }
  2196. if (!isUndefined(from._locale)) {
  2197. to._locale = from._locale;
  2198. }
  2199. if (momentProperties.length > 0) {
  2200. for (i in momentProperties) {
  2201. prop = momentProperties[i];
  2202. val = from[prop];
  2203. if (!isUndefined(val)) {
  2204. to[prop] = val;
  2205. }
  2206. }
  2207. }
  2208. return to;
  2209. }
  2210. var updateInProgress = false;
  2211. // Moment prototype object
  2212. function Moment(config) {
  2213. copyConfig(this, config);
  2214. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  2215. // Prevent infinite loop in case updateOffset creates new moment
  2216. // objects.
  2217. if (updateInProgress === false) {
  2218. updateInProgress = true;
  2219. utils_hooks__hooks.updateOffset(this);
  2220. updateInProgress = false;
  2221. }
  2222. }
  2223. function isMoment (obj) {
  2224. return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
  2225. }
  2226. function absFloor (number) {
  2227. if (number < 0) {
  2228. // -0 -> 0
  2229. return Math.ceil(number) || 0;
  2230. } else {
  2231. return Math.floor(number);
  2232. }
  2233. }
  2234. function toInt(argumentForCoercion) {
  2235. var coercedNumber = +argumentForCoercion,
  2236. value = 0;
  2237. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  2238. value = absFloor(coercedNumber);
  2239. }
  2240. return value;
  2241. }
  2242. // compare two arrays, return the number of differences
  2243. function compareArrays(array1, array2, dontConvert) {
  2244. var len = Math.min(array1.length, array2.length),
  2245. lengthDiff = Math.abs(array1.length - array2.length),
  2246. diffs = 0,
  2247. i;
  2248. for (i = 0; i < len; i++) {
  2249. if ((dontConvert && array1[i] !== array2[i]) ||
  2250. (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
  2251. diffs++;
  2252. }
  2253. }
  2254. return diffs + lengthDiff;
  2255. }
  2256. function warn(msg) {
  2257. if (utils_hooks__hooks.suppressDeprecationWarnings === false &&
  2258. (typeof console !== 'undefined') && console.warn) {
  2259. console.warn('Deprecation warning: ' + msg);
  2260. }
  2261. }
  2262. function deprecate(msg, fn) {
  2263. var firstTime = true;
  2264. return extend(function () {
  2265. if (utils_hooks__hooks.deprecationHandler != null) {
  2266. utils_hooks__hooks.deprecationHandler(null, msg);
  2267. }
  2268. if (firstTime) {
  2269. var args = [];
  2270. var arg;
  2271. for (var i = 0; i < arguments.length; i++) {
  2272. arg = '';
  2273. if (typeof arguments[i] === 'object') {
  2274. arg += '\n[' + i + '] ';
  2275. for (var key in arguments[0]) {
  2276. arg += key + ': ' + arguments[0][key] + ', ';
  2277. }
  2278. arg = arg.slice(0, -2); // Remove trailing comma and space
  2279. } else {
  2280. arg = arguments[i];
  2281. }
  2282. args.push(arg);
  2283. }
  2284. warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack);
  2285. firstTime = false;
  2286. }
  2287. return fn.apply(this, arguments);
  2288. }, fn);
  2289. }
  2290. var deprecations = {};
  2291. function deprecateSimple(name, msg) {
  2292. if (utils_hooks__hooks.deprecationHandler != null) {
  2293. utils_hooks__hooks.deprecationHandler(name, msg);
  2294. }
  2295. if (!deprecations[name]) {
  2296. warn(msg);
  2297. deprecations[name] = true;
  2298. }
  2299. }
  2300. utils_hooks__hooks.suppressDeprecationWarnings = false;
  2301. utils_hooks__hooks.deprecationHandler = null;
  2302. function isFunction(input) {
  2303. return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
  2304. }
  2305. function locale_set__set (config) {
  2306. var prop, i;
  2307. for (i in config) {
  2308. prop = config[i];
  2309. if (isFunction(prop)) {
  2310. this[i] = prop;
  2311. } else {
  2312. this['_' + i] = prop;
  2313. }
  2314. }
  2315. this._config = config;
  2316. // Lenient ordinal parsing accepts just a number in addition to
  2317. // number + (possibly) stuff coming from _ordinalParseLenient.
  2318. this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
  2319. }
  2320. function mergeConfigs(parentConfig, childConfig) {
  2321. var res = extend({}, parentConfig), prop;
  2322. for (prop in childConfig) {
  2323. if (hasOwnProp(childConfig, prop)) {
  2324. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  2325. res[prop] = {};
  2326. extend(res[prop], parentConfig[prop]);
  2327. extend(res[prop], childConfig[prop]);
  2328. } else if (childConfig[prop] != null) {
  2329. res[prop] = childConfig[prop];
  2330. } else {
  2331. delete res[prop];
  2332. }
  2333. }
  2334. }
  2335. for (prop in parentConfig) {
  2336. if (hasOwnProp(parentConfig, prop) &&
  2337. !hasOwnProp(childConfig, prop) &&
  2338. isObject(parentConfig[prop])) {
  2339. // make sure changes to properties don't modify parent config
  2340. res[prop] = extend({}, res[prop]);
  2341. }
  2342. }
  2343. return res;
  2344. }
  2345. function Locale(config) {
  2346. if (config != null) {
  2347. this.set(config);
  2348. }
  2349. }
  2350. var keys;
  2351. if (Object.keys) {
  2352. keys = Object.keys;
  2353. } else {
  2354. keys = function (obj) {
  2355. var i, res = [];
  2356. for (i in obj) {
  2357. if (hasOwnProp(obj, i)) {
  2358. res.push(i);
  2359. }
  2360. }
  2361. return res;
  2362. };
  2363. }
  2364. var defaultCalendar = {
  2365. sameDay : '[Today at] LT',
  2366. nextDay : '[Tomorrow at] LT',
  2367. nextWeek : 'dddd [at] LT',
  2368. lastDay : '[Yesterday at] LT',
  2369. lastWeek : '[Last] dddd [at] LT',
  2370. sameElse : 'L'
  2371. };
  2372. function locale_calendar__calendar (key, mom, now) {
  2373. var output = this._calendar[key] || this._calendar['sameElse'];
  2374. return isFunction(output) ? output.call(mom, now) : output;
  2375. }
  2376. var defaultLongDateFormat = {
  2377. LTS : 'h:mm:ss A',
  2378. LT : 'h:mm A',
  2379. L : 'MM/DD/YYYY',
  2380. LL : 'MMMM D, YYYY',
  2381. LLL : 'MMMM D, YYYY h:mm A',
  2382. LLLL : 'dddd, MMMM D, YYYY h:mm A'
  2383. };
  2384. function longDateFormat (key) {
  2385. var format = this._longDateFormat[key],
  2386. formatUpper = this._longDateFormat[key.toUpperCase()];
  2387. if (format || !formatUpper) {
  2388. return format;
  2389. }
  2390. this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
  2391. return val.slice(1);
  2392. });
  2393. return this._longDateFormat[key];
  2394. }
  2395. var defaultInvalidDate = 'Invalid date';
  2396. function invalidDate () {
  2397. return this._invalidDate;
  2398. }
  2399. var defaultOrdinal = '%d';
  2400. var defaultOrdinalParse = /\d{1,2}/;
  2401. function ordinal (number) {
  2402. return this._ordinal.replace('%d', number);
  2403. }
  2404. var defaultRelativeTime = {
  2405. future : 'in %s',
  2406. past : '%s ago',
  2407. s : 'a few seconds',
  2408. m : 'a minute',
  2409. mm : '%d minutes',
  2410. h : 'an hour',
  2411. hh : '%d hours',
  2412. d : 'a day',
  2413. dd : '%d days',
  2414. M : 'a month',
  2415. MM : '%d months',
  2416. y : 'a year',
  2417. yy : '%d years'
  2418. };
  2419. function relative__relativeTime (number, withoutSuffix, string, isFuture) {
  2420. var output = this._relativeTime[string];
  2421. return (isFunction(output)) ?
  2422. output(number, withoutSuffix, string, isFuture) :
  2423. output.replace(/%d/i, number);
  2424. }
  2425. function pastFuture (diff, output) {
  2426. var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  2427. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  2428. }
  2429. var aliases = {};
  2430. function addUnitAlias (unit, shorthand) {
  2431. var lowerCase = unit.toLowerCase();
  2432. aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
  2433. }
  2434. function normalizeUnits(units) {
  2435. return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
  2436. }
  2437. function normalizeObjectUnits(inputObject) {
  2438. var normalizedInput = {},
  2439. normalizedProp,
  2440. prop;
  2441. for (prop in inputObject) {
  2442. if (hasOwnProp(inputObject, prop)) {
  2443. normalizedProp = normalizeUnits(prop);
  2444. if (normalizedProp) {
  2445. normalizedInput[normalizedProp] = inputObject[prop];
  2446. }
  2447. }
  2448. }
  2449. return normalizedInput;
  2450. }
  2451. var priorities = {};
  2452. function addUnitPriority(unit, priority) {
  2453. priorities[unit] = priority;
  2454. }
  2455. function getPrioritizedUnits(unitsObj) {
  2456. var units = [];
  2457. for (var u in unitsObj) {
  2458. units.push({unit: u, priority: priorities[u]});
  2459. }
  2460. units.sort(function (a, b) {
  2461. return a.priority - b.priority;
  2462. });
  2463. return units;
  2464. }
  2465. function makeGetSet (unit, keepTime) {
  2466. return function (value) {
  2467. if (value != null) {
  2468. get_set__set(this, unit, value);
  2469. utils_hooks__hooks.updateOffset(this, keepTime);
  2470. return this;
  2471. } else {
  2472. return get_set__get(this, unit);
  2473. }
  2474. };
  2475. }
  2476. function get_set__get (mom, unit) {
  2477. return mom.isValid() ?
  2478. mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
  2479. }
  2480. function get_set__set (mom, unit, value) {
  2481. if (mom.isValid()) {
  2482. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
  2483. }
  2484. }
  2485. // MOMENTS
  2486. function stringGet (units) {
  2487. units = normalizeUnits(units);
  2488. if (isFunction(this[units])) {
  2489. return this[units]();
  2490. }
  2491. return this;
  2492. }
  2493. function stringSet (units, value) {
  2494. if (typeof units === 'object') {
  2495. units = normalizeObjectUnits(units);
  2496. var prioritized = getPrioritizedUnits(units);
  2497. for (var i = 0; i < prioritized.length; i++) {
  2498. this[prioritized[i].unit](units[prioritized[i].unit]);
  2499. }
  2500. } else {
  2501. units = normalizeUnits(units);
  2502. if (isFunction(this[units])) {
  2503. return this[units](value);
  2504. }
  2505. }
  2506. return this;
  2507. }
  2508. function zeroFill(number, targetLength, forceSign) {
  2509. var absNumber = '' + Math.abs(number),
  2510. zerosToFill = targetLength - absNumber.length,
  2511. sign = number >= 0;
  2512. return (sign ? (forceSign ? '+' : '') : '-') +
  2513. Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
  2514. }
  2515. var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
  2516. var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
  2517. var formatFunctions = {};
  2518. var formatTokenFunctions = {};
  2519. // token: 'M'
  2520. // padded: ['MM', 2]
  2521. // ordinal: 'Mo'
  2522. // callback: function () { this.month() + 1 }
  2523. function addFormatToken (token, padded, ordinal, callback) {
  2524. var func = callback;
  2525. if (typeof callback === 'string') {
  2526. func = function () {
  2527. return this[callback]();
  2528. };
  2529. }
  2530. if (token) {
  2531. formatTokenFunctions[token] = func;
  2532. }
  2533. if (padded) {
  2534. formatTokenFunctions[padded[0]] = function () {
  2535. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  2536. };
  2537. }
  2538. if (ordinal) {
  2539. formatTokenFunctions[ordinal] = function () {
  2540. return this.localeData().ordinal(func.apply(this, arguments), token);
  2541. };
  2542. }
  2543. }
  2544. function removeFormattingTokens(input) {
  2545. if (input.match(/\[[\s\S]/)) {
  2546. return input.replace(/^\[|\]$/g, '');
  2547. }
  2548. return input.replace(/\\/g, '');
  2549. }
  2550. function makeFormatFunction(format) {
  2551. var array = format.match(formattingTokens), i, length;
  2552. for (i = 0, length = array.length; i < length; i++) {
  2553. if (formatTokenFunctions[array[i]]) {
  2554. array[i] = formatTokenFunctions[array[i]];
  2555. } else {
  2556. array[i] = removeFormattingTokens(array[i]);
  2557. }
  2558. }
  2559. return function (mom) {
  2560. var output = '', i;
  2561. for (i = 0; i < length; i++) {
  2562. output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
  2563. }
  2564. return output;
  2565. };
  2566. }
  2567. // format date using native date object
  2568. function formatMoment(m, format) {
  2569. if (!m.isValid()) {
  2570. return m.localeData().invalidDate();
  2571. }
  2572. format = expandFormat(format, m.localeData());
  2573. formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
  2574. return formatFunctions[format](m);
  2575. }
  2576. function expandFormat(format, locale) {
  2577. var i = 5;
  2578. function replaceLongDateFormatTokens(input) {
  2579. return locale.longDateFormat(input) || input;
  2580. }
  2581. localFormattingTokens.lastIndex = 0;
  2582. while (i >= 0 && localFormattingTokens.test(format)) {
  2583. format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
  2584. localFormattingTokens.lastIndex = 0;
  2585. i -= 1;
  2586. }
  2587. return format;
  2588. }
  2589. var match1 = /\d/; // 0 - 9
  2590. var match2 = /\d\d/; // 00 - 99
  2591. var match3 = /\d{3}/; // 000 - 999
  2592. var match4 = /\d{4}/; // 0000 - 9999
  2593. var match6 = /[+-]?\d{6}/; // -999999 - 999999
  2594. var match1to2 = /\d\d?/; // 0 - 99
  2595. var match3to4 = /\d\d\d\d?/; // 999 - 9999
  2596. var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
  2597. var match1to3 = /\d{1,3}/; // 0 - 999
  2598. var match1to4 = /\d{1,4}/; // 0 - 9999
  2599. var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
  2600. var matchUnsigned = /\d+/; // 0 - inf
  2601. var matchSigned = /[+-]?\d+/; // -inf - inf
  2602. var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
  2603. var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  2604. var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
  2605. // any word (or two) characters or numbers including two/three word month in arabic.
  2606. // includes scottish gaelic two word and hyphenated months
  2607. var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
  2608. var regexes = {};
  2609. function addRegexToken (token, regex, strictRegex) {
  2610. regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
  2611. return (isStrict && strictRegex) ? strictRegex : regex;
  2612. };
  2613. }
  2614. function getParseRegexForToken (token, config) {
  2615. if (!hasOwnProp(regexes, token)) {
  2616. return new RegExp(unescapeFormat(token));
  2617. }
  2618. return regexes[token](config._strict, config._locale);
  2619. }
  2620. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  2621. function unescapeFormat(s) {
  2622. return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
  2623. return p1 || p2 || p3 || p4;
  2624. }));
  2625. }
  2626. function regexEscape(s) {
  2627. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  2628. }
  2629. var tokens = {};
  2630. function addParseToken (token, callback) {
  2631. var i, func = callback;
  2632. if (typeof token === 'string') {
  2633. token = [token];
  2634. }
  2635. if (typeof callback === 'number') {
  2636. func = function (input, array) {
  2637. array[callback] = toInt(input);
  2638. };
  2639. }
  2640. for (i = 0; i < token.length; i++) {
  2641. tokens[token[i]] = func;
  2642. }
  2643. }
  2644. function addWeekParseToken (token, callback) {
  2645. addParseToken(token, function (input, array, config, token) {
  2646. config._w = config._w || {};
  2647. callback(input, config._w, config, token);
  2648. });
  2649. }
  2650. function addTimeToArrayFromToken(token, input, config) {
  2651. if (input != null && hasOwnProp(tokens, token)) {
  2652. tokens[token](input, config._a, config, token);
  2653. }
  2654. }
  2655. var YEAR = 0;
  2656. var MONTH = 1;
  2657. var DATE = 2;
  2658. var HOUR = 3;
  2659. var MINUTE = 4;
  2660. var SECOND = 5;
  2661. var MILLISECOND = 6;
  2662. var WEEK = 7;
  2663. var WEEKDAY = 8;
  2664. var indexOf;
  2665. if (Array.prototype.indexOf) {
  2666. indexOf = Array.prototype.indexOf;
  2667. } else {
  2668. indexOf = function (o) {
  2669. // I know
  2670. var i;
  2671. for (i = 0; i < this.length; ++i) {
  2672. if (this[i] === o) {
  2673. return i;
  2674. }
  2675. }
  2676. return -1;
  2677. };
  2678. }
  2679. function daysInMonth(year, month) {
  2680. return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
  2681. }
  2682. // FORMATTING
  2683. addFormatToken('M', ['MM', 2], 'Mo', function () {
  2684. return this.month() + 1;
  2685. });
  2686. addFormatToken('MMM', 0, 0, function (format) {
  2687. return this.localeData().monthsShort(this, format);
  2688. });
  2689. addFormatToken('MMMM', 0, 0, function (format) {
  2690. return this.localeData().months(this, format);
  2691. });
  2692. // ALIASES
  2693. addUnitAlias('month', 'M');
  2694. // PRIORITY
  2695. addUnitPriority('month', 8);
  2696. // PARSING
  2697. addRegexToken('M', match1to2);
  2698. addRegexToken('MM', match1to2, match2);
  2699. addRegexToken('MMM', function (isStrict, locale) {
  2700. return locale.monthsShortRegex(isStrict);
  2701. });
  2702. addRegexToken('MMMM', function (isStrict, locale) {
  2703. return locale.monthsRegex(isStrict);
  2704. });
  2705. addParseToken(['M', 'MM'], function (input, array) {
  2706. array[MONTH] = toInt(input) - 1;
  2707. });
  2708. addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
  2709. var month = config._locale.monthsParse(input, token, config._strict);
  2710. // if we didn't find a month name, mark the date as invalid.
  2711. if (month != null) {
  2712. array[MONTH] = month;
  2713. } else {
  2714. getParsingFlags(config).invalidMonth = input;
  2715. }
  2716. });
  2717. // LOCALES
  2718. var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
  2719. var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
  2720. function localeMonths (m, format) {
  2721. if (!m) {
  2722. return this._months;
  2723. }
  2724. return isArray(this._months) ? this._months[m.month()] :
  2725. this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];
  2726. }
  2727. var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
  2728. function localeMonthsShort (m, format) {
  2729. if (!m) {
  2730. return this._monthsShort;
  2731. }
  2732. return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
  2733. this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
  2734. }
  2735. function units_month__handleStrictParse(monthName, format, strict) {
  2736. var i, ii, mom, llc = monthName.toLocaleLowerCase();
  2737. if (!this._monthsParse) {
  2738. // this is not used
  2739. this._monthsParse = [];
  2740. this._longMonthsParse = [];
  2741. this._shortMonthsParse = [];
  2742. for (i = 0; i < 12; ++i) {
  2743. mom = create_utc__createUTC([2000, i]);
  2744. this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
  2745. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  2746. }
  2747. }
  2748. if (strict) {
  2749. if (format === 'MMM') {
  2750. ii = indexOf.call(this._shortMonthsParse, llc);
  2751. return ii !== -1 ? ii : null;
  2752. } else {
  2753. ii = indexOf.call(this._longMonthsParse, llc);
  2754. return ii !== -1 ? ii : null;
  2755. }
  2756. } else {
  2757. if (format === 'MMM') {
  2758. ii = indexOf.call(this._shortMonthsParse, llc);
  2759. if (ii !== -1) {
  2760. return ii;
  2761. }
  2762. ii = indexOf.call(this._longMonthsParse, llc);
  2763. return ii !== -1 ? ii : null;
  2764. } else {
  2765. ii = indexOf.call(this._longMonthsParse, llc);
  2766. if (ii !== -1) {
  2767. return ii;
  2768. }
  2769. ii = indexOf.call(this._shortMonthsParse, llc);
  2770. return ii !== -1 ? ii : null;
  2771. }
  2772. }
  2773. }
  2774. function localeMonthsParse (monthName, format, strict) {
  2775. var i, mom, regex;
  2776. if (this._monthsParseExact) {
  2777. return units_month__handleStrictParse.call(this, monthName, format, strict);
  2778. }
  2779. if (!this._monthsParse) {
  2780. this._monthsParse = [];
  2781. this._longMonthsParse = [];
  2782. this._shortMonthsParse = [];
  2783. }
  2784. // TODO: add sorting
  2785. // Sorting makes sure if one month (or abbr) is a prefix of another
  2786. // see sorting in computeMonthsParse
  2787. for (i = 0; i < 12; i++) {
  2788. // make the regex if we don't have it already
  2789. mom = create_utc__createUTC([2000, i]);
  2790. if (strict && !this._longMonthsParse[i]) {
  2791. this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
  2792. this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
  2793. }
  2794. if (!strict && !this._monthsParse[i]) {
  2795. regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
  2796. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  2797. }
  2798. // test the regex
  2799. if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
  2800. return i;
  2801. } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
  2802. return i;
  2803. } else if (!strict && this._monthsParse[i].test(monthName)) {
  2804. return i;
  2805. }
  2806. }
  2807. }
  2808. // MOMENTS
  2809. function setMonth (mom, value) {
  2810. var dayOfMonth;
  2811. if (!mom.isValid()) {
  2812. // No op
  2813. return mom;
  2814. }
  2815. if (typeof value === 'string') {
  2816. if (/^\d+$/.test(value)) {
  2817. value = toInt(value);
  2818. } else {
  2819. value = mom.localeData().monthsParse(value);
  2820. // TODO: Another silent failure?
  2821. if (typeof value !== 'number') {
  2822. return mom;
  2823. }
  2824. }
  2825. }
  2826. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  2827. mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  2828. return mom;
  2829. }
  2830. function getSetMonth (value) {
  2831. if (value != null) {
  2832. setMonth(this, value);
  2833. utils_hooks__hooks.updateOffset(this, true);
  2834. return this;
  2835. } else {
  2836. return get_set__get(this, 'Month');
  2837. }
  2838. }
  2839. function getDaysInMonth () {
  2840. return daysInMonth(this.year(), this.month());
  2841. }
  2842. var defaultMonthsShortRegex = matchWord;
  2843. function monthsShortRegex (isStrict) {
  2844. if (this._monthsParseExact) {
  2845. if (!hasOwnProp(this, '_monthsRegex')) {
  2846. computeMonthsParse.call(this);
  2847. }
  2848. if (isStrict) {
  2849. return this._monthsShortStrictRegex;
  2850. } else {
  2851. return this._monthsShortRegex;
  2852. }
  2853. } else {
  2854. if (!hasOwnProp(this, '_monthsShortRegex')) {
  2855. this._monthsShortRegex = defaultMonthsShortRegex;
  2856. }
  2857. return this._monthsShortStrictRegex && isStrict ?
  2858. this._monthsShortStrictRegex : this._monthsShortRegex;
  2859. }
  2860. }
  2861. var defaultMonthsRegex = matchWord;
  2862. function monthsRegex (isStrict) {
  2863. if (this._monthsParseExact) {
  2864. if (!hasOwnProp(this, '_monthsRegex')) {
  2865. computeMonthsParse.call(this);
  2866. }
  2867. if (isStrict) {
  2868. return this._monthsStrictRegex;
  2869. } else {
  2870. return this._monthsRegex;
  2871. }
  2872. } else {
  2873. if (!hasOwnProp(this, '_monthsRegex')) {
  2874. this._monthsRegex = defaultMonthsRegex;
  2875. }
  2876. return this._monthsStrictRegex && isStrict ?
  2877. this._monthsStrictRegex : this._monthsRegex;
  2878. }
  2879. }
  2880. function computeMonthsParse () {
  2881. function cmpLenRev(a, b) {
  2882. return b.length - a.length;
  2883. }
  2884. var shortPieces = [], longPieces = [], mixedPieces = [],
  2885. i, mom;
  2886. for (i = 0; i < 12; i++) {
  2887. // make the regex if we don't have it already
  2888. mom = create_utc__createUTC([2000, i]);
  2889. shortPieces.push(this.monthsShort(mom, ''));
  2890. longPieces.push(this.months(mom, ''));
  2891. mixedPieces.push(this.months(mom, ''));
  2892. mixedPieces.push(this.monthsShort(mom, ''));
  2893. }
  2894. // Sorting makes sure if one month (or abbr) is a prefix of another it
  2895. // will match the longer piece.
  2896. shortPieces.sort(cmpLenRev);
  2897. longPieces.sort(cmpLenRev);
  2898. mixedPieces.sort(cmpLenRev);
  2899. for (i = 0; i < 12; i++) {
  2900. shortPieces[i] = regexEscape(shortPieces[i]);
  2901. longPieces[i] = regexEscape(longPieces[i]);
  2902. }
  2903. for (i = 0; i < 24; i++) {
  2904. mixedPieces[i] = regexEscape(mixedPieces[i]);
  2905. }
  2906. this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  2907. this._monthsShortRegex = this._monthsRegex;
  2908. this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  2909. this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  2910. }
  2911. // FORMATTING
  2912. addFormatToken('Y', 0, 0, function () {
  2913. var y = this.year();
  2914. return y <= 9999 ? '' + y : '+' + y;
  2915. });
  2916. addFormatToken(0, ['YY', 2], 0, function () {
  2917. return this.year() % 100;
  2918. });
  2919. addFormatToken(0, ['YYYY', 4], 0, 'year');
  2920. addFormatToken(0, ['YYYYY', 5], 0, 'year');
  2921. addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  2922. // ALIASES
  2923. addUnitAlias('year', 'y');
  2924. // PRIORITIES
  2925. addUnitPriority('year', 1);
  2926. // PARSING
  2927. addRegexToken('Y', matchSigned);
  2928. addRegexToken('YY', match1to2, match2);
  2929. addRegexToken('YYYY', match1to4, match4);
  2930. addRegexToken('YYYYY', match1to6, match6);
  2931. addRegexToken('YYYYYY', match1to6, match6);
  2932. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  2933. addParseToken('YYYY', function (input, array) {
  2934. array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input);
  2935. });
  2936. addParseToken('YY', function (input, array) {
  2937. array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input);
  2938. });
  2939. addParseToken('Y', function (input, array) {
  2940. array[YEAR] = parseInt(input, 10);
  2941. });
  2942. // HELPERS
  2943. function daysInYear(year) {
  2944. return isLeapYear(year) ? 366 : 365;
  2945. }
  2946. function isLeapYear(year) {
  2947. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  2948. }
  2949. // HOOKS
  2950. utils_hooks__hooks.parseTwoDigitYear = function (input) {
  2951. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  2952. };
  2953. // MOMENTS
  2954. var getSetYear = makeGetSet('FullYear', true);
  2955. function getIsLeapYear () {
  2956. return isLeapYear(this.year());
  2957. }
  2958. function createDate (y, m, d, h, M, s, ms) {
  2959. //can't just apply() to create a date:
  2960. //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
  2961. var date = new Date(y, m, d, h, M, s, ms);
  2962. //the date constructor remaps years 0-99 to 1900-1999
  2963. if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
  2964. date.setFullYear(y);
  2965. }
  2966. return date;
  2967. }
  2968. function createUTCDate (y) {
  2969. var date = new Date(Date.UTC.apply(null, arguments));
  2970. //the Date.UTC function remaps years 0-99 to 1900-1999
  2971. if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
  2972. date.setUTCFullYear(y);
  2973. }
  2974. return date;
  2975. }
  2976. // start-of-first-week - start-of-year
  2977. function firstWeekOffset(year, dow, doy) {
  2978. var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  2979. fwd = 7 + dow - doy,
  2980. // first-week day local weekday -- which local weekday is fwd
  2981. fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  2982. return -fwdlw + fwd - 1;
  2983. }
  2984. //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  2985. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  2986. var localWeekday = (7 + weekday - dow) % 7,
  2987. weekOffset = firstWeekOffset(year, dow, doy),
  2988. dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
  2989. resYear, resDayOfYear;
  2990. if (dayOfYear <= 0) {
  2991. resYear = year - 1;
  2992. resDayOfYear = daysInYear(resYear) + dayOfYear;
  2993. } else if (dayOfYear > daysInYear(year)) {
  2994. resYear = year + 1;
  2995. resDayOfYear = dayOfYear - daysInYear(year);
  2996. } else {
  2997. resYear = year;
  2998. resDayOfYear = dayOfYear;
  2999. }
  3000. return {
  3001. year: resYear,
  3002. dayOfYear: resDayOfYear
  3003. };
  3004. }
  3005. function weekOfYear(mom, dow, doy) {
  3006. var weekOffset = firstWeekOffset(mom.year(), dow, doy),
  3007. week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
  3008. resWeek, resYear;
  3009. if (week < 1) {
  3010. resYear = mom.year() - 1;
  3011. resWeek = week + weeksInYear(resYear, dow, doy);
  3012. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  3013. resWeek = week - weeksInYear(mom.year(), dow, doy);
  3014. resYear = mom.year() + 1;
  3015. } else {
  3016. resYear = mom.year();
  3017. resWeek = week;
  3018. }
  3019. return {
  3020. week: resWeek,
  3021. year: resYear
  3022. };
  3023. }
  3024. function weeksInYear(year, dow, doy) {
  3025. var weekOffset = firstWeekOffset(year, dow, doy),
  3026. weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  3027. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  3028. }
  3029. // FORMATTING
  3030. addFormatToken('w', ['ww', 2], 'wo', 'week');
  3031. addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  3032. // ALIASES
  3033. addUnitAlias('week', 'w');
  3034. addUnitAlias('isoWeek', 'W');
  3035. // PRIORITIES
  3036. addUnitPriority('week', 5);
  3037. addUnitPriority('isoWeek', 5);
  3038. // PARSING
  3039. addRegexToken('w', match1to2);
  3040. addRegexToken('ww', match1to2, match2);
  3041. addRegexToken('W', match1to2);
  3042. addRegexToken('WW', match1to2, match2);
  3043. addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
  3044. week[token.substr(0, 1)] = toInt(input);
  3045. });
  3046. // HELPERS
  3047. // LOCALES
  3048. function localeWeek (mom) {
  3049. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  3050. }
  3051. var defaultLocaleWeek = {
  3052. dow : 0, // Sunday is the first day of the week.
  3053. doy : 6 // The week that contains Jan 1st is the first week of the year.
  3054. };
  3055. function localeFirstDayOfWeek () {
  3056. return this._week.dow;
  3057. }
  3058. function localeFirstDayOfYear () {
  3059. return this._week.doy;
  3060. }
  3061. // MOMENTS
  3062. function getSetWeek (input) {
  3063. var week = this.localeData().week(this);
  3064. return input == null ? week : this.add((input - week) * 7, 'd');
  3065. }
  3066. function getSetISOWeek (input) {
  3067. var week = weekOfYear(this, 1, 4).week;
  3068. return input == null ? week : this.add((input - week) * 7, 'd');
  3069. }
  3070. // FORMATTING
  3071. addFormatToken('d', 0, 'do', 'day');
  3072. addFormatToken('dd', 0, 0, function (format) {
  3073. return this.localeData().weekdaysMin(this, format);
  3074. });
  3075. addFormatToken('ddd', 0, 0, function (format) {
  3076. return this.localeData().weekdaysShort(this, format);
  3077. });
  3078. addFormatToken('dddd', 0, 0, function (format) {
  3079. return this.localeData().weekdays(this, format);
  3080. });
  3081. addFormatToken('e', 0, 0, 'weekday');
  3082. addFormatToken('E', 0, 0, 'isoWeekday');
  3083. // ALIASES
  3084. addUnitAlias('day', 'd');
  3085. addUnitAlias('weekday', 'e');
  3086. addUnitAlias('isoWeekday', 'E');
  3087. // PRIORITY
  3088. addUnitPriority('day', 11);
  3089. addUnitPriority('weekday', 11);
  3090. addUnitPriority('isoWeekday', 11);
  3091. // PARSING
  3092. addRegexToken('d', match1to2);
  3093. addRegexToken('e', match1to2);
  3094. addRegexToken('E', match1to2);
  3095. addRegexToken('dd', function (isStrict, locale) {
  3096. return locale.weekdaysMinRegex(isStrict);
  3097. });
  3098. addRegexToken('ddd', function (isStrict, locale) {
  3099. return locale.weekdaysShortRegex(isStrict);
  3100. });
  3101. addRegexToken('dddd', function (isStrict, locale) {
  3102. return locale.weekdaysRegex(isStrict);
  3103. });
  3104. addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
  3105. var weekday = config._locale.weekdaysParse(input, token, config._strict);
  3106. // if we didn't get a weekday name, mark the date as invalid
  3107. if (weekday != null) {
  3108. week.d = weekday;
  3109. } else {
  3110. getParsingFlags(config).invalidWeekday = input;
  3111. }
  3112. });
  3113. addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
  3114. week[token] = toInt(input);
  3115. });
  3116. // HELPERS
  3117. function parseWeekday(input, locale) {
  3118. if (typeof input !== 'string') {
  3119. return input;
  3120. }
  3121. if (!isNaN(input)) {
  3122. return parseInt(input, 10);
  3123. }
  3124. input = locale.weekdaysParse(input);
  3125. if (typeof input === 'number') {
  3126. return input;
  3127. }
  3128. return null;
  3129. }
  3130. function parseIsoWeekday(input, locale) {
  3131. if (typeof input === 'string') {
  3132. return locale.weekdaysParse(input) % 7 || 7;
  3133. }
  3134. return isNaN(input) ? null : input;
  3135. }
  3136. // LOCALES
  3137. var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
  3138. function localeWeekdays (m, format) {
  3139. if (!m) {
  3140. return this._weekdays;
  3141. }
  3142. return isArray(this._weekdays) ? this._weekdays[m.day()] :
  3143. this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
  3144. }
  3145. var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
  3146. function localeWeekdaysShort (m) {
  3147. return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;
  3148. }
  3149. var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
  3150. function localeWeekdaysMin (m) {
  3151. return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;
  3152. }
  3153. function day_of_week__handleStrictParse(weekdayName, format, strict) {
  3154. var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
  3155. if (!this._weekdaysParse) {
  3156. this._weekdaysParse = [];
  3157. this._shortWeekdaysParse = [];
  3158. this._minWeekdaysParse = [];
  3159. for (i = 0; i < 7; ++i) {
  3160. mom = create_utc__createUTC([2000, 1]).day(i);
  3161. this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();
  3162. this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();
  3163. this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
  3164. }
  3165. }
  3166. if (strict) {
  3167. if (format === 'dddd') {
  3168. ii = indexOf.call(this._weekdaysParse, llc);
  3169. return ii !== -1 ? ii : null;
  3170. } else if (format === 'ddd') {
  3171. ii = indexOf.call(this._shortWeekdaysParse, llc);
  3172. return ii !== -1 ? ii : null;
  3173. } else {
  3174. ii = indexOf.call(this._minWeekdaysParse, llc);
  3175. return ii !== -1 ? ii : null;
  3176. }
  3177. } else {
  3178. if (format === 'dddd') {
  3179. ii = indexOf.call(this._weekdaysParse, llc);
  3180. if (ii !== -1) {
  3181. return ii;
  3182. }
  3183. ii = indexOf.call(this._shortWeekdaysParse, llc);
  3184. if (ii !== -1) {
  3185. return ii;
  3186. }
  3187. ii = indexOf.call(this._minWeekdaysParse, llc);
  3188. return ii !== -1 ? ii : null;
  3189. } else if (format === 'ddd') {
  3190. ii = indexOf.call(this._shortWeekdaysParse, llc);
  3191. if (ii !== -1) {
  3192. return ii;
  3193. }
  3194. ii = indexOf.call(this._weekdaysParse, llc);
  3195. if (ii !== -1) {
  3196. return ii;
  3197. }
  3198. ii = indexOf.call(this._minWeekdaysParse, llc);
  3199. return ii !== -1 ? ii : null;
  3200. } else {
  3201. ii = indexOf.call(this._minWeekdaysParse, llc);
  3202. if (ii !== -1) {
  3203. return ii;
  3204. }
  3205. ii = indexOf.call(this._weekdaysParse, llc);
  3206. if (ii !== -1) {
  3207. return ii;
  3208. }
  3209. ii = indexOf.call(this._shortWeekdaysParse, llc);
  3210. return ii !== -1 ? ii : null;
  3211. }
  3212. }
  3213. }
  3214. function localeWeekdaysParse (weekdayName, format, strict) {
  3215. var i, mom, regex;
  3216. if (this._weekdaysParseExact) {
  3217. return day_of_week__handleStrictParse.call(this, weekdayName, format, strict);
  3218. }
  3219. if (!this._weekdaysParse) {
  3220. this._weekdaysParse = [];
  3221. this._minWeekdaysParse = [];
  3222. this._shortWeekdaysParse = [];
  3223. this._fullWeekdaysParse = [];
  3224. }
  3225. for (i = 0; i < 7; i++) {
  3226. // make the regex if we don't have it already
  3227. mom = create_utc__createUTC([2000, 1]).day(i);
  3228. if (strict && !this._fullWeekdaysParse[i]) {
  3229. this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
  3230. this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
  3231. this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
  3232. }
  3233. if (!this._weekdaysParse[i]) {
  3234. regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
  3235. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  3236. }
  3237. // test the regex
  3238. if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
  3239. return i;
  3240. } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
  3241. return i;
  3242. } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
  3243. return i;
  3244. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  3245. return i;
  3246. }
  3247. }
  3248. }
  3249. // MOMENTS
  3250. function getSetDayOfWeek (input) {
  3251. if (!this.isValid()) {
  3252. return input != null ? this : NaN;
  3253. }
  3254. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  3255. if (input != null) {
  3256. input = parseWeekday(input, this.localeData());
  3257. return this.add(input - day, 'd');
  3258. } else {
  3259. return day;
  3260. }
  3261. }
  3262. function getSetLocaleDayOfWeek (input) {
  3263. if (!this.isValid()) {
  3264. return input != null ? this : NaN;
  3265. }
  3266. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  3267. return input == null ? weekday : this.add(input - weekday, 'd');
  3268. }
  3269. function getSetISODayOfWeek (input) {
  3270. if (!this.isValid()) {
  3271. return input != null ? this : NaN;
  3272. }
  3273. // behaves the same as moment#day except
  3274. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  3275. // as a setter, sunday should belong to the previous week.
  3276. if (input != null) {
  3277. var weekday = parseIsoWeekday(input, this.localeData());
  3278. return this.day(this.day() % 7 ? weekday : weekday - 7);
  3279. } else {
  3280. return this.day() || 7;
  3281. }
  3282. }
  3283. var defaultWeekdaysRegex = matchWord;
  3284. function weekdaysRegex (isStrict) {
  3285. if (this._weekdaysParseExact) {
  3286. if (!hasOwnProp(this, '_weekdaysRegex')) {
  3287. computeWeekdaysParse.call(this);
  3288. }
  3289. if (isStrict) {
  3290. return this._weekdaysStrictRegex;
  3291. } else {
  3292. return this._weekdaysRegex;
  3293. }
  3294. } else {
  3295. if (!hasOwnProp(this, '_weekdaysRegex')) {
  3296. this._weekdaysRegex = defaultWeekdaysRegex;
  3297. }
  3298. return this._weekdaysStrictRegex && isStrict ?
  3299. this._weekdaysStrictRegex : this._weekdaysRegex;
  3300. }
  3301. }
  3302. var defaultWeekdaysShortRegex = matchWord;
  3303. function weekdaysShortRegex (isStrict) {
  3304. if (this._weekdaysParseExact) {
  3305. if (!hasOwnProp(this, '_weekdaysRegex')) {
  3306. computeWeekdaysParse.call(this);
  3307. }
  3308. if (isStrict) {
  3309. return this._weekdaysShortStrictRegex;
  3310. } else {
  3311. return this._weekdaysShortRegex;
  3312. }
  3313. } else {
  3314. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  3315. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  3316. }
  3317. return this._weekdaysShortStrictRegex && isStrict ?
  3318. this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
  3319. }
  3320. }
  3321. var defaultWeekdaysMinRegex = matchWord;
  3322. function weekdaysMinRegex (isStrict) {
  3323. if (this._weekdaysParseExact) {
  3324. if (!hasOwnProp(this, '_weekdaysRegex')) {
  3325. computeWeekdaysParse.call(this);
  3326. }
  3327. if (isStrict) {
  3328. return this._weekdaysMinStrictRegex;
  3329. } else {
  3330. return this._weekdaysMinRegex;
  3331. }
  3332. } else {
  3333. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  3334. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  3335. }
  3336. return this._weekdaysMinStrictRegex && isStrict ?
  3337. this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
  3338. }
  3339. }
  3340. function computeWeekdaysParse () {
  3341. function cmpLenRev(a, b) {
  3342. return b.length - a.length;
  3343. }
  3344. var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],
  3345. i, mom, minp, shortp, longp;
  3346. for (i = 0; i < 7; i++) {
  3347. // make the regex if we don't have it already
  3348. mom = create_utc__createUTC([2000, 1]).day(i);
  3349. minp = this.weekdaysMin(mom, '');
  3350. shortp = this.weekdaysShort(mom, '');
  3351. longp = this.weekdays(mom, '');
  3352. minPieces.push(minp);
  3353. shortPieces.push(shortp);
  3354. longPieces.push(longp);
  3355. mixedPieces.push(minp);
  3356. mixedPieces.push(shortp);
  3357. mixedPieces.push(longp);
  3358. }
  3359. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  3360. // will match the longer piece.
  3361. minPieces.sort(cmpLenRev);
  3362. shortPieces.sort(cmpLenRev);
  3363. longPieces.sort(cmpLenRev);
  3364. mixedPieces.sort(cmpLenRev);
  3365. for (i = 0; i < 7; i++) {
  3366. shortPieces[i] = regexEscape(shortPieces[i]);
  3367. longPieces[i] = regexEscape(longPieces[i]);
  3368. mixedPieces[i] = regexEscape(mixedPieces[i]);
  3369. }
  3370. this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  3371. this._weekdaysShortRegex = this._weekdaysRegex;
  3372. this._weekdaysMinRegex = this._weekdaysRegex;
  3373. this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');
  3374. this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');
  3375. this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');
  3376. }
  3377. // FORMATTING
  3378. function hFormat() {
  3379. return this.hours() % 12 || 12;
  3380. }
  3381. function kFormat() {
  3382. return this.hours() || 24;
  3383. }
  3384. addFormatToken('H', ['HH', 2], 0, 'hour');
  3385. addFormatToken('h', ['hh', 2], 0, hFormat);
  3386. addFormatToken('k', ['kk', 2], 0, kFormat);
  3387. addFormatToken('hmm', 0, 0, function () {
  3388. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  3389. });
  3390. addFormatToken('hmmss', 0, 0, function () {
  3391. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
  3392. zeroFill(this.seconds(), 2);
  3393. });
  3394. addFormatToken('Hmm', 0, 0, function () {
  3395. return '' + this.hours() + zeroFill(this.minutes(), 2);
  3396. });
  3397. addFormatToken('Hmmss', 0, 0, function () {
  3398. return '' + this.hours() + zeroFill(this.minutes(), 2) +
  3399. zeroFill(this.seconds(), 2);
  3400. });
  3401. function meridiem (token, lowercase) {
  3402. addFormatToken(token, 0, 0, function () {
  3403. return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
  3404. });
  3405. }
  3406. meridiem('a', true);
  3407. meridiem('A', false);
  3408. // ALIASES
  3409. addUnitAlias('hour', 'h');
  3410. // PRIORITY
  3411. addUnitPriority('hour', 13);
  3412. // PARSING
  3413. function matchMeridiem (isStrict, locale) {
  3414. return locale._meridiemParse;
  3415. }
  3416. addRegexToken('a', matchMeridiem);
  3417. addRegexToken('A', matchMeridiem);
  3418. addRegexToken('H', match1to2);
  3419. addRegexToken('h', match1to2);
  3420. addRegexToken('HH', match1to2, match2);
  3421. addRegexToken('hh', match1to2, match2);
  3422. addRegexToken('hmm', match3to4);
  3423. addRegexToken('hmmss', match5to6);
  3424. addRegexToken('Hmm', match3to4);
  3425. addRegexToken('Hmmss', match5to6);
  3426. addParseToken(['H', 'HH'], HOUR);
  3427. addParseToken(['a', 'A'], function (input, array, config) {
  3428. config._isPm = config._locale.isPM(input);
  3429. config._meridiem = input;
  3430. });
  3431. addParseToken(['h', 'hh'], function (input, array, config) {
  3432. array[HOUR] = toInt(input);
  3433. getParsingFlags(config).bigHour = true;
  3434. });
  3435. addParseToken('hmm', function (input, array, config) {
  3436. var pos = input.length - 2;
  3437. array[HOUR] = toInt(input.substr(0, pos));
  3438. array[MINUTE] = toInt(input.substr(pos));
  3439. getParsingFlags(config).bigHour = true;
  3440. });
  3441. addParseToken('hmmss', function (input, array, config) {
  3442. var pos1 = input.length - 4;
  3443. var pos2 = input.length - 2;
  3444. array[HOUR] = toInt(input.substr(0, pos1));
  3445. array[MINUTE] = toInt(input.substr(pos1, 2));
  3446. array[SECOND] = toInt(input.substr(pos2));
  3447. getParsingFlags(config).bigHour = true;
  3448. });
  3449. addParseToken('Hmm', function (input, array, config) {
  3450. var pos = input.length - 2;
  3451. array[HOUR] = toInt(input.substr(0, pos));
  3452. array[MINUTE] = toInt(input.substr(pos));
  3453. });
  3454. addParseToken('Hmmss', function (input, array, config) {
  3455. var pos1 = input.length - 4;
  3456. var pos2 = input.length - 2;
  3457. array[HOUR] = toInt(input.substr(0, pos1));
  3458. array[MINUTE] = toInt(input.substr(pos1, 2));
  3459. array[SECOND] = toInt(input.substr(pos2));
  3460. });
  3461. // LOCALES
  3462. function localeIsPM (input) {
  3463. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  3464. // Using charAt should be more compatible.
  3465. return ((input + '').toLowerCase().charAt(0) === 'p');
  3466. }
  3467. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
  3468. function localeMeridiem (hours, minutes, isLower) {
  3469. if (hours > 11) {
  3470. return isLower ? 'pm' : 'PM';
  3471. } else {
  3472. return isLower ? 'am' : 'AM';
  3473. }
  3474. }
  3475. // MOMENTS
  3476. // Setting the hour should keep the time, because the user explicitly
  3477. // specified which hour he wants. So trying to maintain the same hour (in
  3478. // a new timezone) makes sense. Adding/subtracting hours does not follow
  3479. // this rule.
  3480. var getSetHour = makeGetSet('Hours', true);
  3481. var baseConfig = {
  3482. calendar: defaultCalendar,
  3483. longDateFormat: defaultLongDateFormat,
  3484. invalidDate: defaultInvalidDate,
  3485. ordinal: defaultOrdinal,
  3486. ordinalParse: defaultOrdinalParse,
  3487. relativeTime: defaultRelativeTime,
  3488. months: defaultLocaleMonths,
  3489. monthsShort: defaultLocaleMonthsShort,
  3490. week: defaultLocaleWeek,
  3491. weekdays: defaultLocaleWeekdays,
  3492. weekdaysMin: defaultLocaleWeekdaysMin,
  3493. weekdaysShort: defaultLocaleWeekdaysShort,
  3494. meridiemParse: defaultLocaleMeridiemParse
  3495. };
  3496. // internal storage for locale config files
  3497. var locales = {};
  3498. var globalLocale;
  3499. function normalizeLocale(key) {
  3500. return key ? key.toLowerCase().replace('_', '-') : key;
  3501. }
  3502. // pick the locale from the array
  3503. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  3504. // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
  3505. function chooseLocale(names) {
  3506. var i = 0, j, next, locale, split;
  3507. while (i < names.length) {
  3508. split = normalizeLocale(names[i]).split('-');
  3509. j = split.length;
  3510. next = normalizeLocale(names[i + 1]);
  3511. next = next ? next.split('-') : null;
  3512. while (j > 0) {
  3513. locale = loadLocale(split.slice(0, j).join('-'));
  3514. if (locale) {
  3515. return locale;
  3516. }
  3517. if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
  3518. //the next array item is better than a shallower substring of this one
  3519. break;
  3520. }
  3521. j--;
  3522. }
  3523. i++;
  3524. }
  3525. return null;
  3526. }
  3527. function loadLocale(name) {
  3528. var oldLocale = null;
  3529. // TODO: Find a better way to register and load all the locales in Node
  3530. if (!locales[name] && (typeof module !== 'undefined') &&
  3531. module && module.exports) {
  3532. try {
  3533. oldLocale = globalLocale._abbr;
  3534. require('./locale/' + name);
  3535. // because defineLocale currently also sets the global locale, we
  3536. // want to undo that for lazy loaded locales
  3537. locale_locales__getSetGlobalLocale(oldLocale);
  3538. } catch (e) { }
  3539. }
  3540. return locales[name];
  3541. }
  3542. // This function will load locale and then set the global locale. If
  3543. // no arguments are passed in, it will simply return the current global
  3544. // locale key.
  3545. function locale_locales__getSetGlobalLocale (key, values) {
  3546. var data;
  3547. if (key) {
  3548. if (isUndefined(values)) {
  3549. data = locale_locales__getLocale(key);
  3550. }
  3551. else {
  3552. data = defineLocale(key, values);
  3553. }
  3554. if (data) {
  3555. // moment.duration._locale = moment._locale = data;
  3556. globalLocale = data;
  3557. }
  3558. }
  3559. return globalLocale._abbr;
  3560. }
  3561. function defineLocale (name, config) {
  3562. if (config !== null) {
  3563. var parentConfig = baseConfig;
  3564. config.abbr = name;
  3565. if (locales[name] != null) {
  3566. deprecateSimple('defineLocaleOverride',
  3567. 'use moment.updateLocale(localeName, config) to change ' +
  3568. 'an existing locale. moment.defineLocale(localeName, ' +
  3569. 'config) should only be used for creating a new locale ' +
  3570. 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');
  3571. parentConfig = locales[name]._config;
  3572. } else if (config.parentLocale != null) {
  3573. if (locales[config.parentLocale] != null) {
  3574. parentConfig = locales[config.parentLocale]._config;
  3575. } else {
  3576. // treat as if there is no base config
  3577. deprecateSimple('parentLocaleUndefined',
  3578. 'specified parentLocale is not defined yet. See http://momentjs.com/guides/#/warnings/parent-locale/');
  3579. }
  3580. }
  3581. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  3582. // backwards compat for now: also set the locale
  3583. locale_locales__getSetGlobalLocale(name);
  3584. return locales[name];
  3585. } else {
  3586. // useful for testing
  3587. delete locales[name];
  3588. return null;
  3589. }
  3590. }
  3591. function updateLocale(name, config) {
  3592. if (config != null) {
  3593. var locale, parentConfig = baseConfig;
  3594. // MERGE
  3595. if (locales[name] != null) {
  3596. parentConfig = locales[name]._config;
  3597. }
  3598. config = mergeConfigs(parentConfig, config);
  3599. locale = new Locale(config);
  3600. locale.parentLocale = locales[name];
  3601. locales[name] = locale;
  3602. // backwards compat for now: also set the locale
  3603. locale_locales__getSetGlobalLocale(name);
  3604. } else {
  3605. // pass null for config to unupdate, useful for tests
  3606. if (locales[name] != null) {
  3607. if (locales[name].parentLocale != null) {
  3608. locales[name] = locales[name].parentLocale;
  3609. } else if (locales[name] != null) {
  3610. delete locales[name];
  3611. }
  3612. }
  3613. }
  3614. return locales[name];
  3615. }
  3616. // returns locale data
  3617. function locale_locales__getLocale (key) {
  3618. var locale;
  3619. if (key && key._locale && key._locale._abbr) {
  3620. key = key._locale._abbr;
  3621. }
  3622. if (!key) {
  3623. return globalLocale;
  3624. }
  3625. if (!isArray(key)) {
  3626. //short-circuit everything else
  3627. locale = loadLocale(key);
  3628. if (locale) {
  3629. return locale;
  3630. }
  3631. key = [key];
  3632. }
  3633. return chooseLocale(key);
  3634. }
  3635. function locale_locales__listLocales() {
  3636. return keys(locales);
  3637. }
  3638. function checkOverflow (m) {
  3639. var overflow;
  3640. var a = m._a;
  3641. if (a && getParsingFlags(m).overflow === -2) {
  3642. overflow =
  3643. a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
  3644. a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
  3645. a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
  3646. a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
  3647. a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
  3648. a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
  3649. -1;
  3650. if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
  3651. overflow = DATE;
  3652. }
  3653. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  3654. overflow = WEEK;
  3655. }
  3656. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  3657. overflow = WEEKDAY;
  3658. }
  3659. getParsingFlags(m).overflow = overflow;
  3660. }
  3661. return m;
  3662. }
  3663. // iso 8601 regex
  3664. // 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)
  3665. 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)?)?/;
  3666. var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/;
  3667. var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
  3668. var isoDates = [
  3669. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  3670. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  3671. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  3672. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  3673. ['YYYY-DDD', /\d{4}-\d{3}/],
  3674. ['YYYY-MM', /\d{4}-\d\d/, false],
  3675. ['YYYYYYMMDD', /[+-]\d{10}/],
  3676. ['YYYYMMDD', /\d{8}/],
  3677. // YYYYMM is NOT allowed by the standard
  3678. ['GGGG[W]WWE', /\d{4}W\d{3}/],
  3679. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  3680. ['YYYYDDD', /\d{7}/]
  3681. ];
  3682. // iso time formats and regexes
  3683. var isoTimes = [
  3684. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  3685. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  3686. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  3687. ['HH:mm', /\d\d:\d\d/],
  3688. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  3689. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  3690. ['HHmmss', /\d\d\d\d\d\d/],
  3691. ['HHmm', /\d\d\d\d/],
  3692. ['HH', /\d\d/]
  3693. ];
  3694. var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
  3695. // date from iso format
  3696. function configFromISO(config) {
  3697. var i, l,
  3698. string = config._i,
  3699. match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  3700. allowTime, dateFormat, timeFormat, tzFormat;
  3701. if (match) {
  3702. getParsingFlags(config).iso = true;
  3703. for (i = 0, l = isoDates.length; i < l; i++) {
  3704. if (isoDates[i][1].exec(match[1])) {
  3705. dateFormat = isoDates[i][0];
  3706. allowTime = isoDates[i][2] !== false;
  3707. break;
  3708. }
  3709. }
  3710. if (dateFormat == null) {
  3711. config._isValid = false;
  3712. return;
  3713. }
  3714. if (match[3]) {
  3715. for (i = 0, l = isoTimes.length; i < l; i++) {
  3716. if (isoTimes[i][1].exec(match[3])) {
  3717. // match[2] should be 'T' or space
  3718. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  3719. break;
  3720. }
  3721. }
  3722. if (timeFormat == null) {
  3723. config._isValid = false;
  3724. return;
  3725. }
  3726. }
  3727. if (!allowTime && timeFormat != null) {
  3728. config._isValid = false;
  3729. return;
  3730. }
  3731. if (match[4]) {
  3732. if (tzRegex.exec(match[4])) {
  3733. tzFormat = 'Z';
  3734. } else {
  3735. config._isValid = false;
  3736. return;
  3737. }
  3738. }
  3739. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  3740. configFromStringAndFormat(config);
  3741. } else {
  3742. config._isValid = false;
  3743. }
  3744. }
  3745. // date from iso format or fallback
  3746. function configFromString(config) {
  3747. var matched = aspNetJsonRegex.exec(config._i);
  3748. if (matched !== null) {
  3749. config._d = new Date(+matched[1]);
  3750. return;
  3751. }
  3752. configFromISO(config);
  3753. if (config._isValid === false) {
  3754. delete config._isValid;
  3755. utils_hooks__hooks.createFromInputFallback(config);
  3756. }
  3757. }
  3758. utils_hooks__hooks.createFromInputFallback = deprecate(
  3759. 'value provided is not in a recognized ISO format. moment construction falls back to js Date(), ' +
  3760. 'which is not reliable across all browsers and versions. Non ISO date formats are ' +
  3761. 'discouraged and will be removed in an upcoming major release. Please refer to ' +
  3762. 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  3763. function (config) {
  3764. config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  3765. }
  3766. );
  3767. // Pick the first defined of two or three arguments.
  3768. function defaults(a, b, c) {
  3769. if (a != null) {
  3770. return a;
  3771. }
  3772. if (b != null) {
  3773. return b;
  3774. }
  3775. return c;
  3776. }
  3777. function currentDateArray(config) {
  3778. // hooks is actually the exported moment object
  3779. var nowValue = new Date(utils_hooks__hooks.now());
  3780. if (config._useUTC) {
  3781. return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
  3782. }
  3783. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  3784. }
  3785. // convert an array to a date.
  3786. // the array should mirror the parameters below
  3787. // note: all values past the year are optional and will default to the lowest possible value.
  3788. // [year, month, day , hour, minute, second, millisecond]
  3789. function configFromArray (config) {
  3790. var i, date, input = [], currentDate, yearToUse;
  3791. if (config._d) {
  3792. return;
  3793. }
  3794. currentDate = currentDateArray(config);
  3795. //compute day of the year from weeks and weekdays
  3796. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  3797. dayOfYearFromWeekInfo(config);
  3798. }
  3799. //if the day of the year is set, figure out what it is
  3800. if (config._dayOfYear) {
  3801. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  3802. if (config._dayOfYear > daysInYear(yearToUse)) {
  3803. getParsingFlags(config)._overflowDayOfYear = true;
  3804. }
  3805. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  3806. config._a[MONTH] = date.getUTCMonth();
  3807. config._a[DATE] = date.getUTCDate();
  3808. }
  3809. // Default to current date.
  3810. // * if no year, month, day of month are given, default to today
  3811. // * if day of month is given, default month and year
  3812. // * if month is given, default only year
  3813. // * if year is given, don't default anything
  3814. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  3815. config._a[i] = input[i] = currentDate[i];
  3816. }
  3817. // Zero out whatever was not defaulted, including time
  3818. for (; i < 7; i++) {
  3819. config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
  3820. }
  3821. // Check for 24:00:00.000
  3822. if (config._a[HOUR] === 24 &&
  3823. config._a[MINUTE] === 0 &&
  3824. config._a[SECOND] === 0 &&
  3825. config._a[MILLISECOND] === 0) {
  3826. config._nextDay = true;
  3827. config._a[HOUR] = 0;
  3828. }
  3829. config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
  3830. // Apply timezone offset from input. The actual utcOffset can be changed
  3831. // with parseZone.
  3832. if (config._tzm != null) {
  3833. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  3834. }
  3835. if (config._nextDay) {
  3836. config._a[HOUR] = 24;
  3837. }
  3838. }
  3839. function dayOfYearFromWeekInfo(config) {
  3840. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
  3841. w = config._w;
  3842. if (w.GG != null || w.W != null || w.E != null) {
  3843. dow = 1;
  3844. doy = 4;
  3845. // TODO: We need to take the current isoWeekYear, but that depends on
  3846. // how we interpret now (local, utc, fixed offset). So create
  3847. // a now version of current config (take local/utc/offset flags, and
  3848. // create now).
  3849. weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year);
  3850. week = defaults(w.W, 1);
  3851. weekday = defaults(w.E, 1);
  3852. if (weekday < 1 || weekday > 7) {
  3853. weekdayOverflow = true;
  3854. }
  3855. } else {
  3856. dow = config._locale._week.dow;
  3857. doy = config._locale._week.doy;
  3858. weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year);
  3859. week = defaults(w.w, 1);
  3860. if (w.d != null) {
  3861. // weekday -- low day numbers are considered next week
  3862. weekday = w.d;
  3863. if (weekday < 0 || weekday > 6) {
  3864. weekdayOverflow = true;
  3865. }
  3866. } else if (w.e != null) {
  3867. // local weekday -- counting starts from begining of week
  3868. weekday = w.e + dow;
  3869. if (w.e < 0 || w.e > 6) {
  3870. weekdayOverflow = true;
  3871. }
  3872. } else {
  3873. // default to begining of week
  3874. weekday = dow;
  3875. }
  3876. }
  3877. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  3878. getParsingFlags(config)._overflowWeeks = true;
  3879. } else if (weekdayOverflow != null) {
  3880. getParsingFlags(config)._overflowWeekday = true;
  3881. } else {
  3882. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  3883. config._a[YEAR] = temp.year;
  3884. config._dayOfYear = temp.dayOfYear;
  3885. }
  3886. }
  3887. // constant that refers to the ISO standard
  3888. utils_hooks__hooks.ISO_8601 = function () {};
  3889. // date from string and format string
  3890. function configFromStringAndFormat(config) {
  3891. // TODO: Move this to another part of the creation flow to prevent circular deps
  3892. if (config._f === utils_hooks__hooks.ISO_8601) {
  3893. configFromISO(config);
  3894. return;
  3895. }
  3896. config._a = [];
  3897. getParsingFlags(config).empty = true;
  3898. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  3899. var string = '' + config._i,
  3900. i, parsedInput, tokens, token, skipped,
  3901. stringLength = string.length,
  3902. totalParsedInputLength = 0;
  3903. tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
  3904. for (i = 0; i < tokens.length; i++) {
  3905. token = tokens[i];
  3906. parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
  3907. // console.log('token', token, 'parsedInput', parsedInput,
  3908. // 'regex', getParseRegexForToken(token, config));
  3909. if (parsedInput) {
  3910. skipped = string.substr(0, string.indexOf(parsedInput));
  3911. if (skipped.length > 0) {
  3912. getParsingFlags(config).unusedInput.push(skipped);
  3913. }
  3914. string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
  3915. totalParsedInputLength += parsedInput.length;
  3916. }
  3917. // don't parse if it's not a known token
  3918. if (formatTokenFunctions[token]) {
  3919. if (parsedInput) {
  3920. getParsingFlags(config).empty = false;
  3921. }
  3922. else {
  3923. getParsingFlags(config).unusedTokens.push(token);
  3924. }
  3925. addTimeToArrayFromToken(token, parsedInput, config);
  3926. }
  3927. else if (config._strict && !parsedInput) {
  3928. getParsingFlags(config).unusedTokens.push(token);
  3929. }
  3930. }
  3931. // add remaining unparsed input length to the string
  3932. getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
  3933. if (string.length > 0) {
  3934. getParsingFlags(config).unusedInput.push(string);
  3935. }
  3936. // clear _12h flag if hour is <= 12
  3937. if (config._a[HOUR] <= 12 &&
  3938. getParsingFlags(config).bigHour === true &&
  3939. config._a[HOUR] > 0) {
  3940. getParsingFlags(config).bigHour = undefined;
  3941. }
  3942. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  3943. getParsingFlags(config).meridiem = config._meridiem;
  3944. // handle meridiem
  3945. config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
  3946. configFromArray(config);
  3947. checkOverflow(config);
  3948. }
  3949. function meridiemFixWrap (locale, hour, meridiem) {
  3950. var isPm;
  3951. if (meridiem == null) {
  3952. // nothing to do
  3953. return hour;
  3954. }
  3955. if (locale.meridiemHour != null) {
  3956. return locale.meridiemHour(hour, meridiem);
  3957. } else if (locale.isPM != null) {
  3958. // Fallback
  3959. isPm = locale.isPM(meridiem);
  3960. if (isPm && hour < 12) {
  3961. hour += 12;
  3962. }
  3963. if (!isPm && hour === 12) {
  3964. hour = 0;
  3965. }
  3966. return hour;
  3967. } else {
  3968. // this is not supposed to happen
  3969. return hour;
  3970. }
  3971. }
  3972. // date from string and array of format strings
  3973. function configFromStringAndArray(config) {
  3974. var tempConfig,
  3975. bestMoment,
  3976. scoreToBeat,
  3977. i,
  3978. currentScore;
  3979. if (config._f.length === 0) {
  3980. getParsingFlags(config).invalidFormat = true;
  3981. config._d = new Date(NaN);
  3982. return;
  3983. }
  3984. for (i = 0; i < config._f.length; i++) {
  3985. currentScore = 0;
  3986. tempConfig = copyConfig({}, config);
  3987. if (config._useUTC != null) {
  3988. tempConfig._useUTC = config._useUTC;
  3989. }
  3990. tempConfig._f = config._f[i];
  3991. configFromStringAndFormat(tempConfig);
  3992. if (!valid__isValid(tempConfig)) {
  3993. continue;
  3994. }
  3995. // if there is any input that was not parsed add a penalty for that format
  3996. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  3997. //or tokens
  3998. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  3999. getParsingFlags(tempConfig).score = currentScore;
  4000. if (scoreToBeat == null || currentScore < scoreToBeat) {
  4001. scoreToBeat = currentScore;
  4002. bestMoment = tempConfig;
  4003. }
  4004. }
  4005. extend(config, bestMoment || tempConfig);
  4006. }
  4007. function configFromObject(config) {
  4008. if (config._d) {
  4009. return;
  4010. }
  4011. var i = normalizeObjectUnits(config._i);
  4012. config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
  4013. return obj && parseInt(obj, 10);
  4014. });
  4015. configFromArray(config);
  4016. }
  4017. function createFromConfig (config) {
  4018. var res = new Moment(checkOverflow(prepareConfig(config)));
  4019. if (res._nextDay) {
  4020. // Adding is smart enough around DST
  4021. res.add(1, 'd');
  4022. res._nextDay = undefined;
  4023. }
  4024. return res;
  4025. }
  4026. function prepareConfig (config) {
  4027. var input = config._i,
  4028. format = config._f;
  4029. config._locale = config._locale || locale_locales__getLocale(config._l);
  4030. if (input === null || (format === undefined && input === '')) {
  4031. return valid__createInvalid({nullInput: true});
  4032. }
  4033. if (typeof input === 'string') {
  4034. config._i = input = config._locale.preparse(input);
  4035. }
  4036. if (isMoment(input)) {
  4037. return new Moment(checkOverflow(input));
  4038. } else if (isArray(format)) {
  4039. configFromStringAndArray(config);
  4040. } else if (isDate(input)) {
  4041. config._d = input;
  4042. } else if (format) {
  4043. configFromStringAndFormat(config);
  4044. } else {
  4045. configFromInput(config);
  4046. }
  4047. if (!valid__isValid(config)) {
  4048. config._d = null;
  4049. }
  4050. return config;
  4051. }
  4052. function configFromInput(config) {
  4053. var input = config._i;
  4054. if (input === undefined) {
  4055. config._d = new Date(utils_hooks__hooks.now());
  4056. } else if (isDate(input)) {
  4057. config._d = new Date(input.valueOf());
  4058. } else if (typeof input === 'string') {
  4059. configFromString(config);
  4060. } else if (isArray(input)) {
  4061. config._a = map(input.slice(0), function (obj) {
  4062. return parseInt(obj, 10);
  4063. });
  4064. configFromArray(config);
  4065. } else if (typeof(input) === 'object') {
  4066. configFromObject(config);
  4067. } else if (typeof(input) === 'number') {
  4068. // from milliseconds
  4069. config._d = new Date(input);
  4070. } else {
  4071. utils_hooks__hooks.createFromInputFallback(config);
  4072. }
  4073. }
  4074. function createLocalOrUTC (input, format, locale, strict, isUTC) {
  4075. var c = {};
  4076. if (typeof(locale) === 'boolean') {
  4077. strict = locale;
  4078. locale = undefined;
  4079. }
  4080. if ((isObject(input) && isObjectEmpty(input)) ||
  4081. (isArray(input) && input.length === 0)) {
  4082. input = undefined;
  4083. }
  4084. // object construction must be done this way.
  4085. // https://github.com/moment/moment/issues/1423
  4086. c._isAMomentObject = true;
  4087. c._useUTC = c._isUTC = isUTC;
  4088. c._l = locale;
  4089. c._i = input;
  4090. c._f = format;
  4091. c._strict = strict;
  4092. return createFromConfig(c);
  4093. }
  4094. function local__createLocal (input, format, locale, strict) {
  4095. return createLocalOrUTC(input, format, locale, strict, false);
  4096. }
  4097. var prototypeMin = deprecate(
  4098. 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
  4099. function () {
  4100. var other = local__createLocal.apply(null, arguments);
  4101. if (this.isValid() && other.isValid()) {
  4102. return other < this ? this : other;
  4103. } else {
  4104. return valid__createInvalid();
  4105. }
  4106. }
  4107. );
  4108. var prototypeMax = deprecate(
  4109. 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
  4110. function () {
  4111. var other = local__createLocal.apply(null, arguments);
  4112. if (this.isValid() && other.isValid()) {
  4113. return other > this ? this : other;
  4114. } else {
  4115. return valid__createInvalid();
  4116. }
  4117. }
  4118. );
  4119. // Pick a moment m from moments so that m[fn](other) is true for all
  4120. // other. This relies on the function fn to be transitive.
  4121. //
  4122. // moments should either be an array of moment objects or an array, whose
  4123. // first element is an array of moment objects.
  4124. function pickBy(fn, moments) {
  4125. var res, i;
  4126. if (moments.length === 1 && isArray(moments[0])) {
  4127. moments = moments[0];
  4128. }
  4129. if (!moments.length) {
  4130. return local__createLocal();
  4131. }
  4132. res = moments[0];
  4133. for (i = 1; i < moments.length; ++i) {
  4134. if (!moments[i].isValid() || moments[i][fn](res)) {
  4135. res = moments[i];
  4136. }
  4137. }
  4138. return res;
  4139. }
  4140. // TODO: Use [].sort instead?
  4141. function min () {
  4142. var args = [].slice.call(arguments, 0);
  4143. return pickBy('isBefore', args);
  4144. }
  4145. function max () {
  4146. var args = [].slice.call(arguments, 0);
  4147. return pickBy('isAfter', args);
  4148. }
  4149. var now = function () {
  4150. return Date.now ? Date.now() : +(new Date());
  4151. };
  4152. function Duration (duration) {
  4153. var normalizedInput = normalizeObjectUnits(duration),
  4154. years = normalizedInput.year || 0,
  4155. quarters = normalizedInput.quarter || 0,
  4156. months = normalizedInput.month || 0,
  4157. weeks = normalizedInput.week || 0,
  4158. days = normalizedInput.day || 0,
  4159. hours = normalizedInput.hour || 0,
  4160. minutes = normalizedInput.minute || 0,
  4161. seconds = normalizedInput.second || 0,
  4162. milliseconds = normalizedInput.millisecond || 0;
  4163. // representation for dateAddRemove
  4164. this._milliseconds = +milliseconds +
  4165. seconds * 1e3 + // 1000
  4166. minutes * 6e4 + // 1000 * 60
  4167. hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  4168. // Because of dateAddRemove treats 24 hours as different from a
  4169. // day when working around DST, we need to store them separately
  4170. this._days = +days +
  4171. weeks * 7;
  4172. // It is impossible translate months into days without knowing
  4173. // which months you are are talking about, so we have to store
  4174. // it separately.
  4175. this._months = +months +
  4176. quarters * 3 +
  4177. years * 12;
  4178. this._data = {};
  4179. this._locale = locale_locales__getLocale();
  4180. this._bubble();
  4181. }
  4182. function isDuration (obj) {
  4183. return obj instanceof Duration;
  4184. }
  4185. function absRound (number) {
  4186. if (number < 0) {
  4187. return Math.round(-1 * number) * -1;
  4188. } else {
  4189. return Math.round(number);
  4190. }
  4191. }
  4192. // FORMATTING
  4193. function offset (token, separator) {
  4194. addFormatToken(token, 0, 0, function () {
  4195. var offset = this.utcOffset();
  4196. var sign = '+';
  4197. if (offset < 0) {
  4198. offset = -offset;
  4199. sign = '-';
  4200. }
  4201. return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
  4202. });
  4203. }
  4204. offset('Z', ':');
  4205. offset('ZZ', '');
  4206. // PARSING
  4207. addRegexToken('Z', matchShortOffset);
  4208. addRegexToken('ZZ', matchShortOffset);
  4209. addParseToken(['Z', 'ZZ'], function (input, array, config) {
  4210. config._useUTC = true;
  4211. config._tzm = offsetFromString(matchShortOffset, input);
  4212. });
  4213. // HELPERS
  4214. // timezone chunker
  4215. // '+10:00' > ['10', '00']
  4216. // '-1530' > ['-15', '30']
  4217. var chunkOffset = /([\+\-]|\d\d)/gi;
  4218. function offsetFromString(matcher, string) {
  4219. var matches = ((string || '').match(matcher) || []);
  4220. var chunk = matches[matches.length - 1] || [];
  4221. var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
  4222. var minutes = +(parts[1] * 60) + toInt(parts[2]);
  4223. return parts[0] === '+' ? minutes : -minutes;
  4224. }
  4225. // Return a moment from input, that is local/utc/zone equivalent to model.
  4226. function cloneWithOffset(input, model) {
  4227. var res, diff;
  4228. if (model._isUTC) {
  4229. res = model.clone();
  4230. diff = (isMoment(input) || isDate(input) ? input.valueOf() : local__createLocal(input).valueOf()) - res.valueOf();
  4231. // Use low-level api, because this fn is low-level api.
  4232. res._d.setTime(res._d.valueOf() + diff);
  4233. utils_hooks__hooks.updateOffset(res, false);
  4234. return res;
  4235. } else {
  4236. return local__createLocal(input).local();
  4237. }
  4238. }
  4239. function getDateOffset (m) {
  4240. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  4241. // https://github.com/moment/moment/pull/1871
  4242. return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
  4243. }
  4244. // HOOKS
  4245. // This function will be called whenever a moment is mutated.
  4246. // It is intended to keep the offset in sync with the timezone.
  4247. utils_hooks__hooks.updateOffset = function () {};
  4248. // MOMENTS
  4249. // keepLocalTime = true means only change the timezone, without
  4250. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  4251. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  4252. // +0200, so we adjust the time as needed, to be valid.
  4253. //
  4254. // Keeping the time actually adds/subtracts (one hour)
  4255. // from the actual represented time. That is why we call updateOffset
  4256. // a second time. In case it wants us to change the offset again
  4257. // _changeInProgress == true case, then we have to adjust, because
  4258. // there is no such time in the given timezone.
  4259. function getSetOffset (input, keepLocalTime) {
  4260. var offset = this._offset || 0,
  4261. localAdjust;
  4262. if (!this.isValid()) {
  4263. return input != null ? this : NaN;
  4264. }
  4265. if (input != null) {
  4266. if (typeof input === 'string') {
  4267. input = offsetFromString(matchShortOffset, input);
  4268. } else if (Math.abs(input) < 16) {
  4269. input = input * 60;
  4270. }
  4271. if (!this._isUTC && keepLocalTime) {
  4272. localAdjust = getDateOffset(this);
  4273. }
  4274. this._offset = input;
  4275. this._isUTC = true;
  4276. if (localAdjust != null) {
  4277. this.add(localAdjust, 'm');
  4278. }
  4279. if (offset !== input) {
  4280. if (!keepLocalTime || this._changeInProgress) {
  4281. add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);
  4282. } else if (!this._changeInProgress) {
  4283. this._changeInProgress = true;
  4284. utils_hooks__hooks.updateOffset(this, true);
  4285. this._changeInProgress = null;
  4286. }
  4287. }
  4288. return this;
  4289. } else {
  4290. return this._isUTC ? offset : getDateOffset(this);
  4291. }
  4292. }
  4293. function getSetZone (input, keepLocalTime) {
  4294. if (input != null) {
  4295. if (typeof input !== 'string') {
  4296. input = -input;
  4297. }
  4298. this.utcOffset(input, keepLocalTime);
  4299. return this;
  4300. } else {
  4301. return -this.utcOffset();
  4302. }
  4303. }
  4304. function setOffsetToUTC (keepLocalTime) {
  4305. return this.utcOffset(0, keepLocalTime);
  4306. }
  4307. function setOffsetToLocal (keepLocalTime) {
  4308. if (this._isUTC) {
  4309. this.utcOffset(0, keepLocalTime);
  4310. this._isUTC = false;
  4311. if (keepLocalTime) {
  4312. this.subtract(getDateOffset(this), 'm');
  4313. }
  4314. }
  4315. return this;
  4316. }
  4317. function setOffsetToParsedOffset () {
  4318. if (this._tzm) {
  4319. this.utcOffset(this._tzm);
  4320. } else if (typeof this._i === 'string') {
  4321. var tZone = offsetFromString(matchOffset, this._i);
  4322. if (tZone === 0) {
  4323. this.utcOffset(0, true);
  4324. } else {
  4325. this.utcOffset(offsetFromString(matchOffset, this._i));
  4326. }
  4327. }
  4328. return this;
  4329. }
  4330. function hasAlignedHourOffset (input) {
  4331. if (!this.isValid()) {
  4332. return false;
  4333. }
  4334. input = input ? local__createLocal(input).utcOffset() : 0;
  4335. return (this.utcOffset() - input) % 60 === 0;
  4336. }
  4337. function isDaylightSavingTime () {
  4338. return (
  4339. this.utcOffset() > this.clone().month(0).utcOffset() ||
  4340. this.utcOffset() > this.clone().month(5).utcOffset()
  4341. );
  4342. }
  4343. function isDaylightSavingTimeShifted () {
  4344. if (!isUndefined(this._isDSTShifted)) {
  4345. return this._isDSTShifted;
  4346. }
  4347. var c = {};
  4348. copyConfig(c, this);
  4349. c = prepareConfig(c);
  4350. if (c._a) {
  4351. var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a);
  4352. this._isDSTShifted = this.isValid() &&
  4353. compareArrays(c._a, other.toArray()) > 0;
  4354. } else {
  4355. this._isDSTShifted = false;
  4356. }
  4357. return this._isDSTShifted;
  4358. }
  4359. function isLocal () {
  4360. return this.isValid() ? !this._isUTC : false;
  4361. }
  4362. function isUtcOffset () {
  4363. return this.isValid() ? this._isUTC : false;
  4364. }
  4365. function isUtc () {
  4366. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  4367. }
  4368. // ASP.NET json date format regex
  4369. var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
  4370. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  4371. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  4372. // and further modified to allow for strings containing both week and day
  4373. var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;
  4374. function create__createDuration (input, key) {
  4375. var duration = input,
  4376. // matching against regexp is expensive, do it on demand
  4377. match = null,
  4378. sign,
  4379. ret,
  4380. diffRes;
  4381. if (isDuration(input)) {
  4382. duration = {
  4383. ms : input._milliseconds,
  4384. d : input._days,
  4385. M : input._months
  4386. };
  4387. } else if (typeof input === 'number') {
  4388. duration = {};
  4389. if (key) {
  4390. duration[key] = input;
  4391. } else {
  4392. duration.milliseconds = input;
  4393. }
  4394. } else if (!!(match = aspNetRegex.exec(input))) {
  4395. sign = (match[1] === '-') ? -1 : 1;
  4396. duration = {
  4397. y : 0,
  4398. d : toInt(match[DATE]) * sign,
  4399. h : toInt(match[HOUR]) * sign,
  4400. m : toInt(match[MINUTE]) * sign,
  4401. s : toInt(match[SECOND]) * sign,
  4402. ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match
  4403. };
  4404. } else if (!!(match = isoRegex.exec(input))) {
  4405. sign = (match[1] === '-') ? -1 : 1;
  4406. duration = {
  4407. y : parseIso(match[2], sign),
  4408. M : parseIso(match[3], sign),
  4409. w : parseIso(match[4], sign),
  4410. d : parseIso(match[5], sign),
  4411. h : parseIso(match[6], sign),
  4412. m : parseIso(match[7], sign),
  4413. s : parseIso(match[8], sign)
  4414. };
  4415. } else if (duration == null) {// checks for null or undefined
  4416. duration = {};
  4417. } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
  4418. diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to));
  4419. duration = {};
  4420. duration.ms = diffRes.milliseconds;
  4421. duration.M = diffRes.months;
  4422. }
  4423. ret = new Duration(duration);
  4424. if (isDuration(input) && hasOwnProp(input, '_locale')) {
  4425. ret._locale = input._locale;
  4426. }
  4427. return ret;
  4428. }
  4429. create__createDuration.fn = Duration.prototype;
  4430. function parseIso (inp, sign) {
  4431. // We'd normally use ~~inp for this, but unfortunately it also
  4432. // converts floats to ints.
  4433. // inp may be undefined, so careful calling replace on it.
  4434. var res = inp && parseFloat(inp.replace(',', '.'));
  4435. // apply sign while we're at it
  4436. return (isNaN(res) ? 0 : res) * sign;
  4437. }
  4438. function positiveMomentsDifference(base, other) {
  4439. var res = {milliseconds: 0, months: 0};
  4440. res.months = other.month() - base.month() +
  4441. (other.year() - base.year()) * 12;
  4442. if (base.clone().add(res.months, 'M').isAfter(other)) {
  4443. --res.months;
  4444. }
  4445. res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
  4446. return res;
  4447. }
  4448. function momentsDifference(base, other) {
  4449. var res;
  4450. if (!(base.isValid() && other.isValid())) {
  4451. return {milliseconds: 0, months: 0};
  4452. }
  4453. other = cloneWithOffset(other, base);
  4454. if (base.isBefore(other)) {
  4455. res = positiveMomentsDifference(base, other);
  4456. } else {
  4457. res = positiveMomentsDifference(other, base);
  4458. res.milliseconds = -res.milliseconds;
  4459. res.months = -res.months;
  4460. }
  4461. return res;
  4462. }
  4463. // TODO: remove 'name' arg after deprecation is removed
  4464. function createAdder(direction, name) {
  4465. return function (val, period) {
  4466. var dur, tmp;
  4467. //invert the arguments, but complain about it
  4468. if (period !== null && !isNaN(+period)) {
  4469. deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +
  4470. 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');
  4471. tmp = val; val = period; period = tmp;
  4472. }
  4473. val = typeof val === 'string' ? +val : val;
  4474. dur = create__createDuration(val, period);
  4475. add_subtract__addSubtract(this, dur, direction);
  4476. return this;
  4477. };
  4478. }
  4479. function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) {
  4480. var milliseconds = duration._milliseconds,
  4481. days = absRound(duration._days),
  4482. months = absRound(duration._months);
  4483. if (!mom.isValid()) {
  4484. // No op
  4485. return;
  4486. }
  4487. updateOffset = updateOffset == null ? true : updateOffset;
  4488. if (milliseconds) {
  4489. mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
  4490. }
  4491. if (days) {
  4492. get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding);
  4493. }
  4494. if (months) {
  4495. setMonth(mom, get_set__get(mom, 'Month') + months * isAdding);
  4496. }
  4497. if (updateOffset) {
  4498. utils_hooks__hooks.updateOffset(mom, days || months);
  4499. }
  4500. }
  4501. var add_subtract__add = createAdder(1, 'add');
  4502. var add_subtract__subtract = createAdder(-1, 'subtract');
  4503. function getCalendarFormat(myMoment, now) {
  4504. var diff = myMoment.diff(now, 'days', true);
  4505. return diff < -6 ? 'sameElse' :
  4506. diff < -1 ? 'lastWeek' :
  4507. diff < 0 ? 'lastDay' :
  4508. diff < 1 ? 'sameDay' :
  4509. diff < 2 ? 'nextDay' :
  4510. diff < 7 ? 'nextWeek' : 'sameElse';
  4511. }
  4512. function moment_calendar__calendar (time, formats) {
  4513. // We want to compare the start of today, vs this.
  4514. // Getting start-of-today depends on whether we're local/utc/offset or not.
  4515. var now = time || local__createLocal(),
  4516. sod = cloneWithOffset(now, this).startOf('day'),
  4517. format = utils_hooks__hooks.calendarFormat(this, sod) || 'sameElse';
  4518. var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);
  4519. return this.format(output || this.localeData().calendar(format, this, local__createLocal(now)));
  4520. }
  4521. function clone () {
  4522. return new Moment(this);
  4523. }
  4524. function isAfter (input, units) {
  4525. var localInput = isMoment(input) ? input : local__createLocal(input);
  4526. if (!(this.isValid() && localInput.isValid())) {
  4527. return false;
  4528. }
  4529. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  4530. if (units === 'millisecond') {
  4531. return this.valueOf() > localInput.valueOf();
  4532. } else {
  4533. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  4534. }
  4535. }
  4536. function isBefore (input, units) {
  4537. var localInput = isMoment(input) ? input : local__createLocal(input);
  4538. if (!(this.isValid() && localInput.isValid())) {
  4539. return false;
  4540. }
  4541. units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
  4542. if (units === 'millisecond') {
  4543. return this.valueOf() < localInput.valueOf();
  4544. } else {
  4545. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  4546. }
  4547. }
  4548. function isBetween (from, to, units, inclusivity) {
  4549. inclusivity = inclusivity || '()';
  4550. return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&
  4551. (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));
  4552. }
  4553. function isSame (input, units) {
  4554. var localInput = isMoment(input) ? input : local__createLocal(input),
  4555. inputMs;
  4556. if (!(this.isValid() && localInput.isValid())) {
  4557. return false;
  4558. }
  4559. units = normalizeUnits(units || 'millisecond');
  4560. if (units === 'millisecond') {
  4561. return this.valueOf() === localInput.valueOf();
  4562. } else {
  4563. inputMs = localInput.valueOf();
  4564. return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();
  4565. }
  4566. }
  4567. function isSameOrAfter (input, units) {
  4568. return this.isSame(input, units) || this.isAfter(input,units);
  4569. }
  4570. function isSameOrBefore (input, units) {
  4571. return this.isSame(input, units) || this.isBefore(input,units);
  4572. }
  4573. function diff (input, units, asFloat) {
  4574. var that,
  4575. zoneDelta,
  4576. delta, output;
  4577. if (!this.isValid()) {
  4578. return NaN;
  4579. }
  4580. that = cloneWithOffset(input, this);
  4581. if (!that.isValid()) {
  4582. return NaN;
  4583. }
  4584. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  4585. units = normalizeUnits(units);
  4586. if (units === 'year' || units === 'month' || units === 'quarter') {
  4587. output = monthDiff(this, that);
  4588. if (units === 'quarter') {
  4589. output = output / 3;
  4590. } else if (units === 'year') {
  4591. output = output / 12;
  4592. }
  4593. } else {
  4594. delta = this - that;
  4595. output = units === 'second' ? delta / 1e3 : // 1000
  4596. units === 'minute' ? delta / 6e4 : // 1000 * 60
  4597. units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
  4598. units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
  4599. units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
  4600. delta;
  4601. }
  4602. return asFloat ? output : absFloor(output);
  4603. }
  4604. function monthDiff (a, b) {
  4605. // difference in months
  4606. var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
  4607. // b is in (anchor - 1 month, anchor + 1 month)
  4608. anchor = a.clone().add(wholeMonthDiff, 'months'),
  4609. anchor2, adjust;
  4610. if (b - anchor < 0) {
  4611. anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
  4612. // linear across the month
  4613. adjust = (b - anchor) / (anchor - anchor2);
  4614. } else {
  4615. anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
  4616. // linear across the month
  4617. adjust = (b - anchor) / (anchor2 - anchor);
  4618. }
  4619. //check for negative zero, return zero if negative zero
  4620. return -(wholeMonthDiff + adjust) || 0;
  4621. }
  4622. utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  4623. utils_hooks__hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  4624. function toString () {
  4625. return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  4626. }
  4627. function moment_format__toISOString () {
  4628. var m = this.clone().utc();
  4629. if (0 < m.year() && m.year() <= 9999) {
  4630. if (isFunction(Date.prototype.toISOString)) {
  4631. // native implementation is ~50x faster, use it when we can
  4632. return this.toDate().toISOString();
  4633. } else {
  4634. return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  4635. }
  4636. } else {
  4637. return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
  4638. }
  4639. }
  4640. function format (inputString) {
  4641. if (!inputString) {
  4642. inputString = this.isUtc() ? utils_hooks__hooks.defaultFormatUtc : utils_hooks__hooks.defaultFormat;
  4643. }
  4644. var output = formatMoment(this, inputString);
  4645. return this.localeData().postformat(output);
  4646. }
  4647. function from (time, withoutSuffix) {
  4648. if (this.isValid() &&
  4649. ((isMoment(time) && time.isValid()) ||
  4650. local__createLocal(time).isValid())) {
  4651. return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
  4652. } else {
  4653. return this.localeData().invalidDate();
  4654. }
  4655. }
  4656. function fromNow (withoutSuffix) {
  4657. return this.from(local__createLocal(), withoutSuffix);
  4658. }
  4659. function to (time, withoutSuffix) {
  4660. if (this.isValid() &&
  4661. ((isMoment(time) && time.isValid()) ||
  4662. local__createLocal(time).isValid())) {
  4663. return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
  4664. } else {
  4665. return this.localeData().invalidDate();
  4666. }
  4667. }
  4668. function toNow (withoutSuffix) {
  4669. return this.to(local__createLocal(), withoutSuffix);
  4670. }
  4671. // If passed a locale key, it will set the locale for this
  4672. // instance. Otherwise, it will return the locale configuration
  4673. // variables for this instance.
  4674. function locale (key) {
  4675. var newLocaleData;
  4676. if (key === undefined) {
  4677. return this._locale._abbr;
  4678. } else {
  4679. newLocaleData = locale_locales__getLocale(key);
  4680. if (newLocaleData != null) {
  4681. this._locale = newLocaleData;
  4682. }
  4683. return this;
  4684. }
  4685. }
  4686. var lang = deprecate(
  4687. 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
  4688. function (key) {
  4689. if (key === undefined) {
  4690. return this.localeData();
  4691. } else {
  4692. return this.locale(key);
  4693. }
  4694. }
  4695. );
  4696. function localeData () {
  4697. return this._locale;
  4698. }
  4699. function startOf (units) {
  4700. units = normalizeUnits(units);
  4701. // the following switch intentionally omits break keywords
  4702. // to utilize falling through the cases.
  4703. switch (units) {
  4704. case 'year':
  4705. this.month(0);
  4706. /* falls through */
  4707. case 'quarter':
  4708. case 'month':
  4709. this.date(1);
  4710. /* falls through */
  4711. case 'week':
  4712. case 'isoWeek':
  4713. case 'day':
  4714. case 'date':
  4715. this.hours(0);
  4716. /* falls through */
  4717. case 'hour':
  4718. this.minutes(0);
  4719. /* falls through */
  4720. case 'minute':
  4721. this.seconds(0);
  4722. /* falls through */
  4723. case 'second':
  4724. this.milliseconds(0);
  4725. }
  4726. // weeks are a special case
  4727. if (units === 'week') {
  4728. this.weekday(0);
  4729. }
  4730. if (units === 'isoWeek') {
  4731. this.isoWeekday(1);
  4732. }
  4733. // quarters are also special
  4734. if (units === 'quarter') {
  4735. this.month(Math.floor(this.month() / 3) * 3);
  4736. }
  4737. return this;
  4738. }
  4739. function endOf (units) {
  4740. units = normalizeUnits(units);
  4741. if (units === undefined || units === 'millisecond') {
  4742. return this;
  4743. }
  4744. // 'date' is an alias for 'day', so it should be considered as such.
  4745. if (units === 'date') {
  4746. units = 'day';
  4747. }
  4748. return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
  4749. }
  4750. function to_type__valueOf () {
  4751. return this._d.valueOf() - ((this._offset || 0) * 60000);
  4752. }
  4753. function unix () {
  4754. return Math.floor(this.valueOf() / 1000);
  4755. }
  4756. function toDate () {
  4757. return new Date(this.valueOf());
  4758. }
  4759. function toArray () {
  4760. var m = this;
  4761. return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
  4762. }
  4763. function toObject () {
  4764. var m = this;
  4765. return {
  4766. years: m.year(),
  4767. months: m.month(),
  4768. date: m.date(),
  4769. hours: m.hours(),
  4770. minutes: m.minutes(),
  4771. seconds: m.seconds(),
  4772. milliseconds: m.milliseconds()
  4773. };
  4774. }
  4775. function toJSON () {
  4776. // new Date(NaN).toJSON() === null
  4777. return this.isValid() ? this.toISOString() : null;
  4778. }
  4779. function moment_valid__isValid () {
  4780. return valid__isValid(this);
  4781. }
  4782. function parsingFlags () {
  4783. return extend({}, getParsingFlags(this));
  4784. }
  4785. function invalidAt () {
  4786. return getParsingFlags(this).overflow;
  4787. }
  4788. function creationData() {
  4789. return {
  4790. input: this._i,
  4791. format: this._f,
  4792. locale: this._locale,
  4793. isUTC: this._isUTC,
  4794. strict: this._strict
  4795. };
  4796. }
  4797. // FORMATTING
  4798. addFormatToken(0, ['gg', 2], 0, function () {
  4799. return this.weekYear() % 100;
  4800. });
  4801. addFormatToken(0, ['GG', 2], 0, function () {
  4802. return this.isoWeekYear() % 100;
  4803. });
  4804. function addWeekYearFormatToken (token, getter) {
  4805. addFormatToken(0, [token, token.length], 0, getter);
  4806. }
  4807. addWeekYearFormatToken('gggg', 'weekYear');
  4808. addWeekYearFormatToken('ggggg', 'weekYear');
  4809. addWeekYearFormatToken('GGGG', 'isoWeekYear');
  4810. addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  4811. // ALIASES
  4812. addUnitAlias('weekYear', 'gg');
  4813. addUnitAlias('isoWeekYear', 'GG');
  4814. // PRIORITY
  4815. addUnitPriority('weekYear', 1);
  4816. addUnitPriority('isoWeekYear', 1);
  4817. // PARSING
  4818. addRegexToken('G', matchSigned);
  4819. addRegexToken('g', matchSigned);
  4820. addRegexToken('GG', match1to2, match2);
  4821. addRegexToken('gg', match1to2, match2);
  4822. addRegexToken('GGGG', match1to4, match4);
  4823. addRegexToken('gggg', match1to4, match4);
  4824. addRegexToken('GGGGG', match1to6, match6);
  4825. addRegexToken('ggggg', match1to6, match6);
  4826. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
  4827. week[token.substr(0, 2)] = toInt(input);
  4828. });
  4829. addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  4830. week[token] = utils_hooks__hooks.parseTwoDigitYear(input);
  4831. });
  4832. // MOMENTS
  4833. function getSetWeekYear (input) {
  4834. return getSetWeekYearHelper.call(this,
  4835. input,
  4836. this.week(),
  4837. this.weekday(),
  4838. this.localeData()._week.dow,
  4839. this.localeData()._week.doy);
  4840. }
  4841. function getSetISOWeekYear (input) {
  4842. return getSetWeekYearHelper.call(this,
  4843. input, this.isoWeek(), this.isoWeekday(), 1, 4);
  4844. }
  4845. function getISOWeeksInYear () {
  4846. return weeksInYear(this.year(), 1, 4);
  4847. }
  4848. function getWeeksInYear () {
  4849. var weekInfo = this.localeData()._week;
  4850. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  4851. }
  4852. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  4853. var weeksTarget;
  4854. if (input == null) {
  4855. return weekOfYear(this, dow, doy).year;
  4856. } else {
  4857. weeksTarget = weeksInYear(input, dow, doy);
  4858. if (week > weeksTarget) {
  4859. week = weeksTarget;
  4860. }
  4861. return setWeekAll.call(this, input, week, weekday, dow, doy);
  4862. }
  4863. }
  4864. function setWeekAll(weekYear, week, weekday, dow, doy) {
  4865. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
  4866. date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  4867. this.year(date.getUTCFullYear());
  4868. this.month(date.getUTCMonth());
  4869. this.date(date.getUTCDate());
  4870. return this;
  4871. }
  4872. // FORMATTING
  4873. addFormatToken('Q', 0, 'Qo', 'quarter');
  4874. // ALIASES
  4875. addUnitAlias('quarter', 'Q');
  4876. // PRIORITY
  4877. addUnitPriority('quarter', 7);
  4878. // PARSING
  4879. addRegexToken('Q', match1);
  4880. addParseToken('Q', function (input, array) {
  4881. array[MONTH] = (toInt(input) - 1) * 3;
  4882. });
  4883. // MOMENTS
  4884. function getSetQuarter (input) {
  4885. return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
  4886. }
  4887. // FORMATTING
  4888. addFormatToken('D', ['DD', 2], 'Do', 'date');
  4889. // ALIASES
  4890. addUnitAlias('date', 'D');
  4891. // PRIOROITY
  4892. addUnitPriority('date', 9);
  4893. // PARSING
  4894. addRegexToken('D', match1to2);
  4895. addRegexToken('DD', match1to2, match2);
  4896. addRegexToken('Do', function (isStrict, locale) {
  4897. return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
  4898. });
  4899. addParseToken(['D', 'DD'], DATE);
  4900. addParseToken('Do', function (input, array) {
  4901. array[DATE] = toInt(input.match(match1to2)[0], 10);
  4902. });
  4903. // MOMENTS
  4904. var getSetDayOfMonth = makeGetSet('Date', true);
  4905. // FORMATTING
  4906. addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  4907. // ALIASES
  4908. addUnitAlias('dayOfYear', 'DDD');
  4909. // PRIORITY
  4910. addUnitPriority('dayOfYear', 4);
  4911. // PARSING
  4912. addRegexToken('DDD', match1to3);
  4913. addRegexToken('DDDD', match3);
  4914. addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  4915. config._dayOfYear = toInt(input);
  4916. });
  4917. // HELPERS
  4918. // MOMENTS
  4919. function getSetDayOfYear (input) {
  4920. var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
  4921. return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
  4922. }
  4923. // FORMATTING
  4924. addFormatToken('m', ['mm', 2], 0, 'minute');
  4925. // ALIASES
  4926. addUnitAlias('minute', 'm');
  4927. // PRIORITY
  4928. addUnitPriority('minute', 14);
  4929. // PARSING
  4930. addRegexToken('m', match1to2);
  4931. addRegexToken('mm', match1to2, match2);
  4932. addParseToken(['m', 'mm'], MINUTE);
  4933. // MOMENTS
  4934. var getSetMinute = makeGetSet('Minutes', false);
  4935. // FORMATTING
  4936. addFormatToken('s', ['ss', 2], 0, 'second');
  4937. // ALIASES
  4938. addUnitAlias('second', 's');
  4939. // PRIORITY
  4940. addUnitPriority('second', 15);
  4941. // PARSING
  4942. addRegexToken('s', match1to2);
  4943. addRegexToken('ss', match1to2, match2);
  4944. addParseToken(['s', 'ss'], SECOND);
  4945. // MOMENTS
  4946. var getSetSecond = makeGetSet('Seconds', false);
  4947. // FORMATTING
  4948. addFormatToken('S', 0, 0, function () {
  4949. return ~~(this.millisecond() / 100);
  4950. });
  4951. addFormatToken(0, ['SS', 2], 0, function () {
  4952. return ~~(this.millisecond() / 10);
  4953. });
  4954. addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  4955. addFormatToken(0, ['SSSS', 4], 0, function () {
  4956. return this.millisecond() * 10;
  4957. });
  4958. addFormatToken(0, ['SSSSS', 5], 0, function () {
  4959. return this.millisecond() * 100;
  4960. });
  4961. addFormatToken(0, ['SSSSSS', 6], 0, function () {
  4962. return this.millisecond() * 1000;
  4963. });
  4964. addFormatToken(0, ['SSSSSSS', 7], 0, function () {
  4965. return this.millisecond() * 10000;
  4966. });
  4967. addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
  4968. return this.millisecond() * 100000;
  4969. });
  4970. addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  4971. return this.millisecond() * 1000000;
  4972. });
  4973. // ALIASES
  4974. addUnitAlias('millisecond', 'ms');
  4975. // PRIORITY
  4976. addUnitPriority('millisecond', 16);
  4977. // PARSING
  4978. addRegexToken('S', match1to3, match1);
  4979. addRegexToken('SS', match1to3, match2);
  4980. addRegexToken('SSS', match1to3, match3);
  4981. var token;
  4982. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  4983. addRegexToken(token, matchUnsigned);
  4984. }
  4985. function parseMs(input, array) {
  4986. array[MILLISECOND] = toInt(('0.' + input) * 1000);
  4987. }
  4988. for (token = 'S'; token.length <= 9; token += 'S') {
  4989. addParseToken(token, parseMs);
  4990. }
  4991. // MOMENTS
  4992. var getSetMillisecond = makeGetSet('Milliseconds', false);
  4993. // FORMATTING
  4994. addFormatToken('z', 0, 0, 'zoneAbbr');
  4995. addFormatToken('zz', 0, 0, 'zoneName');
  4996. // MOMENTS
  4997. function getZoneAbbr () {
  4998. return this._isUTC ? 'UTC' : '';
  4999. }
  5000. function getZoneName () {
  5001. return this._isUTC ? 'Coordinated Universal Time' : '';
  5002. }
  5003. var momentPrototype__proto = Moment.prototype;
  5004. momentPrototype__proto.add = add_subtract__add;
  5005. momentPrototype__proto.calendar = moment_calendar__calendar;
  5006. momentPrototype__proto.clone = clone;
  5007. momentPrototype__proto.diff = diff;
  5008. momentPrototype__proto.endOf = endOf;
  5009. momentPrototype__proto.format = format;
  5010. momentPrototype__proto.from = from;
  5011. momentPrototype__proto.fromNow = fromNow;
  5012. momentPrototype__proto.to = to;
  5013. momentPrototype__proto.toNow = toNow;
  5014. momentPrototype__proto.get = stringGet;
  5015. momentPrototype__proto.invalidAt = invalidAt;
  5016. momentPrototype__proto.isAfter = isAfter;
  5017. momentPrototype__proto.isBefore = isBefore;
  5018. momentPrototype__proto.isBetween = isBetween;
  5019. momentPrototype__proto.isSame = isSame;
  5020. momentPrototype__proto.isSameOrAfter = isSameOrAfter;
  5021. momentPrototype__proto.isSameOrBefore = isSameOrBefore;
  5022. momentPrototype__proto.isValid = moment_valid__isValid;
  5023. momentPrototype__proto.lang = lang;
  5024. momentPrototype__proto.locale = locale;
  5025. momentPrototype__proto.localeData = localeData;
  5026. momentPrototype__proto.max = prototypeMax;
  5027. momentPrototype__proto.min = prototypeMin;
  5028. momentPrototype__proto.parsingFlags = parsingFlags;
  5029. momentPrototype__proto.set = stringSet;
  5030. momentPrototype__proto.startOf = startOf;
  5031. momentPrototype__proto.subtract = add_subtract__subtract;
  5032. momentPrototype__proto.toArray = toArray;
  5033. momentPrototype__proto.toObject = toObject;
  5034. momentPrototype__proto.toDate = toDate;
  5035. momentPrototype__proto.toISOString = moment_format__toISOString;
  5036. momentPrototype__proto.toJSON = toJSON;
  5037. momentPrototype__proto.toString = toString;
  5038. momentPrototype__proto.unix = unix;
  5039. momentPrototype__proto.valueOf = to_type__valueOf;
  5040. momentPrototype__proto.creationData = creationData;
  5041. // Year
  5042. momentPrototype__proto.year = getSetYear;
  5043. momentPrototype__proto.isLeapYear = getIsLeapYear;
  5044. // Week Year
  5045. momentPrototype__proto.weekYear = getSetWeekYear;
  5046. momentPrototype__proto.isoWeekYear = getSetISOWeekYear;
  5047. // Quarter
  5048. momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter;
  5049. // Month
  5050. momentPrototype__proto.month = getSetMonth;
  5051. momentPrototype__proto.daysInMonth = getDaysInMonth;
  5052. // Week
  5053. momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek;
  5054. momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek;
  5055. momentPrototype__proto.weeksInYear = getWeeksInYear;
  5056. momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear;
  5057. // Day
  5058. momentPrototype__proto.date = getSetDayOfMonth;
  5059. momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek;
  5060. momentPrototype__proto.weekday = getSetLocaleDayOfWeek;
  5061. momentPrototype__proto.isoWeekday = getSetISODayOfWeek;
  5062. momentPrototype__proto.dayOfYear = getSetDayOfYear;
  5063. // Hour
  5064. momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour;
  5065. // Minute
  5066. momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute;
  5067. // Second
  5068. momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond;
  5069. // Millisecond
  5070. momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond;
  5071. // Offset
  5072. momentPrototype__proto.utcOffset = getSetOffset;
  5073. momentPrototype__proto.utc = setOffsetToUTC;
  5074. momentPrototype__proto.local = setOffsetToLocal;
  5075. momentPrototype__proto.parseZone = setOffsetToParsedOffset;
  5076. momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset;
  5077. momentPrototype__proto.isDST = isDaylightSavingTime;
  5078. momentPrototype__proto.isLocal = isLocal;
  5079. momentPrototype__proto.isUtcOffset = isUtcOffset;
  5080. momentPrototype__proto.isUtc = isUtc;
  5081. momentPrototype__proto.isUTC = isUtc;
  5082. // Timezone
  5083. momentPrototype__proto.zoneAbbr = getZoneAbbr;
  5084. momentPrototype__proto.zoneName = getZoneName;
  5085. // Deprecations
  5086. momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
  5087. momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
  5088. momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
  5089. momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);
  5090. momentPrototype__proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);
  5091. var momentPrototype = momentPrototype__proto;
  5092. function moment__createUnix (input) {
  5093. return local__createLocal(input * 1000);
  5094. }
  5095. function moment__createInZone () {
  5096. return local__createLocal.apply(null, arguments).parseZone();
  5097. }
  5098. function preParsePostFormat (string) {
  5099. return string;
  5100. }
  5101. var prototype__proto = Locale.prototype;
  5102. prototype__proto.calendar = locale_calendar__calendar;
  5103. prototype__proto.longDateFormat = longDateFormat;
  5104. prototype__proto.invalidDate = invalidDate;
  5105. prototype__proto.ordinal = ordinal;
  5106. prototype__proto.preparse = preParsePostFormat;
  5107. prototype__proto.postformat = preParsePostFormat;
  5108. prototype__proto.relativeTime = relative__relativeTime;
  5109. prototype__proto.pastFuture = pastFuture;
  5110. prototype__proto.set = locale_set__set;
  5111. // Month
  5112. prototype__proto.months = localeMonths;
  5113. prototype__proto.monthsShort = localeMonthsShort;
  5114. prototype__proto.monthsParse = localeMonthsParse;
  5115. prototype__proto.monthsRegex = monthsRegex;
  5116. prototype__proto.monthsShortRegex = monthsShortRegex;
  5117. // Week
  5118. prototype__proto.week = localeWeek;
  5119. prototype__proto.firstDayOfYear = localeFirstDayOfYear;
  5120. prototype__proto.firstDayOfWeek = localeFirstDayOfWeek;
  5121. // Day of Week
  5122. prototype__proto.weekdays = localeWeekdays;
  5123. prototype__proto.weekdaysMin = localeWeekdaysMin;
  5124. prototype__proto.weekdaysShort = localeWeekdaysShort;
  5125. prototype__proto.weekdaysParse = localeWeekdaysParse;
  5126. prototype__proto.weekdaysRegex = weekdaysRegex;
  5127. prototype__proto.weekdaysShortRegex = weekdaysShortRegex;
  5128. prototype__proto.weekdaysMinRegex = weekdaysMinRegex;
  5129. // Hours
  5130. prototype__proto.isPM = localeIsPM;
  5131. prototype__proto.meridiem = localeMeridiem;
  5132. function lists__get (format, index, field, setter) {
  5133. var locale = locale_locales__getLocale();
  5134. var utc = create_utc__createUTC().set(setter, index);
  5135. return locale[field](utc, format);
  5136. }
  5137. function listMonthsImpl (format, index, field) {
  5138. if (typeof format === 'number') {
  5139. index = format;
  5140. format = undefined;
  5141. }
  5142. format = format || '';
  5143. if (index != null) {
  5144. return lists__get(format, index, field, 'month');
  5145. }
  5146. var i;
  5147. var out = [];
  5148. for (i = 0; i < 12; i++) {
  5149. out[i] = lists__get(format, i, field, 'month');
  5150. }
  5151. return out;
  5152. }
  5153. // ()
  5154. // (5)
  5155. // (fmt, 5)
  5156. // (fmt)
  5157. // (true)
  5158. // (true, 5)
  5159. // (true, fmt, 5)
  5160. // (true, fmt)
  5161. function listWeekdaysImpl (localeSorted, format, index, field) {
  5162. if (typeof localeSorted === 'boolean') {
  5163. if (typeof format === 'number') {
  5164. index = format;
  5165. format = undefined;
  5166. }
  5167. format = format || '';
  5168. } else {
  5169. format = localeSorted;
  5170. index = format;
  5171. localeSorted = false;
  5172. if (typeof format === 'number') {
  5173. index = format;
  5174. format = undefined;
  5175. }
  5176. format = format || '';
  5177. }
  5178. var locale = locale_locales__getLocale(),
  5179. shift = localeSorted ? locale._week.dow : 0;
  5180. if (index != null) {
  5181. return lists__get(format, (index + shift) % 7, field, 'day');
  5182. }
  5183. var i;
  5184. var out = [];
  5185. for (i = 0; i < 7; i++) {
  5186. out[i] = lists__get(format, (i + shift) % 7, field, 'day');
  5187. }
  5188. return out;
  5189. }
  5190. function lists__listMonths (format, index) {
  5191. return listMonthsImpl(format, index, 'months');
  5192. }
  5193. function lists__listMonthsShort (format, index) {
  5194. return listMonthsImpl(format, index, 'monthsShort');
  5195. }
  5196. function lists__listWeekdays (localeSorted, format, index) {
  5197. return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  5198. }
  5199. function lists__listWeekdaysShort (localeSorted, format, index) {
  5200. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  5201. }
  5202. function lists__listWeekdaysMin (localeSorted, format, index) {
  5203. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  5204. }
  5205. locale_locales__getSetGlobalLocale('en', {
  5206. ordinalParse: /\d{1,2}(th|st|nd|rd)/,
  5207. ordinal : function (number) {
  5208. var b = number % 10,
  5209. output = (toInt(number % 100 / 10) === 1) ? 'th' :
  5210. (b === 1) ? 'st' :
  5211. (b === 2) ? 'nd' :
  5212. (b === 3) ? 'rd' : 'th';
  5213. return number + output;
  5214. }
  5215. });
  5216. // Side effect imports
  5217. utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale);
  5218. utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale);
  5219. var mathAbs = Math.abs;
  5220. function duration_abs__abs () {
  5221. var data = this._data;
  5222. this._milliseconds = mathAbs(this._milliseconds);
  5223. this._days = mathAbs(this._days);
  5224. this._months = mathAbs(this._months);
  5225. data.milliseconds = mathAbs(data.milliseconds);
  5226. data.seconds = mathAbs(data.seconds);
  5227. data.minutes = mathAbs(data.minutes);
  5228. data.hours = mathAbs(data.hours);
  5229. data.months = mathAbs(data.months);
  5230. data.years = mathAbs(data.years);
  5231. return this;
  5232. }
  5233. function duration_add_subtract__addSubtract (duration, input, value, direction) {
  5234. var other = create__createDuration(input, value);
  5235. duration._milliseconds += direction * other._milliseconds;
  5236. duration._days += direction * other._days;
  5237. duration._months += direction * other._months;
  5238. return duration._bubble();
  5239. }
  5240. // supports only 2.0-style add(1, 's') or add(duration)
  5241. function duration_add_subtract__add (input, value) {
  5242. return duration_add_subtract__addSubtract(this, input, value, 1);
  5243. }
  5244. // supports only 2.0-style subtract(1, 's') or subtract(duration)
  5245. function duration_add_subtract__subtract (input, value) {
  5246. return duration_add_subtract__addSubtract(this, input, value, -1);
  5247. }
  5248. function absCeil (number) {
  5249. if (number < 0) {
  5250. return Math.floor(number);
  5251. } else {
  5252. return Math.ceil(number);
  5253. }
  5254. }
  5255. function bubble () {
  5256. var milliseconds = this._milliseconds;
  5257. var days = this._days;
  5258. var months = this._months;
  5259. var data = this._data;
  5260. var seconds, minutes, hours, years, monthsFromDays;
  5261. // if we have a mix of positive and negative values, bubble down first
  5262. // check: https://github.com/moment/moment/issues/2166
  5263. if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
  5264. (milliseconds <= 0 && days <= 0 && months <= 0))) {
  5265. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  5266. days = 0;
  5267. months = 0;
  5268. }
  5269. // The following code bubbles up values, see the tests for
  5270. // examples of what that means.
  5271. data.milliseconds = milliseconds % 1000;
  5272. seconds = absFloor(milliseconds / 1000);
  5273. data.seconds = seconds % 60;
  5274. minutes = absFloor(seconds / 60);
  5275. data.minutes = minutes % 60;
  5276. hours = absFloor(minutes / 60);
  5277. data.hours = hours % 24;
  5278. days += absFloor(hours / 24);
  5279. // convert days to months
  5280. monthsFromDays = absFloor(daysToMonths(days));
  5281. months += monthsFromDays;
  5282. days -= absCeil(monthsToDays(monthsFromDays));
  5283. // 12 months -> 1 year
  5284. years = absFloor(months / 12);
  5285. months %= 12;
  5286. data.days = days;
  5287. data.months = months;
  5288. data.years = years;
  5289. return this;
  5290. }
  5291. function daysToMonths (days) {
  5292. // 400 years have 146097 days (taking into account leap year rules)
  5293. // 400 years have 12 months === 4800
  5294. return days * 4800 / 146097;
  5295. }
  5296. function monthsToDays (months) {
  5297. // the reverse of daysToMonths
  5298. return months * 146097 / 4800;
  5299. }
  5300. function as (units) {
  5301. var days;
  5302. var months;
  5303. var milliseconds = this._milliseconds;
  5304. units = normalizeUnits(units);
  5305. if (units === 'month' || units === 'year') {
  5306. days = this._days + milliseconds / 864e5;
  5307. months = this._months + daysToMonths(days);
  5308. return units === 'month' ? months : months / 12;
  5309. } else {
  5310. // handle milliseconds separately because of floating point math errors (issue #1867)
  5311. days = this._days + Math.round(monthsToDays(this._months));
  5312. switch (units) {
  5313. case 'week' : return days / 7 + milliseconds / 6048e5;
  5314. case 'day' : return days + milliseconds / 864e5;
  5315. case 'hour' : return days * 24 + milliseconds / 36e5;
  5316. case 'minute' : return days * 1440 + milliseconds / 6e4;
  5317. case 'second' : return days * 86400 + milliseconds / 1000;
  5318. // Math.floor prevents floating point math errors here
  5319. case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
  5320. default: throw new Error('Unknown unit ' + units);
  5321. }
  5322. }
  5323. }
  5324. // TODO: Use this.as('ms')?
  5325. function duration_as__valueOf () {
  5326. return (
  5327. this._milliseconds +
  5328. this._days * 864e5 +
  5329. (this._months % 12) * 2592e6 +
  5330. toInt(this._months / 12) * 31536e6
  5331. );
  5332. }
  5333. function makeAs (alias) {
  5334. return function () {
  5335. return this.as(alias);
  5336. };
  5337. }
  5338. var asMilliseconds = makeAs('ms');
  5339. var asSeconds = makeAs('s');
  5340. var asMinutes = makeAs('m');
  5341. var asHours = makeAs('h');
  5342. var asDays = makeAs('d');
  5343. var asWeeks = makeAs('w');
  5344. var asMonths = makeAs('M');
  5345. var asYears = makeAs('y');
  5346. function duration_get__get (units) {
  5347. units = normalizeUnits(units);
  5348. return this[units + 's']();
  5349. }
  5350. function makeGetter(name) {
  5351. return function () {
  5352. return this._data[name];
  5353. };
  5354. }
  5355. var milliseconds = makeGetter('milliseconds');
  5356. var seconds = makeGetter('seconds');
  5357. var minutes = makeGetter('minutes');
  5358. var hours = makeGetter('hours');
  5359. var days = makeGetter('days');
  5360. var months = makeGetter('months');
  5361. var years = makeGetter('years');
  5362. function weeks () {
  5363. return absFloor(this.days() / 7);
  5364. }
  5365. var round = Math.round;
  5366. var thresholds = {
  5367. s: 45, // seconds to minute
  5368. m: 45, // minutes to hour
  5369. h: 22, // hours to day
  5370. d: 26, // days to month
  5371. M: 11 // months to year
  5372. };
  5373. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  5374. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
  5375. return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  5376. }
  5377. function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) {
  5378. var duration = create__createDuration(posNegDuration).abs();
  5379. var seconds = round(duration.as('s'));
  5380. var minutes = round(duration.as('m'));
  5381. var hours = round(duration.as('h'));
  5382. var days = round(duration.as('d'));
  5383. var months = round(duration.as('M'));
  5384. var years = round(duration.as('y'));
  5385. var a = seconds < thresholds.s && ['s', seconds] ||
  5386. minutes <= 1 && ['m'] ||
  5387. minutes < thresholds.m && ['mm', minutes] ||
  5388. hours <= 1 && ['h'] ||
  5389. hours < thresholds.h && ['hh', hours] ||
  5390. days <= 1 && ['d'] ||
  5391. days < thresholds.d && ['dd', days] ||
  5392. months <= 1 && ['M'] ||
  5393. months < thresholds.M && ['MM', months] ||
  5394. years <= 1 && ['y'] || ['yy', years];
  5395. a[2] = withoutSuffix;
  5396. a[3] = +posNegDuration > 0;
  5397. a[4] = locale;
  5398. return substituteTimeAgo.apply(null, a);
  5399. }
  5400. // This function allows you to set the rounding function for relative time strings
  5401. function duration_humanize__getSetRelativeTimeRounding (roundingFunction) {
  5402. if (roundingFunction === undefined) {
  5403. return round;
  5404. }
  5405. if (typeof(roundingFunction) === 'function') {
  5406. round = roundingFunction;
  5407. return true;
  5408. }
  5409. return false;
  5410. }
  5411. // This function allows you to set a threshold for relative time strings
  5412. function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {
  5413. if (thresholds[threshold] === undefined) {
  5414. return false;
  5415. }
  5416. if (limit === undefined) {
  5417. return thresholds[threshold];
  5418. }
  5419. thresholds[threshold] = limit;
  5420. return true;
  5421. }
  5422. function humanize (withSuffix) {
  5423. var locale = this.localeData();
  5424. var output = duration_humanize__relativeTime(this, !withSuffix, locale);
  5425. if (withSuffix) {
  5426. output = locale.pastFuture(+this, output);
  5427. }
  5428. return locale.postformat(output);
  5429. }
  5430. var iso_string__abs = Math.abs;
  5431. function iso_string__toISOString() {
  5432. // for ISO strings we do not use the normal bubbling rules:
  5433. // * milliseconds bubble up until they become hours
  5434. // * days do not bubble at all
  5435. // * months bubble up until they become years
  5436. // This is because there is no context-free conversion between hours and days
  5437. // (think of clock changes)
  5438. // and also not between days and months (28-31 days per month)
  5439. var seconds = iso_string__abs(this._milliseconds) / 1000;
  5440. var days = iso_string__abs(this._days);
  5441. var months = iso_string__abs(this._months);
  5442. var minutes, hours, years;
  5443. // 3600 seconds -> 60 minutes -> 1 hour
  5444. minutes = absFloor(seconds / 60);
  5445. hours = absFloor(minutes / 60);
  5446. seconds %= 60;
  5447. minutes %= 60;
  5448. // 12 months -> 1 year
  5449. years = absFloor(months / 12);
  5450. months %= 12;
  5451. // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
  5452. var Y = years;
  5453. var M = months;
  5454. var D = days;
  5455. var h = hours;
  5456. var m = minutes;
  5457. var s = seconds;
  5458. var total = this.asSeconds();
  5459. if (!total) {
  5460. // this is the same as C#'s (Noda) and python (isodate)...
  5461. // but not other JS (goog.date)
  5462. return 'P0D';
  5463. }
  5464. return (total < 0 ? '-' : '') +
  5465. 'P' +
  5466. (Y ? Y + 'Y' : '') +
  5467. (M ? M + 'M' : '') +
  5468. (D ? D + 'D' : '') +
  5469. ((h || m || s) ? 'T' : '') +
  5470. (h ? h + 'H' : '') +
  5471. (m ? m + 'M' : '') +
  5472. (s ? s + 'S' : '');
  5473. }
  5474. var duration_prototype__proto = Duration.prototype;
  5475. duration_prototype__proto.abs = duration_abs__abs;
  5476. duration_prototype__proto.add = duration_add_subtract__add;
  5477. duration_prototype__proto.subtract = duration_add_subtract__subtract;
  5478. duration_prototype__proto.as = as;
  5479. duration_prototype__proto.asMilliseconds = asMilliseconds;
  5480. duration_prototype__proto.asSeconds = asSeconds;
  5481. duration_prototype__proto.asMinutes = asMinutes;
  5482. duration_prototype__proto.asHours = asHours;
  5483. duration_prototype__proto.asDays = asDays;
  5484. duration_prototype__proto.asWeeks = asWeeks;
  5485. duration_prototype__proto.asMonths = asMonths;
  5486. duration_prototype__proto.asYears = asYears;
  5487. duration_prototype__proto.valueOf = duration_as__valueOf;
  5488. duration_prototype__proto._bubble = bubble;
  5489. duration_prototype__proto.get = duration_get__get;
  5490. duration_prototype__proto.milliseconds = milliseconds;
  5491. duration_prototype__proto.seconds = seconds;
  5492. duration_prototype__proto.minutes = minutes;
  5493. duration_prototype__proto.hours = hours;
  5494. duration_prototype__proto.days = days;
  5495. duration_prototype__proto.weeks = weeks;
  5496. duration_prototype__proto.months = months;
  5497. duration_prototype__proto.years = years;
  5498. duration_prototype__proto.humanize = humanize;
  5499. duration_prototype__proto.toISOString = iso_string__toISOString;
  5500. duration_prototype__proto.toString = iso_string__toISOString;
  5501. duration_prototype__proto.toJSON = iso_string__toISOString;
  5502. duration_prototype__proto.locale = locale;
  5503. duration_prototype__proto.localeData = localeData;
  5504. // Deprecations
  5505. duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString);
  5506. duration_prototype__proto.lang = lang;
  5507. // Side effect imports
  5508. // FORMATTING
  5509. addFormatToken('X', 0, 0, 'unix');
  5510. addFormatToken('x', 0, 0, 'valueOf');
  5511. // PARSING
  5512. addRegexToken('x', matchSigned);
  5513. addRegexToken('X', matchTimestamp);
  5514. addParseToken('X', function (input, array, config) {
  5515. config._d = new Date(parseFloat(input, 10) * 1000);
  5516. });
  5517. addParseToken('x', function (input, array, config) {
  5518. config._d = new Date(toInt(input));
  5519. });
  5520. // Side effect imports
  5521. utils_hooks__hooks.version = '2.15.2';
  5522. setHookCallback(local__createLocal);
  5523. utils_hooks__hooks.fn = momentPrototype;
  5524. utils_hooks__hooks.min = min;
  5525. utils_hooks__hooks.max = max;
  5526. utils_hooks__hooks.now = now;
  5527. utils_hooks__hooks.utc = create_utc__createUTC;
  5528. utils_hooks__hooks.unix = moment__createUnix;
  5529. utils_hooks__hooks.months = lists__listMonths;
  5530. utils_hooks__hooks.isDate = isDate;
  5531. utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale;
  5532. utils_hooks__hooks.invalid = valid__createInvalid;
  5533. utils_hooks__hooks.duration = create__createDuration;
  5534. utils_hooks__hooks.isMoment = isMoment;
  5535. utils_hooks__hooks.weekdays = lists__listWeekdays;
  5536. utils_hooks__hooks.parseZone = moment__createInZone;
  5537. utils_hooks__hooks.localeData = locale_locales__getLocale;
  5538. utils_hooks__hooks.isDuration = isDuration;
  5539. utils_hooks__hooks.monthsShort = lists__listMonthsShort;
  5540. utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin;
  5541. utils_hooks__hooks.defineLocale = defineLocale;
  5542. utils_hooks__hooks.updateLocale = updateLocale;
  5543. utils_hooks__hooks.locales = locale_locales__listLocales;
  5544. utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort;
  5545. utils_hooks__hooks.normalizeUnits = normalizeUnits;
  5546. utils_hooks__hooks.relativeTimeRounding = duration_humanize__getSetRelativeTimeRounding;
  5547. utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold;
  5548. utils_hooks__hooks.calendarFormat = getCalendarFormat;
  5549. utils_hooks__hooks.prototype = momentPrototype;
  5550. var _moment = utils_hooks__hooks;
  5551. return _moment;
  5552. }));
  5553. define('moment', ['moment/moment'], function (main) { return main; });
  5554. /*
  5555. * css.normalize.js
  5556. *
  5557. * CSS Normalization
  5558. *
  5559. * CSS paths are normalized based on an optional basePath and the RequireJS config
  5560. *
  5561. * Usage:
  5562. * normalize(css, fromBasePath, toBasePath);
  5563. *
  5564. * css: the stylesheet content to normalize
  5565. * fromBasePath: the absolute base path of the css relative to any root (but without ../ backtracking)
  5566. * toBasePath: the absolute new base path of the css relative to the same root
  5567. *
  5568. * Absolute dependencies are left untouched.
  5569. *
  5570. * Urls in the CSS are picked up by regular expressions.
  5571. * These will catch all statements of the form:
  5572. *
  5573. * url(*)
  5574. * url('*')
  5575. * url("*")
  5576. *
  5577. * @import '*'
  5578. * @import "*"
  5579. *
  5580. * (and so also @import url(*) variations)
  5581. *
  5582. * For urls needing normalization
  5583. *
  5584. */
  5585. define('../libs/require-css/normalize',[],function() {
  5586. // regular expression for removing double slashes
  5587. // eg http://www.example.com//my///url/here -> http://www.example.com/my/url/here
  5588. var slashes = /([^:])\/+/g
  5589. var removeDoubleSlashes = function(uri) {
  5590. return uri.replace(slashes, '$1/');
  5591. }
  5592. // given a relative URI, and two absolute base URIs, convert it from one base to another
  5593. var protocolRegEx = /[^\:\/]*:\/\/([^\/])*/;
  5594. var absUrlRegEx = /^(\/|data:)/;
  5595. function convertURIBase(uri, fromBase, toBase) {
  5596. if (uri.match(absUrlRegEx) || uri.match(protocolRegEx))
  5597. return uri;
  5598. uri = removeDoubleSlashes(uri);
  5599. // if toBase specifies a protocol path, ensure this is the same protocol as fromBase, if not
  5600. // use absolute path at fromBase
  5601. var toBaseProtocol = toBase.match(protocolRegEx);
  5602. var fromBaseProtocol = fromBase.match(protocolRegEx);
  5603. if (fromBaseProtocol && (!toBaseProtocol || toBaseProtocol[1] != fromBaseProtocol[1] || toBaseProtocol[2] != fromBaseProtocol[2]))
  5604. return absoluteURI(uri, fromBase);
  5605. else {
  5606. return relativeURI(absoluteURI(uri, fromBase), toBase);
  5607. }
  5608. };
  5609. // given a relative URI, calculate the absolute URI
  5610. function absoluteURI(uri, base) {
  5611. if (uri.substr(0, 2) == './')
  5612. uri = uri.substr(2);
  5613. // absolute urls are left in tact
  5614. if (uri.match(absUrlRegEx) || uri.match(protocolRegEx))
  5615. return uri;
  5616. var baseParts = base.split('/');
  5617. var uriParts = uri.split('/');
  5618. baseParts.pop();
  5619. while (curPart = uriParts.shift())
  5620. if (curPart == '..')
  5621. baseParts.pop();
  5622. else
  5623. baseParts.push(curPart);
  5624. return baseParts.join('/');
  5625. };
  5626. // given an absolute URI, calculate the relative URI
  5627. function relativeURI(uri, base) {
  5628. // reduce base and uri strings to just their difference string
  5629. var baseParts = base.split('/');
  5630. baseParts.pop();
  5631. base = baseParts.join('/') + '/';
  5632. i = 0;
  5633. while (base.substr(i, 1) == uri.substr(i, 1))
  5634. i++;
  5635. while (base.substr(i, 1) != '/')
  5636. i--;
  5637. base = base.substr(i + 1);
  5638. uri = uri.substr(i + 1);
  5639. // each base folder difference is thus a backtrack
  5640. baseParts = base.split('/');
  5641. var uriParts = uri.split('/');
  5642. out = '';
  5643. while (baseParts.shift())
  5644. out += '../';
  5645. // finally add uri parts
  5646. while (curPart = uriParts.shift())
  5647. out += curPart + '/';
  5648. return out.substr(0, out.length - 1);
  5649. };
  5650. var normalizeCSS = function(source, fromBase, toBase) {
  5651. fromBase = removeDoubleSlashes(fromBase);
  5652. toBase = removeDoubleSlashes(toBase);
  5653. var urlRegEx = /@import\s*("([^"]*)"|'([^']*)')|url\s*\((?!#)\s*(\s*"([^"]*)"|'([^']*)'|[^\)]*\s*)\s*\)/ig;
  5654. var result, url, source;
  5655. while (result = urlRegEx.exec(source)) {
  5656. url = result[3] || result[2] || result[5] || result[6] || result[4];
  5657. var newUrl;
  5658. newUrl = convertURIBase(url, fromBase, toBase);
  5659. var quoteLen = result[5] || result[6] ? 1 : 0;
  5660. source = source.substr(0, urlRegEx.lastIndex - url.length - quoteLen - 1) + newUrl + source.substr(urlRegEx.lastIndex - quoteLen - 1);
  5661. urlRegEx.lastIndex = urlRegEx.lastIndex + (newUrl.length - url.length);
  5662. }
  5663. return source;
  5664. };
  5665. normalizeCSS.convertURIBase = convertURIBase;
  5666. normalizeCSS.absoluteURI = absoluteURI;
  5667. normalizeCSS.relativeURI = relativeURI;
  5668. return normalizeCSS;
  5669. });
  5670. ;
  5671. define('../libs/require-css/css.min!../libs/bootstrap-table/dist/bootstrap-table.min',[],function(){});
  5672. /*
  5673. * bootstrap-table - v1.11.0 - 2016-07-02
  5674. * https://github.com/wenzhixin/bootstrap-table
  5675. * Copyright (c) 2016 zhixin wen
  5676. * Licensed MIT License
  5677. */
  5678. !function(a){"use strict";var b=null,c=function(a){var b=arguments,c=!0,d=1;return a=a.replace(/%s/g,function(){var a=b[d++];return"undefined"==typeof a?(c=!1,""):a}),c?a:""},d=function(b,c,d,e){var f="";return a.each(b,function(a,b){return b[c]===e?(f=b[d],!1):!0}),f},e=function(b,c){var d=-1;return a.each(b,function(a,b){return b.field===c?(d=a,!1):!0}),d},f=function(b){var c,d,e,f=0,g=[];for(c=0;c<b[0].length;c++)f+=b[0][c].colspan||1;for(c=0;c<b.length;c++)for(g[c]=[],d=0;f>d;d++)g[c][d]=!1;for(c=0;c<b.length;c++)for(d=0;d<b[c].length;d++){var h=b[c][d],i=h.rowspan||1,j=h.colspan||1,k=a.inArray(!1,g[c]);for(1===j&&(h.fieldIndex=k,"undefined"==typeof h.field&&(h.field=k)),e=0;i>e;e++)g[c+e][k]=!0;for(e=0;j>e;e++)g[c][k+e]=!0}},g=function(){if(null===b){var c,d,e=a("<p/>").addClass("fixed-table-scroll-inner"),f=a("<div/>").addClass("fixed-table-scroll-outer");f.append(e),a("body").append(f),c=e[0].offsetWidth,f.css("overflow","scroll"),d=e[0].offsetWidth,c===d&&(d=f[0].clientWidth),f.remove(),b=c-d}return b},h=function(b,d,e,f){var g=d;if("string"==typeof d){var h=d.split(".");h.length>1?(g=window,a.each(h,function(a,b){g=g[b]})):g=window[d]}return"object"==typeof g?g:"function"==typeof g?g.apply(b,e):!g&&"string"==typeof d&&c.apply(this,[d].concat(e))?c.apply(this,[d].concat(e)):f},i=function(b,c,d){var e=Object.getOwnPropertyNames(b),f=Object.getOwnPropertyNames(c),g="";if(d&&e.length!==f.length)return!1;for(var h=0;h<e.length;h++)if(g=e[h],a.inArray(g,f)>-1&&b[g]!==c[g])return!1;return!0},j=function(a){return"string"==typeof a?a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/`/g,"&#x60;"):a},k=function(b){var c=0;return b.children().each(function(){c<a(this).outerHeight(!0)&&(c=a(this).outerHeight(!0))}),c},l=function(a){for(var b in a){var c=b.split(/(?=[A-Z])/).join("-").toLowerCase();c!==b&&(a[c]=a[b],delete a[b])}return a},m=function(a,b,c){var d=a;if("string"!=typeof b||a.hasOwnProperty(b))return c?j(a[b]):a[b];var e=b.split(".");for(var f in e)d=d&&d[e[f]];return c?j(d):d},n=function(){return!!(navigator.userAgent.indexOf("MSIE ")>0||navigator.userAgent.match(/Trident.*rv\:11\./))},o=function(){Object.keys||(Object.keys=function(){var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=c.length;return function(e){if("object"!=typeof e&&("function"!=typeof e||null===e))throw new TypeError("Object.keys called on non-object");var f,g,h=[];for(f in e)a.call(e,f)&&h.push(f);if(b)for(g=0;d>g;g++)a.call(e,c[g])&&h.push(c[g]);return h}}())},p=function(b,c){this.options=c,this.$el=a(b),this.$el_=this.$el.clone(),this.timeoutId_=0,this.timeoutFooter_=0,this.init()};p.DEFAULTS={classes:"table table-hover",locale:void 0,height:void 0,undefinedText:"-",sortName:void 0,sortOrder:"asc",sortStable:!1,striped:!1,columns:[[]],data:[],dataField:"rows",method:"get",url:void 0,ajax:void 0,cache:!0,contentType:"application/json",dataType:"json",ajaxOptions:{},queryParams:function(a){return a},queryParamsType:"limit",responseHandler:function(a){return a},pagination:!1,onlyInfoPagination:!1,sidePagination:"client",totalRows:0,pageNumber:1,pageSize:10,pageList:[10,25,50,100],paginationHAlign:"right",paginationVAlign:"bottom",paginationDetailHAlign:"left",paginationPreText:"&lsaquo;",paginationNextText:"&rsaquo;",search:!1,searchOnEnterKey:!1,strictSearch:!1,searchAlign:"right",selectItemName:"btSelectItem",showHeader:!0,showFooter:!1,showColumns:!1,showPaginationSwitch:!1,showRefresh:!1,showToggle:!1,buttonsAlign:"right",smartDisplay:!0,escape:!1,minimumCountColumns:1,idField:void 0,uniqueId:void 0,cardView:!1,detailView:!1,detailFormatter:function(){return""},trimOnSearch:!0,clickToSelect:!1,singleSelect:!1,toolbar:void 0,toolbarAlign:"left",checkboxHeader:!0,sortable:!0,silentSort:!0,maintainSelected:!1,searchTimeOut:500,searchText:"",iconSize:void 0,buttonsClass:"default",iconsPrefix:"glyphicon",icons:{paginationSwitchDown:"glyphicon-collapse-down icon-chevron-down",paginationSwitchUp:"glyphicon-collapse-up icon-chevron-up",refresh:"glyphicon-refresh icon-refresh",toggle:"glyphicon-list-alt icon-list-alt",columns:"glyphicon-th icon-th",detailOpen:"glyphicon-plus icon-plus",detailClose:"glyphicon-minus icon-minus"},customSearch:a.noop,customSort:a.noop,rowStyle:function(){return{}},rowAttributes:function(){return{}},footerStyle:function(){return{}},onAll:function(){return!1},onClickCell:function(){return!1},onDblClickCell:function(){return!1},onClickRow:function(){return!1},onDblClickRow:function(){return!1},onSort:function(){return!1},onCheck:function(){return!1},onUncheck:function(){return!1},onCheckAll:function(){return!1},onUncheckAll:function(){return!1},onCheckSome:function(){return!1},onUncheckSome:function(){return!1},onLoadSuccess:function(){return!1},onLoadError:function(){return!1},onColumnSwitch:function(){return!1},onPageChange:function(){return!1},onSearch:function(){return!1},onToggle:function(){return!1},onPreBody:function(){return!1},onPostBody:function(){return!1},onPostHeader:function(){return!1},onExpandRow:function(){return!1},onCollapseRow:function(){return!1},onRefreshOptions:function(){return!1},onRefresh:function(){return!1},onResetView:function(){return!1}},p.LOCALES={},p.LOCALES["en-US"]=p.LOCALES.en={formatLoadingMessage:function(){return"Loading, please wait..."},formatRecordsPerPage:function(a){return c("%s rows per page",a)},formatShowingRows:function(a,b,d){return c("Showing %s to %s of %s rows",a,b,d)},formatDetailPagination:function(a){return c("Showing %s rows",a)},formatSearch:function(){return"Search"},formatNoMatches:function(){return"No matching records found"},formatPaginationSwitch:function(){return"Hide/Show pagination"},formatRefresh:function(){return"Refresh"},formatToggle:function(){return"Toggle"},formatColumns:function(){return"Columns"},formatAllRows:function(){return"All"}},a.extend(p.DEFAULTS,p.LOCALES["en-US"]),p.COLUMN_DEFAULTS={radio:!1,checkbox:!1,checkboxEnabled:!0,field:void 0,title:void 0,titleTooltip:void 0,"class":void 0,align:void 0,halign:void 0,falign:void 0,valign:void 0,width:void 0,sortable:!1,order:"asc",visible:!0,switchable:!0,clickToSelect:!0,formatter:void 0,footerFormatter:void 0,events:void 0,sorter:void 0,sortName:void 0,cellStyle:void 0,searchable:!0,searchFormatter:!0,cardVisible:!0},p.EVENTS={"all.bs.table":"onAll","click-cell.bs.table":"onClickCell","dbl-click-cell.bs.table":"onDblClickCell","click-row.bs.table":"onClickRow","dbl-click-row.bs.table":"onDblClickRow","sort.bs.table":"onSort","check.bs.table":"onCheck","uncheck.bs.table":"onUncheck","check-all.bs.table":"onCheckAll","uncheck-all.bs.table":"onUncheckAll","check-some.bs.table":"onCheckSome","uncheck-some.bs.table":"onUncheckSome","load-success.bs.table":"onLoadSuccess","load-error.bs.table":"onLoadError","column-switch.bs.table":"onColumnSwitch","page-change.bs.table":"onPageChange","search.bs.table":"onSearch","toggle.bs.table":"onToggle","pre-body.bs.table":"onPreBody","post-body.bs.table":"onPostBody","post-header.bs.table":"onPostHeader","expand-row.bs.table":"onExpandRow","collapse-row.bs.table":"onCollapseRow","refresh-options.bs.table":"onRefreshOptions","reset-view.bs.table":"onResetView","refresh.bs.table":"onRefresh"},p.prototype.init=function(){this.initLocale(),this.initContainer(),this.initTable(),this.initHeader(),this.initData(),this.initFooter(),this.initToolbar(),this.initPagination(),this.initBody(),this.initSearchText(),this.initServer()},p.prototype.initLocale=function(){if(this.options.locale){var b=this.options.locale.split(/-|_/);b[0].toLowerCase(),b[1]&&b[1].toUpperCase(),a.fn.bootstrapTable.locales[this.options.locale]?a.extend(this.options,a.fn.bootstrapTable.locales[this.options.locale]):a.fn.bootstrapTable.locales[b.join("-")]?a.extend(this.options,a.fn.bootstrapTable.locales[b.join("-")]):a.fn.bootstrapTable.locales[b[0]]&&a.extend(this.options,a.fn.bootstrapTable.locales[b[0]])}},p.prototype.initContainer=function(){this.$container=a(['<div class="bootstrap-table">','<div class="fixed-table-toolbar"></div>',"top"===this.options.paginationVAlign||"both"===this.options.paginationVAlign?'<div class="fixed-table-pagination" style="clear: both;"></div>':"",'<div class="fixed-table-container">','<div class="fixed-table-header"><table></table></div>','<div class="fixed-table-body">','<div class="fixed-table-loading">',this.options.formatLoadingMessage(),"</div>","</div>",'<div class="fixed-table-footer"><table><tr></tr></table></div>',"bottom"===this.options.paginationVAlign||"both"===this.options.paginationVAlign?'<div class="fixed-table-pagination"></div>':"","</div>","</div>"].join("")),this.$container.insertAfter(this.$el),this.$tableContainer=this.$container.find(".fixed-table-container"),this.$tableHeader=this.$container.find(".fixed-table-header"),this.$tableBody=this.$container.find(".fixed-table-body"),this.$tableLoading=this.$container.find(".fixed-table-loading"),this.$tableFooter=this.$container.find(".fixed-table-footer"),this.$toolbar=this.$container.find(".fixed-table-toolbar"),this.$pagination=this.$container.find(".fixed-table-pagination"),this.$tableBody.append(this.$el),this.$container.after('<div class="clearfix"></div>'),this.$el.addClass(this.options.classes),this.options.striped&&this.$el.addClass("table-striped"),-1!==a.inArray("table-no-bordered",this.options.classes.split(" "))&&this.$tableContainer.addClass("table-no-bordered")},p.prototype.initTable=function(){var b=this,c=[],d=[];if(this.$header=this.$el.find(">thead"),this.$header.length||(this.$header=a("<thead></thead>").appendTo(this.$el)),this.$header.find("tr").each(function(){var b=[];a(this).find("th").each(function(){"undefined"!=typeof a(this).data("field")&&a(this).data("field",a(this).data("field")+""),b.push(a.extend({},{title:a(this).html(),"class":a(this).attr("class"),titleTooltip:a(this).attr("title"),rowspan:a(this).attr("rowspan")?+a(this).attr("rowspan"):void 0,colspan:a(this).attr("colspan")?+a(this).attr("colspan"):void 0},a(this).data()))}),c.push(b)}),a.isArray(this.options.columns[0])||(this.options.columns=[this.options.columns]),this.options.columns=a.extend(!0,[],c,this.options.columns),this.columns=[],f(this.options.columns),a.each(this.options.columns,function(c,d){a.each(d,function(d,e){e=a.extend({},p.COLUMN_DEFAULTS,e),"undefined"!=typeof e.fieldIndex&&(b.columns[e.fieldIndex]=e),b.options.columns[c][d]=e})}),!this.options.data.length){var e=[];this.$el.find(">tbody>tr").each(function(c){var f={};f._id=a(this).attr("id"),f._class=a(this).attr("class"),f._data=l(a(this).data()),a(this).find(">td").each(function(d){for(var g,h,i=a(this),j=+i.attr("colspan")||1,k=+i.attr("rowspan")||1;e[c]&&e[c][d];d++);for(g=d;d+j>g;g++)for(h=c;c+k>h;h++)e[h]||(e[h]=[]),e[h][g]=!0;var m=b.columns[d].field;f[m]=a(this).html(),f["_"+m+"_id"]=a(this).attr("id"),f["_"+m+"_class"]=a(this).attr("class"),f["_"+m+"_rowspan"]=a(this).attr("rowspan"),f["_"+m+"_colspan"]=a(this).attr("colspan"),f["_"+m+"_title"]=a(this).attr("title"),f["_"+m+"_data"]=l(a(this).data())}),d.push(f)}),this.options.data=d,d.length&&(this.fromHtml=!0)}},p.prototype.initHeader=function(){var b=this,d={},e=[];this.header={fields:[],styles:[],classes:[],formatters:[],events:[],sorters:[],sortNames:[],cellStyles:[],searchables:[]},a.each(this.options.columns,function(f,g){e.push("<tr>"),0===f&&!b.options.cardView&&b.options.detailView&&e.push(c('<th class="detail" rowspan="%s"><div class="fht-cell"></div></th>',b.options.columns.length)),a.each(g,function(a,f){var g="",h="",i="",j="",k=c(' class="%s"',f["class"]),l=(b.options.sortOrder||f.order,"px"),m=f.width;if(void 0===f.width||b.options.cardView||"string"==typeof f.width&&-1!==f.width.indexOf("%")&&(l="%"),f.width&&"string"==typeof f.width&&(m=f.width.replace("%","").replace("px","")),h=c("text-align: %s; ",f.halign?f.halign:f.align),i=c("text-align: %s; ",f.align),j=c("vertical-align: %s; ",f.valign),j+=c("width: %s; ",!f.checkbox&&!f.radio||m?m?m+l:void 0:"36px"),"undefined"!=typeof f.fieldIndex){if(b.header.fields[f.fieldIndex]=f.field,b.header.styles[f.fieldIndex]=i+j,b.header.classes[f.fieldIndex]=k,b.header.formatters[f.fieldIndex]=f.formatter,b.header.events[f.fieldIndex]=f.events,b.header.sorters[f.fieldIndex]=f.sorter,b.header.sortNames[f.fieldIndex]=f.sortName,b.header.cellStyles[f.fieldIndex]=f.cellStyle,b.header.searchables[f.fieldIndex]=f.searchable,!f.visible)return;if(b.options.cardView&&!f.cardVisible)return;d[f.field]=f}e.push("<th"+c(' title="%s"',f.titleTooltip),f.checkbox||f.radio?c(' class="bs-checkbox %s"',f["class"]||""):k,c(' style="%s"',h+j),c(' rowspan="%s"',f.rowspan),c(' colspan="%s"',f.colspan),c(' data-field="%s"',f.field),"tabindex='0'",">"),e.push(c('<div class="th-inner %s">',b.options.sortable&&f.sortable?"sortable both":"")),g=f.title,f.checkbox&&(!b.options.singleSelect&&b.options.checkboxHeader&&(g='<input name="btSelectAll" type="checkbox" />'),b.header.stateField=f.field),f.radio&&(g="",b.header.stateField=f.field,b.options.singleSelect=!0),e.push(g),e.push("</div>"),e.push('<div class="fht-cell"></div>'),e.push("</div>"),e.push("</th>")}),e.push("</tr>")}),this.$header.html(e.join("")),this.$header.find("th[data-field]").each(function(){a(this).data(d[a(this).data("field")])}),this.$container.off("click",".th-inner").on("click",".th-inner",function(c){var d=a(this);return b.options.detailView&&d.closest(".bootstrap-table")[0]!==b.$container[0]?!1:void(b.options.sortable&&d.parent().data().sortable&&b.onSort(c))}),this.$header.children().children().off("keypress").on("keypress",function(c){if(b.options.sortable&&a(this).data().sortable){var d=c.keyCode||c.which;13==d&&b.onSort(c)}}),a(window).off("resize.bootstrap-table"),!this.options.showHeader||this.options.cardView?(this.$header.hide(),this.$tableHeader.hide(),this.$tableLoading.css("top",0)):(this.$header.show(),this.$tableHeader.show(),this.$tableLoading.css("top",this.$header.outerHeight()+1),this.getCaret(),a(window).on("resize.bootstrap-table",a.proxy(this.resetWidth,this))),this.$selectAll=this.$header.find('[name="btSelectAll"]'),this.$selectAll.off("click").on("click",function(){var c=a(this).prop("checked");b[c?"checkAll":"uncheckAll"](),b.updateSelected()})},p.prototype.initFooter=function(){!this.options.showFooter||this.options.cardView?this.$tableFooter.hide():this.$tableFooter.show()},p.prototype.initData=function(a,b){this.data="append"===b?this.data.concat(a):"prepend"===b?[].concat(a).concat(this.data):a||this.options.data,this.options.data="append"===b?this.options.data.concat(a):"prepend"===b?[].concat(a).concat(this.options.data):this.data,"server"!==this.options.sidePagination&&this.initSort()},p.prototype.initSort=function(){var b=this,c=this.options.sortName,d="desc"===this.options.sortOrder?-1:1,e=a.inArray(this.options.sortName,this.header.fields);return this.options.customSort!==a.noop?void this.options.customSort.apply(this,[this.options.sortName,this.options.sortOrder]):void(-1!==e&&(this.options.sortStable&&a.each(this.data,function(a,b){b.hasOwnProperty("_position")||(b._position=a)}),this.data.sort(function(f,g){b.header.sortNames[e]&&(c=b.header.sortNames[e]);var i=m(f,c,b.options.escape),j=m(g,c,b.options.escape),k=h(b.header,b.header.sorters[e],[i,j]);return void 0!==k?d*k:((void 0===i||null===i)&&(i=""),(void 0===j||null===j)&&(j=""),b.options.sortStable&&i===j&&(i=f._position,j=g._position),a.isNumeric(i)&&a.isNumeric(j)?(i=parseFloat(i),j=parseFloat(j),j>i?-1*d:d):i===j?0:("string"!=typeof i&&(i=i.toString()),-1===i.localeCompare(j)?-1*d:d))})))},p.prototype.onSort=function(b){var c="keypress"===b.type?a(b.currentTarget):a(b.currentTarget).parent(),d=this.$header.find("th").eq(c.index());return this.$header.add(this.$header_).find("span.order").remove(),this.options.sortName===c.data("field")?this.options.sortOrder="asc"===this.options.sortOrder?"desc":"asc":(this.options.sortName=c.data("field"),this.options.sortOrder="asc"===c.data("order")?"desc":"asc"),this.trigger("sort",this.options.sortName,this.options.sortOrder),c.add(d).data("order",this.options.sortOrder),this.getCaret(),"server"===this.options.sidePagination?void this.initServer(this.options.silentSort):(this.initSort(),void this.initBody())},p.prototype.initToolbar=function(){var b,d,e=this,f=[],g=0,i=0;this.$toolbar.find(".bs-bars").children().length&&a("body").append(a(this.options.toolbar)),this.$toolbar.html(""),("string"==typeof this.options.toolbar||"object"==typeof this.options.toolbar)&&a(c('<div class="bs-bars pull-%s"></div>',this.options.toolbarAlign)).appendTo(this.$toolbar).append(a(this.options.toolbar)),f=[c('<div class="columns columns-%s btn-group pull-%s">',this.options.buttonsAlign,this.options.buttonsAlign)],"string"==typeof this.options.icons&&(this.options.icons=h(null,this.options.icons)),this.options.showPaginationSwitch&&f.push(c('<button class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+'" type="button" name="paginationSwitch" title="%s">',this.options.formatPaginationSwitch()),c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.paginationSwitchDown),"</button>"),this.options.showRefresh&&f.push(c('<button class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+'" type="button" name="refresh" title="%s">',this.options.formatRefresh()),c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.refresh),"</button>"),this.options.showToggle&&f.push(c('<button class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+'" type="button" name="toggle" title="%s">',this.options.formatToggle()),c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.toggle),"</button>"),this.options.showColumns&&(f.push(c('<div class="keep-open btn-group" title="%s">',this.options.formatColumns()),'<button type="button" class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+' dropdown-toggle" data-toggle="dropdown">',c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.columns),' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">'),a.each(this.columns,function(a,b){if(!(b.radio||b.checkbox||e.options.cardView&&!b.cardVisible)){var d=b.visible?' checked="checked"':"";b.switchable&&(f.push(c('<li><label><input type="checkbox" data-field="%s" value="%s"%s> %s</label></li>',b.field,a,d,b.title)),i++)}}),f.push("</ul>","</div>")),f.push("</div>"),(this.showToolbar||f.length>2)&&this.$toolbar.append(f.join("")),this.options.showPaginationSwitch&&this.$toolbar.find('button[name="paginationSwitch"]').off("click").on("click",a.proxy(this.togglePagination,this)),this.options.showRefresh&&this.$toolbar.find('button[name="refresh"]').off("click").on("click",a.proxy(this.refresh,this)),this.options.showToggle&&this.$toolbar.find('button[name="toggle"]').off("click").on("click",function(){e.toggleView()}),this.options.showColumns&&(b=this.$toolbar.find(".keep-open"),i<=this.options.minimumCountColumns&&b.find("input").prop("disabled",!0),b.find("li").off("click").on("click",function(a){a.stopImmediatePropagation()}),b.find("input").off("click").on("click",function(){var b=a(this);e.toggleColumn(a(this).val(),b.prop("checked"),!1),e.trigger("column-switch",a(this).data("field"),b.prop("checked"))})),this.options.search&&(f=[],f.push('<div class="pull-'+this.options.searchAlign+' search">',c('<input class="form-control'+c(" input-%s",this.options.iconSize)+'" type="text" placeholder="%s">',this.options.formatSearch()),"</div>"),this.$toolbar.append(f.join("")),d=this.$toolbar.find(".search input"),d.off("keyup drop").on("keyup drop",function(b){e.options.searchOnEnterKey&&13!==b.keyCode||a.inArray(b.keyCode,[37,38,39,40])>-1||(clearTimeout(g),g=setTimeout(function(){e.onSearch(b)},e.options.searchTimeOut))}),n()&&d.off("mouseup").on("mouseup",function(a){clearTimeout(g),g=setTimeout(function(){e.onSearch(a)},e.options.searchTimeOut)}))},p.prototype.onSearch=function(b){var c=a.trim(a(b.currentTarget).val());this.options.trimOnSearch&&a(b.currentTarget).val()!==c&&a(b.currentTarget).val(c),c!==this.searchText&&(this.searchText=c,this.options.searchText=c,this.options.pageNumber=1,this.initSearch(),this.updatePagination(),this.trigger("search",c))},p.prototype.initSearch=function(){var b=this;if("server"!==this.options.sidePagination){if(this.options.customSearch!==a.noop)return void this.options.customSearch.apply(this,[this.searchText]);var c=this.searchText&&(this.options.escape?j(this.searchText):this.searchText).toLowerCase(),d=a.isEmptyObject(this.filterColumns)?null:this.filterColumns;this.data=d?a.grep(this.options.data,function(b){for(var c in d)if(a.isArray(d[c])&&-1===a.inArray(b[c],d[c])||b[c]!==d[c])return!1;return!0}):this.options.data,this.data=c?a.grep(this.data,function(d,f){for(var g=0;g<b.header.fields.length;g++)if(b.header.searchables[g]){var i,j=a.isNumeric(b.header.fields[g])?parseInt(b.header.fields[g],10):b.header.fields[g],k=b.columns[e(b.columns,j)];if("string"==typeof j){i=d;for(var l=j.split("."),m=0;m<l.length;m++)i=i[l[m]];k&&k.searchFormatter&&(i=h(k,b.header.formatters[g],[i,d,f],i))}else i=d[j];if("string"==typeof i||"number"==typeof i)if(b.options.strictSearch){if((i+"").toLowerCase()===c)return!0}else if(-1!==(i+"").toLowerCase().indexOf(c))return!0}return!1}):this.data}},p.prototype.initPagination=function(){if(!this.options.pagination)return void this.$pagination.hide();this.$pagination.show();var b,d,e,f,g,h,i,j,k,l=this,m=[],n=!1,o=this.getData(),p=this.options.pageList;if("server"!==this.options.sidePagination&&(this.options.totalRows=o.length),this.totalPages=0,this.options.totalRows){if(this.options.pageSize===this.options.formatAllRows())this.options.pageSize=this.options.totalRows,n=!0;else if(this.options.pageSize===this.options.totalRows){var q="string"==typeof this.options.pageList?this.options.pageList.replace("[","").replace("]","").replace(/ /g,"").toLowerCase().split(","):this.options.pageList;a.inArray(this.options.formatAllRows().toLowerCase(),q)>-1&&(n=!0)}this.totalPages=~~((this.options.totalRows-1)/this.options.pageSize)+1,this.options.totalPages=this.totalPages}if(this.totalPages>0&&this.options.pageNumber>this.totalPages&&(this.options.pageNumber=this.totalPages),this.pageFrom=(this.options.pageNumber-1)*this.options.pageSize+1,this.pageTo=this.options.pageNumber*this.options.pageSize,this.pageTo>this.options.totalRows&&(this.pageTo=this.options.totalRows),m.push('<div class="pull-'+this.options.paginationDetailHAlign+' pagination-detail">','<span class="pagination-info">',this.options.onlyInfoPagination?this.options.formatDetailPagination(this.options.totalRows):this.options.formatShowingRows(this.pageFrom,this.pageTo,this.options.totalRows),"</span>"),!this.options.onlyInfoPagination){m.push('<span class="page-list">');var r=[c('<span class="btn-group %s">',"top"===this.options.paginationVAlign||"both"===this.options.paginationVAlign?"dropdown":"dropup"),'<button type="button" class="btn'+c(" btn-%s",this.options.buttonsClass)+c(" btn-%s",this.options.iconSize)+' dropdown-toggle" data-toggle="dropdown">','<span class="page-size">',n?this.options.formatAllRows():this.options.pageSize,"</span>",' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">'];if("string"==typeof this.options.pageList){var s=this.options.pageList.replace("[","").replace("]","").replace(/ /g,"").split(",");p=[],a.each(s,function(a,b){p.push(b.toUpperCase()===l.options.formatAllRows().toUpperCase()?l.options.formatAllRows():+b)})}for(a.each(p,function(a,b){if(!l.options.smartDisplay||0===a||p[a-1]<=l.options.totalRows){var d;d=n?b===l.options.formatAllRows()?' class="active"':"":b===l.options.pageSize?' class="active"':"",r.push(c('<li%s><a href="javascript:void(0)">%s</a></li>',d,b))}}),r.push("</ul></span>"),m.push(this.options.formatRecordsPerPage(r.join(""))),m.push("</span>"),m.push("</div>",'<div class="pull-'+this.options.paginationHAlign+' pagination">','<ul class="pagination'+c(" pagination-%s",this.options.iconSize)+'">','<li class="page-pre"><a href="javascript:void(0)">'+this.options.paginationPreText+"</a></li>"),this.totalPages<5?(d=1,e=this.totalPages):(d=this.options.pageNumber-2,e=d+4,1>d&&(d=1,e=5),e>this.totalPages&&(e=this.totalPages,d=e-4)),this.totalPages>=6&&(this.options.pageNumber>=3&&(m.push('<li class="page-first'+(1===this.options.pageNumber?" active":"")+'">','<a href="javascript:void(0)">',1,"</a>","</li>"),d++),this.options.pageNumber>=4&&(4==this.options.pageNumber||6==this.totalPages||7==this.totalPages?d--:m.push('<li class="page-first-separator disabled">','<a href="javascript:void(0)">...</a>',"</li>"),e--)),this.totalPages>=7&&this.options.pageNumber>=this.totalPages-2&&d--,6==this.totalPages?this.options.pageNumber>=this.totalPages-2&&e++:this.totalPages>=7&&(7==this.totalPages||this.options.pageNumber>=this.totalPages-3)&&e++,b=d;e>=b;b++)m.push('<li class="page-number'+(b===this.options.pageNumber?" active":"")+'">','<a href="javascript:void(0)">',b,"</a>","</li>");this.totalPages>=8&&this.options.pageNumber<=this.totalPages-4&&m.push('<li class="page-last-separator disabled">','<a href="javascript:void(0)">...</a>',"</li>"),this.totalPages>=6&&this.options.pageNumber<=this.totalPages-3&&m.push('<li class="page-last'+(this.totalPages===this.options.pageNumber?" active":"")+'">','<a href="javascript:void(0)">',this.totalPages,"</a>","</li>"),m.push('<li class="page-next"><a href="javascript:void(0)">'+this.options.paginationNextText+"</a></li>","</ul>","</div>")}this.$pagination.html(m.join("")),this.options.onlyInfoPagination||(f=this.$pagination.find(".page-list a"),g=this.$pagination.find(".page-first"),h=this.$pagination.find(".page-pre"),i=this.$pagination.find(".page-next"),j=this.$pagination.find(".page-last"),k=this.$pagination.find(".page-number"),this.options.smartDisplay&&(this.totalPages<=1&&this.$pagination.find("div.pagination").hide(),(p.length<2||this.options.totalRows<=p[0])&&this.$pagination.find("span.page-list").hide(),this.$pagination[this.getData().length?"show":"hide"]()),n&&(this.options.pageSize=this.options.formatAllRows()),f.off("click").on("click",a.proxy(this.onPageListChange,this)),g.off("click").on("click",a.proxy(this.onPageFirst,this)),h.off("click").on("click",a.proxy(this.onPagePre,this)),i.off("click").on("click",a.proxy(this.onPageNext,this)),j.off("click").on("click",a.proxy(this.onPageLast,this)),k.off("click").on("click",a.proxy(this.onPageNumber,this)))},p.prototype.updatePagination=function(b){b&&a(b.currentTarget).hasClass("disabled")||(this.options.maintainSelected||this.resetRows(),this.initPagination(),"server"===this.options.sidePagination?this.initServer():this.initBody(),this.trigger("page-change",this.options.pageNumber,this.options.pageSize))},p.prototype.onPageListChange=function(b){var c=a(b.currentTarget);c.parent().addClass("active").siblings().removeClass("active"),this.options.pageSize=c.text().toUpperCase()===this.options.formatAllRows().toUpperCase()?this.options.formatAllRows():+c.text(),this.$toolbar.find(".page-size").text(this.options.pageSize),this.updatePagination(b)},p.prototype.onPageFirst=function(a){this.options.pageNumber=1,this.updatePagination(a)},p.prototype.onPagePre=function(a){this.options.pageNumber-1===0?this.options.pageNumber=this.options.totalPages:this.options.pageNumber--,this.updatePagination(a)},p.prototype.onPageNext=function(a){this.options.pageNumber+1>this.options.totalPages?this.options.pageNumber=1:this.options.pageNumber++,this.updatePagination(a)},p.prototype.onPageLast=function(a){this.options.pageNumber=this.totalPages,this.updatePagination(a)},p.prototype.onPageNumber=function(b){this.options.pageNumber!==+a(b.currentTarget).text()&&(this.options.pageNumber=+a(b.currentTarget).text(),this.updatePagination(b))},p.prototype.initBody=function(b){var f=this,g=[],i=this.getData();this.trigger("pre-body",i),this.$body=this.$el.find(">tbody"),this.$body.length||(this.$body=a("<tbody></tbody>").appendTo(this.$el)),this.options.pagination&&"server"!==this.options.sidePagination||(this.pageFrom=1,this.pageTo=i.length);for(var k=this.pageFrom-1;k<this.pageTo;k++){var l,n=i[k],o={},p=[],q="",r={},s=[];if(o=h(this.options,this.options.rowStyle,[n,k],o),o&&o.css)for(l in o.css)p.push(l+": "+o.css[l]);if(r=h(this.options,this.options.rowAttributes,[n,k],r))for(l in r)s.push(c('%s="%s"',l,j(r[l])));n._data&&!a.isEmptyObject(n._data)&&a.each(n._data,function(a,b){"index"!==a&&(q+=c(' data-%s="%s"',a,b))}),g.push("<tr",c(" %s",s.join(" ")),c(' id="%s"',a.isArray(n)?void 0:n._id),c(' class="%s"',o.classes||(a.isArray(n)?void 0:n._class)),c(' data-index="%s"',k),c(' data-uniqueid="%s"',n[this.options.uniqueId]),c("%s",q),">"),this.options.cardView&&g.push(c('<td colspan="%s"><div class="card-views">',this.header.fields.length)),!this.options.cardView&&this.options.detailView&&g.push("<td>",'<a class="detail-icon" href="javascript:">',c('<i class="%s %s"></i>',this.options.iconsPrefix,this.options.icons.detailOpen),"</a>","</td>"),a.each(this.header.fields,function(b,e){var i="",j=m(n,e,f.options.escape),l="",q={},r="",s=f.header.classes[b],t="",u="",v="",w="",x=f.columns[b];if(!(f.fromHtml&&"undefined"==typeof j||!x.visible||f.options.cardView&&!x.cardVisible)){if(o=c('style="%s"',p.concat(f.header.styles[b]).join("; ")),n["_"+e+"_id"]&&(r=c(' id="%s"',n["_"+e+"_id"])),n["_"+e+"_class"]&&(s=c(' class="%s"',n["_"+e+"_class"])),n["_"+e+"_rowspan"]&&(u=c(' rowspan="%s"',n["_"+e+"_rowspan"])),n["_"+e+"_colspan"]&&(v=c(' colspan="%s"',n["_"+e+"_colspan"])),n["_"+e+"_title"]&&(w=c(' title="%s"',n["_"+e+"_title"])),q=h(f.header,f.header.cellStyles[b],[j,n,k,e],q),q.classes&&(s=c(' class="%s"',q.classes)),q.css){var y=[];for(var z in q.css)y.push(z+": "+q.css[z]);o=c('style="%s"',y.concat(f.header.styles[b]).join("; "))}j=h(x,f.header.formatters[b],[j,n,k],j),n["_"+e+"_data"]&&!a.isEmptyObject(n["_"+e+"_data"])&&a.each(n["_"+e+"_data"],function(a,b){"index"!==a&&(t+=c(' data-%s="%s"',a,b))}),x.checkbox||x.radio?(l=x.checkbox?"checkbox":l,l=x.radio?"radio":l,i=[c(f.options.cardView?'<div class="card-view %s">':'<td class="bs-checkbox %s">',x["class"]||""),"<input"+c(' data-index="%s"',k)+c(' name="%s"',f.options.selectItemName)+c(' type="%s"',l)+c(' value="%s"',n[f.options.idField])+c(' checked="%s"',j===!0||j&&j.checked?"checked":void 0)+c(' disabled="%s"',!x.checkboxEnabled||j&&j.disabled?"disabled":void 0)+" />",f.header.formatters[b]&&"string"==typeof j?j:"",f.options.cardView?"</div>":"</td>"].join(""),n[f.header.stateField]=j===!0||j&&j.checked):(j="undefined"==typeof j||null===j?f.options.undefinedText:j,i=f.options.cardView?['<div class="card-view">',f.options.showHeader?c('<span class="title" %s>%s</span>',o,d(f.columns,"field","title",e)):"",c('<span class="value">%s</span>',j),"</div>"].join(""):[c("<td%s %s %s %s %s %s %s>",r,s,o,t,u,v,w),j,"</td>"].join(""),f.options.cardView&&f.options.smartDisplay&&""===j&&(i='<div class="card-view"></div>')),g.push(i)}}),this.options.cardView&&g.push("</div></td>"),g.push("</tr>")}g.length||g.push('<tr class="no-records-found">',c('<td colspan="%s">%s</td>',this.$header.find("th").length,this.options.formatNoMatches()),"</tr>"),this.$body.html(g.join("")),b||this.scrollTo(0),this.$body.find("> tr[data-index] > td").off("click dblclick").on("click dblclick",function(b){var d=a(this),g=d.parent(),h=f.data[g.data("index")],i=d[0].cellIndex,j=f.getVisibleFields(),k=j[f.options.detailView&&!f.options.cardView?i-1:i],l=f.columns[e(f.columns,k)],n=m(h,k,f.options.escape);if(!d.find(".detail-icon").length&&(f.trigger("click"===b.type?"click-cell":"dbl-click-cell",k,n,h,d),f.trigger("click"===b.type?"click-row":"dbl-click-row",h,g,k),
  5679. "click"===b.type&&f.options.clickToSelect&&l.clickToSelect)){var o=g.find(c('[name="%s"]',f.options.selectItemName));o.length&&o[0].click()}}),this.$body.find("> tr[data-index] > td > .detail-icon").off("click").on("click",function(){var b=a(this),d=b.parent().parent(),e=d.data("index"),g=i[e];if(d.next().is("tr.detail-view"))b.find("i").attr("class",c("%s %s",f.options.iconsPrefix,f.options.icons.detailOpen)),d.next().remove(),f.trigger("collapse-row",e,g);else{b.find("i").attr("class",c("%s %s",f.options.iconsPrefix,f.options.icons.detailClose)),d.after(c('<tr class="detail-view"><td colspan="%s"></td></tr>',d.find("td").length));var j=d.next().find("td"),k=h(f.options,f.options.detailFormatter,[e,g,j],"");1===j.length&&j.append(k),f.trigger("expand-row",e,g,j)}f.resetView()}),this.$selectItem=this.$body.find(c('[name="%s"]',this.options.selectItemName)),this.$selectItem.off("click").on("click",function(b){b.stopImmediatePropagation();var c=a(this),d=c.prop("checked"),e=f.data[c.data("index")];f.options.maintainSelected&&a(this).is(":radio")&&a.each(f.options.data,function(a,b){b[f.header.stateField]=!1}),e[f.header.stateField]=d,f.options.singleSelect&&(f.$selectItem.not(this).each(function(){f.data[a(this).data("index")][f.header.stateField]=!1}),f.$selectItem.filter(":checked").not(this).prop("checked",!1)),f.updateSelected(),f.trigger(d?"check":"uncheck",e,c)}),a.each(this.header.events,function(b,c){if(c){"string"==typeof c&&(c=h(null,c));var d=f.header.fields[b],e=a.inArray(d,f.getVisibleFields());f.options.detailView&&!f.options.cardView&&(e+=1);for(var g in c)f.$body.find(">tr:not(.no-records-found)").each(function(){var b=a(this),h=b.find(f.options.cardView?".card-view":"td").eq(e),i=g.indexOf(" "),j=g.substring(0,i),k=g.substring(i+1),l=c[g];h.find(k).off(j).on(j,function(a){var c=b.data("index"),e=f.data[c],g=e[d];l.apply(this,[a,g,e,c])})})}}),this.updateSelected(),this.resetView(),this.trigger("post-body",i)},p.prototype.initServer=function(b,c,d){var e,f=this,g={},i={searchText:this.searchText,sortName:this.options.sortName,sortOrder:this.options.sortOrder};this.options.pagination&&(i.pageSize=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize,i.pageNumber=this.options.pageNumber),(d||this.options.url||this.options.ajax)&&("limit"===this.options.queryParamsType&&(i={search:i.searchText,sort:i.sortName,order:i.sortOrder},this.options.pagination&&(i.offset=this.options.pageSize===this.options.formatAllRows()?0:this.options.pageSize*(this.options.pageNumber-1),i.limit=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize)),a.isEmptyObject(this.filterColumnsPartial)||(i.filter=JSON.stringify(this.filterColumnsPartial,null)),g=h(this.options,this.options.queryParams,[i],g),a.extend(g,c||{}),g!==!1&&(b||this.$tableLoading.show(),e=a.extend({},h(null,this.options.ajaxOptions),{type:this.options.method,url:d||this.options.url,data:"application/json"===this.options.contentType&&"post"===this.options.method?JSON.stringify(g):g,cache:this.options.cache,contentType:this.options.contentType,dataType:this.options.dataType,success:function(a){a=h(f.options,f.options.responseHandler,[a],a),f.load(a),f.trigger("load-success",a),b||f.$tableLoading.hide()},error:function(a){f.trigger("load-error",a.status,a),b||f.$tableLoading.hide()}}),this.options.ajax?h(this,this.options.ajax,[e],null):(this._xhr&&4!==this._xhr.readyState&&this._xhr.abort(),this._xhr=a.ajax(e))))},p.prototype.initSearchText=function(){if(this.options.search&&""!==this.options.searchText){var a=this.$toolbar.find(".search input");a.val(this.options.searchText),this.onSearch({currentTarget:a})}},p.prototype.getCaret=function(){var b=this;a.each(this.$header.find("th"),function(c,d){a(d).find(".sortable").removeClass("desc asc").addClass(a(d).data("field")===b.options.sortName?b.options.sortOrder:"both")})},p.prototype.updateSelected=function(){var b=this.$selectItem.filter(":enabled").length&&this.$selectItem.filter(":enabled").length===this.$selectItem.filter(":enabled").filter(":checked").length;this.$selectAll.add(this.$selectAll_).prop("checked",b),this.$selectItem.each(function(){a(this).closest("tr")[a(this).prop("checked")?"addClass":"removeClass"]("selected")})},p.prototype.updateRows=function(){var b=this;this.$selectItem.each(function(){b.data[a(this).data("index")][b.header.stateField]=a(this).prop("checked")})},p.prototype.resetRows=function(){var b=this;a.each(this.data,function(a,c){b.$selectAll.prop("checked",!1),b.$selectItem.prop("checked",!1),b.header.stateField&&(c[b.header.stateField]=!1)})},p.prototype.trigger=function(b){var c=Array.prototype.slice.call(arguments,1);b+=".bs.table",this.options[p.EVENTS[b]].apply(this.options,c),this.$el.trigger(a.Event(b),c),this.options.onAll(b,c),this.$el.trigger(a.Event("all.bs.table"),[b,c])},p.prototype.resetHeader=function(){clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(a.proxy(this.fitHeader,this),this.$el.is(":hidden")?100:0)},p.prototype.fitHeader=function(){var b,d,e,f,h=this;if(h.$el.is(":hidden"))return void(h.timeoutId_=setTimeout(a.proxy(h.fitHeader,h),100));if(b=this.$tableBody.get(0),d=b.scrollWidth>b.clientWidth&&b.scrollHeight>b.clientHeight+this.$header.outerHeight()?g():0,this.$el.css("margin-top",-this.$header.outerHeight()),e=a(":focus"),e.length>0){var i=e.parents("th");if(i.length>0){var j=i.attr("data-field");if(void 0!==j){var k=this.$header.find("[data-field='"+j+"']");k.length>0&&k.find(":input").addClass("focus-temp")}}}this.$header_=this.$header.clone(!0,!0),this.$selectAll_=this.$header_.find('[name="btSelectAll"]'),this.$tableHeader.css({"margin-right":d}).find("table").css("width",this.$el.outerWidth()).html("").attr("class",this.$el.attr("class")).append(this.$header_),f=a(".focus-temp:visible:eq(0)"),f.length>0&&(f.focus(),this.$header.find(".focus-temp").removeClass("focus-temp")),this.$header.find("th[data-field]").each(function(){h.$header_.find(c('th[data-field="%s"]',a(this).data("field"))).data(a(this).data())});var l=this.getVisibleFields(),m=this.$header_.find("th");this.$body.find(">tr:first-child:not(.no-records-found) > *").each(function(b){var d=a(this),e=b;h.options.detailView&&!h.options.cardView&&(0===b&&h.$header_.find("th.detail").find(".fht-cell").width(d.innerWidth()),e=b-1);var f=h.$header_.find(c('th[data-field="%s"]',l[e]));f.length>1&&(f=a(m[d[0].cellIndex])),f.find(".fht-cell").width(d.innerWidth())}),this.$tableBody.off("scroll").on("scroll",function(){h.$tableHeader.scrollLeft(a(this).scrollLeft()),h.options.showFooter&&!h.options.cardView&&h.$tableFooter.scrollLeft(a(this).scrollLeft())}),h.trigger("post-header")},p.prototype.resetFooter=function(){var b=this,d=b.getData(),e=[];this.options.showFooter&&!this.options.cardView&&(!this.options.cardView&&this.options.detailView&&e.push('<td><div class="th-inner">&nbsp;</div><div class="fht-cell"></div></td>'),a.each(this.columns,function(a,f){var g,i="",j="",k=[],l={},m=c(' class="%s"',f["class"]);if(f.visible&&(!b.options.cardView||f.cardVisible)){if(i=c("text-align: %s; ",f.falign?f.falign:f.align),j=c("vertical-align: %s; ",f.valign),l=h(null,b.options.footerStyle),l&&l.css)for(g in l.css)k.push(g+": "+l.css[g]);e.push("<td",m,c(' style="%s"',i+j+k.concat().join("; ")),">"),e.push('<div class="th-inner">'),e.push(h(f,f.footerFormatter,[d],"&nbsp;")||"&nbsp;"),e.push("</div>"),e.push('<div class="fht-cell"></div>'),e.push("</div>"),e.push("</td>")}}),this.$tableFooter.find("tr").html(e.join("")),this.$tableFooter.show(),clearTimeout(this.timeoutFooter_),this.timeoutFooter_=setTimeout(a.proxy(this.fitFooter,this),this.$el.is(":hidden")?100:0))},p.prototype.fitFooter=function(){var b,c,d;return clearTimeout(this.timeoutFooter_),this.$el.is(":hidden")?void(this.timeoutFooter_=setTimeout(a.proxy(this.fitFooter,this),100)):(c=this.$el.css("width"),d=c>this.$tableBody.width()?g():0,this.$tableFooter.css({"margin-right":d}).find("table").css("width",c).attr("class",this.$el.attr("class")),b=this.$tableFooter.find("td"),void this.$body.find(">tr:first-child:not(.no-records-found) > *").each(function(c){var d=a(this);b.eq(c).find(".fht-cell").width(d.innerWidth())}))},p.prototype.toggleColumn=function(a,b,d){if(-1!==a&&(this.columns[a].visible=b,this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns)){var e=this.$toolbar.find(".keep-open input").prop("disabled",!1);d&&e.filter(c('[value="%s"]',a)).prop("checked",b),e.filter(":checked").length<=this.options.minimumCountColumns&&e.filter(":checked").prop("disabled",!0)}},p.prototype.toggleRow=function(a,b,d){-1!==a&&this.$body.find("undefined"!=typeof a?c('tr[data-index="%s"]',a):c('tr[data-uniqueid="%s"]',b))[d?"show":"hide"]()},p.prototype.getVisibleFields=function(){var b=this,c=[];return a.each(this.header.fields,function(a,d){var f=b.columns[e(b.columns,d)];f.visible&&c.push(d)}),c},p.prototype.resetView=function(a){var b=0;if(a&&a.height&&(this.options.height=a.height),this.$selectAll.prop("checked",this.$selectItem.length>0&&this.$selectItem.length===this.$selectItem.filter(":checked").length),this.options.height){var c=k(this.$toolbar),d=k(this.$pagination),e=this.options.height-c-d;this.$tableContainer.css("height",e+"px")}return this.options.cardView?(this.$el.css("margin-top","0"),this.$tableContainer.css("padding-bottom","0"),void this.$tableFooter.hide()):(this.options.showHeader&&this.options.height?(this.$tableHeader.show(),this.resetHeader(),b+=this.$header.outerHeight()):(this.$tableHeader.hide(),this.trigger("post-header")),this.options.showFooter&&(this.resetFooter(),this.options.height&&(b+=this.$tableFooter.outerHeight()+1)),this.getCaret(),this.$tableContainer.css("padding-bottom",b+"px"),void this.trigger("reset-view"))},p.prototype.getData=function(b){return!this.searchText&&a.isEmptyObject(this.filterColumns)&&a.isEmptyObject(this.filterColumnsPartial)?b?this.options.data.slice(this.pageFrom-1,this.pageTo):this.options.data:b?this.data.slice(this.pageFrom-1,this.pageTo):this.data},p.prototype.load=function(b){var c=!1;"server"===this.options.sidePagination?(this.options.totalRows=b.total,c=b.fixedScroll,b=b[this.options.dataField]):a.isArray(b)||(c=b.fixedScroll,b=b.data),this.initData(b),this.initSearch(),this.initPagination(),this.initBody(c)},p.prototype.append=function(a){this.initData(a,"append"),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0)},p.prototype.prepend=function(a){this.initData(a,"prepend"),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0)},p.prototype.remove=function(b){var c,d,e=this.options.data.length;if(b.hasOwnProperty("field")&&b.hasOwnProperty("values")){for(c=e-1;c>=0;c--)d=this.options.data[c],d.hasOwnProperty(b.field)&&-1!==a.inArray(d[b.field],b.values)&&this.options.data.splice(c,1);e!==this.options.data.length&&(this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))}},p.prototype.removeAll=function(){this.options.data.length>0&&(this.options.data.splice(0,this.options.data.length),this.initSearch(),this.initPagination(),this.initBody(!0))},p.prototype.getRowByUniqueId=function(a){var b,c,d,e=this.options.uniqueId,f=this.options.data.length,g=null;for(b=f-1;b>=0;b--){if(c=this.options.data[b],c.hasOwnProperty(e))d=c[e];else{if(!c._data.hasOwnProperty(e))continue;d=c._data[e]}if("string"==typeof d?a=a.toString():"number"==typeof d&&(Number(d)===d&&d%1===0?a=parseInt(a):d===Number(d)&&0!==d&&(a=parseFloat(a))),d===a){g=c;break}}return g},p.prototype.removeByUniqueId=function(a){var b=this.options.data.length,c=this.getRowByUniqueId(a);c&&this.options.data.splice(this.options.data.indexOf(c),1),b!==this.options.data.length&&(this.initSearch(),this.initPagination(),this.initBody(!0))},p.prototype.updateByUniqueId=function(b){var c=this,d=a.isArray(b)?b:[b];a.each(d,function(b,d){var e;d.hasOwnProperty("id")&&d.hasOwnProperty("row")&&(e=a.inArray(c.getRowByUniqueId(d.id),c.options.data),-1!==e&&a.extend(c.options.data[e],d.row))}),this.initSearch(),this.initSort(),this.initBody(!0)},p.prototype.insertRow=function(a){a.hasOwnProperty("index")&&a.hasOwnProperty("row")&&(this.data.splice(a.index,0,a.row),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))},p.prototype.updateRow=function(b){var c=this,d=a.isArray(b)?b:[b];a.each(d,function(b,d){d.hasOwnProperty("index")&&d.hasOwnProperty("row")&&a.extend(c.options.data[d.index],d.row)}),this.initSearch(),this.initSort(),this.initBody(!0)},p.prototype.showRow=function(a){(a.hasOwnProperty("index")||a.hasOwnProperty("uniqueId"))&&this.toggleRow(a.index,a.uniqueId,!0)},p.prototype.hideRow=function(a){(a.hasOwnProperty("index")||a.hasOwnProperty("uniqueId"))&&this.toggleRow(a.index,a.uniqueId,!1)},p.prototype.getRowsHidden=function(b){var c=a(this.$body[0]).children().filter(":hidden"),d=0;if(b)for(;d<c.length;d++)a(c[d]).show();return c},p.prototype.mergeCells=function(b){var c,d,e,f=b.index,g=a.inArray(b.field,this.getVisibleFields()),h=b.rowspan||1,i=b.colspan||1,j=this.$body.find(">tr");if(this.options.detailView&&!this.options.cardView&&(g+=1),e=j.eq(f).find(">td").eq(g),!(0>f||0>g||f>=this.data.length)){for(c=f;f+h>c;c++)for(d=g;g+i>d;d++)j.eq(c).find(">td").eq(d).hide();e.attr("rowspan",h).attr("colspan",i).show()}},p.prototype.updateCell=function(a){a.hasOwnProperty("index")&&a.hasOwnProperty("field")&&a.hasOwnProperty("value")&&(this.data[a.index][a.field]=a.value,a.reinit!==!1&&(this.initSort(),this.initBody(!0)))},p.prototype.getOptions=function(){return this.options},p.prototype.getSelections=function(){var b=this;return a.grep(this.options.data,function(a){return a[b.header.stateField]})},p.prototype.getAllSelections=function(){var b=this;return a.grep(this.options.data,function(a){return a[b.header.stateField]})},p.prototype.checkAll=function(){this.checkAll_(!0)},p.prototype.uncheckAll=function(){this.checkAll_(!1)},p.prototype.checkInvert=function(){var b=this,c=b.$selectItem.filter(":enabled"),d=c.filter(":checked");c.each(function(){a(this).prop("checked",!a(this).prop("checked"))}),b.updateRows(),b.updateSelected(),b.trigger("uncheck-some",d),d=b.getSelections(),b.trigger("check-some",d)},p.prototype.checkAll_=function(a){var b;a||(b=this.getSelections()),this.$selectAll.add(this.$selectAll_).prop("checked",a),this.$selectItem.filter(":enabled").prop("checked",a),this.updateRows(),a&&(b=this.getSelections()),this.trigger(a?"check-all":"uncheck-all",b)},p.prototype.check=function(a){this.check_(!0,a)},p.prototype.uncheck=function(a){this.check_(!1,a)},p.prototype.check_=function(a,b){var d=this.$selectItem.filter(c('[data-index="%s"]',b)).prop("checked",a);this.data[b][this.header.stateField]=a,this.updateSelected(),this.trigger(a?"check":"uncheck",this.data[b],d)},p.prototype.checkBy=function(a){this.checkBy_(!0,a)},p.prototype.uncheckBy=function(a){this.checkBy_(!1,a)},p.prototype.checkBy_=function(b,d){if(d.hasOwnProperty("field")&&d.hasOwnProperty("values")){var e=this,f=[];a.each(this.options.data,function(g,h){if(!h.hasOwnProperty(d.field))return!1;if(-1!==a.inArray(h[d.field],d.values)){var i=e.$selectItem.filter(":enabled").filter(c('[data-index="%s"]',g)).prop("checked",b);h[e.header.stateField]=b,f.push(h),e.trigger(b?"check":"uncheck",h,i)}}),this.updateSelected(),this.trigger(b?"check-some":"uncheck-some",f)}},p.prototype.destroy=function(){this.$el.insertBefore(this.$container),a(this.options.toolbar).insertBefore(this.$el),this.$container.next().remove(),this.$container.remove(),this.$el.html(this.$el_.html()).css("margin-top","0").attr("class",this.$el_.attr("class")||"")},p.prototype.showLoading=function(){this.$tableLoading.show()},p.prototype.hideLoading=function(){this.$tableLoading.hide()},p.prototype.togglePagination=function(){this.options.pagination=!this.options.pagination;var a=this.$toolbar.find('button[name="paginationSwitch"] i');this.options.pagination?a.attr("class",this.options.iconsPrefix+" "+this.options.icons.paginationSwitchDown):a.attr("class",this.options.iconsPrefix+" "+this.options.icons.paginationSwitchUp),this.updatePagination()},p.prototype.refresh=function(a){a&&a.url&&(this.options.pageNumber=1),this.initServer(a&&a.silent,a&&a.query,a&&a.url),this.trigger("refresh",a)},p.prototype.resetWidth=function(){this.options.showHeader&&this.options.height&&this.fitHeader(),this.options.showFooter&&this.fitFooter()},p.prototype.showColumn=function(a){this.toggleColumn(e(this.columns,a),!0,!0)},p.prototype.hideColumn=function(a){this.toggleColumn(e(this.columns,a),!1,!0)},p.prototype.getHiddenColumns=function(){return a.grep(this.columns,function(a){return!a.visible})},p.prototype.getVisibleColumns=function(){return a.grep(this.columns,function(a){return a.visible})},p.prototype.toggleAllColumns=function(b){if(a.each(this.columns,function(a){this.columns[a].visible=b}),this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns){var c=this.$toolbar.find(".keep-open input").prop("disabled",!1);c.filter(":checked").length<=this.options.minimumCountColumns&&c.filter(":checked").prop("disabled",!0)}},p.prototype.showAllColumns=function(){this.toggleAllColumns(!0)},p.prototype.hideAllColumns=function(){this.toggleAllColumns(!1)},p.prototype.filterBy=function(b){this.filterColumns=a.isEmptyObject(b)?{}:b,this.options.pageNumber=1,this.initSearch(),this.updatePagination()},p.prototype.scrollTo=function(a){return"string"==typeof a&&(a="bottom"===a?this.$tableBody[0].scrollHeight:0),"number"==typeof a&&this.$tableBody.scrollTop(a),"undefined"==typeof a?this.$tableBody.scrollTop():void 0},p.prototype.getScrollPosition=function(){return this.scrollTo()},p.prototype.selectPage=function(a){a>0&&a<=this.options.totalPages&&(this.options.pageNumber=a,this.updatePagination())},p.prototype.prevPage=function(){this.options.pageNumber>1&&(this.options.pageNumber--,this.updatePagination())},p.prototype.nextPage=function(){this.options.pageNumber<this.options.totalPages&&(this.options.pageNumber++,this.updatePagination())},p.prototype.toggleView=function(){this.options.cardView=!this.options.cardView,this.initHeader(),this.initBody(),this.trigger("toggle",this.options.cardView)},p.prototype.refreshOptions=function(b){i(this.options,b,!0)||(this.options=a.extend(this.options,b),this.trigger("refresh-options",this.options),this.destroy(),this.init())},p.prototype.resetSearch=function(a){var b=this.$toolbar.find(".search input");b.val(a||""),this.onSearch({currentTarget:b})},p.prototype.expandRow_=function(a,b){var d=this.$body.find(c('> tr[data-index="%s"]',b));d.next().is("tr.detail-view")===(a?!1:!0)&&d.find("> td > .detail-icon").click()},p.prototype.expandRow=function(a){this.expandRow_(!0,a)},p.prototype.collapseRow=function(a){this.expandRow_(!1,a)},p.prototype.expandAllRows=function(b){if(b){var d=this.$body.find(c('> tr[data-index="%s"]',0)),e=this,f=null,g=!1,h=-1;if(d.next().is("tr.detail-view")?d.next().next().is("tr.detail-view")||(d.next().find(".detail-icon").click(),g=!0):(d.find("> td > .detail-icon").click(),g=!0),g)try{h=setInterval(function(){f=e.$body.find("tr.detail-view").last().find(".detail-icon"),f.length>0?f.click():clearInterval(h)},1)}catch(i){clearInterval(h)}}else for(var j=this.$body.children(),k=0;k<j.length;k++)this.expandRow_(!0,a(j[k]).data("index"))},p.prototype.collapseAllRows=function(b){if(b)this.expandRow_(!1,0);else for(var c=this.$body.children(),d=0;d<c.length;d++)this.expandRow_(!1,a(c[d]).data("index"))},p.prototype.updateFormatText=function(a,b){this.options[c("format%s",a)]&&("string"==typeof b?this.options[c("format%s",a)]=function(){return b}:"function"==typeof b&&(this.options[c("format%s",a)]=b)),this.initToolbar(),this.initPagination(),this.initBody()};var q=["getOptions","getSelections","getAllSelections","getData","load","append","prepend","remove","removeAll","insertRow","updateRow","updateCell","updateByUniqueId","removeByUniqueId","getRowByUniqueId","showRow","hideRow","getRowsHidden","mergeCells","checkAll","uncheckAll","checkInvert","check","uncheck","checkBy","uncheckBy","refresh","resetView","resetWidth","destroy","showLoading","hideLoading","showColumn","hideColumn","getHiddenColumns","getVisibleColumns","showAllColumns","hideAllColumns","filterBy","scrollTo","getScrollPosition","selectPage","prevPage","nextPage","togglePagination","toggleView","refreshOptions","resetSearch","expandRow","collapseRow","expandAllRows","collapseAllRows","updateFormatText"];a.fn.bootstrapTable=function(b){var c,d=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=a(this),f=e.data("bootstrap.table"),g=a.extend({},p.DEFAULTS,e.data(),"object"==typeof b&&b);if("string"==typeof b){if(a.inArray(b,q)<0)throw new Error("Unknown method: "+b);if(!f)return;c=f[b].apply(f,d),"destroy"===b&&e.removeData("bootstrap.table")}f||e.data("bootstrap.table",f=new p(this,g))}),"undefined"==typeof c?this:c},a.fn.bootstrapTable.Constructor=p,a.fn.bootstrapTable.defaults=p.DEFAULTS,a.fn.bootstrapTable.columnDefaults=p.COLUMN_DEFAULTS,a.fn.bootstrapTable.locales=p.LOCALES,a.fn.bootstrapTable.methods=q,a.fn.bootstrapTable.utils={sprintf:c,getFieldIndex:e,compareObjects:i,calculateObjectValue:h,getItemField:m,objectKeys:o,isIEBrowser:n},a(function(){a('[data-toggle="table"]').bootstrapTable()})}(jQuery);
  5680. define("bootstrap-table", ["bootstrap","css!../libs/bootstrap-table/dist/bootstrap-table.min.css"], (function (global) {
  5681. return function () {
  5682. var ret, fn;
  5683. return ret || global.$.fn.bootstrapTable;
  5684. };
  5685. }(this)));
  5686. /**
  5687. * Bootstrap Table Chinese translation
  5688. * Author: Zhixin Wen<wenzhixin2010@gmail.com>
  5689. */
  5690. (function ($) {
  5691. 'use strict';
  5692. $.fn.bootstrapTable.locales['zh-CN'] = {
  5693. formatLoadingMessage: function () {
  5694. return '正在努力地加载数据中,请稍候……';
  5695. },
  5696. formatRecordsPerPage: function (pageNumber) {
  5697. return '每页显示 ' + pageNumber + ' 条记录';
  5698. },
  5699. formatShowingRows: function (pageFrom, pageTo, totalRows) {
  5700. return '显示第 ' + pageFrom + ' 到第 ' + pageTo + ' 条记录,总共 ' + totalRows + ' 条记录';
  5701. },
  5702. formatSearch: function () {
  5703. return '搜索';
  5704. },
  5705. formatNoMatches: function () {
  5706. return '没有找到匹配的记录';
  5707. },
  5708. formatPaginationSwitch: function () {
  5709. return '隐藏/显示分页';
  5710. },
  5711. formatRefresh: function () {
  5712. return '刷新';
  5713. },
  5714. formatToggle: function () {
  5715. return '切换';
  5716. },
  5717. formatColumns: function () {
  5718. return '列';
  5719. },
  5720. formatExport: function () {
  5721. return '导出数据';
  5722. },
  5723. formatClearFilters: function () {
  5724. return '清空过滤';
  5725. }
  5726. };
  5727. $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']);
  5728. })(jQuery);
  5729. define("bootstrap-table-lang", ["bootstrap-table"], (function (global) {
  5730. return function () {
  5731. var ret, fn;
  5732. return ret || global.$.fn.bootstrapTable.defaults;
  5733. };
  5734. }(this)));
  5735. /**
  5736. * @author: Dennis Hernández
  5737. * @webSite: http://djhvscf.github.io/Blog
  5738. * @version: v1.1.0
  5739. */
  5740. !function ($) {
  5741. 'use strict';
  5742. var showHideColumns = function (that, checked) {
  5743. if (that.options.columnsHidden.length > 0 ) {
  5744. $.each(that.columns, function (i, column) {
  5745. if (that.options.columnsHidden.indexOf(column.field) !== -1) {
  5746. if (column.visible !== checked) {
  5747. that.toggleColumn($.fn.bootstrapTable.utils.getFieldIndex(that.columns, column.field), checked, true);
  5748. }
  5749. }
  5750. });
  5751. }
  5752. };
  5753. var resetView = function (that) {
  5754. if (that.options.height || that.options.showFooter) {
  5755. setTimeout(function(){
  5756. that.resetView.call(that);
  5757. }, 1);
  5758. }
  5759. };
  5760. var changeView = function (that, width, height) {
  5761. if (that.options.minHeight) {
  5762. if ((width <= that.options.minWidth) && (height <= that.options.minHeight)) {
  5763. conditionCardView(that);
  5764. } else if ((width > that.options.minWidth) && (height > that.options.minHeight)) {
  5765. conditionFullView(that);
  5766. }
  5767. } else {
  5768. if (width <= that.options.minWidth) {
  5769. conditionCardView(that);
  5770. } else if (width > that.options.minWidth) {
  5771. conditionFullView(that);
  5772. }
  5773. }
  5774. resetView(that);
  5775. };
  5776. var conditionCardView = function (that) {
  5777. changeTableView(that, false);
  5778. showHideColumns(that, false);
  5779. };
  5780. var conditionFullView = function (that) {
  5781. changeTableView(that, true);
  5782. showHideColumns(that, true);
  5783. };
  5784. var changeTableView = function (that, cardViewState) {
  5785. that.options.cardView = cardViewState;
  5786. that.toggleView();
  5787. };
  5788. var debounce = function(func,wait) {
  5789. var timeout;
  5790. return function() {
  5791. var context = this,
  5792. args = arguments;
  5793. var later = function() {
  5794. timeout = null;
  5795. func.apply(context,args);
  5796. };
  5797. clearTimeout(timeout);
  5798. timeout = setTimeout(later, wait);
  5799. };
  5800. };
  5801. $.extend($.fn.bootstrapTable.defaults, {
  5802. mobileResponsive: false,
  5803. minWidth: 562,
  5804. minHeight: undefined,
  5805. heightThreshold: 100, // just slightly larger than mobile chrome's auto-hiding toolbar
  5806. checkOnInit: true,
  5807. columnsHidden: []
  5808. });
  5809. var BootstrapTable = $.fn.bootstrapTable.Constructor,
  5810. _init = BootstrapTable.prototype.init;
  5811. BootstrapTable.prototype.init = function () {
  5812. _init.apply(this, Array.prototype.slice.apply(arguments));
  5813. if (!this.options.mobileResponsive) {
  5814. return;
  5815. }
  5816. if (!this.options.minWidth) {
  5817. return;
  5818. }
  5819. if (this.options.minWidth < 100 && this.options.resizable) {
  5820. console.log("The minWidth when the resizable extension is active should be greater or equal than 100");
  5821. this.options.minWidth = 100;
  5822. }
  5823. var that = this,
  5824. old = {
  5825. width: $(window).width(),
  5826. height: $(window).height()
  5827. };
  5828. $(window).on('resize orientationchange',debounce(function (evt) {
  5829. // reset view if height has only changed by at least the threshold.
  5830. var height = $(this).height(),
  5831. width = $(this).width();
  5832. if (Math.abs(old.height - height) > that.options.heightThreshold || old.width != width) {
  5833. changeView(that, width, height);
  5834. old = {
  5835. width: width,
  5836. height: height
  5837. };
  5838. }
  5839. },200));
  5840. if (this.options.checkOnInit) {
  5841. var height = $(window).height(),
  5842. width = $(window).width();
  5843. changeView(this, width, height);
  5844. old = {
  5845. width: width,
  5846. height: height
  5847. };
  5848. }
  5849. };
  5850. }(jQuery);
  5851. define("bootstrap-table-mobile", ["bootstrap-table"], (function (global) {
  5852. return function () {
  5853. var ret, fn;
  5854. return ret || global.$.fn.bootstrapTable.defaults;
  5855. };
  5856. }(this)));
  5857. /*
  5858. tableExport.jquery.plugin
  5859. Copyright (c) 2015-2017 hhurz, https://github.com/hhurz/tableExport.jquery.plugin
  5860. Original work Copyright (c) 2014 Giri Raj, https://github.com/kayalshri/
  5861. Licensed under the MIT License, http://opensource.org/licenses/mit-license
  5862. */
  5863. (function(c){c.fn.extend({tableExport:function(u){function S(b){var a=[];c(b).find("thead").first().find("th").each(function(b,d){void 0!==c(d).attr("data-field")?a[b]=c(d).attr("data-field"):a[b]=b.toString()});return a}function z(b,h,e,d,w){if(-1==c.inArray(e,a.ignoreRow)&&-1==c.inArray(e-d,a.ignoreRow)){var q=c(b).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display")||"always"==c(this).closest("table").data("tableexport-display"))}).find(h),
  5864. l=0;q.each(function(b){if("always"==c(this).data("tableexport-display")||"none"!=c(this).css("display")&&"hidden"!=c(this).css("visibility")&&"none"!=c(this).data("tableexport-display")){var d=b,h=!1;0<a.ignoreColumn.length&&("string"==typeof a.ignoreColumn[0]?H.length>d&&"undefined"!=typeof H[d]&&-1!=c.inArray(H[d],a.ignoreColumn)&&(h=!0):"number"!=typeof a.ignoreColumn[0]||-1==c.inArray(d,a.ignoreColumn)&&-1==c.inArray(d-q.length,a.ignoreColumn)||(h=!0));if(!1===h&&"function"===typeof w){var h=
  5865. 0,r,f=0;if("undefined"!=typeof A[e]&&0<A[e].length)for(d=0;d<=b;d++)"undefined"!=typeof A[e][d]&&(w(null,e,d),delete A[e][d],b++);c(this).is("[colspan]")&&(h=parseInt(c(this).attr("colspan")),l+=0<h?h-1:0);c(this).is("[rowspan]")&&(f=parseInt(c(this).attr("rowspan")));w(this,e,b);for(d=0;d<h-1;d++)w(null,e,b+d);if(f)for(r=1;r<f;r++)for("undefined"==typeof A[e+r]&&(A[e+r]=[]),A[e+r][b+l]="",d=1;d<h;d++)A[e+r][b+l-d]=""}}});if("undefined"!=typeof A[e]&&0<A[e].length)for(b=0;b<=A[e].length;b++)"undefined"!=
  5866. typeof A[e][b]&&(w(null,e,b),delete A[e][b])}}function Z(b,h){!0===a.consoleLog&&console.log(b.output());if("string"===a.outputMode)return b.output();if("base64"===a.outputMode)return F(b.output());if("window"===a.outputMode)window.open(URL.createObjectURL(b.output("blob")));else try{var e=b.output("blob");saveAs(e,a.fileName+".pdf")}catch(d){C(a.fileName+".pdf","data:application/pdf"+(h?"":";base64")+",",h?e:b.output())}}function aa(b,a,e){var d=0;"undefined"!=typeof e&&(d=e.colspan);if(0<=d){for(var h=
  5867. b.width,c=b.textPos.x,l=a.table.columns.indexOf(a.column),r=1;r<d;r++)h+=a.table.columns[l+r].width;1<d&&("right"===b.styles.halign?c=b.textPos.x+h-b.width:"center"===b.styles.halign&&(c=b.textPos.x+(h-b.width)/2));b.width=h;b.textPos.x=c;"undefined"!=typeof e&&1<e.rowspan&&(b.height*=e.rowspan);if("middle"===b.styles.valign||"bottom"===b.styles.valign)e=("string"===typeof b.text?b.text.split(/\r\n|\r|\n/g):b.text).length||1,2<e&&(b.textPos.y-=(2-1.15)/2*a.row.styles.fontSize*(e-2)/3);return!0}return!1}
  5868. function ba(b,a,e){"undefined"!=typeof e.images&&a.each(function(){var a=c(this).children();if(c(this).is("img")){var h=ca(this.src);e.images[h]={url:this.src,src:this.src}}"undefined"!=typeof a&&0<a.length&&ba(b,a,e)})}function ka(b,a){function h(b){if(b.url){var d=new Image;c=++q;d.crossOrigin="Anonymous";d.onerror=d.onload=function(){if(d.complete&&(0===d.src.indexOf("data:image/")&&(d.width=b.width||d.width||0,d.height=b.height||d.height||0),d.width+d.height)){var h=document.createElement("canvas"),
  5869. e=h.getContext("2d");h.width=d.width;h.height=d.height;e.drawImage(d,0,0);b.src=h.toDataURL("image/jpeg")}--q||a(c)};d.src=b.url}}var d,c=0,q=0;if("undefined"!=typeof b.images)for(d in b.images)b.images.hasOwnProperty(d)&&h(b.images[d]);(d=q)||(a(c),d=void 0);return d}function da(b,h,e){h.each(function(){var d=c(this).children();if(c(this).is("div")){var h=N(E(this,"background-color"),[255,255,255]),q=N(E(this,"border-top-color"),[0,0,0]),l=O(this,"border-top-width",a.jspdf.unit),r=this.getBoundingClientRect(),
  5870. f=this.offsetLeft*e.dw,g=this.offsetTop*e.dh,k=r.width*e.dw,r=r.height*e.dh;e.doc.setDrawColor.apply(void 0,q);e.doc.setFillColor.apply(void 0,h);e.doc.setLineWidth(l);e.doc.rect(b.x+f,b.y+g,k,r,l?"FD":"F")}else if(c(this).is("img")&&"undefined"!=typeof e.images&&(g=ca(this.src),h=e.images[g],"undefined"!=typeof h)){q=b.width/b.height;l=this.width/this.height;f=b.width;k=b.height;g=0;l<q?(k=Math.min(b.height,this.height),f=this.width*k/this.height):l>q&&(f=Math.min(b.width,this.width),k=this.height*
  5871. f/this.width);k<b.height&&(g=(b.height-k)/2);try{e.doc.addImage(h.src,b.textPos.x,b.y+g,f,k)}catch(oa){}b.textPos.x+=f}"undefined"!=typeof d&&0<d.length&&da(b,d,e)})}function P(b,a,e){return b.replace(new RegExp(a.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),e)}function ea(b){b=P(b||"0",a.numbers.html.thousandsSeparator,"");b=P(b,a.numbers.html.decimalMark,".");return"number"===typeof b||!1!==jQuery.isNumeric(b)?b:!1}function x(b,h,e){var d="";if(null!==b){var w=c(b),q;if(w[0].hasAttribute("data-tableexport-value"))q=
  5872. w.data("tableexport-value");else if(q=w.html(),"function"===typeof a.onCellHtmlData)q=a.onCellHtmlData(w,h,e,q);else if(""!=q){b=c.parseHTML(q);var l=0,r=0;q="";c.each(b,function(){if(c(this).is("input"))q+=w.find("input").eq(l++).val();else if(c(this).is("select"))q+=w.find("select option:selected").eq(r++).text();else if("undefined"===typeof c(this).html())q+=c(this).text();else if(void 0===jQuery().bootstrapTable||!0!==c(this).hasClass("filterControl"))q+=c(this).html()})}if(!0===a.htmlContent)d=
  5873. c.trim(q);else if(""!=q){var f=q.replace(/\n/g,"\u2028").replace(/<br\s*[\/]?>/gi,"\u2060");b=c("<div/>").html(f).contents();f="";c.each(b.text().split("\u2028"),function(b,a){0<b&&(f+=" ");f+=c.trim(a)});c.each(f.split("\u2060"),function(b,a){0<b&&(d+="\n");d+=c.trim(a).replace(/\u00AD/g,"")});if("json"==a.type||!1===a.numbers.output)b=ea(d),!1!==b&&(d=Number(b));else if(a.numbers.html.decimalMark!=a.numbers.output.decimalMark||a.numbers.html.thousandsSeparator!=a.numbers.output.thousandsSeparator)if(b=
  5874. ea(d),!1!==b){var g=(""+b).split(".");1==g.length&&(g[1]="");var k=3<g[0].length?g[0].length%3:0,d=(0>b?"-":"")+(a.numbers.output.thousandsSeparator?(k?g[0].substr(0,k)+a.numbers.output.thousandsSeparator:"")+g[0].substr(k).replace(/(\d{3})(?=\d)/g,"$1"+a.numbers.output.thousandsSeparator):g[0])+(g[1].length?a.numbers.output.decimalMark+g[1]:"")}}!0===a.escape&&(d=escape(d));"function"===typeof a.onCellData&&(d=a.onCellData(w,h,e,d))}return d}function la(b,a,e){return a+"-"+e.toLowerCase()}function N(b,
  5875. a){var h=/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.exec(b),d=a;h&&(d=[parseInt(h[1]),parseInt(h[2]),parseInt(h[3])]);return d}function fa(b){var a=E(b,"text-align"),e=E(b,"font-weight"),d=E(b,"font-style"),w="";"start"==a&&(a="rtl"==E(b,"direction")?"right":"left");700<=e&&(w="bold");"italic"==d&&(w+=d);""===w&&(w="normal");a={style:{align:a,bcolor:N(E(b,"background-color"),[255,255,255]),color:N(E(b,"color"),[0,0,0]),fstyle:w},colspan:parseInt(c(b).attr("colspan"))||0,rowspan:parseInt(c(b).attr("rowspan"))||
  5876. 0};null!==b&&(b=b.getBoundingClientRect(),a.rect={width:b.width,height:b.height});return a}function E(b,a){try{return window.getComputedStyle?(a=a.replace(/([a-z])([A-Z])/,la),window.getComputedStyle(b,null).getPropertyValue(a)):b.currentStyle?b.currentStyle[a]:b.style[a]}catch(e){}return""}function O(b,a,e){a=E(b,a).match(/\d+/);if(null!==a){a=a[0];b=b.parentElement;var d=document.createElement("div");d.style.overflow="hidden";d.style.visibility="hidden";b.appendChild(d);d.style.width=100+e;e=100/
  5877. d.offsetWidth;b.removeChild(d);return a*e}return 0}function T(){if(!(this instanceof T))return new T;this.SheetNames=[];this.Sheets={}}function ma(a){for(var b=new ArrayBuffer(a.length),e=new Uint8Array(b),d=0;d!=a.length;++d)e[d]=a.charCodeAt(d)&255;return b}function na(a){for(var b={},e={s:{c:1E7,r:1E7},e:{c:0,r:0}},d=0;d!=a.length;++d)for(var c=0;c!=a[d].length;++c){e.s.r>d&&(e.s.r=d);e.s.c>c&&(e.s.c=c);e.e.r<d&&(e.e.r=d);e.e.c<c&&(e.e.c=c);var f={v:a[d][c]};if(null!==f.v){var l=XLSX.utils.encode_cell({c:c,
  5878. r:d});if("number"===typeof f.v)f.t="n";else if("boolean"===typeof f.v)f.t="b";else if(f.v instanceof Date){f.t="n";f.z=XLSX.SSF._table[14];var r=f,g;g=(Date.parse(f.v)-new Date(Date.UTC(1899,11,30)))/864E5;r.v=g}else f.t="s";b[l]=f}}1E7>e.s.c&&(b["!ref"]=XLSX.utils.encode_range(e));return b}function ca(a){var b=0,c,d,f;if(0===a.length)return b;c=0;for(f=a.length;c<f;c++)d=a.charCodeAt(c),b=(b<<5)-b+d,b|=0;return b}function C(a,c,e){var b=window.navigator.userAgent;if(!1!==a&&(0<b.indexOf("MSIE ")||
  5879. b.match(/Trident.*rv\:11\./)))if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(new Blob([e]),a);else{if(c=document.createElement("iframe"))document.body.appendChild(c),c.setAttribute("style","display:none"),c.contentDocument.open("txt/html","replace"),c.contentDocument.write(e),c.contentDocument.close(),c.focus(),c.contentDocument.execCommand("SaveAs",!0,a),document.body.removeChild(c)}else if(b=document.createElement("a")){var h=null;b.style.display="none";!1!==a?b.download=
  5880. a:b.target="_blank";"object"==typeof e?(h=window.URL.createObjectURL(e),b.href=h):0<=c.toLowerCase().indexOf("base64,")?b.href=c+F(e):b.href=c+encodeURIComponent(e);document.body.appendChild(b);if(document.createEvent)null===Q&&(Q=document.createEvent("MouseEvents")),Q.initEvent("click",!0,!1),b.dispatchEvent(Q);else if(document.createEventObject)b.fireEvent("onclick");else if("function"==typeof b.onclick)b.onclick();h&&window.URL.revokeObjectURL(h);document.body.removeChild(b)}}function F(a){var b=
  5881. "",c,d,f,g,l,r,k=0;a=a.replace(/\x0d\x0a/g,"\n");d="";for(f=0;f<a.length;f++)g=a.charCodeAt(f),128>g?d+=String.fromCharCode(g):(127<g&&2048>g?d+=String.fromCharCode(g>>6|192):(d+=String.fromCharCode(g>>12|224),d+=String.fromCharCode(g>>6&63|128)),d+=String.fromCharCode(g&63|128));for(a=d;k<a.length;)c=a.charCodeAt(k++),d=a.charCodeAt(k++),f=a.charCodeAt(k++),g=c>>2,c=(c&3)<<4|d>>4,l=(d&15)<<2|f>>6,r=f&63,isNaN(d)?l=r=64:isNaN(f)&&(r=64),b=b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)+
  5882. "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(r);return b}var a={consoleLog:!1,csvEnclosure:'"',csvSeparator:",",csvUseBOM:!0,displayTableName:!1,escape:!1,excelstyles:[],fileName:"tableExport",htmlContent:!1,ignoreColumn:[],ignoreRow:[],jsonScope:"all",jspdf:{orientation:"p",unit:"pt",format:"a4",margins:{left:20,
  5883. right:10,top:10,bottom:10},autotable:{styles:{cellPadding:2,rowHeight:12,fontSize:8,fillColor:255,textColor:50,fontStyle:"normal",overflow:"ellipsize",halign:"left",valign:"middle"},headerStyles:{fillColor:[52,73,94],textColor:255,fontStyle:"bold",halign:"center"},alternateRowStyles:{fillColor:245},tableExport:{onAfterAutotable:null,onBeforeAutotable:null,onTable:null,outputImages:!0}}},numbers:{html:{decimalMark:".",thousandsSeparator:","},output:{decimalMark:".",thousandsSeparator:","}},onCellData:null,
  5884. onCellHtmlData:null,outputMode:"file",pdfmake:{enabled:!1},tbodySelector:"tr",tfootSelector:"tr",theadSelector:"tr",tableName:"myTableName",type:"csv",worksheetName:"xlsWorksheetName"},t=this,Q=null,n=[],g=[],k=0,A=[],m="",H=[],y;c.extend(!0,a,u);H=S(t);if("csv"==a.type||"tsv"==a.type||"txt"==a.type){var D="",I=0,k=0,U=function(b,h,e){b.each(function(){m="";z(this,h,k,e+b.length,function(b,c,e){var d=m,h="";if(null!==b)if(b=x(b,c,e),c=null===b||""===b?"":b.toString(),"tsv"==a.type)b instanceof Date&&
  5885. b.toLocaleString(),h=P(c,"\t"," ");else if(b instanceof Date)h=a.csvEnclosure+b.toLocaleString()+a.csvEnclosure;else if(h=P(c,a.csvEnclosure,a.csvEnclosure+a.csvEnclosure),0<=h.indexOf(a.csvSeparator)||/[\r\n ]/g.test(h))h=a.csvEnclosure+h+a.csvEnclosure;m=d+(h+("tsv"==a.type?"\t":a.csvSeparator))});m=c.trim(m).substring(0,m.length-1);0<m.length&&(0<D.length&&(D+="\n"),D+=m);k++});return b.length},I=I+U(c(t).find("thead").first().find(a.theadSelector),"th,td",I);c(t).find("tbody").each(function(){I+=
  5886. U(c(this).find(a.tbodySelector),"td,th",I)});a.tfootSelector.length&&U(c(t).find("tfoot").first().find(a.tfootSelector),"td,th",I);D+="\n";!0===a.consoleLog&&console.log(D);if("string"===a.outputMode)return D;if("base64"===a.outputMode)return F(D);if("window"===a.outputMode){C(!1,"data:text/"+("csv"==a.type?"csv":"plain")+";charset=utf-8,",D);return}try{y=new Blob([D],{type:"text/"+("csv"==a.type?"csv":"plain")+";charset=utf-8"}),saveAs(y,a.fileName+"."+a.type,"csv"!=a.type||!1===a.csvUseBOM)}catch(b){C(a.fileName+
  5887. "."+a.type,"data:text/"+("csv"==a.type?"csv":"plain")+";charset=utf-8,"+("csv"==a.type&&a.csvUseBOM?"\ufeff":""),D)}}else if("sql"==a.type){var k=0,v="INSERT INTO `"+a.tableName+"` (",n=c(t).find("thead").first().find(a.theadSelector);n.each(function(){z(this,"th,td",k,n.length,function(a,c,e){v+="'"+x(a,c,e)+"',"});k++;v=c.trim(v);v=c.trim(v).substring(0,v.length-1)});v+=") VALUES ";c(t).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,
  5888. c(t).find("tfoot").find(a.tfootSelector));c(g).each(function(){m="";z(this,"td,th",k,n.length+g.length,function(a,c,e){m+="'"+x(a,c,e)+"',"});3<m.length&&(v+="("+m,v=c.trim(v).substring(0,v.length-1),v+="),");k++});v=c.trim(v).substring(0,v.length-1);v+=";";!0===a.consoleLog&&console.log(v);if("string"===a.outputMode)return v;if("base64"===a.outputMode)return F(v);try{y=new Blob([v],{type:"text/plain;charset=utf-8"}),saveAs(y,a.fileName+".sql")}catch(b){C(a.fileName+".sql","data:application/sql;charset=utf-8,",
  5889. v)}}else if("json"==a.type){var J=[],n=c(t).find("thead").first().find(a.theadSelector);n.each(function(){var a=[];z(this,"th,td",k,n.length,function(b,c,d){a.push(x(b,c,d))});J.push(a)});var V=[];c(t).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(t).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a={},h=0;z(this,"td,th",k,n.length+g.length,function(b,c,f){J.length?a[J[J.length-1][h]]=x(b,c,f):a[h]=x(b,c,f);h++});
  5890. !1===c.isEmptyObject(a)&&V.push(a);k++});u="";u="head"==a.jsonScope?JSON.stringify(J):"data"==a.jsonScope?JSON.stringify(V):JSON.stringify({header:J,data:V});!0===a.consoleLog&&console.log(u);if("string"===a.outputMode)return u;if("base64"===a.outputMode)return F(u);try{y=new Blob([u],{type:"application/json;charset=utf-8"}),saveAs(y,a.fileName+".json")}catch(b){C(a.fileName+".json","data:application/json;charset=utf-8;base64,",u)}}else if("xml"===a.type){var k=0,B='<?xml version="1.0" encoding="utf-8"?>',
  5891. B=B+"<tabledata><fields>",n=c(t).find("thead").first().find(a.theadSelector);n.each(function(){z(this,"th,td",k,n.length,function(a,c,e){B+="<field>"+x(a,c,e)+"</field>"});k++});var B=B+"</fields><data>",ga=1;c(t).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(t).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a=1;m="";z(this,"td,th",k,n.length+g.length,function(b,c,d){m+="<column-"+a+">"+x(b,c,d)+"</column-"+a+
  5892. ">";a++});0<m.length&&"<column-1></column-1>"!=m&&(B+='<row id="'+ga+'">'+m+"</row>",ga++);k++});B+="</data></tabledata>";!0===a.consoleLog&&console.log(B);if("string"===a.outputMode)return B;if("base64"===a.outputMode)return F(B);try{y=new Blob([B],{type:"application/xml;charset=utf-8"}),saveAs(y,a.fileName+".xml")}catch(b){C(a.fileName+".xml","data:application/xml;charset=utf-8;base64,",B)}}else if("excel"==a.type||"xls"==a.type||"word"==a.type||"doc"==a.type){u="excel"==a.type||"xls"==a.type?"excel":
  5893. "word";var K="excel"==u?"xls":"doc",p='xmlns:x="urn:schemas-microsoft-com:office:'+u+'"',G="";c(t).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display"))}).each(function(){var b=c(this);k=0;H=S(this);G+="<table><thead>";n=b.find("thead").first().find(a.theadSelector);n.each(function(){m="";z(this,"th,td",k,n.length,function(b,e,d){if(null!==b){var h="";m+="<th";for(var f in a.excelstyles)if(a.excelstyles.hasOwnProperty(f)){var l=
  5894. c(b).css(a.excelstyles[f]);""!==l&&"0px none rgb(0, 0, 0)"!=l&&"rgba(0, 0, 0, 0)"!=l&&(h+=""===h?'style="':";",h+=a.excelstyles[f]+":"+l)}""!==h&&(m+=" "+h+'"');c(b).is("[colspan]")&&(m+=' colspan="'+c(b).attr("colspan")+'"');c(b).is("[rowspan]")&&(m+=' rowspan="'+c(b).attr("rowspan")+'"');m+=">"+x(b,e,d)+"</th>"}});0<m.length&&(G+="<tr>"+m+"</tr>");k++});G+="</thead><tbody>";b.find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,b.find("tfoot").find(a.tfootSelector));
  5895. c(g).each(function(){var b=c(this);m="";z(this,"td,th",k,n.length+g.length,function(e,d,h){if(null!==e){var f="",l=c(e).data("tableexport-msonumberformat");"undefined"==typeof l&&"function"===typeof a.onMsoNumberFormat&&(l=a.onMsoNumberFormat(e,d,h));"undefined"!=typeof l&&""!==l&&(f="style=\"mso-number-format:'"+l+"'");for(var g in a.excelstyles)a.excelstyles.hasOwnProperty(g)&&(l=c(e).css(a.excelstyles[g]),""===l&&(l=b.css(a.excelstyles[g])),""!==l&&"0px none rgb(0, 0, 0)"!=l&&"rgba(0, 0, 0, 0)"!=
  5896. l&&(f+=""===f?'style="':";",f+=a.excelstyles[g]+":"+l));m+="<td";""!==f&&(m+=" "+f+'"');c(e).is("[colspan]")&&(m+=' colspan="'+c(e).attr("colspan")+'"');c(e).is("[rowspan]")&&(m+=' rowspan="'+c(e).attr("rowspan")+'"');m+=">"+x(e,d,h).replace(/\n/g,"<br>")+"</td>"}});0<m.length&&(G+="<tr>"+m+"</tr>");k++});a.displayTableName&&(G+="<tr><td></td></tr><tr><td></td></tr><tr><td>"+x(c("<p>"+a.tableName+"</p>"))+"</td></tr>");G+="</tbody></table>";!0===a.consoleLog&&console.log(G)});p='<html xmlns:o="urn:schemas-microsoft-com:office:office" '+
  5897. p+' xmlns="http://www.w3.org/TR/REC-html40">'+('<meta http-equiv="content-type" content="application/vnd.ms-'+u+'; charset=UTF-8">')+"<head>";"excel"===u&&(p+="\x3c!--[if gte mso 9]>",p+="<xml>",p+="<x:ExcelWorkbook>",p+="<x:ExcelWorksheets>",p+="<x:ExcelWorksheet>",p+="<x:Name>",p+=a.worksheetName,p+="</x:Name>",p+="<x:WorksheetOptions>",p+="<x:DisplayGridlines/>",p+="</x:WorksheetOptions>",p+="</x:ExcelWorksheet>",p+="</x:ExcelWorksheets>",p+="</x:ExcelWorkbook>",p+="</xml>",p+="<![endif]--\x3e");
  5898. p+="<style>br {mso-data-placement:same-cell;}</style>";p+="</head>";p+="<body>";p+=G;p+="</body>";p+="</html>";!0===a.consoleLog&&console.log(p);if("string"===a.outputMode)return p;if("base64"===a.outputMode)return F(p);try{y=new Blob([p],{type:"application/vnd.ms-"+a.type}),saveAs(y,a.fileName+"."+K)}catch(b){C(a.fileName+"."+K,"data:application/vnd.ms-"+u+";base64,",p)}}else if("xlsx"==a.type){var ha=[],W=[],k=0,g=c(t).find("thead").first().find(a.theadSelector);c(t).find("tbody").each(function(){g.push.apply(g,
  5899. c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(t).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a=[];z(this,"th,td",k,g.length,function(b,c,d){if("undefined"!==typeof b&&null!==b){var e=parseInt(b.getAttribute("colspan")),f=parseInt(b.getAttribute("rowspan"));b=x(b,c,d);""!==b&&b==+b&&(b=+b);W.forEach(function(b){if(k>=b.s.r&&k<=b.e.r&&a.length>=b.s.c&&a.length<=b.e.c)for(var c=0;c<=b.e.c-b.s.c;++c)a.push(null)});if(f||e)e=e||1,W.push({s:{r:k,c:a.length},
  5900. e:{r:k+(f||1)-1,c:a.length+e-1}});a.push(""!==b?b:null);if(e)for(f=0;f<e-1;++f)a.push(null)}});ha.push(a);k++});u=new T;K=na(ha);K["!merges"]=W;u.SheetNames.push(a.worksheetName);u.Sheets[a.worksheetName]=K;u=XLSX.write(u,{bookType:a.type,bookSST:!1,type:"binary"});try{y=new Blob([ma(u)],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"}),saveAs(y,a.fileName+"."+a.type)}catch(b){C(a.fileName+"."+a.type,"data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8,",
  5901. y)}}else if("png"==a.type)html2canvas(c(t)[0]).then(function(b){b=b.toDataURL();for(var c=atob(b.substring(22)),e=new ArrayBuffer(c.length),d=new Uint8Array(e),f=0;f<c.length;f++)d[f]=c.charCodeAt(f);!0===a.consoleLog&&console.log(c);if("string"===a.outputMode)return c;if("base64"===a.outputMode)return F(b);if("window"===a.outputMode)window.open(b);else try{y=new Blob([e],{type:"image/png"}),saveAs(y,a.fileName+".png")}catch(q){C(a.fileName+".png","data:image/png,",y)}});else if("pdf"==a.type)if(!0===
  5902. a.pdfmake.enabled){var X=[],Y=[],k=0,n=c(this).find("thead").first().find(a.theadSelector);n.each(function(){var a=[];z(this,"th,td",k,n.length,function(b,c,f){a.push(x(b,c,f))});a.length&&Y.push(a);for(var c=X.length;c<a.length;c++)X.push("*");k++});c(this).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(this).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a=[];z(this,"td,th",k,n.length+g.length,function(b,c,d){a.push(x(b,
  5903. c,d))});a.length&&Y.push(a);k++});pdfMake.createPdf({pageOrientation:"landscape",content:[{table:{headerRows:n.length,widths:X,body:Y}}]}).getBuffer(function(b){try{var c=new Blob([b],{type:"application/pdf"});saveAs(c,a.fileName+".pdf")}catch(e){C(a.fileName+".pdf","data:application/pdf;base64,",b)}})}else if(!1===a.jspdf.autotable){u={dim:{w:O(c(t).first().get(0),"width","mm"),h:O(c(t).first().get(0),"height","mm")},pagesplit:!1};var ia=new jsPDF(a.jspdf.orientation,a.jspdf.unit,a.jspdf.format);
  5904. ia.addHTML(c(t).first(),a.jspdf.margins.left,a.jspdf.margins.top,u,function(){Z(ia,!1)})}else{var f=a.jspdf.autotable.tableExport;if("string"===typeof a.jspdf.format&&"bestfit"===a.jspdf.format.toLowerCase()){var L={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89]},R="",M="",ja=0;c(t).filter(":visible").each(function(){if("none"!=c(this).css("display")){var a=O(c(this).get(0),"width","pt");if(a>ja){a>L.a0[0]&&(R="a0",M="l");for(var f in L)L.hasOwnProperty(f)&&
  5905. L[f][1]>a&&(R=f,M="l",L[f][0]>a&&(M="p"));ja=a}}});a.jspdf.format=""===R?"a4":R;a.jspdf.orientation=""===M?"w":M}f.doc=new jsPDF(a.jspdf.orientation,a.jspdf.unit,a.jspdf.format);!0===f.outputImages&&(f.images={});"undefined"!=typeof f.images&&(c(t).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display"))}).each(function(){var b=0;n=c(this).find("thead").find(a.theadSelector);c(this).find("tbody").each(function(){g.push.apply(g,
  5906. c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(this).find("tfoot").find(a.tfootSelector));c(g).each(function(){z(this,"td,th",n.length+b,n.length+g.length,function(a,b,d){"undefined"!==typeof a&&null!==a&&(b=c(a).children(),"undefined"!=typeof b&&0<b.length&&ba(a,b,f))});b++})}),n=[],g=[]);ka(f,function(b){c(t).filter(function(){return"none"!=c(this).data("tableexport-display")&&(c(this).is(":visible")||"always"==c(this).data("tableexport-display"))}).each(function(){var b,
  5907. e=0;H=S(this);f.columns=[];f.rows=[];f.rowoptions={};if("function"===typeof f.onTable&&!1===f.onTable(c(this),a))return!0;a.jspdf.autotable.tableExport=null;var d=c.extend(!0,{},a.jspdf.autotable);a.jspdf.autotable.tableExport=f;d.margin={};c.extend(!0,d.margin,a.jspdf.margins);d.tableExport=f;"function"!==typeof d.beforePageContent&&(d.beforePageContent=function(a){1==a.pageCount&&a.table.rows.concat(a.table.headerRow).forEach(function(b){0<b.height&&(b.height+=(2-1.15)/2*b.styles.fontSize,a.table.height+=
  5908. (2-1.15)/2*b.styles.fontSize)})});"function"!==typeof d.createdHeaderCell&&(d.createdHeaderCell=function(a,b){a.styles=c.extend({},b.row.styles);if("undefined"!=typeof f.columns[b.column.dataKey]){var e=f.columns[b.column.dataKey];if("undefined"!=typeof e.rect){var g;a.contentWidth=e.rect.width;if("undefined"==typeof f.heightRatio||0===f.heightRatio)g=b.row.raw[b.column.dataKey].rowspan?b.row.raw[b.column.dataKey].rect.height/b.row.raw[b.column.dataKey].rowspan:b.row.raw[b.column.dataKey].rect.height,
  5909. f.heightRatio=a.styles.rowHeight/g;g=b.row.raw[b.column.dataKey].rect.height*f.heightRatio;g>a.styles.rowHeight&&(a.styles.rowHeight=g)}"undefined"!=typeof e.style&&!0!==e.style.hidden&&(a.styles.halign=e.style.align,"inherit"===d.styles.fillColor&&(a.styles.fillColor=e.style.bcolor),"inherit"===d.styles.textColor&&(a.styles.textColor=e.style.color),"inherit"===d.styles.fontStyle&&(a.styles.fontStyle=e.style.fstyle))}});"function"!==typeof d.createdCell&&(d.createdCell=function(a,b){var c=f.rowoptions[b.row.index+
  5910. ":"+b.column.dataKey];"undefined"!=typeof c&&"undefined"!=typeof c.style&&!0!==c.style.hidden&&(a.styles.halign=c.style.align,"inherit"===d.styles.fillColor&&(a.styles.fillColor=c.style.bcolor),"inherit"===d.styles.textColor&&(a.styles.textColor=c.style.color),"inherit"===d.styles.fontStyle&&(a.styles.fontStyle=c.style.fstyle))});"function"!==typeof d.drawHeaderCell&&(d.drawHeaderCell=function(a,b){var c=f.columns[b.column.dataKey];return(!0!==c.style.hasOwnProperty("hidden")||!0!==c.style.hidden)&&
  5911. 0<=c.rowIndex?aa(a,b,c):!1});"function"!==typeof d.drawCell&&(d.drawCell=function(a,b){var c=f.rowoptions[b.row.index+":"+b.column.dataKey];if(aa(a,b,c)){f.doc.rect(a.x,a.y,a.width,a.height,a.styles.fillStyle);if("undefined"!=typeof c&&"undefined"!=typeof c.kids&&0<c.kids.length){var d=a.height/c.rect.height;if(d>f.dh||"undefined"==typeof f.dh)f.dh=d;f.dw=a.width/c.rect.width;da(a,c.kids,f)}f.doc.autoTableText(a.text,a.textPos.x,a.textPos.y,{halign:a.styles.halign,valign:a.styles.valign})}return!1});
  5912. f.headerrows=[];n=c(this).find("thead").find(a.theadSelector);n.each(function(){b=0;f.headerrows[e]=[];z(this,"th,td",e,n.length,function(a,c,d){var g=fa(a);g.title=x(a,c,d);g.key=b++;g.rowIndex=e;f.headerrows[e].push(g)});e++});if(0<e)for(var k=e-1;0<=k;)c.each(f.headerrows[k],function(){var a=this;0<k&&null===this.rect&&(a=f.headerrows[k-1][this.key]);null!==a&&0<=a.rowIndex&&(!0!==a.style.hasOwnProperty("hidden")||!0!==a.style.hidden)&&f.columns.push(a)}),k=0<f.columns.length?-1:k-1;var m=0;g=
  5913. [];c(this).find("tbody").each(function(){g.push.apply(g,c(this).find(a.tbodySelector))});a.tfootSelector.length&&g.push.apply(g,c(this).find("tfoot").find(a.tfootSelector));c(g).each(function(){var a=[];b=0;z(this,"td,th",e,n.length+g.length,function(d,e,g){if("undefined"===typeof f.columns[b]){var h={title:"",key:b,style:{hidden:!0}};f.columns.push(h)}"undefined"!==typeof d&&null!==d?(h=fa(d),h.kids=c(d).children()):(h=c.extend(!0,{},f.rowoptions[m+":"+(b-1)]),h.colspan=-1);f.rowoptions[m+":"+b++]=
  5914. h;a.push(x(d,e,g))});a.length&&(f.rows.push(a),m++);e++});if("function"===typeof f.onBeforeAutotable)f.onBeforeAutotable(c(this),f.columns,f.rows,d);f.doc.autoTable(f.columns,f.rows,d);if("function"===typeof f.onAfterAutotable)f.onAfterAutotable(c(this),d);a.jspdf.autotable.startY=f.doc.autoTableEndPosY()+d.margin.top});Z(f.doc,"undefined"!=typeof f.images&&!1===jQuery.isEmptyObject(f.images));"undefined"!=typeof f.headerrows&&(f.headerrows.length=0);"undefined"!=typeof f.columns&&(f.columns.length=
  5915. 0);"undefined"!=typeof f.rows&&(f.rows.length=0);delete f.doc;f.doc=null})}return this}})})(jQuery);
  5916. define("tableexport", ["jquery"], (function (global) {
  5917. return function () {
  5918. var ret, fn;
  5919. return ret || global.$.fn.extend;
  5920. };
  5921. }(this)));
  5922. /*
  5923. * bootstrap-table - v1.11.0 - 2016-07-02
  5924. * https://github.com/wenzhixin/bootstrap-table
  5925. * Copyright (c) 2016 zhixin wen
  5926. * Licensed MIT License
  5927. */
  5928. !function(a){"use strict";var b=a.fn.bootstrapTable.utils.sprintf,c={json:"JSON",xml:"XML",png:"PNG",csv:"CSV",txt:"TXT",sql:"SQL",doc:"MS-Word",excel:"MS-Excel",powerpoint:"MS-Powerpoint",pdf:"PDF"};a.extend(a.fn.bootstrapTable.defaults,{showExport:!1,exportDataType:"basic",exportTypes:["json","xml","csv","txt","sql","excel"],exportOptions:{}}),a.extend(a.fn.bootstrapTable.defaults.icons,{"export":"glyphicon-export icon-share"}),a.extend(a.fn.bootstrapTable.locales,{formatExport:function(){return"Export data"}}),a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales);var d=a.fn.bootstrapTable.Constructor,e=d.prototype.initToolbar;d.prototype.initToolbar=function(){if(this.showToolbar=this.options.showExport,e.apply(this,Array.prototype.slice.apply(arguments)),this.options.showExport){var d=this,f=this.$toolbar.find(">.btn-group"),g=f.find("div.export");if(!g.length){g=a(['<div class="export btn-group">','<button class="btn'+b(" btn-%s",this.options.buttonsClass)+b(" btn-%s",this.options.iconSize)+' dropdown-toggle" title="'+this.options.formatExport()+'" data-toggle="dropdown" type="button">',b('<i class="%s %s"></i> ',this.options.iconsPrefix,this.options.icons["export"]),'<span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">',"</ul>","</div>"].join("")).appendTo(f);var h=g.find(".dropdown-menu"),i=this.options.exportTypes;if("string"==typeof this.options.exportTypes){var j=this.options.exportTypes.slice(1,-1).replace(/ /g,"").split(",");i=[],a.each(j,function(a,b){i.push(b.slice(1,-1))})}a.each(i,function(a,b){c.hasOwnProperty(b)&&h.append(['<li data-type="'+b+'">','<a href="javascript:void(0)">',c[b],"</a>","</li>"].join(""))}),h.find("li").click(function(){var b=a(this).data("type"),c=function(){d.$el.tableExport(a.extend({},d.options.exportOptions,{type:b,escape:!1}))};if("all"===d.options.exportDataType&&d.options.pagination)d.$el.one("server"===d.options.sidePagination?"post-body.bs.table":"page-change.bs.table",function(){c(),d.togglePagination()}),d.togglePagination();else if("selected"===d.options.exportDataType){var e=d.getData(),f=d.getAllSelections();d.load(f),c(),d.load(e)}else c()})}}}}(jQuery);
  5929. define("bootstrap-table-export", ["bootstrap-table","tableexport"], (function (global) {
  5930. return function () {
  5931. var ret, fn;
  5932. return ret || global.$.fn.bootstrapTable.defaults;
  5933. };
  5934. }(this)));
  5935. /**
  5936. * @author: aperez <aperez@datadec.es>
  5937. * @version: v2.0.0
  5938. *
  5939. * @update Dennis Hernández <http://djhvscf.github.io/Blog>
  5940. */
  5941. !function ($) {
  5942. 'use strict';
  5943. var firstLoad = false;
  5944. var sprintf = $.fn.bootstrapTable.utils.sprintf;
  5945. var showAvdSearch = function (pColumns, that) {
  5946. var searchTitle = that.options.formatAdvancedSearch();
  5947. if (!$("#avdSearchModal" + "_" + that.options.idTable).hasClass("modal")) {
  5948. var vModal = sprintf("<div id=\"avdSearchModal%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"mySmallModalLabel\" aria-hidden=\"true\">", "_" + that.options.idTable);
  5949. vModal += "<div class=\"modal-dialog modal-xs\">";
  5950. vModal += " <div class=\"modal-content\">";
  5951. vModal += " <div class=\"modal-header\">";
  5952. vModal += " <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\" >&times;</button>";
  5953. vModal += sprintf(" <h4 class=\"modal-title\">%s</h4>", searchTitle);
  5954. vModal += " </div>";
  5955. vModal += " <div class=\"modal-body modal-body-custom\">";
  5956. vModal += sprintf(" <div class=\"container-fluid\" id=\"avdSearchModalContent%s\" style=\"padding-right: 0px;padding-left: 0px;\" >", "_" + that.options.idTable);
  5957. vModal += " </div>";
  5958. vModal += " </div>";
  5959. vModal += " <div class=\"modal-footer\">";
  5960. vModal += createFormBtn(that).join('');
  5961. vModal += " </div>";
  5962. vModal += " </div>";
  5963. vModal += " </div>";
  5964. vModal += "</div>";
  5965. $("body").append($(vModal));
  5966. var vFormAvd = createFormAvd(pColumns, that),
  5967. timeoutId = 0;
  5968. ;
  5969. $('#avdSearchModalContent' + "_" + that.options.idTable).append(vFormAvd.join(''));
  5970. if (that.options.sidePagination != 'server' || !that.options.url) {
  5971. $('#' + that.options.idForm).off('keyup blur', 'input').on('keyup blur', 'input', function (event) {
  5972. clearTimeout(timeoutId);
  5973. timeoutId = setTimeout(function () {
  5974. that.onColumnAdvancedSearch(event);
  5975. }, that.options.searchTimeOut);
  5976. });
  5977. } else {
  5978. }
  5979. // 提交搜索
  5980. $("#btnSubmitAvd" + "_" + that.options.idTable).click(function (event) {
  5981. that.onColumnAdvancedSearch();
  5982. });
  5983. // 重置搜索
  5984. $("#btnResetAvd" + "_" + that.options.idTable).click(function () {
  5985. $("#avdSearchModal" + "_" + that.options.idTable + " form")[0].reset();
  5986. that.onColumnAdvancedSearch();
  5987. });
  5988. $("#avdSearchModal" + "_" + that.options.idTable).modal();
  5989. } else {
  5990. $("#avdSearchModal" + "_" + that.options.idTable).modal();
  5991. }
  5992. };
  5993. var createFormAvd = function (pColumns, that) {
  5994. var htmlForm = [];
  5995. var opList = ['=', '>', '>=', '<', '<=', '!=', 'LIKE', 'LIKE %...%', 'NOT LIKE', 'IN(...)', 'NOT IN(...)', 'BETWEEN', 'NOT BETWEEN', 'IS NULL', 'IS NOT NULL'];
  5996. var selectList = [];
  5997. for (var i = 0; i < opList.length; i++) {
  5998. selectList.push("<option value='" + opList[i] + "'>" + opList[i] + "</option>");
  5999. }
  6000. var selectHtml = selectList.join('');
  6001. htmlForm.push(sprintf('<form class="form-horizontal" id="%s" action="%s" >', that.options.idForm, that.options.actionForm));
  6002. for (var i in pColumns) {
  6003. var vObjCol = pColumns[i];
  6004. if (!vObjCol.checkbox && vObjCol.field != 'operate' && vObjCol.visible && vObjCol.searchable) {
  6005. htmlForm.push('<div class="form-group">');
  6006. htmlForm.push(sprintf('<label class="col-sm-3 control-label">%s</label>', vObjCol.title));
  6007. if (that.options.sidePagination == 'server' && that.options.url) {
  6008. htmlForm.push('<div class="col-sm-2">');
  6009. htmlForm.push(sprintf('<select class="form-control" name="field-%s" data-name="%s">%s</select>', vObjCol.field, vObjCol.field, selectHtml));
  6010. htmlForm.push('</div>');
  6011. }
  6012. htmlForm.push('<div class="col-sm-6">');
  6013. htmlForm.push(sprintf('<input type="text" class="form-control input-md" name="%s" placeholder="%s" id="%s">', vObjCol.field, vObjCol.title, vObjCol.field));
  6014. htmlForm.push('</div>');
  6015. htmlForm.push('</div>');
  6016. }
  6017. }
  6018. htmlForm.push('</form>');
  6019. return htmlForm;
  6020. };
  6021. var createFormBtn = function (that) {
  6022. var htmlBtn = [];
  6023. var searchSubmit = that.options.formatAdvancedSubmitButton();
  6024. var searchReset = that.options.formatAdvancedResetButton();
  6025. var searchClose = that.options.formatAdvancedCloseButton();
  6026. htmlBtn.push('<div class="form-group">');
  6027. htmlBtn.push('<div class="col-sm-12 text-center">');
  6028. if (that.options.sidePagination == 'server' && that.options.url) {
  6029. htmlBtn.push(sprintf('<button type="button" id="btnSubmitAvd%s" class="btn btn-success" >%s</button> ', "_" + that.options.idTable, searchSubmit));
  6030. htmlBtn.push(sprintf('<button type="button" id="btnResetAvd%s" class="btn btn-default" >%s</button> ', "_" + that.options.idTable, searchReset));
  6031. } else {
  6032. htmlBtn.push(sprintf('<button type="button" id="btnCloseAvd%s" data-dismiss="modal" class="btn btn-default" >%s</button> ', "_" + that.options.idTable, searchClose));
  6033. }
  6034. htmlBtn.push('</div>');
  6035. htmlBtn.push('</div>');
  6036. return htmlBtn;
  6037. };
  6038. $.extend($.fn.bootstrapTable.defaults, {
  6039. advancedSearch: false,
  6040. idForm: 'advancedSearch',
  6041. actionForm: '',
  6042. idTable: undefined,
  6043. onColumnAdvancedSearch: function (field, text) {
  6044. return false;
  6045. }
  6046. });
  6047. $.extend($.fn.bootstrapTable.defaults.icons, {
  6048. advancedSearchIcon: 'glyphicon-search'
  6049. });
  6050. $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
  6051. 'column-advanced-search.bs.table': 'onColumnAdvancedSearch'
  6052. });
  6053. $.extend($.fn.bootstrapTable.locales, {
  6054. formatAdvancedSearch: function () {
  6055. return 'Advanced search';
  6056. },
  6057. formatAdvancedSubmitButton: function () {
  6058. return "Submit";
  6059. },
  6060. formatAdvancedResetButton: function () {
  6061. return "Reset";
  6062. },
  6063. formatAdvancedCloseButton: function () {
  6064. return "Close";
  6065. }
  6066. });
  6067. $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
  6068. var BootstrapTable = $.fn.bootstrapTable.Constructor,
  6069. _initToolbar = BootstrapTable.prototype.initToolbar,
  6070. _load = BootstrapTable.prototype.load,
  6071. _initSearch = BootstrapTable.prototype.initSearch;
  6072. BootstrapTable.prototype.initToolbar = function () {
  6073. _initToolbar.apply(this, Array.prototype.slice.apply(arguments));
  6074. if (!this.options.search) {
  6075. return;
  6076. }
  6077. if (!this.options.advancedSearch) {
  6078. return;
  6079. }
  6080. if (!this.options.idTable) {
  6081. return;
  6082. }
  6083. var that = this,
  6084. html = [];
  6085. html.push(sprintf('<div class="columns columns-%s btn-group pull-%s" role="group">', this.options.buttonsAlign, this.options.buttonsAlign));
  6086. html.push(sprintf('<button class="btn btn-default%s' + '" type="button" name="advancedSearch" title="%s">', that.options.iconSize === undefined ? '' : ' btn-' + that.options.iconSize, that.options.formatAdvancedSearch()));
  6087. html.push(sprintf('<i class="%s %s"></i>', that.options.iconsPrefix, that.options.icons.advancedSearchIcon))
  6088. html.push('</button></div>');
  6089. that.$toolbar.prepend(html.join(''));
  6090. that.$toolbar.find('button[name="advancedSearch"]')
  6091. .off('click').on('click', function () {
  6092. showAvdSearch(that.columns, that);
  6093. });
  6094. };
  6095. BootstrapTable.prototype.load = function (data) {
  6096. _load.apply(this, Array.prototype.slice.apply(arguments));
  6097. if (!this.options.advancedSearch) {
  6098. return;
  6099. }
  6100. if (typeof this.options.idTable === 'undefined') {
  6101. return;
  6102. } else {
  6103. if (!firstLoad) {
  6104. var height = parseInt($(".bootstrap-table").height());
  6105. height += 10;
  6106. $("#" + this.options.idTable).bootstrapTable("resetView", {height: height});
  6107. firstLoad = true;
  6108. }
  6109. }
  6110. };
  6111. BootstrapTable.prototype.initSearch = function () {
  6112. _initSearch.apply(this, Array.prototype.slice.apply(arguments));
  6113. if (!this.options.advancedSearch) {
  6114. return;
  6115. }
  6116. var that = this;
  6117. var fp = $.isEmptyObject(this.filterColumnsPartial) ? null : this.filterColumnsPartial;
  6118. this.data = fp ? $.grep(this.data, function (item, i) {
  6119. for (var key in fp) {
  6120. var fval = fp[key].toLowerCase();
  6121. var value = item[key];
  6122. value = $.fn.bootstrapTable.utils.calculateObjectValue(that.header,
  6123. that.header.formatters[$.inArray(key, that.header.fields)],
  6124. [value, item, i], value);
  6125. if (!($.inArray(key, that.header.fields) !== -1 &&
  6126. (typeof value === 'string' || typeof value === 'number') &&
  6127. (value + '').toLowerCase().indexOf(fval) !== -1)) {
  6128. return false;
  6129. }
  6130. }
  6131. return true;
  6132. }) : this.data;
  6133. };
  6134. BootstrapTable.prototype.onColumnAdvancedSearch = function (event) {
  6135. if (typeof event == 'undefined') {
  6136. var op = {};
  6137. var filter = {};
  6138. $("#avdSearchModalContent_" + this.options.idTable + " select").each(function () {
  6139. var name = $(this).data("name");
  6140. var sym = $(this).val();
  6141. var value = $("input[name='" + name + "']").val();
  6142. if (value == '' && sym.indexOf("NULL") == -1) {
  6143. return true;
  6144. }
  6145. op[name] = sym;
  6146. filter[name] = value;
  6147. });
  6148. // 追加查询关键字
  6149. this.options.pageNumber = 1;
  6150. this.refresh({query: {filter: JSON.stringify(filter), op: JSON.stringify(op)}});
  6151. } else {
  6152. var text = $.trim($(event.currentTarget).val());
  6153. var $field = $(event.currentTarget)[0].id;
  6154. if ($.isEmptyObject(this.filterColumnsPartial)) {
  6155. this.filterColumnsPartial = {};
  6156. }
  6157. if (text) {
  6158. this.filterColumnsPartial[$field] = text;
  6159. } else {
  6160. delete this.filterColumnsPartial[$field];
  6161. }
  6162. this.options.pageNumber = 1;
  6163. this.onSearch(event);
  6164. // this.updatePagination();
  6165. this.trigger('column-advanced-search', $field, text);
  6166. }
  6167. };
  6168. }(jQuery);
  6169. define("bootstrap-table-advancedsearch", ["bootstrap-table"], (function (global) {
  6170. return function () {
  6171. var ret, fn;
  6172. return ret || global.$.fn.bootstrapTable.defaults;
  6173. };
  6174. }(this)));
  6175. define('table',['jquery', 'bootstrap', 'backend', 'config', 'toastr', 'moment', 'bootstrap-table', 'bootstrap-table-lang', 'bootstrap-table-mobile', 'bootstrap-table-export', 'bootstrap-table-advancedsearch'], function ($, undefined, Backend, Config, Toastr, Moment) {
  6176. var Table = {
  6177. list: {},
  6178. // Bootstrap-table 基础配置
  6179. defaults: {
  6180. url: '',
  6181. sidePagination: 'server',
  6182. method: 'get',
  6183. toolbar: "#toolbar",
  6184. search: true,
  6185. advancedSearch: true,
  6186. idTable: 'advancedTable',
  6187. showExport: true,
  6188. pagination: true,
  6189. clickToSelect: true,
  6190. showRefresh: false,
  6191. locale: Config.language.replace('_', '-'),
  6192. showToggle: true,
  6193. showColumns: true,
  6194. sortName: 'id',
  6195. sortOrder: 'desc',
  6196. paginationFirstText: __("First"),
  6197. paginationPreText: __("Previous"),
  6198. paginationNextText: __("Next"),
  6199. paginationLastText: __("Last"),
  6200. mobileResponsive: true,
  6201. cardView: true,
  6202. checkOnInit: true,
  6203. extend: {
  6204. index_url: '',
  6205. add_url: '',
  6206. edit_url: '',
  6207. del_url: '',
  6208. multi_url: '',
  6209. dragsort_url: 'ajax/weigh',
  6210. }
  6211. },
  6212. // Bootstrap-table 列配置
  6213. columnDefaults: {
  6214. align: 'center',
  6215. valign: 'middle',
  6216. },
  6217. config: {
  6218. firsttd: 'tbody tr td:first-child:not(:has(div.card-views))',
  6219. toolbar: '.toolbar',
  6220. refreshbtn: '.btn-refresh',
  6221. addbtn: '.btn-add',
  6222. editbtn: '.btn-edit',
  6223. delbtn: '.btn-del',
  6224. multibtn: '.btn-multi',
  6225. disabledbtn: '.btn-disabled',
  6226. editonebtn: '.btn-editone',
  6227. dragsortfield: 'weigh',
  6228. },
  6229. api: {
  6230. init: function (defaults, columnDefaults, locales) {
  6231. defaults = defaults ? defaults : {};
  6232. columnDefaults = columnDefaults ? columnDefaults : {};
  6233. locales = locales ? locales : {};
  6234. // 写入bootstrap-table默认配置
  6235. $.extend(true, $.fn.bootstrapTable.defaults, Table.defaults, defaults);
  6236. // 写入bootstrap-table column配置
  6237. $.extend($.fn.bootstrapTable.columnDefaults, Table.columnDefaults, columnDefaults);
  6238. // 写入bootstrap-table locale配置
  6239. $.extend($.fn.bootstrapTable.locales[Table.defaults.locale], {
  6240. formatAdvancedSearch: function () {
  6241. return __('Advanced search');
  6242. },
  6243. formatAdvancedSubmitButton: function () {
  6244. return __("Submit");
  6245. },
  6246. formatAdvancedResetButton: function () {
  6247. return __("Reset");
  6248. },
  6249. formatAdvancedCloseButton: function () {
  6250. return __("Close");
  6251. }
  6252. }, locales);
  6253. },
  6254. // 绑定事件
  6255. bindevent: function (table) {
  6256. //Bootstrap-table的父元素,包含table,toolbar,pagnation
  6257. var parenttable = table.closest('.bootstrap-table');
  6258. //Bootstrap-table配置
  6259. var options = table.bootstrapTable('getOptions');
  6260. //Bootstrap操作区
  6261. var toolbar = $(options.toolbar, parenttable);
  6262. //当刷新表格时
  6263. table.on('load-error.bs.table', function (status, res) {
  6264. Toastr.error(__('Unknown data format'));
  6265. });
  6266. //当刷新表格时
  6267. table.on('refresh.bs.table', function (e, settings, data) {
  6268. $(Table.config.refreshbtn, toolbar).find(".fa").addClass("fa-spin");
  6269. });
  6270. //当双击单元格时
  6271. table.on('dbl-click-row.bs.table', function (e, row, element, field) {
  6272. $(Table.config.editonebtn, element).trigger("click");
  6273. });
  6274. //当内容渲染完成后
  6275. table.on('post-body.bs.table', function (e, settings, json, xhr) {
  6276. $(Table.config.refreshbtn, toolbar).find(".fa").removeClass("fa-spin");
  6277. // 挺拽选择,需要重新绑定事件
  6278. require(['drag', 'drop'], function () {
  6279. $(Table.config.firsttd, table).drag("start", function (ev, dd) {
  6280. return $('<div class="selection" />').css('opacity', .65).appendTo(document.body);
  6281. }).drag(function (ev, dd) {
  6282. $(dd.proxy).css({
  6283. top: Math.min(ev.pageY, dd.startY),
  6284. left: Math.min(ev.pageX, dd.startX),
  6285. height: Math.abs(ev.pageY - dd.startY),
  6286. width: Math.abs(ev.pageX - dd.startX)
  6287. });
  6288. }).drag("end", function (ev, dd) {
  6289. $(dd.proxy).remove();
  6290. });
  6291. $(Table.config.firsttd, table).drop("start", function () {
  6292. Table.api.toggleattr(this);
  6293. }).drop(function () {
  6294. Table.api.toggleattr(this);
  6295. }).drop("end", function () {
  6296. Table.api.toggleattr(this);
  6297. });
  6298. $.drop({
  6299. multi: true
  6300. });
  6301. });
  6302. });
  6303. // 处理选中筛选框后按钮的状态统一变更
  6304. table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table', function () {
  6305. $(Table.config.disabledbtn, toolbar).toggleClass('disabled', !table.bootstrapTable('getSelections').length);
  6306. });
  6307. // 刷新按钮事件
  6308. $(toolbar).on('click', Table.config.refreshbtn, function () {
  6309. table.bootstrapTable('refresh');
  6310. });
  6311. // 添加按钮事件
  6312. $(toolbar).on('click', Table.config.addbtn, function () {
  6313. var ids = Table.api.selectedids(table);
  6314. Backend.api.open(options.extend.add_url + "/ids/" + ids.join(","), __('Add'));
  6315. });
  6316. // 编辑按钮事件
  6317. $(toolbar).on('click', Table.config.editbtn, function () {
  6318. var ids = Table.api.selectedids(table);
  6319. //循环弹出多个编辑框
  6320. $.each(ids, function (i, j) {
  6321. Backend.api.open(options.extend.edit_url + "/ids/" + j, __('Edit'));
  6322. });
  6323. });
  6324. // 批量操作按钮事件
  6325. $(toolbar).on('click', Table.config.multibtn, function () {
  6326. var ids = Table.api.selectedids(table);
  6327. Table.api.multi($(this).data("action"), ids, table, this);
  6328. });
  6329. // 批量删除按钮事件
  6330. $(toolbar).on('click', Table.config.delbtn, function () {
  6331. var that = this;
  6332. var ids = Table.api.selectedids(table);
  6333. var index = Backend.api.layer.confirm(
  6334. __('Are you sure you want to delete the %s selected item?', ids.length),
  6335. {icon: 3, title: __('Warning'), offset: 0, shadeClose: true},
  6336. function () {
  6337. Table.api.multi("del", ids, table, that);
  6338. Backend.api.layer.close(index);
  6339. }
  6340. );
  6341. });
  6342. // 拖拽排序
  6343. require(['dragsort'], function () {
  6344. //绑定拖动排序
  6345. $("tbody", table).dragsort({
  6346. itemSelector: 'tr',
  6347. dragSelector: "a.btn-dragsort",
  6348. dragEnd: function () {
  6349. var data = table.bootstrapTable('getData');
  6350. var current = data[parseInt($(this).data("index"))];
  6351. //改变的值和改变的ID集合
  6352. var ids = $.map($("tbody tr:visible", table), function (tr) {
  6353. return data[parseInt($(tr).data("index"))].id;
  6354. });
  6355. var changeid = current.id;
  6356. var pid = typeof current.pid != 'undefined' ? current.pid : '';
  6357. var options = {
  6358. url: table.bootstrapTable('getOptions').extend.dragsort_url,
  6359. data: {
  6360. ids: ids.join(','),
  6361. changeid: changeid,
  6362. pid: pid,
  6363. field: Table.config.dragsortfield,
  6364. orderway: table.bootstrapTable('getOptions').sortOrder,
  6365. table: table.bootstrapTable('getOptions').extend.table
  6366. }
  6367. };
  6368. Backend.api.ajax(options, function (content) {
  6369. Toastr.success(__('Operation completed'));
  6370. table.bootstrapTable('refresh');
  6371. });
  6372. },
  6373. placeHolderTemplate: ""
  6374. });
  6375. });
  6376. var id = table.attr("id");
  6377. Table.list[id] = table;
  6378. return table;
  6379. },
  6380. // 批量操作请求
  6381. multi: function (action, ids, table, element) {
  6382. var options = table.bootstrapTable('getOptions');
  6383. var url = action == "del" ? options.extend.del_url : options.extend.multi_url;
  6384. url = url + "/ids/" + ($.isArray(ids) ? ids.join(",") : ids);
  6385. var options = {url: url, data: {action: action, ids: ids, params: element ? $(element).data("params") : ''}};
  6386. Backend.api.ajax(options, function (content) {
  6387. Toastr.success(__('Operation completed'));
  6388. table.bootstrapTable('refresh');
  6389. });
  6390. },
  6391. // 单元格元素事件
  6392. events: {
  6393. operate: {
  6394. 'click .btn-editone': function (e, value, row, index) {
  6395. var options = $(this).closest('table').bootstrapTable('getOptions');
  6396. Backend.api.open(options.extend.edit_url + "/ids/" + row.id, __('Edit'));
  6397. },
  6398. 'click .btn-delone': function (e, value, row, index) {
  6399. var that = this;
  6400. var top = $(that).offset().top - $(window).scrollTop();
  6401. var left = $(that).offset().left - $(window).scrollLeft() - 260;
  6402. if (top + 154 > $(window).height()) {
  6403. top = top - 154;
  6404. }
  6405. if ($(window).width() < 480) {
  6406. top = left = undefined;
  6407. }
  6408. var index = Backend.api.layer.confirm(
  6409. __('Are you sure you want to delete this item?'),
  6410. {icon: 3, title: __('Warning'), offset: [top, left], shadeClose: true},
  6411. function () {
  6412. var table = $(that).closest('table');
  6413. Table.api.multi("del", row.id, table, that);
  6414. Backend.api.layer.close(index);
  6415. }
  6416. );
  6417. }
  6418. }
  6419. },
  6420. // 单元格数据格式化
  6421. formatter: {
  6422. icon: function (value, row, index) {
  6423. value = value.indexOf(" ") > -1 ? value : "fa fa-" + value;
  6424. //渲染fontawesome图标
  6425. return '<i class="' + value + '"></i> ' + value;
  6426. },
  6427. image: function (value, row, index) {
  6428. return '<img class="img-rounded img-sm" src="' + (value.indexOf("http") === 0 ? '' : Config.upload.cdnurl) + value + '" />';
  6429. },
  6430. status: function (value, row, index, custom) {
  6431. //颜色状态数组,可使用red/yellow/aqua/blue/navy/teal/olive/lime/fuchsia/purple/maroon
  6432. var colorArr = {normal: 'success', hidden: 'grey', deleted: 'danger', locked: 'info'};
  6433. //如果有自定义状态,可以按需传入
  6434. if (typeof custom !== 'undefined') {
  6435. colorArr = $.extend(colorArr, custom);
  6436. }
  6437. var color = value && typeof colorArr[value] !== 'undefined' ? colorArr[value] : 'primary';
  6438. value = value[0].toUpperCase() + value.substr(1);
  6439. //渲染状态
  6440. var html = '<span class="text-' + color + '"><i class="fa fa-circle"></i> ' + __(value) + '</span>';
  6441. return html;
  6442. },
  6443. url: function (value, row, index) {
  6444. return '<a href="' + value + '" target="_blank" class="label bg-green">' + value + '</a>';
  6445. },
  6446. flag: function (value, row, index) {
  6447. var flagstext = __('Flags');
  6448. var flagscolor = {t: 'red', i: 'blue', r: 'green', h: 'yellow'};
  6449. if (!value)
  6450. return value;
  6451. //渲染Flag
  6452. var html = [];
  6453. var arr = value.split(',');
  6454. arr.forEach(function (value) {
  6455. html.push('<span class="label bg-' + (typeof flagscolor[value] != 'undefined' ? flagscolor[value] : 'primary') + '">' + (typeof flagstext[value] !== 'undefined' ? flagstext[value] : '') + '</span>');
  6456. });
  6457. return html.join(' ');
  6458. },
  6459. datetime: function (value, row, index) {
  6460. return value ? Moment(parseInt(value) * 1000).format("YYYY-MM-DD HH:mm:ss") : __('None');
  6461. },
  6462. operate: function (value, row, index, table) {
  6463. var showweigh = true;
  6464. var showedit = true;
  6465. var showdel = true;
  6466. if (typeof table != 'undefined') {
  6467. var options = table.bootstrapTable('getOptions');
  6468. if (options.extend.del_url == '')
  6469. showdel = false;
  6470. if (options.extend.edit_url == '')
  6471. showedit = false;
  6472. }
  6473. showweigh = typeof row[Table.config.dragsortfield] != 'undefined' ? true : false;
  6474. //行操作
  6475. var html = [];
  6476. if (showweigh)
  6477. html.push('<a href="javascript:;" class="btn btn-primary btn-dragsort btn-xs"><i class="fa fa-arrows"></i></a>');
  6478. if (showedit)
  6479. html.push('<a href="javascript:;" class="btn btn-success btn-editone btn-xs"><i class="fa fa-pencil"></i></a>');
  6480. if (showdel)
  6481. html.push('<a href="javascript:;" class="btn btn-danger btn-delone btn-xs"><i class="fa fa-trash"></i></a>');
  6482. return html.join(' ');
  6483. }
  6484. },
  6485. // 获取选中的条目ID集合
  6486. selectedids: function (table) {
  6487. return $.map(table.bootstrapTable('getSelections'), function (row) {
  6488. return row.id
  6489. });
  6490. },
  6491. // 切换复选框状态
  6492. toggleattr: function (table) {
  6493. $("input[type='checkbox']", table).trigger('click');
  6494. }
  6495. },
  6496. };
  6497. return Table;
  6498. });
  6499. /**
  6500. * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill
  6501. * v1.5.1
  6502. *
  6503. * Copyright 2013, Moxiecode Systems AB
  6504. * Released under GPL License.
  6505. *
  6506. * License: http://www.plupload.com/license
  6507. * Contributing: http://www.plupload.com/contributing
  6508. *
  6509. * Date: 2016-11-14
  6510. */
  6511. !function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.moxie};"function"==typeof define&&define.amd?define("moxie",[],i):"object"==typeof module&&module.exports?module.exports=i():e.moxie=i()}(this||window,function(){!function(e,t){"use strict";function i(e,t){for(var i,n=[],r=0;r<e.length;++r){if(i=s[e[r]]||o(e[r]),!i)throw"module definition dependecy not found: "+e[r];n.push(i)}t.apply(null,n)}function n(e,n,r){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(n===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";i(n,function(){s[e]=r.apply(null,arguments)})}function r(e){return!!s[e]}function o(t){for(var i=e,n=t.split(/[.\/]/),r=0;r<n.length;++r){if(!i[n[r]])return;i=i[n[r]]}return i}function a(i){for(var n=0;n<i.length;n++){for(var r=e,o=i[n],a=o.split(/[.\/]/),u=0;u<a.length-1;++u)r[a[u]]===t&&(r[a[u]]={}),r=r[a[u]];r[a[a.length-1]]=s[o]}}var s={};n("moxie/core/utils/Basic",[],function(){function e(e){var t;return e===t?"undefined":null===e?"null":e.nodeType?"node":{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()}function t(){return n(!1,arguments)}function i(){return n(!0,arguments)}function n(t,i){var r,a=i[0];return o(i,function(i,s){s>0&&o(i,function(i,o){return i===r||t&&a[o]===r?!0:(e(a[o])===e(i)&&-1!==c(e(i),["array","object"])?n(t,[a[o],i]):a[o]=i,void 0)})}),a}function r(e,t){function i(){this.constructor=e}for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__parent__=t.prototype,e}function o(e,t){var i,n,r,o;if(e){try{i=e.length}catch(a){i=o}if(i===o||"number"!=typeof i){for(n in e)if(e.hasOwnProperty(n)&&t(e[n],n)===!1)return}else for(r=0;i>r;r++)if(t(e[r],r)===!1)return}}function a(t){var i;if(!t||"object"!==e(t))return!0;for(i in t)return!1;return!0}function s(t,i){function n(r){"function"===e(t[r])&&t[r](function(e){++r<o&&!e?n(r):i(e)})}var r=0,o=t.length;"function"!==e(i)&&(i=function(){}),t&&t.length||i(),n(r)}function u(e,t){var i=0,n=e.length,r=new Array(n);o(e,function(e,o){e(function(e){if(e)return t(e);var a=[].slice.call(arguments);a.shift(),r[o]=a,i++,i===n&&(r.unshift(null),t.apply(this,r))})})}function c(e,t){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e);for(var i=0,n=t.length;n>i;i++)if(t[i]===e)return i}return-1}function l(t,i){var n=[];"array"!==e(t)&&(t=[t]),"array"!==e(i)&&(i=[i]);for(var r in t)-1===c(t[r],i)&&n.push(t[r]);return n.length?n:!1}function d(e,t){var i=[];return o(e,function(e){-1!==c(e,t)&&i.push(e)}),i.length?i:null}function m(e){var t,i=[];for(t=0;t<e.length;t++)i[t]=e[t];return i}function h(e){return e?String.prototype.trim?String.prototype.trim.call(e):e.toString().replace(/^\s*/,"").replace(/\s*$/,""):e}function f(e){if("string"!=typeof e)return e;var t,i={t:1099511627776,g:1073741824,m:1048576,k:1024};return e=/^([0-9\.]+)([tmgk]?)$/.exec(e.toLowerCase().replace(/[^0-9\.tmkg]/g,"")),t=e[2],e=+e[1],i.hasOwnProperty(t)&&(e*=i[t]),Math.floor(e)}function p(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e(t)?t:""})}function g(e,t){var i=this;setTimeout(function(){e.call(i)},t||1)}var x=function(){var e=0;return function(t){var i,n=(new Date).getTime().toString(32);for(i=0;5>i;i++)n+=Math.floor(65535*Math.random()).toString(32);return(t||"o_")+n+(e++).toString(32)}}();return{guid:x,typeOf:e,extend:t,extendIf:i,inherit:r,each:o,isEmptyObj:a,inSeries:s,inParallel:u,inArray:c,arrayDiff:l,arrayIntersect:d,toArray:m,trim:h,sprintf:p,parseSizeStr:f,delay:g}}),n("moxie/core/utils/Encode",[],function(){var e=function(e){return unescape(encodeURIComponent(e))},t=function(e){return decodeURIComponent(escape(e))},i=function(e,i){if("function"==typeof window.atob)return i?t(window.atob(e)):window.atob(e);var n,r,o,a,s,u,c,l,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,h=0,f="",p=[];if(!e)return e;e+="";do a=d.indexOf(e.charAt(m++)),s=d.indexOf(e.charAt(m++)),u=d.indexOf(e.charAt(m++)),c=d.indexOf(e.charAt(m++)),l=a<<18|s<<12|u<<6|c,n=255&l>>16,r=255&l>>8,o=255&l,p[h++]=64==u?String.fromCharCode(n):64==c?String.fromCharCode(n,r):String.fromCharCode(n,r,o);while(m<e.length);return f=p.join(""),i?t(f):f},n=function(t,i){if(i&&(t=e(t)),"function"==typeof window.btoa)return window.btoa(t);var n,r,o,a,s,u,c,l,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,h=0,f="",p=[];if(!t)return t;do n=t.charCodeAt(m++),r=t.charCodeAt(m++),o=t.charCodeAt(m++),l=n<<16|r<<8|o,a=63&l>>18,s=63&l>>12,u=63&l>>6,c=63&l,p[h++]=d.charAt(a)+d.charAt(s)+d.charAt(u)+d.charAt(c);while(m<t.length);f=p.join("");var g=t.length%3;return(g?f.slice(0,g-3):f)+"===".slice(g||3)};return{utf8_encode:e,utf8_decode:t,atob:i,btoa:n}}),n("moxie/core/utils/Env",["moxie/core/utils/Basic"],function(e){function t(e,t,i){var n=0,r=0,o=0,a={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},s=function(e){return e=(""+e).replace(/[_\-+]/g,"."),e=e.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,"."),e.length?e.split("."):[-8]},u=function(e){return e?isNaN(e)?a[e]||-7:parseInt(e,10):0};for(e=s(e),t=s(t),r=Math.max(e.length,t.length),n=0;r>n;n++)if(e[n]!=t[n]){if(e[n]=u(e[n]),t[n]=u(t[n]),e[n]<t[n]){o=-1;break}if(e[n]>t[n]){o=1;break}}if(!i)return o;switch(i){case">":case"gt":return o>0;case">=":case"ge":return o>=0;case"<=":case"le":return 0>=o;case"==":case"=":case"eq":return 0===o;case"<>":case"!=":case"ne":return 0!==o;case"":case"<":case"lt":return 0>o;default:return null}}var i=function(e){var t="",i="?",n="function",r="undefined",o="object",a="name",s="version",u={has:function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()}},c={rgx:function(){for(var t,i,a,s,u,c,l,d=0,m=arguments;d<m.length;d+=2){var h=m[d],f=m[d+1];if(typeof t===r){t={};for(s in f)u=f[s],typeof u===o?t[u[0]]=e:t[u]=e}for(i=a=0;i<h.length;i++)if(c=h[i].exec(this.getUA())){for(s=0;s<f.length;s++)l=c[++a],u=f[s],typeof u===o&&u.length>0?2==u.length?t[u[0]]=typeof u[1]==n?u[1].call(this,l):u[1]:3==u.length?t[u[0]]=typeof u[1]!==n||u[1].exec&&u[1].test?l?l.replace(u[1],u[2]):e:l?u[1].call(this,l,u[2]):e:4==u.length&&(t[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):e):t[u]=l?l:e;break}if(c)break}return t},str:function(t,n){for(var r in n)if(typeof n[r]===o&&n[r].length>0){for(var a=0;a<n[r].length;a++)if(u.has(n[r][a],t))return r===i?e:r}else if(u.has(n[r],t))return r===i?e:r;return t}},l={browser:{oldsafari:{major:{1:["/8","/1","/3"],2:"/4","?":"/"},version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2000:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",RT:"ARM"}}}},d={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[a,s],[/\s(opr)\/([\w\.]+)/i],[[a,"Opera"],s],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i],[a,s],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[a,"IE"],s],[/(edge)\/((\d+)?[\w\.]+)/i],[a,s],[/(yabrowser)\/([\w\.]+)/i],[[a,"Yandex"],s],[/(comodo_dragon)\/([\w\.]+)/i],[[a,/_/g," "],s],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i],[a,s],[/(dolfin)\/([\w\.]+)/i],[[a,"Dolphin"],s],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[a,"Chrome"],s],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],[s,[a,"MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],[s,[a,"Android Browser"]],[/FBAV\/([\w\.]+);/i],[s,[a,"Facebook"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[s,[a,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[s,a],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[a,[s,c.str,l.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[a,s],[/(navigator|netscape)\/([\w\.-]+)/i],[[a,"Netscape"],s],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[a,s]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[s,[a,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[a,s],[/rv\:([\w\.]+).*(gecko)/i],[s,a]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[a,s],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[a,[s,c.str,l.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[a,"Windows"],[s,c.str,l.os.windows.version]],[/\((bb)(10);/i],[[a,"BlackBerry"],s],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[a,s],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[a,"Symbian"],s],[/\((series40);/i],[a],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[a,"Firefox OS"],s],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[a,s],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[a,"Chromium OS"],s],[/(sunos)\s?([\w\.]+\d)*/i],[[a,"Solaris"],s],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[a,s],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[a,"iOS"],[s,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[a,"Mac OS"],[s,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[a,s]]},m=function(e){var i=e||(window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:t);this.getBrowser=function(){return c.rgx.apply(this,d.browser)},this.getEngine=function(){return c.rgx.apply(this,d.engine)},this.getOS=function(){return c.rgx.apply(this,d.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS()}},this.getUA=function(){return i},this.setUA=function(e){return i=e,this},this.setUA(i)};return m}(),n=function(){var t={define_property:function(){return!1}(),create_canvas:function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))}(),return_response_type:function(t){try{if(-1!==e.inArray(t,["","text","document"]))return!0;if(window.XMLHttpRequest){var i=new XMLHttpRequest;if(i.open("get","/"),"responseType"in i)return i.responseType=t,i.responseType!==t?!1:!0}}catch(n){}return!1},use_data_uri:function(){var e=new Image;return e.onload=function(){t.use_data_uri=1===e.width&&1===e.height},setTimeout(function(){e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1}(),use_data_uri_over32kb:function(){return t.use_data_uri&&("IE"!==o.browser||o.version>=9)},use_data_uri_of:function(e){return t.use_data_uri&&33e3>e||t.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var e=document.createElement("input");return e.setAttribute("type","file"),!e.disabled}};return function(i){var n=[].slice.call(arguments);return n.shift(),"function"===e.typeOf(t[i])?t[i].apply(this,n):!!t[i]}}(),r=(new i).getResult(),o={can:n,uaParser:i,browser:r.browser.name,version:r.browser.version,os:r.os.name,osVersion:r.os.version,verComp:t,swf_url:"../flash/Moxie.swf",xap_url:"../silverlight/Moxie.xap",global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return o.OS=o.os,o}),n("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(e){function t(e,t){var i;for(i in e)if(e[i]===t)return i;return null}return{RuntimeError:function(){function i(e,i){this.code=e,this.name=t(n,e),this.message=this.name+(i||": RuntimeError "+this.code)}var n={NOT_INIT_ERR:1,EXCEPTION_ERR:3,NOT_SUPPORTED_ERR:9,JS_ERR:4};return e.extend(i,n),i.prototype=Error.prototype,i}(),OperationNotAllowedException:function(){function t(e){this.code=e,this.name="OperationNotAllowedException"}return e.extend(t,{NOT_ALLOWED_ERR:1}),t.prototype=Error.prototype,t}(),ImageError:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": ImageError "+this.code}var n={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3};return e.extend(i,n),i.prototype=Error.prototype,i}(),FileException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": FileException "+this.code}var n={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8};return e.extend(i,n),i.prototype=Error.prototype,i}(),DOMException:function(){function i(e){this.code=e,this.name=t(n,e),this.message=this.name+": DOMException "+this.code}var n={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25};return e.extend(i,n),i.prototype=Error.prototype,i}(),EventException:function(){function t(e){this.code=e,this.name="EventException"}return e.extend(t,{UNSPECIFIED_EVENT_TYPE_ERR:0}),t.prototype=Error.prototype,t}()}}),n("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(e){var t=function(e){return"string"!=typeof e?e:document.getElementById(e)},i=function(e,t){if(!e.className)return!1;var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");return i.test(e.className)},n=function(e,t){i(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},r=function(e,t){if(e.className){var i=new RegExp("(^|\\s+)"+t+"(\\s+|$)");e.className=e.className.replace(i,function(e,t,i){return" "===t&&" "===i?" ":""})}},o=function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},a=function(t,i){function n(e){var t,i,n=0,r=0;return e&&(i=e.getBoundingClientRect(),t="CSS1Compat"===c.compatMode?c.documentElement:c.body,n=i.left+t.scrollLeft,r=i.top+t.scrollTop),{x:n,y:r}}var r,o,a,s=0,u=0,c=document;if(t=t,i=i||c.body,t&&t.getBoundingClientRect&&"IE"===e.browser&&(!c.documentMode||c.documentMode<8))return o=n(t),a=n(i),{x:o.x-a.x,y:o.y-a.y};for(r=t;r&&r!=i&&r.nodeType;)s+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!=i&&r.nodeType;)s-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;return{x:s,y:u}},s=function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}};return{get:t,hasClass:i,addClass:n,removeClass:r,getStyle:o,getPos:a,getSize:s}}),n("moxie/core/EventTarget",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(e,t,i){function n(){this.uid=i.guid()}var r={};return i.extend(n.prototype,{init:function(){this.uid||(this.uid=i.guid("uid_"))},addEventListener:function(e,t,n,o){var a,s=this;return this.hasOwnProperty("uid")||(this.uid=i.guid("uid_")),e=i.trim(e),/\s/.test(e)?(i.each(e.split(/\s+/),function(e){s.addEventListener(e,t,n,o)}),void 0):(e=e.toLowerCase(),n=parseInt(n,10)||0,a=r[this.uid]&&r[this.uid][e]||[],a.push({fn:t,priority:n,scope:o||this}),r[this.uid]||(r[this.uid]={}),r[this.uid][e]=a,void 0)},hasEventListener:function(e){var t=e?r[this.uid]&&r[this.uid][e]:r[this.uid];return t?t:!1},removeEventListener:function(e,t){var n,o,a=this;if(e=e.toLowerCase(),/\s/.test(e))return i.each(e.split(/\s+/),function(e){a.removeEventListener(e,t)}),void 0;if(n=r[this.uid]&&r[this.uid][e]){if(t){for(o=n.length-1;o>=0;o--)if(n[o].fn===t){n.splice(o,1);break}}else n=[];n.length||(delete r[this.uid][e],i.isEmptyObj(r[this.uid])&&delete r[this.uid])}},removeAllEventListeners:function(){r[this.uid]&&delete r[this.uid]},dispatchEvent:function(e){var n,o,a,s,u,c={},l=!0;if("string"!==i.typeOf(e)){if(s=e,"string"!==i.typeOf(s.type))throw new t.EventException(t.EventException.UNSPECIFIED_EVENT_TYPE_ERR);e=s.type,s.total!==u&&s.loaded!==u&&(c.total=s.total,c.loaded=s.loaded),c.async=s.async||!1}if(-1!==e.indexOf("::")?function(t){n=t[0],e=t[1]}(e.split("::")):n=this.uid,e=e.toLowerCase(),o=r[n]&&r[n][e]){o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),c.type=e,a.unshift(c);var d=[];i.each(o,function(e){a[0].target=e.scope,c.async?d.push(function(t){setTimeout(function(){t(e.fn.apply(e.scope,a)===!1)},1)}):d.push(function(t){t(e.fn.apply(e.scope,a)===!1)})}),d.length&&i.inSeries(d,function(e){l=!e})}return l},bindOnce:function(e,t,i,n){var r=this;r.bind.call(this,e,function o(){return r.unbind(e,o),t.apply(this,arguments)},i,n)},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(e){var t=this;this.bind(e.join(" "),function(e){var t="on"+e.type.toLowerCase();"function"===i.typeOf(this[t])&&this[t].apply(this,arguments)}),i.each(e,function(e){e="on"+e.toLowerCase(e),"undefined"===i.typeOf(t[e])&&(t[e]=null)})}}),n.instance=new n,n}),n("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(e,t,i,n){function r(e,n,o,s,u){var c,l=this,d=t.guid(n+"_"),m=u||"browser";e=e||{},a[d]=this,o=t.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},o),e.preferred_caps&&(m=r.getMode(s,e.preferred_caps,m)),c=function(){var e={};return{exec:function(t,i,n,r){return c[i]&&(e[t]||(e[t]={context:this,instance:new c[i]}),e[t].instance[n])?e[t].instance[n].apply(this,r):void 0},removeInstance:function(t){delete e[t]},removeAllInstances:function(){var i=this;t.each(e,function(e,n){"function"===t.typeOf(e.instance.destroy)&&e.instance.destroy.call(e.context),i.removeInstance(n)})}}}(),t.extend(this,{initialized:!1,uid:d,type:n,mode:r.getMode(s,e.required_caps,m),shimid:d+"_container",clients:0,options:e,can:function(e,i){var n=arguments[2]||o;if("string"===t.typeOf(e)&&"undefined"===t.typeOf(i)&&(e=r.parseCaps(e)),"object"===t.typeOf(e)){for(var a in e)if(!this.can(a,e[a],n))return!1;return!0}return"function"===t.typeOf(n[e])?n[e].call(this,i):i===n[e]},getShimContainer:function(){var e,n=i.get(this.shimid);return n||(e=i.get(this.options.container)||document.body,n=document.createElement("div"),n.id=this.shimid,n.className="moxie-shim moxie-shim-"+this.type,t.extend(n.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),e.appendChild(n),e=null),n},getShim:function(){return c},shimExec:function(e,t){var i=[].slice.call(arguments,2);return l.getShim().exec.call(this,this.uid,e,t,i)},exec:function(e,t){var i=[].slice.call(arguments,2);return l[e]&&l[e][t]?l[e][t].apply(this,i):l.shimExec.apply(this,arguments)},destroy:function(){if(l){var e=i.get(this.shimid);e&&e.parentNode.removeChild(e),c&&c.removeAllInstances(),this.unbindAll(),delete a[this.uid],this.uid=null,d=l=c=e=null}}}),this.mode&&e.required_caps&&!this.can(e.required_caps)&&(this.mode=!1)}var o={},a={};return r.order="html5,flash,silverlight,html4",r.getRuntime=function(e){return a[e]?a[e]:!1},r.addConstructor=function(e,t){t.prototype=n.instance,o[e]=t},r.getConstructor=function(e){return o[e]||null},r.getInfo=function(e){var t=r.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},r.parseCaps=function(e){var i={};return"string"!==t.typeOf(e)?e||{}:(t.each(e.split(","),function(e){i[e]=!0}),i)},r.can=function(e,t){var i,n,o=r.getConstructor(e);return o?(i=new o({required_caps:t}),n=i.mode,i.destroy(),!!n):!1},r.thatCan=function(e,t){var i=(t||r.order).split(/\s*,\s*/);for(var n in i)if(r.can(i[n],e))return i[n];return null},r.getMode=function(e,i,n){var r=null;if("undefined"===t.typeOf(n)&&(n="browser"),i&&!t.isEmptyObj(e)){if(t.each(i,function(i,n){if(e.hasOwnProperty(n)){var o=e[n](i);if("string"==typeof o&&(o=[o]),r){if(!(r=t.arrayIntersect(r,o)))return r=!1}else r=o}}),r)return-1!==t.inArray(n,r)?n:r[0];if(r===!1)return!1}return n},r.capTrue=function(){return!0},r.capFalse=function(){return!1},r.capTest=function(e){return function(){return!!e}},r}),n("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(e,t,i,n){return function(){var e;i.extend(this,{connectRuntime:function(r){function o(i){var a,u;return i.length?(a=i.shift().toLowerCase(),(u=n.getConstructor(a))?(e=new u(r),e.bind("Init",function(){e.initialized=!0,setTimeout(function(){e.clients++,s.ruid=e.uid,s.trigger("RuntimeInit",e)},1)}),e.bind("Error",function(){e.destroy(),o(i)}),e.bind("Exception",function(e,i){var n=i.name+"(#"+i.code+")"+(i.message?", from: "+i.message:"");s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.EXCEPTION_ERR,n))}),e.mode?(e.init(),void 0):(e.trigger("Error"),void 0)):(o(i),void 0)):(s.trigger("RuntimeError",new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)),e=null,void 0)}var a,s=this;if("string"===i.typeOf(r)?a=r:"string"===i.typeOf(r.ruid)&&(a=r.ruid),a){if(e=n.getRuntime(a))return s.ruid=a,e.clients++,e;throw new t.RuntimeError(t.RuntimeError.NOT_INIT_ERR)}o((r.runtime_order||n.order).split(/\s*,\s*/))},disconnectRuntime:function(){e&&--e.clients<=0&&e.destroy(),e=null},getRuntime:function(){return e&&e.uid?e:e=null},exec:function(){return e?e.exec.apply(this,arguments):null},can:function(t){return e?e.can(t):!1}})}}),n("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(e,t,i){function n(o,a){function s(t,i,o){var a,s=r[this.uid];return"string"===e.typeOf(s)&&s.length?(a=new n(null,{type:o,size:i-t}),a.detach(s.substr(t,a.size)),a):null}i.call(this),o&&this.connectRuntime(o),a?"string"===e.typeOf(a)&&(a={data:a}):a={},e.extend(this,{uid:a.uid||e.guid("uid_"),ruid:o,size:a.size||0,type:a.type||"",slice:function(e,t,i){return this.isDetached()?s.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,i)},getSource:function(){return r[this.uid]?r[this.uid]:null},detach:function(e){if(this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),e=e||"","data:"==e.substr(0,5)){var i=e.indexOf(";base64,");this.type=e.substring(5,i),e=t.atob(e.substring(i+8))}this.size=e.length,r[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===e.typeOf(r[this.uid])},destroy:function(){this.detach(),delete r[this.uid]}}),a.data?this.detach(a.data):r[this.uid]=a}var r={};return n}),n("moxie/core/I18n",["moxie/core/utils/Basic"],function(e){var t={};return{addI18n:function(i){return e.extend(t,i)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(t){var i=[].slice.call(arguments,1);return t.replace(/%[a-z]/g,function(){var t=i.shift();return"undefined"!==e.typeOf(t)?t:""})}}}),n("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(e,t){var i="application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe",n={mimes:{},extensions:{},addMimeType:function(e){var t,i,n,r=e.split(/,/);for(t=0;t<r.length;t+=2){for(n=r[t+1].split(/ /),i=0;i<n.length;i++)this.mimes[n[i]]=r[t];this.extensions[r[t]]=n}},extList2mimes:function(t,i){var n,r,o,a,s=this,u=[];for(r=0;r<t.length;r++)for(n=t[r].extensions.split(/\s*,\s*/),o=0;o<n.length;o++){if("*"===n[o])return[];if(a=s.mimes[n[o]],a&&-1===e.inArray(a,u)&&u.push(a),i&&/^\w+$/.test(n[o]))u.push("."+n[o]);else if(!a)return[]}return u},mimes2exts:function(t){var i=this,n=[];return e.each(t,function(t){if("*"===t)return n=[],!1;var r=t.match(/^(\w+)\/(\*|\w+)$/);r&&("*"===r[2]?e.each(i.extensions,function(e,t){new RegExp("^"+r[1]+"/").test(t)&&[].push.apply(n,i.extensions[t])}):i.extensions[t]&&[].push.apply(n,i.extensions[t]))}),n},mimes2extList:function(i){var n=[],r=[];return"string"===e.typeOf(i)&&(i=e.trim(i).split(/\s*,\s*/)),r=this.mimes2exts(i),n.push({title:t.translate("Files"),extensions:r.length?r.join(","):"*"}),n.mimes=i,n},getFileExtension:function(e){var t=e&&e.match(/\.([^.]+)$/);return t?t[1].toLowerCase():""},getFileMime:function(e){return this.mimes[this.getFileExtension(e)]||""}};return n.addMimeType(i),n}),n("moxie/file/FileInput",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/I18n","moxie/runtime/Runtime","moxie/runtime/RuntimeClient"],function(e,t,i,n,r,o,a,s,u){function c(t){var o,c,d;if(-1!==e.inArray(e.typeOf(t),["string","node"])&&(t={browse_button:t}),c=n.get(t.browse_button),!c)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR);d={accept:[{title:a.translate("All Files"),extensions:"*"}],multiple:!1,required_caps:!1,container:c.parentNode||document.body},t=e.extend({},d,t),"string"==typeof t.required_caps&&(t.required_caps=s.parseCaps(t.required_caps)),"string"==typeof t.accept&&(t.accept=i.mimes2extList(t.accept)),o=n.get(t.container),o||(o=document.body),"static"===n.getStyle(o,"position")&&(o.style.position="relative"),o=c=null,u.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,shimid:null,files:null,init:function(){var i=this;i.bind("RuntimeInit",function(r,o){i.ruid=o.uid,i.shimid=o.shimid,i.bind("Ready",function(){i.trigger("Refresh")},999),i.bind("Refresh",function(){var i,r,a,s,u;a=n.get(t.browse_button),s=n.get(o.shimid),a&&(i=n.getPos(a,n.get(t.container)),r=n.getSize(a),u=parseInt(n.getStyle(a,"z-index"),10)||0,s&&e.extend(s.style,{top:i.y+"px",left:i.x+"px",width:r.w+"px",height:r.h+"px",zIndex:u+1})),s=a=null}),o.exec.call(i,"FileInput","init",t)}),i.connectRuntime(e.extend({},t,{required_caps:{select_file:!0}}))},getOption:function(e){return t[e]},setOption:function(e,n){if(t.hasOwnProperty(e)){var o=t[e];switch(e){case"accept":"string"==typeof n&&(n=i.mimes2extList(n));break;case"container":case"required_caps":throw new r.FileException(r.FileException.NO_MODIFICATION_ALLOWED_ERR)}t[e]=n,this.exec("FileInput","setOption",e,n),this.trigger("OptionChanged",e,n,o)}},disable:function(t){var i=this.getRuntime();i&&this.exec("FileInput","disable","undefined"===e.typeOf(t)?!0:t)},refresh:function(){this.trigger("Refresh")},destroy:function(){var t=this.getRuntime();t&&(t.exec.call(this,"FileInput","destroy"),this.disconnectRuntime()),"array"===e.typeOf(this.files)&&e.each(this.files,function(e){e.destroy()}),this.files=null,this.unbindAll()}}),this.handleEventProps(l)}var l=["ready","change","cancel","mouseenter","mouseleave","mousedown","mouseup"];return c.prototype=o.instance,c}),n("moxie/file/File",["moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/file/Blob"],function(e,t,i){function n(n,r){r||(r={}),i.apply(this,arguments),this.type||(this.type=t.getFileMime(r.name));var o;if(r.name)o=r.name.replace(/\\/g,"/"),o=o.substr(o.lastIndexOf("/")+1);else if(this.type){var a=this.type.split("/")[0];o=e.guid((""!==a?a:"file")+"_"),t.extensions[this.type]&&(o+="."+t.extensions[this.type][0])}e.extend(this,{name:o||e.guid("file_"),relativePath:"",lastModifiedDate:r.lastModifiedDate||(new Date).toLocaleString()})}return n.prototype=i.prototype,n}),n("moxie/file/FileDrop",["moxie/core/I18n","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/core/utils/Env","moxie/file/File","moxie/runtime/RuntimeClient","moxie/core/EventTarget","moxie/core/utils/Mime"],function(e,t,i,n,r,o,a,s,u){function c(i){var r,o=this;"string"==typeof i&&(i={drop_zone:i}),r={accept:[{title:e.translate("All Files"),extensions:"*"}],required_caps:{drag_and_drop:!0}},i="object"==typeof i?n.extend({},r,i):r,i.container=t.get(i.drop_zone)||document.body,"static"===t.getStyle(i.container,"position")&&(i.container.style.position="relative"),"string"==typeof i.accept&&(i.accept=u.mimes2extList(i.accept)),a.call(o),n.extend(o,{uid:n.guid("uid_"),ruid:null,files:null,init:function(){o.bind("RuntimeInit",function(e,t){o.ruid=t.uid,t.exec.call(o,"FileDrop","init",i),o.dispatchEvent("ready")}),o.connectRuntime(i)},destroy:function(){var e=this.getRuntime();e&&(e.exec.call(this,"FileDrop","destroy"),this.disconnectRuntime()),this.files=null,this.unbindAll()}}),this.handleEventProps(l)}var l=["ready","dragenter","dragleave","drop","error"];return c.prototype=s.instance,c}),n("moxie/file/FileReader",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/Exceptions","moxie/core/EventTarget","moxie/file/Blob","moxie/runtime/RuntimeClient"],function(e,t,i,n,r,o){function a(){function n(e,n){if(this.trigger("loadstart"),this.readyState===a.LOADING)return this.trigger("error",new i.DOMException(i.DOMException.INVALID_STATE_ERR)),this.trigger("loadend"),void 0;if(!(n instanceof r))return this.trigger("error",new i.DOMException(i.DOMException.NOT_FOUND_ERR)),this.trigger("loadend"),void 0;
  6512. if(this.result=null,this.readyState=a.LOADING,n.isDetached()){var o=n.getSource();switch(e){case"readAsText":case"readAsBinaryString":this.result=o;break;case"readAsDataURL":this.result="data:"+n.type+";base64,"+t.btoa(o)}this.readyState=a.DONE,this.trigger("load"),this.trigger("loadend")}else this.connectRuntime(n.ruid),this.exec("FileReader","read",e,n)}o.call(this),e.extend(this,{uid:e.guid("uid_"),readyState:a.EMPTY,result:null,error:null,readAsBinaryString:function(e){n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){n.call(this,"readAsDataURL",e)},readAsText:function(e){n.call(this,"readAsText",e)},abort:function(){this.result=null,-1===e.inArray(this.readyState,[a.EMPTY,a.DONE])&&(this.readyState===a.LOADING&&(this.readyState=a.DONE),this.exec("FileReader","abort"),this.trigger("abort"),this.trigger("loadend"))},destroy:function(){this.abort(),this.exec("FileReader","destroy"),this.disconnectRuntime(),this.unbindAll()}}),this.handleEventProps(s),this.bind("Error",function(e,t){this.readyState=a.DONE,this.error=t},999),this.bind("Load",function(){this.readyState=a.DONE},999)}var s=["loadstart","progress","load","abort","error","loadend"];return a.EMPTY=0,a.LOADING=1,a.DONE=2,a.prototype=n.instance,a}),n("moxie/core/utils/Url",[],function(){var e=function(t,i){for(var n=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],r=n.length,o={http:80,https:443},a={},s=/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,u=s.exec(t||"");r--;)u[r]&&(a[n[r]]=u[r]);if(!a.scheme){i&&"string"!=typeof i||(i=e(i||document.location.href)),a.scheme=i.scheme,a.host=i.host,a.port=i.port;var c="";/^[^\/]/.test(a.path)&&(c=i.path,c=/\/[^\/]*\.[^\/]*$/.test(c)?c.replace(/\/[^\/]+$/,"/"):c.replace(/\/?$/,"/")),a.path=c+(a.path||"")}return a.port||(a.port=o[a.scheme]||80),a.port=parseInt(a.port,10),a.path||(a.path="/"),delete a.source,a},t=function(t){var i={http:80,https:443},n="object"==typeof t?t:e(t);return n.scheme+"://"+n.host+(n.port!==i[n.scheme]?":"+n.port:"")+n.path+(n.query?n.query:"")},i=function(t){function i(e){return[e.scheme,e.host,e.port].join("/")}return"string"==typeof t&&(t=e(t)),i(e())===i(t)};return{parseUrl:e,resolveUrl:t,hasSameOrigin:i}}),n("moxie/runtime/RuntimeTarget",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i){function n(){this.uid=e.guid("uid_"),t.call(this),this.destroy=function(){this.disconnectRuntime(),this.unbindAll()}}return n.prototype=i.instance,n}),n("moxie/file/FileReaderSync",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/utils/Encode"],function(e,t,i){return function(){function n(e,t){if(!t.isDetached()){var n=this.connectRuntime(t.ruid).exec.call(this,"FileReaderSync","read",e,t);return this.disconnectRuntime(),n}var r=t.getSource();switch(e){case"readAsBinaryString":return r;case"readAsDataURL":return"data:"+t.type+";base64,"+i.btoa(r);case"readAsText":for(var o="",a=0,s=r.length;s>a;a++)o+=String.fromCharCode(r[a]);return o}}t.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return n.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return n.call(this,"readAsDataURL",e)},readAsText:function(e){return n.call(this,"readAsText",e)}})}}),n("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(e,t,i){function n(){var e,n=[];t.extend(this,{append:function(r,o){var a=this,s=t.typeOf(o);o instanceof i?e={name:r,value:o}:"array"===s?(r+="[]",t.each(o,function(e){a.append(r,e)})):"object"===s?t.each(o,function(e,t){a.append(r+"["+t+"]",e)}):"null"===s||"undefined"===s||"number"===s&&isNaN(o)?a.append(r,"false"):n.push({name:r,value:o.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return e&&e.value||null},getBlobName:function(){return e&&e.name||null},each:function(i){t.each(n,function(e){i(e.value,e.name)}),e&&i(e.value,e.name)},destroy:function(){e=null,n=[]}})}return n}),n("moxie/xhr/XMLHttpRequest",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/Runtime","moxie/runtime/RuntimeTarget","moxie/file/Blob","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/core/utils/Env","moxie/core/utils/Mime"],function(e,t,i,n,r,o,a,s,u,c,l,d){function m(){this.uid=e.guid("uid_")}function h(){function i(e,t){return I.hasOwnProperty(e)?1===arguments.length?l.can("define_property")?I[e]:A[e]:(l.can("define_property")?I[e]=t:A[e]=t,void 0):void 0}function u(t){function n(){R&&(R.destroy(),R=null),s.dispatchEvent("loadend"),s=null}function r(r){R.bind("LoadStart",function(e){i("readyState",h.LOADING),s.dispatchEvent("readystatechange"),s.dispatchEvent(e),L&&s.upload.dispatchEvent(e)}),R.bind("Progress",function(e){i("readyState")!==h.LOADING&&(i("readyState",h.LOADING),s.dispatchEvent("readystatechange")),s.dispatchEvent(e)}),R.bind("UploadProgress",function(e){L&&s.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),R.bind("Load",function(t){i("readyState",h.DONE),i("status",Number(r.exec.call(R,"XMLHttpRequest","getStatus")||0)),i("statusText",f[i("status")]||""),i("response",r.exec.call(R,"XMLHttpRequest","getResponse",i("responseType"))),~e.inArray(i("responseType"),["text",""])?i("responseText",i("response")):"document"===i("responseType")&&i("responseXML",i("response")),U=r.exec.call(R,"XMLHttpRequest","getAllResponseHeaders"),s.dispatchEvent("readystatechange"),i("status")>0?(L&&s.upload.dispatchEvent(t),s.dispatchEvent(t)):(F=!0,s.dispatchEvent("error")),n()}),R.bind("Abort",function(e){s.dispatchEvent(e),n()}),R.bind("Error",function(e){F=!0,i("readyState",h.DONE),s.dispatchEvent("readystatechange"),M=!0,s.dispatchEvent(e),n()}),r.exec.call(R,"XMLHttpRequest","send",{url:x,method:v,async:T,user:y,password:w,headers:S,mimeType:D,encoding:O,responseType:s.responseType,withCredentials:s.withCredentials,options:k},t)}var s=this;E=(new Date).getTime(),R=new a,"string"==typeof k.required_caps&&(k.required_caps=o.parseCaps(k.required_caps)),k.required_caps=e.extend({},k.required_caps,{return_response_type:s.responseType}),t instanceof c&&(k.required_caps.send_multipart=!0),e.isEmptyObj(S)||(k.required_caps.send_custom_headers=!0),B||(k.required_caps.do_cors=!0),k.ruid?r(R.connectRuntime(k)):(R.bind("RuntimeInit",function(e,t){r(t)}),R.bind("RuntimeError",function(e,t){s.dispatchEvent("RuntimeError",t)}),R.connectRuntime(k))}function g(){i("responseText",""),i("responseXML",null),i("response",null),i("status",0),i("statusText",""),E=b=null}var x,v,y,w,E,b,R,_,A=this,I={timeout:0,readyState:h.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},T=!0,S={},O=null,D=null,N=!1,C=!1,L=!1,M=!1,F=!1,B=!1,P=null,H=null,k={},U="";e.extend(this,I,{uid:e.guid("uid_"),upload:new m,open:function(o,a,s,u,c){var l;if(!o||!a)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(o)||n.utf8_encode(o)!==o)throw new t.DOMException(t.DOMException.SYNTAX_ERR);if(~e.inArray(o.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(v=o.toUpperCase()),~e.inArray(v,["CONNECT","TRACE","TRACK"]))throw new t.DOMException(t.DOMException.SECURITY_ERR);if(a=n.utf8_encode(a),l=r.parseUrl(a),B=r.hasSameOrigin(l),x=r.resolveUrl(a),(u||c)&&!B)throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);if(y=u||l.user,w=c||l.pass,T=s||!0,T===!1&&(i("timeout")||i("withCredentials")||""!==i("responseType")))throw new t.DOMException(t.DOMException.INVALID_ACCESS_ERR);N=!T,C=!1,S={},g.call(this),i("readyState",h.OPENED),this.dispatchEvent("readystatechange")},setRequestHeader:function(r,o){var a=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"];if(i("readyState")!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(r)||n.utf8_encode(r)!==r)throw new t.DOMException(t.DOMException.SYNTAX_ERR);return r=e.trim(r).toLowerCase(),~e.inArray(r,a)||/^(proxy\-|sec\-)/.test(r)?!1:(S[r]?S[r]+=", "+o:S[r]=o,!0)},getAllResponseHeaders:function(){return U||""},getResponseHeader:function(t){return t=t.toLowerCase(),F||~e.inArray(t,["set-cookie","set-cookie2"])?null:U&&""!==U&&(_||(_={},e.each(U.split(/\r\n/),function(t){var i=t.split(/:\s+/);2===i.length&&(i[0]=e.trim(i[0]),_[i[0].toLowerCase()]={header:i[0],value:e.trim(i[1])})})),_.hasOwnProperty(t))?_[t].header+": "+_[t].value:null},overrideMimeType:function(n){var r,o;if(~e.inArray(i("readyState"),[h.LOADING,h.DONE]))throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(n=e.trim(n.toLowerCase()),/;/.test(n)&&(r=n.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(n=r[1],r[2]&&(o=r[2])),!d.mimes[n])throw new t.DOMException(t.DOMException.SYNTAX_ERR);P=n,H=o},send:function(i,r){if(k="string"===e.typeOf(r)?{ruid:r}:r?r:{},this.readyState!==h.OPENED||C)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);if(i instanceof s)k.ruid=i.ruid,D=i.type||"application/octet-stream";else if(i instanceof c){if(i.hasBlob()){var o=i.getBlob();k.ruid=o.ruid,D=o.type||"application/octet-stream"}}else"string"==typeof i&&(O="UTF-8",D="text/plain;charset=UTF-8",i=n.utf8_encode(i));this.withCredentials||(this.withCredentials=k.required_caps&&k.required_caps.send_browser_cookies&&!B),L=!N&&this.upload.hasEventListener(),F=!1,M=!i,N||(C=!0),u.call(this,i)},abort:function(){if(F=!0,N=!1,~e.inArray(i("readyState"),[h.UNSENT,h.OPENED,h.DONE]))i("readyState",h.UNSENT);else{if(i("readyState",h.DONE),C=!1,!R)throw new t.DOMException(t.DOMException.INVALID_STATE_ERR);R.getRuntime().exec.call(R,"XMLHttpRequest","abort",M),M=!0}},destroy:function(){R&&("function"===e.typeOf(R.destroy)&&R.destroy(),R=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}}),this.handleEventProps(p.concat(["readystatechange"])),this.upload.handleEventProps(p)}var f={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};m.prototype=i.instance;var p=["loadstart","progress","abort","error","load","timeout","loadend"];return h.UNSENT=0,h.OPENED=1,h.HEADERS_RECEIVED=2,h.LOADING=3,h.DONE=4,h.prototype=i.instance,h}),n("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i,n){function r(){function n(){l=d=0,c=this.result=null}function o(t,i){var n=this;u=i,n.bind("TransportingProgress",function(t){d=t.loaded,l>d&&-1===e.inArray(n.state,[r.IDLE,r.DONE])&&a.call(n)},999),n.bind("TransportingComplete",function(){d=l,n.state=r.DONE,c=null,n.result=u.exec.call(n,"Transporter","getAsBlob",t||"")},999),n.state=r.BUSY,n.trigger("TransportingStarted"),a.call(n)}function a(){var e,i=this,n=l-d;m>n&&(m=n),e=t.btoa(c.substr(d,m)),u.exec.call(i,"Transporter","receive",e,l)}var s,u,c,l,d,m;i.call(this),e.extend(this,{uid:e.guid("uid_"),state:r.IDLE,result:null,transport:function(t,i,r){var a=this;if(r=e.extend({chunk_size:204798},r),(s=r.chunk_size%3)&&(r.chunk_size+=3-s),m=r.chunk_size,n.call(this),c=t,l=t.length,"string"===e.typeOf(r)||r.ruid)o.call(a,i,this.connectRuntime(r));else{var u=function(e,t){a.unbind("RuntimeInit",u),o.call(a,i,t)};this.bind("RuntimeInit",u),this.connectRuntime(r)}},abort:function(){var e=this;e.state=r.IDLE,u&&(u.exec.call(e,"Transporter","clear"),e.trigger("TransportingAborted")),n.call(e)},destroy:function(){this.unbindAll(),u=null,this.disconnectRuntime(),n.call(this)}})}return r.IDLE=0,r.BUSY=1,r.DONE=2,r.prototype=n.instance,r}),n("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(e,t,i,n,r,o,a,s,u,c,l,d,m){function h(){function n(e){e||(e=this.exec("Image","getInfo")),this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name)}function c(t){var n=e.typeOf(t);try{if(t instanceof h){if(!t.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);p.apply(this,arguments)}else if(t instanceof l){if(!~e.inArray(t.type,["image/jpeg","image/png"]))throw new i.ImageError(i.ImageError.WRONG_FORMAT);g.apply(this,arguments)}else if(-1!==e.inArray(n,["blob","file"]))c.call(this,new d(null,t),arguments[1]);else if("string"===n)"data:"===t.substr(0,5)?c.call(this,new l(null,{data:t}),arguments[1]):x.apply(this,arguments);else{if("node"!==n||"img"!==t.nodeName.toLowerCase())throw new i.DOMException(i.DOMException.TYPE_MISMATCH_ERR);c.call(this,t.src,arguments[1])}}catch(r){this.trigger("error",r.code)}}function p(t,i){var n=this.connectRuntime(t.ruid);this.ruid=n.uid,n.exec.call(this,"Image","loadFromImage",t,"undefined"===e.typeOf(i)?!0:i)}function g(t,i){function n(e){r.ruid=e.uid,e.exec.call(r,"Image","loadFromBlob",t)}var r=this;r.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){n(t)}),i&&"string"==typeof i.required_caps&&(i.required_caps=o.parseCaps(i.required_caps)),this.connectRuntime(e.extend({required_caps:{access_image_binary:!0,resize_image:!0}},i))):n(this.connectRuntime(t.ruid))}function x(e,t){var i,n=this;i=new r,i.open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){g.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}a.call(this),e.extend(this,{uid:e.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){c.apply(this,arguments)},resize:function(t){var n,r,o=this,a={x:0,y:0,width:o.width,height:o.height},s=e.extendIf({width:o.width,height:o.height,type:o.type||"image/jpeg",quality:90,crop:!1,fit:!0,preserveHeaders:!0,resample:"default",multipass:!0},t);try{if(!o.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);if(o.width>h.MAX_RESIZE_WIDTH||o.height>h.MAX_RESIZE_HEIGHT)throw new i.ImageError(i.ImageError.MAX_RESOLUTION_ERR);if(n=o.meta&&o.meta.tiff&&o.meta.tiff.Orientation||1,-1!==e.inArray(n,[5,6,7,8])){var u=s.width;s.width=s.height,s.height=u}if(s.crop){switch(r=Math.max(s.width/o.width,s.height/o.height),t.fit?(a.width=Math.min(Math.ceil(s.width/r),o.width),a.height=Math.min(Math.ceil(s.height/r),o.height),r=s.width/a.width):(a.width=Math.min(s.width,o.width),a.height=Math.min(s.height,o.height),r=1),"boolean"==typeof s.crop&&(s.crop="cc"),s.crop.toLowerCase().replace(/_/,"-")){case"rb":case"right-bottom":a.x=o.width-a.width,a.y=o.height-a.height;break;case"cb":case"center-bottom":a.x=Math.floor((o.width-a.width)/2),a.y=o.height-a.height;break;case"lb":case"left-bottom":a.x=0,a.y=o.height-a.height;break;case"lt":case"left-top":a.x=0,a.y=0;break;case"ct":case"center-top":a.x=Math.floor((o.width-a.width)/2),a.y=0;break;case"rt":case"right-top":a.x=o.width-a.width,a.y=0;break;case"rc":case"right-center":case"right-middle":a.x=o.width-a.width,a.y=Math.floor((o.height-a.height)/2);break;case"lc":case"left-center":case"left-middle":a.x=0,a.y=Math.floor((o.height-a.height)/2);break;case"cc":case"center-center":case"center-middle":default:a.x=Math.floor((o.width-a.width)/2),a.y=Math.floor((o.height-a.height)/2)}a.x=Math.max(a.x,0),a.y=Math.max(a.y,0)}else r=Math.min(s.width/o.width,s.height/o.height);this.exec("Image","resize",a,r,s)}catch(c){o.trigger("error",c.code)}},downsize:function(t){var i,n={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:!1,preserveHeaders:!0,resample:"default"};i="object"==typeof t?e.extend(n,t):e.extend(n,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]}),this.resize(i)},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(!u.can("create_canvas"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);var e=this.connectRuntime(this.ruid);return e.exec.call(this,"Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){var i=this.getAsDataURL(e,t);return m.atob(i.substring(i.indexOf("base64,")+7))},embed:function(n,r){function o(t,r){var o=this;if(u.can("create_canvas")){var l=o.getAsCanvas();if(l)return n.appendChild(l),l=null,o.destroy(),c.trigger("embedded"),void 0}var d=o.getAsDataURL(t,r);if(!d)throw new i.ImageError(i.ImageError.WRONG_FORMAT);if(u.can("use_data_uri_of",d.length))n.innerHTML='<img src="'+d+'" width="'+o.width+'" height="'+o.height+'" />',o.destroy(),c.trigger("embedded");else{var h=new s;h.bind("TransportingComplete",function(){a=c.connectRuntime(this.result.ruid),c.bind("Embedded",function(){e.extend(a.getShimContainer().style,{top:"0px",left:"0px",width:o.width+"px",height:o.height+"px"}),a=null},999),a.exec.call(c,"ImageView","display",this.result.uid,width,height),o.destroy()}),h.transport(m.atob(d.substring(d.indexOf("base64,")+7)),t,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:n})}}var a,c=this,l=e.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90},r);try{if(!(n=t.get(n)))throw new i.DOMException(i.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new i.DOMException(i.DOMException.INVALID_STATE_ERR);this.width>h.MAX_RESIZE_WIDTH||this.height>h.MAX_RESIZE_HEIGHT;var d=new h;return d.bind("Resize",function(){o.call(this,l.type,l.quality)}),d.bind("Load",function(){d.downsize(l)}),this.meta.thumb&&this.meta.thumb.width>=l.width&&this.meta.thumb.height>=l.height?d.load(this.meta.thumb.data):d.clone(this,!1),d}catch(f){this.trigger("error",f.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}}),this.handleEventProps(f),this.bind("Load Resize",function(){n.call(this)},999)}var f=["progress","load","error","resize","embedded"];return h.MAX_RESIZE_WIDTH=8192,h.MAX_RESIZE_HEIGHT=8192,h.prototype=c.instance,h}),n("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue,l=e.extend({access_binary:u(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return o.can("access_binary")&&!!s.Image},display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:u(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:u(function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&("IE"!==n.browser||n.verComp(n.version,9,">"))}()),filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),return_response_headers:c,return_response_type:function(e){return"json"===e&&window.JSON?!0:n.can("return_response_type",e)},return_status_code:c,report_upload_progress:u(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return o.can("access_binary")&&n.can("create_canvas")},select_file:function(){return n.can("use_fileinput")&&window.File},select_folder:function(){return o.can("select_file")&&("Chrome"===n.browser&&n.verComp(n.version,21,">=")||"Firefox"===n.browser&&n.verComp(n.version,42,">="))},select_multiple:function(){return!(!o.can("select_file")||"Safari"===n.browser&&"Windows"===n.os||"iOS"===n.os&&n.verComp(n.osVersion,"7.0.0",">")&&n.verComp(n.osVersion,"8.0.0","<"))},send_binary_string:u(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:u(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||o.can("send_binary_string")},slice_blob:u(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return o.can("slice_blob")&&o.can("send_multipart")},summon_file_dialog:function(){return o.can("select_file")&&("Firefox"===n.browser&&n.verComp(n.version,4,">=")||"Opera"===n.browser&&n.verComp(n.version,12,">=")||"IE"===n.browser&&n.verComp(n.version,10,">=")||!!~e.inArray(n.browser,["Chrome","Safari","Edge"]))},upload_filesize:c,use_http_method:c},arguments[2]);i.call(this,t,arguments[1]||a,l),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html5",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){function i(){function e(e,t,i){var n;if(!window.File.prototype.slice)return(n=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?n.call(e,t,i):null;try{return e.slice(),e.slice(t,i)}catch(r){return e.slice(t,i-t)}}this.slice=function(){return new t(this.getRuntime().uid,e.apply(this,arguments))}}return e.Blob=i}),n("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(e){function t(){this.returnValue=!1}function i(){this.cancelBubble=!0}var n={},r="moxie_"+e.guid(),o=function(o,a,s,u){var c,l;a=a.toLowerCase(),o.addEventListener?(c=s,o.addEventListener(a,c,!1)):o.attachEvent&&(c=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=t,e.stopPropagation=i,s(e)},o.attachEvent("on"+a,c)),o[r]||(o[r]=e.guid()),n.hasOwnProperty(o[r])||(n[o[r]]={}),l=n[o[r]],l.hasOwnProperty(a)||(l[a]=[]),l[a].push({func:c,orig:s,key:u})},a=function(t,i,o){var a,s;if(i=i.toLowerCase(),t[r]&&n[t[r]]&&n[t[r]][i]){a=n[t[r]][i];for(var u=a.length-1;u>=0&&(a[u].orig!==o&&a[u].key!==o||(t.removeEventListener?t.removeEventListener(i,a[u].func,!1):t.detachEvent&&t.detachEvent("on"+i,a[u].func),a[u].orig=null,a[u].func=null,a.splice(u,1),o===s));u--);if(a.length||delete n[t[r]][i],e.isEmptyObj(n[t[r]])){delete n[t[r]];try{delete t[r]}catch(c){t[r]=s}}}},s=function(t,i){t&&t[r]&&e.each(n[t[r]],function(e,n){a(t,n,i)})};return{addEvent:o,removeEvent:a,removeAllEvents:s}}),n("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){var e,s;i.extend(this,{init:function(u){var c,l,d,m,h,f,p=this,g=p.getRuntime();e=u,d=e.accept.mimes||o.extList2mimes(e.accept,g.can("filter_by_extension")),l=g.getShimContainer(),l.innerHTML='<input id="'+g.uid+'" type="file" style="font-size:999px;opacity:0;"'+(e.multiple&&g.can("select_multiple")?"multiple":"")+(e.directory&&g.can("select_folder")?"webkitdirectory directory":"")+(d?' accept="'+d.join(",")+'"':"")+" />",c=n.get(g.uid),i.extend(c.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),m=n.get(e.browse_button),s=n.getStyle(m,"z-index")||"auto",g.can("summon_file_dialog")&&("static"===n.getStyle(m,"position")&&(m.style.position="relative"),r.addEvent(m,"click",function(e){var t=n.get(g.uid);t&&!t.disabled&&t.click(),e.preventDefault()},p.uid),p.bind("Refresh",function(){h=parseInt(s,10)||1,n.get(e.browse_button).style.zIndex=h,this.getRuntime().getShimContainer().style.zIndex=h-1})),f=g.can("summon_file_dialog")?m:l,r.addEvent(f,"mouseover",function(){p.trigger("mouseenter")},p.uid),r.addEvent(f,"mouseout",function(){p.trigger("mouseleave")},p.uid),r.addEvent(f,"mousedown",function(){p.trigger("mousedown")},p.uid),r.addEvent(n.get(e.container),"mouseup",function(){p.trigger("mouseup")},p.uid),c.onchange=function x(){if(p.files=[],i.each(this.files,function(i){var n="";return e.directory&&"."==i.name?!0:(i.webkitRelativePath&&(n="/"+i.webkitRelativePath.replace(/^\//,"")),i=new t(g.uid,i),i.relativePath=n,p.files.push(i),void 0)}),"IE"!==a.browser&&"IEMobile"!==a.browser)this.value="";else{var n=this.cloneNode(!0);this.parentNode.replaceChild(n,this),n.onchange=x}p.files.length&&p.trigger("change")},p.trigger({type:"ready",async:!0}),l=null},setOption:function(e,t){var i=this.getRuntime(),r=n.get(i.uid);switch(e){case"accept":if(t){var a=t.mimes||o.extList2mimes(t,i.can("filter_by_extension"));r.setAttribute("accept",a.join(","))}else r.removeAttribute("accept");break;case"directory":t&&i.can("select_folder")?(r.setAttribute("directory",""),r.setAttribute("webkitdirectory","")):(r.removeAttribute("directory"),r.removeAttribute("webkitdirectory"));break;case"multiple":t&&i.can("select_multiple")?r.setAttribute("multiple",""):r.removeAttribute("multiple")}},disable:function(e){var t,i=this.getRuntime();(t=n.get(i.uid))&&(t.disabled=!!e)},destroy:function(){var t=this.getRuntime(),i=t.getShim(),o=t.getShimContainer(),a=e&&n.get(e.container),u=e&&n.get(e.browse_button);a&&r.removeAllEvents(a,this.uid),u&&(r.removeAllEvents(u,this.uid),u.style.zIndex=s),o&&(r.removeAllEvents(o,this.uid),o.innerHTML=""),i.removeInstance(this.uid),e=o=a=u=i=null}})}return e.FileInput=s}),n("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,t,i,n,r,o){function a(){function e(e){if(!e.dataTransfer||!e.dataTransfer.types)return!1;var t=i.toArray(e.dataTransfer.types||[]);return-1!==i.inArray("Files",t)||-1!==i.inArray("public.file-url",t)||-1!==i.inArray("application/x-moz-file",t)}function a(e,i){if(u(e)){var n=new t(f,e);n.relativePath=i||"",p.push(n)}}function s(e){for(var t=[],n=0;n<e.length;n++)[].push.apply(t,e[n].extensions.split(/\s*,\s*/));return-1===i.inArray("*",t)?t:[]}function u(e){if(!g.length)return!0;var t=o.getFileExtension(e.name);return!t||-1!==i.inArray(t,g)}function c(e,t){var n=[];i.each(e,function(e){var t=e.webkitGetAsEntry();t&&(t.isFile?a(e.getAsFile(),t.fullPath):n.push(t))}),n.length?l(n,t):t()}function l(e,t){var n=[];i.each(e,function(e){n.push(function(t){d(e,t)})}),i.inSeries(n,function(){t()})}function d(e,t){e.isFile?e.file(function(i){a(i,e.fullPath),t()},function(){t()}):e.isDirectory?m(e,t):t()}function m(e,t){function i(e){r.readEntries(function(t){t.length?([].push.apply(n,t),i(e)):e()},e)}var n=[],r=e.createReader();i(function(){l(n,t)})}var h,f,p=[],g=[];i.extend(this,{init:function(t){var n,o=this;h=t,f=o.ruid,g=s(h.accept),n=h.container,r.addEvent(n,"dragover",function(t){e(t)&&(t.preventDefault(),t.dataTransfer.dropEffect="copy")},o.uid),r.addEvent(n,"drop",function(t){e(t)&&(t.preventDefault(),p=[],t.dataTransfer.items&&t.dataTransfer.items[0].webkitGetAsEntry?c(t.dataTransfer.items,function(){o.files=p,o.trigger("drop")}):(i.each(t.dataTransfer.files,function(e){a(e)}),o.files=p,o.trigger("drop")))},o.uid),r.addEvent(n,"dragenter",function(){o.trigger("dragenter")},o.uid),r.addEvent(n,"dragleave",function(){o.trigger("dragleave")},o.uid)},destroy:function(){r.removeAllEvents(h&&n.get(h.container),this.uid),f=p=g=h=null}})}return e.FileDrop=a}),n("moxie/runtime/html5/file/FileReader",["moxie/runtime/html5/Runtime","moxie/core/utils/Encode","moxie/core/utils/Basic"],function(e,t,i){function n(){function e(e){return t.atob(e.substring(e.indexOf("base64,")+7))}var n,r=!1;i.extend(this,{read:function(t,o){var a=this;a.result="",n=new window.FileReader,n.addEventListener("progress",function(e){a.trigger(e)}),n.addEventListener("load",function(t){a.result=r?e(n.result):n.result,a.trigger(t)}),n.addEventListener("error",function(e){a.trigger(e,n.error)}),n.addEventListener("loadend",function(e){n=null,a.trigger(e)}),"function"===i.typeOf(n[t])?(r=!1,n[t](o.getSource())):"readAsBinaryString"===t&&(r=!0,n.readAsDataURL(o.getSource()))},abort:function(){n&&n.abort()},destroy:function(){n=null}})}return e.FileReader=n}),n("moxie/runtime/html5/xhr/XMLHttpRequest",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/core/utils/Url","moxie/file/File","moxie/file/Blob","moxie/xhr/FormData","moxie/core/Exceptions","moxie/core/utils/Env"],function(e,t,i,n,r,o,a,s,u){function c(){function e(e,t){var i,n,r=this;i=t.getBlob().getSource(),n=new window.FileReader,n.onload=function(){t.append(t.getBlobName(),new o(null,{type:i.type,data:n.result})),f.send.call(r,e,t)},n.readAsBinaryString(i)}function c(){return!window.XMLHttpRequest||"IE"===u.browser&&u.verComp(u.version,8,"<")?function(){for(var e=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],t=0;t<e.length;t++)try{return new ActiveXObject(e[t])}catch(i){}}():new window.XMLHttpRequest}function l(e){var t=e.responseXML,i=e.responseText;return"IE"===u.browser&&i&&t&&!t.documentElement&&/[^\/]+\/[^\+]+\+xml/.test(e.getResponseHeader("Content-Type"))&&(t=new window.ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.validateOnParse=!1,t.loadXML(i)),t&&("IE"===u.browser&&0!==t.parseError||!t.documentElement||"parsererror"===t.documentElement.tagName)?null:t}function d(e){var t="----moxieboundary"+(new Date).getTime(),i="--",n="\r\n",r="",a=this.getRuntime();if(!a.can("send_binary_string"))throw new s.RuntimeError(s.RuntimeError.NOT_SUPPORTED_ERR);return m.setRequestHeader("Content-Type","multipart/form-data; boundary="+t),e.each(function(e,a){r+=e instanceof o?i+t+n+'Content-Disposition: form-data; name="'+a+'"; filename="'+unescape(encodeURIComponent(e.name||"blob"))+'"'+n+"Content-Type: "+(e.type||"application/octet-stream")+n+n+e.getSource()+n:i+t+n+'Content-Disposition: form-data; name="'+a+'"'+n+n+unescape(encodeURIComponent(e))+n}),r+=i+t+i+n}var m,h,f=this;t.extend(this,{send:function(i,r){var s=this,l="Mozilla"===u.browser&&u.verComp(u.version,4,">=")&&u.verComp(u.version,7,"<"),f="Android Browser"===u.browser,p=!1;if(h=i.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),m=c(),m.open(i.method,i.url,i.async,i.user,i.password),r instanceof o)r.isDetached()&&(p=!0),r=r.getSource();else if(r instanceof a){if(r.hasBlob())if(r.getBlob().isDetached())r=d.call(s,r),p=!0;else if((l||f)&&"blob"===t.typeOf(r.getBlob().getSource())&&window.FileReader)return e.call(s,i,r),void 0;if(r instanceof a){var g=new window.FormData;
  6513. r.each(function(e,t){e instanceof o?g.append(t,e.getSource()):g.append(t,e)}),r=g}}m.upload?(i.withCredentials&&(m.withCredentials=!0),m.addEventListener("load",function(e){s.trigger(e)}),m.addEventListener("error",function(e){s.trigger(e)}),m.addEventListener("progress",function(e){s.trigger(e)}),m.upload.addEventListener("progress",function(e){s.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):m.onreadystatechange=function(){switch(m.readyState){case 1:break;case 2:break;case 3:var e,t;try{n.hasSameOrigin(i.url)&&(e=m.getResponseHeader("Content-Length")||0),m.responseText&&(t=m.responseText.length)}catch(r){e=t=0}s.trigger({type:"progress",lengthComputable:!!e,total:parseInt(e,10),loaded:t});break;case 4:m.onreadystatechange=function(){},0===m.status?s.trigger("error"):s.trigger("load")}},t.isEmptyObj(i.headers)||t.each(i.headers,function(e,t){m.setRequestHeader(t,e)}),""!==i.responseType&&"responseType"in m&&(m.responseType="json"!==i.responseType||u.can("return_response_type","json")?i.responseType:"text"),p?m.sendAsBinary?m.sendAsBinary(r):function(){for(var e=new Uint8Array(r.length),t=0;t<r.length;t++)e[t]=255&r.charCodeAt(t);m.send(e.buffer)}():m.send(r),s.trigger("loadstart")},getStatus:function(){try{if(m)return m.status}catch(e){}return 0},getResponse:function(e){var t=this.getRuntime();try{switch(e){case"blob":var n=new r(t.uid,m.response),o=m.getResponseHeader("Content-Disposition");if(o){var a=o.match(/filename=([\'\"'])([^\1]+)\1/);a&&(h=a[2])}return n.name=h,n.type||(n.type=i.getFileMime(h)),n;case"json":return u.can("return_response_type","json")?m.response:200===m.status&&window.JSON?JSON.parse(m.responseText):null;case"document":return l(m);default:return""!==m.responseText?m.responseText:null}}catch(s){return null}},getAllResponseHeaders:function(){try{return m.getAllResponseHeaders()}catch(e){}return""},abort:function(){m&&m.abort()},destroy:function(){f=h=null}})}return e.XMLHttpRequest=c}),n("moxie/runtime/html5/utils/BinaryReader",["moxie/core/utils/Basic"],function(e){function t(e){e instanceof ArrayBuffer?i.apply(this,arguments):n.apply(this,arguments)}function i(t){var i=new DataView(t);e.extend(this,{readByteAt:function(e){return i.getUint8(e)},writeByteAt:function(e,t){i.setUint8(e,t)},SEGMENT:function(e,n,r){switch(arguments.length){case 2:return t.slice(e,e+n);case 1:return t.slice(e);case 3:if(null===r&&(r=new ArrayBuffer),r instanceof ArrayBuffer){var o=new Uint8Array(this.length()-n+r.byteLength);e>0&&o.set(new Uint8Array(t.slice(0,e)),0),o.set(new Uint8Array(r),e),o.set(new Uint8Array(t.slice(e+n)),e+r.byteLength),this.clear(),t=o.buffer,i=new DataView(t);break}default:return t}},length:function(){return t?t.byteLength:0},clear:function(){i=t=null}})}function n(t){function i(e,i,n){n=3===arguments.length?n:t.length-i-1,t=t.substr(0,i)+e+t.substr(n+i)}e.extend(this,{readByteAt:function(e){return t.charCodeAt(e)},writeByteAt:function(e,t){i(String.fromCharCode(t),e,1)},SEGMENT:function(e,n,r){switch(arguments.length){case 1:return t.substr(e);case 2:return t.substr(e,n);case 3:i(null!==r?r:"",e,n);break;default:return t}},length:function(){return t?t.length:0},clear:function(){t=null}})}return e.extend(t.prototype,{littleEndian:!1,read:function(e,t){var i,n,r;if(e+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),r=0,i=0;t>r;r++)i|=this.readByteAt(e+r)<<Math.abs(n+8*r);return i},write:function(e,t,i){var n,r;if(e>this.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;i>r;r++)this.writeByteAt(e+r,255&t>>Math.abs(n+8*r))},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){var t=this.read(e,4);return t>2147483647?t-4294967296:t},CHAR:function(e){return String.fromCharCode(this.read(e,1))},STRING:function(e,t){return this.asArray("CHAR",e,t).join("")},asArray:function(e,t,i){for(var n=[],r=0;i>r;r++)n[r]=this[e](t+r);return n}}),t}),n("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,t){return function i(n){var r,o,a,s=[],u=0;if(r=new e(n),65496!==r.SHORT(0))throw r.clear(),new t.ImageError(t.ImageError.WRONG_FORMAT);for(o=2;o<=r.length();)if(a=r.SHORT(o),a>=65488&&65495>=a)o+=2;else{if(65498===a||65497===a)break;u=r.SHORT(o+2)+2,a>=65505&&65519>=a&&s.push({hex:a,name:"APP"+(15&a),start:o,length:u,segment:r.SEGMENT(o,u)}),o+=u}return r.clear(),{headers:s,restore:function(t){var i,n,r;for(r=new e(t),o=65504==r.SHORT(2)?4+r.SHORT(4):2,n=0,i=s.length;i>n;n++)r.SEGMENT(o,0,s[n].segment),o+=s[n].length;return t=r.SEGMENT(),r.clear(),t},strip:function(t){var n,r,o,a;for(o=new i(t),r=o.headers,o.purge(),n=new e(t),a=r.length;a--;)n.SEGMENT(r[a].start,r[a].length,"");return t=n.SEGMENT(),n.clear(),t},get:function(e){for(var t=[],i=0,n=s.length;n>i;i++)s[i].name===e.toUpperCase()&&t.push(s[i].segment);return t},set:function(e,t){var i,n,r,o=[];for("string"==typeof t?o.push(t):o=t,i=n=0,r=s.length;r>i&&(s[i].name===e.toUpperCase()&&(s[i].segment=o[n],s[i].length=o[n].length,n++),!(n>=o.length));i++);},purge:function(){this.headers=s=[]}}}}),n("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(e,i,n){function r(o){function a(i,r){var o,a,s,u,c,m,h,f,p=this,g=[],x={},v={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},y={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8};for(o=p.SHORT(i),a=0;o>a;a++)if(g=[],h=i+2+12*a,s=r[p.SHORT(h)],s!==t){if(u=v[p.SHORT(h+=2)],c=p.LONG(h+=2),m=y[u],!m)throw new n.ImageError(n.ImageError.INVALID_META_ERR);if(h+=4,m*c>4&&(h=p.LONG(h)+d.tiffHeader),h+m*c>=this.length())throw new n.ImageError(n.ImageError.INVALID_META_ERR);"ASCII"!==u?(g=p.asArray(u,h,c),f=1==c?g[0]:g,x[s]=l.hasOwnProperty(s)&&"object"!=typeof f?l[s][f]:f):x[s]=e.trim(p.STRING(h,c).replace(/\0$/,""))}return x}function s(e,t,i){var n,r,o,a=0;if("string"==typeof t){var s=c[e.toLowerCase()];for(var u in s)if(s[u]===t){t=u;break}}n=d[e.toLowerCase()+"IFD"],r=this.SHORT(n);for(var l=0;r>l;l++)if(o=n+12*l+2,this.SHORT(o)==t){a=o+8;break}if(!a)return!1;try{this.write(a,i,4)}catch(m){return!1}return!0}var u,c,l,d,m,h;if(i.call(this,o),c={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},l={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},d={tiffHeader:10},m=d.tiffHeader,u={clear:this.clear},e.extend(this,{read:function(){try{return r.prototype.read.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},write:function(){try{return r.prototype.write.apply(this,arguments)}catch(e){throw new n.ImageError(n.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return h||null},EXIF:function(){var t=null;if(d.exifIFD){try{t=a.call(this,d.exifIFD,c.exif)}catch(i){return null}if(t.ExifVersion&&"array"===e.typeOf(t.ExifVersion)){for(var n=0,r="";n<t.ExifVersion.length;n++)r+=String.fromCharCode(t.ExifVersion[n]);t.ExifVersion=r}}return t},GPS:function(){var t=null;if(d.gpsIFD){try{t=a.call(this,d.gpsIFD,c.gps)}catch(i){return null}t.GPSVersionID&&"array"===e.typeOf(t.GPSVersionID)&&(t.GPSVersionID=t.GPSVersionID.join("."))}return t},thumb:function(){if(d.IFD1)try{var e=a.call(this,d.IFD1,c.thumb);if("JPEGInterchangeFormat"in e)return this.SEGMENT(d.tiffHeader+e.JPEGInterchangeFormat,e.JPEGInterchangeFormatLength)}catch(t){}return null},setExif:function(e,t){return"PixelXDimension"!==e&&"PixelYDimension"!==e?!1:s.call(this,"exif",e,t)},clear:function(){u.clear(),o=c=l=h=d=u=null}}),65505!==this.SHORT(0)||"EXIF\0"!==this.STRING(4,5).toUpperCase())throw new n.ImageError(n.ImageError.INVALID_META_ERR);if(this.littleEndian=18761==this.SHORT(m),42!==this.SHORT(m+=2))throw new n.ImageError(n.ImageError.INVALID_META_ERR);d.IFD0=d.tiffHeader+this.LONG(m+=2),h=a.call(this,d.IFD0,c.tiff),"ExifIFDPointer"in h&&(d.exifIFD=d.tiffHeader+h.ExifIFDPointer,delete h.ExifIFDPointer),"GPSInfoIFDPointer"in h&&(d.gpsIFD=d.tiffHeader+h.GPSInfoIFDPointer,delete h.GPSInfoIFDPointer),e.isEmptyObj(h)&&(h=null);var f=this.LONG(d.IFD0+12*this.SHORT(d.IFD0)+2);f&&(d.IFD1=d.tiffHeader+f)}return r.prototype=i.prototype,r}),n("moxie/runtime/html5/image/JPEG",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEGHeaders","moxie/runtime/html5/utils/BinaryReader","moxie/runtime/html5/image/ExifParser"],function(e,t,i,n,r){function o(o){function a(e){var t,i,n=0;for(e||(e=c);n<=e.length();){if(t=e.SHORT(n+=2),t>=65472&&65475>=t)return n+=5,{height:e.SHORT(n),width:e.SHORT(n+=2)};i=e.SHORT(n+=2),n+=i-2}return null}function s(){var e,t,i=d.thumb();return i&&(e=new n(i),t=a(e),e.clear(),t)?(t.data=i,t):null}function u(){d&&l&&c&&(d.clear(),l.purge(),c.clear(),m=l=d=c=null)}var c,l,d,m;if(c=new n(o),65496!==c.SHORT(0))throw new t.ImageError(t.ImageError.WRONG_FORMAT);l=new i(o);try{d=new r(l.get("app1")[0])}catch(h){}m=a.call(this),e.extend(this,{type:"image/jpeg",size:c.length(),width:m&&m.width||0,height:m&&m.height||0,setExif:function(t,i){return d?("object"===e.typeOf(t)?e.each(t,function(e,t){d.setExif(t,e)}):d.setExif(t,i),l.set("app1",d.SEGMENT()),void 0):!1},writeHeaders:function(){return arguments.length?l.restore(arguments[0]):l.restore(o)},stripHeaders:function(e){return l.strip(e)},purge:function(){u.call(this)}}),d&&(this.meta={tiff:d.TIFF(),exif:d.EXIF(),gps:d.GPS(),thumb:s()})}return o}),n("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(e,t,i){function n(n){function r(){var e,t;return e=a.call(this,8),"IHDR"==e.type?(t=e.start,{width:s.LONG(t),height:s.LONG(t+=4)}):null}function o(){s&&(s.clear(),n=l=u=c=s=null)}function a(e){var t,i,n,r;return t=s.LONG(e),i=s.STRING(e+=4,4),n=e+=4,r=s.LONG(e+t),{length:t,type:i,start:n,CRC:r}}var s,u,c,l;s=new i(n),function(){var t=0,i=0,n=[35152,20039,3338,6666];for(i=0;i<n.length;i++,t+=2)if(n[i]!=s.SHORT(t))throw new e.ImageError(e.ImageError.WRONG_FORMAT)}(),l=r.call(this),t.extend(this,{type:"image/png",size:s.length(),width:l.width,height:l.height,purge:function(){o.call(this)}}),o.call(this)}return n}),n("moxie/runtime/html5/image/ImageInfo",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEG","moxie/runtime/html5/image/PNG"],function(e,t,i,n){return function(r){var o,a=[i,n];o=function(){for(var e=0;e<a.length;e++)try{return new a[e](r)}catch(i){}throw new t.ImageError(t.ImageError.WRONG_FORMAT)}(),e.extend(this,{type:"",size:0,width:0,height:0,setExif:function(){},writeHeaders:function(e){return e},stripHeaders:function(e){return e},purge:function(){r=null}}),e.extend(this,o),this.purge=function(){o.purge(),o=null}}}),n("moxie/runtime/html5/image/ResizerCanvas",[],function(){function e(i,n){var r=i.width,o=Math.floor(r*n),a=!1;(.5>n||n>2)&&(n=.5>n?.5:2,a=!0);var s=t(i,n);return a?e(s,o/s.width):s}function t(e,t){var i=e.width,n=e.height,r=Math.floor(i*t),o=Math.floor(n*t),a=document.createElement("canvas");return a.width=r,a.height=o,a.getContext("2d").drawImage(e,0,0,i,n,0,0,r,o),e=null,a}return{scale:e}}),n("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/ResizerCanvas","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a,s,u){function c(){function e(){if(!v&&!g)throw new i.ImageError(i.DOMException.INVALID_STATE_ERR);return v||g}function c(){var t=e();return"canvas"==t.nodeName.toLowerCase()?t:(v=document.createElement("canvas"),v.width=t.width,v.height=t.height,v.getContext("2d").drawImage(t,0,0),v)}function l(e){return n.atob(e.substring(e.indexOf("base64,")+7))}function d(e,t){return"data:"+(t||"")+";base64,"+n.btoa(e)}function m(e){var t=this;g=new Image,g.onerror=function(){p.call(this),t.trigger("error",i.ImageError.WRONG_FORMAT)},g.onload=function(){t.trigger("load")},g.src="data:"==e.substr(0,5)?e:d(e,w.type)}function h(e,t){var n,r=this;return window.FileReader?(n=new FileReader,n.onload=function(){t(this.result)},n.onerror=function(){r.trigger("error",i.ImageError.WRONG_FORMAT)},n.readAsDataURL(e),void 0):t(e.getAsDataURL())}function f(e,i,n){t.inArray(n,[5,6,7,8])>-1&&(v.width=i,v.height=e);var r=v.getContext("2d");switch(n){case 2:r.translate(e,0),r.scale(-1,1);break;case 3:r.translate(e,i),r.rotate(Math.PI);break;case 4:r.translate(0,i),r.scale(1,-1);break;case 5:r.rotate(.5*Math.PI),r.scale(1,-1);break;case 6:r.rotate(.5*Math.PI),r.translate(0,-i);break;case 7:r.rotate(.5*Math.PI),r.translate(e,-i),r.scale(-1,1);break;case 8:r.rotate(-.5*Math.PI),r.translate(-e,0)}}function p(){x&&(x.purge(),x=null),g&&(g.src=""),y=g=v=w=null,b=!1}var g,x,v,y,w,E=this,b=!1,R=!0;t.extend(this,{loadFromBlob:function(e){var t=this,n=t.getRuntime(),r=arguments.length>1?arguments[1]:!0;if(!n.can("access_binary"))throw new i.RuntimeError(i.RuntimeError.NOT_SUPPORTED_ERR);return w=e,e.isDetached()?(y=e.getSource(),m.call(this,y),void 0):(h.call(this,e.getSource(),function(e){r&&(y=l(e)),m.call(t,e)}),void 0)},loadFromImage:function(e,t){this.meta=e.meta,w=new o(null,{name:e.name,size:e.size,type:e.type}),m.call(this,t?y=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var t,i=this.getRuntime();return!x&&y&&i.can("access_image_binary")&&(x=new a(y)),t={width:e().width||0,height:e().height||0,type:w.type||u.getFileMime(w.name),size:y&&y.length||w.size||0,name:w.name||"",meta:null},R&&(t.meta=x&&x.meta||this.meta||{},!t.meta||!t.meta.thumb||t.meta.thumb.data instanceof r||(t.meta.thumb.data=new r(null,{type:"image/jpeg",data:t.meta.thumb.data}))),t},resize:function(t,i,n){var r=document.createElement("canvas");if(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(e(),t.x,t.y,t.width,t.height,0,0,r.width,r.height),v=s.scale(r,i),R=n.preserveHeaders,!R){var o=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1;f(v.width,v.height,o)}this.width=v.width,this.height=v.height,b=!0,this.trigger("Resize")},getAsCanvas:function(){return v||(v=c()),v.id=this.uid+"_canvas",v},getAsBlob:function(e,t){return e!==this.type?(b=!0,new o(null,{name:w.name||"",type:e,data:E.getAsDataURL(e,t)})):new o(null,{name:w.name||"",type:e,data:E.getAsBinaryString(e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!b)return g.src;if(c(),"image/jpeg"!==e)return v.toDataURL("image/png");try{return v.toDataURL("image/jpeg",t/100)}catch(i){return v.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!b)return y||(y=l(E.getAsDataURL(e,t))),y;if("image/jpeg"!==e)y=l(E.getAsDataURL(e,t));else{var i;t||(t=90),c();try{i=v.toDataURL("image/jpeg",t/100)}catch(n){i=v.toDataURL("image/jpeg")}y=l(i),x&&(y=x.stripHeaders(y),R&&(x.meta&&x.meta.exif&&x.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),y=x.writeHeaders(y)),x.purge(),x=null)}return b=!1,y},destroy:function(){E=null,p.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}return e.Image=c}),n("moxie/runtime/flash/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(){var e;try{e=navigator.plugins["Shockwave Flash"],e=e.description}catch(t){try{e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){e="0.0"}}return e=e.match(/\d+/g),parseFloat(e[0]+"."+e[1])}function s(e){var n=i.get(e);n&&"OBJECT"==n.nodeName&&("IE"===t.browser?(n.style.display="none",function r(){4==n.readyState?u(e):setTimeout(r,10)}()):n.parentNode.removeChild(n))}function u(e){var t=i.get(e);if(t){for(var n in t)"function"==typeof t[n]&&(t[n]=null);t.parentNode.removeChild(t)}}function c(u){var c,m=this;u=e.extend({swf_url:t.swf_url},u),o.call(this,u,l,{access_binary:function(e){return e&&"browser"===m.mode},access_image_binary:function(e){return e&&"browser"===m.mode},display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:function(){return"client"===m.mode},resize_image:o.capTrue,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!e.arrayDiff(t,["","text","document"])||"browser"===m.mode},return_status_code:function(t){return"browser"===m.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:function(e){return e&&"browser"===m.mode},send_browser_cookies:function(e){return e&&"browser"===m.mode},send_custom_headers:function(e){return e&&"browser"===m.mode},send_multipart:o.capTrue,slice_blob:function(e){return e&&"browser"===m.mode},stream_upload:function(e){return e&&"browser"===m.mode},summon_file_dialog:!1,upload_filesize:function(t){return e.parseSizeStr(t)<=2097152||"client"===m.mode},use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}},{access_binary:function(e){return e?"browser":"client"},access_image_binary:function(e){return e?"browser":"client"},report_upload_progress:function(e){return e?"browser":"client"},return_response_type:function(t){return e.arrayDiff(t,["","text","json","document"])?"browser":["client","browser"]},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"browser":["client","browser"]},send_binary_string:function(e){return e?"browser":"client"},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"browser":"client"},slice_blob:function(e){return e?"browser":"client"},stream_upload:function(e){return e?"client":"browser"},upload_filesize:function(t){return e.parseSizeStr(t)>=2097152?"client":"browser"}},"client"),a()<11.3&&(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid)},shimExec:function(e,t){var i=[].slice.call(arguments,2);return m.getShim().exec(this.uid,e,t,i)},init:function(){var i,r,o;o=this.getShimContainer(),e.extend(o.style,{position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),i='<object id="'+this.uid+'" type="application/x-shockwave-flash" data="'+u.swf_url+'" ',"IE"===t.browser&&(i+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '),i+='width="100%" height="100%" style="outline:0"><param name="movie" value="'+u.swf_url+'" />'+'<param name="flashvars" value="uid='+escape(this.uid)+"&target="+t.global_event_dispatcher+'" />'+'<param name="wmode" value="transparent" />'+'<param name="allowscriptaccess" value="always" />'+"</object>","IE"===t.browser?(r=document.createElement("div"),o.appendChild(r),r.outerHTML=i,r=o=null):o.innerHTML=i,c=setTimeout(function(){m&&!m.initialized&&m.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},5e3)},destroy:function(e){return function(){s(m.uid),e.call(m),clearTimeout(c),u=c=e=m=null}}(this.destroy)},d)}var l="flash",d={};return o.addConstructor(l,c),d}),n("moxie/runtime/flash/file/Blob",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={slice:function(e,i,n,r){var o=this.getRuntime();return 0>i?i=Math.max(e.size+i,0):i>0&&(i=Math.min(i,e.size)),0>n?n=Math.max(e.size+n,0):n>0&&(n=Math.min(n,e.size)),e=o.shimExec.call(this,"Blob","slice",i,n,r||""),e&&(e=new t(o.uid,e)),e}};return e.Blob=i}),n("moxie/runtime/flash/file/FileInput",["moxie/runtime/flash/Runtime","moxie/file/File","moxie/core/utils/Basic"],function(e,t,i){var n={init:function(e){var n=this,r=this.getRuntime();this.bind("Change",function(){var e=r.shimExec.call(n,"FileInput","getFiles");n.files=[],i.each(e,function(e){n.files.push(new t(r.uid,e))})},999),this.getRuntime().shimExec.call(this,"FileInput","init",{accept:e.accept,multiple:e.multiple}),this.trigger("ready")}};return e.FileInput=n}),n("moxie/runtime/flash/file/FileReader",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n=this;return n.result="","readAsDataURL"===e&&(n.result="data:"+(t.type||"")+";base64,"),n.bind("Progress",function(t,r){r&&(n.result+=i(r,e))},999),n.getRuntime().shimExec.call(this,"FileReader","readAsBase64",t.uid)}};return e.FileReader=n}),n("moxie/runtime/flash/file/FileReaderSync",["moxie/runtime/flash/Runtime","moxie/core/utils/Encode"],function(e,t){function i(e,i){switch(i){case"readAsText":return t.atob(e,"utf8");case"readAsBinaryString":return t.atob(e);case"readAsDataURL":return e}return null}var n={read:function(e,t){var n,r=this.getRuntime();return(n=r.shimExec.call(this,"FileReaderSync","readAsBase64",t.uid))?("readAsDataURL"===e&&(n="data:"+(t.type||"")+";base64,"+n),i(n,e,t.type)):null}};return e.FileReaderSync=n}),n("moxie/runtime/flash/runtime/Transporter",["moxie/runtime/flash/Runtime","moxie/file/Blob"],function(e,t){var i={getAsBlob:function(e){var i=this.getRuntime(),n=i.shimExec.call(this,"Transporter","getAsBlob",e);return n?new t(i.uid,n):null}};return e.Transporter=i}),n("moxie/runtime/flash/xhr/XMLHttpRequest",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/file/File","moxie/file/FileReaderSync","moxie/runtime/flash/file/FileReaderSync","moxie/xhr/FormData","moxie/runtime/Transporter","moxie/runtime/flash/runtime/Transporter"],function(e,t,i,n,r,o,a,s){var u={send:function(e,n){function r(){e.transport=l.mode,l.shimExec.call(c,"XMLHttpRequest","send",e,n)}function o(e,t){l.shimExec.call(c,"XMLHttpRequest","appendBlob",e,t.uid),n=null,r()}function u(e,t){var i=new s;i.bind("TransportingComplete",function(){t(this.result)}),i.transport(e.getSource(),e.type,{ruid:l.uid})}var c=this,l=c.getRuntime();if(t.isEmptyObj(e.headers)||t.each(e.headers,function(e,t){l.shimExec.call(c,"XMLHttpRequest","setRequestHeader",t,e.toString())}),n instanceof a){var d;if(n.each(function(e,t){e instanceof i?d=t:l.shimExec.call(c,"XMLHttpRequest","append",t,e)}),n.hasBlob()){var m=n.getBlob();m.isDetached()?u(m,function(e){m.destroy(),o(d,e)}):o(d,m)}else n=null,r()}else n instanceof i?n.isDetached()?u(n,function(e){n.destroy(),n=e.uid,r()}):(n=n.uid,r()):r()},getResponse:function(e){var i,o,a=this.getRuntime();if(o=a.shimExec.call(this,"XMLHttpRequest","getResponseAsBlob")){if(o=new n(a.uid,o),"blob"===e)return o;try{if(i=new r,~t.inArray(e,["","text"]))return i.readAsText(o);if("json"===e&&window.JSON)return JSON.parse(i.readAsText(o))}finally{o.destroy()}}return null},abort:function(){var e=this.getRuntime();e.shimExec.call(this,"XMLHttpRequest","abort"),this.dispatchEvent("readystatechange"),this.dispatchEvent("abort")}};return e.XMLHttpRequest=u}),n("moxie/runtime/flash/image/Image",["moxie/runtime/flash/Runtime","moxie/core/utils/Basic","moxie/runtime/Transporter","moxie/file/Blob","moxie/file/FileReaderSync"],function(e,t,i,n,r){var o={loadFromBlob:function(e){function t(e){r.shimExec.call(n,"Image","loadFromBlob",e.uid),n=r=null}var n=this,r=n.getRuntime();if(e.isDetached()){var o=new i;o.bind("TransportingComplete",function(){t(o.result.getSource())}),o.transport(e.getSource(),e.type,{ruid:r.uid})}else t(e.getSource())},loadFromImage:function(e){var t=this.getRuntime();return t.shimExec.call(this,"Image","loadFromImage",e.uid)},getInfo:function(){var e=this.getRuntime(),t=e.shimExec.call(this,"Image","getInfo");return!t.meta||!t.meta.thumb||t.meta.thumb.data instanceof n||(t.meta.thumb.data=new n(e.uid,t.meta.thumb.data)),t},getAsBlob:function(e,t){var i=this.getRuntime(),r=i.shimExec.call(this,"Image","getAsBlob",e,t);return r?new n(i.uid,r):null},getAsDataURL:function(){var e,t=this.getRuntime(),i=t.Image.getAsBlob.apply(this,arguments);return i?(e=new r,e.readAsDataURL(i)):null}};return e.Image=o}),n("moxie/runtime/silverlight/Runtime",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/runtime/Runtime"],function(e,t,i,n,o){function a(e){var t,i,n,r,o,a=!1,s=null,u=0;try{try{s=new ActiveXObject("AgControl.AgControl"),s.IsVersionSupported(e)&&(a=!0),s=null}catch(c){var l=navigator.plugins["Silverlight Plug-In"];if(l){for(t=l.description,"1.0.30226.2"===t&&(t="2.0.30226.2"),i=t.split(".");i.length>3;)i.pop();for(;i.length<4;)i.push(0);for(n=e.split(".");n.length>4;)n.pop();do r=parseInt(n[u],10),o=parseInt(i[u],10),u++;while(u<n.length&&r===o);o>=r&&!isNaN(r)&&(a=!0)}}}catch(d){a=!1}return a}function s(s){var l,d=this;s=e.extend({xap_url:t.xap_url},s),o.call(this,s,u,{access_binary:o.capTrue,access_image_binary:o.capTrue,display_media:o.capTest(r("moxie/image/Image")),do_cors:o.capTrue,drag_and_drop:!1,report_upload_progress:o.capTrue,resize_image:o.capTrue,return_response_headers:function(e){return e&&"client"===d.mode},return_response_type:function(e){return"json"!==e?!0:!!window.JSON},return_status_code:function(t){return"client"===d.mode||!e.arrayDiff(t,[200,404])},select_file:o.capTrue,select_multiple:o.capTrue,send_binary_string:o.capTrue,send_browser_cookies:function(e){return e&&"browser"===d.mode},send_custom_headers:function(e){return e&&"client"===d.mode},send_multipart:o.capTrue,slice_blob:o.capTrue,stream_upload:!0,summon_file_dialog:!1,upload_filesize:o.capTrue,use_http_method:function(t){return"client"===d.mode||!e.arrayDiff(t,["GET","POST"])}},{return_response_headers:function(e){return e?"client":"browser"},return_status_code:function(t){return e.arrayDiff(t,[200,404])?"client":["client","browser"]},send_browser_cookies:function(e){return e?"browser":"client"},send_custom_headers:function(e){return e?"client":"browser"},use_http_method:function(t){return e.arrayDiff(t,["GET","POST"])?"client":["client","browser"]}}),a("2.0.31005.0")&&"Opera"!==t.browser||(this.mode=!1),e.extend(this,{getShim:function(){return i.get(this.uid).content.Moxie},shimExec:function(e,t){var i=[].slice.call(arguments,2);return d.getShim().exec(this.uid,e,t,i)},init:function(){var e;e=this.getShimContainer(),e.innerHTML='<object id="'+this.uid+'" data="data:application/x-silverlight," type="application/x-silverlight-2" width="100%" height="100%" style="outline:none;">'+'<param name="source" value="'+s.xap_url+'"/>'+'<param name="background" value="Transparent"/>'+'<param name="windowless" value="true"/>'+'<param name="enablehtmlaccess" value="true"/>'+'<param name="initParams" value="uid='+this.uid+",target="+t.global_event_dispatcher+'"/>'+"</object>",l=setTimeout(function(){d&&!d.initialized&&d.trigger("Error",new n.RuntimeError(n.RuntimeError.NOT_INIT_ERR))},"Windows"!==t.OS?1e4:5e3)},destroy:function(e){return function(){e.call(d),clearTimeout(l),s=l=e=d=null}}(this.destroy)},c)}var u="silverlight",c={};return o.addConstructor(u,s),c}),n("moxie/runtime/silverlight/file/Blob",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/Blob"],function(e,t,i){return e.Blob=t.extend({},i)}),n("moxie/runtime/silverlight/file/FileInput",["moxie/runtime/silverlight/Runtime","moxie/file/File","moxie/core/utils/Basic"],function(e,t,i){function n(e){for(var t="",i=0;i<e.length;i++)t+=(""!==t?"|":"")+e[i].title+" | *."+e[i].extensions.replace(/,/g,";*.");return t}var r={init:function(e){var r=this,o=this.getRuntime();this.bind("Change",function(){var e=o.shimExec.call(r,"FileInput","getFiles");r.files=[],i.each(e,function(e){r.files.push(new t(o.uid,e))})},999),o.shimExec.call(this,"FileInput","init",n(e.accept),e.multiple),this.trigger("ready")},setOption:function(e,t){"accept"==e&&(t=n(t)),this.getRuntime().shimExec.call(this,"FileInput","setOption",e,t)}};return e.FileInput=r}),n("moxie/runtime/silverlight/file/FileDrop",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Dom","moxie/core/utils/Events"],function(e,t,i){var n={init:function(){var e,n=this,r=n.getRuntime();return e=r.getShimContainer(),i.addEvent(e,"dragover",function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy"},n.uid),i.addEvent(e,"dragenter",function(e){e.preventDefault();var i=t.get(r.uid).dragEnter(e);i&&e.stopPropagation()},n.uid),i.addEvent(e,"drop",function(e){e.preventDefault();var i=t.get(r.uid).dragDrop(e);i&&e.stopPropagation()},n.uid),r.shimExec.call(this,"FileDrop","init")}};return e.FileDrop=n}),n("moxie/runtime/silverlight/file/FileReader",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/FileReader"],function(e,t,i){return e.FileReader=t.extend({},i)}),n("moxie/runtime/silverlight/file/FileReaderSync",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/file/FileReaderSync"],function(e,t,i){return e.FileReaderSync=t.extend({},i)}),n("moxie/runtime/silverlight/runtime/Transporter",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/runtime/Transporter"],function(e,t,i){return e.Transporter=t.extend({},i)
  6514. }),n("moxie/runtime/silverlight/xhr/XMLHttpRequest",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/runtime/flash/xhr/XMLHttpRequest","moxie/runtime/silverlight/file/FileReaderSync","moxie/runtime/silverlight/runtime/Transporter"],function(e,t,i){return e.XMLHttpRequest=t.extend({},i)}),n("moxie/runtime/silverlight/image/Image",["moxie/runtime/silverlight/Runtime","moxie/core/utils/Basic","moxie/file/Blob","moxie/runtime/flash/image/Image"],function(e,t,i,n){return e.Image=t.extend({},n,{getInfo:function(){var e=this.getRuntime(),n=["tiff","exif","gps","thumb"],r={meta:{}},o=e.shimExec.call(this,"Image","getInfo");return o.meta&&(t.each(n,function(e){var t,i,n,a,s=o.meta[e];if(s&&s.keys)for(r.meta[e]={},i=0,n=s.keys.length;n>i;i++)t=s.keys[i],a=s[t],a&&(/^(\d|[1-9]\d+)$/.test(a)?a=parseInt(a,10):/^\d*\.\d+$/.test(a)&&(a=parseFloat(a)),r.meta[e][t]=a)}),!r.meta||!r.meta.thumb||r.meta.thumb.data instanceof i||(r.meta.thumb.data=new i(e.uid,r.meta.thumb.data))),r.width=parseInt(o.width,10),r.height=parseInt(o.height,10),r.size=parseInt(o.size,10),r.type=o.type,r.name=o.name,r},resize:function(e,t,i){this.getRuntime().shimExec.call(this,"Image","resize",e.x,e.y,e.width,e.height,t,i.preserveHeaders,i.resample)}})}),n("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(e,t,i,n){function o(t){var o=this,u=i.capTest,c=i.capTrue;i.call(this,t,a,{access_binary:u(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:u((n.can("create_canvas")||n.can("use_data_uri_over32kb"))&&r("moxie/image/Image")),do_cors:!1,drag_and_drop:!1,filter_by_extension:u(function(){return!("Chrome"===n.browser&&n.verComp(n.version,28,"<")||"IE"===n.browser&&n.verComp(n.version,10,"<")||"Safari"===n.browser&&n.verComp(n.version,7,"<")||"Firefox"===n.browser&&n.verComp(n.version,37,"<"))}()),resize_image:function(){return s.Image&&o.can("access_binary")&&n.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(t){return"json"===t&&window.JSON?!0:!!~e.inArray(t,["text","document",""])},return_status_code:function(t){return!e.arrayDiff(t,[200,404])},select_file:function(){return n.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return o.can("select_file")},summon_file_dialog:function(){return o.can("select_file")&&("Firefox"===n.browser&&n.verComp(n.version,4,">=")||"Opera"===n.browser&&n.verComp(n.version,12,">=")||"IE"===n.browser&&n.verComp(n.version,10,">=")||!!~e.inArray(n.browser,["Chrome","Safari"]))},upload_filesize:c,use_http_method:function(t){return!e.arrayDiff(t,["GET","POST"])}}),e.extend(this,{init:function(){this.trigger("Init")},destroy:function(e){return function(){e.call(o),e=o=null}}(this.destroy)}),e.extend(this.getShim(),s)}var a="html4",s={};return i.addConstructor(a,o),s}),n("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,t,i,n,r,o,a){function s(){function e(){var o,c,d,m,h,f,p=this,g=p.getRuntime();f=i.guid("uid_"),o=g.getShimContainer(),s&&(d=n.get(s+"_form"),d&&i.extend(d.style,{top:"100%"})),m=document.createElement("form"),m.setAttribute("id",f+"_form"),m.setAttribute("method","post"),m.setAttribute("enctype","multipart/form-data"),m.setAttribute("encoding","multipart/form-data"),i.extend(m.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),h=document.createElement("input"),h.setAttribute("id",f),h.setAttribute("type","file"),h.setAttribute("accept",l.join(",")),i.extend(h.style,{fontSize:"999px",opacity:0}),m.appendChild(h),o.appendChild(m),i.extend(h.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===a.browser&&a.verComp(a.version,10,"<")&&i.extend(h.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),h.onchange=function(){var i;if(this.value){if(this.files){if(i=this.files[0],0===i.size)return m.parentNode.removeChild(m),void 0}else i={name:this.value};i=new t(g.uid,i),this.onchange=function(){},e.call(p),p.files=[i],h.setAttribute("id",i.uid),m.setAttribute("id",i.uid+"_form"),p.trigger("change"),h=m=null}},g.can("summon_file_dialog")&&(c=n.get(u.browse_button),r.removeEvent(c,"click",p.uid),r.addEvent(c,"click",function(e){h&&!h.disabled&&h.click(),e.preventDefault()},p.uid)),s=f,o=d=c=null}var s,u,c,l=[];i.extend(this,{init:function(t){var i,a=this,s=a.getRuntime();u=t,l=t.accept.mimes||o.extList2mimes(t.accept,s.can("filter_by_extension")),i=s.getShimContainer(),function(){var e,o,l;e=n.get(t.browse_button),c=n.getStyle(e,"z-index")||"auto",s.can("summon_file_dialog")&&("static"===n.getStyle(e,"position")&&(e.style.position="relative"),a.bind("Refresh",function(){o=parseInt(c,10)||1,n.get(u.browse_button).style.zIndex=o,this.getRuntime().getShimContainer().style.zIndex=o-1})),l=s.can("summon_file_dialog")?e:i,r.addEvent(l,"mouseover",function(){a.trigger("mouseenter")},a.uid),r.addEvent(l,"mouseout",function(){a.trigger("mouseleave")},a.uid),r.addEvent(l,"mousedown",function(){a.trigger("mousedown")},a.uid),r.addEvent(n.get(t.container),"mouseup",function(){a.trigger("mouseup")},a.uid),e=null}(),e.call(this),i=null,a.trigger({type:"ready",async:!0})},setOption:function(e,t){var i,r=this.getRuntime();"accept"==e&&(l=t.mimes||o.extList2mimes(t,r.can("filter_by_extension"))),i=n.get(s),i&&i.setAttribute("accept",l.join(","))},disable:function(e){var t;(t=n.get(s))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),i=e.getShimContainer(),o=u&&n.get(u.container),a=u&&n.get(u.browse_button);o&&r.removeAllEvents(o,this.uid),a&&(r.removeAllEvents(a,this.uid),a.style.zIndex=c),i&&(r.removeAllEvents(i,this.uid),i.innerHTML=""),t.removeInstance(this.uid),s=l=u=i=o=a=t=null}})}return e.FileInput=s}),n("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),n("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,t,i,n,r,o,a,s){function u(){function e(e){var t,n,r,a,s=this,u=!1;if(l){if(t=l.id.replace(/_iframe$/,""),n=i.get(t+"_form")){for(r=n.getElementsByTagName("input"),a=r.length;a--;)switch(r[a].getAttribute("type")){case"hidden":r[a].parentNode.removeChild(r[a]);break;case"file":u=!0}r=[],u||n.parentNode.removeChild(n),n=null}setTimeout(function(){o.removeEvent(l,"load",s.uid),l.parentNode&&l.parentNode.removeChild(l);var t=s.getRuntime().getShimContainer();t.children.length||t.parentNode.removeChild(t),t=l=null,e()},1)}}var u,c,l;t.extend(this,{send:function(d,m){function h(){var i=y.getShimContainer()||document.body,r=document.createElement("div");r.innerHTML='<iframe id="'+f+'_iframe" name="'+f+'_iframe" src="javascript:&quot;&quot;" style="display:none"></iframe>',l=r.firstChild,i.appendChild(l),o.addEvent(l,"load",function(){var i;try{i=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(i.title)?u=i.title.replace(/^(\d+).*$/,"$1"):(u=200,c=t.trim(i.body.innerHTML),v.trigger({type:"progress",loaded:c.length,total:c.length}),x&&v.trigger({type:"uploadprogress",loaded:x.size||1025,total:x.size||1025}))}catch(r){if(!n.hasSameOrigin(d.url))return e.call(v,function(){v.trigger("error")}),void 0;u=404}e.call(v,function(){v.trigger("load")})},v.uid)}var f,p,g,x,v=this,y=v.getRuntime();if(u=c=null,m instanceof s&&m.hasBlob()){if(x=m.getBlob(),f=x.uid,g=i.get(f),p=i.get(f+"_form"),!p)throw new r.DOMException(r.DOMException.NOT_FOUND_ERR)}else f=t.guid("uid_"),p=document.createElement("form"),p.setAttribute("id",f+"_form"),p.setAttribute("method",d.method),p.setAttribute("enctype","multipart/form-data"),p.setAttribute("encoding","multipart/form-data"),y.getShimContainer().appendChild(p);p.setAttribute("target",f+"_iframe"),m instanceof s&&m.each(function(e,i){if(e instanceof a)g&&g.setAttribute("name",i);else{var n=document.createElement("input");t.extend(n,{type:"hidden",name:i,value:e}),g?p.insertBefore(n,g):p.appendChild(n)}}),p.setAttribute("action",d.url),h(),p.submit(),v.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===t.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*<pre[^>]*>/,"").replace(/<\/pre>\s*$/,""))}catch(i){return null}return c},abort:function(){var t=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),e.call(this,function(){t.dispatchEvent("abort")})}})}return e.XMLHttpRequest=u}),n("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),a(["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Dom","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/Blob","moxie/core/I18n","moxie/core/utils/Mime","moxie/file/FileInput","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events","moxie/runtime/html5/image/ResizerCanvas"])}(this)});
  6515. define("../libs/plupload/js/moxie.min", function(){});
  6516. /**
  6517. * Plupload - multi-runtime File Uploader
  6518. * v2.2.0
  6519. *
  6520. * Copyright 2013, Moxiecode Systems AB
  6521. * Released under GPL License.
  6522. *
  6523. * License: http://www.plupload.com/license
  6524. * Contributing: http://www.plupload.com/contributing
  6525. *
  6526. * Date: 2016-11-14
  6527. */
  6528. !function(e,t){var i=function(){var e={};return t.apply(e,arguments),e.plupload};"function"==typeof define&&define.amd?define("plupload",["./moxie"],i):"object"==typeof module&&module.exports?module.exports=i(require("./moxie")):e.plupload=i(e.moxie)}(this||window,function(e){!function(e,t,i){function n(e){function t(e,t,i){var r={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};r[e]?n[r[e]]=t:i||(n[e]=t)}var i=e.required_features,n={};return"string"==typeof i?l.each(i.split(/\s*,\s*/),function(e){t(e,!0)}):"object"==typeof i?l.each(i,function(e,i){t(i,e)}):i===!0&&(e.chunk_size>0&&(n.slice_blob=!0),l.isEmptyObj(e.resize)&&e.multipart||(n.send_binary_string=!0),l.each(e,function(e,i){t(i,!!e,!0)})),n}var r=window.setTimeout,s={},a=t.core.utils,o=t.runtime.Runtime,l={VERSION:"2.2.0",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:a.Mime.mimes,ua:a.Env,typeOf:a.Basic.typeOf,extend:a.Basic.extend,guid:a.Basic.guid,getAll:function(e){var t,i=[];"array"!==l.typeOf(e)&&(e=[e]);for(var n=e.length;n--;)t=l.get(e[n]),t&&i.push(t);return i.length?i:null},get:a.Dom.get,each:a.Basic.each,getPos:a.Dom.getPos,getSize:a.Dom.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g;return e?(""+e).replace(i,function(e){return t[e]?"&"+t[e]+";":e}):e},toArray:a.Basic.toArray,inArray:a.Basic.inArray,inSeries:a.Basic.inSeries,addI18n:t.core.I18n.addI18n,translate:t.core.I18n.translate,sprintf:a.Basic.sprintf,isEmptyObj:a.Basic.isEmptyObj,hasClass:a.Dom.hasClass,addClass:a.Dom.addClass,removeClass:a.Dom.removeClass,getStyle:a.Dom.getStyle,addEvent:a.Events.addEvent,removeEvent:a.Events.removeEvent,removeAllEvents:a.Events.removeAllEvents,cleanName:function(e){var t,i;for(i=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],t=0;t<i.length;t+=2)e=e.replace(i[t],i[t+1]);return e=e.replace(/\s+/g,"_"),e=e.replace(/[^a-z0-9_\-\.]+/gi,"")},buildUrl:function(e,t){var i="";return l.each(t,function(e,t){i+=(i?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(e)}),i&&(e+=(e.indexOf("?")>0?"&":"?")+i),e},formatSize:function(e){function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}if(e===i||/\D/.test(e))return l.translate("N/A");var n=Math.pow(1024,4);return e>n?t(e/n,1)+" "+l.translate("tb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("gb"):e>(n/=1024)?t(e/n,1)+" "+l.translate("mb"):e>1024?Math.round(e/1024)+" "+l.translate("kb"):e+" "+l.translate("b")},parseSize:a.Basic.parseSizeStr,predictRuntime:function(e,t){var i,n;return i=new l.Uploader(e),n=o.thatCan(i.getOption().required_features,t||e.runtimes),i.destroy(),n},addFileFilter:function(e,t){s[e]=t}};l.addFileFilter("mime_types",function(e,t,i){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:l.FILE_EXTENSION_ERROR,message:l.translate("File extension error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("max_file_size",function(e,t,i){var n;e=l.parseSize(e),t.size!==n&&e&&t.size>e?(this.trigger("Error",{code:l.FILE_SIZE_ERROR,message:l.translate("File size error."),file:t}),i(!1)):i(!0)}),l.addFileFilter("prevent_duplicates",function(e,t,i){if(e)for(var n=this.files.length;n--;)if(t.name===this.files[n].name&&t.size===this.files[n].size)return this.trigger("Error",{code:l.FILE_DUPLICATE_ERROR,message:l.translate("Duplicate file error."),file:t}),i(!1),void 0;i(!0)}),l.Uploader=function(e){function a(){var e,t,i=0;if(this.state==l.STARTED){for(t=0;t<T.length;t++)e||T[t].status!=l.QUEUED?i++:(e=T[t],this.trigger("BeforeUpload",e)&&(e.status=l.UPLOADING,this.trigger("UploadFile",e)));i==T.length&&(this.state!==l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged")),this.trigger("UploadComplete",T))}}function u(e){e.percent=e.size>0?Math.ceil(100*(e.loaded/e.size)):100,d()}function d(){var e,t;for(w.reset(),e=0;e<T.length;e++)t=T[e],t.size!==i?(w.size+=t.origSize,w.loaded+=t.loaded*t.origSize/t.size):w.size=i,t.status==l.DONE?w.uploaded++:t.status==l.FAILED?w.failed++:w.queued++;w.size===i?w.percent=T.length>0?Math.ceil(100*(w.uploaded/T.length)):0:(w.bytesPerSec=Math.ceil(w.loaded/((+new Date-S||1)/1e3)),w.percent=w.size>0?Math.ceil(100*(w.loaded/w.size)):0)}function c(){var e=A[0]||P[0];return e?e.getRuntime().uid:!1}function f(e,t){if(e.ruid){var i=o.getInfo(e.ruid);if(i)return i.can(t)}return!1}function p(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",y),this.bind("BeforeUpload",m),this.bind("UploadFile",E),this.bind("UploadProgress",v),this.bind("StateChanged",b),this.bind("QueueChanged",d),this.bind("Error",z),this.bind("FileUploaded",R),this.bind("Destroy",O)}function g(e,i){var n=this,r=0,s=[],a={runtime_order:e.runtimes,required_caps:e.required_features,preferred_caps:F,swf_url:e.flash_swf_url,xap_url:e.silverlight_xap_url};l.each(e.runtimes.split(/\s*,\s*/),function(t){e[t]&&(a[t]=e[t])}),e.browse_button&&l.each(e.browse_button,function(i){s.push(function(s){var u=new t.file.FileInput(l.extend({},a,{accept:e.filters.mime_types,name:e.file_data_name,multiple:e.multi_selection,container:e.container,browse_button:i}));u.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),r++,A.push(this),s()},u.onchange=function(){n.addFile(this.files)},u.bind("mouseenter mouseleave mousedown mouseup",function(t){U||(e.browse_button_hover&&("mouseenter"===t.type?l.addClass(i,e.browse_button_hover):"mouseleave"===t.type&&l.removeClass(i,e.browse_button_hover)),e.browse_button_active&&("mousedown"===t.type?l.addClass(i,e.browse_button_active):"mouseup"===t.type&&l.removeClass(i,e.browse_button_active)))}),u.bind("mousedown",function(){n.trigger("Browse")}),u.bind("error runtimeerror",function(){u=null,s()}),u.init()})}),e.drop_element&&l.each(e.drop_element,function(e){s.push(function(i){var s=new t.file.FileDrop(l.extend({},a,{drop_zone:e}));s.onready=function(){var e=o.getInfo(this.ruid);l.extend(n.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),dragdrop:e.can("drag_and_drop")}),r++,P.push(this),i()},s.ondrop=function(){n.addFile(this.files)},s.bind("error runtimeerror",function(){s=null,i()}),s.init()})}),l.inSeries(s,function(){"function"==typeof i&&i(r)})}function h(e,n,r){var s=new t.image.Image;try{s.onload=function(){return n.width>this.width&&n.height>this.height&&n.quality===i&&n.preserve_headers&&!n.crop?(this.destroy(),r(e)):(s.downsize(n.width,n.height,n.crop,n.preserve_headers),void 0)},s.onresize=function(){r(this.getAsBlob(e.type,n.quality)),this.destroy()},s.onerror=function(){r(e)},s.load(e)}catch(a){r(e)}}function _(e,i,r){function s(e,i,n){var r=I[e];switch(e){case"max_file_size":"max_file_size"===e&&(I.max_file_size=I.filters.max_file_size=i);break;case"chunk_size":(i=l.parseSize(i))&&(I[e]=i,I.send_file_name=!0);break;case"multipart":I[e]=i,i||(I.send_file_name=!0);break;case"unique_names":I[e]=i,i&&(I.send_file_name=!0);break;case"filters":"array"===l.typeOf(i)&&(i={mime_types:i}),n?l.extend(I.filters,i):I.filters=i,i.mime_types&&("string"===l.typeOf(i.mime_types)&&(i.mime_types=t.core.utils.Mime.mimes2extList(i.mime_types)),i.mime_types.regexp=function(e){var t=[];return l.each(e,function(e){l.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?t.push("\\.*"):t.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+t.join("|")+")$","i")}(i.mime_types),I.filters.mime_types=i.mime_types);break;case"resize":I.resize=i?l.extend({preserve_headers:!0,crop:!1},i):!1;break;case"prevent_duplicates":I.prevent_duplicates=I.filters.prevent_duplicates=!!i;break;case"container":case"browse_button":case"drop_element":i="container"===e?l.get(i):l.getAll(i);case"runtimes":case"multi_selection":case"flash_swf_url":case"silverlight_xap_url":I[e]=i,n||(u=!0);break;default:I[e]=i}n||a.trigger("OptionChanged",e,i,r)}var a=this,u=!1;"object"==typeof e?l.each(e,function(e,t){s(t,e,r)}):s(e,i,r),r?(I.required_features=n(l.extend({},I)),F=n(l.extend({},I,{required_features:!0}))):u&&(a.trigger("Destroy"),g.call(a,I,function(e){e?(a.runtime=o.getInfo(c()).type,a.trigger("Init",{runtime:a.runtime}),a.trigger("PostInit")):a.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}))}function m(e,t){if(e.settings.unique_names){var i=t.name.match(/\.([^.]+)$/),n="part";i&&(n=i[1]),t.target_name=t.id+"."+n}}function E(e,i){function n(){d-->0?r(s,1e3):(i.loaded=p,e.trigger("Error",{code:l.HTTP_ERROR,message:l.translate("HTTP Error."),file:i,response:D.responseText,status:D.status,responseHeaders:D.getAllResponseHeaders()}))}function s(){var f,g,h,_={};i.status===l.UPLOADING&&e.state!==l.STOPPED&&(e.settings.send_file_name&&(_.name=i.target_name||i.name),u&&c.chunks&&a.size>u?(h=Math.min(u,a.size-p),f=a.slice(p,p+h)):(h=a.size,f=a),u&&c.chunks&&(e.settings.send_chunk_number?(_.chunk=Math.ceil(p/u),_.chunks=Math.ceil(a.size/u)):(_.offset=p,_.total=a.size)),D=new t.xhr.XMLHttpRequest,D.upload&&(D.upload.onprogress=function(t){i.loaded=Math.min(i.size,p+t.loaded),e.trigger("UploadProgress",i)}),D.onload=function(){return D.status>=400?(n(),void 0):(d=e.settings.max_retries,h<a.size?(f.destroy(),p+=h,i.loaded=Math.min(p,a.size),e.trigger("ChunkUploaded",i,{offset:i.loaded,total:a.size,response:D.responseText,status:D.status,responseHeaders:D.getAllResponseHeaders()}),"Android Browser"===l.ua.browser&&e.trigger("UploadProgress",i)):i.loaded=i.size,f=g=null,!p||p>=a.size?(i.size!=i.origSize&&(a.destroy(),a=null),e.trigger("UploadProgress",i),i.status=l.DONE,e.trigger("FileUploaded",i,{response:D.responseText,status:D.status,responseHeaders:D.getAllResponseHeaders()})):r(s,1),void 0)},D.onerror=function(){n()},D.onloadend=function(){this.destroy(),D=null},e.settings.multipart&&c.multipart?(D.open("post",o,!0),l.each(e.settings.headers,function(e,t){D.setRequestHeader(t,e)}),g=new t.xhr.FormData,l.each(l.extend(_,e.settings.multipart_params),function(e,t){g.append(t,e)}),g.append(e.settings.file_data_name,f),D.send(g,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:F,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})):(o=l.buildUrl(e.settings.url,l.extend(_,e.settings.multipart_params)),D.open("post",o,!0),D.setRequestHeader("Content-Type","application/octet-stream"),l.each(e.settings.headers,function(e,t){D.setRequestHeader(t,e)}),D.send(f,{runtime_order:e.settings.runtimes,required_caps:e.settings.required_features,preferred_caps:F,swf_url:e.settings.flash_swf_url,xap_url:e.settings.silverlight_xap_url})))}var a,o=e.settings.url,u=e.settings.chunk_size,d=e.settings.max_retries,c=e.features,p=0;i.loaded&&(p=i.loaded=u?u*Math.floor(i.loaded/u):0),a=i.getSource(),!l.isEmptyObj(e.settings.resize)&&f(a,"send_binary_string")&&-1!==l.inArray(a.type,["image/jpeg","image/png"])?h.call(this,a,e.settings.resize,function(e){a=e,i.size=e.size,s()}):s()}function v(e,t){u(t)}function b(e){if(e.state==l.STARTED)S=+new Date;else if(e.state==l.STOPPED)for(var t=e.files.length-1;t>=0;t--)e.files[t].status==l.UPLOADING&&(e.files[t].status=l.QUEUED,d())}function y(){D&&D.abort()}function R(e){d(),r(function(){a.call(e)},1)}function z(e,t){t.code===l.INIT_ERROR?e.destroy():t.code===l.HTTP_ERROR&&(t.file.status=l.FAILED,u(t.file),e.state==l.STARTED&&(e.trigger("CancelUpload"),r(function(){a.call(e)},1)))}function O(e){e.stop(),l.each(T,function(e){e.destroy()}),T=[],A.length&&(l.each(A,function(e){e.destroy()}),A=[]),P.length&&(l.each(P,function(e){e.destroy()}),P=[]),F={},U=!1,S=D=null,w.reset()}var I,S,w,D,x=l.guid(),T=[],F={},A=[],P=[],U=!1;I={runtimes:o.order,max_retries:0,chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:"file",flash_swf_url:"js/Moxie.swf",silverlight_xap_url:"js/Moxie.xap",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},resize:!1,send_file_name:!0,send_chunk_number:!0},_.call(this,e,null,!0),w=new l.QueueProgress,l.extend(this,{id:x,uid:x,state:l.STOPPED,features:{},runtime:null,files:T,settings:I,total:w,init:function(){var e,t,i=this;return e=i.getOption("preinit"),"function"==typeof e?e(i):l.each(e,function(e,t){i.bind(t,e)}),p.call(i),l.each(["container","browse_button","drop_element"],function(e){return null===i.getOption(e)?(t={code:l.INIT_ERROR,message:l.sprintf(l.translate("%s specified, but cannot be found."),e)},!1):void 0}),t?i.trigger("Error",t):I.browse_button||I.drop_element?(g.call(i,I,function(e){var t=i.getOption("init");"function"==typeof t?t(i):l.each(t,function(e,t){i.bind(t,e)}),e?(i.runtime=o.getInfo(c()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("Init error.")})}),void 0):i.trigger("Error",{code:l.INIT_ERROR,message:l.translate("You must specify either browse_button or drop_element.")})},setOption:function(e,t){_.call(this,e,t,!this.runtime)},getOption:function(e){return e?I[e]:I},refresh:function(){A.length&&l.each(A,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=l.STARTED&&(this.state=l.STARTED,this.trigger("StateChanged"),a.call(this))},stop:function(){this.state!=l.STOPPED&&(this.state=l.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){U=arguments[0]!==i?arguments[0]:!0,A.length&&l.each(A,function(e){e.disable(U)}),this.trigger("DisableBrowse",U)},getFile:function(e){var t;for(t=T.length-1;t>=0;t--)if(T[t].id===e)return T[t]},addFile:function(e,i){function n(e,t){var i=[];l.each(u.settings.filters,function(t,n){s[n]&&i.push(function(i){s[n].call(u,t,e,function(e){i(!e)})})}),l.inSeries(i,t)}function a(e){var s=l.typeOf(e);if(e instanceof t.file.File){if(!e.ruid&&!e.isDetached()){if(!o)return!1;e.ruid=o,e.connectRuntime(o)}a(new l.File(e))}else e instanceof t.file.Blob?(a(e.getSource()),e.destroy()):e instanceof l.File?(i&&(e.name=i),d.push(function(t){n(e,function(i){i||(T.push(e),f.push(e),u.trigger("FileFiltered",e)),r(t,1)})})):-1!==l.inArray(s,["file","blob"])?a(new t.file.File(null,e)):"node"===s&&"filelist"===l.typeOf(e.files)?l.each(e.files,a):"array"===s&&(i=null,l.each(e,a))}var o,u=this,d=[],f=[];o=c(),a(e),d.length&&l.inSeries(d,function(){f.length&&u.trigger("FilesAdded",f)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,i=T.length-1;i>=0;i--)if(T[i].id===t)return this.splice(i,1)[0]},splice:function(e,t){var n=T.splice(e===i?0:e,t===i?T.length:t),r=!1;return this.state==l.STARTED&&(l.each(n,function(e){return e.status===l.UPLOADING?(r=!0,!1):void 0}),r&&this.stop()),this.trigger("FilesRemoved",n),l.each(n,function(e){e.destroy()}),r&&this.start(),n},dispatchEvent:function(e){var t,i;if(e=e.toLowerCase(),t=this.hasEventListener(e)){t.sort(function(e,t){return t.priority-e.priority}),i=[].slice.call(arguments),i.shift(),i.unshift(this);for(var n=0;n<t.length;n++)if(t[n].fn.apply(t[n].scope,i)===!1)return!1}return!0},bind:function(e,t,i,n){l.Uploader.prototype.bind.call(this,e,t,n,i)},destroy:function(){this.trigger("Destroy"),I=w=null,this.unbindAll()}})},l.Uploader.prototype=t.core.EventTarget.instance,l.File=function(){function e(e){l.extend(this,{id:l.guid(),name:e.name||e.fileName,type:e.type||"",size:e.size||e.fileSize,origSize:e.size||e.fileSize,loaded:0,percent:0,status:l.QUEUED,lastModifiedDate:e.lastModifiedDate||(new Date).toLocaleString(),getNative:function(){var e=this.getSource().getSource();return-1!==l.inArray(l.typeOf(e),["blob","file"])?e:null},getSource:function(){return t[this.id]?t[this.id]:null},destroy:function(){var e=this.getSource();e&&(e.destroy(),delete t[this.id])}}),t[this.id]=e}var t={};return e}(),l.QueueProgress=function(){var e=this;e.size=0,e.loaded=0,e.uploaded=0,e.failed=0,e.queued=0,e.percent=0,e.bytesPerSec=0,e.reset=function(){e.size=e.loaded=e.uploaded=e.failed=e.queued=e.percent=e.bytesPerSec=0}},e.plupload=l}(this,e)});
  6529. define('upload',['jquery', 'bootstrap', 'backend', 'config', 'plupload'], function ($, undefined, Backend, Config, Plupload) {
  6530. var Upload = {
  6531. list: {},
  6532. config: {
  6533. container: document.body,
  6534. classname: '.plupload',
  6535. },
  6536. api: {
  6537. //Plupload上传
  6538. plupload: function (element, onAfterUpload) {
  6539. element = typeof element == 'undefined' ? Upload.config.classname : element;
  6540. $(element, Upload.config.container).each(function () {
  6541. var id = $(this).prop("id");
  6542. var url = $(this).data("url");
  6543. var maxsize = $(this).data("maxsize");
  6544. var mimetype = $(this).data("mimetype");
  6545. var multipart = $(this).data("multipart");
  6546. //上传URL
  6547. url = url ? url : Config.upload.uploadurl;
  6548. //最大可上传
  6549. maxsize = maxsize ? maxsize : Config.upload.maxsize;
  6550. //文件类型
  6551. mimetype = mimetype ? mimetype : Config.upload.mimetype;
  6552. //请求的表单参数
  6553. multipart = multipart ? multipart : Config.upload.multipart;
  6554. Upload.list[id] = new Plupload.Uploader({
  6555. runtimes: 'html5,flash,silverlight,html4',
  6556. multi_selection: false, //是否允许多选批量上传
  6557. browse_button: id, // you can pass an id...
  6558. container: $(this).parent().get(0), //取按钮的上级元素
  6559. flash_swf_url: '/assets/libs/plupload/js/Moxie.swf',
  6560. silverlight_xap_url: '/assets/libs/plupload/js/Moxie.xap',
  6561. filters: {
  6562. max_file_size: maxsize,
  6563. mime_types: mimetype
  6564. },
  6565. url: url,
  6566. multipart_params: multipart,
  6567. init: {
  6568. PostInit: function () {
  6569. },
  6570. FilesAdded: function (up, files) {
  6571. Plupload.each(files, function (file) {
  6572. //这里可以改成其它的表现形式
  6573. //document.getElementById('filelist').innerHTML += '<div id="' + file.id + '">' + file.name + ' (' + plupload.formatSize(file.size) + ') <b></b></div>';
  6574. });
  6575. $("#" + id).data("bakup-html", $("#" + id).html());
  6576. //添加后立即上传
  6577. setTimeout(function () {
  6578. Upload.list[id].start();
  6579. }, 1);
  6580. },
  6581. UploadProgress: function (up, file) {
  6582. //这里可以改成其它的表现形式
  6583. //document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '<span>' + file.percent + "%</span>";
  6584. $("#" + id).prop("disabled", true).html("<i class='fa fa-upload'></i> 上传" + file.percent + "%");
  6585. },
  6586. FileUploaded: function (up, file, info) {
  6587. //还原按钮文字及状态
  6588. $("#" + id).prop("disabled", false).html($("#" + id).data("bakup-html"));
  6589. //这里可以改成其它的表现形式
  6590. //document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML += (' [Url]: ' + '<a href="' + url + '" target="_blank">' + url + '</a>');
  6591. //这里建议不修改
  6592. try {
  6593. var data = JSON.parse(info.response);
  6594. if (data.hasOwnProperty('code')) {
  6595. data.code = data.code == 200 ? 0 : data.code;
  6596. if (data.hasOwnProperty("url")) {
  6597. data.content = data.url;
  6598. }
  6599. $("input[data-plupload-id='" + id + "-text']").val(data.content);
  6600. var afterUpload = $("#" + id).data("after-upload");
  6601. if (afterUpload && typeof Upload.api.custom[afterUpload] == 'function') {
  6602. Upload.api.custom[afterUpload].call(info, id, data);
  6603. }
  6604. if (typeof onAfterUpload == 'function') {
  6605. onAfterUpload.call(info, id, data);
  6606. }
  6607. } else {
  6608. Toastr.error(e.message + "(code:-2)");
  6609. }
  6610. } catch (e) {
  6611. Toastr.error(e.message + "(code:-1)");
  6612. }
  6613. },
  6614. Error: function (up, err) {
  6615. Toastr.error(err.message + "(code:" + err.code + ")");
  6616. }
  6617. }
  6618. });
  6619. Upload.list[id].init();
  6620. });
  6621. },
  6622. // AJAX异步上传,主要用于Summernote上传回调
  6623. send: function (file, callback) {
  6624. var data = new FormData();
  6625. data.append("file", file);
  6626. $.each(Config.upload.multipart, function (k, v) {
  6627. data.append(k, v);
  6628. });
  6629. $.ajax({
  6630. url: Config.upload.uploadurl,
  6631. data: data,
  6632. cache: false,
  6633. contentType: false,
  6634. processData: false,
  6635. type: 'POST',
  6636. dataType: 'json',
  6637. success: function (data) {
  6638. if (data.hasOwnProperty("code")) {
  6639. data.code = data.code == 200 ? 1 : data.code;
  6640. if (data.hasOwnProperty("url")) {
  6641. data.content = data.url;
  6642. }
  6643. var content = data.hasOwnProperty("content") && data.content != "" ? data.content : "";
  6644. if (data.code === 1) {
  6645. // 如果回调存在,则直接调用回调
  6646. if (typeof callback == 'function') {
  6647. callback.call(this, data);
  6648. } else {
  6649. Toastr.success(content ? content : __('Operation completed'));
  6650. }
  6651. } else {
  6652. Toastr.error(content ? content : __('Operation failed'));
  6653. }
  6654. } else {
  6655. Toastr.error(__('Unknown data format'));
  6656. }
  6657. }, error: function () {
  6658. Toastr.error(__('Network error'));
  6659. }
  6660. });
  6661. },
  6662. custom: {
  6663. //自定义上传完成回调
  6664. afteruploadcallback: function (id, response) {
  6665. console.log(this, id, response);
  6666. alert("Custom Callback,Response URL:" + response.url);
  6667. },
  6668. },
  6669. }
  6670. };
  6671. return Upload;
  6672. });
  6673. /*!
  6674. * Validator v0.11.9 for Bootstrap 3, by @1000hz
  6675. * Copyright 2017 Cina Saffary
  6676. * Licensed under http://opensource.org/licenses/MIT
  6677. *
  6678. * https://github.com/1000hz/bootstrap-validator
  6679. */
  6680. +function(a){"use strict";function b(b){return b.is('[type="checkbox"]')?b.prop("checked"):b.is('[type="radio"]')?!!a('[name="'+b.attr("name")+'"]:checked').length:b.is("select[multiple]")?(b.val()||[]).length:b.val()}function c(b){return this.each(function(){var c=a(this),e=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b),f=c.data("bs.validator");(f||"destroy"!=b)&&(f||c.data("bs.validator",f=new d(this,e)),"string"==typeof b&&f[b]())})}var d=function(c,e){this.options=e,this.validators=a.extend({},d.VALIDATORS,e.custom),this.$element=a(c),this.$btn=a('button[type="submit"], input[type="submit"]').filter('[form="'+this.$element.attr("id")+'"]').add(this.$element.find('input[type="submit"], button[type="submit"]')),this.update(),this.$element.on("input.bs.validator change.bs.validator focusout.bs.validator",a.proxy(this.onInput,this)),this.$element.on("submit.bs.validator",a.proxy(this.onSubmit,this)),this.$element.on("reset.bs.validator",a.proxy(this.reset,this)),this.$element.find("[data-match]").each(function(){var c=a(this),d=c.attr("data-match");a(d).on("input.bs.validator",function(){b(c)&&c.trigger("input.bs.validator")})}),this.$inputs.filter(function(){return b(a(this))&&!a(this).closest(".has-error").length}).trigger("focusout"),this.$element.attr("novalidate",!0)};d.VERSION="0.11.9",d.INPUT_SELECTOR=':input:not([type="hidden"], [type="submit"], [type="reset"], button)',d.FOCUS_OFFSET=20,d.DEFAULTS={delay:500,html:!1,disable:!0,focus:!0,custom:{},errors:{match:"Does not match",minlength:"Not long enough"},feedback:{success:"glyphicon-ok",error:"glyphicon-remove"}},d.VALIDATORS={"native":function(a){var b=a[0];return b.checkValidity?!b.checkValidity()&&!b.validity.valid&&(b.validationMessage||"error!"):void 0},match:function(b){var c=b.attr("data-match");return b.val()!==a(c).val()&&d.DEFAULTS.errors.match},minlength:function(a){var b=a.attr("data-minlength");return a.val().length<b&&d.DEFAULTS.errors.minlength}},d.prototype.update=function(){var b=this;return this.$inputs=this.$element.find(d.INPUT_SELECTOR).add(this.$element.find('[data-validate="true"]')).not(this.$element.find('[data-validate="false"]').each(function(){b.clearErrors(a(this))})),this.toggleSubmit(),this},d.prototype.onInput=function(b){var c=this,d=a(b.target),e="focusout"!==b.type;this.$inputs.is(d)&&this.validateInput(d,e).done(function(){c.toggleSubmit()})},d.prototype.validateInput=function(c,d){var e=(b(c),c.data("bs.validator.errors"));c.is('[type="radio"]')&&(c=this.$element.find('input[name="'+c.attr("name")+'"]'));var f=a.Event("validate.bs.validator",{relatedTarget:c[0]});if(this.$element.trigger(f),!f.isDefaultPrevented()){var g=this;return this.runValidators(c).done(function(b){c.data("bs.validator.errors",b),b.length?d?g.defer(c,g.showErrors):g.showErrors(c):g.clearErrors(c),e&&b.toString()===e.toString()||(f=b.length?a.Event("invalid.bs.validator",{relatedTarget:c[0],detail:b}):a.Event("valid.bs.validator",{relatedTarget:c[0],detail:e}),g.$element.trigger(f)),g.toggleSubmit(),g.$element.trigger(a.Event("validated.bs.validator",{relatedTarget:c[0]}))})}},d.prototype.runValidators=function(c){function d(a){return c.attr("data-"+a+"-error")}function e(){var a=c[0].validity;return a.typeMismatch?c.attr("data-type-error"):a.patternMismatch?c.attr("data-pattern-error"):a.stepMismatch?c.attr("data-step-error"):a.rangeOverflow?c.attr("data-max-error"):a.rangeUnderflow?c.attr("data-min-error"):a.valueMissing?c.attr("data-required-error"):null}function f(){return c.attr("data-error")}function g(a){return d(a)||e()||f()}var h=[],i=a.Deferred();return c.data("bs.validator.deferred")&&c.data("bs.validator.deferred").reject(),c.data("bs.validator.deferred",i),a.each(this.validators,a.proxy(function(a,d){var e=null;!b(c)&&!c.attr("required")||void 0===c.attr("data-"+a)&&"native"!=a||!(e=d.call(this,c))||(e=g(a)||e,!~h.indexOf(e)&&h.push(e))},this)),!h.length&&b(c)&&c.attr("data-remote")?this.defer(c,function(){var d={};d[c.attr("name")]=b(c),a.get(c.attr("data-remote"),d).fail(function(a,b,c){h.push(g("remote")||c)}).always(function(){i.resolve(h)})}):i.resolve(h),i.promise()},d.prototype.validate=function(){var b=this;return a.when(this.$inputs.map(function(){return b.validateInput(a(this),!1)})).then(function(){b.toggleSubmit(),b.focusError()}),this},d.prototype.focusError=function(){if(this.options.focus){var b=this.$element.find(".has-error:first :input");0!==b.length&&(a("html, body").animate({scrollTop:b.offset().top-d.FOCUS_OFFSET},250),b.focus())}},d.prototype.showErrors=function(b){var c=this.options.html?"html":"text",d=b.data("bs.validator.errors"),e=b.closest(".form-group"),f=e.find(".help-block.with-errors"),g=e.find(".form-control-feedback");d.length&&(d=a("<ul/>").addClass("list-unstyled").append(a.map(d,function(b){return a("<li/>")[c](b)})),void 0===f.data("bs.validator.originalContent")&&f.data("bs.validator.originalContent",f.html()),f.empty().append(d),e.addClass("has-error has-danger"),e.hasClass("has-feedback")&&g.removeClass(this.options.feedback.success)&&g.addClass(this.options.feedback.error)&&e.removeClass("has-success"))},d.prototype.clearErrors=function(a){var c=a.closest(".form-group"),d=c.find(".help-block.with-errors"),e=c.find(".form-control-feedback");d.html(d.data("bs.validator.originalContent")),c.removeClass("has-error has-danger has-success"),c.hasClass("has-feedback")&&e.removeClass(this.options.feedback.error)&&e.removeClass(this.options.feedback.success)&&b(a)&&e.addClass(this.options.feedback.success)&&c.addClass("has-success")},d.prototype.hasErrors=function(){function b(){return!!(a(this).data("bs.validator.errors")||[]).length}return!!this.$inputs.filter(b).length},d.prototype.isIncomplete=function(){function c(){var c=b(a(this));return!("string"==typeof c?a.trim(c):c)}return!!this.$inputs.filter("[required]").filter(c).length},d.prototype.onSubmit=function(a){this.validate(),(this.isIncomplete()||this.hasErrors())&&a.preventDefault()},d.prototype.toggleSubmit=function(){this.options.disable&&this.$btn.toggleClass("disabled",this.isIncomplete()||this.hasErrors())},d.prototype.defer=function(b,c){return c=a.proxy(c,this,b),this.options.delay?(window.clearTimeout(b.data("bs.validator.timeout")),void b.data("bs.validator.timeout",window.setTimeout(c,this.options.delay))):c()},d.prototype.reset=function(){return this.$element.find(".form-control-feedback").removeClass(this.options.feedback.error).removeClass(this.options.feedback.success),this.$inputs.removeData(["bs.validator.errors","bs.validator.deferred"]).each(function(){var b=a(this),c=b.data("bs.validator.timeout");window.clearTimeout(c)&&b.removeData("bs.validator.timeout")}),this.$element.find(".help-block.with-errors").each(function(){var b=a(this),c=b.data("bs.validator.originalContent");b.removeData("bs.validator.originalContent").html(c)}),this.$btn.removeClass("disabled"),this.$element.find(".has-error, .has-danger, .has-success").removeClass("has-error has-danger has-success"),this},d.prototype.destroy=function(){return this.reset(),this.$element.removeAttr("novalidate").removeData("bs.validator").off(".bs.validator"),this.$inputs.off(".bs.validator"),this.options=null,this.validators=null,this.$element=null,this.$btn=null,this.$inputs=null,this};var e=a.fn.validator;a.fn.validator=c,a.fn.validator.Constructor=d,a.fn.validator.noConflict=function(){return a.fn.validator=e,this},a(window).on("load",function(){a('form[data-toggle="validator"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery);
  6681. define("bootstrap-validator", function(){});
  6682. !function ($) {
  6683. /* CHECKBOX PUBLIC CLASS DEFINITION
  6684. * ============================== */
  6685. var Checkbox = function (element, options) {
  6686. this.init(element, options);
  6687. }
  6688. Checkbox.prototype = {
  6689. constructor: Checkbox
  6690. , init: function (element, options) {
  6691. var $el = this.$element = $(element)
  6692. this.options = $.extend({}, $.fn.checkbox.defaults, options);
  6693. $el.before(this.options.template);
  6694. this.setState();
  6695. }
  6696. , setState: function () {
  6697. var $el = this.$element
  6698. , $parent = $el.closest('.checkbox');
  6699. $el.prop('disabled') && $parent.addClass('disabled');
  6700. $el.prop('checked') && $parent.addClass('checked');
  6701. }
  6702. , toggle: function () {
  6703. var ch = 'checked'
  6704. , $el = this.$element
  6705. , $parent = $el.closest('.checkbox')
  6706. , checked = $el.prop(ch)
  6707. , e = $.Event('toggle')
  6708. if ($el.prop('disabled') == false) {
  6709. $parent.toggleClass(ch) && checked ? $el.removeAttr(ch) : $el.prop(ch, ch);
  6710. $el.trigger(e).trigger('change');
  6711. }
  6712. }
  6713. , setCheck: function (option) {
  6714. var d = 'disabled'
  6715. , ch = 'checked'
  6716. , $el = this.$element
  6717. , $parent = $el.closest('.checkbox')
  6718. , checkAction = option == 'check' ? true : false
  6719. , e = $.Event(option)
  6720. $parent[checkAction ? 'addClass' : 'removeClass' ](ch) && checkAction ? $el.prop(ch, ch) : $el.removeAttr(ch);
  6721. $el.trigger(e).trigger('change');
  6722. }
  6723. }
  6724. /* CHECKBOX PLUGIN DEFINITION
  6725. * ======================== */
  6726. var old = $.fn.checkbox
  6727. $.fn.checkbox = function (option) {
  6728. return this.each(function () {
  6729. var $this = $(this)
  6730. , data = $this.data('checkbox')
  6731. , options = $.extend({}, $.fn.checkbox.defaults, $this.data(), typeof option == 'object' && option);
  6732. if (!data)
  6733. $this.data('checkbox', (data = new Checkbox(this, options)));
  6734. if (option == 'toggle')
  6735. data.toggle()
  6736. if (option == 'check' || option == 'uncheck')
  6737. data.setCheck(option)
  6738. else if (option)
  6739. data.setState();
  6740. });
  6741. }
  6742. $.fn.checkbox.defaults = {
  6743. template: '<span class="icons"><span class="first-icon fa fa-square-o"></span><span class="second-icon fa fa-check-square-o"></span></span>'
  6744. }
  6745. /* CHECKBOX NO CONFLICT
  6746. * ================== */
  6747. $.fn.checkbox.noConflict = function () {
  6748. $.fn.checkbox = old;
  6749. return this;
  6750. }
  6751. /* CHECKBOX DATA-API
  6752. * =============== */
  6753. $(document).on('click.checkbox.data-api', '[data-toggle^=checkbox], .checkbox', function (e) {
  6754. var $checkbox = $(e.target);
  6755. if (e.target.tagName != "A") {
  6756. e && e.preventDefault() && e.stopPropagation();
  6757. if (!$checkbox.hasClass('checkbox'))
  6758. $checkbox = $checkbox.closest('.checkbox');
  6759. $checkbox.find(':checkbox').checkbox('toggle');
  6760. }
  6761. });
  6762. $(function () {
  6763. $('[data-toggle="checkbox"]').each(function () {
  6764. var $checkbox = $(this);
  6765. $checkbox.checkbox();
  6766. });
  6767. });
  6768. }(window.jQuery);
  6769. define("bootstrap-checkbox", ["jquery"], function(){});
  6770. /* =============================================================
  6771. * flatui-radio v0.0.3
  6772. * ============================================================ */
  6773. !function ($) {
  6774. /* RADIO PUBLIC CLASS DEFINITION
  6775. * ============================== */
  6776. var Radio = function (element, options) {
  6777. this.init(element, options);
  6778. }
  6779. Radio.prototype = {
  6780. constructor: Radio
  6781. , init: function (element, options) {
  6782. var $el = this.$element = $(element)
  6783. this.options = $.extend({}, $.fn.radio.defaults, options);
  6784. $el.before(this.options.template);
  6785. this.setState();
  6786. }
  6787. , setState: function () {
  6788. var $el = this.$element
  6789. , $parent = $el.closest('.radio');
  6790. $el.prop('disabled') && $parent.addClass('disabled');
  6791. $el.prop('checked') && $parent.addClass('checked');
  6792. }
  6793. , toggle: function () {
  6794. var d = 'disabled'
  6795. , ch = 'checked'
  6796. , $el = this.$element
  6797. , checked = $el.prop(ch)
  6798. , $parent = $el.closest('.radio')
  6799. , $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
  6800. , $elemGroup = $parentWrap.find(':radio[name="' + $el.attr('name') + '"]')
  6801. , e = $.Event('toggle')
  6802. if ($el.prop(d) == false) {
  6803. $elemGroup.not($el).each(function () {
  6804. var $el = $(this)
  6805. , $parent = $(this).closest('.radio');
  6806. if ($el.prop(d) == false) {
  6807. $parent.removeClass(ch) && $el.removeAttr(ch).trigger('change');
  6808. }
  6809. });
  6810. if (checked == false)
  6811. $parent.addClass(ch) && $el.prop(ch, true);
  6812. $el.trigger(e);
  6813. if (checked !== $el.prop(ch)) {
  6814. $el.trigger('change');
  6815. }
  6816. }
  6817. }
  6818. , setCheck: function (option) {
  6819. var ch = 'checked'
  6820. , $el = this.$element
  6821. , $parent = $el.closest('.radio')
  6822. , checkAction = option == 'check' ? true : false
  6823. , checked = $el.prop(ch)
  6824. , $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
  6825. , $elemGroup = $parentWrap.find(':radio[name="' + $el['attr']('name') + '"]')
  6826. , e = $.Event(option)
  6827. $elemGroup.not($el).each(function () {
  6828. var $el = $(this)
  6829. , $parent = $(this).closest('.radio');
  6830. $parent.removeClass(ch) && $el.removeAttr(ch);
  6831. });
  6832. $parent[checkAction ? 'addClass' : 'removeClass'](ch) && checkAction ? $el.prop(ch, ch) : $el.removeAttr(ch);
  6833. $el.trigger(e);
  6834. if (checked !== $el.prop(ch)) {
  6835. $el.trigger('change');
  6836. }
  6837. }
  6838. }
  6839. /* RADIO PLUGIN DEFINITION
  6840. * ======================== */
  6841. var old = $.fn.radio
  6842. $.fn.radio = function (option) {
  6843. return this.each(function () {
  6844. var $this = $(this)
  6845. , data = $this.data('radio')
  6846. , options = $.extend({}, $.fn.radio.defaults, $this.data(), typeof option == 'object' && option);
  6847. if (!data)
  6848. $this.data('radio', (data = new Radio(this, options)));
  6849. if (option == 'toggle')
  6850. data.toggle()
  6851. if (option == 'check' || option == 'uncheck')
  6852. data.setCheck(option)
  6853. else if (option)
  6854. data.setState();
  6855. });
  6856. }
  6857. $.fn.radio.defaults = {
  6858. template: '<span class="icons"><span class="first-icon fa fa-circle-o"></span><span class="second-icon fa fa-dot-circle-o"></span></span>'
  6859. }
  6860. /* RADIO NO CONFLICT
  6861. * ================== */
  6862. $.fn.radio.noConflict = function () {
  6863. $.fn.radio = old;
  6864. return this;
  6865. }
  6866. /* RADIO DATA-API
  6867. * =============== */
  6868. $(document).on('click.radio.data-api', '[data-toggle^=radio], .radio', function (e) {
  6869. var $radio = $(e.target);
  6870. e && e.preventDefault() && e.stopPropagation();
  6871. if (!$radio.hasClass('radio'))
  6872. $radio = $radio.closest('.radio');
  6873. $radio.find(':radio').radio('toggle');
  6874. });
  6875. $(function () {
  6876. $('[data-toggle="radio"]').each(function () {
  6877. var $radio = $(this);
  6878. $radio.radio();
  6879. });
  6880. });
  6881. }(window.jQuery);
  6882. define("bootstrap-radio", ["jquery"], function(){});
  6883. /* ============================================================
  6884. * bootstrapSwitch v1.3 by Larentis Mattia @spiritualGuru
  6885. * http://www.larentis.eu/switch/
  6886. * ============================================================
  6887. * Licensed under the Apache License, Version 2.0
  6888. * http://www.apache.org/licenses/LICENSE-2.0
  6889. * ============================================================ */
  6890. !function ($) {
  6891. "use strict";
  6892. $.fn['bootstrapSwitch'] = function (method) {
  6893. var methods = {
  6894. init: function () {
  6895. return this.each(function () {
  6896. var $element = $(this)
  6897. , $div
  6898. , $switchLeft
  6899. , $switchRight
  6900. , $label
  6901. , myClasses = ""
  6902. , classes = $element.attr('class')
  6903. , color
  6904. , moving
  6905. , onLabel = "开"
  6906. , offLabel = "关"
  6907. , icon = false;
  6908. $.each(['switch-mini', 'switch-small', 'switch-large'], function (i, el) {
  6909. if (classes.indexOf(el) >= 0)
  6910. myClasses = el;
  6911. });
  6912. $element.addClass('has-switch');
  6913. if ($element.data('on') !== undefined)
  6914. color = "switch-" + $element.data('on');
  6915. if ($element.data('on-label') !== undefined)
  6916. onLabel = $element.data('on-label');
  6917. if ($element.data('off-label') !== undefined)
  6918. offLabel = $element.data('off-label');
  6919. if ($element.data('icon') !== undefined)
  6920. icon = $element.data('icon');
  6921. $switchLeft = $('<span>')
  6922. .addClass("switch-left")
  6923. .addClass(myClasses)
  6924. .addClass(color)
  6925. .html(onLabel);
  6926. color = '';
  6927. if ($element.data('off') !== undefined)
  6928. color = "switch-" + $element.data('off');
  6929. $switchRight = $('<span>')
  6930. .addClass("switch-right")
  6931. .addClass(myClasses)
  6932. .addClass(color)
  6933. .html(offLabel);
  6934. $label = $('<label>')
  6935. .html("&nbsp;")
  6936. .addClass(myClasses)
  6937. .attr('for', $element.find('input').attr('id'));
  6938. if (icon) {
  6939. $label.html('<i class="' + icon + '"></i>');
  6940. }
  6941. $div = $element.find(':checkbox').wrap($('<div>')).parent().data('animated', false);
  6942. if ($element.data('animated') !== false)
  6943. $div.addClass('switch-animate').data('animated', true);
  6944. $div
  6945. .append($switchLeft)
  6946. .append($label)
  6947. .append($switchRight);
  6948. $element.find('>div').addClass(
  6949. $element.find('input').is(':checked') ? 'switch-on' : 'switch-off'
  6950. );
  6951. if ($element.find('input').is(':disabled'))
  6952. $(this).addClass('deactivate');
  6953. var changeStatus = function ($this) {
  6954. $this.siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
  6955. };
  6956. $element.on('keydown', function (e) {
  6957. if (e.keyCode === 32) {
  6958. e.stopImmediatePropagation();
  6959. e.preventDefault();
  6960. changeStatus($(e.target).find('span:first'));
  6961. }
  6962. });
  6963. $switchLeft.on('click', function (e) {
  6964. changeStatus($(this));
  6965. });
  6966. $switchRight.on('click', function (e) {
  6967. changeStatus($(this));
  6968. });
  6969. $element.find('input').on('change', function (e) {
  6970. var $this = $(this)
  6971. , $element = $this.parent()
  6972. , thisState = $this.is(':checked')
  6973. , state = $element.is('.switch-off');
  6974. e.preventDefault();
  6975. $element.css('left', '');
  6976. if (state === thisState) {
  6977. if (thisState)
  6978. $element.removeClass('switch-off').addClass('switch-on');
  6979. else
  6980. $element.removeClass('switch-on').addClass('switch-off');
  6981. if ($element.data('animated') !== false)
  6982. $element.addClass("switch-animate");
  6983. $element.parent().trigger('switch-change', {'el': $this, 'value': thisState})
  6984. }
  6985. });
  6986. $element.find('label').on('mousedown touchstart', function (e) {
  6987. var $this = $(this);
  6988. moving = false;
  6989. e.preventDefault();
  6990. e.stopImmediatePropagation();
  6991. $this.closest('div').removeClass('switch-animate');
  6992. if ($this.closest('.has-switch').is('.deactivate'))
  6993. $this.unbind('click');
  6994. else {
  6995. $this.on('mousemove touchmove', function (e) {
  6996. var $element = $(this).closest('.switch')
  6997. , relativeX = (e.pageX || e.originalEvent.targetTouches[0].pageX) - $element.offset().left
  6998. , percent = (relativeX / $element.width()) * 100
  6999. , left = 25
  7000. , right = 75;
  7001. moving = true;
  7002. if (percent < left)
  7003. percent = left;
  7004. else if (percent > right)
  7005. percent = right;
  7006. $element.find('>div').css('left', (percent - right) + "%")
  7007. });
  7008. $this.on('click touchend', function (e) {
  7009. var $this = $(this)
  7010. , $target = $(e.target)
  7011. , $myCheckBox = $target.siblings('input');
  7012. e.stopImmediatePropagation();
  7013. e.preventDefault();
  7014. $this.unbind('mouseleave');
  7015. if (moving)
  7016. $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25));
  7017. else
  7018. $myCheckBox.prop("checked", !$myCheckBox.is(":checked"));
  7019. moving = false;
  7020. $myCheckBox.trigger('change');
  7021. });
  7022. $this.on('mouseleave', function (e) {
  7023. var $this = $(this)
  7024. , $myCheckBox = $this.siblings('input');
  7025. e.preventDefault();
  7026. e.stopImmediatePropagation();
  7027. $this.unbind('mouseleave');
  7028. $this.trigger('mouseup');
  7029. $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25)).trigger('change');
  7030. });
  7031. $this.on('mouseup', function (e) {
  7032. e.stopImmediatePropagation();
  7033. e.preventDefault();
  7034. $(this).unbind('mousemove');
  7035. });
  7036. }
  7037. });
  7038. }
  7039. );
  7040. },
  7041. toggleActivation: function () {
  7042. $(this).toggleClass('deactivate');
  7043. },
  7044. isActive: function () {
  7045. return !$(this).hasClass('deactivate');
  7046. },
  7047. setActive: function (active) {
  7048. if (active)
  7049. $(this).removeClass('deactivate');
  7050. else
  7051. $(this).addClass('deactivate');
  7052. },
  7053. toggleState: function (skipOnChange) {
  7054. var $input = $(this).find('input:checkbox');
  7055. $input.prop('checked', !$input.is(':checked')).trigger('change', skipOnChange);
  7056. },
  7057. setState: function (value, skipOnChange) {
  7058. $(this).find('input:checkbox').prop('checked', value).trigger('change', skipOnChange);
  7059. },
  7060. status: function () {
  7061. return $(this).find('input:checkbox').is(':checked');
  7062. },
  7063. destroy: function () {
  7064. var $div = $(this).find('div')
  7065. , $checkbox;
  7066. $div.find(':not(input:checkbox)').remove();
  7067. $checkbox = $div.children();
  7068. $checkbox.unwrap().unwrap();
  7069. $checkbox.unbind('change');
  7070. return $checkbox;
  7071. }
  7072. };
  7073. if (methods[method])
  7074. return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
  7075. else if (typeof method === 'object' || !method)
  7076. return methods.init.apply(this, arguments);
  7077. else
  7078. $.error('Method ' + method + ' does not exist!');
  7079. };
  7080. }(jQuery);
  7081. define("bootstrap-switch", ["jquery"], function(){});
  7082. define('form',['jquery', 'bootstrap', 'backend', 'config', 'toastr', 'upload', 'bootstrap-validator', 'bootstrap-checkbox', 'bootstrap-radio', 'bootstrap-switch'], function ($, undefined, Backend, Config, Toastr, Upload, undefined) {
  7083. var Form = {
  7084. config: {
  7085. },
  7086. api: {
  7087. submit: function (form, onBeforeSubmit, onAfterSubmit) {
  7088. if (form.size() == 0)
  7089. return Toastr.error("表单未初始化完成,无法提交");
  7090. //提交前事件
  7091. var beforeSubmit = form.data("before-submit");
  7092. //元素绑定函数
  7093. if (beforeSubmit && typeof Form.api.custom[beforeSubmit] == 'function') {
  7094. if (!Form.api.custom[beforeSubmit].call(form)) {
  7095. return false;
  7096. }
  7097. }
  7098. //自定义函数
  7099. if (typeof onBeforeSubmit == 'function') {
  7100. if (!onBeforeSubmit.call(form)) {
  7101. return false;
  7102. }
  7103. }
  7104. var type = form.attr("method");
  7105. type = type && (type == 'GET' || type == 'POST') ? type : 'GET';
  7106. url = form.attr("action");
  7107. url = url ? url : location.href;
  7108. $.ajax({
  7109. type: type,
  7110. url: url,
  7111. data: form.serialize(),
  7112. dataType: 'json',
  7113. success: function (data) {
  7114. if (data.hasOwnProperty("code")) {
  7115. var content = data.hasOwnProperty("content") && data.content != "" ? data.content : "";
  7116. if (data.code === 1) {
  7117. $('.form-group', form).removeClass('has-feedback has-success has-error');
  7118. //成功提交后事件
  7119. var afterSubmit = form.data("after-submit");
  7120. //元素绑定函数
  7121. if (afterSubmit && typeof Form.api.custom[afterSubmit] == 'function') {
  7122. if (!Form.api.custom[afterSubmit].call(form, content)) {
  7123. return false;
  7124. }
  7125. }
  7126. //自定义函数
  7127. if (typeof onAfterSubmit == 'function') {
  7128. if (!onAfterSubmit.call(form, content)) {
  7129. return false;
  7130. }
  7131. }
  7132. Toastr.success(content ? content : __('Operation completed'));
  7133. } else {
  7134. Toastr.error(content ? content : __('Operation failed'));
  7135. }
  7136. } else {
  7137. Toastr.error(__('Unknown data format'));
  7138. }
  7139. }, error: function () {
  7140. Toastr.error(__('Network error'));
  7141. }, complete: function (e) {
  7142. }
  7143. });
  7144. return false;
  7145. },
  7146. bindevent: function (form, onBeforeSubmit, onAfterSubmit) {
  7147. form.validator().on('submit', function (e) {
  7148. if (e.isDefaultPrevented()) {
  7149. //验证不通过
  7150. Toastr.error("验证失败,请检查表单输入是否正确");
  7151. //Backend.api.error();
  7152. } else {
  7153. //验证通过提交表单
  7154. Form.api.submit(form, onBeforeSubmit, function (content) {
  7155. if (typeof onAfterSubmit == 'function') {
  7156. if (!onAfterSubmit.call(form, content)) {
  7157. return false;
  7158. }
  7159. }
  7160. //提示及关闭当前窗口
  7161. parent.Layer.msg(__('Operation completed'), {
  7162. offset: 0, icon: 1
  7163. });
  7164. parent.$(".btn-refresh").trigger("click");
  7165. var index = parent.Layer.getFrameIndex(window.name);
  7166. parent.Layer.close(index);
  7167. });
  7168. return false;
  7169. }
  7170. });
  7171. // Activate the switches with icons
  7172. if ($('.switch').length != 0) {
  7173. $('.switch')['bootstrapSwitch']();
  7174. }
  7175. // Activate regular switches
  7176. if ($("[data-toggle='switch']").length != 0) {
  7177. $("[data-toggle='switch']").wrap('<div class="switch" />').parent().bootstrapSwitch();
  7178. }
  7179. //绑定select元素事件
  7180. if ($(".selectpicker", form).size() > 0) {
  7181. require(['bootstrap-select'], function () {
  7182. $('.selectpicker', form).selectpicker();
  7183. });
  7184. }
  7185. if ($(".typeahead").size() > 0 || $(".tagsinput").size() > 0) {
  7186. require(['bloodhound'], function () {
  7187. var remotesource = function (input) {
  7188. return new Bloodhound({
  7189. datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'),
  7190. queryTokenizer: Bloodhound.tokenizers.whitespace,
  7191. remote: {
  7192. url: '/ajax/typeahead?search=%QUERY&field=' + $(input).attr("name"),
  7193. wildcard: '%QUERY',
  7194. transform: function (data) {
  7195. return data.content.searchlist;
  7196. }
  7197. }
  7198. });
  7199. };
  7200. //绑定typeahead事件
  7201. if ($(".typeahead", form).size() > 0) {
  7202. require(['typeahead'], function () {
  7203. $(".typeahead", form).each(function () {
  7204. $(this).typeahead({
  7205. hint: true,
  7206. highlight: true,
  7207. minLength: 0
  7208. }, {
  7209. name: 'typeahead',
  7210. limit: 20,
  7211. displayKey: 'id',
  7212. source: remotesource(this),
  7213. templates: {
  7214. empty: '<li class="notfound">' + __('No matches found') + '</li>',
  7215. suggestion: function (item) {
  7216. return '<li>' + item.name + '</li>';
  7217. }
  7218. }
  7219. });
  7220. });
  7221. });
  7222. }
  7223. //绑定tagsinput事件
  7224. if ($(".tagsinput", form).size() > 0) {
  7225. require(['bootstrap-tagsinput'], function () {
  7226. $('.tagsinput', form).each(function () {
  7227. $(this).tagsinput({
  7228. freeInput: false,
  7229. typeaheadjs: {
  7230. name: 'tagsinput',
  7231. limit: 20,
  7232. displayKey: 'name',
  7233. valueKey: 'id',
  7234. source: remotesource(this),
  7235. templates: {
  7236. empty: '<li class="notfound">' + __('No matches found') + '</li>',
  7237. suggestion: function (item) {
  7238. return '<li>' + item.name + '</li>';
  7239. }
  7240. }
  7241. }
  7242. });
  7243. });
  7244. $('.bootstrap-tagsinput .twitter-typeahead').css('display', 'inline');
  7245. });
  7246. }
  7247. });
  7248. }
  7249. //绑定日期时间元素事件
  7250. if ($(".datetimepicker", form).size() > 0) {
  7251. require(['bootstrap-datetimepicker'], function () {
  7252. $('.datetimepicker', form).parent().css('position', 'relative');
  7253. $('.datetimepicker', form)
  7254. .datetimepicker({
  7255. format: 'YYYY-MM-DD HH:mm:ss',
  7256. icons: {
  7257. time: 'fa fa-clock-o',
  7258. date: 'fa fa-calendar',
  7259. up: 'fa fa-chevron-up',
  7260. down: 'fa fa-chevron-down',
  7261. previous: 'fa fa-chevron-left',
  7262. next: 'fa fa-chevron-right',
  7263. today: 'fa fa-history',
  7264. clear: 'fa fa-trash',
  7265. close: 'fa fa-remove'
  7266. },
  7267. showTodayButton: true,
  7268. showClose: true
  7269. });
  7270. });
  7271. }
  7272. //绑定summernote事件
  7273. if ($(".summernote", form).size() > 0) {
  7274. require(['summernote'], function () {
  7275. $(".summernote", form).summernote({
  7276. height: 250,
  7277. lang: 'zh-CN',
  7278. dialogsInBody: true,
  7279. callbacks: {
  7280. onChange: function (contents) {
  7281. $(this).val(contents);
  7282. $(this).trigger('change');
  7283. },
  7284. onInit: function () {
  7285. },
  7286. onImageUpload: function (files) {
  7287. var that = this;
  7288. //依次上传图片
  7289. for (var i = 0; i < files.length; i++) {
  7290. Upload.api.send(files[i], function (data) {
  7291. var url = Config.upload.cdnurl + data.content;
  7292. $(that).summernote("insertImage", url, 'filename');
  7293. });
  7294. }
  7295. }
  7296. }
  7297. });
  7298. });
  7299. }
  7300. //绑定plupload上传元素事件
  7301. if ($(".plupload", form).size() > 0) {
  7302. Upload.api.plupload();
  7303. }
  7304. },
  7305. custom: {}
  7306. },
  7307. };
  7308. return Form;
  7309. });
  7310. // jQuery List DragSort v0.5.2
  7311. // Website: http://dragsort.codeplex.com/
  7312. // License: http://dragsort.codeplex.com/license
  7313. (function($) {
  7314. $.fn.dragsort = function(options) {
  7315. if (options == "destroy") {
  7316. $(this.selector).trigger("dragsort-uninit");
  7317. return;
  7318. }
  7319. var opts = $.extend({}, $.fn.dragsort.defaults, options);
  7320. var lists = [];
  7321. var list = null, lastPos = null;
  7322. this.each(function(i, cont) {
  7323. //if list container is table, the browser automatically wraps rows in tbody if not specified so change list container to tbody so that children returns rows as user expected
  7324. if ($(cont).is("table") && $(cont).children().size() == 1 && $(cont).children().is("tbody"))
  7325. cont = $(cont).children().get(0);
  7326. var newList = {
  7327. draggedItem: null,
  7328. placeHolderItem: null,
  7329. pos: null,
  7330. offset: null,
  7331. offsetLimit: null,
  7332. scroll: null,
  7333. container: cont,
  7334. init: function() {
  7335. //set options to default values if not set
  7336. opts.tagName = $(this.container).children().size() == 0 ? "li" : $(this.container).children().get(0).tagName.toLowerCase();
  7337. if (opts.itemSelector == "")
  7338. opts.itemSelector = opts.tagName;
  7339. if (opts.dragSelector == "")
  7340. opts.dragSelector = opts.tagName;
  7341. if (opts.placeHolderTemplate == "")
  7342. opts.placeHolderTemplate = "<" + opts.tagName + ">&nbsp;</" + opts.tagName + ">";
  7343. //listidx allows reference back to correct list variable instance
  7344. $(this.container).attr("data-listidx", i).mousedown(this.grabItem).bind("dragsort-uninit", this.uninit);
  7345. this.styleDragHandlers(true);
  7346. },
  7347. uninit: function() {
  7348. var list = lists[$(this).attr("data-listidx")];
  7349. $(list.container).unbind("mousedown", list.grabItem).unbind("dragsort-uninit");
  7350. list.styleDragHandlers(false);
  7351. },
  7352. getItems: function() {
  7353. return $(this.container).children(opts.itemSelector);
  7354. },
  7355. styleDragHandlers: function(cursor) {
  7356. this.getItems().map(function() { return $(this).is(opts.dragSelector) ? this : $(this).find(opts.dragSelector).get(); }).css("cursor", cursor ? "pointer" : "");
  7357. },
  7358. grabItem: function(e) {
  7359. var list = lists[$(this).attr("data-listidx")];
  7360. var item = $(e.target).closest("[data-listidx] > " + opts.tagName).get(0);
  7361. var insideMoveableItem = list.getItems().filter(function() { return this == item; }).size() > 0;
  7362. //if not left click or if clicked on excluded element (e.g. text box) or not a moveable list item return
  7363. if (e.which != 1 || $(e.target).is(opts.dragSelectorExclude) || $(e.target).closest(opts.dragSelectorExclude).size() > 0 || !insideMoveableItem)
  7364. return;
  7365. //prevents selection, stops issue on Fx where dragging hyperlink doesn't work and on IE where it triggers mousemove even though mouse hasn't moved,
  7366. //does also stop being able to click text boxes hence dragging on text boxes by default is disabled in dragSelectorExclude
  7367. //e.preventDefault();
  7368. //change cursor to move while dragging
  7369. var dragHandle = e.target;
  7370. while (!$(dragHandle).is(opts.dragSelector)) {
  7371. if (dragHandle == this) return;
  7372. dragHandle = dragHandle.parentNode;
  7373. }
  7374. $(dragHandle).attr("data-cursor", $(dragHandle).css("cursor"));
  7375. $(dragHandle).css("cursor", "move");
  7376. //on mousedown wait for movement of mouse before triggering dragsort script (dragStart) to allow clicking of hyperlinks to work
  7377. var listElem = this;
  7378. var trigger = function() {
  7379. list.dragStart.call(listElem, e);
  7380. $(list.container).unbind("mousemove", trigger);
  7381. };
  7382. $(list.container).mousemove(trigger).mouseup(function() { $(list.container).unbind("mousemove", trigger); $(dragHandle).css("cursor", $(dragHandle).attr("data-cursor")); });
  7383. },
  7384. dragStart: function(e) {
  7385. if (list != null && list.draggedItem != null)
  7386. list.dropItem();
  7387. list = lists[$(this).attr("data-listidx")];
  7388. list.draggedItem = $(e.target).closest("[data-listidx] > " + opts.tagName)
  7389. //record current position so on dragend we know if the dragged item changed position or not, not using getItems to allow dragsort to restore dragged item to original location in relation to fixed items
  7390. list.draggedItem.attr("data-origpos", $(this).attr("data-listidx") + "-" + $(list.container).children().index(list.draggedItem));
  7391. //calculate mouse offset relative to draggedItem
  7392. var mt = parseInt(list.draggedItem.css("marginTop"));
  7393. var ml = parseInt(list.draggedItem.css("marginLeft"));
  7394. list.offset = list.draggedItem.offset();
  7395. list.offset.top = e.pageY - list.offset.top + (isNaN(mt) ? 0 : mt) - 1;
  7396. list.offset.left = e.pageX - list.offset.left + (isNaN(ml) ? 0 : ml) - 1;
  7397. //calculate box the dragged item can't be dragged outside of
  7398. if (!opts.dragBetween) {
  7399. var containerHeight = $(list.container).outerHeight() == 0 ? Math.max(1, Math.round(0.5 + list.getItems().size() * list.draggedItem.outerWidth() / $(list.container).outerWidth())) * list.draggedItem.outerHeight() : $(list.container).outerHeight();
  7400. list.offsetLimit = $(list.container).offset();
  7401. list.offsetLimit.right = list.offsetLimit.left + $(list.container).outerWidth() - list.draggedItem.outerWidth();
  7402. list.offsetLimit.bottom = list.offsetLimit.top + containerHeight - list.draggedItem.outerHeight();
  7403. }
  7404. //create placeholder item
  7405. var h = list.draggedItem.height();
  7406. var w = list.draggedItem.width();
  7407. if (opts.tagName == "tr") {
  7408. list.draggedItem.children().each(function() { $(this).width($(this).width()); });
  7409. list.placeHolderItem = list.draggedItem.clone().attr("data-placeholder", true);
  7410. list.draggedItem.after(list.placeHolderItem);
  7411. //list.placeHolderItem.children().each(function() { $(this).css({ borderWidth:0, width: $(this).width() + 1, height: $(this).height() + 1 }).html("&nbsp;"); });
  7412. list.placeHolderItem.children().each(function() { $(this).html("&nbsp;"); });
  7413. } else {
  7414. list.draggedItem.after(opts.placeHolderTemplate);
  7415. list.placeHolderItem = list.draggedItem.next().css({ height: h, width: w }).attr("data-placeholder", true);
  7416. }
  7417. if (opts.tagName == "td") {
  7418. var listTable = list.draggedItem.closest("table").get(0);
  7419. $("<table id='" + listTable.id + "' style='border-width: 0px;' class='dragSortItem " + listTable.className + "'><tr></tr></table>").appendTo("body").children().append(list.draggedItem);
  7420. }
  7421. //style draggedItem while dragging
  7422. var orig = list.draggedItem.attr("style");
  7423. list.draggedItem.attr("data-origstyle", orig ? orig : "");
  7424. list.draggedItem.css({ position: "absolute", opacity: 0.8, "z-index": 999, height: h, width: w });
  7425. //auto-scroll setup
  7426. list.scroll = { moveX: 0, moveY: 0, maxX: $(document).width() - $(window).width(), maxY: $(document).height() - $(window).height() };
  7427. list.scroll.scrollY = window.setInterval(function() {
  7428. if (opts.scrollContainer != window) {
  7429. $(opts.scrollContainer).scrollTop($(opts.scrollContainer).scrollTop() + list.scroll.moveY);
  7430. return;
  7431. }
  7432. var t = $(opts.scrollContainer).scrollTop();
  7433. if (list.scroll.moveY > 0 && t < list.scroll.maxY || list.scroll.moveY < 0 && t > 0) {
  7434. $(opts.scrollContainer).scrollTop(t + list.scroll.moveY);
  7435. list.draggedItem.css("top", list.draggedItem.offset().top + list.scroll.moveY + 1);
  7436. }
  7437. }, 10);
  7438. list.scroll.scrollX = window.setInterval(function() {
  7439. if (opts.scrollContainer != window) {
  7440. $(opts.scrollContainer).scrollLeft($(opts.scrollContainer).scrollLeft() + list.scroll.moveX);
  7441. return;
  7442. }
  7443. var l = $(opts.scrollContainer).scrollLeft();
  7444. if (list.scroll.moveX > 0 && l < list.scroll.maxX || list.scroll.moveX < 0 && l > 0) {
  7445. $(opts.scrollContainer).scrollLeft(l + list.scroll.moveX);
  7446. list.draggedItem.css("left", list.draggedItem.offset().left + list.scroll.moveX + 1);
  7447. }
  7448. }, 10);
  7449. //misc
  7450. $(lists).each(function(i, l) { l.createDropTargets(); l.buildPositionTable(); });
  7451. list.setPos(e.pageX, e.pageY);
  7452. $(document).bind("mousemove", list.swapItems);
  7453. $(document).bind("mouseup", list.dropItem);
  7454. if (opts.scrollContainer != window)
  7455. $(window).bind("wheel", list.wheel);
  7456. },
  7457. //set position of draggedItem
  7458. setPos: function(x, y) {
  7459. //remove mouse offset so mouse cursor remains in same place on draggedItem instead of top left corner
  7460. var top = y - this.offset.top;
  7461. var left = x - this.offset.left;
  7462. //limit top, left to within box draggedItem can't be dragged outside of
  7463. if (!opts.dragBetween) {
  7464. top = Math.min(this.offsetLimit.bottom, Math.max(top, this.offsetLimit.top));
  7465. left = Math.min(this.offsetLimit.right, Math.max(left, this.offsetLimit.left));
  7466. }
  7467. //adjust top & left calculations to parent offset
  7468. var parent = this.draggedItem.offsetParent().not("body").offset(); //offsetParent returns body even when it's static, if not static offset is only factoring margin
  7469. if (parent != null) {
  7470. top -= parent.top;
  7471. left -= parent.left;
  7472. }
  7473. //set x or y auto-scroll amount
  7474. if (opts.scrollContainer == window) {
  7475. y -= $(window).scrollTop();
  7476. x -= $(window).scrollLeft();
  7477. y = Math.max(0, y - $(window).height() + 5) + Math.min(0, y - 5);
  7478. x = Math.max(0, x - $(window).width() + 5) + Math.min(0, x - 5);
  7479. } else {
  7480. var cont = $(opts.scrollContainer);
  7481. var offset = cont.offset();
  7482. y = Math.max(0, y - cont.height() - offset.top) + Math.min(0, y - offset.top);
  7483. x = Math.max(0, x - cont.width() - offset.left) + Math.min(0, x - offset.left);
  7484. }
  7485. list.scroll.moveX = x == 0 ? 0 : x * opts.scrollSpeed / Math.abs(x);
  7486. list.scroll.moveY = y == 0 ? 0 : y * opts.scrollSpeed / Math.abs(y);
  7487. //move draggedItem to new mouse cursor location
  7488. this.draggedItem.css({ top: top, left: left });
  7489. },
  7490. //if scroll container is a div allow mouse wheel to scroll div instead of window when mouse is hovering over
  7491. wheel: function(e) {
  7492. if (list && opts.scrollContainer != window) {
  7493. var cont = $(opts.scrollContainer);
  7494. var offset = cont.offset();
  7495. e = e.originalEvent;
  7496. if (e.clientX > offset.left && e.clientX < offset.left + cont.width() && e.clientY > offset.top && e.clientY < offset.top + cont.height()) {
  7497. var deltaY = (e.deltaMode == 0 ? 1 : 10) * e.deltaY;
  7498. cont.scrollTop(cont.scrollTop() + deltaY);
  7499. e.preventDefault();
  7500. }
  7501. }
  7502. },
  7503. //build a table recording all the positions of the moveable list items
  7504. buildPositionTable: function() {
  7505. var pos = [];
  7506. this.getItems().not([list.draggedItem[0], list.placeHolderItem[0]]).each(function(i) {
  7507. var loc = $(this).offset();
  7508. loc.right = loc.left + $(this).outerWidth();
  7509. loc.bottom = loc.top + $(this).outerHeight();
  7510. loc.elm = this;
  7511. pos[i] = loc;
  7512. });
  7513. this.pos = pos;
  7514. },
  7515. dropItem: function() {
  7516. if (list.draggedItem == null)
  7517. return;
  7518. //list.draggedItem.attr("style", "") doesn't work on IE8 and jQuery 1.5 or lower
  7519. //list.draggedItem.removeAttr("style") doesn't work on chrome and jQuery 1.6 (works jQuery 1.5 or lower)
  7520. var orig = list.draggedItem.attr("data-origstyle");
  7521. list.draggedItem.attr("style", orig);
  7522. if (orig == "")
  7523. list.draggedItem.removeAttr("style");
  7524. list.draggedItem.removeAttr("data-origstyle");
  7525. list.styleDragHandlers(true);
  7526. list.placeHolderItem.before(list.draggedItem);
  7527. list.placeHolderItem.remove();
  7528. $("[data-droptarget], .dragSortItem").remove();
  7529. window.clearInterval(list.scroll.scrollY);
  7530. window.clearInterval(list.scroll.scrollX);
  7531. //if position changed call dragEnd
  7532. if (list.draggedItem.attr("data-origpos") != $(lists).index(list) + "-" + $(list.container).children().index(list.draggedItem))
  7533. if (opts.dragEnd.apply(list.draggedItem) == false) { //if dragEnd returns false revert order
  7534. var pos = list.draggedItem.attr("data-origpos").split('-');
  7535. var nextItem = $(lists[pos[0]].container).children().not(list.draggedItem).eq(pos[1]);
  7536. if (nextItem.size() > 0)
  7537. nextItem.before(list.draggedItem);
  7538. else if (pos[1] == 0) //was the only item in list
  7539. $(lists[pos[0]].container).prepend(list.draggedItem);
  7540. else //was the last item in list
  7541. $(lists[pos[0]].container).append(list.draggedItem);
  7542. }
  7543. list.draggedItem.removeAttr("data-origpos");
  7544. list.draggedItem = null;
  7545. $(document).unbind("mousemove", list.swapItems);
  7546. $(document).unbind("mouseup", list.dropItem);
  7547. if (opts.scrollContainer != window)
  7548. $(window).unbind("wheel", list.wheel);
  7549. return false;
  7550. },
  7551. //swap the draggedItem (represented visually by placeholder) with the list item the it has been dragged on top of
  7552. swapItems: function(e) {
  7553. if (list.draggedItem == null)
  7554. return false;
  7555. //move draggedItem to mouse location
  7556. list.setPos(e.pageX, e.pageY);
  7557. //retrieve list and item position mouse cursor is over
  7558. var ei = list.findPos(e.pageX, e.pageY);
  7559. var nlist = list;
  7560. for (var i = 0; ei == -1 && opts.dragBetween && i < lists.length; i++) {
  7561. ei = lists[i].findPos(e.pageX, e.pageY);
  7562. nlist = lists[i];
  7563. }
  7564. //if not over another moveable list item return
  7565. if (ei == -1)
  7566. return false;
  7567. //save fixed items locations
  7568. var children = function() { return $(nlist.container).children().not(nlist.draggedItem); };
  7569. var fixed = children().not(opts.itemSelector).each(function(i) { this.idx = children().index(this); });
  7570. //if moving draggedItem up or left place placeHolder before list item the dragged item is hovering over otherwise place it after
  7571. if (lastPos == null || lastPos.top > list.draggedItem.offset().top || lastPos.left > list.draggedItem.offset().left)
  7572. $(nlist.pos[ei].elm).before(list.placeHolderItem);
  7573. else
  7574. $(nlist.pos[ei].elm).after(list.placeHolderItem);
  7575. //restore fixed items location
  7576. fixed.each(function() {
  7577. var elm = children().eq(this.idx).get(0);
  7578. if (this != elm && children().index(this) < this.idx)
  7579. $(this).insertAfter(elm);
  7580. else if (this != elm)
  7581. $(this).insertBefore(elm);
  7582. });
  7583. //misc
  7584. $(lists).each(function(i, l) { l.createDropTargets(); l.buildPositionTable(); });
  7585. lastPos = list.draggedItem.offset();
  7586. return false;
  7587. },
  7588. //returns the index of the list item the mouse is over
  7589. findPos: function(x, y) {
  7590. for (var i = 0; i < this.pos.length; i++) {
  7591. if (this.pos[i].left < x && this.pos[i].right > x && this.pos[i].top < y && this.pos[i].bottom > y)
  7592. return i;
  7593. }
  7594. return -1;
  7595. },
  7596. //create drop targets which are placeholders at the end of other lists to allow dragging straight to the last position
  7597. createDropTargets: function() {
  7598. if (!opts.dragBetween)
  7599. return;
  7600. $(lists).each(function() {
  7601. var ph = $(this.container).find("[data-placeholder]");
  7602. var dt = $(this.container).find("[data-droptarget]");
  7603. if (ph.size() > 0 && dt.size() > 0)
  7604. dt.remove();
  7605. else if (ph.size() == 0 && dt.size() == 0) {
  7606. if (opts.tagName == "td")
  7607. $(opts.placeHolderTemplate).attr("data-droptarget", true).appendTo(this.container);
  7608. else
  7609. //list.placeHolderItem.clone().removeAttr("data-placeholder") crashes in IE7 and jquery 1.5.1 (doesn't in jquery 1.4.2 or IE8)
  7610. $(this.container).append(list.placeHolderItem.removeAttr("data-placeholder").clone().attr("data-droptarget", true));
  7611. list.placeHolderItem.attr("data-placeholder", true);
  7612. }
  7613. });
  7614. }
  7615. };
  7616. newList.init();
  7617. lists.push(newList);
  7618. });
  7619. return this;
  7620. };
  7621. $.fn.dragsort.defaults = {
  7622. itemSelector: "",
  7623. dragSelector: "",
  7624. dragSelectorExclude: "input, textarea",
  7625. dragEnd: function() { },
  7626. dragBetween: false,
  7627. placeHolderTemplate: "",
  7628. scrollContainer: window,
  7629. scrollSpeed: 5
  7630. };
  7631. })(jQuery);
  7632. define("dragsort", function(){});
  7633. /*!
  7634. * jquery.event.drag - v 2.2
  7635. * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com
  7636. * Open Source MIT License - http://threedubmedia.com/code/license
  7637. */
  7638. ;(function(e){e.fn.drag=function(k,g,j){var i=typeof k=="string"?k:"",h=e.isFunction(k)?k:e.isFunction(g)?g:null;if(i.indexOf("drag")!==0){i="drag"+i}j=(k==h?g:j)||{};return h?this.bind(i,j,h):this.trigger(i)};var b=e.event,a=b.special,d=a.drag={defaults:{which:1,distance:0,not:":input",handle:null,relative:false,drop:true,click:false},datakey:"dragdata",noBubble:true,add:function(i){var h=e.data(this,d.datakey),g=i.data||{};h.related+=1;e.each(d.defaults,function(j,k){if(g[j]!==undefined){h[j]=g[j]}})},remove:function(){e.data(this,d.datakey).related-=1},setup:function(){if(e.data(this,d.datakey)){return}var g=e.extend({related:0},d.defaults);e.data(this,d.datakey,g);b.add(this,"touchstart mousedown",d.init,g);if(this.attachEvent){this.attachEvent("ondragstart",d.dontstart)}},teardown:function(){var g=e.data(this,d.datakey)||{};if(g.related){return}e.removeData(this,d.datakey);b.remove(this,"touchstart mousedown",d.init);d.textselect(true);if(this.detachEvent){this.detachEvent("ondragstart",d.dontstart)}},init:function(i){if(d.touched){return}var g=i.data,h;if(i.which!=0&&g.which>0&&i.which!=g.which){return}if(e(i.target).is(g.not)){return}if(g.handle&&!e(i.target).closest(g.handle,i.currentTarget).length){return}d.touched=i.type=="touchstart"?this:null;g.propagates=1;g.mousedown=this;g.interactions=[d.interaction(this,g)];g.target=i.target;g.pageX=i.pageX;g.pageY=i.pageY;g.dragging=null;h=d.hijack(i,"draginit",g);if(!g.propagates){return}h=d.flatten(h);if(h&&h.length){g.interactions=[];e.each(h,function(){g.interactions.push(d.interaction(this,g))})}g.propagates=g.interactions.length;if(g.drop!==false&&a.drop){a.drop.handler(i,g)}d.textselect(false);if(d.touched){b.add(d.touched,"touchmove touchend",d.handler,g)}else{b.add(document,"mousemove mouseup",d.handler,g)}if(!d.touched||g.live){return false}},interaction:function(h,g){var i=e(h)[g.relative?"position":"offset"]()||{top:0,left:0};return{drag:h,callback:new d.callback(),droppable:[],offset:i}},handler:function(h){var g=h.data;switch(h.type){case !g.dragging&&"touchmove":h.preventDefault();case !g.dragging&&"mousemove":if(Math.pow(h.pageX-g.pageX,2)+Math.pow(h.pageY-g.pageY,2)<Math.pow(g.distance,2)){break}h.target=g.target;d.hijack(h,"dragstart",g);if(g.propagates){g.dragging=true}case"touchmove":h.preventDefault();case"mousemove":if(g.dragging){d.hijack(h,"drag",g);if(g.propagates){if(g.drop!==false&&a.drop){a.drop.handler(h,g)}break}h.type="mouseup"}case"touchend":case"mouseup":default:if(d.touched){b.remove(d.touched,"touchmove touchend",d.handler)}else{b.remove(document,"mousemove mouseup",d.handler)}if(g.dragging){if(g.drop!==false&&a.drop){a.drop.handler(h,g)}d.hijack(h,"dragend",g)}d.textselect(true);if(g.click===false&&g.dragging){e.data(g.mousedown,"suppress.click",new Date().getTime()+5)}g.dragging=d.touched=false;break}},hijack:function(h,o,r,p,k){if(!r){return}var q={event:h.originalEvent,type:h.type},m=o.indexOf("drop")?"drag":"drop",t,l=p||0,j,g,s,n=!isNaN(p)?p:r.interactions.length;h.type=o;h.originalEvent=null;r.results=[];do{if(j=r.interactions[l]){if(o!=="dragend"&&j.cancelled){continue}s=d.properties(h,r,j);j.results=[];e(k||j[m]||r.droppable).each(function(u,i){s.target=i;h.isPropagationStopped=function(){return false};t=i?b.dispatch.call(i,h,s):null;if(t===false){if(m=="drag"){j.cancelled=true;r.propagates-=1}if(o=="drop"){j[m][u]=null}}else{if(o=="dropinit"){j.droppable.push(d.element(t)||i)}}if(o=="dragstart"){j.proxy=e(d.element(t)||j.drag)[0]}j.results.push(t);delete h.result;if(o!=="dropinit"){return t}});r.results[l]=d.flatten(j.results);if(o=="dropinit"){j.droppable=d.flatten(j.droppable)}if(o=="dragstart"&&!j.cancelled){s.update()}}}while(++l<n);h.type=q.type;h.originalEvent=q.event;return d.flatten(r.results)},properties:function(i,g,h){var j=h.callback;j.drag=h.drag;j.proxy=h.proxy||h.drag;j.startX=g.pageX;j.startY=g.pageY;j.deltaX=i.pageX-g.pageX;j.deltaY=i.pageY-g.pageY;j.originalX=h.offset.left;j.originalY=h.offset.top;j.offsetX=j.originalX+j.deltaX;j.offsetY=j.originalY+j.deltaY;j.drop=d.flatten((h.drop||[]).slice());j.available=d.flatten((h.droppable||[]).slice());return j},element:function(g){if(g&&(g.jquery||g.nodeType==1)){return g}},flatten:function(g){return e.map(g,function(h){return h&&h.jquery?e.makeArray(h):h&&h.length?d.flatten(h):h})},textselect:function(g){e(document)[g?"unbind":"bind"]("selectstart",d.dontstart).css("MozUserSelect",g?"":"none");document.unselectable=g?"off":"on"},dontstart:function(){return false},callback:function(){}};d.callback.prototype={update:function(){if(a.drop&&this.available.length){e.each(this.available,function(g){a.drop.locate(this,g)})}}};var f=b.dispatch;b.dispatch=function(g){if(e.data(this,"suppress."+g.type)-new Date().getTime()>0){e.removeData(this,"suppress."+g.type);return}return f.apply(this,arguments)};var c=b.fixHooks.touchstart=b.fixHooks.touchmove=b.fixHooks.touchend=b.fixHooks.touchcancel={props:"clientX clientY pageX pageY screenX screenY".split(" "),filter:function(h,i){if(i){var g=(i.touches&&i.touches[0])||(i.changedTouches&&i.changedTouches[0])||null;if(g){e.each(c.props,function(j,k){h[k]=g[k]})}}return h}};a.draginit=a.dragstart=a.dragend=d})(jQuery);
  7639. define("drag", function(){});
  7640. /*!
  7641. * jquery.event.drop - v 2.2
  7642. * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com
  7643. * Open Source MIT License - http://threedubmedia.com/code/license
  7644. */
  7645. ;(function(d){d.fn.drop=function(i,e,h){var g=typeof i=="string"?i:"",f=d.isFunction(i)?i:d.isFunction(e)?e:null;if(g.indexOf("drop")!==0){g="drop"+g}h=(i==f?e:h)||{};return f?this.bind(g,h,f):this.trigger(g)};d.drop=function(e){e=e||{};b.multi=e.multi===true?Infinity:e.multi===false?1:!isNaN(e.multi)?e.multi:b.multi;b.delay=e.delay||b.delay;b.tolerance=d.isFunction(e.tolerance)?e.tolerance:e.tolerance===null?null:b.tolerance;b.mode=e.mode||b.mode||"intersect"};var c=d.event,a=c.special,b=d.event.special.drop={multi:1,delay:20,mode:"overlap",targets:[],datakey:"dropdata",noBubble:true,add:function(f){var e=d.data(this,b.datakey);e.related+=1},remove:function(){d.data(this,b.datakey).related-=1},setup:function(){if(d.data(this,b.datakey)){return}var e={related:0,active:[],anyactive:0,winner:0,location:{}};d.data(this,b.datakey,e);b.targets.push(this);return false},teardown:function(){var f=d.data(this,b.datakey)||{};if(f.related){return}d.removeData(this,b.datakey);var e=this;b.targets=d.grep(b.targets,function(g){return(g!==e)})},handler:function(g,e){var f,h;if(!e){return}switch(g.type){case"mousedown":case"touchstart":h=d(b.targets);if(typeof e.drop=="string"){h=h.filter(e.drop)}h.each(function(){var i=d.data(this,b.datakey);i.active=[];i.anyactive=0;i.winner=0});e.droppable=h;a.drag.hijack(g,"dropinit",e);break;case"mousemove":case"touchmove":b.event=g;if(!b.timer){b.tolerate(e)}break;case"mouseup":case"touchend":b.timer=clearTimeout(b.timer);if(e.propagates){a.drag.hijack(g,"drop",e);a.drag.hijack(g,"dropend",e)}break}},locate:function(k,h){var l=d.data(k,b.datakey),g=d(k),i=g.offset()||{},e=g.outerHeight(),j=g.outerWidth(),f={elem:k,width:j,height:e,top:i.top,left:i.left,right:i.left+j,bottom:i.top+e};if(l){l.location=f;l.index=h;l.elem=k}return f},contains:function(e,f){return((f[0]||f.left)>=e.left&&(f[0]||f.right)<=e.right&&(f[1]||f.top)>=e.top&&(f[1]||f.bottom)<=e.bottom)},modes:{intersect:function(f,e,g){return this.contains(g,[f.pageX,f.pageY])?1000000000:this.modes.overlap.apply(this,arguments)},overlap:function(f,e,g){return Math.max(0,Math.min(g.bottom,e.bottom)-Math.max(g.top,e.top))*Math.max(0,Math.min(g.right,e.right)-Math.max(g.left,e.left))},fit:function(f,e,g){return this.contains(g,e)?1:0},middle:function(f,e,g){return this.contains(g,[e.left+e.width*0.5,e.top+e.height*0.5])?1:0}},sort:function(f,e){return(e.winner-f.winner)||(f.index-e.index)},tolerate:function(q){var k,e,n,j,l,m,g,p=0,f,h=q.interactions.length,r=[b.event.pageX,b.event.pageY],o=b.tolerance||b.modes[b.mode];do{if(f=q.interactions[p]){if(!f){return}f.drop=[];l=[];m=f.droppable.length;if(o){n=b.locate(f.proxy)}k=0;do{if(g=f.droppable[k]){j=d.data(g,b.datakey);e=j.location;if(!e){continue}j.winner=o?o.call(b,b.event,n,e):b.contains(e,r)?1:0;l.push(j)}}while(++k<m);l.sort(b.sort);k=0;do{if(j=l[k]){if(j.winner&&f.drop.length<b.multi){if(!j.active[p]&&!j.anyactive){if(a.drag.hijack(b.event,"dropstart",q,p,j.elem)[0]!==false){j.active[p]=1;j.anyactive+=1}else{j.winner=0}}if(j.winner){f.drop.push(j.elem)}}else{if(j.active[p]&&j.anyactive==1){a.drag.hijack(b.event,"dropend",q,p,j.elem);j.active[p]=0;j.anyactive-=1}}}}while(++k<m)}}while(++p<h);if(b.last&&r[0]==b.last.pageX&&r[1]==b.last.pageY){delete b.timer}else{b.timer=setTimeout(function(){b.tolerate(q)},b.delay)}b.last=b.event}};a.dropinit=a.dropstart=a.dropend=b})(jQuery);
  7646. define("drop", function(){});
  7647. /**
  7648. * http://git.oschina.net/hbbcs/bootStrap-addTabs
  7649. * Created by joe on 2015-12-19.
  7650. * @param {type} options {
  7651. * content string||html 直接指定内容
  7652. * close bool 是否可以关闭
  7653. * monitor 监视的区域
  7654. * }
  7655. *
  7656. * @returns
  7657. */
  7658. $.fn.addtabs = function (options) {
  7659. var obj = $(this);
  7660. options = $.extend({
  7661. content: '', //直接指定所有页面TABS内容
  7662. close: true, //是否可以关闭
  7663. monitor: 'body', //监视的区域
  7664. nav: '.nav-addtabs',
  7665. tab: '.tab-addtabs',
  7666. iframeUse: true, //使用iframe还是ajax
  7667. iframeHeight: $(window).height() - 50, //固定TAB中IFRAME高度,根据需要自己修改
  7668. callback: function () {
  7669. //关闭后回调函数
  7670. }
  7671. }, options || {});
  7672. var navobj = $(options.nav);
  7673. var tabobj = $(options.tab);
  7674. if (history.pushState) {
  7675. //浏览器前进后退事件
  7676. $(window).on("popstate", function (e) {
  7677. var state = e.originalEvent.state;
  7678. $("a[addtabs=" + state.id + "]", options.monitor).data("pushstate", true).trigger("click");
  7679. });
  7680. }
  7681. $(options.monitor).on('click', '[addtabs]', function (e) {
  7682. if ($(this).attr('url').indexOf("javascript") !== 0) {
  7683. if ($(this).is("a")) {
  7684. e.preventDefault();
  7685. }
  7686. var id = $(this).attr('addtabs');
  7687. var title = $(this).attr('title') ? $(this).attr('title') : $.trim($(this).text());
  7688. var url = $(this).attr('url');
  7689. var content = options.content ? options.content : $(this).attr('content');
  7690. var ajax = $(this).attr('ajax') ? true : false;
  7691. var state = ({
  7692. url: url, title: title, id: id, content: content, ajax: ajax
  7693. });
  7694. document.title = title;
  7695. if (history.pushState && !$(this).data("pushstate")) {
  7696. window.history.pushState(state, title, url);
  7697. }
  7698. $(this).data("pushstate", null);
  7699. _add({
  7700. id: id,
  7701. title: $(this).attr('title') ? $(this).attr('title') : $(this).html(),
  7702. content: content,
  7703. url: url,
  7704. ajax: ajax
  7705. });
  7706. }
  7707. });
  7708. navobj.on('click', '.close-tab', function (e) {
  7709. id = $(this).prev("a").attr("aria-controls");
  7710. _close(id);
  7711. return false;
  7712. });
  7713. navobj.on('dblclick', 'li[role=presentation]', function (e) {
  7714. $(this).find(".close-tab").trigger("click");
  7715. });
  7716. navobj.on('click', 'li[role=presentation]', function (e) {
  7717. $("a[addtabs=" + $("a", this).attr("node-id") + "]").trigger("click");
  7718. });
  7719. $(window).resize(function () {
  7720. $("#nav").width($("#header > .navbar").width() - $(".sidebar-toggle").outerWidth() - $(".navbar-custom-menu").outerWidth() - 20);
  7721. _drop();
  7722. });
  7723. _add = function (opts) {
  7724. id = 'tab_' + opts.id;
  7725. url = opts.url;
  7726. url += (opts.url.indexOf("?") > -1 ? "&addtabs=1" : "?addtabs=1");
  7727. navobj.find("[role='presentation']").removeClass('active');
  7728. tabobj.find("[role='tabpanel']").removeClass('active');
  7729. //如果TAB不存在,创建一个新的TAB
  7730. if ($("#" + id).size() == 0) {
  7731. //创建新TAB的title
  7732. title = $('<li role="presentation" id="tab_' + id + '"><a href="#' + id + '" node-id="' + opts.id + '" aria-controls="' + id + '" role="tab" data-toggle="tab">' + opts.title + '</a></li>');
  7733. //是否允许关闭
  7734. if (options.close) {
  7735. title.append(' <i class="close-tab fa fa-remove"></i>');
  7736. }
  7737. //创建新TAB的内容
  7738. content = $('<div role="tabpanel" class="tab-pane" id="' + id + '"></div>');
  7739. //是否指定TAB内容
  7740. if (opts.content) {
  7741. content.append(opts.content);
  7742. } else if (options.iframeUse && !opts.ajax) {//没有内容,使用IFRAME打开链接
  7743. var height = options.iframeHeight;
  7744. content.append('<iframe src="' + url + '" width="100%" height="' + height + '" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling-x="no" scrolling-y="auto" allowtransparency="yes"></iframe></div>');
  7745. } else {
  7746. $.get(url, function (data) {
  7747. content.append(data);
  7748. });
  7749. }
  7750. //加入TABS
  7751. if ($('.tabdrop li').size() > 0) {
  7752. $('.tabdrop ul').append(title);
  7753. } else {
  7754. navobj.append(title);
  7755. }
  7756. tabobj.append(content);
  7757. }
  7758. //激活TAB
  7759. $("#tab_" + id).addClass('active');
  7760. $("#" + id).addClass("active");
  7761. _drop();
  7762. };
  7763. _close = function (id) {
  7764. //如果关闭的是当前激活的TAB,激活他的前一个TAB
  7765. if (obj.find("li.active").attr('id') == "tab_" + id) {
  7766. if ($("#tab_" + id).prev().not(".tabdrop").size() > 0) {
  7767. $("#tab_" + id).prev().not(".tabdrop").find("a").trigger("click");
  7768. } else if ($("#tab_" + id).next().size() > 0) {
  7769. $("#tab_" + id).next().trigger("click");
  7770. }
  7771. }
  7772. //关闭TAB
  7773. $("#tab_" + id).remove();
  7774. $("#" + id).remove();
  7775. _drop();
  7776. options.callback();
  7777. };
  7778. _drop = function () {
  7779. //创建下拉标签
  7780. var dropdown = $('<li class="dropdown pull-right hide tabdrop"><a class="dropdown-toggle" data-toggle="dropdown" href="javascript:;">' +
  7781. '<i class="glyphicon glyphicon-align-justify"></i>' +
  7782. ' <b class="caret"></b></a><ul class="dropdown-menu"></ul></li>');
  7783. //检测是否已增加
  7784. if (!$('.tabdrop').html()) {
  7785. dropdown.prependTo(navobj);
  7786. } else {
  7787. dropdown = navobj.find('.tabdrop');
  7788. }
  7789. //检测是否有下拉样式
  7790. if (navobj.parent().is('.tabs-below')) {
  7791. dropdown.addClass('dropup');
  7792. }
  7793. var collection = 0;
  7794. var maxwidth = navobj.width() - 60;
  7795. var liwidth = 0;
  7796. //检查超过一行的标签页
  7797. var litabs = navobj.append(dropdown.find('li')).find('>li').not('.tabdrop');
  7798. var lisize = litabs.size();
  7799. litabs.each(function (i, j) {
  7800. liwidth += $(this).width();
  7801. if (collection == 0 && i == lisize - 1 && liwidth <= navobj.width()) {
  7802. return true;
  7803. }
  7804. if (liwidth > maxwidth) {
  7805. dropdown.find('ul').append($(this));
  7806. collection++;
  7807. }
  7808. });
  7809. //如果有超出的,显示下拉标签
  7810. if (collection > 0) {
  7811. dropdown.removeClass('hide');
  7812. if (dropdown.find('.active').length == 1) {
  7813. dropdown.addClass('active');
  7814. } else {
  7815. dropdown.removeClass('active');
  7816. }
  7817. } else {
  7818. dropdown.addClass('hide');
  7819. }
  7820. };
  7821. };
  7822. define("addtabs", function(){});
  7823. (function(c){var d=document,a='appendChild',i='styleSheet',s=d.createElement('style');s.type='text/css';d.getElementsByTagName('head')[0][a](s);s[i]?s[i].cssText=c:s[a](d.createTextNode(c));})
  7824. ('.fixed-table-container .bs-checkbox,.fixed-table-container .no-records-found{text-align:center}.fixed-table-body thead th .th-inner,.table td,.table th{box-sizing:border-box}.bootstrap-table .table{margin-bottom:0!important;border-bottom:1px solid #ddd;border-collapse:collapse!important;border-radius:1px}.bootstrap-table .table:not(.table-condensed),.bootstrap-table .table:not(.table-condensed)>tbody>tr>td,.bootstrap-table .table:not(.table-condensed)>tbody>tr>th,.bootstrap-table .table:not(.table-condensed)>tfoot>tr>td,.bootstrap-table .table:not(.table-condensed)>tfoot>tr>th,.bootstrap-table .table:not(.table-condensed)>thead>tr>td{padding:8px}.bootstrap-table .table.table-no-bordered>tbody>tr>td,.bootstrap-table .table.table-no-bordered>thead>tr>th{border-right:2px solid transparent}.bootstrap-table .table.table-no-bordered>tbody>tr>td:last-child{border-right:none}.fixed-table-container{position:relative;clear:both;border:1px solid #ddd;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.fixed-table-container.table-no-bordered{border:1px solid transparent}.fixed-table-footer,.fixed-table-header{overflow:hidden}.fixed-table-footer{border-top:1px solid #ddd}.fixed-table-body{overflow-x:auto;overflow-y:auto;height:100%}.fixed-table-container table{width:100%}.fixed-table-container thead th{height:0;padding:0;margin:0;border-left:1px solid #ddd}.fixed-table-container thead th:focus{outline:transparent solid 0}.fixed-table-container thead th:first-child{border-left:none;border-top-left-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px}.fixed-table-container tbody td .th-inner,.fixed-table-container thead th .th-inner{padding:8px;line-height:24px;vertical-align:top;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fixed-table-container thead th .sortable{cursor:pointer;background-position:right;background-repeat:no-repeat;padding-right:30px}.fixed-table-container thead th .both{background-image:url(\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC\')}.fixed-table-container thead th .asc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==)}.fixed-table-container thead th .desc{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII=)}.fixed-table-container th.detail{width:30px}.fixed-table-container tbody td{border-left:1px solid #ddd}.fixed-table-container tbody tr:first-child td{border-top:none}.fixed-table-container tbody td:first-child{border-left:none}.fixed-table-container tbody .selected td{background-color:#f5f5f5}.fixed-table-container .bs-checkbox .th-inner{padding:8px 0}.fixed-table-container input[type=radio],.fixed-table-container input[type=checkbox]{margin:0 auto!important}.fixed-table-pagination .pagination-detail,.fixed-table-pagination div.pagination{margin-top:10px;margin-bottom:10px}.fixed-table-pagination div.pagination .pagination{margin:0}.fixed-table-pagination .pagination a{padding:6px 12px;line-height:1.428571429}.fixed-table-pagination .pagination-info{line-height:34px;margin-right:5px}.fixed-table-pagination .btn-group{position:relative;display:inline-block;vertical-align:middle}.fixed-table-pagination .dropup .dropdown-menu{margin-bottom:0}.fixed-table-pagination .page-list{display:inline-block}.fixed-table-toolbar .columns-left{margin-right:5px}.fixed-table-toolbar .columns-right{margin-left:5px}.fixed-table-toolbar .columns label{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.428571429}.fixed-table-toolbar .bs-bars,.fixed-table-toolbar .columns,.fixed-table-toolbar .search{position:relative;margin-top:10px;margin-bottom:10px;line-height:34px}.fixed-table-pagination li.disabled a{pointer-events:none;cursor:default}.fixed-table-loading{display:none;position:absolute;top:42px;right:0;bottom:0;left:0;z-index:99;background-color:#fff;text-align:center}.fixed-table-body .card-view .title{font-weight:700;display:inline-block;min-width:30%;text-align:left!important}.table td,.table th{vertical-align:middle}.fixed-table-toolbar .dropdown-menu{text-align:left;max-height:300px;overflow:auto}.fixed-table-toolbar .btn-group>.btn-group{display:inline-block;margin-left:-1px!important}.fixed-table-toolbar .btn-group>.btn-group>.btn{border-radius:0}.fixed-table-toolbar .btn-group>.btn-group:first-child>.btn{border-top-left-radius:4px;border-bottom-left-radius:4px}.fixed-table-toolbar .btn-group>.btn-group:last-child>.btn{border-top-right-radius:4px;border-bottom-right-radius:4px}.bootstrap-table .table>thead>tr>th{vertical-align:bottom;border-bottom:1px solid #ddd}.bootstrap-table .table thead>tr>th{padding:0;margin:0}.bootstrap-table .fixed-table-footer tbody>tr>td{padding:0!important}.bootstrap-table .fixed-table-footer .table{border-bottom:none;border-radius:0;padding:0!important}.pull-right .dropdown-menu{right:0;left:auto}p.fixed-table-scroll-inner{width:100%;height:200px}div.fixed-table-scroll-outer{top:0;left:0;visibility:hidden;width:200px;height:150px;overflow:hidden}');