Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bson.js 528KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory();
  4. else if(typeof define === 'function' && define.amd)
  5. define([], factory);
  6. else {
  7. var a = factory();
  8. for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
  9. }
  10. })(this, function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/ // The require function
  15. /******/ function __webpack_require__(moduleId) {
  16. /******/ // Check if module is in cache
  17. /******/ if(installedModules[moduleId])
  18. /******/ return installedModules[moduleId].exports;
  19. /******/ // Create a new module (and put it into the cache)
  20. /******/ var module = installedModules[moduleId] = {
  21. /******/ exports: {},
  22. /******/ id: moduleId,
  23. /******/ loaded: false
  24. /******/ };
  25. /******/ // Execute the module function
  26. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  27. /******/ // Flag the module as loaded
  28. /******/ module.loaded = true;
  29. /******/ // Return the exports of the module
  30. /******/ return module.exports;
  31. /******/ }
  32. /******/ // expose the modules object (__webpack_modules__)
  33. /******/ __webpack_require__.m = modules;
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/ // __webpack_public_path__
  37. /******/ __webpack_require__.p = "/";
  38. /******/ // Load entry module and return exports
  39. /******/ return __webpack_require__(0);
  40. /******/ })
  41. /************************************************************************/
  42. /******/ ([
  43. /* 0 */
  44. /***/ (function(module, exports, __webpack_require__) {
  45. __webpack_require__(1);
  46. module.exports = __webpack_require__(327);
  47. /***/ }),
  48. /* 1 */
  49. /***/ (function(module, exports, __webpack_require__) {
  50. /* WEBPACK VAR INJECTION */(function(global) {"use strict";
  51. __webpack_require__(2);
  52. __webpack_require__(323);
  53. __webpack_require__(324);
  54. if (global._babelPolyfill) {
  55. throw new Error("only one instance of babel-polyfill is allowed");
  56. }
  57. global._babelPolyfill = true;
  58. var DEFINE_PROPERTY = "defineProperty";
  59. function define(O, key, value) {
  60. O[key] || Object[DEFINE_PROPERTY](O, key, {
  61. writable: true,
  62. configurable: true,
  63. value: value
  64. });
  65. }
  66. define(String.prototype, "padLeft", "".padStart);
  67. define(String.prototype, "padRight", "".padEnd);
  68. "pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) {
  69. [][key] && define(Array, key, Function.call.bind([][key]));
  70. });
  71. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  72. /***/ }),
  73. /* 2 */
  74. /***/ (function(module, exports, __webpack_require__) {
  75. __webpack_require__(3);
  76. __webpack_require__(51);
  77. __webpack_require__(52);
  78. __webpack_require__(53);
  79. __webpack_require__(54);
  80. __webpack_require__(56);
  81. __webpack_require__(59);
  82. __webpack_require__(60);
  83. __webpack_require__(61);
  84. __webpack_require__(62);
  85. __webpack_require__(63);
  86. __webpack_require__(64);
  87. __webpack_require__(65);
  88. __webpack_require__(66);
  89. __webpack_require__(67);
  90. __webpack_require__(69);
  91. __webpack_require__(71);
  92. __webpack_require__(73);
  93. __webpack_require__(75);
  94. __webpack_require__(78);
  95. __webpack_require__(79);
  96. __webpack_require__(80);
  97. __webpack_require__(84);
  98. __webpack_require__(86);
  99. __webpack_require__(88);
  100. __webpack_require__(91);
  101. __webpack_require__(92);
  102. __webpack_require__(93);
  103. __webpack_require__(94);
  104. __webpack_require__(96);
  105. __webpack_require__(97);
  106. __webpack_require__(98);
  107. __webpack_require__(99);
  108. __webpack_require__(100);
  109. __webpack_require__(101);
  110. __webpack_require__(102);
  111. __webpack_require__(104);
  112. __webpack_require__(105);
  113. __webpack_require__(106);
  114. __webpack_require__(108);
  115. __webpack_require__(109);
  116. __webpack_require__(110);
  117. __webpack_require__(112);
  118. __webpack_require__(114);
  119. __webpack_require__(115);
  120. __webpack_require__(116);
  121. __webpack_require__(117);
  122. __webpack_require__(118);
  123. __webpack_require__(119);
  124. __webpack_require__(120);
  125. __webpack_require__(121);
  126. __webpack_require__(122);
  127. __webpack_require__(123);
  128. __webpack_require__(124);
  129. __webpack_require__(125);
  130. __webpack_require__(126);
  131. __webpack_require__(131);
  132. __webpack_require__(132);
  133. __webpack_require__(136);
  134. __webpack_require__(137);
  135. __webpack_require__(138);
  136. __webpack_require__(139);
  137. __webpack_require__(141);
  138. __webpack_require__(142);
  139. __webpack_require__(143);
  140. __webpack_require__(144);
  141. __webpack_require__(145);
  142. __webpack_require__(146);
  143. __webpack_require__(147);
  144. __webpack_require__(148);
  145. __webpack_require__(149);
  146. __webpack_require__(150);
  147. __webpack_require__(151);
  148. __webpack_require__(152);
  149. __webpack_require__(153);
  150. __webpack_require__(154);
  151. __webpack_require__(155);
  152. __webpack_require__(157);
  153. __webpack_require__(158);
  154. __webpack_require__(160);
  155. __webpack_require__(161);
  156. __webpack_require__(167);
  157. __webpack_require__(168);
  158. __webpack_require__(170);
  159. __webpack_require__(171);
  160. __webpack_require__(172);
  161. __webpack_require__(176);
  162. __webpack_require__(177);
  163. __webpack_require__(178);
  164. __webpack_require__(179);
  165. __webpack_require__(180);
  166. __webpack_require__(182);
  167. __webpack_require__(183);
  168. __webpack_require__(184);
  169. __webpack_require__(185);
  170. __webpack_require__(188);
  171. __webpack_require__(190);
  172. __webpack_require__(191);
  173. __webpack_require__(192);
  174. __webpack_require__(194);
  175. __webpack_require__(196);
  176. __webpack_require__(198);
  177. __webpack_require__(199);
  178. __webpack_require__(200);
  179. __webpack_require__(202);
  180. __webpack_require__(203);
  181. __webpack_require__(204);
  182. __webpack_require__(205);
  183. __webpack_require__(216);
  184. __webpack_require__(220);
  185. __webpack_require__(221);
  186. __webpack_require__(223);
  187. __webpack_require__(224);
  188. __webpack_require__(228);
  189. __webpack_require__(229);
  190. __webpack_require__(231);
  191. __webpack_require__(232);
  192. __webpack_require__(233);
  193. __webpack_require__(234);
  194. __webpack_require__(235);
  195. __webpack_require__(236);
  196. __webpack_require__(237);
  197. __webpack_require__(238);
  198. __webpack_require__(239);
  199. __webpack_require__(240);
  200. __webpack_require__(241);
  201. __webpack_require__(242);
  202. __webpack_require__(243);
  203. __webpack_require__(244);
  204. __webpack_require__(245);
  205. __webpack_require__(246);
  206. __webpack_require__(247);
  207. __webpack_require__(248);
  208. __webpack_require__(249);
  209. __webpack_require__(251);
  210. __webpack_require__(252);
  211. __webpack_require__(253);
  212. __webpack_require__(254);
  213. __webpack_require__(255);
  214. __webpack_require__(257);
  215. __webpack_require__(258);
  216. __webpack_require__(259);
  217. __webpack_require__(261);
  218. __webpack_require__(262);
  219. __webpack_require__(263);
  220. __webpack_require__(264);
  221. __webpack_require__(265);
  222. __webpack_require__(266);
  223. __webpack_require__(267);
  224. __webpack_require__(268);
  225. __webpack_require__(270);
  226. __webpack_require__(271);
  227. __webpack_require__(273);
  228. __webpack_require__(274);
  229. __webpack_require__(275);
  230. __webpack_require__(276);
  231. __webpack_require__(279);
  232. __webpack_require__(280);
  233. __webpack_require__(282);
  234. __webpack_require__(283);
  235. __webpack_require__(284);
  236. __webpack_require__(285);
  237. __webpack_require__(287);
  238. __webpack_require__(288);
  239. __webpack_require__(289);
  240. __webpack_require__(290);
  241. __webpack_require__(291);
  242. __webpack_require__(292);
  243. __webpack_require__(293);
  244. __webpack_require__(294);
  245. __webpack_require__(295);
  246. __webpack_require__(296);
  247. __webpack_require__(298);
  248. __webpack_require__(299);
  249. __webpack_require__(300);
  250. __webpack_require__(301);
  251. __webpack_require__(302);
  252. __webpack_require__(303);
  253. __webpack_require__(304);
  254. __webpack_require__(305);
  255. __webpack_require__(306);
  256. __webpack_require__(307);
  257. __webpack_require__(308);
  258. __webpack_require__(310);
  259. __webpack_require__(311);
  260. __webpack_require__(312);
  261. __webpack_require__(313);
  262. __webpack_require__(314);
  263. __webpack_require__(315);
  264. __webpack_require__(316);
  265. __webpack_require__(317);
  266. __webpack_require__(318);
  267. __webpack_require__(319);
  268. __webpack_require__(320);
  269. __webpack_require__(321);
  270. __webpack_require__(322);
  271. module.exports = __webpack_require__(9);
  272. /***/ }),
  273. /* 3 */
  274. /***/ (function(module, exports, __webpack_require__) {
  275. 'use strict';
  276. // ECMAScript 6 symbols shim
  277. var global = __webpack_require__(4);
  278. var has = __webpack_require__(5);
  279. var DESCRIPTORS = __webpack_require__(6);
  280. var $export = __webpack_require__(8);
  281. var redefine = __webpack_require__(18);
  282. var META = __webpack_require__(22).KEY;
  283. var $fails = __webpack_require__(7);
  284. var shared = __webpack_require__(23);
  285. var setToStringTag = __webpack_require__(25);
  286. var uid = __webpack_require__(19);
  287. var wks = __webpack_require__(26);
  288. var wksExt = __webpack_require__(27);
  289. var wksDefine = __webpack_require__(28);
  290. var enumKeys = __webpack_require__(29);
  291. var isArray = __webpack_require__(44);
  292. var anObject = __webpack_require__(12);
  293. var isObject = __webpack_require__(13);
  294. var toIObject = __webpack_require__(32);
  295. var toPrimitive = __webpack_require__(16);
  296. var createDesc = __webpack_require__(17);
  297. var _create = __webpack_require__(45);
  298. var gOPNExt = __webpack_require__(48);
  299. var $GOPD = __webpack_require__(50);
  300. var $DP = __webpack_require__(11);
  301. var $keys = __webpack_require__(30);
  302. var gOPD = $GOPD.f;
  303. var dP = $DP.f;
  304. var gOPN = gOPNExt.f;
  305. var $Symbol = global.Symbol;
  306. var $JSON = global.JSON;
  307. var _stringify = $JSON && $JSON.stringify;
  308. var PROTOTYPE = 'prototype';
  309. var HIDDEN = wks('_hidden');
  310. var TO_PRIMITIVE = wks('toPrimitive');
  311. var isEnum = {}.propertyIsEnumerable;
  312. var SymbolRegistry = shared('symbol-registry');
  313. var AllSymbols = shared('symbols');
  314. var OPSymbols = shared('op-symbols');
  315. var ObjectProto = Object[PROTOTYPE];
  316. var USE_NATIVE = typeof $Symbol == 'function';
  317. var QObject = global.QObject;
  318. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  319. var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  320. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  321. var setSymbolDesc = DESCRIPTORS && $fails(function () {
  322. return _create(dP({}, 'a', {
  323. get: function () { return dP(this, 'a', { value: 7 }).a; }
  324. })).a != 7;
  325. }) ? function (it, key, D) {
  326. var protoDesc = gOPD(ObjectProto, key);
  327. if (protoDesc) delete ObjectProto[key];
  328. dP(it, key, D);
  329. if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
  330. } : dP;
  331. var wrap = function (tag) {
  332. var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
  333. sym._k = tag;
  334. return sym;
  335. };
  336. var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
  337. return typeof it == 'symbol';
  338. } : function (it) {
  339. return it instanceof $Symbol;
  340. };
  341. var $defineProperty = function defineProperty(it, key, D) {
  342. if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
  343. anObject(it);
  344. key = toPrimitive(key, true);
  345. anObject(D);
  346. if (has(AllSymbols, key)) {
  347. if (!D.enumerable) {
  348. if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
  349. it[HIDDEN][key] = true;
  350. } else {
  351. if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
  352. D = _create(D, { enumerable: createDesc(0, false) });
  353. } return setSymbolDesc(it, key, D);
  354. } return dP(it, key, D);
  355. };
  356. var $defineProperties = function defineProperties(it, P) {
  357. anObject(it);
  358. var keys = enumKeys(P = toIObject(P));
  359. var i = 0;
  360. var l = keys.length;
  361. var key;
  362. while (l > i) $defineProperty(it, key = keys[i++], P[key]);
  363. return it;
  364. };
  365. var $create = function create(it, P) {
  366. return P === undefined ? _create(it) : $defineProperties(_create(it), P);
  367. };
  368. var $propertyIsEnumerable = function propertyIsEnumerable(key) {
  369. var E = isEnum.call(this, key = toPrimitive(key, true));
  370. if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
  371. return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
  372. };
  373. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
  374. it = toIObject(it);
  375. key = toPrimitive(key, true);
  376. if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
  377. var D = gOPD(it, key);
  378. if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
  379. return D;
  380. };
  381. var $getOwnPropertyNames = function getOwnPropertyNames(it) {
  382. var names = gOPN(toIObject(it));
  383. var result = [];
  384. var i = 0;
  385. var key;
  386. while (names.length > i) {
  387. if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
  388. } return result;
  389. };
  390. var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
  391. var IS_OP = it === ObjectProto;
  392. var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
  393. var result = [];
  394. var i = 0;
  395. var key;
  396. while (names.length > i) {
  397. if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
  398. } return result;
  399. };
  400. // 19.4.1.1 Symbol([description])
  401. if (!USE_NATIVE) {
  402. $Symbol = function Symbol() {
  403. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
  404. var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
  405. var $set = function (value) {
  406. if (this === ObjectProto) $set.call(OPSymbols, value);
  407. if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  408. setSymbolDesc(this, tag, createDesc(1, value));
  409. };
  410. if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
  411. return wrap(tag);
  412. };
  413. redefine($Symbol[PROTOTYPE], 'toString', function toString() {
  414. return this._k;
  415. });
  416. $GOPD.f = $getOwnPropertyDescriptor;
  417. $DP.f = $defineProperty;
  418. __webpack_require__(49).f = gOPNExt.f = $getOwnPropertyNames;
  419. __webpack_require__(43).f = $propertyIsEnumerable;
  420. __webpack_require__(42).f = $getOwnPropertySymbols;
  421. if (DESCRIPTORS && !__webpack_require__(24)) {
  422. redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
  423. }
  424. wksExt.f = function (name) {
  425. return wrap(wks(name));
  426. };
  427. }
  428. $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
  429. for (var es6Symbols = (
  430. // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
  431. 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
  432. ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
  433. for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
  434. $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
  435. // 19.4.2.1 Symbol.for(key)
  436. 'for': function (key) {
  437. return has(SymbolRegistry, key += '')
  438. ? SymbolRegistry[key]
  439. : SymbolRegistry[key] = $Symbol(key);
  440. },
  441. // 19.4.2.5 Symbol.keyFor(sym)
  442. keyFor: function keyFor(sym) {
  443. if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
  444. for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
  445. },
  446. useSetter: function () { setter = true; },
  447. useSimple: function () { setter = false; }
  448. });
  449. $export($export.S + $export.F * !USE_NATIVE, 'Object', {
  450. // 19.1.2.2 Object.create(O [, Properties])
  451. create: $create,
  452. // 19.1.2.4 Object.defineProperty(O, P, Attributes)
  453. defineProperty: $defineProperty,
  454. // 19.1.2.3 Object.defineProperties(O, Properties)
  455. defineProperties: $defineProperties,
  456. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  457. getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
  458. // 19.1.2.7 Object.getOwnPropertyNames(O)
  459. getOwnPropertyNames: $getOwnPropertyNames,
  460. // 19.1.2.8 Object.getOwnPropertySymbols(O)
  461. getOwnPropertySymbols: $getOwnPropertySymbols
  462. });
  463. // 24.3.2 JSON.stringify(value [, replacer [, space]])
  464. $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
  465. var S = $Symbol();
  466. // MS Edge converts symbol values to JSON as {}
  467. // WebKit converts symbol values to JSON as null
  468. // V8 throws on boxed symbols
  469. return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
  470. })), 'JSON', {
  471. stringify: function stringify(it) {
  472. var args = [it];
  473. var i = 1;
  474. var replacer, $replacer;
  475. while (arguments.length > i) args.push(arguments[i++]);
  476. $replacer = replacer = args[1];
  477. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  478. if (!isArray(replacer)) replacer = function (key, value) {
  479. if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
  480. if (!isSymbol(value)) return value;
  481. };
  482. args[1] = replacer;
  483. return _stringify.apply($JSON, args);
  484. }
  485. });
  486. // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
  487. $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(10)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
  488. // 19.4.3.5 Symbol.prototype[@@toStringTag]
  489. setToStringTag($Symbol, 'Symbol');
  490. // 20.2.1.9 Math[@@toStringTag]
  491. setToStringTag(Math, 'Math', true);
  492. // 24.3.3 JSON[@@toStringTag]
  493. setToStringTag(global.JSON, 'JSON', true);
  494. /***/ }),
  495. /* 4 */
  496. /***/ (function(module, exports) {
  497. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  498. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  499. ? window : typeof self != 'undefined' && self.Math == Math ? self
  500. // eslint-disable-next-line no-new-func
  501. : Function('return this')();
  502. if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
  503. /***/ }),
  504. /* 5 */
  505. /***/ (function(module, exports) {
  506. var hasOwnProperty = {}.hasOwnProperty;
  507. module.exports = function (it, key) {
  508. return hasOwnProperty.call(it, key);
  509. };
  510. /***/ }),
  511. /* 6 */
  512. /***/ (function(module, exports, __webpack_require__) {
  513. // Thank's IE8 for his funny defineProperty
  514. module.exports = !__webpack_require__(7)(function () {
  515. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  516. });
  517. /***/ }),
  518. /* 7 */
  519. /***/ (function(module, exports) {
  520. module.exports = function (exec) {
  521. try {
  522. return !!exec();
  523. } catch (e) {
  524. return true;
  525. }
  526. };
  527. /***/ }),
  528. /* 8 */
  529. /***/ (function(module, exports, __webpack_require__) {
  530. var global = __webpack_require__(4);
  531. var core = __webpack_require__(9);
  532. var hide = __webpack_require__(10);
  533. var redefine = __webpack_require__(18);
  534. var ctx = __webpack_require__(20);
  535. var PROTOTYPE = 'prototype';
  536. var $export = function (type, name, source) {
  537. var IS_FORCED = type & $export.F;
  538. var IS_GLOBAL = type & $export.G;
  539. var IS_STATIC = type & $export.S;
  540. var IS_PROTO = type & $export.P;
  541. var IS_BIND = type & $export.B;
  542. var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
  543. var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  544. var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
  545. var key, own, out, exp;
  546. if (IS_GLOBAL) source = name;
  547. for (key in source) {
  548. // contains in native
  549. own = !IS_FORCED && target && target[key] !== undefined;
  550. // export native or passed
  551. out = (own ? target : source)[key];
  552. // bind timers to global for call from export context
  553. exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  554. // extend global
  555. if (target) redefine(target, key, out, type & $export.U);
  556. // export
  557. if (exports[key] != out) hide(exports, key, exp);
  558. if (IS_PROTO && expProto[key] != out) expProto[key] = out;
  559. }
  560. };
  561. global.core = core;
  562. // type bitmap
  563. $export.F = 1; // forced
  564. $export.G = 2; // global
  565. $export.S = 4; // static
  566. $export.P = 8; // proto
  567. $export.B = 16; // bind
  568. $export.W = 32; // wrap
  569. $export.U = 64; // safe
  570. $export.R = 128; // real proto method for `library`
  571. module.exports = $export;
  572. /***/ }),
  573. /* 9 */
  574. /***/ (function(module, exports) {
  575. var core = module.exports = { version: '2.5.7' };
  576. if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
  577. /***/ }),
  578. /* 10 */
  579. /***/ (function(module, exports, __webpack_require__) {
  580. var dP = __webpack_require__(11);
  581. var createDesc = __webpack_require__(17);
  582. module.exports = __webpack_require__(6) ? function (object, key, value) {
  583. return dP.f(object, key, createDesc(1, value));
  584. } : function (object, key, value) {
  585. object[key] = value;
  586. return object;
  587. };
  588. /***/ }),
  589. /* 11 */
  590. /***/ (function(module, exports, __webpack_require__) {
  591. var anObject = __webpack_require__(12);
  592. var IE8_DOM_DEFINE = __webpack_require__(14);
  593. var toPrimitive = __webpack_require__(16);
  594. var dP = Object.defineProperty;
  595. exports.f = __webpack_require__(6) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  596. anObject(O);
  597. P = toPrimitive(P, true);
  598. anObject(Attributes);
  599. if (IE8_DOM_DEFINE) try {
  600. return dP(O, P, Attributes);
  601. } catch (e) { /* empty */ }
  602. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  603. if ('value' in Attributes) O[P] = Attributes.value;
  604. return O;
  605. };
  606. /***/ }),
  607. /* 12 */
  608. /***/ (function(module, exports, __webpack_require__) {
  609. var isObject = __webpack_require__(13);
  610. module.exports = function (it) {
  611. if (!isObject(it)) throw TypeError(it + ' is not an object!');
  612. return it;
  613. };
  614. /***/ }),
  615. /* 13 */
  616. /***/ (function(module, exports) {
  617. module.exports = function (it) {
  618. return typeof it === 'object' ? it !== null : typeof it === 'function';
  619. };
  620. /***/ }),
  621. /* 14 */
  622. /***/ (function(module, exports, __webpack_require__) {
  623. module.exports = !__webpack_require__(6) && !__webpack_require__(7)(function () {
  624. return Object.defineProperty(__webpack_require__(15)('div'), 'a', { get: function () { return 7; } }).a != 7;
  625. });
  626. /***/ }),
  627. /* 15 */
  628. /***/ (function(module, exports, __webpack_require__) {
  629. var isObject = __webpack_require__(13);
  630. var document = __webpack_require__(4).document;
  631. // typeof document.createElement is 'object' in old IE
  632. var is = isObject(document) && isObject(document.createElement);
  633. module.exports = function (it) {
  634. return is ? document.createElement(it) : {};
  635. };
  636. /***/ }),
  637. /* 16 */
  638. /***/ (function(module, exports, __webpack_require__) {
  639. // 7.1.1 ToPrimitive(input [, PreferredType])
  640. var isObject = __webpack_require__(13);
  641. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  642. // and the second argument - flag - preferred type is a string
  643. module.exports = function (it, S) {
  644. if (!isObject(it)) return it;
  645. var fn, val;
  646. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  647. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  648. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  649. throw TypeError("Can't convert object to primitive value");
  650. };
  651. /***/ }),
  652. /* 17 */
  653. /***/ (function(module, exports) {
  654. module.exports = function (bitmap, value) {
  655. return {
  656. enumerable: !(bitmap & 1),
  657. configurable: !(bitmap & 2),
  658. writable: !(bitmap & 4),
  659. value: value
  660. };
  661. };
  662. /***/ }),
  663. /* 18 */
  664. /***/ (function(module, exports, __webpack_require__) {
  665. var global = __webpack_require__(4);
  666. var hide = __webpack_require__(10);
  667. var has = __webpack_require__(5);
  668. var SRC = __webpack_require__(19)('src');
  669. var TO_STRING = 'toString';
  670. var $toString = Function[TO_STRING];
  671. var TPL = ('' + $toString).split(TO_STRING);
  672. __webpack_require__(9).inspectSource = function (it) {
  673. return $toString.call(it);
  674. };
  675. (module.exports = function (O, key, val, safe) {
  676. var isFunction = typeof val == 'function';
  677. if (isFunction) has(val, 'name') || hide(val, 'name', key);
  678. if (O[key] === val) return;
  679. if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
  680. if (O === global) {
  681. O[key] = val;
  682. } else if (!safe) {
  683. delete O[key];
  684. hide(O, key, val);
  685. } else if (O[key]) {
  686. O[key] = val;
  687. } else {
  688. hide(O, key, val);
  689. }
  690. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  691. })(Function.prototype, TO_STRING, function toString() {
  692. return typeof this == 'function' && this[SRC] || $toString.call(this);
  693. });
  694. /***/ }),
  695. /* 19 */
  696. /***/ (function(module, exports) {
  697. var id = 0;
  698. var px = Math.random();
  699. module.exports = function (key) {
  700. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  701. };
  702. /***/ }),
  703. /* 20 */
  704. /***/ (function(module, exports, __webpack_require__) {
  705. // optional / simple context binding
  706. var aFunction = __webpack_require__(21);
  707. module.exports = function (fn, that, length) {
  708. aFunction(fn);
  709. if (that === undefined) return fn;
  710. switch (length) {
  711. case 1: return function (a) {
  712. return fn.call(that, a);
  713. };
  714. case 2: return function (a, b) {
  715. return fn.call(that, a, b);
  716. };
  717. case 3: return function (a, b, c) {
  718. return fn.call(that, a, b, c);
  719. };
  720. }
  721. return function (/* ...args */) {
  722. return fn.apply(that, arguments);
  723. };
  724. };
  725. /***/ }),
  726. /* 21 */
  727. /***/ (function(module, exports) {
  728. module.exports = function (it) {
  729. if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  730. return it;
  731. };
  732. /***/ }),
  733. /* 22 */
  734. /***/ (function(module, exports, __webpack_require__) {
  735. var META = __webpack_require__(19)('meta');
  736. var isObject = __webpack_require__(13);
  737. var has = __webpack_require__(5);
  738. var setDesc = __webpack_require__(11).f;
  739. var id = 0;
  740. var isExtensible = Object.isExtensible || function () {
  741. return true;
  742. };
  743. var FREEZE = !__webpack_require__(7)(function () {
  744. return isExtensible(Object.preventExtensions({}));
  745. });
  746. var setMeta = function (it) {
  747. setDesc(it, META, { value: {
  748. i: 'O' + ++id, // object ID
  749. w: {} // weak collections IDs
  750. } });
  751. };
  752. var fastKey = function (it, create) {
  753. // return primitive with prefix
  754. if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  755. if (!has(it, META)) {
  756. // can't set metadata to uncaught frozen object
  757. if (!isExtensible(it)) return 'F';
  758. // not necessary to add metadata
  759. if (!create) return 'E';
  760. // add missing metadata
  761. setMeta(it);
  762. // return object ID
  763. } return it[META].i;
  764. };
  765. var getWeak = function (it, create) {
  766. if (!has(it, META)) {
  767. // can't set metadata to uncaught frozen object
  768. if (!isExtensible(it)) return true;
  769. // not necessary to add metadata
  770. if (!create) return false;
  771. // add missing metadata
  772. setMeta(it);
  773. // return hash weak collections IDs
  774. } return it[META].w;
  775. };
  776. // add metadata on freeze-family methods calling
  777. var onFreeze = function (it) {
  778. if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
  779. return it;
  780. };
  781. var meta = module.exports = {
  782. KEY: META,
  783. NEED: false,
  784. fastKey: fastKey,
  785. getWeak: getWeak,
  786. onFreeze: onFreeze
  787. };
  788. /***/ }),
  789. /* 23 */
  790. /***/ (function(module, exports, __webpack_require__) {
  791. var core = __webpack_require__(9);
  792. var global = __webpack_require__(4);
  793. var SHARED = '__core-js_shared__';
  794. var store = global[SHARED] || (global[SHARED] = {});
  795. (module.exports = function (key, value) {
  796. return store[key] || (store[key] = value !== undefined ? value : {});
  797. })('versions', []).push({
  798. version: core.version,
  799. mode: __webpack_require__(24) ? 'pure' : 'global',
  800. copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
  801. });
  802. /***/ }),
  803. /* 24 */
  804. /***/ (function(module, exports) {
  805. module.exports = false;
  806. /***/ }),
  807. /* 25 */
  808. /***/ (function(module, exports, __webpack_require__) {
  809. var def = __webpack_require__(11).f;
  810. var has = __webpack_require__(5);
  811. var TAG = __webpack_require__(26)('toStringTag');
  812. module.exports = function (it, tag, stat) {
  813. if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
  814. };
  815. /***/ }),
  816. /* 26 */
  817. /***/ (function(module, exports, __webpack_require__) {
  818. var store = __webpack_require__(23)('wks');
  819. var uid = __webpack_require__(19);
  820. var Symbol = __webpack_require__(4).Symbol;
  821. var USE_SYMBOL = typeof Symbol == 'function';
  822. var $exports = module.exports = function (name) {
  823. return store[name] || (store[name] =
  824. USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
  825. };
  826. $exports.store = store;
  827. /***/ }),
  828. /* 27 */
  829. /***/ (function(module, exports, __webpack_require__) {
  830. exports.f = __webpack_require__(26);
  831. /***/ }),
  832. /* 28 */
  833. /***/ (function(module, exports, __webpack_require__) {
  834. var global = __webpack_require__(4);
  835. var core = __webpack_require__(9);
  836. var LIBRARY = __webpack_require__(24);
  837. var wksExt = __webpack_require__(27);
  838. var defineProperty = __webpack_require__(11).f;
  839. module.exports = function (name) {
  840. var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
  841. if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
  842. };
  843. /***/ }),
  844. /* 29 */
  845. /***/ (function(module, exports, __webpack_require__) {
  846. // all enumerable object keys, includes symbols
  847. var getKeys = __webpack_require__(30);
  848. var gOPS = __webpack_require__(42);
  849. var pIE = __webpack_require__(43);
  850. module.exports = function (it) {
  851. var result = getKeys(it);
  852. var getSymbols = gOPS.f;
  853. if (getSymbols) {
  854. var symbols = getSymbols(it);
  855. var isEnum = pIE.f;
  856. var i = 0;
  857. var key;
  858. while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
  859. } return result;
  860. };
  861. /***/ }),
  862. /* 30 */
  863. /***/ (function(module, exports, __webpack_require__) {
  864. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  865. var $keys = __webpack_require__(31);
  866. var enumBugKeys = __webpack_require__(41);
  867. module.exports = Object.keys || function keys(O) {
  868. return $keys(O, enumBugKeys);
  869. };
  870. /***/ }),
  871. /* 31 */
  872. /***/ (function(module, exports, __webpack_require__) {
  873. var has = __webpack_require__(5);
  874. var toIObject = __webpack_require__(32);
  875. var arrayIndexOf = __webpack_require__(36)(false);
  876. var IE_PROTO = __webpack_require__(40)('IE_PROTO');
  877. module.exports = function (object, names) {
  878. var O = toIObject(object);
  879. var i = 0;
  880. var result = [];
  881. var key;
  882. for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  883. // Don't enum bug & hidden keys
  884. while (names.length > i) if (has(O, key = names[i++])) {
  885. ~arrayIndexOf(result, key) || result.push(key);
  886. }
  887. return result;
  888. };
  889. /***/ }),
  890. /* 32 */
  891. /***/ (function(module, exports, __webpack_require__) {
  892. // to indexed object, toObject with fallback for non-array-like ES3 strings
  893. var IObject = __webpack_require__(33);
  894. var defined = __webpack_require__(35);
  895. module.exports = function (it) {
  896. return IObject(defined(it));
  897. };
  898. /***/ }),
  899. /* 33 */
  900. /***/ (function(module, exports, __webpack_require__) {
  901. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  902. var cof = __webpack_require__(34);
  903. // eslint-disable-next-line no-prototype-builtins
  904. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  905. return cof(it) == 'String' ? it.split('') : Object(it);
  906. };
  907. /***/ }),
  908. /* 34 */
  909. /***/ (function(module, exports) {
  910. var toString = {}.toString;
  911. module.exports = function (it) {
  912. return toString.call(it).slice(8, -1);
  913. };
  914. /***/ }),
  915. /* 35 */
  916. /***/ (function(module, exports) {
  917. // 7.2.1 RequireObjectCoercible(argument)
  918. module.exports = function (it) {
  919. if (it == undefined) throw TypeError("Can't call method on " + it);
  920. return it;
  921. };
  922. /***/ }),
  923. /* 36 */
  924. /***/ (function(module, exports, __webpack_require__) {
  925. // false -> Array#indexOf
  926. // true -> Array#includes
  927. var toIObject = __webpack_require__(32);
  928. var toLength = __webpack_require__(37);
  929. var toAbsoluteIndex = __webpack_require__(39);
  930. module.exports = function (IS_INCLUDES) {
  931. return function ($this, el, fromIndex) {
  932. var O = toIObject($this);
  933. var length = toLength(O.length);
  934. var index = toAbsoluteIndex(fromIndex, length);
  935. var value;
  936. // Array#includes uses SameValueZero equality algorithm
  937. // eslint-disable-next-line no-self-compare
  938. if (IS_INCLUDES && el != el) while (length > index) {
  939. value = O[index++];
  940. // eslint-disable-next-line no-self-compare
  941. if (value != value) return true;
  942. // Array#indexOf ignores holes, Array#includes - not
  943. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  944. if (O[index] === el) return IS_INCLUDES || index || 0;
  945. } return !IS_INCLUDES && -1;
  946. };
  947. };
  948. /***/ }),
  949. /* 37 */
  950. /***/ (function(module, exports, __webpack_require__) {
  951. // 7.1.15 ToLength
  952. var toInteger = __webpack_require__(38);
  953. var min = Math.min;
  954. module.exports = function (it) {
  955. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  956. };
  957. /***/ }),
  958. /* 38 */
  959. /***/ (function(module, exports) {
  960. // 7.1.4 ToInteger
  961. var ceil = Math.ceil;
  962. var floor = Math.floor;
  963. module.exports = function (it) {
  964. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  965. };
  966. /***/ }),
  967. /* 39 */
  968. /***/ (function(module, exports, __webpack_require__) {
  969. var toInteger = __webpack_require__(38);
  970. var max = Math.max;
  971. var min = Math.min;
  972. module.exports = function (index, length) {
  973. index = toInteger(index);
  974. return index < 0 ? max(index + length, 0) : min(index, length);
  975. };
  976. /***/ }),
  977. /* 40 */
  978. /***/ (function(module, exports, __webpack_require__) {
  979. var shared = __webpack_require__(23)('keys');
  980. var uid = __webpack_require__(19);
  981. module.exports = function (key) {
  982. return shared[key] || (shared[key] = uid(key));
  983. };
  984. /***/ }),
  985. /* 41 */
  986. /***/ (function(module, exports) {
  987. // IE 8- don't enum bug keys
  988. module.exports = (
  989. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  990. ).split(',');
  991. /***/ }),
  992. /* 42 */
  993. /***/ (function(module, exports) {
  994. exports.f = Object.getOwnPropertySymbols;
  995. /***/ }),
  996. /* 43 */
  997. /***/ (function(module, exports) {
  998. exports.f = {}.propertyIsEnumerable;
  999. /***/ }),
  1000. /* 44 */
  1001. /***/ (function(module, exports, __webpack_require__) {
  1002. // 7.2.2 IsArray(argument)
  1003. var cof = __webpack_require__(34);
  1004. module.exports = Array.isArray || function isArray(arg) {
  1005. return cof(arg) == 'Array';
  1006. };
  1007. /***/ }),
  1008. /* 45 */
  1009. /***/ (function(module, exports, __webpack_require__) {
  1010. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  1011. var anObject = __webpack_require__(12);
  1012. var dPs = __webpack_require__(46);
  1013. var enumBugKeys = __webpack_require__(41);
  1014. var IE_PROTO = __webpack_require__(40)('IE_PROTO');
  1015. var Empty = function () { /* empty */ };
  1016. var PROTOTYPE = 'prototype';
  1017. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1018. var createDict = function () {
  1019. // Thrash, waste and sodomy: IE GC bug
  1020. var iframe = __webpack_require__(15)('iframe');
  1021. var i = enumBugKeys.length;
  1022. var lt = '<';
  1023. var gt = '>';
  1024. var iframeDocument;
  1025. iframe.style.display = 'none';
  1026. __webpack_require__(47).appendChild(iframe);
  1027. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  1028. // createDict = iframe.contentWindow.Object;
  1029. // html.removeChild(iframe);
  1030. iframeDocument = iframe.contentWindow.document;
  1031. iframeDocument.open();
  1032. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  1033. iframeDocument.close();
  1034. createDict = iframeDocument.F;
  1035. while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
  1036. return createDict();
  1037. };
  1038. module.exports = Object.create || function create(O, Properties) {
  1039. var result;
  1040. if (O !== null) {
  1041. Empty[PROTOTYPE] = anObject(O);
  1042. result = new Empty();
  1043. Empty[PROTOTYPE] = null;
  1044. // add "__proto__" for Object.getPrototypeOf polyfill
  1045. result[IE_PROTO] = O;
  1046. } else result = createDict();
  1047. return Properties === undefined ? result : dPs(result, Properties);
  1048. };
  1049. /***/ }),
  1050. /* 46 */
  1051. /***/ (function(module, exports, __webpack_require__) {
  1052. var dP = __webpack_require__(11);
  1053. var anObject = __webpack_require__(12);
  1054. var getKeys = __webpack_require__(30);
  1055. module.exports = __webpack_require__(6) ? Object.defineProperties : function defineProperties(O, Properties) {
  1056. anObject(O);
  1057. var keys = getKeys(Properties);
  1058. var length = keys.length;
  1059. var i = 0;
  1060. var P;
  1061. while (length > i) dP.f(O, P = keys[i++], Properties[P]);
  1062. return O;
  1063. };
  1064. /***/ }),
  1065. /* 47 */
  1066. /***/ (function(module, exports, __webpack_require__) {
  1067. var document = __webpack_require__(4).document;
  1068. module.exports = document && document.documentElement;
  1069. /***/ }),
  1070. /* 48 */
  1071. /***/ (function(module, exports, __webpack_require__) {
  1072. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  1073. var toIObject = __webpack_require__(32);
  1074. var gOPN = __webpack_require__(49).f;
  1075. var toString = {}.toString;
  1076. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  1077. ? Object.getOwnPropertyNames(window) : [];
  1078. var getWindowNames = function (it) {
  1079. try {
  1080. return gOPN(it);
  1081. } catch (e) {
  1082. return windowNames.slice();
  1083. }
  1084. };
  1085. module.exports.f = function getOwnPropertyNames(it) {
  1086. return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
  1087. };
  1088. /***/ }),
  1089. /* 49 */
  1090. /***/ (function(module, exports, __webpack_require__) {
  1091. // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
  1092. var $keys = __webpack_require__(31);
  1093. var hiddenKeys = __webpack_require__(41).concat('length', 'prototype');
  1094. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  1095. return $keys(O, hiddenKeys);
  1096. };
  1097. /***/ }),
  1098. /* 50 */
  1099. /***/ (function(module, exports, __webpack_require__) {
  1100. var pIE = __webpack_require__(43);
  1101. var createDesc = __webpack_require__(17);
  1102. var toIObject = __webpack_require__(32);
  1103. var toPrimitive = __webpack_require__(16);
  1104. var has = __webpack_require__(5);
  1105. var IE8_DOM_DEFINE = __webpack_require__(14);
  1106. var gOPD = Object.getOwnPropertyDescriptor;
  1107. exports.f = __webpack_require__(6) ? gOPD : function getOwnPropertyDescriptor(O, P) {
  1108. O = toIObject(O);
  1109. P = toPrimitive(P, true);
  1110. if (IE8_DOM_DEFINE) try {
  1111. return gOPD(O, P);
  1112. } catch (e) { /* empty */ }
  1113. if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
  1114. };
  1115. /***/ }),
  1116. /* 51 */
  1117. /***/ (function(module, exports, __webpack_require__) {
  1118. var $export = __webpack_require__(8);
  1119. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  1120. $export($export.S, 'Object', { create: __webpack_require__(45) });
  1121. /***/ }),
  1122. /* 52 */
  1123. /***/ (function(module, exports, __webpack_require__) {
  1124. var $export = __webpack_require__(8);
  1125. // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
  1126. $export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperty: __webpack_require__(11).f });
  1127. /***/ }),
  1128. /* 53 */
  1129. /***/ (function(module, exports, __webpack_require__) {
  1130. var $export = __webpack_require__(8);
  1131. // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
  1132. $export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperties: __webpack_require__(46) });
  1133. /***/ }),
  1134. /* 54 */
  1135. /***/ (function(module, exports, __webpack_require__) {
  1136. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  1137. var toIObject = __webpack_require__(32);
  1138. var $getOwnPropertyDescriptor = __webpack_require__(50).f;
  1139. __webpack_require__(55)('getOwnPropertyDescriptor', function () {
  1140. return function getOwnPropertyDescriptor(it, key) {
  1141. return $getOwnPropertyDescriptor(toIObject(it), key);
  1142. };
  1143. });
  1144. /***/ }),
  1145. /* 55 */
  1146. /***/ (function(module, exports, __webpack_require__) {
  1147. // most Object methods by ES6 should accept primitives
  1148. var $export = __webpack_require__(8);
  1149. var core = __webpack_require__(9);
  1150. var fails = __webpack_require__(7);
  1151. module.exports = function (KEY, exec) {
  1152. var fn = (core.Object || {})[KEY] || Object[KEY];
  1153. var exp = {};
  1154. exp[KEY] = exec(fn);
  1155. $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
  1156. };
  1157. /***/ }),
  1158. /* 56 */
  1159. /***/ (function(module, exports, __webpack_require__) {
  1160. // 19.1.2.9 Object.getPrototypeOf(O)
  1161. var toObject = __webpack_require__(57);
  1162. var $getPrototypeOf = __webpack_require__(58);
  1163. __webpack_require__(55)('getPrototypeOf', function () {
  1164. return function getPrototypeOf(it) {
  1165. return $getPrototypeOf(toObject(it));
  1166. };
  1167. });
  1168. /***/ }),
  1169. /* 57 */
  1170. /***/ (function(module, exports, __webpack_require__) {
  1171. // 7.1.13 ToObject(argument)
  1172. var defined = __webpack_require__(35);
  1173. module.exports = function (it) {
  1174. return Object(defined(it));
  1175. };
  1176. /***/ }),
  1177. /* 58 */
  1178. /***/ (function(module, exports, __webpack_require__) {
  1179. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  1180. var has = __webpack_require__(5);
  1181. var toObject = __webpack_require__(57);
  1182. var IE_PROTO = __webpack_require__(40)('IE_PROTO');
  1183. var ObjectProto = Object.prototype;
  1184. module.exports = Object.getPrototypeOf || function (O) {
  1185. O = toObject(O);
  1186. if (has(O, IE_PROTO)) return O[IE_PROTO];
  1187. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  1188. return O.constructor.prototype;
  1189. } return O instanceof Object ? ObjectProto : null;
  1190. };
  1191. /***/ }),
  1192. /* 59 */
  1193. /***/ (function(module, exports, __webpack_require__) {
  1194. // 19.1.2.14 Object.keys(O)
  1195. var toObject = __webpack_require__(57);
  1196. var $keys = __webpack_require__(30);
  1197. __webpack_require__(55)('keys', function () {
  1198. return function keys(it) {
  1199. return $keys(toObject(it));
  1200. };
  1201. });
  1202. /***/ }),
  1203. /* 60 */
  1204. /***/ (function(module, exports, __webpack_require__) {
  1205. // 19.1.2.7 Object.getOwnPropertyNames(O)
  1206. __webpack_require__(55)('getOwnPropertyNames', function () {
  1207. return __webpack_require__(48).f;
  1208. });
  1209. /***/ }),
  1210. /* 61 */
  1211. /***/ (function(module, exports, __webpack_require__) {
  1212. // 19.1.2.5 Object.freeze(O)
  1213. var isObject = __webpack_require__(13);
  1214. var meta = __webpack_require__(22).onFreeze;
  1215. __webpack_require__(55)('freeze', function ($freeze) {
  1216. return function freeze(it) {
  1217. return $freeze && isObject(it) ? $freeze(meta(it)) : it;
  1218. };
  1219. });
  1220. /***/ }),
  1221. /* 62 */
  1222. /***/ (function(module, exports, __webpack_require__) {
  1223. // 19.1.2.17 Object.seal(O)
  1224. var isObject = __webpack_require__(13);
  1225. var meta = __webpack_require__(22).onFreeze;
  1226. __webpack_require__(55)('seal', function ($seal) {
  1227. return function seal(it) {
  1228. return $seal && isObject(it) ? $seal(meta(it)) : it;
  1229. };
  1230. });
  1231. /***/ }),
  1232. /* 63 */
  1233. /***/ (function(module, exports, __webpack_require__) {
  1234. // 19.1.2.15 Object.preventExtensions(O)
  1235. var isObject = __webpack_require__(13);
  1236. var meta = __webpack_require__(22).onFreeze;
  1237. __webpack_require__(55)('preventExtensions', function ($preventExtensions) {
  1238. return function preventExtensions(it) {
  1239. return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;
  1240. };
  1241. });
  1242. /***/ }),
  1243. /* 64 */
  1244. /***/ (function(module, exports, __webpack_require__) {
  1245. // 19.1.2.12 Object.isFrozen(O)
  1246. var isObject = __webpack_require__(13);
  1247. __webpack_require__(55)('isFrozen', function ($isFrozen) {
  1248. return function isFrozen(it) {
  1249. return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;
  1250. };
  1251. });
  1252. /***/ }),
  1253. /* 65 */
  1254. /***/ (function(module, exports, __webpack_require__) {
  1255. // 19.1.2.13 Object.isSealed(O)
  1256. var isObject = __webpack_require__(13);
  1257. __webpack_require__(55)('isSealed', function ($isSealed) {
  1258. return function isSealed(it) {
  1259. return isObject(it) ? $isSealed ? $isSealed(it) : false : true;
  1260. };
  1261. });
  1262. /***/ }),
  1263. /* 66 */
  1264. /***/ (function(module, exports, __webpack_require__) {
  1265. // 19.1.2.11 Object.isExtensible(O)
  1266. var isObject = __webpack_require__(13);
  1267. __webpack_require__(55)('isExtensible', function ($isExtensible) {
  1268. return function isExtensible(it) {
  1269. return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
  1270. };
  1271. });
  1272. /***/ }),
  1273. /* 67 */
  1274. /***/ (function(module, exports, __webpack_require__) {
  1275. // 19.1.3.1 Object.assign(target, source)
  1276. var $export = __webpack_require__(8);
  1277. $export($export.S + $export.F, 'Object', { assign: __webpack_require__(68) });
  1278. /***/ }),
  1279. /* 68 */
  1280. /***/ (function(module, exports, __webpack_require__) {
  1281. 'use strict';
  1282. // 19.1.2.1 Object.assign(target, source, ...)
  1283. var getKeys = __webpack_require__(30);
  1284. var gOPS = __webpack_require__(42);
  1285. var pIE = __webpack_require__(43);
  1286. var toObject = __webpack_require__(57);
  1287. var IObject = __webpack_require__(33);
  1288. var $assign = Object.assign;
  1289. // should work with symbols and should have deterministic property order (V8 bug)
  1290. module.exports = !$assign || __webpack_require__(7)(function () {
  1291. var A = {};
  1292. var B = {};
  1293. // eslint-disable-next-line no-undef
  1294. var S = Symbol();
  1295. var K = 'abcdefghijklmnopqrst';
  1296. A[S] = 7;
  1297. K.split('').forEach(function (k) { B[k] = k; });
  1298. return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
  1299. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  1300. var T = toObject(target);
  1301. var aLen = arguments.length;
  1302. var index = 1;
  1303. var getSymbols = gOPS.f;
  1304. var isEnum = pIE.f;
  1305. while (aLen > index) {
  1306. var S = IObject(arguments[index++]);
  1307. var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
  1308. var length = keys.length;
  1309. var j = 0;
  1310. var key;
  1311. while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
  1312. } return T;
  1313. } : $assign;
  1314. /***/ }),
  1315. /* 69 */
  1316. /***/ (function(module, exports, __webpack_require__) {
  1317. // 19.1.3.10 Object.is(value1, value2)
  1318. var $export = __webpack_require__(8);
  1319. $export($export.S, 'Object', { is: __webpack_require__(70) });
  1320. /***/ }),
  1321. /* 70 */
  1322. /***/ (function(module, exports) {
  1323. // 7.2.9 SameValue(x, y)
  1324. module.exports = Object.is || function is(x, y) {
  1325. // eslint-disable-next-line no-self-compare
  1326. return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  1327. };
  1328. /***/ }),
  1329. /* 71 */
  1330. /***/ (function(module, exports, __webpack_require__) {
  1331. // 19.1.3.19 Object.setPrototypeOf(O, proto)
  1332. var $export = __webpack_require__(8);
  1333. $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(72).set });
  1334. /***/ }),
  1335. /* 72 */
  1336. /***/ (function(module, exports, __webpack_require__) {
  1337. // Works with __proto__ only. Old v8 can't work with null proto objects.
  1338. /* eslint-disable no-proto */
  1339. var isObject = __webpack_require__(13);
  1340. var anObject = __webpack_require__(12);
  1341. var check = function (O, proto) {
  1342. anObject(O);
  1343. if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
  1344. };
  1345. module.exports = {
  1346. set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
  1347. function (test, buggy, set) {
  1348. try {
  1349. set = __webpack_require__(20)(Function.call, __webpack_require__(50).f(Object.prototype, '__proto__').set, 2);
  1350. set(test, []);
  1351. buggy = !(test instanceof Array);
  1352. } catch (e) { buggy = true; }
  1353. return function setPrototypeOf(O, proto) {
  1354. check(O, proto);
  1355. if (buggy) O.__proto__ = proto;
  1356. else set(O, proto);
  1357. return O;
  1358. };
  1359. }({}, false) : undefined),
  1360. check: check
  1361. };
  1362. /***/ }),
  1363. /* 73 */
  1364. /***/ (function(module, exports, __webpack_require__) {
  1365. 'use strict';
  1366. // 19.1.3.6 Object.prototype.toString()
  1367. var classof = __webpack_require__(74);
  1368. var test = {};
  1369. test[__webpack_require__(26)('toStringTag')] = 'z';
  1370. if (test + '' != '[object z]') {
  1371. __webpack_require__(18)(Object.prototype, 'toString', function toString() {
  1372. return '[object ' + classof(this) + ']';
  1373. }, true);
  1374. }
  1375. /***/ }),
  1376. /* 74 */
  1377. /***/ (function(module, exports, __webpack_require__) {
  1378. // getting tag from 19.1.3.6 Object.prototype.toString()
  1379. var cof = __webpack_require__(34);
  1380. var TAG = __webpack_require__(26)('toStringTag');
  1381. // ES3 wrong here
  1382. var ARG = cof(function () { return arguments; }()) == 'Arguments';
  1383. // fallback for IE11 Script Access Denied error
  1384. var tryGet = function (it, key) {
  1385. try {
  1386. return it[key];
  1387. } catch (e) { /* empty */ }
  1388. };
  1389. module.exports = function (it) {
  1390. var O, T, B;
  1391. return it === undefined ? 'Undefined' : it === null ? 'Null'
  1392. // @@toStringTag case
  1393. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  1394. // builtinTag case
  1395. : ARG ? cof(O)
  1396. // ES3 arguments fallback
  1397. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  1398. };
  1399. /***/ }),
  1400. /* 75 */
  1401. /***/ (function(module, exports, __webpack_require__) {
  1402. // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
  1403. var $export = __webpack_require__(8);
  1404. $export($export.P, 'Function', { bind: __webpack_require__(76) });
  1405. /***/ }),
  1406. /* 76 */
  1407. /***/ (function(module, exports, __webpack_require__) {
  1408. 'use strict';
  1409. var aFunction = __webpack_require__(21);
  1410. var isObject = __webpack_require__(13);
  1411. var invoke = __webpack_require__(77);
  1412. var arraySlice = [].slice;
  1413. var factories = {};
  1414. var construct = function (F, len, args) {
  1415. if (!(len in factories)) {
  1416. for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';
  1417. // eslint-disable-next-line no-new-func
  1418. factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
  1419. } return factories[len](F, args);
  1420. };
  1421. module.exports = Function.bind || function bind(that /* , ...args */) {
  1422. var fn = aFunction(this);
  1423. var partArgs = arraySlice.call(arguments, 1);
  1424. var bound = function (/* args... */) {
  1425. var args = partArgs.concat(arraySlice.call(arguments));
  1426. return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
  1427. };
  1428. if (isObject(fn.prototype)) bound.prototype = fn.prototype;
  1429. return bound;
  1430. };
  1431. /***/ }),
  1432. /* 77 */
  1433. /***/ (function(module, exports) {
  1434. // fast apply, http://jsperf.lnkit.com/fast-apply/5
  1435. module.exports = function (fn, args, that) {
  1436. var un = that === undefined;
  1437. switch (args.length) {
  1438. case 0: return un ? fn()
  1439. : fn.call(that);
  1440. case 1: return un ? fn(args[0])
  1441. : fn.call(that, args[0]);
  1442. case 2: return un ? fn(args[0], args[1])
  1443. : fn.call(that, args[0], args[1]);
  1444. case 3: return un ? fn(args[0], args[1], args[2])
  1445. : fn.call(that, args[0], args[1], args[2]);
  1446. case 4: return un ? fn(args[0], args[1], args[2], args[3])
  1447. : fn.call(that, args[0], args[1], args[2], args[3]);
  1448. } return fn.apply(that, args);
  1449. };
  1450. /***/ }),
  1451. /* 78 */
  1452. /***/ (function(module, exports, __webpack_require__) {
  1453. var dP = __webpack_require__(11).f;
  1454. var FProto = Function.prototype;
  1455. var nameRE = /^\s*function ([^ (]*)/;
  1456. var NAME = 'name';
  1457. // 19.2.4.2 name
  1458. NAME in FProto || __webpack_require__(6) && dP(FProto, NAME, {
  1459. configurable: true,
  1460. get: function () {
  1461. try {
  1462. return ('' + this).match(nameRE)[1];
  1463. } catch (e) {
  1464. return '';
  1465. }
  1466. }
  1467. });
  1468. /***/ }),
  1469. /* 79 */
  1470. /***/ (function(module, exports, __webpack_require__) {
  1471. 'use strict';
  1472. var isObject = __webpack_require__(13);
  1473. var getPrototypeOf = __webpack_require__(58);
  1474. var HAS_INSTANCE = __webpack_require__(26)('hasInstance');
  1475. var FunctionProto = Function.prototype;
  1476. // 19.2.3.6 Function.prototype[@@hasInstance](V)
  1477. if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(11).f(FunctionProto, HAS_INSTANCE, { value: function (O) {
  1478. if (typeof this != 'function' || !isObject(O)) return false;
  1479. if (!isObject(this.prototype)) return O instanceof this;
  1480. // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:
  1481. while (O = getPrototypeOf(O)) if (this.prototype === O) return true;
  1482. return false;
  1483. } });
  1484. /***/ }),
  1485. /* 80 */
  1486. /***/ (function(module, exports, __webpack_require__) {
  1487. var $export = __webpack_require__(8);
  1488. var $parseInt = __webpack_require__(81);
  1489. // 18.2.5 parseInt(string, radix)
  1490. $export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });
  1491. /***/ }),
  1492. /* 81 */
  1493. /***/ (function(module, exports, __webpack_require__) {
  1494. var $parseInt = __webpack_require__(4).parseInt;
  1495. var $trim = __webpack_require__(82).trim;
  1496. var ws = __webpack_require__(83);
  1497. var hex = /^[-+]?0[xX]/;
  1498. module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {
  1499. var string = $trim(String(str), 3);
  1500. return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
  1501. } : $parseInt;
  1502. /***/ }),
  1503. /* 82 */
  1504. /***/ (function(module, exports, __webpack_require__) {
  1505. var $export = __webpack_require__(8);
  1506. var defined = __webpack_require__(35);
  1507. var fails = __webpack_require__(7);
  1508. var spaces = __webpack_require__(83);
  1509. var space = '[' + spaces + ']';
  1510. var non = '\u200b\u0085';
  1511. var ltrim = RegExp('^' + space + space + '*');
  1512. var rtrim = RegExp(space + space + '*$');
  1513. var exporter = function (KEY, exec, ALIAS) {
  1514. var exp = {};
  1515. var FORCE = fails(function () {
  1516. return !!spaces[KEY]() || non[KEY]() != non;
  1517. });
  1518. var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
  1519. if (ALIAS) exp[ALIAS] = fn;
  1520. $export($export.P + $export.F * FORCE, 'String', exp);
  1521. };
  1522. // 1 -> String#trimLeft
  1523. // 2 -> String#trimRight
  1524. // 3 -> String#trim
  1525. var trim = exporter.trim = function (string, TYPE) {
  1526. string = String(defined(string));
  1527. if (TYPE & 1) string = string.replace(ltrim, '');
  1528. if (TYPE & 2) string = string.replace(rtrim, '');
  1529. return string;
  1530. };
  1531. module.exports = exporter;
  1532. /***/ }),
  1533. /* 83 */
  1534. /***/ (function(module, exports) {
  1535. module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
  1536. '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
  1537. /***/ }),
  1538. /* 84 */
  1539. /***/ (function(module, exports, __webpack_require__) {
  1540. var $export = __webpack_require__(8);
  1541. var $parseFloat = __webpack_require__(85);
  1542. // 18.2.4 parseFloat(string)
  1543. $export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });
  1544. /***/ }),
  1545. /* 85 */
  1546. /***/ (function(module, exports, __webpack_require__) {
  1547. var $parseFloat = __webpack_require__(4).parseFloat;
  1548. var $trim = __webpack_require__(82).trim;
  1549. module.exports = 1 / $parseFloat(__webpack_require__(83) + '-0') !== -Infinity ? function parseFloat(str) {
  1550. var string = $trim(String(str), 3);
  1551. var result = $parseFloat(string);
  1552. return result === 0 && string.charAt(0) == '-' ? -0 : result;
  1553. } : $parseFloat;
  1554. /***/ }),
  1555. /* 86 */
  1556. /***/ (function(module, exports, __webpack_require__) {
  1557. 'use strict';
  1558. var global = __webpack_require__(4);
  1559. var has = __webpack_require__(5);
  1560. var cof = __webpack_require__(34);
  1561. var inheritIfRequired = __webpack_require__(87);
  1562. var toPrimitive = __webpack_require__(16);
  1563. var fails = __webpack_require__(7);
  1564. var gOPN = __webpack_require__(49).f;
  1565. var gOPD = __webpack_require__(50).f;
  1566. var dP = __webpack_require__(11).f;
  1567. var $trim = __webpack_require__(82).trim;
  1568. var NUMBER = 'Number';
  1569. var $Number = global[NUMBER];
  1570. var Base = $Number;
  1571. var proto = $Number.prototype;
  1572. // Opera ~12 has broken Object#toString
  1573. var BROKEN_COF = cof(__webpack_require__(45)(proto)) == NUMBER;
  1574. var TRIM = 'trim' in String.prototype;
  1575. // 7.1.3 ToNumber(argument)
  1576. var toNumber = function (argument) {
  1577. var it = toPrimitive(argument, false);
  1578. if (typeof it == 'string' && it.length > 2) {
  1579. it = TRIM ? it.trim() : $trim(it, 3);
  1580. var first = it.charCodeAt(0);
  1581. var third, radix, maxCode;
  1582. if (first === 43 || first === 45) {
  1583. third = it.charCodeAt(2);
  1584. if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
  1585. } else if (first === 48) {
  1586. switch (it.charCodeAt(1)) {
  1587. case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i
  1588. case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i
  1589. default: return +it;
  1590. }
  1591. for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {
  1592. code = digits.charCodeAt(i);
  1593. // parseInt parses a string to a first unavailable symbol
  1594. // but ToNumber should return NaN if a string contains unavailable symbols
  1595. if (code < 48 || code > maxCode) return NaN;
  1596. } return parseInt(digits, radix);
  1597. }
  1598. } return +it;
  1599. };
  1600. if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {
  1601. $Number = function Number(value) {
  1602. var it = arguments.length < 1 ? 0 : value;
  1603. var that = this;
  1604. return that instanceof $Number
  1605. // check on 1..constructor(foo) case
  1606. && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)
  1607. ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
  1608. };
  1609. for (var keys = __webpack_require__(6) ? gOPN(Base) : (
  1610. // ES3:
  1611. 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
  1612. // ES6 (in case, if modules with ES6 Number statics required before):
  1613. 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
  1614. 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
  1615. ).split(','), j = 0, key; keys.length > j; j++) {
  1616. if (has(Base, key = keys[j]) && !has($Number, key)) {
  1617. dP($Number, key, gOPD(Base, key));
  1618. }
  1619. }
  1620. $Number.prototype = proto;
  1621. proto.constructor = $Number;
  1622. __webpack_require__(18)(global, NUMBER, $Number);
  1623. }
  1624. /***/ }),
  1625. /* 87 */
  1626. /***/ (function(module, exports, __webpack_require__) {
  1627. var isObject = __webpack_require__(13);
  1628. var setPrototypeOf = __webpack_require__(72).set;
  1629. module.exports = function (that, target, C) {
  1630. var S = target.constructor;
  1631. var P;
  1632. if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {
  1633. setPrototypeOf(that, P);
  1634. } return that;
  1635. };
  1636. /***/ }),
  1637. /* 88 */
  1638. /***/ (function(module, exports, __webpack_require__) {
  1639. 'use strict';
  1640. var $export = __webpack_require__(8);
  1641. var toInteger = __webpack_require__(38);
  1642. var aNumberValue = __webpack_require__(89);
  1643. var repeat = __webpack_require__(90);
  1644. var $toFixed = 1.0.toFixed;
  1645. var floor = Math.floor;
  1646. var data = [0, 0, 0, 0, 0, 0];
  1647. var ERROR = 'Number.toFixed: incorrect invocation!';
  1648. var ZERO = '0';
  1649. var multiply = function (n, c) {
  1650. var i = -1;
  1651. var c2 = c;
  1652. while (++i < 6) {
  1653. c2 += n * data[i];
  1654. data[i] = c2 % 1e7;
  1655. c2 = floor(c2 / 1e7);
  1656. }
  1657. };
  1658. var divide = function (n) {
  1659. var i = 6;
  1660. var c = 0;
  1661. while (--i >= 0) {
  1662. c += data[i];
  1663. data[i] = floor(c / n);
  1664. c = (c % n) * 1e7;
  1665. }
  1666. };
  1667. var numToString = function () {
  1668. var i = 6;
  1669. var s = '';
  1670. while (--i >= 0) {
  1671. if (s !== '' || i === 0 || data[i] !== 0) {
  1672. var t = String(data[i]);
  1673. s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;
  1674. }
  1675. } return s;
  1676. };
  1677. var pow = function (x, n, acc) {
  1678. return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
  1679. };
  1680. var log = function (x) {
  1681. var n = 0;
  1682. var x2 = x;
  1683. while (x2 >= 4096) {
  1684. n += 12;
  1685. x2 /= 4096;
  1686. }
  1687. while (x2 >= 2) {
  1688. n += 1;
  1689. x2 /= 2;
  1690. } return n;
  1691. };
  1692. $export($export.P + $export.F * (!!$toFixed && (
  1693. 0.00008.toFixed(3) !== '0.000' ||
  1694. 0.9.toFixed(0) !== '1' ||
  1695. 1.255.toFixed(2) !== '1.25' ||
  1696. 1000000000000000128.0.toFixed(0) !== '1000000000000000128'
  1697. ) || !__webpack_require__(7)(function () {
  1698. // V8 ~ Android 4.3-
  1699. $toFixed.call({});
  1700. })), 'Number', {
  1701. toFixed: function toFixed(fractionDigits) {
  1702. var x = aNumberValue(this, ERROR);
  1703. var f = toInteger(fractionDigits);
  1704. var s = '';
  1705. var m = ZERO;
  1706. var e, z, j, k;
  1707. if (f < 0 || f > 20) throw RangeError(ERROR);
  1708. // eslint-disable-next-line no-self-compare
  1709. if (x != x) return 'NaN';
  1710. if (x <= -1e21 || x >= 1e21) return String(x);
  1711. if (x < 0) {
  1712. s = '-';
  1713. x = -x;
  1714. }
  1715. if (x > 1e-21) {
  1716. e = log(x * pow(2, 69, 1)) - 69;
  1717. z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);
  1718. z *= 0x10000000000000;
  1719. e = 52 - e;
  1720. if (e > 0) {
  1721. multiply(0, z);
  1722. j = f;
  1723. while (j >= 7) {
  1724. multiply(1e7, 0);
  1725. j -= 7;
  1726. }
  1727. multiply(pow(10, j, 1), 0);
  1728. j = e - 1;
  1729. while (j >= 23) {
  1730. divide(1 << 23);
  1731. j -= 23;
  1732. }
  1733. divide(1 << j);
  1734. multiply(1, 1);
  1735. divide(2);
  1736. m = numToString();
  1737. } else {
  1738. multiply(0, z);
  1739. multiply(1 << -e, 0);
  1740. m = numToString() + repeat.call(ZERO, f);
  1741. }
  1742. }
  1743. if (f > 0) {
  1744. k = m.length;
  1745. m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));
  1746. } else {
  1747. m = s + m;
  1748. } return m;
  1749. }
  1750. });
  1751. /***/ }),
  1752. /* 89 */
  1753. /***/ (function(module, exports, __webpack_require__) {
  1754. var cof = __webpack_require__(34);
  1755. module.exports = function (it, msg) {
  1756. if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);
  1757. return +it;
  1758. };
  1759. /***/ }),
  1760. /* 90 */
  1761. /***/ (function(module, exports, __webpack_require__) {
  1762. 'use strict';
  1763. var toInteger = __webpack_require__(38);
  1764. var defined = __webpack_require__(35);
  1765. module.exports = function repeat(count) {
  1766. var str = String(defined(this));
  1767. var res = '';
  1768. var n = toInteger(count);
  1769. if (n < 0 || n == Infinity) throw RangeError("Count can't be negative");
  1770. for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;
  1771. return res;
  1772. };
  1773. /***/ }),
  1774. /* 91 */
  1775. /***/ (function(module, exports, __webpack_require__) {
  1776. 'use strict';
  1777. var $export = __webpack_require__(8);
  1778. var $fails = __webpack_require__(7);
  1779. var aNumberValue = __webpack_require__(89);
  1780. var $toPrecision = 1.0.toPrecision;
  1781. $export($export.P + $export.F * ($fails(function () {
  1782. // IE7-
  1783. return $toPrecision.call(1, undefined) !== '1';
  1784. }) || !$fails(function () {
  1785. // V8 ~ Android 4.3-
  1786. $toPrecision.call({});
  1787. })), 'Number', {
  1788. toPrecision: function toPrecision(precision) {
  1789. var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');
  1790. return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);
  1791. }
  1792. });
  1793. /***/ }),
  1794. /* 92 */
  1795. /***/ (function(module, exports, __webpack_require__) {
  1796. // 20.1.2.1 Number.EPSILON
  1797. var $export = __webpack_require__(8);
  1798. $export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });
  1799. /***/ }),
  1800. /* 93 */
  1801. /***/ (function(module, exports, __webpack_require__) {
  1802. // 20.1.2.2 Number.isFinite(number)
  1803. var $export = __webpack_require__(8);
  1804. var _isFinite = __webpack_require__(4).isFinite;
  1805. $export($export.S, 'Number', {
  1806. isFinite: function isFinite(it) {
  1807. return typeof it == 'number' && _isFinite(it);
  1808. }
  1809. });
  1810. /***/ }),
  1811. /* 94 */
  1812. /***/ (function(module, exports, __webpack_require__) {
  1813. // 20.1.2.3 Number.isInteger(number)
  1814. var $export = __webpack_require__(8);
  1815. $export($export.S, 'Number', { isInteger: __webpack_require__(95) });
  1816. /***/ }),
  1817. /* 95 */
  1818. /***/ (function(module, exports, __webpack_require__) {
  1819. // 20.1.2.3 Number.isInteger(number)
  1820. var isObject = __webpack_require__(13);
  1821. var floor = Math.floor;
  1822. module.exports = function isInteger(it) {
  1823. return !isObject(it) && isFinite(it) && floor(it) === it;
  1824. };
  1825. /***/ }),
  1826. /* 96 */
  1827. /***/ (function(module, exports, __webpack_require__) {
  1828. // 20.1.2.4 Number.isNaN(number)
  1829. var $export = __webpack_require__(8);
  1830. $export($export.S, 'Number', {
  1831. isNaN: function isNaN(number) {
  1832. // eslint-disable-next-line no-self-compare
  1833. return number != number;
  1834. }
  1835. });
  1836. /***/ }),
  1837. /* 97 */
  1838. /***/ (function(module, exports, __webpack_require__) {
  1839. // 20.1.2.5 Number.isSafeInteger(number)
  1840. var $export = __webpack_require__(8);
  1841. var isInteger = __webpack_require__(95);
  1842. var abs = Math.abs;
  1843. $export($export.S, 'Number', {
  1844. isSafeInteger: function isSafeInteger(number) {
  1845. return isInteger(number) && abs(number) <= 0x1fffffffffffff;
  1846. }
  1847. });
  1848. /***/ }),
  1849. /* 98 */
  1850. /***/ (function(module, exports, __webpack_require__) {
  1851. // 20.1.2.6 Number.MAX_SAFE_INTEGER
  1852. var $export = __webpack_require__(8);
  1853. $export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });
  1854. /***/ }),
  1855. /* 99 */
  1856. /***/ (function(module, exports, __webpack_require__) {
  1857. // 20.1.2.10 Number.MIN_SAFE_INTEGER
  1858. var $export = __webpack_require__(8);
  1859. $export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });
  1860. /***/ }),
  1861. /* 100 */
  1862. /***/ (function(module, exports, __webpack_require__) {
  1863. var $export = __webpack_require__(8);
  1864. var $parseFloat = __webpack_require__(85);
  1865. // 20.1.2.12 Number.parseFloat(string)
  1866. $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });
  1867. /***/ }),
  1868. /* 101 */
  1869. /***/ (function(module, exports, __webpack_require__) {
  1870. var $export = __webpack_require__(8);
  1871. var $parseInt = __webpack_require__(81);
  1872. // 20.1.2.13 Number.parseInt(string, radix)
  1873. $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });
  1874. /***/ }),
  1875. /* 102 */
  1876. /***/ (function(module, exports, __webpack_require__) {
  1877. // 20.2.2.3 Math.acosh(x)
  1878. var $export = __webpack_require__(8);
  1879. var log1p = __webpack_require__(103);
  1880. var sqrt = Math.sqrt;
  1881. var $acosh = Math.acosh;
  1882. $export($export.S + $export.F * !($acosh
  1883. // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
  1884. && Math.floor($acosh(Number.MAX_VALUE)) == 710
  1885. // Tor Browser bug: Math.acosh(Infinity) -> NaN
  1886. && $acosh(Infinity) == Infinity
  1887. ), 'Math', {
  1888. acosh: function acosh(x) {
  1889. return (x = +x) < 1 ? NaN : x > 94906265.62425156
  1890. ? Math.log(x) + Math.LN2
  1891. : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
  1892. }
  1893. });
  1894. /***/ }),
  1895. /* 103 */
  1896. /***/ (function(module, exports) {
  1897. // 20.2.2.20 Math.log1p(x)
  1898. module.exports = Math.log1p || function log1p(x) {
  1899. return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);
  1900. };
  1901. /***/ }),
  1902. /* 104 */
  1903. /***/ (function(module, exports, __webpack_require__) {
  1904. // 20.2.2.5 Math.asinh(x)
  1905. var $export = __webpack_require__(8);
  1906. var $asinh = Math.asinh;
  1907. function asinh(x) {
  1908. return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));
  1909. }
  1910. // Tor Browser bug: Math.asinh(0) -> -0
  1911. $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });
  1912. /***/ }),
  1913. /* 105 */
  1914. /***/ (function(module, exports, __webpack_require__) {
  1915. // 20.2.2.7 Math.atanh(x)
  1916. var $export = __webpack_require__(8);
  1917. var $atanh = Math.atanh;
  1918. // Tor Browser bug: Math.atanh(-0) -> 0
  1919. $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {
  1920. atanh: function atanh(x) {
  1921. return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;
  1922. }
  1923. });
  1924. /***/ }),
  1925. /* 106 */
  1926. /***/ (function(module, exports, __webpack_require__) {
  1927. // 20.2.2.9 Math.cbrt(x)
  1928. var $export = __webpack_require__(8);
  1929. var sign = __webpack_require__(107);
  1930. $export($export.S, 'Math', {
  1931. cbrt: function cbrt(x) {
  1932. return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);
  1933. }
  1934. });
  1935. /***/ }),
  1936. /* 107 */
  1937. /***/ (function(module, exports) {
  1938. // 20.2.2.28 Math.sign(x)
  1939. module.exports = Math.sign || function sign(x) {
  1940. // eslint-disable-next-line no-self-compare
  1941. return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
  1942. };
  1943. /***/ }),
  1944. /* 108 */
  1945. /***/ (function(module, exports, __webpack_require__) {
  1946. // 20.2.2.11 Math.clz32(x)
  1947. var $export = __webpack_require__(8);
  1948. $export($export.S, 'Math', {
  1949. clz32: function clz32(x) {
  1950. return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;
  1951. }
  1952. });
  1953. /***/ }),
  1954. /* 109 */
  1955. /***/ (function(module, exports, __webpack_require__) {
  1956. // 20.2.2.12 Math.cosh(x)
  1957. var $export = __webpack_require__(8);
  1958. var exp = Math.exp;
  1959. $export($export.S, 'Math', {
  1960. cosh: function cosh(x) {
  1961. return (exp(x = +x) + exp(-x)) / 2;
  1962. }
  1963. });
  1964. /***/ }),
  1965. /* 110 */
  1966. /***/ (function(module, exports, __webpack_require__) {
  1967. // 20.2.2.14 Math.expm1(x)
  1968. var $export = __webpack_require__(8);
  1969. var $expm1 = __webpack_require__(111);
  1970. $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });
  1971. /***/ }),
  1972. /* 111 */
  1973. /***/ (function(module, exports) {
  1974. // 20.2.2.14 Math.expm1(x)
  1975. var $expm1 = Math.expm1;
  1976. module.exports = (!$expm1
  1977. // Old FF bug
  1978. || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
  1979. // Tor Browser bug
  1980. || $expm1(-2e-17) != -2e-17
  1981. ) ? function expm1(x) {
  1982. return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;
  1983. } : $expm1;
  1984. /***/ }),
  1985. /* 112 */
  1986. /***/ (function(module, exports, __webpack_require__) {
  1987. // 20.2.2.16 Math.fround(x)
  1988. var $export = __webpack_require__(8);
  1989. $export($export.S, 'Math', { fround: __webpack_require__(113) });
  1990. /***/ }),
  1991. /* 113 */
  1992. /***/ (function(module, exports, __webpack_require__) {
  1993. // 20.2.2.16 Math.fround(x)
  1994. var sign = __webpack_require__(107);
  1995. var pow = Math.pow;
  1996. var EPSILON = pow(2, -52);
  1997. var EPSILON32 = pow(2, -23);
  1998. var MAX32 = pow(2, 127) * (2 - EPSILON32);
  1999. var MIN32 = pow(2, -126);
  2000. var roundTiesToEven = function (n) {
  2001. return n + 1 / EPSILON - 1 / EPSILON;
  2002. };
  2003. module.exports = Math.fround || function fround(x) {
  2004. var $abs = Math.abs(x);
  2005. var $sign = sign(x);
  2006. var a, result;
  2007. if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
  2008. a = (1 + EPSILON32 / EPSILON) * $abs;
  2009. result = a - (a - $abs);
  2010. // eslint-disable-next-line no-self-compare
  2011. if (result > MAX32 || result != result) return $sign * Infinity;
  2012. return $sign * result;
  2013. };
  2014. /***/ }),
  2015. /* 114 */
  2016. /***/ (function(module, exports, __webpack_require__) {
  2017. // 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
  2018. var $export = __webpack_require__(8);
  2019. var abs = Math.abs;
  2020. $export($export.S, 'Math', {
  2021. hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars
  2022. var sum = 0;
  2023. var i = 0;
  2024. var aLen = arguments.length;
  2025. var larg = 0;
  2026. var arg, div;
  2027. while (i < aLen) {
  2028. arg = abs(arguments[i++]);
  2029. if (larg < arg) {
  2030. div = larg / arg;
  2031. sum = sum * div * div + 1;
  2032. larg = arg;
  2033. } else if (arg > 0) {
  2034. div = arg / larg;
  2035. sum += div * div;
  2036. } else sum += arg;
  2037. }
  2038. return larg === Infinity ? Infinity : larg * Math.sqrt(sum);
  2039. }
  2040. });
  2041. /***/ }),
  2042. /* 115 */
  2043. /***/ (function(module, exports, __webpack_require__) {
  2044. // 20.2.2.18 Math.imul(x, y)
  2045. var $export = __webpack_require__(8);
  2046. var $imul = Math.imul;
  2047. // some WebKit versions fails with big numbers, some has wrong arity
  2048. $export($export.S + $export.F * __webpack_require__(7)(function () {
  2049. return $imul(0xffffffff, 5) != -5 || $imul.length != 2;
  2050. }), 'Math', {
  2051. imul: function imul(x, y) {
  2052. var UINT16 = 0xffff;
  2053. var xn = +x;
  2054. var yn = +y;
  2055. var xl = UINT16 & xn;
  2056. var yl = UINT16 & yn;
  2057. return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
  2058. }
  2059. });
  2060. /***/ }),
  2061. /* 116 */
  2062. /***/ (function(module, exports, __webpack_require__) {
  2063. // 20.2.2.21 Math.log10(x)
  2064. var $export = __webpack_require__(8);
  2065. $export($export.S, 'Math', {
  2066. log10: function log10(x) {
  2067. return Math.log(x) * Math.LOG10E;
  2068. }
  2069. });
  2070. /***/ }),
  2071. /* 117 */
  2072. /***/ (function(module, exports, __webpack_require__) {
  2073. // 20.2.2.20 Math.log1p(x)
  2074. var $export = __webpack_require__(8);
  2075. $export($export.S, 'Math', { log1p: __webpack_require__(103) });
  2076. /***/ }),
  2077. /* 118 */
  2078. /***/ (function(module, exports, __webpack_require__) {
  2079. // 20.2.2.22 Math.log2(x)
  2080. var $export = __webpack_require__(8);
  2081. $export($export.S, 'Math', {
  2082. log2: function log2(x) {
  2083. return Math.log(x) / Math.LN2;
  2084. }
  2085. });
  2086. /***/ }),
  2087. /* 119 */
  2088. /***/ (function(module, exports, __webpack_require__) {
  2089. // 20.2.2.28 Math.sign(x)
  2090. var $export = __webpack_require__(8);
  2091. $export($export.S, 'Math', { sign: __webpack_require__(107) });
  2092. /***/ }),
  2093. /* 120 */
  2094. /***/ (function(module, exports, __webpack_require__) {
  2095. // 20.2.2.30 Math.sinh(x)
  2096. var $export = __webpack_require__(8);
  2097. var expm1 = __webpack_require__(111);
  2098. var exp = Math.exp;
  2099. // V8 near Chromium 38 has a problem with very small numbers
  2100. $export($export.S + $export.F * __webpack_require__(7)(function () {
  2101. return !Math.sinh(-2e-17) != -2e-17;
  2102. }), 'Math', {
  2103. sinh: function sinh(x) {
  2104. return Math.abs(x = +x) < 1
  2105. ? (expm1(x) - expm1(-x)) / 2
  2106. : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);
  2107. }
  2108. });
  2109. /***/ }),
  2110. /* 121 */
  2111. /***/ (function(module, exports, __webpack_require__) {
  2112. // 20.2.2.33 Math.tanh(x)
  2113. var $export = __webpack_require__(8);
  2114. var expm1 = __webpack_require__(111);
  2115. var exp = Math.exp;
  2116. $export($export.S, 'Math', {
  2117. tanh: function tanh(x) {
  2118. var a = expm1(x = +x);
  2119. var b = expm1(-x);
  2120. return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
  2121. }
  2122. });
  2123. /***/ }),
  2124. /* 122 */
  2125. /***/ (function(module, exports, __webpack_require__) {
  2126. // 20.2.2.34 Math.trunc(x)
  2127. var $export = __webpack_require__(8);
  2128. $export($export.S, 'Math', {
  2129. trunc: function trunc(it) {
  2130. return (it > 0 ? Math.floor : Math.ceil)(it);
  2131. }
  2132. });
  2133. /***/ }),
  2134. /* 123 */
  2135. /***/ (function(module, exports, __webpack_require__) {
  2136. var $export = __webpack_require__(8);
  2137. var toAbsoluteIndex = __webpack_require__(39);
  2138. var fromCharCode = String.fromCharCode;
  2139. var $fromCodePoint = String.fromCodePoint;
  2140. // length should be 1, old FF problem
  2141. $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
  2142. // 21.1.2.2 String.fromCodePoint(...codePoints)
  2143. fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars
  2144. var res = [];
  2145. var aLen = arguments.length;
  2146. var i = 0;
  2147. var code;
  2148. while (aLen > i) {
  2149. code = +arguments[i++];
  2150. if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');
  2151. res.push(code < 0x10000
  2152. ? fromCharCode(code)
  2153. : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
  2154. );
  2155. } return res.join('');
  2156. }
  2157. });
  2158. /***/ }),
  2159. /* 124 */
  2160. /***/ (function(module, exports, __webpack_require__) {
  2161. var $export = __webpack_require__(8);
  2162. var toIObject = __webpack_require__(32);
  2163. var toLength = __webpack_require__(37);
  2164. $export($export.S, 'String', {
  2165. // 21.1.2.4 String.raw(callSite, ...substitutions)
  2166. raw: function raw(callSite) {
  2167. var tpl = toIObject(callSite.raw);
  2168. var len = toLength(tpl.length);
  2169. var aLen = arguments.length;
  2170. var res = [];
  2171. var i = 0;
  2172. while (len > i) {
  2173. res.push(String(tpl[i++]));
  2174. if (i < aLen) res.push(String(arguments[i]));
  2175. } return res.join('');
  2176. }
  2177. });
  2178. /***/ }),
  2179. /* 125 */
  2180. /***/ (function(module, exports, __webpack_require__) {
  2181. 'use strict';
  2182. // 21.1.3.25 String.prototype.trim()
  2183. __webpack_require__(82)('trim', function ($trim) {
  2184. return function trim() {
  2185. return $trim(this, 3);
  2186. };
  2187. });
  2188. /***/ }),
  2189. /* 126 */
  2190. /***/ (function(module, exports, __webpack_require__) {
  2191. 'use strict';
  2192. var $at = __webpack_require__(127)(true);
  2193. // 21.1.3.27 String.prototype[@@iterator]()
  2194. __webpack_require__(128)(String, 'String', function (iterated) {
  2195. this._t = String(iterated); // target
  2196. this._i = 0; // next index
  2197. // 21.1.5.2.1 %StringIteratorPrototype%.next()
  2198. }, function () {
  2199. var O = this._t;
  2200. var index = this._i;
  2201. var point;
  2202. if (index >= O.length) return { value: undefined, done: true };
  2203. point = $at(O, index);
  2204. this._i += point.length;
  2205. return { value: point, done: false };
  2206. });
  2207. /***/ }),
  2208. /* 127 */
  2209. /***/ (function(module, exports, __webpack_require__) {
  2210. var toInteger = __webpack_require__(38);
  2211. var defined = __webpack_require__(35);
  2212. // true -> String#at
  2213. // false -> String#codePointAt
  2214. module.exports = function (TO_STRING) {
  2215. return function (that, pos) {
  2216. var s = String(defined(that));
  2217. var i = toInteger(pos);
  2218. var l = s.length;
  2219. var a, b;
  2220. if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
  2221. a = s.charCodeAt(i);
  2222. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  2223. ? TO_STRING ? s.charAt(i) : a
  2224. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  2225. };
  2226. };
  2227. /***/ }),
  2228. /* 128 */
  2229. /***/ (function(module, exports, __webpack_require__) {
  2230. 'use strict';
  2231. var LIBRARY = __webpack_require__(24);
  2232. var $export = __webpack_require__(8);
  2233. var redefine = __webpack_require__(18);
  2234. var hide = __webpack_require__(10);
  2235. var Iterators = __webpack_require__(129);
  2236. var $iterCreate = __webpack_require__(130);
  2237. var setToStringTag = __webpack_require__(25);
  2238. var getPrototypeOf = __webpack_require__(58);
  2239. var ITERATOR = __webpack_require__(26)('iterator');
  2240. var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
  2241. var FF_ITERATOR = '@@iterator';
  2242. var KEYS = 'keys';
  2243. var VALUES = 'values';
  2244. var returnThis = function () { return this; };
  2245. module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  2246. $iterCreate(Constructor, NAME, next);
  2247. var getMethod = function (kind) {
  2248. if (!BUGGY && kind in proto) return proto[kind];
  2249. switch (kind) {
  2250. case KEYS: return function keys() { return new Constructor(this, kind); };
  2251. case VALUES: return function values() { return new Constructor(this, kind); };
  2252. } return function entries() { return new Constructor(this, kind); };
  2253. };
  2254. var TAG = NAME + ' Iterator';
  2255. var DEF_VALUES = DEFAULT == VALUES;
  2256. var VALUES_BUG = false;
  2257. var proto = Base.prototype;
  2258. var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  2259. var $default = $native || getMethod(DEFAULT);
  2260. var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
  2261. var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
  2262. var methods, key, IteratorPrototype;
  2263. // Fix native
  2264. if ($anyNative) {
  2265. IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
  2266. if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
  2267. // Set @@toStringTag to native iterators
  2268. setToStringTag(IteratorPrototype, TAG, true);
  2269. // fix for some old engines
  2270. if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
  2271. }
  2272. }
  2273. // fix Array#{values, @@iterator}.name in V8 / FF
  2274. if (DEF_VALUES && $native && $native.name !== VALUES) {
  2275. VALUES_BUG = true;
  2276. $default = function values() { return $native.call(this); };
  2277. }
  2278. // Define iterator
  2279. if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
  2280. hide(proto, ITERATOR, $default);
  2281. }
  2282. // Plug for library
  2283. Iterators[NAME] = $default;
  2284. Iterators[TAG] = returnThis;
  2285. if (DEFAULT) {
  2286. methods = {
  2287. values: DEF_VALUES ? $default : getMethod(VALUES),
  2288. keys: IS_SET ? $default : getMethod(KEYS),
  2289. entries: $entries
  2290. };
  2291. if (FORCED) for (key in methods) {
  2292. if (!(key in proto)) redefine(proto, key, methods[key]);
  2293. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  2294. }
  2295. return methods;
  2296. };
  2297. /***/ }),
  2298. /* 129 */
  2299. /***/ (function(module, exports) {
  2300. module.exports = {};
  2301. /***/ }),
  2302. /* 130 */
  2303. /***/ (function(module, exports, __webpack_require__) {
  2304. 'use strict';
  2305. var create = __webpack_require__(45);
  2306. var descriptor = __webpack_require__(17);
  2307. var setToStringTag = __webpack_require__(25);
  2308. var IteratorPrototype = {};
  2309. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  2310. __webpack_require__(10)(IteratorPrototype, __webpack_require__(26)('iterator'), function () { return this; });
  2311. module.exports = function (Constructor, NAME, next) {
  2312. Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  2313. setToStringTag(Constructor, NAME + ' Iterator');
  2314. };
  2315. /***/ }),
  2316. /* 131 */
  2317. /***/ (function(module, exports, __webpack_require__) {
  2318. 'use strict';
  2319. var $export = __webpack_require__(8);
  2320. var $at = __webpack_require__(127)(false);
  2321. $export($export.P, 'String', {
  2322. // 21.1.3.3 String.prototype.codePointAt(pos)
  2323. codePointAt: function codePointAt(pos) {
  2324. return $at(this, pos);
  2325. }
  2326. });
  2327. /***/ }),
  2328. /* 132 */
  2329. /***/ (function(module, exports, __webpack_require__) {
  2330. // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
  2331. 'use strict';
  2332. var $export = __webpack_require__(8);
  2333. var toLength = __webpack_require__(37);
  2334. var context = __webpack_require__(133);
  2335. var ENDS_WITH = 'endsWith';
  2336. var $endsWith = ''[ENDS_WITH];
  2337. $export($export.P + $export.F * __webpack_require__(135)(ENDS_WITH), 'String', {
  2338. endsWith: function endsWith(searchString /* , endPosition = @length */) {
  2339. var that = context(this, searchString, ENDS_WITH);
  2340. var endPosition = arguments.length > 1 ? arguments[1] : undefined;
  2341. var len = toLength(that.length);
  2342. var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);
  2343. var search = String(searchString);
  2344. return $endsWith
  2345. ? $endsWith.call(that, search, end)
  2346. : that.slice(end - search.length, end) === search;
  2347. }
  2348. });
  2349. /***/ }),
  2350. /* 133 */
  2351. /***/ (function(module, exports, __webpack_require__) {
  2352. // helper for String#{startsWith, endsWith, includes}
  2353. var isRegExp = __webpack_require__(134);
  2354. var defined = __webpack_require__(35);
  2355. module.exports = function (that, searchString, NAME) {
  2356. if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
  2357. return String(defined(that));
  2358. };
  2359. /***/ }),
  2360. /* 134 */
  2361. /***/ (function(module, exports, __webpack_require__) {
  2362. // 7.2.8 IsRegExp(argument)
  2363. var isObject = __webpack_require__(13);
  2364. var cof = __webpack_require__(34);
  2365. var MATCH = __webpack_require__(26)('match');
  2366. module.exports = function (it) {
  2367. var isRegExp;
  2368. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
  2369. };
  2370. /***/ }),
  2371. /* 135 */
  2372. /***/ (function(module, exports, __webpack_require__) {
  2373. var MATCH = __webpack_require__(26)('match');
  2374. module.exports = function (KEY) {
  2375. var re = /./;
  2376. try {
  2377. '/./'[KEY](re);
  2378. } catch (e) {
  2379. try {
  2380. re[MATCH] = false;
  2381. return !'/./'[KEY](re);
  2382. } catch (f) { /* empty */ }
  2383. } return true;
  2384. };
  2385. /***/ }),
  2386. /* 136 */
  2387. /***/ (function(module, exports, __webpack_require__) {
  2388. // 21.1.3.7 String.prototype.includes(searchString, position = 0)
  2389. 'use strict';
  2390. var $export = __webpack_require__(8);
  2391. var context = __webpack_require__(133);
  2392. var INCLUDES = 'includes';
  2393. $export($export.P + $export.F * __webpack_require__(135)(INCLUDES), 'String', {
  2394. includes: function includes(searchString /* , position = 0 */) {
  2395. return !!~context(this, searchString, INCLUDES)
  2396. .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
  2397. }
  2398. });
  2399. /***/ }),
  2400. /* 137 */
  2401. /***/ (function(module, exports, __webpack_require__) {
  2402. var $export = __webpack_require__(8);
  2403. $export($export.P, 'String', {
  2404. // 21.1.3.13 String.prototype.repeat(count)
  2405. repeat: __webpack_require__(90)
  2406. });
  2407. /***/ }),
  2408. /* 138 */
  2409. /***/ (function(module, exports, __webpack_require__) {
  2410. // 21.1.3.18 String.prototype.startsWith(searchString [, position ])
  2411. 'use strict';
  2412. var $export = __webpack_require__(8);
  2413. var toLength = __webpack_require__(37);
  2414. var context = __webpack_require__(133);
  2415. var STARTS_WITH = 'startsWith';
  2416. var $startsWith = ''[STARTS_WITH];
  2417. $export($export.P + $export.F * __webpack_require__(135)(STARTS_WITH), 'String', {
  2418. startsWith: function startsWith(searchString /* , position = 0 */) {
  2419. var that = context(this, searchString, STARTS_WITH);
  2420. var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
  2421. var search = String(searchString);
  2422. return $startsWith
  2423. ? $startsWith.call(that, search, index)
  2424. : that.slice(index, index + search.length) === search;
  2425. }
  2426. });
  2427. /***/ }),
  2428. /* 139 */
  2429. /***/ (function(module, exports, __webpack_require__) {
  2430. 'use strict';
  2431. // B.2.3.2 String.prototype.anchor(name)
  2432. __webpack_require__(140)('anchor', function (createHTML) {
  2433. return function anchor(name) {
  2434. return createHTML(this, 'a', 'name', name);
  2435. };
  2436. });
  2437. /***/ }),
  2438. /* 140 */
  2439. /***/ (function(module, exports, __webpack_require__) {
  2440. var $export = __webpack_require__(8);
  2441. var fails = __webpack_require__(7);
  2442. var defined = __webpack_require__(35);
  2443. var quot = /"/g;
  2444. // B.2.3.2.1 CreateHTML(string, tag, attribute, value)
  2445. var createHTML = function (string, tag, attribute, value) {
  2446. var S = String(defined(string));
  2447. var p1 = '<' + tag;
  2448. if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '&quot;') + '"';
  2449. return p1 + '>' + S + '</' + tag + '>';
  2450. };
  2451. module.exports = function (NAME, exec) {
  2452. var O = {};
  2453. O[NAME] = exec(createHTML);
  2454. $export($export.P + $export.F * fails(function () {
  2455. var test = ''[NAME]('"');
  2456. return test !== test.toLowerCase() || test.split('"').length > 3;
  2457. }), 'String', O);
  2458. };
  2459. /***/ }),
  2460. /* 141 */
  2461. /***/ (function(module, exports, __webpack_require__) {
  2462. 'use strict';
  2463. // B.2.3.3 String.prototype.big()
  2464. __webpack_require__(140)('big', function (createHTML) {
  2465. return function big() {
  2466. return createHTML(this, 'big', '', '');
  2467. };
  2468. });
  2469. /***/ }),
  2470. /* 142 */
  2471. /***/ (function(module, exports, __webpack_require__) {
  2472. 'use strict';
  2473. // B.2.3.4 String.prototype.blink()
  2474. __webpack_require__(140)('blink', function (createHTML) {
  2475. return function blink() {
  2476. return createHTML(this, 'blink', '', '');
  2477. };
  2478. });
  2479. /***/ }),
  2480. /* 143 */
  2481. /***/ (function(module, exports, __webpack_require__) {
  2482. 'use strict';
  2483. // B.2.3.5 String.prototype.bold()
  2484. __webpack_require__(140)('bold', function (createHTML) {
  2485. return function bold() {
  2486. return createHTML(this, 'b', '', '');
  2487. };
  2488. });
  2489. /***/ }),
  2490. /* 144 */
  2491. /***/ (function(module, exports, __webpack_require__) {
  2492. 'use strict';
  2493. // B.2.3.6 String.prototype.fixed()
  2494. __webpack_require__(140)('fixed', function (createHTML) {
  2495. return function fixed() {
  2496. return createHTML(this, 'tt', '', '');
  2497. };
  2498. });
  2499. /***/ }),
  2500. /* 145 */
  2501. /***/ (function(module, exports, __webpack_require__) {
  2502. 'use strict';
  2503. // B.2.3.7 String.prototype.fontcolor(color)
  2504. __webpack_require__(140)('fontcolor', function (createHTML) {
  2505. return function fontcolor(color) {
  2506. return createHTML(this, 'font', 'color', color);
  2507. };
  2508. });
  2509. /***/ }),
  2510. /* 146 */
  2511. /***/ (function(module, exports, __webpack_require__) {
  2512. 'use strict';
  2513. // B.2.3.8 String.prototype.fontsize(size)
  2514. __webpack_require__(140)('fontsize', function (createHTML) {
  2515. return function fontsize(size) {
  2516. return createHTML(this, 'font', 'size', size);
  2517. };
  2518. });
  2519. /***/ }),
  2520. /* 147 */
  2521. /***/ (function(module, exports, __webpack_require__) {
  2522. 'use strict';
  2523. // B.2.3.9 String.prototype.italics()
  2524. __webpack_require__(140)('italics', function (createHTML) {
  2525. return function italics() {
  2526. return createHTML(this, 'i', '', '');
  2527. };
  2528. });
  2529. /***/ }),
  2530. /* 148 */
  2531. /***/ (function(module, exports, __webpack_require__) {
  2532. 'use strict';
  2533. // B.2.3.10 String.prototype.link(url)
  2534. __webpack_require__(140)('link', function (createHTML) {
  2535. return function link(url) {
  2536. return createHTML(this, 'a', 'href', url);
  2537. };
  2538. });
  2539. /***/ }),
  2540. /* 149 */
  2541. /***/ (function(module, exports, __webpack_require__) {
  2542. 'use strict';
  2543. // B.2.3.11 String.prototype.small()
  2544. __webpack_require__(140)('small', function (createHTML) {
  2545. return function small() {
  2546. return createHTML(this, 'small', '', '');
  2547. };
  2548. });
  2549. /***/ }),
  2550. /* 150 */
  2551. /***/ (function(module, exports, __webpack_require__) {
  2552. 'use strict';
  2553. // B.2.3.12 String.prototype.strike()
  2554. __webpack_require__(140)('strike', function (createHTML) {
  2555. return function strike() {
  2556. return createHTML(this, 'strike', '', '');
  2557. };
  2558. });
  2559. /***/ }),
  2560. /* 151 */
  2561. /***/ (function(module, exports, __webpack_require__) {
  2562. 'use strict';
  2563. // B.2.3.13 String.prototype.sub()
  2564. __webpack_require__(140)('sub', function (createHTML) {
  2565. return function sub() {
  2566. return createHTML(this, 'sub', '', '');
  2567. };
  2568. });
  2569. /***/ }),
  2570. /* 152 */
  2571. /***/ (function(module, exports, __webpack_require__) {
  2572. 'use strict';
  2573. // B.2.3.14 String.prototype.sup()
  2574. __webpack_require__(140)('sup', function (createHTML) {
  2575. return function sup() {
  2576. return createHTML(this, 'sup', '', '');
  2577. };
  2578. });
  2579. /***/ }),
  2580. /* 153 */
  2581. /***/ (function(module, exports, __webpack_require__) {
  2582. // 20.3.3.1 / 15.9.4.4 Date.now()
  2583. var $export = __webpack_require__(8);
  2584. $export($export.S, 'Date', { now: function () { return new Date().getTime(); } });
  2585. /***/ }),
  2586. /* 154 */
  2587. /***/ (function(module, exports, __webpack_require__) {
  2588. 'use strict';
  2589. var $export = __webpack_require__(8);
  2590. var toObject = __webpack_require__(57);
  2591. var toPrimitive = __webpack_require__(16);
  2592. $export($export.P + $export.F * __webpack_require__(7)(function () {
  2593. return new Date(NaN).toJSON() !== null
  2594. || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
  2595. }), 'Date', {
  2596. // eslint-disable-next-line no-unused-vars
  2597. toJSON: function toJSON(key) {
  2598. var O = toObject(this);
  2599. var pv = toPrimitive(O);
  2600. return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
  2601. }
  2602. });
  2603. /***/ }),
  2604. /* 155 */
  2605. /***/ (function(module, exports, __webpack_require__) {
  2606. // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
  2607. var $export = __webpack_require__(8);
  2608. var toISOString = __webpack_require__(156);
  2609. // PhantomJS / old WebKit has a broken implementations
  2610. $export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {
  2611. toISOString: toISOString
  2612. });
  2613. /***/ }),
  2614. /* 156 */
  2615. /***/ (function(module, exports, __webpack_require__) {
  2616. 'use strict';
  2617. // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
  2618. var fails = __webpack_require__(7);
  2619. var getTime = Date.prototype.getTime;
  2620. var $toISOString = Date.prototype.toISOString;
  2621. var lz = function (num) {
  2622. return num > 9 ? num : '0' + num;
  2623. };
  2624. // PhantomJS / old WebKit has a broken implementations
  2625. module.exports = (fails(function () {
  2626. return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
  2627. }) || !fails(function () {
  2628. $toISOString.call(new Date(NaN));
  2629. })) ? function toISOString() {
  2630. if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');
  2631. var d = this;
  2632. var y = d.getUTCFullYear();
  2633. var m = d.getUTCMilliseconds();
  2634. var s = y < 0 ? '-' : y > 9999 ? '+' : '';
  2635. return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
  2636. '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
  2637. 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
  2638. ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
  2639. } : $toISOString;
  2640. /***/ }),
  2641. /* 157 */
  2642. /***/ (function(module, exports, __webpack_require__) {
  2643. var DateProto = Date.prototype;
  2644. var INVALID_DATE = 'Invalid Date';
  2645. var TO_STRING = 'toString';
  2646. var $toString = DateProto[TO_STRING];
  2647. var getTime = DateProto.getTime;
  2648. if (new Date(NaN) + '' != INVALID_DATE) {
  2649. __webpack_require__(18)(DateProto, TO_STRING, function toString() {
  2650. var value = getTime.call(this);
  2651. // eslint-disable-next-line no-self-compare
  2652. return value === value ? $toString.call(this) : INVALID_DATE;
  2653. });
  2654. }
  2655. /***/ }),
  2656. /* 158 */
  2657. /***/ (function(module, exports, __webpack_require__) {
  2658. var TO_PRIMITIVE = __webpack_require__(26)('toPrimitive');
  2659. var proto = Date.prototype;
  2660. if (!(TO_PRIMITIVE in proto)) __webpack_require__(10)(proto, TO_PRIMITIVE, __webpack_require__(159));
  2661. /***/ }),
  2662. /* 159 */
  2663. /***/ (function(module, exports, __webpack_require__) {
  2664. 'use strict';
  2665. var anObject = __webpack_require__(12);
  2666. var toPrimitive = __webpack_require__(16);
  2667. var NUMBER = 'number';
  2668. module.exports = function (hint) {
  2669. if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');
  2670. return toPrimitive(anObject(this), hint != NUMBER);
  2671. };
  2672. /***/ }),
  2673. /* 160 */
  2674. /***/ (function(module, exports, __webpack_require__) {
  2675. // 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
  2676. var $export = __webpack_require__(8);
  2677. $export($export.S, 'Array', { isArray: __webpack_require__(44) });
  2678. /***/ }),
  2679. /* 161 */
  2680. /***/ (function(module, exports, __webpack_require__) {
  2681. 'use strict';
  2682. var ctx = __webpack_require__(20);
  2683. var $export = __webpack_require__(8);
  2684. var toObject = __webpack_require__(57);
  2685. var call = __webpack_require__(162);
  2686. var isArrayIter = __webpack_require__(163);
  2687. var toLength = __webpack_require__(37);
  2688. var createProperty = __webpack_require__(164);
  2689. var getIterFn = __webpack_require__(165);
  2690. $export($export.S + $export.F * !__webpack_require__(166)(function (iter) { Array.from(iter); }), 'Array', {
  2691. // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
  2692. from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  2693. var O = toObject(arrayLike);
  2694. var C = typeof this == 'function' ? this : Array;
  2695. var aLen = arguments.length;
  2696. var mapfn = aLen > 1 ? arguments[1] : undefined;
  2697. var mapping = mapfn !== undefined;
  2698. var index = 0;
  2699. var iterFn = getIterFn(O);
  2700. var length, result, step, iterator;
  2701. if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
  2702. // if object isn't iterable or it's array with default iterator - use simple case
  2703. if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
  2704. for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
  2705. createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
  2706. }
  2707. } else {
  2708. length = toLength(O.length);
  2709. for (result = new C(length); length > index; index++) {
  2710. createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
  2711. }
  2712. }
  2713. result.length = index;
  2714. return result;
  2715. }
  2716. });
  2717. /***/ }),
  2718. /* 162 */
  2719. /***/ (function(module, exports, __webpack_require__) {
  2720. // call something on iterator step with safe closing on error
  2721. var anObject = __webpack_require__(12);
  2722. module.exports = function (iterator, fn, value, entries) {
  2723. try {
  2724. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  2725. // 7.4.6 IteratorClose(iterator, completion)
  2726. } catch (e) {
  2727. var ret = iterator['return'];
  2728. if (ret !== undefined) anObject(ret.call(iterator));
  2729. throw e;
  2730. }
  2731. };
  2732. /***/ }),
  2733. /* 163 */
  2734. /***/ (function(module, exports, __webpack_require__) {
  2735. // check on default Array iterator
  2736. var Iterators = __webpack_require__(129);
  2737. var ITERATOR = __webpack_require__(26)('iterator');
  2738. var ArrayProto = Array.prototype;
  2739. module.exports = function (it) {
  2740. return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
  2741. };
  2742. /***/ }),
  2743. /* 164 */
  2744. /***/ (function(module, exports, __webpack_require__) {
  2745. 'use strict';
  2746. var $defineProperty = __webpack_require__(11);
  2747. var createDesc = __webpack_require__(17);
  2748. module.exports = function (object, index, value) {
  2749. if (index in object) $defineProperty.f(object, index, createDesc(0, value));
  2750. else object[index] = value;
  2751. };
  2752. /***/ }),
  2753. /* 165 */
  2754. /***/ (function(module, exports, __webpack_require__) {
  2755. var classof = __webpack_require__(74);
  2756. var ITERATOR = __webpack_require__(26)('iterator');
  2757. var Iterators = __webpack_require__(129);
  2758. module.exports = __webpack_require__(9).getIteratorMethod = function (it) {
  2759. if (it != undefined) return it[ITERATOR]
  2760. || it['@@iterator']
  2761. || Iterators[classof(it)];
  2762. };
  2763. /***/ }),
  2764. /* 166 */
  2765. /***/ (function(module, exports, __webpack_require__) {
  2766. var ITERATOR = __webpack_require__(26)('iterator');
  2767. var SAFE_CLOSING = false;
  2768. try {
  2769. var riter = [7][ITERATOR]();
  2770. riter['return'] = function () { SAFE_CLOSING = true; };
  2771. // eslint-disable-next-line no-throw-literal
  2772. Array.from(riter, function () { throw 2; });
  2773. } catch (e) { /* empty */ }
  2774. module.exports = function (exec, skipClosing) {
  2775. if (!skipClosing && !SAFE_CLOSING) return false;
  2776. var safe = false;
  2777. try {
  2778. var arr = [7];
  2779. var iter = arr[ITERATOR]();
  2780. iter.next = function () { return { done: safe = true }; };
  2781. arr[ITERATOR] = function () { return iter; };
  2782. exec(arr);
  2783. } catch (e) { /* empty */ }
  2784. return safe;
  2785. };
  2786. /***/ }),
  2787. /* 167 */
  2788. /***/ (function(module, exports, __webpack_require__) {
  2789. 'use strict';
  2790. var $export = __webpack_require__(8);
  2791. var createProperty = __webpack_require__(164);
  2792. // WebKit Array.of isn't generic
  2793. $export($export.S + $export.F * __webpack_require__(7)(function () {
  2794. function F() { /* empty */ }
  2795. return !(Array.of.call(F) instanceof F);
  2796. }), 'Array', {
  2797. // 22.1.2.3 Array.of( ...items)
  2798. of: function of(/* ...args */) {
  2799. var index = 0;
  2800. var aLen = arguments.length;
  2801. var result = new (typeof this == 'function' ? this : Array)(aLen);
  2802. while (aLen > index) createProperty(result, index, arguments[index++]);
  2803. result.length = aLen;
  2804. return result;
  2805. }
  2806. });
  2807. /***/ }),
  2808. /* 168 */
  2809. /***/ (function(module, exports, __webpack_require__) {
  2810. 'use strict';
  2811. // 22.1.3.13 Array.prototype.join(separator)
  2812. var $export = __webpack_require__(8);
  2813. var toIObject = __webpack_require__(32);
  2814. var arrayJoin = [].join;
  2815. // fallback for not array-like strings
  2816. $export($export.P + $export.F * (__webpack_require__(33) != Object || !__webpack_require__(169)(arrayJoin)), 'Array', {
  2817. join: function join(separator) {
  2818. return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);
  2819. }
  2820. });
  2821. /***/ }),
  2822. /* 169 */
  2823. /***/ (function(module, exports, __webpack_require__) {
  2824. 'use strict';
  2825. var fails = __webpack_require__(7);
  2826. module.exports = function (method, arg) {
  2827. return !!method && fails(function () {
  2828. // eslint-disable-next-line no-useless-call
  2829. arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);
  2830. });
  2831. };
  2832. /***/ }),
  2833. /* 170 */
  2834. /***/ (function(module, exports, __webpack_require__) {
  2835. 'use strict';
  2836. var $export = __webpack_require__(8);
  2837. var html = __webpack_require__(47);
  2838. var cof = __webpack_require__(34);
  2839. var toAbsoluteIndex = __webpack_require__(39);
  2840. var toLength = __webpack_require__(37);
  2841. var arraySlice = [].slice;
  2842. // fallback for not array-like ES3 strings and DOM objects
  2843. $export($export.P + $export.F * __webpack_require__(7)(function () {
  2844. if (html) arraySlice.call(html);
  2845. }), 'Array', {
  2846. slice: function slice(begin, end) {
  2847. var len = toLength(this.length);
  2848. var klass = cof(this);
  2849. end = end === undefined ? len : end;
  2850. if (klass == 'Array') return arraySlice.call(this, begin, end);
  2851. var start = toAbsoluteIndex(begin, len);
  2852. var upTo = toAbsoluteIndex(end, len);
  2853. var size = toLength(upTo - start);
  2854. var cloned = new Array(size);
  2855. var i = 0;
  2856. for (; i < size; i++) cloned[i] = klass == 'String'
  2857. ? this.charAt(start + i)
  2858. : this[start + i];
  2859. return cloned;
  2860. }
  2861. });
  2862. /***/ }),
  2863. /* 171 */
  2864. /***/ (function(module, exports, __webpack_require__) {
  2865. 'use strict';
  2866. var $export = __webpack_require__(8);
  2867. var aFunction = __webpack_require__(21);
  2868. var toObject = __webpack_require__(57);
  2869. var fails = __webpack_require__(7);
  2870. var $sort = [].sort;
  2871. var test = [1, 2, 3];
  2872. $export($export.P + $export.F * (fails(function () {
  2873. // IE8-
  2874. test.sort(undefined);
  2875. }) || !fails(function () {
  2876. // V8 bug
  2877. test.sort(null);
  2878. // Old WebKit
  2879. }) || !__webpack_require__(169)($sort)), 'Array', {
  2880. // 22.1.3.25 Array.prototype.sort(comparefn)
  2881. sort: function sort(comparefn) {
  2882. return comparefn === undefined
  2883. ? $sort.call(toObject(this))
  2884. : $sort.call(toObject(this), aFunction(comparefn));
  2885. }
  2886. });
  2887. /***/ }),
  2888. /* 172 */
  2889. /***/ (function(module, exports, __webpack_require__) {
  2890. 'use strict';
  2891. var $export = __webpack_require__(8);
  2892. var $forEach = __webpack_require__(173)(0);
  2893. var STRICT = __webpack_require__(169)([].forEach, true);
  2894. $export($export.P + $export.F * !STRICT, 'Array', {
  2895. // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
  2896. forEach: function forEach(callbackfn /* , thisArg */) {
  2897. return $forEach(this, callbackfn, arguments[1]);
  2898. }
  2899. });
  2900. /***/ }),
  2901. /* 173 */
  2902. /***/ (function(module, exports, __webpack_require__) {
  2903. // 0 -> Array#forEach
  2904. // 1 -> Array#map
  2905. // 2 -> Array#filter
  2906. // 3 -> Array#some
  2907. // 4 -> Array#every
  2908. // 5 -> Array#find
  2909. // 6 -> Array#findIndex
  2910. var ctx = __webpack_require__(20);
  2911. var IObject = __webpack_require__(33);
  2912. var toObject = __webpack_require__(57);
  2913. var toLength = __webpack_require__(37);
  2914. var asc = __webpack_require__(174);
  2915. module.exports = function (TYPE, $create) {
  2916. var IS_MAP = TYPE == 1;
  2917. var IS_FILTER = TYPE == 2;
  2918. var IS_SOME = TYPE == 3;
  2919. var IS_EVERY = TYPE == 4;
  2920. var IS_FIND_INDEX = TYPE == 6;
  2921. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  2922. var create = $create || asc;
  2923. return function ($this, callbackfn, that) {
  2924. var O = toObject($this);
  2925. var self = IObject(O);
  2926. var f = ctx(callbackfn, that, 3);
  2927. var length = toLength(self.length);
  2928. var index = 0;
  2929. var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  2930. var val, res;
  2931. for (;length > index; index++) if (NO_HOLES || index in self) {
  2932. val = self[index];
  2933. res = f(val, index, O);
  2934. if (TYPE) {
  2935. if (IS_MAP) result[index] = res; // map
  2936. else if (res) switch (TYPE) {
  2937. case 3: return true; // some
  2938. case 5: return val; // find
  2939. case 6: return index; // findIndex
  2940. case 2: result.push(val); // filter
  2941. } else if (IS_EVERY) return false; // every
  2942. }
  2943. }
  2944. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
  2945. };
  2946. };
  2947. /***/ }),
  2948. /* 174 */
  2949. /***/ (function(module, exports, __webpack_require__) {
  2950. // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
  2951. var speciesConstructor = __webpack_require__(175);
  2952. module.exports = function (original, length) {
  2953. return new (speciesConstructor(original))(length);
  2954. };
  2955. /***/ }),
  2956. /* 175 */
  2957. /***/ (function(module, exports, __webpack_require__) {
  2958. var isObject = __webpack_require__(13);
  2959. var isArray = __webpack_require__(44);
  2960. var SPECIES = __webpack_require__(26)('species');
  2961. module.exports = function (original) {
  2962. var C;
  2963. if (isArray(original)) {
  2964. C = original.constructor;
  2965. // cross-realm fallback
  2966. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  2967. if (isObject(C)) {
  2968. C = C[SPECIES];
  2969. if (C === null) C = undefined;
  2970. }
  2971. } return C === undefined ? Array : C;
  2972. };
  2973. /***/ }),
  2974. /* 176 */
  2975. /***/ (function(module, exports, __webpack_require__) {
  2976. 'use strict';
  2977. var $export = __webpack_require__(8);
  2978. var $map = __webpack_require__(173)(1);
  2979. $export($export.P + $export.F * !__webpack_require__(169)([].map, true), 'Array', {
  2980. // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
  2981. map: function map(callbackfn /* , thisArg */) {
  2982. return $map(this, callbackfn, arguments[1]);
  2983. }
  2984. });
  2985. /***/ }),
  2986. /* 177 */
  2987. /***/ (function(module, exports, __webpack_require__) {
  2988. 'use strict';
  2989. var $export = __webpack_require__(8);
  2990. var $filter = __webpack_require__(173)(2);
  2991. $export($export.P + $export.F * !__webpack_require__(169)([].filter, true), 'Array', {
  2992. // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
  2993. filter: function filter(callbackfn /* , thisArg */) {
  2994. return $filter(this, callbackfn, arguments[1]);
  2995. }
  2996. });
  2997. /***/ }),
  2998. /* 178 */
  2999. /***/ (function(module, exports, __webpack_require__) {
  3000. 'use strict';
  3001. var $export = __webpack_require__(8);
  3002. var $some = __webpack_require__(173)(3);
  3003. $export($export.P + $export.F * !__webpack_require__(169)([].some, true), 'Array', {
  3004. // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
  3005. some: function some(callbackfn /* , thisArg */) {
  3006. return $some(this, callbackfn, arguments[1]);
  3007. }
  3008. });
  3009. /***/ }),
  3010. /* 179 */
  3011. /***/ (function(module, exports, __webpack_require__) {
  3012. 'use strict';
  3013. var $export = __webpack_require__(8);
  3014. var $every = __webpack_require__(173)(4);
  3015. $export($export.P + $export.F * !__webpack_require__(169)([].every, true), 'Array', {
  3016. // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])
  3017. every: function every(callbackfn /* , thisArg */) {
  3018. return $every(this, callbackfn, arguments[1]);
  3019. }
  3020. });
  3021. /***/ }),
  3022. /* 180 */
  3023. /***/ (function(module, exports, __webpack_require__) {
  3024. 'use strict';
  3025. var $export = __webpack_require__(8);
  3026. var $reduce = __webpack_require__(181);
  3027. $export($export.P + $export.F * !__webpack_require__(169)([].reduce, true), 'Array', {
  3028. // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])
  3029. reduce: function reduce(callbackfn /* , initialValue */) {
  3030. return $reduce(this, callbackfn, arguments.length, arguments[1], false);
  3031. }
  3032. });
  3033. /***/ }),
  3034. /* 181 */
  3035. /***/ (function(module, exports, __webpack_require__) {
  3036. var aFunction = __webpack_require__(21);
  3037. var toObject = __webpack_require__(57);
  3038. var IObject = __webpack_require__(33);
  3039. var toLength = __webpack_require__(37);
  3040. module.exports = function (that, callbackfn, aLen, memo, isRight) {
  3041. aFunction(callbackfn);
  3042. var O = toObject(that);
  3043. var self = IObject(O);
  3044. var length = toLength(O.length);
  3045. var index = isRight ? length - 1 : 0;
  3046. var i = isRight ? -1 : 1;
  3047. if (aLen < 2) for (;;) {
  3048. if (index in self) {
  3049. memo = self[index];
  3050. index += i;
  3051. break;
  3052. }
  3053. index += i;
  3054. if (isRight ? index < 0 : length <= index) {
  3055. throw TypeError('Reduce of empty array with no initial value');
  3056. }
  3057. }
  3058. for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {
  3059. memo = callbackfn(memo, self[index], index, O);
  3060. }
  3061. return memo;
  3062. };
  3063. /***/ }),
  3064. /* 182 */
  3065. /***/ (function(module, exports, __webpack_require__) {
  3066. 'use strict';
  3067. var $export = __webpack_require__(8);
  3068. var $reduce = __webpack_require__(181);
  3069. $export($export.P + $export.F * !__webpack_require__(169)([].reduceRight, true), 'Array', {
  3070. // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])
  3071. reduceRight: function reduceRight(callbackfn /* , initialValue */) {
  3072. return $reduce(this, callbackfn, arguments.length, arguments[1], true);
  3073. }
  3074. });
  3075. /***/ }),
  3076. /* 183 */
  3077. /***/ (function(module, exports, __webpack_require__) {
  3078. 'use strict';
  3079. var $export = __webpack_require__(8);
  3080. var $indexOf = __webpack_require__(36)(false);
  3081. var $native = [].indexOf;
  3082. var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;
  3083. $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(169)($native)), 'Array', {
  3084. // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
  3085. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  3086. return NEGATIVE_ZERO
  3087. // convert -0 to +0
  3088. ? $native.apply(this, arguments) || 0
  3089. : $indexOf(this, searchElement, arguments[1]);
  3090. }
  3091. });
  3092. /***/ }),
  3093. /* 184 */
  3094. /***/ (function(module, exports, __webpack_require__) {
  3095. 'use strict';
  3096. var $export = __webpack_require__(8);
  3097. var toIObject = __webpack_require__(32);
  3098. var toInteger = __webpack_require__(38);
  3099. var toLength = __webpack_require__(37);
  3100. var $native = [].lastIndexOf;
  3101. var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;
  3102. $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(169)($native)), 'Array', {
  3103. // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
  3104. lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
  3105. // convert -0 to +0
  3106. if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;
  3107. var O = toIObject(this);
  3108. var length = toLength(O.length);
  3109. var index = length - 1;
  3110. if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));
  3111. if (index < 0) index = length + index;
  3112. for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;
  3113. return -1;
  3114. }
  3115. });
  3116. /***/ }),
  3117. /* 185 */
  3118. /***/ (function(module, exports, __webpack_require__) {
  3119. // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
  3120. var $export = __webpack_require__(8);
  3121. $export($export.P, 'Array', { copyWithin: __webpack_require__(186) });
  3122. __webpack_require__(187)('copyWithin');
  3123. /***/ }),
  3124. /* 186 */
  3125. /***/ (function(module, exports, __webpack_require__) {
  3126. // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
  3127. 'use strict';
  3128. var toObject = __webpack_require__(57);
  3129. var toAbsoluteIndex = __webpack_require__(39);
  3130. var toLength = __webpack_require__(37);
  3131. module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
  3132. var O = toObject(this);
  3133. var len = toLength(O.length);
  3134. var to = toAbsoluteIndex(target, len);
  3135. var from = toAbsoluteIndex(start, len);
  3136. var end = arguments.length > 2 ? arguments[2] : undefined;
  3137. var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
  3138. var inc = 1;
  3139. if (from < to && to < from + count) {
  3140. inc = -1;
  3141. from += count - 1;
  3142. to += count - 1;
  3143. }
  3144. while (count-- > 0) {
  3145. if (from in O) O[to] = O[from];
  3146. else delete O[to];
  3147. to += inc;
  3148. from += inc;
  3149. } return O;
  3150. };
  3151. /***/ }),
  3152. /* 187 */
  3153. /***/ (function(module, exports, __webpack_require__) {
  3154. // 22.1.3.31 Array.prototype[@@unscopables]
  3155. var UNSCOPABLES = __webpack_require__(26)('unscopables');
  3156. var ArrayProto = Array.prototype;
  3157. if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(10)(ArrayProto, UNSCOPABLES, {});
  3158. module.exports = function (key) {
  3159. ArrayProto[UNSCOPABLES][key] = true;
  3160. };
  3161. /***/ }),
  3162. /* 188 */
  3163. /***/ (function(module, exports, __webpack_require__) {
  3164. // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
  3165. var $export = __webpack_require__(8);
  3166. $export($export.P, 'Array', { fill: __webpack_require__(189) });
  3167. __webpack_require__(187)('fill');
  3168. /***/ }),
  3169. /* 189 */
  3170. /***/ (function(module, exports, __webpack_require__) {
  3171. // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
  3172. 'use strict';
  3173. var toObject = __webpack_require__(57);
  3174. var toAbsoluteIndex = __webpack_require__(39);
  3175. var toLength = __webpack_require__(37);
  3176. module.exports = function fill(value /* , start = 0, end = @length */) {
  3177. var O = toObject(this);
  3178. var length = toLength(O.length);
  3179. var aLen = arguments.length;
  3180. var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);
  3181. var end = aLen > 2 ? arguments[2] : undefined;
  3182. var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
  3183. while (endPos > index) O[index++] = value;
  3184. return O;
  3185. };
  3186. /***/ }),
  3187. /* 190 */
  3188. /***/ (function(module, exports, __webpack_require__) {
  3189. 'use strict';
  3190. // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
  3191. var $export = __webpack_require__(8);
  3192. var $find = __webpack_require__(173)(5);
  3193. var KEY = 'find';
  3194. var forced = true;
  3195. // Shouldn't skip holes
  3196. if (KEY in []) Array(1)[KEY](function () { forced = false; });
  3197. $export($export.P + $export.F * forced, 'Array', {
  3198. find: function find(callbackfn /* , that = undefined */) {
  3199. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  3200. }
  3201. });
  3202. __webpack_require__(187)(KEY);
  3203. /***/ }),
  3204. /* 191 */
  3205. /***/ (function(module, exports, __webpack_require__) {
  3206. 'use strict';
  3207. // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
  3208. var $export = __webpack_require__(8);
  3209. var $find = __webpack_require__(173)(6);
  3210. var KEY = 'findIndex';
  3211. var forced = true;
  3212. // Shouldn't skip holes
  3213. if (KEY in []) Array(1)[KEY](function () { forced = false; });
  3214. $export($export.P + $export.F * forced, 'Array', {
  3215. findIndex: function findIndex(callbackfn /* , that = undefined */) {
  3216. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  3217. }
  3218. });
  3219. __webpack_require__(187)(KEY);
  3220. /***/ }),
  3221. /* 192 */
  3222. /***/ (function(module, exports, __webpack_require__) {
  3223. __webpack_require__(193)('Array');
  3224. /***/ }),
  3225. /* 193 */
  3226. /***/ (function(module, exports, __webpack_require__) {
  3227. 'use strict';
  3228. var global = __webpack_require__(4);
  3229. var dP = __webpack_require__(11);
  3230. var DESCRIPTORS = __webpack_require__(6);
  3231. var SPECIES = __webpack_require__(26)('species');
  3232. module.exports = function (KEY) {
  3233. var C = global[KEY];
  3234. if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
  3235. configurable: true,
  3236. get: function () { return this; }
  3237. });
  3238. };
  3239. /***/ }),
  3240. /* 194 */
  3241. /***/ (function(module, exports, __webpack_require__) {
  3242. 'use strict';
  3243. var addToUnscopables = __webpack_require__(187);
  3244. var step = __webpack_require__(195);
  3245. var Iterators = __webpack_require__(129);
  3246. var toIObject = __webpack_require__(32);
  3247. // 22.1.3.4 Array.prototype.entries()
  3248. // 22.1.3.13 Array.prototype.keys()
  3249. // 22.1.3.29 Array.prototype.values()
  3250. // 22.1.3.30 Array.prototype[@@iterator]()
  3251. module.exports = __webpack_require__(128)(Array, 'Array', function (iterated, kind) {
  3252. this._t = toIObject(iterated); // target
  3253. this._i = 0; // next index
  3254. this._k = kind; // kind
  3255. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  3256. }, function () {
  3257. var O = this._t;
  3258. var kind = this._k;
  3259. var index = this._i++;
  3260. if (!O || index >= O.length) {
  3261. this._t = undefined;
  3262. return step(1);
  3263. }
  3264. if (kind == 'keys') return step(0, index);
  3265. if (kind == 'values') return step(0, O[index]);
  3266. return step(0, [index, O[index]]);
  3267. }, 'values');
  3268. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  3269. Iterators.Arguments = Iterators.Array;
  3270. addToUnscopables('keys');
  3271. addToUnscopables('values');
  3272. addToUnscopables('entries');
  3273. /***/ }),
  3274. /* 195 */
  3275. /***/ (function(module, exports) {
  3276. module.exports = function (done, value) {
  3277. return { value: value, done: !!done };
  3278. };
  3279. /***/ }),
  3280. /* 196 */
  3281. /***/ (function(module, exports, __webpack_require__) {
  3282. var global = __webpack_require__(4);
  3283. var inheritIfRequired = __webpack_require__(87);
  3284. var dP = __webpack_require__(11).f;
  3285. var gOPN = __webpack_require__(49).f;
  3286. var isRegExp = __webpack_require__(134);
  3287. var $flags = __webpack_require__(197);
  3288. var $RegExp = global.RegExp;
  3289. var Base = $RegExp;
  3290. var proto = $RegExp.prototype;
  3291. var re1 = /a/g;
  3292. var re2 = /a/g;
  3293. // "new" creates a new object, old webkit buggy here
  3294. var CORRECT_NEW = new $RegExp(re1) !== re1;
  3295. if (__webpack_require__(6) && (!CORRECT_NEW || __webpack_require__(7)(function () {
  3296. re2[__webpack_require__(26)('match')] = false;
  3297. // RegExp constructor can alter flags and IsRegExp works correct with @@match
  3298. return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';
  3299. }))) {
  3300. $RegExp = function RegExp(p, f) {
  3301. var tiRE = this instanceof $RegExp;
  3302. var piRE = isRegExp(p);
  3303. var fiU = f === undefined;
  3304. return !tiRE && piRE && p.constructor === $RegExp && fiU ? p
  3305. : inheritIfRequired(CORRECT_NEW
  3306. ? new Base(piRE && !fiU ? p.source : p, f)
  3307. : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)
  3308. , tiRE ? this : proto, $RegExp);
  3309. };
  3310. var proxy = function (key) {
  3311. key in $RegExp || dP($RegExp, key, {
  3312. configurable: true,
  3313. get: function () { return Base[key]; },
  3314. set: function (it) { Base[key] = it; }
  3315. });
  3316. };
  3317. for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);
  3318. proto.constructor = $RegExp;
  3319. $RegExp.prototype = proto;
  3320. __webpack_require__(18)(global, 'RegExp', $RegExp);
  3321. }
  3322. __webpack_require__(193)('RegExp');
  3323. /***/ }),
  3324. /* 197 */
  3325. /***/ (function(module, exports, __webpack_require__) {
  3326. 'use strict';
  3327. // 21.2.5.3 get RegExp.prototype.flags
  3328. var anObject = __webpack_require__(12);
  3329. module.exports = function () {
  3330. var that = anObject(this);
  3331. var result = '';
  3332. if (that.global) result += 'g';
  3333. if (that.ignoreCase) result += 'i';
  3334. if (that.multiline) result += 'm';
  3335. if (that.unicode) result += 'u';
  3336. if (that.sticky) result += 'y';
  3337. return result;
  3338. };
  3339. /***/ }),
  3340. /* 198 */
  3341. /***/ (function(module, exports, __webpack_require__) {
  3342. 'use strict';
  3343. __webpack_require__(199);
  3344. var anObject = __webpack_require__(12);
  3345. var $flags = __webpack_require__(197);
  3346. var DESCRIPTORS = __webpack_require__(6);
  3347. var TO_STRING = 'toString';
  3348. var $toString = /./[TO_STRING];
  3349. var define = function (fn) {
  3350. __webpack_require__(18)(RegExp.prototype, TO_STRING, fn, true);
  3351. };
  3352. // 21.2.5.14 RegExp.prototype.toString()
  3353. if (__webpack_require__(7)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {
  3354. define(function toString() {
  3355. var R = anObject(this);
  3356. return '/'.concat(R.source, '/',
  3357. 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);
  3358. });
  3359. // FF44- RegExp#toString has a wrong name
  3360. } else if ($toString.name != TO_STRING) {
  3361. define(function toString() {
  3362. return $toString.call(this);
  3363. });
  3364. }
  3365. /***/ }),
  3366. /* 199 */
  3367. /***/ (function(module, exports, __webpack_require__) {
  3368. // 21.2.5.3 get RegExp.prototype.flags()
  3369. if (__webpack_require__(6) && /./g.flags != 'g') __webpack_require__(11).f(RegExp.prototype, 'flags', {
  3370. configurable: true,
  3371. get: __webpack_require__(197)
  3372. });
  3373. /***/ }),
  3374. /* 200 */
  3375. /***/ (function(module, exports, __webpack_require__) {
  3376. // @@match logic
  3377. __webpack_require__(201)('match', 1, function (defined, MATCH, $match) {
  3378. // 21.1.3.11 String.prototype.match(regexp)
  3379. return [function match(regexp) {
  3380. 'use strict';
  3381. var O = defined(this);
  3382. var fn = regexp == undefined ? undefined : regexp[MATCH];
  3383. return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
  3384. }, $match];
  3385. });
  3386. /***/ }),
  3387. /* 201 */
  3388. /***/ (function(module, exports, __webpack_require__) {
  3389. 'use strict';
  3390. var hide = __webpack_require__(10);
  3391. var redefine = __webpack_require__(18);
  3392. var fails = __webpack_require__(7);
  3393. var defined = __webpack_require__(35);
  3394. var wks = __webpack_require__(26);
  3395. module.exports = function (KEY, length, exec) {
  3396. var SYMBOL = wks(KEY);
  3397. var fns = exec(defined, SYMBOL, ''[KEY]);
  3398. var strfn = fns[0];
  3399. var rxfn = fns[1];
  3400. if (fails(function () {
  3401. var O = {};
  3402. O[SYMBOL] = function () { return 7; };
  3403. return ''[KEY](O) != 7;
  3404. })) {
  3405. redefine(String.prototype, KEY, strfn);
  3406. hide(RegExp.prototype, SYMBOL, length == 2
  3407. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  3408. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  3409. ? function (string, arg) { return rxfn.call(string, this, arg); }
  3410. // 21.2.5.6 RegExp.prototype[@@match](string)
  3411. // 21.2.5.9 RegExp.prototype[@@search](string)
  3412. : function (string) { return rxfn.call(string, this); }
  3413. );
  3414. }
  3415. };
  3416. /***/ }),
  3417. /* 202 */
  3418. /***/ (function(module, exports, __webpack_require__) {
  3419. // @@replace logic
  3420. __webpack_require__(201)('replace', 2, function (defined, REPLACE, $replace) {
  3421. // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)
  3422. return [function replace(searchValue, replaceValue) {
  3423. 'use strict';
  3424. var O = defined(this);
  3425. var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
  3426. return fn !== undefined
  3427. ? fn.call(searchValue, O, replaceValue)
  3428. : $replace.call(String(O), searchValue, replaceValue);
  3429. }, $replace];
  3430. });
  3431. /***/ }),
  3432. /* 203 */
  3433. /***/ (function(module, exports, __webpack_require__) {
  3434. // @@search logic
  3435. __webpack_require__(201)('search', 1, function (defined, SEARCH, $search) {
  3436. // 21.1.3.15 String.prototype.search(regexp)
  3437. return [function search(regexp) {
  3438. 'use strict';
  3439. var O = defined(this);
  3440. var fn = regexp == undefined ? undefined : regexp[SEARCH];
  3441. return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
  3442. }, $search];
  3443. });
  3444. /***/ }),
  3445. /* 204 */
  3446. /***/ (function(module, exports, __webpack_require__) {
  3447. // @@split logic
  3448. __webpack_require__(201)('split', 2, function (defined, SPLIT, $split) {
  3449. 'use strict';
  3450. var isRegExp = __webpack_require__(134);
  3451. var _split = $split;
  3452. var $push = [].push;
  3453. var $SPLIT = 'split';
  3454. var LENGTH = 'length';
  3455. var LAST_INDEX = 'lastIndex';
  3456. if (
  3457. 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
  3458. 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
  3459. 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
  3460. '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
  3461. '.'[$SPLIT](/()()/)[LENGTH] > 1 ||
  3462. ''[$SPLIT](/.?/)[LENGTH]
  3463. ) {
  3464. var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group
  3465. // based on es5-shim implementation, need to rework it
  3466. $split = function (separator, limit) {
  3467. var string = String(this);
  3468. if (separator === undefined && limit === 0) return [];
  3469. // If `separator` is not a regex, use native split
  3470. if (!isRegExp(separator)) return _split.call(string, separator, limit);
  3471. var output = [];
  3472. var flags = (separator.ignoreCase ? 'i' : '') +
  3473. (separator.multiline ? 'm' : '') +
  3474. (separator.unicode ? 'u' : '') +
  3475. (separator.sticky ? 'y' : '');
  3476. var lastLastIndex = 0;
  3477. var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;
  3478. // Make `global` and avoid `lastIndex` issues by working with a copy
  3479. var separatorCopy = new RegExp(separator.source, flags + 'g');
  3480. var separator2, match, lastIndex, lastLength, i;
  3481. // Doesn't need flags gy, but they don't hurt
  3482. if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags);
  3483. while (match = separatorCopy.exec(string)) {
  3484. // `separatorCopy.lastIndex` is not reliable cross-browser
  3485. lastIndex = match.index + match[0][LENGTH];
  3486. if (lastIndex > lastLastIndex) {
  3487. output.push(string.slice(lastLastIndex, match.index));
  3488. // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG
  3489. // eslint-disable-next-line no-loop-func
  3490. if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {
  3491. for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;
  3492. });
  3493. if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));
  3494. lastLength = match[0][LENGTH];
  3495. lastLastIndex = lastIndex;
  3496. if (output[LENGTH] >= splitLimit) break;
  3497. }
  3498. if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
  3499. }
  3500. if (lastLastIndex === string[LENGTH]) {
  3501. if (lastLength || !separatorCopy.test('')) output.push('');
  3502. } else output.push(string.slice(lastLastIndex));
  3503. return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
  3504. };
  3505. // Chakra, V8
  3506. } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {
  3507. $split = function (separator, limit) {
  3508. return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);
  3509. };
  3510. }
  3511. // 21.1.3.17 String.prototype.split(separator, limit)
  3512. return [function split(separator, limit) {
  3513. var O = defined(this);
  3514. var fn = separator == undefined ? undefined : separator[SPLIT];
  3515. return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);
  3516. }, $split];
  3517. });
  3518. /***/ }),
  3519. /* 205 */
  3520. /***/ (function(module, exports, __webpack_require__) {
  3521. 'use strict';
  3522. var LIBRARY = __webpack_require__(24);
  3523. var global = __webpack_require__(4);
  3524. var ctx = __webpack_require__(20);
  3525. var classof = __webpack_require__(74);
  3526. var $export = __webpack_require__(8);
  3527. var isObject = __webpack_require__(13);
  3528. var aFunction = __webpack_require__(21);
  3529. var anInstance = __webpack_require__(206);
  3530. var forOf = __webpack_require__(207);
  3531. var speciesConstructor = __webpack_require__(208);
  3532. var task = __webpack_require__(209).set;
  3533. var microtask = __webpack_require__(210)();
  3534. var newPromiseCapabilityModule = __webpack_require__(211);
  3535. var perform = __webpack_require__(212);
  3536. var userAgent = __webpack_require__(213);
  3537. var promiseResolve = __webpack_require__(214);
  3538. var PROMISE = 'Promise';
  3539. var TypeError = global.TypeError;
  3540. var process = global.process;
  3541. var versions = process && process.versions;
  3542. var v8 = versions && versions.v8 || '';
  3543. var $Promise = global[PROMISE];
  3544. var isNode = classof(process) == 'process';
  3545. var empty = function () { /* empty */ };
  3546. var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
  3547. var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
  3548. var USE_NATIVE = !!function () {
  3549. try {
  3550. // correct subclassing with @@species support
  3551. var promise = $Promise.resolve(1);
  3552. var FakePromise = (promise.constructor = {})[__webpack_require__(26)('species')] = function (exec) {
  3553. exec(empty, empty);
  3554. };
  3555. // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  3556. return (isNode || typeof PromiseRejectionEvent == 'function')
  3557. && promise.then(empty) instanceof FakePromise
  3558. // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
  3559. // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
  3560. // we can't detect it synchronously, so just check versions
  3561. && v8.indexOf('6.6') !== 0
  3562. && userAgent.indexOf('Chrome/66') === -1;
  3563. } catch (e) { /* empty */ }
  3564. }();
  3565. // helpers
  3566. var isThenable = function (it) {
  3567. var then;
  3568. return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
  3569. };
  3570. var notify = function (promise, isReject) {
  3571. if (promise._n) return;
  3572. promise._n = true;
  3573. var chain = promise._c;
  3574. microtask(function () {
  3575. var value = promise._v;
  3576. var ok = promise._s == 1;
  3577. var i = 0;
  3578. var run = function (reaction) {
  3579. var handler = ok ? reaction.ok : reaction.fail;
  3580. var resolve = reaction.resolve;
  3581. var reject = reaction.reject;
  3582. var domain = reaction.domain;
  3583. var result, then, exited;
  3584. try {
  3585. if (handler) {
  3586. if (!ok) {
  3587. if (promise._h == 2) onHandleUnhandled(promise);
  3588. promise._h = 1;
  3589. }
  3590. if (handler === true) result = value;
  3591. else {
  3592. if (domain) domain.enter();
  3593. result = handler(value); // may throw
  3594. if (domain) {
  3595. domain.exit();
  3596. exited = true;
  3597. }
  3598. }
  3599. if (result === reaction.promise) {
  3600. reject(TypeError('Promise-chain cycle'));
  3601. } else if (then = isThenable(result)) {
  3602. then.call(result, resolve, reject);
  3603. } else resolve(result);
  3604. } else reject(value);
  3605. } catch (e) {
  3606. if (domain && !exited) domain.exit();
  3607. reject(e);
  3608. }
  3609. };
  3610. while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
  3611. promise._c = [];
  3612. promise._n = false;
  3613. if (isReject && !promise._h) onUnhandled(promise);
  3614. });
  3615. };
  3616. var onUnhandled = function (promise) {
  3617. task.call(global, function () {
  3618. var value = promise._v;
  3619. var unhandled = isUnhandled(promise);
  3620. var result, handler, console;
  3621. if (unhandled) {
  3622. result = perform(function () {
  3623. if (isNode) {
  3624. process.emit('unhandledRejection', value, promise);
  3625. } else if (handler = global.onunhandledrejection) {
  3626. handler({ promise: promise, reason: value });
  3627. } else if ((console = global.console) && console.error) {
  3628. console.error('Unhandled promise rejection', value);
  3629. }
  3630. });
  3631. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  3632. promise._h = isNode || isUnhandled(promise) ? 2 : 1;
  3633. } promise._a = undefined;
  3634. if (unhandled && result.e) throw result.v;
  3635. });
  3636. };
  3637. var isUnhandled = function (promise) {
  3638. return promise._h !== 1 && (promise._a || promise._c).length === 0;
  3639. };
  3640. var onHandleUnhandled = function (promise) {
  3641. task.call(global, function () {
  3642. var handler;
  3643. if (isNode) {
  3644. process.emit('rejectionHandled', promise);
  3645. } else if (handler = global.onrejectionhandled) {
  3646. handler({ promise: promise, reason: promise._v });
  3647. }
  3648. });
  3649. };
  3650. var $reject = function (value) {
  3651. var promise = this;
  3652. if (promise._d) return;
  3653. promise._d = true;
  3654. promise = promise._w || promise; // unwrap
  3655. promise._v = value;
  3656. promise._s = 2;
  3657. if (!promise._a) promise._a = promise._c.slice();
  3658. notify(promise, true);
  3659. };
  3660. var $resolve = function (value) {
  3661. var promise = this;
  3662. var then;
  3663. if (promise._d) return;
  3664. promise._d = true;
  3665. promise = promise._w || promise; // unwrap
  3666. try {
  3667. if (promise === value) throw TypeError("Promise can't be resolved itself");
  3668. if (then = isThenable(value)) {
  3669. microtask(function () {
  3670. var wrapper = { _w: promise, _d: false }; // wrap
  3671. try {
  3672. then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
  3673. } catch (e) {
  3674. $reject.call(wrapper, e);
  3675. }
  3676. });
  3677. } else {
  3678. promise._v = value;
  3679. promise._s = 1;
  3680. notify(promise, false);
  3681. }
  3682. } catch (e) {
  3683. $reject.call({ _w: promise, _d: false }, e); // wrap
  3684. }
  3685. };
  3686. // constructor polyfill
  3687. if (!USE_NATIVE) {
  3688. // 25.4.3.1 Promise(executor)
  3689. $Promise = function Promise(executor) {
  3690. anInstance(this, $Promise, PROMISE, '_h');
  3691. aFunction(executor);
  3692. Internal.call(this);
  3693. try {
  3694. executor(ctx($resolve, this, 1), ctx($reject, this, 1));
  3695. } catch (err) {
  3696. $reject.call(this, err);
  3697. }
  3698. };
  3699. // eslint-disable-next-line no-unused-vars
  3700. Internal = function Promise(executor) {
  3701. this._c = []; // <- awaiting reactions
  3702. this._a = undefined; // <- checked in isUnhandled reactions
  3703. this._s = 0; // <- state
  3704. this._d = false; // <- done
  3705. this._v = undefined; // <- value
  3706. this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
  3707. this._n = false; // <- notify
  3708. };
  3709. Internal.prototype = __webpack_require__(215)($Promise.prototype, {
  3710. // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
  3711. then: function then(onFulfilled, onRejected) {
  3712. var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
  3713. reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
  3714. reaction.fail = typeof onRejected == 'function' && onRejected;
  3715. reaction.domain = isNode ? process.domain : undefined;
  3716. this._c.push(reaction);
  3717. if (this._a) this._a.push(reaction);
  3718. if (this._s) notify(this, false);
  3719. return reaction.promise;
  3720. },
  3721. // 25.4.5.1 Promise.prototype.catch(onRejected)
  3722. 'catch': function (onRejected) {
  3723. return this.then(undefined, onRejected);
  3724. }
  3725. });
  3726. OwnPromiseCapability = function () {
  3727. var promise = new Internal();
  3728. this.promise = promise;
  3729. this.resolve = ctx($resolve, promise, 1);
  3730. this.reject = ctx($reject, promise, 1);
  3731. };
  3732. newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
  3733. return C === $Promise || C === Wrapper
  3734. ? new OwnPromiseCapability(C)
  3735. : newGenericPromiseCapability(C);
  3736. };
  3737. }
  3738. $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
  3739. __webpack_require__(25)($Promise, PROMISE);
  3740. __webpack_require__(193)(PROMISE);
  3741. Wrapper = __webpack_require__(9)[PROMISE];
  3742. // statics
  3743. $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
  3744. // 25.4.4.5 Promise.reject(r)
  3745. reject: function reject(r) {
  3746. var capability = newPromiseCapability(this);
  3747. var $$reject = capability.reject;
  3748. $$reject(r);
  3749. return capability.promise;
  3750. }
  3751. });
  3752. $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
  3753. // 25.4.4.6 Promise.resolve(x)
  3754. resolve: function resolve(x) {
  3755. return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
  3756. }
  3757. });
  3758. $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(166)(function (iter) {
  3759. $Promise.all(iter)['catch'](empty);
  3760. })), PROMISE, {
  3761. // 25.4.4.1 Promise.all(iterable)
  3762. all: function all(iterable) {
  3763. var C = this;
  3764. var capability = newPromiseCapability(C);
  3765. var resolve = capability.resolve;
  3766. var reject = capability.reject;
  3767. var result = perform(function () {
  3768. var values = [];
  3769. var index = 0;
  3770. var remaining = 1;
  3771. forOf(iterable, false, function (promise) {
  3772. var $index = index++;
  3773. var alreadyCalled = false;
  3774. values.push(undefined);
  3775. remaining++;
  3776. C.resolve(promise).then(function (value) {
  3777. if (alreadyCalled) return;
  3778. alreadyCalled = true;
  3779. values[$index] = value;
  3780. --remaining || resolve(values);
  3781. }, reject);
  3782. });
  3783. --remaining || resolve(values);
  3784. });
  3785. if (result.e) reject(result.v);
  3786. return capability.promise;
  3787. },
  3788. // 25.4.4.4 Promise.race(iterable)
  3789. race: function race(iterable) {
  3790. var C = this;
  3791. var capability = newPromiseCapability(C);
  3792. var reject = capability.reject;
  3793. var result = perform(function () {
  3794. forOf(iterable, false, function (promise) {
  3795. C.resolve(promise).then(capability.resolve, reject);
  3796. });
  3797. });
  3798. if (result.e) reject(result.v);
  3799. return capability.promise;
  3800. }
  3801. });
  3802. /***/ }),
  3803. /* 206 */
  3804. /***/ (function(module, exports) {
  3805. module.exports = function (it, Constructor, name, forbiddenField) {
  3806. if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
  3807. throw TypeError(name + ': incorrect invocation!');
  3808. } return it;
  3809. };
  3810. /***/ }),
  3811. /* 207 */
  3812. /***/ (function(module, exports, __webpack_require__) {
  3813. var ctx = __webpack_require__(20);
  3814. var call = __webpack_require__(162);
  3815. var isArrayIter = __webpack_require__(163);
  3816. var anObject = __webpack_require__(12);
  3817. var toLength = __webpack_require__(37);
  3818. var getIterFn = __webpack_require__(165);
  3819. var BREAK = {};
  3820. var RETURN = {};
  3821. var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
  3822. var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
  3823. var f = ctx(fn, that, entries ? 2 : 1);
  3824. var index = 0;
  3825. var length, step, iterator, result;
  3826. if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
  3827. // fast case for arrays with default iterator
  3828. if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
  3829. result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
  3830. if (result === BREAK || result === RETURN) return result;
  3831. } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
  3832. result = call(iterator, f, step.value, entries);
  3833. if (result === BREAK || result === RETURN) return result;
  3834. }
  3835. };
  3836. exports.BREAK = BREAK;
  3837. exports.RETURN = RETURN;
  3838. /***/ }),
  3839. /* 208 */
  3840. /***/ (function(module, exports, __webpack_require__) {
  3841. // 7.3.20 SpeciesConstructor(O, defaultConstructor)
  3842. var anObject = __webpack_require__(12);
  3843. var aFunction = __webpack_require__(21);
  3844. var SPECIES = __webpack_require__(26)('species');
  3845. module.exports = function (O, D) {
  3846. var C = anObject(O).constructor;
  3847. var S;
  3848. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
  3849. };
  3850. /***/ }),
  3851. /* 209 */
  3852. /***/ (function(module, exports, __webpack_require__) {
  3853. var ctx = __webpack_require__(20);
  3854. var invoke = __webpack_require__(77);
  3855. var html = __webpack_require__(47);
  3856. var cel = __webpack_require__(15);
  3857. var global = __webpack_require__(4);
  3858. var process = global.process;
  3859. var setTask = global.setImmediate;
  3860. var clearTask = global.clearImmediate;
  3861. var MessageChannel = global.MessageChannel;
  3862. var Dispatch = global.Dispatch;
  3863. var counter = 0;
  3864. var queue = {};
  3865. var ONREADYSTATECHANGE = 'onreadystatechange';
  3866. var defer, channel, port;
  3867. var run = function () {
  3868. var id = +this;
  3869. // eslint-disable-next-line no-prototype-builtins
  3870. if (queue.hasOwnProperty(id)) {
  3871. var fn = queue[id];
  3872. delete queue[id];
  3873. fn();
  3874. }
  3875. };
  3876. var listener = function (event) {
  3877. run.call(event.data);
  3878. };
  3879. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  3880. if (!setTask || !clearTask) {
  3881. setTask = function setImmediate(fn) {
  3882. var args = [];
  3883. var i = 1;
  3884. while (arguments.length > i) args.push(arguments[i++]);
  3885. queue[++counter] = function () {
  3886. // eslint-disable-next-line no-new-func
  3887. invoke(typeof fn == 'function' ? fn : Function(fn), args);
  3888. };
  3889. defer(counter);
  3890. return counter;
  3891. };
  3892. clearTask = function clearImmediate(id) {
  3893. delete queue[id];
  3894. };
  3895. // Node.js 0.8-
  3896. if (__webpack_require__(34)(process) == 'process') {
  3897. defer = function (id) {
  3898. process.nextTick(ctx(run, id, 1));
  3899. };
  3900. // Sphere (JS game engine) Dispatch API
  3901. } else if (Dispatch && Dispatch.now) {
  3902. defer = function (id) {
  3903. Dispatch.now(ctx(run, id, 1));
  3904. };
  3905. // Browsers with MessageChannel, includes WebWorkers
  3906. } else if (MessageChannel) {
  3907. channel = new MessageChannel();
  3908. port = channel.port2;
  3909. channel.port1.onmessage = listener;
  3910. defer = ctx(port.postMessage, port, 1);
  3911. // Browsers with postMessage, skip WebWorkers
  3912. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  3913. } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
  3914. defer = function (id) {
  3915. global.postMessage(id + '', '*');
  3916. };
  3917. global.addEventListener('message', listener, false);
  3918. // IE8-
  3919. } else if (ONREADYSTATECHANGE in cel('script')) {
  3920. defer = function (id) {
  3921. html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
  3922. html.removeChild(this);
  3923. run.call(id);
  3924. };
  3925. };
  3926. // Rest old browsers
  3927. } else {
  3928. defer = function (id) {
  3929. setTimeout(ctx(run, id, 1), 0);
  3930. };
  3931. }
  3932. }
  3933. module.exports = {
  3934. set: setTask,
  3935. clear: clearTask
  3936. };
  3937. /***/ }),
  3938. /* 210 */
  3939. /***/ (function(module, exports, __webpack_require__) {
  3940. var global = __webpack_require__(4);
  3941. var macrotask = __webpack_require__(209).set;
  3942. var Observer = global.MutationObserver || global.WebKitMutationObserver;
  3943. var process = global.process;
  3944. var Promise = global.Promise;
  3945. var isNode = __webpack_require__(34)(process) == 'process';
  3946. module.exports = function () {
  3947. var head, last, notify;
  3948. var flush = function () {
  3949. var parent, fn;
  3950. if (isNode && (parent = process.domain)) parent.exit();
  3951. while (head) {
  3952. fn = head.fn;
  3953. head = head.next;
  3954. try {
  3955. fn();
  3956. } catch (e) {
  3957. if (head) notify();
  3958. else last = undefined;
  3959. throw e;
  3960. }
  3961. } last = undefined;
  3962. if (parent) parent.enter();
  3963. };
  3964. // Node.js
  3965. if (isNode) {
  3966. notify = function () {
  3967. process.nextTick(flush);
  3968. };
  3969. // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
  3970. } else if (Observer && !(global.navigator && global.navigator.standalone)) {
  3971. var toggle = true;
  3972. var node = document.createTextNode('');
  3973. new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
  3974. notify = function () {
  3975. node.data = toggle = !toggle;
  3976. };
  3977. // environments with maybe non-completely correct, but existent Promise
  3978. } else if (Promise && Promise.resolve) {
  3979. // Promise.resolve without an argument throws an error in LG WebOS 2
  3980. var promise = Promise.resolve(undefined);
  3981. notify = function () {
  3982. promise.then(flush);
  3983. };
  3984. // for other environments - macrotask based on:
  3985. // - setImmediate
  3986. // - MessageChannel
  3987. // - window.postMessag
  3988. // - onreadystatechange
  3989. // - setTimeout
  3990. } else {
  3991. notify = function () {
  3992. // strange IE + webpack dev server bug - use .call(global)
  3993. macrotask.call(global, flush);
  3994. };
  3995. }
  3996. return function (fn) {
  3997. var task = { fn: fn, next: undefined };
  3998. if (last) last.next = task;
  3999. if (!head) {
  4000. head = task;
  4001. notify();
  4002. } last = task;
  4003. };
  4004. };
  4005. /***/ }),
  4006. /* 211 */
  4007. /***/ (function(module, exports, __webpack_require__) {
  4008. 'use strict';
  4009. // 25.4.1.5 NewPromiseCapability(C)
  4010. var aFunction = __webpack_require__(21);
  4011. function PromiseCapability(C) {
  4012. var resolve, reject;
  4013. this.promise = new C(function ($$resolve, $$reject) {
  4014. if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
  4015. resolve = $$resolve;
  4016. reject = $$reject;
  4017. });
  4018. this.resolve = aFunction(resolve);
  4019. this.reject = aFunction(reject);
  4020. }
  4021. module.exports.f = function (C) {
  4022. return new PromiseCapability(C);
  4023. };
  4024. /***/ }),
  4025. /* 212 */
  4026. /***/ (function(module, exports) {
  4027. module.exports = function (exec) {
  4028. try {
  4029. return { e: false, v: exec() };
  4030. } catch (e) {
  4031. return { e: true, v: e };
  4032. }
  4033. };
  4034. /***/ }),
  4035. /* 213 */
  4036. /***/ (function(module, exports, __webpack_require__) {
  4037. var global = __webpack_require__(4);
  4038. var navigator = global.navigator;
  4039. module.exports = navigator && navigator.userAgent || '';
  4040. /***/ }),
  4041. /* 214 */
  4042. /***/ (function(module, exports, __webpack_require__) {
  4043. var anObject = __webpack_require__(12);
  4044. var isObject = __webpack_require__(13);
  4045. var newPromiseCapability = __webpack_require__(211);
  4046. module.exports = function (C, x) {
  4047. anObject(C);
  4048. if (isObject(x) && x.constructor === C) return x;
  4049. var promiseCapability = newPromiseCapability.f(C);
  4050. var resolve = promiseCapability.resolve;
  4051. resolve(x);
  4052. return promiseCapability.promise;
  4053. };
  4054. /***/ }),
  4055. /* 215 */
  4056. /***/ (function(module, exports, __webpack_require__) {
  4057. var redefine = __webpack_require__(18);
  4058. module.exports = function (target, src, safe) {
  4059. for (var key in src) redefine(target, key, src[key], safe);
  4060. return target;
  4061. };
  4062. /***/ }),
  4063. /* 216 */
  4064. /***/ (function(module, exports, __webpack_require__) {
  4065. 'use strict';
  4066. var strong = __webpack_require__(217);
  4067. var validate = __webpack_require__(218);
  4068. var MAP = 'Map';
  4069. // 23.1 Map Objects
  4070. module.exports = __webpack_require__(219)(MAP, function (get) {
  4071. return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  4072. }, {
  4073. // 23.1.3.6 Map.prototype.get(key)
  4074. get: function get(key) {
  4075. var entry = strong.getEntry(validate(this, MAP), key);
  4076. return entry && entry.v;
  4077. },
  4078. // 23.1.3.9 Map.prototype.set(key, value)
  4079. set: function set(key, value) {
  4080. return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);
  4081. }
  4082. }, strong, true);
  4083. /***/ }),
  4084. /* 217 */
  4085. /***/ (function(module, exports, __webpack_require__) {
  4086. 'use strict';
  4087. var dP = __webpack_require__(11).f;
  4088. var create = __webpack_require__(45);
  4089. var redefineAll = __webpack_require__(215);
  4090. var ctx = __webpack_require__(20);
  4091. var anInstance = __webpack_require__(206);
  4092. var forOf = __webpack_require__(207);
  4093. var $iterDefine = __webpack_require__(128);
  4094. var step = __webpack_require__(195);
  4095. var setSpecies = __webpack_require__(193);
  4096. var DESCRIPTORS = __webpack_require__(6);
  4097. var fastKey = __webpack_require__(22).fastKey;
  4098. var validate = __webpack_require__(218);
  4099. var SIZE = DESCRIPTORS ? '_s' : 'size';
  4100. var getEntry = function (that, key) {
  4101. // fast case
  4102. var index = fastKey(key);
  4103. var entry;
  4104. if (index !== 'F') return that._i[index];
  4105. // frozen object case
  4106. for (entry = that._f; entry; entry = entry.n) {
  4107. if (entry.k == key) return entry;
  4108. }
  4109. };
  4110. module.exports = {
  4111. getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
  4112. var C = wrapper(function (that, iterable) {
  4113. anInstance(that, C, NAME, '_i');
  4114. that._t = NAME; // collection type
  4115. that._i = create(null); // index
  4116. that._f = undefined; // first entry
  4117. that._l = undefined; // last entry
  4118. that[SIZE] = 0; // size
  4119. if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
  4120. });
  4121. redefineAll(C.prototype, {
  4122. // 23.1.3.1 Map.prototype.clear()
  4123. // 23.2.3.2 Set.prototype.clear()
  4124. clear: function clear() {
  4125. for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
  4126. entry.r = true;
  4127. if (entry.p) entry.p = entry.p.n = undefined;
  4128. delete data[entry.i];
  4129. }
  4130. that._f = that._l = undefined;
  4131. that[SIZE] = 0;
  4132. },
  4133. // 23.1.3.3 Map.prototype.delete(key)
  4134. // 23.2.3.4 Set.prototype.delete(value)
  4135. 'delete': function (key) {
  4136. var that = validate(this, NAME);
  4137. var entry = getEntry(that, key);
  4138. if (entry) {
  4139. var next = entry.n;
  4140. var prev = entry.p;
  4141. delete that._i[entry.i];
  4142. entry.r = true;
  4143. if (prev) prev.n = next;
  4144. if (next) next.p = prev;
  4145. if (that._f == entry) that._f = next;
  4146. if (that._l == entry) that._l = prev;
  4147. that[SIZE]--;
  4148. } return !!entry;
  4149. },
  4150. // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
  4151. // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
  4152. forEach: function forEach(callbackfn /* , that = undefined */) {
  4153. validate(this, NAME);
  4154. var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
  4155. var entry;
  4156. while (entry = entry ? entry.n : this._f) {
  4157. f(entry.v, entry.k, this);
  4158. // revert to the last existing entry
  4159. while (entry && entry.r) entry = entry.p;
  4160. }
  4161. },
  4162. // 23.1.3.7 Map.prototype.has(key)
  4163. // 23.2.3.7 Set.prototype.has(value)
  4164. has: function has(key) {
  4165. return !!getEntry(validate(this, NAME), key);
  4166. }
  4167. });
  4168. if (DESCRIPTORS) dP(C.prototype, 'size', {
  4169. get: function () {
  4170. return validate(this, NAME)[SIZE];
  4171. }
  4172. });
  4173. return C;
  4174. },
  4175. def: function (that, key, value) {
  4176. var entry = getEntry(that, key);
  4177. var prev, index;
  4178. // change existing entry
  4179. if (entry) {
  4180. entry.v = value;
  4181. // create new entry
  4182. } else {
  4183. that._l = entry = {
  4184. i: index = fastKey(key, true), // <- index
  4185. k: key, // <- key
  4186. v: value, // <- value
  4187. p: prev = that._l, // <- previous entry
  4188. n: undefined, // <- next entry
  4189. r: false // <- removed
  4190. };
  4191. if (!that._f) that._f = entry;
  4192. if (prev) prev.n = entry;
  4193. that[SIZE]++;
  4194. // add to index
  4195. if (index !== 'F') that._i[index] = entry;
  4196. } return that;
  4197. },
  4198. getEntry: getEntry,
  4199. setStrong: function (C, NAME, IS_MAP) {
  4200. // add .keys, .values, .entries, [@@iterator]
  4201. // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
  4202. $iterDefine(C, NAME, function (iterated, kind) {
  4203. this._t = validate(iterated, NAME); // target
  4204. this._k = kind; // kind
  4205. this._l = undefined; // previous
  4206. }, function () {
  4207. var that = this;
  4208. var kind = that._k;
  4209. var entry = that._l;
  4210. // revert to the last existing entry
  4211. while (entry && entry.r) entry = entry.p;
  4212. // get next entry
  4213. if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
  4214. // or finish the iteration
  4215. that._t = undefined;
  4216. return step(1);
  4217. }
  4218. // return step by kind
  4219. if (kind == 'keys') return step(0, entry.k);
  4220. if (kind == 'values') return step(0, entry.v);
  4221. return step(0, [entry.k, entry.v]);
  4222. }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
  4223. // add [@@species], 23.1.2.2, 23.2.2.2
  4224. setSpecies(NAME);
  4225. }
  4226. };
  4227. /***/ }),
  4228. /* 218 */
  4229. /***/ (function(module, exports, __webpack_require__) {
  4230. var isObject = __webpack_require__(13);
  4231. module.exports = function (it, TYPE) {
  4232. if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
  4233. return it;
  4234. };
  4235. /***/ }),
  4236. /* 219 */
  4237. /***/ (function(module, exports, __webpack_require__) {
  4238. 'use strict';
  4239. var global = __webpack_require__(4);
  4240. var $export = __webpack_require__(8);
  4241. var redefine = __webpack_require__(18);
  4242. var redefineAll = __webpack_require__(215);
  4243. var meta = __webpack_require__(22);
  4244. var forOf = __webpack_require__(207);
  4245. var anInstance = __webpack_require__(206);
  4246. var isObject = __webpack_require__(13);
  4247. var fails = __webpack_require__(7);
  4248. var $iterDetect = __webpack_require__(166);
  4249. var setToStringTag = __webpack_require__(25);
  4250. var inheritIfRequired = __webpack_require__(87);
  4251. module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
  4252. var Base = global[NAME];
  4253. var C = Base;
  4254. var ADDER = IS_MAP ? 'set' : 'add';
  4255. var proto = C && C.prototype;
  4256. var O = {};
  4257. var fixMethod = function (KEY) {
  4258. var fn = proto[KEY];
  4259. redefine(proto, KEY,
  4260. KEY == 'delete' ? function (a) {
  4261. return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
  4262. } : KEY == 'has' ? function has(a) {
  4263. return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
  4264. } : KEY == 'get' ? function get(a) {
  4265. return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
  4266. } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }
  4267. : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }
  4268. );
  4269. };
  4270. if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
  4271. new C().entries().next();
  4272. }))) {
  4273. // create collection constructor
  4274. C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
  4275. redefineAll(C.prototype, methods);
  4276. meta.NEED = true;
  4277. } else {
  4278. var instance = new C();
  4279. // early implementations not supports chaining
  4280. var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
  4281. // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
  4282. var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
  4283. // most early implementations doesn't supports iterables, most modern - not close it correctly
  4284. var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new
  4285. // for early implementations -0 and +0 not the same
  4286. var BUGGY_ZERO = !IS_WEAK && fails(function () {
  4287. // V8 ~ Chromium 42- fails only with 5+ elements
  4288. var $instance = new C();
  4289. var index = 5;
  4290. while (index--) $instance[ADDER](index, index);
  4291. return !$instance.has(-0);
  4292. });
  4293. if (!ACCEPT_ITERABLES) {
  4294. C = wrapper(function (target, iterable) {
  4295. anInstance(target, C, NAME);
  4296. var that = inheritIfRequired(new Base(), target, C);
  4297. if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
  4298. return that;
  4299. });
  4300. C.prototype = proto;
  4301. proto.constructor = C;
  4302. }
  4303. if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
  4304. fixMethod('delete');
  4305. fixMethod('has');
  4306. IS_MAP && fixMethod('get');
  4307. }
  4308. if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
  4309. // weak collections should not contains .clear method
  4310. if (IS_WEAK && proto.clear) delete proto.clear;
  4311. }
  4312. setToStringTag(C, NAME);
  4313. O[NAME] = C;
  4314. $export($export.G + $export.W + $export.F * (C != Base), O);
  4315. if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
  4316. return C;
  4317. };
  4318. /***/ }),
  4319. /* 220 */
  4320. /***/ (function(module, exports, __webpack_require__) {
  4321. 'use strict';
  4322. var strong = __webpack_require__(217);
  4323. var validate = __webpack_require__(218);
  4324. var SET = 'Set';
  4325. // 23.2 Set Objects
  4326. module.exports = __webpack_require__(219)(SET, function (get) {
  4327. return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  4328. }, {
  4329. // 23.2.3.1 Set.prototype.add(value)
  4330. add: function add(value) {
  4331. return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
  4332. }
  4333. }, strong);
  4334. /***/ }),
  4335. /* 221 */
  4336. /***/ (function(module, exports, __webpack_require__) {
  4337. 'use strict';
  4338. var each = __webpack_require__(173)(0);
  4339. var redefine = __webpack_require__(18);
  4340. var meta = __webpack_require__(22);
  4341. var assign = __webpack_require__(68);
  4342. var weak = __webpack_require__(222);
  4343. var isObject = __webpack_require__(13);
  4344. var fails = __webpack_require__(7);
  4345. var validate = __webpack_require__(218);
  4346. var WEAK_MAP = 'WeakMap';
  4347. var getWeak = meta.getWeak;
  4348. var isExtensible = Object.isExtensible;
  4349. var uncaughtFrozenStore = weak.ufstore;
  4350. var tmp = {};
  4351. var InternalMap;
  4352. var wrapper = function (get) {
  4353. return function WeakMap() {
  4354. return get(this, arguments.length > 0 ? arguments[0] : undefined);
  4355. };
  4356. };
  4357. var methods = {
  4358. // 23.3.3.3 WeakMap.prototype.get(key)
  4359. get: function get(key) {
  4360. if (isObject(key)) {
  4361. var data = getWeak(key);
  4362. if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);
  4363. return data ? data[this._i] : undefined;
  4364. }
  4365. },
  4366. // 23.3.3.5 WeakMap.prototype.set(key, value)
  4367. set: function set(key, value) {
  4368. return weak.def(validate(this, WEAK_MAP), key, value);
  4369. }
  4370. };
  4371. // 23.3 WeakMap Objects
  4372. var $WeakMap = module.exports = __webpack_require__(219)(WEAK_MAP, wrapper, methods, weak, true, true);
  4373. // IE11 WeakMap frozen keys fix
  4374. if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {
  4375. InternalMap = weak.getConstructor(wrapper, WEAK_MAP);
  4376. assign(InternalMap.prototype, methods);
  4377. meta.NEED = true;
  4378. each(['delete', 'has', 'get', 'set'], function (key) {
  4379. var proto = $WeakMap.prototype;
  4380. var method = proto[key];
  4381. redefine(proto, key, function (a, b) {
  4382. // store frozen objects on internal weakmap shim
  4383. if (isObject(a) && !isExtensible(a)) {
  4384. if (!this._f) this._f = new InternalMap();
  4385. var result = this._f[key](a, b);
  4386. return key == 'set' ? this : result;
  4387. // store all the rest on native weakmap
  4388. } return method.call(this, a, b);
  4389. });
  4390. });
  4391. }
  4392. /***/ }),
  4393. /* 222 */
  4394. /***/ (function(module, exports, __webpack_require__) {
  4395. 'use strict';
  4396. var redefineAll = __webpack_require__(215);
  4397. var getWeak = __webpack_require__(22).getWeak;
  4398. var anObject = __webpack_require__(12);
  4399. var isObject = __webpack_require__(13);
  4400. var anInstance = __webpack_require__(206);
  4401. var forOf = __webpack_require__(207);
  4402. var createArrayMethod = __webpack_require__(173);
  4403. var $has = __webpack_require__(5);
  4404. var validate = __webpack_require__(218);
  4405. var arrayFind = createArrayMethod(5);
  4406. var arrayFindIndex = createArrayMethod(6);
  4407. var id = 0;
  4408. // fallback for uncaught frozen keys
  4409. var uncaughtFrozenStore = function (that) {
  4410. return that._l || (that._l = new UncaughtFrozenStore());
  4411. };
  4412. var UncaughtFrozenStore = function () {
  4413. this.a = [];
  4414. };
  4415. var findUncaughtFrozen = function (store, key) {
  4416. return arrayFind(store.a, function (it) {
  4417. return it[0] === key;
  4418. });
  4419. };
  4420. UncaughtFrozenStore.prototype = {
  4421. get: function (key) {
  4422. var entry = findUncaughtFrozen(this, key);
  4423. if (entry) return entry[1];
  4424. },
  4425. has: function (key) {
  4426. return !!findUncaughtFrozen(this, key);
  4427. },
  4428. set: function (key, value) {
  4429. var entry = findUncaughtFrozen(this, key);
  4430. if (entry) entry[1] = value;
  4431. else this.a.push([key, value]);
  4432. },
  4433. 'delete': function (key) {
  4434. var index = arrayFindIndex(this.a, function (it) {
  4435. return it[0] === key;
  4436. });
  4437. if (~index) this.a.splice(index, 1);
  4438. return !!~index;
  4439. }
  4440. };
  4441. module.exports = {
  4442. getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
  4443. var C = wrapper(function (that, iterable) {
  4444. anInstance(that, C, NAME, '_i');
  4445. that._t = NAME; // collection type
  4446. that._i = id++; // collection id
  4447. that._l = undefined; // leak store for uncaught frozen objects
  4448. if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
  4449. });
  4450. redefineAll(C.prototype, {
  4451. // 23.3.3.2 WeakMap.prototype.delete(key)
  4452. // 23.4.3.3 WeakSet.prototype.delete(value)
  4453. 'delete': function (key) {
  4454. if (!isObject(key)) return false;
  4455. var data = getWeak(key);
  4456. if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);
  4457. return data && $has(data, this._i) && delete data[this._i];
  4458. },
  4459. // 23.3.3.4 WeakMap.prototype.has(key)
  4460. // 23.4.3.4 WeakSet.prototype.has(value)
  4461. has: function has(key) {
  4462. if (!isObject(key)) return false;
  4463. var data = getWeak(key);
  4464. if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);
  4465. return data && $has(data, this._i);
  4466. }
  4467. });
  4468. return C;
  4469. },
  4470. def: function (that, key, value) {
  4471. var data = getWeak(anObject(key), true);
  4472. if (data === true) uncaughtFrozenStore(that).set(key, value);
  4473. else data[that._i] = value;
  4474. return that;
  4475. },
  4476. ufstore: uncaughtFrozenStore
  4477. };
  4478. /***/ }),
  4479. /* 223 */
  4480. /***/ (function(module, exports, __webpack_require__) {
  4481. 'use strict';
  4482. var weak = __webpack_require__(222);
  4483. var validate = __webpack_require__(218);
  4484. var WEAK_SET = 'WeakSet';
  4485. // 23.4 WeakSet Objects
  4486. __webpack_require__(219)(WEAK_SET, function (get) {
  4487. return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  4488. }, {
  4489. // 23.4.3.1 WeakSet.prototype.add(value)
  4490. add: function add(value) {
  4491. return weak.def(validate(this, WEAK_SET), value, true);
  4492. }
  4493. }, weak, false, true);
  4494. /***/ }),
  4495. /* 224 */
  4496. /***/ (function(module, exports, __webpack_require__) {
  4497. 'use strict';
  4498. var $export = __webpack_require__(8);
  4499. var $typed = __webpack_require__(225);
  4500. var buffer = __webpack_require__(226);
  4501. var anObject = __webpack_require__(12);
  4502. var toAbsoluteIndex = __webpack_require__(39);
  4503. var toLength = __webpack_require__(37);
  4504. var isObject = __webpack_require__(13);
  4505. var ArrayBuffer = __webpack_require__(4).ArrayBuffer;
  4506. var speciesConstructor = __webpack_require__(208);
  4507. var $ArrayBuffer = buffer.ArrayBuffer;
  4508. var $DataView = buffer.DataView;
  4509. var $isView = $typed.ABV && ArrayBuffer.isView;
  4510. var $slice = $ArrayBuffer.prototype.slice;
  4511. var VIEW = $typed.VIEW;
  4512. var ARRAY_BUFFER = 'ArrayBuffer';
  4513. $export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });
  4514. $export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {
  4515. // 24.1.3.1 ArrayBuffer.isView(arg)
  4516. isView: function isView(it) {
  4517. return $isView && $isView(it) || isObject(it) && VIEW in it;
  4518. }
  4519. });
  4520. $export($export.P + $export.U + $export.F * __webpack_require__(7)(function () {
  4521. return !new $ArrayBuffer(2).slice(1, undefined).byteLength;
  4522. }), ARRAY_BUFFER, {
  4523. // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)
  4524. slice: function slice(start, end) {
  4525. if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix
  4526. var len = anObject(this).byteLength;
  4527. var first = toAbsoluteIndex(start, len);
  4528. var fin = toAbsoluteIndex(end === undefined ? len : end, len);
  4529. var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first));
  4530. var viewS = new $DataView(this);
  4531. var viewT = new $DataView(result);
  4532. var index = 0;
  4533. while (first < fin) {
  4534. viewT.setUint8(index++, viewS.getUint8(first++));
  4535. } return result;
  4536. }
  4537. });
  4538. __webpack_require__(193)(ARRAY_BUFFER);
  4539. /***/ }),
  4540. /* 225 */
  4541. /***/ (function(module, exports, __webpack_require__) {
  4542. var global = __webpack_require__(4);
  4543. var hide = __webpack_require__(10);
  4544. var uid = __webpack_require__(19);
  4545. var TYPED = uid('typed_array');
  4546. var VIEW = uid('view');
  4547. var ABV = !!(global.ArrayBuffer && global.DataView);
  4548. var CONSTR = ABV;
  4549. var i = 0;
  4550. var l = 9;
  4551. var Typed;
  4552. var TypedArrayConstructors = (
  4553. 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'
  4554. ).split(',');
  4555. while (i < l) {
  4556. if (Typed = global[TypedArrayConstructors[i++]]) {
  4557. hide(Typed.prototype, TYPED, true);
  4558. hide(Typed.prototype, VIEW, true);
  4559. } else CONSTR = false;
  4560. }
  4561. module.exports = {
  4562. ABV: ABV,
  4563. CONSTR: CONSTR,
  4564. TYPED: TYPED,
  4565. VIEW: VIEW
  4566. };
  4567. /***/ }),
  4568. /* 226 */
  4569. /***/ (function(module, exports, __webpack_require__) {
  4570. 'use strict';
  4571. var global = __webpack_require__(4);
  4572. var DESCRIPTORS = __webpack_require__(6);
  4573. var LIBRARY = __webpack_require__(24);
  4574. var $typed = __webpack_require__(225);
  4575. var hide = __webpack_require__(10);
  4576. var redefineAll = __webpack_require__(215);
  4577. var fails = __webpack_require__(7);
  4578. var anInstance = __webpack_require__(206);
  4579. var toInteger = __webpack_require__(38);
  4580. var toLength = __webpack_require__(37);
  4581. var toIndex = __webpack_require__(227);
  4582. var gOPN = __webpack_require__(49).f;
  4583. var dP = __webpack_require__(11).f;
  4584. var arrayFill = __webpack_require__(189);
  4585. var setToStringTag = __webpack_require__(25);
  4586. var ARRAY_BUFFER = 'ArrayBuffer';
  4587. var DATA_VIEW = 'DataView';
  4588. var PROTOTYPE = 'prototype';
  4589. var WRONG_LENGTH = 'Wrong length!';
  4590. var WRONG_INDEX = 'Wrong index!';
  4591. var $ArrayBuffer = global[ARRAY_BUFFER];
  4592. var $DataView = global[DATA_VIEW];
  4593. var Math = global.Math;
  4594. var RangeError = global.RangeError;
  4595. // eslint-disable-next-line no-shadow-restricted-names
  4596. var Infinity = global.Infinity;
  4597. var BaseBuffer = $ArrayBuffer;
  4598. var abs = Math.abs;
  4599. var pow = Math.pow;
  4600. var floor = Math.floor;
  4601. var log = Math.log;
  4602. var LN2 = Math.LN2;
  4603. var BUFFER = 'buffer';
  4604. var BYTE_LENGTH = 'byteLength';
  4605. var BYTE_OFFSET = 'byteOffset';
  4606. var $BUFFER = DESCRIPTORS ? '_b' : BUFFER;
  4607. var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;
  4608. var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;
  4609. // IEEE754 conversions based on https://github.com/feross/ieee754
  4610. function packIEEE754(value, mLen, nBytes) {
  4611. var buffer = new Array(nBytes);
  4612. var eLen = nBytes * 8 - mLen - 1;
  4613. var eMax = (1 << eLen) - 1;
  4614. var eBias = eMax >> 1;
  4615. var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;
  4616. var i = 0;
  4617. var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
  4618. var e, m, c;
  4619. value = abs(value);
  4620. // eslint-disable-next-line no-self-compare
  4621. if (value != value || value === Infinity) {
  4622. // eslint-disable-next-line no-self-compare
  4623. m = value != value ? 1 : 0;
  4624. e = eMax;
  4625. } else {
  4626. e = floor(log(value) / LN2);
  4627. if (value * (c = pow(2, -e)) < 1) {
  4628. e--;
  4629. c *= 2;
  4630. }
  4631. if (e + eBias >= 1) {
  4632. value += rt / c;
  4633. } else {
  4634. value += rt * pow(2, 1 - eBias);
  4635. }
  4636. if (value * c >= 2) {
  4637. e++;
  4638. c /= 2;
  4639. }
  4640. if (e + eBias >= eMax) {
  4641. m = 0;
  4642. e = eMax;
  4643. } else if (e + eBias >= 1) {
  4644. m = (value * c - 1) * pow(2, mLen);
  4645. e = e + eBias;
  4646. } else {
  4647. m = value * pow(2, eBias - 1) * pow(2, mLen);
  4648. e = 0;
  4649. }
  4650. }
  4651. for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);
  4652. e = e << mLen | m;
  4653. eLen += mLen;
  4654. for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);
  4655. buffer[--i] |= s * 128;
  4656. return buffer;
  4657. }
  4658. function unpackIEEE754(buffer, mLen, nBytes) {
  4659. var eLen = nBytes * 8 - mLen - 1;
  4660. var eMax = (1 << eLen) - 1;
  4661. var eBias = eMax >> 1;
  4662. var nBits = eLen - 7;
  4663. var i = nBytes - 1;
  4664. var s = buffer[i--];
  4665. var e = s & 127;
  4666. var m;
  4667. s >>= 7;
  4668. for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);
  4669. m = e & (1 << -nBits) - 1;
  4670. e >>= -nBits;
  4671. nBits += mLen;
  4672. for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);
  4673. if (e === 0) {
  4674. e = 1 - eBias;
  4675. } else if (e === eMax) {
  4676. return m ? NaN : s ? -Infinity : Infinity;
  4677. } else {
  4678. m = m + pow(2, mLen);
  4679. e = e - eBias;
  4680. } return (s ? -1 : 1) * m * pow(2, e - mLen);
  4681. }
  4682. function unpackI32(bytes) {
  4683. return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];
  4684. }
  4685. function packI8(it) {
  4686. return [it & 0xff];
  4687. }
  4688. function packI16(it) {
  4689. return [it & 0xff, it >> 8 & 0xff];
  4690. }
  4691. function packI32(it) {
  4692. return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];
  4693. }
  4694. function packF64(it) {
  4695. return packIEEE754(it, 52, 8);
  4696. }
  4697. function packF32(it) {
  4698. return packIEEE754(it, 23, 4);
  4699. }
  4700. function addGetter(C, key, internal) {
  4701. dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });
  4702. }
  4703. function get(view, bytes, index, isLittleEndian) {
  4704. var numIndex = +index;
  4705. var intIndex = toIndex(numIndex);
  4706. if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
  4707. var store = view[$BUFFER]._b;
  4708. var start = intIndex + view[$OFFSET];
  4709. var pack = store.slice(start, start + bytes);
  4710. return isLittleEndian ? pack : pack.reverse();
  4711. }
  4712. function set(view, bytes, index, conversion, value, isLittleEndian) {
  4713. var numIndex = +index;
  4714. var intIndex = toIndex(numIndex);
  4715. if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
  4716. var store = view[$BUFFER]._b;
  4717. var start = intIndex + view[$OFFSET];
  4718. var pack = conversion(+value);
  4719. for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];
  4720. }
  4721. if (!$typed.ABV) {
  4722. $ArrayBuffer = function ArrayBuffer(length) {
  4723. anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
  4724. var byteLength = toIndex(length);
  4725. this._b = arrayFill.call(new Array(byteLength), 0);
  4726. this[$LENGTH] = byteLength;
  4727. };
  4728. $DataView = function DataView(buffer, byteOffset, byteLength) {
  4729. anInstance(this, $DataView, DATA_VIEW);
  4730. anInstance(buffer, $ArrayBuffer, DATA_VIEW);
  4731. var bufferLength = buffer[$LENGTH];
  4732. var offset = toInteger(byteOffset);
  4733. if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');
  4734. byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
  4735. if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
  4736. this[$BUFFER] = buffer;
  4737. this[$OFFSET] = offset;
  4738. this[$LENGTH] = byteLength;
  4739. };
  4740. if (DESCRIPTORS) {
  4741. addGetter($ArrayBuffer, BYTE_LENGTH, '_l');
  4742. addGetter($DataView, BUFFER, '_b');
  4743. addGetter($DataView, BYTE_LENGTH, '_l');
  4744. addGetter($DataView, BYTE_OFFSET, '_o');
  4745. }
  4746. redefineAll($DataView[PROTOTYPE], {
  4747. getInt8: function getInt8(byteOffset) {
  4748. return get(this, 1, byteOffset)[0] << 24 >> 24;
  4749. },
  4750. getUint8: function getUint8(byteOffset) {
  4751. return get(this, 1, byteOffset)[0];
  4752. },
  4753. getInt16: function getInt16(byteOffset /* , littleEndian */) {
  4754. var bytes = get(this, 2, byteOffset, arguments[1]);
  4755. return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
  4756. },
  4757. getUint16: function getUint16(byteOffset /* , littleEndian */) {
  4758. var bytes = get(this, 2, byteOffset, arguments[1]);
  4759. return bytes[1] << 8 | bytes[0];
  4760. },
  4761. getInt32: function getInt32(byteOffset /* , littleEndian */) {
  4762. return unpackI32(get(this, 4, byteOffset, arguments[1]));
  4763. },
  4764. getUint32: function getUint32(byteOffset /* , littleEndian */) {
  4765. return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;
  4766. },
  4767. getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
  4768. return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);
  4769. },
  4770. getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
  4771. return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);
  4772. },
  4773. setInt8: function setInt8(byteOffset, value) {
  4774. set(this, 1, byteOffset, packI8, value);
  4775. },
  4776. setUint8: function setUint8(byteOffset, value) {
  4777. set(this, 1, byteOffset, packI8, value);
  4778. },
  4779. setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
  4780. set(this, 2, byteOffset, packI16, value, arguments[2]);
  4781. },
  4782. setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
  4783. set(this, 2, byteOffset, packI16, value, arguments[2]);
  4784. },
  4785. setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
  4786. set(this, 4, byteOffset, packI32, value, arguments[2]);
  4787. },
  4788. setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
  4789. set(this, 4, byteOffset, packI32, value, arguments[2]);
  4790. },
  4791. setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
  4792. set(this, 4, byteOffset, packF32, value, arguments[2]);
  4793. },
  4794. setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
  4795. set(this, 8, byteOffset, packF64, value, arguments[2]);
  4796. }
  4797. });
  4798. } else {
  4799. if (!fails(function () {
  4800. $ArrayBuffer(1);
  4801. }) || !fails(function () {
  4802. new $ArrayBuffer(-1); // eslint-disable-line no-new
  4803. }) || fails(function () {
  4804. new $ArrayBuffer(); // eslint-disable-line no-new
  4805. new $ArrayBuffer(1.5); // eslint-disable-line no-new
  4806. new $ArrayBuffer(NaN); // eslint-disable-line no-new
  4807. return $ArrayBuffer.name != ARRAY_BUFFER;
  4808. })) {
  4809. $ArrayBuffer = function ArrayBuffer(length) {
  4810. anInstance(this, $ArrayBuffer);
  4811. return new BaseBuffer(toIndex(length));
  4812. };
  4813. var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];
  4814. for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {
  4815. if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);
  4816. }
  4817. if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;
  4818. }
  4819. // iOS Safari 7.x bug
  4820. var view = new $DataView(new $ArrayBuffer(2));
  4821. var $setInt8 = $DataView[PROTOTYPE].setInt8;
  4822. view.setInt8(0, 2147483648);
  4823. view.setInt8(1, 2147483649);
  4824. if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {
  4825. setInt8: function setInt8(byteOffset, value) {
  4826. $setInt8.call(this, byteOffset, value << 24 >> 24);
  4827. },
  4828. setUint8: function setUint8(byteOffset, value) {
  4829. $setInt8.call(this, byteOffset, value << 24 >> 24);
  4830. }
  4831. }, true);
  4832. }
  4833. setToStringTag($ArrayBuffer, ARRAY_BUFFER);
  4834. setToStringTag($DataView, DATA_VIEW);
  4835. hide($DataView[PROTOTYPE], $typed.VIEW, true);
  4836. exports[ARRAY_BUFFER] = $ArrayBuffer;
  4837. exports[DATA_VIEW] = $DataView;
  4838. /***/ }),
  4839. /* 227 */
  4840. /***/ (function(module, exports, __webpack_require__) {
  4841. // https://tc39.github.io/ecma262/#sec-toindex
  4842. var toInteger = __webpack_require__(38);
  4843. var toLength = __webpack_require__(37);
  4844. module.exports = function (it) {
  4845. if (it === undefined) return 0;
  4846. var number = toInteger(it);
  4847. var length = toLength(number);
  4848. if (number !== length) throw RangeError('Wrong length!');
  4849. return length;
  4850. };
  4851. /***/ }),
  4852. /* 228 */
  4853. /***/ (function(module, exports, __webpack_require__) {
  4854. var $export = __webpack_require__(8);
  4855. $export($export.G + $export.W + $export.F * !__webpack_require__(225).ABV, {
  4856. DataView: __webpack_require__(226).DataView
  4857. });
  4858. /***/ }),
  4859. /* 229 */
  4860. /***/ (function(module, exports, __webpack_require__) {
  4861. __webpack_require__(230)('Int8', 1, function (init) {
  4862. return function Int8Array(data, byteOffset, length) {
  4863. return init(this, data, byteOffset, length);
  4864. };
  4865. });
  4866. /***/ }),
  4867. /* 230 */
  4868. /***/ (function(module, exports, __webpack_require__) {
  4869. 'use strict';
  4870. if (__webpack_require__(6)) {
  4871. var LIBRARY = __webpack_require__(24);
  4872. var global = __webpack_require__(4);
  4873. var fails = __webpack_require__(7);
  4874. var $export = __webpack_require__(8);
  4875. var $typed = __webpack_require__(225);
  4876. var $buffer = __webpack_require__(226);
  4877. var ctx = __webpack_require__(20);
  4878. var anInstance = __webpack_require__(206);
  4879. var propertyDesc = __webpack_require__(17);
  4880. var hide = __webpack_require__(10);
  4881. var redefineAll = __webpack_require__(215);
  4882. var toInteger = __webpack_require__(38);
  4883. var toLength = __webpack_require__(37);
  4884. var toIndex = __webpack_require__(227);
  4885. var toAbsoluteIndex = __webpack_require__(39);
  4886. var toPrimitive = __webpack_require__(16);
  4887. var has = __webpack_require__(5);
  4888. var classof = __webpack_require__(74);
  4889. var isObject = __webpack_require__(13);
  4890. var toObject = __webpack_require__(57);
  4891. var isArrayIter = __webpack_require__(163);
  4892. var create = __webpack_require__(45);
  4893. var getPrototypeOf = __webpack_require__(58);
  4894. var gOPN = __webpack_require__(49).f;
  4895. var getIterFn = __webpack_require__(165);
  4896. var uid = __webpack_require__(19);
  4897. var wks = __webpack_require__(26);
  4898. var createArrayMethod = __webpack_require__(173);
  4899. var createArrayIncludes = __webpack_require__(36);
  4900. var speciesConstructor = __webpack_require__(208);
  4901. var ArrayIterators = __webpack_require__(194);
  4902. var Iterators = __webpack_require__(129);
  4903. var $iterDetect = __webpack_require__(166);
  4904. var setSpecies = __webpack_require__(193);
  4905. var arrayFill = __webpack_require__(189);
  4906. var arrayCopyWithin = __webpack_require__(186);
  4907. var $DP = __webpack_require__(11);
  4908. var $GOPD = __webpack_require__(50);
  4909. var dP = $DP.f;
  4910. var gOPD = $GOPD.f;
  4911. var RangeError = global.RangeError;
  4912. var TypeError = global.TypeError;
  4913. var Uint8Array = global.Uint8Array;
  4914. var ARRAY_BUFFER = 'ArrayBuffer';
  4915. var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;
  4916. var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
  4917. var PROTOTYPE = 'prototype';
  4918. var ArrayProto = Array[PROTOTYPE];
  4919. var $ArrayBuffer = $buffer.ArrayBuffer;
  4920. var $DataView = $buffer.DataView;
  4921. var arrayForEach = createArrayMethod(0);
  4922. var arrayFilter = createArrayMethod(2);
  4923. var arraySome = createArrayMethod(3);
  4924. var arrayEvery = createArrayMethod(4);
  4925. var arrayFind = createArrayMethod(5);
  4926. var arrayFindIndex = createArrayMethod(6);
  4927. var arrayIncludes = createArrayIncludes(true);
  4928. var arrayIndexOf = createArrayIncludes(false);
  4929. var arrayValues = ArrayIterators.values;
  4930. var arrayKeys = ArrayIterators.keys;
  4931. var arrayEntries = ArrayIterators.entries;
  4932. var arrayLastIndexOf = ArrayProto.lastIndexOf;
  4933. var arrayReduce = ArrayProto.reduce;
  4934. var arrayReduceRight = ArrayProto.reduceRight;
  4935. var arrayJoin = ArrayProto.join;
  4936. var arraySort = ArrayProto.sort;
  4937. var arraySlice = ArrayProto.slice;
  4938. var arrayToString = ArrayProto.toString;
  4939. var arrayToLocaleString = ArrayProto.toLocaleString;
  4940. var ITERATOR = wks('iterator');
  4941. var TAG = wks('toStringTag');
  4942. var TYPED_CONSTRUCTOR = uid('typed_constructor');
  4943. var DEF_CONSTRUCTOR = uid('def_constructor');
  4944. var ALL_CONSTRUCTORS = $typed.CONSTR;
  4945. var TYPED_ARRAY = $typed.TYPED;
  4946. var VIEW = $typed.VIEW;
  4947. var WRONG_LENGTH = 'Wrong length!';
  4948. var $map = createArrayMethod(1, function (O, length) {
  4949. return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);
  4950. });
  4951. var LITTLE_ENDIAN = fails(function () {
  4952. // eslint-disable-next-line no-undef
  4953. return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
  4954. });
  4955. var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {
  4956. new Uint8Array(1).set({});
  4957. });
  4958. var toOffset = function (it, BYTES) {
  4959. var offset = toInteger(it);
  4960. if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');
  4961. return offset;
  4962. };
  4963. var validate = function (it) {
  4964. if (isObject(it) && TYPED_ARRAY in it) return it;
  4965. throw TypeError(it + ' is not a typed array!');
  4966. };
  4967. var allocate = function (C, length) {
  4968. if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {
  4969. throw TypeError('It is not a typed array constructor!');
  4970. } return new C(length);
  4971. };
  4972. var speciesFromList = function (O, list) {
  4973. return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);
  4974. };
  4975. var fromList = function (C, list) {
  4976. var index = 0;
  4977. var length = list.length;
  4978. var result = allocate(C, length);
  4979. while (length > index) result[index] = list[index++];
  4980. return result;
  4981. };
  4982. var addGetter = function (it, key, internal) {
  4983. dP(it, key, { get: function () { return this._d[internal]; } });
  4984. };
  4985. var $from = function from(source /* , mapfn, thisArg */) {
  4986. var O = toObject(source);
  4987. var aLen = arguments.length;
  4988. var mapfn = aLen > 1 ? arguments[1] : undefined;
  4989. var mapping = mapfn !== undefined;
  4990. var iterFn = getIterFn(O);
  4991. var i, length, values, result, step, iterator;
  4992. if (iterFn != undefined && !isArrayIter(iterFn)) {
  4993. for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {
  4994. values.push(step.value);
  4995. } O = values;
  4996. }
  4997. if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);
  4998. for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {
  4999. result[i] = mapping ? mapfn(O[i], i) : O[i];
  5000. }
  5001. return result;
  5002. };
  5003. var $of = function of(/* ...items */) {
  5004. var index = 0;
  5005. var length = arguments.length;
  5006. var result = allocate(this, length);
  5007. while (length > index) result[index] = arguments[index++];
  5008. return result;
  5009. };
  5010. // iOS Safari 6.x fails here
  5011. var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });
  5012. var $toLocaleString = function toLocaleString() {
  5013. return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);
  5014. };
  5015. var proto = {
  5016. copyWithin: function copyWithin(target, start /* , end */) {
  5017. return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
  5018. },
  5019. every: function every(callbackfn /* , thisArg */) {
  5020. return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  5021. },
  5022. fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars
  5023. return arrayFill.apply(validate(this), arguments);
  5024. },
  5025. filter: function filter(callbackfn /* , thisArg */) {
  5026. return speciesFromList(this, arrayFilter(validate(this), callbackfn,
  5027. arguments.length > 1 ? arguments[1] : undefined));
  5028. },
  5029. find: function find(predicate /* , thisArg */) {
  5030. return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
  5031. },
  5032. findIndex: function findIndex(predicate /* , thisArg */) {
  5033. return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
  5034. },
  5035. forEach: function forEach(callbackfn /* , thisArg */) {
  5036. arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  5037. },
  5038. indexOf: function indexOf(searchElement /* , fromIndex */) {
  5039. return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
  5040. },
  5041. includes: function includes(searchElement /* , fromIndex */) {
  5042. return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
  5043. },
  5044. join: function join(separator) { // eslint-disable-line no-unused-vars
  5045. return arrayJoin.apply(validate(this), arguments);
  5046. },
  5047. lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars
  5048. return arrayLastIndexOf.apply(validate(this), arguments);
  5049. },
  5050. map: function map(mapfn /* , thisArg */) {
  5051. return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);
  5052. },
  5053. reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
  5054. return arrayReduce.apply(validate(this), arguments);
  5055. },
  5056. reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
  5057. return arrayReduceRight.apply(validate(this), arguments);
  5058. },
  5059. reverse: function reverse() {
  5060. var that = this;
  5061. var length = validate(that).length;
  5062. var middle = Math.floor(length / 2);
  5063. var index = 0;
  5064. var value;
  5065. while (index < middle) {
  5066. value = that[index];
  5067. that[index++] = that[--length];
  5068. that[length] = value;
  5069. } return that;
  5070. },
  5071. some: function some(callbackfn /* , thisArg */) {
  5072. return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  5073. },
  5074. sort: function sort(comparefn) {
  5075. return arraySort.call(validate(this), comparefn);
  5076. },
  5077. subarray: function subarray(begin, end) {
  5078. var O = validate(this);
  5079. var length = O.length;
  5080. var $begin = toAbsoluteIndex(begin, length);
  5081. return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(
  5082. O.buffer,
  5083. O.byteOffset + $begin * O.BYTES_PER_ELEMENT,
  5084. toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)
  5085. );
  5086. }
  5087. };
  5088. var $slice = function slice(start, end) {
  5089. return speciesFromList(this, arraySlice.call(validate(this), start, end));
  5090. };
  5091. var $set = function set(arrayLike /* , offset */) {
  5092. validate(this);
  5093. var offset = toOffset(arguments[1], 1);
  5094. var length = this.length;
  5095. var src = toObject(arrayLike);
  5096. var len = toLength(src.length);
  5097. var index = 0;
  5098. if (len + offset > length) throw RangeError(WRONG_LENGTH);
  5099. while (index < len) this[offset + index] = src[index++];
  5100. };
  5101. var $iterators = {
  5102. entries: function entries() {
  5103. return arrayEntries.call(validate(this));
  5104. },
  5105. keys: function keys() {
  5106. return arrayKeys.call(validate(this));
  5107. },
  5108. values: function values() {
  5109. return arrayValues.call(validate(this));
  5110. }
  5111. };
  5112. var isTAIndex = function (target, key) {
  5113. return isObject(target)
  5114. && target[TYPED_ARRAY]
  5115. && typeof key != 'symbol'
  5116. && key in target
  5117. && String(+key) == String(key);
  5118. };
  5119. var $getDesc = function getOwnPropertyDescriptor(target, key) {
  5120. return isTAIndex(target, key = toPrimitive(key, true))
  5121. ? propertyDesc(2, target[key])
  5122. : gOPD(target, key);
  5123. };
  5124. var $setDesc = function defineProperty(target, key, desc) {
  5125. if (isTAIndex(target, key = toPrimitive(key, true))
  5126. && isObject(desc)
  5127. && has(desc, 'value')
  5128. && !has(desc, 'get')
  5129. && !has(desc, 'set')
  5130. // TODO: add validation descriptor w/o calling accessors
  5131. && !desc.configurable
  5132. && (!has(desc, 'writable') || desc.writable)
  5133. && (!has(desc, 'enumerable') || desc.enumerable)
  5134. ) {
  5135. target[key] = desc.value;
  5136. return target;
  5137. } return dP(target, key, desc);
  5138. };
  5139. if (!ALL_CONSTRUCTORS) {
  5140. $GOPD.f = $getDesc;
  5141. $DP.f = $setDesc;
  5142. }
  5143. $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {
  5144. getOwnPropertyDescriptor: $getDesc,
  5145. defineProperty: $setDesc
  5146. });
  5147. if (fails(function () { arrayToString.call({}); })) {
  5148. arrayToString = arrayToLocaleString = function toString() {
  5149. return arrayJoin.call(this);
  5150. };
  5151. }
  5152. var $TypedArrayPrototype$ = redefineAll({}, proto);
  5153. redefineAll($TypedArrayPrototype$, $iterators);
  5154. hide($TypedArrayPrototype$, ITERATOR, $iterators.values);
  5155. redefineAll($TypedArrayPrototype$, {
  5156. slice: $slice,
  5157. set: $set,
  5158. constructor: function () { /* noop */ },
  5159. toString: arrayToString,
  5160. toLocaleString: $toLocaleString
  5161. });
  5162. addGetter($TypedArrayPrototype$, 'buffer', 'b');
  5163. addGetter($TypedArrayPrototype$, 'byteOffset', 'o');
  5164. addGetter($TypedArrayPrototype$, 'byteLength', 'l');
  5165. addGetter($TypedArrayPrototype$, 'length', 'e');
  5166. dP($TypedArrayPrototype$, TAG, {
  5167. get: function () { return this[TYPED_ARRAY]; }
  5168. });
  5169. // eslint-disable-next-line max-statements
  5170. module.exports = function (KEY, BYTES, wrapper, CLAMPED) {
  5171. CLAMPED = !!CLAMPED;
  5172. var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';
  5173. var GETTER = 'get' + KEY;
  5174. var SETTER = 'set' + KEY;
  5175. var TypedArray = global[NAME];
  5176. var Base = TypedArray || {};
  5177. var TAC = TypedArray && getPrototypeOf(TypedArray);
  5178. var FORCED = !TypedArray || !$typed.ABV;
  5179. var O = {};
  5180. var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];
  5181. var getter = function (that, index) {
  5182. var data = that._d;
  5183. return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);
  5184. };
  5185. var setter = function (that, index, value) {
  5186. var data = that._d;
  5187. if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;
  5188. data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);
  5189. };
  5190. var addElement = function (that, index) {
  5191. dP(that, index, {
  5192. get: function () {
  5193. return getter(this, index);
  5194. },
  5195. set: function (value) {
  5196. return setter(this, index, value);
  5197. },
  5198. enumerable: true
  5199. });
  5200. };
  5201. if (FORCED) {
  5202. TypedArray = wrapper(function (that, data, $offset, $length) {
  5203. anInstance(that, TypedArray, NAME, '_d');
  5204. var index = 0;
  5205. var offset = 0;
  5206. var buffer, byteLength, length, klass;
  5207. if (!isObject(data)) {
  5208. length = toIndex(data);
  5209. byteLength = length * BYTES;
  5210. buffer = new $ArrayBuffer(byteLength);
  5211. } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
  5212. buffer = data;
  5213. offset = toOffset($offset, BYTES);
  5214. var $len = data.byteLength;
  5215. if ($length === undefined) {
  5216. if ($len % BYTES) throw RangeError(WRONG_LENGTH);
  5217. byteLength = $len - offset;
  5218. if (byteLength < 0) throw RangeError(WRONG_LENGTH);
  5219. } else {
  5220. byteLength = toLength($length) * BYTES;
  5221. if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);
  5222. }
  5223. length = byteLength / BYTES;
  5224. } else if (TYPED_ARRAY in data) {
  5225. return fromList(TypedArray, data);
  5226. } else {
  5227. return $from.call(TypedArray, data);
  5228. }
  5229. hide(that, '_d', {
  5230. b: buffer,
  5231. o: offset,
  5232. l: byteLength,
  5233. e: length,
  5234. v: new $DataView(buffer)
  5235. });
  5236. while (index < length) addElement(that, index++);
  5237. });
  5238. TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);
  5239. hide(TypedArrayPrototype, 'constructor', TypedArray);
  5240. } else if (!fails(function () {
  5241. TypedArray(1);
  5242. }) || !fails(function () {
  5243. new TypedArray(-1); // eslint-disable-line no-new
  5244. }) || !$iterDetect(function (iter) {
  5245. new TypedArray(); // eslint-disable-line no-new
  5246. new TypedArray(null); // eslint-disable-line no-new
  5247. new TypedArray(1.5); // eslint-disable-line no-new
  5248. new TypedArray(iter); // eslint-disable-line no-new
  5249. }, true)) {
  5250. TypedArray = wrapper(function (that, data, $offset, $length) {
  5251. anInstance(that, TypedArray, NAME);
  5252. var klass;
  5253. // `ws` module bug, temporarily remove validation length for Uint8Array
  5254. // https://github.com/websockets/ws/pull/645
  5255. if (!isObject(data)) return new Base(toIndex(data));
  5256. if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
  5257. return $length !== undefined
  5258. ? new Base(data, toOffset($offset, BYTES), $length)
  5259. : $offset !== undefined
  5260. ? new Base(data, toOffset($offset, BYTES))
  5261. : new Base(data);
  5262. }
  5263. if (TYPED_ARRAY in data) return fromList(TypedArray, data);
  5264. return $from.call(TypedArray, data);
  5265. });
  5266. arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {
  5267. if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);
  5268. });
  5269. TypedArray[PROTOTYPE] = TypedArrayPrototype;
  5270. if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;
  5271. }
  5272. var $nativeIterator = TypedArrayPrototype[ITERATOR];
  5273. var CORRECT_ITER_NAME = !!$nativeIterator
  5274. && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);
  5275. var $iterator = $iterators.values;
  5276. hide(TypedArray, TYPED_CONSTRUCTOR, true);
  5277. hide(TypedArrayPrototype, TYPED_ARRAY, NAME);
  5278. hide(TypedArrayPrototype, VIEW, true);
  5279. hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);
  5280. if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {
  5281. dP(TypedArrayPrototype, TAG, {
  5282. get: function () { return NAME; }
  5283. });
  5284. }
  5285. O[NAME] = TypedArray;
  5286. $export($export.G + $export.W + $export.F * (TypedArray != Base), O);
  5287. $export($export.S, NAME, {
  5288. BYTES_PER_ELEMENT: BYTES
  5289. });
  5290. $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {
  5291. from: $from,
  5292. of: $of
  5293. });
  5294. if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);
  5295. $export($export.P, NAME, proto);
  5296. setSpecies(NAME);
  5297. $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });
  5298. $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);
  5299. if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;
  5300. $export($export.P + $export.F * fails(function () {
  5301. new TypedArray(1).slice();
  5302. }), NAME, { slice: $slice });
  5303. $export($export.P + $export.F * (fails(function () {
  5304. return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();
  5305. }) || !fails(function () {
  5306. TypedArrayPrototype.toLocaleString.call([1, 2]);
  5307. })), NAME, { toLocaleString: $toLocaleString });
  5308. Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;
  5309. if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);
  5310. };
  5311. } else module.exports = function () { /* empty */ };
  5312. /***/ }),
  5313. /* 231 */
  5314. /***/ (function(module, exports, __webpack_require__) {
  5315. __webpack_require__(230)('Uint8', 1, function (init) {
  5316. return function Uint8Array(data, byteOffset, length) {
  5317. return init(this, data, byteOffset, length);
  5318. };
  5319. });
  5320. /***/ }),
  5321. /* 232 */
  5322. /***/ (function(module, exports, __webpack_require__) {
  5323. __webpack_require__(230)('Uint8', 1, function (init) {
  5324. return function Uint8ClampedArray(data, byteOffset, length) {
  5325. return init(this, data, byteOffset, length);
  5326. };
  5327. }, true);
  5328. /***/ }),
  5329. /* 233 */
  5330. /***/ (function(module, exports, __webpack_require__) {
  5331. __webpack_require__(230)('Int16', 2, function (init) {
  5332. return function Int16Array(data, byteOffset, length) {
  5333. return init(this, data, byteOffset, length);
  5334. };
  5335. });
  5336. /***/ }),
  5337. /* 234 */
  5338. /***/ (function(module, exports, __webpack_require__) {
  5339. __webpack_require__(230)('Uint16', 2, function (init) {
  5340. return function Uint16Array(data, byteOffset, length) {
  5341. return init(this, data, byteOffset, length);
  5342. };
  5343. });
  5344. /***/ }),
  5345. /* 235 */
  5346. /***/ (function(module, exports, __webpack_require__) {
  5347. __webpack_require__(230)('Int32', 4, function (init) {
  5348. return function Int32Array(data, byteOffset, length) {
  5349. return init(this, data, byteOffset, length);
  5350. };
  5351. });
  5352. /***/ }),
  5353. /* 236 */
  5354. /***/ (function(module, exports, __webpack_require__) {
  5355. __webpack_require__(230)('Uint32', 4, function (init) {
  5356. return function Uint32Array(data, byteOffset, length) {
  5357. return init(this, data, byteOffset, length);
  5358. };
  5359. });
  5360. /***/ }),
  5361. /* 237 */
  5362. /***/ (function(module, exports, __webpack_require__) {
  5363. __webpack_require__(230)('Float32', 4, function (init) {
  5364. return function Float32Array(data, byteOffset, length) {
  5365. return init(this, data, byteOffset, length);
  5366. };
  5367. });
  5368. /***/ }),
  5369. /* 238 */
  5370. /***/ (function(module, exports, __webpack_require__) {
  5371. __webpack_require__(230)('Float64', 8, function (init) {
  5372. return function Float64Array(data, byteOffset, length) {
  5373. return init(this, data, byteOffset, length);
  5374. };
  5375. });
  5376. /***/ }),
  5377. /* 239 */
  5378. /***/ (function(module, exports, __webpack_require__) {
  5379. // 26.1.1 Reflect.apply(target, thisArgument, argumentsList)
  5380. var $export = __webpack_require__(8);
  5381. var aFunction = __webpack_require__(21);
  5382. var anObject = __webpack_require__(12);
  5383. var rApply = (__webpack_require__(4).Reflect || {}).apply;
  5384. var fApply = Function.apply;
  5385. // MS Edge argumentsList argument is optional
  5386. $export($export.S + $export.F * !__webpack_require__(7)(function () {
  5387. rApply(function () { /* empty */ });
  5388. }), 'Reflect', {
  5389. apply: function apply(target, thisArgument, argumentsList) {
  5390. var T = aFunction(target);
  5391. var L = anObject(argumentsList);
  5392. return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);
  5393. }
  5394. });
  5395. /***/ }),
  5396. /* 240 */
  5397. /***/ (function(module, exports, __webpack_require__) {
  5398. // 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
  5399. var $export = __webpack_require__(8);
  5400. var create = __webpack_require__(45);
  5401. var aFunction = __webpack_require__(21);
  5402. var anObject = __webpack_require__(12);
  5403. var isObject = __webpack_require__(13);
  5404. var fails = __webpack_require__(7);
  5405. var bind = __webpack_require__(76);
  5406. var rConstruct = (__webpack_require__(4).Reflect || {}).construct;
  5407. // MS Edge supports only 2 arguments and argumentsList argument is optional
  5408. // FF Nightly sets third argument as `new.target`, but does not create `this` from it
  5409. var NEW_TARGET_BUG = fails(function () {
  5410. function F() { /* empty */ }
  5411. return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);
  5412. });
  5413. var ARGS_BUG = !fails(function () {
  5414. rConstruct(function () { /* empty */ });
  5415. });
  5416. $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
  5417. construct: function construct(Target, args /* , newTarget */) {
  5418. aFunction(Target);
  5419. anObject(args);
  5420. var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
  5421. if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);
  5422. if (Target == newTarget) {
  5423. // w/o altered newTarget, optimization for 0-4 arguments
  5424. switch (args.length) {
  5425. case 0: return new Target();
  5426. case 1: return new Target(args[0]);
  5427. case 2: return new Target(args[0], args[1]);
  5428. case 3: return new Target(args[0], args[1], args[2]);
  5429. case 4: return new Target(args[0], args[1], args[2], args[3]);
  5430. }
  5431. // w/o altered newTarget, lot of arguments case
  5432. var $args = [null];
  5433. $args.push.apply($args, args);
  5434. return new (bind.apply(Target, $args))();
  5435. }
  5436. // with altered newTarget, not support built-in constructors
  5437. var proto = newTarget.prototype;
  5438. var instance = create(isObject(proto) ? proto : Object.prototype);
  5439. var result = Function.apply.call(Target, instance, args);
  5440. return isObject(result) ? result : instance;
  5441. }
  5442. });
  5443. /***/ }),
  5444. /* 241 */
  5445. /***/ (function(module, exports, __webpack_require__) {
  5446. // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)
  5447. var dP = __webpack_require__(11);
  5448. var $export = __webpack_require__(8);
  5449. var anObject = __webpack_require__(12);
  5450. var toPrimitive = __webpack_require__(16);
  5451. // MS Edge has broken Reflect.defineProperty - throwing instead of returning false
  5452. $export($export.S + $export.F * __webpack_require__(7)(function () {
  5453. // eslint-disable-next-line no-undef
  5454. Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });
  5455. }), 'Reflect', {
  5456. defineProperty: function defineProperty(target, propertyKey, attributes) {
  5457. anObject(target);
  5458. propertyKey = toPrimitive(propertyKey, true);
  5459. anObject(attributes);
  5460. try {
  5461. dP.f(target, propertyKey, attributes);
  5462. return true;
  5463. } catch (e) {
  5464. return false;
  5465. }
  5466. }
  5467. });
  5468. /***/ }),
  5469. /* 242 */
  5470. /***/ (function(module, exports, __webpack_require__) {
  5471. // 26.1.4 Reflect.deleteProperty(target, propertyKey)
  5472. var $export = __webpack_require__(8);
  5473. var gOPD = __webpack_require__(50).f;
  5474. var anObject = __webpack_require__(12);
  5475. $export($export.S, 'Reflect', {
  5476. deleteProperty: function deleteProperty(target, propertyKey) {
  5477. var desc = gOPD(anObject(target), propertyKey);
  5478. return desc && !desc.configurable ? false : delete target[propertyKey];
  5479. }
  5480. });
  5481. /***/ }),
  5482. /* 243 */
  5483. /***/ (function(module, exports, __webpack_require__) {
  5484. 'use strict';
  5485. // 26.1.5 Reflect.enumerate(target)
  5486. var $export = __webpack_require__(8);
  5487. var anObject = __webpack_require__(12);
  5488. var Enumerate = function (iterated) {
  5489. this._t = anObject(iterated); // target
  5490. this._i = 0; // next index
  5491. var keys = this._k = []; // keys
  5492. var key;
  5493. for (key in iterated) keys.push(key);
  5494. };
  5495. __webpack_require__(130)(Enumerate, 'Object', function () {
  5496. var that = this;
  5497. var keys = that._k;
  5498. var key;
  5499. do {
  5500. if (that._i >= keys.length) return { value: undefined, done: true };
  5501. } while (!((key = keys[that._i++]) in that._t));
  5502. return { value: key, done: false };
  5503. });
  5504. $export($export.S, 'Reflect', {
  5505. enumerate: function enumerate(target) {
  5506. return new Enumerate(target);
  5507. }
  5508. });
  5509. /***/ }),
  5510. /* 244 */
  5511. /***/ (function(module, exports, __webpack_require__) {
  5512. // 26.1.6 Reflect.get(target, propertyKey [, receiver])
  5513. var gOPD = __webpack_require__(50);
  5514. var getPrototypeOf = __webpack_require__(58);
  5515. var has = __webpack_require__(5);
  5516. var $export = __webpack_require__(8);
  5517. var isObject = __webpack_require__(13);
  5518. var anObject = __webpack_require__(12);
  5519. function get(target, propertyKey /* , receiver */) {
  5520. var receiver = arguments.length < 3 ? target : arguments[2];
  5521. var desc, proto;
  5522. if (anObject(target) === receiver) return target[propertyKey];
  5523. if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')
  5524. ? desc.value
  5525. : desc.get !== undefined
  5526. ? desc.get.call(receiver)
  5527. : undefined;
  5528. if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);
  5529. }
  5530. $export($export.S, 'Reflect', { get: get });
  5531. /***/ }),
  5532. /* 245 */
  5533. /***/ (function(module, exports, __webpack_require__) {
  5534. // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)
  5535. var gOPD = __webpack_require__(50);
  5536. var $export = __webpack_require__(8);
  5537. var anObject = __webpack_require__(12);
  5538. $export($export.S, 'Reflect', {
  5539. getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
  5540. return gOPD.f(anObject(target), propertyKey);
  5541. }
  5542. });
  5543. /***/ }),
  5544. /* 246 */
  5545. /***/ (function(module, exports, __webpack_require__) {
  5546. // 26.1.8 Reflect.getPrototypeOf(target)
  5547. var $export = __webpack_require__(8);
  5548. var getProto = __webpack_require__(58);
  5549. var anObject = __webpack_require__(12);
  5550. $export($export.S, 'Reflect', {
  5551. getPrototypeOf: function getPrototypeOf(target) {
  5552. return getProto(anObject(target));
  5553. }
  5554. });
  5555. /***/ }),
  5556. /* 247 */
  5557. /***/ (function(module, exports, __webpack_require__) {
  5558. // 26.1.9 Reflect.has(target, propertyKey)
  5559. var $export = __webpack_require__(8);
  5560. $export($export.S, 'Reflect', {
  5561. has: function has(target, propertyKey) {
  5562. return propertyKey in target;
  5563. }
  5564. });
  5565. /***/ }),
  5566. /* 248 */
  5567. /***/ (function(module, exports, __webpack_require__) {
  5568. // 26.1.10 Reflect.isExtensible(target)
  5569. var $export = __webpack_require__(8);
  5570. var anObject = __webpack_require__(12);
  5571. var $isExtensible = Object.isExtensible;
  5572. $export($export.S, 'Reflect', {
  5573. isExtensible: function isExtensible(target) {
  5574. anObject(target);
  5575. return $isExtensible ? $isExtensible(target) : true;
  5576. }
  5577. });
  5578. /***/ }),
  5579. /* 249 */
  5580. /***/ (function(module, exports, __webpack_require__) {
  5581. // 26.1.11 Reflect.ownKeys(target)
  5582. var $export = __webpack_require__(8);
  5583. $export($export.S, 'Reflect', { ownKeys: __webpack_require__(250) });
  5584. /***/ }),
  5585. /* 250 */
  5586. /***/ (function(module, exports, __webpack_require__) {
  5587. // all object keys, includes non-enumerable and symbols
  5588. var gOPN = __webpack_require__(49);
  5589. var gOPS = __webpack_require__(42);
  5590. var anObject = __webpack_require__(12);
  5591. var Reflect = __webpack_require__(4).Reflect;
  5592. module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {
  5593. var keys = gOPN.f(anObject(it));
  5594. var getSymbols = gOPS.f;
  5595. return getSymbols ? keys.concat(getSymbols(it)) : keys;
  5596. };
  5597. /***/ }),
  5598. /* 251 */
  5599. /***/ (function(module, exports, __webpack_require__) {
  5600. // 26.1.12 Reflect.preventExtensions(target)
  5601. var $export = __webpack_require__(8);
  5602. var anObject = __webpack_require__(12);
  5603. var $preventExtensions = Object.preventExtensions;
  5604. $export($export.S, 'Reflect', {
  5605. preventExtensions: function preventExtensions(target) {
  5606. anObject(target);
  5607. try {
  5608. if ($preventExtensions) $preventExtensions(target);
  5609. return true;
  5610. } catch (e) {
  5611. return false;
  5612. }
  5613. }
  5614. });
  5615. /***/ }),
  5616. /* 252 */
  5617. /***/ (function(module, exports, __webpack_require__) {
  5618. // 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
  5619. var dP = __webpack_require__(11);
  5620. var gOPD = __webpack_require__(50);
  5621. var getPrototypeOf = __webpack_require__(58);
  5622. var has = __webpack_require__(5);
  5623. var $export = __webpack_require__(8);
  5624. var createDesc = __webpack_require__(17);
  5625. var anObject = __webpack_require__(12);
  5626. var isObject = __webpack_require__(13);
  5627. function set(target, propertyKey, V /* , receiver */) {
  5628. var receiver = arguments.length < 4 ? target : arguments[3];
  5629. var ownDesc = gOPD.f(anObject(target), propertyKey);
  5630. var existingDescriptor, proto;
  5631. if (!ownDesc) {
  5632. if (isObject(proto = getPrototypeOf(target))) {
  5633. return set(proto, propertyKey, V, receiver);
  5634. }
  5635. ownDesc = createDesc(0);
  5636. }
  5637. if (has(ownDesc, 'value')) {
  5638. if (ownDesc.writable === false || !isObject(receiver)) return false;
  5639. if (existingDescriptor = gOPD.f(receiver, propertyKey)) {
  5640. if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
  5641. existingDescriptor.value = V;
  5642. dP.f(receiver, propertyKey, existingDescriptor);
  5643. } else dP.f(receiver, propertyKey, createDesc(0, V));
  5644. return true;
  5645. }
  5646. return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
  5647. }
  5648. $export($export.S, 'Reflect', { set: set });
  5649. /***/ }),
  5650. /* 253 */
  5651. /***/ (function(module, exports, __webpack_require__) {
  5652. // 26.1.14 Reflect.setPrototypeOf(target, proto)
  5653. var $export = __webpack_require__(8);
  5654. var setProto = __webpack_require__(72);
  5655. if (setProto) $export($export.S, 'Reflect', {
  5656. setPrototypeOf: function setPrototypeOf(target, proto) {
  5657. setProto.check(target, proto);
  5658. try {
  5659. setProto.set(target, proto);
  5660. return true;
  5661. } catch (e) {
  5662. return false;
  5663. }
  5664. }
  5665. });
  5666. /***/ }),
  5667. /* 254 */
  5668. /***/ (function(module, exports, __webpack_require__) {
  5669. 'use strict';
  5670. // https://github.com/tc39/Array.prototype.includes
  5671. var $export = __webpack_require__(8);
  5672. var $includes = __webpack_require__(36)(true);
  5673. $export($export.P, 'Array', {
  5674. includes: function includes(el /* , fromIndex = 0 */) {
  5675. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  5676. }
  5677. });
  5678. __webpack_require__(187)('includes');
  5679. /***/ }),
  5680. /* 255 */
  5681. /***/ (function(module, exports, __webpack_require__) {
  5682. 'use strict';
  5683. // https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap
  5684. var $export = __webpack_require__(8);
  5685. var flattenIntoArray = __webpack_require__(256);
  5686. var toObject = __webpack_require__(57);
  5687. var toLength = __webpack_require__(37);
  5688. var aFunction = __webpack_require__(21);
  5689. var arraySpeciesCreate = __webpack_require__(174);
  5690. $export($export.P, 'Array', {
  5691. flatMap: function flatMap(callbackfn /* , thisArg */) {
  5692. var O = toObject(this);
  5693. var sourceLen, A;
  5694. aFunction(callbackfn);
  5695. sourceLen = toLength(O.length);
  5696. A = arraySpeciesCreate(O, 0);
  5697. flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);
  5698. return A;
  5699. }
  5700. });
  5701. __webpack_require__(187)('flatMap');
  5702. /***/ }),
  5703. /* 256 */
  5704. /***/ (function(module, exports, __webpack_require__) {
  5705. 'use strict';
  5706. // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
  5707. var isArray = __webpack_require__(44);
  5708. var isObject = __webpack_require__(13);
  5709. var toLength = __webpack_require__(37);
  5710. var ctx = __webpack_require__(20);
  5711. var IS_CONCAT_SPREADABLE = __webpack_require__(26)('isConcatSpreadable');
  5712. function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {
  5713. var targetIndex = start;
  5714. var sourceIndex = 0;
  5715. var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;
  5716. var element, spreadable;
  5717. while (sourceIndex < sourceLen) {
  5718. if (sourceIndex in source) {
  5719. element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
  5720. spreadable = false;
  5721. if (isObject(element)) {
  5722. spreadable = element[IS_CONCAT_SPREADABLE];
  5723. spreadable = spreadable !== undefined ? !!spreadable : isArray(element);
  5724. }
  5725. if (spreadable && depth > 0) {
  5726. targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
  5727. } else {
  5728. if (targetIndex >= 0x1fffffffffffff) throw TypeError();
  5729. target[targetIndex] = element;
  5730. }
  5731. targetIndex++;
  5732. }
  5733. sourceIndex++;
  5734. }
  5735. return targetIndex;
  5736. }
  5737. module.exports = flattenIntoArray;
  5738. /***/ }),
  5739. /* 257 */
  5740. /***/ (function(module, exports, __webpack_require__) {
  5741. 'use strict';
  5742. // https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten
  5743. var $export = __webpack_require__(8);
  5744. var flattenIntoArray = __webpack_require__(256);
  5745. var toObject = __webpack_require__(57);
  5746. var toLength = __webpack_require__(37);
  5747. var toInteger = __webpack_require__(38);
  5748. var arraySpeciesCreate = __webpack_require__(174);
  5749. $export($export.P, 'Array', {
  5750. flatten: function flatten(/* depthArg = 1 */) {
  5751. var depthArg = arguments[0];
  5752. var O = toObject(this);
  5753. var sourceLen = toLength(O.length);
  5754. var A = arraySpeciesCreate(O, 0);
  5755. flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));
  5756. return A;
  5757. }
  5758. });
  5759. __webpack_require__(187)('flatten');
  5760. /***/ }),
  5761. /* 258 */
  5762. /***/ (function(module, exports, __webpack_require__) {
  5763. 'use strict';
  5764. // https://github.com/mathiasbynens/String.prototype.at
  5765. var $export = __webpack_require__(8);
  5766. var $at = __webpack_require__(127)(true);
  5767. $export($export.P, 'String', {
  5768. at: function at(pos) {
  5769. return $at(this, pos);
  5770. }
  5771. });
  5772. /***/ }),
  5773. /* 259 */
  5774. /***/ (function(module, exports, __webpack_require__) {
  5775. 'use strict';
  5776. // https://github.com/tc39/proposal-string-pad-start-end
  5777. var $export = __webpack_require__(8);
  5778. var $pad = __webpack_require__(260);
  5779. var userAgent = __webpack_require__(213);
  5780. // https://github.com/zloirock/core-js/issues/280
  5781. $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', {
  5782. padStart: function padStart(maxLength /* , fillString = ' ' */) {
  5783. return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
  5784. }
  5785. });
  5786. /***/ }),
  5787. /* 260 */
  5788. /***/ (function(module, exports, __webpack_require__) {
  5789. // https://github.com/tc39/proposal-string-pad-start-end
  5790. var toLength = __webpack_require__(37);
  5791. var repeat = __webpack_require__(90);
  5792. var defined = __webpack_require__(35);
  5793. module.exports = function (that, maxLength, fillString, left) {
  5794. var S = String(defined(that));
  5795. var stringLength = S.length;
  5796. var fillStr = fillString === undefined ? ' ' : String(fillString);
  5797. var intMaxLength = toLength(maxLength);
  5798. if (intMaxLength <= stringLength || fillStr == '') return S;
  5799. var fillLen = intMaxLength - stringLength;
  5800. var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
  5801. if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
  5802. return left ? stringFiller + S : S + stringFiller;
  5803. };
  5804. /***/ }),
  5805. /* 261 */
  5806. /***/ (function(module, exports, __webpack_require__) {
  5807. 'use strict';
  5808. // https://github.com/tc39/proposal-string-pad-start-end
  5809. var $export = __webpack_require__(8);
  5810. var $pad = __webpack_require__(260);
  5811. var userAgent = __webpack_require__(213);
  5812. // https://github.com/zloirock/core-js/issues/280
  5813. $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', {
  5814. padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
  5815. return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
  5816. }
  5817. });
  5818. /***/ }),
  5819. /* 262 */
  5820. /***/ (function(module, exports, __webpack_require__) {
  5821. 'use strict';
  5822. // https://github.com/sebmarkbage/ecmascript-string-left-right-trim
  5823. __webpack_require__(82)('trimLeft', function ($trim) {
  5824. return function trimLeft() {
  5825. return $trim(this, 1);
  5826. };
  5827. }, 'trimStart');
  5828. /***/ }),
  5829. /* 263 */
  5830. /***/ (function(module, exports, __webpack_require__) {
  5831. 'use strict';
  5832. // https://github.com/sebmarkbage/ecmascript-string-left-right-trim
  5833. __webpack_require__(82)('trimRight', function ($trim) {
  5834. return function trimRight() {
  5835. return $trim(this, 2);
  5836. };
  5837. }, 'trimEnd');
  5838. /***/ }),
  5839. /* 264 */
  5840. /***/ (function(module, exports, __webpack_require__) {
  5841. 'use strict';
  5842. // https://tc39.github.io/String.prototype.matchAll/
  5843. var $export = __webpack_require__(8);
  5844. var defined = __webpack_require__(35);
  5845. var toLength = __webpack_require__(37);
  5846. var isRegExp = __webpack_require__(134);
  5847. var getFlags = __webpack_require__(197);
  5848. var RegExpProto = RegExp.prototype;
  5849. var $RegExpStringIterator = function (regexp, string) {
  5850. this._r = regexp;
  5851. this._s = string;
  5852. };
  5853. __webpack_require__(130)($RegExpStringIterator, 'RegExp String', function next() {
  5854. var match = this._r.exec(this._s);
  5855. return { value: match, done: match === null };
  5856. });
  5857. $export($export.P, 'String', {
  5858. matchAll: function matchAll(regexp) {
  5859. defined(this);
  5860. if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!');
  5861. var S = String(this);
  5862. var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp);
  5863. var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);
  5864. rx.lastIndex = toLength(regexp.lastIndex);
  5865. return new $RegExpStringIterator(rx, S);
  5866. }
  5867. });
  5868. /***/ }),
  5869. /* 265 */
  5870. /***/ (function(module, exports, __webpack_require__) {
  5871. __webpack_require__(28)('asyncIterator');
  5872. /***/ }),
  5873. /* 266 */
  5874. /***/ (function(module, exports, __webpack_require__) {
  5875. __webpack_require__(28)('observable');
  5876. /***/ }),
  5877. /* 267 */
  5878. /***/ (function(module, exports, __webpack_require__) {
  5879. // https://github.com/tc39/proposal-object-getownpropertydescriptors
  5880. var $export = __webpack_require__(8);
  5881. var ownKeys = __webpack_require__(250);
  5882. var toIObject = __webpack_require__(32);
  5883. var gOPD = __webpack_require__(50);
  5884. var createProperty = __webpack_require__(164);
  5885. $export($export.S, 'Object', {
  5886. getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
  5887. var O = toIObject(object);
  5888. var getDesc = gOPD.f;
  5889. var keys = ownKeys(O);
  5890. var result = {};
  5891. var i = 0;
  5892. var key, desc;
  5893. while (keys.length > i) {
  5894. desc = getDesc(O, key = keys[i++]);
  5895. if (desc !== undefined) createProperty(result, key, desc);
  5896. }
  5897. return result;
  5898. }
  5899. });
  5900. /***/ }),
  5901. /* 268 */
  5902. /***/ (function(module, exports, __webpack_require__) {
  5903. // https://github.com/tc39/proposal-object-values-entries
  5904. var $export = __webpack_require__(8);
  5905. var $values = __webpack_require__(269)(false);
  5906. $export($export.S, 'Object', {
  5907. values: function values(it) {
  5908. return $values(it);
  5909. }
  5910. });
  5911. /***/ }),
  5912. /* 269 */
  5913. /***/ (function(module, exports, __webpack_require__) {
  5914. var getKeys = __webpack_require__(30);
  5915. var toIObject = __webpack_require__(32);
  5916. var isEnum = __webpack_require__(43).f;
  5917. module.exports = function (isEntries) {
  5918. return function (it) {
  5919. var O = toIObject(it);
  5920. var keys = getKeys(O);
  5921. var length = keys.length;
  5922. var i = 0;
  5923. var result = [];
  5924. var key;
  5925. while (length > i) if (isEnum.call(O, key = keys[i++])) {
  5926. result.push(isEntries ? [key, O[key]] : O[key]);
  5927. } return result;
  5928. };
  5929. };
  5930. /***/ }),
  5931. /* 270 */
  5932. /***/ (function(module, exports, __webpack_require__) {
  5933. // https://github.com/tc39/proposal-object-values-entries
  5934. var $export = __webpack_require__(8);
  5935. var $entries = __webpack_require__(269)(true);
  5936. $export($export.S, 'Object', {
  5937. entries: function entries(it) {
  5938. return $entries(it);
  5939. }
  5940. });
  5941. /***/ }),
  5942. /* 271 */
  5943. /***/ (function(module, exports, __webpack_require__) {
  5944. 'use strict';
  5945. var $export = __webpack_require__(8);
  5946. var toObject = __webpack_require__(57);
  5947. var aFunction = __webpack_require__(21);
  5948. var $defineProperty = __webpack_require__(11);
  5949. // B.2.2.2 Object.prototype.__defineGetter__(P, getter)
  5950. __webpack_require__(6) && $export($export.P + __webpack_require__(272), 'Object', {
  5951. __defineGetter__: function __defineGetter__(P, getter) {
  5952. $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });
  5953. }
  5954. });
  5955. /***/ }),
  5956. /* 272 */
  5957. /***/ (function(module, exports, __webpack_require__) {
  5958. 'use strict';
  5959. // Forced replacement prototype accessors methods
  5960. module.exports = __webpack_require__(24) || !__webpack_require__(7)(function () {
  5961. var K = Math.random();
  5962. // In FF throws only define methods
  5963. // eslint-disable-next-line no-undef, no-useless-call
  5964. __defineSetter__.call(null, K, function () { /* empty */ });
  5965. delete __webpack_require__(4)[K];
  5966. });
  5967. /***/ }),
  5968. /* 273 */
  5969. /***/ (function(module, exports, __webpack_require__) {
  5970. 'use strict';
  5971. var $export = __webpack_require__(8);
  5972. var toObject = __webpack_require__(57);
  5973. var aFunction = __webpack_require__(21);
  5974. var $defineProperty = __webpack_require__(11);
  5975. // B.2.2.3 Object.prototype.__defineSetter__(P, setter)
  5976. __webpack_require__(6) && $export($export.P + __webpack_require__(272), 'Object', {
  5977. __defineSetter__: function __defineSetter__(P, setter) {
  5978. $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });
  5979. }
  5980. });
  5981. /***/ }),
  5982. /* 274 */
  5983. /***/ (function(module, exports, __webpack_require__) {
  5984. 'use strict';
  5985. var $export = __webpack_require__(8);
  5986. var toObject = __webpack_require__(57);
  5987. var toPrimitive = __webpack_require__(16);
  5988. var getPrototypeOf = __webpack_require__(58);
  5989. var getOwnPropertyDescriptor = __webpack_require__(50).f;
  5990. // B.2.2.4 Object.prototype.__lookupGetter__(P)
  5991. __webpack_require__(6) && $export($export.P + __webpack_require__(272), 'Object', {
  5992. __lookupGetter__: function __lookupGetter__(P) {
  5993. var O = toObject(this);
  5994. var K = toPrimitive(P, true);
  5995. var D;
  5996. do {
  5997. if (D = getOwnPropertyDescriptor(O, K)) return D.get;
  5998. } while (O = getPrototypeOf(O));
  5999. }
  6000. });
  6001. /***/ }),
  6002. /* 275 */
  6003. /***/ (function(module, exports, __webpack_require__) {
  6004. 'use strict';
  6005. var $export = __webpack_require__(8);
  6006. var toObject = __webpack_require__(57);
  6007. var toPrimitive = __webpack_require__(16);
  6008. var getPrototypeOf = __webpack_require__(58);
  6009. var getOwnPropertyDescriptor = __webpack_require__(50).f;
  6010. // B.2.2.5 Object.prototype.__lookupSetter__(P)
  6011. __webpack_require__(6) && $export($export.P + __webpack_require__(272), 'Object', {
  6012. __lookupSetter__: function __lookupSetter__(P) {
  6013. var O = toObject(this);
  6014. var K = toPrimitive(P, true);
  6015. var D;
  6016. do {
  6017. if (D = getOwnPropertyDescriptor(O, K)) return D.set;
  6018. } while (O = getPrototypeOf(O));
  6019. }
  6020. });
  6021. /***/ }),
  6022. /* 276 */
  6023. /***/ (function(module, exports, __webpack_require__) {
  6024. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  6025. var $export = __webpack_require__(8);
  6026. $export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(277)('Map') });
  6027. /***/ }),
  6028. /* 277 */
  6029. /***/ (function(module, exports, __webpack_require__) {
  6030. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  6031. var classof = __webpack_require__(74);
  6032. var from = __webpack_require__(278);
  6033. module.exports = function (NAME) {
  6034. return function toJSON() {
  6035. if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
  6036. return from(this);
  6037. };
  6038. };
  6039. /***/ }),
  6040. /* 278 */
  6041. /***/ (function(module, exports, __webpack_require__) {
  6042. var forOf = __webpack_require__(207);
  6043. module.exports = function (iter, ITERATOR) {
  6044. var result = [];
  6045. forOf(iter, false, result.push, result, ITERATOR);
  6046. return result;
  6047. };
  6048. /***/ }),
  6049. /* 279 */
  6050. /***/ (function(module, exports, __webpack_require__) {
  6051. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  6052. var $export = __webpack_require__(8);
  6053. $export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(277)('Set') });
  6054. /***/ }),
  6055. /* 280 */
  6056. /***/ (function(module, exports, __webpack_require__) {
  6057. // https://tc39.github.io/proposal-setmap-offrom/#sec-map.of
  6058. __webpack_require__(281)('Map');
  6059. /***/ }),
  6060. /* 281 */
  6061. /***/ (function(module, exports, __webpack_require__) {
  6062. 'use strict';
  6063. // https://tc39.github.io/proposal-setmap-offrom/
  6064. var $export = __webpack_require__(8);
  6065. module.exports = function (COLLECTION) {
  6066. $export($export.S, COLLECTION, { of: function of() {
  6067. var length = arguments.length;
  6068. var A = new Array(length);
  6069. while (length--) A[length] = arguments[length];
  6070. return new this(A);
  6071. } });
  6072. };
  6073. /***/ }),
  6074. /* 282 */
  6075. /***/ (function(module, exports, __webpack_require__) {
  6076. // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of
  6077. __webpack_require__(281)('Set');
  6078. /***/ }),
  6079. /* 283 */
  6080. /***/ (function(module, exports, __webpack_require__) {
  6081. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of
  6082. __webpack_require__(281)('WeakMap');
  6083. /***/ }),
  6084. /* 284 */
  6085. /***/ (function(module, exports, __webpack_require__) {
  6086. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of
  6087. __webpack_require__(281)('WeakSet');
  6088. /***/ }),
  6089. /* 285 */
  6090. /***/ (function(module, exports, __webpack_require__) {
  6091. // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from
  6092. __webpack_require__(286)('Map');
  6093. /***/ }),
  6094. /* 286 */
  6095. /***/ (function(module, exports, __webpack_require__) {
  6096. 'use strict';
  6097. // https://tc39.github.io/proposal-setmap-offrom/
  6098. var $export = __webpack_require__(8);
  6099. var aFunction = __webpack_require__(21);
  6100. var ctx = __webpack_require__(20);
  6101. var forOf = __webpack_require__(207);
  6102. module.exports = function (COLLECTION) {
  6103. $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
  6104. var mapFn = arguments[1];
  6105. var mapping, A, n, cb;
  6106. aFunction(this);
  6107. mapping = mapFn !== undefined;
  6108. if (mapping) aFunction(mapFn);
  6109. if (source == undefined) return new this();
  6110. A = [];
  6111. if (mapping) {
  6112. n = 0;
  6113. cb = ctx(mapFn, arguments[2], 2);
  6114. forOf(source, false, function (nextItem) {
  6115. A.push(cb(nextItem, n++));
  6116. });
  6117. } else {
  6118. forOf(source, false, A.push, A);
  6119. }
  6120. return new this(A);
  6121. } });
  6122. };
  6123. /***/ }),
  6124. /* 287 */
  6125. /***/ (function(module, exports, __webpack_require__) {
  6126. // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from
  6127. __webpack_require__(286)('Set');
  6128. /***/ }),
  6129. /* 288 */
  6130. /***/ (function(module, exports, __webpack_require__) {
  6131. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from
  6132. __webpack_require__(286)('WeakMap');
  6133. /***/ }),
  6134. /* 289 */
  6135. /***/ (function(module, exports, __webpack_require__) {
  6136. // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from
  6137. __webpack_require__(286)('WeakSet');
  6138. /***/ }),
  6139. /* 290 */
  6140. /***/ (function(module, exports, __webpack_require__) {
  6141. // https://github.com/tc39/proposal-global
  6142. var $export = __webpack_require__(8);
  6143. $export($export.G, { global: __webpack_require__(4) });
  6144. /***/ }),
  6145. /* 291 */
  6146. /***/ (function(module, exports, __webpack_require__) {
  6147. // https://github.com/tc39/proposal-global
  6148. var $export = __webpack_require__(8);
  6149. $export($export.S, 'System', { global: __webpack_require__(4) });
  6150. /***/ }),
  6151. /* 292 */
  6152. /***/ (function(module, exports, __webpack_require__) {
  6153. // https://github.com/ljharb/proposal-is-error
  6154. var $export = __webpack_require__(8);
  6155. var cof = __webpack_require__(34);
  6156. $export($export.S, 'Error', {
  6157. isError: function isError(it) {
  6158. return cof(it) === 'Error';
  6159. }
  6160. });
  6161. /***/ }),
  6162. /* 293 */
  6163. /***/ (function(module, exports, __webpack_require__) {
  6164. // https://rwaldron.github.io/proposal-math-extensions/
  6165. var $export = __webpack_require__(8);
  6166. $export($export.S, 'Math', {
  6167. clamp: function clamp(x, lower, upper) {
  6168. return Math.min(upper, Math.max(lower, x));
  6169. }
  6170. });
  6171. /***/ }),
  6172. /* 294 */
  6173. /***/ (function(module, exports, __webpack_require__) {
  6174. // https://rwaldron.github.io/proposal-math-extensions/
  6175. var $export = __webpack_require__(8);
  6176. $export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 });
  6177. /***/ }),
  6178. /* 295 */
  6179. /***/ (function(module, exports, __webpack_require__) {
  6180. // https://rwaldron.github.io/proposal-math-extensions/
  6181. var $export = __webpack_require__(8);
  6182. var RAD_PER_DEG = 180 / Math.PI;
  6183. $export($export.S, 'Math', {
  6184. degrees: function degrees(radians) {
  6185. return radians * RAD_PER_DEG;
  6186. }
  6187. });
  6188. /***/ }),
  6189. /* 296 */
  6190. /***/ (function(module, exports, __webpack_require__) {
  6191. // https://rwaldron.github.io/proposal-math-extensions/
  6192. var $export = __webpack_require__(8);
  6193. var scale = __webpack_require__(297);
  6194. var fround = __webpack_require__(113);
  6195. $export($export.S, 'Math', {
  6196. fscale: function fscale(x, inLow, inHigh, outLow, outHigh) {
  6197. return fround(scale(x, inLow, inHigh, outLow, outHigh));
  6198. }
  6199. });
  6200. /***/ }),
  6201. /* 297 */
  6202. /***/ (function(module, exports) {
  6203. // https://rwaldron.github.io/proposal-math-extensions/
  6204. module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {
  6205. if (
  6206. arguments.length === 0
  6207. // eslint-disable-next-line no-self-compare
  6208. || x != x
  6209. // eslint-disable-next-line no-self-compare
  6210. || inLow != inLow
  6211. // eslint-disable-next-line no-self-compare
  6212. || inHigh != inHigh
  6213. // eslint-disable-next-line no-self-compare
  6214. || outLow != outLow
  6215. // eslint-disable-next-line no-self-compare
  6216. || outHigh != outHigh
  6217. ) return NaN;
  6218. if (x === Infinity || x === -Infinity) return x;
  6219. return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;
  6220. };
  6221. /***/ }),
  6222. /* 298 */
  6223. /***/ (function(module, exports, __webpack_require__) {
  6224. // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
  6225. var $export = __webpack_require__(8);
  6226. $export($export.S, 'Math', {
  6227. iaddh: function iaddh(x0, x1, y0, y1) {
  6228. var $x0 = x0 >>> 0;
  6229. var $x1 = x1 >>> 0;
  6230. var $y0 = y0 >>> 0;
  6231. return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;
  6232. }
  6233. });
  6234. /***/ }),
  6235. /* 299 */
  6236. /***/ (function(module, exports, __webpack_require__) {
  6237. // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
  6238. var $export = __webpack_require__(8);
  6239. $export($export.S, 'Math', {
  6240. isubh: function isubh(x0, x1, y0, y1) {
  6241. var $x0 = x0 >>> 0;
  6242. var $x1 = x1 >>> 0;
  6243. var $y0 = y0 >>> 0;
  6244. return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;
  6245. }
  6246. });
  6247. /***/ }),
  6248. /* 300 */
  6249. /***/ (function(module, exports, __webpack_require__) {
  6250. // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
  6251. var $export = __webpack_require__(8);
  6252. $export($export.S, 'Math', {
  6253. imulh: function imulh(u, v) {
  6254. var UINT16 = 0xffff;
  6255. var $u = +u;
  6256. var $v = +v;
  6257. var u0 = $u & UINT16;
  6258. var v0 = $v & UINT16;
  6259. var u1 = $u >> 16;
  6260. var v1 = $v >> 16;
  6261. var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
  6262. return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);
  6263. }
  6264. });
  6265. /***/ }),
  6266. /* 301 */
  6267. /***/ (function(module, exports, __webpack_require__) {
  6268. // https://rwaldron.github.io/proposal-math-extensions/
  6269. var $export = __webpack_require__(8);
  6270. $export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI });
  6271. /***/ }),
  6272. /* 302 */
  6273. /***/ (function(module, exports, __webpack_require__) {
  6274. // https://rwaldron.github.io/proposal-math-extensions/
  6275. var $export = __webpack_require__(8);
  6276. var DEG_PER_RAD = Math.PI / 180;
  6277. $export($export.S, 'Math', {
  6278. radians: function radians(degrees) {
  6279. return degrees * DEG_PER_RAD;
  6280. }
  6281. });
  6282. /***/ }),
  6283. /* 303 */
  6284. /***/ (function(module, exports, __webpack_require__) {
  6285. // https://rwaldron.github.io/proposal-math-extensions/
  6286. var $export = __webpack_require__(8);
  6287. $export($export.S, 'Math', { scale: __webpack_require__(297) });
  6288. /***/ }),
  6289. /* 304 */
  6290. /***/ (function(module, exports, __webpack_require__) {
  6291. // https://gist.github.com/BrendanEich/4294d5c212a6d2254703
  6292. var $export = __webpack_require__(8);
  6293. $export($export.S, 'Math', {
  6294. umulh: function umulh(u, v) {
  6295. var UINT16 = 0xffff;
  6296. var $u = +u;
  6297. var $v = +v;
  6298. var u0 = $u & UINT16;
  6299. var v0 = $v & UINT16;
  6300. var u1 = $u >>> 16;
  6301. var v1 = $v >>> 16;
  6302. var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
  6303. return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);
  6304. }
  6305. });
  6306. /***/ }),
  6307. /* 305 */
  6308. /***/ (function(module, exports, __webpack_require__) {
  6309. // http://jfbastien.github.io/papers/Math.signbit.html
  6310. var $export = __webpack_require__(8);
  6311. $export($export.S, 'Math', { signbit: function signbit(x) {
  6312. // eslint-disable-next-line no-self-compare
  6313. return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0;
  6314. } });
  6315. /***/ }),
  6316. /* 306 */
  6317. /***/ (function(module, exports, __webpack_require__) {
  6318. // https://github.com/tc39/proposal-promise-finally
  6319. 'use strict';
  6320. var $export = __webpack_require__(8);
  6321. var core = __webpack_require__(9);
  6322. var global = __webpack_require__(4);
  6323. var speciesConstructor = __webpack_require__(208);
  6324. var promiseResolve = __webpack_require__(214);
  6325. $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
  6326. var C = speciesConstructor(this, core.Promise || global.Promise);
  6327. var isFunction = typeof onFinally == 'function';
  6328. return this.then(
  6329. isFunction ? function (x) {
  6330. return promiseResolve(C, onFinally()).then(function () { return x; });
  6331. } : onFinally,
  6332. isFunction ? function (e) {
  6333. return promiseResolve(C, onFinally()).then(function () { throw e; });
  6334. } : onFinally
  6335. );
  6336. } });
  6337. /***/ }),
  6338. /* 307 */
  6339. /***/ (function(module, exports, __webpack_require__) {
  6340. 'use strict';
  6341. // https://github.com/tc39/proposal-promise-try
  6342. var $export = __webpack_require__(8);
  6343. var newPromiseCapability = __webpack_require__(211);
  6344. var perform = __webpack_require__(212);
  6345. $export($export.S, 'Promise', { 'try': function (callbackfn) {
  6346. var promiseCapability = newPromiseCapability.f(this);
  6347. var result = perform(callbackfn);
  6348. (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
  6349. return promiseCapability.promise;
  6350. } });
  6351. /***/ }),
  6352. /* 308 */
  6353. /***/ (function(module, exports, __webpack_require__) {
  6354. var metadata = __webpack_require__(309);
  6355. var anObject = __webpack_require__(12);
  6356. var toMetaKey = metadata.key;
  6357. var ordinaryDefineOwnMetadata = metadata.set;
  6358. metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) {
  6359. ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));
  6360. } });
  6361. /***/ }),
  6362. /* 309 */
  6363. /***/ (function(module, exports, __webpack_require__) {
  6364. var Map = __webpack_require__(216);
  6365. var $export = __webpack_require__(8);
  6366. var shared = __webpack_require__(23)('metadata');
  6367. var store = shared.store || (shared.store = new (__webpack_require__(221))());
  6368. var getOrCreateMetadataMap = function (target, targetKey, create) {
  6369. var targetMetadata = store.get(target);
  6370. if (!targetMetadata) {
  6371. if (!create) return undefined;
  6372. store.set(target, targetMetadata = new Map());
  6373. }
  6374. var keyMetadata = targetMetadata.get(targetKey);
  6375. if (!keyMetadata) {
  6376. if (!create) return undefined;
  6377. targetMetadata.set(targetKey, keyMetadata = new Map());
  6378. } return keyMetadata;
  6379. };
  6380. var ordinaryHasOwnMetadata = function (MetadataKey, O, P) {
  6381. var metadataMap = getOrCreateMetadataMap(O, P, false);
  6382. return metadataMap === undefined ? false : metadataMap.has(MetadataKey);
  6383. };
  6384. var ordinaryGetOwnMetadata = function (MetadataKey, O, P) {
  6385. var metadataMap = getOrCreateMetadataMap(O, P, false);
  6386. return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);
  6387. };
  6388. var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {
  6389. getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);
  6390. };
  6391. var ordinaryOwnMetadataKeys = function (target, targetKey) {
  6392. var metadataMap = getOrCreateMetadataMap(target, targetKey, false);
  6393. var keys = [];
  6394. if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });
  6395. return keys;
  6396. };
  6397. var toMetaKey = function (it) {
  6398. return it === undefined || typeof it == 'symbol' ? it : String(it);
  6399. };
  6400. var exp = function (O) {
  6401. $export($export.S, 'Reflect', O);
  6402. };
  6403. module.exports = {
  6404. store: store,
  6405. map: getOrCreateMetadataMap,
  6406. has: ordinaryHasOwnMetadata,
  6407. get: ordinaryGetOwnMetadata,
  6408. set: ordinaryDefineOwnMetadata,
  6409. keys: ordinaryOwnMetadataKeys,
  6410. key: toMetaKey,
  6411. exp: exp
  6412. };
  6413. /***/ }),
  6414. /* 310 */
  6415. /***/ (function(module, exports, __webpack_require__) {
  6416. var metadata = __webpack_require__(309);
  6417. var anObject = __webpack_require__(12);
  6418. var toMetaKey = metadata.key;
  6419. var getOrCreateMetadataMap = metadata.map;
  6420. var store = metadata.store;
  6421. metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) {
  6422. var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]);
  6423. var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);
  6424. if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false;
  6425. if (metadataMap.size) return true;
  6426. var targetMetadata = store.get(target);
  6427. targetMetadata['delete'](targetKey);
  6428. return !!targetMetadata.size || store['delete'](target);
  6429. } });
  6430. /***/ }),
  6431. /* 311 */
  6432. /***/ (function(module, exports, __webpack_require__) {
  6433. var metadata = __webpack_require__(309);
  6434. var anObject = __webpack_require__(12);
  6435. var getPrototypeOf = __webpack_require__(58);
  6436. var ordinaryHasOwnMetadata = metadata.has;
  6437. var ordinaryGetOwnMetadata = metadata.get;
  6438. var toMetaKey = metadata.key;
  6439. var ordinaryGetMetadata = function (MetadataKey, O, P) {
  6440. var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
  6441. if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P);
  6442. var parent = getPrototypeOf(O);
  6443. return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;
  6444. };
  6445. metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {
  6446. return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
  6447. } });
  6448. /***/ }),
  6449. /* 312 */
  6450. /***/ (function(module, exports, __webpack_require__) {
  6451. var Set = __webpack_require__(220);
  6452. var from = __webpack_require__(278);
  6453. var metadata = __webpack_require__(309);
  6454. var anObject = __webpack_require__(12);
  6455. var getPrototypeOf = __webpack_require__(58);
  6456. var ordinaryOwnMetadataKeys = metadata.keys;
  6457. var toMetaKey = metadata.key;
  6458. var ordinaryMetadataKeys = function (O, P) {
  6459. var oKeys = ordinaryOwnMetadataKeys(O, P);
  6460. var parent = getPrototypeOf(O);
  6461. if (parent === null) return oKeys;
  6462. var pKeys = ordinaryMetadataKeys(parent, P);
  6463. return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;
  6464. };
  6465. metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {
  6466. return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
  6467. } });
  6468. /***/ }),
  6469. /* 313 */
  6470. /***/ (function(module, exports, __webpack_require__) {
  6471. var metadata = __webpack_require__(309);
  6472. var anObject = __webpack_require__(12);
  6473. var ordinaryGetOwnMetadata = metadata.get;
  6474. var toMetaKey = metadata.key;
  6475. metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) {
  6476. return ordinaryGetOwnMetadata(metadataKey, anObject(target)
  6477. , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
  6478. } });
  6479. /***/ }),
  6480. /* 314 */
  6481. /***/ (function(module, exports, __webpack_require__) {
  6482. var metadata = __webpack_require__(309);
  6483. var anObject = __webpack_require__(12);
  6484. var ordinaryOwnMetadataKeys = metadata.keys;
  6485. var toMetaKey = metadata.key;
  6486. metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) {
  6487. return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
  6488. } });
  6489. /***/ }),
  6490. /* 315 */
  6491. /***/ (function(module, exports, __webpack_require__) {
  6492. var metadata = __webpack_require__(309);
  6493. var anObject = __webpack_require__(12);
  6494. var getPrototypeOf = __webpack_require__(58);
  6495. var ordinaryHasOwnMetadata = metadata.has;
  6496. var toMetaKey = metadata.key;
  6497. var ordinaryHasMetadata = function (MetadataKey, O, P) {
  6498. var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
  6499. if (hasOwn) return true;
  6500. var parent = getPrototypeOf(O);
  6501. return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;
  6502. };
  6503. metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) {
  6504. return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
  6505. } });
  6506. /***/ }),
  6507. /* 316 */
  6508. /***/ (function(module, exports, __webpack_require__) {
  6509. var metadata = __webpack_require__(309);
  6510. var anObject = __webpack_require__(12);
  6511. var ordinaryHasOwnMetadata = metadata.has;
  6512. var toMetaKey = metadata.key;
  6513. metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) {
  6514. return ordinaryHasOwnMetadata(metadataKey, anObject(target)
  6515. , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
  6516. } });
  6517. /***/ }),
  6518. /* 317 */
  6519. /***/ (function(module, exports, __webpack_require__) {
  6520. var $metadata = __webpack_require__(309);
  6521. var anObject = __webpack_require__(12);
  6522. var aFunction = __webpack_require__(21);
  6523. var toMetaKey = $metadata.key;
  6524. var ordinaryDefineOwnMetadata = $metadata.set;
  6525. $metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {
  6526. return function decorator(target, targetKey) {
  6527. ordinaryDefineOwnMetadata(
  6528. metadataKey, metadataValue,
  6529. (targetKey !== undefined ? anObject : aFunction)(target),
  6530. toMetaKey(targetKey)
  6531. );
  6532. };
  6533. } });
  6534. /***/ }),
  6535. /* 318 */
  6536. /***/ (function(module, exports, __webpack_require__) {
  6537. // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask
  6538. var $export = __webpack_require__(8);
  6539. var microtask = __webpack_require__(210)();
  6540. var process = __webpack_require__(4).process;
  6541. var isNode = __webpack_require__(34)(process) == 'process';
  6542. $export($export.G, {
  6543. asap: function asap(fn) {
  6544. var domain = isNode && process.domain;
  6545. microtask(domain ? domain.bind(fn) : fn);
  6546. }
  6547. });
  6548. /***/ }),
  6549. /* 319 */
  6550. /***/ (function(module, exports, __webpack_require__) {
  6551. 'use strict';
  6552. // https://github.com/zenparsing/es-observable
  6553. var $export = __webpack_require__(8);
  6554. var global = __webpack_require__(4);
  6555. var core = __webpack_require__(9);
  6556. var microtask = __webpack_require__(210)();
  6557. var OBSERVABLE = __webpack_require__(26)('observable');
  6558. var aFunction = __webpack_require__(21);
  6559. var anObject = __webpack_require__(12);
  6560. var anInstance = __webpack_require__(206);
  6561. var redefineAll = __webpack_require__(215);
  6562. var hide = __webpack_require__(10);
  6563. var forOf = __webpack_require__(207);
  6564. var RETURN = forOf.RETURN;
  6565. var getMethod = function (fn) {
  6566. return fn == null ? undefined : aFunction(fn);
  6567. };
  6568. var cleanupSubscription = function (subscription) {
  6569. var cleanup = subscription._c;
  6570. if (cleanup) {
  6571. subscription._c = undefined;
  6572. cleanup();
  6573. }
  6574. };
  6575. var subscriptionClosed = function (subscription) {
  6576. return subscription._o === undefined;
  6577. };
  6578. var closeSubscription = function (subscription) {
  6579. if (!subscriptionClosed(subscription)) {
  6580. subscription._o = undefined;
  6581. cleanupSubscription(subscription);
  6582. }
  6583. };
  6584. var Subscription = function (observer, subscriber) {
  6585. anObject(observer);
  6586. this._c = undefined;
  6587. this._o = observer;
  6588. observer = new SubscriptionObserver(this);
  6589. try {
  6590. var cleanup = subscriber(observer);
  6591. var subscription = cleanup;
  6592. if (cleanup != null) {
  6593. if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); };
  6594. else aFunction(cleanup);
  6595. this._c = cleanup;
  6596. }
  6597. } catch (e) {
  6598. observer.error(e);
  6599. return;
  6600. } if (subscriptionClosed(this)) cleanupSubscription(this);
  6601. };
  6602. Subscription.prototype = redefineAll({}, {
  6603. unsubscribe: function unsubscribe() { closeSubscription(this); }
  6604. });
  6605. var SubscriptionObserver = function (subscription) {
  6606. this._s = subscription;
  6607. };
  6608. SubscriptionObserver.prototype = redefineAll({}, {
  6609. next: function next(value) {
  6610. var subscription = this._s;
  6611. if (!subscriptionClosed(subscription)) {
  6612. var observer = subscription._o;
  6613. try {
  6614. var m = getMethod(observer.next);
  6615. if (m) return m.call(observer, value);
  6616. } catch (e) {
  6617. try {
  6618. closeSubscription(subscription);
  6619. } finally {
  6620. throw e;
  6621. }
  6622. }
  6623. }
  6624. },
  6625. error: function error(value) {
  6626. var subscription = this._s;
  6627. if (subscriptionClosed(subscription)) throw value;
  6628. var observer = subscription._o;
  6629. subscription._o = undefined;
  6630. try {
  6631. var m = getMethod(observer.error);
  6632. if (!m) throw value;
  6633. value = m.call(observer, value);
  6634. } catch (e) {
  6635. try {
  6636. cleanupSubscription(subscription);
  6637. } finally {
  6638. throw e;
  6639. }
  6640. } cleanupSubscription(subscription);
  6641. return value;
  6642. },
  6643. complete: function complete(value) {
  6644. var subscription = this._s;
  6645. if (!subscriptionClosed(subscription)) {
  6646. var observer = subscription._o;
  6647. subscription._o = undefined;
  6648. try {
  6649. var m = getMethod(observer.complete);
  6650. value = m ? m.call(observer, value) : undefined;
  6651. } catch (e) {
  6652. try {
  6653. cleanupSubscription(subscription);
  6654. } finally {
  6655. throw e;
  6656. }
  6657. } cleanupSubscription(subscription);
  6658. return value;
  6659. }
  6660. }
  6661. });
  6662. var $Observable = function Observable(subscriber) {
  6663. anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);
  6664. };
  6665. redefineAll($Observable.prototype, {
  6666. subscribe: function subscribe(observer) {
  6667. return new Subscription(observer, this._f);
  6668. },
  6669. forEach: function forEach(fn) {
  6670. var that = this;
  6671. return new (core.Promise || global.Promise)(function (resolve, reject) {
  6672. aFunction(fn);
  6673. var subscription = that.subscribe({
  6674. next: function (value) {
  6675. try {
  6676. return fn(value);
  6677. } catch (e) {
  6678. reject(e);
  6679. subscription.unsubscribe();
  6680. }
  6681. },
  6682. error: reject,
  6683. complete: resolve
  6684. });
  6685. });
  6686. }
  6687. });
  6688. redefineAll($Observable, {
  6689. from: function from(x) {
  6690. var C = typeof this === 'function' ? this : $Observable;
  6691. var method = getMethod(anObject(x)[OBSERVABLE]);
  6692. if (method) {
  6693. var observable = anObject(method.call(x));
  6694. return observable.constructor === C ? observable : new C(function (observer) {
  6695. return observable.subscribe(observer);
  6696. });
  6697. }
  6698. return new C(function (observer) {
  6699. var done = false;
  6700. microtask(function () {
  6701. if (!done) {
  6702. try {
  6703. if (forOf(x, false, function (it) {
  6704. observer.next(it);
  6705. if (done) return RETURN;
  6706. }) === RETURN) return;
  6707. } catch (e) {
  6708. if (done) throw e;
  6709. observer.error(e);
  6710. return;
  6711. } observer.complete();
  6712. }
  6713. });
  6714. return function () { done = true; };
  6715. });
  6716. },
  6717. of: function of() {
  6718. for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++];
  6719. return new (typeof this === 'function' ? this : $Observable)(function (observer) {
  6720. var done = false;
  6721. microtask(function () {
  6722. if (!done) {
  6723. for (var j = 0; j < items.length; ++j) {
  6724. observer.next(items[j]);
  6725. if (done) return;
  6726. } observer.complete();
  6727. }
  6728. });
  6729. return function () { done = true; };
  6730. });
  6731. }
  6732. });
  6733. hide($Observable.prototype, OBSERVABLE, function () { return this; });
  6734. $export($export.G, { Observable: $Observable });
  6735. __webpack_require__(193)('Observable');
  6736. /***/ }),
  6737. /* 320 */
  6738. /***/ (function(module, exports, __webpack_require__) {
  6739. // ie9- setTimeout & setInterval additional parameters fix
  6740. var global = __webpack_require__(4);
  6741. var $export = __webpack_require__(8);
  6742. var userAgent = __webpack_require__(213);
  6743. var slice = [].slice;
  6744. var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check
  6745. var wrap = function (set) {
  6746. return function (fn, time /* , ...args */) {
  6747. var boundArgs = arguments.length > 2;
  6748. var args = boundArgs ? slice.call(arguments, 2) : false;
  6749. return set(boundArgs ? function () {
  6750. // eslint-disable-next-line no-new-func
  6751. (typeof fn == 'function' ? fn : Function(fn)).apply(this, args);
  6752. } : fn, time);
  6753. };
  6754. };
  6755. $export($export.G + $export.B + $export.F * MSIE, {
  6756. setTimeout: wrap(global.setTimeout),
  6757. setInterval: wrap(global.setInterval)
  6758. });
  6759. /***/ }),
  6760. /* 321 */
  6761. /***/ (function(module, exports, __webpack_require__) {
  6762. var $export = __webpack_require__(8);
  6763. var $task = __webpack_require__(209);
  6764. $export($export.G + $export.B, {
  6765. setImmediate: $task.set,
  6766. clearImmediate: $task.clear
  6767. });
  6768. /***/ }),
  6769. /* 322 */
  6770. /***/ (function(module, exports, __webpack_require__) {
  6771. var $iterators = __webpack_require__(194);
  6772. var getKeys = __webpack_require__(30);
  6773. var redefine = __webpack_require__(18);
  6774. var global = __webpack_require__(4);
  6775. var hide = __webpack_require__(10);
  6776. var Iterators = __webpack_require__(129);
  6777. var wks = __webpack_require__(26);
  6778. var ITERATOR = wks('iterator');
  6779. var TO_STRING_TAG = wks('toStringTag');
  6780. var ArrayValues = Iterators.Array;
  6781. var DOMIterables = {
  6782. CSSRuleList: true, // TODO: Not spec compliant, should be false.
  6783. CSSStyleDeclaration: false,
  6784. CSSValueList: false,
  6785. ClientRectList: false,
  6786. DOMRectList: false,
  6787. DOMStringList: false,
  6788. DOMTokenList: true,
  6789. DataTransferItemList: false,
  6790. FileList: false,
  6791. HTMLAllCollection: false,
  6792. HTMLCollection: false,
  6793. HTMLFormElement: false,
  6794. HTMLSelectElement: false,
  6795. MediaList: true, // TODO: Not spec compliant, should be false.
  6796. MimeTypeArray: false,
  6797. NamedNodeMap: false,
  6798. NodeList: true,
  6799. PaintRequestList: false,
  6800. Plugin: false,
  6801. PluginArray: false,
  6802. SVGLengthList: false,
  6803. SVGNumberList: false,
  6804. SVGPathSegList: false,
  6805. SVGPointList: false,
  6806. SVGStringList: false,
  6807. SVGTransformList: false,
  6808. SourceBufferList: false,
  6809. StyleSheetList: true, // TODO: Not spec compliant, should be false.
  6810. TextTrackCueList: false,
  6811. TextTrackList: false,
  6812. TouchList: false
  6813. };
  6814. for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
  6815. var NAME = collections[i];
  6816. var explicit = DOMIterables[NAME];
  6817. var Collection = global[NAME];
  6818. var proto = Collection && Collection.prototype;
  6819. var key;
  6820. if (proto) {
  6821. if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
  6822. if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
  6823. Iterators[NAME] = ArrayValues;
  6824. if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
  6825. }
  6826. }
  6827. /***/ }),
  6828. /* 323 */
  6829. /***/ (function(module, exports) {
  6830. /* WEBPACK VAR INJECTION */(function(global) {/**
  6831. * Copyright (c) 2014, Facebook, Inc.
  6832. * All rights reserved.
  6833. *
  6834. * This source code is licensed under the BSD-style license found in the
  6835. * https://raw.github.com/facebook/regenerator/master/LICENSE file. An
  6836. * additional grant of patent rights can be found in the PATENTS file in
  6837. * the same directory.
  6838. */
  6839. !(function(global) {
  6840. "use strict";
  6841. var Op = Object.prototype;
  6842. var hasOwn = Op.hasOwnProperty;
  6843. var undefined; // More compressible than void 0.
  6844. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  6845. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  6846. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  6847. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  6848. var inModule = typeof module === "object";
  6849. var runtime = global.regeneratorRuntime;
  6850. if (runtime) {
  6851. if (inModule) {
  6852. // If regeneratorRuntime is defined globally and we're in a module,
  6853. // make the exports object identical to regeneratorRuntime.
  6854. module.exports = runtime;
  6855. }
  6856. // Don't bother evaluating the rest of this file if the runtime was
  6857. // already defined globally.
  6858. return;
  6859. }
  6860. // Define the runtime globally (as expected by generated code) as either
  6861. // module.exports (if we're in a module) or a new, empty object.
  6862. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  6863. function wrap(innerFn, outerFn, self, tryLocsList) {
  6864. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  6865. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  6866. var generator = Object.create(protoGenerator.prototype);
  6867. var context = new Context(tryLocsList || []);
  6868. // The ._invoke method unifies the implementations of the .next,
  6869. // .throw, and .return methods.
  6870. generator._invoke = makeInvokeMethod(innerFn, self, context);
  6871. return generator;
  6872. }
  6873. runtime.wrap = wrap;
  6874. // Try/catch helper to minimize deoptimizations. Returns a completion
  6875. // record like context.tryEntries[i].completion. This interface could
  6876. // have been (and was previously) designed to take a closure to be
  6877. // invoked without arguments, but in all the cases we care about we
  6878. // already have an existing method we want to call, so there's no need
  6879. // to create a new function object. We can even get away with assuming
  6880. // the method takes exactly one argument, since that happens to be true
  6881. // in every case, so we don't have to touch the arguments object. The
  6882. // only additional allocation required is the completion record, which
  6883. // has a stable shape and so hopefully should be cheap to allocate.
  6884. function tryCatch(fn, obj, arg) {
  6885. try {
  6886. return { type: "normal", arg: fn.call(obj, arg) };
  6887. } catch (err) {
  6888. return { type: "throw", arg: err };
  6889. }
  6890. }
  6891. var GenStateSuspendedStart = "suspendedStart";
  6892. var GenStateSuspendedYield = "suspendedYield";
  6893. var GenStateExecuting = "executing";
  6894. var GenStateCompleted = "completed";
  6895. // Returning this object from the innerFn has the same effect as
  6896. // breaking out of the dispatch switch statement.
  6897. var ContinueSentinel = {};
  6898. // Dummy constructor functions that we use as the .constructor and
  6899. // .constructor.prototype properties for functions that return Generator
  6900. // objects. For full spec compliance, you may wish to configure your
  6901. // minifier not to mangle the names of these two functions.
  6902. function Generator() {}
  6903. function GeneratorFunction() {}
  6904. function GeneratorFunctionPrototype() {}
  6905. // This is a polyfill for %IteratorPrototype% for environments that
  6906. // don't natively support it.
  6907. var IteratorPrototype = {};
  6908. IteratorPrototype[iteratorSymbol] = function () {
  6909. return this;
  6910. };
  6911. var getProto = Object.getPrototypeOf;
  6912. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  6913. if (NativeIteratorPrototype &&
  6914. NativeIteratorPrototype !== Op &&
  6915. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  6916. // This environment has a native %IteratorPrototype%; use it instead
  6917. // of the polyfill.
  6918. IteratorPrototype = NativeIteratorPrototype;
  6919. }
  6920. var Gp = GeneratorFunctionPrototype.prototype =
  6921. Generator.prototype = Object.create(IteratorPrototype);
  6922. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  6923. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  6924. GeneratorFunctionPrototype[toStringTagSymbol] =
  6925. GeneratorFunction.displayName = "GeneratorFunction";
  6926. // Helper for defining the .next, .throw, and .return methods of the
  6927. // Iterator interface in terms of a single ._invoke method.
  6928. function defineIteratorMethods(prototype) {
  6929. ["next", "throw", "return"].forEach(function(method) {
  6930. prototype[method] = function(arg) {
  6931. return this._invoke(method, arg);
  6932. };
  6933. });
  6934. }
  6935. runtime.isGeneratorFunction = function(genFun) {
  6936. var ctor = typeof genFun === "function" && genFun.constructor;
  6937. return ctor
  6938. ? ctor === GeneratorFunction ||
  6939. // For the native GeneratorFunction constructor, the best we can
  6940. // do is to check its .name property.
  6941. (ctor.displayName || ctor.name) === "GeneratorFunction"
  6942. : false;
  6943. };
  6944. runtime.mark = function(genFun) {
  6945. if (Object.setPrototypeOf) {
  6946. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  6947. } else {
  6948. genFun.__proto__ = GeneratorFunctionPrototype;
  6949. if (!(toStringTagSymbol in genFun)) {
  6950. genFun[toStringTagSymbol] = "GeneratorFunction";
  6951. }
  6952. }
  6953. genFun.prototype = Object.create(Gp);
  6954. return genFun;
  6955. };
  6956. // Within the body of any async function, `await x` is transformed to
  6957. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  6958. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  6959. // meant to be awaited.
  6960. runtime.awrap = function(arg) {
  6961. return { __await: arg };
  6962. };
  6963. function AsyncIterator(generator) {
  6964. function invoke(method, arg, resolve, reject) {
  6965. var record = tryCatch(generator[method], generator, arg);
  6966. if (record.type === "throw") {
  6967. reject(record.arg);
  6968. } else {
  6969. var result = record.arg;
  6970. var value = result.value;
  6971. if (value &&
  6972. typeof value === "object" &&
  6973. hasOwn.call(value, "__await")) {
  6974. return Promise.resolve(value.__await).then(function(value) {
  6975. invoke("next", value, resolve, reject);
  6976. }, function(err) {
  6977. invoke("throw", err, resolve, reject);
  6978. });
  6979. }
  6980. return Promise.resolve(value).then(function(unwrapped) {
  6981. // When a yielded Promise is resolved, its final value becomes
  6982. // the .value of the Promise<{value,done}> result for the
  6983. // current iteration. If the Promise is rejected, however, the
  6984. // result for this iteration will be rejected with the same
  6985. // reason. Note that rejections of yielded Promises are not
  6986. // thrown back into the generator function, as is the case
  6987. // when an awaited Promise is rejected. This difference in
  6988. // behavior between yield and await is important, because it
  6989. // allows the consumer to decide what to do with the yielded
  6990. // rejection (swallow it and continue, manually .throw it back
  6991. // into the generator, abandon iteration, whatever). With
  6992. // await, by contrast, there is no opportunity to examine the
  6993. // rejection reason outside the generator function, so the
  6994. // only option is to throw it from the await expression, and
  6995. // let the generator function handle the exception.
  6996. result.value = unwrapped;
  6997. resolve(result);
  6998. }, reject);
  6999. }
  7000. }
  7001. if (typeof global.process === "object" && global.process.domain) {
  7002. invoke = global.process.domain.bind(invoke);
  7003. }
  7004. var previousPromise;
  7005. function enqueue(method, arg) {
  7006. function callInvokeWithMethodAndArg() {
  7007. return new Promise(function(resolve, reject) {
  7008. invoke(method, arg, resolve, reject);
  7009. });
  7010. }
  7011. return previousPromise =
  7012. // If enqueue has been called before, then we want to wait until
  7013. // all previous Promises have been resolved before calling invoke,
  7014. // so that results are always delivered in the correct order. If
  7015. // enqueue has not been called before, then it is important to
  7016. // call invoke immediately, without waiting on a callback to fire,
  7017. // so that the async generator function has the opportunity to do
  7018. // any necessary setup in a predictable way. This predictability
  7019. // is why the Promise constructor synchronously invokes its
  7020. // executor callback, and why async functions synchronously
  7021. // execute code before the first await. Since we implement simple
  7022. // async functions in terms of async generators, it is especially
  7023. // important to get this right, even though it requires care.
  7024. previousPromise ? previousPromise.then(
  7025. callInvokeWithMethodAndArg,
  7026. // Avoid propagating failures to Promises returned by later
  7027. // invocations of the iterator.
  7028. callInvokeWithMethodAndArg
  7029. ) : callInvokeWithMethodAndArg();
  7030. }
  7031. // Define the unified helper method that is used to implement .next,
  7032. // .throw, and .return (see defineIteratorMethods).
  7033. this._invoke = enqueue;
  7034. }
  7035. defineIteratorMethods(AsyncIterator.prototype);
  7036. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  7037. return this;
  7038. };
  7039. runtime.AsyncIterator = AsyncIterator;
  7040. // Note that simple async functions are implemented on top of
  7041. // AsyncIterator objects; they just return a Promise for the value of
  7042. // the final result produced by the iterator.
  7043. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  7044. var iter = new AsyncIterator(
  7045. wrap(innerFn, outerFn, self, tryLocsList)
  7046. );
  7047. return runtime.isGeneratorFunction(outerFn)
  7048. ? iter // If outerFn is a generator, return the full iterator.
  7049. : iter.next().then(function(result) {
  7050. return result.done ? result.value : iter.next();
  7051. });
  7052. };
  7053. function makeInvokeMethod(innerFn, self, context) {
  7054. var state = GenStateSuspendedStart;
  7055. return function invoke(method, arg) {
  7056. if (state === GenStateExecuting) {
  7057. throw new Error("Generator is already running");
  7058. }
  7059. if (state === GenStateCompleted) {
  7060. if (method === "throw") {
  7061. throw arg;
  7062. }
  7063. // Be forgiving, per 25.3.3.3.3 of the spec:
  7064. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  7065. return doneResult();
  7066. }
  7067. context.method = method;
  7068. context.arg = arg;
  7069. while (true) {
  7070. var delegate = context.delegate;
  7071. if (delegate) {
  7072. var delegateResult = maybeInvokeDelegate(delegate, context);
  7073. if (delegateResult) {
  7074. if (delegateResult === ContinueSentinel) continue;
  7075. return delegateResult;
  7076. }
  7077. }
  7078. if (context.method === "next") {
  7079. // Setting context._sent for legacy support of Babel's
  7080. // function.sent implementation.
  7081. context.sent = context._sent = context.arg;
  7082. } else if (context.method === "throw") {
  7083. if (state === GenStateSuspendedStart) {
  7084. state = GenStateCompleted;
  7085. throw context.arg;
  7086. }
  7087. context.dispatchException(context.arg);
  7088. } else if (context.method === "return") {
  7089. context.abrupt("return", context.arg);
  7090. }
  7091. state = GenStateExecuting;
  7092. var record = tryCatch(innerFn, self, context);
  7093. if (record.type === "normal") {
  7094. // If an exception is thrown from innerFn, we leave state ===
  7095. // GenStateExecuting and loop back for another invocation.
  7096. state = context.done
  7097. ? GenStateCompleted
  7098. : GenStateSuspendedYield;
  7099. if (record.arg === ContinueSentinel) {
  7100. continue;
  7101. }
  7102. return {
  7103. value: record.arg,
  7104. done: context.done
  7105. };
  7106. } else if (record.type === "throw") {
  7107. state = GenStateCompleted;
  7108. // Dispatch the exception by looping back around to the
  7109. // context.dispatchException(context.arg) call above.
  7110. context.method = "throw";
  7111. context.arg = record.arg;
  7112. }
  7113. }
  7114. };
  7115. }
  7116. // Call delegate.iterator[context.method](context.arg) and handle the
  7117. // result, either by returning a { value, done } result from the
  7118. // delegate iterator, or by modifying context.method and context.arg,
  7119. // setting context.delegate to null, and returning the ContinueSentinel.
  7120. function maybeInvokeDelegate(delegate, context) {
  7121. var method = delegate.iterator[context.method];
  7122. if (method === undefined) {
  7123. // A .throw or .return when the delegate iterator has no .throw
  7124. // method always terminates the yield* loop.
  7125. context.delegate = null;
  7126. if (context.method === "throw") {
  7127. if (delegate.iterator.return) {
  7128. // If the delegate iterator has a return method, give it a
  7129. // chance to clean up.
  7130. context.method = "return";
  7131. context.arg = undefined;
  7132. maybeInvokeDelegate(delegate, context);
  7133. if (context.method === "throw") {
  7134. // If maybeInvokeDelegate(context) changed context.method from
  7135. // "return" to "throw", let that override the TypeError below.
  7136. return ContinueSentinel;
  7137. }
  7138. }
  7139. context.method = "throw";
  7140. context.arg = new TypeError(
  7141. "The iterator does not provide a 'throw' method");
  7142. }
  7143. return ContinueSentinel;
  7144. }
  7145. var record = tryCatch(method, delegate.iterator, context.arg);
  7146. if (record.type === "throw") {
  7147. context.method = "throw";
  7148. context.arg = record.arg;
  7149. context.delegate = null;
  7150. return ContinueSentinel;
  7151. }
  7152. var info = record.arg;
  7153. if (! info) {
  7154. context.method = "throw";
  7155. context.arg = new TypeError("iterator result is not an object");
  7156. context.delegate = null;
  7157. return ContinueSentinel;
  7158. }
  7159. if (info.done) {
  7160. // Assign the result of the finished delegate to the temporary
  7161. // variable specified by delegate.resultName (see delegateYield).
  7162. context[delegate.resultName] = info.value;
  7163. // Resume execution at the desired location (see delegateYield).
  7164. context.next = delegate.nextLoc;
  7165. // If context.method was "throw" but the delegate handled the
  7166. // exception, let the outer generator proceed normally. If
  7167. // context.method was "next", forget context.arg since it has been
  7168. // "consumed" by the delegate iterator. If context.method was
  7169. // "return", allow the original .return call to continue in the
  7170. // outer generator.
  7171. if (context.method !== "return") {
  7172. context.method = "next";
  7173. context.arg = undefined;
  7174. }
  7175. } else {
  7176. // Re-yield the result returned by the delegate method.
  7177. return info;
  7178. }
  7179. // The delegate iterator is finished, so forget it and continue with
  7180. // the outer generator.
  7181. context.delegate = null;
  7182. return ContinueSentinel;
  7183. }
  7184. // Define Generator.prototype.{next,throw,return} in terms of the
  7185. // unified ._invoke helper method.
  7186. defineIteratorMethods(Gp);
  7187. Gp[toStringTagSymbol] = "Generator";
  7188. // A Generator should always return itself as the iterator object when the
  7189. // @@iterator function is called on it. Some browsers' implementations of the
  7190. // iterator prototype chain incorrectly implement this, causing the Generator
  7191. // object to not be returned from this call. This ensures that doesn't happen.
  7192. // See https://github.com/facebook/regenerator/issues/274 for more details.
  7193. Gp[iteratorSymbol] = function() {
  7194. return this;
  7195. };
  7196. Gp.toString = function() {
  7197. return "[object Generator]";
  7198. };
  7199. function pushTryEntry(locs) {
  7200. var entry = { tryLoc: locs[0] };
  7201. if (1 in locs) {
  7202. entry.catchLoc = locs[1];
  7203. }
  7204. if (2 in locs) {
  7205. entry.finallyLoc = locs[2];
  7206. entry.afterLoc = locs[3];
  7207. }
  7208. this.tryEntries.push(entry);
  7209. }
  7210. function resetTryEntry(entry) {
  7211. var record = entry.completion || {};
  7212. record.type = "normal";
  7213. delete record.arg;
  7214. entry.completion = record;
  7215. }
  7216. function Context(tryLocsList) {
  7217. // The root entry object (effectively a try statement without a catch
  7218. // or a finally block) gives us a place to store values thrown from
  7219. // locations where there is no enclosing try statement.
  7220. this.tryEntries = [{ tryLoc: "root" }];
  7221. tryLocsList.forEach(pushTryEntry, this);
  7222. this.reset(true);
  7223. }
  7224. runtime.keys = function(object) {
  7225. var keys = [];
  7226. for (var key in object) {
  7227. keys.push(key);
  7228. }
  7229. keys.reverse();
  7230. // Rather than returning an object with a next method, we keep
  7231. // things simple and return the next function itself.
  7232. return function next() {
  7233. while (keys.length) {
  7234. var key = keys.pop();
  7235. if (key in object) {
  7236. next.value = key;
  7237. next.done = false;
  7238. return next;
  7239. }
  7240. }
  7241. // To avoid creating an additional object, we just hang the .value
  7242. // and .done properties off the next function object itself. This
  7243. // also ensures that the minifier will not anonymize the function.
  7244. next.done = true;
  7245. return next;
  7246. };
  7247. };
  7248. function values(iterable) {
  7249. if (iterable) {
  7250. var iteratorMethod = iterable[iteratorSymbol];
  7251. if (iteratorMethod) {
  7252. return iteratorMethod.call(iterable);
  7253. }
  7254. if (typeof iterable.next === "function") {
  7255. return iterable;
  7256. }
  7257. if (!isNaN(iterable.length)) {
  7258. var i = -1, next = function next() {
  7259. while (++i < iterable.length) {
  7260. if (hasOwn.call(iterable, i)) {
  7261. next.value = iterable[i];
  7262. next.done = false;
  7263. return next;
  7264. }
  7265. }
  7266. next.value = undefined;
  7267. next.done = true;
  7268. return next;
  7269. };
  7270. return next.next = next;
  7271. }
  7272. }
  7273. // Return an iterator with no values.
  7274. return { next: doneResult };
  7275. }
  7276. runtime.values = values;
  7277. function doneResult() {
  7278. return { value: undefined, done: true };
  7279. }
  7280. Context.prototype = {
  7281. constructor: Context,
  7282. reset: function(skipTempReset) {
  7283. this.prev = 0;
  7284. this.next = 0;
  7285. // Resetting context._sent for legacy support of Babel's
  7286. // function.sent implementation.
  7287. this.sent = this._sent = undefined;
  7288. this.done = false;
  7289. this.delegate = null;
  7290. this.method = "next";
  7291. this.arg = undefined;
  7292. this.tryEntries.forEach(resetTryEntry);
  7293. if (!skipTempReset) {
  7294. for (var name in this) {
  7295. // Not sure about the optimal order of these conditions:
  7296. if (name.charAt(0) === "t" &&
  7297. hasOwn.call(this, name) &&
  7298. !isNaN(+name.slice(1))) {
  7299. this[name] = undefined;
  7300. }
  7301. }
  7302. }
  7303. },
  7304. stop: function() {
  7305. this.done = true;
  7306. var rootEntry = this.tryEntries[0];
  7307. var rootRecord = rootEntry.completion;
  7308. if (rootRecord.type === "throw") {
  7309. throw rootRecord.arg;
  7310. }
  7311. return this.rval;
  7312. },
  7313. dispatchException: function(exception) {
  7314. if (this.done) {
  7315. throw exception;
  7316. }
  7317. var context = this;
  7318. function handle(loc, caught) {
  7319. record.type = "throw";
  7320. record.arg = exception;
  7321. context.next = loc;
  7322. if (caught) {
  7323. // If the dispatched exception was caught by a catch block,
  7324. // then let that catch block handle the exception normally.
  7325. context.method = "next";
  7326. context.arg = undefined;
  7327. }
  7328. return !! caught;
  7329. }
  7330. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7331. var entry = this.tryEntries[i];
  7332. var record = entry.completion;
  7333. if (entry.tryLoc === "root") {
  7334. // Exception thrown outside of any try block that could handle
  7335. // it, so set the completion value of the entire function to
  7336. // throw the exception.
  7337. return handle("end");
  7338. }
  7339. if (entry.tryLoc <= this.prev) {
  7340. var hasCatch = hasOwn.call(entry, "catchLoc");
  7341. var hasFinally = hasOwn.call(entry, "finallyLoc");
  7342. if (hasCatch && hasFinally) {
  7343. if (this.prev < entry.catchLoc) {
  7344. return handle(entry.catchLoc, true);
  7345. } else if (this.prev < entry.finallyLoc) {
  7346. return handle(entry.finallyLoc);
  7347. }
  7348. } else if (hasCatch) {
  7349. if (this.prev < entry.catchLoc) {
  7350. return handle(entry.catchLoc, true);
  7351. }
  7352. } else if (hasFinally) {
  7353. if (this.prev < entry.finallyLoc) {
  7354. return handle(entry.finallyLoc);
  7355. }
  7356. } else {
  7357. throw new Error("try statement without catch or finally");
  7358. }
  7359. }
  7360. }
  7361. },
  7362. abrupt: function(type, arg) {
  7363. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7364. var entry = this.tryEntries[i];
  7365. if (entry.tryLoc <= this.prev &&
  7366. hasOwn.call(entry, "finallyLoc") &&
  7367. this.prev < entry.finallyLoc) {
  7368. var finallyEntry = entry;
  7369. break;
  7370. }
  7371. }
  7372. if (finallyEntry &&
  7373. (type === "break" ||
  7374. type === "continue") &&
  7375. finallyEntry.tryLoc <= arg &&
  7376. arg <= finallyEntry.finallyLoc) {
  7377. // Ignore the finally entry if control is not jumping to a
  7378. // location outside the try/catch block.
  7379. finallyEntry = null;
  7380. }
  7381. var record = finallyEntry ? finallyEntry.completion : {};
  7382. record.type = type;
  7383. record.arg = arg;
  7384. if (finallyEntry) {
  7385. this.method = "next";
  7386. this.next = finallyEntry.finallyLoc;
  7387. return ContinueSentinel;
  7388. }
  7389. return this.complete(record);
  7390. },
  7391. complete: function(record, afterLoc) {
  7392. if (record.type === "throw") {
  7393. throw record.arg;
  7394. }
  7395. if (record.type === "break" ||
  7396. record.type === "continue") {
  7397. this.next = record.arg;
  7398. } else if (record.type === "return") {
  7399. this.rval = this.arg = record.arg;
  7400. this.method = "return";
  7401. this.next = "end";
  7402. } else if (record.type === "normal" && afterLoc) {
  7403. this.next = afterLoc;
  7404. }
  7405. return ContinueSentinel;
  7406. },
  7407. finish: function(finallyLoc) {
  7408. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7409. var entry = this.tryEntries[i];
  7410. if (entry.finallyLoc === finallyLoc) {
  7411. this.complete(entry.completion, entry.afterLoc);
  7412. resetTryEntry(entry);
  7413. return ContinueSentinel;
  7414. }
  7415. }
  7416. },
  7417. "catch": function(tryLoc) {
  7418. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  7419. var entry = this.tryEntries[i];
  7420. if (entry.tryLoc === tryLoc) {
  7421. var record = entry.completion;
  7422. if (record.type === "throw") {
  7423. var thrown = record.arg;
  7424. resetTryEntry(entry);
  7425. }
  7426. return thrown;
  7427. }
  7428. }
  7429. // The context.catch method must only be called with a location
  7430. // argument that corresponds to a known catch block.
  7431. throw new Error("illegal catch attempt");
  7432. },
  7433. delegateYield: function(iterable, resultName, nextLoc) {
  7434. this.delegate = {
  7435. iterator: values(iterable),
  7436. resultName: resultName,
  7437. nextLoc: nextLoc
  7438. };
  7439. if (this.method === "next") {
  7440. // Deliberately forget the last sent value so that we don't
  7441. // accidentally pass it on to the delegate.
  7442. this.arg = undefined;
  7443. }
  7444. return ContinueSentinel;
  7445. }
  7446. };
  7447. })(
  7448. // Among the various tricks for obtaining a reference to the global
  7449. // object, this seems to be the most reliable technique that does not
  7450. // use indirect eval (which violates Content Security Policy).
  7451. typeof global === "object" ? global :
  7452. typeof window === "object" ? window :
  7453. typeof self === "object" ? self : this
  7454. );
  7455. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  7456. /***/ }),
  7457. /* 324 */
  7458. /***/ (function(module, exports, __webpack_require__) {
  7459. __webpack_require__(325);
  7460. module.exports = __webpack_require__(9).RegExp.escape;
  7461. /***/ }),
  7462. /* 325 */
  7463. /***/ (function(module, exports, __webpack_require__) {
  7464. // https://github.com/benjamingr/RexExp.escape
  7465. var $export = __webpack_require__(8);
  7466. var $re = __webpack_require__(326)(/[\\^$*+?.()|[\]{}]/g, '\\$&');
  7467. $export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } });
  7468. /***/ }),
  7469. /* 326 */
  7470. /***/ (function(module, exports) {
  7471. module.exports = function (regExp, replace) {
  7472. var replacer = replace === Object(replace) ? function (part) {
  7473. return replace[part];
  7474. } : replace;
  7475. return function (it) {
  7476. return String(it).replace(regExp, replacer);
  7477. };
  7478. };
  7479. /***/ }),
  7480. /* 327 */
  7481. /***/ (function(module, exports, __webpack_require__) {
  7482. var BSON = __webpack_require__(328),
  7483. Binary = __webpack_require__(350),
  7484. Code = __webpack_require__(345),
  7485. DBRef = __webpack_require__(349),
  7486. Decimal128 = __webpack_require__(346),
  7487. Double = __webpack_require__(335),
  7488. Int32 = __webpack_require__(344),
  7489. Long = __webpack_require__(334),
  7490. Map = __webpack_require__(333),
  7491. MaxKey = __webpack_require__(348),
  7492. MinKey = __webpack_require__(347),
  7493. ObjectId = __webpack_require__(337),
  7494. BSONRegExp = __webpack_require__(342),
  7495. Symbol = __webpack_require__(343),
  7496. Timestamp = __webpack_require__(336);
  7497. // BSON MAX VALUES
  7498. BSON.BSON_INT32_MAX = 0x7fffffff;
  7499. BSON.BSON_INT32_MIN = -0x80000000;
  7500. BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
  7501. BSON.BSON_INT64_MIN = -Math.pow(2, 63);
  7502. // JS MAX PRECISE VALUES
  7503. BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
  7504. BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
  7505. // Add BSON types to function creation
  7506. BSON.Binary = Binary;
  7507. BSON.Code = Code;
  7508. BSON.DBRef = DBRef;
  7509. BSON.Decimal128 = Decimal128;
  7510. BSON.Double = Double;
  7511. BSON.Int32 = Int32;
  7512. BSON.Long = Long;
  7513. BSON.Map = Map;
  7514. BSON.MaxKey = MaxKey;
  7515. BSON.MinKey = MinKey;
  7516. BSON.ObjectId = ObjectId;
  7517. BSON.ObjectID = ObjectId;
  7518. BSON.BSONRegExp = BSONRegExp;
  7519. BSON.Symbol = Symbol;
  7520. BSON.Timestamp = Timestamp;
  7521. // Return the BSON
  7522. module.exports = BSON;
  7523. /***/ }),
  7524. /* 328 */
  7525. /***/ (function(module, exports, __webpack_require__) {
  7526. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  7527. var Map = __webpack_require__(333),
  7528. Long = __webpack_require__(334),
  7529. Double = __webpack_require__(335),
  7530. Timestamp = __webpack_require__(336),
  7531. ObjectID = __webpack_require__(337),
  7532. BSONRegExp = __webpack_require__(342),
  7533. Symbol = __webpack_require__(343),
  7534. Int32 = __webpack_require__(344),
  7535. Code = __webpack_require__(345),
  7536. Decimal128 = __webpack_require__(346),
  7537. MinKey = __webpack_require__(347),
  7538. MaxKey = __webpack_require__(348),
  7539. DBRef = __webpack_require__(349),
  7540. Binary = __webpack_require__(350);
  7541. // Parts of the parser
  7542. var deserialize = __webpack_require__(351),
  7543. serializer = __webpack_require__(352),
  7544. calculateObjectSize = __webpack_require__(355);
  7545. /**
  7546. * @ignore
  7547. * @api private
  7548. */
  7549. // Default Max Size
  7550. var MAXSIZE = 1024 * 1024 * 17;
  7551. // Current Internal Temporary Serialization Buffer
  7552. var buffer = new Buffer(MAXSIZE);
  7553. var BSON = function () {};
  7554. /**
  7555. * Serialize a Javascript object.
  7556. *
  7557. * @param {Object} object the Javascript object to serialize.
  7558. * @param {Boolean} [options.checkKeys] the serializer will check if keys are valid.
  7559. * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
  7560. * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
  7561. * @param {Number} [options.minInternalBufferSize=1024*1024*17] minimum size of the internal temporary serialization buffer **(default:1024*1024*17)**.
  7562. * @return {Buffer} returns the Buffer object containing the serialized object.
  7563. * @api public
  7564. */
  7565. BSON.prototype.serialize = function serialize(object, options) {
  7566. options = options || {};
  7567. // Unpack the options
  7568. var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
  7569. var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
  7570. var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
  7571. var minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE;
  7572. // Resize the internal serialization buffer if needed
  7573. if (buffer.length < minInternalBufferSize) {
  7574. buffer = new Buffer(minInternalBufferSize);
  7575. }
  7576. // Attempt to serialize
  7577. var serializationIndex = serializer(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []);
  7578. // Create the final buffer
  7579. var finishedBuffer = new Buffer(serializationIndex);
  7580. // Copy into the finished buffer
  7581. buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length);
  7582. // Return the buffer
  7583. return finishedBuffer;
  7584. };
  7585. /**
  7586. * Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization.
  7587. *
  7588. * @param {Object} object the Javascript object to serialize.
  7589. * @param {Buffer} buffer the Buffer you pre-allocated to store the serialized BSON object.
  7590. * @param {Boolean} [options.checkKeys] the serializer will check if keys are valid.
  7591. * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
  7592. * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
  7593. * @param {Number} [options.index] the index in the buffer where we wish to start serializing into.
  7594. * @return {Number} returns the index pointing to the last written byte in the buffer.
  7595. * @api public
  7596. */
  7597. BSON.prototype.serializeWithBufferAndIndex = function (object, finalBuffer, options) {
  7598. options = options || {};
  7599. // Unpack the options
  7600. var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
  7601. var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
  7602. var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
  7603. var startIndex = typeof options.index === 'number' ? options.index : 0;
  7604. // Attempt to serialize
  7605. var serializationIndex = serializer(finalBuffer, object, checkKeys, startIndex || 0, 0, serializeFunctions, ignoreUndefined);
  7606. // Return the index
  7607. return serializationIndex - 1;
  7608. };
  7609. /**
  7610. * Deserialize data as BSON.
  7611. *
  7612. * @param {Buffer} buffer the buffer containing the serialized set of BSON documents.
  7613. * @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized.
  7614. * @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse.
  7615. * @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function.
  7616. * @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits
  7617. * @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a node.js Buffer instance.
  7618. * @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types.
  7619. * @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer.
  7620. * @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances.
  7621. * @return {Object} returns the deserialized Javascript Object.
  7622. * @api public
  7623. */
  7624. BSON.prototype.deserialize = function (buffer, options) {
  7625. return deserialize(buffer, options);
  7626. };
  7627. /**
  7628. * Calculate the bson size for a passed in Javascript object.
  7629. *
  7630. * @param {Object} object the Javascript object to calculate the BSON byte size for.
  7631. * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
  7632. * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
  7633. * @return {Number} returns the number of bytes the BSON object will take up.
  7634. * @api public
  7635. */
  7636. BSON.prototype.calculateObjectSize = function (object, options) {
  7637. options = options || {};
  7638. var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
  7639. var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
  7640. return calculateObjectSize(object, serializeFunctions, ignoreUndefined);
  7641. };
  7642. /**
  7643. * Deserialize stream data as BSON documents.
  7644. *
  7645. * @param {Buffer} data the buffer containing the serialized set of BSON documents.
  7646. * @param {Number} startIndex the start index in the data Buffer where the deserialization is to start.
  7647. * @param {Number} numberOfDocuments number of documents to deserialize.
  7648. * @param {Array} documents an array where to store the deserialized documents.
  7649. * @param {Number} docStartIndex the index in the documents array from where to start inserting documents.
  7650. * @param {Object} [options] additional options used for the deserialization.
  7651. * @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized.
  7652. * @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse.
  7653. * @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function.
  7654. * @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits
  7655. * @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a node.js Buffer instance.
  7656. * @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types.
  7657. * @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer.
  7658. * @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances.
  7659. * @return {Number} returns the next index in the buffer after deserialization **x** numbers of documents.
  7660. * @api public
  7661. */
  7662. BSON.prototype.deserializeStream = function (data, startIndex, numberOfDocuments, documents, docStartIndex, options) {
  7663. options = options != null ? options : {};
  7664. var index = startIndex;
  7665. // Loop over all documents
  7666. for (var i = 0; i < numberOfDocuments; i++) {
  7667. // Find size of the document
  7668. var size = data[index] | data[index + 1] << 8 | data[index + 2] << 16 | data[index + 3] << 24;
  7669. // Update options with index
  7670. options['index'] = index;
  7671. // Parse the document at this point
  7672. documents[docStartIndex + i] = this.deserialize(data, options);
  7673. // Adjust index by the document size
  7674. index = index + size;
  7675. }
  7676. // Return object containing end index of parsing and list of documents
  7677. return index;
  7678. };
  7679. /**
  7680. * @ignore
  7681. * @api private
  7682. */
  7683. // BSON MAX VALUES
  7684. BSON.BSON_INT32_MAX = 0x7fffffff;
  7685. BSON.BSON_INT32_MIN = -0x80000000;
  7686. BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
  7687. BSON.BSON_INT64_MIN = -Math.pow(2, 63);
  7688. // JS MAX PRECISE VALUES
  7689. BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
  7690. BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
  7691. // Internal long versions
  7692. // var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
  7693. // var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
  7694. /**
  7695. * Number BSON Type
  7696. *
  7697. * @classconstant BSON_DATA_NUMBER
  7698. **/
  7699. BSON.BSON_DATA_NUMBER = 1;
  7700. /**
  7701. * String BSON Type
  7702. *
  7703. * @classconstant BSON_DATA_STRING
  7704. **/
  7705. BSON.BSON_DATA_STRING = 2;
  7706. /**
  7707. * Object BSON Type
  7708. *
  7709. * @classconstant BSON_DATA_OBJECT
  7710. **/
  7711. BSON.BSON_DATA_OBJECT = 3;
  7712. /**
  7713. * Array BSON Type
  7714. *
  7715. * @classconstant BSON_DATA_ARRAY
  7716. **/
  7717. BSON.BSON_DATA_ARRAY = 4;
  7718. /**
  7719. * Binary BSON Type
  7720. *
  7721. * @classconstant BSON_DATA_BINARY
  7722. **/
  7723. BSON.BSON_DATA_BINARY = 5;
  7724. /**
  7725. * ObjectID BSON Type
  7726. *
  7727. * @classconstant BSON_DATA_OID
  7728. **/
  7729. BSON.BSON_DATA_OID = 7;
  7730. /**
  7731. * Boolean BSON Type
  7732. *
  7733. * @classconstant BSON_DATA_BOOLEAN
  7734. **/
  7735. BSON.BSON_DATA_BOOLEAN = 8;
  7736. /**
  7737. * Date BSON Type
  7738. *
  7739. * @classconstant BSON_DATA_DATE
  7740. **/
  7741. BSON.BSON_DATA_DATE = 9;
  7742. /**
  7743. * null BSON Type
  7744. *
  7745. * @classconstant BSON_DATA_NULL
  7746. **/
  7747. BSON.BSON_DATA_NULL = 10;
  7748. /**
  7749. * RegExp BSON Type
  7750. *
  7751. * @classconstant BSON_DATA_REGEXP
  7752. **/
  7753. BSON.BSON_DATA_REGEXP = 11;
  7754. /**
  7755. * Code BSON Type
  7756. *
  7757. * @classconstant BSON_DATA_CODE
  7758. **/
  7759. BSON.BSON_DATA_CODE = 13;
  7760. /**
  7761. * Symbol BSON Type
  7762. *
  7763. * @classconstant BSON_DATA_SYMBOL
  7764. **/
  7765. BSON.BSON_DATA_SYMBOL = 14;
  7766. /**
  7767. * Code with Scope BSON Type
  7768. *
  7769. * @classconstant BSON_DATA_CODE_W_SCOPE
  7770. **/
  7771. BSON.BSON_DATA_CODE_W_SCOPE = 15;
  7772. /**
  7773. * 32 bit Integer BSON Type
  7774. *
  7775. * @classconstant BSON_DATA_INT
  7776. **/
  7777. BSON.BSON_DATA_INT = 16;
  7778. /**
  7779. * Timestamp BSON Type
  7780. *
  7781. * @classconstant BSON_DATA_TIMESTAMP
  7782. **/
  7783. BSON.BSON_DATA_TIMESTAMP = 17;
  7784. /**
  7785. * Long BSON Type
  7786. *
  7787. * @classconstant BSON_DATA_LONG
  7788. **/
  7789. BSON.BSON_DATA_LONG = 18;
  7790. /**
  7791. * MinKey BSON Type
  7792. *
  7793. * @classconstant BSON_DATA_MIN_KEY
  7794. **/
  7795. BSON.BSON_DATA_MIN_KEY = 0xff;
  7796. /**
  7797. * MaxKey BSON Type
  7798. *
  7799. * @classconstant BSON_DATA_MAX_KEY
  7800. **/
  7801. BSON.BSON_DATA_MAX_KEY = 0x7f;
  7802. /**
  7803. * Binary Default Type
  7804. *
  7805. * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
  7806. **/
  7807. BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
  7808. /**
  7809. * Binary Function Type
  7810. *
  7811. * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
  7812. **/
  7813. BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
  7814. /**
  7815. * Binary Byte Array Type
  7816. *
  7817. * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
  7818. **/
  7819. BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
  7820. /**
  7821. * Binary UUID Type
  7822. *
  7823. * @classconstant BSON_BINARY_SUBTYPE_UUID
  7824. **/
  7825. BSON.BSON_BINARY_SUBTYPE_UUID = 3;
  7826. /**
  7827. * Binary MD5 Type
  7828. *
  7829. * @classconstant BSON_BINARY_SUBTYPE_MD5
  7830. **/
  7831. BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
  7832. /**
  7833. * Binary User Defined Type
  7834. *
  7835. * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
  7836. **/
  7837. BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
  7838. // Return BSON
  7839. module.exports = BSON;
  7840. module.exports.Code = Code;
  7841. module.exports.Map = Map;
  7842. module.exports.Symbol = Symbol;
  7843. module.exports.BSON = BSON;
  7844. module.exports.DBRef = DBRef;
  7845. module.exports.Binary = Binary;
  7846. module.exports.ObjectID = ObjectID;
  7847. module.exports.Long = Long;
  7848. module.exports.Timestamp = Timestamp;
  7849. module.exports.Double = Double;
  7850. module.exports.Int32 = Int32;
  7851. module.exports.MinKey = MinKey;
  7852. module.exports.MaxKey = MaxKey;
  7853. module.exports.BSONRegExp = BSONRegExp;
  7854. module.exports.Decimal128 = Decimal128;
  7855. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(329).Buffer))
  7856. /***/ }),
  7857. /* 329 */
  7858. /***/ (function(module, exports, __webpack_require__) {
  7859. /* WEBPACK VAR INJECTION */(function(global) {/*!
  7860. * The buffer module from node.js, for the browser.
  7861. *
  7862. * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  7863. * @license MIT
  7864. */
  7865. /* eslint-disable no-proto */
  7866. 'use strict'
  7867. var base64 = __webpack_require__(330)
  7868. var ieee754 = __webpack_require__(331)
  7869. var isArray = __webpack_require__(332)
  7870. exports.Buffer = Buffer
  7871. exports.SlowBuffer = SlowBuffer
  7872. exports.INSPECT_MAX_BYTES = 50
  7873. /**
  7874. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  7875. * === true Use Uint8Array implementation (fastest)
  7876. * === false Use Object implementation (most compatible, even IE6)
  7877. *
  7878. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  7879. * Opera 11.6+, iOS 4.2+.
  7880. *
  7881. * Due to various browser bugs, sometimes the Object implementation will be used even
  7882. * when the browser supports typed arrays.
  7883. *
  7884. * Note:
  7885. *
  7886. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  7887. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  7888. *
  7889. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  7890. *
  7891. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  7892. * incorrect length in some situations.
  7893. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  7894. * get the Object implementation, which is slower but behaves correctly.
  7895. */
  7896. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  7897. ? global.TYPED_ARRAY_SUPPORT
  7898. : typedArraySupport()
  7899. /*
  7900. * Export kMaxLength after typed array support is determined.
  7901. */
  7902. exports.kMaxLength = kMaxLength()
  7903. function typedArraySupport () {
  7904. try {
  7905. var arr = new Uint8Array(1)
  7906. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  7907. return arr.foo() === 42 && // typed array instances can be augmented
  7908. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  7909. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  7910. } catch (e) {
  7911. return false
  7912. }
  7913. }
  7914. function kMaxLength () {
  7915. return Buffer.TYPED_ARRAY_SUPPORT
  7916. ? 0x7fffffff
  7917. : 0x3fffffff
  7918. }
  7919. function createBuffer (that, length) {
  7920. if (kMaxLength() < length) {
  7921. throw new RangeError('Invalid typed array length')
  7922. }
  7923. if (Buffer.TYPED_ARRAY_SUPPORT) {
  7924. // Return an augmented `Uint8Array` instance, for best performance
  7925. that = new Uint8Array(length)
  7926. that.__proto__ = Buffer.prototype
  7927. } else {
  7928. // Fallback: Return an object instance of the Buffer class
  7929. if (that === null) {
  7930. that = new Buffer(length)
  7931. }
  7932. that.length = length
  7933. }
  7934. return that
  7935. }
  7936. /**
  7937. * The Buffer constructor returns instances of `Uint8Array` that have their
  7938. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  7939. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  7940. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  7941. * returns a single octet.
  7942. *
  7943. * The `Uint8Array` prototype remains unmodified.
  7944. */
  7945. function Buffer (arg, encodingOrOffset, length) {
  7946. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  7947. return new Buffer(arg, encodingOrOffset, length)
  7948. }
  7949. // Common case.
  7950. if (typeof arg === 'number') {
  7951. if (typeof encodingOrOffset === 'string') {
  7952. throw new Error(
  7953. 'If encoding is specified then the first argument must be a string'
  7954. )
  7955. }
  7956. return allocUnsafe(this, arg)
  7957. }
  7958. return from(this, arg, encodingOrOffset, length)
  7959. }
  7960. Buffer.poolSize = 8192 // not used by this implementation
  7961. // TODO: Legacy, not needed anymore. Remove in next major version.
  7962. Buffer._augment = function (arr) {
  7963. arr.__proto__ = Buffer.prototype
  7964. return arr
  7965. }
  7966. function from (that, value, encodingOrOffset, length) {
  7967. if (typeof value === 'number') {
  7968. throw new TypeError('"value" argument must not be a number')
  7969. }
  7970. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  7971. return fromArrayBuffer(that, value, encodingOrOffset, length)
  7972. }
  7973. if (typeof value === 'string') {
  7974. return fromString(that, value, encodingOrOffset)
  7975. }
  7976. return fromObject(that, value)
  7977. }
  7978. /**
  7979. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  7980. * if value is a number.
  7981. * Buffer.from(str[, encoding])
  7982. * Buffer.from(array)
  7983. * Buffer.from(buffer)
  7984. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  7985. **/
  7986. Buffer.from = function (value, encodingOrOffset, length) {
  7987. return from(null, value, encodingOrOffset, length)
  7988. }
  7989. if (Buffer.TYPED_ARRAY_SUPPORT) {
  7990. Buffer.prototype.__proto__ = Uint8Array.prototype
  7991. Buffer.__proto__ = Uint8Array
  7992. if (typeof Symbol !== 'undefined' && Symbol.species &&
  7993. Buffer[Symbol.species] === Buffer) {
  7994. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  7995. Object.defineProperty(Buffer, Symbol.species, {
  7996. value: null,
  7997. configurable: true
  7998. })
  7999. }
  8000. }
  8001. function assertSize (size) {
  8002. if (typeof size !== 'number') {
  8003. throw new TypeError('"size" argument must be a number')
  8004. } else if (size < 0) {
  8005. throw new RangeError('"size" argument must not be negative')
  8006. }
  8007. }
  8008. function alloc (that, size, fill, encoding) {
  8009. assertSize(size)
  8010. if (size <= 0) {
  8011. return createBuffer(that, size)
  8012. }
  8013. if (fill !== undefined) {
  8014. // Only pay attention to encoding if it's a string. This
  8015. // prevents accidentally sending in a number that would
  8016. // be interpretted as a start offset.
  8017. return typeof encoding === 'string'
  8018. ? createBuffer(that, size).fill(fill, encoding)
  8019. : createBuffer(that, size).fill(fill)
  8020. }
  8021. return createBuffer(that, size)
  8022. }
  8023. /**
  8024. * Creates a new filled Buffer instance.
  8025. * alloc(size[, fill[, encoding]])
  8026. **/
  8027. Buffer.alloc = function (size, fill, encoding) {
  8028. return alloc(null, size, fill, encoding)
  8029. }
  8030. function allocUnsafe (that, size) {
  8031. assertSize(size)
  8032. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  8033. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  8034. for (var i = 0; i < size; ++i) {
  8035. that[i] = 0
  8036. }
  8037. }
  8038. return that
  8039. }
  8040. /**
  8041. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  8042. * */
  8043. Buffer.allocUnsafe = function (size) {
  8044. return allocUnsafe(null, size)
  8045. }
  8046. /**
  8047. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  8048. */
  8049. Buffer.allocUnsafeSlow = function (size) {
  8050. return allocUnsafe(null, size)
  8051. }
  8052. function fromString (that, string, encoding) {
  8053. if (typeof encoding !== 'string' || encoding === '') {
  8054. encoding = 'utf8'
  8055. }
  8056. if (!Buffer.isEncoding(encoding)) {
  8057. throw new TypeError('"encoding" must be a valid string encoding')
  8058. }
  8059. var length = byteLength(string, encoding) | 0
  8060. that = createBuffer(that, length)
  8061. var actual = that.write(string, encoding)
  8062. if (actual !== length) {
  8063. // Writing a hex string, for example, that contains invalid characters will
  8064. // cause everything after the first invalid character to be ignored. (e.g.
  8065. // 'abxxcd' will be treated as 'ab')
  8066. that = that.slice(0, actual)
  8067. }
  8068. return that
  8069. }
  8070. function fromArrayLike (that, array) {
  8071. var length = array.length < 0 ? 0 : checked(array.length) | 0
  8072. that = createBuffer(that, length)
  8073. for (var i = 0; i < length; i += 1) {
  8074. that[i] = array[i] & 255
  8075. }
  8076. return that
  8077. }
  8078. function fromArrayBuffer (that, array, byteOffset, length) {
  8079. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  8080. if (byteOffset < 0 || array.byteLength < byteOffset) {
  8081. throw new RangeError('\'offset\' is out of bounds')
  8082. }
  8083. if (array.byteLength < byteOffset + (length || 0)) {
  8084. throw new RangeError('\'length\' is out of bounds')
  8085. }
  8086. if (byteOffset === undefined && length === undefined) {
  8087. array = new Uint8Array(array)
  8088. } else if (length === undefined) {
  8089. array = new Uint8Array(array, byteOffset)
  8090. } else {
  8091. array = new Uint8Array(array, byteOffset, length)
  8092. }
  8093. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8094. // Return an augmented `Uint8Array` instance, for best performance
  8095. that = array
  8096. that.__proto__ = Buffer.prototype
  8097. } else {
  8098. // Fallback: Return an object instance of the Buffer class
  8099. that = fromArrayLike(that, array)
  8100. }
  8101. return that
  8102. }
  8103. function fromObject (that, obj) {
  8104. if (Buffer.isBuffer(obj)) {
  8105. var len = checked(obj.length) | 0
  8106. that = createBuffer(that, len)
  8107. if (that.length === 0) {
  8108. return that
  8109. }
  8110. obj.copy(that, 0, 0, len)
  8111. return that
  8112. }
  8113. if (obj) {
  8114. if ((typeof ArrayBuffer !== 'undefined' &&
  8115. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  8116. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  8117. return createBuffer(that, 0)
  8118. }
  8119. return fromArrayLike(that, obj)
  8120. }
  8121. if (obj.type === 'Buffer' && isArray(obj.data)) {
  8122. return fromArrayLike(that, obj.data)
  8123. }
  8124. }
  8125. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  8126. }
  8127. function checked (length) {
  8128. // Note: cannot use `length < kMaxLength()` here because that fails when
  8129. // length is NaN (which is otherwise coerced to zero.)
  8130. if (length >= kMaxLength()) {
  8131. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  8132. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  8133. }
  8134. return length | 0
  8135. }
  8136. function SlowBuffer (length) {
  8137. if (+length != length) { // eslint-disable-line eqeqeq
  8138. length = 0
  8139. }
  8140. return Buffer.alloc(+length)
  8141. }
  8142. Buffer.isBuffer = function isBuffer (b) {
  8143. return !!(b != null && b._isBuffer)
  8144. }
  8145. Buffer.compare = function compare (a, b) {
  8146. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  8147. throw new TypeError('Arguments must be Buffers')
  8148. }
  8149. if (a === b) return 0
  8150. var x = a.length
  8151. var y = b.length
  8152. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  8153. if (a[i] !== b[i]) {
  8154. x = a[i]
  8155. y = b[i]
  8156. break
  8157. }
  8158. }
  8159. if (x < y) return -1
  8160. if (y < x) return 1
  8161. return 0
  8162. }
  8163. Buffer.isEncoding = function isEncoding (encoding) {
  8164. switch (String(encoding).toLowerCase()) {
  8165. case 'hex':
  8166. case 'utf8':
  8167. case 'utf-8':
  8168. case 'ascii':
  8169. case 'latin1':
  8170. case 'binary':
  8171. case 'base64':
  8172. case 'ucs2':
  8173. case 'ucs-2':
  8174. case 'utf16le':
  8175. case 'utf-16le':
  8176. return true
  8177. default:
  8178. return false
  8179. }
  8180. }
  8181. Buffer.concat = function concat (list, length) {
  8182. if (!isArray(list)) {
  8183. throw new TypeError('"list" argument must be an Array of Buffers')
  8184. }
  8185. if (list.length === 0) {
  8186. return Buffer.alloc(0)
  8187. }
  8188. var i
  8189. if (length === undefined) {
  8190. length = 0
  8191. for (i = 0; i < list.length; ++i) {
  8192. length += list[i].length
  8193. }
  8194. }
  8195. var buffer = Buffer.allocUnsafe(length)
  8196. var pos = 0
  8197. for (i = 0; i < list.length; ++i) {
  8198. var buf = list[i]
  8199. if (!Buffer.isBuffer(buf)) {
  8200. throw new TypeError('"list" argument must be an Array of Buffers')
  8201. }
  8202. buf.copy(buffer, pos)
  8203. pos += buf.length
  8204. }
  8205. return buffer
  8206. }
  8207. function byteLength (string, encoding) {
  8208. if (Buffer.isBuffer(string)) {
  8209. return string.length
  8210. }
  8211. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  8212. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  8213. return string.byteLength
  8214. }
  8215. if (typeof string !== 'string') {
  8216. string = '' + string
  8217. }
  8218. var len = string.length
  8219. if (len === 0) return 0
  8220. // Use a for loop to avoid recursion
  8221. var loweredCase = false
  8222. for (;;) {
  8223. switch (encoding) {
  8224. case 'ascii':
  8225. case 'latin1':
  8226. case 'binary':
  8227. return len
  8228. case 'utf8':
  8229. case 'utf-8':
  8230. case undefined:
  8231. return utf8ToBytes(string).length
  8232. case 'ucs2':
  8233. case 'ucs-2':
  8234. case 'utf16le':
  8235. case 'utf-16le':
  8236. return len * 2
  8237. case 'hex':
  8238. return len >>> 1
  8239. case 'base64':
  8240. return base64ToBytes(string).length
  8241. default:
  8242. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  8243. encoding = ('' + encoding).toLowerCase()
  8244. loweredCase = true
  8245. }
  8246. }
  8247. }
  8248. Buffer.byteLength = byteLength
  8249. function slowToString (encoding, start, end) {
  8250. var loweredCase = false
  8251. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  8252. // property of a typed array.
  8253. // This behaves neither like String nor Uint8Array in that we set start/end
  8254. // to their upper/lower bounds if the value passed is out of range.
  8255. // undefined is handled specially as per ECMA-262 6th Edition,
  8256. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  8257. if (start === undefined || start < 0) {
  8258. start = 0
  8259. }
  8260. // Return early if start > this.length. Done here to prevent potential uint32
  8261. // coercion fail below.
  8262. if (start > this.length) {
  8263. return ''
  8264. }
  8265. if (end === undefined || end > this.length) {
  8266. end = this.length
  8267. }
  8268. if (end <= 0) {
  8269. return ''
  8270. }
  8271. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  8272. end >>>= 0
  8273. start >>>= 0
  8274. if (end <= start) {
  8275. return ''
  8276. }
  8277. if (!encoding) encoding = 'utf8'
  8278. while (true) {
  8279. switch (encoding) {
  8280. case 'hex':
  8281. return hexSlice(this, start, end)
  8282. case 'utf8':
  8283. case 'utf-8':
  8284. return utf8Slice(this, start, end)
  8285. case 'ascii':
  8286. return asciiSlice(this, start, end)
  8287. case 'latin1':
  8288. case 'binary':
  8289. return latin1Slice(this, start, end)
  8290. case 'base64':
  8291. return base64Slice(this, start, end)
  8292. case 'ucs2':
  8293. case 'ucs-2':
  8294. case 'utf16le':
  8295. case 'utf-16le':
  8296. return utf16leSlice(this, start, end)
  8297. default:
  8298. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  8299. encoding = (encoding + '').toLowerCase()
  8300. loweredCase = true
  8301. }
  8302. }
  8303. }
  8304. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  8305. // Buffer instances.
  8306. Buffer.prototype._isBuffer = true
  8307. function swap (b, n, m) {
  8308. var i = b[n]
  8309. b[n] = b[m]
  8310. b[m] = i
  8311. }
  8312. Buffer.prototype.swap16 = function swap16 () {
  8313. var len = this.length
  8314. if (len % 2 !== 0) {
  8315. throw new RangeError('Buffer size must be a multiple of 16-bits')
  8316. }
  8317. for (var i = 0; i < len; i += 2) {
  8318. swap(this, i, i + 1)
  8319. }
  8320. return this
  8321. }
  8322. Buffer.prototype.swap32 = function swap32 () {
  8323. var len = this.length
  8324. if (len % 4 !== 0) {
  8325. throw new RangeError('Buffer size must be a multiple of 32-bits')
  8326. }
  8327. for (var i = 0; i < len; i += 4) {
  8328. swap(this, i, i + 3)
  8329. swap(this, i + 1, i + 2)
  8330. }
  8331. return this
  8332. }
  8333. Buffer.prototype.swap64 = function swap64 () {
  8334. var len = this.length
  8335. if (len % 8 !== 0) {
  8336. throw new RangeError('Buffer size must be a multiple of 64-bits')
  8337. }
  8338. for (var i = 0; i < len; i += 8) {
  8339. swap(this, i, i + 7)
  8340. swap(this, i + 1, i + 6)
  8341. swap(this, i + 2, i + 5)
  8342. swap(this, i + 3, i + 4)
  8343. }
  8344. return this
  8345. }
  8346. Buffer.prototype.toString = function toString () {
  8347. var length = this.length | 0
  8348. if (length === 0) return ''
  8349. if (arguments.length === 0) return utf8Slice(this, 0, length)
  8350. return slowToString.apply(this, arguments)
  8351. }
  8352. Buffer.prototype.equals = function equals (b) {
  8353. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  8354. if (this === b) return true
  8355. return Buffer.compare(this, b) === 0
  8356. }
  8357. Buffer.prototype.inspect = function inspect () {
  8358. var str = ''
  8359. var max = exports.INSPECT_MAX_BYTES
  8360. if (this.length > 0) {
  8361. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  8362. if (this.length > max) str += ' ... '
  8363. }
  8364. return '<Buffer ' + str + '>'
  8365. }
  8366. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  8367. if (!Buffer.isBuffer(target)) {
  8368. throw new TypeError('Argument must be a Buffer')
  8369. }
  8370. if (start === undefined) {
  8371. start = 0
  8372. }
  8373. if (end === undefined) {
  8374. end = target ? target.length : 0
  8375. }
  8376. if (thisStart === undefined) {
  8377. thisStart = 0
  8378. }
  8379. if (thisEnd === undefined) {
  8380. thisEnd = this.length
  8381. }
  8382. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  8383. throw new RangeError('out of range index')
  8384. }
  8385. if (thisStart >= thisEnd && start >= end) {
  8386. return 0
  8387. }
  8388. if (thisStart >= thisEnd) {
  8389. return -1
  8390. }
  8391. if (start >= end) {
  8392. return 1
  8393. }
  8394. start >>>= 0
  8395. end >>>= 0
  8396. thisStart >>>= 0
  8397. thisEnd >>>= 0
  8398. if (this === target) return 0
  8399. var x = thisEnd - thisStart
  8400. var y = end - start
  8401. var len = Math.min(x, y)
  8402. var thisCopy = this.slice(thisStart, thisEnd)
  8403. var targetCopy = target.slice(start, end)
  8404. for (var i = 0; i < len; ++i) {
  8405. if (thisCopy[i] !== targetCopy[i]) {
  8406. x = thisCopy[i]
  8407. y = targetCopy[i]
  8408. break
  8409. }
  8410. }
  8411. if (x < y) return -1
  8412. if (y < x) return 1
  8413. return 0
  8414. }
  8415. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  8416. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  8417. //
  8418. // Arguments:
  8419. // - buffer - a Buffer to search
  8420. // - val - a string, Buffer, or number
  8421. // - byteOffset - an index into `buffer`; will be clamped to an int32
  8422. // - encoding - an optional encoding, relevant is val is a string
  8423. // - dir - true for indexOf, false for lastIndexOf
  8424. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  8425. // Empty buffer means no match
  8426. if (buffer.length === 0) return -1
  8427. // Normalize byteOffset
  8428. if (typeof byteOffset === 'string') {
  8429. encoding = byteOffset
  8430. byteOffset = 0
  8431. } else if (byteOffset > 0x7fffffff) {
  8432. byteOffset = 0x7fffffff
  8433. } else if (byteOffset < -0x80000000) {
  8434. byteOffset = -0x80000000
  8435. }
  8436. byteOffset = +byteOffset // Coerce to Number.
  8437. if (isNaN(byteOffset)) {
  8438. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  8439. byteOffset = dir ? 0 : (buffer.length - 1)
  8440. }
  8441. // Normalize byteOffset: negative offsets start from the end of the buffer
  8442. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  8443. if (byteOffset >= buffer.length) {
  8444. if (dir) return -1
  8445. else byteOffset = buffer.length - 1
  8446. } else if (byteOffset < 0) {
  8447. if (dir) byteOffset = 0
  8448. else return -1
  8449. }
  8450. // Normalize val
  8451. if (typeof val === 'string') {
  8452. val = Buffer.from(val, encoding)
  8453. }
  8454. // Finally, search either indexOf (if dir is true) or lastIndexOf
  8455. if (Buffer.isBuffer(val)) {
  8456. // Special case: looking for empty string/buffer always fails
  8457. if (val.length === 0) {
  8458. return -1
  8459. }
  8460. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  8461. } else if (typeof val === 'number') {
  8462. val = val & 0xFF // Search for a byte value [0-255]
  8463. if (Buffer.TYPED_ARRAY_SUPPORT &&
  8464. typeof Uint8Array.prototype.indexOf === 'function') {
  8465. if (dir) {
  8466. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  8467. } else {
  8468. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  8469. }
  8470. }
  8471. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  8472. }
  8473. throw new TypeError('val must be string, number or Buffer')
  8474. }
  8475. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  8476. var indexSize = 1
  8477. var arrLength = arr.length
  8478. var valLength = val.length
  8479. if (encoding !== undefined) {
  8480. encoding = String(encoding).toLowerCase()
  8481. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  8482. encoding === 'utf16le' || encoding === 'utf-16le') {
  8483. if (arr.length < 2 || val.length < 2) {
  8484. return -1
  8485. }
  8486. indexSize = 2
  8487. arrLength /= 2
  8488. valLength /= 2
  8489. byteOffset /= 2
  8490. }
  8491. }
  8492. function read (buf, i) {
  8493. if (indexSize === 1) {
  8494. return buf[i]
  8495. } else {
  8496. return buf.readUInt16BE(i * indexSize)
  8497. }
  8498. }
  8499. var i
  8500. if (dir) {
  8501. var foundIndex = -1
  8502. for (i = byteOffset; i < arrLength; i++) {
  8503. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  8504. if (foundIndex === -1) foundIndex = i
  8505. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  8506. } else {
  8507. if (foundIndex !== -1) i -= i - foundIndex
  8508. foundIndex = -1
  8509. }
  8510. }
  8511. } else {
  8512. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  8513. for (i = byteOffset; i >= 0; i--) {
  8514. var found = true
  8515. for (var j = 0; j < valLength; j++) {
  8516. if (read(arr, i + j) !== read(val, j)) {
  8517. found = false
  8518. break
  8519. }
  8520. }
  8521. if (found) return i
  8522. }
  8523. }
  8524. return -1
  8525. }
  8526. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  8527. return this.indexOf(val, byteOffset, encoding) !== -1
  8528. }
  8529. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  8530. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  8531. }
  8532. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  8533. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  8534. }
  8535. function hexWrite (buf, string, offset, length) {
  8536. offset = Number(offset) || 0
  8537. var remaining = buf.length - offset
  8538. if (!length) {
  8539. length = remaining
  8540. } else {
  8541. length = Number(length)
  8542. if (length > remaining) {
  8543. length = remaining
  8544. }
  8545. }
  8546. // must be an even number of digits
  8547. var strLen = string.length
  8548. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  8549. if (length > strLen / 2) {
  8550. length = strLen / 2
  8551. }
  8552. for (var i = 0; i < length; ++i) {
  8553. var parsed = parseInt(string.substr(i * 2, 2), 16)
  8554. if (isNaN(parsed)) return i
  8555. buf[offset + i] = parsed
  8556. }
  8557. return i
  8558. }
  8559. function utf8Write (buf, string, offset, length) {
  8560. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  8561. }
  8562. function asciiWrite (buf, string, offset, length) {
  8563. return blitBuffer(asciiToBytes(string), buf, offset, length)
  8564. }
  8565. function latin1Write (buf, string, offset, length) {
  8566. return asciiWrite(buf, string, offset, length)
  8567. }
  8568. function base64Write (buf, string, offset, length) {
  8569. return blitBuffer(base64ToBytes(string), buf, offset, length)
  8570. }
  8571. function ucs2Write (buf, string, offset, length) {
  8572. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  8573. }
  8574. Buffer.prototype.write = function write (string, offset, length, encoding) {
  8575. // Buffer#write(string)
  8576. if (offset === undefined) {
  8577. encoding = 'utf8'
  8578. length = this.length
  8579. offset = 0
  8580. // Buffer#write(string, encoding)
  8581. } else if (length === undefined && typeof offset === 'string') {
  8582. encoding = offset
  8583. length = this.length
  8584. offset = 0
  8585. // Buffer#write(string, offset[, length][, encoding])
  8586. } else if (isFinite(offset)) {
  8587. offset = offset | 0
  8588. if (isFinite(length)) {
  8589. length = length | 0
  8590. if (encoding === undefined) encoding = 'utf8'
  8591. } else {
  8592. encoding = length
  8593. length = undefined
  8594. }
  8595. // legacy write(string, encoding, offset, length) - remove in v0.13
  8596. } else {
  8597. throw new Error(
  8598. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  8599. )
  8600. }
  8601. var remaining = this.length - offset
  8602. if (length === undefined || length > remaining) length = remaining
  8603. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  8604. throw new RangeError('Attempt to write outside buffer bounds')
  8605. }
  8606. if (!encoding) encoding = 'utf8'
  8607. var loweredCase = false
  8608. for (;;) {
  8609. switch (encoding) {
  8610. case 'hex':
  8611. return hexWrite(this, string, offset, length)
  8612. case 'utf8':
  8613. case 'utf-8':
  8614. return utf8Write(this, string, offset, length)
  8615. case 'ascii':
  8616. return asciiWrite(this, string, offset, length)
  8617. case 'latin1':
  8618. case 'binary':
  8619. return latin1Write(this, string, offset, length)
  8620. case 'base64':
  8621. // Warning: maxLength not taken into account in base64Write
  8622. return base64Write(this, string, offset, length)
  8623. case 'ucs2':
  8624. case 'ucs-2':
  8625. case 'utf16le':
  8626. case 'utf-16le':
  8627. return ucs2Write(this, string, offset, length)
  8628. default:
  8629. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  8630. encoding = ('' + encoding).toLowerCase()
  8631. loweredCase = true
  8632. }
  8633. }
  8634. }
  8635. Buffer.prototype.toJSON = function toJSON () {
  8636. return {
  8637. type: 'Buffer',
  8638. data: Array.prototype.slice.call(this._arr || this, 0)
  8639. }
  8640. }
  8641. function base64Slice (buf, start, end) {
  8642. if (start === 0 && end === buf.length) {
  8643. return base64.fromByteArray(buf)
  8644. } else {
  8645. return base64.fromByteArray(buf.slice(start, end))
  8646. }
  8647. }
  8648. function utf8Slice (buf, start, end) {
  8649. end = Math.min(buf.length, end)
  8650. var res = []
  8651. var i = start
  8652. while (i < end) {
  8653. var firstByte = buf[i]
  8654. var codePoint = null
  8655. var bytesPerSequence = (firstByte > 0xEF) ? 4
  8656. : (firstByte > 0xDF) ? 3
  8657. : (firstByte > 0xBF) ? 2
  8658. : 1
  8659. if (i + bytesPerSequence <= end) {
  8660. var secondByte, thirdByte, fourthByte, tempCodePoint
  8661. switch (bytesPerSequence) {
  8662. case 1:
  8663. if (firstByte < 0x80) {
  8664. codePoint = firstByte
  8665. }
  8666. break
  8667. case 2:
  8668. secondByte = buf[i + 1]
  8669. if ((secondByte & 0xC0) === 0x80) {
  8670. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  8671. if (tempCodePoint > 0x7F) {
  8672. codePoint = tempCodePoint
  8673. }
  8674. }
  8675. break
  8676. case 3:
  8677. secondByte = buf[i + 1]
  8678. thirdByte = buf[i + 2]
  8679. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  8680. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  8681. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  8682. codePoint = tempCodePoint
  8683. }
  8684. }
  8685. break
  8686. case 4:
  8687. secondByte = buf[i + 1]
  8688. thirdByte = buf[i + 2]
  8689. fourthByte = buf[i + 3]
  8690. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  8691. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  8692. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  8693. codePoint = tempCodePoint
  8694. }
  8695. }
  8696. }
  8697. }
  8698. if (codePoint === null) {
  8699. // we did not generate a valid codePoint so insert a
  8700. // replacement char (U+FFFD) and advance only 1 byte
  8701. codePoint = 0xFFFD
  8702. bytesPerSequence = 1
  8703. } else if (codePoint > 0xFFFF) {
  8704. // encode to utf16 (surrogate pair dance)
  8705. codePoint -= 0x10000
  8706. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  8707. codePoint = 0xDC00 | codePoint & 0x3FF
  8708. }
  8709. res.push(codePoint)
  8710. i += bytesPerSequence
  8711. }
  8712. return decodeCodePointsArray(res)
  8713. }
  8714. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  8715. // the lowest limit is Chrome, with 0x10000 args.
  8716. // We go 1 magnitude less, for safety
  8717. var MAX_ARGUMENTS_LENGTH = 0x1000
  8718. function decodeCodePointsArray (codePoints) {
  8719. var len = codePoints.length
  8720. if (len <= MAX_ARGUMENTS_LENGTH) {
  8721. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  8722. }
  8723. // Decode in chunks to avoid "call stack size exceeded".
  8724. var res = ''
  8725. var i = 0
  8726. while (i < len) {
  8727. res += String.fromCharCode.apply(
  8728. String,
  8729. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  8730. )
  8731. }
  8732. return res
  8733. }
  8734. function asciiSlice (buf, start, end) {
  8735. var ret = ''
  8736. end = Math.min(buf.length, end)
  8737. for (var i = start; i < end; ++i) {
  8738. ret += String.fromCharCode(buf[i] & 0x7F)
  8739. }
  8740. return ret
  8741. }
  8742. function latin1Slice (buf, start, end) {
  8743. var ret = ''
  8744. end = Math.min(buf.length, end)
  8745. for (var i = start; i < end; ++i) {
  8746. ret += String.fromCharCode(buf[i])
  8747. }
  8748. return ret
  8749. }
  8750. function hexSlice (buf, start, end) {
  8751. var len = buf.length
  8752. if (!start || start < 0) start = 0
  8753. if (!end || end < 0 || end > len) end = len
  8754. var out = ''
  8755. for (var i = start; i < end; ++i) {
  8756. out += toHex(buf[i])
  8757. }
  8758. return out
  8759. }
  8760. function utf16leSlice (buf, start, end) {
  8761. var bytes = buf.slice(start, end)
  8762. var res = ''
  8763. for (var i = 0; i < bytes.length; i += 2) {
  8764. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  8765. }
  8766. return res
  8767. }
  8768. Buffer.prototype.slice = function slice (start, end) {
  8769. var len = this.length
  8770. start = ~~start
  8771. end = end === undefined ? len : ~~end
  8772. if (start < 0) {
  8773. start += len
  8774. if (start < 0) start = 0
  8775. } else if (start > len) {
  8776. start = len
  8777. }
  8778. if (end < 0) {
  8779. end += len
  8780. if (end < 0) end = 0
  8781. } else if (end > len) {
  8782. end = len
  8783. }
  8784. if (end < start) end = start
  8785. var newBuf
  8786. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8787. newBuf = this.subarray(start, end)
  8788. newBuf.__proto__ = Buffer.prototype
  8789. } else {
  8790. var sliceLen = end - start
  8791. newBuf = new Buffer(sliceLen, undefined)
  8792. for (var i = 0; i < sliceLen; ++i) {
  8793. newBuf[i] = this[i + start]
  8794. }
  8795. }
  8796. return newBuf
  8797. }
  8798. /*
  8799. * Need to make sure that buffer isn't trying to write out of bounds.
  8800. */
  8801. function checkOffset (offset, ext, length) {
  8802. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  8803. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  8804. }
  8805. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  8806. offset = offset | 0
  8807. byteLength = byteLength | 0
  8808. if (!noAssert) checkOffset(offset, byteLength, this.length)
  8809. var val = this[offset]
  8810. var mul = 1
  8811. var i = 0
  8812. while (++i < byteLength && (mul *= 0x100)) {
  8813. val += this[offset + i] * mul
  8814. }
  8815. return val
  8816. }
  8817. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  8818. offset = offset | 0
  8819. byteLength = byteLength | 0
  8820. if (!noAssert) {
  8821. checkOffset(offset, byteLength, this.length)
  8822. }
  8823. var val = this[offset + --byteLength]
  8824. var mul = 1
  8825. while (byteLength > 0 && (mul *= 0x100)) {
  8826. val += this[offset + --byteLength] * mul
  8827. }
  8828. return val
  8829. }
  8830. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  8831. if (!noAssert) checkOffset(offset, 1, this.length)
  8832. return this[offset]
  8833. }
  8834. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  8835. if (!noAssert) checkOffset(offset, 2, this.length)
  8836. return this[offset] | (this[offset + 1] << 8)
  8837. }
  8838. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  8839. if (!noAssert) checkOffset(offset, 2, this.length)
  8840. return (this[offset] << 8) | this[offset + 1]
  8841. }
  8842. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  8843. if (!noAssert) checkOffset(offset, 4, this.length)
  8844. return ((this[offset]) |
  8845. (this[offset + 1] << 8) |
  8846. (this[offset + 2] << 16)) +
  8847. (this[offset + 3] * 0x1000000)
  8848. }
  8849. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  8850. if (!noAssert) checkOffset(offset, 4, this.length)
  8851. return (this[offset] * 0x1000000) +
  8852. ((this[offset + 1] << 16) |
  8853. (this[offset + 2] << 8) |
  8854. this[offset + 3])
  8855. }
  8856. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  8857. offset = offset | 0
  8858. byteLength = byteLength | 0
  8859. if (!noAssert) checkOffset(offset, byteLength, this.length)
  8860. var val = this[offset]
  8861. var mul = 1
  8862. var i = 0
  8863. while (++i < byteLength && (mul *= 0x100)) {
  8864. val += this[offset + i] * mul
  8865. }
  8866. mul *= 0x80
  8867. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  8868. return val
  8869. }
  8870. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  8871. offset = offset | 0
  8872. byteLength = byteLength | 0
  8873. if (!noAssert) checkOffset(offset, byteLength, this.length)
  8874. var i = byteLength
  8875. var mul = 1
  8876. var val = this[offset + --i]
  8877. while (i > 0 && (mul *= 0x100)) {
  8878. val += this[offset + --i] * mul
  8879. }
  8880. mul *= 0x80
  8881. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  8882. return val
  8883. }
  8884. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  8885. if (!noAssert) checkOffset(offset, 1, this.length)
  8886. if (!(this[offset] & 0x80)) return (this[offset])
  8887. return ((0xff - this[offset] + 1) * -1)
  8888. }
  8889. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  8890. if (!noAssert) checkOffset(offset, 2, this.length)
  8891. var val = this[offset] | (this[offset + 1] << 8)
  8892. return (val & 0x8000) ? val | 0xFFFF0000 : val
  8893. }
  8894. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  8895. if (!noAssert) checkOffset(offset, 2, this.length)
  8896. var val = this[offset + 1] | (this[offset] << 8)
  8897. return (val & 0x8000) ? val | 0xFFFF0000 : val
  8898. }
  8899. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  8900. if (!noAssert) checkOffset(offset, 4, this.length)
  8901. return (this[offset]) |
  8902. (this[offset + 1] << 8) |
  8903. (this[offset + 2] << 16) |
  8904. (this[offset + 3] << 24)
  8905. }
  8906. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  8907. if (!noAssert) checkOffset(offset, 4, this.length)
  8908. return (this[offset] << 24) |
  8909. (this[offset + 1] << 16) |
  8910. (this[offset + 2] << 8) |
  8911. (this[offset + 3])
  8912. }
  8913. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  8914. if (!noAssert) checkOffset(offset, 4, this.length)
  8915. return ieee754.read(this, offset, true, 23, 4)
  8916. }
  8917. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  8918. if (!noAssert) checkOffset(offset, 4, this.length)
  8919. return ieee754.read(this, offset, false, 23, 4)
  8920. }
  8921. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  8922. if (!noAssert) checkOffset(offset, 8, this.length)
  8923. return ieee754.read(this, offset, true, 52, 8)
  8924. }
  8925. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  8926. if (!noAssert) checkOffset(offset, 8, this.length)
  8927. return ieee754.read(this, offset, false, 52, 8)
  8928. }
  8929. function checkInt (buf, value, offset, ext, max, min) {
  8930. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  8931. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  8932. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  8933. }
  8934. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  8935. value = +value
  8936. offset = offset | 0
  8937. byteLength = byteLength | 0
  8938. if (!noAssert) {
  8939. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  8940. checkInt(this, value, offset, byteLength, maxBytes, 0)
  8941. }
  8942. var mul = 1
  8943. var i = 0
  8944. this[offset] = value & 0xFF
  8945. while (++i < byteLength && (mul *= 0x100)) {
  8946. this[offset + i] = (value / mul) & 0xFF
  8947. }
  8948. return offset + byteLength
  8949. }
  8950. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  8951. value = +value
  8952. offset = offset | 0
  8953. byteLength = byteLength | 0
  8954. if (!noAssert) {
  8955. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  8956. checkInt(this, value, offset, byteLength, maxBytes, 0)
  8957. }
  8958. var i = byteLength - 1
  8959. var mul = 1
  8960. this[offset + i] = value & 0xFF
  8961. while (--i >= 0 && (mul *= 0x100)) {
  8962. this[offset + i] = (value / mul) & 0xFF
  8963. }
  8964. return offset + byteLength
  8965. }
  8966. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  8967. value = +value
  8968. offset = offset | 0
  8969. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  8970. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  8971. this[offset] = (value & 0xff)
  8972. return offset + 1
  8973. }
  8974. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  8975. if (value < 0) value = 0xffff + value + 1
  8976. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  8977. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  8978. (littleEndian ? i : 1 - i) * 8
  8979. }
  8980. }
  8981. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  8982. value = +value
  8983. offset = offset | 0
  8984. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  8985. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8986. this[offset] = (value & 0xff)
  8987. this[offset + 1] = (value >>> 8)
  8988. } else {
  8989. objectWriteUInt16(this, value, offset, true)
  8990. }
  8991. return offset + 2
  8992. }
  8993. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  8994. value = +value
  8995. offset = offset | 0
  8996. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  8997. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8998. this[offset] = (value >>> 8)
  8999. this[offset + 1] = (value & 0xff)
  9000. } else {
  9001. objectWriteUInt16(this, value, offset, false)
  9002. }
  9003. return offset + 2
  9004. }
  9005. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  9006. if (value < 0) value = 0xffffffff + value + 1
  9007. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  9008. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  9009. }
  9010. }
  9011. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  9012. value = +value
  9013. offset = offset | 0
  9014. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  9015. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9016. this[offset + 3] = (value >>> 24)
  9017. this[offset + 2] = (value >>> 16)
  9018. this[offset + 1] = (value >>> 8)
  9019. this[offset] = (value & 0xff)
  9020. } else {
  9021. objectWriteUInt32(this, value, offset, true)
  9022. }
  9023. return offset + 4
  9024. }
  9025. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  9026. value = +value
  9027. offset = offset | 0
  9028. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  9029. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9030. this[offset] = (value >>> 24)
  9031. this[offset + 1] = (value >>> 16)
  9032. this[offset + 2] = (value >>> 8)
  9033. this[offset + 3] = (value & 0xff)
  9034. } else {
  9035. objectWriteUInt32(this, value, offset, false)
  9036. }
  9037. return offset + 4
  9038. }
  9039. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  9040. value = +value
  9041. offset = offset | 0
  9042. if (!noAssert) {
  9043. var limit = Math.pow(2, 8 * byteLength - 1)
  9044. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  9045. }
  9046. var i = 0
  9047. var mul = 1
  9048. var sub = 0
  9049. this[offset] = value & 0xFF
  9050. while (++i < byteLength && (mul *= 0x100)) {
  9051. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  9052. sub = 1
  9053. }
  9054. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  9055. }
  9056. return offset + byteLength
  9057. }
  9058. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  9059. value = +value
  9060. offset = offset | 0
  9061. if (!noAssert) {
  9062. var limit = Math.pow(2, 8 * byteLength - 1)
  9063. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  9064. }
  9065. var i = byteLength - 1
  9066. var mul = 1
  9067. var sub = 0
  9068. this[offset + i] = value & 0xFF
  9069. while (--i >= 0 && (mul *= 0x100)) {
  9070. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  9071. sub = 1
  9072. }
  9073. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  9074. }
  9075. return offset + byteLength
  9076. }
  9077. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  9078. value = +value
  9079. offset = offset | 0
  9080. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  9081. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  9082. if (value < 0) value = 0xff + value + 1
  9083. this[offset] = (value & 0xff)
  9084. return offset + 1
  9085. }
  9086. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  9087. value = +value
  9088. offset = offset | 0
  9089. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  9090. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9091. this[offset] = (value & 0xff)
  9092. this[offset + 1] = (value >>> 8)
  9093. } else {
  9094. objectWriteUInt16(this, value, offset, true)
  9095. }
  9096. return offset + 2
  9097. }
  9098. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  9099. value = +value
  9100. offset = offset | 0
  9101. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  9102. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9103. this[offset] = (value >>> 8)
  9104. this[offset + 1] = (value & 0xff)
  9105. } else {
  9106. objectWriteUInt16(this, value, offset, false)
  9107. }
  9108. return offset + 2
  9109. }
  9110. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  9111. value = +value
  9112. offset = offset | 0
  9113. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  9114. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9115. this[offset] = (value & 0xff)
  9116. this[offset + 1] = (value >>> 8)
  9117. this[offset + 2] = (value >>> 16)
  9118. this[offset + 3] = (value >>> 24)
  9119. } else {
  9120. objectWriteUInt32(this, value, offset, true)
  9121. }
  9122. return offset + 4
  9123. }
  9124. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  9125. value = +value
  9126. offset = offset | 0
  9127. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  9128. if (value < 0) value = 0xffffffff + value + 1
  9129. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9130. this[offset] = (value >>> 24)
  9131. this[offset + 1] = (value >>> 16)
  9132. this[offset + 2] = (value >>> 8)
  9133. this[offset + 3] = (value & 0xff)
  9134. } else {
  9135. objectWriteUInt32(this, value, offset, false)
  9136. }
  9137. return offset + 4
  9138. }
  9139. function checkIEEE754 (buf, value, offset, ext, max, min) {
  9140. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  9141. if (offset < 0) throw new RangeError('Index out of range')
  9142. }
  9143. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  9144. if (!noAssert) {
  9145. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  9146. }
  9147. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  9148. return offset + 4
  9149. }
  9150. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  9151. return writeFloat(this, value, offset, true, noAssert)
  9152. }
  9153. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  9154. return writeFloat(this, value, offset, false, noAssert)
  9155. }
  9156. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  9157. if (!noAssert) {
  9158. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  9159. }
  9160. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  9161. return offset + 8
  9162. }
  9163. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  9164. return writeDouble(this, value, offset, true, noAssert)
  9165. }
  9166. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  9167. return writeDouble(this, value, offset, false, noAssert)
  9168. }
  9169. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  9170. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  9171. if (!start) start = 0
  9172. if (!end && end !== 0) end = this.length
  9173. if (targetStart >= target.length) targetStart = target.length
  9174. if (!targetStart) targetStart = 0
  9175. if (end > 0 && end < start) end = start
  9176. // Copy 0 bytes; we're done
  9177. if (end === start) return 0
  9178. if (target.length === 0 || this.length === 0) return 0
  9179. // Fatal error conditions
  9180. if (targetStart < 0) {
  9181. throw new RangeError('targetStart out of bounds')
  9182. }
  9183. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  9184. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  9185. // Are we oob?
  9186. if (end > this.length) end = this.length
  9187. if (target.length - targetStart < end - start) {
  9188. end = target.length - targetStart + start
  9189. }
  9190. var len = end - start
  9191. var i
  9192. if (this === target && start < targetStart && targetStart < end) {
  9193. // descending copy from end
  9194. for (i = len - 1; i >= 0; --i) {
  9195. target[i + targetStart] = this[i + start]
  9196. }
  9197. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  9198. // ascending copy from start
  9199. for (i = 0; i < len; ++i) {
  9200. target[i + targetStart] = this[i + start]
  9201. }
  9202. } else {
  9203. Uint8Array.prototype.set.call(
  9204. target,
  9205. this.subarray(start, start + len),
  9206. targetStart
  9207. )
  9208. }
  9209. return len
  9210. }
  9211. // Usage:
  9212. // buffer.fill(number[, offset[, end]])
  9213. // buffer.fill(buffer[, offset[, end]])
  9214. // buffer.fill(string[, offset[, end]][, encoding])
  9215. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  9216. // Handle string cases:
  9217. if (typeof val === 'string') {
  9218. if (typeof start === 'string') {
  9219. encoding = start
  9220. start = 0
  9221. end = this.length
  9222. } else if (typeof end === 'string') {
  9223. encoding = end
  9224. end = this.length
  9225. }
  9226. if (val.length === 1) {
  9227. var code = val.charCodeAt(0)
  9228. if (code < 256) {
  9229. val = code
  9230. }
  9231. }
  9232. if (encoding !== undefined && typeof encoding !== 'string') {
  9233. throw new TypeError('encoding must be a string')
  9234. }
  9235. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  9236. throw new TypeError('Unknown encoding: ' + encoding)
  9237. }
  9238. } else if (typeof val === 'number') {
  9239. val = val & 255
  9240. }
  9241. // Invalid ranges are not set to a default, so can range check early.
  9242. if (start < 0 || this.length < start || this.length < end) {
  9243. throw new RangeError('Out of range index')
  9244. }
  9245. if (end <= start) {
  9246. return this
  9247. }
  9248. start = start >>> 0
  9249. end = end === undefined ? this.length : end >>> 0
  9250. if (!val) val = 0
  9251. var i
  9252. if (typeof val === 'number') {
  9253. for (i = start; i < end; ++i) {
  9254. this[i] = val
  9255. }
  9256. } else {
  9257. var bytes = Buffer.isBuffer(val)
  9258. ? val
  9259. : utf8ToBytes(new Buffer(val, encoding).toString())
  9260. var len = bytes.length
  9261. for (i = 0; i < end - start; ++i) {
  9262. this[i + start] = bytes[i % len]
  9263. }
  9264. }
  9265. return this
  9266. }
  9267. // HELPER FUNCTIONS
  9268. // ================
  9269. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  9270. function base64clean (str) {
  9271. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  9272. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  9273. // Node converts strings with length < 2 to ''
  9274. if (str.length < 2) return ''
  9275. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  9276. while (str.length % 4 !== 0) {
  9277. str = str + '='
  9278. }
  9279. return str
  9280. }
  9281. function stringtrim (str) {
  9282. if (str.trim) return str.trim()
  9283. return str.replace(/^\s+|\s+$/g, '')
  9284. }
  9285. function toHex (n) {
  9286. if (n < 16) return '0' + n.toString(16)
  9287. return n.toString(16)
  9288. }
  9289. function utf8ToBytes (string, units) {
  9290. units = units || Infinity
  9291. var codePoint
  9292. var length = string.length
  9293. var leadSurrogate = null
  9294. var bytes = []
  9295. for (var i = 0; i < length; ++i) {
  9296. codePoint = string.charCodeAt(i)
  9297. // is surrogate component
  9298. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  9299. // last char was a lead
  9300. if (!leadSurrogate) {
  9301. // no lead yet
  9302. if (codePoint > 0xDBFF) {
  9303. // unexpected trail
  9304. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  9305. continue
  9306. } else if (i + 1 === length) {
  9307. // unpaired lead
  9308. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  9309. continue
  9310. }
  9311. // valid lead
  9312. leadSurrogate = codePoint
  9313. continue
  9314. }
  9315. // 2 leads in a row
  9316. if (codePoint < 0xDC00) {
  9317. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  9318. leadSurrogate = codePoint
  9319. continue
  9320. }
  9321. // valid surrogate pair
  9322. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  9323. } else if (leadSurrogate) {
  9324. // valid bmp char, but last char was a lead
  9325. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  9326. }
  9327. leadSurrogate = null
  9328. // encode utf8
  9329. if (codePoint < 0x80) {
  9330. if ((units -= 1) < 0) break
  9331. bytes.push(codePoint)
  9332. } else if (codePoint < 0x800) {
  9333. if ((units -= 2) < 0) break
  9334. bytes.push(
  9335. codePoint >> 0x6 | 0xC0,
  9336. codePoint & 0x3F | 0x80
  9337. )
  9338. } else if (codePoint < 0x10000) {
  9339. if ((units -= 3) < 0) break
  9340. bytes.push(
  9341. codePoint >> 0xC | 0xE0,
  9342. codePoint >> 0x6 & 0x3F | 0x80,
  9343. codePoint & 0x3F | 0x80
  9344. )
  9345. } else if (codePoint < 0x110000) {
  9346. if ((units -= 4) < 0) break
  9347. bytes.push(
  9348. codePoint >> 0x12 | 0xF0,
  9349. codePoint >> 0xC & 0x3F | 0x80,
  9350. codePoint >> 0x6 & 0x3F | 0x80,
  9351. codePoint & 0x3F | 0x80
  9352. )
  9353. } else {
  9354. throw new Error('Invalid code point')
  9355. }
  9356. }
  9357. return bytes
  9358. }
  9359. function asciiToBytes (str) {
  9360. var byteArray = []
  9361. for (var i = 0; i < str.length; ++i) {
  9362. // Node's code seems to be doing this and not & 0x7F..
  9363. byteArray.push(str.charCodeAt(i) & 0xFF)
  9364. }
  9365. return byteArray
  9366. }
  9367. function utf16leToBytes (str, units) {
  9368. var c, hi, lo
  9369. var byteArray = []
  9370. for (var i = 0; i < str.length; ++i) {
  9371. if ((units -= 2) < 0) break
  9372. c = str.charCodeAt(i)
  9373. hi = c >> 8
  9374. lo = c % 256
  9375. byteArray.push(lo)
  9376. byteArray.push(hi)
  9377. }
  9378. return byteArray
  9379. }
  9380. function base64ToBytes (str) {
  9381. return base64.toByteArray(base64clean(str))
  9382. }
  9383. function blitBuffer (src, dst, offset, length) {
  9384. for (var i = 0; i < length; ++i) {
  9385. if ((i + offset >= dst.length) || (i >= src.length)) break
  9386. dst[i + offset] = src[i]
  9387. }
  9388. return i
  9389. }
  9390. function isnan (val) {
  9391. return val !== val // eslint-disable-line no-self-compare
  9392. }
  9393. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  9394. /***/ }),
  9395. /* 330 */
  9396. /***/ (function(module, exports) {
  9397. 'use strict'
  9398. exports.byteLength = byteLength
  9399. exports.toByteArray = toByteArray
  9400. exports.fromByteArray = fromByteArray
  9401. var lookup = []
  9402. var revLookup = []
  9403. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  9404. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  9405. for (var i = 0, len = code.length; i < len; ++i) {
  9406. lookup[i] = code[i]
  9407. revLookup[code.charCodeAt(i)] = i
  9408. }
  9409. // Support decoding URL-safe base64 strings, as Node.js does.
  9410. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  9411. revLookup['-'.charCodeAt(0)] = 62
  9412. revLookup['_'.charCodeAt(0)] = 63
  9413. function getLens (b64) {
  9414. var len = b64.length
  9415. if (len % 4 > 0) {
  9416. throw new Error('Invalid string. Length must be a multiple of 4')
  9417. }
  9418. // Trim off extra bytes after placeholder bytes are found
  9419. // See: https://github.com/beatgammit/base64-js/issues/42
  9420. var validLen = b64.indexOf('=')
  9421. if (validLen === -1) validLen = len
  9422. var placeHoldersLen = validLen === len
  9423. ? 0
  9424. : 4 - (validLen % 4)
  9425. return [validLen, placeHoldersLen]
  9426. }
  9427. // base64 is 4/3 + up to two characters of the original data
  9428. function byteLength (b64) {
  9429. var lens = getLens(b64)
  9430. var validLen = lens[0]
  9431. var placeHoldersLen = lens[1]
  9432. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  9433. }
  9434. function _byteLength (b64, validLen, placeHoldersLen) {
  9435. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  9436. }
  9437. function toByteArray (b64) {
  9438. var tmp
  9439. var lens = getLens(b64)
  9440. var validLen = lens[0]
  9441. var placeHoldersLen = lens[1]
  9442. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  9443. var curByte = 0
  9444. // if there are placeholders, only get up to the last complete 4 chars
  9445. var len = placeHoldersLen > 0
  9446. ? validLen - 4
  9447. : validLen
  9448. for (var i = 0; i < len; i += 4) {
  9449. tmp =
  9450. (revLookup[b64.charCodeAt(i)] << 18) |
  9451. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  9452. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  9453. revLookup[b64.charCodeAt(i + 3)]
  9454. arr[curByte++] = (tmp >> 16) & 0xFF
  9455. arr[curByte++] = (tmp >> 8) & 0xFF
  9456. arr[curByte++] = tmp & 0xFF
  9457. }
  9458. if (placeHoldersLen === 2) {
  9459. tmp =
  9460. (revLookup[b64.charCodeAt(i)] << 2) |
  9461. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  9462. arr[curByte++] = tmp & 0xFF
  9463. }
  9464. if (placeHoldersLen === 1) {
  9465. tmp =
  9466. (revLookup[b64.charCodeAt(i)] << 10) |
  9467. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  9468. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  9469. arr[curByte++] = (tmp >> 8) & 0xFF
  9470. arr[curByte++] = tmp & 0xFF
  9471. }
  9472. return arr
  9473. }
  9474. function tripletToBase64 (num) {
  9475. return lookup[num >> 18 & 0x3F] +
  9476. lookup[num >> 12 & 0x3F] +
  9477. lookup[num >> 6 & 0x3F] +
  9478. lookup[num & 0x3F]
  9479. }
  9480. function encodeChunk (uint8, start, end) {
  9481. var tmp
  9482. var output = []
  9483. for (var i = start; i < end; i += 3) {
  9484. tmp =
  9485. ((uint8[i] << 16) & 0xFF0000) +
  9486. ((uint8[i + 1] << 8) & 0xFF00) +
  9487. (uint8[i + 2] & 0xFF)
  9488. output.push(tripletToBase64(tmp))
  9489. }
  9490. return output.join('')
  9491. }
  9492. function fromByteArray (uint8) {
  9493. var tmp
  9494. var len = uint8.length
  9495. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  9496. var parts = []
  9497. var maxChunkLength = 16383 // must be multiple of 3
  9498. // go through the array every three bytes, we'll deal with trailing stuff later
  9499. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  9500. parts.push(encodeChunk(
  9501. uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
  9502. ))
  9503. }
  9504. // pad the end with zeros, but make sure to not forget the extra bytes
  9505. if (extraBytes === 1) {
  9506. tmp = uint8[len - 1]
  9507. parts.push(
  9508. lookup[tmp >> 2] +
  9509. lookup[(tmp << 4) & 0x3F] +
  9510. '=='
  9511. )
  9512. } else if (extraBytes === 2) {
  9513. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  9514. parts.push(
  9515. lookup[tmp >> 10] +
  9516. lookup[(tmp >> 4) & 0x3F] +
  9517. lookup[(tmp << 2) & 0x3F] +
  9518. '='
  9519. )
  9520. }
  9521. return parts.join('')
  9522. }
  9523. /***/ }),
  9524. /* 331 */
  9525. /***/ (function(module, exports) {
  9526. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  9527. var e, m
  9528. var eLen = (nBytes * 8) - mLen - 1
  9529. var eMax = (1 << eLen) - 1
  9530. var eBias = eMax >> 1
  9531. var nBits = -7
  9532. var i = isLE ? (nBytes - 1) : 0
  9533. var d = isLE ? -1 : 1
  9534. var s = buffer[offset + i]
  9535. i += d
  9536. e = s & ((1 << (-nBits)) - 1)
  9537. s >>= (-nBits)
  9538. nBits += eLen
  9539. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  9540. m = e & ((1 << (-nBits)) - 1)
  9541. e >>= (-nBits)
  9542. nBits += mLen
  9543. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  9544. if (e === 0) {
  9545. e = 1 - eBias
  9546. } else if (e === eMax) {
  9547. return m ? NaN : ((s ? -1 : 1) * Infinity)
  9548. } else {
  9549. m = m + Math.pow(2, mLen)
  9550. e = e - eBias
  9551. }
  9552. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  9553. }
  9554. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  9555. var e, m, c
  9556. var eLen = (nBytes * 8) - mLen - 1
  9557. var eMax = (1 << eLen) - 1
  9558. var eBias = eMax >> 1
  9559. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  9560. var i = isLE ? 0 : (nBytes - 1)
  9561. var d = isLE ? 1 : -1
  9562. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  9563. value = Math.abs(value)
  9564. if (isNaN(value) || value === Infinity) {
  9565. m = isNaN(value) ? 1 : 0
  9566. e = eMax
  9567. } else {
  9568. e = Math.floor(Math.log(value) / Math.LN2)
  9569. if (value * (c = Math.pow(2, -e)) < 1) {
  9570. e--
  9571. c *= 2
  9572. }
  9573. if (e + eBias >= 1) {
  9574. value += rt / c
  9575. } else {
  9576. value += rt * Math.pow(2, 1 - eBias)
  9577. }
  9578. if (value * c >= 2) {
  9579. e++
  9580. c /= 2
  9581. }
  9582. if (e + eBias >= eMax) {
  9583. m = 0
  9584. e = eMax
  9585. } else if (e + eBias >= 1) {
  9586. m = ((value * c) - 1) * Math.pow(2, mLen)
  9587. e = e + eBias
  9588. } else {
  9589. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  9590. e = 0
  9591. }
  9592. }
  9593. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  9594. e = (e << mLen) | m
  9595. eLen += mLen
  9596. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  9597. buffer[offset + i - d] |= s * 128
  9598. }
  9599. /***/ }),
  9600. /* 332 */
  9601. /***/ (function(module, exports) {
  9602. var toString = {}.toString;
  9603. module.exports = Array.isArray || function (arr) {
  9604. return toString.call(arr) == '[object Array]';
  9605. };
  9606. /***/ }),
  9607. /* 333 */
  9608. /***/ (function(module, exports) {
  9609. /* WEBPACK VAR INJECTION */(function(global) {'use strict';
  9610. // We have an ES6 Map available, return the native instance
  9611. if (typeof global.Map !== 'undefined') {
  9612. module.exports = global.Map;
  9613. module.exports.Map = global.Map;
  9614. } else {
  9615. // We will return a polyfill
  9616. var Map = function (array) {
  9617. this._keys = [];
  9618. this._values = {};
  9619. for (var i = 0; i < array.length; i++) {
  9620. if (array[i] == null) continue; // skip null and undefined
  9621. var entry = array[i];
  9622. var key = entry[0];
  9623. var value = entry[1];
  9624. // Add the key to the list of keys in order
  9625. this._keys.push(key);
  9626. // Add the key and value to the values dictionary with a point
  9627. // to the location in the ordered keys list
  9628. this._values[key] = { v: value, i: this._keys.length - 1 };
  9629. }
  9630. };
  9631. Map.prototype.clear = function () {
  9632. this._keys = [];
  9633. this._values = {};
  9634. };
  9635. Map.prototype.delete = function (key) {
  9636. var value = this._values[key];
  9637. if (value == null) return false;
  9638. // Delete entry
  9639. delete this._values[key];
  9640. // Remove the key from the ordered keys list
  9641. this._keys.splice(value.i, 1);
  9642. return true;
  9643. };
  9644. Map.prototype.entries = function () {
  9645. var self = this;
  9646. var index = 0;
  9647. return {
  9648. next: function () {
  9649. var key = self._keys[index++];
  9650. return {
  9651. value: key !== undefined ? [key, self._values[key].v] : undefined,
  9652. done: key !== undefined ? false : true
  9653. };
  9654. }
  9655. };
  9656. };
  9657. Map.prototype.forEach = function (callback, self) {
  9658. self = self || this;
  9659. for (var i = 0; i < this._keys.length; i++) {
  9660. var key = this._keys[i];
  9661. // Call the forEach callback
  9662. callback.call(self, this._values[key].v, key, self);
  9663. }
  9664. };
  9665. Map.prototype.get = function (key) {
  9666. return this._values[key] ? this._values[key].v : undefined;
  9667. };
  9668. Map.prototype.has = function (key) {
  9669. return this._values[key] != null;
  9670. };
  9671. Map.prototype.keys = function () {
  9672. var self = this;
  9673. var index = 0;
  9674. return {
  9675. next: function () {
  9676. var key = self._keys[index++];
  9677. return {
  9678. value: key !== undefined ? key : undefined,
  9679. done: key !== undefined ? false : true
  9680. };
  9681. }
  9682. };
  9683. };
  9684. Map.prototype.set = function (key, value) {
  9685. if (this._values[key]) {
  9686. this._values[key].v = value;
  9687. return this;
  9688. }
  9689. // Add the key to the list of keys in order
  9690. this._keys.push(key);
  9691. // Add the key and value to the values dictionary with a point
  9692. // to the location in the ordered keys list
  9693. this._values[key] = { v: value, i: this._keys.length - 1 };
  9694. return this;
  9695. };
  9696. Map.prototype.values = function () {
  9697. var self = this;
  9698. var index = 0;
  9699. return {
  9700. next: function () {
  9701. var key = self._keys[index++];
  9702. return {
  9703. value: key !== undefined ? self._values[key].v : undefined,
  9704. done: key !== undefined ? false : true
  9705. };
  9706. }
  9707. };
  9708. };
  9709. // Last ismaster
  9710. Object.defineProperty(Map.prototype, 'size', {
  9711. enumerable: true,
  9712. get: function () {
  9713. return this._keys.length;
  9714. }
  9715. });
  9716. module.exports = Map;
  9717. module.exports.Map = Map;
  9718. }
  9719. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  9720. /***/ }),
  9721. /* 334 */
  9722. /***/ (function(module, exports) {
  9723. // Licensed under the Apache License, Version 2.0 (the "License");
  9724. // you may not use this file except in compliance with the License.
  9725. // You may obtain a copy of the License at
  9726. //
  9727. // http://www.apache.org/licenses/LICENSE-2.0
  9728. //
  9729. // Unless required by applicable law or agreed to in writing, software
  9730. // distributed under the License is distributed on an "AS IS" BASIS,
  9731. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9732. // See the License for the specific language governing permissions and
  9733. // limitations under the License.
  9734. //
  9735. // Copyright 2009 Google Inc. All Rights Reserved
  9736. /**
  9737. * Defines a Long class for representing a 64-bit two's-complement
  9738. * integer value, which faithfully simulates the behavior of a Java "Long". This
  9739. * implementation is derived from LongLib in GWT.
  9740. *
  9741. * Constructs a 64-bit two's-complement integer, given its low and high 32-bit
  9742. * values as *signed* integers. See the from* functions below for more
  9743. * convenient ways of constructing Longs.
  9744. *
  9745. * The internal representation of a Long is the two given signed, 32-bit values.
  9746. * We use 32-bit pieces because these are the size of integers on which
  9747. * Javascript performs bit-operations. For operations like addition and
  9748. * multiplication, we split each number into 16-bit pieces, which can easily be
  9749. * multiplied within Javascript's floating-point representation without overflow
  9750. * or change in sign.
  9751. *
  9752. * In the algorithms below, we frequently reduce the negative case to the
  9753. * positive case by negating the input(s) and then post-processing the result.
  9754. * Note that we must ALWAYS check specially whether those values are MIN_VALUE
  9755. * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
  9756. * a positive number, it overflows back into a negative). Not handling this
  9757. * case would often result in infinite recursion.
  9758. *
  9759. * @class
  9760. * @param {number} low the low (signed) 32 bits of the Long.
  9761. * @param {number} high the high (signed) 32 bits of the Long.
  9762. * @return {Long}
  9763. */
  9764. function Long(low, high) {
  9765. if (!(this instanceof Long)) return new Long(low, high);
  9766. this._bsontype = 'Long';
  9767. /**
  9768. * @type {number}
  9769. * @ignore
  9770. */
  9771. this.low_ = low | 0; // force into 32 signed bits.
  9772. /**
  9773. * @type {number}
  9774. * @ignore
  9775. */
  9776. this.high_ = high | 0; // force into 32 signed bits.
  9777. }
  9778. /**
  9779. * Return the int value.
  9780. *
  9781. * @method
  9782. * @return {number} the value, assuming it is a 32-bit integer.
  9783. */
  9784. Long.prototype.toInt = function () {
  9785. return this.low_;
  9786. };
  9787. /**
  9788. * Return the Number value.
  9789. *
  9790. * @method
  9791. * @return {number} the closest floating-point representation to this value.
  9792. */
  9793. Long.prototype.toNumber = function () {
  9794. return this.high_ * Long.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();
  9795. };
  9796. /**
  9797. * Return the JSON value.
  9798. *
  9799. * @method
  9800. * @return {string} the JSON representation.
  9801. */
  9802. Long.prototype.toJSON = function () {
  9803. return this.toString();
  9804. };
  9805. /**
  9806. * Return the String value.
  9807. *
  9808. * @method
  9809. * @param {number} [opt_radix] the radix in which the text should be written.
  9810. * @return {string} the textual representation of this value.
  9811. */
  9812. Long.prototype.toString = function (opt_radix) {
  9813. var radix = opt_radix || 10;
  9814. if (radix < 2 || 36 < radix) {
  9815. throw Error('radix out of range: ' + radix);
  9816. }
  9817. if (this.isZero()) {
  9818. return '0';
  9819. }
  9820. if (this.isNegative()) {
  9821. if (this.equals(Long.MIN_VALUE)) {
  9822. // We need to change the Long value before it can be negated, so we remove
  9823. // the bottom-most digit in this base and then recurse to do the rest.
  9824. var radixLong = Long.fromNumber(radix);
  9825. var div = this.div(radixLong);
  9826. var rem = div.multiply(radixLong).subtract(this);
  9827. return div.toString(radix) + rem.toInt().toString(radix);
  9828. } else {
  9829. return '-' + this.negate().toString(radix);
  9830. }
  9831. }
  9832. // Do several (6) digits each time through the loop, so as to
  9833. // minimize the calls to the very expensive emulated div.
  9834. var radixToPower = Long.fromNumber(Math.pow(radix, 6));
  9835. rem = this;
  9836. var result = '';
  9837. while (!rem.isZero()) {
  9838. var remDiv = rem.div(radixToPower);
  9839. var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();
  9840. var digits = intval.toString(radix);
  9841. rem = remDiv;
  9842. if (rem.isZero()) {
  9843. return digits + result;
  9844. } else {
  9845. while (digits.length < 6) {
  9846. digits = '0' + digits;
  9847. }
  9848. result = '' + digits + result;
  9849. }
  9850. }
  9851. };
  9852. /**
  9853. * Return the high 32-bits value.
  9854. *
  9855. * @method
  9856. * @return {number} the high 32-bits as a signed value.
  9857. */
  9858. Long.prototype.getHighBits = function () {
  9859. return this.high_;
  9860. };
  9861. /**
  9862. * Return the low 32-bits value.
  9863. *
  9864. * @method
  9865. * @return {number} the low 32-bits as a signed value.
  9866. */
  9867. Long.prototype.getLowBits = function () {
  9868. return this.low_;
  9869. };
  9870. /**
  9871. * Return the low unsigned 32-bits value.
  9872. *
  9873. * @method
  9874. * @return {number} the low 32-bits as an unsigned value.
  9875. */
  9876. Long.prototype.getLowBitsUnsigned = function () {
  9877. return this.low_ >= 0 ? this.low_ : Long.TWO_PWR_32_DBL_ + this.low_;
  9878. };
  9879. /**
  9880. * Returns the number of bits needed to represent the absolute value of this Long.
  9881. *
  9882. * @method
  9883. * @return {number} Returns the number of bits needed to represent the absolute value of this Long.
  9884. */
  9885. Long.prototype.getNumBitsAbs = function () {
  9886. if (this.isNegative()) {
  9887. if (this.equals(Long.MIN_VALUE)) {
  9888. return 64;
  9889. } else {
  9890. return this.negate().getNumBitsAbs();
  9891. }
  9892. } else {
  9893. var val = this.high_ !== 0 ? this.high_ : this.low_;
  9894. for (var bit = 31; bit > 0; bit--) {
  9895. if ((val & 1 << bit) !== 0) {
  9896. break;
  9897. }
  9898. }
  9899. return this.high_ !== 0 ? bit + 33 : bit + 1;
  9900. }
  9901. };
  9902. /**
  9903. * Return whether this value is zero.
  9904. *
  9905. * @method
  9906. * @return {boolean} whether this value is zero.
  9907. */
  9908. Long.prototype.isZero = function () {
  9909. return this.high_ === 0 && this.low_ === 0;
  9910. };
  9911. /**
  9912. * Return whether this value is negative.
  9913. *
  9914. * @method
  9915. * @return {boolean} whether this value is negative.
  9916. */
  9917. Long.prototype.isNegative = function () {
  9918. return this.high_ < 0;
  9919. };
  9920. /**
  9921. * Return whether this value is odd.
  9922. *
  9923. * @method
  9924. * @return {boolean} whether this value is odd.
  9925. */
  9926. Long.prototype.isOdd = function () {
  9927. return (this.low_ & 1) === 1;
  9928. };
  9929. /**
  9930. * Return whether this Long equals the other
  9931. *
  9932. * @method
  9933. * @param {Long} other Long to compare against.
  9934. * @return {boolean} whether this Long equals the other
  9935. */
  9936. Long.prototype.equals = function (other) {
  9937. return this.high_ === other.high_ && this.low_ === other.low_;
  9938. };
  9939. /**
  9940. * Return whether this Long does not equal the other.
  9941. *
  9942. * @method
  9943. * @param {Long} other Long to compare against.
  9944. * @return {boolean} whether this Long does not equal the other.
  9945. */
  9946. Long.prototype.notEquals = function (other) {
  9947. return this.high_ !== other.high_ || this.low_ !== other.low_;
  9948. };
  9949. /**
  9950. * Return whether this Long is less than the other.
  9951. *
  9952. * @method
  9953. * @param {Long} other Long to compare against.
  9954. * @return {boolean} whether this Long is less than the other.
  9955. */
  9956. Long.prototype.lessThan = function (other) {
  9957. return this.compare(other) < 0;
  9958. };
  9959. /**
  9960. * Return whether this Long is less than or equal to the other.
  9961. *
  9962. * @method
  9963. * @param {Long} other Long to compare against.
  9964. * @return {boolean} whether this Long is less than or equal to the other.
  9965. */
  9966. Long.prototype.lessThanOrEqual = function (other) {
  9967. return this.compare(other) <= 0;
  9968. };
  9969. /**
  9970. * Return whether this Long is greater than the other.
  9971. *
  9972. * @method
  9973. * @param {Long} other Long to compare against.
  9974. * @return {boolean} whether this Long is greater than the other.
  9975. */
  9976. Long.prototype.greaterThan = function (other) {
  9977. return this.compare(other) > 0;
  9978. };
  9979. /**
  9980. * Return whether this Long is greater than or equal to the other.
  9981. *
  9982. * @method
  9983. * @param {Long} other Long to compare against.
  9984. * @return {boolean} whether this Long is greater than or equal to the other.
  9985. */
  9986. Long.prototype.greaterThanOrEqual = function (other) {
  9987. return this.compare(other) >= 0;
  9988. };
  9989. /**
  9990. * Compares this Long with the given one.
  9991. *
  9992. * @method
  9993. * @param {Long} other Long to compare against.
  9994. * @return {boolean} 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
  9995. */
  9996. Long.prototype.compare = function (other) {
  9997. if (this.equals(other)) {
  9998. return 0;
  9999. }
  10000. var thisNeg = this.isNegative();
  10001. var otherNeg = other.isNegative();
  10002. if (thisNeg && !otherNeg) {
  10003. return -1;
  10004. }
  10005. if (!thisNeg && otherNeg) {
  10006. return 1;
  10007. }
  10008. // at this point, the signs are the same, so subtraction will not overflow
  10009. if (this.subtract(other).isNegative()) {
  10010. return -1;
  10011. } else {
  10012. return 1;
  10013. }
  10014. };
  10015. /**
  10016. * The negation of this value.
  10017. *
  10018. * @method
  10019. * @return {Long} the negation of this value.
  10020. */
  10021. Long.prototype.negate = function () {
  10022. if (this.equals(Long.MIN_VALUE)) {
  10023. return Long.MIN_VALUE;
  10024. } else {
  10025. return this.not().add(Long.ONE);
  10026. }
  10027. };
  10028. /**
  10029. * Returns the sum of this and the given Long.
  10030. *
  10031. * @method
  10032. * @param {Long} other Long to add to this one.
  10033. * @return {Long} the sum of this and the given Long.
  10034. */
  10035. Long.prototype.add = function (other) {
  10036. // Divide each number into 4 chunks of 16 bits, and then sum the chunks.
  10037. var a48 = this.high_ >>> 16;
  10038. var a32 = this.high_ & 0xffff;
  10039. var a16 = this.low_ >>> 16;
  10040. var a00 = this.low_ & 0xffff;
  10041. var b48 = other.high_ >>> 16;
  10042. var b32 = other.high_ & 0xffff;
  10043. var b16 = other.low_ >>> 16;
  10044. var b00 = other.low_ & 0xffff;
  10045. var c48 = 0,
  10046. c32 = 0,
  10047. c16 = 0,
  10048. c00 = 0;
  10049. c00 += a00 + b00;
  10050. c16 += c00 >>> 16;
  10051. c00 &= 0xffff;
  10052. c16 += a16 + b16;
  10053. c32 += c16 >>> 16;
  10054. c16 &= 0xffff;
  10055. c32 += a32 + b32;
  10056. c48 += c32 >>> 16;
  10057. c32 &= 0xffff;
  10058. c48 += a48 + b48;
  10059. c48 &= 0xffff;
  10060. return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32);
  10061. };
  10062. /**
  10063. * Returns the difference of this and the given Long.
  10064. *
  10065. * @method
  10066. * @param {Long} other Long to subtract from this.
  10067. * @return {Long} the difference of this and the given Long.
  10068. */
  10069. Long.prototype.subtract = function (other) {
  10070. return this.add(other.negate());
  10071. };
  10072. /**
  10073. * Returns the product of this and the given Long.
  10074. *
  10075. * @method
  10076. * @param {Long} other Long to multiply with this.
  10077. * @return {Long} the product of this and the other.
  10078. */
  10079. Long.prototype.multiply = function (other) {
  10080. if (this.isZero()) {
  10081. return Long.ZERO;
  10082. } else if (other.isZero()) {
  10083. return Long.ZERO;
  10084. }
  10085. if (this.equals(Long.MIN_VALUE)) {
  10086. return other.isOdd() ? Long.MIN_VALUE : Long.ZERO;
  10087. } else if (other.equals(Long.MIN_VALUE)) {
  10088. return this.isOdd() ? Long.MIN_VALUE : Long.ZERO;
  10089. }
  10090. if (this.isNegative()) {
  10091. if (other.isNegative()) {
  10092. return this.negate().multiply(other.negate());
  10093. } else {
  10094. return this.negate().multiply(other).negate();
  10095. }
  10096. } else if (other.isNegative()) {
  10097. return this.multiply(other.negate()).negate();
  10098. }
  10099. // If both Longs are small, use float multiplication
  10100. if (this.lessThan(Long.TWO_PWR_24_) && other.lessThan(Long.TWO_PWR_24_)) {
  10101. return Long.fromNumber(this.toNumber() * other.toNumber());
  10102. }
  10103. // Divide each Long into 4 chunks of 16 bits, and then add up 4x4 products.
  10104. // We can skip products that would overflow.
  10105. var a48 = this.high_ >>> 16;
  10106. var a32 = this.high_ & 0xffff;
  10107. var a16 = this.low_ >>> 16;
  10108. var a00 = this.low_ & 0xffff;
  10109. var b48 = other.high_ >>> 16;
  10110. var b32 = other.high_ & 0xffff;
  10111. var b16 = other.low_ >>> 16;
  10112. var b00 = other.low_ & 0xffff;
  10113. var c48 = 0,
  10114. c32 = 0,
  10115. c16 = 0,
  10116. c00 = 0;
  10117. c00 += a00 * b00;
  10118. c16 += c00 >>> 16;
  10119. c00 &= 0xffff;
  10120. c16 += a16 * b00;
  10121. c32 += c16 >>> 16;
  10122. c16 &= 0xffff;
  10123. c16 += a00 * b16;
  10124. c32 += c16 >>> 16;
  10125. c16 &= 0xffff;
  10126. c32 += a32 * b00;
  10127. c48 += c32 >>> 16;
  10128. c32 &= 0xffff;
  10129. c32 += a16 * b16;
  10130. c48 += c32 >>> 16;
  10131. c32 &= 0xffff;
  10132. c32 += a00 * b32;
  10133. c48 += c32 >>> 16;
  10134. c32 &= 0xffff;
  10135. c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
  10136. c48 &= 0xffff;
  10137. return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32);
  10138. };
  10139. /**
  10140. * Returns this Long divided by the given one.
  10141. *
  10142. * @method
  10143. * @param {Long} other Long by which to divide.
  10144. * @return {Long} this Long divided by the given one.
  10145. */
  10146. Long.prototype.div = function (other) {
  10147. if (other.isZero()) {
  10148. throw Error('division by zero');
  10149. } else if (this.isZero()) {
  10150. return Long.ZERO;
  10151. }
  10152. if (this.equals(Long.MIN_VALUE)) {
  10153. if (other.equals(Long.ONE) || other.equals(Long.NEG_ONE)) {
  10154. return Long.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
  10155. } else if (other.equals(Long.MIN_VALUE)) {
  10156. return Long.ONE;
  10157. } else {
  10158. // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
  10159. var halfThis = this.shiftRight(1);
  10160. var approx = halfThis.div(other).shiftLeft(1);
  10161. if (approx.equals(Long.ZERO)) {
  10162. return other.isNegative() ? Long.ONE : Long.NEG_ONE;
  10163. } else {
  10164. var rem = this.subtract(other.multiply(approx));
  10165. var result = approx.add(rem.div(other));
  10166. return result;
  10167. }
  10168. }
  10169. } else if (other.equals(Long.MIN_VALUE)) {
  10170. return Long.ZERO;
  10171. }
  10172. if (this.isNegative()) {
  10173. if (other.isNegative()) {
  10174. return this.negate().div(other.negate());
  10175. } else {
  10176. return this.negate().div(other).negate();
  10177. }
  10178. } else if (other.isNegative()) {
  10179. return this.div(other.negate()).negate();
  10180. }
  10181. // Repeat the following until the remainder is less than other: find a
  10182. // floating-point that approximates remainder / other *from below*, add this
  10183. // into the result, and subtract it from the remainder. It is critical that
  10184. // the approximate value is less than or equal to the real value so that the
  10185. // remainder never becomes negative.
  10186. var res = Long.ZERO;
  10187. rem = this;
  10188. while (rem.greaterThanOrEqual(other)) {
  10189. // Approximate the result of division. This may be a little greater or
  10190. // smaller than the actual value.
  10191. approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));
  10192. // We will tweak the approximate result by changing it in the 48-th digit or
  10193. // the smallest non-fractional digit, whichever is larger.
  10194. var log2 = Math.ceil(Math.log(approx) / Math.LN2);
  10195. var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);
  10196. // Decrease the approximation until it is smaller than the remainder. Note
  10197. // that if it is too large, the product overflows and is negative.
  10198. var approxRes = Long.fromNumber(approx);
  10199. var approxRem = approxRes.multiply(other);
  10200. while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
  10201. approx -= delta;
  10202. approxRes = Long.fromNumber(approx);
  10203. approxRem = approxRes.multiply(other);
  10204. }
  10205. // We know the answer can't be zero... and actually, zero would cause
  10206. // infinite recursion since we would make no progress.
  10207. if (approxRes.isZero()) {
  10208. approxRes = Long.ONE;
  10209. }
  10210. res = res.add(approxRes);
  10211. rem = rem.subtract(approxRem);
  10212. }
  10213. return res;
  10214. };
  10215. /**
  10216. * Returns this Long modulo the given one.
  10217. *
  10218. * @method
  10219. * @param {Long} other Long by which to mod.
  10220. * @return {Long} this Long modulo the given one.
  10221. */
  10222. Long.prototype.modulo = function (other) {
  10223. return this.subtract(this.div(other).multiply(other));
  10224. };
  10225. /**
  10226. * The bitwise-NOT of this value.
  10227. *
  10228. * @method
  10229. * @return {Long} the bitwise-NOT of this value.
  10230. */
  10231. Long.prototype.not = function () {
  10232. return Long.fromBits(~this.low_, ~this.high_);
  10233. };
  10234. /**
  10235. * Returns the bitwise-AND of this Long and the given one.
  10236. *
  10237. * @method
  10238. * @param {Long} other the Long with which to AND.
  10239. * @return {Long} the bitwise-AND of this and the other.
  10240. */
  10241. Long.prototype.and = function (other) {
  10242. return Long.fromBits(this.low_ & other.low_, this.high_ & other.high_);
  10243. };
  10244. /**
  10245. * Returns the bitwise-OR of this Long and the given one.
  10246. *
  10247. * @method
  10248. * @param {Long} other the Long with which to OR.
  10249. * @return {Long} the bitwise-OR of this and the other.
  10250. */
  10251. Long.prototype.or = function (other) {
  10252. return Long.fromBits(this.low_ | other.low_, this.high_ | other.high_);
  10253. };
  10254. /**
  10255. * Returns the bitwise-XOR of this Long and the given one.
  10256. *
  10257. * @method
  10258. * @param {Long} other the Long with which to XOR.
  10259. * @return {Long} the bitwise-XOR of this and the other.
  10260. */
  10261. Long.prototype.xor = function (other) {
  10262. return Long.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);
  10263. };
  10264. /**
  10265. * Returns this Long with bits shifted to the left by the given amount.
  10266. *
  10267. * @method
  10268. * @param {number} numBits the number of bits by which to shift.
  10269. * @return {Long} this shifted to the left by the given amount.
  10270. */
  10271. Long.prototype.shiftLeft = function (numBits) {
  10272. numBits &= 63;
  10273. if (numBits === 0) {
  10274. return this;
  10275. } else {
  10276. var low = this.low_;
  10277. if (numBits < 32) {
  10278. var high = this.high_;
  10279. return Long.fromBits(low << numBits, high << numBits | low >>> 32 - numBits);
  10280. } else {
  10281. return Long.fromBits(0, low << numBits - 32);
  10282. }
  10283. }
  10284. };
  10285. /**
  10286. * Returns this Long with bits shifted to the right by the given amount.
  10287. *
  10288. * @method
  10289. * @param {number} numBits the number of bits by which to shift.
  10290. * @return {Long} this shifted to the right by the given amount.
  10291. */
  10292. Long.prototype.shiftRight = function (numBits) {
  10293. numBits &= 63;
  10294. if (numBits === 0) {
  10295. return this;
  10296. } else {
  10297. var high = this.high_;
  10298. if (numBits < 32) {
  10299. var low = this.low_;
  10300. return Long.fromBits(low >>> numBits | high << 32 - numBits, high >> numBits);
  10301. } else {
  10302. return Long.fromBits(high >> numBits - 32, high >= 0 ? 0 : -1);
  10303. }
  10304. }
  10305. };
  10306. /**
  10307. * Returns this Long with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
  10308. *
  10309. * @method
  10310. * @param {number} numBits the number of bits by which to shift.
  10311. * @return {Long} this shifted to the right by the given amount, with zeros placed into the new leading bits.
  10312. */
  10313. Long.prototype.shiftRightUnsigned = function (numBits) {
  10314. numBits &= 63;
  10315. if (numBits === 0) {
  10316. return this;
  10317. } else {
  10318. var high = this.high_;
  10319. if (numBits < 32) {
  10320. var low = this.low_;
  10321. return Long.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits);
  10322. } else if (numBits === 32) {
  10323. return Long.fromBits(high, 0);
  10324. } else {
  10325. return Long.fromBits(high >>> numBits - 32, 0);
  10326. }
  10327. }
  10328. };
  10329. /**
  10330. * Returns a Long representing the given (32-bit) integer value.
  10331. *
  10332. * @method
  10333. * @param {number} value the 32-bit integer in question.
  10334. * @return {Long} the corresponding Long value.
  10335. */
  10336. Long.fromInt = function (value) {
  10337. if (-128 <= value && value < 128) {
  10338. var cachedObj = Long.INT_CACHE_[value];
  10339. if (cachedObj) {
  10340. return cachedObj;
  10341. }
  10342. }
  10343. var obj = new Long(value | 0, value < 0 ? -1 : 0);
  10344. if (-128 <= value && value < 128) {
  10345. Long.INT_CACHE_[value] = obj;
  10346. }
  10347. return obj;
  10348. };
  10349. /**
  10350. * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
  10351. *
  10352. * @method
  10353. * @param {number} value the number in question.
  10354. * @return {Long} the corresponding Long value.
  10355. */
  10356. Long.fromNumber = function (value) {
  10357. if (isNaN(value) || !isFinite(value)) {
  10358. return Long.ZERO;
  10359. } else if (value <= -Long.TWO_PWR_63_DBL_) {
  10360. return Long.MIN_VALUE;
  10361. } else if (value + 1 >= Long.TWO_PWR_63_DBL_) {
  10362. return Long.MAX_VALUE;
  10363. } else if (value < 0) {
  10364. return Long.fromNumber(-value).negate();
  10365. } else {
  10366. return new Long(value % Long.TWO_PWR_32_DBL_ | 0, value / Long.TWO_PWR_32_DBL_ | 0);
  10367. }
  10368. };
  10369. /**
  10370. * Returns a Long representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
  10371. *
  10372. * @method
  10373. * @param {number} lowBits the low 32-bits.
  10374. * @param {number} highBits the high 32-bits.
  10375. * @return {Long} the corresponding Long value.
  10376. */
  10377. Long.fromBits = function (lowBits, highBits) {
  10378. return new Long(lowBits, highBits);
  10379. };
  10380. /**
  10381. * Returns a Long representation of the given string, written using the given radix.
  10382. *
  10383. * @method
  10384. * @param {string} str the textual representation of the Long.
  10385. * @param {number} opt_radix the radix in which the text is written.
  10386. * @return {Long} the corresponding Long value.
  10387. */
  10388. Long.fromString = function (str, opt_radix) {
  10389. if (str.length === 0) {
  10390. throw Error('number format error: empty string');
  10391. }
  10392. var radix = opt_radix || 10;
  10393. if (radix < 2 || 36 < radix) {
  10394. throw Error('radix out of range: ' + radix);
  10395. }
  10396. if (str.charAt(0) === '-') {
  10397. return Long.fromString(str.substring(1), radix).negate();
  10398. } else if (str.indexOf('-') >= 0) {
  10399. throw Error('number format error: interior "-" character: ' + str);
  10400. }
  10401. // Do several (8) digits each time through the loop, so as to
  10402. // minimize the calls to the very expensive emulated div.
  10403. var radixToPower = Long.fromNumber(Math.pow(radix, 8));
  10404. var result = Long.ZERO;
  10405. for (var i = 0; i < str.length; i += 8) {
  10406. var size = Math.min(8, str.length - i);
  10407. var value = parseInt(str.substring(i, i + size), radix);
  10408. if (size < 8) {
  10409. var power = Long.fromNumber(Math.pow(radix, size));
  10410. result = result.multiply(power).add(Long.fromNumber(value));
  10411. } else {
  10412. result = result.multiply(radixToPower);
  10413. result = result.add(Long.fromNumber(value));
  10414. }
  10415. }
  10416. return result;
  10417. };
  10418. // NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
  10419. // from* methods on which they depend.
  10420. /**
  10421. * A cache of the Long representations of small integer values.
  10422. * @type {Object}
  10423. * @ignore
  10424. */
  10425. Long.INT_CACHE_ = {};
  10426. // NOTE: the compiler should inline these constant values below and then remove
  10427. // these variables, so there should be no runtime penalty for these.
  10428. /**
  10429. * Number used repeated below in calculations. This must appear before the
  10430. * first call to any from* function below.
  10431. * @type {number}
  10432. * @ignore
  10433. */
  10434. Long.TWO_PWR_16_DBL_ = 1 << 16;
  10435. /**
  10436. * @type {number}
  10437. * @ignore
  10438. */
  10439. Long.TWO_PWR_24_DBL_ = 1 << 24;
  10440. /**
  10441. * @type {number}
  10442. * @ignore
  10443. */
  10444. Long.TWO_PWR_32_DBL_ = Long.TWO_PWR_16_DBL_ * Long.TWO_PWR_16_DBL_;
  10445. /**
  10446. * @type {number}
  10447. * @ignore
  10448. */
  10449. Long.TWO_PWR_31_DBL_ = Long.TWO_PWR_32_DBL_ / 2;
  10450. /**
  10451. * @type {number}
  10452. * @ignore
  10453. */
  10454. Long.TWO_PWR_48_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_16_DBL_;
  10455. /**
  10456. * @type {number}
  10457. * @ignore
  10458. */
  10459. Long.TWO_PWR_64_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_32_DBL_;
  10460. /**
  10461. * @type {number}
  10462. * @ignore
  10463. */
  10464. Long.TWO_PWR_63_DBL_ = Long.TWO_PWR_64_DBL_ / 2;
  10465. /** @type {Long} */
  10466. Long.ZERO = Long.fromInt(0);
  10467. /** @type {Long} */
  10468. Long.ONE = Long.fromInt(1);
  10469. /** @type {Long} */
  10470. Long.NEG_ONE = Long.fromInt(-1);
  10471. /** @type {Long} */
  10472. Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0);
  10473. /** @type {Long} */
  10474. Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0);
  10475. /**
  10476. * @type {Long}
  10477. * @ignore
  10478. */
  10479. Long.TWO_PWR_24_ = Long.fromInt(1 << 24);
  10480. /**
  10481. * Expose.
  10482. */
  10483. module.exports = Long;
  10484. module.exports.Long = Long;
  10485. /***/ }),
  10486. /* 335 */
  10487. /***/ (function(module, exports) {
  10488. /**
  10489. * A class representation of the BSON Double type.
  10490. *
  10491. * @class
  10492. * @param {number} value the number we want to represent as a double.
  10493. * @return {Double}
  10494. */
  10495. function Double(value) {
  10496. if (!(this instanceof Double)) return new Double(value);
  10497. this._bsontype = 'Double';
  10498. this.value = value;
  10499. }
  10500. /**
  10501. * Access the number value.
  10502. *
  10503. * @method
  10504. * @return {number} returns the wrapped double number.
  10505. */
  10506. Double.prototype.valueOf = function () {
  10507. return this.value;
  10508. };
  10509. /**
  10510. * @ignore
  10511. */
  10512. Double.prototype.toJSON = function () {
  10513. return this.value;
  10514. };
  10515. module.exports = Double;
  10516. module.exports.Double = Double;
  10517. /***/ }),
  10518. /* 336 */
  10519. /***/ (function(module, exports) {
  10520. // Licensed under the Apache License, Version 2.0 (the "License");
  10521. // you may not use this file except in compliance with the License.
  10522. // You may obtain a copy of the License at
  10523. //
  10524. // http://www.apache.org/licenses/LICENSE-2.0
  10525. //
  10526. // Unless required by applicable law or agreed to in writing, software
  10527. // distributed under the License is distributed on an "AS IS" BASIS,
  10528. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10529. // See the License for the specific language governing permissions and
  10530. // limitations under the License.
  10531. //
  10532. // Copyright 2009 Google Inc. All Rights Reserved
  10533. /**
  10534. * This type is for INTERNAL use in MongoDB only and should not be used in applications.
  10535. * The appropriate corresponding type is the JavaScript Date type.
  10536. *
  10537. * Defines a Timestamp class for representing a 64-bit two's-complement
  10538. * integer value, which faithfully simulates the behavior of a Java "Timestamp". This
  10539. * implementation is derived from TimestampLib in GWT.
  10540. *
  10541. * Constructs a 64-bit two's-complement integer, given its low and high 32-bit
  10542. * values as *signed* integers. See the from* functions below for more
  10543. * convenient ways of constructing Timestamps.
  10544. *
  10545. * The internal representation of a Timestamp is the two given signed, 32-bit values.
  10546. * We use 32-bit pieces because these are the size of integers on which
  10547. * Javascript performs bit-operations. For operations like addition and
  10548. * multiplication, we split each number into 16-bit pieces, which can easily be
  10549. * multiplied within Javascript's floating-point representation without overflow
  10550. * or change in sign.
  10551. *
  10552. * In the algorithms below, we frequently reduce the negative case to the
  10553. * positive case by negating the input(s) and then post-processing the result.
  10554. * Note that we must ALWAYS check specially whether those values are MIN_VALUE
  10555. * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
  10556. * a positive number, it overflows back into a negative). Not handling this
  10557. * case would often result in infinite recursion.
  10558. *
  10559. * @class
  10560. * @param {number} low the low (signed) 32 bits of the Timestamp.
  10561. * @param {number} high the high (signed) 32 bits of the Timestamp.
  10562. */
  10563. function Timestamp(low, high) {
  10564. if (!(this instanceof Timestamp)) return new Timestamp(low, high);
  10565. this._bsontype = 'Timestamp';
  10566. /**
  10567. * @type {number}
  10568. * @ignore
  10569. */
  10570. this.low_ = low | 0; // force into 32 signed bits.
  10571. /**
  10572. * @type {number}
  10573. * @ignore
  10574. */
  10575. this.high_ = high | 0; // force into 32 signed bits.
  10576. }
  10577. /**
  10578. * Return the int value.
  10579. *
  10580. * @return {number} the value, assuming it is a 32-bit integer.
  10581. */
  10582. Timestamp.prototype.toInt = function () {
  10583. return this.low_;
  10584. };
  10585. /**
  10586. * Return the Number value.
  10587. *
  10588. * @method
  10589. * @return {number} the closest floating-point representation to this value.
  10590. */
  10591. Timestamp.prototype.toNumber = function () {
  10592. return this.high_ * Timestamp.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();
  10593. };
  10594. /**
  10595. * Return the JSON value.
  10596. *
  10597. * @method
  10598. * @return {string} the JSON representation.
  10599. */
  10600. Timestamp.prototype.toJSON = function () {
  10601. return this.toString();
  10602. };
  10603. /**
  10604. * Return the String value.
  10605. *
  10606. * @method
  10607. * @param {number} [opt_radix] the radix in which the text should be written.
  10608. * @return {string} the textual representation of this value.
  10609. */
  10610. Timestamp.prototype.toString = function (opt_radix) {
  10611. var radix = opt_radix || 10;
  10612. if (radix < 2 || 36 < radix) {
  10613. throw Error('radix out of range: ' + radix);
  10614. }
  10615. if (this.isZero()) {
  10616. return '0';
  10617. }
  10618. if (this.isNegative()) {
  10619. if (this.equals(Timestamp.MIN_VALUE)) {
  10620. // We need to change the Timestamp value before it can be negated, so we remove
  10621. // the bottom-most digit in this base and then recurse to do the rest.
  10622. var radixTimestamp = Timestamp.fromNumber(radix);
  10623. var div = this.div(radixTimestamp);
  10624. var rem = div.multiply(radixTimestamp).subtract(this);
  10625. return div.toString(radix) + rem.toInt().toString(radix);
  10626. } else {
  10627. return '-' + this.negate().toString(radix);
  10628. }
  10629. }
  10630. // Do several (6) digits each time through the loop, so as to
  10631. // minimize the calls to the very expensive emulated div.
  10632. var radixToPower = Timestamp.fromNumber(Math.pow(radix, 6));
  10633. rem = this;
  10634. var result = '';
  10635. while (!rem.isZero()) {
  10636. var remDiv = rem.div(radixToPower);
  10637. var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();
  10638. var digits = intval.toString(radix);
  10639. rem = remDiv;
  10640. if (rem.isZero()) {
  10641. return digits + result;
  10642. } else {
  10643. while (digits.length < 6) {
  10644. digits = '0' + digits;
  10645. }
  10646. result = '' + digits + result;
  10647. }
  10648. }
  10649. };
  10650. /**
  10651. * Return the high 32-bits value.
  10652. *
  10653. * @method
  10654. * @return {number} the high 32-bits as a signed value.
  10655. */
  10656. Timestamp.prototype.getHighBits = function () {
  10657. return this.high_;
  10658. };
  10659. /**
  10660. * Return the low 32-bits value.
  10661. *
  10662. * @method
  10663. * @return {number} the low 32-bits as a signed value.
  10664. */
  10665. Timestamp.prototype.getLowBits = function () {
  10666. return this.low_;
  10667. };
  10668. /**
  10669. * Return the low unsigned 32-bits value.
  10670. *
  10671. * @method
  10672. * @return {number} the low 32-bits as an unsigned value.
  10673. */
  10674. Timestamp.prototype.getLowBitsUnsigned = function () {
  10675. return this.low_ >= 0 ? this.low_ : Timestamp.TWO_PWR_32_DBL_ + this.low_;
  10676. };
  10677. /**
  10678. * Returns the number of bits needed to represent the absolute value of this Timestamp.
  10679. *
  10680. * @method
  10681. * @return {number} Returns the number of bits needed to represent the absolute value of this Timestamp.
  10682. */
  10683. Timestamp.prototype.getNumBitsAbs = function () {
  10684. if (this.isNegative()) {
  10685. if (this.equals(Timestamp.MIN_VALUE)) {
  10686. return 64;
  10687. } else {
  10688. return this.negate().getNumBitsAbs();
  10689. }
  10690. } else {
  10691. var val = this.high_ !== 0 ? this.high_ : this.low_;
  10692. for (var bit = 31; bit > 0; bit--) {
  10693. if ((val & 1 << bit) !== 0) {
  10694. break;
  10695. }
  10696. }
  10697. return this.high_ !== 0 ? bit + 33 : bit + 1;
  10698. }
  10699. };
  10700. /**
  10701. * Return whether this value is zero.
  10702. *
  10703. * @method
  10704. * @return {boolean} whether this value is zero.
  10705. */
  10706. Timestamp.prototype.isZero = function () {
  10707. return this.high_ === 0 && this.low_ === 0;
  10708. };
  10709. /**
  10710. * Return whether this value is negative.
  10711. *
  10712. * @method
  10713. * @return {boolean} whether this value is negative.
  10714. */
  10715. Timestamp.prototype.isNegative = function () {
  10716. return this.high_ < 0;
  10717. };
  10718. /**
  10719. * Return whether this value is odd.
  10720. *
  10721. * @method
  10722. * @return {boolean} whether this value is odd.
  10723. */
  10724. Timestamp.prototype.isOdd = function () {
  10725. return (this.low_ & 1) === 1;
  10726. };
  10727. /**
  10728. * Return whether this Timestamp equals the other
  10729. *
  10730. * @method
  10731. * @param {Timestamp} other Timestamp to compare against.
  10732. * @return {boolean} whether this Timestamp equals the other
  10733. */
  10734. Timestamp.prototype.equals = function (other) {
  10735. return this.high_ === other.high_ && this.low_ === other.low_;
  10736. };
  10737. /**
  10738. * Return whether this Timestamp does not equal the other.
  10739. *
  10740. * @method
  10741. * @param {Timestamp} other Timestamp to compare against.
  10742. * @return {boolean} whether this Timestamp does not equal the other.
  10743. */
  10744. Timestamp.prototype.notEquals = function (other) {
  10745. return this.high_ !== other.high_ || this.low_ !== other.low_;
  10746. };
  10747. /**
  10748. * Return whether this Timestamp is less than the other.
  10749. *
  10750. * @method
  10751. * @param {Timestamp} other Timestamp to compare against.
  10752. * @return {boolean} whether this Timestamp is less than the other.
  10753. */
  10754. Timestamp.prototype.lessThan = function (other) {
  10755. return this.compare(other) < 0;
  10756. };
  10757. /**
  10758. * Return whether this Timestamp is less than or equal to the other.
  10759. *
  10760. * @method
  10761. * @param {Timestamp} other Timestamp to compare against.
  10762. * @return {boolean} whether this Timestamp is less than or equal to the other.
  10763. */
  10764. Timestamp.prototype.lessThanOrEqual = function (other) {
  10765. return this.compare(other) <= 0;
  10766. };
  10767. /**
  10768. * Return whether this Timestamp is greater than the other.
  10769. *
  10770. * @method
  10771. * @param {Timestamp} other Timestamp to compare against.
  10772. * @return {boolean} whether this Timestamp is greater than the other.
  10773. */
  10774. Timestamp.prototype.greaterThan = function (other) {
  10775. return this.compare(other) > 0;
  10776. };
  10777. /**
  10778. * Return whether this Timestamp is greater than or equal to the other.
  10779. *
  10780. * @method
  10781. * @param {Timestamp} other Timestamp to compare against.
  10782. * @return {boolean} whether this Timestamp is greater than or equal to the other.
  10783. */
  10784. Timestamp.prototype.greaterThanOrEqual = function (other) {
  10785. return this.compare(other) >= 0;
  10786. };
  10787. /**
  10788. * Compares this Timestamp with the given one.
  10789. *
  10790. * @method
  10791. * @param {Timestamp} other Timestamp to compare against.
  10792. * @return {boolean} 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
  10793. */
  10794. Timestamp.prototype.compare = function (other) {
  10795. if (this.equals(other)) {
  10796. return 0;
  10797. }
  10798. var thisNeg = this.isNegative();
  10799. var otherNeg = other.isNegative();
  10800. if (thisNeg && !otherNeg) {
  10801. return -1;
  10802. }
  10803. if (!thisNeg && otherNeg) {
  10804. return 1;
  10805. }
  10806. // at this point, the signs are the same, so subtraction will not overflow
  10807. if (this.subtract(other).isNegative()) {
  10808. return -1;
  10809. } else {
  10810. return 1;
  10811. }
  10812. };
  10813. /**
  10814. * The negation of this value.
  10815. *
  10816. * @method
  10817. * @return {Timestamp} the negation of this value.
  10818. */
  10819. Timestamp.prototype.negate = function () {
  10820. if (this.equals(Timestamp.MIN_VALUE)) {
  10821. return Timestamp.MIN_VALUE;
  10822. } else {
  10823. return this.not().add(Timestamp.ONE);
  10824. }
  10825. };
  10826. /**
  10827. * Returns the sum of this and the given Timestamp.
  10828. *
  10829. * @method
  10830. * @param {Timestamp} other Timestamp to add to this one.
  10831. * @return {Timestamp} the sum of this and the given Timestamp.
  10832. */
  10833. Timestamp.prototype.add = function (other) {
  10834. // Divide each number into 4 chunks of 16 bits, and then sum the chunks.
  10835. var a48 = this.high_ >>> 16;
  10836. var a32 = this.high_ & 0xffff;
  10837. var a16 = this.low_ >>> 16;
  10838. var a00 = this.low_ & 0xffff;
  10839. var b48 = other.high_ >>> 16;
  10840. var b32 = other.high_ & 0xffff;
  10841. var b16 = other.low_ >>> 16;
  10842. var b00 = other.low_ & 0xffff;
  10843. var c48 = 0,
  10844. c32 = 0,
  10845. c16 = 0,
  10846. c00 = 0;
  10847. c00 += a00 + b00;
  10848. c16 += c00 >>> 16;
  10849. c00 &= 0xffff;
  10850. c16 += a16 + b16;
  10851. c32 += c16 >>> 16;
  10852. c16 &= 0xffff;
  10853. c32 += a32 + b32;
  10854. c48 += c32 >>> 16;
  10855. c32 &= 0xffff;
  10856. c48 += a48 + b48;
  10857. c48 &= 0xffff;
  10858. return Timestamp.fromBits(c16 << 16 | c00, c48 << 16 | c32);
  10859. };
  10860. /**
  10861. * Returns the difference of this and the given Timestamp.
  10862. *
  10863. * @method
  10864. * @param {Timestamp} other Timestamp to subtract from this.
  10865. * @return {Timestamp} the difference of this and the given Timestamp.
  10866. */
  10867. Timestamp.prototype.subtract = function (other) {
  10868. return this.add(other.negate());
  10869. };
  10870. /**
  10871. * Returns the product of this and the given Timestamp.
  10872. *
  10873. * @method
  10874. * @param {Timestamp} other Timestamp to multiply with this.
  10875. * @return {Timestamp} the product of this and the other.
  10876. */
  10877. Timestamp.prototype.multiply = function (other) {
  10878. if (this.isZero()) {
  10879. return Timestamp.ZERO;
  10880. } else if (other.isZero()) {
  10881. return Timestamp.ZERO;
  10882. }
  10883. if (this.equals(Timestamp.MIN_VALUE)) {
  10884. return other.isOdd() ? Timestamp.MIN_VALUE : Timestamp.ZERO;
  10885. } else if (other.equals(Timestamp.MIN_VALUE)) {
  10886. return this.isOdd() ? Timestamp.MIN_VALUE : Timestamp.ZERO;
  10887. }
  10888. if (this.isNegative()) {
  10889. if (other.isNegative()) {
  10890. return this.negate().multiply(other.negate());
  10891. } else {
  10892. return this.negate().multiply(other).negate();
  10893. }
  10894. } else if (other.isNegative()) {
  10895. return this.multiply(other.negate()).negate();
  10896. }
  10897. // If both Timestamps are small, use float multiplication
  10898. if (this.lessThan(Timestamp.TWO_PWR_24_) && other.lessThan(Timestamp.TWO_PWR_24_)) {
  10899. return Timestamp.fromNumber(this.toNumber() * other.toNumber());
  10900. }
  10901. // Divide each Timestamp into 4 chunks of 16 bits, and then add up 4x4 products.
  10902. // We can skip products that would overflow.
  10903. var a48 = this.high_ >>> 16;
  10904. var a32 = this.high_ & 0xffff;
  10905. var a16 = this.low_ >>> 16;
  10906. var a00 = this.low_ & 0xffff;
  10907. var b48 = other.high_ >>> 16;
  10908. var b32 = other.high_ & 0xffff;
  10909. var b16 = other.low_ >>> 16;
  10910. var b00 = other.low_ & 0xffff;
  10911. var c48 = 0,
  10912. c32 = 0,
  10913. c16 = 0,
  10914. c00 = 0;
  10915. c00 += a00 * b00;
  10916. c16 += c00 >>> 16;
  10917. c00 &= 0xffff;
  10918. c16 += a16 * b00;
  10919. c32 += c16 >>> 16;
  10920. c16 &= 0xffff;
  10921. c16 += a00 * b16;
  10922. c32 += c16 >>> 16;
  10923. c16 &= 0xffff;
  10924. c32 += a32 * b00;
  10925. c48 += c32 >>> 16;
  10926. c32 &= 0xffff;
  10927. c32 += a16 * b16;
  10928. c48 += c32 >>> 16;
  10929. c32 &= 0xffff;
  10930. c32 += a00 * b32;
  10931. c48 += c32 >>> 16;
  10932. c32 &= 0xffff;
  10933. c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
  10934. c48 &= 0xffff;
  10935. return Timestamp.fromBits(c16 << 16 | c00, c48 << 16 | c32);
  10936. };
  10937. /**
  10938. * Returns this Timestamp divided by the given one.
  10939. *
  10940. * @method
  10941. * @param {Timestamp} other Timestamp by which to divide.
  10942. * @return {Timestamp} this Timestamp divided by the given one.
  10943. */
  10944. Timestamp.prototype.div = function (other) {
  10945. if (other.isZero()) {
  10946. throw Error('division by zero');
  10947. } else if (this.isZero()) {
  10948. return Timestamp.ZERO;
  10949. }
  10950. if (this.equals(Timestamp.MIN_VALUE)) {
  10951. if (other.equals(Timestamp.ONE) || other.equals(Timestamp.NEG_ONE)) {
  10952. return Timestamp.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
  10953. } else if (other.equals(Timestamp.MIN_VALUE)) {
  10954. return Timestamp.ONE;
  10955. } else {
  10956. // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
  10957. var halfThis = this.shiftRight(1);
  10958. var approx = halfThis.div(other).shiftLeft(1);
  10959. if (approx.equals(Timestamp.ZERO)) {
  10960. return other.isNegative() ? Timestamp.ONE : Timestamp.NEG_ONE;
  10961. } else {
  10962. var rem = this.subtract(other.multiply(approx));
  10963. var result = approx.add(rem.div(other));
  10964. return result;
  10965. }
  10966. }
  10967. } else if (other.equals(Timestamp.MIN_VALUE)) {
  10968. return Timestamp.ZERO;
  10969. }
  10970. if (this.isNegative()) {
  10971. if (other.isNegative()) {
  10972. return this.negate().div(other.negate());
  10973. } else {
  10974. return this.negate().div(other).negate();
  10975. }
  10976. } else if (other.isNegative()) {
  10977. return this.div(other.negate()).negate();
  10978. }
  10979. // Repeat the following until the remainder is less than other: find a
  10980. // floating-point that approximates remainder / other *from below*, add this
  10981. // into the result, and subtract it from the remainder. It is critical that
  10982. // the approximate value is less than or equal to the real value so that the
  10983. // remainder never becomes negative.
  10984. var res = Timestamp.ZERO;
  10985. rem = this;
  10986. while (rem.greaterThanOrEqual(other)) {
  10987. // Approximate the result of division. This may be a little greater or
  10988. // smaller than the actual value.
  10989. approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));
  10990. // We will tweak the approximate result by changing it in the 48-th digit or
  10991. // the smallest non-fractional digit, whichever is larger.
  10992. var log2 = Math.ceil(Math.log(approx) / Math.LN2);
  10993. var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);
  10994. // Decrease the approximation until it is smaller than the remainder. Note
  10995. // that if it is too large, the product overflows and is negative.
  10996. var approxRes = Timestamp.fromNumber(approx);
  10997. var approxRem = approxRes.multiply(other);
  10998. while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
  10999. approx -= delta;
  11000. approxRes = Timestamp.fromNumber(approx);
  11001. approxRem = approxRes.multiply(other);
  11002. }
  11003. // We know the answer can't be zero... and actually, zero would cause
  11004. // infinite recursion since we would make no progress.
  11005. if (approxRes.isZero()) {
  11006. approxRes = Timestamp.ONE;
  11007. }
  11008. res = res.add(approxRes);
  11009. rem = rem.subtract(approxRem);
  11010. }
  11011. return res;
  11012. };
  11013. /**
  11014. * Returns this Timestamp modulo the given one.
  11015. *
  11016. * @method
  11017. * @param {Timestamp} other Timestamp by which to mod.
  11018. * @return {Timestamp} this Timestamp modulo the given one.
  11019. */
  11020. Timestamp.prototype.modulo = function (other) {
  11021. return this.subtract(this.div(other).multiply(other));
  11022. };
  11023. /**
  11024. * The bitwise-NOT of this value.
  11025. *
  11026. * @method
  11027. * @return {Timestamp} the bitwise-NOT of this value.
  11028. */
  11029. Timestamp.prototype.not = function () {
  11030. return Timestamp.fromBits(~this.low_, ~this.high_);
  11031. };
  11032. /**
  11033. * Returns the bitwise-AND of this Timestamp and the given one.
  11034. *
  11035. * @method
  11036. * @param {Timestamp} other the Timestamp with which to AND.
  11037. * @return {Timestamp} the bitwise-AND of this and the other.
  11038. */
  11039. Timestamp.prototype.and = function (other) {
  11040. return Timestamp.fromBits(this.low_ & other.low_, this.high_ & other.high_);
  11041. };
  11042. /**
  11043. * Returns the bitwise-OR of this Timestamp and the given one.
  11044. *
  11045. * @method
  11046. * @param {Timestamp} other the Timestamp with which to OR.
  11047. * @return {Timestamp} the bitwise-OR of this and the other.
  11048. */
  11049. Timestamp.prototype.or = function (other) {
  11050. return Timestamp.fromBits(this.low_ | other.low_, this.high_ | other.high_);
  11051. };
  11052. /**
  11053. * Returns the bitwise-XOR of this Timestamp and the given one.
  11054. *
  11055. * @method
  11056. * @param {Timestamp} other the Timestamp with which to XOR.
  11057. * @return {Timestamp} the bitwise-XOR of this and the other.
  11058. */
  11059. Timestamp.prototype.xor = function (other) {
  11060. return Timestamp.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);
  11061. };
  11062. /**
  11063. * Returns this Timestamp with bits shifted to the left by the given amount.
  11064. *
  11065. * @method
  11066. * @param {number} numBits the number of bits by which to shift.
  11067. * @return {Timestamp} this shifted to the left by the given amount.
  11068. */
  11069. Timestamp.prototype.shiftLeft = function (numBits) {
  11070. numBits &= 63;
  11071. if (numBits === 0) {
  11072. return this;
  11073. } else {
  11074. var low = this.low_;
  11075. if (numBits < 32) {
  11076. var high = this.high_;
  11077. return Timestamp.fromBits(low << numBits, high << numBits | low >>> 32 - numBits);
  11078. } else {
  11079. return Timestamp.fromBits(0, low << numBits - 32);
  11080. }
  11081. }
  11082. };
  11083. /**
  11084. * Returns this Timestamp with bits shifted to the right by the given amount.
  11085. *
  11086. * @method
  11087. * @param {number} numBits the number of bits by which to shift.
  11088. * @return {Timestamp} this shifted to the right by the given amount.
  11089. */
  11090. Timestamp.prototype.shiftRight = function (numBits) {
  11091. numBits &= 63;
  11092. if (numBits === 0) {
  11093. return this;
  11094. } else {
  11095. var high = this.high_;
  11096. if (numBits < 32) {
  11097. var low = this.low_;
  11098. return Timestamp.fromBits(low >>> numBits | high << 32 - numBits, high >> numBits);
  11099. } else {
  11100. return Timestamp.fromBits(high >> numBits - 32, high >= 0 ? 0 : -1);
  11101. }
  11102. }
  11103. };
  11104. /**
  11105. * Returns this Timestamp with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
  11106. *
  11107. * @method
  11108. * @param {number} numBits the number of bits by which to shift.
  11109. * @return {Timestamp} this shifted to the right by the given amount, with zeros placed into the new leading bits.
  11110. */
  11111. Timestamp.prototype.shiftRightUnsigned = function (numBits) {
  11112. numBits &= 63;
  11113. if (numBits === 0) {
  11114. return this;
  11115. } else {
  11116. var high = this.high_;
  11117. if (numBits < 32) {
  11118. var low = this.low_;
  11119. return Timestamp.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits);
  11120. } else if (numBits === 32) {
  11121. return Timestamp.fromBits(high, 0);
  11122. } else {
  11123. return Timestamp.fromBits(high >>> numBits - 32, 0);
  11124. }
  11125. }
  11126. };
  11127. /**
  11128. * Returns a Timestamp representing the given (32-bit) integer value.
  11129. *
  11130. * @method
  11131. * @param {number} value the 32-bit integer in question.
  11132. * @return {Timestamp} the corresponding Timestamp value.
  11133. */
  11134. Timestamp.fromInt = function (value) {
  11135. if (-128 <= value && value < 128) {
  11136. var cachedObj = Timestamp.INT_CACHE_[value];
  11137. if (cachedObj) {
  11138. return cachedObj;
  11139. }
  11140. }
  11141. var obj = new Timestamp(value | 0, value < 0 ? -1 : 0);
  11142. if (-128 <= value && value < 128) {
  11143. Timestamp.INT_CACHE_[value] = obj;
  11144. }
  11145. return obj;
  11146. };
  11147. /**
  11148. * Returns a Timestamp representing the given value, provided that it is a finite number. Otherwise, zero is returned.
  11149. *
  11150. * @method
  11151. * @param {number} value the number in question.
  11152. * @return {Timestamp} the corresponding Timestamp value.
  11153. */
  11154. Timestamp.fromNumber = function (value) {
  11155. if (isNaN(value) || !isFinite(value)) {
  11156. return Timestamp.ZERO;
  11157. } else if (value <= -Timestamp.TWO_PWR_63_DBL_) {
  11158. return Timestamp.MIN_VALUE;
  11159. } else if (value + 1 >= Timestamp.TWO_PWR_63_DBL_) {
  11160. return Timestamp.MAX_VALUE;
  11161. } else if (value < 0) {
  11162. return Timestamp.fromNumber(-value).negate();
  11163. } else {
  11164. return new Timestamp(value % Timestamp.TWO_PWR_32_DBL_ | 0, value / Timestamp.TWO_PWR_32_DBL_ | 0);
  11165. }
  11166. };
  11167. /**
  11168. * Returns a Timestamp representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
  11169. *
  11170. * @method
  11171. * @param {number} lowBits the low 32-bits.
  11172. * @param {number} highBits the high 32-bits.
  11173. * @return {Timestamp} the corresponding Timestamp value.
  11174. */
  11175. Timestamp.fromBits = function (lowBits, highBits) {
  11176. return new Timestamp(lowBits, highBits);
  11177. };
  11178. /**
  11179. * Returns a Timestamp representation of the given string, written using the given radix.
  11180. *
  11181. * @method
  11182. * @param {string} str the textual representation of the Timestamp.
  11183. * @param {number} opt_radix the radix in which the text is written.
  11184. * @return {Timestamp} the corresponding Timestamp value.
  11185. */
  11186. Timestamp.fromString = function (str, opt_radix) {
  11187. if (str.length === 0) {
  11188. throw Error('number format error: empty string');
  11189. }
  11190. var radix = opt_radix || 10;
  11191. if (radix < 2 || 36 < radix) {
  11192. throw Error('radix out of range: ' + radix);
  11193. }
  11194. if (str.charAt(0) === '-') {
  11195. return Timestamp.fromString(str.substring(1), radix).negate();
  11196. } else if (str.indexOf('-') >= 0) {
  11197. throw Error('number format error: interior "-" character: ' + str);
  11198. }
  11199. // Do several (8) digits each time through the loop, so as to
  11200. // minimize the calls to the very expensive emulated div.
  11201. var radixToPower = Timestamp.fromNumber(Math.pow(radix, 8));
  11202. var result = Timestamp.ZERO;
  11203. for (var i = 0; i < str.length; i += 8) {
  11204. var size = Math.min(8, str.length - i);
  11205. var value = parseInt(str.substring(i, i + size), radix);
  11206. if (size < 8) {
  11207. var power = Timestamp.fromNumber(Math.pow(radix, size));
  11208. result = result.multiply(power).add(Timestamp.fromNumber(value));
  11209. } else {
  11210. result = result.multiply(radixToPower);
  11211. result = result.add(Timestamp.fromNumber(value));
  11212. }
  11213. }
  11214. return result;
  11215. };
  11216. // NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
  11217. // from* methods on which they depend.
  11218. /**
  11219. * A cache of the Timestamp representations of small integer values.
  11220. * @type {Object}
  11221. * @ignore
  11222. */
  11223. Timestamp.INT_CACHE_ = {};
  11224. // NOTE: the compiler should inline these constant values below and then remove
  11225. // these variables, so there should be no runtime penalty for these.
  11226. /**
  11227. * Number used repeated below in calculations. This must appear before the
  11228. * first call to any from* function below.
  11229. * @type {number}
  11230. * @ignore
  11231. */
  11232. Timestamp.TWO_PWR_16_DBL_ = 1 << 16;
  11233. /**
  11234. * @type {number}
  11235. * @ignore
  11236. */
  11237. Timestamp.TWO_PWR_24_DBL_ = 1 << 24;
  11238. /**
  11239. * @type {number}
  11240. * @ignore
  11241. */
  11242. Timestamp.TWO_PWR_32_DBL_ = Timestamp.TWO_PWR_16_DBL_ * Timestamp.TWO_PWR_16_DBL_;
  11243. /**
  11244. * @type {number}
  11245. * @ignore
  11246. */
  11247. Timestamp.TWO_PWR_31_DBL_ = Timestamp.TWO_PWR_32_DBL_ / 2;
  11248. /**
  11249. * @type {number}
  11250. * @ignore
  11251. */
  11252. Timestamp.TWO_PWR_48_DBL_ = Timestamp.TWO_PWR_32_DBL_ * Timestamp.TWO_PWR_16_DBL_;
  11253. /**
  11254. * @type {number}
  11255. * @ignore
  11256. */
  11257. Timestamp.TWO_PWR_64_DBL_ = Timestamp.TWO_PWR_32_DBL_ * Timestamp.TWO_PWR_32_DBL_;
  11258. /**
  11259. * @type {number}
  11260. * @ignore
  11261. */
  11262. Timestamp.TWO_PWR_63_DBL_ = Timestamp.TWO_PWR_64_DBL_ / 2;
  11263. /** @type {Timestamp} */
  11264. Timestamp.ZERO = Timestamp.fromInt(0);
  11265. /** @type {Timestamp} */
  11266. Timestamp.ONE = Timestamp.fromInt(1);
  11267. /** @type {Timestamp} */
  11268. Timestamp.NEG_ONE = Timestamp.fromInt(-1);
  11269. /** @type {Timestamp} */
  11270. Timestamp.MAX_VALUE = Timestamp.fromBits(0xffffffff | 0, 0x7fffffff | 0);
  11271. /** @type {Timestamp} */
  11272. Timestamp.MIN_VALUE = Timestamp.fromBits(0, 0x80000000 | 0);
  11273. /**
  11274. * @type {Timestamp}
  11275. * @ignore
  11276. */
  11277. Timestamp.TWO_PWR_24_ = Timestamp.fromInt(1 << 24);
  11278. /**
  11279. * Expose.
  11280. */
  11281. module.exports = Timestamp;
  11282. module.exports.Timestamp = Timestamp;
  11283. /***/ }),
  11284. /* 337 */
  11285. /***/ (function(module, exports, __webpack_require__) {
  11286. /* WEBPACK VAR INJECTION */(function(Buffer, process) {// Custom inspect property name / symbol.
  11287. var inspect = 'inspect';
  11288. /**
  11289. * Machine id.
  11290. *
  11291. * Create a random 3-byte value (i.e. unique for this
  11292. * process). Other drivers use a md5 of the machine id here, but
  11293. * that would mean an asyc call to gethostname, so we don't bother.
  11294. * @ignore
  11295. */
  11296. var MACHINE_ID = parseInt(Math.random() * 0xffffff, 10);
  11297. // Regular expression that checks for hex value
  11298. var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$');
  11299. // Check if buffer exists
  11300. try {
  11301. if (Buffer && Buffer.from) {
  11302. var hasBufferType = true;
  11303. inspect = __webpack_require__(339).inspect.custom || 'inspect';
  11304. }
  11305. } catch (err) {
  11306. hasBufferType = false;
  11307. }
  11308. /**
  11309. * Create a new ObjectID instance
  11310. *
  11311. * @class
  11312. * @param {(string|number)} id Can be a 24 byte hex string, 12 byte binary string or a Number.
  11313. * @property {number} generationTime The generation time of this ObjectId instance
  11314. * @return {ObjectID} instance of ObjectID.
  11315. */
  11316. var ObjectID = function ObjectID(id) {
  11317. // Duck-typing to support ObjectId from different npm packages
  11318. if (id instanceof ObjectID) return id;
  11319. if (!(this instanceof ObjectID)) return new ObjectID(id);
  11320. this._bsontype = 'ObjectID';
  11321. // The most common usecase (blank id, new objectId instance)
  11322. if (id == null || typeof id === 'number') {
  11323. // Generate a new id
  11324. this.id = this.generate(id);
  11325. // If we are caching the hex string
  11326. if (ObjectID.cacheHexString) this.__id = this.toString('hex');
  11327. // Return the object
  11328. return;
  11329. }
  11330. // Check if the passed in id is valid
  11331. var valid = ObjectID.isValid(id);
  11332. // Throw an error if it's not a valid setup
  11333. if (!valid && id != null) {
  11334. throw new Error('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters');
  11335. } else if (valid && typeof id === 'string' && id.length === 24 && hasBufferType) {
  11336. return new ObjectID(new Buffer(id, 'hex'));
  11337. } else if (valid && typeof id === 'string' && id.length === 24) {
  11338. return ObjectID.createFromHexString(id);
  11339. } else if (id != null && id.length === 12) {
  11340. // assume 12 byte string
  11341. this.id = id;
  11342. } else if (id != null && id.toHexString) {
  11343. // Duck-typing to support ObjectId from different npm packages
  11344. return id;
  11345. } else {
  11346. throw new Error('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters');
  11347. }
  11348. if (ObjectID.cacheHexString) this.__id = this.toString('hex');
  11349. };
  11350. // Allow usage of ObjectId as well as ObjectID
  11351. // var ObjectId = ObjectID;
  11352. // Precomputed hex table enables speedy hex string conversion
  11353. var hexTable = [];
  11354. for (var i = 0; i < 256; i++) {
  11355. hexTable[i] = (i <= 15 ? '0' : '') + i.toString(16);
  11356. }
  11357. /**
  11358. * Return the ObjectID id as a 24 byte hex string representation
  11359. *
  11360. * @method
  11361. * @return {string} return the 24 byte hex string representation.
  11362. */
  11363. ObjectID.prototype.toHexString = function () {
  11364. if (ObjectID.cacheHexString && this.__id) return this.__id;
  11365. var hexString = '';
  11366. if (!this.id || !this.id.length) {
  11367. throw new Error('invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is [' + JSON.stringify(this.id) + ']');
  11368. }
  11369. if (this.id instanceof _Buffer) {
  11370. hexString = convertToHex(this.id);
  11371. if (ObjectID.cacheHexString) this.__id = hexString;
  11372. return hexString;
  11373. }
  11374. for (var i = 0; i < this.id.length; i++) {
  11375. hexString += hexTable[this.id.charCodeAt(i)];
  11376. }
  11377. if (ObjectID.cacheHexString) this.__id = hexString;
  11378. return hexString;
  11379. };
  11380. /**
  11381. * Update the ObjectID index used in generating new ObjectID's on the driver
  11382. *
  11383. * @method
  11384. * @return {number} returns next index value.
  11385. * @ignore
  11386. */
  11387. ObjectID.prototype.get_inc = function () {
  11388. return ObjectID.index = (ObjectID.index + 1) % 0xffffff;
  11389. };
  11390. /**
  11391. * Update the ObjectID index used in generating new ObjectID's on the driver
  11392. *
  11393. * @method
  11394. * @return {number} returns next index value.
  11395. * @ignore
  11396. */
  11397. ObjectID.prototype.getInc = function () {
  11398. return this.get_inc();
  11399. };
  11400. /**
  11401. * Generate a 12 byte id buffer used in ObjectID's
  11402. *
  11403. * @method
  11404. * @param {number} [time] optional parameter allowing to pass in a second based timestamp.
  11405. * @return {Buffer} return the 12 byte id buffer string.
  11406. */
  11407. ObjectID.prototype.generate = function (time) {
  11408. if ('number' !== typeof time) {
  11409. time = ~~(Date.now() / 1000);
  11410. }
  11411. // Use pid
  11412. var pid = (typeof process === 'undefined' || process.pid === 1 ? Math.floor(Math.random() * 100000) : process.pid) % 0xffff;
  11413. var inc = this.get_inc();
  11414. // Buffer used
  11415. var buffer = new Buffer(12);
  11416. // Encode time
  11417. buffer[3] = time & 0xff;
  11418. buffer[2] = time >> 8 & 0xff;
  11419. buffer[1] = time >> 16 & 0xff;
  11420. buffer[0] = time >> 24 & 0xff;
  11421. // Encode machine
  11422. buffer[6] = MACHINE_ID & 0xff;
  11423. buffer[5] = MACHINE_ID >> 8 & 0xff;
  11424. buffer[4] = MACHINE_ID >> 16 & 0xff;
  11425. // Encode pid
  11426. buffer[8] = pid & 0xff;
  11427. buffer[7] = pid >> 8 & 0xff;
  11428. // Encode index
  11429. buffer[11] = inc & 0xff;
  11430. buffer[10] = inc >> 8 & 0xff;
  11431. buffer[9] = inc >> 16 & 0xff;
  11432. // Return the buffer
  11433. return buffer;
  11434. };
  11435. /**
  11436. * Converts the id into a 24 byte hex string for printing
  11437. *
  11438. * @param {String} format The Buffer toString format parameter.
  11439. * @return {String} return the 24 byte hex string representation.
  11440. * @ignore
  11441. */
  11442. ObjectID.prototype.toString = function (format) {
  11443. // Is the id a buffer then use the buffer toString method to return the format
  11444. if (this.id && this.id.copy) {
  11445. return this.id.toString(typeof format === 'string' ? format : 'hex');
  11446. }
  11447. // if(this.buffer )
  11448. return this.toHexString();
  11449. };
  11450. /**
  11451. * Converts to a string representation of this Id.
  11452. *
  11453. * @return {String} return the 24 byte hex string representation.
  11454. * @ignore
  11455. */
  11456. ObjectID.prototype[inspect] = ObjectID.prototype.toString;
  11457. /**
  11458. * Converts to its JSON representation.
  11459. *
  11460. * @return {String} return the 24 byte hex string representation.
  11461. * @ignore
  11462. */
  11463. ObjectID.prototype.toJSON = function () {
  11464. return this.toHexString();
  11465. };
  11466. /**
  11467. * Compares the equality of this ObjectID with `otherID`.
  11468. *
  11469. * @method
  11470. * @param {object} otherID ObjectID instance to compare against.
  11471. * @return {boolean} the result of comparing two ObjectID's
  11472. */
  11473. ObjectID.prototype.equals = function equals(otherId) {
  11474. // var id;
  11475. if (otherId instanceof ObjectID) {
  11476. return this.toString() === otherId.toString();
  11477. } else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 12 && this.id instanceof _Buffer) {
  11478. return otherId === this.id.toString('binary');
  11479. } else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 24) {
  11480. return otherId.toLowerCase() === this.toHexString();
  11481. } else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 12) {
  11482. return otherId === this.id;
  11483. } else if (otherId != null && (otherId instanceof ObjectID || otherId.toHexString)) {
  11484. return otherId.toHexString() === this.toHexString();
  11485. } else {
  11486. return false;
  11487. }
  11488. };
  11489. /**
  11490. * Returns the generation date (accurate up to the second) that this ID was generated.
  11491. *
  11492. * @method
  11493. * @return {date} the generation date
  11494. */
  11495. ObjectID.prototype.getTimestamp = function () {
  11496. var timestamp = new Date();
  11497. var time = this.id[3] | this.id[2] << 8 | this.id[1] << 16 | this.id[0] << 24;
  11498. timestamp.setTime(Math.floor(time) * 1000);
  11499. return timestamp;
  11500. };
  11501. /**
  11502. * @ignore
  11503. */
  11504. ObjectID.index = ~~(Math.random() * 0xffffff);
  11505. /**
  11506. * @ignore
  11507. */
  11508. ObjectID.createPk = function createPk() {
  11509. return new ObjectID();
  11510. };
  11511. /**
  11512. * Creates an ObjectID from a second based number, with the rest of the ObjectID zeroed out. Used for comparisons or sorting the ObjectID.
  11513. *
  11514. * @method
  11515. * @param {number} time an integer number representing a number of seconds.
  11516. * @return {ObjectID} return the created ObjectID
  11517. */
  11518. ObjectID.createFromTime = function createFromTime(time) {
  11519. var buffer = new Buffer([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
  11520. // Encode time into first 4 bytes
  11521. buffer[3] = time & 0xff;
  11522. buffer[2] = time >> 8 & 0xff;
  11523. buffer[1] = time >> 16 & 0xff;
  11524. buffer[0] = time >> 24 & 0xff;
  11525. // Return the new objectId
  11526. return new ObjectID(buffer);
  11527. };
  11528. // Lookup tables
  11529. //var encodeLookup = '0123456789abcdef'.split('');
  11530. var decodeLookup = [];
  11531. i = 0;
  11532. while (i < 10) decodeLookup[0x30 + i] = i++;
  11533. while (i < 16) decodeLookup[0x41 - 10 + i] = decodeLookup[0x61 - 10 + i] = i++;
  11534. var _Buffer = Buffer;
  11535. var convertToHex = function (bytes) {
  11536. return bytes.toString('hex');
  11537. };
  11538. /**
  11539. * Creates an ObjectID from a hex string representation of an ObjectID.
  11540. *
  11541. * @method
  11542. * @param {string} hexString create a ObjectID from a passed in 24 byte hexstring.
  11543. * @return {ObjectID} return the created ObjectID
  11544. */
  11545. ObjectID.createFromHexString = function createFromHexString(string) {
  11546. // Throw an error if it's not a valid setup
  11547. if (typeof string === 'undefined' || string != null && string.length !== 24) {
  11548. throw new Error('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters');
  11549. }
  11550. // Use Buffer.from method if available
  11551. if (hasBufferType) return new ObjectID(new Buffer(string, 'hex'));
  11552. // Calculate lengths
  11553. var array = new _Buffer(12);
  11554. var n = 0;
  11555. var i = 0;
  11556. while (i < 24) {
  11557. array[n++] = decodeLookup[string.charCodeAt(i++)] << 4 | decodeLookup[string.charCodeAt(i++)];
  11558. }
  11559. return new ObjectID(array);
  11560. };
  11561. /**
  11562. * Checks if a value is a valid bson ObjectId
  11563. *
  11564. * @method
  11565. * @return {boolean} return true if the value is a valid bson ObjectId, return false otherwise.
  11566. */
  11567. ObjectID.isValid = function isValid(id) {
  11568. if (id == null) return false;
  11569. if (typeof id === 'number') {
  11570. return true;
  11571. }
  11572. if (typeof id === 'string') {
  11573. return id.length === 12 || id.length === 24 && checkForHexRegExp.test(id);
  11574. }
  11575. if (id instanceof ObjectID) {
  11576. return true;
  11577. }
  11578. if (id instanceof _Buffer) {
  11579. return true;
  11580. }
  11581. // Duck-Typing detection of ObjectId like objects
  11582. if (id.toHexString) {
  11583. return id.id.length === 12 || id.id.length === 24 && checkForHexRegExp.test(id.id);
  11584. }
  11585. return false;
  11586. };
  11587. /**
  11588. * @ignore
  11589. */
  11590. Object.defineProperty(ObjectID.prototype, 'generationTime', {
  11591. enumerable: true,
  11592. get: function () {
  11593. return this.id[3] | this.id[2] << 8 | this.id[1] << 16 | this.id[0] << 24;
  11594. },
  11595. set: function (value) {
  11596. // Encode time into first 4 bytes
  11597. this.id[3] = value & 0xff;
  11598. this.id[2] = value >> 8 & 0xff;
  11599. this.id[1] = value >> 16 & 0xff;
  11600. this.id[0] = value >> 24 & 0xff;
  11601. }
  11602. });
  11603. /**
  11604. * Expose.
  11605. */
  11606. module.exports = ObjectID;
  11607. module.exports.ObjectID = ObjectID;
  11608. module.exports.ObjectId = ObjectID;
  11609. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(329).Buffer, __webpack_require__(338)))
  11610. /***/ }),
  11611. /* 338 */
  11612. /***/ (function(module, exports) {
  11613. // shim for using process in browser
  11614. var process = module.exports = {};
  11615. // cached from whatever global is present so that test runners that stub it
  11616. // don't break things. But we need to wrap it in a try catch in case it is
  11617. // wrapped in strict mode code which doesn't define any globals. It's inside a
  11618. // function because try/catches deoptimize in certain engines.
  11619. var cachedSetTimeout;
  11620. var cachedClearTimeout;
  11621. function defaultSetTimout() {
  11622. throw new Error('setTimeout has not been defined');
  11623. }
  11624. function defaultClearTimeout () {
  11625. throw new Error('clearTimeout has not been defined');
  11626. }
  11627. (function () {
  11628. try {
  11629. if (typeof setTimeout === 'function') {
  11630. cachedSetTimeout = setTimeout;
  11631. } else {
  11632. cachedSetTimeout = defaultSetTimout;
  11633. }
  11634. } catch (e) {
  11635. cachedSetTimeout = defaultSetTimout;
  11636. }
  11637. try {
  11638. if (typeof clearTimeout === 'function') {
  11639. cachedClearTimeout = clearTimeout;
  11640. } else {
  11641. cachedClearTimeout = defaultClearTimeout;
  11642. }
  11643. } catch (e) {
  11644. cachedClearTimeout = defaultClearTimeout;
  11645. }
  11646. } ())
  11647. function runTimeout(fun) {
  11648. if (cachedSetTimeout === setTimeout) {
  11649. //normal enviroments in sane situations
  11650. return setTimeout(fun, 0);
  11651. }
  11652. // if setTimeout wasn't available but was latter defined
  11653. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  11654. cachedSetTimeout = setTimeout;
  11655. return setTimeout(fun, 0);
  11656. }
  11657. try {
  11658. // when when somebody has screwed with setTimeout but no I.E. maddness
  11659. return cachedSetTimeout(fun, 0);
  11660. } catch(e){
  11661. try {
  11662. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  11663. return cachedSetTimeout.call(null, fun, 0);
  11664. } catch(e){
  11665. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  11666. return cachedSetTimeout.call(this, fun, 0);
  11667. }
  11668. }
  11669. }
  11670. function runClearTimeout(marker) {
  11671. if (cachedClearTimeout === clearTimeout) {
  11672. //normal enviroments in sane situations
  11673. return clearTimeout(marker);
  11674. }
  11675. // if clearTimeout wasn't available but was latter defined
  11676. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  11677. cachedClearTimeout = clearTimeout;
  11678. return clearTimeout(marker);
  11679. }
  11680. try {
  11681. // when when somebody has screwed with setTimeout but no I.E. maddness
  11682. return cachedClearTimeout(marker);
  11683. } catch (e){
  11684. try {
  11685. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  11686. return cachedClearTimeout.call(null, marker);
  11687. } catch (e){
  11688. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  11689. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  11690. return cachedClearTimeout.call(this, marker);
  11691. }
  11692. }
  11693. }
  11694. var queue = [];
  11695. var draining = false;
  11696. var currentQueue;
  11697. var queueIndex = -1;
  11698. function cleanUpNextTick() {
  11699. if (!draining || !currentQueue) {
  11700. return;
  11701. }
  11702. draining = false;
  11703. if (currentQueue.length) {
  11704. queue = currentQueue.concat(queue);
  11705. } else {
  11706. queueIndex = -1;
  11707. }
  11708. if (queue.length) {
  11709. drainQueue();
  11710. }
  11711. }
  11712. function drainQueue() {
  11713. if (draining) {
  11714. return;
  11715. }
  11716. var timeout = runTimeout(cleanUpNextTick);
  11717. draining = true;
  11718. var len = queue.length;
  11719. while(len) {
  11720. currentQueue = queue;
  11721. queue = [];
  11722. while (++queueIndex < len) {
  11723. if (currentQueue) {
  11724. currentQueue[queueIndex].run();
  11725. }
  11726. }
  11727. queueIndex = -1;
  11728. len = queue.length;
  11729. }
  11730. currentQueue = null;
  11731. draining = false;
  11732. runClearTimeout(timeout);
  11733. }
  11734. process.nextTick = function (fun) {
  11735. var args = new Array(arguments.length - 1);
  11736. if (arguments.length > 1) {
  11737. for (var i = 1; i < arguments.length; i++) {
  11738. args[i - 1] = arguments[i];
  11739. }
  11740. }
  11741. queue.push(new Item(fun, args));
  11742. if (queue.length === 1 && !draining) {
  11743. runTimeout(drainQueue);
  11744. }
  11745. };
  11746. // v8 likes predictible objects
  11747. function Item(fun, array) {
  11748. this.fun = fun;
  11749. this.array = array;
  11750. }
  11751. Item.prototype.run = function () {
  11752. this.fun.apply(null, this.array);
  11753. };
  11754. process.title = 'browser';
  11755. process.browser = true;
  11756. process.env = {};
  11757. process.argv = [];
  11758. process.version = ''; // empty string to avoid regexp issues
  11759. process.versions = {};
  11760. function noop() {}
  11761. process.on = noop;
  11762. process.addListener = noop;
  11763. process.once = noop;
  11764. process.off = noop;
  11765. process.removeListener = noop;
  11766. process.removeAllListeners = noop;
  11767. process.emit = noop;
  11768. process.prependListener = noop;
  11769. process.prependOnceListener = noop;
  11770. process.listeners = function (name) { return [] }
  11771. process.binding = function (name) {
  11772. throw new Error('process.binding is not supported');
  11773. };
  11774. process.cwd = function () { return '/' };
  11775. process.chdir = function (dir) {
  11776. throw new Error('process.chdir is not supported');
  11777. };
  11778. process.umask = function() { return 0; };
  11779. /***/ }),
  11780. /* 339 */
  11781. /***/ (function(module, exports, __webpack_require__) {
  11782. /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
  11783. //
  11784. // Permission is hereby granted, free of charge, to any person obtaining a
  11785. // copy of this software and associated documentation files (the
  11786. // "Software"), to deal in the Software without restriction, including
  11787. // without limitation the rights to use, copy, modify, merge, publish,
  11788. // distribute, sublicense, and/or sell copies of the Software, and to permit
  11789. // persons to whom the Software is furnished to do so, subject to the
  11790. // following conditions:
  11791. //
  11792. // The above copyright notice and this permission notice shall be included
  11793. // in all copies or substantial portions of the Software.
  11794. //
  11795. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  11796. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  11797. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  11798. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  11799. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  11800. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  11801. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  11802. var formatRegExp = /%[sdj%]/g;
  11803. exports.format = function(f) {
  11804. if (!isString(f)) {
  11805. var objects = [];
  11806. for (var i = 0; i < arguments.length; i++) {
  11807. objects.push(inspect(arguments[i]));
  11808. }
  11809. return objects.join(' ');
  11810. }
  11811. var i = 1;
  11812. var args = arguments;
  11813. var len = args.length;
  11814. var str = String(f).replace(formatRegExp, function(x) {
  11815. if (x === '%%') return '%';
  11816. if (i >= len) return x;
  11817. switch (x) {
  11818. case '%s': return String(args[i++]);
  11819. case '%d': return Number(args[i++]);
  11820. case '%j':
  11821. try {
  11822. return JSON.stringify(args[i++]);
  11823. } catch (_) {
  11824. return '[Circular]';
  11825. }
  11826. default:
  11827. return x;
  11828. }
  11829. });
  11830. for (var x = args[i]; i < len; x = args[++i]) {
  11831. if (isNull(x) || !isObject(x)) {
  11832. str += ' ' + x;
  11833. } else {
  11834. str += ' ' + inspect(x);
  11835. }
  11836. }
  11837. return str;
  11838. };
  11839. // Mark that a method should not be used.
  11840. // Returns a modified function which warns once by default.
  11841. // If --no-deprecation is set, then it is a no-op.
  11842. exports.deprecate = function(fn, msg) {
  11843. // Allow for deprecating things in the process of starting up.
  11844. if (isUndefined(global.process)) {
  11845. return function() {
  11846. return exports.deprecate(fn, msg).apply(this, arguments);
  11847. };
  11848. }
  11849. if (process.noDeprecation === true) {
  11850. return fn;
  11851. }
  11852. var warned = false;
  11853. function deprecated() {
  11854. if (!warned) {
  11855. if (process.throwDeprecation) {
  11856. throw new Error(msg);
  11857. } else if (process.traceDeprecation) {
  11858. console.trace(msg);
  11859. } else {
  11860. console.error(msg);
  11861. }
  11862. warned = true;
  11863. }
  11864. return fn.apply(this, arguments);
  11865. }
  11866. return deprecated;
  11867. };
  11868. var debugs = {};
  11869. var debugEnviron;
  11870. exports.debuglog = function(set) {
  11871. if (isUndefined(debugEnviron))
  11872. debugEnviron = process.env.NODE_DEBUG || '';
  11873. set = set.toUpperCase();
  11874. if (!debugs[set]) {
  11875. if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
  11876. var pid = process.pid;
  11877. debugs[set] = function() {
  11878. var msg = exports.format.apply(exports, arguments);
  11879. console.error('%s %d: %s', set, pid, msg);
  11880. };
  11881. } else {
  11882. debugs[set] = function() {};
  11883. }
  11884. }
  11885. return debugs[set];
  11886. };
  11887. /**
  11888. * Echos the value of a value. Trys to print the value out
  11889. * in the best way possible given the different types.
  11890. *
  11891. * @param {Object} obj The object to print out.
  11892. * @param {Object} opts Optional options object that alters the output.
  11893. */
  11894. /* legacy: obj, showHidden, depth, colors*/
  11895. function inspect(obj, opts) {
  11896. // default options
  11897. var ctx = {
  11898. seen: [],
  11899. stylize: stylizeNoColor
  11900. };
  11901. // legacy...
  11902. if (arguments.length >= 3) ctx.depth = arguments[2];
  11903. if (arguments.length >= 4) ctx.colors = arguments[3];
  11904. if (isBoolean(opts)) {
  11905. // legacy...
  11906. ctx.showHidden = opts;
  11907. } else if (opts) {
  11908. // got an "options" object
  11909. exports._extend(ctx, opts);
  11910. }
  11911. // set default options
  11912. if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
  11913. if (isUndefined(ctx.depth)) ctx.depth = 2;
  11914. if (isUndefined(ctx.colors)) ctx.colors = false;
  11915. if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
  11916. if (ctx.colors) ctx.stylize = stylizeWithColor;
  11917. return formatValue(ctx, obj, ctx.depth);
  11918. }
  11919. exports.inspect = inspect;
  11920. // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
  11921. inspect.colors = {
  11922. 'bold' : [1, 22],
  11923. 'italic' : [3, 23],
  11924. 'underline' : [4, 24],
  11925. 'inverse' : [7, 27],
  11926. 'white' : [37, 39],
  11927. 'grey' : [90, 39],
  11928. 'black' : [30, 39],
  11929. 'blue' : [34, 39],
  11930. 'cyan' : [36, 39],
  11931. 'green' : [32, 39],
  11932. 'magenta' : [35, 39],
  11933. 'red' : [31, 39],
  11934. 'yellow' : [33, 39]
  11935. };
  11936. // Don't use 'blue' not visible on cmd.exe
  11937. inspect.styles = {
  11938. 'special': 'cyan',
  11939. 'number': 'yellow',
  11940. 'boolean': 'yellow',
  11941. 'undefined': 'grey',
  11942. 'null': 'bold',
  11943. 'string': 'green',
  11944. 'date': 'magenta',
  11945. // "name": intentionally not styling
  11946. 'regexp': 'red'
  11947. };
  11948. function stylizeWithColor(str, styleType) {
  11949. var style = inspect.styles[styleType];
  11950. if (style) {
  11951. return '\u001b[' + inspect.colors[style][0] + 'm' + str +
  11952. '\u001b[' + inspect.colors[style][1] + 'm';
  11953. } else {
  11954. return str;
  11955. }
  11956. }
  11957. function stylizeNoColor(str, styleType) {
  11958. return str;
  11959. }
  11960. function arrayToHash(array) {
  11961. var hash = {};
  11962. array.forEach(function(val, idx) {
  11963. hash[val] = true;
  11964. });
  11965. return hash;
  11966. }
  11967. function formatValue(ctx, value, recurseTimes) {
  11968. // Provide a hook for user-specified inspect functions.
  11969. // Check that value is an object with an inspect function on it
  11970. if (ctx.customInspect &&
  11971. value &&
  11972. isFunction(value.inspect) &&
  11973. // Filter out the util module, it's inspect function is special
  11974. value.inspect !== exports.inspect &&
  11975. // Also filter out any prototype objects using the circular check.
  11976. !(value.constructor && value.constructor.prototype === value)) {
  11977. var ret = value.inspect(recurseTimes, ctx);
  11978. if (!isString(ret)) {
  11979. ret = formatValue(ctx, ret, recurseTimes);
  11980. }
  11981. return ret;
  11982. }
  11983. // Primitive types cannot have properties
  11984. var primitive = formatPrimitive(ctx, value);
  11985. if (primitive) {
  11986. return primitive;
  11987. }
  11988. // Look up the keys of the object.
  11989. var keys = Object.keys(value);
  11990. var visibleKeys = arrayToHash(keys);
  11991. if (ctx.showHidden) {
  11992. keys = Object.getOwnPropertyNames(value);
  11993. }
  11994. // IE doesn't make error fields non-enumerable
  11995. // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
  11996. if (isError(value)
  11997. && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
  11998. return formatError(value);
  11999. }
  12000. // Some type of object without properties can be shortcutted.
  12001. if (keys.length === 0) {
  12002. if (isFunction(value)) {
  12003. var name = value.name ? ': ' + value.name : '';
  12004. return ctx.stylize('[Function' + name + ']', 'special');
  12005. }
  12006. if (isRegExp(value)) {
  12007. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  12008. }
  12009. if (isDate(value)) {
  12010. return ctx.stylize(Date.prototype.toString.call(value), 'date');
  12011. }
  12012. if (isError(value)) {
  12013. return formatError(value);
  12014. }
  12015. }
  12016. var base = '', array = false, braces = ['{', '}'];
  12017. // Make Array say that they are Array
  12018. if (isArray(value)) {
  12019. array = true;
  12020. braces = ['[', ']'];
  12021. }
  12022. // Make functions say that they are functions
  12023. if (isFunction(value)) {
  12024. var n = value.name ? ': ' + value.name : '';
  12025. base = ' [Function' + n + ']';
  12026. }
  12027. // Make RegExps say that they are RegExps
  12028. if (isRegExp(value)) {
  12029. base = ' ' + RegExp.prototype.toString.call(value);
  12030. }
  12031. // Make dates with properties first say the date
  12032. if (isDate(value)) {
  12033. base = ' ' + Date.prototype.toUTCString.call(value);
  12034. }
  12035. // Make error with message first say the error
  12036. if (isError(value)) {
  12037. base = ' ' + formatError(value);
  12038. }
  12039. if (keys.length === 0 && (!array || value.length == 0)) {
  12040. return braces[0] + base + braces[1];
  12041. }
  12042. if (recurseTimes < 0) {
  12043. if (isRegExp(value)) {
  12044. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  12045. } else {
  12046. return ctx.stylize('[Object]', 'special');
  12047. }
  12048. }
  12049. ctx.seen.push(value);
  12050. var output;
  12051. if (array) {
  12052. output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  12053. } else {
  12054. output = keys.map(function(key) {
  12055. return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
  12056. });
  12057. }
  12058. ctx.seen.pop();
  12059. return reduceToSingleString(output, base, braces);
  12060. }
  12061. function formatPrimitive(ctx, value) {
  12062. if (isUndefined(value))
  12063. return ctx.stylize('undefined', 'undefined');
  12064. if (isString(value)) {
  12065. var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
  12066. .replace(/'/g, "\\'")
  12067. .replace(/\\"/g, '"') + '\'';
  12068. return ctx.stylize(simple, 'string');
  12069. }
  12070. if (isNumber(value))
  12071. return ctx.stylize('' + value, 'number');
  12072. if (isBoolean(value))
  12073. return ctx.stylize('' + value, 'boolean');
  12074. // For some reason typeof null is "object", so special case here.
  12075. if (isNull(value))
  12076. return ctx.stylize('null', 'null');
  12077. }
  12078. function formatError(value) {
  12079. return '[' + Error.prototype.toString.call(value) + ']';
  12080. }
  12081. function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  12082. var output = [];
  12083. for (var i = 0, l = value.length; i < l; ++i) {
  12084. if (hasOwnProperty(value, String(i))) {
  12085. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  12086. String(i), true));
  12087. } else {
  12088. output.push('');
  12089. }
  12090. }
  12091. keys.forEach(function(key) {
  12092. if (!key.match(/^\d+$/)) {
  12093. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  12094. key, true));
  12095. }
  12096. });
  12097. return output;
  12098. }
  12099. function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  12100. var name, str, desc;
  12101. desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
  12102. if (desc.get) {
  12103. if (desc.set) {
  12104. str = ctx.stylize('[Getter/Setter]', 'special');
  12105. } else {
  12106. str = ctx.stylize('[Getter]', 'special');
  12107. }
  12108. } else {
  12109. if (desc.set) {
  12110. str = ctx.stylize('[Setter]', 'special');
  12111. }
  12112. }
  12113. if (!hasOwnProperty(visibleKeys, key)) {
  12114. name = '[' + key + ']';
  12115. }
  12116. if (!str) {
  12117. if (ctx.seen.indexOf(desc.value) < 0) {
  12118. if (isNull(recurseTimes)) {
  12119. str = formatValue(ctx, desc.value, null);
  12120. } else {
  12121. str = formatValue(ctx, desc.value, recurseTimes - 1);
  12122. }
  12123. if (str.indexOf('\n') > -1) {
  12124. if (array) {
  12125. str = str.split('\n').map(function(line) {
  12126. return ' ' + line;
  12127. }).join('\n').substr(2);
  12128. } else {
  12129. str = '\n' + str.split('\n').map(function(line) {
  12130. return ' ' + line;
  12131. }).join('\n');
  12132. }
  12133. }
  12134. } else {
  12135. str = ctx.stylize('[Circular]', 'special');
  12136. }
  12137. }
  12138. if (isUndefined(name)) {
  12139. if (array && key.match(/^\d+$/)) {
  12140. return str;
  12141. }
  12142. name = JSON.stringify('' + key);
  12143. if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
  12144. name = name.substr(1, name.length - 2);
  12145. name = ctx.stylize(name, 'name');
  12146. } else {
  12147. name = name.replace(/'/g, "\\'")
  12148. .replace(/\\"/g, '"')
  12149. .replace(/(^"|"$)/g, "'");
  12150. name = ctx.stylize(name, 'string');
  12151. }
  12152. }
  12153. return name + ': ' + str;
  12154. }
  12155. function reduceToSingleString(output, base, braces) {
  12156. var numLinesEst = 0;
  12157. var length = output.reduce(function(prev, cur) {
  12158. numLinesEst++;
  12159. if (cur.indexOf('\n') >= 0) numLinesEst++;
  12160. return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
  12161. }, 0);
  12162. if (length > 60) {
  12163. return braces[0] +
  12164. (base === '' ? '' : base + '\n ') +
  12165. ' ' +
  12166. output.join(',\n ') +
  12167. ' ' +
  12168. braces[1];
  12169. }
  12170. return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
  12171. }
  12172. // NOTE: These type checking functions intentionally don't use `instanceof`
  12173. // because it is fragile and can be easily faked with `Object.create()`.
  12174. function isArray(ar) {
  12175. return Array.isArray(ar);
  12176. }
  12177. exports.isArray = isArray;
  12178. function isBoolean(arg) {
  12179. return typeof arg === 'boolean';
  12180. }
  12181. exports.isBoolean = isBoolean;
  12182. function isNull(arg) {
  12183. return arg === null;
  12184. }
  12185. exports.isNull = isNull;
  12186. function isNullOrUndefined(arg) {
  12187. return arg == null;
  12188. }
  12189. exports.isNullOrUndefined = isNullOrUndefined;
  12190. function isNumber(arg) {
  12191. return typeof arg === 'number';
  12192. }
  12193. exports.isNumber = isNumber;
  12194. function isString(arg) {
  12195. return typeof arg === 'string';
  12196. }
  12197. exports.isString = isString;
  12198. function isSymbol(arg) {
  12199. return typeof arg === 'symbol';
  12200. }
  12201. exports.isSymbol = isSymbol;
  12202. function isUndefined(arg) {
  12203. return arg === void 0;
  12204. }
  12205. exports.isUndefined = isUndefined;
  12206. function isRegExp(re) {
  12207. return isObject(re) && objectToString(re) === '[object RegExp]';
  12208. }
  12209. exports.isRegExp = isRegExp;
  12210. function isObject(arg) {
  12211. return typeof arg === 'object' && arg !== null;
  12212. }
  12213. exports.isObject = isObject;
  12214. function isDate(d) {
  12215. return isObject(d) && objectToString(d) === '[object Date]';
  12216. }
  12217. exports.isDate = isDate;
  12218. function isError(e) {
  12219. return isObject(e) &&
  12220. (objectToString(e) === '[object Error]' || e instanceof Error);
  12221. }
  12222. exports.isError = isError;
  12223. function isFunction(arg) {
  12224. return typeof arg === 'function';
  12225. }
  12226. exports.isFunction = isFunction;
  12227. function isPrimitive(arg) {
  12228. return arg === null ||
  12229. typeof arg === 'boolean' ||
  12230. typeof arg === 'number' ||
  12231. typeof arg === 'string' ||
  12232. typeof arg === 'symbol' || // ES6 symbol
  12233. typeof arg === 'undefined';
  12234. }
  12235. exports.isPrimitive = isPrimitive;
  12236. exports.isBuffer = __webpack_require__(340);
  12237. function objectToString(o) {
  12238. return Object.prototype.toString.call(o);
  12239. }
  12240. function pad(n) {
  12241. return n < 10 ? '0' + n.toString(10) : n.toString(10);
  12242. }
  12243. var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
  12244. 'Oct', 'Nov', 'Dec'];
  12245. // 26 Feb 16:19:34
  12246. function timestamp() {
  12247. var d = new Date();
  12248. var time = [pad(d.getHours()),
  12249. pad(d.getMinutes()),
  12250. pad(d.getSeconds())].join(':');
  12251. return [d.getDate(), months[d.getMonth()], time].join(' ');
  12252. }
  12253. // log is just a thin wrapper to console.log that prepends a timestamp
  12254. exports.log = function() {
  12255. console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
  12256. };
  12257. /**
  12258. * Inherit the prototype methods from one constructor into another.
  12259. *
  12260. * The Function.prototype.inherits from lang.js rewritten as a standalone
  12261. * function (not on Function.prototype). NOTE: If this file is to be loaded
  12262. * during bootstrapping this function needs to be rewritten using some native
  12263. * functions as prototype setup using normal JavaScript does not work as
  12264. * expected during bootstrapping (see mirror.js in r114903).
  12265. *
  12266. * @param {function} ctor Constructor function which needs to inherit the
  12267. * prototype.
  12268. * @param {function} superCtor Constructor function to inherit prototype from.
  12269. */
  12270. exports.inherits = __webpack_require__(341);
  12271. exports._extend = function(origin, add) {
  12272. // Don't do anything if add isn't an object
  12273. if (!add || !isObject(add)) return origin;
  12274. var keys = Object.keys(add);
  12275. var i = keys.length;
  12276. while (i--) {
  12277. origin[keys[i]] = add[keys[i]];
  12278. }
  12279. return origin;
  12280. };
  12281. function hasOwnProperty(obj, prop) {
  12282. return Object.prototype.hasOwnProperty.call(obj, prop);
  12283. }
  12284. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(338)))
  12285. /***/ }),
  12286. /* 340 */
  12287. /***/ (function(module, exports) {
  12288. module.exports = function isBuffer(arg) {
  12289. return arg && typeof arg === 'object'
  12290. && typeof arg.copy === 'function'
  12291. && typeof arg.fill === 'function'
  12292. && typeof arg.readUInt8 === 'function';
  12293. }
  12294. /***/ }),
  12295. /* 341 */
  12296. /***/ (function(module, exports) {
  12297. if (typeof Object.create === 'function') {
  12298. // implementation from standard node.js 'util' module
  12299. module.exports = function inherits(ctor, superCtor) {
  12300. ctor.super_ = superCtor
  12301. ctor.prototype = Object.create(superCtor.prototype, {
  12302. constructor: {
  12303. value: ctor,
  12304. enumerable: false,
  12305. writable: true,
  12306. configurable: true
  12307. }
  12308. });
  12309. };
  12310. } else {
  12311. // old school shim for old browsers
  12312. module.exports = function inherits(ctor, superCtor) {
  12313. ctor.super_ = superCtor
  12314. var TempCtor = function () {}
  12315. TempCtor.prototype = superCtor.prototype
  12316. ctor.prototype = new TempCtor()
  12317. ctor.prototype.constructor = ctor
  12318. }
  12319. }
  12320. /***/ }),
  12321. /* 342 */
  12322. /***/ (function(module, exports) {
  12323. /**
  12324. * A class representation of the BSON RegExp type.
  12325. *
  12326. * @class
  12327. * @return {BSONRegExp} A MinKey instance
  12328. */
  12329. function BSONRegExp(pattern, options) {
  12330. if (!(this instanceof BSONRegExp)) return new BSONRegExp();
  12331. // Execute
  12332. this._bsontype = 'BSONRegExp';
  12333. this.pattern = pattern || '';
  12334. this.options = options || '';
  12335. // Validate options
  12336. for (var i = 0; i < this.options.length; i++) {
  12337. if (!(this.options[i] === 'i' || this.options[i] === 'm' || this.options[i] === 'x' || this.options[i] === 'l' || this.options[i] === 's' || this.options[i] === 'u')) {
  12338. throw new Error('the regular expression options [' + this.options[i] + '] is not supported');
  12339. }
  12340. }
  12341. }
  12342. module.exports = BSONRegExp;
  12343. module.exports.BSONRegExp = BSONRegExp;
  12344. /***/ }),
  12345. /* 343 */
  12346. /***/ (function(module, exports, __webpack_require__) {
  12347. /* WEBPACK VAR INJECTION */(function(Buffer) {// Custom inspect property name / symbol.
  12348. var inspect = Buffer ? __webpack_require__(339).inspect.custom || 'inspect' : 'inspect';
  12349. /**
  12350. * A class representation of the BSON Symbol type.
  12351. *
  12352. * @class
  12353. * @deprecated
  12354. * @param {string} value the string representing the symbol.
  12355. * @return {Symbol}
  12356. */
  12357. function Symbol(value) {
  12358. if (!(this instanceof Symbol)) return new Symbol(value);
  12359. this._bsontype = 'Symbol';
  12360. this.value = value;
  12361. }
  12362. /**
  12363. * Access the wrapped string value.
  12364. *
  12365. * @method
  12366. * @return {String} returns the wrapped string.
  12367. */
  12368. Symbol.prototype.valueOf = function () {
  12369. return this.value;
  12370. };
  12371. /**
  12372. * @ignore
  12373. */
  12374. Symbol.prototype.toString = function () {
  12375. return this.value;
  12376. };
  12377. /**
  12378. * @ignore
  12379. */
  12380. Symbol.prototype[inspect] = function () {
  12381. return this.value;
  12382. };
  12383. /**
  12384. * @ignore
  12385. */
  12386. Symbol.prototype.toJSON = function () {
  12387. return this.value;
  12388. };
  12389. module.exports = Symbol;
  12390. module.exports.Symbol = Symbol;
  12391. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(329).Buffer))
  12392. /***/ }),
  12393. /* 344 */
  12394. /***/ (function(module, exports) {
  12395. /**
  12396. * A class representation of a BSON Int32 type.
  12397. *
  12398. * @class
  12399. * @param {number} value the number we want to represent as an int32.
  12400. * @return {Int32}
  12401. */
  12402. var Int32 = function (value) {
  12403. if (!(this instanceof Int32)) return new Int32(value);
  12404. this._bsontype = 'Int32';
  12405. this.value = value;
  12406. };
  12407. /**
  12408. * Access the number value.
  12409. *
  12410. * @method
  12411. * @return {number} returns the wrapped int32 number.
  12412. */
  12413. Int32.prototype.valueOf = function () {
  12414. return this.value;
  12415. };
  12416. /**
  12417. * @ignore
  12418. */
  12419. Int32.prototype.toJSON = function () {
  12420. return this.value;
  12421. };
  12422. module.exports = Int32;
  12423. module.exports.Int32 = Int32;
  12424. /***/ }),
  12425. /* 345 */
  12426. /***/ (function(module, exports) {
  12427. /**
  12428. * A class representation of the BSON Code type.
  12429. *
  12430. * @class
  12431. * @param {(string|function)} code a string or function.
  12432. * @param {Object} [scope] an optional scope for the function.
  12433. * @return {Code}
  12434. */
  12435. var Code = function Code(code, scope) {
  12436. if (!(this instanceof Code)) return new Code(code, scope);
  12437. this._bsontype = 'Code';
  12438. this.code = code;
  12439. this.scope = scope;
  12440. };
  12441. /**
  12442. * @ignore
  12443. */
  12444. Code.prototype.toJSON = function () {
  12445. return { scope: this.scope, code: this.code };
  12446. };
  12447. module.exports = Code;
  12448. module.exports.Code = Code;
  12449. /***/ }),
  12450. /* 346 */
  12451. /***/ (function(module, exports, __webpack_require__) {
  12452. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  12453. var Long = __webpack_require__(334);
  12454. var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/;
  12455. var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i;
  12456. var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i;
  12457. var EXPONENT_MAX = 6111;
  12458. var EXPONENT_MIN = -6176;
  12459. var EXPONENT_BIAS = 6176;
  12460. var MAX_DIGITS = 34;
  12461. // Nan value bits as 32 bit values (due to lack of longs)
  12462. var NAN_BUFFER = [0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
  12463. // Infinity value bits 32 bit values (due to lack of longs)
  12464. var INF_NEGATIVE_BUFFER = [0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
  12465. var INF_POSITIVE_BUFFER = [0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
  12466. var EXPONENT_REGEX = /^([-+])?(\d+)?$/;
  12467. // Detect if the value is a digit
  12468. var isDigit = function (value) {
  12469. return !isNaN(parseInt(value, 10));
  12470. };
  12471. // Divide two uint128 values
  12472. var divideu128 = function (value) {
  12473. var DIVISOR = Long.fromNumber(1000 * 1000 * 1000);
  12474. var _rem = Long.fromNumber(0);
  12475. var i = 0;
  12476. if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) {
  12477. return { quotient: value, rem: _rem };
  12478. }
  12479. for (i = 0; i <= 3; i++) {
  12480. // Adjust remainder to match value of next dividend
  12481. _rem = _rem.shiftLeft(32);
  12482. // Add the divided to _rem
  12483. _rem = _rem.add(new Long(value.parts[i], 0));
  12484. value.parts[i] = _rem.div(DIVISOR).low_;
  12485. _rem = _rem.modulo(DIVISOR);
  12486. }
  12487. return { quotient: value, rem: _rem };
  12488. };
  12489. // Multiply two Long values and return the 128 bit value
  12490. var multiply64x2 = function (left, right) {
  12491. if (!left && !right) {
  12492. return { high: Long.fromNumber(0), low: Long.fromNumber(0) };
  12493. }
  12494. var leftHigh = left.shiftRightUnsigned(32);
  12495. var leftLow = new Long(left.getLowBits(), 0);
  12496. var rightHigh = right.shiftRightUnsigned(32);
  12497. var rightLow = new Long(right.getLowBits(), 0);
  12498. var productHigh = leftHigh.multiply(rightHigh);
  12499. var productMid = leftHigh.multiply(rightLow);
  12500. var productMid2 = leftLow.multiply(rightHigh);
  12501. var productLow = leftLow.multiply(rightLow);
  12502. productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
  12503. productMid = new Long(productMid.getLowBits(), 0).add(productMid2).add(productLow.shiftRightUnsigned(32));
  12504. productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
  12505. productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0));
  12506. // Return the 128 bit result
  12507. return { high: productHigh, low: productLow };
  12508. };
  12509. var lessThan = function (left, right) {
  12510. // Make values unsigned
  12511. var uhleft = left.high_ >>> 0;
  12512. var uhright = right.high_ >>> 0;
  12513. // Compare high bits first
  12514. if (uhleft < uhright) {
  12515. return true;
  12516. } else if (uhleft === uhright) {
  12517. var ulleft = left.low_ >>> 0;
  12518. var ulright = right.low_ >>> 0;
  12519. if (ulleft < ulright) return true;
  12520. }
  12521. return false;
  12522. };
  12523. // var longtoHex = function(value) {
  12524. // var buffer = new Buffer(8);
  12525. // var index = 0;
  12526. // // Encode the low 64 bits of the decimal
  12527. // // Encode low bits
  12528. // buffer[index++] = value.low_ & 0xff;
  12529. // buffer[index++] = (value.low_ >> 8) & 0xff;
  12530. // buffer[index++] = (value.low_ >> 16) & 0xff;
  12531. // buffer[index++] = (value.low_ >> 24) & 0xff;
  12532. // // Encode high bits
  12533. // buffer[index++] = value.high_ & 0xff;
  12534. // buffer[index++] = (value.high_ >> 8) & 0xff;
  12535. // buffer[index++] = (value.high_ >> 16) & 0xff;
  12536. // buffer[index++] = (value.high_ >> 24) & 0xff;
  12537. // return buffer.reverse().toString('hex');
  12538. // };
  12539. // var int32toHex = function(value) {
  12540. // var buffer = new Buffer(4);
  12541. // var index = 0;
  12542. // // Encode the low 64 bits of the decimal
  12543. // // Encode low bits
  12544. // buffer[index++] = value & 0xff;
  12545. // buffer[index++] = (value >> 8) & 0xff;
  12546. // buffer[index++] = (value >> 16) & 0xff;
  12547. // buffer[index++] = (value >> 24) & 0xff;
  12548. // return buffer.reverse().toString('hex');
  12549. // };
  12550. /**
  12551. * A class representation of the BSON Decimal128 type.
  12552. *
  12553. * @class
  12554. * @param {Buffer} bytes a buffer containing the raw Decimal128 bytes.
  12555. * @return {Double}
  12556. */
  12557. var Decimal128 = function (bytes) {
  12558. this._bsontype = 'Decimal128';
  12559. this.bytes = bytes;
  12560. };
  12561. /**
  12562. * Create a Decimal128 instance from a string representation
  12563. *
  12564. * @method
  12565. * @param {string} string a numeric string representation.
  12566. * @return {Decimal128} returns a Decimal128 instance.
  12567. */
  12568. Decimal128.fromString = function (string) {
  12569. // Parse state tracking
  12570. var isNegative = false;
  12571. var sawRadix = false;
  12572. var foundNonZero = false;
  12573. // Total number of significant digits (no leading or trailing zero)
  12574. var significantDigits = 0;
  12575. // Total number of significand digits read
  12576. var nDigitsRead = 0;
  12577. // Total number of digits (no leading zeros)
  12578. var nDigits = 0;
  12579. // The number of the digits after radix
  12580. var radixPosition = 0;
  12581. // The index of the first non-zero in *str*
  12582. var firstNonZero = 0;
  12583. // Digits Array
  12584. var digits = [0];
  12585. // The number of digits in digits
  12586. var nDigitsStored = 0;
  12587. // Insertion pointer for digits
  12588. var digitsInsert = 0;
  12589. // The index of the first non-zero digit
  12590. var firstDigit = 0;
  12591. // The index of the last digit
  12592. var lastDigit = 0;
  12593. // Exponent
  12594. var exponent = 0;
  12595. // loop index over array
  12596. var i = 0;
  12597. // The high 17 digits of the significand
  12598. var significandHigh = [0, 0];
  12599. // The low 17 digits of the significand
  12600. var significandLow = [0, 0];
  12601. // The biased exponent
  12602. var biasedExponent = 0;
  12603. // Read index
  12604. var index = 0;
  12605. // Trim the string
  12606. string = string.trim();
  12607. // Naively prevent against REDOS attacks.
  12608. // TODO: implementing a custom parsing for this, or refactoring the regex would yield
  12609. // further gains.
  12610. if (string.length >= 7000) {
  12611. throw new Error('' + string + ' not a valid Decimal128 string');
  12612. }
  12613. // Results
  12614. var stringMatch = string.match(PARSE_STRING_REGEXP);
  12615. var infMatch = string.match(PARSE_INF_REGEXP);
  12616. var nanMatch = string.match(PARSE_NAN_REGEXP);
  12617. // Validate the string
  12618. if (!stringMatch && !infMatch && !nanMatch || string.length === 0) {
  12619. throw new Error('' + string + ' not a valid Decimal128 string');
  12620. }
  12621. // Check if we have an illegal exponent format
  12622. if (stringMatch && stringMatch[4] && stringMatch[2] === undefined) {
  12623. throw new Error('' + string + ' not a valid Decimal128 string');
  12624. }
  12625. // Get the negative or positive sign
  12626. if (string[index] === '+' || string[index] === '-') {
  12627. isNegative = string[index++] === '-';
  12628. }
  12629. // Check if user passed Infinity or NaN
  12630. if (!isDigit(string[index]) && string[index] !== '.') {
  12631. if (string[index] === 'i' || string[index] === 'I') {
  12632. return new Decimal128(new Buffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
  12633. } else if (string[index] === 'N') {
  12634. return new Decimal128(new Buffer(NAN_BUFFER));
  12635. }
  12636. }
  12637. // Read all the digits
  12638. while (isDigit(string[index]) || string[index] === '.') {
  12639. if (string[index] === '.') {
  12640. if (sawRadix) {
  12641. return new Decimal128(new Buffer(NAN_BUFFER));
  12642. }
  12643. sawRadix = true;
  12644. index = index + 1;
  12645. continue;
  12646. }
  12647. if (nDigitsStored < 34) {
  12648. if (string[index] !== '0' || foundNonZero) {
  12649. if (!foundNonZero) {
  12650. firstNonZero = nDigitsRead;
  12651. }
  12652. foundNonZero = true;
  12653. // Only store 34 digits
  12654. digits[digitsInsert++] = parseInt(string[index], 10);
  12655. nDigitsStored = nDigitsStored + 1;
  12656. }
  12657. }
  12658. if (foundNonZero) {
  12659. nDigits = nDigits + 1;
  12660. }
  12661. if (sawRadix) {
  12662. radixPosition = radixPosition + 1;
  12663. }
  12664. nDigitsRead = nDigitsRead + 1;
  12665. index = index + 1;
  12666. }
  12667. if (sawRadix && !nDigitsRead) {
  12668. throw new Error('' + string + ' not a valid Decimal128 string');
  12669. }
  12670. // Read exponent if exists
  12671. if (string[index] === 'e' || string[index] === 'E') {
  12672. // Read exponent digits
  12673. var match = string.substr(++index).match(EXPONENT_REGEX);
  12674. // No digits read
  12675. if (!match || !match[2]) {
  12676. return new Decimal128(new Buffer(NAN_BUFFER));
  12677. }
  12678. // Get exponent
  12679. exponent = parseInt(match[0], 10);
  12680. // Adjust the index
  12681. index = index + match[0].length;
  12682. }
  12683. // Return not a number
  12684. if (string[index]) {
  12685. return new Decimal128(new Buffer(NAN_BUFFER));
  12686. }
  12687. // Done reading input
  12688. // Find first non-zero digit in digits
  12689. firstDigit = 0;
  12690. if (!nDigitsStored) {
  12691. firstDigit = 0;
  12692. lastDigit = 0;
  12693. digits[0] = 0;
  12694. nDigits = 1;
  12695. nDigitsStored = 1;
  12696. significantDigits = 0;
  12697. } else {
  12698. lastDigit = nDigitsStored - 1;
  12699. significantDigits = nDigits;
  12700. if (exponent !== 0 && significantDigits !== 1) {
  12701. while (string[firstNonZero + significantDigits - 1] === '0') {
  12702. significantDigits = significantDigits - 1;
  12703. }
  12704. }
  12705. }
  12706. // Normalization of exponent
  12707. // Correct exponent based on radix position, and shift significand as needed
  12708. // to represent user input
  12709. // Overflow prevention
  12710. if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) {
  12711. exponent = EXPONENT_MIN;
  12712. } else {
  12713. exponent = exponent - radixPosition;
  12714. }
  12715. // Attempt to normalize the exponent
  12716. while (exponent > EXPONENT_MAX) {
  12717. // Shift exponent to significand and decrease
  12718. lastDigit = lastDigit + 1;
  12719. if (lastDigit - firstDigit > MAX_DIGITS) {
  12720. // Check if we have a zero then just hard clamp, otherwise fail
  12721. var digitsString = digits.join('');
  12722. if (digitsString.match(/^0+$/)) {
  12723. exponent = EXPONENT_MAX;
  12724. break;
  12725. } else {
  12726. return new Decimal128(new Buffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
  12727. }
  12728. }
  12729. exponent = exponent - 1;
  12730. }
  12731. while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) {
  12732. // Shift last digit
  12733. if (lastDigit === 0) {
  12734. exponent = EXPONENT_MIN;
  12735. significantDigits = 0;
  12736. break;
  12737. }
  12738. if (nDigitsStored < nDigits) {
  12739. // adjust to match digits not stored
  12740. nDigits = nDigits - 1;
  12741. } else {
  12742. // adjust to round
  12743. lastDigit = lastDigit - 1;
  12744. }
  12745. if (exponent < EXPONENT_MAX) {
  12746. exponent = exponent + 1;
  12747. } else {
  12748. // Check if we have a zero then just hard clamp, otherwise fail
  12749. digitsString = digits.join('');
  12750. if (digitsString.match(/^0+$/)) {
  12751. exponent = EXPONENT_MAX;
  12752. break;
  12753. } else {
  12754. return new Decimal128(new Buffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
  12755. }
  12756. }
  12757. }
  12758. // Round
  12759. // We've normalized the exponent, but might still need to round.
  12760. if (lastDigit - firstDigit + 1 < significantDigits && string[significantDigits] !== '0') {
  12761. var endOfString = nDigitsRead;
  12762. // If we have seen a radix point, 'string' is 1 longer than we have
  12763. // documented with ndigits_read, so inc the position of the first nonzero
  12764. // digit and the position that digits are read to.
  12765. if (sawRadix && exponent === EXPONENT_MIN) {
  12766. firstNonZero = firstNonZero + 1;
  12767. endOfString = endOfString + 1;
  12768. }
  12769. var roundDigit = parseInt(string[firstNonZero + lastDigit + 1], 10);
  12770. var roundBit = 0;
  12771. if (roundDigit >= 5) {
  12772. roundBit = 1;
  12773. if (roundDigit === 5) {
  12774. roundBit = digits[lastDigit] % 2 === 1;
  12775. for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) {
  12776. if (parseInt(string[i], 10)) {
  12777. roundBit = 1;
  12778. break;
  12779. }
  12780. }
  12781. }
  12782. }
  12783. if (roundBit) {
  12784. var dIdx = lastDigit;
  12785. for (; dIdx >= 0; dIdx--) {
  12786. if (++digits[dIdx] > 9) {
  12787. digits[dIdx] = 0;
  12788. // overflowed most significant digit
  12789. if (dIdx === 0) {
  12790. if (exponent < EXPONENT_MAX) {
  12791. exponent = exponent + 1;
  12792. digits[dIdx] = 1;
  12793. } else {
  12794. return new Decimal128(new Buffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
  12795. }
  12796. }
  12797. } else {
  12798. break;
  12799. }
  12800. }
  12801. }
  12802. }
  12803. // Encode significand
  12804. // The high 17 digits of the significand
  12805. significandHigh = Long.fromNumber(0);
  12806. // The low 17 digits of the significand
  12807. significandLow = Long.fromNumber(0);
  12808. // read a zero
  12809. if (significantDigits === 0) {
  12810. significandHigh = Long.fromNumber(0);
  12811. significandLow = Long.fromNumber(0);
  12812. } else if (lastDigit - firstDigit < 17) {
  12813. dIdx = firstDigit;
  12814. significandLow = Long.fromNumber(digits[dIdx++]);
  12815. significandHigh = new Long(0, 0);
  12816. for (; dIdx <= lastDigit; dIdx++) {
  12817. significandLow = significandLow.multiply(Long.fromNumber(10));
  12818. significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
  12819. }
  12820. } else {
  12821. dIdx = firstDigit;
  12822. significandHigh = Long.fromNumber(digits[dIdx++]);
  12823. for (; dIdx <= lastDigit - 17; dIdx++) {
  12824. significandHigh = significandHigh.multiply(Long.fromNumber(10));
  12825. significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx]));
  12826. }
  12827. significandLow = Long.fromNumber(digits[dIdx++]);
  12828. for (; dIdx <= lastDigit; dIdx++) {
  12829. significandLow = significandLow.multiply(Long.fromNumber(10));
  12830. significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
  12831. }
  12832. }
  12833. var significand = multiply64x2(significandHigh, Long.fromString('100000000000000000'));
  12834. significand.low = significand.low.add(significandLow);
  12835. if (lessThan(significand.low, significandLow)) {
  12836. significand.high = significand.high.add(Long.fromNumber(1));
  12837. }
  12838. // Biased exponent
  12839. biasedExponent = exponent + EXPONENT_BIAS;
  12840. var dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) };
  12841. // Encode combination, exponent, and significand.
  12842. if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber)) {
  12843. // Encode '11' into bits 1 to 3
  12844. dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61));
  12845. dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47)));
  12846. dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff)));
  12847. } else {
  12848. dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49));
  12849. dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff)));
  12850. }
  12851. dec.low = significand.low;
  12852. // Encode sign
  12853. if (isNegative) {
  12854. dec.high = dec.high.or(Long.fromString('9223372036854775808'));
  12855. }
  12856. // Encode into a buffer
  12857. var buffer = new Buffer(16);
  12858. index = 0;
  12859. // Encode the low 64 bits of the decimal
  12860. // Encode low bits
  12861. buffer[index++] = dec.low.low_ & 0xff;
  12862. buffer[index++] = dec.low.low_ >> 8 & 0xff;
  12863. buffer[index++] = dec.low.low_ >> 16 & 0xff;
  12864. buffer[index++] = dec.low.low_ >> 24 & 0xff;
  12865. // Encode high bits
  12866. buffer[index++] = dec.low.high_ & 0xff;
  12867. buffer[index++] = dec.low.high_ >> 8 & 0xff;
  12868. buffer[index++] = dec.low.high_ >> 16 & 0xff;
  12869. buffer[index++] = dec.low.high_ >> 24 & 0xff;
  12870. // Encode the high 64 bits of the decimal
  12871. // Encode low bits
  12872. buffer[index++] = dec.high.low_ & 0xff;
  12873. buffer[index++] = dec.high.low_ >> 8 & 0xff;
  12874. buffer[index++] = dec.high.low_ >> 16 & 0xff;
  12875. buffer[index++] = dec.high.low_ >> 24 & 0xff;
  12876. // Encode high bits
  12877. buffer[index++] = dec.high.high_ & 0xff;
  12878. buffer[index++] = dec.high.high_ >> 8 & 0xff;
  12879. buffer[index++] = dec.high.high_ >> 16 & 0xff;
  12880. buffer[index++] = dec.high.high_ >> 24 & 0xff;
  12881. // Return the new Decimal128
  12882. return new Decimal128(buffer);
  12883. };
  12884. // Extract least significant 5 bits
  12885. var COMBINATION_MASK = 0x1f;
  12886. // Extract least significant 14 bits
  12887. var EXPONENT_MASK = 0x3fff;
  12888. // Value of combination field for Inf
  12889. var COMBINATION_INFINITY = 30;
  12890. // Value of combination field for NaN
  12891. var COMBINATION_NAN = 31;
  12892. // Value of combination field for NaN
  12893. // var COMBINATION_SNAN = 32;
  12894. // decimal128 exponent bias
  12895. EXPONENT_BIAS = 6176;
  12896. /**
  12897. * Create a string representation of the raw Decimal128 value
  12898. *
  12899. * @method
  12900. * @return {string} returns a Decimal128 string representation.
  12901. */
  12902. Decimal128.prototype.toString = function () {
  12903. // Note: bits in this routine are referred to starting at 0,
  12904. // from the sign bit, towards the coefficient.
  12905. // bits 0 - 31
  12906. var high;
  12907. // bits 32 - 63
  12908. var midh;
  12909. // bits 64 - 95
  12910. var midl;
  12911. // bits 96 - 127
  12912. var low;
  12913. // bits 1 - 5
  12914. var combination;
  12915. // decoded biased exponent (14 bits)
  12916. var biased_exponent;
  12917. // the number of significand digits
  12918. var significand_digits = 0;
  12919. // the base-10 digits in the significand
  12920. var significand = new Array(36);
  12921. for (var i = 0; i < significand.length; i++) significand[i] = 0;
  12922. // read pointer into significand
  12923. var index = 0;
  12924. // unbiased exponent
  12925. var exponent;
  12926. // the exponent if scientific notation is used
  12927. var scientific_exponent;
  12928. // true if the number is zero
  12929. var is_zero = false;
  12930. // the most signifcant significand bits (50-46)
  12931. var significand_msb;
  12932. // temporary storage for significand decoding
  12933. var significand128 = { parts: new Array(4) };
  12934. // indexing variables
  12935. i;
  12936. var j, k;
  12937. // Output string
  12938. var string = [];
  12939. // Unpack index
  12940. index = 0;
  12941. // Buffer reference
  12942. var buffer = this.bytes;
  12943. // Unpack the low 64bits into a long
  12944. low = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  12945. midl = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  12946. // Unpack the high 64bits into a long
  12947. midh = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  12948. high = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  12949. // Unpack index
  12950. index = 0;
  12951. // Create the state of the decimal
  12952. var dec = {
  12953. low: new Long(low, midl),
  12954. high: new Long(midh, high)
  12955. };
  12956. if (dec.high.lessThan(Long.ZERO)) {
  12957. string.push('-');
  12958. }
  12959. // Decode combination field and exponent
  12960. combination = high >> 26 & COMBINATION_MASK;
  12961. if (combination >> 3 === 3) {
  12962. // Check for 'special' values
  12963. if (combination === COMBINATION_INFINITY) {
  12964. return string.join('') + 'Infinity';
  12965. } else if (combination === COMBINATION_NAN) {
  12966. return 'NaN';
  12967. } else {
  12968. biased_exponent = high >> 15 & EXPONENT_MASK;
  12969. significand_msb = 0x08 + (high >> 14 & 0x01);
  12970. }
  12971. } else {
  12972. significand_msb = high >> 14 & 0x07;
  12973. biased_exponent = high >> 17 & EXPONENT_MASK;
  12974. }
  12975. exponent = biased_exponent - EXPONENT_BIAS;
  12976. // Create string of significand digits
  12977. // Convert the 114-bit binary number represented by
  12978. // (significand_high, significand_low) to at most 34 decimal
  12979. // digits through modulo and division.
  12980. significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
  12981. significand128.parts[1] = midh;
  12982. significand128.parts[2] = midl;
  12983. significand128.parts[3] = low;
  12984. if (significand128.parts[0] === 0 && significand128.parts[1] === 0 && significand128.parts[2] === 0 && significand128.parts[3] === 0) {
  12985. is_zero = true;
  12986. } else {
  12987. for (k = 3; k >= 0; k--) {
  12988. var least_digits = 0;
  12989. // Peform the divide
  12990. var result = divideu128(significand128);
  12991. significand128 = result.quotient;
  12992. least_digits = result.rem.low_;
  12993. // We now have the 9 least significant digits (in base 2).
  12994. // Convert and output to string.
  12995. if (!least_digits) continue;
  12996. for (j = 8; j >= 0; j--) {
  12997. // significand[k * 9 + j] = Math.round(least_digits % 10);
  12998. significand[k * 9 + j] = least_digits % 10;
  12999. // least_digits = Math.round(least_digits / 10);
  13000. least_digits = Math.floor(least_digits / 10);
  13001. }
  13002. }
  13003. }
  13004. // Output format options:
  13005. // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd
  13006. // Regular - ddd.ddd
  13007. if (is_zero) {
  13008. significand_digits = 1;
  13009. significand[index] = 0;
  13010. } else {
  13011. significand_digits = 36;
  13012. i = 0;
  13013. while (!significand[index]) {
  13014. i++;
  13015. significand_digits = significand_digits - 1;
  13016. index = index + 1;
  13017. }
  13018. }
  13019. scientific_exponent = significand_digits - 1 + exponent;
  13020. // The scientific exponent checks are dictated by the string conversion
  13021. // specification and are somewhat arbitrary cutoffs.
  13022. //
  13023. // We must check exponent > 0, because if this is the case, the number
  13024. // has trailing zeros. However, we *cannot* output these trailing zeros,
  13025. // because doing so would change the precision of the value, and would
  13026. // change stored data if the string converted number is round tripped.
  13027. if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) {
  13028. // Scientific format
  13029. string.push(significand[index++]);
  13030. significand_digits = significand_digits - 1;
  13031. if (significand_digits) {
  13032. string.push('.');
  13033. }
  13034. for (i = 0; i < significand_digits; i++) {
  13035. string.push(significand[index++]);
  13036. }
  13037. // Exponent
  13038. string.push('E');
  13039. if (scientific_exponent > 0) {
  13040. string.push('+' + scientific_exponent);
  13041. } else {
  13042. string.push(scientific_exponent);
  13043. }
  13044. } else {
  13045. // Regular format with no decimal place
  13046. if (exponent >= 0) {
  13047. for (i = 0; i < significand_digits; i++) {
  13048. string.push(significand[index++]);
  13049. }
  13050. } else {
  13051. var radix_position = significand_digits + exponent;
  13052. // non-zero digits before radix
  13053. if (radix_position > 0) {
  13054. for (i = 0; i < radix_position; i++) {
  13055. string.push(significand[index++]);
  13056. }
  13057. } else {
  13058. string.push('0');
  13059. }
  13060. string.push('.');
  13061. // add leading zeros after radix
  13062. while (radix_position++ < 0) {
  13063. string.push('0');
  13064. }
  13065. for (i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) {
  13066. string.push(significand[index++]);
  13067. }
  13068. }
  13069. }
  13070. return string.join('');
  13071. };
  13072. Decimal128.prototype.toJSON = function () {
  13073. return { $numberDecimal: this.toString() };
  13074. };
  13075. module.exports = Decimal128;
  13076. module.exports.Decimal128 = Decimal128;
  13077. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(329).Buffer))
  13078. /***/ }),
  13079. /* 347 */
  13080. /***/ (function(module, exports) {
  13081. /**
  13082. * A class representation of the BSON MinKey type.
  13083. *
  13084. * @class
  13085. * @return {MinKey} A MinKey instance
  13086. */
  13087. function MinKey() {
  13088. if (!(this instanceof MinKey)) return new MinKey();
  13089. this._bsontype = 'MinKey';
  13090. }
  13091. module.exports = MinKey;
  13092. module.exports.MinKey = MinKey;
  13093. /***/ }),
  13094. /* 348 */
  13095. /***/ (function(module, exports) {
  13096. /**
  13097. * A class representation of the BSON MaxKey type.
  13098. *
  13099. * @class
  13100. * @return {MaxKey} A MaxKey instance
  13101. */
  13102. function MaxKey() {
  13103. if (!(this instanceof MaxKey)) return new MaxKey();
  13104. this._bsontype = 'MaxKey';
  13105. }
  13106. module.exports = MaxKey;
  13107. module.exports.MaxKey = MaxKey;
  13108. /***/ }),
  13109. /* 349 */
  13110. /***/ (function(module, exports) {
  13111. /**
  13112. * A class representation of the BSON DBRef type.
  13113. *
  13114. * @class
  13115. * @param {string} namespace the collection name.
  13116. * @param {ObjectID} oid the reference ObjectID.
  13117. * @param {string} [db] optional db name, if omitted the reference is local to the current db.
  13118. * @return {DBRef}
  13119. */
  13120. function DBRef(namespace, oid, db) {
  13121. if (!(this instanceof DBRef)) return new DBRef(namespace, oid, db);
  13122. this._bsontype = 'DBRef';
  13123. this.namespace = namespace;
  13124. this.oid = oid;
  13125. this.db = db;
  13126. }
  13127. /**
  13128. * @ignore
  13129. * @api private
  13130. */
  13131. DBRef.prototype.toJSON = function () {
  13132. return {
  13133. $ref: this.namespace,
  13134. $id: this.oid,
  13135. $db: this.db == null ? '' : this.db
  13136. };
  13137. };
  13138. module.exports = DBRef;
  13139. module.exports.DBRef = DBRef;
  13140. /***/ }),
  13141. /* 350 */
  13142. /***/ (function(module, exports, __webpack_require__) {
  13143. /* WEBPACK VAR INJECTION */(function(global) {/**
  13144. * Module dependencies.
  13145. * @ignore
  13146. */
  13147. // Test if we're in Node via presence of "global" not absence of "window"
  13148. // to support hybrid environments like Electron
  13149. if (typeof global !== 'undefined') {
  13150. var Buffer = __webpack_require__(329).Buffer; // TODO just use global Buffer
  13151. }
  13152. /**
  13153. * A class representation of the BSON Binary type.
  13154. *
  13155. * Sub types
  13156. * - **BSON.BSON_BINARY_SUBTYPE_DEFAULT**, default BSON type.
  13157. * - **BSON.BSON_BINARY_SUBTYPE_FUNCTION**, BSON function type.
  13158. * - **BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY**, BSON byte array type.
  13159. * - **BSON.BSON_BINARY_SUBTYPE_UUID**, BSON uuid type.
  13160. * - **BSON.BSON_BINARY_SUBTYPE_MD5**, BSON md5 type.
  13161. * - **BSON.BSON_BINARY_SUBTYPE_USER_DEFINED**, BSON user defined type.
  13162. *
  13163. * @class
  13164. * @param {Buffer} buffer a buffer object containing the binary data.
  13165. * @param {Number} [subType] the option binary type.
  13166. * @return {Binary}
  13167. */
  13168. function Binary(buffer, subType) {
  13169. if (!(this instanceof Binary)) return new Binary(buffer, subType);
  13170. if (buffer != null && !(typeof buffer === 'string') && !Buffer.isBuffer(buffer) && !(buffer instanceof Uint8Array) && !Array.isArray(buffer)) {
  13171. throw new Error('only String, Buffer, Uint8Array or Array accepted');
  13172. }
  13173. this._bsontype = 'Binary';
  13174. if (buffer instanceof Number) {
  13175. this.sub_type = buffer;
  13176. this.position = 0;
  13177. } else {
  13178. this.sub_type = subType == null ? BSON_BINARY_SUBTYPE_DEFAULT : subType;
  13179. this.position = 0;
  13180. }
  13181. if (buffer != null && !(buffer instanceof Number)) {
  13182. // Only accept Buffer, Uint8Array or Arrays
  13183. if (typeof buffer === 'string') {
  13184. // Different ways of writing the length of the string for the different types
  13185. if (typeof Buffer !== 'undefined') {
  13186. this.buffer = new Buffer(buffer);
  13187. } else if (typeof Uint8Array !== 'undefined' || Object.prototype.toString.call(buffer) === '[object Array]') {
  13188. this.buffer = writeStringToArray(buffer);
  13189. } else {
  13190. throw new Error('only String, Buffer, Uint8Array or Array accepted');
  13191. }
  13192. } else {
  13193. this.buffer = buffer;
  13194. }
  13195. this.position = buffer.length;
  13196. } else {
  13197. if (typeof Buffer !== 'undefined') {
  13198. this.buffer = new Buffer(Binary.BUFFER_SIZE);
  13199. } else if (typeof Uint8Array !== 'undefined') {
  13200. this.buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE));
  13201. } else {
  13202. this.buffer = new Array(Binary.BUFFER_SIZE);
  13203. }
  13204. // Set position to start of buffer
  13205. this.position = 0;
  13206. }
  13207. }
  13208. /**
  13209. * Updates this binary with byte_value.
  13210. *
  13211. * @method
  13212. * @param {string} byte_value a single byte we wish to write.
  13213. */
  13214. Binary.prototype.put = function put(byte_value) {
  13215. // If it's a string and a has more than one character throw an error
  13216. if (byte_value['length'] != null && typeof byte_value !== 'number' && byte_value.length !== 1) throw new Error('only accepts single character String, Uint8Array or Array');
  13217. if (typeof byte_value !== 'number' && byte_value < 0 || byte_value > 255) throw new Error('only accepts number in a valid unsigned byte range 0-255');
  13218. // Decode the byte value once
  13219. var decoded_byte = null;
  13220. if (typeof byte_value === 'string') {
  13221. decoded_byte = byte_value.charCodeAt(0);
  13222. } else if (byte_value['length'] != null) {
  13223. decoded_byte = byte_value[0];
  13224. } else {
  13225. decoded_byte = byte_value;
  13226. }
  13227. if (this.buffer.length > this.position) {
  13228. this.buffer[this.position++] = decoded_byte;
  13229. } else {
  13230. if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
  13231. // Create additional overflow buffer
  13232. var buffer = new Buffer(Binary.BUFFER_SIZE + this.buffer.length);
  13233. // Combine the two buffers together
  13234. this.buffer.copy(buffer, 0, 0, this.buffer.length);
  13235. this.buffer = buffer;
  13236. this.buffer[this.position++] = decoded_byte;
  13237. } else {
  13238. buffer = null;
  13239. // Create a new buffer (typed or normal array)
  13240. if (Object.prototype.toString.call(this.buffer) === '[object Uint8Array]') {
  13241. buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE + this.buffer.length));
  13242. } else {
  13243. buffer = new Array(Binary.BUFFER_SIZE + this.buffer.length);
  13244. }
  13245. // We need to copy all the content to the new array
  13246. for (var i = 0; i < this.buffer.length; i++) {
  13247. buffer[i] = this.buffer[i];
  13248. }
  13249. // Reassign the buffer
  13250. this.buffer = buffer;
  13251. // Write the byte
  13252. this.buffer[this.position++] = decoded_byte;
  13253. }
  13254. }
  13255. };
  13256. /**
  13257. * Writes a buffer or string to the binary.
  13258. *
  13259. * @method
  13260. * @param {(Buffer|string)} string a string or buffer to be written to the Binary BSON object.
  13261. * @param {number} offset specify the binary of where to write the content.
  13262. * @return {null}
  13263. */
  13264. Binary.prototype.write = function write(string, offset) {
  13265. offset = typeof offset === 'number' ? offset : this.position;
  13266. // If the buffer is to small let's extend the buffer
  13267. if (this.buffer.length < offset + string.length) {
  13268. var buffer = null;
  13269. // If we are in node.js
  13270. if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
  13271. buffer = new Buffer(this.buffer.length + string.length);
  13272. this.buffer.copy(buffer, 0, 0, this.buffer.length);
  13273. } else if (Object.prototype.toString.call(this.buffer) === '[object Uint8Array]') {
  13274. // Create a new buffer
  13275. buffer = new Uint8Array(new ArrayBuffer(this.buffer.length + string.length));
  13276. // Copy the content
  13277. for (var i = 0; i < this.position; i++) {
  13278. buffer[i] = this.buffer[i];
  13279. }
  13280. }
  13281. // Assign the new buffer
  13282. this.buffer = buffer;
  13283. }
  13284. if (typeof Buffer !== 'undefined' && Buffer.isBuffer(string) && Buffer.isBuffer(this.buffer)) {
  13285. string.copy(this.buffer, offset, 0, string.length);
  13286. this.position = offset + string.length > this.position ? offset + string.length : this.position;
  13287. // offset = string.length
  13288. } else if (typeof Buffer !== 'undefined' && typeof string === 'string' && Buffer.isBuffer(this.buffer)) {
  13289. this.buffer.write(string, offset, 'binary');
  13290. this.position = offset + string.length > this.position ? offset + string.length : this.position;
  13291. // offset = string.length;
  13292. } else if (Object.prototype.toString.call(string) === '[object Uint8Array]' || Object.prototype.toString.call(string) === '[object Array]' && typeof string !== 'string') {
  13293. for (i = 0; i < string.length; i++) {
  13294. this.buffer[offset++] = string[i];
  13295. }
  13296. this.position = offset > this.position ? offset : this.position;
  13297. } else if (typeof string === 'string') {
  13298. for (i = 0; i < string.length; i++) {
  13299. this.buffer[offset++] = string.charCodeAt(i);
  13300. }
  13301. this.position = offset > this.position ? offset : this.position;
  13302. }
  13303. };
  13304. /**
  13305. * Reads **length** bytes starting at **position**.
  13306. *
  13307. * @method
  13308. * @param {number} position read from the given position in the Binary.
  13309. * @param {number} length the number of bytes to read.
  13310. * @return {Buffer}
  13311. */
  13312. Binary.prototype.read = function read(position, length) {
  13313. length = length && length > 0 ? length : this.position;
  13314. // Let's return the data based on the type we have
  13315. if (this.buffer['slice']) {
  13316. return this.buffer.slice(position, position + length);
  13317. } else {
  13318. // Create a buffer to keep the result
  13319. var buffer = typeof Uint8Array !== 'undefined' ? new Uint8Array(new ArrayBuffer(length)) : new Array(length);
  13320. for (var i = 0; i < length; i++) {
  13321. buffer[i] = this.buffer[position++];
  13322. }
  13323. }
  13324. // Return the buffer
  13325. return buffer;
  13326. };
  13327. /**
  13328. * Returns the value of this binary as a string.
  13329. *
  13330. * @method
  13331. * @return {string}
  13332. */
  13333. Binary.prototype.value = function value(asRaw) {
  13334. asRaw = asRaw == null ? false : asRaw;
  13335. // Optimize to serialize for the situation where the data == size of buffer
  13336. if (asRaw && typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer) && this.buffer.length === this.position) return this.buffer;
  13337. // If it's a node.js buffer object
  13338. if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
  13339. return asRaw ? this.buffer.slice(0, this.position) : this.buffer.toString('binary', 0, this.position);
  13340. } else {
  13341. if (asRaw) {
  13342. // we support the slice command use it
  13343. if (this.buffer['slice'] != null) {
  13344. return this.buffer.slice(0, this.position);
  13345. } else {
  13346. // Create a new buffer to copy content to
  13347. var newBuffer = Object.prototype.toString.call(this.buffer) === '[object Uint8Array]' ? new Uint8Array(new ArrayBuffer(this.position)) : new Array(this.position);
  13348. // Copy content
  13349. for (var i = 0; i < this.position; i++) {
  13350. newBuffer[i] = this.buffer[i];
  13351. }
  13352. // Return the buffer
  13353. return newBuffer;
  13354. }
  13355. } else {
  13356. return convertArraytoUtf8BinaryString(this.buffer, 0, this.position);
  13357. }
  13358. }
  13359. };
  13360. /**
  13361. * Length.
  13362. *
  13363. * @method
  13364. * @return {number} the length of the binary.
  13365. */
  13366. Binary.prototype.length = function length() {
  13367. return this.position;
  13368. };
  13369. /**
  13370. * @ignore
  13371. */
  13372. Binary.prototype.toJSON = function () {
  13373. return this.buffer != null ? this.buffer.toString('base64') : '';
  13374. };
  13375. /**
  13376. * @ignore
  13377. */
  13378. Binary.prototype.toString = function (format) {
  13379. return this.buffer != null ? this.buffer.slice(0, this.position).toString(format) : '';
  13380. };
  13381. /**
  13382. * Binary default subtype
  13383. * @ignore
  13384. */
  13385. var BSON_BINARY_SUBTYPE_DEFAULT = 0;
  13386. /**
  13387. * @ignore
  13388. */
  13389. var writeStringToArray = function (data) {
  13390. // Create a buffer
  13391. var buffer = typeof Uint8Array !== 'undefined' ? new Uint8Array(new ArrayBuffer(data.length)) : new Array(data.length);
  13392. // Write the content to the buffer
  13393. for (var i = 0; i < data.length; i++) {
  13394. buffer[i] = data.charCodeAt(i);
  13395. }
  13396. // Write the string to the buffer
  13397. return buffer;
  13398. };
  13399. /**
  13400. * Convert Array ot Uint8Array to Binary String
  13401. *
  13402. * @ignore
  13403. */
  13404. var convertArraytoUtf8BinaryString = function (byteArray, startIndex, endIndex) {
  13405. var result = '';
  13406. for (var i = startIndex; i < endIndex; i++) {
  13407. result = result + String.fromCharCode(byteArray[i]);
  13408. }
  13409. return result;
  13410. };
  13411. Binary.BUFFER_SIZE = 256;
  13412. /**
  13413. * Default BSON type
  13414. *
  13415. * @classconstant SUBTYPE_DEFAULT
  13416. **/
  13417. Binary.SUBTYPE_DEFAULT = 0;
  13418. /**
  13419. * Function BSON type
  13420. *
  13421. * @classconstant SUBTYPE_DEFAULT
  13422. **/
  13423. Binary.SUBTYPE_FUNCTION = 1;
  13424. /**
  13425. * Byte Array BSON type
  13426. *
  13427. * @classconstant SUBTYPE_DEFAULT
  13428. **/
  13429. Binary.SUBTYPE_BYTE_ARRAY = 2;
  13430. /**
  13431. * OLD UUID BSON type
  13432. *
  13433. * @classconstant SUBTYPE_DEFAULT
  13434. **/
  13435. Binary.SUBTYPE_UUID_OLD = 3;
  13436. /**
  13437. * UUID BSON type
  13438. *
  13439. * @classconstant SUBTYPE_DEFAULT
  13440. **/
  13441. Binary.SUBTYPE_UUID = 4;
  13442. /**
  13443. * MD5 BSON type
  13444. *
  13445. * @classconstant SUBTYPE_DEFAULT
  13446. **/
  13447. Binary.SUBTYPE_MD5 = 5;
  13448. /**
  13449. * User BSON type
  13450. *
  13451. * @classconstant SUBTYPE_DEFAULT
  13452. **/
  13453. Binary.SUBTYPE_USER_DEFINED = 128;
  13454. /**
  13455. * Expose.
  13456. */
  13457. module.exports = Binary;
  13458. module.exports.Binary = Binary;
  13459. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  13460. /***/ }),
  13461. /* 351 */
  13462. /***/ (function(module, exports, __webpack_require__) {
  13463. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  13464. var Long = __webpack_require__(334).Long,
  13465. Double = __webpack_require__(335).Double,
  13466. Timestamp = __webpack_require__(336).Timestamp,
  13467. ObjectID = __webpack_require__(337).ObjectID,
  13468. Symbol = __webpack_require__(343).Symbol,
  13469. Code = __webpack_require__(345).Code,
  13470. MinKey = __webpack_require__(347).MinKey,
  13471. MaxKey = __webpack_require__(348).MaxKey,
  13472. Decimal128 = __webpack_require__(346),
  13473. Int32 = __webpack_require__(344),
  13474. DBRef = __webpack_require__(349).DBRef,
  13475. BSONRegExp = __webpack_require__(342).BSONRegExp,
  13476. Binary = __webpack_require__(350).Binary;
  13477. var deserialize = function (buffer, options, isArray) {
  13478. options = options == null ? {} : options;
  13479. var index = options && options.index ? options.index : 0;
  13480. // Read the document size
  13481. var size = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
  13482. // Ensure buffer is valid size
  13483. if (size < 5 || buffer.length < size || size + index > buffer.length) {
  13484. throw new Error('corrupt bson message');
  13485. }
  13486. // Illegal end value
  13487. if (buffer[index + size - 1] !== 0) {
  13488. throw new Error("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");
  13489. }
  13490. // Start deserializtion
  13491. return deserializeObject(buffer, index, options, isArray);
  13492. };
  13493. var deserializeObject = function (buffer, index, options, isArray) {
  13494. var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions'];
  13495. var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions'];
  13496. var cacheFunctionsCrc32 = options['cacheFunctionsCrc32'] == null ? false : options['cacheFunctionsCrc32'];
  13497. if (!cacheFunctionsCrc32) var crc32 = null;
  13498. var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw'];
  13499. // Return raw bson buffer instead of parsing it
  13500. var raw = options['raw'] == null ? false : options['raw'];
  13501. // Return BSONRegExp objects instead of native regular expressions
  13502. var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false;
  13503. // Controls the promotion of values vs wrapper classes
  13504. var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers'];
  13505. var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs'];
  13506. var promoteValues = options['promoteValues'] == null ? true : options['promoteValues'];
  13507. // Set the start index
  13508. var startIndex = index;
  13509. // Validate that we have at least 4 bytes of buffer
  13510. if (buffer.length < 5) throw new Error('corrupt bson message < 5 bytes long');
  13511. // Read the document size
  13512. var size = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13513. // Ensure buffer is valid size
  13514. if (size < 5 || size > buffer.length) throw new Error('corrupt bson message');
  13515. // Create holding object
  13516. var object = isArray ? [] : {};
  13517. // Used for arrays to skip having to perform utf8 decoding
  13518. var arrayIndex = 0;
  13519. var done = false;
  13520. // While we have more left data left keep parsing
  13521. // while (buffer[index + 1] !== 0) {
  13522. while (!done) {
  13523. // Read the type
  13524. var elementType = buffer[index++];
  13525. // If we get a zero it's the last byte, exit
  13526. if (elementType === 0) break;
  13527. // Get the start search index
  13528. var i = index;
  13529. // Locate the end of the c string
  13530. while (buffer[i] !== 0x00 && i < buffer.length) {
  13531. i++;
  13532. }
  13533. // If are at the end of the buffer there is a problem with the document
  13534. if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
  13535. var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i);
  13536. index = i + 1;
  13537. if (elementType === BSON.BSON_DATA_STRING) {
  13538. var stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13539. if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
  13540. object[name] = buffer.toString('utf8', index, index + stringSize - 1);
  13541. index = index + stringSize;
  13542. } else if (elementType === BSON.BSON_DATA_OID) {
  13543. var oid = new Buffer(12);
  13544. buffer.copy(oid, 0, index, index + 12);
  13545. object[name] = new ObjectID(oid);
  13546. index = index + 12;
  13547. } else if (elementType === BSON.BSON_DATA_INT && promoteValues === false) {
  13548. object[name] = new Int32(buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24);
  13549. } else if (elementType === BSON.BSON_DATA_INT) {
  13550. object[name] = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13551. } else if (elementType === BSON.BSON_DATA_NUMBER && promoteValues === false) {
  13552. object[name] = new Double(buffer.readDoubleLE(index));
  13553. index = index + 8;
  13554. } else if (elementType === BSON.BSON_DATA_NUMBER) {
  13555. object[name] = buffer.readDoubleLE(index);
  13556. index = index + 8;
  13557. } else if (elementType === BSON.BSON_DATA_DATE) {
  13558. var lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13559. var highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13560. object[name] = new Date(new Long(lowBits, highBits).toNumber());
  13561. } else if (elementType === BSON.BSON_DATA_BOOLEAN) {
  13562. if (buffer[index] !== 0 && buffer[index] !== 1) throw new Error('illegal boolean type value');
  13563. object[name] = buffer[index++] === 1;
  13564. } else if (elementType === BSON.BSON_DATA_OBJECT) {
  13565. var _index = index;
  13566. var objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
  13567. if (objectSize <= 0 || objectSize > buffer.length - index) throw new Error('bad embedded document length in bson');
  13568. // We have a raw value
  13569. if (raw) {
  13570. object[name] = buffer.slice(index, index + objectSize);
  13571. } else {
  13572. object[name] = deserializeObject(buffer, _index, options, false);
  13573. }
  13574. index = index + objectSize;
  13575. } else if (elementType === BSON.BSON_DATA_ARRAY) {
  13576. _index = index;
  13577. objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
  13578. var arrayOptions = options;
  13579. // Stop index
  13580. var stopIndex = index + objectSize;
  13581. // All elements of array to be returned as raw bson
  13582. if (fieldsAsRaw && fieldsAsRaw[name]) {
  13583. arrayOptions = {};
  13584. for (var n in options) arrayOptions[n] = options[n];
  13585. arrayOptions['raw'] = true;
  13586. }
  13587. object[name] = deserializeObject(buffer, _index, arrayOptions, true);
  13588. index = index + objectSize;
  13589. if (buffer[index - 1] !== 0) throw new Error('invalid array terminator byte');
  13590. if (index !== stopIndex) throw new Error('corrupted array bson');
  13591. } else if (elementType === BSON.BSON_DATA_UNDEFINED) {
  13592. object[name] = undefined;
  13593. } else if (elementType === BSON.BSON_DATA_NULL) {
  13594. object[name] = null;
  13595. } else if (elementType === BSON.BSON_DATA_LONG) {
  13596. // Unpack the low and high bits
  13597. lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13598. highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13599. var long = new Long(lowBits, highBits);
  13600. // Promote the long if possible
  13601. if (promoteLongs && promoteValues === true) {
  13602. object[name] = long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) ? long.toNumber() : long;
  13603. } else {
  13604. object[name] = long;
  13605. }
  13606. } else if (elementType === BSON.BSON_DATA_DECIMAL128) {
  13607. // Buffer to contain the decimal bytes
  13608. var bytes = new Buffer(16);
  13609. // Copy the next 16 bytes into the bytes buffer
  13610. buffer.copy(bytes, 0, index, index + 16);
  13611. // Update index
  13612. index = index + 16;
  13613. // Assign the new Decimal128 value
  13614. var decimal128 = new Decimal128(bytes);
  13615. // If we have an alternative mapper use that
  13616. object[name] = decimal128.toObject ? decimal128.toObject() : decimal128;
  13617. } else if (elementType === BSON.BSON_DATA_BINARY) {
  13618. var binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13619. var totalBinarySize = binarySize;
  13620. var subType = buffer[index++];
  13621. // Did we have a negative binary size, throw
  13622. if (binarySize < 0) throw new Error('Negative binary type element size found');
  13623. // Is the length longer than the document
  13624. if (binarySize > buffer.length) throw new Error('Binary type size larger than document size');
  13625. // Decode as raw Buffer object if options specifies it
  13626. if (buffer['slice'] != null) {
  13627. // If we have subtype 2 skip the 4 bytes for the size
  13628. if (subType === Binary.SUBTYPE_BYTE_ARRAY) {
  13629. binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13630. if (binarySize < 0) throw new Error('Negative binary type element size found for subtype 0x02');
  13631. if (binarySize > totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to long binary size');
  13632. if (binarySize < totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to short binary size');
  13633. }
  13634. if (promoteBuffers && promoteValues) {
  13635. object[name] = buffer.slice(index, index + binarySize);
  13636. } else {
  13637. object[name] = new Binary(buffer.slice(index, index + binarySize), subType);
  13638. }
  13639. } else {
  13640. var _buffer = typeof Uint8Array !== 'undefined' ? new Uint8Array(new ArrayBuffer(binarySize)) : new Array(binarySize);
  13641. // If we have subtype 2 skip the 4 bytes for the size
  13642. if (subType === Binary.SUBTYPE_BYTE_ARRAY) {
  13643. binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13644. if (binarySize < 0) throw new Error('Negative binary type element size found for subtype 0x02');
  13645. if (binarySize > totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to long binary size');
  13646. if (binarySize < totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to short binary size');
  13647. }
  13648. // Copy the data
  13649. for (i = 0; i < binarySize; i++) {
  13650. _buffer[i] = buffer[index + i];
  13651. }
  13652. if (promoteBuffers && promoteValues) {
  13653. object[name] = _buffer;
  13654. } else {
  13655. object[name] = new Binary(_buffer, subType);
  13656. }
  13657. }
  13658. // Update the index
  13659. index = index + binarySize;
  13660. } else if (elementType === BSON.BSON_DATA_REGEXP && bsonRegExp === false) {
  13661. // Get the start search index
  13662. i = index;
  13663. // Locate the end of the c string
  13664. while (buffer[i] !== 0x00 && i < buffer.length) {
  13665. i++;
  13666. }
  13667. // If are at the end of the buffer there is a problem with the document
  13668. if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
  13669. // Return the C string
  13670. var source = buffer.toString('utf8', index, i);
  13671. // Create the regexp
  13672. index = i + 1;
  13673. // Get the start search index
  13674. i = index;
  13675. // Locate the end of the c string
  13676. while (buffer[i] !== 0x00 && i < buffer.length) {
  13677. i++;
  13678. }
  13679. // If are at the end of the buffer there is a problem with the document
  13680. if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
  13681. // Return the C string
  13682. var regExpOptions = buffer.toString('utf8', index, i);
  13683. index = i + 1;
  13684. // For each option add the corresponding one for javascript
  13685. var optionsArray = new Array(regExpOptions.length);
  13686. // Parse options
  13687. for (i = 0; i < regExpOptions.length; i++) {
  13688. switch (regExpOptions[i]) {
  13689. case 'm':
  13690. optionsArray[i] = 'm';
  13691. break;
  13692. case 's':
  13693. optionsArray[i] = 'g';
  13694. break;
  13695. case 'i':
  13696. optionsArray[i] = 'i';
  13697. break;
  13698. }
  13699. }
  13700. object[name] = new RegExp(source, optionsArray.join(''));
  13701. } else if (elementType === BSON.BSON_DATA_REGEXP && bsonRegExp === true) {
  13702. // Get the start search index
  13703. i = index;
  13704. // Locate the end of the c string
  13705. while (buffer[i] !== 0x00 && i < buffer.length) {
  13706. i++;
  13707. }
  13708. // If are at the end of the buffer there is a problem with the document
  13709. if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
  13710. // Return the C string
  13711. source = buffer.toString('utf8', index, i);
  13712. index = i + 1;
  13713. // Get the start search index
  13714. i = index;
  13715. // Locate the end of the c string
  13716. while (buffer[i] !== 0x00 && i < buffer.length) {
  13717. i++;
  13718. }
  13719. // If are at the end of the buffer there is a problem with the document
  13720. if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
  13721. // Return the C string
  13722. regExpOptions = buffer.toString('utf8', index, i);
  13723. index = i + 1;
  13724. // Set the object
  13725. object[name] = new BSONRegExp(source, regExpOptions);
  13726. } else if (elementType === BSON.BSON_DATA_SYMBOL) {
  13727. stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13728. if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
  13729. object[name] = new Symbol(buffer.toString('utf8', index, index + stringSize - 1));
  13730. index = index + stringSize;
  13731. } else if (elementType === BSON.BSON_DATA_TIMESTAMP) {
  13732. lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13733. highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13734. object[name] = new Timestamp(lowBits, highBits);
  13735. } else if (elementType === BSON.BSON_DATA_MIN_KEY) {
  13736. object[name] = new MinKey();
  13737. } else if (elementType === BSON.BSON_DATA_MAX_KEY) {
  13738. object[name] = new MaxKey();
  13739. } else if (elementType === BSON.BSON_DATA_CODE) {
  13740. stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13741. if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
  13742. var functionString = buffer.toString('utf8', index, index + stringSize - 1);
  13743. // If we are evaluating the functions
  13744. if (evalFunctions) {
  13745. // If we have cache enabled let's look for the md5 of the function in the cache
  13746. if (cacheFunctions) {
  13747. var hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString;
  13748. // Got to do this to avoid V8 deoptimizing the call due to finding eval
  13749. object[name] = isolateEvalWithHash(functionCache, hash, functionString, object);
  13750. } else {
  13751. object[name] = isolateEval(functionString);
  13752. }
  13753. } else {
  13754. object[name] = new Code(functionString);
  13755. }
  13756. // Update parse index position
  13757. index = index + stringSize;
  13758. } else if (elementType === BSON.BSON_DATA_CODE_W_SCOPE) {
  13759. var totalSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13760. // Element cannot be shorter than totalSize + stringSize + documentSize + terminator
  13761. if (totalSize < 4 + 4 + 4 + 1) {
  13762. throw new Error('code_w_scope total size shorter minimum expected length');
  13763. }
  13764. // Get the code string size
  13765. stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13766. // Check if we have a valid string
  13767. if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
  13768. // Javascript function
  13769. functionString = buffer.toString('utf8', index, index + stringSize - 1);
  13770. // Update parse index position
  13771. index = index + stringSize;
  13772. // Parse the element
  13773. _index = index;
  13774. // Decode the size of the object document
  13775. objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
  13776. // Decode the scope object
  13777. var scopeObject = deserializeObject(buffer, _index, options, false);
  13778. // Adjust the index
  13779. index = index + objectSize;
  13780. // Check if field length is to short
  13781. if (totalSize < 4 + 4 + objectSize + stringSize) {
  13782. throw new Error('code_w_scope total size is to short, truncating scope');
  13783. }
  13784. // Check if totalSize field is to long
  13785. if (totalSize > 4 + 4 + objectSize + stringSize) {
  13786. throw new Error('code_w_scope total size is to long, clips outer document');
  13787. }
  13788. // If we are evaluating the functions
  13789. if (evalFunctions) {
  13790. // If we have cache enabled let's look for the md5 of the function in the cache
  13791. if (cacheFunctions) {
  13792. hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString;
  13793. // Got to do this to avoid V8 deoptimizing the call due to finding eval
  13794. object[name] = isolateEvalWithHash(functionCache, hash, functionString, object);
  13795. } else {
  13796. object[name] = isolateEval(functionString);
  13797. }
  13798. object[name].scope = scopeObject;
  13799. } else {
  13800. object[name] = new Code(functionString, scopeObject);
  13801. }
  13802. } else if (elementType === BSON.BSON_DATA_DBPOINTER) {
  13803. // Get the code string size
  13804. stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
  13805. // Check if we have a valid string
  13806. if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
  13807. // Namespace
  13808. var namespace = buffer.toString('utf8', index, index + stringSize - 1);
  13809. // Update parse index position
  13810. index = index + stringSize;
  13811. // Read the oid
  13812. var oidBuffer = new Buffer(12);
  13813. buffer.copy(oidBuffer, 0, index, index + 12);
  13814. oid = new ObjectID(oidBuffer);
  13815. // Update the index
  13816. index = index + 12;
  13817. // Split the namespace
  13818. var parts = namespace.split('.');
  13819. var db = parts.shift();
  13820. var collection = parts.join('.');
  13821. // Upgrade to DBRef type
  13822. object[name] = new DBRef(collection, oid, db);
  13823. } else {
  13824. throw new Error('Detected unknown BSON type ' + elementType.toString(16) + ' for fieldname "' + name + '", are you using the latest BSON parser');
  13825. }
  13826. }
  13827. // Check if the deserialization was against a valid array/object
  13828. if (size !== index - startIndex) {
  13829. if (isArray) throw new Error('corrupt array bson');
  13830. throw new Error('corrupt object bson');
  13831. }
  13832. // Check if we have a db ref object
  13833. if (object['$id'] != null) object = new DBRef(object['$ref'], object['$id'], object['$db']);
  13834. return object;
  13835. };
  13836. /**
  13837. * Ensure eval is isolated.
  13838. *
  13839. * @ignore
  13840. * @api private
  13841. */
  13842. var isolateEvalWithHash = function (functionCache, hash, functionString, object) {
  13843. // Contains the value we are going to set
  13844. var value = null;
  13845. // Check for cache hit, eval if missing and return cached function
  13846. if (functionCache[hash] == null) {
  13847. eval('value = ' + functionString);
  13848. functionCache[hash] = value;
  13849. }
  13850. // Set the object
  13851. return functionCache[hash].bind(object);
  13852. };
  13853. /**
  13854. * Ensure eval is isolated.
  13855. *
  13856. * @ignore
  13857. * @api private
  13858. */
  13859. var isolateEval = function (functionString) {
  13860. // Contains the value we are going to set
  13861. var value = null;
  13862. // Eval the function
  13863. eval('value = ' + functionString);
  13864. return value;
  13865. };
  13866. var BSON = {};
  13867. /**
  13868. * Contains the function cache if we have that enable to allow for avoiding the eval step on each deserialization, comparison is by md5
  13869. *
  13870. * @ignore
  13871. * @api private
  13872. */
  13873. var functionCache = BSON.functionCache = {};
  13874. /**
  13875. * Number BSON Type
  13876. *
  13877. * @classconstant BSON_DATA_NUMBER
  13878. **/
  13879. BSON.BSON_DATA_NUMBER = 1;
  13880. /**
  13881. * String BSON Type
  13882. *
  13883. * @classconstant BSON_DATA_STRING
  13884. **/
  13885. BSON.BSON_DATA_STRING = 2;
  13886. /**
  13887. * Object BSON Type
  13888. *
  13889. * @classconstant BSON_DATA_OBJECT
  13890. **/
  13891. BSON.BSON_DATA_OBJECT = 3;
  13892. /**
  13893. * Array BSON Type
  13894. *
  13895. * @classconstant BSON_DATA_ARRAY
  13896. **/
  13897. BSON.BSON_DATA_ARRAY = 4;
  13898. /**
  13899. * Binary BSON Type
  13900. *
  13901. * @classconstant BSON_DATA_BINARY
  13902. **/
  13903. BSON.BSON_DATA_BINARY = 5;
  13904. /**
  13905. * Binary BSON Type
  13906. *
  13907. * @classconstant BSON_DATA_UNDEFINED
  13908. **/
  13909. BSON.BSON_DATA_UNDEFINED = 6;
  13910. /**
  13911. * ObjectID BSON Type
  13912. *
  13913. * @classconstant BSON_DATA_OID
  13914. **/
  13915. BSON.BSON_DATA_OID = 7;
  13916. /**
  13917. * Boolean BSON Type
  13918. *
  13919. * @classconstant BSON_DATA_BOOLEAN
  13920. **/
  13921. BSON.BSON_DATA_BOOLEAN = 8;
  13922. /**
  13923. * Date BSON Type
  13924. *
  13925. * @classconstant BSON_DATA_DATE
  13926. **/
  13927. BSON.BSON_DATA_DATE = 9;
  13928. /**
  13929. * null BSON Type
  13930. *
  13931. * @classconstant BSON_DATA_NULL
  13932. **/
  13933. BSON.BSON_DATA_NULL = 10;
  13934. /**
  13935. * RegExp BSON Type
  13936. *
  13937. * @classconstant BSON_DATA_REGEXP
  13938. **/
  13939. BSON.BSON_DATA_REGEXP = 11;
  13940. /**
  13941. * Code BSON Type
  13942. *
  13943. * @classconstant BSON_DATA_DBPOINTER
  13944. **/
  13945. BSON.BSON_DATA_DBPOINTER = 12;
  13946. /**
  13947. * Code BSON Type
  13948. *
  13949. * @classconstant BSON_DATA_CODE
  13950. **/
  13951. BSON.BSON_DATA_CODE = 13;
  13952. /**
  13953. * Symbol BSON Type
  13954. *
  13955. * @classconstant BSON_DATA_SYMBOL
  13956. **/
  13957. BSON.BSON_DATA_SYMBOL = 14;
  13958. /**
  13959. * Code with Scope BSON Type
  13960. *
  13961. * @classconstant BSON_DATA_CODE_W_SCOPE
  13962. **/
  13963. BSON.BSON_DATA_CODE_W_SCOPE = 15;
  13964. /**
  13965. * 32 bit Integer BSON Type
  13966. *
  13967. * @classconstant BSON_DATA_INT
  13968. **/
  13969. BSON.BSON_DATA_INT = 16;
  13970. /**
  13971. * Timestamp BSON Type
  13972. *
  13973. * @classconstant BSON_DATA_TIMESTAMP
  13974. **/
  13975. BSON.BSON_DATA_TIMESTAMP = 17;
  13976. /**
  13977. * Long BSON Type
  13978. *
  13979. * @classconstant BSON_DATA_LONG
  13980. **/
  13981. BSON.BSON_DATA_LONG = 18;
  13982. /**
  13983. * Long BSON Type
  13984. *
  13985. * @classconstant BSON_DATA_DECIMAL128
  13986. **/
  13987. BSON.BSON_DATA_DECIMAL128 = 19;
  13988. /**
  13989. * MinKey BSON Type
  13990. *
  13991. * @classconstant BSON_DATA_MIN_KEY
  13992. **/
  13993. BSON.BSON_DATA_MIN_KEY = 0xff;
  13994. /**
  13995. * MaxKey BSON Type
  13996. *
  13997. * @classconstant BSON_DATA_MAX_KEY
  13998. **/
  13999. BSON.BSON_DATA_MAX_KEY = 0x7f;
  14000. /**
  14001. * Binary Default Type
  14002. *
  14003. * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
  14004. **/
  14005. BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
  14006. /**
  14007. * Binary Function Type
  14008. *
  14009. * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
  14010. **/
  14011. BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
  14012. /**
  14013. * Binary Byte Array Type
  14014. *
  14015. * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
  14016. **/
  14017. BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
  14018. /**
  14019. * Binary UUID Type
  14020. *
  14021. * @classconstant BSON_BINARY_SUBTYPE_UUID
  14022. **/
  14023. BSON.BSON_BINARY_SUBTYPE_UUID = 3;
  14024. /**
  14025. * Binary MD5 Type
  14026. *
  14027. * @classconstant BSON_BINARY_SUBTYPE_MD5
  14028. **/
  14029. BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
  14030. /**
  14031. * Binary User Defined Type
  14032. *
  14033. * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
  14034. **/
  14035. BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
  14036. // BSON MAX VALUES
  14037. BSON.BSON_INT32_MAX = 0x7fffffff;
  14038. BSON.BSON_INT32_MIN = -0x80000000;
  14039. BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
  14040. BSON.BSON_INT64_MIN = -Math.pow(2, 63);
  14041. // JS MAX PRECISE VALUES
  14042. BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
  14043. BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
  14044. // Internal long versions
  14045. var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
  14046. var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
  14047. module.exports = deserialize;
  14048. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(329).Buffer))
  14049. /***/ }),
  14050. /* 352 */
  14051. /***/ (function(module, exports, __webpack_require__) {
  14052. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  14053. var writeIEEE754 = __webpack_require__(353).writeIEEE754,
  14054. Long = __webpack_require__(334).Long,
  14055. MinKey = __webpack_require__(347).MinKey,
  14056. Map = __webpack_require__(333),
  14057. Binary = __webpack_require__(350).Binary;
  14058. const normalizedFunctionString = __webpack_require__(354).normalizedFunctionString;
  14059. // try {
  14060. // var _Buffer = Uint8Array;
  14061. // } catch (e) {
  14062. // _Buffer = Buffer;
  14063. // }
  14064. var regexp = /\x00/; // eslint-disable-line no-control-regex
  14065. // To ensure that 0.4 of node works correctly
  14066. var isDate = function isDate(d) {
  14067. return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]';
  14068. };
  14069. var isRegExp = function isRegExp(d) {
  14070. return Object.prototype.toString.call(d) === '[object RegExp]';
  14071. };
  14072. var serializeString = function (buffer, key, value, index, isArray) {
  14073. // Encode String type
  14074. buffer[index++] = BSON.BSON_DATA_STRING;
  14075. // Number of written bytes
  14076. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14077. // Encode the name
  14078. index = index + numberOfWrittenBytes + 1;
  14079. buffer[index - 1] = 0;
  14080. // Write the string
  14081. var size = buffer.write(value, index + 4, 'utf8');
  14082. // Write the size of the string to buffer
  14083. buffer[index + 3] = size + 1 >> 24 & 0xff;
  14084. buffer[index + 2] = size + 1 >> 16 & 0xff;
  14085. buffer[index + 1] = size + 1 >> 8 & 0xff;
  14086. buffer[index] = size + 1 & 0xff;
  14087. // Update index
  14088. index = index + 4 + size;
  14089. // Write zero
  14090. buffer[index++] = 0;
  14091. return index;
  14092. };
  14093. var serializeNumber = function (buffer, key, value, index, isArray) {
  14094. // We have an integer value
  14095. if (Math.floor(value) === value && value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
  14096. // If the value fits in 32 bits encode as int, if it fits in a double
  14097. // encode it as a double, otherwise long
  14098. if (value >= BSON.BSON_INT32_MIN && value <= BSON.BSON_INT32_MAX) {
  14099. // Set int type 32 bits or less
  14100. buffer[index++] = BSON.BSON_DATA_INT;
  14101. // Number of written bytes
  14102. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14103. // Encode the name
  14104. index = index + numberOfWrittenBytes;
  14105. buffer[index++] = 0;
  14106. // Write the int value
  14107. buffer[index++] = value & 0xff;
  14108. buffer[index++] = value >> 8 & 0xff;
  14109. buffer[index++] = value >> 16 & 0xff;
  14110. buffer[index++] = value >> 24 & 0xff;
  14111. } else if (value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
  14112. // Encode as double
  14113. buffer[index++] = BSON.BSON_DATA_NUMBER;
  14114. // Number of written bytes
  14115. numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14116. // Encode the name
  14117. index = index + numberOfWrittenBytes;
  14118. buffer[index++] = 0;
  14119. // Write float
  14120. writeIEEE754(buffer, value, index, 'little', 52, 8);
  14121. // Ajust index
  14122. index = index + 8;
  14123. } else {
  14124. // Set long type
  14125. buffer[index++] = BSON.BSON_DATA_LONG;
  14126. // Number of written bytes
  14127. numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14128. // Encode the name
  14129. index = index + numberOfWrittenBytes;
  14130. buffer[index++] = 0;
  14131. var longVal = Long.fromNumber(value);
  14132. var lowBits = longVal.getLowBits();
  14133. var highBits = longVal.getHighBits();
  14134. // Encode low bits
  14135. buffer[index++] = lowBits & 0xff;
  14136. buffer[index++] = lowBits >> 8 & 0xff;
  14137. buffer[index++] = lowBits >> 16 & 0xff;
  14138. buffer[index++] = lowBits >> 24 & 0xff;
  14139. // Encode high bits
  14140. buffer[index++] = highBits & 0xff;
  14141. buffer[index++] = highBits >> 8 & 0xff;
  14142. buffer[index++] = highBits >> 16 & 0xff;
  14143. buffer[index++] = highBits >> 24 & 0xff;
  14144. }
  14145. } else {
  14146. // Encode as double
  14147. buffer[index++] = BSON.BSON_DATA_NUMBER;
  14148. // Number of written bytes
  14149. numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14150. // Encode the name
  14151. index = index + numberOfWrittenBytes;
  14152. buffer[index++] = 0;
  14153. // Write float
  14154. writeIEEE754(buffer, value, index, 'little', 52, 8);
  14155. // Ajust index
  14156. index = index + 8;
  14157. }
  14158. return index;
  14159. };
  14160. var serializeNull = function (buffer, key, value, index, isArray) {
  14161. // Set long type
  14162. buffer[index++] = BSON.BSON_DATA_NULL;
  14163. // Number of written bytes
  14164. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14165. // Encode the name
  14166. index = index + numberOfWrittenBytes;
  14167. buffer[index++] = 0;
  14168. return index;
  14169. };
  14170. var serializeBoolean = function (buffer, key, value, index, isArray) {
  14171. // Write the type
  14172. buffer[index++] = BSON.BSON_DATA_BOOLEAN;
  14173. // Number of written bytes
  14174. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14175. // Encode the name
  14176. index = index + numberOfWrittenBytes;
  14177. buffer[index++] = 0;
  14178. // Encode the boolean value
  14179. buffer[index++] = value ? 1 : 0;
  14180. return index;
  14181. };
  14182. var serializeDate = function (buffer, key, value, index, isArray) {
  14183. // Write the type
  14184. buffer[index++] = BSON.BSON_DATA_DATE;
  14185. // Number of written bytes
  14186. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14187. // Encode the name
  14188. index = index + numberOfWrittenBytes;
  14189. buffer[index++] = 0;
  14190. // Write the date
  14191. var dateInMilis = Long.fromNumber(value.getTime());
  14192. var lowBits = dateInMilis.getLowBits();
  14193. var highBits = dateInMilis.getHighBits();
  14194. // Encode low bits
  14195. buffer[index++] = lowBits & 0xff;
  14196. buffer[index++] = lowBits >> 8 & 0xff;
  14197. buffer[index++] = lowBits >> 16 & 0xff;
  14198. buffer[index++] = lowBits >> 24 & 0xff;
  14199. // Encode high bits
  14200. buffer[index++] = highBits & 0xff;
  14201. buffer[index++] = highBits >> 8 & 0xff;
  14202. buffer[index++] = highBits >> 16 & 0xff;
  14203. buffer[index++] = highBits >> 24 & 0xff;
  14204. return index;
  14205. };
  14206. var serializeRegExp = function (buffer, key, value, index, isArray) {
  14207. // Write the type
  14208. buffer[index++] = BSON.BSON_DATA_REGEXP;
  14209. // Number of written bytes
  14210. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14211. // Encode the name
  14212. index = index + numberOfWrittenBytes;
  14213. buffer[index++] = 0;
  14214. if (value.source && value.source.match(regexp) != null) {
  14215. throw Error('value ' + value.source + ' must not contain null bytes');
  14216. }
  14217. // Adjust the index
  14218. index = index + buffer.write(value.source, index, 'utf8');
  14219. // Write zero
  14220. buffer[index++] = 0x00;
  14221. // Write the parameters
  14222. if (value.global) buffer[index++] = 0x73; // s
  14223. if (value.ignoreCase) buffer[index++] = 0x69; // i
  14224. if (value.multiline) buffer[index++] = 0x6d; // m
  14225. // Add ending zero
  14226. buffer[index++] = 0x00;
  14227. return index;
  14228. };
  14229. var serializeBSONRegExp = function (buffer, key, value, index, isArray) {
  14230. // Write the type
  14231. buffer[index++] = BSON.BSON_DATA_REGEXP;
  14232. // Number of written bytes
  14233. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14234. // Encode the name
  14235. index = index + numberOfWrittenBytes;
  14236. buffer[index++] = 0;
  14237. // Check the pattern for 0 bytes
  14238. if (value.pattern.match(regexp) != null) {
  14239. // The BSON spec doesn't allow keys with null bytes because keys are
  14240. // null-terminated.
  14241. throw Error('pattern ' + value.pattern + ' must not contain null bytes');
  14242. }
  14243. // Adjust the index
  14244. index = index + buffer.write(value.pattern, index, 'utf8');
  14245. // Write zero
  14246. buffer[index++] = 0x00;
  14247. // Write the options
  14248. index = index + buffer.write(value.options.split('').sort().join(''), index, 'utf8');
  14249. // Add ending zero
  14250. buffer[index++] = 0x00;
  14251. return index;
  14252. };
  14253. var serializeMinMax = function (buffer, key, value, index, isArray) {
  14254. // Write the type of either min or max key
  14255. if (value === null) {
  14256. buffer[index++] = BSON.BSON_DATA_NULL;
  14257. } else if (value instanceof MinKey) {
  14258. buffer[index++] = BSON.BSON_DATA_MIN_KEY;
  14259. } else {
  14260. buffer[index++] = BSON.BSON_DATA_MAX_KEY;
  14261. }
  14262. // Number of written bytes
  14263. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14264. // Encode the name
  14265. index = index + numberOfWrittenBytes;
  14266. buffer[index++] = 0;
  14267. return index;
  14268. };
  14269. var serializeObjectId = function (buffer, key, value, index, isArray) {
  14270. // Write the type
  14271. buffer[index++] = BSON.BSON_DATA_OID;
  14272. // Number of written bytes
  14273. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14274. // Encode the name
  14275. index = index + numberOfWrittenBytes;
  14276. buffer[index++] = 0;
  14277. // Write the objectId into the shared buffer
  14278. if (typeof value.id === 'string') {
  14279. buffer.write(value.id, index, 'binary');
  14280. } else if (value.id && value.id.copy) {
  14281. value.id.copy(buffer, index, 0, 12);
  14282. } else {
  14283. throw new Error('object [' + JSON.stringify(value) + '] is not a valid ObjectId');
  14284. }
  14285. // Ajust index
  14286. return index + 12;
  14287. };
  14288. var serializeBuffer = function (buffer, key, value, index, isArray) {
  14289. // Write the type
  14290. buffer[index++] = BSON.BSON_DATA_BINARY;
  14291. // Number of written bytes
  14292. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14293. // Encode the name
  14294. index = index + numberOfWrittenBytes;
  14295. buffer[index++] = 0;
  14296. // Get size of the buffer (current write point)
  14297. var size = value.length;
  14298. // Write the size of the string to buffer
  14299. buffer[index++] = size & 0xff;
  14300. buffer[index++] = size >> 8 & 0xff;
  14301. buffer[index++] = size >> 16 & 0xff;
  14302. buffer[index++] = size >> 24 & 0xff;
  14303. // Write the default subtype
  14304. buffer[index++] = BSON.BSON_BINARY_SUBTYPE_DEFAULT;
  14305. // Copy the content form the binary field to the buffer
  14306. value.copy(buffer, index, 0, size);
  14307. // Adjust the index
  14308. index = index + size;
  14309. return index;
  14310. };
  14311. var serializeObject = function (buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) {
  14312. for (var i = 0; i < path.length; i++) {
  14313. if (path[i] === value) throw new Error('cyclic dependency detected');
  14314. }
  14315. // Push value to stack
  14316. path.push(value);
  14317. // Write the type
  14318. buffer[index++] = Array.isArray(value) ? BSON.BSON_DATA_ARRAY : BSON.BSON_DATA_OBJECT;
  14319. // Number of written bytes
  14320. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14321. // Encode the name
  14322. index = index + numberOfWrittenBytes;
  14323. buffer[index++] = 0;
  14324. var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path);
  14325. // Pop stack
  14326. path.pop();
  14327. // Write size
  14328. return endIndex;
  14329. };
  14330. var serializeDecimal128 = function (buffer, key, value, index, isArray) {
  14331. buffer[index++] = BSON.BSON_DATA_DECIMAL128;
  14332. // Number of written bytes
  14333. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14334. // Encode the name
  14335. index = index + numberOfWrittenBytes;
  14336. buffer[index++] = 0;
  14337. // Write the data from the value
  14338. value.bytes.copy(buffer, index, 0, 16);
  14339. return index + 16;
  14340. };
  14341. var serializeLong = function (buffer, key, value, index, isArray) {
  14342. // Write the type
  14343. buffer[index++] = value._bsontype === 'Long' ? BSON.BSON_DATA_LONG : BSON.BSON_DATA_TIMESTAMP;
  14344. // Number of written bytes
  14345. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14346. // Encode the name
  14347. index = index + numberOfWrittenBytes;
  14348. buffer[index++] = 0;
  14349. // Write the date
  14350. var lowBits = value.getLowBits();
  14351. var highBits = value.getHighBits();
  14352. // Encode low bits
  14353. buffer[index++] = lowBits & 0xff;
  14354. buffer[index++] = lowBits >> 8 & 0xff;
  14355. buffer[index++] = lowBits >> 16 & 0xff;
  14356. buffer[index++] = lowBits >> 24 & 0xff;
  14357. // Encode high bits
  14358. buffer[index++] = highBits & 0xff;
  14359. buffer[index++] = highBits >> 8 & 0xff;
  14360. buffer[index++] = highBits >> 16 & 0xff;
  14361. buffer[index++] = highBits >> 24 & 0xff;
  14362. return index;
  14363. };
  14364. var serializeInt32 = function (buffer, key, value, index, isArray) {
  14365. // Set int type 32 bits or less
  14366. buffer[index++] = BSON.BSON_DATA_INT;
  14367. // Number of written bytes
  14368. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14369. // Encode the name
  14370. index = index + numberOfWrittenBytes;
  14371. buffer[index++] = 0;
  14372. // Write the int value
  14373. buffer[index++] = value & 0xff;
  14374. buffer[index++] = value >> 8 & 0xff;
  14375. buffer[index++] = value >> 16 & 0xff;
  14376. buffer[index++] = value >> 24 & 0xff;
  14377. return index;
  14378. };
  14379. var serializeDouble = function (buffer, key, value, index, isArray) {
  14380. // Encode as double
  14381. buffer[index++] = BSON.BSON_DATA_NUMBER;
  14382. // Number of written bytes
  14383. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14384. // Encode the name
  14385. index = index + numberOfWrittenBytes;
  14386. buffer[index++] = 0;
  14387. // Write float
  14388. writeIEEE754(buffer, value, index, 'little', 52, 8);
  14389. // Ajust index
  14390. index = index + 8;
  14391. return index;
  14392. };
  14393. var serializeFunction = function (buffer, key, value, index, checkKeys, depth, isArray) {
  14394. buffer[index++] = BSON.BSON_DATA_CODE;
  14395. // Number of written bytes
  14396. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14397. // Encode the name
  14398. index = index + numberOfWrittenBytes;
  14399. buffer[index++] = 0;
  14400. // Function string
  14401. var functionString = normalizedFunctionString(value);
  14402. // Write the string
  14403. var size = buffer.write(functionString, index + 4, 'utf8') + 1;
  14404. // Write the size of the string to buffer
  14405. buffer[index] = size & 0xff;
  14406. buffer[index + 1] = size >> 8 & 0xff;
  14407. buffer[index + 2] = size >> 16 & 0xff;
  14408. buffer[index + 3] = size >> 24 & 0xff;
  14409. // Update index
  14410. index = index + 4 + size - 1;
  14411. // Write zero
  14412. buffer[index++] = 0;
  14413. return index;
  14414. };
  14415. var serializeCode = function (buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) {
  14416. if (value.scope && typeof value.scope === 'object') {
  14417. // Write the type
  14418. buffer[index++] = BSON.BSON_DATA_CODE_W_SCOPE;
  14419. // Number of written bytes
  14420. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14421. // Encode the name
  14422. index = index + numberOfWrittenBytes;
  14423. buffer[index++] = 0;
  14424. // Starting index
  14425. var startIndex = index;
  14426. // Serialize the function
  14427. // Get the function string
  14428. var functionString = typeof value.code === 'string' ? value.code : value.code.toString();
  14429. // Index adjustment
  14430. index = index + 4;
  14431. // Write string into buffer
  14432. var codeSize = buffer.write(functionString, index + 4, 'utf8') + 1;
  14433. // Write the size of the string to buffer
  14434. buffer[index] = codeSize & 0xff;
  14435. buffer[index + 1] = codeSize >> 8 & 0xff;
  14436. buffer[index + 2] = codeSize >> 16 & 0xff;
  14437. buffer[index + 3] = codeSize >> 24 & 0xff;
  14438. // Write end 0
  14439. buffer[index + 4 + codeSize - 1] = 0;
  14440. // Write the
  14441. index = index + codeSize + 4;
  14442. //
  14443. // Serialize the scope value
  14444. var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined);
  14445. index = endIndex - 1;
  14446. // Writ the total
  14447. var totalSize = endIndex - startIndex;
  14448. // Write the total size of the object
  14449. buffer[startIndex++] = totalSize & 0xff;
  14450. buffer[startIndex++] = totalSize >> 8 & 0xff;
  14451. buffer[startIndex++] = totalSize >> 16 & 0xff;
  14452. buffer[startIndex++] = totalSize >> 24 & 0xff;
  14453. // Write trailing zero
  14454. buffer[index++] = 0;
  14455. } else {
  14456. buffer[index++] = BSON.BSON_DATA_CODE;
  14457. // Number of written bytes
  14458. numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14459. // Encode the name
  14460. index = index + numberOfWrittenBytes;
  14461. buffer[index++] = 0;
  14462. // Function string
  14463. functionString = value.code.toString();
  14464. // Write the string
  14465. var size = buffer.write(functionString, index + 4, 'utf8') + 1;
  14466. // Write the size of the string to buffer
  14467. buffer[index] = size & 0xff;
  14468. buffer[index + 1] = size >> 8 & 0xff;
  14469. buffer[index + 2] = size >> 16 & 0xff;
  14470. buffer[index + 3] = size >> 24 & 0xff;
  14471. // Update index
  14472. index = index + 4 + size - 1;
  14473. // Write zero
  14474. buffer[index++] = 0;
  14475. }
  14476. return index;
  14477. };
  14478. var serializeBinary = function (buffer, key, value, index, isArray) {
  14479. // Write the type
  14480. buffer[index++] = BSON.BSON_DATA_BINARY;
  14481. // Number of written bytes
  14482. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14483. // Encode the name
  14484. index = index + numberOfWrittenBytes;
  14485. buffer[index++] = 0;
  14486. // Extract the buffer
  14487. var data = value.value(true);
  14488. // Calculate size
  14489. var size = value.position;
  14490. // Add the deprecated 02 type 4 bytes of size to total
  14491. if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) size = size + 4;
  14492. // Write the size of the string to buffer
  14493. buffer[index++] = size & 0xff;
  14494. buffer[index++] = size >> 8 & 0xff;
  14495. buffer[index++] = size >> 16 & 0xff;
  14496. buffer[index++] = size >> 24 & 0xff;
  14497. // Write the subtype to the buffer
  14498. buffer[index++] = value.sub_type;
  14499. // If we have binary type 2 the 4 first bytes are the size
  14500. if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) {
  14501. size = size - 4;
  14502. buffer[index++] = size & 0xff;
  14503. buffer[index++] = size >> 8 & 0xff;
  14504. buffer[index++] = size >> 16 & 0xff;
  14505. buffer[index++] = size >> 24 & 0xff;
  14506. }
  14507. // Write the data to the object
  14508. data.copy(buffer, index, 0, value.position);
  14509. // Adjust the index
  14510. index = index + value.position;
  14511. return index;
  14512. };
  14513. var serializeSymbol = function (buffer, key, value, index, isArray) {
  14514. // Write the type
  14515. buffer[index++] = BSON.BSON_DATA_SYMBOL;
  14516. // Number of written bytes
  14517. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14518. // Encode the name
  14519. index = index + numberOfWrittenBytes;
  14520. buffer[index++] = 0;
  14521. // Write the string
  14522. var size = buffer.write(value.value, index + 4, 'utf8') + 1;
  14523. // Write the size of the string to buffer
  14524. buffer[index] = size & 0xff;
  14525. buffer[index + 1] = size >> 8 & 0xff;
  14526. buffer[index + 2] = size >> 16 & 0xff;
  14527. buffer[index + 3] = size >> 24 & 0xff;
  14528. // Update index
  14529. index = index + 4 + size - 1;
  14530. // Write zero
  14531. buffer[index++] = 0x00;
  14532. return index;
  14533. };
  14534. var serializeDBRef = function (buffer, key, value, index, depth, serializeFunctions, isArray) {
  14535. // Write the type
  14536. buffer[index++] = BSON.BSON_DATA_OBJECT;
  14537. // Number of written bytes
  14538. var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
  14539. // Encode the name
  14540. index = index + numberOfWrittenBytes;
  14541. buffer[index++] = 0;
  14542. var startIndex = index;
  14543. var endIndex;
  14544. // Serialize object
  14545. if (null != value.db) {
  14546. endIndex = serializeInto(buffer, {
  14547. $ref: value.namespace,
  14548. $id: value.oid,
  14549. $db: value.db
  14550. }, false, index, depth + 1, serializeFunctions);
  14551. } else {
  14552. endIndex = serializeInto(buffer, {
  14553. $ref: value.namespace,
  14554. $id: value.oid
  14555. }, false, index, depth + 1, serializeFunctions);
  14556. }
  14557. // Calculate object size
  14558. var size = endIndex - startIndex;
  14559. // Write the size
  14560. buffer[startIndex++] = size & 0xff;
  14561. buffer[startIndex++] = size >> 8 & 0xff;
  14562. buffer[startIndex++] = size >> 16 & 0xff;
  14563. buffer[startIndex++] = size >> 24 & 0xff;
  14564. // Set index
  14565. return endIndex;
  14566. };
  14567. var serializeInto = function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) {
  14568. startingIndex = startingIndex || 0;
  14569. path = path || [];
  14570. // Push the object to the path
  14571. path.push(object);
  14572. // Start place to serialize into
  14573. var index = startingIndex + 4;
  14574. // var self = this;
  14575. // Special case isArray
  14576. if (Array.isArray(object)) {
  14577. // Get object keys
  14578. for (var i = 0; i < object.length; i++) {
  14579. var key = '' + i;
  14580. var value = object[i];
  14581. // Is there an override value
  14582. if (value && value.toBSON) {
  14583. if (typeof value.toBSON !== 'function') throw new Error('toBSON is not a function');
  14584. value = value.toBSON();
  14585. }
  14586. var type = typeof value;
  14587. if (type === 'string') {
  14588. index = serializeString(buffer, key, value, index, true);
  14589. } else if (type === 'number') {
  14590. index = serializeNumber(buffer, key, value, index, true);
  14591. } else if (type === 'boolean') {
  14592. index = serializeBoolean(buffer, key, value, index, true);
  14593. } else if (value instanceof Date || isDate(value)) {
  14594. index = serializeDate(buffer, key, value, index, true);
  14595. } else if (value === undefined) {
  14596. index = serializeNull(buffer, key, value, index, true);
  14597. } else if (value === null) {
  14598. index = serializeNull(buffer, key, value, index, true);
  14599. } else if (value['_bsontype'] === 'ObjectID') {
  14600. index = serializeObjectId(buffer, key, value, index, true);
  14601. } else if (Buffer.isBuffer(value)) {
  14602. index = serializeBuffer(buffer, key, value, index, true);
  14603. } else if (value instanceof RegExp || isRegExp(value)) {
  14604. index = serializeRegExp(buffer, key, value, index, true);
  14605. } else if (type === 'object' && value['_bsontype'] == null) {
  14606. index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path);
  14607. } else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
  14608. index = serializeDecimal128(buffer, key, value, index, true);
  14609. } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
  14610. index = serializeLong(buffer, key, value, index, true);
  14611. } else if (value['_bsontype'] === 'Double') {
  14612. index = serializeDouble(buffer, key, value, index, true);
  14613. } else if (typeof value === 'function' && serializeFunctions) {
  14614. index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions, true);
  14615. } else if (value['_bsontype'] === 'Code') {
  14616. index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true);
  14617. } else if (value['_bsontype'] === 'Binary') {
  14618. index = serializeBinary(buffer, key, value, index, true);
  14619. } else if (value['_bsontype'] === 'Symbol') {
  14620. index = serializeSymbol(buffer, key, value, index, true);
  14621. } else if (value['_bsontype'] === 'DBRef') {
  14622. index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true);
  14623. } else if (value['_bsontype'] === 'BSONRegExp') {
  14624. index = serializeBSONRegExp(buffer, key, value, index, true);
  14625. } else if (value['_bsontype'] === 'Int32') {
  14626. index = serializeInt32(buffer, key, value, index, true);
  14627. } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
  14628. index = serializeMinMax(buffer, key, value, index, true);
  14629. }
  14630. }
  14631. } else if (object instanceof Map) {
  14632. var iterator = object.entries();
  14633. var done = false;
  14634. while (!done) {
  14635. // Unpack the next entry
  14636. var entry = iterator.next();
  14637. done = entry.done;
  14638. // Are we done, then skip and terminate
  14639. if (done) continue;
  14640. // Get the entry values
  14641. key = entry.value[0];
  14642. value = entry.value[1];
  14643. // Check the type of the value
  14644. type = typeof value;
  14645. // Check the key and throw error if it's illegal
  14646. if (key !== '$db' && key !== '$ref' && key !== '$id') {
  14647. if (key.match(regexp) != null) {
  14648. // The BSON spec doesn't allow keys with null bytes because keys are
  14649. // null-terminated.
  14650. throw Error('key ' + key + ' must not contain null bytes');
  14651. }
  14652. if (checkKeys) {
  14653. if ('$' === key[0]) {
  14654. throw Error('key ' + key + " must not start with '$'");
  14655. } else if (~key.indexOf('.')) {
  14656. throw Error('key ' + key + " must not contain '.'");
  14657. }
  14658. }
  14659. }
  14660. if (type === 'string') {
  14661. index = serializeString(buffer, key, value, index);
  14662. } else if (type === 'number') {
  14663. index = serializeNumber(buffer, key, value, index);
  14664. } else if (type === 'boolean') {
  14665. index = serializeBoolean(buffer, key, value, index);
  14666. } else if (value instanceof Date || isDate(value)) {
  14667. index = serializeDate(buffer, key, value, index);
  14668. // } else if (value === undefined && ignoreUndefined === true) {
  14669. } else if (value === null || value === undefined && ignoreUndefined === false) {
  14670. index = serializeNull(buffer, key, value, index);
  14671. } else if (value['_bsontype'] === 'ObjectID') {
  14672. index = serializeObjectId(buffer, key, value, index);
  14673. } else if (Buffer.isBuffer(value)) {
  14674. index = serializeBuffer(buffer, key, value, index);
  14675. } else if (value instanceof RegExp || isRegExp(value)) {
  14676. index = serializeRegExp(buffer, key, value, index);
  14677. } else if (type === 'object' && value['_bsontype'] == null) {
  14678. index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path);
  14679. } else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
  14680. index = serializeDecimal128(buffer, key, value, index);
  14681. } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
  14682. index = serializeLong(buffer, key, value, index);
  14683. } else if (value['_bsontype'] === 'Double') {
  14684. index = serializeDouble(buffer, key, value, index);
  14685. } else if (value['_bsontype'] === 'Code') {
  14686. index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined);
  14687. } else if (typeof value === 'function' && serializeFunctions) {
  14688. index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions);
  14689. } else if (value['_bsontype'] === 'Binary') {
  14690. index = serializeBinary(buffer, key, value, index);
  14691. } else if (value['_bsontype'] === 'Symbol') {
  14692. index = serializeSymbol(buffer, key, value, index);
  14693. } else if (value['_bsontype'] === 'DBRef') {
  14694. index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions);
  14695. } else if (value['_bsontype'] === 'BSONRegExp') {
  14696. index = serializeBSONRegExp(buffer, key, value, index);
  14697. } else if (value['_bsontype'] === 'Int32') {
  14698. index = serializeInt32(buffer, key, value, index);
  14699. } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
  14700. index = serializeMinMax(buffer, key, value, index);
  14701. }
  14702. }
  14703. } else {
  14704. // Did we provide a custom serialization method
  14705. if (object.toBSON) {
  14706. if (typeof object.toBSON !== 'function') throw new Error('toBSON is not a function');
  14707. object = object.toBSON();
  14708. if (object != null && typeof object !== 'object') throw new Error('toBSON function did not return an object');
  14709. }
  14710. // Iterate over all the keys
  14711. for (key in object) {
  14712. value = object[key];
  14713. // Is there an override value
  14714. if (value && value.toBSON) {
  14715. if (typeof value.toBSON !== 'function') throw new Error('toBSON is not a function');
  14716. value = value.toBSON();
  14717. }
  14718. // Check the type of the value
  14719. type = typeof value;
  14720. // Check the key and throw error if it's illegal
  14721. if (key !== '$db' && key !== '$ref' && key !== '$id') {
  14722. if (key.match(regexp) != null) {
  14723. // The BSON spec doesn't allow keys with null bytes because keys are
  14724. // null-terminated.
  14725. throw Error('key ' + key + ' must not contain null bytes');
  14726. }
  14727. if (checkKeys) {
  14728. if ('$' === key[0]) {
  14729. throw Error('key ' + key + " must not start with '$'");
  14730. } else if (~key.indexOf('.')) {
  14731. throw Error('key ' + key + " must not contain '.'");
  14732. }
  14733. }
  14734. }
  14735. if (type === 'string') {
  14736. index = serializeString(buffer, key, value, index);
  14737. } else if (type === 'number') {
  14738. index = serializeNumber(buffer, key, value, index);
  14739. } else if (type === 'boolean') {
  14740. index = serializeBoolean(buffer, key, value, index);
  14741. } else if (value instanceof Date || isDate(value)) {
  14742. index = serializeDate(buffer, key, value, index);
  14743. } else if (value === undefined) {
  14744. if (ignoreUndefined === false) index = serializeNull(buffer, key, value, index);
  14745. } else if (value === null) {
  14746. index = serializeNull(buffer, key, value, index);
  14747. } else if (value['_bsontype'] === 'ObjectID') {
  14748. index = serializeObjectId(buffer, key, value, index);
  14749. } else if (Buffer.isBuffer(value)) {
  14750. index = serializeBuffer(buffer, key, value, index);
  14751. } else if (value instanceof RegExp || isRegExp(value)) {
  14752. index = serializeRegExp(buffer, key, value, index);
  14753. } else if (type === 'object' && value['_bsontype'] == null) {
  14754. index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path);
  14755. } else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
  14756. index = serializeDecimal128(buffer, key, value, index);
  14757. } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
  14758. index = serializeLong(buffer, key, value, index);
  14759. } else if (value['_bsontype'] === 'Double') {
  14760. index = serializeDouble(buffer, key, value, index);
  14761. } else if (value['_bsontype'] === 'Code') {
  14762. index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined);
  14763. } else if (typeof value === 'function' && serializeFunctions) {
  14764. index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions);
  14765. } else if (value['_bsontype'] === 'Binary') {
  14766. index = serializeBinary(buffer, key, value, index);
  14767. } else if (value['_bsontype'] === 'Symbol') {
  14768. index = serializeSymbol(buffer, key, value, index);
  14769. } else if (value['_bsontype'] === 'DBRef') {
  14770. index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions);
  14771. } else if (value['_bsontype'] === 'BSONRegExp') {
  14772. index = serializeBSONRegExp(buffer, key, value, index);
  14773. } else if (value['_bsontype'] === 'Int32') {
  14774. index = serializeInt32(buffer, key, value, index);
  14775. } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
  14776. index = serializeMinMax(buffer, key, value, index);
  14777. }
  14778. }
  14779. }
  14780. // Remove the path
  14781. path.pop();
  14782. // Final padding byte for object
  14783. buffer[index++] = 0x00;
  14784. // Final size
  14785. var size = index - startingIndex;
  14786. // Write the size of the object
  14787. buffer[startingIndex++] = size & 0xff;
  14788. buffer[startingIndex++] = size >> 8 & 0xff;
  14789. buffer[startingIndex++] = size >> 16 & 0xff;
  14790. buffer[startingIndex++] = size >> 24 & 0xff;
  14791. return index;
  14792. };
  14793. var BSON = {};
  14794. /**
  14795. * Contains the function cache if we have that enable to allow for avoiding the eval step on each deserialization, comparison is by md5
  14796. *
  14797. * @ignore
  14798. * @api private
  14799. */
  14800. // var functionCache = (BSON.functionCache = {});
  14801. /**
  14802. * Number BSON Type
  14803. *
  14804. * @classconstant BSON_DATA_NUMBER
  14805. **/
  14806. BSON.BSON_DATA_NUMBER = 1;
  14807. /**
  14808. * String BSON Type
  14809. *
  14810. * @classconstant BSON_DATA_STRING
  14811. **/
  14812. BSON.BSON_DATA_STRING = 2;
  14813. /**
  14814. * Object BSON Type
  14815. *
  14816. * @classconstant BSON_DATA_OBJECT
  14817. **/
  14818. BSON.BSON_DATA_OBJECT = 3;
  14819. /**
  14820. * Array BSON Type
  14821. *
  14822. * @classconstant BSON_DATA_ARRAY
  14823. **/
  14824. BSON.BSON_DATA_ARRAY = 4;
  14825. /**
  14826. * Binary BSON Type
  14827. *
  14828. * @classconstant BSON_DATA_BINARY
  14829. **/
  14830. BSON.BSON_DATA_BINARY = 5;
  14831. /**
  14832. * ObjectID BSON Type, deprecated
  14833. *
  14834. * @classconstant BSON_DATA_UNDEFINED
  14835. **/
  14836. BSON.BSON_DATA_UNDEFINED = 6;
  14837. /**
  14838. * ObjectID BSON Type
  14839. *
  14840. * @classconstant BSON_DATA_OID
  14841. **/
  14842. BSON.BSON_DATA_OID = 7;
  14843. /**
  14844. * Boolean BSON Type
  14845. *
  14846. * @classconstant BSON_DATA_BOOLEAN
  14847. **/
  14848. BSON.BSON_DATA_BOOLEAN = 8;
  14849. /**
  14850. * Date BSON Type
  14851. *
  14852. * @classconstant BSON_DATA_DATE
  14853. **/
  14854. BSON.BSON_DATA_DATE = 9;
  14855. /**
  14856. * null BSON Type
  14857. *
  14858. * @classconstant BSON_DATA_NULL
  14859. **/
  14860. BSON.BSON_DATA_NULL = 10;
  14861. /**
  14862. * RegExp BSON Type
  14863. *
  14864. * @classconstant BSON_DATA_REGEXP
  14865. **/
  14866. BSON.BSON_DATA_REGEXP = 11;
  14867. /**
  14868. * Code BSON Type
  14869. *
  14870. * @classconstant BSON_DATA_CODE
  14871. **/
  14872. BSON.BSON_DATA_CODE = 13;
  14873. /**
  14874. * Symbol BSON Type
  14875. *
  14876. * @classconstant BSON_DATA_SYMBOL
  14877. **/
  14878. BSON.BSON_DATA_SYMBOL = 14;
  14879. /**
  14880. * Code with Scope BSON Type
  14881. *
  14882. * @classconstant BSON_DATA_CODE_W_SCOPE
  14883. **/
  14884. BSON.BSON_DATA_CODE_W_SCOPE = 15;
  14885. /**
  14886. * 32 bit Integer BSON Type
  14887. *
  14888. * @classconstant BSON_DATA_INT
  14889. **/
  14890. BSON.BSON_DATA_INT = 16;
  14891. /**
  14892. * Timestamp BSON Type
  14893. *
  14894. * @classconstant BSON_DATA_TIMESTAMP
  14895. **/
  14896. BSON.BSON_DATA_TIMESTAMP = 17;
  14897. /**
  14898. * Long BSON Type
  14899. *
  14900. * @classconstant BSON_DATA_LONG
  14901. **/
  14902. BSON.BSON_DATA_LONG = 18;
  14903. /**
  14904. * Long BSON Type
  14905. *
  14906. * @classconstant BSON_DATA_DECIMAL128
  14907. **/
  14908. BSON.BSON_DATA_DECIMAL128 = 19;
  14909. /**
  14910. * MinKey BSON Type
  14911. *
  14912. * @classconstant BSON_DATA_MIN_KEY
  14913. **/
  14914. BSON.BSON_DATA_MIN_KEY = 0xff;
  14915. /**
  14916. * MaxKey BSON Type
  14917. *
  14918. * @classconstant BSON_DATA_MAX_KEY
  14919. **/
  14920. BSON.BSON_DATA_MAX_KEY = 0x7f;
  14921. /**
  14922. * Binary Default Type
  14923. *
  14924. * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
  14925. **/
  14926. BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
  14927. /**
  14928. * Binary Function Type
  14929. *
  14930. * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
  14931. **/
  14932. BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
  14933. /**
  14934. * Binary Byte Array Type
  14935. *
  14936. * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
  14937. **/
  14938. BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
  14939. /**
  14940. * Binary UUID Type
  14941. *
  14942. * @classconstant BSON_BINARY_SUBTYPE_UUID
  14943. **/
  14944. BSON.BSON_BINARY_SUBTYPE_UUID = 3;
  14945. /**
  14946. * Binary MD5 Type
  14947. *
  14948. * @classconstant BSON_BINARY_SUBTYPE_MD5
  14949. **/
  14950. BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
  14951. /**
  14952. * Binary User Defined Type
  14953. *
  14954. * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
  14955. **/
  14956. BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
  14957. // BSON MAX VALUES
  14958. BSON.BSON_INT32_MAX = 0x7fffffff;
  14959. BSON.BSON_INT32_MIN = -0x80000000;
  14960. BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
  14961. BSON.BSON_INT64_MIN = -Math.pow(2, 63);
  14962. // JS MAX PRECISE VALUES
  14963. BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
  14964. BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
  14965. // Internal long versions
  14966. // var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
  14967. // var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
  14968. module.exports = serializeInto;
  14969. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(329).Buffer))
  14970. /***/ }),
  14971. /* 353 */
  14972. /***/ (function(module, exports) {
  14973. // Copyright (c) 2008, Fair Oaks Labs, Inc.
  14974. // All rights reserved.
  14975. //
  14976. // Redistribution and use in source and binary forms, with or without
  14977. // modification, are permitted provided that the following conditions are met:
  14978. //
  14979. // * Redistributions of source code must retain the above copyright notice,
  14980. // this list of conditions and the following disclaimer.
  14981. //
  14982. // * Redistributions in binary form must reproduce the above copyright notice,
  14983. // this list of conditions and the following disclaimer in the documentation
  14984. // and/or other materials provided with the distribution.
  14985. //
  14986. // * Neither the name of Fair Oaks Labs, Inc. nor the names of its contributors
  14987. // may be used to endorse or promote products derived from this software
  14988. // without specific prior written permission.
  14989. //
  14990. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  14991. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  14992. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  14993. // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  14994. // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  14995. // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  14996. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  14997. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  14998. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  14999. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  15000. // POSSIBILITY OF SUCH DAMAGE.
  15001. //
  15002. //
  15003. // Modifications to writeIEEE754 to support negative zeroes made by Brian White
  15004. var readIEEE754 = function (buffer, offset, endian, mLen, nBytes) {
  15005. var e,
  15006. m,
  15007. bBE = endian === 'big',
  15008. eLen = nBytes * 8 - mLen - 1,
  15009. eMax = (1 << eLen) - 1,
  15010. eBias = eMax >> 1,
  15011. nBits = -7,
  15012. i = bBE ? 0 : nBytes - 1,
  15013. d = bBE ? 1 : -1,
  15014. s = buffer[offset + i];
  15015. i += d;
  15016. e = s & (1 << -nBits) - 1;
  15017. s >>= -nBits;
  15018. nBits += eLen;
  15019. for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);
  15020. m = e & (1 << -nBits) - 1;
  15021. e >>= -nBits;
  15022. nBits += mLen;
  15023. for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);
  15024. if (e === 0) {
  15025. e = 1 - eBias;
  15026. } else if (e === eMax) {
  15027. return m ? NaN : (s ? -1 : 1) * Infinity;
  15028. } else {
  15029. m = m + Math.pow(2, mLen);
  15030. e = e - eBias;
  15031. }
  15032. return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
  15033. };
  15034. var writeIEEE754 = function (buffer, value, offset, endian, mLen, nBytes) {
  15035. var e,
  15036. m,
  15037. c,
  15038. bBE = endian === 'big',
  15039. eLen = nBytes * 8 - mLen - 1,
  15040. eMax = (1 << eLen) - 1,
  15041. eBias = eMax >> 1,
  15042. rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  15043. i = bBE ? nBytes - 1 : 0,
  15044. d = bBE ? -1 : 1,
  15045. s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
  15046. value = Math.abs(value);
  15047. if (isNaN(value) || value === Infinity) {
  15048. m = isNaN(value) ? 1 : 0;
  15049. e = eMax;
  15050. } else {
  15051. e = Math.floor(Math.log(value) / Math.LN2);
  15052. if (value * (c = Math.pow(2, -e)) < 1) {
  15053. e--;
  15054. c *= 2;
  15055. }
  15056. if (e + eBias >= 1) {
  15057. value += rt / c;
  15058. } else {
  15059. value += rt * Math.pow(2, 1 - eBias);
  15060. }
  15061. if (value * c >= 2) {
  15062. e++;
  15063. c /= 2;
  15064. }
  15065. if (e + eBias >= eMax) {
  15066. m = 0;
  15067. e = eMax;
  15068. } else if (e + eBias >= 1) {
  15069. m = (value * c - 1) * Math.pow(2, mLen);
  15070. e = e + eBias;
  15071. } else {
  15072. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
  15073. e = 0;
  15074. }
  15075. }
  15076. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);
  15077. e = e << mLen | m;
  15078. eLen += mLen;
  15079. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);
  15080. buffer[offset + i - d] |= s * 128;
  15081. };
  15082. exports.readIEEE754 = readIEEE754;
  15083. exports.writeIEEE754 = writeIEEE754;
  15084. /***/ }),
  15085. /* 354 */
  15086. /***/ (function(module, exports) {
  15087. 'use strict';
  15088. /**
  15089. * Normalizes our expected stringified form of a function across versions of node
  15090. * @param {Function} fn The function to stringify
  15091. */
  15092. function normalizedFunctionString(fn) {
  15093. return fn.toString().replace(/function *\(/, 'function (');
  15094. }
  15095. module.exports = {
  15096. normalizedFunctionString: normalizedFunctionString
  15097. };
  15098. /***/ }),
  15099. /* 355 */
  15100. /***/ (function(module, exports, __webpack_require__) {
  15101. /* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
  15102. var Long = __webpack_require__(334).Long,
  15103. Double = __webpack_require__(335).Double,
  15104. Timestamp = __webpack_require__(336).Timestamp,
  15105. ObjectID = __webpack_require__(337).ObjectID,
  15106. Symbol = __webpack_require__(343).Symbol,
  15107. BSONRegExp = __webpack_require__(342).BSONRegExp,
  15108. Code = __webpack_require__(345).Code,
  15109. Decimal128 = __webpack_require__(346),
  15110. MinKey = __webpack_require__(347).MinKey,
  15111. MaxKey = __webpack_require__(348).MaxKey,
  15112. DBRef = __webpack_require__(349).DBRef,
  15113. Binary = __webpack_require__(350).Binary;
  15114. var normalizedFunctionString = __webpack_require__(354).normalizedFunctionString;
  15115. // To ensure that 0.4 of node works correctly
  15116. var isDate = function isDate(d) {
  15117. return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]';
  15118. };
  15119. var calculateObjectSize = function calculateObjectSize(object, serializeFunctions, ignoreUndefined) {
  15120. var totalLength = 4 + 1;
  15121. if (Array.isArray(object)) {
  15122. for (var i = 0; i < object.length; i++) {
  15123. totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined);
  15124. }
  15125. } else {
  15126. // If we have toBSON defined, override the current object
  15127. if (object.toBSON) {
  15128. object = object.toBSON();
  15129. }
  15130. // Calculate size
  15131. for (var key in object) {
  15132. totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined);
  15133. }
  15134. }
  15135. return totalLength;
  15136. };
  15137. /**
  15138. * @ignore
  15139. * @api private
  15140. */
  15141. function calculateElement(name, value, serializeFunctions, isArray, ignoreUndefined) {
  15142. // If we have toBSON defined, override the current object
  15143. if (value && value.toBSON) {
  15144. value = value.toBSON();
  15145. }
  15146. switch (typeof value) {
  15147. case 'string':
  15148. return 1 + Buffer.byteLength(name, 'utf8') + 1 + 4 + Buffer.byteLength(value, 'utf8') + 1;
  15149. case 'number':
  15150. if (Math.floor(value) === value && value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
  15151. if (value >= BSON.BSON_INT32_MIN && value <= BSON.BSON_INT32_MAX) {
  15152. // 32 bit
  15153. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (4 + 1);
  15154. } else {
  15155. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
  15156. }
  15157. } else {
  15158. // 64 bit
  15159. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
  15160. }
  15161. case 'undefined':
  15162. if (isArray || !ignoreUndefined) return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1;
  15163. return 0;
  15164. case 'boolean':
  15165. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 1);
  15166. case 'object':
  15167. if (value == null || value instanceof MinKey || value instanceof MaxKey || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
  15168. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1;
  15169. } else if (value instanceof ObjectID || value['_bsontype'] === 'ObjectID') {
  15170. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (12 + 1);
  15171. } else if (value instanceof Date || isDate(value)) {
  15172. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
  15173. } else if (typeof Buffer !== 'undefined' && Buffer.isBuffer(value)) {
  15174. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.length;
  15175. } else if (value instanceof Long || value instanceof Double || value instanceof Timestamp || value['_bsontype'] === 'Long' || value['_bsontype'] === 'Double' || value['_bsontype'] === 'Timestamp') {
  15176. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
  15177. } else if (value instanceof Decimal128 || value['_bsontype'] === 'Decimal128') {
  15178. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (16 + 1);
  15179. } else if (value instanceof Code || value['_bsontype'] === 'Code') {
  15180. // Calculate size depending on the availability of a scope
  15181. if (value.scope != null && Object.keys(value.scope).length > 0) {
  15182. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + 4 + Buffer.byteLength(value.code.toString(), 'utf8') + 1 + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined);
  15183. } else {
  15184. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + Buffer.byteLength(value.code.toString(), 'utf8') + 1;
  15185. }
  15186. } else if (value instanceof Binary || value['_bsontype'] === 'Binary') {
  15187. // Check what kind of subtype we have
  15188. if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) {
  15189. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1 + 4);
  15190. } else {
  15191. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1);
  15192. }
  15193. } else if (value instanceof Symbol || value['_bsontype'] === 'Symbol') {
  15194. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + Buffer.byteLength(value.value, 'utf8') + 4 + 1 + 1;
  15195. } else if (value instanceof DBRef || value['_bsontype'] === 'DBRef') {
  15196. // Set up correct object for serialization
  15197. var ordered_values = {
  15198. $ref: value.namespace,
  15199. $id: value.oid
  15200. };
  15201. // Add db reference if it exists
  15202. if (null != value.db) {
  15203. ordered_values['$db'] = value.db;
  15204. }
  15205. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + calculateObjectSize(ordered_values, serializeFunctions, ignoreUndefined);
  15206. } else if (value instanceof RegExp || Object.prototype.toString.call(value) === '[object RegExp]') {
  15207. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.source, 'utf8') + 1 + (value.global ? 1 : 0) + (value.ignoreCase ? 1 : 0) + (value.multiline ? 1 : 0) + 1;
  15208. } else if (value instanceof BSONRegExp || value['_bsontype'] === 'BSONRegExp') {
  15209. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.pattern, 'utf8') + 1 + Buffer.byteLength(value.options, 'utf8') + 1;
  15210. } else {
  15211. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + calculateObjectSize(value, serializeFunctions, ignoreUndefined) + 1;
  15212. }
  15213. case 'function':
  15214. // WTF for 0.4.X where typeof /someregexp/ === 'function'
  15215. if (value instanceof RegExp || Object.prototype.toString.call(value) === '[object RegExp]' || String.call(value) === '[object RegExp]') {
  15216. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.source, 'utf8') + 1 + (value.global ? 1 : 0) + (value.ignoreCase ? 1 : 0) + (value.multiline ? 1 : 0) + 1;
  15217. } else {
  15218. if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) {
  15219. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + 4 + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + 1 + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined);
  15220. } else if (serializeFunctions) {
  15221. return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + 1;
  15222. }
  15223. }
  15224. }
  15225. return 0;
  15226. }
  15227. var BSON = {};
  15228. // BSON MAX VALUES
  15229. BSON.BSON_INT32_MAX = 0x7fffffff;
  15230. BSON.BSON_INT32_MIN = -0x80000000;
  15231. // JS MAX PRECISE VALUES
  15232. BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
  15233. BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
  15234. module.exports = calculateObjectSize;
  15235. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(329).Buffer))
  15236. /***/ })
  15237. /******/ ])
  15238. });
  15239. ;