av-weapp.js 864 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547
  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 if(typeof exports === 'object')
  7. exports["AV"] = factory();
  8. else
  9. root["AV"] = factory();
  10. })(typeof self !== 'undefined' ? self : this, function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, {
  50. /******/ configurable: false,
  51. /******/ enumerable: true,
  52. /******/ get: getter
  53. /******/ });
  54. /******/ }
  55. /******/ };
  56. /******/
  57. /******/ // getDefaultExport function for compatibility with non-harmony modules
  58. /******/ __webpack_require__.n = function(module) {
  59. /******/ var getter = module && module.__esModule ?
  60. /******/ function getDefault() { return module['default']; } :
  61. /******/ function getModuleExports() { return module; };
  62. /******/ __webpack_require__.d(getter, 'a', getter);
  63. /******/ return getter;
  64. /******/ };
  65. /******/
  66. /******/ // Object.prototype.hasOwnProperty.call
  67. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  68. /******/
  69. /******/ // __webpack_public_path__
  70. /******/ __webpack_require__.p = "";
  71. /******/
  72. /******/ // Load entry module and return exports
  73. /******/ return __webpack_require__(__webpack_require__.s = 249);
  74. /******/ })
  75. /************************************************************************/
  76. /******/ ([
  77. /* 0 */
  78. /***/ (function(module, exports, __webpack_require__) {
  79. "use strict";
  80. var global = __webpack_require__(6);
  81. var apply = __webpack_require__(69);
  82. var uncurryThis = __webpack_require__(4);
  83. var isCallable = __webpack_require__(7);
  84. var getOwnPropertyDescriptor = __webpack_require__(71).f;
  85. var isForced = __webpack_require__(149);
  86. var path = __webpack_require__(10);
  87. var bind = __webpack_require__(45);
  88. var createNonEnumerableProperty = __webpack_require__(35);
  89. var hasOwn = __webpack_require__(14);
  90. var wrapConstructor = function (NativeConstructor) {
  91. var Wrapper = function (a, b, c) {
  92. if (this instanceof Wrapper) {
  93. switch (arguments.length) {
  94. case 0: return new NativeConstructor();
  95. case 1: return new NativeConstructor(a);
  96. case 2: return new NativeConstructor(a, b);
  97. } return new NativeConstructor(a, b, c);
  98. } return apply(NativeConstructor, this, arguments);
  99. };
  100. Wrapper.prototype = NativeConstructor.prototype;
  101. return Wrapper;
  102. };
  103. /*
  104. options.target - name of the target object
  105. options.global - target is the global object
  106. options.stat - export as static methods of target
  107. options.proto - export as prototype methods of target
  108. options.real - real prototype method for the `pure` version
  109. options.forced - export even if the native feature is available
  110. options.bind - bind methods to the target, required for the `pure` version
  111. options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
  112. options.unsafe - use the simple assignment of property instead of delete + defineProperty
  113. options.sham - add a flag to not completely full polyfills
  114. options.enumerable - export as enumerable property
  115. options.dontCallGetSet - prevent calling a getter on target
  116. options.name - the .name of the function if it does not match the key
  117. */
  118. module.exports = function (options, source) {
  119. var TARGET = options.target;
  120. var GLOBAL = options.global;
  121. var STATIC = options.stat;
  122. var PROTO = options.proto;
  123. var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;
  124. var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];
  125. var targetPrototype = target.prototype;
  126. var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
  127. var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
  128. for (key in source) {
  129. FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
  130. // contains in native
  131. USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key);
  132. targetProperty = target[key];
  133. if (USE_NATIVE) if (options.dontCallGetSet) {
  134. descriptor = getOwnPropertyDescriptor(nativeSource, key);
  135. nativeProperty = descriptor && descriptor.value;
  136. } else nativeProperty = nativeSource[key];
  137. // export native or implementation
  138. sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];
  139. if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;
  140. // bind timers to global for call from export context
  141. if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);
  142. // wrap global constructors for prevent changs in this version
  143. else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);
  144. // make static versions for prototype methods
  145. else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);
  146. // default case
  147. else resultProperty = sourceProperty;
  148. // add a flag to not completely full polyfills
  149. if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {
  150. createNonEnumerableProperty(resultProperty, 'sham', true);
  151. }
  152. createNonEnumerableProperty(target, key, resultProperty);
  153. if (PROTO) {
  154. VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
  155. if (!hasOwn(path, VIRTUAL_PROTOTYPE)) {
  156. createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});
  157. }
  158. // export virtual prototype methods
  159. createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);
  160. // export real prototype methods
  161. if (options.real && targetPrototype && !targetPrototype[key]) {
  162. createNonEnumerableProperty(targetPrototype, key, sourceProperty);
  163. }
  164. }
  165. }
  166. };
  167. /***/ }),
  168. /* 1 */
  169. /***/ (function(module, exports) {
  170. function _interopRequireDefault(obj) {
  171. return obj && obj.__esModule ? obj : {
  172. "default": obj
  173. };
  174. }
  175. module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
  176. /***/ }),
  177. /* 2 */
  178. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  179. "use strict";
  180. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  181. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__index_default_js__ = __webpack_require__(290);
  182. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_0__index_default_js__["a"]; });
  183. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__index_js__ = __webpack_require__(126);
  184. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["VERSION"]; });
  185. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["restArguments"]; });
  186. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isObject"]; });
  187. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNull"]; });
  188. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isUndefined"]; });
  189. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isBoolean"]; });
  190. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isElement"]; });
  191. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isString"]; });
  192. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNumber"]; });
  193. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDate"]; });
  194. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isRegExp"]; });
  195. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isError"]; });
  196. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSymbol"]; });
  197. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArrayBuffer"]; });
  198. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDataView"]; });
  199. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArray"]; });
  200. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFunction"]; });
  201. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArguments"]; });
  202. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFinite"]; });
  203. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNaN"]; });
  204. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isTypedArray"]; });
  205. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEmpty"]; });
  206. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMatch"]; });
  207. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEqual"]; });
  208. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMap"]; });
  209. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakMap"]; });
  210. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSet"]; });
  211. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakSet"]; });
  212. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["keys"]; });
  213. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["allKeys"]; });
  214. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["values"]; });
  215. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pairs"]; });
  216. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invert"]; });
  217. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["functions"]; });
  218. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["methods"]; });
  219. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extend"]; });
  220. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extendOwn"]; });
  221. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["assign"]; });
  222. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defaults"]; });
  223. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["create"]; });
  224. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["clone"]; });
  225. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tap"]; });
  226. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["get"]; });
  227. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["has"]; });
  228. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mapObject"]; });
  229. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["identity"]; });
  230. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["constant"]; });
  231. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["noop"]; });
  232. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toPath"]; });
  233. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["property"]; });
  234. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["propertyOf"]; });
  235. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matcher"]; });
  236. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matches"]; });
  237. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["times"]; });
  238. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["random"]; });
  239. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["now"]; });
  240. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["escape"]; });
  241. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unescape"]; });
  242. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["templateSettings"]; });
  243. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["template"]; });
  244. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["result"]; });
  245. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniqueId"]; });
  246. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chain"]; });
  247. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["iteratee"]; });
  248. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partial"]; });
  249. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bind"]; });
  250. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bindAll"]; });
  251. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["memoize"]; });
  252. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["delay"]; });
  253. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defer"]; });
  254. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["throttle"]; });
  255. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["debounce"]; });
  256. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["wrap"]; });
  257. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["negate"]; });
  258. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compose"]; });
  259. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["after"]; });
  260. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["before"]; });
  261. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["once"]; });
  262. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findKey"]; });
  263. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findIndex"]; });
  264. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findLastIndex"]; });
  265. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortedIndex"]; });
  266. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexOf"]; });
  267. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["lastIndexOf"]; });
  268. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["find"]; });
  269. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["detect"]; });
  270. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findWhere"]; });
  271. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["each"]; });
  272. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["forEach"]; });
  273. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["map"]; });
  274. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["collect"]; });
  275. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduce"]; });
  276. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldl"]; });
  277. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["inject"]; });
  278. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduceRight"]; });
  279. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldr"]; });
  280. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["filter"]; });
  281. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["select"]; });
  282. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reject"]; });
  283. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["every"]; });
  284. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["all"]; });
  285. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["some"]; });
  286. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["any"]; });
  287. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["contains"]; });
  288. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["includes"]; });
  289. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["include"]; });
  290. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invoke"]; });
  291. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pluck"]; });
  292. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["where"]; });
  293. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["max"]; });
  294. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["min"]; });
  295. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["shuffle"]; });
  296. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sample"]; });
  297. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortBy"]; });
  298. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["groupBy"]; });
  299. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexBy"]; });
  300. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["countBy"]; });
  301. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partition"]; });
  302. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toArray"]; });
  303. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["size"]; });
  304. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pick"]; });
  305. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["omit"]; });
  306. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["first"]; });
  307. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["head"]; });
  308. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["take"]; });
  309. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["initial"]; });
  310. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["last"]; });
  311. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["rest"]; });
  312. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tail"]; });
  313. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["drop"]; });
  314. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compact"]; });
  315. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["flatten"]; });
  316. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["without"]; });
  317. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniq"]; });
  318. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unique"]; });
  319. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["union"]; });
  320. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["intersection"]; });
  321. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["difference"]; });
  322. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unzip"]; });
  323. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["transpose"]; });
  324. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["zip"]; });
  325. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["object"]; });
  326. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["range"]; });
  327. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chunk"]; });
  328. /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mixin"]; });
  329. // ESM Exports
  330. // ===========
  331. // This module is the package entry point for ES module users. In other words,
  332. // it is the module they are interfacing with when they import from the whole
  333. // package instead of from a submodule, like this:
  334. //
  335. // ```js
  336. // import { map } from 'underscore';
  337. // ```
  338. //
  339. // The difference with `./index-default`, which is the package entry point for
  340. // CommonJS, AMD and UMD users, is purely technical. In ES modules, named and
  341. // default exports are considered to be siblings, so when you have a default
  342. // export, its properties are not automatically available as named exports. For
  343. // this reason, we re-export the named exports in addition to providing the same
  344. // default export as in `./index-default`.
  345. /***/ }),
  346. /* 3 */
  347. /***/ (function(module, exports) {
  348. module.exports = function (exec) {
  349. try {
  350. return !!exec();
  351. } catch (error) {
  352. return true;
  353. }
  354. };
  355. /***/ }),
  356. /* 4 */
  357. /***/ (function(module, exports, __webpack_require__) {
  358. var NATIVE_BIND = __webpack_require__(70);
  359. var FunctionPrototype = Function.prototype;
  360. var bind = FunctionPrototype.bind;
  361. var call = FunctionPrototype.call;
  362. var uncurryThis = NATIVE_BIND && bind.bind(call, call);
  363. module.exports = NATIVE_BIND ? function (fn) {
  364. return fn && uncurryThis(fn);
  365. } : function (fn) {
  366. return fn && function () {
  367. return call.apply(fn, arguments);
  368. };
  369. };
  370. /***/ }),
  371. /* 5 */
  372. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  373. "use strict";
  374. /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return VERSION; });
  375. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return root; });
  376. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ArrayProto; });
  377. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ObjProto; });
  378. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return SymbolProto; });
  379. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return push; });
  380. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return slice; });
  381. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return toString; });
  382. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return hasOwnProperty; });
  383. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return supportsArrayBuffer; });
  384. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return supportsDataView; });
  385. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return nativeIsArray; });
  386. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return nativeKeys; });
  387. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return nativeCreate; });
  388. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return nativeIsView; });
  389. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return _isNaN; });
  390. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _isFinite; });
  391. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return hasEnumBug; });
  392. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return nonEnumerableProps; });
  393. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MAX_ARRAY_INDEX; });
  394. // Current version.
  395. var VERSION = '1.12.1';
  396. // Establish the root object, `window` (`self`) in the browser, `global`
  397. // on the server, or `this` in some virtual machines. We use `self`
  398. // instead of `window` for `WebWorker` support.
  399. var root = typeof self == 'object' && self.self === self && self ||
  400. typeof global == 'object' && global.global === global && global ||
  401. Function('return this')() ||
  402. {};
  403. // Save bytes in the minified (but not gzipped) version:
  404. var ArrayProto = Array.prototype, ObjProto = Object.prototype;
  405. var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
  406. // Create quick reference variables for speed access to core prototypes.
  407. var push = ArrayProto.push,
  408. slice = ArrayProto.slice,
  409. toString = ObjProto.toString,
  410. hasOwnProperty = ObjProto.hasOwnProperty;
  411. // Modern feature detection.
  412. var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',
  413. supportsDataView = typeof DataView !== 'undefined';
  414. // All **ECMAScript 5+** native function implementations that we hope to use
  415. // are declared here.
  416. var nativeIsArray = Array.isArray,
  417. nativeKeys = Object.keys,
  418. nativeCreate = Object.create,
  419. nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
  420. // Create references to these builtin functions because we override them.
  421. var _isNaN = isNaN,
  422. _isFinite = isFinite;
  423. // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
  424. var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
  425. var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
  426. 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
  427. // The largest integer that can be represented exactly.
  428. var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
  429. /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(112)))
  430. /***/ }),
  431. /* 6 */
  432. /***/ (function(module, exports, __webpack_require__) {
  433. /* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
  434. return it && it.Math == Math && it;
  435. };
  436. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  437. module.exports =
  438. // eslint-disable-next-line es-x/no-global-this -- safe
  439. check(typeof globalThis == 'object' && globalThis) ||
  440. check(typeof window == 'object' && window) ||
  441. // eslint-disable-next-line no-restricted-globals -- safe
  442. check(typeof self == 'object' && self) ||
  443. check(typeof global == 'object' && global) ||
  444. // eslint-disable-next-line no-new-func -- fallback
  445. (function () { return this; })() || Function('return this')();
  446. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(112)))
  447. /***/ }),
  448. /* 7 */
  449. /***/ (function(module, exports) {
  450. // `IsCallable` abstract operation
  451. // https://tc39.es/ecma262/#sec-iscallable
  452. module.exports = function (argument) {
  453. return typeof argument == 'function';
  454. };
  455. /***/ }),
  456. /* 8 */
  457. /***/ (function(module, exports, __webpack_require__) {
  458. var path = __webpack_require__(10);
  459. var hasOwn = __webpack_require__(14);
  460. var wrappedWellKnownSymbolModule = __webpack_require__(144);
  461. var defineProperty = __webpack_require__(22).f;
  462. module.exports = function (NAME) {
  463. var Symbol = path.Symbol || (path.Symbol = {});
  464. if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {
  465. value: wrappedWellKnownSymbolModule.f(NAME)
  466. });
  467. };
  468. /***/ }),
  469. /* 9 */
  470. /***/ (function(module, exports, __webpack_require__) {
  471. var global = __webpack_require__(6);
  472. var shared = __webpack_require__(73);
  473. var hasOwn = __webpack_require__(14);
  474. var uid = __webpack_require__(92);
  475. var NATIVE_SYMBOL = __webpack_require__(57);
  476. var USE_SYMBOL_AS_UID = __webpack_require__(147);
  477. var WellKnownSymbolsStore = shared('wks');
  478. var Symbol = global.Symbol;
  479. var symbolFor = Symbol && Symbol['for'];
  480. var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
  481. module.exports = function (name) {
  482. if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
  483. var description = 'Symbol.' + name;
  484. if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {
  485. WellKnownSymbolsStore[name] = Symbol[name];
  486. } else if (USE_SYMBOL_AS_UID && symbolFor) {
  487. WellKnownSymbolsStore[name] = symbolFor(description);
  488. } else {
  489. WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
  490. }
  491. } return WellKnownSymbolsStore[name];
  492. };
  493. /***/ }),
  494. /* 10 */
  495. /***/ (function(module, exports) {
  496. module.exports = {};
  497. /***/ }),
  498. /* 11 */
  499. /***/ (function(module, exports, __webpack_require__) {
  500. var isCallable = __webpack_require__(7);
  501. module.exports = function (it) {
  502. return typeof it == 'object' ? it !== null : isCallable(it);
  503. };
  504. /***/ }),
  505. /* 12 */
  506. /***/ (function(module, exports, __webpack_require__) {
  507. module.exports = __webpack_require__(252);
  508. /***/ }),
  509. /* 13 */
  510. /***/ (function(module, exports, __webpack_require__) {
  511. var NATIVE_BIND = __webpack_require__(70);
  512. var call = Function.prototype.call;
  513. module.exports = NATIVE_BIND ? call.bind(call) : function () {
  514. return call.apply(call, arguments);
  515. };
  516. /***/ }),
  517. /* 14 */
  518. /***/ (function(module, exports, __webpack_require__) {
  519. var uncurryThis = __webpack_require__(4);
  520. var toObject = __webpack_require__(34);
  521. var hasOwnProperty = uncurryThis({}.hasOwnProperty);
  522. // `HasOwnProperty` abstract operation
  523. // https://tc39.es/ecma262/#sec-hasownproperty
  524. // eslint-disable-next-line es-x/no-object-hasown -- safe
  525. module.exports = Object.hasOwn || function hasOwn(it, key) {
  526. return hasOwnProperty(toObject(it), key);
  527. };
  528. /***/ }),
  529. /* 15 */
  530. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  531. "use strict";
  532. /* harmony export (immutable) */ __webpack_exports__["a"] = keys;
  533. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
  534. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
  535. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(40);
  536. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__ = __webpack_require__(180);
  537. // Retrieve the names of an object's own properties.
  538. // Delegates to **ECMAScript 5**'s native `Object.keys`.
  539. function keys(obj) {
  540. if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return [];
  541. if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */])(obj);
  542. var keys = [];
  543. for (var key in obj) if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, key)) keys.push(key);
  544. // Ahem, IE < 9.
  545. if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__["a" /* default */])(obj, keys);
  546. return keys;
  547. }
  548. /***/ }),
  549. /* 16 */
  550. /***/ (function(module, exports, __webpack_require__) {
  551. var fails = __webpack_require__(3);
  552. // Detect IE8's incomplete defineProperty implementation
  553. module.exports = !fails(function () {
  554. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  555. return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
  556. });
  557. /***/ }),
  558. /* 17 */
  559. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  560. "use strict";
  561. /* harmony export (immutable) */ __webpack_exports__["a"] = tagTester;
  562. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
  563. // Internal function for creating a `toString`-based type tester.
  564. function tagTester(name) {
  565. var tag = '[object ' + name + ']';
  566. return function(obj) {
  567. return __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === tag;
  568. };
  569. }
  570. /***/ }),
  571. /* 18 */
  572. /***/ (function(module, exports, __webpack_require__) {
  573. var path = __webpack_require__(10);
  574. var global = __webpack_require__(6);
  575. var isCallable = __webpack_require__(7);
  576. var aFunction = function (variable) {
  577. return isCallable(variable) ? variable : undefined;
  578. };
  579. module.exports = function (namespace, method) {
  580. return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
  581. : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
  582. };
  583. /***/ }),
  584. /* 19 */
  585. /***/ (function(module, exports, __webpack_require__) {
  586. var isObject = __webpack_require__(11);
  587. var $String = String;
  588. var $TypeError = TypeError;
  589. // `Assert: Type(argument) is Object`
  590. module.exports = function (argument) {
  591. if (isObject(argument)) return argument;
  592. throw $TypeError($String(argument) + ' is not an object');
  593. };
  594. /***/ }),
  595. /* 20 */
  596. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  597. "use strict";
  598. /* harmony export (immutable) */ __webpack_exports__["a"] = cb;
  599. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
  600. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(190);
  601. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__iteratee_js__ = __webpack_require__(191);
  602. // The function we call internally to generate a callback. It invokes
  603. // `_.iteratee` if overridden, otherwise `baseIteratee`.
  604. function cb(value, context, argCount) {
  605. if (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].iteratee !== __WEBPACK_IMPORTED_MODULE_2__iteratee_js__["a" /* default */]) return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].iteratee(value, context);
  606. return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" /* default */])(value, context, argCount);
  607. }
  608. /***/ }),
  609. /* 21 */
  610. /***/ (function(module, exports, __webpack_require__) {
  611. var uncurryThis = __webpack_require__(4);
  612. module.exports = uncurryThis({}.isPrototypeOf);
  613. /***/ }),
  614. /* 22 */
  615. /***/ (function(module, exports, __webpack_require__) {
  616. var DESCRIPTORS = __webpack_require__(16);
  617. var IE8_DOM_DEFINE = __webpack_require__(148);
  618. var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(150);
  619. var anObject = __webpack_require__(19);
  620. var toPropertyKey = __webpack_require__(88);
  621. var $TypeError = TypeError;
  622. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  623. var $defineProperty = Object.defineProperty;
  624. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  625. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  626. var ENUMERABLE = 'enumerable';
  627. var CONFIGURABLE = 'configurable';
  628. var WRITABLE = 'writable';
  629. // `Object.defineProperty` method
  630. // https://tc39.es/ecma262/#sec-object.defineproperty
  631. exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
  632. anObject(O);
  633. P = toPropertyKey(P);
  634. anObject(Attributes);
  635. if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
  636. var current = $getOwnPropertyDescriptor(O, P);
  637. if (current && current[WRITABLE]) {
  638. O[P] = Attributes.value;
  639. Attributes = {
  640. configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
  641. enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
  642. writable: false
  643. };
  644. }
  645. } return $defineProperty(O, P, Attributes);
  646. } : $defineProperty : function defineProperty(O, P, Attributes) {
  647. anObject(O);
  648. P = toPropertyKey(P);
  649. anObject(Attributes);
  650. if (IE8_DOM_DEFINE) try {
  651. return $defineProperty(O, P, Attributes);
  652. } catch (error) { /* empty */ }
  653. if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
  654. if ('value' in Attributes) O[P] = Attributes.value;
  655. return O;
  656. };
  657. /***/ }),
  658. /* 23 */
  659. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  660. "use strict";
  661. /* harmony export (immutable) */ __webpack_exports__["a"] = restArguments;
  662. // Some functions take a variable number of arguments, or a few expected
  663. // arguments at the beginning and then a variable number of values to operate
  664. // on. This helper accumulates all remaining arguments past the function’s
  665. // argument length (or an explicit `startIndex`), into an array that becomes
  666. // the last argument. Similar to ES6’s "rest parameter".
  667. function restArguments(func, startIndex) {
  668. startIndex = startIndex == null ? func.length - 1 : +startIndex;
  669. return function() {
  670. var length = Math.max(arguments.length - startIndex, 0),
  671. rest = Array(length),
  672. index = 0;
  673. for (; index < length; index++) {
  674. rest[index] = arguments[index + startIndex];
  675. }
  676. switch (startIndex) {
  677. case 0: return func.call(this, rest);
  678. case 1: return func.call(this, arguments[0], rest);
  679. case 2: return func.call(this, arguments[0], arguments[1], rest);
  680. }
  681. var args = Array(startIndex + 1);
  682. for (index = 0; index < startIndex; index++) {
  683. args[index] = arguments[index];
  684. }
  685. args[startIndex] = rest;
  686. return func.apply(this, args);
  687. };
  688. }
  689. /***/ }),
  690. /* 24 */
  691. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  692. "use strict";
  693. /* harmony export (immutable) */ __webpack_exports__["a"] = _;
  694. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
  695. // If Underscore is called as a function, it returns a wrapped object that can
  696. // be used OO-style. This wrapper holds altered versions of all functions added
  697. // through `_.mixin`. Wrapped objects may be chained.
  698. function _(obj) {
  699. if (obj instanceof _) return obj;
  700. if (!(this instanceof _)) return new _(obj);
  701. this._wrapped = obj;
  702. }
  703. _.VERSION = __WEBPACK_IMPORTED_MODULE_0__setup_js__["e" /* VERSION */];
  704. // Extracts the result from a wrapped and chained object.
  705. _.prototype.value = function() {
  706. return this._wrapped;
  707. };
  708. // Provide unwrapping proxies for some methods used in engine operations
  709. // such as arithmetic and JSON stringification.
  710. _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
  711. _.prototype.toString = function() {
  712. return String(this._wrapped);
  713. };
  714. /***/ }),
  715. /* 25 */
  716. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  717. "use strict";
  718. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(178);
  719. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
  720. // Internal helper for collection methods to determine whether a collection
  721. // should be iterated as an array or as an object.
  722. // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
  723. // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
  724. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */]));
  725. /***/ }),
  726. /* 26 */
  727. /***/ (function(module, exports, __webpack_require__) {
  728. "use strict";
  729. var _interopRequireDefault = __webpack_require__(1);
  730. var _concat = _interopRequireDefault(__webpack_require__(30));
  731. var _promise = _interopRequireDefault(__webpack_require__(12));
  732. var _ = __webpack_require__(2);
  733. var md5 = __webpack_require__(502);
  734. var _require = __webpack_require__(2),
  735. extend = _require.extend;
  736. var AV = __webpack_require__(65);
  737. var AVError = __webpack_require__(43);
  738. var _require2 = __webpack_require__(29),
  739. getSessionToken = _require2.getSessionToken;
  740. var ajax = __webpack_require__(108); // 计算 X-LC-Sign 的签名方法
  741. var sign = function sign(key, isMasterKey) {
  742. var _context2;
  743. var now = new Date().getTime();
  744. var signature = md5(now + key);
  745. if (isMasterKey) {
  746. var _context;
  747. return (0, _concat.default)(_context = "".concat(signature, ",")).call(_context, now, ",master");
  748. }
  749. return (0, _concat.default)(_context2 = "".concat(signature, ",")).call(_context2, now);
  750. };
  751. var setAppKey = function setAppKey(headers, signKey) {
  752. if (signKey) {
  753. headers['X-LC-Sign'] = sign(AV.applicationKey);
  754. } else {
  755. headers['X-LC-Key'] = AV.applicationKey;
  756. }
  757. };
  758. var setHeaders = function setHeaders() {
  759. var authOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  760. var signKey = arguments.length > 1 ? arguments[1] : undefined;
  761. var headers = {
  762. 'X-LC-Id': AV.applicationId,
  763. 'Content-Type': 'application/json;charset=UTF-8'
  764. };
  765. var useMasterKey = false;
  766. if (typeof authOptions.useMasterKey === 'boolean') {
  767. useMasterKey = authOptions.useMasterKey;
  768. } else if (typeof AV._config.useMasterKey === 'boolean') {
  769. useMasterKey = AV._config.useMasterKey;
  770. }
  771. if (useMasterKey) {
  772. if (AV.masterKey) {
  773. if (signKey) {
  774. headers['X-LC-Sign'] = sign(AV.masterKey, true);
  775. } else {
  776. headers['X-LC-Key'] = "".concat(AV.masterKey, ",master");
  777. }
  778. } else {
  779. console.warn('masterKey is not set, fall back to use appKey');
  780. setAppKey(headers, signKey);
  781. }
  782. } else {
  783. setAppKey(headers, signKey);
  784. }
  785. if (AV.hookKey) {
  786. headers['X-LC-Hook-Key'] = AV.hookKey;
  787. }
  788. if (AV._config.production !== null) {
  789. headers['X-LC-Prod'] = String(AV._config.production);
  790. }
  791. headers[ false ? 'User-Agent' : 'X-LC-UA'] = AV._sharedConfig.userAgent;
  792. return _promise.default.resolve().then(function () {
  793. // Pass the session token
  794. var sessionToken = getSessionToken(authOptions);
  795. if (sessionToken) {
  796. headers['X-LC-Session'] = sessionToken;
  797. } else if (!AV._config.disableCurrentUser) {
  798. return AV.User.currentAsync().then(function (currentUser) {
  799. if (currentUser && currentUser._sessionToken) {
  800. headers['X-LC-Session'] = currentUser._sessionToken;
  801. }
  802. return headers;
  803. });
  804. }
  805. return headers;
  806. });
  807. };
  808. var createApiUrl = function createApiUrl(_ref) {
  809. var _ref$service = _ref.service,
  810. service = _ref$service === void 0 ? 'api' : _ref$service,
  811. _ref$version = _ref.version,
  812. version = _ref$version === void 0 ? '1.1' : _ref$version,
  813. path = _ref.path;
  814. var apiURL = AV._config.serverURLs[service];
  815. if (!apiURL) throw new Error("undefined server URL for ".concat(service));
  816. if (apiURL.charAt(apiURL.length - 1) !== '/') {
  817. apiURL += '/';
  818. }
  819. apiURL += version;
  820. if (path) {
  821. apiURL += path;
  822. }
  823. return apiURL;
  824. };
  825. /**
  826. * Low level REST API client. Call REST endpoints with authorization headers.
  827. * @function AV.request
  828. * @since 3.0.0
  829. * @param {Object} options
  830. * @param {String} options.method HTTP method
  831. * @param {String} options.path endpoint path, e.g. `/classes/Test/55759577e4b029ae6015ac20`
  832. * @param {Object} [options.query] query string dict
  833. * @param {Object} [options.data] HTTP body
  834. * @param {AuthOptions} [options.authOptions]
  835. * @param {String} [options.service = 'api']
  836. * @param {String} [options.version = '1.1']
  837. */
  838. var request = function request(_ref2) {
  839. var service = _ref2.service,
  840. version = _ref2.version,
  841. method = _ref2.method,
  842. path = _ref2.path,
  843. query = _ref2.query,
  844. data = _ref2.data,
  845. authOptions = _ref2.authOptions,
  846. _ref2$signKey = _ref2.signKey,
  847. signKey = _ref2$signKey === void 0 ? true : _ref2$signKey;
  848. if (!(AV.applicationId && (AV.applicationKey || AV.masterKey))) {
  849. throw new Error('Not initialized');
  850. }
  851. if (AV._appRouter) {
  852. AV._appRouter.refresh();
  853. }
  854. var timeout = AV._config.requestTimeout;
  855. var url = createApiUrl({
  856. service: service,
  857. path: path,
  858. version: version
  859. });
  860. return setHeaders(authOptions, signKey).then(function (headers) {
  861. return ajax({
  862. method: method,
  863. url: url,
  864. query: query,
  865. data: data,
  866. headers: headers,
  867. timeout: timeout
  868. }).catch(function (error) {
  869. var errorJSON = {
  870. code: error.code || -1,
  871. error: error.message || error.responseText
  872. };
  873. if (error.response && error.response.code) {
  874. errorJSON = error.response;
  875. } else if (error.responseText) {
  876. try {
  877. errorJSON = JSON.parse(error.responseText);
  878. } catch (e) {// If we fail to parse the error text, that's okay.
  879. }
  880. }
  881. errorJSON.rawMessage = errorJSON.rawMessage || errorJSON.error;
  882. if (!AV._sharedConfig.keepErrorRawMessage) {
  883. var _context3, _context4;
  884. errorJSON.error += (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = " [".concat(error.statusCode || 'N/A', " ")).call(_context4, method, " ")).call(_context3, url, "]");
  885. } // Transform the error into an instance of AVError by trying to parse
  886. // the error string as JSON.
  887. var err = new AVError(errorJSON.code, errorJSON.error);
  888. delete errorJSON.error;
  889. throw _.extend(err, errorJSON);
  890. });
  891. });
  892. }; // lagecy request
  893. var _request = function _request(route, className, objectId, method, data, authOptions, query) {
  894. var path = '';
  895. if (route) path += "/".concat(route);
  896. if (className) path += "/".concat(className);
  897. if (objectId) path += "/".concat(objectId); // for migeration
  898. if (data && data._fetchWhenSave) throw new Error('_fetchWhenSave should be in the query');
  899. if (data && data._where) throw new Error('_where should be in the query');
  900. if (method && method.toLowerCase() === 'get') {
  901. query = extend({}, query, data);
  902. data = null;
  903. }
  904. return request({
  905. method: method,
  906. path: path,
  907. query: query,
  908. data: data,
  909. authOptions: authOptions
  910. });
  911. };
  912. AV.request = request;
  913. module.exports = {
  914. _request: _request,
  915. request: request
  916. };
  917. /***/ }),
  918. /* 27 */
  919. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  920. "use strict";
  921. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
  922. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
  923. var isFunction = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Function');
  924. // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old
  925. // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).
  926. var nodelist = __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" /* root */].document && __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" /* root */].document.childNodes;
  927. if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
  928. isFunction = function(obj) {
  929. return typeof obj == 'function' || false;
  930. };
  931. }
  932. /* harmony default export */ __webpack_exports__["a"] = (isFunction);
  933. /***/ }),
  934. /* 28 */
  935. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  936. "use strict";
  937. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(179);
  938. // Internal helper to obtain the `length` property of an object.
  939. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" /* default */])('length'));
  940. /***/ }),
  941. /* 29 */
  942. /***/ (function(module, exports, __webpack_require__) {
  943. "use strict";
  944. var _interopRequireDefault = __webpack_require__(1);
  945. var _keys = _interopRequireDefault(__webpack_require__(55));
  946. var _getPrototypeOf = _interopRequireDefault(__webpack_require__(142));
  947. var _promise = _interopRequireDefault(__webpack_require__(12));
  948. var _ = __webpack_require__(2); // Helper function to check null or undefined.
  949. var isNullOrUndefined = function isNullOrUndefined(x) {
  950. return _.isNull(x) || _.isUndefined(x);
  951. };
  952. var ensureArray = function ensureArray(target) {
  953. if (_.isArray(target)) {
  954. return target;
  955. }
  956. if (target === undefined || target === null) {
  957. return [];
  958. }
  959. return [target];
  960. };
  961. var transformFetchOptions = function transformFetchOptions() {
  962. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  963. keys = (0, _keys.default)(_ref),
  964. include = _ref.include,
  965. includeACL = _ref.includeACL;
  966. var fetchOptions = {};
  967. if (keys) {
  968. fetchOptions.keys = ensureArray(keys).join(',');
  969. }
  970. if (include) {
  971. fetchOptions.include = ensureArray(include).join(',');
  972. }
  973. if (includeACL) {
  974. fetchOptions.returnACL = includeACL;
  975. }
  976. return fetchOptions;
  977. };
  978. var getSessionToken = function getSessionToken(authOptions) {
  979. if (authOptions.sessionToken) {
  980. return authOptions.sessionToken;
  981. }
  982. if (authOptions.user && typeof authOptions.user.getSessionToken === 'function') {
  983. return authOptions.user.getSessionToken();
  984. }
  985. };
  986. var tap = function tap(interceptor) {
  987. return function (value) {
  988. return interceptor(value), value;
  989. };
  990. }; // Shared empty constructor function to aid in prototype-chain creation.
  991. var EmptyConstructor = function EmptyConstructor() {}; // Helper function to correctly set up the prototype chain, for subclasses.
  992. // Similar to `goog.inherits`, but uses a hash of prototype properties and
  993. // class properties to be extended.
  994. var inherits = function inherits(parent, protoProps, staticProps) {
  995. var child; // The constructor function for the new subclass is either defined by you
  996. // (the "constructor" property in your `extend` definition), or defaulted
  997. // by us to simply call the parent's constructor.
  998. if (protoProps && protoProps.hasOwnProperty('constructor')) {
  999. child = protoProps.constructor;
  1000. } else {
  1001. /** @ignore */
  1002. child = function child() {
  1003. parent.apply(this, arguments);
  1004. };
  1005. } // Inherit class (static) properties from parent.
  1006. _.extend(child, parent); // Set the prototype chain to inherit from `parent`, without calling
  1007. // `parent`'s constructor function.
  1008. EmptyConstructor.prototype = parent.prototype;
  1009. child.prototype = new EmptyConstructor(); // Add prototype properties (instance properties) to the subclass,
  1010. // if supplied.
  1011. if (protoProps) {
  1012. _.extend(child.prototype, protoProps);
  1013. } // Add static properties to the constructor function, if supplied.
  1014. if (staticProps) {
  1015. _.extend(child, staticProps);
  1016. } // Correctly set child's `prototype.constructor`.
  1017. child.prototype.constructor = child; // Set a convenience property in case the parent's prototype is
  1018. // needed later.
  1019. child.__super__ = parent.prototype;
  1020. return child;
  1021. };
  1022. var parseDate = function parseDate(iso8601) {
  1023. return new Date(iso8601);
  1024. };
  1025. var setValue = function setValue(target, key, value) {
  1026. // '.' is not allowed in Class keys, escaping is not in concern now.
  1027. var segs = key.split('.');
  1028. var lastSeg = segs.pop();
  1029. var currentTarget = target;
  1030. segs.forEach(function (seg) {
  1031. if (currentTarget[seg] === undefined) currentTarget[seg] = {};
  1032. currentTarget = currentTarget[seg];
  1033. });
  1034. currentTarget[lastSeg] = value;
  1035. return target;
  1036. };
  1037. var findValue = function findValue(target, key) {
  1038. var segs = key.split('.');
  1039. var firstSeg = segs[0];
  1040. var lastSeg = segs.pop();
  1041. var currentTarget = target;
  1042. for (var i = 0; i < segs.length; i++) {
  1043. currentTarget = currentTarget[segs[i]];
  1044. if (currentTarget === undefined) {
  1045. return [undefined, undefined, lastSeg];
  1046. }
  1047. }
  1048. var value = currentTarget[lastSeg];
  1049. return [value, currentTarget, lastSeg, firstSeg];
  1050. };
  1051. var isPlainObject = function isPlainObject(obj) {
  1052. return _.isObject(obj) && (0, _getPrototypeOf.default)(obj) === Object.prototype;
  1053. };
  1054. var continueWhile = function continueWhile(predicate, asyncFunction) {
  1055. if (predicate()) {
  1056. return asyncFunction().then(function () {
  1057. return continueWhile(predicate, asyncFunction);
  1058. });
  1059. }
  1060. return _promise.default.resolve();
  1061. };
  1062. module.exports = {
  1063. isNullOrUndefined: isNullOrUndefined,
  1064. ensureArray: ensureArray,
  1065. transformFetchOptions: transformFetchOptions,
  1066. getSessionToken: getSessionToken,
  1067. tap: tap,
  1068. inherits: inherits,
  1069. parseDate: parseDate,
  1070. setValue: setValue,
  1071. findValue: findValue,
  1072. isPlainObject: isPlainObject,
  1073. continueWhile: continueWhile
  1074. };
  1075. /***/ }),
  1076. /* 30 */
  1077. /***/ (function(module, exports, __webpack_require__) {
  1078. module.exports = __webpack_require__(362);
  1079. /***/ }),
  1080. /* 31 */
  1081. /***/ (function(module, exports, __webpack_require__) {
  1082. var isCallable = __webpack_require__(7);
  1083. var tryToString = __webpack_require__(72);
  1084. var $TypeError = TypeError;
  1085. // `Assert: IsCallable(argument) is true`
  1086. module.exports = function (argument) {
  1087. if (isCallable(argument)) return argument;
  1088. throw $TypeError(tryToString(argument) + ' is not a function');
  1089. };
  1090. /***/ }),
  1091. /* 32 */
  1092. /***/ (function(module, exports) {
  1093. module.exports = true;
  1094. /***/ }),
  1095. /* 33 */
  1096. /***/ (function(module, exports, __webpack_require__) {
  1097. // toObject with fallback for non-array-like ES3 strings
  1098. var IndexedObject = __webpack_require__(114);
  1099. var requireObjectCoercible = __webpack_require__(115);
  1100. module.exports = function (it) {
  1101. return IndexedObject(requireObjectCoercible(it));
  1102. };
  1103. /***/ }),
  1104. /* 34 */
  1105. /***/ (function(module, exports, __webpack_require__) {
  1106. var requireObjectCoercible = __webpack_require__(115);
  1107. var $Object = Object;
  1108. // `ToObject` abstract operation
  1109. // https://tc39.es/ecma262/#sec-toobject
  1110. module.exports = function (argument) {
  1111. return $Object(requireObjectCoercible(argument));
  1112. };
  1113. /***/ }),
  1114. /* 35 */
  1115. /***/ (function(module, exports, __webpack_require__) {
  1116. var DESCRIPTORS = __webpack_require__(16);
  1117. var definePropertyModule = __webpack_require__(22);
  1118. var createPropertyDescriptor = __webpack_require__(44);
  1119. module.exports = DESCRIPTORS ? function (object, key, value) {
  1120. return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
  1121. } : function (object, key, value) {
  1122. object[key] = value;
  1123. return object;
  1124. };
  1125. /***/ }),
  1126. /* 36 */
  1127. /***/ (function(module, exports, __webpack_require__) {
  1128. module.exports = __webpack_require__(374);
  1129. /***/ }),
  1130. /* 37 */
  1131. /***/ (function(module, exports, __webpack_require__) {
  1132. var bind = __webpack_require__(45);
  1133. var call = __webpack_require__(13);
  1134. var anObject = __webpack_require__(19);
  1135. var tryToString = __webpack_require__(72);
  1136. var isArrayIteratorMethod = __webpack_require__(156);
  1137. var lengthOfArrayLike = __webpack_require__(46);
  1138. var isPrototypeOf = __webpack_require__(21);
  1139. var getIterator = __webpack_require__(157);
  1140. var getIteratorMethod = __webpack_require__(99);
  1141. var iteratorClose = __webpack_require__(158);
  1142. var $TypeError = TypeError;
  1143. var Result = function (stopped, result) {
  1144. this.stopped = stopped;
  1145. this.result = result;
  1146. };
  1147. var ResultPrototype = Result.prototype;
  1148. module.exports = function (iterable, unboundFunction, options) {
  1149. var that = options && options.that;
  1150. var AS_ENTRIES = !!(options && options.AS_ENTRIES);
  1151. var IS_ITERATOR = !!(options && options.IS_ITERATOR);
  1152. var INTERRUPTED = !!(options && options.INTERRUPTED);
  1153. var fn = bind(unboundFunction, that);
  1154. var iterator, iterFn, index, length, result, next, step;
  1155. var stop = function (condition) {
  1156. if (iterator) iteratorClose(iterator, 'normal', condition);
  1157. return new Result(true, condition);
  1158. };
  1159. var callFn = function (value) {
  1160. if (AS_ENTRIES) {
  1161. anObject(value);
  1162. return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
  1163. } return INTERRUPTED ? fn(value, stop) : fn(value);
  1164. };
  1165. if (IS_ITERATOR) {
  1166. iterator = iterable;
  1167. } else {
  1168. iterFn = getIteratorMethod(iterable);
  1169. if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
  1170. // optimisation for array iterators
  1171. if (isArrayIteratorMethod(iterFn)) {
  1172. for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
  1173. result = callFn(iterable[index]);
  1174. if (result && isPrototypeOf(ResultPrototype, result)) return result;
  1175. } return new Result(false);
  1176. }
  1177. iterator = getIterator(iterable, iterFn);
  1178. }
  1179. next = iterator.next;
  1180. while (!(step = call(next, iterator)).done) {
  1181. try {
  1182. result = callFn(step.value);
  1183. } catch (error) {
  1184. iteratorClose(iterator, 'throw', error);
  1185. }
  1186. if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
  1187. } return new Result(false);
  1188. };
  1189. /***/ }),
  1190. /* 38 */
  1191. /***/ (function(module, exports, __webpack_require__) {
  1192. var NATIVE_WEAK_MAP = __webpack_require__(160);
  1193. var global = __webpack_require__(6);
  1194. var uncurryThis = __webpack_require__(4);
  1195. var isObject = __webpack_require__(11);
  1196. var createNonEnumerableProperty = __webpack_require__(35);
  1197. var hasOwn = __webpack_require__(14);
  1198. var shared = __webpack_require__(117);
  1199. var sharedKey = __webpack_require__(94);
  1200. var hiddenKeys = __webpack_require__(74);
  1201. var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
  1202. var TypeError = global.TypeError;
  1203. var WeakMap = global.WeakMap;
  1204. var set, get, has;
  1205. var enforce = function (it) {
  1206. return has(it) ? get(it) : set(it, {});
  1207. };
  1208. var getterFor = function (TYPE) {
  1209. return function (it) {
  1210. var state;
  1211. if (!isObject(it) || (state = get(it)).type !== TYPE) {
  1212. throw TypeError('Incompatible receiver, ' + TYPE + ' required');
  1213. } return state;
  1214. };
  1215. };
  1216. if (NATIVE_WEAK_MAP || shared.state) {
  1217. var store = shared.state || (shared.state = new WeakMap());
  1218. var wmget = uncurryThis(store.get);
  1219. var wmhas = uncurryThis(store.has);
  1220. var wmset = uncurryThis(store.set);
  1221. set = function (it, metadata) {
  1222. if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
  1223. metadata.facade = it;
  1224. wmset(store, it, metadata);
  1225. return metadata;
  1226. };
  1227. get = function (it) {
  1228. return wmget(store, it) || {};
  1229. };
  1230. has = function (it) {
  1231. return wmhas(store, it);
  1232. };
  1233. } else {
  1234. var STATE = sharedKey('state');
  1235. hiddenKeys[STATE] = true;
  1236. set = function (it, metadata) {
  1237. if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
  1238. metadata.facade = it;
  1239. createNonEnumerableProperty(it, STATE, metadata);
  1240. return metadata;
  1241. };
  1242. get = function (it) {
  1243. return hasOwn(it, STATE) ? it[STATE] : {};
  1244. };
  1245. has = function (it) {
  1246. return hasOwn(it, STATE);
  1247. };
  1248. }
  1249. module.exports = {
  1250. set: set,
  1251. get: get,
  1252. has: has,
  1253. enforce: enforce,
  1254. getterFor: getterFor
  1255. };
  1256. /***/ }),
  1257. /* 39 */
  1258. /***/ (function(module, exports, __webpack_require__) {
  1259. var createNonEnumerableProperty = __webpack_require__(35);
  1260. module.exports = function (target, key, value, options) {
  1261. if (options && options.enumerable) target[key] = value;
  1262. else createNonEnumerableProperty(target, key, value);
  1263. return target;
  1264. };
  1265. /***/ }),
  1266. /* 40 */
  1267. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1268. "use strict";
  1269. /* harmony export (immutable) */ __webpack_exports__["a"] = has;
  1270. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
  1271. // Internal function to check whether `key` is an own property name of `obj`.
  1272. function has(obj, key) {
  1273. return obj != null && __WEBPACK_IMPORTED_MODULE_0__setup_js__["i" /* hasOwnProperty */].call(obj, key);
  1274. }
  1275. /***/ }),
  1276. /* 41 */
  1277. /***/ (function(module, exports, __webpack_require__) {
  1278. var path = __webpack_require__(10);
  1279. module.exports = function (CONSTRUCTOR) {
  1280. return path[CONSTRUCTOR + 'Prototype'];
  1281. };
  1282. /***/ }),
  1283. /* 42 */
  1284. /***/ (function(module, exports, __webpack_require__) {
  1285. module.exports = __webpack_require__(367);
  1286. /***/ }),
  1287. /* 43 */
  1288. /***/ (function(module, exports, __webpack_require__) {
  1289. "use strict";
  1290. var _interopRequireDefault = __webpack_require__(1);
  1291. var _setPrototypeOf = _interopRequireDefault(__webpack_require__(227));
  1292. var _getPrototypeOf = _interopRequireDefault(__webpack_require__(142));
  1293. var _ = __webpack_require__(2);
  1294. /**
  1295. * @class AV.Error
  1296. */
  1297. function AVError(code, message) {
  1298. if (this instanceof AVError ? this.constructor : void 0) {
  1299. var error = new Error(message);
  1300. (0, _setPrototypeOf.default)(error, (0, _getPrototypeOf.default)(this));
  1301. error.code = code;
  1302. return error;
  1303. }
  1304. return new AVError(code, message);
  1305. }
  1306. AVError.prototype = Object.create(Error.prototype, {
  1307. constructor: {
  1308. value: Error,
  1309. enumerable: false,
  1310. writable: true,
  1311. configurable: true
  1312. }
  1313. });
  1314. (0, _setPrototypeOf.default)(AVError, Error);
  1315. _.extend(AVError,
  1316. /** @lends AV.Error */
  1317. {
  1318. /**
  1319. * Error code indicating some error other than those enumerated here.
  1320. * @constant
  1321. */
  1322. OTHER_CAUSE: -1,
  1323. /**
  1324. * Error code indicating that something has gone wrong with the server.
  1325. * If you get this error code, it is AV's fault.
  1326. * @constant
  1327. */
  1328. INTERNAL_SERVER_ERROR: 1,
  1329. /**
  1330. * Error code indicating the connection to the AV servers failed.
  1331. * @constant
  1332. */
  1333. CONNECTION_FAILED: 100,
  1334. /**
  1335. * Error code indicating the specified object doesn't exist.
  1336. * @constant
  1337. */
  1338. OBJECT_NOT_FOUND: 101,
  1339. /**
  1340. * Error code indicating you tried to query with a datatype that doesn't
  1341. * support it, like exact matching an array or object.
  1342. * @constant
  1343. */
  1344. INVALID_QUERY: 102,
  1345. /**
  1346. * Error code indicating a missing or invalid classname. Classnames are
  1347. * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the
  1348. * only valid characters.
  1349. * @constant
  1350. */
  1351. INVALID_CLASS_NAME: 103,
  1352. /**
  1353. * Error code indicating an unspecified object id.
  1354. * @constant
  1355. */
  1356. MISSING_OBJECT_ID: 104,
  1357. /**
  1358. * Error code indicating an invalid key name. Keys are case-sensitive. They
  1359. * must start with a letter, and a-zA-Z0-9_ are the only valid characters.
  1360. * @constant
  1361. */
  1362. INVALID_KEY_NAME: 105,
  1363. /**
  1364. * Error code indicating a malformed pointer. You should not see this unless
  1365. * you have been mucking about changing internal AV code.
  1366. * @constant
  1367. */
  1368. INVALID_POINTER: 106,
  1369. /**
  1370. * Error code indicating that badly formed JSON was received upstream. This
  1371. * either indicates you have done something unusual with modifying how
  1372. * things encode to JSON, or the network is failing badly.
  1373. * @constant
  1374. */
  1375. INVALID_JSON: 107,
  1376. /**
  1377. * Error code indicating that the feature you tried to access is only
  1378. * available internally for testing purposes.
  1379. * @constant
  1380. */
  1381. COMMAND_UNAVAILABLE: 108,
  1382. /**
  1383. * You must call AV.initialize before using the AV library.
  1384. * @constant
  1385. */
  1386. NOT_INITIALIZED: 109,
  1387. /**
  1388. * Error code indicating that a field was set to an inconsistent type.
  1389. * @constant
  1390. */
  1391. INCORRECT_TYPE: 111,
  1392. /**
  1393. * Error code indicating an invalid channel name. A channel name is either
  1394. * an empty string (the broadcast channel) or contains only a-zA-Z0-9_
  1395. * characters.
  1396. * @constant
  1397. */
  1398. INVALID_CHANNEL_NAME: 112,
  1399. /**
  1400. * Error code indicating that push is misconfigured.
  1401. * @constant
  1402. */
  1403. PUSH_MISCONFIGURED: 115,
  1404. /**
  1405. * Error code indicating that the object is too large.
  1406. * @constant
  1407. */
  1408. OBJECT_TOO_LARGE: 116,
  1409. /**
  1410. * Error code indicating that the operation isn't allowed for clients.
  1411. * @constant
  1412. */
  1413. OPERATION_FORBIDDEN: 119,
  1414. /**
  1415. * Error code indicating the result was not found in the cache.
  1416. * @constant
  1417. */
  1418. CACHE_MISS: 120,
  1419. /**
  1420. * Error code indicating that an invalid key was used in a nested
  1421. * JSONObject.
  1422. * @constant
  1423. */
  1424. INVALID_NESTED_KEY: 121,
  1425. /**
  1426. * Error code indicating that an invalid filename was used for AVFile.
  1427. * A valid file name contains only a-zA-Z0-9_. characters and is between 1
  1428. * and 128 characters.
  1429. * @constant
  1430. */
  1431. INVALID_FILE_NAME: 122,
  1432. /**
  1433. * Error code indicating an invalid ACL was provided.
  1434. * @constant
  1435. */
  1436. INVALID_ACL: 123,
  1437. /**
  1438. * Error code indicating that the request timed out on the server. Typically
  1439. * this indicates that the request is too expensive to run.
  1440. * @constant
  1441. */
  1442. TIMEOUT: 124,
  1443. /**
  1444. * Error code indicating that the email address was invalid.
  1445. * @constant
  1446. */
  1447. INVALID_EMAIL_ADDRESS: 125,
  1448. /**
  1449. * Error code indicating a missing content type.
  1450. * @constant
  1451. */
  1452. MISSING_CONTENT_TYPE: 126,
  1453. /**
  1454. * Error code indicating a missing content length.
  1455. * @constant
  1456. */
  1457. MISSING_CONTENT_LENGTH: 127,
  1458. /**
  1459. * Error code indicating an invalid content length.
  1460. * @constant
  1461. */
  1462. INVALID_CONTENT_LENGTH: 128,
  1463. /**
  1464. * Error code indicating a file that was too large.
  1465. * @constant
  1466. */
  1467. FILE_TOO_LARGE: 129,
  1468. /**
  1469. * Error code indicating an error saving a file.
  1470. * @constant
  1471. */
  1472. FILE_SAVE_ERROR: 130,
  1473. /**
  1474. * Error code indicating an error deleting a file.
  1475. * @constant
  1476. */
  1477. FILE_DELETE_ERROR: 153,
  1478. /**
  1479. * Error code indicating that a unique field was given a value that is
  1480. * already taken.
  1481. * @constant
  1482. */
  1483. DUPLICATE_VALUE: 137,
  1484. /**
  1485. * Error code indicating that a role's name is invalid.
  1486. * @constant
  1487. */
  1488. INVALID_ROLE_NAME: 139,
  1489. /**
  1490. * Error code indicating that an application quota was exceeded. Upgrade to
  1491. * resolve.
  1492. * @constant
  1493. */
  1494. EXCEEDED_QUOTA: 140,
  1495. /**
  1496. * Error code indicating that a Cloud Code script failed.
  1497. * @constant
  1498. */
  1499. SCRIPT_FAILED: 141,
  1500. /**
  1501. * Error code indicating that a Cloud Code validation failed.
  1502. * @constant
  1503. */
  1504. VALIDATION_ERROR: 142,
  1505. /**
  1506. * Error code indicating that invalid image data was provided.
  1507. * @constant
  1508. */
  1509. INVALID_IMAGE_DATA: 150,
  1510. /**
  1511. * Error code indicating an unsaved file.
  1512. * @constant
  1513. */
  1514. UNSAVED_FILE_ERROR: 151,
  1515. /**
  1516. * Error code indicating an invalid push time.
  1517. * @constant
  1518. */
  1519. INVALID_PUSH_TIME_ERROR: 152,
  1520. /**
  1521. * Error code indicating that the username is missing or empty.
  1522. * @constant
  1523. */
  1524. USERNAME_MISSING: 200,
  1525. /**
  1526. * Error code indicating that the password is missing or empty.
  1527. * @constant
  1528. */
  1529. PASSWORD_MISSING: 201,
  1530. /**
  1531. * Error code indicating that the username has already been taken.
  1532. * @constant
  1533. */
  1534. USERNAME_TAKEN: 202,
  1535. /**
  1536. * Error code indicating that the email has already been taken.
  1537. * @constant
  1538. */
  1539. EMAIL_TAKEN: 203,
  1540. /**
  1541. * Error code indicating that the email is missing, but must be specified.
  1542. * @constant
  1543. */
  1544. EMAIL_MISSING: 204,
  1545. /**
  1546. * Error code indicating that a user with the specified email was not found.
  1547. * @constant
  1548. */
  1549. EMAIL_NOT_FOUND: 205,
  1550. /**
  1551. * Error code indicating that a user object without a valid session could
  1552. * not be altered.
  1553. * @constant
  1554. */
  1555. SESSION_MISSING: 206,
  1556. /**
  1557. * Error code indicating that a user can only be created through signup.
  1558. * @constant
  1559. */
  1560. MUST_CREATE_USER_THROUGH_SIGNUP: 207,
  1561. /**
  1562. * Error code indicating that an an account being linked is already linked
  1563. * to another user.
  1564. * @constant
  1565. */
  1566. ACCOUNT_ALREADY_LINKED: 208,
  1567. /**
  1568. * Error code indicating that a user cannot be linked to an account because
  1569. * that account's id could not be found.
  1570. * @constant
  1571. */
  1572. LINKED_ID_MISSING: 250,
  1573. /**
  1574. * Error code indicating that a user with a linked (e.g. Facebook) account
  1575. * has an invalid session.
  1576. * @constant
  1577. */
  1578. INVALID_LINKED_SESSION: 251,
  1579. /**
  1580. * Error code indicating that a service being linked (e.g. Facebook or
  1581. * Twitter) is unsupported.
  1582. * @constant
  1583. */
  1584. UNSUPPORTED_SERVICE: 252,
  1585. /**
  1586. * Error code indicating a real error code is unavailable because
  1587. * we had to use an XDomainRequest object to allow CORS requests in
  1588. * Internet Explorer, which strips the body from HTTP responses that have
  1589. * a non-2XX status code.
  1590. * @constant
  1591. */
  1592. X_DOMAIN_REQUEST: 602
  1593. });
  1594. module.exports = AVError;
  1595. /***/ }),
  1596. /* 44 */
  1597. /***/ (function(module, exports) {
  1598. module.exports = function (bitmap, value) {
  1599. return {
  1600. enumerable: !(bitmap & 1),
  1601. configurable: !(bitmap & 2),
  1602. writable: !(bitmap & 4),
  1603. value: value
  1604. };
  1605. };
  1606. /***/ }),
  1607. /* 45 */
  1608. /***/ (function(module, exports, __webpack_require__) {
  1609. var uncurryThis = __webpack_require__(4);
  1610. var aCallable = __webpack_require__(31);
  1611. var NATIVE_BIND = __webpack_require__(70);
  1612. var bind = uncurryThis(uncurryThis.bind);
  1613. // optional / simple context binding
  1614. module.exports = function (fn, that) {
  1615. aCallable(fn);
  1616. return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {
  1617. return fn.apply(that, arguments);
  1618. };
  1619. };
  1620. /***/ }),
  1621. /* 46 */
  1622. /***/ (function(module, exports, __webpack_require__) {
  1623. var toLength = __webpack_require__(263);
  1624. // `LengthOfArrayLike` abstract operation
  1625. // https://tc39.es/ecma262/#sec-lengthofarraylike
  1626. module.exports = function (obj) {
  1627. return toLength(obj.length);
  1628. };
  1629. /***/ }),
  1630. /* 47 */
  1631. /***/ (function(module, exports, __webpack_require__) {
  1632. /* global ActiveXObject -- old IE, WSH */
  1633. var anObject = __webpack_require__(19);
  1634. var definePropertiesModule = __webpack_require__(154);
  1635. var enumBugKeys = __webpack_require__(121);
  1636. var hiddenKeys = __webpack_require__(74);
  1637. var html = __webpack_require__(155);
  1638. var documentCreateElement = __webpack_require__(118);
  1639. var sharedKey = __webpack_require__(94);
  1640. var GT = '>';
  1641. var LT = '<';
  1642. var PROTOTYPE = 'prototype';
  1643. var SCRIPT = 'script';
  1644. var IE_PROTO = sharedKey('IE_PROTO');
  1645. var EmptyConstructor = function () { /* empty */ };
  1646. var scriptTag = function (content) {
  1647. return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
  1648. };
  1649. // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
  1650. var NullProtoObjectViaActiveX = function (activeXDocument) {
  1651. activeXDocument.write(scriptTag(''));
  1652. activeXDocument.close();
  1653. var temp = activeXDocument.parentWindow.Object;
  1654. activeXDocument = null; // avoid memory leak
  1655. return temp;
  1656. };
  1657. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  1658. var NullProtoObjectViaIFrame = function () {
  1659. // Thrash, waste and sodomy: IE GC bug
  1660. var iframe = documentCreateElement('iframe');
  1661. var JS = 'java' + SCRIPT + ':';
  1662. var iframeDocument;
  1663. iframe.style.display = 'none';
  1664. html.appendChild(iframe);
  1665. // https://github.com/zloirock/core-js/issues/475
  1666. iframe.src = String(JS);
  1667. iframeDocument = iframe.contentWindow.document;
  1668. iframeDocument.open();
  1669. iframeDocument.write(scriptTag('document.F=Object'));
  1670. iframeDocument.close();
  1671. return iframeDocument.F;
  1672. };
  1673. // Check for document.domain and active x support
  1674. // No need to use active x approach when document.domain is not set
  1675. // see https://github.com/es-shims/es5-shim/issues/150
  1676. // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
  1677. // avoid IE GC bug
  1678. var activeXDocument;
  1679. var NullProtoObject = function () {
  1680. try {
  1681. activeXDocument = new ActiveXObject('htmlfile');
  1682. } catch (error) { /* ignore */ }
  1683. NullProtoObject = typeof document != 'undefined'
  1684. ? document.domain && activeXDocument
  1685. ? NullProtoObjectViaActiveX(activeXDocument) // old IE
  1686. : NullProtoObjectViaIFrame()
  1687. : NullProtoObjectViaActiveX(activeXDocument); // WSH
  1688. var length = enumBugKeys.length;
  1689. while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
  1690. return NullProtoObject();
  1691. };
  1692. hiddenKeys[IE_PROTO] = true;
  1693. // `Object.create` method
  1694. // https://tc39.es/ecma262/#sec-object.create
  1695. // eslint-disable-next-line es-x/no-object-create -- safe
  1696. module.exports = Object.create || function create(O, Properties) {
  1697. var result;
  1698. if (O !== null) {
  1699. EmptyConstructor[PROTOTYPE] = anObject(O);
  1700. result = new EmptyConstructor();
  1701. EmptyConstructor[PROTOTYPE] = null;
  1702. // add "__proto__" for Object.getPrototypeOf polyfill
  1703. result[IE_PROTO] = O;
  1704. } else result = NullProtoObject();
  1705. return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
  1706. };
  1707. /***/ }),
  1708. /* 48 */
  1709. /***/ (function(module, exports, __webpack_require__) {
  1710. "use strict";
  1711. var toIndexedObject = __webpack_require__(33);
  1712. var addToUnscopables = __webpack_require__(159);
  1713. var Iterators = __webpack_require__(58);
  1714. var InternalStateModule = __webpack_require__(38);
  1715. var defineProperty = __webpack_require__(22).f;
  1716. var defineIterator = __webpack_require__(124);
  1717. var IS_PURE = __webpack_require__(32);
  1718. var DESCRIPTORS = __webpack_require__(16);
  1719. var ARRAY_ITERATOR = 'Array Iterator';
  1720. var setInternalState = InternalStateModule.set;
  1721. var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
  1722. // `Array.prototype.entries` method
  1723. // https://tc39.es/ecma262/#sec-array.prototype.entries
  1724. // `Array.prototype.keys` method
  1725. // https://tc39.es/ecma262/#sec-array.prototype.keys
  1726. // `Array.prototype.values` method
  1727. // https://tc39.es/ecma262/#sec-array.prototype.values
  1728. // `Array.prototype[@@iterator]` method
  1729. // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
  1730. // `CreateArrayIterator` internal method
  1731. // https://tc39.es/ecma262/#sec-createarrayiterator
  1732. module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
  1733. setInternalState(this, {
  1734. type: ARRAY_ITERATOR,
  1735. target: toIndexedObject(iterated), // target
  1736. index: 0, // next index
  1737. kind: kind // kind
  1738. });
  1739. // `%ArrayIteratorPrototype%.next` method
  1740. // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
  1741. }, function () {
  1742. var state = getInternalState(this);
  1743. var target = state.target;
  1744. var kind = state.kind;
  1745. var index = state.index++;
  1746. if (!target || index >= target.length) {
  1747. state.target = undefined;
  1748. return { value: undefined, done: true };
  1749. }
  1750. if (kind == 'keys') return { value: index, done: false };
  1751. if (kind == 'values') return { value: target[index], done: false };
  1752. return { value: [index, target[index]], done: false };
  1753. }, 'values');
  1754. // argumentsList[@@iterator] is %ArrayProto_values%
  1755. // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
  1756. // https://tc39.es/ecma262/#sec-createmappedargumentsobject
  1757. var values = Iterators.Arguments = Iterators.Array;
  1758. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  1759. addToUnscopables('keys');
  1760. addToUnscopables('values');
  1761. addToUnscopables('entries');
  1762. // V8 ~ Chrome 45- bug
  1763. if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {
  1764. defineProperty(values, 'name', { value: 'values' });
  1765. } catch (error) { /* empty */ }
  1766. /***/ }),
  1767. /* 49 */
  1768. /***/ (function(module, exports, __webpack_require__) {
  1769. var TO_STRING_TAG_SUPPORT = __webpack_require__(122);
  1770. var defineProperty = __webpack_require__(22).f;
  1771. var createNonEnumerableProperty = __webpack_require__(35);
  1772. var hasOwn = __webpack_require__(14);
  1773. var toString = __webpack_require__(270);
  1774. var wellKnownSymbol = __webpack_require__(9);
  1775. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  1776. module.exports = function (it, TAG, STATIC, SET_METHOD) {
  1777. if (it) {
  1778. var target = STATIC ? it : it.prototype;
  1779. if (!hasOwn(target, TO_STRING_TAG)) {
  1780. defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
  1781. }
  1782. if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
  1783. createNonEnumerableProperty(target, 'toString', toString);
  1784. }
  1785. }
  1786. };
  1787. /***/ }),
  1788. /* 50 */
  1789. /***/ (function(module, exports, __webpack_require__) {
  1790. "use strict";
  1791. var aCallable = __webpack_require__(31);
  1792. var PromiseCapability = function (C) {
  1793. var resolve, reject;
  1794. this.promise = new C(function ($$resolve, $$reject) {
  1795. if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
  1796. resolve = $$resolve;
  1797. reject = $$reject;
  1798. });
  1799. this.resolve = aCallable(resolve);
  1800. this.reject = aCallable(reject);
  1801. };
  1802. // `NewPromiseCapability` abstract operation
  1803. // https://tc39.es/ecma262/#sec-newpromisecapability
  1804. module.exports.f = function (C) {
  1805. return new PromiseCapability(C);
  1806. };
  1807. /***/ }),
  1808. /* 51 */
  1809. /***/ (function(module, exports, __webpack_require__) {
  1810. __webpack_require__(48);
  1811. var DOMIterables = __webpack_require__(289);
  1812. var global = __webpack_require__(6);
  1813. var classof = __webpack_require__(59);
  1814. var createNonEnumerableProperty = __webpack_require__(35);
  1815. var Iterators = __webpack_require__(58);
  1816. var wellKnownSymbol = __webpack_require__(9);
  1817. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  1818. for (var COLLECTION_NAME in DOMIterables) {
  1819. var Collection = global[COLLECTION_NAME];
  1820. var CollectionPrototype = Collection && Collection.prototype;
  1821. if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {
  1822. createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
  1823. }
  1824. Iterators[COLLECTION_NAME] = Iterators.Array;
  1825. }
  1826. /***/ }),
  1827. /* 52 */
  1828. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1829. "use strict";
  1830. /* harmony export (immutable) */ __webpack_exports__["a"] = isObject;
  1831. // Is a given variable an object?
  1832. function isObject(obj) {
  1833. var type = typeof obj;
  1834. return type === 'function' || type === 'object' && !!obj;
  1835. }
  1836. /***/ }),
  1837. /* 53 */
  1838. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1839. "use strict";
  1840. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
  1841. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tagTester_js__ = __webpack_require__(17);
  1842. // Is a given value an array?
  1843. // Delegates to ECMA5's native `Array.isArray`.
  1844. /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["k" /* nativeIsArray */] || Object(__WEBPACK_IMPORTED_MODULE_1__tagTester_js__["a" /* default */])('Array'));
  1845. /***/ }),
  1846. /* 54 */
  1847. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1848. "use strict";
  1849. /* harmony export (immutable) */ __webpack_exports__["a"] = each;
  1850. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(82);
  1851. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
  1852. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
  1853. // The cornerstone for collection functions, an `each`
  1854. // implementation, aka `forEach`.
  1855. // Handles raw objects in addition to array-likes. Treats all
  1856. // sparse array-likes as if they were dense.
  1857. function each(obj, iteratee, context) {
  1858. iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" /* default */])(iteratee, context);
  1859. var i, length;
  1860. if (Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj)) {
  1861. for (i = 0, length = obj.length; i < length; i++) {
  1862. iteratee(obj[i], i, obj);
  1863. }
  1864. } else {
  1865. var _keys = Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj);
  1866. for (i = 0, length = _keys.length; i < length; i++) {
  1867. iteratee(obj[_keys[i]], _keys[i], obj);
  1868. }
  1869. }
  1870. return obj;
  1871. }
  1872. /***/ }),
  1873. /* 55 */
  1874. /***/ (function(module, exports, __webpack_require__) {
  1875. module.exports = __webpack_require__(381);
  1876. /***/ }),
  1877. /* 56 */
  1878. /***/ (function(module, exports, __webpack_require__) {
  1879. var uncurryThis = __webpack_require__(4);
  1880. var toString = uncurryThis({}.toString);
  1881. var stringSlice = uncurryThis(''.slice);
  1882. module.exports = function (it) {
  1883. return stringSlice(toString(it), 8, -1);
  1884. };
  1885. /***/ }),
  1886. /* 57 */
  1887. /***/ (function(module, exports, __webpack_require__) {
  1888. /* eslint-disable es-x/no-symbol -- required for testing */
  1889. var V8_VERSION = __webpack_require__(90);
  1890. var fails = __webpack_require__(3);
  1891. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
  1892. module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
  1893. var symbol = Symbol();
  1894. // Chrome 38 Symbol has incorrect toString conversion
  1895. // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
  1896. return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
  1897. // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
  1898. !Symbol.sham && V8_VERSION && V8_VERSION < 41;
  1899. });
  1900. /***/ }),
  1901. /* 58 */
  1902. /***/ (function(module, exports) {
  1903. module.exports = {};
  1904. /***/ }),
  1905. /* 59 */
  1906. /***/ (function(module, exports, __webpack_require__) {
  1907. var TO_STRING_TAG_SUPPORT = __webpack_require__(122);
  1908. var isCallable = __webpack_require__(7);
  1909. var classofRaw = __webpack_require__(56);
  1910. var wellKnownSymbol = __webpack_require__(9);
  1911. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  1912. var $Object = Object;
  1913. // ES3 wrong here
  1914. var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
  1915. // fallback for IE11 Script Access Denied error
  1916. var tryGet = function (it, key) {
  1917. try {
  1918. return it[key];
  1919. } catch (error) { /* empty */ }
  1920. };
  1921. // getting tag from ES6+ `Object.prototype.toString`
  1922. module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
  1923. var O, tag, result;
  1924. return it === undefined ? 'Undefined' : it === null ? 'Null'
  1925. // @@toStringTag case
  1926. : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
  1927. // builtinTag case
  1928. : CORRECT_ARGUMENTS ? classofRaw(O)
  1929. // ES3 arguments fallback
  1930. : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
  1931. };
  1932. /***/ }),
  1933. /* 60 */
  1934. /***/ (function(module, exports) {
  1935. // empty
  1936. /***/ }),
  1937. /* 61 */
  1938. /***/ (function(module, exports, __webpack_require__) {
  1939. var global = __webpack_require__(6);
  1940. module.exports = global.Promise;
  1941. /***/ }),
  1942. /* 62 */
  1943. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1944. "use strict";
  1945. /* harmony export (immutable) */ __webpack_exports__["a"] = values;
  1946. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
  1947. // Retrieve the values of an object's properties.
  1948. function values(obj) {
  1949. var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
  1950. var length = _keys.length;
  1951. var values = Array(length);
  1952. for (var i = 0; i < length; i++) {
  1953. values[i] = obj[_keys[i]];
  1954. }
  1955. return values;
  1956. }
  1957. /***/ }),
  1958. /* 63 */
  1959. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1960. "use strict";
  1961. /* harmony export (immutable) */ __webpack_exports__["a"] = flatten;
  1962. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
  1963. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
  1964. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArray_js__ = __webpack_require__(53);
  1965. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(129);
  1966. // Internal implementation of a recursive `flatten` function.
  1967. function flatten(input, depth, strict, output) {
  1968. output = output || [];
  1969. if (!depth && depth !== 0) {
  1970. depth = Infinity;
  1971. } else if (depth <= 0) {
  1972. return output.concat(input);
  1973. }
  1974. var idx = output.length;
  1975. for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(input); i < length; i++) {
  1976. var value = input[i];
  1977. if (Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(value) && (Object(__WEBPACK_IMPORTED_MODULE_2__isArray_js__["a" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_3__isArguments_js__["a" /* default */])(value))) {
  1978. // Flatten current level of array or arguments object.
  1979. if (depth > 1) {
  1980. flatten(value, depth - 1, strict, output);
  1981. idx = output.length;
  1982. } else {
  1983. var j = 0, len = value.length;
  1984. while (j < len) output[idx++] = value[j++];
  1985. }
  1986. } else if (!strict) {
  1987. output[idx++] = value;
  1988. }
  1989. }
  1990. return output;
  1991. }
  1992. /***/ }),
  1993. /* 64 */
  1994. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1995. "use strict";
  1996. /* harmony export (immutable) */ __webpack_exports__["a"] = map;
  1997. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
  1998. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
  1999. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
  2000. // Return the results of applying the iteratee to each element.
  2001. function map(obj, iteratee, context) {
  2002. iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
  2003. var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
  2004. length = (_keys || obj).length,
  2005. results = Array(length);
  2006. for (var index = 0; index < length; index++) {
  2007. var currentKey = _keys ? _keys[index] : index;
  2008. results[index] = iteratee(obj[currentKey], currentKey, obj);
  2009. }
  2010. return results;
  2011. }
  2012. /***/ }),
  2013. /* 65 */
  2014. /***/ (function(module, exports, __webpack_require__) {
  2015. "use strict";
  2016. /* WEBPACK VAR INJECTION */(function(global) {
  2017. var _interopRequireDefault = __webpack_require__(1);
  2018. var _promise = _interopRequireDefault(__webpack_require__(12));
  2019. var _concat = _interopRequireDefault(__webpack_require__(30));
  2020. var _map = _interopRequireDefault(__webpack_require__(42));
  2021. var _keys = _interopRequireDefault(__webpack_require__(141));
  2022. var _stringify = _interopRequireDefault(__webpack_require__(36));
  2023. var _indexOf = _interopRequireDefault(__webpack_require__(86));
  2024. var _keys2 = _interopRequireDefault(__webpack_require__(55));
  2025. var _ = __webpack_require__(2);
  2026. var uuid = __webpack_require__(221);
  2027. var debug = __webpack_require__(67);
  2028. var _require = __webpack_require__(29),
  2029. inherits = _require.inherits,
  2030. parseDate = _require.parseDate;
  2031. var version = __webpack_require__(223);
  2032. var _require2 = __webpack_require__(68),
  2033. setAdapters = _require2.setAdapters,
  2034. adapterManager = _require2.adapterManager;
  2035. var AV = global.AV || {}; // All internal configuration items
  2036. AV._config = {
  2037. serverURLs: {},
  2038. useMasterKey: false,
  2039. production: null,
  2040. realtime: null,
  2041. requestTimeout: null
  2042. };
  2043. var initialUserAgent = "LeanCloud-JS-SDK/".concat(version); // configs shared by all AV instances
  2044. AV._sharedConfig = {
  2045. userAgent: initialUserAgent,
  2046. liveQueryRealtime: null
  2047. };
  2048. adapterManager.on('platformInfo', function (platformInfo) {
  2049. var ua = initialUserAgent;
  2050. if (platformInfo) {
  2051. if (platformInfo.userAgent) {
  2052. ua = platformInfo.userAgent;
  2053. } else {
  2054. var comments = platformInfo.name;
  2055. if (platformInfo.version) {
  2056. comments += "/".concat(platformInfo.version);
  2057. }
  2058. if (platformInfo.extra) {
  2059. comments += "; ".concat(platformInfo.extra);
  2060. }
  2061. ua += " (".concat(comments, ")");
  2062. }
  2063. }
  2064. AV._sharedConfig.userAgent = ua;
  2065. });
  2066. /**
  2067. * Contains all AV API classes and functions.
  2068. * @namespace AV
  2069. */
  2070. /**
  2071. * Returns prefix for localStorage keys used by this instance of AV.
  2072. * @param {String} path The relative suffix to append to it.
  2073. * null or undefined is treated as the empty string.
  2074. * @return {String} The full key name.
  2075. * @private
  2076. */
  2077. AV._getAVPath = function (path) {
  2078. if (!AV.applicationId) {
  2079. throw new Error('You need to call AV.initialize before using AV.');
  2080. }
  2081. if (!path) {
  2082. path = '';
  2083. }
  2084. if (!_.isString(path)) {
  2085. throw new Error("Tried to get a localStorage path that wasn't a String.");
  2086. }
  2087. if (path[0] === '/') {
  2088. path = path.substring(1);
  2089. }
  2090. return 'AV/' + AV.applicationId + '/' + path;
  2091. };
  2092. /**
  2093. * Returns the unique string for this app on this machine.
  2094. * Gets reset when localStorage is cleared.
  2095. * @private
  2096. */
  2097. AV._installationId = null;
  2098. AV._getInstallationId = function () {
  2099. // See if it's cached in RAM.
  2100. if (AV._installationId) {
  2101. return _promise.default.resolve(AV._installationId);
  2102. } // Try to get it from localStorage.
  2103. var path = AV._getAVPath('installationId');
  2104. return AV.localStorage.getItemAsync(path).then(function (_installationId) {
  2105. AV._installationId = _installationId;
  2106. if (!AV._installationId) {
  2107. // It wasn't in localStorage, so create a new one.
  2108. AV._installationId = _installationId = uuid();
  2109. return AV.localStorage.setItemAsync(path, _installationId).then(function () {
  2110. return _installationId;
  2111. });
  2112. }
  2113. return _installationId;
  2114. });
  2115. };
  2116. AV._subscriptionId = null;
  2117. AV._refreshSubscriptionId = function () {
  2118. var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : AV._getAVPath('subscriptionId');
  2119. var subscriptionId = AV._subscriptionId = uuid();
  2120. return AV.localStorage.setItemAsync(path, subscriptionId).then(function () {
  2121. return subscriptionId;
  2122. });
  2123. };
  2124. AV._getSubscriptionId = function () {
  2125. // See if it's cached in RAM.
  2126. if (AV._subscriptionId) {
  2127. return _promise.default.resolve(AV._subscriptionId);
  2128. } // Try to get it from localStorage.
  2129. var path = AV._getAVPath('subscriptionId');
  2130. return AV.localStorage.getItemAsync(path).then(function (_subscriptionId) {
  2131. AV._subscriptionId = _subscriptionId;
  2132. if (!AV._subscriptionId) {
  2133. // It wasn't in localStorage, so create a new one.
  2134. _subscriptionId = AV._refreshSubscriptionId(path);
  2135. }
  2136. return _subscriptionId;
  2137. });
  2138. };
  2139. AV._parseDate = parseDate; // A self-propagating extend function.
  2140. AV._extend = function (protoProps, classProps) {
  2141. var child = inherits(this, protoProps, classProps);
  2142. child.extend = this.extend;
  2143. return child;
  2144. };
  2145. /**
  2146. * Converts a value in a AV Object into the appropriate representation.
  2147. * This is the JS equivalent of Java's AV.maybeReferenceAndEncode(Object)
  2148. * if seenObjects is falsey. Otherwise any AV.Objects not in
  2149. * seenObjects will be fully embedded rather than encoded
  2150. * as a pointer. This array will be used to prevent going into an infinite
  2151. * loop because we have circular references. If <seenObjects>
  2152. * is set, then none of the AV Objects that are serialized can be dirty.
  2153. * @private
  2154. */
  2155. AV._encode = function (value, seenObjects, disallowObjects) {
  2156. var full = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
  2157. if (value instanceof AV.Object) {
  2158. if (disallowObjects) {
  2159. throw new Error('AV.Objects not allowed here');
  2160. }
  2161. if (!seenObjects || _.include(seenObjects, value) || !value._hasData) {
  2162. return value._toPointer();
  2163. }
  2164. return value._toFullJSON((0, _concat.default)(seenObjects).call(seenObjects, value), full);
  2165. }
  2166. if (value instanceof AV.ACL) {
  2167. return value.toJSON();
  2168. }
  2169. if (_.isDate(value)) {
  2170. return full ? {
  2171. __type: 'Date',
  2172. iso: value.toJSON()
  2173. } : value.toJSON();
  2174. }
  2175. if (value instanceof AV.GeoPoint) {
  2176. return value.toJSON();
  2177. }
  2178. if (_.isArray(value)) {
  2179. return (0, _map.default)(_).call(_, value, function (x) {
  2180. return AV._encode(x, seenObjects, disallowObjects, full);
  2181. });
  2182. }
  2183. if (_.isRegExp(value)) {
  2184. return value.source;
  2185. }
  2186. if (value instanceof AV.Relation) {
  2187. return value.toJSON();
  2188. }
  2189. if (value instanceof AV.Op) {
  2190. return value.toJSON();
  2191. }
  2192. if (value instanceof AV.File) {
  2193. if (!value.url() && !value.id) {
  2194. throw new Error('Tried to save an object containing an unsaved file.');
  2195. }
  2196. return value._toFullJSON(seenObjects, full);
  2197. }
  2198. if (_.isObject(value)) {
  2199. return _.mapObject(value, function (v, k) {
  2200. return AV._encode(v, seenObjects, disallowObjects, full);
  2201. });
  2202. }
  2203. return value;
  2204. };
  2205. /**
  2206. * The inverse function of AV._encode.
  2207. * @private
  2208. */
  2209. AV._decode = function (value, key) {
  2210. if (!_.isObject(value) || _.isDate(value)) {
  2211. return value;
  2212. }
  2213. if (_.isArray(value)) {
  2214. return (0, _map.default)(_).call(_, value, function (v) {
  2215. return AV._decode(v);
  2216. });
  2217. }
  2218. if (value instanceof AV.Object) {
  2219. return value;
  2220. }
  2221. if (value instanceof AV.File) {
  2222. return value;
  2223. }
  2224. if (value instanceof AV.Op) {
  2225. return value;
  2226. }
  2227. if (value instanceof AV.GeoPoint) {
  2228. return value;
  2229. }
  2230. if (value instanceof AV.ACL) {
  2231. return value;
  2232. }
  2233. if (key === 'ACL') {
  2234. return new AV.ACL(value);
  2235. }
  2236. if (value.__op) {
  2237. return AV.Op._decode(value);
  2238. }
  2239. var className;
  2240. if (value.__type === 'Pointer') {
  2241. className = value.className;
  2242. var pointer = AV.Object._create(className);
  2243. if ((0, _keys.default)(value).length > 3) {
  2244. var v = _.clone(value);
  2245. delete v.__type;
  2246. delete v.className;
  2247. pointer._finishFetch(v, true);
  2248. } else {
  2249. pointer._finishFetch({
  2250. objectId: value.objectId
  2251. }, false);
  2252. }
  2253. return pointer;
  2254. }
  2255. if (value.__type === 'Object') {
  2256. // It's an Object included in a query result.
  2257. className = value.className;
  2258. var _v = _.clone(value);
  2259. delete _v.__type;
  2260. delete _v.className;
  2261. var object = AV.Object._create(className);
  2262. object._finishFetch(_v, true);
  2263. return object;
  2264. }
  2265. if (value.__type === 'Date') {
  2266. return AV._parseDate(value.iso);
  2267. }
  2268. if (value.__type === 'GeoPoint') {
  2269. return new AV.GeoPoint({
  2270. latitude: value.latitude,
  2271. longitude: value.longitude
  2272. });
  2273. }
  2274. if (value.__type === 'Relation') {
  2275. if (!key) throw new Error('key missing decoding a Relation');
  2276. var relation = new AV.Relation(null, key);
  2277. relation.targetClassName = value.className;
  2278. return relation;
  2279. }
  2280. if (value.__type === 'File') {
  2281. var file = new AV.File(value.name);
  2282. var _v2 = _.clone(value);
  2283. delete _v2.__type;
  2284. file._finishFetch(_v2);
  2285. return file;
  2286. }
  2287. return _.mapObject(value, AV._decode);
  2288. };
  2289. /**
  2290. * The inverse function of {@link AV.Object#toFullJSON}.
  2291. * @since 3.0.0
  2292. * @method
  2293. * @param {Object}
  2294. * return {AV.Object|AV.File|any}
  2295. */
  2296. AV.parseJSON = AV._decode;
  2297. /**
  2298. * Similar to JSON.parse, except that AV internal types will be used if possible.
  2299. * Inverse to {@link AV.stringify}
  2300. * @since 3.14.0
  2301. * @param {string} text the string to parse.
  2302. * @return {AV.Object|AV.File|any}
  2303. */
  2304. AV.parse = function (text) {
  2305. return AV.parseJSON(JSON.parse(text));
  2306. };
  2307. /**
  2308. * Serialize a target containing AV.Object, similar to JSON.stringify.
  2309. * Inverse to {@link AV.parse}
  2310. * @since 3.14.0
  2311. * @return {string}
  2312. */
  2313. AV.stringify = function (target) {
  2314. return (0, _stringify.default)(AV._encode(target, [], false, true));
  2315. };
  2316. AV._encodeObjectOrArray = function (value) {
  2317. var encodeAVObject = function encodeAVObject(object) {
  2318. if (object && object._toFullJSON) {
  2319. object = object._toFullJSON([]);
  2320. }
  2321. return _.mapObject(object, function (value) {
  2322. return AV._encode(value, []);
  2323. });
  2324. };
  2325. if (_.isArray(value)) {
  2326. return (0, _map.default)(value).call(value, function (object) {
  2327. return encodeAVObject(object);
  2328. });
  2329. } else {
  2330. return encodeAVObject(value);
  2331. }
  2332. };
  2333. AV._arrayEach = _.each;
  2334. /**
  2335. * Does a deep traversal of every item in object, calling func on every one.
  2336. * @param {Object} object The object or array to traverse deeply.
  2337. * @param {Function} func The function to call for every item. It will
  2338. * be passed the item as an argument. If it returns a truthy value, that
  2339. * value will replace the item in its parent container.
  2340. * @returns {} the result of calling func on the top-level object itself.
  2341. * @private
  2342. */
  2343. AV._traverse = function (object, func, seen) {
  2344. if (object instanceof AV.Object) {
  2345. seen = seen || [];
  2346. if ((0, _indexOf.default)(_).call(_, seen, object) >= 0) {
  2347. // We've already visited this object in this call.
  2348. return;
  2349. }
  2350. seen.push(object);
  2351. AV._traverse(object.attributes, func, seen);
  2352. return func(object);
  2353. }
  2354. if (object instanceof AV.Relation || object instanceof AV.File) {
  2355. // Nothing needs to be done, but we don't want to recurse into the
  2356. // object's parent infinitely, so we catch this case.
  2357. return func(object);
  2358. }
  2359. if (_.isArray(object)) {
  2360. _.each(object, function (child, index) {
  2361. var newChild = AV._traverse(child, func, seen);
  2362. if (newChild) {
  2363. object[index] = newChild;
  2364. }
  2365. });
  2366. return func(object);
  2367. }
  2368. if (_.isObject(object)) {
  2369. AV._each(object, function (child, key) {
  2370. var newChild = AV._traverse(child, func, seen);
  2371. if (newChild) {
  2372. object[key] = newChild;
  2373. }
  2374. });
  2375. return func(object);
  2376. }
  2377. return func(object);
  2378. };
  2379. /**
  2380. * This is like _.each, except:
  2381. * * it doesn't work for so-called array-like objects,
  2382. * * it does work for dictionaries with a "length" attribute.
  2383. * @private
  2384. */
  2385. AV._objectEach = AV._each = function (obj, callback) {
  2386. if (_.isObject(obj)) {
  2387. _.each((0, _keys2.default)(_).call(_, obj), function (key) {
  2388. callback(obj[key], key);
  2389. });
  2390. } else {
  2391. _.each(obj, callback);
  2392. }
  2393. };
  2394. /**
  2395. * @namespace
  2396. * @since 3.14.0
  2397. */
  2398. AV.debug = {
  2399. /**
  2400. * Enable debug
  2401. */
  2402. enable: function enable() {
  2403. var namespaces = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'leancloud*';
  2404. return debug.enable(namespaces);
  2405. },
  2406. /**
  2407. * Disable debug
  2408. */
  2409. disable: debug.disable
  2410. };
  2411. /**
  2412. * Specify Adapters
  2413. * @since 4.4.0
  2414. * @function
  2415. * @param {Adapters} newAdapters See {@link https://url.leanapp.cn/adapter-type-definitions @leancloud/adapter-types} for detailed definitions.
  2416. */
  2417. AV.setAdapters = setAdapters;
  2418. module.exports = AV;
  2419. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(112)))
  2420. /***/ }),
  2421. /* 66 */
  2422. /***/ (function(module, exports, __webpack_require__) {
  2423. var bind = __webpack_require__(45);
  2424. var uncurryThis = __webpack_require__(4);
  2425. var IndexedObject = __webpack_require__(114);
  2426. var toObject = __webpack_require__(34);
  2427. var lengthOfArrayLike = __webpack_require__(46);
  2428. var arraySpeciesCreate = __webpack_require__(219);
  2429. var push = uncurryThis([].push);
  2430. // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
  2431. var createMethod = function (TYPE) {
  2432. var IS_MAP = TYPE == 1;
  2433. var IS_FILTER = TYPE == 2;
  2434. var IS_SOME = TYPE == 3;
  2435. var IS_EVERY = TYPE == 4;
  2436. var IS_FIND_INDEX = TYPE == 6;
  2437. var IS_FILTER_REJECT = TYPE == 7;
  2438. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  2439. return function ($this, callbackfn, that, specificCreate) {
  2440. var O = toObject($this);
  2441. var self = IndexedObject(O);
  2442. var boundFunction = bind(callbackfn, that);
  2443. var length = lengthOfArrayLike(self);
  2444. var index = 0;
  2445. var create = specificCreate || arraySpeciesCreate;
  2446. var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
  2447. var value, result;
  2448. for (;length > index; index++) if (NO_HOLES || index in self) {
  2449. value = self[index];
  2450. result = boundFunction(value, index, O);
  2451. if (TYPE) {
  2452. if (IS_MAP) target[index] = result; // map
  2453. else if (result) switch (TYPE) {
  2454. case 3: return true; // some
  2455. case 5: return value; // find
  2456. case 6: return index; // findIndex
  2457. case 2: push(target, value); // filter
  2458. } else switch (TYPE) {
  2459. case 4: return false; // every
  2460. case 7: push(target, value); // filterReject
  2461. }
  2462. }
  2463. }
  2464. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
  2465. };
  2466. };
  2467. module.exports = {
  2468. // `Array.prototype.forEach` method
  2469. // https://tc39.es/ecma262/#sec-array.prototype.foreach
  2470. forEach: createMethod(0),
  2471. // `Array.prototype.map` method
  2472. // https://tc39.es/ecma262/#sec-array.prototype.map
  2473. map: createMethod(1),
  2474. // `Array.prototype.filter` method
  2475. // https://tc39.es/ecma262/#sec-array.prototype.filter
  2476. filter: createMethod(2),
  2477. // `Array.prototype.some` method
  2478. // https://tc39.es/ecma262/#sec-array.prototype.some
  2479. some: createMethod(3),
  2480. // `Array.prototype.every` method
  2481. // https://tc39.es/ecma262/#sec-array.prototype.every
  2482. every: createMethod(4),
  2483. // `Array.prototype.find` method
  2484. // https://tc39.es/ecma262/#sec-array.prototype.find
  2485. find: createMethod(5),
  2486. // `Array.prototype.findIndex` method
  2487. // https://tc39.es/ecma262/#sec-array.prototype.findIndex
  2488. findIndex: createMethod(6),
  2489. // `Array.prototype.filterReject` method
  2490. // https://github.com/tc39/proposal-array-filtering
  2491. filterReject: createMethod(7)
  2492. };
  2493. /***/ }),
  2494. /* 67 */
  2495. /***/ (function(module, exports, __webpack_require__) {
  2496. "use strict";
  2497. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  2498. /* eslint-env browser */
  2499. /**
  2500. * This is the web browser implementation of `debug()`.
  2501. */
  2502. exports.log = log;
  2503. exports.formatArgs = formatArgs;
  2504. exports.save = save;
  2505. exports.load = load;
  2506. exports.useColors = useColors;
  2507. exports.storage = localstorage();
  2508. /**
  2509. * Colors.
  2510. */
  2511. exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
  2512. /**
  2513. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  2514. * and the Firebug extension (any Firefox version) are known
  2515. * to support "%c" CSS customizations.
  2516. *
  2517. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  2518. */
  2519. // eslint-disable-next-line complexity
  2520. function useColors() {
  2521. // NB: In an Electron preload script, document will be defined but not fully
  2522. // initialized. Since we know we're in Chrome, we'll just detect this case
  2523. // explicitly
  2524. if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
  2525. return true;
  2526. } // Internet Explorer and Edge do not support colors.
  2527. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
  2528. return false;
  2529. } // Is webkit? http://stackoverflow.com/a/16459606/376773
  2530. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  2531. return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
  2532. typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
  2533. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  2534. typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
  2535. typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
  2536. }
  2537. /**
  2538. * Colorize log arguments if enabled.
  2539. *
  2540. * @api public
  2541. */
  2542. function formatArgs(args) {
  2543. args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
  2544. if (!this.useColors) {
  2545. return;
  2546. }
  2547. var c = 'color: ' + this.color;
  2548. args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
  2549. // arguments passed either before or after the %c, so we need to
  2550. // figure out the correct index to insert the CSS into
  2551. var index = 0;
  2552. var lastC = 0;
  2553. args[0].replace(/%[a-zA-Z%]/g, function (match) {
  2554. if (match === '%%') {
  2555. return;
  2556. }
  2557. index++;
  2558. if (match === '%c') {
  2559. // We only are interested in the *last* %c
  2560. // (the user may have provided their own)
  2561. lastC = index;
  2562. }
  2563. });
  2564. args.splice(lastC, 0, c);
  2565. }
  2566. /**
  2567. * Invokes `console.log()` when available.
  2568. * No-op when `console.log` is not a "function".
  2569. *
  2570. * @api public
  2571. */
  2572. function log() {
  2573. var _console;
  2574. // This hackery is required for IE8/9, where
  2575. // the `console.log` function doesn't have 'apply'
  2576. return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
  2577. }
  2578. /**
  2579. * Save `namespaces`.
  2580. *
  2581. * @param {String} namespaces
  2582. * @api private
  2583. */
  2584. function save(namespaces) {
  2585. try {
  2586. if (namespaces) {
  2587. exports.storage.setItem('debug', namespaces);
  2588. } else {
  2589. exports.storage.removeItem('debug');
  2590. }
  2591. } catch (error) {// Swallow
  2592. // XXX (@Qix-) should we be logging these?
  2593. }
  2594. }
  2595. /**
  2596. * Load `namespaces`.
  2597. *
  2598. * @return {String} returns the previously persisted debug modes
  2599. * @api private
  2600. */
  2601. function load() {
  2602. var r;
  2603. try {
  2604. r = exports.storage.getItem('debug');
  2605. } catch (error) {} // Swallow
  2606. // XXX (@Qix-) should we be logging these?
  2607. // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  2608. if (!r && typeof process !== 'undefined' && 'env' in process) {
  2609. r = process.env.DEBUG;
  2610. }
  2611. return r;
  2612. }
  2613. /**
  2614. * Localstorage attempts to return the localstorage.
  2615. *
  2616. * This is necessary because safari throws
  2617. * when a user disables cookies/localstorage
  2618. * and you attempt to access it.
  2619. *
  2620. * @return {LocalStorage}
  2621. * @api private
  2622. */
  2623. function localstorage() {
  2624. try {
  2625. // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
  2626. // The Browser also has localStorage in the global context.
  2627. return localStorage;
  2628. } catch (error) {// Swallow
  2629. // XXX (@Qix-) should we be logging these?
  2630. }
  2631. }
  2632. module.exports = __webpack_require__(386)(exports);
  2633. var formatters = module.exports.formatters;
  2634. /**
  2635. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  2636. */
  2637. formatters.j = function (v) {
  2638. try {
  2639. return JSON.stringify(v);
  2640. } catch (error) {
  2641. return '[UnexpectedJSONParseError]: ' + error.message;
  2642. }
  2643. };
  2644. /***/ }),
  2645. /* 68 */
  2646. /***/ (function(module, exports, __webpack_require__) {
  2647. "use strict";
  2648. var _interopRequireDefault = __webpack_require__(1);
  2649. var _keys = _interopRequireDefault(__webpack_require__(55));
  2650. var _ = __webpack_require__(2);
  2651. var EventEmitter = __webpack_require__(224);
  2652. var _require = __webpack_require__(29),
  2653. inherits = _require.inherits;
  2654. var AdapterManager = inherits(EventEmitter, {
  2655. constructor: function constructor() {
  2656. EventEmitter.apply(this);
  2657. this._adapters = {};
  2658. },
  2659. getAdapter: function getAdapter(name) {
  2660. var adapter = this._adapters[name];
  2661. if (adapter === undefined) {
  2662. throw new Error("".concat(name, " adapter is not configured"));
  2663. }
  2664. return adapter;
  2665. },
  2666. setAdapters: function setAdapters(newAdapters) {
  2667. var _this = this;
  2668. _.extend(this._adapters, newAdapters);
  2669. (0, _keys.default)(_).call(_, newAdapters).forEach(function (name) {
  2670. return _this.emit(name, newAdapters[name]);
  2671. });
  2672. }
  2673. });
  2674. var adapterManager = new AdapterManager();
  2675. module.exports = {
  2676. getAdapter: adapterManager.getAdapter.bind(adapterManager),
  2677. setAdapters: adapterManager.setAdapters.bind(adapterManager),
  2678. adapterManager: adapterManager
  2679. };
  2680. /***/ }),
  2681. /* 69 */
  2682. /***/ (function(module, exports, __webpack_require__) {
  2683. var NATIVE_BIND = __webpack_require__(70);
  2684. var FunctionPrototype = Function.prototype;
  2685. var apply = FunctionPrototype.apply;
  2686. var call = FunctionPrototype.call;
  2687. // eslint-disable-next-line es-x/no-reflect -- safe
  2688. module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {
  2689. return call.apply(apply, arguments);
  2690. });
  2691. /***/ }),
  2692. /* 70 */
  2693. /***/ (function(module, exports, __webpack_require__) {
  2694. var fails = __webpack_require__(3);
  2695. module.exports = !fails(function () {
  2696. // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
  2697. var test = (function () { /* empty */ }).bind();
  2698. // eslint-disable-next-line no-prototype-builtins -- safe
  2699. return typeof test != 'function' || test.hasOwnProperty('prototype');
  2700. });
  2701. /***/ }),
  2702. /* 71 */
  2703. /***/ (function(module, exports, __webpack_require__) {
  2704. var DESCRIPTORS = __webpack_require__(16);
  2705. var call = __webpack_require__(13);
  2706. var propertyIsEnumerableModule = __webpack_require__(113);
  2707. var createPropertyDescriptor = __webpack_require__(44);
  2708. var toIndexedObject = __webpack_require__(33);
  2709. var toPropertyKey = __webpack_require__(88);
  2710. var hasOwn = __webpack_require__(14);
  2711. var IE8_DOM_DEFINE = __webpack_require__(148);
  2712. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  2713. var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  2714. // `Object.getOwnPropertyDescriptor` method
  2715. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  2716. exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
  2717. O = toIndexedObject(O);
  2718. P = toPropertyKey(P);
  2719. if (IE8_DOM_DEFINE) try {
  2720. return $getOwnPropertyDescriptor(O, P);
  2721. } catch (error) { /* empty */ }
  2722. if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
  2723. };
  2724. /***/ }),
  2725. /* 72 */
  2726. /***/ (function(module, exports) {
  2727. var $String = String;
  2728. module.exports = function (argument) {
  2729. try {
  2730. return $String(argument);
  2731. } catch (error) {
  2732. return 'Object';
  2733. }
  2734. };
  2735. /***/ }),
  2736. /* 73 */
  2737. /***/ (function(module, exports, __webpack_require__) {
  2738. var IS_PURE = __webpack_require__(32);
  2739. var store = __webpack_require__(117);
  2740. (module.exports = function (key, value) {
  2741. return store[key] || (store[key] = value !== undefined ? value : {});
  2742. })('versions', []).push({
  2743. version: '3.23.3',
  2744. mode: IS_PURE ? 'pure' : 'global',
  2745. copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
  2746. license: 'https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE',
  2747. source: 'https://github.com/zloirock/core-js'
  2748. });
  2749. /***/ }),
  2750. /* 74 */
  2751. /***/ (function(module, exports) {
  2752. module.exports = {};
  2753. /***/ }),
  2754. /* 75 */
  2755. /***/ (function(module, exports, __webpack_require__) {
  2756. var classof = __webpack_require__(59);
  2757. var $String = String;
  2758. module.exports = function (argument) {
  2759. if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
  2760. return $String(argument);
  2761. };
  2762. /***/ }),
  2763. /* 76 */
  2764. /***/ (function(module, exports) {
  2765. module.exports = function (exec) {
  2766. try {
  2767. return { error: false, value: exec() };
  2768. } catch (error) {
  2769. return { error: true, value: error };
  2770. }
  2771. };
  2772. /***/ }),
  2773. /* 77 */
  2774. /***/ (function(module, exports, __webpack_require__) {
  2775. var global = __webpack_require__(6);
  2776. var NativePromiseConstructor = __webpack_require__(61);
  2777. var isCallable = __webpack_require__(7);
  2778. var isForced = __webpack_require__(149);
  2779. var inspectSource = __webpack_require__(123);
  2780. var wellKnownSymbol = __webpack_require__(9);
  2781. var IS_BROWSER = __webpack_require__(279);
  2782. var IS_PURE = __webpack_require__(32);
  2783. var V8_VERSION = __webpack_require__(90);
  2784. var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
  2785. var SPECIES = wellKnownSymbol('species');
  2786. var SUBCLASSING = false;
  2787. var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);
  2788. var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {
  2789. var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
  2790. var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
  2791. // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
  2792. // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
  2793. // We can't detect it synchronously, so just check versions
  2794. if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
  2795. // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution
  2796. if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;
  2797. // We can't use @@species feature detection in V8 since it causes
  2798. // deoptimization and performance degradation
  2799. // https://github.com/zloirock/core-js/issues/679
  2800. if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
  2801. // Detect correctness of subclassing with @@species support
  2802. var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });
  2803. var FakePromise = function (exec) {
  2804. exec(function () { /* empty */ }, function () { /* empty */ });
  2805. };
  2806. var constructor = promise.constructor = {};
  2807. constructor[SPECIES] = FakePromise;
  2808. SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
  2809. if (!SUBCLASSING) return true;
  2810. // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  2811. return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT;
  2812. });
  2813. module.exports = {
  2814. CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
  2815. REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
  2816. SUBCLASSING: SUBCLASSING
  2817. };
  2818. /***/ }),
  2819. /* 78 */
  2820. /***/ (function(module, exports, __webpack_require__) {
  2821. "use strict";
  2822. var charAt = __webpack_require__(288).charAt;
  2823. var toString = __webpack_require__(75);
  2824. var InternalStateModule = __webpack_require__(38);
  2825. var defineIterator = __webpack_require__(124);
  2826. var STRING_ITERATOR = 'String Iterator';
  2827. var setInternalState = InternalStateModule.set;
  2828. var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
  2829. // `String.prototype[@@iterator]` method
  2830. // https://tc39.es/ecma262/#sec-string.prototype-@@iterator
  2831. defineIterator(String, 'String', function (iterated) {
  2832. setInternalState(this, {
  2833. type: STRING_ITERATOR,
  2834. string: toString(iterated),
  2835. index: 0
  2836. });
  2837. // `%StringIteratorPrototype%.next` method
  2838. // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
  2839. }, function next() {
  2840. var state = getInternalState(this);
  2841. var string = state.string;
  2842. var index = state.index;
  2843. var point;
  2844. if (index >= string.length) return { value: undefined, done: true };
  2845. point = charAt(string, index);
  2846. state.index += point.length;
  2847. return { value: point, done: false };
  2848. });
  2849. /***/ }),
  2850. /* 79 */
  2851. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2852. "use strict";
  2853. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasStringTagBug; });
  2854. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isIE11; });
  2855. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
  2856. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__ = __webpack_require__(296);
  2857. // In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`.
  2858. // In IE 11, the most common among them, this problem also applies to
  2859. // `Map`, `WeakMap` and `Set`.
  2860. var hasStringTagBug = (
  2861. __WEBPACK_IMPORTED_MODULE_0__setup_js__["s" /* supportsDataView */] && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" /* default */])(new DataView(new ArrayBuffer(8)))
  2862. ),
  2863. isIE11 = (typeof Map !== 'undefined' && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" /* default */])(new Map));
  2864. /***/ }),
  2865. /* 80 */
  2866. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2867. "use strict";
  2868. /* harmony export (immutable) */ __webpack_exports__["a"] = allKeys;
  2869. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
  2870. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
  2871. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__ = __webpack_require__(180);
  2872. // Retrieve all the enumerable property names of an object.
  2873. function allKeys(obj) {
  2874. if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return [];
  2875. var keys = [];
  2876. for (var key in obj) keys.push(key);
  2877. // Ahem, IE < 9.
  2878. if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__["a" /* default */])(obj, keys);
  2879. return keys;
  2880. }
  2881. /***/ }),
  2882. /* 81 */
  2883. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2884. "use strict";
  2885. /* harmony export (immutable) */ __webpack_exports__["a"] = toPath;
  2886. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
  2887. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(189);
  2888. // Internal wrapper for `_.toPath` to enable minification.
  2889. // Similar to `cb` for `_.iteratee`.
  2890. function toPath(path) {
  2891. return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].toPath(path);
  2892. }
  2893. /***/ }),
  2894. /* 82 */
  2895. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2896. "use strict";
  2897. /* harmony export (immutable) */ __webpack_exports__["a"] = optimizeCb;
  2898. // Internal function that returns an efficient (for current engines) version
  2899. // of the passed-in callback, to be repeatedly applied in other Underscore
  2900. // functions.
  2901. function optimizeCb(func, context, argCount) {
  2902. if (context === void 0) return func;
  2903. switch (argCount == null ? 3 : argCount) {
  2904. case 1: return function(value) {
  2905. return func.call(context, value);
  2906. };
  2907. // The 2-argument case is omitted because we’re not using it.
  2908. case 3: return function(value, index, collection) {
  2909. return func.call(context, value, index, collection);
  2910. };
  2911. case 4: return function(accumulator, value, index, collection) {
  2912. return func.call(context, accumulator, value, index, collection);
  2913. };
  2914. }
  2915. return function() {
  2916. return func.apply(context, arguments);
  2917. };
  2918. }
  2919. /***/ }),
  2920. /* 83 */
  2921. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2922. "use strict";
  2923. /* harmony export (immutable) */ __webpack_exports__["a"] = filter;
  2924. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
  2925. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
  2926. // Return all the elements that pass a truth test.
  2927. function filter(obj, predicate, context) {
  2928. var results = [];
  2929. predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
  2930. Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(obj, function(value, index, list) {
  2931. if (predicate(value, index, list)) results.push(value);
  2932. });
  2933. return results;
  2934. }
  2935. /***/ }),
  2936. /* 84 */
  2937. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2938. "use strict";
  2939. /* harmony export (immutable) */ __webpack_exports__["a"] = contains;
  2940. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
  2941. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(62);
  2942. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__indexOf_js__ = __webpack_require__(205);
  2943. // Determine if the array or object contains a given item (using `===`).
  2944. function contains(obj, item, fromIndex, guard) {
  2945. if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
  2946. if (typeof fromIndex != 'number' || guard) fromIndex = 0;
  2947. return Object(__WEBPACK_IMPORTED_MODULE_2__indexOf_js__["a" /* default */])(obj, item, fromIndex) >= 0;
  2948. }
  2949. /***/ }),
  2950. /* 85 */
  2951. /***/ (function(module, exports, __webpack_require__) {
  2952. var classof = __webpack_require__(56);
  2953. // `IsArray` abstract operation
  2954. // https://tc39.es/ecma262/#sec-isarray
  2955. // eslint-disable-next-line es-x/no-array-isarray -- safe
  2956. module.exports = Array.isArray || function isArray(argument) {
  2957. return classof(argument) == 'Array';
  2958. };
  2959. /***/ }),
  2960. /* 86 */
  2961. /***/ (function(module, exports, __webpack_require__) {
  2962. module.exports = __webpack_require__(376);
  2963. /***/ }),
  2964. /* 87 */
  2965. /***/ (function(module, exports, __webpack_require__) {
  2966. module.exports = __webpack_require__(229);
  2967. /***/ }),
  2968. /* 88 */
  2969. /***/ (function(module, exports, __webpack_require__) {
  2970. var toPrimitive = __webpack_require__(256);
  2971. var isSymbol = __webpack_require__(89);
  2972. // `ToPropertyKey` abstract operation
  2973. // https://tc39.es/ecma262/#sec-topropertykey
  2974. module.exports = function (argument) {
  2975. var key = toPrimitive(argument, 'string');
  2976. return isSymbol(key) ? key : key + '';
  2977. };
  2978. /***/ }),
  2979. /* 89 */
  2980. /***/ (function(module, exports, __webpack_require__) {
  2981. var getBuiltIn = __webpack_require__(18);
  2982. var isCallable = __webpack_require__(7);
  2983. var isPrototypeOf = __webpack_require__(21);
  2984. var USE_SYMBOL_AS_UID = __webpack_require__(147);
  2985. var $Object = Object;
  2986. module.exports = USE_SYMBOL_AS_UID ? function (it) {
  2987. return typeof it == 'symbol';
  2988. } : function (it) {
  2989. var $Symbol = getBuiltIn('Symbol');
  2990. return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
  2991. };
  2992. /***/ }),
  2993. /* 90 */
  2994. /***/ (function(module, exports, __webpack_require__) {
  2995. var global = __webpack_require__(6);
  2996. var userAgent = __webpack_require__(91);
  2997. var process = global.process;
  2998. var Deno = global.Deno;
  2999. var versions = process && process.versions || Deno && Deno.version;
  3000. var v8 = versions && versions.v8;
  3001. var match, version;
  3002. if (v8) {
  3003. match = v8.split('.');
  3004. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  3005. // but their correct versions are not interesting for us
  3006. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  3007. }
  3008. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  3009. // so check `userAgent` even if `.v8` exists, but 0
  3010. if (!version && userAgent) {
  3011. match = userAgent.match(/Edge\/(\d+)/);
  3012. if (!match || match[1] >= 74) {
  3013. match = userAgent.match(/Chrome\/(\d+)/);
  3014. if (match) version = +match[1];
  3015. }
  3016. }
  3017. module.exports = version;
  3018. /***/ }),
  3019. /* 91 */
  3020. /***/ (function(module, exports, __webpack_require__) {
  3021. var getBuiltIn = __webpack_require__(18);
  3022. module.exports = getBuiltIn('navigator', 'userAgent') || '';
  3023. /***/ }),
  3024. /* 92 */
  3025. /***/ (function(module, exports, __webpack_require__) {
  3026. var uncurryThis = __webpack_require__(4);
  3027. var id = 0;
  3028. var postfix = Math.random();
  3029. var toString = uncurryThis(1.0.toString);
  3030. module.exports = function (key) {
  3031. return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
  3032. };
  3033. /***/ }),
  3034. /* 93 */
  3035. /***/ (function(module, exports, __webpack_require__) {
  3036. var hasOwn = __webpack_require__(14);
  3037. var isCallable = __webpack_require__(7);
  3038. var toObject = __webpack_require__(34);
  3039. var sharedKey = __webpack_require__(94);
  3040. var CORRECT_PROTOTYPE_GETTER = __webpack_require__(151);
  3041. var IE_PROTO = sharedKey('IE_PROTO');
  3042. var $Object = Object;
  3043. var ObjectPrototype = $Object.prototype;
  3044. // `Object.getPrototypeOf` method
  3045. // https://tc39.es/ecma262/#sec-object.getprototypeof
  3046. // eslint-disable-next-line es-x/no-object-getprototypeof -- safe
  3047. module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
  3048. var object = toObject(O);
  3049. if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
  3050. var constructor = object.constructor;
  3051. if (isCallable(constructor) && object instanceof constructor) {
  3052. return constructor.prototype;
  3053. } return object instanceof $Object ? ObjectPrototype : null;
  3054. };
  3055. /***/ }),
  3056. /* 94 */
  3057. /***/ (function(module, exports, __webpack_require__) {
  3058. var shared = __webpack_require__(73);
  3059. var uid = __webpack_require__(92);
  3060. var keys = shared('keys');
  3061. module.exports = function (key) {
  3062. return keys[key] || (keys[key] = uid(key));
  3063. };
  3064. /***/ }),
  3065. /* 95 */
  3066. /***/ (function(module, exports, __webpack_require__) {
  3067. /* eslint-disable no-proto -- safe */
  3068. var uncurryThis = __webpack_require__(4);
  3069. var anObject = __webpack_require__(19);
  3070. var aPossiblePrototype = __webpack_require__(259);
  3071. // `Object.setPrototypeOf` method
  3072. // https://tc39.es/ecma262/#sec-object.setprototypeof
  3073. // Works with __proto__ only. Old v8 can't work with null proto objects.
  3074. // eslint-disable-next-line es-x/no-object-setprototypeof -- safe
  3075. module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
  3076. var CORRECT_SETTER = false;
  3077. var test = {};
  3078. var setter;
  3079. try {
  3080. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  3081. setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
  3082. setter(test, []);
  3083. CORRECT_SETTER = test instanceof Array;
  3084. } catch (error) { /* empty */ }
  3085. return function setPrototypeOf(O, proto) {
  3086. anObject(O);
  3087. aPossiblePrototype(proto);
  3088. if (CORRECT_SETTER) setter(O, proto);
  3089. else O.__proto__ = proto;
  3090. return O;
  3091. };
  3092. }() : undefined);
  3093. /***/ }),
  3094. /* 96 */
  3095. /***/ (function(module, exports, __webpack_require__) {
  3096. var internalObjectKeys = __webpack_require__(152);
  3097. var enumBugKeys = __webpack_require__(121);
  3098. var hiddenKeys = enumBugKeys.concat('length', 'prototype');
  3099. // `Object.getOwnPropertyNames` method
  3100. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  3101. // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
  3102. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  3103. return internalObjectKeys(O, hiddenKeys);
  3104. };
  3105. /***/ }),
  3106. /* 97 */
  3107. /***/ (function(module, exports) {
  3108. // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
  3109. exports.f = Object.getOwnPropertySymbols;
  3110. /***/ }),
  3111. /* 98 */
  3112. /***/ (function(module, exports, __webpack_require__) {
  3113. var internalObjectKeys = __webpack_require__(152);
  3114. var enumBugKeys = __webpack_require__(121);
  3115. // `Object.keys` method
  3116. // https://tc39.es/ecma262/#sec-object.keys
  3117. // eslint-disable-next-line es-x/no-object-keys -- safe
  3118. module.exports = Object.keys || function keys(O) {
  3119. return internalObjectKeys(O, enumBugKeys);
  3120. };
  3121. /***/ }),
  3122. /* 99 */
  3123. /***/ (function(module, exports, __webpack_require__) {
  3124. var classof = __webpack_require__(59);
  3125. var getMethod = __webpack_require__(116);
  3126. var Iterators = __webpack_require__(58);
  3127. var wellKnownSymbol = __webpack_require__(9);
  3128. var ITERATOR = wellKnownSymbol('iterator');
  3129. module.exports = function (it) {
  3130. if (it != undefined) return getMethod(it, ITERATOR)
  3131. || getMethod(it, '@@iterator')
  3132. || Iterators[classof(it)];
  3133. };
  3134. /***/ }),
  3135. /* 100 */
  3136. /***/ (function(module, exports, __webpack_require__) {
  3137. var isPrototypeOf = __webpack_require__(21);
  3138. var $TypeError = TypeError;
  3139. module.exports = function (it, Prototype) {
  3140. if (isPrototypeOf(Prototype, it)) return it;
  3141. throw $TypeError('Incorrect invocation');
  3142. };
  3143. /***/ }),
  3144. /* 101 */
  3145. /***/ (function(module, exports, __webpack_require__) {
  3146. var uncurryThis = __webpack_require__(4);
  3147. var fails = __webpack_require__(3);
  3148. var isCallable = __webpack_require__(7);
  3149. var classof = __webpack_require__(59);
  3150. var getBuiltIn = __webpack_require__(18);
  3151. var inspectSource = __webpack_require__(123);
  3152. var noop = function () { /* empty */ };
  3153. var empty = [];
  3154. var construct = getBuiltIn('Reflect', 'construct');
  3155. var constructorRegExp = /^\s*(?:class|function)\b/;
  3156. var exec = uncurryThis(constructorRegExp.exec);
  3157. var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
  3158. var isConstructorModern = function isConstructor(argument) {
  3159. if (!isCallable(argument)) return false;
  3160. try {
  3161. construct(noop, empty, argument);
  3162. return true;
  3163. } catch (error) {
  3164. return false;
  3165. }
  3166. };
  3167. var isConstructorLegacy = function isConstructor(argument) {
  3168. if (!isCallable(argument)) return false;
  3169. switch (classof(argument)) {
  3170. case 'AsyncFunction':
  3171. case 'GeneratorFunction':
  3172. case 'AsyncGeneratorFunction': return false;
  3173. }
  3174. try {
  3175. // we can't check .prototype since constructors produced by .bind haven't it
  3176. // `Function#toString` throws on some built-it function in some legacy engines
  3177. // (for example, `DOMQuad` and similar in FF41-)
  3178. return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
  3179. } catch (error) {
  3180. return true;
  3181. }
  3182. };
  3183. isConstructorLegacy.sham = true;
  3184. // `IsConstructor` abstract operation
  3185. // https://tc39.es/ecma262/#sec-isconstructor
  3186. module.exports = !construct || fails(function () {
  3187. var called;
  3188. return isConstructorModern(isConstructorModern.call)
  3189. || !isConstructorModern(Object)
  3190. || !isConstructorModern(function () { called = true; })
  3191. || called;
  3192. }) ? isConstructorLegacy : isConstructorModern;
  3193. /***/ }),
  3194. /* 102 */
  3195. /***/ (function(module, exports, __webpack_require__) {
  3196. var uncurryThis = __webpack_require__(4);
  3197. module.exports = uncurryThis([].slice);
  3198. /***/ }),
  3199. /* 103 */
  3200. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3201. "use strict";
  3202. /* harmony export (immutable) */ __webpack_exports__["a"] = matcher;
  3203. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__extendOwn_js__ = __webpack_require__(133);
  3204. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isMatch_js__ = __webpack_require__(181);
  3205. // Returns a predicate for checking whether an object has a given set of
  3206. // `key:value` pairs.
  3207. function matcher(attrs) {
  3208. attrs = Object(__WEBPACK_IMPORTED_MODULE_0__extendOwn_js__["a" /* default */])({}, attrs);
  3209. return function(obj) {
  3210. return Object(__WEBPACK_IMPORTED_MODULE_1__isMatch_js__["a" /* default */])(obj, attrs);
  3211. };
  3212. }
  3213. /***/ }),
  3214. /* 104 */
  3215. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3216. "use strict";
  3217. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
  3218. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__executeBound_js__ = __webpack_require__(197);
  3219. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(24);
  3220. // Partially apply a function by creating a version that has had some of its
  3221. // arguments pre-filled, without changing its dynamic `this` context. `_` acts
  3222. // as a placeholder by default, allowing any combination of arguments to be
  3223. // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.
  3224. var partial = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, boundArgs) {
  3225. var placeholder = partial.placeholder;
  3226. var bound = function() {
  3227. var position = 0, length = boundArgs.length;
  3228. var args = Array(length);
  3229. for (var i = 0; i < length; i++) {
  3230. args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
  3231. }
  3232. while (position < arguments.length) args.push(arguments[position++]);
  3233. return Object(__WEBPACK_IMPORTED_MODULE_1__executeBound_js__["a" /* default */])(func, bound, this, this, args);
  3234. };
  3235. return bound;
  3236. });
  3237. partial.placeholder = __WEBPACK_IMPORTED_MODULE_2__underscore_js__["a" /* default */];
  3238. /* harmony default export */ __webpack_exports__["a"] = (partial);
  3239. /***/ }),
  3240. /* 105 */
  3241. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3242. "use strict";
  3243. /* harmony export (immutable) */ __webpack_exports__["a"] = group;
  3244. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
  3245. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
  3246. // An internal function used for aggregate "group by" operations.
  3247. function group(behavior, partition) {
  3248. return function(obj, iteratee, context) {
  3249. var result = partition ? [[], []] : {};
  3250. iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
  3251. Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(obj, function(value, index) {
  3252. var key = iteratee(value, index, obj);
  3253. behavior(result, value, key);
  3254. });
  3255. return result;
  3256. };
  3257. }
  3258. /***/ }),
  3259. /* 106 */
  3260. /***/ (function(module, exports, __webpack_require__) {
  3261. "use strict";
  3262. var toPropertyKey = __webpack_require__(88);
  3263. var definePropertyModule = __webpack_require__(22);
  3264. var createPropertyDescriptor = __webpack_require__(44);
  3265. module.exports = function (object, key, value) {
  3266. var propertyKey = toPropertyKey(key);
  3267. if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
  3268. else object[propertyKey] = value;
  3269. };
  3270. /***/ }),
  3271. /* 107 */
  3272. /***/ (function(module, exports, __webpack_require__) {
  3273. var fails = __webpack_require__(3);
  3274. var wellKnownSymbol = __webpack_require__(9);
  3275. var V8_VERSION = __webpack_require__(90);
  3276. var SPECIES = wellKnownSymbol('species');
  3277. module.exports = function (METHOD_NAME) {
  3278. // We can't use this feature detection in V8 since it causes
  3279. // deoptimization and serious performance degradation
  3280. // https://github.com/zloirock/core-js/issues/677
  3281. return V8_VERSION >= 51 || !fails(function () {
  3282. var array = [];
  3283. var constructor = array.constructor = {};
  3284. constructor[SPECIES] = function () {
  3285. return { foo: 1 };
  3286. };
  3287. return array[METHOD_NAME](Boolean).foo !== 1;
  3288. });
  3289. };
  3290. /***/ }),
  3291. /* 108 */
  3292. /***/ (function(module, exports, __webpack_require__) {
  3293. "use strict";
  3294. var _interopRequireDefault = __webpack_require__(1);
  3295. var _typeof2 = _interopRequireDefault(__webpack_require__(109));
  3296. var _filter = _interopRequireDefault(__webpack_require__(437));
  3297. var _map = _interopRequireDefault(__webpack_require__(42));
  3298. var _keys = _interopRequireDefault(__webpack_require__(141));
  3299. var _stringify = _interopRequireDefault(__webpack_require__(36));
  3300. var _concat = _interopRequireDefault(__webpack_require__(30));
  3301. var _ = __webpack_require__(2);
  3302. var _require = __webpack_require__(442),
  3303. timeout = _require.timeout;
  3304. var debug = __webpack_require__(67);
  3305. var debugRequest = debug('leancloud:request');
  3306. var debugRequestError = debug('leancloud:request:error');
  3307. var _require2 = __webpack_require__(68),
  3308. getAdapter = _require2.getAdapter;
  3309. var requestsCount = 0;
  3310. var ajax = function ajax(_ref) {
  3311. var method = _ref.method,
  3312. url = _ref.url,
  3313. query = _ref.query,
  3314. data = _ref.data,
  3315. _ref$headers = _ref.headers,
  3316. headers = _ref$headers === void 0 ? {} : _ref$headers,
  3317. time = _ref.timeout,
  3318. onprogress = _ref.onprogress;
  3319. if (query) {
  3320. var _context, _context2, _context4;
  3321. var queryString = (0, _filter.default)(_context = (0, _map.default)(_context2 = (0, _keys.default)(query)).call(_context2, function (key) {
  3322. var _context3;
  3323. var value = query[key];
  3324. if (value === undefined) return undefined;
  3325. var v = (0, _typeof2.default)(value) === 'object' ? (0, _stringify.default)(value) : value;
  3326. return (0, _concat.default)(_context3 = "".concat(encodeURIComponent(key), "=")).call(_context3, encodeURIComponent(v));
  3327. })).call(_context, function (qs) {
  3328. return qs;
  3329. }).join('&');
  3330. url = (0, _concat.default)(_context4 = "".concat(url, "?")).call(_context4, queryString);
  3331. }
  3332. var count = requestsCount++;
  3333. debugRequest('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
  3334. var request = getAdapter('request');
  3335. var promise = request(url, {
  3336. method: method,
  3337. headers: headers,
  3338. data: data,
  3339. onprogress: onprogress
  3340. }).then(function (response) {
  3341. debugRequest('response(%d) %d %O %o', count, response.status, response.data || response.text, response.header);
  3342. if (response.ok === false) {
  3343. var error = new Error();
  3344. error.response = response;
  3345. throw error;
  3346. }
  3347. return response.data;
  3348. }).catch(function (error) {
  3349. if (error.response) {
  3350. if (!debug.enabled('leancloud:request')) {
  3351. debugRequestError('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
  3352. }
  3353. debugRequestError('response(%d) %d %O %o', count, error.response.status, error.response.data || error.response.text, error.response.header);
  3354. error.statusCode = error.response.status;
  3355. error.responseText = error.response.text;
  3356. error.response = error.response.data;
  3357. }
  3358. throw error;
  3359. });
  3360. return time ? timeout(promise, time) : promise;
  3361. };
  3362. module.exports = ajax;
  3363. /***/ }),
  3364. /* 109 */
  3365. /***/ (function(module, exports, __webpack_require__) {
  3366. var _Symbol = __webpack_require__(231);
  3367. var _Symbol$iterator = __webpack_require__(432);
  3368. function _typeof(obj) {
  3369. "@babel/helpers - typeof";
  3370. return (module.exports = _typeof = "function" == typeof _Symbol && "symbol" == typeof _Symbol$iterator ? function (obj) {
  3371. return typeof obj;
  3372. } : function (obj) {
  3373. return obj && "function" == typeof _Symbol && obj.constructor === _Symbol && obj !== _Symbol.prototype ? "symbol" : typeof obj;
  3374. }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
  3375. }
  3376. module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
  3377. /***/ }),
  3378. /* 110 */
  3379. /***/ (function(module, exports, __webpack_require__) {
  3380. module.exports = __webpack_require__(447);
  3381. /***/ }),
  3382. /* 111 */
  3383. /***/ (function(module, exports, __webpack_require__) {
  3384. var $ = __webpack_require__(0);
  3385. var uncurryThis = __webpack_require__(4);
  3386. var hiddenKeys = __webpack_require__(74);
  3387. var isObject = __webpack_require__(11);
  3388. var hasOwn = __webpack_require__(14);
  3389. var defineProperty = __webpack_require__(22).f;
  3390. var getOwnPropertyNamesModule = __webpack_require__(96);
  3391. var getOwnPropertyNamesExternalModule = __webpack_require__(234);
  3392. var isExtensible = __webpack_require__(247);
  3393. var uid = __webpack_require__(92);
  3394. var FREEZING = __webpack_require__(562);
  3395. var REQUIRED = false;
  3396. var METADATA = uid('meta');
  3397. var id = 0;
  3398. var setMetadata = function (it) {
  3399. defineProperty(it, METADATA, { value: {
  3400. objectID: 'O' + id++, // object ID
  3401. weakData: {} // weak collections IDs
  3402. } });
  3403. };
  3404. var fastKey = function (it, create) {
  3405. // return a primitive with prefix
  3406. if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  3407. if (!hasOwn(it, METADATA)) {
  3408. // can't set metadata to uncaught frozen object
  3409. if (!isExtensible(it)) return 'F';
  3410. // not necessary to add metadata
  3411. if (!create) return 'E';
  3412. // add missing metadata
  3413. setMetadata(it);
  3414. // return object ID
  3415. } return it[METADATA].objectID;
  3416. };
  3417. var getWeakData = function (it, create) {
  3418. if (!hasOwn(it, METADATA)) {
  3419. // can't set metadata to uncaught frozen object
  3420. if (!isExtensible(it)) return true;
  3421. // not necessary to add metadata
  3422. if (!create) return false;
  3423. // add missing metadata
  3424. setMetadata(it);
  3425. // return the store of weak collections IDs
  3426. } return it[METADATA].weakData;
  3427. };
  3428. // add metadata on freeze-family methods calling
  3429. var onFreeze = function (it) {
  3430. if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it);
  3431. return it;
  3432. };
  3433. var enable = function () {
  3434. meta.enable = function () { /* empty */ };
  3435. REQUIRED = true;
  3436. var getOwnPropertyNames = getOwnPropertyNamesModule.f;
  3437. var splice = uncurryThis([].splice);
  3438. var test = {};
  3439. test[METADATA] = 1;
  3440. // prevent exposing of metadata key
  3441. if (getOwnPropertyNames(test).length) {
  3442. getOwnPropertyNamesModule.f = function (it) {
  3443. var result = getOwnPropertyNames(it);
  3444. for (var i = 0, length = result.length; i < length; i++) {
  3445. if (result[i] === METADATA) {
  3446. splice(result, i, 1);
  3447. break;
  3448. }
  3449. } return result;
  3450. };
  3451. $({ target: 'Object', stat: true, forced: true }, {
  3452. getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
  3453. });
  3454. }
  3455. };
  3456. var meta = module.exports = {
  3457. enable: enable,
  3458. fastKey: fastKey,
  3459. getWeakData: getWeakData,
  3460. onFreeze: onFreeze
  3461. };
  3462. hiddenKeys[METADATA] = true;
  3463. /***/ }),
  3464. /* 112 */
  3465. /***/ (function(module, exports) {
  3466. var g;
  3467. // This works in non-strict mode
  3468. g = (function() {
  3469. return this;
  3470. })();
  3471. try {
  3472. // This works if eval is allowed (see CSP)
  3473. g = g || Function("return this")() || (1,eval)("this");
  3474. } catch(e) {
  3475. // This works if the window reference is available
  3476. if(typeof window === "object")
  3477. g = window;
  3478. }
  3479. // g can still be undefined, but nothing to do about it...
  3480. // We return undefined, instead of nothing here, so it's
  3481. // easier to handle this case. if(!global) { ...}
  3482. module.exports = g;
  3483. /***/ }),
  3484. /* 113 */
  3485. /***/ (function(module, exports, __webpack_require__) {
  3486. "use strict";
  3487. var $propertyIsEnumerable = {}.propertyIsEnumerable;
  3488. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  3489. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  3490. // Nashorn ~ JDK8 bug
  3491. var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
  3492. // `Object.prototype.propertyIsEnumerable` method implementation
  3493. // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
  3494. exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
  3495. var descriptor = getOwnPropertyDescriptor(this, V);
  3496. return !!descriptor && descriptor.enumerable;
  3497. } : $propertyIsEnumerable;
  3498. /***/ }),
  3499. /* 114 */
  3500. /***/ (function(module, exports, __webpack_require__) {
  3501. var uncurryThis = __webpack_require__(4);
  3502. var fails = __webpack_require__(3);
  3503. var classof = __webpack_require__(56);
  3504. var $Object = Object;
  3505. var split = uncurryThis(''.split);
  3506. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  3507. module.exports = fails(function () {
  3508. // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
  3509. // eslint-disable-next-line no-prototype-builtins -- safe
  3510. return !$Object('z').propertyIsEnumerable(0);
  3511. }) ? function (it) {
  3512. return classof(it) == 'String' ? split(it, '') : $Object(it);
  3513. } : $Object;
  3514. /***/ }),
  3515. /* 115 */
  3516. /***/ (function(module, exports) {
  3517. var $TypeError = TypeError;
  3518. // `RequireObjectCoercible` abstract operation
  3519. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  3520. module.exports = function (it) {
  3521. if (it == undefined) throw $TypeError("Can't call method on " + it);
  3522. return it;
  3523. };
  3524. /***/ }),
  3525. /* 116 */
  3526. /***/ (function(module, exports, __webpack_require__) {
  3527. var aCallable = __webpack_require__(31);
  3528. // `GetMethod` abstract operation
  3529. // https://tc39.es/ecma262/#sec-getmethod
  3530. module.exports = function (V, P) {
  3531. var func = V[P];
  3532. return func == null ? undefined : aCallable(func);
  3533. };
  3534. /***/ }),
  3535. /* 117 */
  3536. /***/ (function(module, exports, __webpack_require__) {
  3537. var global = __webpack_require__(6);
  3538. var defineGlobalProperty = __webpack_require__(258);
  3539. var SHARED = '__core-js_shared__';
  3540. var store = global[SHARED] || defineGlobalProperty(SHARED, {});
  3541. module.exports = store;
  3542. /***/ }),
  3543. /* 118 */
  3544. /***/ (function(module, exports, __webpack_require__) {
  3545. var global = __webpack_require__(6);
  3546. var isObject = __webpack_require__(11);
  3547. var document = global.document;
  3548. // typeof document.createElement is 'object' in old IE
  3549. var EXISTS = isObject(document) && isObject(document.createElement);
  3550. module.exports = function (it) {
  3551. return EXISTS ? document.createElement(it) : {};
  3552. };
  3553. /***/ }),
  3554. /* 119 */
  3555. /***/ (function(module, exports, __webpack_require__) {
  3556. var toIntegerOrInfinity = __webpack_require__(120);
  3557. var max = Math.max;
  3558. var min = Math.min;
  3559. // Helper for a popular repeating case of the spec:
  3560. // Let integer be ? ToInteger(index).
  3561. // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
  3562. module.exports = function (index, length) {
  3563. var integer = toIntegerOrInfinity(index);
  3564. return integer < 0 ? max(integer + length, 0) : min(integer, length);
  3565. };
  3566. /***/ }),
  3567. /* 120 */
  3568. /***/ (function(module, exports, __webpack_require__) {
  3569. var trunc = __webpack_require__(262);
  3570. // `ToIntegerOrInfinity` abstract operation
  3571. // https://tc39.es/ecma262/#sec-tointegerorinfinity
  3572. module.exports = function (argument) {
  3573. var number = +argument;
  3574. // eslint-disable-next-line no-self-compare -- NaN check
  3575. return number !== number || number === 0 ? 0 : trunc(number);
  3576. };
  3577. /***/ }),
  3578. /* 121 */
  3579. /***/ (function(module, exports) {
  3580. // IE8- don't enum bug keys
  3581. module.exports = [
  3582. 'constructor',
  3583. 'hasOwnProperty',
  3584. 'isPrototypeOf',
  3585. 'propertyIsEnumerable',
  3586. 'toLocaleString',
  3587. 'toString',
  3588. 'valueOf'
  3589. ];
  3590. /***/ }),
  3591. /* 122 */
  3592. /***/ (function(module, exports, __webpack_require__) {
  3593. var wellKnownSymbol = __webpack_require__(9);
  3594. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  3595. var test = {};
  3596. test[TO_STRING_TAG] = 'z';
  3597. module.exports = String(test) === '[object z]';
  3598. /***/ }),
  3599. /* 123 */
  3600. /***/ (function(module, exports, __webpack_require__) {
  3601. var uncurryThis = __webpack_require__(4);
  3602. var isCallable = __webpack_require__(7);
  3603. var store = __webpack_require__(117);
  3604. var functionToString = uncurryThis(Function.toString);
  3605. // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
  3606. if (!isCallable(store.inspectSource)) {
  3607. store.inspectSource = function (it) {
  3608. return functionToString(it);
  3609. };
  3610. }
  3611. module.exports = store.inspectSource;
  3612. /***/ }),
  3613. /* 124 */
  3614. /***/ (function(module, exports, __webpack_require__) {
  3615. "use strict";
  3616. var $ = __webpack_require__(0);
  3617. var call = __webpack_require__(13);
  3618. var IS_PURE = __webpack_require__(32);
  3619. var FunctionName = __webpack_require__(268);
  3620. var isCallable = __webpack_require__(7);
  3621. var createIteratorConstructor = __webpack_require__(269);
  3622. var getPrototypeOf = __webpack_require__(93);
  3623. var setPrototypeOf = __webpack_require__(95);
  3624. var setToStringTag = __webpack_require__(49);
  3625. var createNonEnumerableProperty = __webpack_require__(35);
  3626. var defineBuiltIn = __webpack_require__(39);
  3627. var wellKnownSymbol = __webpack_require__(9);
  3628. var Iterators = __webpack_require__(58);
  3629. var IteratorsCore = __webpack_require__(161);
  3630. var PROPER_FUNCTION_NAME = FunctionName.PROPER;
  3631. var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
  3632. var IteratorPrototype = IteratorsCore.IteratorPrototype;
  3633. var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
  3634. var ITERATOR = wellKnownSymbol('iterator');
  3635. var KEYS = 'keys';
  3636. var VALUES = 'values';
  3637. var ENTRIES = 'entries';
  3638. var returnThis = function () { return this; };
  3639. module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
  3640. createIteratorConstructor(IteratorConstructor, NAME, next);
  3641. var getIterationMethod = function (KIND) {
  3642. if (KIND === DEFAULT && defaultIterator) return defaultIterator;
  3643. if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
  3644. switch (KIND) {
  3645. case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
  3646. case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
  3647. case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
  3648. } return function () { return new IteratorConstructor(this); };
  3649. };
  3650. var TO_STRING_TAG = NAME + ' Iterator';
  3651. var INCORRECT_VALUES_NAME = false;
  3652. var IterablePrototype = Iterable.prototype;
  3653. var nativeIterator = IterablePrototype[ITERATOR]
  3654. || IterablePrototype['@@iterator']
  3655. || DEFAULT && IterablePrototype[DEFAULT];
  3656. var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
  3657. var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
  3658. var CurrentIteratorPrototype, methods, KEY;
  3659. // fix native
  3660. if (anyNativeIterator) {
  3661. CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
  3662. if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
  3663. if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
  3664. if (setPrototypeOf) {
  3665. setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
  3666. } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
  3667. defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
  3668. }
  3669. }
  3670. // Set @@toStringTag to native iterators
  3671. setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
  3672. if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
  3673. }
  3674. }
  3675. // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
  3676. if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
  3677. if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
  3678. createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
  3679. } else {
  3680. INCORRECT_VALUES_NAME = true;
  3681. defaultIterator = function values() { return call(nativeIterator, this); };
  3682. }
  3683. }
  3684. // export additional methods
  3685. if (DEFAULT) {
  3686. methods = {
  3687. values: getIterationMethod(VALUES),
  3688. keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
  3689. entries: getIterationMethod(ENTRIES)
  3690. };
  3691. if (FORCED) for (KEY in methods) {
  3692. if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
  3693. defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
  3694. }
  3695. } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
  3696. }
  3697. // define iterator
  3698. if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
  3699. defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
  3700. }
  3701. Iterators[NAME] = defaultIterator;
  3702. return methods;
  3703. };
  3704. /***/ }),
  3705. /* 125 */
  3706. /***/ (function(module, exports, __webpack_require__) {
  3707. var classof = __webpack_require__(56);
  3708. var global = __webpack_require__(6);
  3709. module.exports = classof(global.process) == 'process';
  3710. /***/ }),
  3711. /* 126 */
  3712. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3713. "use strict";
  3714. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  3715. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
  3716. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_0__setup_js__["e"]; });
  3717. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__restArguments_js__ = __webpack_require__(23);
  3718. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__restArguments_js__["a"]; });
  3719. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(52);
  3720. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_2__isObject_js__["a"]; });
  3721. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isNull_js__ = __webpack_require__(291);
  3722. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_3__isNull_js__["a"]; });
  3723. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__ = __webpack_require__(170);
  3724. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__["a"]; });
  3725. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__ = __webpack_require__(171);
  3726. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__["a"]; });
  3727. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isElement_js__ = __webpack_require__(292);
  3728. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_6__isElement_js__["a"]; });
  3729. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__isString_js__ = __webpack_require__(127);
  3730. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_7__isString_js__["a"]; });
  3731. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__isNumber_js__ = __webpack_require__(172);
  3732. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_8__isNumber_js__["a"]; });
  3733. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__isDate_js__ = __webpack_require__(293);
  3734. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_9__isDate_js__["a"]; });
  3735. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__ = __webpack_require__(294);
  3736. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__["a"]; });
  3737. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__isError_js__ = __webpack_require__(295);
  3738. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_11__isError_js__["a"]; });
  3739. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__ = __webpack_require__(173);
  3740. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__["a"]; });
  3741. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__ = __webpack_require__(174);
  3742. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__["a"]; });
  3743. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__isDataView_js__ = __webpack_require__(128);
  3744. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_14__isDataView_js__["a"]; });
  3745. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__isArray_js__ = __webpack_require__(53);
  3746. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_15__isArray_js__["a"]; });
  3747. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__isFunction_js__ = __webpack_require__(27);
  3748. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_16__isFunction_js__["a"]; });
  3749. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__isArguments_js__ = __webpack_require__(129);
  3750. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_17__isArguments_js__["a"]; });
  3751. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__isFinite_js__ = __webpack_require__(297);
  3752. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_18__isFinite_js__["a"]; });
  3753. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__isNaN_js__ = __webpack_require__(175);
  3754. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_19__isNaN_js__["a"]; });
  3755. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__ = __webpack_require__(176);
  3756. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__["a"]; });
  3757. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__ = __webpack_require__(299);
  3758. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__["a"]; });
  3759. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__isMatch_js__ = __webpack_require__(181);
  3760. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_22__isMatch_js__["a"]; });
  3761. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__isEqual_js__ = __webpack_require__(300);
  3762. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_23__isEqual_js__["a"]; });
  3763. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__isMap_js__ = __webpack_require__(302);
  3764. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_24__isMap_js__["a"]; });
  3765. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__ = __webpack_require__(303);
  3766. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__["a"]; });
  3767. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__isSet_js__ = __webpack_require__(304);
  3768. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_26__isSet_js__["a"]; });
  3769. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__ = __webpack_require__(305);
  3770. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__["a"]; });
  3771. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__keys_js__ = __webpack_require__(15);
  3772. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_28__keys_js__["a"]; });
  3773. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__allKeys_js__ = __webpack_require__(80);
  3774. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_29__allKeys_js__["a"]; });
  3775. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__values_js__ = __webpack_require__(62);
  3776. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_30__values_js__["a"]; });
  3777. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__pairs_js__ = __webpack_require__(306);
  3778. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_31__pairs_js__["a"]; });
  3779. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__invert_js__ = __webpack_require__(182);
  3780. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_32__invert_js__["a"]; });
  3781. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__functions_js__ = __webpack_require__(183);
  3782. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
  3783. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
  3784. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__extend_js__ = __webpack_require__(184);
  3785. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_34__extend_js__["a"]; });
  3786. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__ = __webpack_require__(133);
  3787. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
  3788. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
  3789. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__defaults_js__ = __webpack_require__(185);
  3790. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_36__defaults_js__["a"]; });
  3791. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__create_js__ = __webpack_require__(307);
  3792. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_37__create_js__["a"]; });
  3793. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__clone_js__ = __webpack_require__(187);
  3794. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_38__clone_js__["a"]; });
  3795. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__tap_js__ = __webpack_require__(308);
  3796. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_39__tap_js__["a"]; });
  3797. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__get_js__ = __webpack_require__(188);
  3798. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_40__get_js__["a"]; });
  3799. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__has_js__ = __webpack_require__(309);
  3800. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_41__has_js__["a"]; });
  3801. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__mapObject_js__ = __webpack_require__(310);
  3802. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_42__mapObject_js__["a"]; });
  3803. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__identity_js__ = __webpack_require__(135);
  3804. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_43__identity_js__["a"]; });
  3805. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__constant_js__ = __webpack_require__(177);
  3806. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_44__constant_js__["a"]; });
  3807. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__noop_js__ = __webpack_require__(192);
  3808. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_45__noop_js__["a"]; });
  3809. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__toPath_js__ = __webpack_require__(189);
  3810. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_46__toPath_js__["a"]; });
  3811. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__property_js__ = __webpack_require__(136);
  3812. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_47__property_js__["a"]; });
  3813. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__ = __webpack_require__(311);
  3814. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__["a"]; });
  3815. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__matcher_js__ = __webpack_require__(103);
  3816. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
  3817. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
  3818. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__times_js__ = __webpack_require__(312);
  3819. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_50__times_js__["a"]; });
  3820. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__random_js__ = __webpack_require__(193);
  3821. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_51__random_js__["a"]; });
  3822. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__now_js__ = __webpack_require__(137);
  3823. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_52__now_js__["a"]; });
  3824. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__escape_js__ = __webpack_require__(313);
  3825. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_53__escape_js__["a"]; });
  3826. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__unescape_js__ = __webpack_require__(314);
  3827. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_54__unescape_js__["a"]; });
  3828. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__ = __webpack_require__(196);
  3829. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__["a"]; });
  3830. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__template_js__ = __webpack_require__(316);
  3831. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_56__template_js__["a"]; });
  3832. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__result_js__ = __webpack_require__(317);
  3833. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_57__result_js__["a"]; });
  3834. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__ = __webpack_require__(318);
  3835. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__["a"]; });
  3836. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__chain_js__ = __webpack_require__(319);
  3837. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_59__chain_js__["a"]; });
  3838. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__iteratee_js__ = __webpack_require__(191);
  3839. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_60__iteratee_js__["a"]; });
  3840. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__partial_js__ = __webpack_require__(104);
  3841. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_61__partial_js__["a"]; });
  3842. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__bind_js__ = __webpack_require__(198);
  3843. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_62__bind_js__["a"]; });
  3844. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__bindAll_js__ = __webpack_require__(320);
  3845. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_63__bindAll_js__["a"]; });
  3846. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__memoize_js__ = __webpack_require__(321);
  3847. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_64__memoize_js__["a"]; });
  3848. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__delay_js__ = __webpack_require__(199);
  3849. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_65__delay_js__["a"]; });
  3850. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__defer_js__ = __webpack_require__(322);
  3851. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_66__defer_js__["a"]; });
  3852. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__throttle_js__ = __webpack_require__(323);
  3853. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_67__throttle_js__["a"]; });
  3854. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__debounce_js__ = __webpack_require__(324);
  3855. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_68__debounce_js__["a"]; });
  3856. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__wrap_js__ = __webpack_require__(325);
  3857. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_69__wrap_js__["a"]; });
  3858. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__negate_js__ = __webpack_require__(138);
  3859. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_70__negate_js__["a"]; });
  3860. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__compose_js__ = __webpack_require__(326);
  3861. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_71__compose_js__["a"]; });
  3862. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__after_js__ = __webpack_require__(327);
  3863. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_72__after_js__["a"]; });
  3864. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__before_js__ = __webpack_require__(200);
  3865. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_73__before_js__["a"]; });
  3866. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__once_js__ = __webpack_require__(328);
  3867. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_74__once_js__["a"]; });
  3868. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__findKey_js__ = __webpack_require__(201);
  3869. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_75__findKey_js__["a"]; });
  3870. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__findIndex_js__ = __webpack_require__(139);
  3871. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_76__findIndex_js__["a"]; });
  3872. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__ = __webpack_require__(203);
  3873. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__["a"]; });
  3874. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__ = __webpack_require__(204);
  3875. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__["a"]; });
  3876. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__indexOf_js__ = __webpack_require__(205);
  3877. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_79__indexOf_js__["a"]; });
  3878. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__ = __webpack_require__(329);
  3879. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__["a"]; });
  3880. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__find_js__ = __webpack_require__(207);
  3881. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
  3882. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
  3883. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__findWhere_js__ = __webpack_require__(330);
  3884. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_82__findWhere_js__["a"]; });
  3885. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__each_js__ = __webpack_require__(54);
  3886. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
  3887. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
  3888. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__map_js__ = __webpack_require__(64);
  3889. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
  3890. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
  3891. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__reduce_js__ = __webpack_require__(331);
  3892. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
  3893. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
  3894. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
  3895. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__ = __webpack_require__(332);
  3896. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
  3897. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
  3898. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__filter_js__ = __webpack_require__(83);
  3899. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
  3900. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
  3901. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__reject_js__ = __webpack_require__(333);
  3902. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_88__reject_js__["a"]; });
  3903. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__every_js__ = __webpack_require__(334);
  3904. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
  3905. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
  3906. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__some_js__ = __webpack_require__(335);
  3907. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
  3908. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
  3909. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__contains_js__ = __webpack_require__(84);
  3910. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
  3911. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
  3912. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
  3913. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__invoke_js__ = __webpack_require__(336);
  3914. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_92__invoke_js__["a"]; });
  3915. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__pluck_js__ = __webpack_require__(140);
  3916. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_93__pluck_js__["a"]; });
  3917. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__where_js__ = __webpack_require__(337);
  3918. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_94__where_js__["a"]; });
  3919. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__max_js__ = __webpack_require__(209);
  3920. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_95__max_js__["a"]; });
  3921. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__min_js__ = __webpack_require__(338);
  3922. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_96__min_js__["a"]; });
  3923. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__shuffle_js__ = __webpack_require__(339);
  3924. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_97__shuffle_js__["a"]; });
  3925. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__sample_js__ = __webpack_require__(210);
  3926. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_98__sample_js__["a"]; });
  3927. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__sortBy_js__ = __webpack_require__(340);
  3928. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_99__sortBy_js__["a"]; });
  3929. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__groupBy_js__ = __webpack_require__(341);
  3930. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_100__groupBy_js__["a"]; });
  3931. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__indexBy_js__ = __webpack_require__(342);
  3932. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_101__indexBy_js__["a"]; });
  3933. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__countBy_js__ = __webpack_require__(343);
  3934. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_102__countBy_js__["a"]; });
  3935. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_103__partition_js__ = __webpack_require__(344);
  3936. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_103__partition_js__["a"]; });
  3937. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_104__toArray_js__ = __webpack_require__(345);
  3938. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_104__toArray_js__["a"]; });
  3939. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_105__size_js__ = __webpack_require__(346);
  3940. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_105__size_js__["a"]; });
  3941. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_106__pick_js__ = __webpack_require__(211);
  3942. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_106__pick_js__["a"]; });
  3943. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_107__omit_js__ = __webpack_require__(348);
  3944. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_107__omit_js__["a"]; });
  3945. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_108__first_js__ = __webpack_require__(349);
  3946. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
  3947. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
  3948. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
  3949. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_109__initial_js__ = __webpack_require__(212);
  3950. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_109__initial_js__["a"]; });
  3951. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_110__last_js__ = __webpack_require__(350);
  3952. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_110__last_js__["a"]; });
  3953. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_111__rest_js__ = __webpack_require__(213);
  3954. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
  3955. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
  3956. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
  3957. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_112__compact_js__ = __webpack_require__(351);
  3958. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_112__compact_js__["a"]; });
  3959. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_113__flatten_js__ = __webpack_require__(352);
  3960. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_113__flatten_js__["a"]; });
  3961. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_114__without_js__ = __webpack_require__(353);
  3962. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_114__without_js__["a"]; });
  3963. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_115__uniq_js__ = __webpack_require__(215);
  3964. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
  3965. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
  3966. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_116__union_js__ = __webpack_require__(354);
  3967. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_116__union_js__["a"]; });
  3968. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_117__intersection_js__ = __webpack_require__(355);
  3969. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_117__intersection_js__["a"]; });
  3970. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_118__difference_js__ = __webpack_require__(214);
  3971. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_118__difference_js__["a"]; });
  3972. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_119__unzip_js__ = __webpack_require__(216);
  3973. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
  3974. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
  3975. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_120__zip_js__ = __webpack_require__(356);
  3976. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_120__zip_js__["a"]; });
  3977. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_121__object_js__ = __webpack_require__(357);
  3978. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_121__object_js__["a"]; });
  3979. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_122__range_js__ = __webpack_require__(358);
  3980. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_122__range_js__["a"]; });
  3981. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_123__chunk_js__ = __webpack_require__(359);
  3982. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_123__chunk_js__["a"]; });
  3983. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_124__mixin_js__ = __webpack_require__(360);
  3984. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_124__mixin_js__["a"]; });
  3985. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__ = __webpack_require__(361);
  3986. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__["a"]; });
  3987. // Named Exports
  3988. // =============
  3989. // Underscore.js 1.12.1
  3990. // https://underscorejs.org
  3991. // (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  3992. // Underscore may be freely distributed under the MIT license.
  3993. // Baseline setup.
  3994. // Object Functions
  3995. // ----------------
  3996. // Our most fundamental functions operate on any JavaScript object.
  3997. // Most functions in Underscore depend on at least one function in this section.
  3998. // A group of functions that check the types of core JavaScript values.
  3999. // These are often informally referred to as the "isType" functions.
  4000. // Functions that treat an object as a dictionary of key-value pairs.
  4001. // Utility Functions
  4002. // -----------------
  4003. // A bit of a grab bag: Predicate-generating functions for use with filters and
  4004. // loops, string escaping and templating, create random numbers and unique ids,
  4005. // and functions that facilitate Underscore's chaining and iteration conventions.
  4006. // Function (ahem) Functions
  4007. // -------------------------
  4008. // These functions take a function as an argument and return a new function
  4009. // as the result. Also known as higher-order functions.
  4010. // Finders
  4011. // -------
  4012. // Functions that extract (the position of) a single element from an object
  4013. // or array based on some criterion.
  4014. // Collection Functions
  4015. // --------------------
  4016. // Functions that work on any collection of elements: either an array, or
  4017. // an object of key-value pairs.
  4018. // `_.pick` and `_.omit` are actually object functions, but we put
  4019. // them here in order to create a more natural reading order in the
  4020. // monolithic build as they depend on `_.contains`.
  4021. // Array Functions
  4022. // ---------------
  4023. // Functions that operate on arrays (and array-likes) only, because they’re
  4024. // expressed in terms of operations on an ordered list of values.
  4025. // OOP
  4026. // ---
  4027. // These modules support the "object-oriented" calling style. See also
  4028. // `underscore.js` and `index-default.js`.
  4029. /***/ }),
  4030. /* 127 */
  4031. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4032. "use strict";
  4033. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
  4034. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('String'));
  4035. /***/ }),
  4036. /* 128 */
  4037. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4038. "use strict";
  4039. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
  4040. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
  4041. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__ = __webpack_require__(174);
  4042. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__ = __webpack_require__(79);
  4043. var isDataView = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('DataView');
  4044. // In IE 10 - Edge 13, we need a different heuristic
  4045. // to determine whether an object is a `DataView`.
  4046. function ie10IsDataView(obj) {
  4047. return obj != null && Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj.getInt8) && Object(__WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__["a" /* default */])(obj.buffer);
  4048. }
  4049. /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__["a" /* hasStringTagBug */] ? ie10IsDataView : isDataView);
  4050. /***/ }),
  4051. /* 129 */
  4052. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4053. "use strict";
  4054. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
  4055. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(40);
  4056. var isArguments = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Arguments');
  4057. // Define a fallback version of the method in browsers (ahem, IE < 9), where
  4058. // there isn't any inspectable "Arguments" type.
  4059. (function() {
  4060. if (!isArguments(arguments)) {
  4061. isArguments = function(obj) {
  4062. return Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(obj, 'callee');
  4063. };
  4064. }
  4065. }());
  4066. /* harmony default export */ __webpack_exports__["a"] = (isArguments);
  4067. /***/ }),
  4068. /* 130 */
  4069. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4070. "use strict";
  4071. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(179);
  4072. // Internal helper to obtain the `byteLength` property of an object.
  4073. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" /* default */])('byteLength'));
  4074. /***/ }),
  4075. /* 131 */
  4076. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4077. "use strict";
  4078. /* harmony export (immutable) */ __webpack_exports__["a"] = ie11fingerprint;
  4079. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return mapMethods; });
  4080. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return weakMapMethods; });
  4081. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setMethods; });
  4082. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
  4083. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
  4084. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__allKeys_js__ = __webpack_require__(80);
  4085. // Since the regular `Object.prototype.toString` type tests don't work for
  4086. // some types in IE 11, we use a fingerprinting heuristic instead, based
  4087. // on the methods. It's not great, but it's the best we got.
  4088. // The fingerprint method lists are defined below.
  4089. function ie11fingerprint(methods) {
  4090. var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(methods);
  4091. return function(obj) {
  4092. if (obj == null) return false;
  4093. // `Map`, `WeakMap` and `Set` have no enumerable keys.
  4094. var keys = Object(__WEBPACK_IMPORTED_MODULE_2__allKeys_js__["a" /* default */])(obj);
  4095. if (Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(keys)) return false;
  4096. for (var i = 0; i < length; i++) {
  4097. if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj[methods[i]])) return false;
  4098. }
  4099. // If we are testing against `WeakMap`, we need to ensure that
  4100. // `obj` doesn't have a `forEach` method in order to distinguish
  4101. // it from a regular `Map`.
  4102. return methods !== weakMapMethods || !Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj[forEachName]);
  4103. };
  4104. }
  4105. // In the interest of compact minification, we write
  4106. // each string in the fingerprints only once.
  4107. var forEachName = 'forEach',
  4108. hasName = 'has',
  4109. commonInit = ['clear', 'delete'],
  4110. mapTail = ['get', hasName, 'set'];
  4111. // `Map`, `WeakMap` and `Set` each have slightly different
  4112. // combinations of the above sublists.
  4113. var mapMethods = commonInit.concat(forEachName, mapTail),
  4114. weakMapMethods = commonInit.concat(mapTail),
  4115. setMethods = ['add'].concat(commonInit, forEachName, hasName);
  4116. /***/ }),
  4117. /* 132 */
  4118. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4119. "use strict";
  4120. /* harmony export (immutable) */ __webpack_exports__["a"] = createAssigner;
  4121. // An internal function for creating assigner functions.
  4122. function createAssigner(keysFunc, defaults) {
  4123. return function(obj) {
  4124. var length = arguments.length;
  4125. if (defaults) obj = Object(obj);
  4126. if (length < 2 || obj == null) return obj;
  4127. for (var index = 1; index < length; index++) {
  4128. var source = arguments[index],
  4129. keys = keysFunc(source),
  4130. l = keys.length;
  4131. for (var i = 0; i < l; i++) {
  4132. var key = keys[i];
  4133. if (!defaults || obj[key] === void 0) obj[key] = source[key];
  4134. }
  4135. }
  4136. return obj;
  4137. };
  4138. }
  4139. /***/ }),
  4140. /* 133 */
  4141. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4142. "use strict";
  4143. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(132);
  4144. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
  4145. // Assigns a given object with all the own properties in the passed-in
  4146. // object(s).
  4147. // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
  4148. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */]));
  4149. /***/ }),
  4150. /* 134 */
  4151. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4152. "use strict";
  4153. /* harmony export (immutable) */ __webpack_exports__["a"] = deepGet;
  4154. // Internal function to obtain a nested property in `obj` along `path`.
  4155. function deepGet(obj, path) {
  4156. var length = path.length;
  4157. for (var i = 0; i < length; i++) {
  4158. if (obj == null) return void 0;
  4159. obj = obj[path[i]];
  4160. }
  4161. return length ? obj : void 0;
  4162. }
  4163. /***/ }),
  4164. /* 135 */
  4165. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4166. "use strict";
  4167. /* harmony export (immutable) */ __webpack_exports__["a"] = identity;
  4168. // Keep the identity function around for default iteratees.
  4169. function identity(value) {
  4170. return value;
  4171. }
  4172. /***/ }),
  4173. /* 136 */
  4174. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4175. "use strict";
  4176. /* harmony export (immutable) */ __webpack_exports__["a"] = property;
  4177. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__deepGet_js__ = __webpack_require__(134);
  4178. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(81);
  4179. // Creates a function that, when passed an object, will traverse that object’s
  4180. // properties down the given `path`, specified as an array of keys or indices.
  4181. function property(path) {
  4182. path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
  4183. return function(obj) {
  4184. return Object(__WEBPACK_IMPORTED_MODULE_0__deepGet_js__["a" /* default */])(obj, path);
  4185. };
  4186. }
  4187. /***/ }),
  4188. /* 137 */
  4189. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4190. "use strict";
  4191. // A (possibly faster) way to get the current timestamp as an integer.
  4192. /* harmony default export */ __webpack_exports__["a"] = (Date.now || function() {
  4193. return new Date().getTime();
  4194. });
  4195. /***/ }),
  4196. /* 138 */
  4197. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4198. "use strict";
  4199. /* harmony export (immutable) */ __webpack_exports__["a"] = negate;
  4200. // Returns a negated version of the passed-in predicate.
  4201. function negate(predicate) {
  4202. return function() {
  4203. return !predicate.apply(this, arguments);
  4204. };
  4205. }
  4206. /***/ }),
  4207. /* 139 */
  4208. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4209. "use strict";
  4210. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(202);
  4211. // Returns the first index on an array-like that passes a truth test.
  4212. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" /* default */])(1));
  4213. /***/ }),
  4214. /* 140 */
  4215. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4216. "use strict";
  4217. /* harmony export (immutable) */ __webpack_exports__["a"] = pluck;
  4218. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__map_js__ = __webpack_require__(64);
  4219. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__property_js__ = __webpack_require__(136);
  4220. // Convenience version of a common use case of `_.map`: fetching a property.
  4221. function pluck(obj, key) {
  4222. return Object(__WEBPACK_IMPORTED_MODULE_0__map_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__property_js__["a" /* default */])(key));
  4223. }
  4224. /***/ }),
  4225. /* 141 */
  4226. /***/ (function(module, exports, __webpack_require__) {
  4227. module.exports = __webpack_require__(371);
  4228. /***/ }),
  4229. /* 142 */
  4230. /***/ (function(module, exports, __webpack_require__) {
  4231. module.exports = __webpack_require__(222);
  4232. /***/ }),
  4233. /* 143 */
  4234. /***/ (function(module, exports, __webpack_require__) {
  4235. module.exports = __webpack_require__(230);
  4236. /***/ }),
  4237. /* 144 */
  4238. /***/ (function(module, exports, __webpack_require__) {
  4239. var wellKnownSymbol = __webpack_require__(9);
  4240. exports.f = wellKnownSymbol;
  4241. /***/ }),
  4242. /* 145 */
  4243. /***/ (function(module, exports, __webpack_require__) {
  4244. module.exports = __webpack_require__(477);
  4245. /***/ }),
  4246. /* 146 */
  4247. /***/ (function(module, exports, __webpack_require__) {
  4248. var defineBuiltIn = __webpack_require__(39);
  4249. module.exports = function (target, src, options) {
  4250. for (var key in src) {
  4251. if (options && options.unsafe && target[key]) target[key] = src[key];
  4252. else defineBuiltIn(target, key, src[key], options);
  4253. } return target;
  4254. };
  4255. /***/ }),
  4256. /* 147 */
  4257. /***/ (function(module, exports, __webpack_require__) {
  4258. /* eslint-disable es-x/no-symbol -- required for testing */
  4259. var NATIVE_SYMBOL = __webpack_require__(57);
  4260. module.exports = NATIVE_SYMBOL
  4261. && !Symbol.sham
  4262. && typeof Symbol.iterator == 'symbol';
  4263. /***/ }),
  4264. /* 148 */
  4265. /***/ (function(module, exports, __webpack_require__) {
  4266. var DESCRIPTORS = __webpack_require__(16);
  4267. var fails = __webpack_require__(3);
  4268. var createElement = __webpack_require__(118);
  4269. // Thanks to IE8 for its funny defineProperty
  4270. module.exports = !DESCRIPTORS && !fails(function () {
  4271. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  4272. return Object.defineProperty(createElement('div'), 'a', {
  4273. get: function () { return 7; }
  4274. }).a != 7;
  4275. });
  4276. /***/ }),
  4277. /* 149 */
  4278. /***/ (function(module, exports, __webpack_require__) {
  4279. var fails = __webpack_require__(3);
  4280. var isCallable = __webpack_require__(7);
  4281. var replacement = /#|\.prototype\./;
  4282. var isForced = function (feature, detection) {
  4283. var value = data[normalize(feature)];
  4284. return value == POLYFILL ? true
  4285. : value == NATIVE ? false
  4286. : isCallable(detection) ? fails(detection)
  4287. : !!detection;
  4288. };
  4289. var normalize = isForced.normalize = function (string) {
  4290. return String(string).replace(replacement, '.').toLowerCase();
  4291. };
  4292. var data = isForced.data = {};
  4293. var NATIVE = isForced.NATIVE = 'N';
  4294. var POLYFILL = isForced.POLYFILL = 'P';
  4295. module.exports = isForced;
  4296. /***/ }),
  4297. /* 150 */
  4298. /***/ (function(module, exports, __webpack_require__) {
  4299. var DESCRIPTORS = __webpack_require__(16);
  4300. var fails = __webpack_require__(3);
  4301. // V8 ~ Chrome 36-
  4302. // https://bugs.chromium.org/p/v8/issues/detail?id=3334
  4303. module.exports = DESCRIPTORS && fails(function () {
  4304. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  4305. return Object.defineProperty(function () { /* empty */ }, 'prototype', {
  4306. value: 42,
  4307. writable: false
  4308. }).prototype != 42;
  4309. });
  4310. /***/ }),
  4311. /* 151 */
  4312. /***/ (function(module, exports, __webpack_require__) {
  4313. var fails = __webpack_require__(3);
  4314. module.exports = !fails(function () {
  4315. function F() { /* empty */ }
  4316. F.prototype.constructor = null;
  4317. // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
  4318. return Object.getPrototypeOf(new F()) !== F.prototype;
  4319. });
  4320. /***/ }),
  4321. /* 152 */
  4322. /***/ (function(module, exports, __webpack_require__) {
  4323. var uncurryThis = __webpack_require__(4);
  4324. var hasOwn = __webpack_require__(14);
  4325. var toIndexedObject = __webpack_require__(33);
  4326. var indexOf = __webpack_require__(153).indexOf;
  4327. var hiddenKeys = __webpack_require__(74);
  4328. var push = uncurryThis([].push);
  4329. module.exports = function (object, names) {
  4330. var O = toIndexedObject(object);
  4331. var i = 0;
  4332. var result = [];
  4333. var key;
  4334. for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
  4335. // Don't enum bug & hidden keys
  4336. while (names.length > i) if (hasOwn(O, key = names[i++])) {
  4337. ~indexOf(result, key) || push(result, key);
  4338. }
  4339. return result;
  4340. };
  4341. /***/ }),
  4342. /* 153 */
  4343. /***/ (function(module, exports, __webpack_require__) {
  4344. var toIndexedObject = __webpack_require__(33);
  4345. var toAbsoluteIndex = __webpack_require__(119);
  4346. var lengthOfArrayLike = __webpack_require__(46);
  4347. // `Array.prototype.{ indexOf, includes }` methods implementation
  4348. var createMethod = function (IS_INCLUDES) {
  4349. return function ($this, el, fromIndex) {
  4350. var O = toIndexedObject($this);
  4351. var length = lengthOfArrayLike(O);
  4352. var index = toAbsoluteIndex(fromIndex, length);
  4353. var value;
  4354. // Array#includes uses SameValueZero equality algorithm
  4355. // eslint-disable-next-line no-self-compare -- NaN check
  4356. if (IS_INCLUDES && el != el) while (length > index) {
  4357. value = O[index++];
  4358. // eslint-disable-next-line no-self-compare -- NaN check
  4359. if (value != value) return true;
  4360. // Array#indexOf ignores holes, Array#includes - not
  4361. } else for (;length > index; index++) {
  4362. if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
  4363. } return !IS_INCLUDES && -1;
  4364. };
  4365. };
  4366. module.exports = {
  4367. // `Array.prototype.includes` method
  4368. // https://tc39.es/ecma262/#sec-array.prototype.includes
  4369. includes: createMethod(true),
  4370. // `Array.prototype.indexOf` method
  4371. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  4372. indexOf: createMethod(false)
  4373. };
  4374. /***/ }),
  4375. /* 154 */
  4376. /***/ (function(module, exports, __webpack_require__) {
  4377. var DESCRIPTORS = __webpack_require__(16);
  4378. var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(150);
  4379. var definePropertyModule = __webpack_require__(22);
  4380. var anObject = __webpack_require__(19);
  4381. var toIndexedObject = __webpack_require__(33);
  4382. var objectKeys = __webpack_require__(98);
  4383. // `Object.defineProperties` method
  4384. // https://tc39.es/ecma262/#sec-object.defineproperties
  4385. // eslint-disable-next-line es-x/no-object-defineproperties -- safe
  4386. exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
  4387. anObject(O);
  4388. var props = toIndexedObject(Properties);
  4389. var keys = objectKeys(Properties);
  4390. var length = keys.length;
  4391. var index = 0;
  4392. var key;
  4393. while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
  4394. return O;
  4395. };
  4396. /***/ }),
  4397. /* 155 */
  4398. /***/ (function(module, exports, __webpack_require__) {
  4399. var getBuiltIn = __webpack_require__(18);
  4400. module.exports = getBuiltIn('document', 'documentElement');
  4401. /***/ }),
  4402. /* 156 */
  4403. /***/ (function(module, exports, __webpack_require__) {
  4404. var wellKnownSymbol = __webpack_require__(9);
  4405. var Iterators = __webpack_require__(58);
  4406. var ITERATOR = wellKnownSymbol('iterator');
  4407. var ArrayPrototype = Array.prototype;
  4408. // check on default Array iterator
  4409. module.exports = function (it) {
  4410. return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
  4411. };
  4412. /***/ }),
  4413. /* 157 */
  4414. /***/ (function(module, exports, __webpack_require__) {
  4415. var call = __webpack_require__(13);
  4416. var aCallable = __webpack_require__(31);
  4417. var anObject = __webpack_require__(19);
  4418. var tryToString = __webpack_require__(72);
  4419. var getIteratorMethod = __webpack_require__(99);
  4420. var $TypeError = TypeError;
  4421. module.exports = function (argument, usingIterator) {
  4422. var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
  4423. if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
  4424. throw $TypeError(tryToString(argument) + ' is not iterable');
  4425. };
  4426. /***/ }),
  4427. /* 158 */
  4428. /***/ (function(module, exports, __webpack_require__) {
  4429. var call = __webpack_require__(13);
  4430. var anObject = __webpack_require__(19);
  4431. var getMethod = __webpack_require__(116);
  4432. module.exports = function (iterator, kind, value) {
  4433. var innerResult, innerError;
  4434. anObject(iterator);
  4435. try {
  4436. innerResult = getMethod(iterator, 'return');
  4437. if (!innerResult) {
  4438. if (kind === 'throw') throw value;
  4439. return value;
  4440. }
  4441. innerResult = call(innerResult, iterator);
  4442. } catch (error) {
  4443. innerError = true;
  4444. innerResult = error;
  4445. }
  4446. if (kind === 'throw') throw value;
  4447. if (innerError) throw innerResult;
  4448. anObject(innerResult);
  4449. return value;
  4450. };
  4451. /***/ }),
  4452. /* 159 */
  4453. /***/ (function(module, exports) {
  4454. module.exports = function () { /* empty */ };
  4455. /***/ }),
  4456. /* 160 */
  4457. /***/ (function(module, exports, __webpack_require__) {
  4458. var global = __webpack_require__(6);
  4459. var isCallable = __webpack_require__(7);
  4460. var inspectSource = __webpack_require__(123);
  4461. var WeakMap = global.WeakMap;
  4462. module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
  4463. /***/ }),
  4464. /* 161 */
  4465. /***/ (function(module, exports, __webpack_require__) {
  4466. "use strict";
  4467. var fails = __webpack_require__(3);
  4468. var isCallable = __webpack_require__(7);
  4469. var create = __webpack_require__(47);
  4470. var getPrototypeOf = __webpack_require__(93);
  4471. var defineBuiltIn = __webpack_require__(39);
  4472. var wellKnownSymbol = __webpack_require__(9);
  4473. var IS_PURE = __webpack_require__(32);
  4474. var ITERATOR = wellKnownSymbol('iterator');
  4475. var BUGGY_SAFARI_ITERATORS = false;
  4476. // `%IteratorPrototype%` object
  4477. // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
  4478. var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
  4479. /* eslint-disable es-x/no-array-prototype-keys -- safe */
  4480. if ([].keys) {
  4481. arrayIterator = [].keys();
  4482. // Safari 8 has buggy iterators w/o `next`
  4483. if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
  4484. else {
  4485. PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
  4486. if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
  4487. }
  4488. }
  4489. var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
  4490. var test = {};
  4491. // FF44- legacy iterators case
  4492. return IteratorPrototype[ITERATOR].call(test) !== test;
  4493. });
  4494. if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
  4495. else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
  4496. // `%IteratorPrototype%[@@iterator]()` method
  4497. // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
  4498. if (!isCallable(IteratorPrototype[ITERATOR])) {
  4499. defineBuiltIn(IteratorPrototype, ITERATOR, function () {
  4500. return this;
  4501. });
  4502. }
  4503. module.exports = {
  4504. IteratorPrototype: IteratorPrototype,
  4505. BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
  4506. };
  4507. /***/ }),
  4508. /* 162 */
  4509. /***/ (function(module, exports, __webpack_require__) {
  4510. "use strict";
  4511. var getBuiltIn = __webpack_require__(18);
  4512. var definePropertyModule = __webpack_require__(22);
  4513. var wellKnownSymbol = __webpack_require__(9);
  4514. var DESCRIPTORS = __webpack_require__(16);
  4515. var SPECIES = wellKnownSymbol('species');
  4516. module.exports = function (CONSTRUCTOR_NAME) {
  4517. var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
  4518. var defineProperty = definePropertyModule.f;
  4519. if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
  4520. defineProperty(Constructor, SPECIES, {
  4521. configurable: true,
  4522. get: function () { return this; }
  4523. });
  4524. }
  4525. };
  4526. /***/ }),
  4527. /* 163 */
  4528. /***/ (function(module, exports, __webpack_require__) {
  4529. var anObject = __webpack_require__(19);
  4530. var aConstructor = __webpack_require__(164);
  4531. var wellKnownSymbol = __webpack_require__(9);
  4532. var SPECIES = wellKnownSymbol('species');
  4533. // `SpeciesConstructor` abstract operation
  4534. // https://tc39.es/ecma262/#sec-speciesconstructor
  4535. module.exports = function (O, defaultConstructor) {
  4536. var C = anObject(O).constructor;
  4537. var S;
  4538. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
  4539. };
  4540. /***/ }),
  4541. /* 164 */
  4542. /***/ (function(module, exports, __webpack_require__) {
  4543. var isConstructor = __webpack_require__(101);
  4544. var tryToString = __webpack_require__(72);
  4545. var $TypeError = TypeError;
  4546. // `Assert: IsConstructor(argument) is true`
  4547. module.exports = function (argument) {
  4548. if (isConstructor(argument)) return argument;
  4549. throw $TypeError(tryToString(argument) + ' is not a constructor');
  4550. };
  4551. /***/ }),
  4552. /* 165 */
  4553. /***/ (function(module, exports, __webpack_require__) {
  4554. var global = __webpack_require__(6);
  4555. var apply = __webpack_require__(69);
  4556. var bind = __webpack_require__(45);
  4557. var isCallable = __webpack_require__(7);
  4558. var hasOwn = __webpack_require__(14);
  4559. var fails = __webpack_require__(3);
  4560. var html = __webpack_require__(155);
  4561. var arraySlice = __webpack_require__(102);
  4562. var createElement = __webpack_require__(118);
  4563. var validateArgumentsLength = __webpack_require__(273);
  4564. var IS_IOS = __webpack_require__(166);
  4565. var IS_NODE = __webpack_require__(125);
  4566. var set = global.setImmediate;
  4567. var clear = global.clearImmediate;
  4568. var process = global.process;
  4569. var Dispatch = global.Dispatch;
  4570. var Function = global.Function;
  4571. var MessageChannel = global.MessageChannel;
  4572. var String = global.String;
  4573. var counter = 0;
  4574. var queue = {};
  4575. var ONREADYSTATECHANGE = 'onreadystatechange';
  4576. var location, defer, channel, port;
  4577. try {
  4578. // Deno throws a ReferenceError on `location` access without `--location` flag
  4579. location = global.location;
  4580. } catch (error) { /* empty */ }
  4581. var run = function (id) {
  4582. if (hasOwn(queue, id)) {
  4583. var fn = queue[id];
  4584. delete queue[id];
  4585. fn();
  4586. }
  4587. };
  4588. var runner = function (id) {
  4589. return function () {
  4590. run(id);
  4591. };
  4592. };
  4593. var listener = function (event) {
  4594. run(event.data);
  4595. };
  4596. var post = function (id) {
  4597. // old engines have not location.origin
  4598. global.postMessage(String(id), location.protocol + '//' + location.host);
  4599. };
  4600. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  4601. if (!set || !clear) {
  4602. set = function setImmediate(handler) {
  4603. validateArgumentsLength(arguments.length, 1);
  4604. var fn = isCallable(handler) ? handler : Function(handler);
  4605. var args = arraySlice(arguments, 1);
  4606. queue[++counter] = function () {
  4607. apply(fn, undefined, args);
  4608. };
  4609. defer(counter);
  4610. return counter;
  4611. };
  4612. clear = function clearImmediate(id) {
  4613. delete queue[id];
  4614. };
  4615. // Node.js 0.8-
  4616. if (IS_NODE) {
  4617. defer = function (id) {
  4618. process.nextTick(runner(id));
  4619. };
  4620. // Sphere (JS game engine) Dispatch API
  4621. } else if (Dispatch && Dispatch.now) {
  4622. defer = function (id) {
  4623. Dispatch.now(runner(id));
  4624. };
  4625. // Browsers with MessageChannel, includes WebWorkers
  4626. // except iOS - https://github.com/zloirock/core-js/issues/624
  4627. } else if (MessageChannel && !IS_IOS) {
  4628. channel = new MessageChannel();
  4629. port = channel.port2;
  4630. channel.port1.onmessage = listener;
  4631. defer = bind(port.postMessage, port);
  4632. // Browsers with postMessage, skip WebWorkers
  4633. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  4634. } else if (
  4635. global.addEventListener &&
  4636. isCallable(global.postMessage) &&
  4637. !global.importScripts &&
  4638. location && location.protocol !== 'file:' &&
  4639. !fails(post)
  4640. ) {
  4641. defer = post;
  4642. global.addEventListener('message', listener, false);
  4643. // IE8-
  4644. } else if (ONREADYSTATECHANGE in createElement('script')) {
  4645. defer = function (id) {
  4646. html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
  4647. html.removeChild(this);
  4648. run(id);
  4649. };
  4650. };
  4651. // Rest old browsers
  4652. } else {
  4653. defer = function (id) {
  4654. setTimeout(runner(id), 0);
  4655. };
  4656. }
  4657. }
  4658. module.exports = {
  4659. set: set,
  4660. clear: clear
  4661. };
  4662. /***/ }),
  4663. /* 166 */
  4664. /***/ (function(module, exports, __webpack_require__) {
  4665. var userAgent = __webpack_require__(91);
  4666. module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
  4667. /***/ }),
  4668. /* 167 */
  4669. /***/ (function(module, exports, __webpack_require__) {
  4670. var NativePromiseConstructor = __webpack_require__(61);
  4671. var checkCorrectnessOfIteration = __webpack_require__(168);
  4672. var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
  4673. module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {
  4674. NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });
  4675. });
  4676. /***/ }),
  4677. /* 168 */
  4678. /***/ (function(module, exports, __webpack_require__) {
  4679. var wellKnownSymbol = __webpack_require__(9);
  4680. var ITERATOR = wellKnownSymbol('iterator');
  4681. var SAFE_CLOSING = false;
  4682. try {
  4683. var called = 0;
  4684. var iteratorWithReturn = {
  4685. next: function () {
  4686. return { done: !!called++ };
  4687. },
  4688. 'return': function () {
  4689. SAFE_CLOSING = true;
  4690. }
  4691. };
  4692. iteratorWithReturn[ITERATOR] = function () {
  4693. return this;
  4694. };
  4695. // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing
  4696. Array.from(iteratorWithReturn, function () { throw 2; });
  4697. } catch (error) { /* empty */ }
  4698. module.exports = function (exec, SKIP_CLOSING) {
  4699. if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
  4700. var ITERATION_SUPPORT = false;
  4701. try {
  4702. var object = {};
  4703. object[ITERATOR] = function () {
  4704. return {
  4705. next: function () {
  4706. return { done: ITERATION_SUPPORT = true };
  4707. }
  4708. };
  4709. };
  4710. exec(object);
  4711. } catch (error) { /* empty */ }
  4712. return ITERATION_SUPPORT;
  4713. };
  4714. /***/ }),
  4715. /* 169 */
  4716. /***/ (function(module, exports, __webpack_require__) {
  4717. var anObject = __webpack_require__(19);
  4718. var isObject = __webpack_require__(11);
  4719. var newPromiseCapability = __webpack_require__(50);
  4720. module.exports = function (C, x) {
  4721. anObject(C);
  4722. if (isObject(x) && x.constructor === C) return x;
  4723. var promiseCapability = newPromiseCapability.f(C);
  4724. var resolve = promiseCapability.resolve;
  4725. resolve(x);
  4726. return promiseCapability.promise;
  4727. };
  4728. /***/ }),
  4729. /* 170 */
  4730. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4731. "use strict";
  4732. /* harmony export (immutable) */ __webpack_exports__["a"] = isUndefined;
  4733. // Is a given variable undefined?
  4734. function isUndefined(obj) {
  4735. return obj === void 0;
  4736. }
  4737. /***/ }),
  4738. /* 171 */
  4739. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4740. "use strict";
  4741. /* harmony export (immutable) */ __webpack_exports__["a"] = isBoolean;
  4742. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
  4743. // Is a given value a boolean?
  4744. function isBoolean(obj) {
  4745. return obj === true || obj === false || __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === '[object Boolean]';
  4746. }
  4747. /***/ }),
  4748. /* 172 */
  4749. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4750. "use strict";
  4751. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
  4752. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Number'));
  4753. /***/ }),
  4754. /* 173 */
  4755. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4756. "use strict";
  4757. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
  4758. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Symbol'));
  4759. /***/ }),
  4760. /* 174 */
  4761. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4762. "use strict";
  4763. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
  4764. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('ArrayBuffer'));
  4765. /***/ }),
  4766. /* 175 */
  4767. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4768. "use strict";
  4769. /* harmony export (immutable) */ __webpack_exports__["a"] = isNaN;
  4770. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
  4771. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isNumber_js__ = __webpack_require__(172);
  4772. // Is the given value `NaN`?
  4773. function isNaN(obj) {
  4774. return Object(__WEBPACK_IMPORTED_MODULE_1__isNumber_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["g" /* _isNaN */])(obj);
  4775. }
  4776. /***/ }),
  4777. /* 176 */
  4778. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4779. "use strict";
  4780. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
  4781. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isDataView_js__ = __webpack_require__(128);
  4782. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constant_js__ = __webpack_require__(177);
  4783. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__ = __webpack_require__(298);
  4784. // Is a given value a typed array?
  4785. var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
  4786. function isTypedArray(obj) {
  4787. // `ArrayBuffer.isView` is the most future-proof, so use it when available.
  4788. // Otherwise, fall back on the above regular expression.
  4789. return __WEBPACK_IMPORTED_MODULE_0__setup_js__["l" /* nativeIsView */] ? (Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["l" /* nativeIsView */])(obj) && !Object(__WEBPACK_IMPORTED_MODULE_1__isDataView_js__["a" /* default */])(obj)) :
  4790. Object(__WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__["a" /* default */])(obj) && typedArrayPattern.test(__WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj));
  4791. }
  4792. /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["r" /* supportsArrayBuffer */] ? isTypedArray : Object(__WEBPACK_IMPORTED_MODULE_2__constant_js__["a" /* default */])(false));
  4793. /***/ }),
  4794. /* 177 */
  4795. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4796. "use strict";
  4797. /* harmony export (immutable) */ __webpack_exports__["a"] = constant;
  4798. // Predicate-generating function. Often useful outside of Underscore.
  4799. function constant(value) {
  4800. return function() {
  4801. return value;
  4802. };
  4803. }
  4804. /***/ }),
  4805. /* 178 */
  4806. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4807. "use strict";
  4808. /* harmony export (immutable) */ __webpack_exports__["a"] = createSizePropertyCheck;
  4809. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
  4810. // Common internal logic for `isArrayLike` and `isBufferLike`.
  4811. function createSizePropertyCheck(getSizeProperty) {
  4812. return function(collection) {
  4813. var sizeProperty = getSizeProperty(collection);
  4814. return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= __WEBPACK_IMPORTED_MODULE_0__setup_js__["b" /* MAX_ARRAY_INDEX */];
  4815. }
  4816. }
  4817. /***/ }),
  4818. /* 179 */
  4819. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4820. "use strict";
  4821. /* harmony export (immutable) */ __webpack_exports__["a"] = shallowProperty;
  4822. // Internal helper to generate a function to obtain property `key` from `obj`.
  4823. function shallowProperty(key) {
  4824. return function(obj) {
  4825. return obj == null ? void 0 : obj[key];
  4826. };
  4827. }
  4828. /***/ }),
  4829. /* 180 */
  4830. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4831. "use strict";
  4832. /* harmony export (immutable) */ __webpack_exports__["a"] = collectNonEnumProps;
  4833. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
  4834. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
  4835. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(40);
  4836. // Internal helper to create a simple lookup structure.
  4837. // `collectNonEnumProps` used to depend on `_.contains`, but this led to
  4838. // circular imports. `emulatedSet` is a one-off solution that only works for
  4839. // arrays of strings.
  4840. function emulatedSet(keys) {
  4841. var hash = {};
  4842. for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
  4843. return {
  4844. contains: function(key) { return hash[key]; },
  4845. push: function(key) {
  4846. hash[key] = true;
  4847. return keys.push(key);
  4848. }
  4849. };
  4850. }
  4851. // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't
  4852. // be iterated by `for key in ...` and thus missed. Extends `keys` in place if
  4853. // needed.
  4854. function collectNonEnumProps(obj, keys) {
  4855. keys = emulatedSet(keys);
  4856. var nonEnumIdx = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" /* nonEnumerableProps */].length;
  4857. var constructor = obj.constructor;
  4858. var proto = Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(constructor) && constructor.prototype || __WEBPACK_IMPORTED_MODULE_0__setup_js__["c" /* ObjProto */];
  4859. // Constructor is a special case.
  4860. var prop = 'constructor';
  4861. if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, prop) && !keys.contains(prop)) keys.push(prop);
  4862. while (nonEnumIdx--) {
  4863. prop = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" /* nonEnumerableProps */][nonEnumIdx];
  4864. if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
  4865. keys.push(prop);
  4866. }
  4867. }
  4868. }
  4869. /***/ }),
  4870. /* 181 */
  4871. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4872. "use strict";
  4873. /* harmony export (immutable) */ __webpack_exports__["a"] = isMatch;
  4874. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
  4875. // Returns whether an object has a given set of `key:value` pairs.
  4876. function isMatch(object, attrs) {
  4877. var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(attrs), length = _keys.length;
  4878. if (object == null) return !length;
  4879. var obj = Object(object);
  4880. for (var i = 0; i < length; i++) {
  4881. var key = _keys[i];
  4882. if (attrs[key] !== obj[key] || !(key in obj)) return false;
  4883. }
  4884. return true;
  4885. }
  4886. /***/ }),
  4887. /* 182 */
  4888. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4889. "use strict";
  4890. /* harmony export (immutable) */ __webpack_exports__["a"] = invert;
  4891. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
  4892. // Invert the keys and values of an object. The values must be serializable.
  4893. function invert(obj) {
  4894. var result = {};
  4895. var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
  4896. for (var i = 0, length = _keys.length; i < length; i++) {
  4897. result[obj[_keys[i]]] = _keys[i];
  4898. }
  4899. return result;
  4900. }
  4901. /***/ }),
  4902. /* 183 */
  4903. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4904. "use strict";
  4905. /* harmony export (immutable) */ __webpack_exports__["a"] = functions;
  4906. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(27);
  4907. // Return a sorted list of the function names available on the object.
  4908. function functions(obj) {
  4909. var names = [];
  4910. for (var key in obj) {
  4911. if (Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(obj[key])) names.push(key);
  4912. }
  4913. return names.sort();
  4914. }
  4915. /***/ }),
  4916. /* 184 */
  4917. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4918. "use strict";
  4919. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(132);
  4920. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(80);
  4921. // Extend a given object with all the properties in passed-in object(s).
  4922. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" /* default */]));
  4923. /***/ }),
  4924. /* 185 */
  4925. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4926. "use strict";
  4927. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(132);
  4928. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(80);
  4929. // Fill in a given object with default properties.
  4930. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" /* default */], true));
  4931. /***/ }),
  4932. /* 186 */
  4933. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4934. "use strict";
  4935. /* harmony export (immutable) */ __webpack_exports__["a"] = baseCreate;
  4936. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
  4937. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
  4938. // Create a naked function reference for surrogate-prototype-swapping.
  4939. function ctor() {
  4940. return function(){};
  4941. }
  4942. // An internal function for creating a new object that inherits from another.
  4943. function baseCreate(prototype) {
  4944. if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(prototype)) return {};
  4945. if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" /* nativeCreate */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" /* nativeCreate */])(prototype);
  4946. var Ctor = ctor();
  4947. Ctor.prototype = prototype;
  4948. var result = new Ctor;
  4949. Ctor.prototype = null;
  4950. return result;
  4951. }
  4952. /***/ }),
  4953. /* 187 */
  4954. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4955. "use strict";
  4956. /* harmony export (immutable) */ __webpack_exports__["a"] = clone;
  4957. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
  4958. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(53);
  4959. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__extend_js__ = __webpack_require__(184);
  4960. // Create a (shallow-cloned) duplicate of an object.
  4961. function clone(obj) {
  4962. if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return obj;
  4963. return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(obj) ? obj.slice() : Object(__WEBPACK_IMPORTED_MODULE_2__extend_js__["a" /* default */])({}, obj);
  4964. }
  4965. /***/ }),
  4966. /* 188 */
  4967. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4968. "use strict";
  4969. /* harmony export (immutable) */ __webpack_exports__["a"] = get;
  4970. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__toPath_js__ = __webpack_require__(81);
  4971. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__deepGet_js__ = __webpack_require__(134);
  4972. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isUndefined_js__ = __webpack_require__(170);
  4973. // Get the value of the (deep) property on `path` from `object`.
  4974. // If any property in `path` does not exist or if the value is
  4975. // `undefined`, return `defaultValue` instead.
  4976. // The `path` is normalized through `_.toPath`.
  4977. function get(object, path, defaultValue) {
  4978. var value = Object(__WEBPACK_IMPORTED_MODULE_1__deepGet_js__["a" /* default */])(object, Object(__WEBPACK_IMPORTED_MODULE_0__toPath_js__["a" /* default */])(path));
  4979. return Object(__WEBPACK_IMPORTED_MODULE_2__isUndefined_js__["a" /* default */])(value) ? defaultValue : value;
  4980. }
  4981. /***/ }),
  4982. /* 189 */
  4983. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4984. "use strict";
  4985. /* harmony export (immutable) */ __webpack_exports__["a"] = toPath;
  4986. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
  4987. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(53);
  4988. // Normalize a (deep) property `path` to array.
  4989. // Like `_.iteratee`, this function can be customized.
  4990. function toPath(path) {
  4991. return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(path) ? path : [path];
  4992. }
  4993. __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].toPath = toPath;
  4994. /***/ }),
  4995. /* 190 */
  4996. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4997. "use strict";
  4998. /* harmony export (immutable) */ __webpack_exports__["a"] = baseIteratee;
  4999. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__identity_js__ = __webpack_require__(135);
  5000. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
  5001. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(52);
  5002. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArray_js__ = __webpack_require__(53);
  5003. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__matcher_js__ = __webpack_require__(103);
  5004. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__property_js__ = __webpack_require__(136);
  5005. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__ = __webpack_require__(82);
  5006. // An internal function to generate callbacks that can be applied to each
  5007. // element in a collection, returning the desired result — either `_.identity`,
  5008. // an arbitrary callback, a property matcher, or a property accessor.
  5009. function baseIteratee(value, context, argCount) {
  5010. if (value == null) return __WEBPACK_IMPORTED_MODULE_0__identity_js__["a" /* default */];
  5011. if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(value)) return Object(__WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__["a" /* default */])(value, context, argCount);
  5012. if (Object(__WEBPACK_IMPORTED_MODULE_2__isObject_js__["a" /* default */])(value) && !Object(__WEBPACK_IMPORTED_MODULE_3__isArray_js__["a" /* default */])(value)) return Object(__WEBPACK_IMPORTED_MODULE_4__matcher_js__["a" /* default */])(value);
  5013. return Object(__WEBPACK_IMPORTED_MODULE_5__property_js__["a" /* default */])(value);
  5014. }
  5015. /***/ }),
  5016. /* 191 */
  5017. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5018. "use strict";
  5019. /* harmony export (immutable) */ __webpack_exports__["a"] = iteratee;
  5020. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
  5021. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(190);
  5022. // External wrapper for our callback generator. Users may customize
  5023. // `_.iteratee` if they want additional predicate/iteratee shorthand styles.
  5024. // This abstraction hides the internal-only `argCount` argument.
  5025. function iteratee(value, context) {
  5026. return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" /* default */])(value, context, Infinity);
  5027. }
  5028. __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].iteratee = iteratee;
  5029. /***/ }),
  5030. /* 192 */
  5031. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5032. "use strict";
  5033. /* harmony export (immutable) */ __webpack_exports__["a"] = noop;
  5034. // Predicate-generating function. Often useful outside of Underscore.
  5035. function noop(){}
  5036. /***/ }),
  5037. /* 193 */
  5038. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5039. "use strict";
  5040. /* harmony export (immutable) */ __webpack_exports__["a"] = random;
  5041. // Return a random integer between `min` and `max` (inclusive).
  5042. function random(min, max) {
  5043. if (max == null) {
  5044. max = min;
  5045. min = 0;
  5046. }
  5047. return min + Math.floor(Math.random() * (max - min + 1));
  5048. }
  5049. /***/ }),
  5050. /* 194 */
  5051. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5052. "use strict";
  5053. /* harmony export (immutable) */ __webpack_exports__["a"] = createEscaper;
  5054. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
  5055. // Internal helper to generate functions for escaping and unescaping strings
  5056. // to/from HTML interpolation.
  5057. function createEscaper(map) {
  5058. var escaper = function(match) {
  5059. return map[match];
  5060. };
  5061. // Regexes for identifying a key that needs to be escaped.
  5062. var source = '(?:' + Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(map).join('|') + ')';
  5063. var testRegexp = RegExp(source);
  5064. var replaceRegexp = RegExp(source, 'g');
  5065. return function(string) {
  5066. string = string == null ? '' : '' + string;
  5067. return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
  5068. };
  5069. }
  5070. /***/ }),
  5071. /* 195 */
  5072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5073. "use strict";
  5074. // Internal list of HTML entities for escaping.
  5075. /* harmony default export */ __webpack_exports__["a"] = ({
  5076. '&': '&amp;',
  5077. '<': '&lt;',
  5078. '>': '&gt;',
  5079. '"': '&quot;',
  5080. "'": '&#x27;',
  5081. '`': '&#x60;'
  5082. });
  5083. /***/ }),
  5084. /* 196 */
  5085. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5086. "use strict";
  5087. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
  5088. // By default, Underscore uses ERB-style template delimiters. Change the
  5089. // following template settings to use alternative delimiters.
  5090. /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].templateSettings = {
  5091. evaluate: /<%([\s\S]+?)%>/g,
  5092. interpolate: /<%=([\s\S]+?)%>/g,
  5093. escape: /<%-([\s\S]+?)%>/g
  5094. });
  5095. /***/ }),
  5096. /* 197 */
  5097. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5098. "use strict";
  5099. /* harmony export (immutable) */ __webpack_exports__["a"] = executeBound;
  5100. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(186);
  5101. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isObject_js__ = __webpack_require__(52);
  5102. // Internal function to execute `sourceFunc` bound to `context` with optional
  5103. // `args`. Determines whether to execute a function as a constructor or as a
  5104. // normal function.
  5105. function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
  5106. if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
  5107. var self = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" /* default */])(sourceFunc.prototype);
  5108. var result = sourceFunc.apply(self, args);
  5109. if (Object(__WEBPACK_IMPORTED_MODULE_1__isObject_js__["a" /* default */])(result)) return result;
  5110. return self;
  5111. }
  5112. /***/ }),
  5113. /* 198 */
  5114. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5115. "use strict";
  5116. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
  5117. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
  5118. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__executeBound_js__ = __webpack_require__(197);
  5119. // Create a function bound to a given object (assigning `this`, and arguments,
  5120. // optionally).
  5121. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, context, args) {
  5122. if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(func)) throw new TypeError('Bind must be called on a function');
  5123. var bound = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(callArgs) {
  5124. return Object(__WEBPACK_IMPORTED_MODULE_2__executeBound_js__["a" /* default */])(func, bound, context, this, args.concat(callArgs));
  5125. });
  5126. return bound;
  5127. }));
  5128. /***/ }),
  5129. /* 199 */
  5130. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5131. "use strict";
  5132. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
  5133. // Delays a function for the given number of milliseconds, and then calls
  5134. // it with the arguments supplied.
  5135. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, wait, args) {
  5136. return setTimeout(function() {
  5137. return func.apply(null, args);
  5138. }, wait);
  5139. }));
  5140. /***/ }),
  5141. /* 200 */
  5142. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5143. "use strict";
  5144. /* harmony export (immutable) */ __webpack_exports__["a"] = before;
  5145. // Returns a function that will only be executed up to (but not including) the
  5146. // Nth call.
  5147. function before(times, func) {
  5148. var memo;
  5149. return function() {
  5150. if (--times > 0) {
  5151. memo = func.apply(this, arguments);
  5152. }
  5153. if (times <= 1) func = null;
  5154. return memo;
  5155. };
  5156. }
  5157. /***/ }),
  5158. /* 201 */
  5159. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5160. "use strict";
  5161. /* harmony export (immutable) */ __webpack_exports__["a"] = findKey;
  5162. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
  5163. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
  5164. // Returns the first key on an object that passes a truth test.
  5165. function findKey(obj, predicate, context) {
  5166. predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
  5167. var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj), key;
  5168. for (var i = 0, length = _keys.length; i < length; i++) {
  5169. key = _keys[i];
  5170. if (predicate(obj[key], key, obj)) return key;
  5171. }
  5172. }
  5173. /***/ }),
  5174. /* 202 */
  5175. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5176. "use strict";
  5177. /* harmony export (immutable) */ __webpack_exports__["a"] = createPredicateIndexFinder;
  5178. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
  5179. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
  5180. // Internal function to generate `_.findIndex` and `_.findLastIndex`.
  5181. function createPredicateIndexFinder(dir) {
  5182. return function(array, predicate, context) {
  5183. predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
  5184. var length = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */])(array);
  5185. var index = dir > 0 ? 0 : length - 1;
  5186. for (; index >= 0 && index < length; index += dir) {
  5187. if (predicate(array[index], index, array)) return index;
  5188. }
  5189. return -1;
  5190. };
  5191. }
  5192. /***/ }),
  5193. /* 203 */
  5194. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5195. "use strict";
  5196. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(202);
  5197. // Returns the last index on an array-like that passes a truth test.
  5198. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" /* default */])(-1));
  5199. /***/ }),
  5200. /* 204 */
  5201. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5202. "use strict";
  5203. /* harmony export (immutable) */ __webpack_exports__["a"] = sortedIndex;
  5204. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
  5205. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
  5206. // Use a comparator function to figure out the smallest index at which
  5207. // an object should be inserted so as to maintain order. Uses binary search.
  5208. function sortedIndex(array, obj, iteratee, context) {
  5209. iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context, 1);
  5210. var value = iteratee(obj);
  5211. var low = 0, high = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */])(array);
  5212. while (low < high) {
  5213. var mid = Math.floor((low + high) / 2);
  5214. if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
  5215. }
  5216. return low;
  5217. }
  5218. /***/ }),
  5219. /* 205 */
  5220. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5221. "use strict";
  5222. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__ = __webpack_require__(204);
  5223. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(139);
  5224. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__ = __webpack_require__(206);
  5225. // Return the position of the first occurrence of an item in an array,
  5226. // or -1 if the item is not included in the array.
  5227. // If the array is large and already in sort order, pass `true`
  5228. // for **isSorted** to use binary search.
  5229. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__["a" /* default */])(1, __WEBPACK_IMPORTED_MODULE_1__findIndex_js__["a" /* default */], __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__["a" /* default */]));
  5230. /***/ }),
  5231. /* 206 */
  5232. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5233. "use strict";
  5234. /* harmony export (immutable) */ __webpack_exports__["a"] = createIndexFinder;
  5235. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
  5236. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
  5237. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isNaN_js__ = __webpack_require__(175);
  5238. // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.
  5239. function createIndexFinder(dir, predicateFind, sortedIndex) {
  5240. return function(array, item, idx) {
  5241. var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(array);
  5242. if (typeof idx == 'number') {
  5243. if (dir > 0) {
  5244. i = idx >= 0 ? idx : Math.max(idx + length, i);
  5245. } else {
  5246. length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
  5247. }
  5248. } else if (sortedIndex && idx && length) {
  5249. idx = sortedIndex(array, item);
  5250. return array[idx] === item ? idx : -1;
  5251. }
  5252. if (item !== item) {
  5253. idx = predicateFind(__WEBPACK_IMPORTED_MODULE_1__setup_js__["q" /* slice */].call(array, i, length), __WEBPACK_IMPORTED_MODULE_2__isNaN_js__["a" /* default */]);
  5254. return idx >= 0 ? idx + i : -1;
  5255. }
  5256. for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
  5257. if (array[idx] === item) return idx;
  5258. }
  5259. return -1;
  5260. };
  5261. }
  5262. /***/ }),
  5263. /* 207 */
  5264. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5265. "use strict";
  5266. /* harmony export (immutable) */ __webpack_exports__["a"] = find;
  5267. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
  5268. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(139);
  5269. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__findKey_js__ = __webpack_require__(201);
  5270. // Return the first value which passes a truth test.
  5271. function find(obj, predicate, context) {
  5272. var keyFinder = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? __WEBPACK_IMPORTED_MODULE_1__findIndex_js__["a" /* default */] : __WEBPACK_IMPORTED_MODULE_2__findKey_js__["a" /* default */];
  5273. var key = keyFinder(obj, predicate, context);
  5274. if (key !== void 0 && key !== -1) return obj[key];
  5275. }
  5276. /***/ }),
  5277. /* 208 */
  5278. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5279. "use strict";
  5280. /* harmony export (immutable) */ __webpack_exports__["a"] = createReduce;
  5281. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
  5282. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
  5283. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(82);
  5284. // Internal helper to create a reducing function, iterating left or right.
  5285. function createReduce(dir) {
  5286. // Wrap code that reassigns argument variables in a separate function than
  5287. // the one that accesses `arguments.length` to avoid a perf hit. (#1991)
  5288. var reducer = function(obj, iteratee, memo, initial) {
  5289. var _keys = !Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj),
  5290. length = (_keys || obj).length,
  5291. index = dir > 0 ? 0 : length - 1;
  5292. if (!initial) {
  5293. memo = obj[_keys ? _keys[index] : index];
  5294. index += dir;
  5295. }
  5296. for (; index >= 0 && index < length; index += dir) {
  5297. var currentKey = _keys ? _keys[index] : index;
  5298. memo = iteratee(memo, obj[currentKey], currentKey, obj);
  5299. }
  5300. return memo;
  5301. };
  5302. return function(obj, iteratee, memo, context) {
  5303. var initial = arguments.length >= 3;
  5304. return reducer(obj, Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" /* default */])(iteratee, context, 4), memo, initial);
  5305. };
  5306. }
  5307. /***/ }),
  5308. /* 209 */
  5309. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5310. "use strict";
  5311. /* harmony export (immutable) */ __webpack_exports__["a"] = max;
  5312. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
  5313. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(62);
  5314. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(20);
  5315. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(54);
  5316. // Return the maximum element (or element-based computation).
  5317. function max(obj, iteratee, context) {
  5318. var result = -Infinity, lastComputed = -Infinity,
  5319. value, computed;
  5320. if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
  5321. obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
  5322. for (var i = 0, length = obj.length; i < length; i++) {
  5323. value = obj[i];
  5324. if (value != null && value > result) {
  5325. result = value;
  5326. }
  5327. }
  5328. } else {
  5329. iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(iteratee, context);
  5330. Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" /* default */])(obj, function(v, index, list) {
  5331. computed = iteratee(v, index, list);
  5332. if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
  5333. result = v;
  5334. lastComputed = computed;
  5335. }
  5336. });
  5337. }
  5338. return result;
  5339. }
  5340. /***/ }),
  5341. /* 210 */
  5342. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5343. "use strict";
  5344. /* harmony export (immutable) */ __webpack_exports__["a"] = sample;
  5345. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
  5346. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__clone_js__ = __webpack_require__(187);
  5347. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__values_js__ = __webpack_require__(62);
  5348. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__getLength_js__ = __webpack_require__(28);
  5349. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__random_js__ = __webpack_require__(193);
  5350. // Sample **n** random values from a collection using the modern version of the
  5351. // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
  5352. // If **n** is not specified, returns a single random element.
  5353. // The internal `guard` argument allows it to work with `_.map`.
  5354. function sample(obj, n, guard) {
  5355. if (n == null || guard) {
  5356. if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" /* default */])(obj);
  5357. return obj[Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" /* default */])(obj.length - 1)];
  5358. }
  5359. var sample = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? Object(__WEBPACK_IMPORTED_MODULE_1__clone_js__["a" /* default */])(obj) : Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" /* default */])(obj);
  5360. var length = Object(__WEBPACK_IMPORTED_MODULE_3__getLength_js__["a" /* default */])(sample);
  5361. n = Math.max(Math.min(n, length), 0);
  5362. var last = length - 1;
  5363. for (var index = 0; index < n; index++) {
  5364. var rand = Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" /* default */])(index, last);
  5365. var temp = sample[index];
  5366. sample[index] = sample[rand];
  5367. sample[rand] = temp;
  5368. }
  5369. return sample.slice(0, n);
  5370. }
  5371. /***/ }),
  5372. /* 211 */
  5373. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5374. "use strict";
  5375. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
  5376. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
  5377. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(82);
  5378. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__allKeys_js__ = __webpack_require__(80);
  5379. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__ = __webpack_require__(347);
  5380. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__flatten_js__ = __webpack_require__(63);
  5381. // Return a copy of the object only containing the allowed properties.
  5382. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
  5383. var result = {}, iteratee = keys[0];
  5384. if (obj == null) return result;
  5385. if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(iteratee)) {
  5386. if (keys.length > 1) iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" /* default */])(iteratee, keys[1]);
  5387. keys = Object(__WEBPACK_IMPORTED_MODULE_3__allKeys_js__["a" /* default */])(obj);
  5388. } else {
  5389. iteratee = __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__["a" /* default */];
  5390. keys = Object(__WEBPACK_IMPORTED_MODULE_5__flatten_js__["a" /* default */])(keys, false, false);
  5391. obj = Object(obj);
  5392. }
  5393. for (var i = 0, length = keys.length; i < length; i++) {
  5394. var key = keys[i];
  5395. var value = obj[key];
  5396. if (iteratee(value, key, obj)) result[key] = value;
  5397. }
  5398. return result;
  5399. }));
  5400. /***/ }),
  5401. /* 212 */
  5402. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5403. "use strict";
  5404. /* harmony export (immutable) */ __webpack_exports__["a"] = initial;
  5405. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
  5406. // Returns everything but the last entry of the array. Especially useful on
  5407. // the arguments object. Passing **n** will return all the values in
  5408. // the array, excluding the last N.
  5409. function initial(array, n, guard) {
  5410. return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
  5411. }
  5412. /***/ }),
  5413. /* 213 */
  5414. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5415. "use strict";
  5416. /* harmony export (immutable) */ __webpack_exports__["a"] = rest;
  5417. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
  5418. // Returns everything but the first entry of the `array`. Especially useful on
  5419. // the `arguments` object. Passing an **n** will return the rest N values in the
  5420. // `array`.
  5421. function rest(array, n, guard) {
  5422. return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, n == null || guard ? 1 : n);
  5423. }
  5424. /***/ }),
  5425. /* 214 */
  5426. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5427. "use strict";
  5428. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
  5429. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(63);
  5430. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_js__ = __webpack_require__(83);
  5431. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(84);
  5432. // Take the difference between one array and a number of other arrays.
  5433. // Only the elements present in just the first array will remain.
  5434. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(array, rest) {
  5435. rest = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" /* default */])(rest, true, true);
  5436. return Object(__WEBPACK_IMPORTED_MODULE_2__filter_js__["a" /* default */])(array, function(value){
  5437. return !Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(rest, value);
  5438. });
  5439. }));
  5440. /***/ }),
  5441. /* 215 */
  5442. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5443. "use strict";
  5444. /* harmony export (immutable) */ __webpack_exports__["a"] = uniq;
  5445. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isBoolean_js__ = __webpack_require__(171);
  5446. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__cb_js__ = __webpack_require__(20);
  5447. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getLength_js__ = __webpack_require__(28);
  5448. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(84);
  5449. // Produce a duplicate-free version of the array. If the array has already
  5450. // been sorted, you have the option of using a faster algorithm.
  5451. // The faster algorithm will not work with an iteratee if the iteratee
  5452. // is not a one-to-one function, so providing an iteratee will disable
  5453. // the faster algorithm.
  5454. function uniq(array, isSorted, iteratee, context) {
  5455. if (!Object(__WEBPACK_IMPORTED_MODULE_0__isBoolean_js__["a" /* default */])(isSorted)) {
  5456. context = iteratee;
  5457. iteratee = isSorted;
  5458. isSorted = false;
  5459. }
  5460. if (iteratee != null) iteratee = Object(__WEBPACK_IMPORTED_MODULE_1__cb_js__["a" /* default */])(iteratee, context);
  5461. var result = [];
  5462. var seen = [];
  5463. for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_2__getLength_js__["a" /* default */])(array); i < length; i++) {
  5464. var value = array[i],
  5465. computed = iteratee ? iteratee(value, i, array) : value;
  5466. if (isSorted && !iteratee) {
  5467. if (!i || seen !== computed) result.push(value);
  5468. seen = computed;
  5469. } else if (iteratee) {
  5470. if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(seen, computed)) {
  5471. seen.push(computed);
  5472. result.push(value);
  5473. }
  5474. } else if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(result, value)) {
  5475. result.push(value);
  5476. }
  5477. }
  5478. return result;
  5479. }
  5480. /***/ }),
  5481. /* 216 */
  5482. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5483. "use strict";
  5484. /* harmony export (immutable) */ __webpack_exports__["a"] = unzip;
  5485. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__max_js__ = __webpack_require__(209);
  5486. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
  5487. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pluck_js__ = __webpack_require__(140);
  5488. // Complement of zip. Unzip accepts an array of arrays and groups
  5489. // each array's elements on shared indices.
  5490. function unzip(array) {
  5491. var length = array && Object(__WEBPACK_IMPORTED_MODULE_0__max_js__["a" /* default */])(array, __WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */]).length || 0;
  5492. var result = Array(length);
  5493. for (var index = 0; index < length; index++) {
  5494. result[index] = Object(__WEBPACK_IMPORTED_MODULE_2__pluck_js__["a" /* default */])(array, index);
  5495. }
  5496. return result;
  5497. }
  5498. /***/ }),
  5499. /* 217 */
  5500. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5501. "use strict";
  5502. /* harmony export (immutable) */ __webpack_exports__["a"] = chainResult;
  5503. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
  5504. // Helper function to continue chaining intermediate results.
  5505. function chainResult(instance, obj) {
  5506. return instance._chain ? Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */])(obj).chain() : obj;
  5507. }
  5508. /***/ }),
  5509. /* 218 */
  5510. /***/ (function(module, exports, __webpack_require__) {
  5511. "use strict";
  5512. var $ = __webpack_require__(0);
  5513. var fails = __webpack_require__(3);
  5514. var isArray = __webpack_require__(85);
  5515. var isObject = __webpack_require__(11);
  5516. var toObject = __webpack_require__(34);
  5517. var lengthOfArrayLike = __webpack_require__(46);
  5518. var doesNotExceedSafeInteger = __webpack_require__(365);
  5519. var createProperty = __webpack_require__(106);
  5520. var arraySpeciesCreate = __webpack_require__(219);
  5521. var arrayMethodHasSpeciesSupport = __webpack_require__(107);
  5522. var wellKnownSymbol = __webpack_require__(9);
  5523. var V8_VERSION = __webpack_require__(90);
  5524. var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
  5525. // We can't use this feature detection in V8 since it causes
  5526. // deoptimization and serious performance degradation
  5527. // https://github.com/zloirock/core-js/issues/679
  5528. var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
  5529. var array = [];
  5530. array[IS_CONCAT_SPREADABLE] = false;
  5531. return array.concat()[0] !== array;
  5532. });
  5533. var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
  5534. var isConcatSpreadable = function (O) {
  5535. if (!isObject(O)) return false;
  5536. var spreadable = O[IS_CONCAT_SPREADABLE];
  5537. return spreadable !== undefined ? !!spreadable : isArray(O);
  5538. };
  5539. var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
  5540. // `Array.prototype.concat` method
  5541. // https://tc39.es/ecma262/#sec-array.prototype.concat
  5542. // with adding support of @@isConcatSpreadable and @@species
  5543. $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
  5544. // eslint-disable-next-line no-unused-vars -- required for `.length`
  5545. concat: function concat(arg) {
  5546. var O = toObject(this);
  5547. var A = arraySpeciesCreate(O, 0);
  5548. var n = 0;
  5549. var i, k, length, len, E;
  5550. for (i = -1, length = arguments.length; i < length; i++) {
  5551. E = i === -1 ? O : arguments[i];
  5552. if (isConcatSpreadable(E)) {
  5553. len = lengthOfArrayLike(E);
  5554. doesNotExceedSafeInteger(n + len);
  5555. for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
  5556. } else {
  5557. doesNotExceedSafeInteger(n + 1);
  5558. createProperty(A, n++, E);
  5559. }
  5560. }
  5561. A.length = n;
  5562. return A;
  5563. }
  5564. });
  5565. /***/ }),
  5566. /* 219 */
  5567. /***/ (function(module, exports, __webpack_require__) {
  5568. var arraySpeciesConstructor = __webpack_require__(366);
  5569. // `ArraySpeciesCreate` abstract operation
  5570. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  5571. module.exports = function (originalArray, length) {
  5572. return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
  5573. };
  5574. /***/ }),
  5575. /* 220 */
  5576. /***/ (function(module, exports, __webpack_require__) {
  5577. var $ = __webpack_require__(0);
  5578. var getBuiltIn = __webpack_require__(18);
  5579. var apply = __webpack_require__(69);
  5580. var call = __webpack_require__(13);
  5581. var uncurryThis = __webpack_require__(4);
  5582. var fails = __webpack_require__(3);
  5583. var isArray = __webpack_require__(85);
  5584. var isCallable = __webpack_require__(7);
  5585. var isObject = __webpack_require__(11);
  5586. var isSymbol = __webpack_require__(89);
  5587. var arraySlice = __webpack_require__(102);
  5588. var NATIVE_SYMBOL = __webpack_require__(57);
  5589. var $stringify = getBuiltIn('JSON', 'stringify');
  5590. var exec = uncurryThis(/./.exec);
  5591. var charAt = uncurryThis(''.charAt);
  5592. var charCodeAt = uncurryThis(''.charCodeAt);
  5593. var replace = uncurryThis(''.replace);
  5594. var numberToString = uncurryThis(1.0.toString);
  5595. var tester = /[\uD800-\uDFFF]/g;
  5596. var low = /^[\uD800-\uDBFF]$/;
  5597. var hi = /^[\uDC00-\uDFFF]$/;
  5598. var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {
  5599. var symbol = getBuiltIn('Symbol')();
  5600. // MS Edge converts symbol values to JSON as {}
  5601. return $stringify([symbol]) != '[null]'
  5602. // WebKit converts symbol values to JSON as null
  5603. || $stringify({ a: symbol }) != '{}'
  5604. // V8 throws on boxed symbols
  5605. || $stringify(Object(symbol)) != '{}';
  5606. });
  5607. // https://github.com/tc39/proposal-well-formed-stringify
  5608. var ILL_FORMED_UNICODE = fails(function () {
  5609. return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
  5610. || $stringify('\uDEAD') !== '"\\udead"';
  5611. });
  5612. var stringifyWithSymbolsFix = function (it, replacer) {
  5613. var args = arraySlice(arguments);
  5614. var $replacer = replacer;
  5615. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  5616. if (!isArray(replacer)) replacer = function (key, value) {
  5617. if (isCallable($replacer)) value = call($replacer, this, key, value);
  5618. if (!isSymbol(value)) return value;
  5619. };
  5620. args[1] = replacer;
  5621. return apply($stringify, null, args);
  5622. };
  5623. var fixIllFormed = function (match, offset, string) {
  5624. var prev = charAt(string, offset - 1);
  5625. var next = charAt(string, offset + 1);
  5626. if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {
  5627. return '\\u' + numberToString(charCodeAt(match, 0), 16);
  5628. } return match;
  5629. };
  5630. if ($stringify) {
  5631. // `JSON.stringify` method
  5632. // https://tc39.es/ecma262/#sec-json.stringify
  5633. $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
  5634. // eslint-disable-next-line no-unused-vars -- required for `.length`
  5635. stringify: function stringify(it, replacer, space) {
  5636. var args = arraySlice(arguments);
  5637. var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
  5638. return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;
  5639. }
  5640. });
  5641. }
  5642. /***/ }),
  5643. /* 221 */
  5644. /***/ (function(module, exports, __webpack_require__) {
  5645. var rng = __webpack_require__(384);
  5646. var bytesToUuid = __webpack_require__(385);
  5647. function v4(options, buf, offset) {
  5648. var i = buf && offset || 0;
  5649. if (typeof(options) == 'string') {
  5650. buf = options === 'binary' ? new Array(16) : null;
  5651. options = null;
  5652. }
  5653. options = options || {};
  5654. var rnds = options.random || (options.rng || rng)();
  5655. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  5656. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  5657. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  5658. // Copy bytes to buffer, if provided
  5659. if (buf) {
  5660. for (var ii = 0; ii < 16; ++ii) {
  5661. buf[i + ii] = rnds[ii];
  5662. }
  5663. }
  5664. return buf || bytesToUuid(rnds);
  5665. }
  5666. module.exports = v4;
  5667. /***/ }),
  5668. /* 222 */
  5669. /***/ (function(module, exports, __webpack_require__) {
  5670. var parent = __webpack_require__(388);
  5671. module.exports = parent;
  5672. /***/ }),
  5673. /* 223 */
  5674. /***/ (function(module, exports, __webpack_require__) {
  5675. "use strict";
  5676. module.exports = '4.13.4';
  5677. /***/ }),
  5678. /* 224 */
  5679. /***/ (function(module, exports, __webpack_require__) {
  5680. "use strict";
  5681. var has = Object.prototype.hasOwnProperty
  5682. , prefix = '~';
  5683. /**
  5684. * Constructor to create a storage for our `EE` objects.
  5685. * An `Events` instance is a plain object whose properties are event names.
  5686. *
  5687. * @constructor
  5688. * @api private
  5689. */
  5690. function Events() {}
  5691. //
  5692. // We try to not inherit from `Object.prototype`. In some engines creating an
  5693. // instance in this way is faster than calling `Object.create(null)` directly.
  5694. // If `Object.create(null)` is not supported we prefix the event names with a
  5695. // character to make sure that the built-in object properties are not
  5696. // overridden or used as an attack vector.
  5697. //
  5698. if (Object.create) {
  5699. Events.prototype = Object.create(null);
  5700. //
  5701. // This hack is needed because the `__proto__` property is still inherited in
  5702. // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
  5703. //
  5704. if (!new Events().__proto__) prefix = false;
  5705. }
  5706. /**
  5707. * Representation of a single event listener.
  5708. *
  5709. * @param {Function} fn The listener function.
  5710. * @param {Mixed} context The context to invoke the listener with.
  5711. * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
  5712. * @constructor
  5713. * @api private
  5714. */
  5715. function EE(fn, context, once) {
  5716. this.fn = fn;
  5717. this.context = context;
  5718. this.once = once || false;
  5719. }
  5720. /**
  5721. * Minimal `EventEmitter` interface that is molded against the Node.js
  5722. * `EventEmitter` interface.
  5723. *
  5724. * @constructor
  5725. * @api public
  5726. */
  5727. function EventEmitter() {
  5728. this._events = new Events();
  5729. this._eventsCount = 0;
  5730. }
  5731. /**
  5732. * Return an array listing the events for which the emitter has registered
  5733. * listeners.
  5734. *
  5735. * @returns {Array}
  5736. * @api public
  5737. */
  5738. EventEmitter.prototype.eventNames = function eventNames() {
  5739. var names = []
  5740. , events
  5741. , name;
  5742. if (this._eventsCount === 0) return names;
  5743. for (name in (events = this._events)) {
  5744. if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
  5745. }
  5746. if (Object.getOwnPropertySymbols) {
  5747. return names.concat(Object.getOwnPropertySymbols(events));
  5748. }
  5749. return names;
  5750. };
  5751. /**
  5752. * Return the listeners registered for a given event.
  5753. *
  5754. * @param {String|Symbol} event The event name.
  5755. * @param {Boolean} exists Only check if there are listeners.
  5756. * @returns {Array|Boolean}
  5757. * @api public
  5758. */
  5759. EventEmitter.prototype.listeners = function listeners(event, exists) {
  5760. var evt = prefix ? prefix + event : event
  5761. , available = this._events[evt];
  5762. if (exists) return !!available;
  5763. if (!available) return [];
  5764. if (available.fn) return [available.fn];
  5765. for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
  5766. ee[i] = available[i].fn;
  5767. }
  5768. return ee;
  5769. };
  5770. /**
  5771. * Calls each of the listeners registered for a given event.
  5772. *
  5773. * @param {String|Symbol} event The event name.
  5774. * @returns {Boolean} `true` if the event had listeners, else `false`.
  5775. * @api public
  5776. */
  5777. EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
  5778. var evt = prefix ? prefix + event : event;
  5779. if (!this._events[evt]) return false;
  5780. var listeners = this._events[evt]
  5781. , len = arguments.length
  5782. , args
  5783. , i;
  5784. if (listeners.fn) {
  5785. if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
  5786. switch (len) {
  5787. case 1: return listeners.fn.call(listeners.context), true;
  5788. case 2: return listeners.fn.call(listeners.context, a1), true;
  5789. case 3: return listeners.fn.call(listeners.context, a1, a2), true;
  5790. case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
  5791. case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
  5792. case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
  5793. }
  5794. for (i = 1, args = new Array(len -1); i < len; i++) {
  5795. args[i - 1] = arguments[i];
  5796. }
  5797. listeners.fn.apply(listeners.context, args);
  5798. } else {
  5799. var length = listeners.length
  5800. , j;
  5801. for (i = 0; i < length; i++) {
  5802. if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
  5803. switch (len) {
  5804. case 1: listeners[i].fn.call(listeners[i].context); break;
  5805. case 2: listeners[i].fn.call(listeners[i].context, a1); break;
  5806. case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
  5807. case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
  5808. default:
  5809. if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
  5810. args[j - 1] = arguments[j];
  5811. }
  5812. listeners[i].fn.apply(listeners[i].context, args);
  5813. }
  5814. }
  5815. }
  5816. return true;
  5817. };
  5818. /**
  5819. * Add a listener for a given event.
  5820. *
  5821. * @param {String|Symbol} event The event name.
  5822. * @param {Function} fn The listener function.
  5823. * @param {Mixed} [context=this] The context to invoke the listener with.
  5824. * @returns {EventEmitter} `this`.
  5825. * @api public
  5826. */
  5827. EventEmitter.prototype.on = function on(event, fn, context) {
  5828. var listener = new EE(fn, context || this)
  5829. , evt = prefix ? prefix + event : event;
  5830. if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
  5831. else if (!this._events[evt].fn) this._events[evt].push(listener);
  5832. else this._events[evt] = [this._events[evt], listener];
  5833. return this;
  5834. };
  5835. /**
  5836. * Add a one-time listener for a given event.
  5837. *
  5838. * @param {String|Symbol} event The event name.
  5839. * @param {Function} fn The listener function.
  5840. * @param {Mixed} [context=this] The context to invoke the listener with.
  5841. * @returns {EventEmitter} `this`.
  5842. * @api public
  5843. */
  5844. EventEmitter.prototype.once = function once(event, fn, context) {
  5845. var listener = new EE(fn, context || this, true)
  5846. , evt = prefix ? prefix + event : event;
  5847. if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
  5848. else if (!this._events[evt].fn) this._events[evt].push(listener);
  5849. else this._events[evt] = [this._events[evt], listener];
  5850. return this;
  5851. };
  5852. /**
  5853. * Remove the listeners of a given event.
  5854. *
  5855. * @param {String|Symbol} event The event name.
  5856. * @param {Function} fn Only remove the listeners that match this function.
  5857. * @param {Mixed} context Only remove the listeners that have this context.
  5858. * @param {Boolean} once Only remove one-time listeners.
  5859. * @returns {EventEmitter} `this`.
  5860. * @api public
  5861. */
  5862. EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
  5863. var evt = prefix ? prefix + event : event;
  5864. if (!this._events[evt]) return this;
  5865. if (!fn) {
  5866. if (--this._eventsCount === 0) this._events = new Events();
  5867. else delete this._events[evt];
  5868. return this;
  5869. }
  5870. var listeners = this._events[evt];
  5871. if (listeners.fn) {
  5872. if (
  5873. listeners.fn === fn
  5874. && (!once || listeners.once)
  5875. && (!context || listeners.context === context)
  5876. ) {
  5877. if (--this._eventsCount === 0) this._events = new Events();
  5878. else delete this._events[evt];
  5879. }
  5880. } else {
  5881. for (var i = 0, events = [], length = listeners.length; i < length; i++) {
  5882. if (
  5883. listeners[i].fn !== fn
  5884. || (once && !listeners[i].once)
  5885. || (context && listeners[i].context !== context)
  5886. ) {
  5887. events.push(listeners[i]);
  5888. }
  5889. }
  5890. //
  5891. // Reset the array, or remove it completely if we have no more listeners.
  5892. //
  5893. if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
  5894. else if (--this._eventsCount === 0) this._events = new Events();
  5895. else delete this._events[evt];
  5896. }
  5897. return this;
  5898. };
  5899. /**
  5900. * Remove all listeners, or those of the specified event.
  5901. *
  5902. * @param {String|Symbol} [event] The event name.
  5903. * @returns {EventEmitter} `this`.
  5904. * @api public
  5905. */
  5906. EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
  5907. var evt;
  5908. if (event) {
  5909. evt = prefix ? prefix + event : event;
  5910. if (this._events[evt]) {
  5911. if (--this._eventsCount === 0) this._events = new Events();
  5912. else delete this._events[evt];
  5913. }
  5914. } else {
  5915. this._events = new Events();
  5916. this._eventsCount = 0;
  5917. }
  5918. return this;
  5919. };
  5920. //
  5921. // Alias methods names because people roll like that.
  5922. //
  5923. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  5924. EventEmitter.prototype.addListener = EventEmitter.prototype.on;
  5925. //
  5926. // This function doesn't apply anymore.
  5927. //
  5928. EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
  5929. return this;
  5930. };
  5931. //
  5932. // Expose the prefix.
  5933. //
  5934. EventEmitter.prefixed = prefix;
  5935. //
  5936. // Allow `EventEmitter` to be imported as module namespace.
  5937. //
  5938. EventEmitter.EventEmitter = EventEmitter;
  5939. //
  5940. // Expose the module.
  5941. //
  5942. if (true) {
  5943. module.exports = EventEmitter;
  5944. }
  5945. /***/ }),
  5946. /* 225 */
  5947. /***/ (function(module, exports, __webpack_require__) {
  5948. "use strict";
  5949. var _interopRequireDefault = __webpack_require__(1);
  5950. var _promise = _interopRequireDefault(__webpack_require__(12));
  5951. var _require = __webpack_require__(68),
  5952. getAdapter = _require.getAdapter;
  5953. var syncApiNames = ['getItem', 'setItem', 'removeItem', 'clear'];
  5954. var localStorage = {
  5955. get async() {
  5956. return getAdapter('storage').async;
  5957. }
  5958. }; // wrap sync apis with async ones.
  5959. syncApiNames.forEach(function (apiName) {
  5960. localStorage[apiName + 'Async'] = function () {
  5961. var storage = getAdapter('storage');
  5962. return _promise.default.resolve(storage[apiName].apply(storage, arguments));
  5963. };
  5964. localStorage[apiName] = function () {
  5965. var storage = getAdapter('storage');
  5966. if (!storage.async) {
  5967. return storage[apiName].apply(storage, arguments);
  5968. }
  5969. var error = new Error('Synchronous API [' + apiName + '] is not available in this runtime.');
  5970. error.code = 'SYNC_API_NOT_AVAILABLE';
  5971. throw error;
  5972. };
  5973. });
  5974. module.exports = localStorage;
  5975. /***/ }),
  5976. /* 226 */
  5977. /***/ (function(module, exports, __webpack_require__) {
  5978. "use strict";
  5979. var _interopRequireDefault = __webpack_require__(1);
  5980. var _concat = _interopRequireDefault(__webpack_require__(30));
  5981. var _stringify = _interopRequireDefault(__webpack_require__(36));
  5982. var storage = __webpack_require__(225);
  5983. var AV = __webpack_require__(65);
  5984. var removeAsync = exports.removeAsync = storage.removeItemAsync.bind(storage);
  5985. var getCacheData = function getCacheData(cacheData, key) {
  5986. try {
  5987. cacheData = JSON.parse(cacheData);
  5988. } catch (e) {
  5989. return null;
  5990. }
  5991. if (cacheData) {
  5992. var expired = cacheData.expiredAt && cacheData.expiredAt < Date.now();
  5993. if (!expired) {
  5994. return cacheData.value;
  5995. }
  5996. return removeAsync(key).then(function () {
  5997. return null;
  5998. });
  5999. }
  6000. return null;
  6001. };
  6002. exports.getAsync = function (key) {
  6003. var _context;
  6004. key = (0, _concat.default)(_context = "AV/".concat(AV.applicationId, "/")).call(_context, key);
  6005. return storage.getItemAsync(key).then(function (cache) {
  6006. return getCacheData(cache, key);
  6007. });
  6008. };
  6009. exports.setAsync = function (key, value, ttl) {
  6010. var _context2;
  6011. var cache = {
  6012. value: value
  6013. };
  6014. if (typeof ttl === 'number') {
  6015. cache.expiredAt = Date.now() + ttl;
  6016. }
  6017. return storage.setItemAsync((0, _concat.default)(_context2 = "AV/".concat(AV.applicationId, "/")).call(_context2, key), (0, _stringify.default)(cache));
  6018. };
  6019. /***/ }),
  6020. /* 227 */
  6021. /***/ (function(module, exports, __webpack_require__) {
  6022. module.exports = __webpack_require__(228);
  6023. /***/ }),
  6024. /* 228 */
  6025. /***/ (function(module, exports, __webpack_require__) {
  6026. var parent = __webpack_require__(390);
  6027. module.exports = parent;
  6028. /***/ }),
  6029. /* 229 */
  6030. /***/ (function(module, exports, __webpack_require__) {
  6031. var parent = __webpack_require__(393);
  6032. module.exports = parent;
  6033. /***/ }),
  6034. /* 230 */
  6035. /***/ (function(module, exports, __webpack_require__) {
  6036. var parent = __webpack_require__(396);
  6037. module.exports = parent;
  6038. /***/ }),
  6039. /* 231 */
  6040. /***/ (function(module, exports, __webpack_require__) {
  6041. module.exports = __webpack_require__(399);
  6042. /***/ }),
  6043. /* 232 */
  6044. /***/ (function(module, exports, __webpack_require__) {
  6045. var parent = __webpack_require__(402);
  6046. __webpack_require__(51);
  6047. module.exports = parent;
  6048. /***/ }),
  6049. /* 233 */
  6050. /***/ (function(module, exports, __webpack_require__) {
  6051. // TODO: Remove this module from `core-js@4` since it's split to modules listed below
  6052. __webpack_require__(403);
  6053. __webpack_require__(405);
  6054. __webpack_require__(406);
  6055. __webpack_require__(220);
  6056. __webpack_require__(407);
  6057. /***/ }),
  6058. /* 234 */
  6059. /***/ (function(module, exports, __webpack_require__) {
  6060. /* eslint-disable es-x/no-object-getownpropertynames -- safe */
  6061. var classof = __webpack_require__(56);
  6062. var toIndexedObject = __webpack_require__(33);
  6063. var $getOwnPropertyNames = __webpack_require__(96).f;
  6064. var arraySlice = __webpack_require__(404);
  6065. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  6066. ? Object.getOwnPropertyNames(window) : [];
  6067. var getWindowNames = function (it) {
  6068. try {
  6069. return $getOwnPropertyNames(it);
  6070. } catch (error) {
  6071. return arraySlice(windowNames);
  6072. }
  6073. };
  6074. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  6075. module.exports.f = function getOwnPropertyNames(it) {
  6076. return windowNames && classof(it) == 'Window'
  6077. ? getWindowNames(it)
  6078. : $getOwnPropertyNames(toIndexedObject(it));
  6079. };
  6080. /***/ }),
  6081. /* 235 */
  6082. /***/ (function(module, exports, __webpack_require__) {
  6083. var call = __webpack_require__(13);
  6084. var getBuiltIn = __webpack_require__(18);
  6085. var wellKnownSymbol = __webpack_require__(9);
  6086. var defineBuiltIn = __webpack_require__(39);
  6087. module.exports = function () {
  6088. var Symbol = getBuiltIn('Symbol');
  6089. var SymbolPrototype = Symbol && Symbol.prototype;
  6090. var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
  6091. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  6092. if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
  6093. // `Symbol.prototype[@@toPrimitive]` method
  6094. // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
  6095. // eslint-disable-next-line no-unused-vars -- required for .length
  6096. defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {
  6097. return call(valueOf, this);
  6098. }, { arity: 1 });
  6099. }
  6100. };
  6101. /***/ }),
  6102. /* 236 */
  6103. /***/ (function(module, exports, __webpack_require__) {
  6104. var NATIVE_SYMBOL = __webpack_require__(57);
  6105. /* eslint-disable es-x/no-symbol -- safe */
  6106. module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;
  6107. /***/ }),
  6108. /* 237 */
  6109. /***/ (function(module, exports, __webpack_require__) {
  6110. var defineWellKnownSymbol = __webpack_require__(8);
  6111. // `Symbol.iterator` well-known symbol
  6112. // https://tc39.es/ecma262/#sec-symbol.iterator
  6113. defineWellKnownSymbol('iterator');
  6114. /***/ }),
  6115. /* 238 */
  6116. /***/ (function(module, exports, __webpack_require__) {
  6117. var parent = __webpack_require__(436);
  6118. __webpack_require__(51);
  6119. module.exports = parent;
  6120. /***/ }),
  6121. /* 239 */
  6122. /***/ (function(module, exports, __webpack_require__) {
  6123. var parent = __webpack_require__(456);
  6124. module.exports = parent;
  6125. /***/ }),
  6126. /* 240 */
  6127. /***/ (function(module, exports, __webpack_require__) {
  6128. module.exports = __webpack_require__(232);
  6129. /***/ }),
  6130. /* 241 */
  6131. /***/ (function(module, exports, __webpack_require__) {
  6132. module.exports = __webpack_require__(460);
  6133. /***/ }),
  6134. /* 242 */
  6135. /***/ (function(module, exports, __webpack_require__) {
  6136. "use strict";
  6137. var uncurryThis = __webpack_require__(4);
  6138. var aCallable = __webpack_require__(31);
  6139. var isObject = __webpack_require__(11);
  6140. var hasOwn = __webpack_require__(14);
  6141. var arraySlice = __webpack_require__(102);
  6142. var NATIVE_BIND = __webpack_require__(70);
  6143. var $Function = Function;
  6144. var concat = uncurryThis([].concat);
  6145. var join = uncurryThis([].join);
  6146. var factories = {};
  6147. var construct = function (C, argsLength, args) {
  6148. if (!hasOwn(factories, argsLength)) {
  6149. for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
  6150. factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
  6151. } return factories[argsLength](C, args);
  6152. };
  6153. // `Function.prototype.bind` method implementation
  6154. // https://tc39.es/ecma262/#sec-function.prototype.bind
  6155. module.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {
  6156. var F = aCallable(this);
  6157. var Prototype = F.prototype;
  6158. var partArgs = arraySlice(arguments, 1);
  6159. var boundFunction = function bound(/* args... */) {
  6160. var args = concat(partArgs, arraySlice(arguments));
  6161. return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
  6162. };
  6163. if (isObject(Prototype)) boundFunction.prototype = Prototype;
  6164. return boundFunction;
  6165. };
  6166. /***/ }),
  6167. /* 243 */
  6168. /***/ (function(module, exports, __webpack_require__) {
  6169. module.exports = __webpack_require__(481);
  6170. /***/ }),
  6171. /* 244 */
  6172. /***/ (function(module, exports, __webpack_require__) {
  6173. module.exports = __webpack_require__(484);
  6174. /***/ }),
  6175. /* 245 */
  6176. /***/ (function(module, exports) {
  6177. var charenc = {
  6178. // UTF-8 encoding
  6179. utf8: {
  6180. // Convert a string to a byte array
  6181. stringToBytes: function(str) {
  6182. return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
  6183. },
  6184. // Convert a byte array to a string
  6185. bytesToString: function(bytes) {
  6186. return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
  6187. }
  6188. },
  6189. // Binary encoding
  6190. bin: {
  6191. // Convert a string to a byte array
  6192. stringToBytes: function(str) {
  6193. for (var bytes = [], i = 0; i < str.length; i++)
  6194. bytes.push(str.charCodeAt(i) & 0xFF);
  6195. return bytes;
  6196. },
  6197. // Convert a byte array to a string
  6198. bytesToString: function(bytes) {
  6199. for (var str = [], i = 0; i < bytes.length; i++)
  6200. str.push(String.fromCharCode(bytes[i]));
  6201. return str.join('');
  6202. }
  6203. }
  6204. };
  6205. module.exports = charenc;
  6206. /***/ }),
  6207. /* 246 */
  6208. /***/ (function(module, exports, __webpack_require__) {
  6209. module.exports = __webpack_require__(528);
  6210. /***/ }),
  6211. /* 247 */
  6212. /***/ (function(module, exports, __webpack_require__) {
  6213. var fails = __webpack_require__(3);
  6214. var isObject = __webpack_require__(11);
  6215. var classof = __webpack_require__(56);
  6216. var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(561);
  6217. // eslint-disable-next-line es-x/no-object-isextensible -- safe
  6218. var $isExtensible = Object.isExtensible;
  6219. var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
  6220. // `Object.isExtensible` method
  6221. // https://tc39.es/ecma262/#sec-object.isextensible
  6222. module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {
  6223. if (!isObject(it)) return false;
  6224. if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return false;
  6225. return $isExtensible ? $isExtensible(it) : true;
  6226. } : $isExtensible;
  6227. /***/ }),
  6228. /* 248 */
  6229. /***/ (function(module, exports, __webpack_require__) {
  6230. "use strict";
  6231. var $ = __webpack_require__(0);
  6232. var global = __webpack_require__(6);
  6233. var InternalMetadataModule = __webpack_require__(111);
  6234. var fails = __webpack_require__(3);
  6235. var createNonEnumerableProperty = __webpack_require__(35);
  6236. var iterate = __webpack_require__(37);
  6237. var anInstance = __webpack_require__(100);
  6238. var isCallable = __webpack_require__(7);
  6239. var isObject = __webpack_require__(11);
  6240. var setToStringTag = __webpack_require__(49);
  6241. var defineProperty = __webpack_require__(22).f;
  6242. var forEach = __webpack_require__(66).forEach;
  6243. var DESCRIPTORS = __webpack_require__(16);
  6244. var InternalStateModule = __webpack_require__(38);
  6245. var setInternalState = InternalStateModule.set;
  6246. var internalStateGetterFor = InternalStateModule.getterFor;
  6247. module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
  6248. var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
  6249. var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
  6250. var ADDER = IS_MAP ? 'set' : 'add';
  6251. var NativeConstructor = global[CONSTRUCTOR_NAME];
  6252. var NativePrototype = NativeConstructor && NativeConstructor.prototype;
  6253. var exported = {};
  6254. var Constructor;
  6255. if (!DESCRIPTORS || !isCallable(NativeConstructor)
  6256. || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); }))
  6257. ) {
  6258. // create collection constructor
  6259. Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
  6260. InternalMetadataModule.enable();
  6261. } else {
  6262. Constructor = wrapper(function (target, iterable) {
  6263. setInternalState(anInstance(target, Prototype), {
  6264. type: CONSTRUCTOR_NAME,
  6265. collection: new NativeConstructor()
  6266. });
  6267. if (iterable != undefined) iterate(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });
  6268. });
  6269. var Prototype = Constructor.prototype;
  6270. var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
  6271. forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {
  6272. var IS_ADDER = KEY == 'add' || KEY == 'set';
  6273. if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {
  6274. createNonEnumerableProperty(Prototype, KEY, function (a, b) {
  6275. var collection = getInternalState(this).collection;
  6276. if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
  6277. var result = collection[KEY](a === 0 ? 0 : a, b);
  6278. return IS_ADDER ? this : result;
  6279. });
  6280. }
  6281. });
  6282. IS_WEAK || defineProperty(Prototype, 'size', {
  6283. configurable: true,
  6284. get: function () {
  6285. return getInternalState(this).collection.size;
  6286. }
  6287. });
  6288. }
  6289. setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);
  6290. exported[CONSTRUCTOR_NAME] = Constructor;
  6291. $({ global: true, forced: true }, exported);
  6292. if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
  6293. return Constructor;
  6294. };
  6295. /***/ }),
  6296. /* 249 */
  6297. /***/ (function(module, exports, __webpack_require__) {
  6298. "use strict";
  6299. var AV = __webpack_require__(250);
  6300. var useAdatpers = __webpack_require__(545);
  6301. module.exports = useAdatpers(AV);
  6302. /***/ }),
  6303. /* 250 */
  6304. /***/ (function(module, exports, __webpack_require__) {
  6305. "use strict";
  6306. module.exports = __webpack_require__(251);
  6307. /***/ }),
  6308. /* 251 */
  6309. /***/ (function(module, exports, __webpack_require__) {
  6310. "use strict";
  6311. var _interopRequireDefault = __webpack_require__(1);
  6312. var _promise = _interopRequireDefault(__webpack_require__(12));
  6313. /*!
  6314. * LeanCloud JavaScript SDK
  6315. * https://leancloud.cn
  6316. *
  6317. * Copyright 2016 LeanCloud.cn, Inc.
  6318. * The LeanCloud JavaScript SDK is freely distributable under the MIT license.
  6319. */
  6320. var _ = __webpack_require__(2);
  6321. var AV = __webpack_require__(65);
  6322. AV._ = _;
  6323. AV.version = __webpack_require__(223);
  6324. AV.Promise = _promise.default;
  6325. AV.localStorage = __webpack_require__(225);
  6326. AV.Cache = __webpack_require__(226);
  6327. AV.Error = __webpack_require__(43);
  6328. __webpack_require__(392);
  6329. __webpack_require__(443)(AV);
  6330. __webpack_require__(444)(AV);
  6331. __webpack_require__(445)(AV);
  6332. __webpack_require__(446)(AV);
  6333. __webpack_require__(451)(AV);
  6334. __webpack_require__(452)(AV);
  6335. __webpack_require__(506)(AV);
  6336. __webpack_require__(531)(AV);
  6337. __webpack_require__(532)(AV);
  6338. __webpack_require__(534)(AV);
  6339. __webpack_require__(535)(AV);
  6340. __webpack_require__(536)(AV);
  6341. __webpack_require__(537)(AV);
  6342. __webpack_require__(538)(AV);
  6343. __webpack_require__(539)(AV);
  6344. __webpack_require__(540)(AV);
  6345. __webpack_require__(541)(AV);
  6346. __webpack_require__(542)(AV);
  6347. AV.Conversation = __webpack_require__(543);
  6348. __webpack_require__(544);
  6349. module.exports = AV;
  6350. /**
  6351. * Options to controll the authentication for an operation
  6352. * @typedef {Object} AuthOptions
  6353. * @property {String} [sessionToken] Specify a user to excute the operation as.
  6354. * @property {AV.User} [user] Specify a user to excute the operation as. The user must have _sessionToken. This option will be ignored if sessionToken option provided.
  6355. * @property {Boolean} [useMasterKey] Indicates whether masterKey is used for this operation. Only valid when masterKey is set.
  6356. */
  6357. /**
  6358. * Options to controll the authentication for an SMS operation
  6359. * @typedef {Object} SMSAuthOptions
  6360. * @property {String} [sessionToken] Specify a user to excute the operation as.
  6361. * @property {AV.User} [user] Specify a user to excute the operation as. The user must have _sessionToken. This option will be ignored if sessionToken option provided.
  6362. * @property {Boolean} [useMasterKey] Indicates whether masterKey is used for this operation. Only valid when masterKey is set.
  6363. * @property {String} [validateToken] a validate token returned by {@link AV.Cloud.verifyCaptcha}
  6364. */
  6365. /***/ }),
  6366. /* 252 */
  6367. /***/ (function(module, exports, __webpack_require__) {
  6368. var parent = __webpack_require__(253);
  6369. __webpack_require__(51);
  6370. module.exports = parent;
  6371. /***/ }),
  6372. /* 253 */
  6373. /***/ (function(module, exports, __webpack_require__) {
  6374. __webpack_require__(254);
  6375. __webpack_require__(48);
  6376. __webpack_require__(60);
  6377. __webpack_require__(271);
  6378. __webpack_require__(285);
  6379. __webpack_require__(286);
  6380. __webpack_require__(287);
  6381. __webpack_require__(78);
  6382. var path = __webpack_require__(10);
  6383. module.exports = path.Promise;
  6384. /***/ }),
  6385. /* 254 */
  6386. /***/ (function(module, exports, __webpack_require__) {
  6387. // TODO: Remove this module from `core-js@4` since it's replaced to module below
  6388. __webpack_require__(255);
  6389. /***/ }),
  6390. /* 255 */
  6391. /***/ (function(module, exports, __webpack_require__) {
  6392. "use strict";
  6393. var $ = __webpack_require__(0);
  6394. var isPrototypeOf = __webpack_require__(21);
  6395. var getPrototypeOf = __webpack_require__(93);
  6396. var setPrototypeOf = __webpack_require__(95);
  6397. var copyConstructorProperties = __webpack_require__(260);
  6398. var create = __webpack_require__(47);
  6399. var createNonEnumerableProperty = __webpack_require__(35);
  6400. var createPropertyDescriptor = __webpack_require__(44);
  6401. var clearErrorStack = __webpack_require__(264);
  6402. var installErrorCause = __webpack_require__(265);
  6403. var iterate = __webpack_require__(37);
  6404. var normalizeStringArgument = __webpack_require__(266);
  6405. var wellKnownSymbol = __webpack_require__(9);
  6406. var ERROR_STACK_INSTALLABLE = __webpack_require__(267);
  6407. var TO_STRING_TAG = wellKnownSymbol('toStringTag');
  6408. var $Error = Error;
  6409. var push = [].push;
  6410. var $AggregateError = function AggregateError(errors, message /* , options */) {
  6411. var options = arguments.length > 2 ? arguments[2] : undefined;
  6412. var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
  6413. var that;
  6414. if (setPrototypeOf) {
  6415. that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
  6416. } else {
  6417. that = isInstance ? this : create(AggregateErrorPrototype);
  6418. createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
  6419. }
  6420. if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));
  6421. if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1));
  6422. installErrorCause(that, options);
  6423. var errorsArray = [];
  6424. iterate(errors, push, { that: errorsArray });
  6425. createNonEnumerableProperty(that, 'errors', errorsArray);
  6426. return that;
  6427. };
  6428. if (setPrototypeOf) setPrototypeOf($AggregateError, $Error);
  6429. else copyConstructorProperties($AggregateError, $Error, { name: true });
  6430. var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, {
  6431. constructor: createPropertyDescriptor(1, $AggregateError),
  6432. message: createPropertyDescriptor(1, ''),
  6433. name: createPropertyDescriptor(1, 'AggregateError')
  6434. });
  6435. // `AggregateError` constructor
  6436. // https://tc39.es/ecma262/#sec-aggregate-error-constructor
  6437. $({ global: true, constructor: true, arity: 2 }, {
  6438. AggregateError: $AggregateError
  6439. });
  6440. /***/ }),
  6441. /* 256 */
  6442. /***/ (function(module, exports, __webpack_require__) {
  6443. var call = __webpack_require__(13);
  6444. var isObject = __webpack_require__(11);
  6445. var isSymbol = __webpack_require__(89);
  6446. var getMethod = __webpack_require__(116);
  6447. var ordinaryToPrimitive = __webpack_require__(257);
  6448. var wellKnownSymbol = __webpack_require__(9);
  6449. var $TypeError = TypeError;
  6450. var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
  6451. // `ToPrimitive` abstract operation
  6452. // https://tc39.es/ecma262/#sec-toprimitive
  6453. module.exports = function (input, pref) {
  6454. if (!isObject(input) || isSymbol(input)) return input;
  6455. var exoticToPrim = getMethod(input, TO_PRIMITIVE);
  6456. var result;
  6457. if (exoticToPrim) {
  6458. if (pref === undefined) pref = 'default';
  6459. result = call(exoticToPrim, input, pref);
  6460. if (!isObject(result) || isSymbol(result)) return result;
  6461. throw $TypeError("Can't convert object to primitive value");
  6462. }
  6463. if (pref === undefined) pref = 'number';
  6464. return ordinaryToPrimitive(input, pref);
  6465. };
  6466. /***/ }),
  6467. /* 257 */
  6468. /***/ (function(module, exports, __webpack_require__) {
  6469. var call = __webpack_require__(13);
  6470. var isCallable = __webpack_require__(7);
  6471. var isObject = __webpack_require__(11);
  6472. var $TypeError = TypeError;
  6473. // `OrdinaryToPrimitive` abstract operation
  6474. // https://tc39.es/ecma262/#sec-ordinarytoprimitive
  6475. module.exports = function (input, pref) {
  6476. var fn, val;
  6477. if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
  6478. if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
  6479. if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
  6480. throw $TypeError("Can't convert object to primitive value");
  6481. };
  6482. /***/ }),
  6483. /* 258 */
  6484. /***/ (function(module, exports, __webpack_require__) {
  6485. var global = __webpack_require__(6);
  6486. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  6487. var defineProperty = Object.defineProperty;
  6488. module.exports = function (key, value) {
  6489. try {
  6490. defineProperty(global, key, { value: value, configurable: true, writable: true });
  6491. } catch (error) {
  6492. global[key] = value;
  6493. } return value;
  6494. };
  6495. /***/ }),
  6496. /* 259 */
  6497. /***/ (function(module, exports, __webpack_require__) {
  6498. var isCallable = __webpack_require__(7);
  6499. var $String = String;
  6500. var $TypeError = TypeError;
  6501. module.exports = function (argument) {
  6502. if (typeof argument == 'object' || isCallable(argument)) return argument;
  6503. throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
  6504. };
  6505. /***/ }),
  6506. /* 260 */
  6507. /***/ (function(module, exports, __webpack_require__) {
  6508. var hasOwn = __webpack_require__(14);
  6509. var ownKeys = __webpack_require__(261);
  6510. var getOwnPropertyDescriptorModule = __webpack_require__(71);
  6511. var definePropertyModule = __webpack_require__(22);
  6512. module.exports = function (target, source, exceptions) {
  6513. var keys = ownKeys(source);
  6514. var defineProperty = definePropertyModule.f;
  6515. var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  6516. for (var i = 0; i < keys.length; i++) {
  6517. var key = keys[i];
  6518. if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
  6519. defineProperty(target, key, getOwnPropertyDescriptor(source, key));
  6520. }
  6521. }
  6522. };
  6523. /***/ }),
  6524. /* 261 */
  6525. /***/ (function(module, exports, __webpack_require__) {
  6526. var getBuiltIn = __webpack_require__(18);
  6527. var uncurryThis = __webpack_require__(4);
  6528. var getOwnPropertyNamesModule = __webpack_require__(96);
  6529. var getOwnPropertySymbolsModule = __webpack_require__(97);
  6530. var anObject = __webpack_require__(19);
  6531. var concat = uncurryThis([].concat);
  6532. // all object keys, includes non-enumerable and symbols
  6533. module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
  6534. var keys = getOwnPropertyNamesModule.f(anObject(it));
  6535. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  6536. return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
  6537. };
  6538. /***/ }),
  6539. /* 262 */
  6540. /***/ (function(module, exports) {
  6541. var ceil = Math.ceil;
  6542. var floor = Math.floor;
  6543. // `Math.trunc` method
  6544. // https://tc39.es/ecma262/#sec-math.trunc
  6545. // eslint-disable-next-line es-x/no-math-trunc -- safe
  6546. module.exports = Math.trunc || function trunc(x) {
  6547. var n = +x;
  6548. return (n > 0 ? floor : ceil)(n);
  6549. };
  6550. /***/ }),
  6551. /* 263 */
  6552. /***/ (function(module, exports, __webpack_require__) {
  6553. var toIntegerOrInfinity = __webpack_require__(120);
  6554. var min = Math.min;
  6555. // `ToLength` abstract operation
  6556. // https://tc39.es/ecma262/#sec-tolength
  6557. module.exports = function (argument) {
  6558. return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
  6559. };
  6560. /***/ }),
  6561. /* 264 */
  6562. /***/ (function(module, exports, __webpack_require__) {
  6563. var uncurryThis = __webpack_require__(4);
  6564. var $Error = Error;
  6565. var replace = uncurryThis(''.replace);
  6566. var TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');
  6567. var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
  6568. var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
  6569. module.exports = function (stack, dropEntries) {
  6570. if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
  6571. while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
  6572. } return stack;
  6573. };
  6574. /***/ }),
  6575. /* 265 */
  6576. /***/ (function(module, exports, __webpack_require__) {
  6577. var isObject = __webpack_require__(11);
  6578. var createNonEnumerableProperty = __webpack_require__(35);
  6579. // `InstallErrorCause` abstract operation
  6580. // https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
  6581. module.exports = function (O, options) {
  6582. if (isObject(options) && 'cause' in options) {
  6583. createNonEnumerableProperty(O, 'cause', options.cause);
  6584. }
  6585. };
  6586. /***/ }),
  6587. /* 266 */
  6588. /***/ (function(module, exports, __webpack_require__) {
  6589. var toString = __webpack_require__(75);
  6590. module.exports = function (argument, $default) {
  6591. return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
  6592. };
  6593. /***/ }),
  6594. /* 267 */
  6595. /***/ (function(module, exports, __webpack_require__) {
  6596. var fails = __webpack_require__(3);
  6597. var createPropertyDescriptor = __webpack_require__(44);
  6598. module.exports = !fails(function () {
  6599. var error = Error('a');
  6600. if (!('stack' in error)) return true;
  6601. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  6602. Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
  6603. return error.stack !== 7;
  6604. });
  6605. /***/ }),
  6606. /* 268 */
  6607. /***/ (function(module, exports, __webpack_require__) {
  6608. var DESCRIPTORS = __webpack_require__(16);
  6609. var hasOwn = __webpack_require__(14);
  6610. var FunctionPrototype = Function.prototype;
  6611. // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
  6612. var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
  6613. var EXISTS = hasOwn(FunctionPrototype, 'name');
  6614. // additional protection from minified / mangled / dropped function names
  6615. var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
  6616. var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
  6617. module.exports = {
  6618. EXISTS: EXISTS,
  6619. PROPER: PROPER,
  6620. CONFIGURABLE: CONFIGURABLE
  6621. };
  6622. /***/ }),
  6623. /* 269 */
  6624. /***/ (function(module, exports, __webpack_require__) {
  6625. "use strict";
  6626. var IteratorPrototype = __webpack_require__(161).IteratorPrototype;
  6627. var create = __webpack_require__(47);
  6628. var createPropertyDescriptor = __webpack_require__(44);
  6629. var setToStringTag = __webpack_require__(49);
  6630. var Iterators = __webpack_require__(58);
  6631. var returnThis = function () { return this; };
  6632. module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
  6633. var TO_STRING_TAG = NAME + ' Iterator';
  6634. IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
  6635. setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
  6636. Iterators[TO_STRING_TAG] = returnThis;
  6637. return IteratorConstructor;
  6638. };
  6639. /***/ }),
  6640. /* 270 */
  6641. /***/ (function(module, exports, __webpack_require__) {
  6642. "use strict";
  6643. var TO_STRING_TAG_SUPPORT = __webpack_require__(122);
  6644. var classof = __webpack_require__(59);
  6645. // `Object.prototype.toString` method implementation
  6646. // https://tc39.es/ecma262/#sec-object.prototype.tostring
  6647. module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
  6648. return '[object ' + classof(this) + ']';
  6649. };
  6650. /***/ }),
  6651. /* 271 */
  6652. /***/ (function(module, exports, __webpack_require__) {
  6653. // TODO: Remove this module from `core-js@4` since it's split to modules listed below
  6654. __webpack_require__(272);
  6655. __webpack_require__(280);
  6656. __webpack_require__(281);
  6657. __webpack_require__(282);
  6658. __webpack_require__(283);
  6659. __webpack_require__(284);
  6660. /***/ }),
  6661. /* 272 */
  6662. /***/ (function(module, exports, __webpack_require__) {
  6663. "use strict";
  6664. var $ = __webpack_require__(0);
  6665. var IS_PURE = __webpack_require__(32);
  6666. var IS_NODE = __webpack_require__(125);
  6667. var global = __webpack_require__(6);
  6668. var call = __webpack_require__(13);
  6669. var defineBuiltIn = __webpack_require__(39);
  6670. var setPrototypeOf = __webpack_require__(95);
  6671. var setToStringTag = __webpack_require__(49);
  6672. var setSpecies = __webpack_require__(162);
  6673. var aCallable = __webpack_require__(31);
  6674. var isCallable = __webpack_require__(7);
  6675. var isObject = __webpack_require__(11);
  6676. var anInstance = __webpack_require__(100);
  6677. var speciesConstructor = __webpack_require__(163);
  6678. var task = __webpack_require__(165).set;
  6679. var microtask = __webpack_require__(274);
  6680. var hostReportErrors = __webpack_require__(277);
  6681. var perform = __webpack_require__(76);
  6682. var Queue = __webpack_require__(278);
  6683. var InternalStateModule = __webpack_require__(38);
  6684. var NativePromiseConstructor = __webpack_require__(61);
  6685. var PromiseConstructorDetection = __webpack_require__(77);
  6686. var newPromiseCapabilityModule = __webpack_require__(50);
  6687. var PROMISE = 'Promise';
  6688. var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
  6689. var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
  6690. var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
  6691. var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
  6692. var setInternalState = InternalStateModule.set;
  6693. var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
  6694. var PromiseConstructor = NativePromiseConstructor;
  6695. var PromisePrototype = NativePromisePrototype;
  6696. var TypeError = global.TypeError;
  6697. var document = global.document;
  6698. var process = global.process;
  6699. var newPromiseCapability = newPromiseCapabilityModule.f;
  6700. var newGenericPromiseCapability = newPromiseCapability;
  6701. var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
  6702. var UNHANDLED_REJECTION = 'unhandledrejection';
  6703. var REJECTION_HANDLED = 'rejectionhandled';
  6704. var PENDING = 0;
  6705. var FULFILLED = 1;
  6706. var REJECTED = 2;
  6707. var HANDLED = 1;
  6708. var UNHANDLED = 2;
  6709. var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
  6710. // helpers
  6711. var isThenable = function (it) {
  6712. var then;
  6713. return isObject(it) && isCallable(then = it.then) ? then : false;
  6714. };
  6715. var callReaction = function (reaction, state) {
  6716. var value = state.value;
  6717. var ok = state.state == FULFILLED;
  6718. var handler = ok ? reaction.ok : reaction.fail;
  6719. var resolve = reaction.resolve;
  6720. var reject = reaction.reject;
  6721. var domain = reaction.domain;
  6722. var result, then, exited;
  6723. try {
  6724. if (handler) {
  6725. if (!ok) {
  6726. if (state.rejection === UNHANDLED) onHandleUnhandled(state);
  6727. state.rejection = HANDLED;
  6728. }
  6729. if (handler === true) result = value;
  6730. else {
  6731. if (domain) domain.enter();
  6732. result = handler(value); // can throw
  6733. if (domain) {
  6734. domain.exit();
  6735. exited = true;
  6736. }
  6737. }
  6738. if (result === reaction.promise) {
  6739. reject(TypeError('Promise-chain cycle'));
  6740. } else if (then = isThenable(result)) {
  6741. call(then, result, resolve, reject);
  6742. } else resolve(result);
  6743. } else reject(value);
  6744. } catch (error) {
  6745. if (domain && !exited) domain.exit();
  6746. reject(error);
  6747. }
  6748. };
  6749. var notify = function (state, isReject) {
  6750. if (state.notified) return;
  6751. state.notified = true;
  6752. microtask(function () {
  6753. var reactions = state.reactions;
  6754. var reaction;
  6755. while (reaction = reactions.get()) {
  6756. callReaction(reaction, state);
  6757. }
  6758. state.notified = false;
  6759. if (isReject && !state.rejection) onUnhandled(state);
  6760. });
  6761. };
  6762. var dispatchEvent = function (name, promise, reason) {
  6763. var event, handler;
  6764. if (DISPATCH_EVENT) {
  6765. event = document.createEvent('Event');
  6766. event.promise = promise;
  6767. event.reason = reason;
  6768. event.initEvent(name, false, true);
  6769. global.dispatchEvent(event);
  6770. } else event = { promise: promise, reason: reason };
  6771. if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
  6772. else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
  6773. };
  6774. var onUnhandled = function (state) {
  6775. call(task, global, function () {
  6776. var promise = state.facade;
  6777. var value = state.value;
  6778. var IS_UNHANDLED = isUnhandled(state);
  6779. var result;
  6780. if (IS_UNHANDLED) {
  6781. result = perform(function () {
  6782. if (IS_NODE) {
  6783. process.emit('unhandledRejection', value, promise);
  6784. } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
  6785. });
  6786. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  6787. state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
  6788. if (result.error) throw result.value;
  6789. }
  6790. });
  6791. };
  6792. var isUnhandled = function (state) {
  6793. return state.rejection !== HANDLED && !state.parent;
  6794. };
  6795. var onHandleUnhandled = function (state) {
  6796. call(task, global, function () {
  6797. var promise = state.facade;
  6798. if (IS_NODE) {
  6799. process.emit('rejectionHandled', promise);
  6800. } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
  6801. });
  6802. };
  6803. var bind = function (fn, state, unwrap) {
  6804. return function (value) {
  6805. fn(state, value, unwrap);
  6806. };
  6807. };
  6808. var internalReject = function (state, value, unwrap) {
  6809. if (state.done) return;
  6810. state.done = true;
  6811. if (unwrap) state = unwrap;
  6812. state.value = value;
  6813. state.state = REJECTED;
  6814. notify(state, true);
  6815. };
  6816. var internalResolve = function (state, value, unwrap) {
  6817. if (state.done) return;
  6818. state.done = true;
  6819. if (unwrap) state = unwrap;
  6820. try {
  6821. if (state.facade === value) throw TypeError("Promise can't be resolved itself");
  6822. var then = isThenable(value);
  6823. if (then) {
  6824. microtask(function () {
  6825. var wrapper = { done: false };
  6826. try {
  6827. call(then, value,
  6828. bind(internalResolve, wrapper, state),
  6829. bind(internalReject, wrapper, state)
  6830. );
  6831. } catch (error) {
  6832. internalReject(wrapper, error, state);
  6833. }
  6834. });
  6835. } else {
  6836. state.value = value;
  6837. state.state = FULFILLED;
  6838. notify(state, false);
  6839. }
  6840. } catch (error) {
  6841. internalReject({ done: false }, error, state);
  6842. }
  6843. };
  6844. // constructor polyfill
  6845. if (FORCED_PROMISE_CONSTRUCTOR) {
  6846. // 25.4.3.1 Promise(executor)
  6847. PromiseConstructor = function Promise(executor) {
  6848. anInstance(this, PromisePrototype);
  6849. aCallable(executor);
  6850. call(Internal, this);
  6851. var state = getInternalPromiseState(this);
  6852. try {
  6853. executor(bind(internalResolve, state), bind(internalReject, state));
  6854. } catch (error) {
  6855. internalReject(state, error);
  6856. }
  6857. };
  6858. PromisePrototype = PromiseConstructor.prototype;
  6859. // eslint-disable-next-line no-unused-vars -- required for `.length`
  6860. Internal = function Promise(executor) {
  6861. setInternalState(this, {
  6862. type: PROMISE,
  6863. done: false,
  6864. notified: false,
  6865. parent: false,
  6866. reactions: new Queue(),
  6867. rejection: false,
  6868. state: PENDING,
  6869. value: undefined
  6870. });
  6871. };
  6872. // `Promise.prototype.then` method
  6873. // https://tc39.es/ecma262/#sec-promise.prototype.then
  6874. Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
  6875. var state = getInternalPromiseState(this);
  6876. var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
  6877. state.parent = true;
  6878. reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
  6879. reaction.fail = isCallable(onRejected) && onRejected;
  6880. reaction.domain = IS_NODE ? process.domain : undefined;
  6881. if (state.state == PENDING) state.reactions.add(reaction);
  6882. else microtask(function () {
  6883. callReaction(reaction, state);
  6884. });
  6885. return reaction.promise;
  6886. });
  6887. OwnPromiseCapability = function () {
  6888. var promise = new Internal();
  6889. var state = getInternalPromiseState(promise);
  6890. this.promise = promise;
  6891. this.resolve = bind(internalResolve, state);
  6892. this.reject = bind(internalReject, state);
  6893. };
  6894. newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
  6895. return C === PromiseConstructor || C === PromiseWrapper
  6896. ? new OwnPromiseCapability(C)
  6897. : newGenericPromiseCapability(C);
  6898. };
  6899. if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
  6900. nativeThen = NativePromisePrototype.then;
  6901. if (!NATIVE_PROMISE_SUBCLASSING) {
  6902. // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
  6903. defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
  6904. var that = this;
  6905. return new PromiseConstructor(function (resolve, reject) {
  6906. call(nativeThen, that, resolve, reject);
  6907. }).then(onFulfilled, onRejected);
  6908. // https://github.com/zloirock/core-js/issues/640
  6909. }, { unsafe: true });
  6910. }
  6911. // make `.constructor === Promise` work for native promise-based APIs
  6912. try {
  6913. delete NativePromisePrototype.constructor;
  6914. } catch (error) { /* empty */ }
  6915. // make `instanceof Promise` work for native promise-based APIs
  6916. if (setPrototypeOf) {
  6917. setPrototypeOf(NativePromisePrototype, PromisePrototype);
  6918. }
  6919. }
  6920. }
  6921. $({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
  6922. Promise: PromiseConstructor
  6923. });
  6924. setToStringTag(PromiseConstructor, PROMISE, false, true);
  6925. setSpecies(PROMISE);
  6926. /***/ }),
  6927. /* 273 */
  6928. /***/ (function(module, exports) {
  6929. var $TypeError = TypeError;
  6930. module.exports = function (passed, required) {
  6931. if (passed < required) throw $TypeError('Not enough arguments');
  6932. return passed;
  6933. };
  6934. /***/ }),
  6935. /* 274 */
  6936. /***/ (function(module, exports, __webpack_require__) {
  6937. var global = __webpack_require__(6);
  6938. var bind = __webpack_require__(45);
  6939. var getOwnPropertyDescriptor = __webpack_require__(71).f;
  6940. var macrotask = __webpack_require__(165).set;
  6941. var IS_IOS = __webpack_require__(166);
  6942. var IS_IOS_PEBBLE = __webpack_require__(275);
  6943. var IS_WEBOS_WEBKIT = __webpack_require__(276);
  6944. var IS_NODE = __webpack_require__(125);
  6945. var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
  6946. var document = global.document;
  6947. var process = global.process;
  6948. var Promise = global.Promise;
  6949. // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
  6950. var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
  6951. var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
  6952. var flush, head, last, notify, toggle, node, promise, then;
  6953. // modern engines have queueMicrotask method
  6954. if (!queueMicrotask) {
  6955. flush = function () {
  6956. var parent, fn;
  6957. if (IS_NODE && (parent = process.domain)) parent.exit();
  6958. while (head) {
  6959. fn = head.fn;
  6960. head = head.next;
  6961. try {
  6962. fn();
  6963. } catch (error) {
  6964. if (head) notify();
  6965. else last = undefined;
  6966. throw error;
  6967. }
  6968. } last = undefined;
  6969. if (parent) parent.enter();
  6970. };
  6971. // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
  6972. // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
  6973. if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
  6974. toggle = true;
  6975. node = document.createTextNode('');
  6976. new MutationObserver(flush).observe(node, { characterData: true });
  6977. notify = function () {
  6978. node.data = toggle = !toggle;
  6979. };
  6980. // environments with maybe non-completely correct, but existent Promise
  6981. } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
  6982. // Promise.resolve without an argument throws an error in LG WebOS 2
  6983. promise = Promise.resolve(undefined);
  6984. // workaround of WebKit ~ iOS Safari 10.1 bug
  6985. promise.constructor = Promise;
  6986. then = bind(promise.then, promise);
  6987. notify = function () {
  6988. then(flush);
  6989. };
  6990. // Node.js without promises
  6991. } else if (IS_NODE) {
  6992. notify = function () {
  6993. process.nextTick(flush);
  6994. };
  6995. // for other environments - macrotask based on:
  6996. // - setImmediate
  6997. // - MessageChannel
  6998. // - window.postMessage
  6999. // - onreadystatechange
  7000. // - setTimeout
  7001. } else {
  7002. // strange IE + webpack dev server bug - use .bind(global)
  7003. macrotask = bind(macrotask, global);
  7004. notify = function () {
  7005. macrotask(flush);
  7006. };
  7007. }
  7008. }
  7009. module.exports = queueMicrotask || function (fn) {
  7010. var task = { fn: fn, next: undefined };
  7011. if (last) last.next = task;
  7012. if (!head) {
  7013. head = task;
  7014. notify();
  7015. } last = task;
  7016. };
  7017. /***/ }),
  7018. /* 275 */
  7019. /***/ (function(module, exports, __webpack_require__) {
  7020. var userAgent = __webpack_require__(91);
  7021. var global = __webpack_require__(6);
  7022. module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;
  7023. /***/ }),
  7024. /* 276 */
  7025. /***/ (function(module, exports, __webpack_require__) {
  7026. var userAgent = __webpack_require__(91);
  7027. module.exports = /web0s(?!.*chrome)/i.test(userAgent);
  7028. /***/ }),
  7029. /* 277 */
  7030. /***/ (function(module, exports, __webpack_require__) {
  7031. var global = __webpack_require__(6);
  7032. module.exports = function (a, b) {
  7033. var console = global.console;
  7034. if (console && console.error) {
  7035. arguments.length == 1 ? console.error(a) : console.error(a, b);
  7036. }
  7037. };
  7038. /***/ }),
  7039. /* 278 */
  7040. /***/ (function(module, exports) {
  7041. var Queue = function () {
  7042. this.head = null;
  7043. this.tail = null;
  7044. };
  7045. Queue.prototype = {
  7046. add: function (item) {
  7047. var entry = { item: item, next: null };
  7048. if (this.head) this.tail.next = entry;
  7049. else this.head = entry;
  7050. this.tail = entry;
  7051. },
  7052. get: function () {
  7053. var entry = this.head;
  7054. if (entry) {
  7055. this.head = entry.next;
  7056. if (this.tail === entry) this.tail = null;
  7057. return entry.item;
  7058. }
  7059. }
  7060. };
  7061. module.exports = Queue;
  7062. /***/ }),
  7063. /* 279 */
  7064. /***/ (function(module, exports) {
  7065. module.exports = typeof window == 'object' && typeof Deno != 'object';
  7066. /***/ }),
  7067. /* 280 */
  7068. /***/ (function(module, exports, __webpack_require__) {
  7069. "use strict";
  7070. var $ = __webpack_require__(0);
  7071. var call = __webpack_require__(13);
  7072. var aCallable = __webpack_require__(31);
  7073. var newPromiseCapabilityModule = __webpack_require__(50);
  7074. var perform = __webpack_require__(76);
  7075. var iterate = __webpack_require__(37);
  7076. var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(167);
  7077. // `Promise.all` method
  7078. // https://tc39.es/ecma262/#sec-promise.all
  7079. $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
  7080. all: function all(iterable) {
  7081. var C = this;
  7082. var capability = newPromiseCapabilityModule.f(C);
  7083. var resolve = capability.resolve;
  7084. var reject = capability.reject;
  7085. var result = perform(function () {
  7086. var $promiseResolve = aCallable(C.resolve);
  7087. var values = [];
  7088. var counter = 0;
  7089. var remaining = 1;
  7090. iterate(iterable, function (promise) {
  7091. var index = counter++;
  7092. var alreadyCalled = false;
  7093. remaining++;
  7094. call($promiseResolve, C, promise).then(function (value) {
  7095. if (alreadyCalled) return;
  7096. alreadyCalled = true;
  7097. values[index] = value;
  7098. --remaining || resolve(values);
  7099. }, reject);
  7100. });
  7101. --remaining || resolve(values);
  7102. });
  7103. if (result.error) reject(result.value);
  7104. return capability.promise;
  7105. }
  7106. });
  7107. /***/ }),
  7108. /* 281 */
  7109. /***/ (function(module, exports, __webpack_require__) {
  7110. "use strict";
  7111. var $ = __webpack_require__(0);
  7112. var IS_PURE = __webpack_require__(32);
  7113. var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
  7114. var NativePromiseConstructor = __webpack_require__(61);
  7115. var getBuiltIn = __webpack_require__(18);
  7116. var isCallable = __webpack_require__(7);
  7117. var defineBuiltIn = __webpack_require__(39);
  7118. var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
  7119. // `Promise.prototype.catch` method
  7120. // https://tc39.es/ecma262/#sec-promise.prototype.catch
  7121. $({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
  7122. 'catch': function (onRejected) {
  7123. return this.then(undefined, onRejected);
  7124. }
  7125. });
  7126. // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
  7127. if (!IS_PURE && isCallable(NativePromiseConstructor)) {
  7128. var method = getBuiltIn('Promise').prototype['catch'];
  7129. if (NativePromisePrototype['catch'] !== method) {
  7130. defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
  7131. }
  7132. }
  7133. /***/ }),
  7134. /* 282 */
  7135. /***/ (function(module, exports, __webpack_require__) {
  7136. "use strict";
  7137. var $ = __webpack_require__(0);
  7138. var call = __webpack_require__(13);
  7139. var aCallable = __webpack_require__(31);
  7140. var newPromiseCapabilityModule = __webpack_require__(50);
  7141. var perform = __webpack_require__(76);
  7142. var iterate = __webpack_require__(37);
  7143. var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(167);
  7144. // `Promise.race` method
  7145. // https://tc39.es/ecma262/#sec-promise.race
  7146. $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
  7147. race: function race(iterable) {
  7148. var C = this;
  7149. var capability = newPromiseCapabilityModule.f(C);
  7150. var reject = capability.reject;
  7151. var result = perform(function () {
  7152. var $promiseResolve = aCallable(C.resolve);
  7153. iterate(iterable, function (promise) {
  7154. call($promiseResolve, C, promise).then(capability.resolve, reject);
  7155. });
  7156. });
  7157. if (result.error) reject(result.value);
  7158. return capability.promise;
  7159. }
  7160. });
  7161. /***/ }),
  7162. /* 283 */
  7163. /***/ (function(module, exports, __webpack_require__) {
  7164. "use strict";
  7165. var $ = __webpack_require__(0);
  7166. var call = __webpack_require__(13);
  7167. var newPromiseCapabilityModule = __webpack_require__(50);
  7168. var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
  7169. // `Promise.reject` method
  7170. // https://tc39.es/ecma262/#sec-promise.reject
  7171. $({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
  7172. reject: function reject(r) {
  7173. var capability = newPromiseCapabilityModule.f(this);
  7174. call(capability.reject, undefined, r);
  7175. return capability.promise;
  7176. }
  7177. });
  7178. /***/ }),
  7179. /* 284 */
  7180. /***/ (function(module, exports, __webpack_require__) {
  7181. "use strict";
  7182. var $ = __webpack_require__(0);
  7183. var getBuiltIn = __webpack_require__(18);
  7184. var IS_PURE = __webpack_require__(32);
  7185. var NativePromiseConstructor = __webpack_require__(61);
  7186. var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
  7187. var promiseResolve = __webpack_require__(169);
  7188. var PromiseConstructorWrapper = getBuiltIn('Promise');
  7189. var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
  7190. // `Promise.resolve` method
  7191. // https://tc39.es/ecma262/#sec-promise.resolve
  7192. $({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
  7193. resolve: function resolve(x) {
  7194. return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);
  7195. }
  7196. });
  7197. /***/ }),
  7198. /* 285 */
  7199. /***/ (function(module, exports, __webpack_require__) {
  7200. "use strict";
  7201. var $ = __webpack_require__(0);
  7202. var call = __webpack_require__(13);
  7203. var aCallable = __webpack_require__(31);
  7204. var newPromiseCapabilityModule = __webpack_require__(50);
  7205. var perform = __webpack_require__(76);
  7206. var iterate = __webpack_require__(37);
  7207. // `Promise.allSettled` method
  7208. // https://tc39.es/ecma262/#sec-promise.allsettled
  7209. $({ target: 'Promise', stat: true }, {
  7210. allSettled: function allSettled(iterable) {
  7211. var C = this;
  7212. var capability = newPromiseCapabilityModule.f(C);
  7213. var resolve = capability.resolve;
  7214. var reject = capability.reject;
  7215. var result = perform(function () {
  7216. var promiseResolve = aCallable(C.resolve);
  7217. var values = [];
  7218. var counter = 0;
  7219. var remaining = 1;
  7220. iterate(iterable, function (promise) {
  7221. var index = counter++;
  7222. var alreadyCalled = false;
  7223. remaining++;
  7224. call(promiseResolve, C, promise).then(function (value) {
  7225. if (alreadyCalled) return;
  7226. alreadyCalled = true;
  7227. values[index] = { status: 'fulfilled', value: value };
  7228. --remaining || resolve(values);
  7229. }, function (error) {
  7230. if (alreadyCalled) return;
  7231. alreadyCalled = true;
  7232. values[index] = { status: 'rejected', reason: error };
  7233. --remaining || resolve(values);
  7234. });
  7235. });
  7236. --remaining || resolve(values);
  7237. });
  7238. if (result.error) reject(result.value);
  7239. return capability.promise;
  7240. }
  7241. });
  7242. /***/ }),
  7243. /* 286 */
  7244. /***/ (function(module, exports, __webpack_require__) {
  7245. "use strict";
  7246. var $ = __webpack_require__(0);
  7247. var call = __webpack_require__(13);
  7248. var aCallable = __webpack_require__(31);
  7249. var getBuiltIn = __webpack_require__(18);
  7250. var newPromiseCapabilityModule = __webpack_require__(50);
  7251. var perform = __webpack_require__(76);
  7252. var iterate = __webpack_require__(37);
  7253. var PROMISE_ANY_ERROR = 'No one promise resolved';
  7254. // `Promise.any` method
  7255. // https://tc39.es/ecma262/#sec-promise.any
  7256. $({ target: 'Promise', stat: true }, {
  7257. any: function any(iterable) {
  7258. var C = this;
  7259. var AggregateError = getBuiltIn('AggregateError');
  7260. var capability = newPromiseCapabilityModule.f(C);
  7261. var resolve = capability.resolve;
  7262. var reject = capability.reject;
  7263. var result = perform(function () {
  7264. var promiseResolve = aCallable(C.resolve);
  7265. var errors = [];
  7266. var counter = 0;
  7267. var remaining = 1;
  7268. var alreadyResolved = false;
  7269. iterate(iterable, function (promise) {
  7270. var index = counter++;
  7271. var alreadyRejected = false;
  7272. remaining++;
  7273. call(promiseResolve, C, promise).then(function (value) {
  7274. if (alreadyRejected || alreadyResolved) return;
  7275. alreadyResolved = true;
  7276. resolve(value);
  7277. }, function (error) {
  7278. if (alreadyRejected || alreadyResolved) return;
  7279. alreadyRejected = true;
  7280. errors[index] = error;
  7281. --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
  7282. });
  7283. });
  7284. --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
  7285. });
  7286. if (result.error) reject(result.value);
  7287. return capability.promise;
  7288. }
  7289. });
  7290. /***/ }),
  7291. /* 287 */
  7292. /***/ (function(module, exports, __webpack_require__) {
  7293. "use strict";
  7294. var $ = __webpack_require__(0);
  7295. var IS_PURE = __webpack_require__(32);
  7296. var NativePromiseConstructor = __webpack_require__(61);
  7297. var fails = __webpack_require__(3);
  7298. var getBuiltIn = __webpack_require__(18);
  7299. var isCallable = __webpack_require__(7);
  7300. var speciesConstructor = __webpack_require__(163);
  7301. var promiseResolve = __webpack_require__(169);
  7302. var defineBuiltIn = __webpack_require__(39);
  7303. var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
  7304. // Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829
  7305. var NON_GENERIC = !!NativePromiseConstructor && fails(function () {
  7306. // eslint-disable-next-line unicorn/no-thenable -- required for testing
  7307. NativePromisePrototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });
  7308. });
  7309. // `Promise.prototype.finally` method
  7310. // https://tc39.es/ecma262/#sec-promise.prototype.finally
  7311. $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
  7312. 'finally': function (onFinally) {
  7313. var C = speciesConstructor(this, getBuiltIn('Promise'));
  7314. var isFunction = isCallable(onFinally);
  7315. return this.then(
  7316. isFunction ? function (x) {
  7317. return promiseResolve(C, onFinally()).then(function () { return x; });
  7318. } : onFinally,
  7319. isFunction ? function (e) {
  7320. return promiseResolve(C, onFinally()).then(function () { throw e; });
  7321. } : onFinally
  7322. );
  7323. }
  7324. });
  7325. // makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`
  7326. if (!IS_PURE && isCallable(NativePromiseConstructor)) {
  7327. var method = getBuiltIn('Promise').prototype['finally'];
  7328. if (NativePromisePrototype['finally'] !== method) {
  7329. defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });
  7330. }
  7331. }
  7332. /***/ }),
  7333. /* 288 */
  7334. /***/ (function(module, exports, __webpack_require__) {
  7335. var uncurryThis = __webpack_require__(4);
  7336. var toIntegerOrInfinity = __webpack_require__(120);
  7337. var toString = __webpack_require__(75);
  7338. var requireObjectCoercible = __webpack_require__(115);
  7339. var charAt = uncurryThis(''.charAt);
  7340. var charCodeAt = uncurryThis(''.charCodeAt);
  7341. var stringSlice = uncurryThis(''.slice);
  7342. var createMethod = function (CONVERT_TO_STRING) {
  7343. return function ($this, pos) {
  7344. var S = toString(requireObjectCoercible($this));
  7345. var position = toIntegerOrInfinity(pos);
  7346. var size = S.length;
  7347. var first, second;
  7348. if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
  7349. first = charCodeAt(S, position);
  7350. return first < 0xD800 || first > 0xDBFF || position + 1 === size
  7351. || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
  7352. ? CONVERT_TO_STRING
  7353. ? charAt(S, position)
  7354. : first
  7355. : CONVERT_TO_STRING
  7356. ? stringSlice(S, position, position + 2)
  7357. : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
  7358. };
  7359. };
  7360. module.exports = {
  7361. // `String.prototype.codePointAt` method
  7362. // https://tc39.es/ecma262/#sec-string.prototype.codepointat
  7363. codeAt: createMethod(false),
  7364. // `String.prototype.at` method
  7365. // https://github.com/mathiasbynens/String.prototype.at
  7366. charAt: createMethod(true)
  7367. };
  7368. /***/ }),
  7369. /* 289 */
  7370. /***/ (function(module, exports) {
  7371. // iterable DOM collections
  7372. // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
  7373. module.exports = {
  7374. CSSRuleList: 0,
  7375. CSSStyleDeclaration: 0,
  7376. CSSValueList: 0,
  7377. ClientRectList: 0,
  7378. DOMRectList: 0,
  7379. DOMStringList: 0,
  7380. DOMTokenList: 1,
  7381. DataTransferItemList: 0,
  7382. FileList: 0,
  7383. HTMLAllCollection: 0,
  7384. HTMLCollection: 0,
  7385. HTMLFormElement: 0,
  7386. HTMLSelectElement: 0,
  7387. MediaList: 0,
  7388. MimeTypeArray: 0,
  7389. NamedNodeMap: 0,
  7390. NodeList: 1,
  7391. PaintRequestList: 0,
  7392. Plugin: 0,
  7393. PluginArray: 0,
  7394. SVGLengthList: 0,
  7395. SVGNumberList: 0,
  7396. SVGPathSegList: 0,
  7397. SVGPointList: 0,
  7398. SVGStringList: 0,
  7399. SVGTransformList: 0,
  7400. SourceBufferList: 0,
  7401. StyleSheetList: 0,
  7402. TextTrackCueList: 0,
  7403. TextTrackList: 0,
  7404. TouchList: 0
  7405. };
  7406. /***/ }),
  7407. /* 290 */
  7408. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7409. "use strict";
  7410. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__index_js__ = __webpack_require__(126);
  7411. // Default Export
  7412. // ==============
  7413. // In this module, we mix our bundled exports into the `_` object and export
  7414. // the result. This is analogous to setting `module.exports = _` in CommonJS.
  7415. // Hence, this module is also the entry point of our UMD bundle and the package
  7416. // entry point for CommonJS and AMD users. In other words, this is (the source
  7417. // of) the module you are interfacing with when you do any of the following:
  7418. //
  7419. // ```js
  7420. // // CommonJS
  7421. // var _ = require('underscore');
  7422. //
  7423. // // AMD
  7424. // define(['underscore'], function(_) {...});
  7425. //
  7426. // // UMD in the browser
  7427. // // _ is available as a global variable
  7428. // ```
  7429. // Add all of the Underscore functions to the wrapper object.
  7430. var _ = Object(__WEBPACK_IMPORTED_MODULE_0__index_js__["mixin"])(__WEBPACK_IMPORTED_MODULE_0__index_js__);
  7431. // Legacy Node.js API.
  7432. _._ = _;
  7433. // Export the Underscore API.
  7434. /* harmony default export */ __webpack_exports__["a"] = (_);
  7435. /***/ }),
  7436. /* 291 */
  7437. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7438. "use strict";
  7439. /* harmony export (immutable) */ __webpack_exports__["a"] = isNull;
  7440. // Is a given value equal to null?
  7441. function isNull(obj) {
  7442. return obj === null;
  7443. }
  7444. /***/ }),
  7445. /* 292 */
  7446. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7447. "use strict";
  7448. /* harmony export (immutable) */ __webpack_exports__["a"] = isElement;
  7449. // Is a given value a DOM element?
  7450. function isElement(obj) {
  7451. return !!(obj && obj.nodeType === 1);
  7452. }
  7453. /***/ }),
  7454. /* 293 */
  7455. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7456. "use strict";
  7457. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
  7458. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Date'));
  7459. /***/ }),
  7460. /* 294 */
  7461. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7462. "use strict";
  7463. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
  7464. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('RegExp'));
  7465. /***/ }),
  7466. /* 295 */
  7467. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7468. "use strict";
  7469. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
  7470. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Error'));
  7471. /***/ }),
  7472. /* 296 */
  7473. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7474. "use strict";
  7475. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
  7476. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Object'));
  7477. /***/ }),
  7478. /* 297 */
  7479. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7480. "use strict";
  7481. /* harmony export (immutable) */ __webpack_exports__["a"] = isFinite;
  7482. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
  7483. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isSymbol_js__ = __webpack_require__(173);
  7484. // Is a given object a finite number?
  7485. function isFinite(obj) {
  7486. return !Object(__WEBPACK_IMPORTED_MODULE_1__isSymbol_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["f" /* _isFinite */])(obj) && !isNaN(parseFloat(obj));
  7487. }
  7488. /***/ }),
  7489. /* 298 */
  7490. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7491. "use strict";
  7492. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(178);
  7493. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getByteLength_js__ = __webpack_require__(130);
  7494. // Internal helper to determine whether we should spend extensive checks against
  7495. // `ArrayBuffer` et al.
  7496. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__getByteLength_js__["a" /* default */]));
  7497. /***/ }),
  7498. /* 299 */
  7499. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7500. "use strict";
  7501. /* harmony export (immutable) */ __webpack_exports__["a"] = isEmpty;
  7502. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
  7503. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(53);
  7504. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(127);
  7505. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(129);
  7506. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__keys_js__ = __webpack_require__(15);
  7507. // Is a given array, string, or object empty?
  7508. // An "empty" object has no enumerable own-properties.
  7509. function isEmpty(obj) {
  7510. if (obj == null) return true;
  7511. // Skip the more expensive `toString`-based type checks if `obj` has no
  7512. // `.length`.
  7513. var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(obj);
  7514. if (typeof length == 'number' && (
  7515. Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(obj) || Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" /* default */])(obj) || Object(__WEBPACK_IMPORTED_MODULE_3__isArguments_js__["a" /* default */])(obj)
  7516. )) return length === 0;
  7517. return Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__keys_js__["a" /* default */])(obj)) === 0;
  7518. }
  7519. /***/ }),
  7520. /* 300 */
  7521. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7522. "use strict";
  7523. /* harmony export (immutable) */ __webpack_exports__["a"] = isEqual;
  7524. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
  7525. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
  7526. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getByteLength_js__ = __webpack_require__(130);
  7527. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__ = __webpack_require__(176);
  7528. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isFunction_js__ = __webpack_require__(27);
  7529. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__ = __webpack_require__(79);
  7530. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isDataView_js__ = __webpack_require__(128);
  7531. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__keys_js__ = __webpack_require__(15);
  7532. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__has_js__ = __webpack_require__(40);
  7533. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__toBufferView_js__ = __webpack_require__(301);
  7534. // We use this string twice, so give it a name for minification.
  7535. var tagDataView = '[object DataView]';
  7536. // Internal recursive comparison function for `_.isEqual`.
  7537. function eq(a, b, aStack, bStack) {
  7538. // Identical objects are equal. `0 === -0`, but they aren't identical.
  7539. // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).
  7540. if (a === b) return a !== 0 || 1 / a === 1 / b;
  7541. // `null` or `undefined` only equal to itself (strict comparison).
  7542. if (a == null || b == null) return false;
  7543. // `NaN`s are equivalent, but non-reflexive.
  7544. if (a !== a) return b !== b;
  7545. // Exhaust primitive checks
  7546. var type = typeof a;
  7547. if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
  7548. return deepEq(a, b, aStack, bStack);
  7549. }
  7550. // Internal recursive comparison function for `_.isEqual`.
  7551. function deepEq(a, b, aStack, bStack) {
  7552. // Unwrap any wrapped objects.
  7553. if (a instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]) a = a._wrapped;
  7554. if (b instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]) b = b._wrapped;
  7555. // Compare `[[Class]]` names.
  7556. var className = __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" /* toString */].call(a);
  7557. if (className !== __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" /* toString */].call(b)) return false;
  7558. // Work around a bug in IE 10 - Edge 13.
  7559. if (__WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__["a" /* hasStringTagBug */] && className == '[object Object]' && Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" /* default */])(a)) {
  7560. if (!Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" /* default */])(b)) return false;
  7561. className = tagDataView;
  7562. }
  7563. switch (className) {
  7564. // These types are compared by value.
  7565. case '[object RegExp]':
  7566. // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
  7567. case '[object String]':
  7568. // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
  7569. // equivalent to `new String("5")`.
  7570. return '' + a === '' + b;
  7571. case '[object Number]':
  7572. // `NaN`s are equivalent, but non-reflexive.
  7573. // Object(NaN) is equivalent to NaN.
  7574. if (+a !== +a) return +b !== +b;
  7575. // An `egal` comparison is performed for other numeric values.
  7576. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  7577. case '[object Date]':
  7578. case '[object Boolean]':
  7579. // Coerce dates and booleans to numeric primitive values. Dates are compared by their
  7580. // millisecond representations. Note that invalid dates with millisecond representations
  7581. // of `NaN` are not equivalent.
  7582. return +a === +b;
  7583. case '[object Symbol]':
  7584. return __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" /* SymbolProto */].valueOf.call(a) === __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" /* SymbolProto */].valueOf.call(b);
  7585. case '[object ArrayBuffer]':
  7586. case tagDataView:
  7587. // Coerce to typed array so we can fall through.
  7588. return deepEq(Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" /* default */])(a), Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" /* default */])(b), aStack, bStack);
  7589. }
  7590. var areArrays = className === '[object Array]';
  7591. if (!areArrays && Object(__WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__["a" /* default */])(a)) {
  7592. var byteLength = Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" /* default */])(a);
  7593. if (byteLength !== Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" /* default */])(b)) return false;
  7594. if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
  7595. areArrays = true;
  7596. }
  7597. if (!areArrays) {
  7598. if (typeof a != 'object' || typeof b != 'object') return false;
  7599. // Objects with different constructors are not equivalent, but `Object`s or `Array`s
  7600. // from different frames are.
  7601. var aCtor = a.constructor, bCtor = b.constructor;
  7602. if (aCtor !== bCtor && !(Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" /* default */])(aCtor) && aCtor instanceof aCtor &&
  7603. Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" /* default */])(bCtor) && bCtor instanceof bCtor)
  7604. && ('constructor' in a && 'constructor' in b)) {
  7605. return false;
  7606. }
  7607. }
  7608. // Assume equality for cyclic structures. The algorithm for detecting cyclic
  7609. // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
  7610. // Initializing stack of traversed objects.
  7611. // It's done here since we only need them for objects and arrays comparison.
  7612. aStack = aStack || [];
  7613. bStack = bStack || [];
  7614. var length = aStack.length;
  7615. while (length--) {
  7616. // Linear search. Performance is inversely proportional to the number of
  7617. // unique nested structures.
  7618. if (aStack[length] === a) return bStack[length] === b;
  7619. }
  7620. // Add the first object to the stack of traversed objects.
  7621. aStack.push(a);
  7622. bStack.push(b);
  7623. // Recursively compare objects and arrays.
  7624. if (areArrays) {
  7625. // Compare array lengths to determine if a deep comparison is necessary.
  7626. length = a.length;
  7627. if (length !== b.length) return false;
  7628. // Deep compare the contents, ignoring non-numeric properties.
  7629. while (length--) {
  7630. if (!eq(a[length], b[length], aStack, bStack)) return false;
  7631. }
  7632. } else {
  7633. // Deep compare objects.
  7634. var _keys = Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" /* default */])(a), key;
  7635. length = _keys.length;
  7636. // Ensure that both objects contain the same number of properties before comparing deep equality.
  7637. if (Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" /* default */])(b).length !== length) return false;
  7638. while (length--) {
  7639. // Deep compare each member
  7640. key = _keys[length];
  7641. if (!(Object(__WEBPACK_IMPORTED_MODULE_8__has_js__["a" /* default */])(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
  7642. }
  7643. }
  7644. // Remove the first object from the stack of traversed objects.
  7645. aStack.pop();
  7646. bStack.pop();
  7647. return true;
  7648. }
  7649. // Perform a deep comparison to check if two objects are equal.
  7650. function isEqual(a, b) {
  7651. return eq(a, b);
  7652. }
  7653. /***/ }),
  7654. /* 301 */
  7655. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7656. "use strict";
  7657. /* harmony export (immutable) */ __webpack_exports__["a"] = toBufferView;
  7658. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getByteLength_js__ = __webpack_require__(130);
  7659. // Internal function to wrap or shallow-copy an ArrayBuffer,
  7660. // typed array or DataView to a new view, reusing the buffer.
  7661. function toBufferView(bufferSource) {
  7662. return new Uint8Array(
  7663. bufferSource.buffer || bufferSource,
  7664. bufferSource.byteOffset || 0,
  7665. Object(__WEBPACK_IMPORTED_MODULE_0__getByteLength_js__["a" /* default */])(bufferSource)
  7666. );
  7667. }
  7668. /***/ }),
  7669. /* 302 */
  7670. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7671. "use strict";
  7672. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
  7673. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(79);
  7674. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(131);
  7675. /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" /* isIE11 */] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" /* ie11fingerprint */])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["b" /* mapMethods */]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Map'));
  7676. /***/ }),
  7677. /* 303 */
  7678. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7679. "use strict";
  7680. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
  7681. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(79);
  7682. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(131);
  7683. /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" /* isIE11 */] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" /* ie11fingerprint */])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["d" /* weakMapMethods */]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('WeakMap'));
  7684. /***/ }),
  7685. /* 304 */
  7686. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7687. "use strict";
  7688. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
  7689. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(79);
  7690. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(131);
  7691. /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__["b" /* isIE11 */] ? Object(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["a" /* ie11fingerprint */])(__WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__["c" /* setMethods */]) : Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Set'));
  7692. /***/ }),
  7693. /* 305 */
  7694. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7695. "use strict";
  7696. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
  7697. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('WeakSet'));
  7698. /***/ }),
  7699. /* 306 */
  7700. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7701. "use strict";
  7702. /* harmony export (immutable) */ __webpack_exports__["a"] = pairs;
  7703. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
  7704. // Convert an object into a list of `[key, value]` pairs.
  7705. // The opposite of `_.object` with one argument.
  7706. function pairs(obj) {
  7707. var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
  7708. var length = _keys.length;
  7709. var pairs = Array(length);
  7710. for (var i = 0; i < length; i++) {
  7711. pairs[i] = [_keys[i], obj[_keys[i]]];
  7712. }
  7713. return pairs;
  7714. }
  7715. /***/ }),
  7716. /* 307 */
  7717. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7718. "use strict";
  7719. /* harmony export (immutable) */ __webpack_exports__["a"] = create;
  7720. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(186);
  7721. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__extendOwn_js__ = __webpack_require__(133);
  7722. // Creates an object that inherits from the given prototype object.
  7723. // If additional properties are provided then they will be added to the
  7724. // created object.
  7725. function create(prototype, props) {
  7726. var result = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" /* default */])(prototype);
  7727. if (props) Object(__WEBPACK_IMPORTED_MODULE_1__extendOwn_js__["a" /* default */])(result, props);
  7728. return result;
  7729. }
  7730. /***/ }),
  7731. /* 308 */
  7732. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7733. "use strict";
  7734. /* harmony export (immutable) */ __webpack_exports__["a"] = tap;
  7735. // Invokes `interceptor` with the `obj` and then returns `obj`.
  7736. // The primary purpose of this method is to "tap into" a method chain, in
  7737. // order to perform operations on intermediate results within the chain.
  7738. function tap(obj, interceptor) {
  7739. interceptor(obj);
  7740. return obj;
  7741. }
  7742. /***/ }),
  7743. /* 309 */
  7744. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7745. "use strict";
  7746. /* harmony export (immutable) */ __webpack_exports__["a"] = has;
  7747. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(40);
  7748. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(81);
  7749. // Shortcut function for checking if an object has a given property directly on
  7750. // itself (in other words, not on a prototype). Unlike the internal `has`
  7751. // function, this public version can also traverse nested properties.
  7752. function has(obj, path) {
  7753. path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
  7754. var length = path.length;
  7755. for (var i = 0; i < length; i++) {
  7756. var key = path[i];
  7757. if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" /* default */])(obj, key)) return false;
  7758. obj = obj[key];
  7759. }
  7760. return !!length;
  7761. }
  7762. /***/ }),
  7763. /* 310 */
  7764. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7765. "use strict";
  7766. /* harmony export (immutable) */ __webpack_exports__["a"] = mapObject;
  7767. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
  7768. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
  7769. // Returns the results of applying the `iteratee` to each element of `obj`.
  7770. // In contrast to `_.map` it returns an object.
  7771. function mapObject(obj, iteratee, context) {
  7772. iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
  7773. var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj),
  7774. length = _keys.length,
  7775. results = {};
  7776. for (var index = 0; index < length; index++) {
  7777. var currentKey = _keys[index];
  7778. results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
  7779. }
  7780. return results;
  7781. }
  7782. /***/ }),
  7783. /* 311 */
  7784. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7785. "use strict";
  7786. /* harmony export (immutable) */ __webpack_exports__["a"] = propertyOf;
  7787. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__noop_js__ = __webpack_require__(192);
  7788. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__get_js__ = __webpack_require__(188);
  7789. // Generates a function for a given object that returns a given property.
  7790. function propertyOf(obj) {
  7791. if (obj == null) return __WEBPACK_IMPORTED_MODULE_0__noop_js__["a" /* default */];
  7792. return function(path) {
  7793. return Object(__WEBPACK_IMPORTED_MODULE_1__get_js__["a" /* default */])(obj, path);
  7794. };
  7795. }
  7796. /***/ }),
  7797. /* 312 */
  7798. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7799. "use strict";
  7800. /* harmony export (immutable) */ __webpack_exports__["a"] = times;
  7801. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(82);
  7802. // Run a function **n** times.
  7803. function times(n, iteratee, context) {
  7804. var accum = Array(Math.max(0, n));
  7805. iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" /* default */])(iteratee, context, 1);
  7806. for (var i = 0; i < n; i++) accum[i] = iteratee(i);
  7807. return accum;
  7808. }
  7809. /***/ }),
  7810. /* 313 */
  7811. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7812. "use strict";
  7813. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(194);
  7814. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(195);
  7815. // Function for escaping strings to HTML interpolation.
  7816. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" /* default */]));
  7817. /***/ }),
  7818. /* 314 */
  7819. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7820. "use strict";
  7821. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(194);
  7822. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__ = __webpack_require__(315);
  7823. // Function for unescaping strings from HTML interpolation.
  7824. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__["a" /* default */]));
  7825. /***/ }),
  7826. /* 315 */
  7827. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7828. "use strict";
  7829. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__invert_js__ = __webpack_require__(182);
  7830. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(195);
  7831. // Internal list of HTML entities for unescaping.
  7832. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__invert_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" /* default */]));
  7833. /***/ }),
  7834. /* 316 */
  7835. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7836. "use strict";
  7837. /* harmony export (immutable) */ __webpack_exports__["a"] = template;
  7838. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__defaults_js__ = __webpack_require__(185);
  7839. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__underscore_js__ = __webpack_require__(24);
  7840. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__templateSettings_js__ = __webpack_require__(196);
  7841. // When customizing `_.templateSettings`, if you don't want to define an
  7842. // interpolation, evaluation or escaping regex, we need one that is
  7843. // guaranteed not to match.
  7844. var noMatch = /(.)^/;
  7845. // Certain characters need to be escaped so that they can be put into a
  7846. // string literal.
  7847. var escapes = {
  7848. "'": "'",
  7849. '\\': '\\',
  7850. '\r': 'r',
  7851. '\n': 'n',
  7852. '\u2028': 'u2028',
  7853. '\u2029': 'u2029'
  7854. };
  7855. var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
  7856. function escapeChar(match) {
  7857. return '\\' + escapes[match];
  7858. }
  7859. var bareIdentifier = /^\s*(\w|\$)+\s*$/;
  7860. // JavaScript micro-templating, similar to John Resig's implementation.
  7861. // Underscore templating handles arbitrary delimiters, preserves whitespace,
  7862. // and correctly escapes quotes within interpolated code.
  7863. // NB: `oldSettings` only exists for backwards compatibility.
  7864. function template(text, settings, oldSettings) {
  7865. if (!settings && oldSettings) settings = oldSettings;
  7866. settings = Object(__WEBPACK_IMPORTED_MODULE_0__defaults_js__["a" /* default */])({}, settings, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" /* default */].templateSettings);
  7867. // Combine delimiters into one regular expression via alternation.
  7868. var matcher = RegExp([
  7869. (settings.escape || noMatch).source,
  7870. (settings.interpolate || noMatch).source,
  7871. (settings.evaluate || noMatch).source
  7872. ].join('|') + '|$', 'g');
  7873. // Compile the template source, escaping string literals appropriately.
  7874. var index = 0;
  7875. var source = "__p+='";
  7876. text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
  7877. source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
  7878. index = offset + match.length;
  7879. if (escape) {
  7880. source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
  7881. } else if (interpolate) {
  7882. source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
  7883. } else if (evaluate) {
  7884. source += "';\n" + evaluate + "\n__p+='";
  7885. }
  7886. // Adobe VMs need the match returned to produce the correct offset.
  7887. return match;
  7888. });
  7889. source += "';\n";
  7890. var argument = settings.variable;
  7891. if (argument) {
  7892. if (!bareIdentifier.test(argument)) throw new Error(argument);
  7893. } else {
  7894. // If a variable is not specified, place data values in local scope.
  7895. source = 'with(obj||{}){\n' + source + '}\n';
  7896. argument = 'obj';
  7897. }
  7898. source = "var __t,__p='',__j=Array.prototype.join," +
  7899. "print=function(){__p+=__j.call(arguments,'');};\n" +
  7900. source + 'return __p;\n';
  7901. var render;
  7902. try {
  7903. render = new Function(argument, '_', source);
  7904. } catch (e) {
  7905. e.source = source;
  7906. throw e;
  7907. }
  7908. var template = function(data) {
  7909. return render.call(this, data, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" /* default */]);
  7910. };
  7911. // Provide the compiled source as a convenience for precompilation.
  7912. template.source = 'function(' + argument + '){\n' + source + '}';
  7913. return template;
  7914. }
  7915. /***/ }),
  7916. /* 317 */
  7917. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7918. "use strict";
  7919. /* harmony export (immutable) */ __webpack_exports__["a"] = result;
  7920. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(27);
  7921. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(81);
  7922. // Traverses the children of `obj` along `path`. If a child is a function, it
  7923. // is invoked with its parent as context. Returns the value of the final
  7924. // child, or `fallback` if any child is undefined.
  7925. function result(obj, path, fallback) {
  7926. path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
  7927. var length = path.length;
  7928. if (!length) {
  7929. return Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(fallback) ? fallback.call(obj) : fallback;
  7930. }
  7931. for (var i = 0; i < length; i++) {
  7932. var prop = obj == null ? void 0 : obj[path[i]];
  7933. if (prop === void 0) {
  7934. prop = fallback;
  7935. i = length; // Ensure we don't continue iterating.
  7936. }
  7937. obj = Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(prop) ? prop.call(obj) : prop;
  7938. }
  7939. return obj;
  7940. }
  7941. /***/ }),
  7942. /* 318 */
  7943. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7944. "use strict";
  7945. /* harmony export (immutable) */ __webpack_exports__["a"] = uniqueId;
  7946. // Generate a unique integer id (unique within the entire client session).
  7947. // Useful for temporary DOM ids.
  7948. var idCounter = 0;
  7949. function uniqueId(prefix) {
  7950. var id = ++idCounter + '';
  7951. return prefix ? prefix + id : id;
  7952. }
  7953. /***/ }),
  7954. /* 319 */
  7955. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7956. "use strict";
  7957. /* harmony export (immutable) */ __webpack_exports__["a"] = chain;
  7958. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
  7959. // Start chaining a wrapped Underscore object.
  7960. function chain(obj) {
  7961. var instance = Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */])(obj);
  7962. instance._chain = true;
  7963. return instance;
  7964. }
  7965. /***/ }),
  7966. /* 320 */
  7967. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7968. "use strict";
  7969. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
  7970. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(63);
  7971. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bind_js__ = __webpack_require__(198);
  7972. // Bind a number of an object's methods to that object. Remaining arguments
  7973. // are the method names to be bound. Useful for ensuring that all callbacks
  7974. // defined on an object belong to it.
  7975. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
  7976. keys = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" /* default */])(keys, false, false);
  7977. var index = keys.length;
  7978. if (index < 1) throw new Error('bindAll must be passed function names');
  7979. while (index--) {
  7980. var key = keys[index];
  7981. obj[key] = Object(__WEBPACK_IMPORTED_MODULE_2__bind_js__["a" /* default */])(obj[key], obj);
  7982. }
  7983. return obj;
  7984. }));
  7985. /***/ }),
  7986. /* 321 */
  7987. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7988. "use strict";
  7989. /* harmony export (immutable) */ __webpack_exports__["a"] = memoize;
  7990. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(40);
  7991. // Memoize an expensive function by storing its results.
  7992. function memoize(func, hasher) {
  7993. var memoize = function(key) {
  7994. var cache = memoize.cache;
  7995. var address = '' + (hasher ? hasher.apply(this, arguments) : key);
  7996. if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" /* default */])(cache, address)) cache[address] = func.apply(this, arguments);
  7997. return cache[address];
  7998. };
  7999. memoize.cache = {};
  8000. return memoize;
  8001. }
  8002. /***/ }),
  8003. /* 322 */
  8004. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8005. "use strict";
  8006. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(104);
  8007. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__delay_js__ = __webpack_require__(199);
  8008. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(24);
  8009. // Defers a function, scheduling it to run after the current call stack has
  8010. // cleared.
  8011. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__delay_js__["a" /* default */], __WEBPACK_IMPORTED_MODULE_2__underscore_js__["a" /* default */], 1));
  8012. /***/ }),
  8013. /* 323 */
  8014. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8015. "use strict";
  8016. /* harmony export (immutable) */ __webpack_exports__["a"] = throttle;
  8017. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__now_js__ = __webpack_require__(137);
  8018. // Returns a function, that, when invoked, will only be triggered at most once
  8019. // during a given window of time. Normally, the throttled function will run
  8020. // as much as it can, without ever going more than once per `wait` duration;
  8021. // but if you'd like to disable the execution on the leading edge, pass
  8022. // `{leading: false}`. To disable execution on the trailing edge, ditto.
  8023. function throttle(func, wait, options) {
  8024. var timeout, context, args, result;
  8025. var previous = 0;
  8026. if (!options) options = {};
  8027. var later = function() {
  8028. previous = options.leading === false ? 0 : Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" /* default */])();
  8029. timeout = null;
  8030. result = func.apply(context, args);
  8031. if (!timeout) context = args = null;
  8032. };
  8033. var throttled = function() {
  8034. var _now = Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" /* default */])();
  8035. if (!previous && options.leading === false) previous = _now;
  8036. var remaining = wait - (_now - previous);
  8037. context = this;
  8038. args = arguments;
  8039. if (remaining <= 0 || remaining > wait) {
  8040. if (timeout) {
  8041. clearTimeout(timeout);
  8042. timeout = null;
  8043. }
  8044. previous = _now;
  8045. result = func.apply(context, args);
  8046. if (!timeout) context = args = null;
  8047. } else if (!timeout && options.trailing !== false) {
  8048. timeout = setTimeout(later, remaining);
  8049. }
  8050. return result;
  8051. };
  8052. throttled.cancel = function() {
  8053. clearTimeout(timeout);
  8054. previous = 0;
  8055. timeout = context = args = null;
  8056. };
  8057. return throttled;
  8058. }
  8059. /***/ }),
  8060. /* 324 */
  8061. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8062. "use strict";
  8063. /* harmony export (immutable) */ __webpack_exports__["a"] = debounce;
  8064. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
  8065. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__now_js__ = __webpack_require__(137);
  8066. // When a sequence of calls of the returned function ends, the argument
  8067. // function is triggered. The end of a sequence is defined by the `wait`
  8068. // parameter. If `immediate` is passed, the argument function will be
  8069. // triggered at the beginning of the sequence instead of at the end.
  8070. function debounce(func, wait, immediate) {
  8071. var timeout, previous, args, result, context;
  8072. var later = function() {
  8073. var passed = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" /* default */])() - previous;
  8074. if (wait > passed) {
  8075. timeout = setTimeout(later, wait - passed);
  8076. } else {
  8077. timeout = null;
  8078. if (!immediate) result = func.apply(context, args);
  8079. // This check is needed because `func` can recursively invoke `debounced`.
  8080. if (!timeout) args = context = null;
  8081. }
  8082. };
  8083. var debounced = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(_args) {
  8084. context = this;
  8085. args = _args;
  8086. previous = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" /* default */])();
  8087. if (!timeout) {
  8088. timeout = setTimeout(later, wait);
  8089. if (immediate) result = func.apply(context, args);
  8090. }
  8091. return result;
  8092. });
  8093. debounced.cancel = function() {
  8094. clearTimeout(timeout);
  8095. timeout = args = context = null;
  8096. };
  8097. return debounced;
  8098. }
  8099. /***/ }),
  8100. /* 325 */
  8101. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8102. "use strict";
  8103. /* harmony export (immutable) */ __webpack_exports__["a"] = wrap;
  8104. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(104);
  8105. // Returns the first function passed as an argument to the second,
  8106. // allowing you to adjust arguments, run code before and after, and
  8107. // conditionally execute the original function.
  8108. function wrap(func, wrapper) {
  8109. return Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(wrapper, func);
  8110. }
  8111. /***/ }),
  8112. /* 326 */
  8113. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8114. "use strict";
  8115. /* harmony export (immutable) */ __webpack_exports__["a"] = compose;
  8116. // Returns a function that is the composition of a list of functions, each
  8117. // consuming the return value of the function that follows.
  8118. function compose() {
  8119. var args = arguments;
  8120. var start = args.length - 1;
  8121. return function() {
  8122. var i = start;
  8123. var result = args[start].apply(this, arguments);
  8124. while (i--) result = args[i].call(this, result);
  8125. return result;
  8126. };
  8127. }
  8128. /***/ }),
  8129. /* 327 */
  8130. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8131. "use strict";
  8132. /* harmony export (immutable) */ __webpack_exports__["a"] = after;
  8133. // Returns a function that will only be executed on and after the Nth call.
  8134. function after(times, func) {
  8135. return function() {
  8136. if (--times < 1) {
  8137. return func.apply(this, arguments);
  8138. }
  8139. };
  8140. }
  8141. /***/ }),
  8142. /* 328 */
  8143. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8144. "use strict";
  8145. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(104);
  8146. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__before_js__ = __webpack_require__(200);
  8147. // Returns a function that will be executed at most one time, no matter how
  8148. // often you call it. Useful for lazy initialization.
  8149. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__before_js__["a" /* default */], 2));
  8150. /***/ }),
  8151. /* 329 */
  8152. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8153. "use strict";
  8154. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__ = __webpack_require__(203);
  8155. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__ = __webpack_require__(206);
  8156. // Return the position of the last occurrence of an item in an array,
  8157. // or -1 if the item is not included in the array.
  8158. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__["a" /* default */])(-1, __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__["a" /* default */]));
  8159. /***/ }),
  8160. /* 330 */
  8161. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8162. "use strict";
  8163. /* harmony export (immutable) */ __webpack_exports__["a"] = findWhere;
  8164. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__find_js__ = __webpack_require__(207);
  8165. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(103);
  8166. // Convenience version of a common use case of `_.find`: getting the first
  8167. // object containing specific `key:value` pairs.
  8168. function findWhere(obj, attrs) {
  8169. return Object(__WEBPACK_IMPORTED_MODULE_0__find_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" /* default */])(attrs));
  8170. }
  8171. /***/ }),
  8172. /* 331 */
  8173. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8174. "use strict";
  8175. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(208);
  8176. // **Reduce** builds up a single result from a list of values, aka `inject`,
  8177. // or `foldl`.
  8178. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" /* default */])(1));
  8179. /***/ }),
  8180. /* 332 */
  8181. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8182. "use strict";
  8183. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(208);
  8184. // The right-associative version of reduce, also known as `foldr`.
  8185. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" /* default */])(-1));
  8186. /***/ }),
  8187. /* 333 */
  8188. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8189. "use strict";
  8190. /* harmony export (immutable) */ __webpack_exports__["a"] = reject;
  8191. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(83);
  8192. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__negate_js__ = __webpack_require__(138);
  8193. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(20);
  8194. // Return all the elements for which a truth test fails.
  8195. function reject(obj, predicate, context) {
  8196. return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__negate_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(predicate)), context);
  8197. }
  8198. /***/ }),
  8199. /* 334 */
  8200. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8201. "use strict";
  8202. /* harmony export (immutable) */ __webpack_exports__["a"] = every;
  8203. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
  8204. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
  8205. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
  8206. // Determine whether all of the elements pass a truth test.
  8207. function every(obj, predicate, context) {
  8208. predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
  8209. var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
  8210. length = (_keys || obj).length;
  8211. for (var index = 0; index < length; index++) {
  8212. var currentKey = _keys ? _keys[index] : index;
  8213. if (!predicate(obj[currentKey], currentKey, obj)) return false;
  8214. }
  8215. return true;
  8216. }
  8217. /***/ }),
  8218. /* 335 */
  8219. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8220. "use strict";
  8221. /* harmony export (immutable) */ __webpack_exports__["a"] = some;
  8222. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
  8223. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
  8224. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
  8225. // Determine if at least one element in the object passes a truth test.
  8226. function some(obj, predicate, context) {
  8227. predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
  8228. var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
  8229. length = (_keys || obj).length;
  8230. for (var index = 0; index < length; index++) {
  8231. var currentKey = _keys ? _keys[index] : index;
  8232. if (predicate(obj[currentKey], currentKey, obj)) return true;
  8233. }
  8234. return false;
  8235. }
  8236. /***/ }),
  8237. /* 336 */
  8238. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8239. "use strict";
  8240. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
  8241. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
  8242. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(64);
  8243. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__deepGet_js__ = __webpack_require__(134);
  8244. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__toPath_js__ = __webpack_require__(81);
  8245. // Invoke a method (with arguments) on every item in a collection.
  8246. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, path, args) {
  8247. var contextPath, func;
  8248. if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(path)) {
  8249. func = path;
  8250. } else {
  8251. path = Object(__WEBPACK_IMPORTED_MODULE_4__toPath_js__["a" /* default */])(path);
  8252. contextPath = path.slice(0, -1);
  8253. path = path[path.length - 1];
  8254. }
  8255. return Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" /* default */])(obj, function(context) {
  8256. var method = func;
  8257. if (!method) {
  8258. if (contextPath && contextPath.length) {
  8259. context = Object(__WEBPACK_IMPORTED_MODULE_3__deepGet_js__["a" /* default */])(context, contextPath);
  8260. }
  8261. if (context == null) return void 0;
  8262. method = context[path];
  8263. }
  8264. return method == null ? method : method.apply(context, args);
  8265. });
  8266. }));
  8267. /***/ }),
  8268. /* 337 */
  8269. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8270. "use strict";
  8271. /* harmony export (immutable) */ __webpack_exports__["a"] = where;
  8272. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(83);
  8273. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(103);
  8274. // Convenience version of a common use case of `_.filter`: selecting only
  8275. // objects containing specific `key:value` pairs.
  8276. function where(obj, attrs) {
  8277. return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" /* default */])(attrs));
  8278. }
  8279. /***/ }),
  8280. /* 338 */
  8281. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8282. "use strict";
  8283. /* harmony export (immutable) */ __webpack_exports__["a"] = min;
  8284. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
  8285. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(62);
  8286. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(20);
  8287. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(54);
  8288. // Return the minimum element (or element-based computation).
  8289. function min(obj, iteratee, context) {
  8290. var result = Infinity, lastComputed = Infinity,
  8291. value, computed;
  8292. if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
  8293. obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
  8294. for (var i = 0, length = obj.length; i < length; i++) {
  8295. value = obj[i];
  8296. if (value != null && value < result) {
  8297. result = value;
  8298. }
  8299. }
  8300. } else {
  8301. iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(iteratee, context);
  8302. Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" /* default */])(obj, function(v, index, list) {
  8303. computed = iteratee(v, index, list);
  8304. if (computed < lastComputed || computed === Infinity && result === Infinity) {
  8305. result = v;
  8306. lastComputed = computed;
  8307. }
  8308. });
  8309. }
  8310. return result;
  8311. }
  8312. /***/ }),
  8313. /* 339 */
  8314. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8315. "use strict";
  8316. /* harmony export (immutable) */ __webpack_exports__["a"] = shuffle;
  8317. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sample_js__ = __webpack_require__(210);
  8318. // Shuffle a collection.
  8319. function shuffle(obj) {
  8320. return Object(__WEBPACK_IMPORTED_MODULE_0__sample_js__["a" /* default */])(obj, Infinity);
  8321. }
  8322. /***/ }),
  8323. /* 340 */
  8324. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8325. "use strict";
  8326. /* harmony export (immutable) */ __webpack_exports__["a"] = sortBy;
  8327. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
  8328. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pluck_js__ = __webpack_require__(140);
  8329. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(64);
  8330. // Sort the object's values by a criterion produced by an iteratee.
  8331. function sortBy(obj, iteratee, context) {
  8332. var index = 0;
  8333. iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
  8334. return Object(__WEBPACK_IMPORTED_MODULE_1__pluck_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" /* default */])(obj, function(value, key, list) {
  8335. return {
  8336. value: value,
  8337. index: index++,
  8338. criteria: iteratee(value, key, list)
  8339. };
  8340. }).sort(function(left, right) {
  8341. var a = left.criteria;
  8342. var b = right.criteria;
  8343. if (a !== b) {
  8344. if (a > b || a === void 0) return 1;
  8345. if (a < b || b === void 0) return -1;
  8346. }
  8347. return left.index - right.index;
  8348. }), 'value');
  8349. }
  8350. /***/ }),
  8351. /* 341 */
  8352. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8353. "use strict";
  8354. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
  8355. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(40);
  8356. // Groups the object's values by a criterion. Pass either a string attribute
  8357. // to group by, or a function that returns the criterion.
  8358. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
  8359. if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(result, key)) result[key].push(value); else result[key] = [value];
  8360. }));
  8361. /***/ }),
  8362. /* 342 */
  8363. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8364. "use strict";
  8365. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
  8366. // Indexes the object's values by a criterion, similar to `_.groupBy`, but for
  8367. // when you know that your index values will be unique.
  8368. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
  8369. result[key] = value;
  8370. }));
  8371. /***/ }),
  8372. /* 343 */
  8373. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8374. "use strict";
  8375. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
  8376. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(40);
  8377. // Counts instances of an object that group by a certain criterion. Pass
  8378. // either a string attribute to count by, or a function that returns the
  8379. // criterion.
  8380. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
  8381. if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(result, key)) result[key]++; else result[key] = 1;
  8382. }));
  8383. /***/ }),
  8384. /* 344 */
  8385. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8386. "use strict";
  8387. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
  8388. // Split a collection into two arrays: one whose elements all pass the given
  8389. // truth test, and one whose elements all do not pass the truth test.
  8390. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, pass) {
  8391. result[pass ? 0 : 1].push(value);
  8392. }, true));
  8393. /***/ }),
  8394. /* 345 */
  8395. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8396. "use strict";
  8397. /* harmony export (immutable) */ __webpack_exports__["a"] = toArray;
  8398. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArray_js__ = __webpack_require__(53);
  8399. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
  8400. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(127);
  8401. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__ = __webpack_require__(25);
  8402. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map_js__ = __webpack_require__(64);
  8403. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__identity_js__ = __webpack_require__(135);
  8404. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__values_js__ = __webpack_require__(62);
  8405. // Safely create a real, live array from anything iterable.
  8406. var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
  8407. function toArray(obj) {
  8408. if (!obj) return [];
  8409. if (Object(__WEBPACK_IMPORTED_MODULE_0__isArray_js__["a" /* default */])(obj)) return __WEBPACK_IMPORTED_MODULE_1__setup_js__["q" /* slice */].call(obj);
  8410. if (Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" /* default */])(obj)) {
  8411. // Keep surrogate pair characters together.
  8412. return obj.match(reStrSymbol);
  8413. }
  8414. if (Object(__WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__["a" /* default */])(obj)) return Object(__WEBPACK_IMPORTED_MODULE_4__map_js__["a" /* default */])(obj, __WEBPACK_IMPORTED_MODULE_5__identity_js__["a" /* default */]);
  8415. return Object(__WEBPACK_IMPORTED_MODULE_6__values_js__["a" /* default */])(obj);
  8416. }
  8417. /***/ }),
  8418. /* 346 */
  8419. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8420. "use strict";
  8421. /* harmony export (immutable) */ __webpack_exports__["a"] = size;
  8422. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
  8423. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
  8424. // Return the number of elements in a collection.
  8425. function size(obj) {
  8426. if (obj == null) return 0;
  8427. return Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj.length : Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj).length;
  8428. }
  8429. /***/ }),
  8430. /* 347 */
  8431. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8432. "use strict";
  8433. /* harmony export (immutable) */ __webpack_exports__["a"] = keyInObj;
  8434. // Internal `_.pick` helper function to determine whether `key` is an enumerable
  8435. // property name of `obj`.
  8436. function keyInObj(value, key, obj) {
  8437. return key in obj;
  8438. }
  8439. /***/ }),
  8440. /* 348 */
  8441. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8442. "use strict";
  8443. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
  8444. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
  8445. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__negate_js__ = __webpack_require__(138);
  8446. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__map_js__ = __webpack_require__(64);
  8447. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__flatten_js__ = __webpack_require__(63);
  8448. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__contains_js__ = __webpack_require__(84);
  8449. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pick_js__ = __webpack_require__(211);
  8450. // Return a copy of the object without the disallowed properties.
  8451. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
  8452. var iteratee = keys[0], context;
  8453. if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(iteratee)) {
  8454. iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__negate_js__["a" /* default */])(iteratee);
  8455. if (keys.length > 1) context = keys[1];
  8456. } else {
  8457. keys = Object(__WEBPACK_IMPORTED_MODULE_3__map_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__flatten_js__["a" /* default */])(keys, false, false), String);
  8458. iteratee = function(value, key) {
  8459. return !Object(__WEBPACK_IMPORTED_MODULE_5__contains_js__["a" /* default */])(keys, key);
  8460. };
  8461. }
  8462. return Object(__WEBPACK_IMPORTED_MODULE_6__pick_js__["a" /* default */])(obj, iteratee, context);
  8463. }));
  8464. /***/ }),
  8465. /* 349 */
  8466. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8467. "use strict";
  8468. /* harmony export (immutable) */ __webpack_exports__["a"] = first;
  8469. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__initial_js__ = __webpack_require__(212);
  8470. // Get the first element of an array. Passing **n** will return the first N
  8471. // values in the array. The **guard** check allows it to work with `_.map`.
  8472. function first(array, n, guard) {
  8473. if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
  8474. if (n == null || guard) return array[0];
  8475. return Object(__WEBPACK_IMPORTED_MODULE_0__initial_js__["a" /* default */])(array, array.length - n);
  8476. }
  8477. /***/ }),
  8478. /* 350 */
  8479. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8480. "use strict";
  8481. /* harmony export (immutable) */ __webpack_exports__["a"] = last;
  8482. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rest_js__ = __webpack_require__(213);
  8483. // Get the last element of an array. Passing **n** will return the last N
  8484. // values in the array.
  8485. function last(array, n, guard) {
  8486. if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
  8487. if (n == null || guard) return array[array.length - 1];
  8488. return Object(__WEBPACK_IMPORTED_MODULE_0__rest_js__["a" /* default */])(array, Math.max(0, array.length - n));
  8489. }
  8490. /***/ }),
  8491. /* 351 */
  8492. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8493. "use strict";
  8494. /* harmony export (immutable) */ __webpack_exports__["a"] = compact;
  8495. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(83);
  8496. // Trim out all falsy values from an array.
  8497. function compact(array) {
  8498. return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(array, Boolean);
  8499. }
  8500. /***/ }),
  8501. /* 352 */
  8502. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8503. "use strict";
  8504. /* harmony export (immutable) */ __webpack_exports__["a"] = flatten;
  8505. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__flatten_js__ = __webpack_require__(63);
  8506. // Flatten out an array, either recursively (by default), or up to `depth`.
  8507. // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.
  8508. function flatten(array, depth) {
  8509. return Object(__WEBPACK_IMPORTED_MODULE_0__flatten_js__["a" /* default */])(array, depth, false);
  8510. }
  8511. /***/ }),
  8512. /* 353 */
  8513. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8514. "use strict";
  8515. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
  8516. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__difference_js__ = __webpack_require__(214);
  8517. // Return a version of the array that does not contain the specified value(s).
  8518. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(array, otherArrays) {
  8519. return Object(__WEBPACK_IMPORTED_MODULE_1__difference_js__["a" /* default */])(array, otherArrays);
  8520. }));
  8521. /***/ }),
  8522. /* 354 */
  8523. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8524. "use strict";
  8525. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
  8526. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__uniq_js__ = __webpack_require__(215);
  8527. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__flatten_js__ = __webpack_require__(63);
  8528. // Produce an array that contains the union: each distinct element from all of
  8529. // the passed-in arrays.
  8530. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(arrays) {
  8531. return Object(__WEBPACK_IMPORTED_MODULE_1__uniq_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__flatten_js__["a" /* default */])(arrays, true, true));
  8532. }));
  8533. /***/ }),
  8534. /* 355 */
  8535. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8536. "use strict";
  8537. /* harmony export (immutable) */ __webpack_exports__["a"] = intersection;
  8538. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
  8539. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__contains_js__ = __webpack_require__(84);
  8540. // Produce an array that contains every item shared between all the
  8541. // passed-in arrays.
  8542. function intersection(array) {
  8543. var result = [];
  8544. var argsLength = arguments.length;
  8545. for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(array); i < length; i++) {
  8546. var item = array[i];
  8547. if (Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" /* default */])(result, item)) continue;
  8548. var j;
  8549. for (j = 1; j < argsLength; j++) {
  8550. if (!Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" /* default */])(arguments[j], item)) break;
  8551. }
  8552. if (j === argsLength) result.push(item);
  8553. }
  8554. return result;
  8555. }
  8556. /***/ }),
  8557. /* 356 */
  8558. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8559. "use strict";
  8560. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
  8561. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__unzip_js__ = __webpack_require__(216);
  8562. // Zip together multiple lists into a single array -- elements that share
  8563. // an index go together.
  8564. /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__unzip_js__["a" /* default */]));
  8565. /***/ }),
  8566. /* 357 */
  8567. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8568. "use strict";
  8569. /* harmony export (immutable) */ __webpack_exports__["a"] = object;
  8570. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
  8571. // Converts lists into objects. Pass either a single array of `[key, value]`
  8572. // pairs, or two parallel arrays of the same length -- one of keys, and one of
  8573. // the corresponding values. Passing by pairs is the reverse of `_.pairs`.
  8574. function object(list, values) {
  8575. var result = {};
  8576. for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(list); i < length; i++) {
  8577. if (values) {
  8578. result[list[i]] = values[i];
  8579. } else {
  8580. result[list[i][0]] = list[i][1];
  8581. }
  8582. }
  8583. return result;
  8584. }
  8585. /***/ }),
  8586. /* 358 */
  8587. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8588. "use strict";
  8589. /* harmony export (immutable) */ __webpack_exports__["a"] = range;
  8590. // Generate an integer Array containing an arithmetic progression. A port of
  8591. // the native Python `range()` function. See
  8592. // [the Python documentation](https://docs.python.org/library/functions.html#range).
  8593. function range(start, stop, step) {
  8594. if (stop == null) {
  8595. stop = start || 0;
  8596. start = 0;
  8597. }
  8598. if (!step) {
  8599. step = stop < start ? -1 : 1;
  8600. }
  8601. var length = Math.max(Math.ceil((stop - start) / step), 0);
  8602. var range = Array(length);
  8603. for (var idx = 0; idx < length; idx++, start += step) {
  8604. range[idx] = start;
  8605. }
  8606. return range;
  8607. }
  8608. /***/ }),
  8609. /* 359 */
  8610. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8611. "use strict";
  8612. /* harmony export (immutable) */ __webpack_exports__["a"] = chunk;
  8613. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
  8614. // Chunk a single array into multiple arrays, each containing `count` or fewer
  8615. // items.
  8616. function chunk(array, count) {
  8617. if (count == null || count < 1) return [];
  8618. var result = [];
  8619. var i = 0, length = array.length;
  8620. while (i < length) {
  8621. result.push(__WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, i, i += count));
  8622. }
  8623. return result;
  8624. }
  8625. /***/ }),
  8626. /* 360 */
  8627. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8628. "use strict";
  8629. /* harmony export (immutable) */ __webpack_exports__["a"] = mixin;
  8630. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
  8631. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
  8632. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__functions_js__ = __webpack_require__(183);
  8633. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__setup_js__ = __webpack_require__(5);
  8634. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__chainResult_js__ = __webpack_require__(217);
  8635. // Add your own custom functions to the Underscore object.
  8636. function mixin(obj) {
  8637. Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__functions_js__["a" /* default */])(obj), function(name) {
  8638. var func = __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */][name] = obj[name];
  8639. __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
  8640. var args = [this._wrapped];
  8641. __WEBPACK_IMPORTED_MODULE_3__setup_js__["o" /* push */].apply(args, arguments);
  8642. return Object(__WEBPACK_IMPORTED_MODULE_4__chainResult_js__["a" /* default */])(this, func.apply(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */], args));
  8643. };
  8644. });
  8645. return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */];
  8646. }
  8647. /***/ }),
  8648. /* 361 */
  8649. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8650. "use strict";
  8651. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
  8652. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
  8653. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__setup_js__ = __webpack_require__(5);
  8654. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chainResult_js__ = __webpack_require__(217);
  8655. // Add all mutator `Array` functions to the wrapper.
  8656. Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
  8657. var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" /* ArrayProto */][name];
  8658. __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
  8659. var obj = this._wrapped;
  8660. if (obj != null) {
  8661. method.apply(obj, arguments);
  8662. if ((name === 'shift' || name === 'splice') && obj.length === 0) {
  8663. delete obj[0];
  8664. }
  8665. }
  8666. return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" /* default */])(this, obj);
  8667. };
  8668. });
  8669. // Add all accessor `Array` functions to the wrapper.
  8670. Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(['concat', 'join', 'slice'], function(name) {
  8671. var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" /* ArrayProto */][name];
  8672. __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
  8673. var obj = this._wrapped;
  8674. if (obj != null) obj = method.apply(obj, arguments);
  8675. return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" /* default */])(this, obj);
  8676. };
  8677. });
  8678. /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]);
  8679. /***/ }),
  8680. /* 362 */
  8681. /***/ (function(module, exports, __webpack_require__) {
  8682. var parent = __webpack_require__(363);
  8683. module.exports = parent;
  8684. /***/ }),
  8685. /* 363 */
  8686. /***/ (function(module, exports, __webpack_require__) {
  8687. var isPrototypeOf = __webpack_require__(21);
  8688. var method = __webpack_require__(364);
  8689. var ArrayPrototype = Array.prototype;
  8690. module.exports = function (it) {
  8691. var own = it.concat;
  8692. return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.concat) ? method : own;
  8693. };
  8694. /***/ }),
  8695. /* 364 */
  8696. /***/ (function(module, exports, __webpack_require__) {
  8697. __webpack_require__(218);
  8698. var entryVirtual = __webpack_require__(41);
  8699. module.exports = entryVirtual('Array').concat;
  8700. /***/ }),
  8701. /* 365 */
  8702. /***/ (function(module, exports) {
  8703. var $TypeError = TypeError;
  8704. var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
  8705. module.exports = function (it) {
  8706. if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
  8707. return it;
  8708. };
  8709. /***/ }),
  8710. /* 366 */
  8711. /***/ (function(module, exports, __webpack_require__) {
  8712. var isArray = __webpack_require__(85);
  8713. var isConstructor = __webpack_require__(101);
  8714. var isObject = __webpack_require__(11);
  8715. var wellKnownSymbol = __webpack_require__(9);
  8716. var SPECIES = wellKnownSymbol('species');
  8717. var $Array = Array;
  8718. // a part of `ArraySpeciesCreate` abstract operation
  8719. // https://tc39.es/ecma262/#sec-arrayspeciescreate
  8720. module.exports = function (originalArray) {
  8721. var C;
  8722. if (isArray(originalArray)) {
  8723. C = originalArray.constructor;
  8724. // cross-realm fallback
  8725. if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
  8726. else if (isObject(C)) {
  8727. C = C[SPECIES];
  8728. if (C === null) C = undefined;
  8729. }
  8730. } return C === undefined ? $Array : C;
  8731. };
  8732. /***/ }),
  8733. /* 367 */
  8734. /***/ (function(module, exports, __webpack_require__) {
  8735. var parent = __webpack_require__(368);
  8736. module.exports = parent;
  8737. /***/ }),
  8738. /* 368 */
  8739. /***/ (function(module, exports, __webpack_require__) {
  8740. var isPrototypeOf = __webpack_require__(21);
  8741. var method = __webpack_require__(369);
  8742. var ArrayPrototype = Array.prototype;
  8743. module.exports = function (it) {
  8744. var own = it.map;
  8745. return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.map) ? method : own;
  8746. };
  8747. /***/ }),
  8748. /* 369 */
  8749. /***/ (function(module, exports, __webpack_require__) {
  8750. __webpack_require__(370);
  8751. var entryVirtual = __webpack_require__(41);
  8752. module.exports = entryVirtual('Array').map;
  8753. /***/ }),
  8754. /* 370 */
  8755. /***/ (function(module, exports, __webpack_require__) {
  8756. "use strict";
  8757. var $ = __webpack_require__(0);
  8758. var $map = __webpack_require__(66).map;
  8759. var arrayMethodHasSpeciesSupport = __webpack_require__(107);
  8760. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
  8761. // `Array.prototype.map` method
  8762. // https://tc39.es/ecma262/#sec-array.prototype.map
  8763. // with adding support of @@species
  8764. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  8765. map: function map(callbackfn /* , thisArg */) {
  8766. return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  8767. }
  8768. });
  8769. /***/ }),
  8770. /* 371 */
  8771. /***/ (function(module, exports, __webpack_require__) {
  8772. var parent = __webpack_require__(372);
  8773. module.exports = parent;
  8774. /***/ }),
  8775. /* 372 */
  8776. /***/ (function(module, exports, __webpack_require__) {
  8777. __webpack_require__(373);
  8778. var path = __webpack_require__(10);
  8779. module.exports = path.Object.keys;
  8780. /***/ }),
  8781. /* 373 */
  8782. /***/ (function(module, exports, __webpack_require__) {
  8783. var $ = __webpack_require__(0);
  8784. var toObject = __webpack_require__(34);
  8785. var nativeKeys = __webpack_require__(98);
  8786. var fails = __webpack_require__(3);
  8787. var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
  8788. // `Object.keys` method
  8789. // https://tc39.es/ecma262/#sec-object.keys
  8790. $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
  8791. keys: function keys(it) {
  8792. return nativeKeys(toObject(it));
  8793. }
  8794. });
  8795. /***/ }),
  8796. /* 374 */
  8797. /***/ (function(module, exports, __webpack_require__) {
  8798. var parent = __webpack_require__(375);
  8799. module.exports = parent;
  8800. /***/ }),
  8801. /* 375 */
  8802. /***/ (function(module, exports, __webpack_require__) {
  8803. __webpack_require__(220);
  8804. var path = __webpack_require__(10);
  8805. var apply = __webpack_require__(69);
  8806. // eslint-disable-next-line es-x/no-json -- safe
  8807. if (!path.JSON) path.JSON = { stringify: JSON.stringify };
  8808. // eslint-disable-next-line no-unused-vars -- required for `.length`
  8809. module.exports = function stringify(it, replacer, space) {
  8810. return apply(path.JSON.stringify, null, arguments);
  8811. };
  8812. /***/ }),
  8813. /* 376 */
  8814. /***/ (function(module, exports, __webpack_require__) {
  8815. var parent = __webpack_require__(377);
  8816. module.exports = parent;
  8817. /***/ }),
  8818. /* 377 */
  8819. /***/ (function(module, exports, __webpack_require__) {
  8820. var isPrototypeOf = __webpack_require__(21);
  8821. var method = __webpack_require__(378);
  8822. var ArrayPrototype = Array.prototype;
  8823. module.exports = function (it) {
  8824. var own = it.indexOf;
  8825. return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.indexOf) ? method : own;
  8826. };
  8827. /***/ }),
  8828. /* 378 */
  8829. /***/ (function(module, exports, __webpack_require__) {
  8830. __webpack_require__(379);
  8831. var entryVirtual = __webpack_require__(41);
  8832. module.exports = entryVirtual('Array').indexOf;
  8833. /***/ }),
  8834. /* 379 */
  8835. /***/ (function(module, exports, __webpack_require__) {
  8836. "use strict";
  8837. /* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
  8838. var $ = __webpack_require__(0);
  8839. var uncurryThis = __webpack_require__(4);
  8840. var $IndexOf = __webpack_require__(153).indexOf;
  8841. var arrayMethodIsStrict = __webpack_require__(380);
  8842. var un$IndexOf = uncurryThis([].indexOf);
  8843. var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
  8844. var STRICT_METHOD = arrayMethodIsStrict('indexOf');
  8845. // `Array.prototype.indexOf` method
  8846. // https://tc39.es/ecma262/#sec-array.prototype.indexof
  8847. $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
  8848. indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
  8849. var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
  8850. return NEGATIVE_ZERO
  8851. // convert -0 to +0
  8852. ? un$IndexOf(this, searchElement, fromIndex) || 0
  8853. : $IndexOf(this, searchElement, fromIndex);
  8854. }
  8855. });
  8856. /***/ }),
  8857. /* 380 */
  8858. /***/ (function(module, exports, __webpack_require__) {
  8859. "use strict";
  8860. var fails = __webpack_require__(3);
  8861. module.exports = function (METHOD_NAME, argument) {
  8862. var method = [][METHOD_NAME];
  8863. return !!method && fails(function () {
  8864. // eslint-disable-next-line no-useless-call -- required for testing
  8865. method.call(null, argument || function () { return 1; }, 1);
  8866. });
  8867. };
  8868. /***/ }),
  8869. /* 381 */
  8870. /***/ (function(module, exports, __webpack_require__) {
  8871. __webpack_require__(51);
  8872. var classof = __webpack_require__(59);
  8873. var hasOwn = __webpack_require__(14);
  8874. var isPrototypeOf = __webpack_require__(21);
  8875. var method = __webpack_require__(382);
  8876. var ArrayPrototype = Array.prototype;
  8877. var DOMIterables = {
  8878. DOMTokenList: true,
  8879. NodeList: true
  8880. };
  8881. module.exports = function (it) {
  8882. var own = it.keys;
  8883. return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.keys)
  8884. || hasOwn(DOMIterables, classof(it)) ? method : own;
  8885. };
  8886. /***/ }),
  8887. /* 382 */
  8888. /***/ (function(module, exports, __webpack_require__) {
  8889. var parent = __webpack_require__(383);
  8890. module.exports = parent;
  8891. /***/ }),
  8892. /* 383 */
  8893. /***/ (function(module, exports, __webpack_require__) {
  8894. __webpack_require__(48);
  8895. __webpack_require__(60);
  8896. var entryVirtual = __webpack_require__(41);
  8897. module.exports = entryVirtual('Array').keys;
  8898. /***/ }),
  8899. /* 384 */
  8900. /***/ (function(module, exports) {
  8901. // Unique ID creation requires a high quality random # generator. In the
  8902. // browser this is a little complicated due to unknown quality of Math.random()
  8903. // and inconsistent support for the `crypto` API. We do the best we can via
  8904. // feature-detection
  8905. // getRandomValues needs to be invoked in a context where "this" is a Crypto
  8906. // implementation. Also, find the complete implementation of crypto on IE11.
  8907. var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
  8908. (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
  8909. if (getRandomValues) {
  8910. // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
  8911. var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
  8912. module.exports = function whatwgRNG() {
  8913. getRandomValues(rnds8);
  8914. return rnds8;
  8915. };
  8916. } else {
  8917. // Math.random()-based (RNG)
  8918. //
  8919. // If all else fails, use Math.random(). It's fast, but is of unspecified
  8920. // quality.
  8921. var rnds = new Array(16);
  8922. module.exports = function mathRNG() {
  8923. for (var i = 0, r; i < 16; i++) {
  8924. if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
  8925. rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
  8926. }
  8927. return rnds;
  8928. };
  8929. }
  8930. /***/ }),
  8931. /* 385 */
  8932. /***/ (function(module, exports) {
  8933. /**
  8934. * Convert array of 16 byte values to UUID string format of the form:
  8935. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  8936. */
  8937. var byteToHex = [];
  8938. for (var i = 0; i < 256; ++i) {
  8939. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  8940. }
  8941. function bytesToUuid(buf, offset) {
  8942. var i = offset || 0;
  8943. var bth = byteToHex;
  8944. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  8945. return ([bth[buf[i++]], bth[buf[i++]],
  8946. bth[buf[i++]], bth[buf[i++]], '-',
  8947. bth[buf[i++]], bth[buf[i++]], '-',
  8948. bth[buf[i++]], bth[buf[i++]], '-',
  8949. bth[buf[i++]], bth[buf[i++]], '-',
  8950. bth[buf[i++]], bth[buf[i++]],
  8951. bth[buf[i++]], bth[buf[i++]],
  8952. bth[buf[i++]], bth[buf[i++]]]).join('');
  8953. }
  8954. module.exports = bytesToUuid;
  8955. /***/ }),
  8956. /* 386 */
  8957. /***/ (function(module, exports, __webpack_require__) {
  8958. "use strict";
  8959. /**
  8960. * This is the common logic for both the Node.js and web browser
  8961. * implementations of `debug()`.
  8962. */
  8963. function setup(env) {
  8964. createDebug.debug = createDebug;
  8965. createDebug.default = createDebug;
  8966. createDebug.coerce = coerce;
  8967. createDebug.disable = disable;
  8968. createDebug.enable = enable;
  8969. createDebug.enabled = enabled;
  8970. createDebug.humanize = __webpack_require__(387);
  8971. Object.keys(env).forEach(function (key) {
  8972. createDebug[key] = env[key];
  8973. });
  8974. /**
  8975. * Active `debug` instances.
  8976. */
  8977. createDebug.instances = [];
  8978. /**
  8979. * The currently active debug mode names, and names to skip.
  8980. */
  8981. createDebug.names = [];
  8982. createDebug.skips = [];
  8983. /**
  8984. * Map of special "%n" handling functions, for the debug "format" argument.
  8985. *
  8986. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  8987. */
  8988. createDebug.formatters = {};
  8989. /**
  8990. * Selects a color for a debug namespace
  8991. * @param {String} namespace The namespace string for the for the debug instance to be colored
  8992. * @return {Number|String} An ANSI color code for the given namespace
  8993. * @api private
  8994. */
  8995. function selectColor(namespace) {
  8996. var hash = 0;
  8997. for (var i = 0; i < namespace.length; i++) {
  8998. hash = (hash << 5) - hash + namespace.charCodeAt(i);
  8999. hash |= 0; // Convert to 32bit integer
  9000. }
  9001. return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
  9002. }
  9003. createDebug.selectColor = selectColor;
  9004. /**
  9005. * Create a debugger with the given `namespace`.
  9006. *
  9007. * @param {String} namespace
  9008. * @return {Function}
  9009. * @api public
  9010. */
  9011. function createDebug(namespace) {
  9012. var prevTime;
  9013. function debug() {
  9014. // Disabled?
  9015. if (!debug.enabled) {
  9016. return;
  9017. }
  9018. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  9019. args[_key] = arguments[_key];
  9020. }
  9021. var self = debug; // Set `diff` timestamp
  9022. var curr = Number(new Date());
  9023. var ms = curr - (prevTime || curr);
  9024. self.diff = ms;
  9025. self.prev = prevTime;
  9026. self.curr = curr;
  9027. prevTime = curr;
  9028. args[0] = createDebug.coerce(args[0]);
  9029. if (typeof args[0] !== 'string') {
  9030. // Anything else let's inspect with %O
  9031. args.unshift('%O');
  9032. } // Apply any `formatters` transformations
  9033. var index = 0;
  9034. args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
  9035. // If we encounter an escaped % then don't increase the array index
  9036. if (match === '%%') {
  9037. return match;
  9038. }
  9039. index++;
  9040. var formatter = createDebug.formatters[format];
  9041. if (typeof formatter === 'function') {
  9042. var val = args[index];
  9043. match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
  9044. args.splice(index, 1);
  9045. index--;
  9046. }
  9047. return match;
  9048. }); // Apply env-specific formatting (colors, etc.)
  9049. createDebug.formatArgs.call(self, args);
  9050. var logFn = self.log || createDebug.log;
  9051. logFn.apply(self, args);
  9052. }
  9053. debug.namespace = namespace;
  9054. debug.enabled = createDebug.enabled(namespace);
  9055. debug.useColors = createDebug.useColors();
  9056. debug.color = selectColor(namespace);
  9057. debug.destroy = destroy;
  9058. debug.extend = extend; // Debug.formatArgs = formatArgs;
  9059. // debug.rawLog = rawLog;
  9060. // env-specific initialization logic for debug instances
  9061. if (typeof createDebug.init === 'function') {
  9062. createDebug.init(debug);
  9063. }
  9064. createDebug.instances.push(debug);
  9065. return debug;
  9066. }
  9067. function destroy() {
  9068. var index = createDebug.instances.indexOf(this);
  9069. if (index !== -1) {
  9070. createDebug.instances.splice(index, 1);
  9071. return true;
  9072. }
  9073. return false;
  9074. }
  9075. function extend(namespace, delimiter) {
  9076. return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
  9077. }
  9078. /**
  9079. * Enables a debug mode by namespaces. This can include modes
  9080. * separated by a colon and wildcards.
  9081. *
  9082. * @param {String} namespaces
  9083. * @api public
  9084. */
  9085. function enable(namespaces) {
  9086. createDebug.save(namespaces);
  9087. createDebug.names = [];
  9088. createDebug.skips = [];
  9089. var i;
  9090. var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  9091. var len = split.length;
  9092. for (i = 0; i < len; i++) {
  9093. if (!split[i]) {
  9094. // ignore empty strings
  9095. continue;
  9096. }
  9097. namespaces = split[i].replace(/\*/g, '.*?');
  9098. if (namespaces[0] === '-') {
  9099. createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  9100. } else {
  9101. createDebug.names.push(new RegExp('^' + namespaces + '$'));
  9102. }
  9103. }
  9104. for (i = 0; i < createDebug.instances.length; i++) {
  9105. var instance = createDebug.instances[i];
  9106. instance.enabled = createDebug.enabled(instance.namespace);
  9107. }
  9108. }
  9109. /**
  9110. * Disable debug output.
  9111. *
  9112. * @api public
  9113. */
  9114. function disable() {
  9115. createDebug.enable('');
  9116. }
  9117. /**
  9118. * Returns true if the given mode name is enabled, false otherwise.
  9119. *
  9120. * @param {String} name
  9121. * @return {Boolean}
  9122. * @api public
  9123. */
  9124. function enabled(name) {
  9125. if (name[name.length - 1] === '*') {
  9126. return true;
  9127. }
  9128. var i;
  9129. var len;
  9130. for (i = 0, len = createDebug.skips.length; i < len; i++) {
  9131. if (createDebug.skips[i].test(name)) {
  9132. return false;
  9133. }
  9134. }
  9135. for (i = 0, len = createDebug.names.length; i < len; i++) {
  9136. if (createDebug.names[i].test(name)) {
  9137. return true;
  9138. }
  9139. }
  9140. return false;
  9141. }
  9142. /**
  9143. * Coerce `val`.
  9144. *
  9145. * @param {Mixed} val
  9146. * @return {Mixed}
  9147. * @api private
  9148. */
  9149. function coerce(val) {
  9150. if (val instanceof Error) {
  9151. return val.stack || val.message;
  9152. }
  9153. return val;
  9154. }
  9155. createDebug.enable(createDebug.load());
  9156. return createDebug;
  9157. }
  9158. module.exports = setup;
  9159. /***/ }),
  9160. /* 387 */
  9161. /***/ (function(module, exports) {
  9162. /**
  9163. * Helpers.
  9164. */
  9165. var s = 1000;
  9166. var m = s * 60;
  9167. var h = m * 60;
  9168. var d = h * 24;
  9169. var w = d * 7;
  9170. var y = d * 365.25;
  9171. /**
  9172. * Parse or format the given `val`.
  9173. *
  9174. * Options:
  9175. *
  9176. * - `long` verbose formatting [false]
  9177. *
  9178. * @param {String|Number} val
  9179. * @param {Object} [options]
  9180. * @throws {Error} throw an error if val is not a non-empty string or a number
  9181. * @return {String|Number}
  9182. * @api public
  9183. */
  9184. module.exports = function(val, options) {
  9185. options = options || {};
  9186. var type = typeof val;
  9187. if (type === 'string' && val.length > 0) {
  9188. return parse(val);
  9189. } else if (type === 'number' && isFinite(val)) {
  9190. return options.long ? fmtLong(val) : fmtShort(val);
  9191. }
  9192. throw new Error(
  9193. 'val is not a non-empty string or a valid number. val=' +
  9194. JSON.stringify(val)
  9195. );
  9196. };
  9197. /**
  9198. * Parse the given `str` and return milliseconds.
  9199. *
  9200. * @param {String} str
  9201. * @return {Number}
  9202. * @api private
  9203. */
  9204. function parse(str) {
  9205. str = String(str);
  9206. if (str.length > 100) {
  9207. return;
  9208. }
  9209. var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
  9210. str
  9211. );
  9212. if (!match) {
  9213. return;
  9214. }
  9215. var n = parseFloat(match[1]);
  9216. var type = (match[2] || 'ms').toLowerCase();
  9217. switch (type) {
  9218. case 'years':
  9219. case 'year':
  9220. case 'yrs':
  9221. case 'yr':
  9222. case 'y':
  9223. return n * y;
  9224. case 'weeks':
  9225. case 'week':
  9226. case 'w':
  9227. return n * w;
  9228. case 'days':
  9229. case 'day':
  9230. case 'd':
  9231. return n * d;
  9232. case 'hours':
  9233. case 'hour':
  9234. case 'hrs':
  9235. case 'hr':
  9236. case 'h':
  9237. return n * h;
  9238. case 'minutes':
  9239. case 'minute':
  9240. case 'mins':
  9241. case 'min':
  9242. case 'm':
  9243. return n * m;
  9244. case 'seconds':
  9245. case 'second':
  9246. case 'secs':
  9247. case 'sec':
  9248. case 's':
  9249. return n * s;
  9250. case 'milliseconds':
  9251. case 'millisecond':
  9252. case 'msecs':
  9253. case 'msec':
  9254. case 'ms':
  9255. return n;
  9256. default:
  9257. return undefined;
  9258. }
  9259. }
  9260. /**
  9261. * Short format for `ms`.
  9262. *
  9263. * @param {Number} ms
  9264. * @return {String}
  9265. * @api private
  9266. */
  9267. function fmtShort(ms) {
  9268. var msAbs = Math.abs(ms);
  9269. if (msAbs >= d) {
  9270. return Math.round(ms / d) + 'd';
  9271. }
  9272. if (msAbs >= h) {
  9273. return Math.round(ms / h) + 'h';
  9274. }
  9275. if (msAbs >= m) {
  9276. return Math.round(ms / m) + 'm';
  9277. }
  9278. if (msAbs >= s) {
  9279. return Math.round(ms / s) + 's';
  9280. }
  9281. return ms + 'ms';
  9282. }
  9283. /**
  9284. * Long format for `ms`.
  9285. *
  9286. * @param {Number} ms
  9287. * @return {String}
  9288. * @api private
  9289. */
  9290. function fmtLong(ms) {
  9291. var msAbs = Math.abs(ms);
  9292. if (msAbs >= d) {
  9293. return plural(ms, msAbs, d, 'day');
  9294. }
  9295. if (msAbs >= h) {
  9296. return plural(ms, msAbs, h, 'hour');
  9297. }
  9298. if (msAbs >= m) {
  9299. return plural(ms, msAbs, m, 'minute');
  9300. }
  9301. if (msAbs >= s) {
  9302. return plural(ms, msAbs, s, 'second');
  9303. }
  9304. return ms + ' ms';
  9305. }
  9306. /**
  9307. * Pluralization helper.
  9308. */
  9309. function plural(ms, msAbs, n, name) {
  9310. var isPlural = msAbs >= n * 1.5;
  9311. return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
  9312. }
  9313. /***/ }),
  9314. /* 388 */
  9315. /***/ (function(module, exports, __webpack_require__) {
  9316. __webpack_require__(389);
  9317. var path = __webpack_require__(10);
  9318. module.exports = path.Object.getPrototypeOf;
  9319. /***/ }),
  9320. /* 389 */
  9321. /***/ (function(module, exports, __webpack_require__) {
  9322. var $ = __webpack_require__(0);
  9323. var fails = __webpack_require__(3);
  9324. var toObject = __webpack_require__(34);
  9325. var nativeGetPrototypeOf = __webpack_require__(93);
  9326. var CORRECT_PROTOTYPE_GETTER = __webpack_require__(151);
  9327. var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
  9328. // `Object.getPrototypeOf` method
  9329. // https://tc39.es/ecma262/#sec-object.getprototypeof
  9330. $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
  9331. getPrototypeOf: function getPrototypeOf(it) {
  9332. return nativeGetPrototypeOf(toObject(it));
  9333. }
  9334. });
  9335. /***/ }),
  9336. /* 390 */
  9337. /***/ (function(module, exports, __webpack_require__) {
  9338. __webpack_require__(391);
  9339. var path = __webpack_require__(10);
  9340. module.exports = path.Object.setPrototypeOf;
  9341. /***/ }),
  9342. /* 391 */
  9343. /***/ (function(module, exports, __webpack_require__) {
  9344. var $ = __webpack_require__(0);
  9345. var setPrototypeOf = __webpack_require__(95);
  9346. // `Object.setPrototypeOf` method
  9347. // https://tc39.es/ecma262/#sec-object.setprototypeof
  9348. $({ target: 'Object', stat: true }, {
  9349. setPrototypeOf: setPrototypeOf
  9350. });
  9351. /***/ }),
  9352. /* 392 */
  9353. /***/ (function(module, exports, __webpack_require__) {
  9354. "use strict";
  9355. var _interopRequireDefault = __webpack_require__(1);
  9356. var _slice = _interopRequireDefault(__webpack_require__(87));
  9357. var _concat = _interopRequireDefault(__webpack_require__(30));
  9358. var _defineProperty = _interopRequireDefault(__webpack_require__(143));
  9359. var AV = __webpack_require__(65);
  9360. var AppRouter = __webpack_require__(398);
  9361. var _require = __webpack_require__(29),
  9362. isNullOrUndefined = _require.isNullOrUndefined;
  9363. var _require2 = __webpack_require__(2),
  9364. extend = _require2.extend,
  9365. isObject = _require2.isObject,
  9366. isEmpty = _require2.isEmpty;
  9367. var isCNApp = function isCNApp(appId) {
  9368. return (0, _slice.default)(appId).call(appId, -9) !== '-MdYXbMMI';
  9369. };
  9370. var fillServerURLs = function fillServerURLs(url) {
  9371. return {
  9372. push: url,
  9373. stats: url,
  9374. engine: url,
  9375. api: url,
  9376. rtm: url
  9377. };
  9378. };
  9379. function getDefaultServerURLs(appId) {
  9380. var _context, _context2, _context3, _context4, _context5;
  9381. if (isCNApp(appId)) {
  9382. return {};
  9383. }
  9384. var id = (0, _slice.default)(appId).call(appId, 0, 8).toLowerCase();
  9385. var domain = 'lncldglobal.com';
  9386. return {
  9387. push: (0, _concat.default)(_context = "https://".concat(id, ".push.")).call(_context, domain),
  9388. stats: (0, _concat.default)(_context2 = "https://".concat(id, ".stats.")).call(_context2, domain),
  9389. engine: (0, _concat.default)(_context3 = "https://".concat(id, ".engine.")).call(_context3, domain),
  9390. api: (0, _concat.default)(_context4 = "https://".concat(id, ".api.")).call(_context4, domain),
  9391. rtm: (0, _concat.default)(_context5 = "https://".concat(id, ".rtm.")).call(_context5, domain)
  9392. };
  9393. }
  9394. var _disableAppRouter = false;
  9395. var _initialized = false;
  9396. /**
  9397. * URLs for services
  9398. * @typedef {Object} ServerURLs
  9399. * @property {String} [api] serverURL for API service
  9400. * @property {String} [engine] serverURL for engine service
  9401. * @property {String} [stats] serverURL for stats service
  9402. * @property {String} [push] serverURL for push service
  9403. * @property {String} [rtm] serverURL for LiveQuery service
  9404. */
  9405. /**
  9406. * Call this method first to set up your authentication tokens for AV.
  9407. * You can get your app keys from the LeanCloud dashboard on http://leancloud.cn .
  9408. * @function AV.init
  9409. * @param {Object} options
  9410. * @param {String} options.appId application id
  9411. * @param {String} options.appKey application key
  9412. * @param {String} [options.masterKey] application master key
  9413. * @param {Boolean} [options.production]
  9414. * @param {String|ServerURLs} [options.serverURL] URLs for services. if a string was given, it will be applied for all services.
  9415. * @param {Boolean} [options.disableCurrentUser]
  9416. */
  9417. AV.init = function init(options) {
  9418. if (!isObject(options)) {
  9419. return AV.init({
  9420. appId: options,
  9421. appKey: arguments.length <= 1 ? undefined : arguments[1],
  9422. masterKey: arguments.length <= 2 ? undefined : arguments[2]
  9423. });
  9424. }
  9425. var appId = options.appId,
  9426. appKey = options.appKey,
  9427. masterKey = options.masterKey,
  9428. hookKey = options.hookKey,
  9429. serverURL = options.serverURL,
  9430. _options$serverURLs = options.serverURLs,
  9431. serverURLs = _options$serverURLs === void 0 ? serverURL : _options$serverURLs,
  9432. disableCurrentUser = options.disableCurrentUser,
  9433. production = options.production,
  9434. realtime = options.realtime;
  9435. if (_initialized) console.warn('Initializing LeanCloud Storage SDK which has already been initialized. Reinitializing the SDK might cause problems like unexpected cross-app data writing and invalid relations.');
  9436. if (!appId) throw new TypeError('appId must be a string');
  9437. if (!appKey) throw new TypeError('appKey must be a string');
  9438. if ("Weapp" !== 'NODE_JS' && masterKey) console.warn('MasterKey is not supposed to be used at client side.');
  9439. if (isCNApp(appId)) {
  9440. if (!serverURLs && isEmpty(AV._config.serverURLs)) {
  9441. throw new TypeError("serverURL option is required for apps from CN region");
  9442. }
  9443. }
  9444. if (appId !== AV._config.applicationId) {
  9445. // overwrite all keys when reinitializing as a new app
  9446. AV._config.masterKey = masterKey;
  9447. AV._config.hookKey = hookKey;
  9448. } else {
  9449. if (masterKey) AV._config.masterKey = masterKey;
  9450. if (hookKey) AV._config.hookKey = hookKey;
  9451. }
  9452. AV._config.applicationId = appId;
  9453. AV._config.applicationKey = appKey;
  9454. if (!isNullOrUndefined(production)) {
  9455. AV.setProduction(production);
  9456. }
  9457. if (typeof disableCurrentUser !== 'undefined') AV._config.disableCurrentUser = disableCurrentUser;
  9458. var disableAppRouter = _disableAppRouter || typeof serverURLs !== 'undefined';
  9459. if (!disableAppRouter) {
  9460. AV._appRouter = new AppRouter(AV);
  9461. }
  9462. AV._setServerURLs(extend({}, getDefaultServerURLs(appId), AV._config.serverURLs, typeof serverURLs === 'string' ? fillServerURLs(serverURLs) : serverURLs), disableAppRouter);
  9463. if (realtime) {
  9464. AV._config.realtime = realtime;
  9465. } else if (AV._sharedConfig.liveQueryRealtime) {
  9466. var _AV$_config$serverURL = AV._config.serverURLs,
  9467. api = _AV$_config$serverURL.api,
  9468. rtm = _AV$_config$serverURL.rtm;
  9469. AV._config.realtime = new AV._sharedConfig.liveQueryRealtime({
  9470. appId: appId,
  9471. appKey: appKey,
  9472. server: {
  9473. api: api,
  9474. RTMRouter: rtm
  9475. }
  9476. });
  9477. }
  9478. _initialized = true;
  9479. }; // If we're running in node.js, allow using the master key.
  9480. if (false) {
  9481. AV.Cloud = AV.Cloud || {};
  9482. /**
  9483. * Switches the LeanCloud SDK to using the Master key. The Master key grants
  9484. * priveleged access to the data in LeanCloud and can be used to bypass ACLs and
  9485. * other restrictions that are applied to the client SDKs.
  9486. * <p><strong><em>Available in Cloud Code and Node.js only.</em></strong>
  9487. * </p>
  9488. */
  9489. AV.Cloud.useMasterKey = function () {
  9490. AV._config.useMasterKey = true;
  9491. };
  9492. }
  9493. /**
  9494. * Call this method to set production environment variable.
  9495. * @function AV.setProduction
  9496. * @param {Boolean} production True is production environment,and
  9497. * it's true by default.
  9498. */
  9499. AV.setProduction = function (production) {
  9500. if (!isNullOrUndefined(production)) {
  9501. AV._config.production = production ? 1 : 0;
  9502. } else {
  9503. // change to default value
  9504. AV._config.production = null;
  9505. }
  9506. };
  9507. AV._setServerURLs = function (urls) {
  9508. var disableAppRouter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  9509. if (typeof urls !== 'string') {
  9510. extend(AV._config.serverURLs, urls);
  9511. } else {
  9512. AV._config.serverURLs = fillServerURLs(urls);
  9513. }
  9514. if (disableAppRouter) {
  9515. if (AV._appRouter) {
  9516. AV._appRouter.disable();
  9517. } else {
  9518. _disableAppRouter = true;
  9519. }
  9520. }
  9521. };
  9522. /**
  9523. * Set server URLs for services.
  9524. * @function AV.setServerURL
  9525. * @since 4.3.0
  9526. * @param {String|ServerURLs} urls URLs for services. if a string was given, it will be applied for all services.
  9527. * You can also set them when initializing SDK with `options.serverURL`
  9528. */
  9529. AV.setServerURL = function (urls) {
  9530. return AV._setServerURLs(urls);
  9531. };
  9532. AV.setServerURLs = AV.setServerURL;
  9533. AV.keepErrorRawMessage = function (value) {
  9534. AV._sharedConfig.keepErrorRawMessage = value;
  9535. };
  9536. /**
  9537. * Set a deadline for requests to complete.
  9538. * Note that file upload requests are not affected.
  9539. * @function AV.setRequestTimeout
  9540. * @since 3.6.0
  9541. * @param {number} ms
  9542. */
  9543. AV.setRequestTimeout = function (ms) {
  9544. AV._config.requestTimeout = ms;
  9545. }; // backword compatible
  9546. AV.initialize = AV.init;
  9547. var defineConfig = function defineConfig(property) {
  9548. return (0, _defineProperty.default)(AV, property, {
  9549. get: function get() {
  9550. return AV._config[property];
  9551. },
  9552. set: function set(value) {
  9553. AV._config[property] = value;
  9554. }
  9555. });
  9556. };
  9557. ['applicationId', 'applicationKey', 'masterKey', 'hookKey'].forEach(defineConfig);
  9558. /***/ }),
  9559. /* 393 */
  9560. /***/ (function(module, exports, __webpack_require__) {
  9561. var isPrototypeOf = __webpack_require__(21);
  9562. var method = __webpack_require__(394);
  9563. var ArrayPrototype = Array.prototype;
  9564. module.exports = function (it) {
  9565. var own = it.slice;
  9566. return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.slice) ? method : own;
  9567. };
  9568. /***/ }),
  9569. /* 394 */
  9570. /***/ (function(module, exports, __webpack_require__) {
  9571. __webpack_require__(395);
  9572. var entryVirtual = __webpack_require__(41);
  9573. module.exports = entryVirtual('Array').slice;
  9574. /***/ }),
  9575. /* 395 */
  9576. /***/ (function(module, exports, __webpack_require__) {
  9577. "use strict";
  9578. var $ = __webpack_require__(0);
  9579. var isArray = __webpack_require__(85);
  9580. var isConstructor = __webpack_require__(101);
  9581. var isObject = __webpack_require__(11);
  9582. var toAbsoluteIndex = __webpack_require__(119);
  9583. var lengthOfArrayLike = __webpack_require__(46);
  9584. var toIndexedObject = __webpack_require__(33);
  9585. var createProperty = __webpack_require__(106);
  9586. var wellKnownSymbol = __webpack_require__(9);
  9587. var arrayMethodHasSpeciesSupport = __webpack_require__(107);
  9588. var un$Slice = __webpack_require__(102);
  9589. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
  9590. var SPECIES = wellKnownSymbol('species');
  9591. var $Array = Array;
  9592. var max = Math.max;
  9593. // `Array.prototype.slice` method
  9594. // https://tc39.es/ecma262/#sec-array.prototype.slice
  9595. // fallback for not array-like ES3 strings and DOM objects
  9596. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  9597. slice: function slice(start, end) {
  9598. var O = toIndexedObject(this);
  9599. var length = lengthOfArrayLike(O);
  9600. var k = toAbsoluteIndex(start, length);
  9601. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  9602. // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
  9603. var Constructor, result, n;
  9604. if (isArray(O)) {
  9605. Constructor = O.constructor;
  9606. // cross-realm fallback
  9607. if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {
  9608. Constructor = undefined;
  9609. } else if (isObject(Constructor)) {
  9610. Constructor = Constructor[SPECIES];
  9611. if (Constructor === null) Constructor = undefined;
  9612. }
  9613. if (Constructor === $Array || Constructor === undefined) {
  9614. return un$Slice(O, k, fin);
  9615. }
  9616. }
  9617. result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));
  9618. for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
  9619. result.length = n;
  9620. return result;
  9621. }
  9622. });
  9623. /***/ }),
  9624. /* 396 */
  9625. /***/ (function(module, exports, __webpack_require__) {
  9626. __webpack_require__(397);
  9627. var path = __webpack_require__(10);
  9628. var Object = path.Object;
  9629. var defineProperty = module.exports = function defineProperty(it, key, desc) {
  9630. return Object.defineProperty(it, key, desc);
  9631. };
  9632. if (Object.defineProperty.sham) defineProperty.sham = true;
  9633. /***/ }),
  9634. /* 397 */
  9635. /***/ (function(module, exports, __webpack_require__) {
  9636. var $ = __webpack_require__(0);
  9637. var DESCRIPTORS = __webpack_require__(16);
  9638. var defineProperty = __webpack_require__(22).f;
  9639. // `Object.defineProperty` method
  9640. // https://tc39.es/ecma262/#sec-object.defineproperty
  9641. // eslint-disable-next-line es-x/no-object-defineproperty -- safe
  9642. $({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {
  9643. defineProperty: defineProperty
  9644. });
  9645. /***/ }),
  9646. /* 398 */
  9647. /***/ (function(module, exports, __webpack_require__) {
  9648. "use strict";
  9649. var ajax = __webpack_require__(108);
  9650. var Cache = __webpack_require__(226);
  9651. function AppRouter(AV) {
  9652. var _this = this;
  9653. this.AV = AV;
  9654. this.lockedUntil = 0;
  9655. Cache.getAsync('serverURLs').then(function (data) {
  9656. if (_this.disabled) return;
  9657. if (!data) return _this.lock(0);
  9658. var serverURLs = data.serverURLs,
  9659. lockedUntil = data.lockedUntil;
  9660. _this.AV._setServerURLs(serverURLs, false);
  9661. _this.lockedUntil = lockedUntil;
  9662. }).catch(function () {
  9663. return _this.lock(0);
  9664. });
  9665. }
  9666. AppRouter.prototype.disable = function disable() {
  9667. this.disabled = true;
  9668. };
  9669. AppRouter.prototype.lock = function lock(ttl) {
  9670. this.lockedUntil = Date.now() + ttl;
  9671. };
  9672. AppRouter.prototype.refresh = function refresh() {
  9673. var _this2 = this;
  9674. if (this.disabled) return;
  9675. if (Date.now() < this.lockedUntil) return;
  9676. this.lock(10);
  9677. var url = 'https://app-router.com/2/route';
  9678. return ajax({
  9679. method: 'get',
  9680. url: url,
  9681. query: {
  9682. appId: this.AV.applicationId
  9683. }
  9684. }).then(function (servers) {
  9685. if (_this2.disabled) return;
  9686. var ttl = servers.ttl;
  9687. if (!ttl) throw new Error('missing ttl');
  9688. ttl = ttl * 1000;
  9689. var protocal = 'https://';
  9690. var serverURLs = {
  9691. push: protocal + servers.push_server,
  9692. stats: protocal + servers.stats_server,
  9693. engine: protocal + servers.engine_server,
  9694. api: protocal + servers.api_server
  9695. };
  9696. _this2.AV._setServerURLs(serverURLs, false);
  9697. _this2.lock(ttl);
  9698. return Cache.setAsync('serverURLs', {
  9699. serverURLs: serverURLs,
  9700. lockedUntil: _this2.lockedUntil
  9701. }, ttl);
  9702. }).catch(function (error) {
  9703. // bypass all errors
  9704. console.warn("refresh server URLs failed: ".concat(error.message));
  9705. _this2.lock(600);
  9706. });
  9707. };
  9708. module.exports = AppRouter;
  9709. /***/ }),
  9710. /* 399 */
  9711. /***/ (function(module, exports, __webpack_require__) {
  9712. module.exports = __webpack_require__(400);
  9713. /***/ }),
  9714. /* 400 */
  9715. /***/ (function(module, exports, __webpack_require__) {
  9716. var parent = __webpack_require__(401);
  9717. __webpack_require__(424);
  9718. __webpack_require__(425);
  9719. __webpack_require__(426);
  9720. __webpack_require__(427);
  9721. __webpack_require__(428);
  9722. // TODO: Remove from `core-js@4`
  9723. __webpack_require__(429);
  9724. __webpack_require__(430);
  9725. __webpack_require__(431);
  9726. module.exports = parent;
  9727. /***/ }),
  9728. /* 401 */
  9729. /***/ (function(module, exports, __webpack_require__) {
  9730. var parent = __webpack_require__(232);
  9731. module.exports = parent;
  9732. /***/ }),
  9733. /* 402 */
  9734. /***/ (function(module, exports, __webpack_require__) {
  9735. __webpack_require__(218);
  9736. __webpack_require__(60);
  9737. __webpack_require__(233);
  9738. __webpack_require__(408);
  9739. __webpack_require__(409);
  9740. __webpack_require__(410);
  9741. __webpack_require__(411);
  9742. __webpack_require__(237);
  9743. __webpack_require__(412);
  9744. __webpack_require__(413);
  9745. __webpack_require__(414);
  9746. __webpack_require__(415);
  9747. __webpack_require__(416);
  9748. __webpack_require__(417);
  9749. __webpack_require__(418);
  9750. __webpack_require__(419);
  9751. __webpack_require__(420);
  9752. __webpack_require__(421);
  9753. __webpack_require__(422);
  9754. __webpack_require__(423);
  9755. var path = __webpack_require__(10);
  9756. module.exports = path.Symbol;
  9757. /***/ }),
  9758. /* 403 */
  9759. /***/ (function(module, exports, __webpack_require__) {
  9760. "use strict";
  9761. var $ = __webpack_require__(0);
  9762. var global = __webpack_require__(6);
  9763. var call = __webpack_require__(13);
  9764. var uncurryThis = __webpack_require__(4);
  9765. var IS_PURE = __webpack_require__(32);
  9766. var DESCRIPTORS = __webpack_require__(16);
  9767. var NATIVE_SYMBOL = __webpack_require__(57);
  9768. var fails = __webpack_require__(3);
  9769. var hasOwn = __webpack_require__(14);
  9770. var isPrototypeOf = __webpack_require__(21);
  9771. var anObject = __webpack_require__(19);
  9772. var toIndexedObject = __webpack_require__(33);
  9773. var toPropertyKey = __webpack_require__(88);
  9774. var $toString = __webpack_require__(75);
  9775. var createPropertyDescriptor = __webpack_require__(44);
  9776. var nativeObjectCreate = __webpack_require__(47);
  9777. var objectKeys = __webpack_require__(98);
  9778. var getOwnPropertyNamesModule = __webpack_require__(96);
  9779. var getOwnPropertyNamesExternal = __webpack_require__(234);
  9780. var getOwnPropertySymbolsModule = __webpack_require__(97);
  9781. var getOwnPropertyDescriptorModule = __webpack_require__(71);
  9782. var definePropertyModule = __webpack_require__(22);
  9783. var definePropertiesModule = __webpack_require__(154);
  9784. var propertyIsEnumerableModule = __webpack_require__(113);
  9785. var defineBuiltIn = __webpack_require__(39);
  9786. var shared = __webpack_require__(73);
  9787. var sharedKey = __webpack_require__(94);
  9788. var hiddenKeys = __webpack_require__(74);
  9789. var uid = __webpack_require__(92);
  9790. var wellKnownSymbol = __webpack_require__(9);
  9791. var wrappedWellKnownSymbolModule = __webpack_require__(144);
  9792. var defineWellKnownSymbol = __webpack_require__(8);
  9793. var defineSymbolToPrimitive = __webpack_require__(235);
  9794. var setToStringTag = __webpack_require__(49);
  9795. var InternalStateModule = __webpack_require__(38);
  9796. var $forEach = __webpack_require__(66).forEach;
  9797. var HIDDEN = sharedKey('hidden');
  9798. var SYMBOL = 'Symbol';
  9799. var PROTOTYPE = 'prototype';
  9800. var setInternalState = InternalStateModule.set;
  9801. var getInternalState = InternalStateModule.getterFor(SYMBOL);
  9802. var ObjectPrototype = Object[PROTOTYPE];
  9803. var $Symbol = global.Symbol;
  9804. var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
  9805. var TypeError = global.TypeError;
  9806. var QObject = global.QObject;
  9807. var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
  9808. var nativeDefineProperty = definePropertyModule.f;
  9809. var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
  9810. var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
  9811. var push = uncurryThis([].push);
  9812. var AllSymbols = shared('symbols');
  9813. var ObjectPrototypeSymbols = shared('op-symbols');
  9814. var WellKnownSymbolsStore = shared('wks');
  9815. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  9816. var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  9817. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  9818. var setSymbolDescriptor = DESCRIPTORS && fails(function () {
  9819. return nativeObjectCreate(nativeDefineProperty({}, 'a', {
  9820. get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
  9821. })).a != 7;
  9822. }) ? function (O, P, Attributes) {
  9823. var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
  9824. if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
  9825. nativeDefineProperty(O, P, Attributes);
  9826. if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
  9827. nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
  9828. }
  9829. } : nativeDefineProperty;
  9830. var wrap = function (tag, description) {
  9831. var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
  9832. setInternalState(symbol, {
  9833. type: SYMBOL,
  9834. tag: tag,
  9835. description: description
  9836. });
  9837. if (!DESCRIPTORS) symbol.description = description;
  9838. return symbol;
  9839. };
  9840. var $defineProperty = function defineProperty(O, P, Attributes) {
  9841. if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
  9842. anObject(O);
  9843. var key = toPropertyKey(P);
  9844. anObject(Attributes);
  9845. if (hasOwn(AllSymbols, key)) {
  9846. if (!Attributes.enumerable) {
  9847. if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
  9848. O[HIDDEN][key] = true;
  9849. } else {
  9850. if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
  9851. Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
  9852. } return setSymbolDescriptor(O, key, Attributes);
  9853. } return nativeDefineProperty(O, key, Attributes);
  9854. };
  9855. var $defineProperties = function defineProperties(O, Properties) {
  9856. anObject(O);
  9857. var properties = toIndexedObject(Properties);
  9858. var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
  9859. $forEach(keys, function (key) {
  9860. if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
  9861. });
  9862. return O;
  9863. };
  9864. var $create = function create(O, Properties) {
  9865. return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
  9866. };
  9867. var $propertyIsEnumerable = function propertyIsEnumerable(V) {
  9868. var P = toPropertyKey(V);
  9869. var enumerable = call(nativePropertyIsEnumerable, this, P);
  9870. if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;
  9871. return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]
  9872. ? enumerable : true;
  9873. };
  9874. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
  9875. var it = toIndexedObject(O);
  9876. var key = toPropertyKey(P);
  9877. if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;
  9878. var descriptor = nativeGetOwnPropertyDescriptor(it, key);
  9879. if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {
  9880. descriptor.enumerable = true;
  9881. }
  9882. return descriptor;
  9883. };
  9884. var $getOwnPropertyNames = function getOwnPropertyNames(O) {
  9885. var names = nativeGetOwnPropertyNames(toIndexedObject(O));
  9886. var result = [];
  9887. $forEach(names, function (key) {
  9888. if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key);
  9889. });
  9890. return result;
  9891. };
  9892. var $getOwnPropertySymbols = function (O) {
  9893. var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
  9894. var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
  9895. var result = [];
  9896. $forEach(names, function (key) {
  9897. if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
  9898. push(result, AllSymbols[key]);
  9899. }
  9900. });
  9901. return result;
  9902. };
  9903. // `Symbol` constructor
  9904. // https://tc39.es/ecma262/#sec-symbol-constructor
  9905. if (!NATIVE_SYMBOL) {
  9906. $Symbol = function Symbol() {
  9907. if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor');
  9908. var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
  9909. var tag = uid(description);
  9910. var setter = function (value) {
  9911. if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value);
  9912. if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  9913. setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
  9914. };
  9915. if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
  9916. return wrap(tag, description);
  9917. };
  9918. SymbolPrototype = $Symbol[PROTOTYPE];
  9919. defineBuiltIn(SymbolPrototype, 'toString', function toString() {
  9920. return getInternalState(this).tag;
  9921. });
  9922. defineBuiltIn($Symbol, 'withoutSetter', function (description) {
  9923. return wrap(uid(description), description);
  9924. });
  9925. propertyIsEnumerableModule.f = $propertyIsEnumerable;
  9926. definePropertyModule.f = $defineProperty;
  9927. definePropertiesModule.f = $defineProperties;
  9928. getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
  9929. getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
  9930. getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
  9931. wrappedWellKnownSymbolModule.f = function (name) {
  9932. return wrap(wellKnownSymbol(name), name);
  9933. };
  9934. if (DESCRIPTORS) {
  9935. // https://github.com/tc39/proposal-Symbol-description
  9936. nativeDefineProperty(SymbolPrototype, 'description', {
  9937. configurable: true,
  9938. get: function description() {
  9939. return getInternalState(this).description;
  9940. }
  9941. });
  9942. if (!IS_PURE) {
  9943. defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
  9944. }
  9945. }
  9946. }
  9947. $({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
  9948. Symbol: $Symbol
  9949. });
  9950. $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
  9951. defineWellKnownSymbol(name);
  9952. });
  9953. $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
  9954. useSetter: function () { USE_SETTER = true; },
  9955. useSimple: function () { USE_SETTER = false; }
  9956. });
  9957. $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
  9958. // `Object.create` method
  9959. // https://tc39.es/ecma262/#sec-object.create
  9960. create: $create,
  9961. // `Object.defineProperty` method
  9962. // https://tc39.es/ecma262/#sec-object.defineproperty
  9963. defineProperty: $defineProperty,
  9964. // `Object.defineProperties` method
  9965. // https://tc39.es/ecma262/#sec-object.defineproperties
  9966. defineProperties: $defineProperties,
  9967. // `Object.getOwnPropertyDescriptor` method
  9968. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
  9969. getOwnPropertyDescriptor: $getOwnPropertyDescriptor
  9970. });
  9971. $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
  9972. // `Object.getOwnPropertyNames` method
  9973. // https://tc39.es/ecma262/#sec-object.getownpropertynames
  9974. getOwnPropertyNames: $getOwnPropertyNames
  9975. });
  9976. // `Symbol.prototype[@@toPrimitive]` method
  9977. // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
  9978. defineSymbolToPrimitive();
  9979. // `Symbol.prototype[@@toStringTag]` property
  9980. // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
  9981. setToStringTag($Symbol, SYMBOL);
  9982. hiddenKeys[HIDDEN] = true;
  9983. /***/ }),
  9984. /* 404 */
  9985. /***/ (function(module, exports, __webpack_require__) {
  9986. var toAbsoluteIndex = __webpack_require__(119);
  9987. var lengthOfArrayLike = __webpack_require__(46);
  9988. var createProperty = __webpack_require__(106);
  9989. var $Array = Array;
  9990. var max = Math.max;
  9991. module.exports = function (O, start, end) {
  9992. var length = lengthOfArrayLike(O);
  9993. var k = toAbsoluteIndex(start, length);
  9994. var fin = toAbsoluteIndex(end === undefined ? length : end, length);
  9995. var result = $Array(max(fin - k, 0));
  9996. for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
  9997. result.length = n;
  9998. return result;
  9999. };
  10000. /***/ }),
  10001. /* 405 */
  10002. /***/ (function(module, exports, __webpack_require__) {
  10003. var $ = __webpack_require__(0);
  10004. var getBuiltIn = __webpack_require__(18);
  10005. var hasOwn = __webpack_require__(14);
  10006. var toString = __webpack_require__(75);
  10007. var shared = __webpack_require__(73);
  10008. var NATIVE_SYMBOL_REGISTRY = __webpack_require__(236);
  10009. var StringToSymbolRegistry = shared('string-to-symbol-registry');
  10010. var SymbolToStringRegistry = shared('symbol-to-string-registry');
  10011. // `Symbol.for` method
  10012. // https://tc39.es/ecma262/#sec-symbol.for
  10013. $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
  10014. 'for': function (key) {
  10015. var string = toString(key);
  10016. if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
  10017. var symbol = getBuiltIn('Symbol')(string);
  10018. StringToSymbolRegistry[string] = symbol;
  10019. SymbolToStringRegistry[symbol] = string;
  10020. return symbol;
  10021. }
  10022. });
  10023. /***/ }),
  10024. /* 406 */
  10025. /***/ (function(module, exports, __webpack_require__) {
  10026. var $ = __webpack_require__(0);
  10027. var hasOwn = __webpack_require__(14);
  10028. var isSymbol = __webpack_require__(89);
  10029. var tryToString = __webpack_require__(72);
  10030. var shared = __webpack_require__(73);
  10031. var NATIVE_SYMBOL_REGISTRY = __webpack_require__(236);
  10032. var SymbolToStringRegistry = shared('symbol-to-string-registry');
  10033. // `Symbol.keyFor` method
  10034. // https://tc39.es/ecma262/#sec-symbol.keyfor
  10035. $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
  10036. keyFor: function keyFor(sym) {
  10037. if (!isSymbol(sym)) throw TypeError(tryToString(sym) + ' is not a symbol');
  10038. if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
  10039. }
  10040. });
  10041. /***/ }),
  10042. /* 407 */
  10043. /***/ (function(module, exports, __webpack_require__) {
  10044. var $ = __webpack_require__(0);
  10045. var NATIVE_SYMBOL = __webpack_require__(57);
  10046. var fails = __webpack_require__(3);
  10047. var getOwnPropertySymbolsModule = __webpack_require__(97);
  10048. var toObject = __webpack_require__(34);
  10049. // V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
  10050. // https://bugs.chromium.org/p/v8/issues/detail?id=3443
  10051. var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });
  10052. // `Object.getOwnPropertySymbols` method
  10053. // https://tc39.es/ecma262/#sec-object.getownpropertysymbols
  10054. $({ target: 'Object', stat: true, forced: FORCED }, {
  10055. getOwnPropertySymbols: function getOwnPropertySymbols(it) {
  10056. var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  10057. return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
  10058. }
  10059. });
  10060. /***/ }),
  10061. /* 408 */
  10062. /***/ (function(module, exports, __webpack_require__) {
  10063. var defineWellKnownSymbol = __webpack_require__(8);
  10064. // `Symbol.asyncIterator` well-known symbol
  10065. // https://tc39.es/ecma262/#sec-symbol.asynciterator
  10066. defineWellKnownSymbol('asyncIterator');
  10067. /***/ }),
  10068. /* 409 */
  10069. /***/ (function(module, exports) {
  10070. // empty
  10071. /***/ }),
  10072. /* 410 */
  10073. /***/ (function(module, exports, __webpack_require__) {
  10074. var defineWellKnownSymbol = __webpack_require__(8);
  10075. // `Symbol.hasInstance` well-known symbol
  10076. // https://tc39.es/ecma262/#sec-symbol.hasinstance
  10077. defineWellKnownSymbol('hasInstance');
  10078. /***/ }),
  10079. /* 411 */
  10080. /***/ (function(module, exports, __webpack_require__) {
  10081. var defineWellKnownSymbol = __webpack_require__(8);
  10082. // `Symbol.isConcatSpreadable` well-known symbol
  10083. // https://tc39.es/ecma262/#sec-symbol.isconcatspreadable
  10084. defineWellKnownSymbol('isConcatSpreadable');
  10085. /***/ }),
  10086. /* 412 */
  10087. /***/ (function(module, exports, __webpack_require__) {
  10088. var defineWellKnownSymbol = __webpack_require__(8);
  10089. // `Symbol.match` well-known symbol
  10090. // https://tc39.es/ecma262/#sec-symbol.match
  10091. defineWellKnownSymbol('match');
  10092. /***/ }),
  10093. /* 413 */
  10094. /***/ (function(module, exports, __webpack_require__) {
  10095. var defineWellKnownSymbol = __webpack_require__(8);
  10096. // `Symbol.matchAll` well-known symbol
  10097. // https://tc39.es/ecma262/#sec-symbol.matchall
  10098. defineWellKnownSymbol('matchAll');
  10099. /***/ }),
  10100. /* 414 */
  10101. /***/ (function(module, exports, __webpack_require__) {
  10102. var defineWellKnownSymbol = __webpack_require__(8);
  10103. // `Symbol.replace` well-known symbol
  10104. // https://tc39.es/ecma262/#sec-symbol.replace
  10105. defineWellKnownSymbol('replace');
  10106. /***/ }),
  10107. /* 415 */
  10108. /***/ (function(module, exports, __webpack_require__) {
  10109. var defineWellKnownSymbol = __webpack_require__(8);
  10110. // `Symbol.search` well-known symbol
  10111. // https://tc39.es/ecma262/#sec-symbol.search
  10112. defineWellKnownSymbol('search');
  10113. /***/ }),
  10114. /* 416 */
  10115. /***/ (function(module, exports, __webpack_require__) {
  10116. var defineWellKnownSymbol = __webpack_require__(8);
  10117. // `Symbol.species` well-known symbol
  10118. // https://tc39.es/ecma262/#sec-symbol.species
  10119. defineWellKnownSymbol('species');
  10120. /***/ }),
  10121. /* 417 */
  10122. /***/ (function(module, exports, __webpack_require__) {
  10123. var defineWellKnownSymbol = __webpack_require__(8);
  10124. // `Symbol.split` well-known symbol
  10125. // https://tc39.es/ecma262/#sec-symbol.split
  10126. defineWellKnownSymbol('split');
  10127. /***/ }),
  10128. /* 418 */
  10129. /***/ (function(module, exports, __webpack_require__) {
  10130. var defineWellKnownSymbol = __webpack_require__(8);
  10131. var defineSymbolToPrimitive = __webpack_require__(235);
  10132. // `Symbol.toPrimitive` well-known symbol
  10133. // https://tc39.es/ecma262/#sec-symbol.toprimitive
  10134. defineWellKnownSymbol('toPrimitive');
  10135. // `Symbol.prototype[@@toPrimitive]` method
  10136. // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
  10137. defineSymbolToPrimitive();
  10138. /***/ }),
  10139. /* 419 */
  10140. /***/ (function(module, exports, __webpack_require__) {
  10141. var getBuiltIn = __webpack_require__(18);
  10142. var defineWellKnownSymbol = __webpack_require__(8);
  10143. var setToStringTag = __webpack_require__(49);
  10144. // `Symbol.toStringTag` well-known symbol
  10145. // https://tc39.es/ecma262/#sec-symbol.tostringtag
  10146. defineWellKnownSymbol('toStringTag');
  10147. // `Symbol.prototype[@@toStringTag]` property
  10148. // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
  10149. setToStringTag(getBuiltIn('Symbol'), 'Symbol');
  10150. /***/ }),
  10151. /* 420 */
  10152. /***/ (function(module, exports, __webpack_require__) {
  10153. var defineWellKnownSymbol = __webpack_require__(8);
  10154. // `Symbol.unscopables` well-known symbol
  10155. // https://tc39.es/ecma262/#sec-symbol.unscopables
  10156. defineWellKnownSymbol('unscopables');
  10157. /***/ }),
  10158. /* 421 */
  10159. /***/ (function(module, exports, __webpack_require__) {
  10160. var global = __webpack_require__(6);
  10161. var setToStringTag = __webpack_require__(49);
  10162. // JSON[@@toStringTag] property
  10163. // https://tc39.es/ecma262/#sec-json-@@tostringtag
  10164. setToStringTag(global.JSON, 'JSON', true);
  10165. /***/ }),
  10166. /* 422 */
  10167. /***/ (function(module, exports) {
  10168. // empty
  10169. /***/ }),
  10170. /* 423 */
  10171. /***/ (function(module, exports) {
  10172. // empty
  10173. /***/ }),
  10174. /* 424 */
  10175. /***/ (function(module, exports, __webpack_require__) {
  10176. var defineWellKnownSymbol = __webpack_require__(8);
  10177. // `Symbol.asyncDispose` well-known symbol
  10178. // https://github.com/tc39/proposal-using-statement
  10179. defineWellKnownSymbol('asyncDispose');
  10180. /***/ }),
  10181. /* 425 */
  10182. /***/ (function(module, exports, __webpack_require__) {
  10183. var defineWellKnownSymbol = __webpack_require__(8);
  10184. // `Symbol.dispose` well-known symbol
  10185. // https://github.com/tc39/proposal-using-statement
  10186. defineWellKnownSymbol('dispose');
  10187. /***/ }),
  10188. /* 426 */
  10189. /***/ (function(module, exports, __webpack_require__) {
  10190. var defineWellKnownSymbol = __webpack_require__(8);
  10191. // `Symbol.matcher` well-known symbol
  10192. // https://github.com/tc39/proposal-pattern-matching
  10193. defineWellKnownSymbol('matcher');
  10194. /***/ }),
  10195. /* 427 */
  10196. /***/ (function(module, exports, __webpack_require__) {
  10197. var defineWellKnownSymbol = __webpack_require__(8);
  10198. // `Symbol.metadataKey` well-known symbol
  10199. // https://github.com/tc39/proposal-decorator-metadata
  10200. defineWellKnownSymbol('metadataKey');
  10201. /***/ }),
  10202. /* 428 */
  10203. /***/ (function(module, exports, __webpack_require__) {
  10204. var defineWellKnownSymbol = __webpack_require__(8);
  10205. // `Symbol.observable` well-known symbol
  10206. // https://github.com/tc39/proposal-observable
  10207. defineWellKnownSymbol('observable');
  10208. /***/ }),
  10209. /* 429 */
  10210. /***/ (function(module, exports, __webpack_require__) {
  10211. // TODO: Remove from `core-js@4`
  10212. var defineWellKnownSymbol = __webpack_require__(8);
  10213. // `Symbol.metadata` well-known symbol
  10214. // https://github.com/tc39/proposal-decorators
  10215. defineWellKnownSymbol('metadata');
  10216. /***/ }),
  10217. /* 430 */
  10218. /***/ (function(module, exports, __webpack_require__) {
  10219. // TODO: remove from `core-js@4`
  10220. var defineWellKnownSymbol = __webpack_require__(8);
  10221. // `Symbol.patternMatch` well-known symbol
  10222. // https://github.com/tc39/proposal-pattern-matching
  10223. defineWellKnownSymbol('patternMatch');
  10224. /***/ }),
  10225. /* 431 */
  10226. /***/ (function(module, exports, __webpack_require__) {
  10227. // TODO: remove from `core-js@4`
  10228. var defineWellKnownSymbol = __webpack_require__(8);
  10229. defineWellKnownSymbol('replaceAll');
  10230. /***/ }),
  10231. /* 432 */
  10232. /***/ (function(module, exports, __webpack_require__) {
  10233. module.exports = __webpack_require__(433);
  10234. /***/ }),
  10235. /* 433 */
  10236. /***/ (function(module, exports, __webpack_require__) {
  10237. module.exports = __webpack_require__(434);
  10238. /***/ }),
  10239. /* 434 */
  10240. /***/ (function(module, exports, __webpack_require__) {
  10241. var parent = __webpack_require__(435);
  10242. module.exports = parent;
  10243. /***/ }),
  10244. /* 435 */
  10245. /***/ (function(module, exports, __webpack_require__) {
  10246. var parent = __webpack_require__(238);
  10247. module.exports = parent;
  10248. /***/ }),
  10249. /* 436 */
  10250. /***/ (function(module, exports, __webpack_require__) {
  10251. __webpack_require__(48);
  10252. __webpack_require__(60);
  10253. __webpack_require__(78);
  10254. __webpack_require__(237);
  10255. var WrappedWellKnownSymbolModule = __webpack_require__(144);
  10256. module.exports = WrappedWellKnownSymbolModule.f('iterator');
  10257. /***/ }),
  10258. /* 437 */
  10259. /***/ (function(module, exports, __webpack_require__) {
  10260. module.exports = __webpack_require__(438);
  10261. /***/ }),
  10262. /* 438 */
  10263. /***/ (function(module, exports, __webpack_require__) {
  10264. var parent = __webpack_require__(439);
  10265. module.exports = parent;
  10266. /***/ }),
  10267. /* 439 */
  10268. /***/ (function(module, exports, __webpack_require__) {
  10269. var isPrototypeOf = __webpack_require__(21);
  10270. var method = __webpack_require__(440);
  10271. var ArrayPrototype = Array.prototype;
  10272. module.exports = function (it) {
  10273. var own = it.filter;
  10274. return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.filter) ? method : own;
  10275. };
  10276. /***/ }),
  10277. /* 440 */
  10278. /***/ (function(module, exports, __webpack_require__) {
  10279. __webpack_require__(441);
  10280. var entryVirtual = __webpack_require__(41);
  10281. module.exports = entryVirtual('Array').filter;
  10282. /***/ }),
  10283. /* 441 */
  10284. /***/ (function(module, exports, __webpack_require__) {
  10285. "use strict";
  10286. var $ = __webpack_require__(0);
  10287. var $filter = __webpack_require__(66).filter;
  10288. var arrayMethodHasSpeciesSupport = __webpack_require__(107);
  10289. var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
  10290. // `Array.prototype.filter` method
  10291. // https://tc39.es/ecma262/#sec-array.prototype.filter
  10292. // with adding support of @@species
  10293. $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
  10294. filter: function filter(callbackfn /* , thisArg */) {
  10295. return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  10296. }
  10297. });
  10298. /***/ }),
  10299. /* 442 */
  10300. /***/ (function(module, exports, __webpack_require__) {
  10301. "use strict";
  10302. // Copyright (c) 2015-2017 David M. Lee, II
  10303. /**
  10304. * Local reference to TimeoutError
  10305. * @private
  10306. */
  10307. var TimeoutError;
  10308. /**
  10309. * Rejects a promise with a {@link TimeoutError} if it does not settle within
  10310. * the specified timeout.
  10311. *
  10312. * @param {Promise} promise The promise.
  10313. * @param {number} timeoutMillis Number of milliseconds to wait on settling.
  10314. * @returns {Promise} Either resolves/rejects with `promise`, or rejects with
  10315. * `TimeoutError`, whichever settles first.
  10316. */
  10317. var timeout = module.exports.timeout = function(promise, timeoutMillis) {
  10318. var error = new TimeoutError(),
  10319. timeout;
  10320. return Promise.race([
  10321. promise,
  10322. new Promise(function(resolve, reject) {
  10323. timeout = setTimeout(function() {
  10324. reject(error);
  10325. }, timeoutMillis);
  10326. }),
  10327. ]).then(function(v) {
  10328. clearTimeout(timeout);
  10329. return v;
  10330. }, function(err) {
  10331. clearTimeout(timeout);
  10332. throw err;
  10333. });
  10334. };
  10335. /**
  10336. * Exception indicating that the timeout expired.
  10337. */
  10338. TimeoutError = module.exports.TimeoutError = function() {
  10339. Error.call(this)
  10340. this.stack = Error().stack
  10341. this.message = 'Timeout';
  10342. };
  10343. TimeoutError.prototype = Object.create(Error.prototype);
  10344. TimeoutError.prototype.name = "TimeoutError";
  10345. /***/ }),
  10346. /* 443 */
  10347. /***/ (function(module, exports, __webpack_require__) {
  10348. "use strict";
  10349. var _interopRequireDefault = __webpack_require__(1);
  10350. var _slice = _interopRequireDefault(__webpack_require__(87));
  10351. var _keys = _interopRequireDefault(__webpack_require__(55));
  10352. var _concat = _interopRequireDefault(__webpack_require__(30));
  10353. var _ = __webpack_require__(2);
  10354. module.exports = function (AV) {
  10355. var eventSplitter = /\s+/;
  10356. var slice = (0, _slice.default)(Array.prototype);
  10357. /**
  10358. * @class
  10359. *
  10360. * <p>AV.Events is a fork of Backbone's Events module, provided for your
  10361. * convenience.</p>
  10362. *
  10363. * <p>A module that can be mixed in to any object in order to provide
  10364. * it with custom events. You may bind callback functions to an event
  10365. * with `on`, or remove these functions with `off`.
  10366. * Triggering an event fires all callbacks in the order that `on` was
  10367. * called.
  10368. *
  10369. * @private
  10370. * @example
  10371. * var object = {};
  10372. * _.extend(object, AV.Events);
  10373. * object.on('expand', function(){ alert('expanded'); });
  10374. * object.trigger('expand');</pre></p>
  10375. *
  10376. */
  10377. AV.Events = {
  10378. /**
  10379. * Bind one or more space separated events, `events`, to a `callback`
  10380. * function. Passing `"all"` will bind the callback to all events fired.
  10381. */
  10382. on: function on(events, callback, context) {
  10383. var calls, event, node, tail, list;
  10384. if (!callback) {
  10385. return this;
  10386. }
  10387. events = events.split(eventSplitter);
  10388. calls = this._callbacks || (this._callbacks = {}); // Create an immutable callback list, allowing traversal during
  10389. // modification. The tail is an empty object that will always be used
  10390. // as the next node.
  10391. event = events.shift();
  10392. while (event) {
  10393. list = calls[event];
  10394. node = list ? list.tail : {};
  10395. node.next = tail = {};
  10396. node.context = context;
  10397. node.callback = callback;
  10398. calls[event] = {
  10399. tail: tail,
  10400. next: list ? list.next : node
  10401. };
  10402. event = events.shift();
  10403. }
  10404. return this;
  10405. },
  10406. /**
  10407. * Remove one or many callbacks. If `context` is null, removes all callbacks
  10408. * with that function. If `callback` is null, removes all callbacks for the
  10409. * event. If `events` is null, removes all bound callbacks for all events.
  10410. */
  10411. off: function off(events, callback, context) {
  10412. var event, calls, node, tail, cb, ctx; // No events, or removing *all* events.
  10413. if (!(calls = this._callbacks)) {
  10414. return;
  10415. }
  10416. if (!(events || callback || context)) {
  10417. delete this._callbacks;
  10418. return this;
  10419. } // Loop through the listed events and contexts, splicing them out of the
  10420. // linked list of callbacks if appropriate.
  10421. events = events ? events.split(eventSplitter) : (0, _keys.default)(_).call(_, calls);
  10422. event = events.shift();
  10423. while (event) {
  10424. node = calls[event];
  10425. delete calls[event];
  10426. if (!node || !(callback || context)) {
  10427. continue;
  10428. } // Create a new list, omitting the indicated callbacks.
  10429. tail = node.tail;
  10430. node = node.next;
  10431. while (node !== tail) {
  10432. cb = node.callback;
  10433. ctx = node.context;
  10434. if (callback && cb !== callback || context && ctx !== context) {
  10435. this.on(event, cb, ctx);
  10436. }
  10437. node = node.next;
  10438. }
  10439. event = events.shift();
  10440. }
  10441. return this;
  10442. },
  10443. /**
  10444. * Trigger one or many events, firing all bound callbacks. Callbacks are
  10445. * passed the same arguments as `trigger` is, apart from the event name
  10446. * (unless you're listening on `"all"`, which will cause your callback to
  10447. * receive the true name of the event as the first argument).
  10448. */
  10449. trigger: function trigger(events) {
  10450. var event, node, calls, tail, args, all, rest;
  10451. if (!(calls = this._callbacks)) {
  10452. return this;
  10453. }
  10454. all = calls.all;
  10455. events = events.split(eventSplitter);
  10456. rest = slice.call(arguments, 1); // For each event, walk through the linked list of callbacks twice,
  10457. // first to trigger the event, then to trigger any `"all"` callbacks.
  10458. event = events.shift();
  10459. while (event) {
  10460. node = calls[event];
  10461. if (node) {
  10462. tail = node.tail;
  10463. while ((node = node.next) !== tail) {
  10464. node.callback.apply(node.context || this, rest);
  10465. }
  10466. }
  10467. node = all;
  10468. if (node) {
  10469. var _context;
  10470. tail = node.tail;
  10471. args = (0, _concat.default)(_context = [event]).call(_context, rest);
  10472. while ((node = node.next) !== tail) {
  10473. node.callback.apply(node.context || this, args);
  10474. }
  10475. }
  10476. event = events.shift();
  10477. }
  10478. return this;
  10479. }
  10480. };
  10481. /**
  10482. * @function
  10483. */
  10484. AV.Events.bind = AV.Events.on;
  10485. /**
  10486. * @function
  10487. */
  10488. AV.Events.unbind = AV.Events.off;
  10489. };
  10490. /***/ }),
  10491. /* 444 */
  10492. /***/ (function(module, exports, __webpack_require__) {
  10493. "use strict";
  10494. var _interopRequireDefault = __webpack_require__(1);
  10495. var _promise = _interopRequireDefault(__webpack_require__(12));
  10496. var _ = __webpack_require__(2);
  10497. /*global navigator: false */
  10498. module.exports = function (AV) {
  10499. /**
  10500. * Creates a new GeoPoint with any of the following forms:<br>
  10501. * @example
  10502. * new GeoPoint(otherGeoPoint)
  10503. * new GeoPoint(30, 30)
  10504. * new GeoPoint([30, 30])
  10505. * new GeoPoint({latitude: 30, longitude: 30})
  10506. * new GeoPoint() // defaults to (0, 0)
  10507. * @class
  10508. *
  10509. * <p>Represents a latitude / longitude point that may be associated
  10510. * with a key in a AVObject or used as a reference point for geo queries.
  10511. * This allows proximity-based queries on the key.</p>
  10512. *
  10513. * <p>Only one key in a class may contain a GeoPoint.</p>
  10514. *
  10515. * <p>Example:<pre>
  10516. * var point = new AV.GeoPoint(30.0, -20.0);
  10517. * var object = new AV.Object("PlaceObject");
  10518. * object.set("location", point);
  10519. * object.save();</pre></p>
  10520. */
  10521. AV.GeoPoint = function (arg1, arg2) {
  10522. if (_.isArray(arg1)) {
  10523. AV.GeoPoint._validate(arg1[0], arg1[1]);
  10524. this.latitude = arg1[0];
  10525. this.longitude = arg1[1];
  10526. } else if (_.isObject(arg1)) {
  10527. AV.GeoPoint._validate(arg1.latitude, arg1.longitude);
  10528. this.latitude = arg1.latitude;
  10529. this.longitude = arg1.longitude;
  10530. } else if (_.isNumber(arg1) && _.isNumber(arg2)) {
  10531. AV.GeoPoint._validate(arg1, arg2);
  10532. this.latitude = arg1;
  10533. this.longitude = arg2;
  10534. } else {
  10535. this.latitude = 0;
  10536. this.longitude = 0;
  10537. } // Add properties so that anyone using Webkit or Mozilla will get an error
  10538. // if they try to set values that are out of bounds.
  10539. var self = this;
  10540. if (this.__defineGetter__ && this.__defineSetter__) {
  10541. // Use _latitude and _longitude to actually store the values, and add
  10542. // getters and setters for latitude and longitude.
  10543. this._latitude = this.latitude;
  10544. this._longitude = this.longitude;
  10545. this.__defineGetter__('latitude', function () {
  10546. return self._latitude;
  10547. });
  10548. this.__defineGetter__('longitude', function () {
  10549. return self._longitude;
  10550. });
  10551. this.__defineSetter__('latitude', function (val) {
  10552. AV.GeoPoint._validate(val, self.longitude);
  10553. self._latitude = val;
  10554. });
  10555. this.__defineSetter__('longitude', function (val) {
  10556. AV.GeoPoint._validate(self.latitude, val);
  10557. self._longitude = val;
  10558. });
  10559. }
  10560. };
  10561. /**
  10562. * @lends AV.GeoPoint.prototype
  10563. * @property {float} latitude North-south portion of the coordinate, in range
  10564. * [-90, 90]. Throws an exception if set out of range in a modern browser.
  10565. * @property {float} longitude East-west portion of the coordinate, in range
  10566. * [-180, 180]. Throws if set out of range in a modern browser.
  10567. */
  10568. /**
  10569. * Throws an exception if the given lat-long is out of bounds.
  10570. * @private
  10571. */
  10572. AV.GeoPoint._validate = function (latitude, longitude) {
  10573. if (latitude < -90.0) {
  10574. throw new Error('AV.GeoPoint latitude ' + latitude + ' < -90.0.');
  10575. }
  10576. if (latitude > 90.0) {
  10577. throw new Error('AV.GeoPoint latitude ' + latitude + ' > 90.0.');
  10578. }
  10579. if (longitude < -180.0) {
  10580. throw new Error('AV.GeoPoint longitude ' + longitude + ' < -180.0.');
  10581. }
  10582. if (longitude > 180.0) {
  10583. throw new Error('AV.GeoPoint longitude ' + longitude + ' > 180.0.');
  10584. }
  10585. };
  10586. /**
  10587. * Creates a GeoPoint with the user's current location, if available.
  10588. * @return {Promise.<AV.GeoPoint>}
  10589. */
  10590. AV.GeoPoint.current = function () {
  10591. return new _promise.default(function (resolve, reject) {
  10592. navigator.geolocation.getCurrentPosition(function (location) {
  10593. resolve(new AV.GeoPoint({
  10594. latitude: location.coords.latitude,
  10595. longitude: location.coords.longitude
  10596. }));
  10597. }, reject);
  10598. });
  10599. };
  10600. _.extend(AV.GeoPoint.prototype,
  10601. /** @lends AV.GeoPoint.prototype */
  10602. {
  10603. /**
  10604. * Returns a JSON representation of the GeoPoint, suitable for AV.
  10605. * @return {Object}
  10606. */
  10607. toJSON: function toJSON() {
  10608. AV.GeoPoint._validate(this.latitude, this.longitude);
  10609. return {
  10610. __type: 'GeoPoint',
  10611. latitude: this.latitude,
  10612. longitude: this.longitude
  10613. };
  10614. },
  10615. /**
  10616. * Returns the distance from this GeoPoint to another in radians.
  10617. * @param {AV.GeoPoint} point the other AV.GeoPoint.
  10618. * @return {Number}
  10619. */
  10620. radiansTo: function radiansTo(point) {
  10621. var d2r = Math.PI / 180.0;
  10622. var lat1rad = this.latitude * d2r;
  10623. var long1rad = this.longitude * d2r;
  10624. var lat2rad = point.latitude * d2r;
  10625. var long2rad = point.longitude * d2r;
  10626. var deltaLat = lat1rad - lat2rad;
  10627. var deltaLong = long1rad - long2rad;
  10628. var sinDeltaLatDiv2 = Math.sin(deltaLat / 2);
  10629. var sinDeltaLongDiv2 = Math.sin(deltaLong / 2); // Square of half the straight line chord distance between both points.
  10630. var a = sinDeltaLatDiv2 * sinDeltaLatDiv2 + Math.cos(lat1rad) * Math.cos(lat2rad) * sinDeltaLongDiv2 * sinDeltaLongDiv2;
  10631. a = Math.min(1.0, a);
  10632. return 2 * Math.asin(Math.sqrt(a));
  10633. },
  10634. /**
  10635. * Returns the distance from this GeoPoint to another in kilometers.
  10636. * @param {AV.GeoPoint} point the other AV.GeoPoint.
  10637. * @return {Number}
  10638. */
  10639. kilometersTo: function kilometersTo(point) {
  10640. return this.radiansTo(point) * 6371.0;
  10641. },
  10642. /**
  10643. * Returns the distance from this GeoPoint to another in miles.
  10644. * @param {AV.GeoPoint} point the other AV.GeoPoint.
  10645. * @return {Number}
  10646. */
  10647. milesTo: function milesTo(point) {
  10648. return this.radiansTo(point) * 3958.8;
  10649. }
  10650. });
  10651. };
  10652. /***/ }),
  10653. /* 445 */
  10654. /***/ (function(module, exports, __webpack_require__) {
  10655. "use strict";
  10656. var _ = __webpack_require__(2);
  10657. module.exports = function (AV) {
  10658. var PUBLIC_KEY = '*';
  10659. /**
  10660. * Creates a new ACL.
  10661. * If no argument is given, the ACL has no permissions for anyone.
  10662. * If the argument is a AV.User, the ACL will have read and write
  10663. * permission for only that user.
  10664. * If the argument is any other JSON object, that object will be interpretted
  10665. * as a serialized ACL created with toJSON().
  10666. * @see AV.Object#setACL
  10667. * @class
  10668. *
  10669. * <p>An ACL, or Access Control List can be added to any
  10670. * <code>AV.Object</code> to restrict access to only a subset of users
  10671. * of your application.</p>
  10672. */
  10673. AV.ACL = function (arg1) {
  10674. var self = this;
  10675. self.permissionsById = {};
  10676. if (_.isObject(arg1)) {
  10677. if (arg1 instanceof AV.User) {
  10678. self.setReadAccess(arg1, true);
  10679. self.setWriteAccess(arg1, true);
  10680. } else {
  10681. if (_.isFunction(arg1)) {
  10682. throw new Error('AV.ACL() called with a function. Did you forget ()?');
  10683. }
  10684. AV._objectEach(arg1, function (accessList, userId) {
  10685. if (!_.isString(userId)) {
  10686. throw new Error('Tried to create an ACL with an invalid userId.');
  10687. }
  10688. self.permissionsById[userId] = {};
  10689. AV._objectEach(accessList, function (allowed, permission) {
  10690. if (permission !== 'read' && permission !== 'write') {
  10691. throw new Error('Tried to create an ACL with an invalid permission type.');
  10692. }
  10693. if (!_.isBoolean(allowed)) {
  10694. throw new Error('Tried to create an ACL with an invalid permission value.');
  10695. }
  10696. self.permissionsById[userId][permission] = allowed;
  10697. });
  10698. });
  10699. }
  10700. }
  10701. };
  10702. /**
  10703. * Returns a JSON-encoded version of the ACL.
  10704. * @return {Object}
  10705. */
  10706. AV.ACL.prototype.toJSON = function () {
  10707. return _.clone(this.permissionsById);
  10708. };
  10709. AV.ACL.prototype._setAccess = function (accessType, userId, allowed) {
  10710. if (userId instanceof AV.User) {
  10711. userId = userId.id;
  10712. } else if (userId instanceof AV.Role) {
  10713. userId = 'role:' + userId.getName();
  10714. }
  10715. if (!_.isString(userId)) {
  10716. throw new Error('userId must be a string.');
  10717. }
  10718. if (!_.isBoolean(allowed)) {
  10719. throw new Error('allowed must be either true or false.');
  10720. }
  10721. var permissions = this.permissionsById[userId];
  10722. if (!permissions) {
  10723. if (!allowed) {
  10724. // The user already doesn't have this permission, so no action needed.
  10725. return;
  10726. } else {
  10727. permissions = {};
  10728. this.permissionsById[userId] = permissions;
  10729. }
  10730. }
  10731. if (allowed) {
  10732. this.permissionsById[userId][accessType] = true;
  10733. } else {
  10734. delete permissions[accessType];
  10735. if (_.isEmpty(permissions)) {
  10736. delete this.permissionsById[userId];
  10737. }
  10738. }
  10739. };
  10740. AV.ACL.prototype._getAccess = function (accessType, userId) {
  10741. if (userId instanceof AV.User) {
  10742. userId = userId.id;
  10743. } else if (userId instanceof AV.Role) {
  10744. userId = 'role:' + userId.getName();
  10745. }
  10746. var permissions = this.permissionsById[userId];
  10747. if (!permissions) {
  10748. return false;
  10749. }
  10750. return permissions[accessType] ? true : false;
  10751. };
  10752. /**
  10753. * Set whether the given user is allowed to read this object.
  10754. * @param userId An instance of AV.User or its objectId.
  10755. * @param {Boolean} allowed Whether that user should have read access.
  10756. */
  10757. AV.ACL.prototype.setReadAccess = function (userId, allowed) {
  10758. this._setAccess('read', userId, allowed);
  10759. };
  10760. /**
  10761. * Get whether the given user id is *explicitly* allowed to read this object.
  10762. * Even if this returns false, the user may still be able to access it if
  10763. * getPublicReadAccess returns true or a role that the user belongs to has
  10764. * write access.
  10765. * @param userId An instance of AV.User or its objectId, or a AV.Role.
  10766. * @return {Boolean}
  10767. */
  10768. AV.ACL.prototype.getReadAccess = function (userId) {
  10769. return this._getAccess('read', userId);
  10770. };
  10771. /**
  10772. * Set whether the given user id is allowed to write this object.
  10773. * @param userId An instance of AV.User or its objectId, or a AV.Role..
  10774. * @param {Boolean} allowed Whether that user should have write access.
  10775. */
  10776. AV.ACL.prototype.setWriteAccess = function (userId, allowed) {
  10777. this._setAccess('write', userId, allowed);
  10778. };
  10779. /**
  10780. * Get whether the given user id is *explicitly* allowed to write this object.
  10781. * Even if this returns false, the user may still be able to write it if
  10782. * getPublicWriteAccess returns true or a role that the user belongs to has
  10783. * write access.
  10784. * @param userId An instance of AV.User or its objectId, or a AV.Role.
  10785. * @return {Boolean}
  10786. */
  10787. AV.ACL.prototype.getWriteAccess = function (userId) {
  10788. return this._getAccess('write', userId);
  10789. };
  10790. /**
  10791. * Set whether the public is allowed to read this object.
  10792. * @param {Boolean} allowed
  10793. */
  10794. AV.ACL.prototype.setPublicReadAccess = function (allowed) {
  10795. this.setReadAccess(PUBLIC_KEY, allowed);
  10796. };
  10797. /**
  10798. * Get whether the public is allowed to read this object.
  10799. * @return {Boolean}
  10800. */
  10801. AV.ACL.prototype.getPublicReadAccess = function () {
  10802. return this.getReadAccess(PUBLIC_KEY);
  10803. };
  10804. /**
  10805. * Set whether the public is allowed to write this object.
  10806. * @param {Boolean} allowed
  10807. */
  10808. AV.ACL.prototype.setPublicWriteAccess = function (allowed) {
  10809. this.setWriteAccess(PUBLIC_KEY, allowed);
  10810. };
  10811. /**
  10812. * Get whether the public is allowed to write this object.
  10813. * @return {Boolean}
  10814. */
  10815. AV.ACL.prototype.getPublicWriteAccess = function () {
  10816. return this.getWriteAccess(PUBLIC_KEY);
  10817. };
  10818. /**
  10819. * Get whether users belonging to the given role are allowed
  10820. * to read this object. Even if this returns false, the role may
  10821. * still be able to write it if a parent role has read access.
  10822. *
  10823. * @param role The name of the role, or a AV.Role object.
  10824. * @return {Boolean} true if the role has read access. false otherwise.
  10825. * @throws {String} If role is neither a AV.Role nor a String.
  10826. */
  10827. AV.ACL.prototype.getRoleReadAccess = function (role) {
  10828. if (role instanceof AV.Role) {
  10829. // Normalize to the String name
  10830. role = role.getName();
  10831. }
  10832. if (_.isString(role)) {
  10833. return this.getReadAccess('role:' + role);
  10834. }
  10835. throw new Error('role must be a AV.Role or a String');
  10836. };
  10837. /**
  10838. * Get whether users belonging to the given role are allowed
  10839. * to write this object. Even if this returns false, the role may
  10840. * still be able to write it if a parent role has write access.
  10841. *
  10842. * @param role The name of the role, or a AV.Role object.
  10843. * @return {Boolean} true if the role has write access. false otherwise.
  10844. * @throws {String} If role is neither a AV.Role nor a String.
  10845. */
  10846. AV.ACL.prototype.getRoleWriteAccess = function (role) {
  10847. if (role instanceof AV.Role) {
  10848. // Normalize to the String name
  10849. role = role.getName();
  10850. }
  10851. if (_.isString(role)) {
  10852. return this.getWriteAccess('role:' + role);
  10853. }
  10854. throw new Error('role must be a AV.Role or a String');
  10855. };
  10856. /**
  10857. * Set whether users belonging to the given role are allowed
  10858. * to read this object.
  10859. *
  10860. * @param role The name of the role, or a AV.Role object.
  10861. * @param {Boolean} allowed Whether the given role can read this object.
  10862. * @throws {String} If role is neither a AV.Role nor a String.
  10863. */
  10864. AV.ACL.prototype.setRoleReadAccess = function (role, allowed) {
  10865. if (role instanceof AV.Role) {
  10866. // Normalize to the String name
  10867. role = role.getName();
  10868. }
  10869. if (_.isString(role)) {
  10870. this.setReadAccess('role:' + role, allowed);
  10871. return;
  10872. }
  10873. throw new Error('role must be a AV.Role or a String');
  10874. };
  10875. /**
  10876. * Set whether users belonging to the given role are allowed
  10877. * to write this object.
  10878. *
  10879. * @param role The name of the role, or a AV.Role object.
  10880. * @param {Boolean} allowed Whether the given role can write this object.
  10881. * @throws {String} If role is neither a AV.Role nor a String.
  10882. */
  10883. AV.ACL.prototype.setRoleWriteAccess = function (role, allowed) {
  10884. if (role instanceof AV.Role) {
  10885. // Normalize to the String name
  10886. role = role.getName();
  10887. }
  10888. if (_.isString(role)) {
  10889. this.setWriteAccess('role:' + role, allowed);
  10890. return;
  10891. }
  10892. throw new Error('role must be a AV.Role or a String');
  10893. };
  10894. };
  10895. /***/ }),
  10896. /* 446 */
  10897. /***/ (function(module, exports, __webpack_require__) {
  10898. "use strict";
  10899. var _interopRequireDefault = __webpack_require__(1);
  10900. var _concat = _interopRequireDefault(__webpack_require__(30));
  10901. var _find = _interopRequireDefault(__webpack_require__(110));
  10902. var _indexOf = _interopRequireDefault(__webpack_require__(86));
  10903. var _map = _interopRequireDefault(__webpack_require__(42));
  10904. var _ = __webpack_require__(2);
  10905. module.exports = function (AV) {
  10906. /**
  10907. * @private
  10908. * @class
  10909. * A AV.Op is an atomic operation that can be applied to a field in a
  10910. * AV.Object. For example, calling <code>object.set("foo", "bar")</code>
  10911. * is an example of a AV.Op.Set. Calling <code>object.unset("foo")</code>
  10912. * is a AV.Op.Unset. These operations are stored in a AV.Object and
  10913. * sent to the server as part of <code>object.save()</code> operations.
  10914. * Instances of AV.Op should be immutable.
  10915. *
  10916. * You should not create subclasses of AV.Op or instantiate AV.Op
  10917. * directly.
  10918. */
  10919. AV.Op = function () {
  10920. this._initialize.apply(this, arguments);
  10921. };
  10922. _.extend(AV.Op.prototype,
  10923. /** @lends AV.Op.prototype */
  10924. {
  10925. _initialize: function _initialize() {}
  10926. });
  10927. _.extend(AV.Op, {
  10928. /**
  10929. * To create a new Op, call AV.Op._extend();
  10930. * @private
  10931. */
  10932. _extend: AV._extend,
  10933. // A map of __op string to decoder function.
  10934. _opDecoderMap: {},
  10935. /**
  10936. * Registers a function to convert a json object with an __op field into an
  10937. * instance of a subclass of AV.Op.
  10938. * @private
  10939. */
  10940. _registerDecoder: function _registerDecoder(opName, decoder) {
  10941. AV.Op._opDecoderMap[opName] = decoder;
  10942. },
  10943. /**
  10944. * Converts a json object into an instance of a subclass of AV.Op.
  10945. * @private
  10946. */
  10947. _decode: function _decode(json) {
  10948. var decoder = AV.Op._opDecoderMap[json.__op];
  10949. if (decoder) {
  10950. return decoder(json);
  10951. } else {
  10952. return undefined;
  10953. }
  10954. }
  10955. });
  10956. /*
  10957. * Add a handler for Batch ops.
  10958. */
  10959. AV.Op._registerDecoder('Batch', function (json) {
  10960. var op = null;
  10961. AV._arrayEach(json.ops, function (nextOp) {
  10962. nextOp = AV.Op._decode(nextOp);
  10963. op = nextOp._mergeWithPrevious(op);
  10964. });
  10965. return op;
  10966. });
  10967. /**
  10968. * @private
  10969. * @class
  10970. * A Set operation indicates that either the field was changed using
  10971. * AV.Object.set, or it is a mutable container that was detected as being
  10972. * changed.
  10973. */
  10974. AV.Op.Set = AV.Op._extend(
  10975. /** @lends AV.Op.Set.prototype */
  10976. {
  10977. _initialize: function _initialize(value) {
  10978. this._value = value;
  10979. },
  10980. /**
  10981. * Returns the new value of this field after the set.
  10982. */
  10983. value: function value() {
  10984. return this._value;
  10985. },
  10986. /**
  10987. * Returns a JSON version of the operation suitable for sending to AV.
  10988. * @return {Object}
  10989. */
  10990. toJSON: function toJSON() {
  10991. return AV._encode(this.value());
  10992. },
  10993. _mergeWithPrevious: function _mergeWithPrevious(previous) {
  10994. return this;
  10995. },
  10996. _estimate: function _estimate(oldValue) {
  10997. return this.value();
  10998. }
  10999. });
  11000. /**
  11001. * A sentinel value that is returned by AV.Op.Unset._estimate to
  11002. * indicate the field should be deleted. Basically, if you find _UNSET as a
  11003. * value in your object, you should remove that key.
  11004. */
  11005. AV.Op._UNSET = {};
  11006. /**
  11007. * @private
  11008. * @class
  11009. * An Unset operation indicates that this field has been deleted from the
  11010. * object.
  11011. */
  11012. AV.Op.Unset = AV.Op._extend(
  11013. /** @lends AV.Op.Unset.prototype */
  11014. {
  11015. /**
  11016. * Returns a JSON version of the operation suitable for sending to AV.
  11017. * @return {Object}
  11018. */
  11019. toJSON: function toJSON() {
  11020. return {
  11021. __op: 'Delete'
  11022. };
  11023. },
  11024. _mergeWithPrevious: function _mergeWithPrevious(previous) {
  11025. return this;
  11026. },
  11027. _estimate: function _estimate(oldValue) {
  11028. return AV.Op._UNSET;
  11029. }
  11030. });
  11031. AV.Op._registerDecoder('Delete', function (json) {
  11032. return new AV.Op.Unset();
  11033. });
  11034. /**
  11035. * @private
  11036. * @class
  11037. * An Increment is an atomic operation where the numeric value for the field
  11038. * will be increased by a given amount.
  11039. */
  11040. AV.Op.Increment = AV.Op._extend(
  11041. /** @lends AV.Op.Increment.prototype */
  11042. {
  11043. _initialize: function _initialize(amount) {
  11044. this._amount = amount;
  11045. },
  11046. /**
  11047. * Returns the amount to increment by.
  11048. * @return {Number} the amount to increment by.
  11049. */
  11050. amount: function amount() {
  11051. return this._amount;
  11052. },
  11053. /**
  11054. * Returns a JSON version of the operation suitable for sending to AV.
  11055. * @return {Object}
  11056. */
  11057. toJSON: function toJSON() {
  11058. return {
  11059. __op: 'Increment',
  11060. amount: this._amount
  11061. };
  11062. },
  11063. _mergeWithPrevious: function _mergeWithPrevious(previous) {
  11064. if (!previous) {
  11065. return this;
  11066. } else if (previous instanceof AV.Op.Unset) {
  11067. return new AV.Op.Set(this.amount());
  11068. } else if (previous instanceof AV.Op.Set) {
  11069. return new AV.Op.Set(previous.value() + this.amount());
  11070. } else if (previous instanceof AV.Op.Increment) {
  11071. return new AV.Op.Increment(this.amount() + previous.amount());
  11072. } else {
  11073. throw new Error('Op is invalid after previous op.');
  11074. }
  11075. },
  11076. _estimate: function _estimate(oldValue) {
  11077. if (!oldValue) {
  11078. return this.amount();
  11079. }
  11080. return oldValue + this.amount();
  11081. }
  11082. });
  11083. AV.Op._registerDecoder('Increment', function (json) {
  11084. return new AV.Op.Increment(json.amount);
  11085. });
  11086. /**
  11087. * @private
  11088. * @class
  11089. * BitAnd is an atomic operation where the given value will be bit and to the
  11090. * value than is stored in this field.
  11091. */
  11092. AV.Op.BitAnd = AV.Op._extend(
  11093. /** @lends AV.Op.BitAnd.prototype */
  11094. {
  11095. _initialize: function _initialize(value) {
  11096. this._value = value;
  11097. },
  11098. value: function value() {
  11099. return this._value;
  11100. },
  11101. /**
  11102. * Returns a JSON version of the operation suitable for sending to AV.
  11103. * @return {Object}
  11104. */
  11105. toJSON: function toJSON() {
  11106. return {
  11107. __op: 'BitAnd',
  11108. value: this.value()
  11109. };
  11110. },
  11111. _mergeWithPrevious: function _mergeWithPrevious(previous) {
  11112. if (!previous) {
  11113. return this;
  11114. } else if (previous instanceof AV.Op.Unset) {
  11115. return new AV.Op.Set(0);
  11116. } else if (previous instanceof AV.Op.Set) {
  11117. return new AV.Op.Set(previous.value() & this.value());
  11118. } else {
  11119. throw new Error('Op is invalid after previous op.');
  11120. }
  11121. },
  11122. _estimate: function _estimate(oldValue) {
  11123. return oldValue & this.value();
  11124. }
  11125. });
  11126. AV.Op._registerDecoder('BitAnd', function (json) {
  11127. return new AV.Op.BitAnd(json.value);
  11128. });
  11129. /**
  11130. * @private
  11131. * @class
  11132. * BitOr is an atomic operation where the given value will be bit and to the
  11133. * value than is stored in this field.
  11134. */
  11135. AV.Op.BitOr = AV.Op._extend(
  11136. /** @lends AV.Op.BitOr.prototype */
  11137. {
  11138. _initialize: function _initialize(value) {
  11139. this._value = value;
  11140. },
  11141. value: function value() {
  11142. return this._value;
  11143. },
  11144. /**
  11145. * Returns a JSON version of the operation suitable for sending to AV.
  11146. * @return {Object}
  11147. */
  11148. toJSON: function toJSON() {
  11149. return {
  11150. __op: 'BitOr',
  11151. value: this.value()
  11152. };
  11153. },
  11154. _mergeWithPrevious: function _mergeWithPrevious(previous) {
  11155. if (!previous) {
  11156. return this;
  11157. } else if (previous instanceof AV.Op.Unset) {
  11158. return new AV.Op.Set(this.value());
  11159. } else if (previous instanceof AV.Op.Set) {
  11160. return new AV.Op.Set(previous.value() | this.value());
  11161. } else {
  11162. throw new Error('Op is invalid after previous op.');
  11163. }
  11164. },
  11165. _estimate: function _estimate(oldValue) {
  11166. return oldValue | this.value();
  11167. }
  11168. });
  11169. AV.Op._registerDecoder('BitOr', function (json) {
  11170. return new AV.Op.BitOr(json.value);
  11171. });
  11172. /**
  11173. * @private
  11174. * @class
  11175. * BitXor is an atomic operation where the given value will be bit and to the
  11176. * value than is stored in this field.
  11177. */
  11178. AV.Op.BitXor = AV.Op._extend(
  11179. /** @lends AV.Op.BitXor.prototype */
  11180. {
  11181. _initialize: function _initialize(value) {
  11182. this._value = value;
  11183. },
  11184. value: function value() {
  11185. return this._value;
  11186. },
  11187. /**
  11188. * Returns a JSON version of the operation suitable for sending to AV.
  11189. * @return {Object}
  11190. */
  11191. toJSON: function toJSON() {
  11192. return {
  11193. __op: 'BitXor',
  11194. value: this.value()
  11195. };
  11196. },
  11197. _mergeWithPrevious: function _mergeWithPrevious(previous) {
  11198. if (!previous) {
  11199. return this;
  11200. } else if (previous instanceof AV.Op.Unset) {
  11201. return new AV.Op.Set(this.value());
  11202. } else if (previous instanceof AV.Op.Set) {
  11203. return new AV.Op.Set(previous.value() ^ this.value());
  11204. } else {
  11205. throw new Error('Op is invalid after previous op.');
  11206. }
  11207. },
  11208. _estimate: function _estimate(oldValue) {
  11209. return oldValue ^ this.value();
  11210. }
  11211. });
  11212. AV.Op._registerDecoder('BitXor', function (json) {
  11213. return new AV.Op.BitXor(json.value);
  11214. });
  11215. /**
  11216. * @private
  11217. * @class
  11218. * Add is an atomic operation where the given objects will be appended to the
  11219. * array that is stored in this field.
  11220. */
  11221. AV.Op.Add = AV.Op._extend(
  11222. /** @lends AV.Op.Add.prototype */
  11223. {
  11224. _initialize: function _initialize(objects) {
  11225. this._objects = objects;
  11226. },
  11227. /**
  11228. * Returns the objects to be added to the array.
  11229. * @return {Array} The objects to be added to the array.
  11230. */
  11231. objects: function objects() {
  11232. return this._objects;
  11233. },
  11234. /**
  11235. * Returns a JSON version of the operation suitable for sending to AV.
  11236. * @return {Object}
  11237. */
  11238. toJSON: function toJSON() {
  11239. return {
  11240. __op: 'Add',
  11241. objects: AV._encode(this.objects())
  11242. };
  11243. },
  11244. _mergeWithPrevious: function _mergeWithPrevious(previous) {
  11245. if (!previous) {
  11246. return this;
  11247. } else if (previous instanceof AV.Op.Unset) {
  11248. return new AV.Op.Set(this.objects());
  11249. } else if (previous instanceof AV.Op.Set) {
  11250. return new AV.Op.Set(this._estimate(previous.value()));
  11251. } else if (previous instanceof AV.Op.Add) {
  11252. var _context;
  11253. return new AV.Op.Add((0, _concat.default)(_context = previous.objects()).call(_context, this.objects()));
  11254. } else {
  11255. throw new Error('Op is invalid after previous op.');
  11256. }
  11257. },
  11258. _estimate: function _estimate(oldValue) {
  11259. if (!oldValue) {
  11260. return _.clone(this.objects());
  11261. } else {
  11262. return (0, _concat.default)(oldValue).call(oldValue, this.objects());
  11263. }
  11264. }
  11265. });
  11266. AV.Op._registerDecoder('Add', function (json) {
  11267. return new AV.Op.Add(AV._decode(json.objects));
  11268. });
  11269. /**
  11270. * @private
  11271. * @class
  11272. * AddUnique is an atomic operation where the given items will be appended to
  11273. * the array that is stored in this field only if they were not already
  11274. * present in the array.
  11275. */
  11276. AV.Op.AddUnique = AV.Op._extend(
  11277. /** @lends AV.Op.AddUnique.prototype */
  11278. {
  11279. _initialize: function _initialize(objects) {
  11280. this._objects = _.uniq(objects);
  11281. },
  11282. /**
  11283. * Returns the objects to be added to the array.
  11284. * @return {Array} The objects to be added to the array.
  11285. */
  11286. objects: function objects() {
  11287. return this._objects;
  11288. },
  11289. /**
  11290. * Returns a JSON version of the operation suitable for sending to AV.
  11291. * @return {Object}
  11292. */
  11293. toJSON: function toJSON() {
  11294. return {
  11295. __op: 'AddUnique',
  11296. objects: AV._encode(this.objects())
  11297. };
  11298. },
  11299. _mergeWithPrevious: function _mergeWithPrevious(previous) {
  11300. if (!previous) {
  11301. return this;
  11302. } else if (previous instanceof AV.Op.Unset) {
  11303. return new AV.Op.Set(this.objects());
  11304. } else if (previous instanceof AV.Op.Set) {
  11305. return new AV.Op.Set(this._estimate(previous.value()));
  11306. } else if (previous instanceof AV.Op.AddUnique) {
  11307. return new AV.Op.AddUnique(this._estimate(previous.objects()));
  11308. } else {
  11309. throw new Error('Op is invalid after previous op.');
  11310. }
  11311. },
  11312. _estimate: function _estimate(oldValue) {
  11313. if (!oldValue) {
  11314. return _.clone(this.objects());
  11315. } else {
  11316. // We can't just take the _.uniq(_.union(...)) of oldValue and
  11317. // this.objects, because the uniqueness may not apply to oldValue
  11318. // (especially if the oldValue was set via .set())
  11319. var newValue = _.clone(oldValue);
  11320. AV._arrayEach(this.objects(), function (obj) {
  11321. if (obj instanceof AV.Object && obj.id) {
  11322. var matchingObj = (0, _find.default)(_).call(_, newValue, function (anObj) {
  11323. return anObj instanceof AV.Object && anObj.id === obj.id;
  11324. });
  11325. if (!matchingObj) {
  11326. newValue.push(obj);
  11327. } else {
  11328. var index = (0, _indexOf.default)(_).call(_, newValue, matchingObj);
  11329. newValue[index] = obj;
  11330. }
  11331. } else if (!_.contains(newValue, obj)) {
  11332. newValue.push(obj);
  11333. }
  11334. });
  11335. return newValue;
  11336. }
  11337. }
  11338. });
  11339. AV.Op._registerDecoder('AddUnique', function (json) {
  11340. return new AV.Op.AddUnique(AV._decode(json.objects));
  11341. });
  11342. /**
  11343. * @private
  11344. * @class
  11345. * Remove is an atomic operation where the given objects will be removed from
  11346. * the array that is stored in this field.
  11347. */
  11348. AV.Op.Remove = AV.Op._extend(
  11349. /** @lends AV.Op.Remove.prototype */
  11350. {
  11351. _initialize: function _initialize(objects) {
  11352. this._objects = _.uniq(objects);
  11353. },
  11354. /**
  11355. * Returns the objects to be removed from the array.
  11356. * @return {Array} The objects to be removed from the array.
  11357. */
  11358. objects: function objects() {
  11359. return this._objects;
  11360. },
  11361. /**
  11362. * Returns a JSON version of the operation suitable for sending to AV.
  11363. * @return {Object}
  11364. */
  11365. toJSON: function toJSON() {
  11366. return {
  11367. __op: 'Remove',
  11368. objects: AV._encode(this.objects())
  11369. };
  11370. },
  11371. _mergeWithPrevious: function _mergeWithPrevious(previous) {
  11372. if (!previous) {
  11373. return this;
  11374. } else if (previous instanceof AV.Op.Unset) {
  11375. return previous;
  11376. } else if (previous instanceof AV.Op.Set) {
  11377. return new AV.Op.Set(this._estimate(previous.value()));
  11378. } else if (previous instanceof AV.Op.Remove) {
  11379. return new AV.Op.Remove(_.union(previous.objects(), this.objects()));
  11380. } else {
  11381. throw new Error('Op is invalid after previous op.');
  11382. }
  11383. },
  11384. _estimate: function _estimate(oldValue) {
  11385. if (!oldValue) {
  11386. return [];
  11387. } else {
  11388. var newValue = _.difference(oldValue, this.objects()); // If there are saved AV Objects being removed, also remove them.
  11389. AV._arrayEach(this.objects(), function (obj) {
  11390. if (obj instanceof AV.Object && obj.id) {
  11391. newValue = _.reject(newValue, function (other) {
  11392. return other instanceof AV.Object && other.id === obj.id;
  11393. });
  11394. }
  11395. });
  11396. return newValue;
  11397. }
  11398. }
  11399. });
  11400. AV.Op._registerDecoder('Remove', function (json) {
  11401. return new AV.Op.Remove(AV._decode(json.objects));
  11402. });
  11403. /**
  11404. * @private
  11405. * @class
  11406. * A Relation operation indicates that the field is an instance of
  11407. * AV.Relation, and objects are being added to, or removed from, that
  11408. * relation.
  11409. */
  11410. AV.Op.Relation = AV.Op._extend(
  11411. /** @lends AV.Op.Relation.prototype */
  11412. {
  11413. _initialize: function _initialize(adds, removes) {
  11414. this._targetClassName = null;
  11415. var self = this;
  11416. var pointerToId = function pointerToId(object) {
  11417. if (object instanceof AV.Object) {
  11418. if (!object.id) {
  11419. throw new Error("You can't add an unsaved AV.Object to a relation.");
  11420. }
  11421. if (!self._targetClassName) {
  11422. self._targetClassName = object.className;
  11423. }
  11424. if (self._targetClassName !== object.className) {
  11425. throw new Error('Tried to create a AV.Relation with 2 different types: ' + self._targetClassName + ' and ' + object.className + '.');
  11426. }
  11427. return object.id;
  11428. }
  11429. return object;
  11430. };
  11431. this.relationsToAdd = _.uniq((0, _map.default)(_).call(_, adds, pointerToId));
  11432. this.relationsToRemove = _.uniq((0, _map.default)(_).call(_, removes, pointerToId));
  11433. },
  11434. /**
  11435. * Returns an array of unfetched AV.Object that are being added to the
  11436. * relation.
  11437. * @return {Array}
  11438. */
  11439. added: function added() {
  11440. var self = this;
  11441. return (0, _map.default)(_).call(_, this.relationsToAdd, function (objectId) {
  11442. var object = AV.Object._create(self._targetClassName);
  11443. object.id = objectId;
  11444. return object;
  11445. });
  11446. },
  11447. /**
  11448. * Returns an array of unfetched AV.Object that are being removed from
  11449. * the relation.
  11450. * @return {Array}
  11451. */
  11452. removed: function removed() {
  11453. var self = this;
  11454. return (0, _map.default)(_).call(_, this.relationsToRemove, function (objectId) {
  11455. var object = AV.Object._create(self._targetClassName);
  11456. object.id = objectId;
  11457. return object;
  11458. });
  11459. },
  11460. /**
  11461. * Returns a JSON version of the operation suitable for sending to AV.
  11462. * @return {Object}
  11463. */
  11464. toJSON: function toJSON() {
  11465. var adds = null;
  11466. var removes = null;
  11467. var self = this;
  11468. var idToPointer = function idToPointer(id) {
  11469. return {
  11470. __type: 'Pointer',
  11471. className: self._targetClassName,
  11472. objectId: id
  11473. };
  11474. };
  11475. var pointers = null;
  11476. if (this.relationsToAdd.length > 0) {
  11477. pointers = (0, _map.default)(_).call(_, this.relationsToAdd, idToPointer);
  11478. adds = {
  11479. __op: 'AddRelation',
  11480. objects: pointers
  11481. };
  11482. }
  11483. if (this.relationsToRemove.length > 0) {
  11484. pointers = (0, _map.default)(_).call(_, this.relationsToRemove, idToPointer);
  11485. removes = {
  11486. __op: 'RemoveRelation',
  11487. objects: pointers
  11488. };
  11489. }
  11490. if (adds && removes) {
  11491. return {
  11492. __op: 'Batch',
  11493. ops: [adds, removes]
  11494. };
  11495. }
  11496. return adds || removes || {};
  11497. },
  11498. _mergeWithPrevious: function _mergeWithPrevious(previous) {
  11499. if (!previous) {
  11500. return this;
  11501. } else if (previous instanceof AV.Op.Unset) {
  11502. throw new Error("You can't modify a relation after deleting it.");
  11503. } else if (previous instanceof AV.Op.Relation) {
  11504. if (previous._targetClassName && previous._targetClassName !== this._targetClassName) {
  11505. throw new Error('Related object must be of class ' + previous._targetClassName + ', but ' + this._targetClassName + ' was passed in.');
  11506. }
  11507. var newAdd = _.union(_.difference(previous.relationsToAdd, this.relationsToRemove), this.relationsToAdd);
  11508. var newRemove = _.union(_.difference(previous.relationsToRemove, this.relationsToAdd), this.relationsToRemove);
  11509. var newRelation = new AV.Op.Relation(newAdd, newRemove);
  11510. newRelation._targetClassName = this._targetClassName;
  11511. return newRelation;
  11512. } else {
  11513. throw new Error('Op is invalid after previous op.');
  11514. }
  11515. },
  11516. _estimate: function _estimate(oldValue, object, key) {
  11517. if (!oldValue) {
  11518. var relation = new AV.Relation(object, key);
  11519. relation.targetClassName = this._targetClassName;
  11520. } else if (oldValue instanceof AV.Relation) {
  11521. if (this._targetClassName) {
  11522. if (oldValue.targetClassName) {
  11523. if (oldValue.targetClassName !== this._targetClassName) {
  11524. throw new Error('Related object must be a ' + oldValue.targetClassName + ', but a ' + this._targetClassName + ' was passed in.');
  11525. }
  11526. } else {
  11527. oldValue.targetClassName = this._targetClassName;
  11528. }
  11529. }
  11530. return oldValue;
  11531. } else {
  11532. throw new Error('Op is invalid after previous op.');
  11533. }
  11534. }
  11535. });
  11536. AV.Op._registerDecoder('AddRelation', function (json) {
  11537. return new AV.Op.Relation(AV._decode(json.objects), []);
  11538. });
  11539. AV.Op._registerDecoder('RemoveRelation', function (json) {
  11540. return new AV.Op.Relation([], AV._decode(json.objects));
  11541. });
  11542. };
  11543. /***/ }),
  11544. /* 447 */
  11545. /***/ (function(module, exports, __webpack_require__) {
  11546. var parent = __webpack_require__(448);
  11547. module.exports = parent;
  11548. /***/ }),
  11549. /* 448 */
  11550. /***/ (function(module, exports, __webpack_require__) {
  11551. var isPrototypeOf = __webpack_require__(21);
  11552. var method = __webpack_require__(449);
  11553. var ArrayPrototype = Array.prototype;
  11554. module.exports = function (it) {
  11555. var own = it.find;
  11556. return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.find) ? method : own;
  11557. };
  11558. /***/ }),
  11559. /* 449 */
  11560. /***/ (function(module, exports, __webpack_require__) {
  11561. __webpack_require__(450);
  11562. var entryVirtual = __webpack_require__(41);
  11563. module.exports = entryVirtual('Array').find;
  11564. /***/ }),
  11565. /* 450 */
  11566. /***/ (function(module, exports, __webpack_require__) {
  11567. "use strict";
  11568. var $ = __webpack_require__(0);
  11569. var $find = __webpack_require__(66).find;
  11570. var addToUnscopables = __webpack_require__(159);
  11571. var FIND = 'find';
  11572. var SKIPS_HOLES = true;
  11573. // Shouldn't skip holes
  11574. if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
  11575. // `Array.prototype.find` method
  11576. // https://tc39.es/ecma262/#sec-array.prototype.find
  11577. $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
  11578. find: function find(callbackfn /* , that = undefined */) {
  11579. return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  11580. }
  11581. });
  11582. // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
  11583. addToUnscopables(FIND);
  11584. /***/ }),
  11585. /* 451 */
  11586. /***/ (function(module, exports, __webpack_require__) {
  11587. "use strict";
  11588. var _ = __webpack_require__(2);
  11589. module.exports = function (AV) {
  11590. /**
  11591. * Creates a new Relation for the given parent object and key. This
  11592. * constructor should rarely be used directly, but rather created by
  11593. * {@link AV.Object#relation}.
  11594. * @param {AV.Object} parent The parent of this relation.
  11595. * @param {String} key The key for this relation on the parent.
  11596. * @see AV.Object#relation
  11597. * @class
  11598. *
  11599. * <p>
  11600. * A class that is used to access all of the children of a many-to-many
  11601. * relationship. Each instance of AV.Relation is associated with a
  11602. * particular parent object and key.
  11603. * </p>
  11604. */
  11605. AV.Relation = function (parent, key) {
  11606. if (!_.isString(key)) {
  11607. throw new TypeError('key must be a string');
  11608. }
  11609. this.parent = parent;
  11610. this.key = key;
  11611. this.targetClassName = null;
  11612. };
  11613. /**
  11614. * Creates a query that can be used to query the parent objects in this relation.
  11615. * @param {String} parentClass The parent class or name.
  11616. * @param {String} relationKey The relation field key in parent.
  11617. * @param {AV.Object} child The child object.
  11618. * @return {AV.Query}
  11619. */
  11620. AV.Relation.reverseQuery = function (parentClass, relationKey, child) {
  11621. var query = new AV.Query(parentClass);
  11622. query.equalTo(relationKey, child._toPointer());
  11623. return query;
  11624. };
  11625. _.extend(AV.Relation.prototype,
  11626. /** @lends AV.Relation.prototype */
  11627. {
  11628. /**
  11629. * Makes sure that this relation has the right parent and key.
  11630. * @private
  11631. */
  11632. _ensureParentAndKey: function _ensureParentAndKey(parent, key) {
  11633. this.parent = this.parent || parent;
  11634. this.key = this.key || key;
  11635. if (this.parent !== parent) {
  11636. throw new Error('Internal Error. Relation retrieved from two different Objects.');
  11637. }
  11638. if (this.key !== key) {
  11639. throw new Error('Internal Error. Relation retrieved from two different keys.');
  11640. }
  11641. },
  11642. /**
  11643. * Adds a AV.Object or an array of AV.Objects to the relation.
  11644. * @param {AV.Object|AV.Object[]} objects The item or items to add.
  11645. */
  11646. add: function add(objects) {
  11647. if (!_.isArray(objects)) {
  11648. objects = [objects];
  11649. }
  11650. var change = new AV.Op.Relation(objects, []);
  11651. this.parent.set(this.key, change);
  11652. this.targetClassName = change._targetClassName;
  11653. },
  11654. /**
  11655. * Removes a AV.Object or an array of AV.Objects from this relation.
  11656. * @param {AV.Object|AV.Object[]} objects The item or items to remove.
  11657. */
  11658. remove: function remove(objects) {
  11659. if (!_.isArray(objects)) {
  11660. objects = [objects];
  11661. }
  11662. var change = new AV.Op.Relation([], objects);
  11663. this.parent.set(this.key, change);
  11664. this.targetClassName = change._targetClassName;
  11665. },
  11666. /**
  11667. * Returns a JSON version of the object suitable for saving to disk.
  11668. * @return {Object}
  11669. */
  11670. toJSON: function toJSON() {
  11671. return {
  11672. __type: 'Relation',
  11673. className: this.targetClassName
  11674. };
  11675. },
  11676. /**
  11677. * Returns a AV.Query that is limited to objects in this
  11678. * relation.
  11679. * @return {AV.Query}
  11680. */
  11681. query: function query() {
  11682. var targetClass;
  11683. var query;
  11684. if (!this.targetClassName) {
  11685. targetClass = AV.Object._getSubclass(this.parent.className);
  11686. query = new AV.Query(targetClass);
  11687. query._defaultParams.redirectClassNameForKey = this.key;
  11688. } else {
  11689. targetClass = AV.Object._getSubclass(this.targetClassName);
  11690. query = new AV.Query(targetClass);
  11691. }
  11692. query._addCondition('$relatedTo', 'object', this.parent._toPointer());
  11693. query._addCondition('$relatedTo', 'key', this.key);
  11694. return query;
  11695. }
  11696. });
  11697. };
  11698. /***/ }),
  11699. /* 452 */
  11700. /***/ (function(module, exports, __webpack_require__) {
  11701. "use strict";
  11702. var _interopRequireDefault = __webpack_require__(1);
  11703. var _promise = _interopRequireDefault(__webpack_require__(12));
  11704. var _ = __webpack_require__(2);
  11705. var cos = __webpack_require__(453);
  11706. var qiniu = __webpack_require__(454);
  11707. var s3 = __webpack_require__(501);
  11708. var AVError = __webpack_require__(43);
  11709. var _require = __webpack_require__(26),
  11710. request = _require.request,
  11711. AVRequest = _require._request;
  11712. var _require2 = __webpack_require__(29),
  11713. tap = _require2.tap,
  11714. transformFetchOptions = _require2.transformFetchOptions;
  11715. var debug = __webpack_require__(67)('leancloud:file');
  11716. var parseBase64 = __webpack_require__(505);
  11717. module.exports = function (AV) {
  11718. // port from browserify path module
  11719. // since react-native packager won't shim node modules.
  11720. var extname = function extname(path) {
  11721. if (!_.isString(path)) return '';
  11722. return path.match(/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/)[4];
  11723. };
  11724. var b64Digit = function b64Digit(number) {
  11725. if (number < 26) {
  11726. return String.fromCharCode(65 + number);
  11727. }
  11728. if (number < 52) {
  11729. return String.fromCharCode(97 + (number - 26));
  11730. }
  11731. if (number < 62) {
  11732. return String.fromCharCode(48 + (number - 52));
  11733. }
  11734. if (number === 62) {
  11735. return '+';
  11736. }
  11737. if (number === 63) {
  11738. return '/';
  11739. }
  11740. throw new Error('Tried to encode large digit ' + number + ' in base64.');
  11741. };
  11742. var encodeBase64 = function encodeBase64(array) {
  11743. var chunks = [];
  11744. chunks.length = Math.ceil(array.length / 3);
  11745. _.times(chunks.length, function (i) {
  11746. var b1 = array[i * 3];
  11747. var b2 = array[i * 3 + 1] || 0;
  11748. var b3 = array[i * 3 + 2] || 0;
  11749. var has2 = i * 3 + 1 < array.length;
  11750. var has3 = i * 3 + 2 < array.length;
  11751. chunks[i] = [b64Digit(b1 >> 2 & 0x3f), b64Digit(b1 << 4 & 0x30 | b2 >> 4 & 0x0f), has2 ? b64Digit(b2 << 2 & 0x3c | b3 >> 6 & 0x03) : '=', has3 ? b64Digit(b3 & 0x3f) : '='].join('');
  11752. });
  11753. return chunks.join('');
  11754. };
  11755. /**
  11756. * An AV.File is a local representation of a file that is saved to the AV
  11757. * cloud.
  11758. * @param name {String} The file's name. This will change to a unique value
  11759. * once the file has finished saving.
  11760. * @param data {Array} The data for the file, as either:
  11761. * 1. an Array of byte value Numbers, or
  11762. * 2. an Object like { base64: "..." } with a base64-encoded String.
  11763. * 3. a Blob(File) selected with a file upload control in a browser.
  11764. * 4. an Object like { blob: {uri: "..."} } that mimics Blob
  11765. * in some non-browser environments such as React Native.
  11766. * 5. a Buffer in Node.js runtime.
  11767. * 6. a Stream in Node.js runtime.
  11768. *
  11769. * For example:<pre>
  11770. * var fileUploadControl = $("#profilePhotoFileUpload")[0];
  11771. * if (fileUploadControl.files.length > 0) {
  11772. * var file = fileUploadControl.files[0];
  11773. * var name = "photo.jpg";
  11774. * var file = new AV.File(name, file);
  11775. * file.save().then(function() {
  11776. * // The file has been saved to AV.
  11777. * }, function(error) {
  11778. * // The file either could not be read, or could not be saved to AV.
  11779. * });
  11780. * }</pre>
  11781. *
  11782. * @class
  11783. * @param [mimeType] {String} Content-Type header to use for the file. If
  11784. * this is omitted, the content type will be inferred from the name's
  11785. * extension.
  11786. */
  11787. AV.File = function (name, data, mimeType) {
  11788. this.attributes = {
  11789. name: name,
  11790. url: '',
  11791. metaData: {},
  11792. // 用来存储转换后要上传的 base64 String
  11793. base64: ''
  11794. };
  11795. if (_.isString(data)) {
  11796. throw new TypeError('Creating an AV.File from a String is not yet supported.');
  11797. }
  11798. if (_.isArray(data)) {
  11799. this.attributes.metaData.size = data.length;
  11800. data = {
  11801. base64: encodeBase64(data)
  11802. };
  11803. }
  11804. this._extName = '';
  11805. this._data = data;
  11806. this._uploadHeaders = {};
  11807. if (data && data.blob && typeof data.blob.uri === 'string') {
  11808. this._extName = extname(data.blob.uri);
  11809. }
  11810. if (typeof Blob !== 'undefined' && data instanceof Blob) {
  11811. if (data.size) {
  11812. this.attributes.metaData.size = data.size;
  11813. }
  11814. if (data.name) {
  11815. this._extName = extname(data.name);
  11816. }
  11817. }
  11818. var owner;
  11819. if (data && data.owner) {
  11820. owner = data.owner;
  11821. } else if (!AV._config.disableCurrentUser) {
  11822. try {
  11823. owner = AV.User.current();
  11824. } catch (error) {
  11825. if ('SYNC_API_NOT_AVAILABLE' !== error.code) {
  11826. throw error;
  11827. }
  11828. }
  11829. }
  11830. this.attributes.metaData.owner = owner ? owner.id : 'unknown';
  11831. this.set('mime_type', mimeType);
  11832. };
  11833. /**
  11834. * Creates a fresh AV.File object with exists url for saving to AVOS Cloud.
  11835. * @param {String} name the file name
  11836. * @param {String} url the file url.
  11837. * @param {Object} [metaData] the file metadata object.
  11838. * @param {String} [type] Content-Type header to use for the file. If
  11839. * this is omitted, the content type will be inferred from the name's
  11840. * extension.
  11841. * @return {AV.File} the file object
  11842. */
  11843. AV.File.withURL = function (name, url, metaData, type) {
  11844. if (!name || !url) {
  11845. throw new Error('Please provide file name and url');
  11846. }
  11847. var file = new AV.File(name, null, type); //copy metaData properties to file.
  11848. if (metaData) {
  11849. for (var prop in metaData) {
  11850. if (!file.attributes.metaData[prop]) file.attributes.metaData[prop] = metaData[prop];
  11851. }
  11852. }
  11853. file.attributes.url = url; //Mark the file is from external source.
  11854. file.attributes.metaData.__source = 'external';
  11855. file.attributes.metaData.size = 0;
  11856. return file;
  11857. };
  11858. /**
  11859. * Creates a file object with exists objectId.
  11860. * @param {String} objectId The objectId string
  11861. * @return {AV.File} the file object
  11862. */
  11863. AV.File.createWithoutData = function (objectId) {
  11864. if (!objectId) {
  11865. throw new TypeError('The objectId must be provided');
  11866. }
  11867. var file = new AV.File();
  11868. file.id = objectId;
  11869. return file;
  11870. };
  11871. /**
  11872. * Request file censor.
  11873. * @since 4.13.0
  11874. * @param {String} objectId
  11875. * @return {Promise.<string>}
  11876. */
  11877. AV.File.censor = function (objectId) {
  11878. if (!AV._config.masterKey) {
  11879. throw new Error('Cannot censor a file without masterKey');
  11880. }
  11881. return request({
  11882. method: 'POST',
  11883. path: "/files/".concat(objectId, "/censor"),
  11884. authOptions: {
  11885. useMasterKey: true
  11886. }
  11887. }).then(function (res) {
  11888. return res.censorResult;
  11889. });
  11890. };
  11891. _.extend(AV.File.prototype,
  11892. /** @lends AV.File.prototype */
  11893. {
  11894. className: '_File',
  11895. _toFullJSON: function _toFullJSON(seenObjects) {
  11896. var _this = this;
  11897. var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  11898. var json = _.clone(this.attributes);
  11899. AV._objectEach(json, function (val, key) {
  11900. json[key] = AV._encode(val, seenObjects, undefined, full);
  11901. });
  11902. AV._objectEach(this._operations, function (val, key) {
  11903. json[key] = val;
  11904. });
  11905. if (_.has(this, 'id')) {
  11906. json.objectId = this.id;
  11907. }
  11908. ['createdAt', 'updatedAt'].forEach(function (key) {
  11909. if (_.has(_this, key)) {
  11910. var val = _this[key];
  11911. json[key] = _.isDate(val) ? val.toJSON() : val;
  11912. }
  11913. });
  11914. if (full) {
  11915. json.__type = 'File';
  11916. }
  11917. return json;
  11918. },
  11919. /**
  11920. * Returns a JSON version of the file with meta data.
  11921. * Inverse to {@link AV.parseJSON}
  11922. * @since 3.0.0
  11923. * @return {Object}
  11924. */
  11925. toFullJSON: function toFullJSON() {
  11926. var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  11927. return this._toFullJSON(seenObjects);
  11928. },
  11929. /**
  11930. * Returns a JSON version of the object.
  11931. * @return {Object}
  11932. */
  11933. toJSON: function toJSON(key, holder) {
  11934. var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [this];
  11935. return this._toFullJSON(seenObjects, false);
  11936. },
  11937. /**
  11938. * Gets a Pointer referencing this file.
  11939. * @private
  11940. */
  11941. _toPointer: function _toPointer() {
  11942. return {
  11943. __type: 'Pointer',
  11944. className: this.className,
  11945. objectId: this.id
  11946. };
  11947. },
  11948. /**
  11949. * Returns the ACL for this file.
  11950. * @returns {AV.ACL} An instance of AV.ACL.
  11951. */
  11952. getACL: function getACL() {
  11953. return this._acl;
  11954. },
  11955. /**
  11956. * Sets the ACL to be used for this file.
  11957. * @param {AV.ACL} acl An instance of AV.ACL.
  11958. */
  11959. setACL: function setACL(acl) {
  11960. if (!(acl instanceof AV.ACL)) {
  11961. return new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
  11962. }
  11963. this._acl = acl;
  11964. return this;
  11965. },
  11966. /**
  11967. * Gets the name of the file. Before save is called, this is the filename
  11968. * given by the user. After save is called, that name gets prefixed with a
  11969. * unique identifier.
  11970. */
  11971. name: function name() {
  11972. return this.get('name');
  11973. },
  11974. /**
  11975. * Gets the url of the file. It is only available after you save the file or
  11976. * after you get the file from a AV.Object.
  11977. * @return {String}
  11978. */
  11979. url: function url() {
  11980. return this.get('url');
  11981. },
  11982. /**
  11983. * Gets the attributs of the file object.
  11984. * @param {String} The attribute name which want to get.
  11985. * @returns {Any}
  11986. */
  11987. get: function get(attrName) {
  11988. switch (attrName) {
  11989. case 'objectId':
  11990. return this.id;
  11991. case 'url':
  11992. case 'name':
  11993. case 'mime_type':
  11994. case 'metaData':
  11995. case 'createdAt':
  11996. case 'updatedAt':
  11997. return this.attributes[attrName];
  11998. default:
  11999. return this.attributes.metaData[attrName];
  12000. }
  12001. },
  12002. /**
  12003. * Set the metaData of the file object.
  12004. * @param {Object} Object is an key value Object for setting metaData.
  12005. * @param {String} attr is an optional metadata key.
  12006. * @param {Object} value is an optional metadata value.
  12007. * @returns {String|Number|Array|Object}
  12008. */
  12009. set: function set() {
  12010. var _this2 = this;
  12011. var set = function set(attrName, value) {
  12012. switch (attrName) {
  12013. case 'name':
  12014. case 'url':
  12015. case 'mime_type':
  12016. case 'base64':
  12017. case 'metaData':
  12018. _this2.attributes[attrName] = value;
  12019. break;
  12020. default:
  12021. // File 并非一个 AVObject,不能完全自定义其他属性,所以只能都放在 metaData 上面
  12022. _this2.attributes.metaData[attrName] = value;
  12023. break;
  12024. }
  12025. };
  12026. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  12027. args[_key] = arguments[_key];
  12028. }
  12029. switch (args.length) {
  12030. case 1:
  12031. // 传入一个 Object
  12032. for (var k in args[0]) {
  12033. set(k, args[0][k]);
  12034. }
  12035. break;
  12036. case 2:
  12037. set(args[0], args[1]);
  12038. break;
  12039. }
  12040. return this;
  12041. },
  12042. /**
  12043. * Set a header for the upload request.
  12044. * For more infomation, go to https://url.leanapp.cn/avfile-upload-headers
  12045. *
  12046. * @param {String} key header key
  12047. * @param {String} value header value
  12048. * @return {AV.File} this
  12049. */
  12050. setUploadHeader: function setUploadHeader(key, value) {
  12051. this._uploadHeaders[key] = value;
  12052. return this;
  12053. },
  12054. /**
  12055. * <p>Returns the file's metadata JSON object if no arguments is given.Returns the
  12056. * metadata value if a key is given.Set metadata value if key and value are both given.</p>
  12057. * <p><pre>
  12058. * var metadata = file.metaData(); //Get metadata JSON object.
  12059. * var size = file.metaData('size'); // Get the size metadata value.
  12060. * file.metaData('format', 'jpeg'); //set metadata attribute and value.
  12061. *</pre></p>
  12062. * @return {Object} The file's metadata JSON object.
  12063. * @param {String} attr an optional metadata key.
  12064. * @param {Object} value an optional metadata value.
  12065. **/
  12066. metaData: function metaData(attr, value) {
  12067. if (attr && value) {
  12068. this.attributes.metaData[attr] = value;
  12069. return this;
  12070. } else if (attr && !value) {
  12071. return this.attributes.metaData[attr];
  12072. } else {
  12073. return this.attributes.metaData;
  12074. }
  12075. },
  12076. /**
  12077. * 如果文件是图片,获取图片的缩略图URL。可以传入宽度、高度、质量、格式等参数。
  12078. * @return {String} 缩略图URL
  12079. * @param {Number} width 宽度,单位:像素
  12080. * @param {Number} heigth 高度,单位:像素
  12081. * @param {Number} quality 质量,1-100的数字,默认100
  12082. * @param {Number} scaleToFit 是否将图片自适应大小。默认为true。
  12083. * @param {String} fmt 格式,默认为png,也可以为jpeg,gif等格式。
  12084. */
  12085. thumbnailURL: function thumbnailURL(width, height) {
  12086. var quality = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
  12087. var scaleToFit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
  12088. var fmt = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'png';
  12089. var url = this.attributes.url;
  12090. if (!url) {
  12091. throw new Error('Invalid url.');
  12092. }
  12093. if (!width || !height || width <= 0 || height <= 0) {
  12094. throw new Error('Invalid width or height value.');
  12095. }
  12096. if (quality <= 0 || quality > 100) {
  12097. throw new Error('Invalid quality value.');
  12098. }
  12099. var mode = scaleToFit ? 2 : 1;
  12100. return url + '?imageView/' + mode + '/w/' + width + '/h/' + height + '/q/' + quality + '/format/' + fmt;
  12101. },
  12102. /**
  12103. * Returns the file's size.
  12104. * @return {Number} The file's size in bytes.
  12105. **/
  12106. size: function size() {
  12107. return this.metaData().size;
  12108. },
  12109. /**
  12110. * Returns the file's owner.
  12111. * @return {String} The file's owner id.
  12112. */
  12113. ownerId: function ownerId() {
  12114. return this.metaData().owner;
  12115. },
  12116. /**
  12117. * Destroy the file.
  12118. * @param {AuthOptions} options
  12119. * @return {Promise} A promise that is fulfilled when the destroy
  12120. * completes.
  12121. */
  12122. destroy: function destroy(options) {
  12123. if (!this.id) {
  12124. return _promise.default.reject(new Error('The file id does not eixst.'));
  12125. }
  12126. var request = AVRequest('files', null, this.id, 'DELETE', null, options);
  12127. return request;
  12128. },
  12129. /**
  12130. * Request Qiniu upload token
  12131. * @param {string} type
  12132. * @return {Promise} Resolved with the response
  12133. * @private
  12134. */
  12135. _fileToken: function _fileToken(type, authOptions) {
  12136. var name = this.attributes.name;
  12137. var extName = extname(name);
  12138. if (!extName && this._extName) {
  12139. name += this._extName;
  12140. extName = this._extName;
  12141. }
  12142. var data = {
  12143. name: name,
  12144. keep_file_name: authOptions.keepFileName,
  12145. key: authOptions.key,
  12146. ACL: this._acl,
  12147. mime_type: type,
  12148. metaData: this.attributes.metaData
  12149. };
  12150. return AVRequest('fileTokens', null, null, 'POST', data, authOptions);
  12151. },
  12152. /**
  12153. * @callback UploadProgressCallback
  12154. * @param {XMLHttpRequestProgressEvent} event - The progress event with 'loaded' and 'total' attributes
  12155. */
  12156. /**
  12157. * Saves the file to the AV cloud.
  12158. * @param {AuthOptions} [options] AuthOptions plus:
  12159. * @param {UploadProgressCallback} [options.onprogress] 文件上传进度,在 Node.js 中无效,回调参数说明详见 {@link UploadProgressCallback}。
  12160. * @param {boolean} [options.keepFileName = false] 保留下载文件的文件名。
  12161. * @param {string} [options.key] 指定文件的 key。设置该选项需要使用 masterKey
  12162. * @return {Promise} Promise that is resolved when the save finishes.
  12163. */
  12164. save: function save() {
  12165. var _this3 = this;
  12166. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  12167. if (this.id) {
  12168. throw new Error('File is already saved.');
  12169. }
  12170. if (!this._previousSave) {
  12171. if (this._data) {
  12172. var mimeType = this.get('mime_type');
  12173. this._previousSave = this._fileToken(mimeType, options).then(function (uploadInfo) {
  12174. if (uploadInfo.mime_type) {
  12175. mimeType = uploadInfo.mime_type;
  12176. _this3.set('mime_type', mimeType);
  12177. }
  12178. _this3._token = uploadInfo.token;
  12179. return _promise.default.resolve().then(function () {
  12180. var data = _this3._data;
  12181. if (data && data.base64) {
  12182. return parseBase64(data.base64, mimeType);
  12183. }
  12184. if (data && data.blob) {
  12185. if (!data.blob.type && mimeType) {
  12186. data.blob.type = mimeType;
  12187. }
  12188. if (!data.blob.name) {
  12189. data.blob.name = _this3.get('name');
  12190. }
  12191. return data.blob;
  12192. }
  12193. if (typeof Blob !== 'undefined' && data instanceof Blob) {
  12194. return data;
  12195. }
  12196. throw new TypeError('malformed file data');
  12197. }).then(function (data) {
  12198. var _options = _.extend({}, options); // filter out download progress events
  12199. if (options.onprogress) {
  12200. _options.onprogress = function (event) {
  12201. if (event.direction === 'download') return;
  12202. return options.onprogress(event);
  12203. };
  12204. }
  12205. switch (uploadInfo.provider) {
  12206. case 's3':
  12207. return s3(uploadInfo, data, _this3, _options);
  12208. case 'qcloud':
  12209. return cos(uploadInfo, data, _this3, _options);
  12210. case 'qiniu':
  12211. default:
  12212. return qiniu(uploadInfo, data, _this3, _options);
  12213. }
  12214. }).then(tap(function () {
  12215. return _this3._callback(true);
  12216. }), function (error) {
  12217. _this3._callback(false);
  12218. throw error;
  12219. });
  12220. });
  12221. } else if (this.attributes.url && this.attributes.metaData.__source === 'external') {
  12222. // external link file.
  12223. var data = {
  12224. name: this.attributes.name,
  12225. ACL: this._acl,
  12226. metaData: this.attributes.metaData,
  12227. mime_type: this.mimeType,
  12228. url: this.attributes.url
  12229. };
  12230. this._previousSave = AVRequest('files', null, null, 'post', data, options).then(function (response) {
  12231. _this3.id = response.objectId;
  12232. return _this3;
  12233. });
  12234. }
  12235. }
  12236. return this._previousSave;
  12237. },
  12238. _callback: function _callback(success) {
  12239. AVRequest('fileCallback', null, null, 'post', {
  12240. token: this._token,
  12241. result: success
  12242. }).catch(debug);
  12243. delete this._token;
  12244. delete this._data;
  12245. },
  12246. /**
  12247. * fetch the file from server. If the server's representation of the
  12248. * model differs from its current attributes, they will be overriden,
  12249. * @param {Object} fetchOptions Optional options to set 'keys',
  12250. * 'include' and 'includeACL' option.
  12251. * @param {AuthOptions} options
  12252. * @return {Promise} A promise that is fulfilled when the fetch
  12253. * completes.
  12254. */
  12255. fetch: function fetch(fetchOptions, options) {
  12256. if (!this.id) {
  12257. throw new Error('Cannot fetch unsaved file');
  12258. }
  12259. var request = AVRequest('files', null, this.id, 'GET', transformFetchOptions(fetchOptions), options);
  12260. return request.then(this._finishFetch.bind(this));
  12261. },
  12262. _finishFetch: function _finishFetch(response) {
  12263. var value = AV.Object.prototype.parse(response);
  12264. value.attributes = {
  12265. name: value.name,
  12266. url: value.url,
  12267. mime_type: value.mime_type,
  12268. bucket: value.bucket
  12269. };
  12270. value.attributes.metaData = value.metaData || {};
  12271. value.id = value.objectId; // clean
  12272. delete value.objectId;
  12273. delete value.metaData;
  12274. delete value.url;
  12275. delete value.name;
  12276. delete value.mime_type;
  12277. delete value.bucket;
  12278. _.extend(this, value);
  12279. return this;
  12280. },
  12281. /**
  12282. * Request file censor
  12283. * @since 4.13.0
  12284. * @return {Promise.<string>}
  12285. */
  12286. censor: function censor() {
  12287. if (!this.id) {
  12288. throw new Error('Cannot censor an unsaved file');
  12289. }
  12290. return AV.File.censor(this.id);
  12291. }
  12292. });
  12293. };
  12294. /***/ }),
  12295. /* 453 */
  12296. /***/ (function(module, exports, __webpack_require__) {
  12297. "use strict";
  12298. var _require = __webpack_require__(68),
  12299. getAdapter = _require.getAdapter;
  12300. var debug = __webpack_require__(67)('cos');
  12301. module.exports = function (uploadInfo, data, file) {
  12302. var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  12303. var url = uploadInfo.upload_url + '?sign=' + encodeURIComponent(uploadInfo.token);
  12304. var fileFormData = {
  12305. field: 'fileContent',
  12306. data: data,
  12307. name: file.attributes.name
  12308. };
  12309. var options = {
  12310. headers: file._uploadHeaders,
  12311. data: {
  12312. op: 'upload'
  12313. },
  12314. onprogress: saveOptions.onprogress
  12315. };
  12316. debug('url: %s, file: %o, options: %o', url, fileFormData, options);
  12317. var upload = getAdapter('upload');
  12318. return upload(url, fileFormData, options).then(function (response) {
  12319. debug(response.status, response.data);
  12320. if (response.ok === false) {
  12321. var error = new Error(response.status);
  12322. error.response = response;
  12323. throw error;
  12324. }
  12325. file.attributes.url = uploadInfo.url;
  12326. file._bucket = uploadInfo.bucket;
  12327. file.id = uploadInfo.objectId;
  12328. return file;
  12329. }, function (error) {
  12330. var response = error.response;
  12331. if (response) {
  12332. debug(response.status, response.data);
  12333. error.statusCode = response.status;
  12334. error.response = response.data;
  12335. }
  12336. throw error;
  12337. });
  12338. };
  12339. /***/ }),
  12340. /* 454 */
  12341. /***/ (function(module, exports, __webpack_require__) {
  12342. "use strict";
  12343. var _sliceInstanceProperty2 = __webpack_require__(87);
  12344. var _Array$from = __webpack_require__(455);
  12345. var _Symbol = __webpack_require__(240);
  12346. var _getIteratorMethod = __webpack_require__(241);
  12347. var _Reflect$construct = __webpack_require__(465);
  12348. var _interopRequireDefault = __webpack_require__(1);
  12349. var _inherits2 = _interopRequireDefault(__webpack_require__(469));
  12350. var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(491));
  12351. var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(493));
  12352. var _classCallCheck2 = _interopRequireDefault(__webpack_require__(498));
  12353. var _createClass2 = _interopRequireDefault(__webpack_require__(499));
  12354. var _stringify = _interopRequireDefault(__webpack_require__(36));
  12355. var _concat = _interopRequireDefault(__webpack_require__(30));
  12356. var _promise = _interopRequireDefault(__webpack_require__(12));
  12357. var _slice = _interopRequireDefault(__webpack_require__(87));
  12358. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
  12359. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  12360. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
  12361. function _unsupportedIterableToArray(o, minLen) { var _context8; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty2(_context8 = Object.prototype.toString.call(o)).call(_context8, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  12362. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  12363. var _require = __webpack_require__(68),
  12364. getAdapter = _require.getAdapter;
  12365. var debug = __webpack_require__(67)('leancloud:qiniu');
  12366. var ajax = __webpack_require__(108);
  12367. var btoa = __webpack_require__(500);
  12368. var SHARD_THRESHOLD = 1024 * 1024 * 64;
  12369. var CHUNK_SIZE = 1024 * 1024 * 16;
  12370. function upload(uploadInfo, data, file) {
  12371. var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  12372. // Get the uptoken to upload files to qiniu.
  12373. var uptoken = uploadInfo.token;
  12374. var url = uploadInfo.upload_url || 'https://upload.qiniup.com';
  12375. var fileFormData = {
  12376. field: 'file',
  12377. data: data,
  12378. name: file.attributes.name
  12379. };
  12380. var options = {
  12381. headers: file._uploadHeaders,
  12382. data: {
  12383. name: file.attributes.name,
  12384. key: uploadInfo.key,
  12385. token: uptoken
  12386. },
  12387. onprogress: saveOptions.onprogress
  12388. };
  12389. debug('url: %s, file: %o, options: %o', url, fileFormData, options);
  12390. var upload = getAdapter('upload');
  12391. return upload(url, fileFormData, options).then(function (response) {
  12392. debug(response.status, response.data);
  12393. if (response.ok === false) {
  12394. var message = response.status;
  12395. if (response.data) {
  12396. if (response.data.error) {
  12397. message = response.data.error;
  12398. } else {
  12399. message = (0, _stringify.default)(response.data);
  12400. }
  12401. }
  12402. var error = new Error(message);
  12403. error.response = response;
  12404. throw error;
  12405. }
  12406. file.attributes.url = uploadInfo.url;
  12407. file._bucket = uploadInfo.bucket;
  12408. file.id = uploadInfo.objectId;
  12409. return file;
  12410. }, function (error) {
  12411. var response = error.response;
  12412. if (response) {
  12413. debug(response.status, response.data);
  12414. error.statusCode = response.status;
  12415. error.response = response.data;
  12416. }
  12417. throw error;
  12418. });
  12419. }
  12420. function urlSafeBase64(string) {
  12421. var base64 = btoa(unescape(encodeURIComponent(string)));
  12422. var result = '';
  12423. var _iterator = _createForOfIteratorHelper(base64),
  12424. _step;
  12425. try {
  12426. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  12427. var ch = _step.value;
  12428. switch (ch) {
  12429. case '+':
  12430. result += '-';
  12431. break;
  12432. case '/':
  12433. result += '_';
  12434. break;
  12435. default:
  12436. result += ch;
  12437. }
  12438. }
  12439. } catch (err) {
  12440. _iterator.e(err);
  12441. } finally {
  12442. _iterator.f();
  12443. }
  12444. return result;
  12445. }
  12446. var ShardUploader = /*#__PURE__*/function () {
  12447. function ShardUploader(uploadInfo, data, file, saveOptions) {
  12448. var _context,
  12449. _context2,
  12450. _this = this;
  12451. (0, _classCallCheck2.default)(this, ShardUploader);
  12452. this.uploadInfo = uploadInfo;
  12453. this.data = data;
  12454. this.file = file;
  12455. this.size = undefined;
  12456. this.offset = 0;
  12457. this.uploadedChunks = 0;
  12458. var key = urlSafeBase64(uploadInfo.key);
  12459. var uploadURL = uploadInfo.upload_url || 'https://upload.qiniup.com';
  12460. this.baseURL = (0, _concat.default)(_context = (0, _concat.default)(_context2 = "".concat(uploadURL, "/buckets/")).call(_context2, uploadInfo.bucket, "/objects/")).call(_context, key, "/uploads");
  12461. this.upToken = 'UpToken ' + uploadInfo.token;
  12462. this.uploaded = 0;
  12463. if (saveOptions && saveOptions.onprogress) {
  12464. this.onProgress = function (_ref) {
  12465. var loaded = _ref.loaded;
  12466. loaded += _this.uploadedChunks * CHUNK_SIZE;
  12467. if (loaded <= _this.uploaded) {
  12468. return;
  12469. }
  12470. if (_this.size) {
  12471. saveOptions.onprogress({
  12472. loaded: loaded,
  12473. total: _this.size,
  12474. percent: loaded / _this.size * 100
  12475. });
  12476. } else {
  12477. saveOptions.onprogress({
  12478. loaded: loaded
  12479. });
  12480. }
  12481. _this.uploaded = loaded;
  12482. };
  12483. }
  12484. }
  12485. /**
  12486. * @returns {Promise<string>}
  12487. */
  12488. (0, _createClass2.default)(ShardUploader, [{
  12489. key: "getUploadId",
  12490. value: function getUploadId() {
  12491. return ajax({
  12492. method: 'POST',
  12493. url: this.baseURL,
  12494. headers: {
  12495. Authorization: this.upToken
  12496. }
  12497. }).then(function (res) {
  12498. return res.uploadId;
  12499. });
  12500. }
  12501. }, {
  12502. key: "getChunk",
  12503. value: function getChunk() {
  12504. throw new Error('Not implemented');
  12505. }
  12506. /**
  12507. * @param {string} uploadId
  12508. * @param {number} partNumber
  12509. * @param {any} data
  12510. * @returns {Promise<{ partNumber: number, etag: string }>}
  12511. */
  12512. }, {
  12513. key: "uploadPart",
  12514. value: function uploadPart(uploadId, partNumber, data) {
  12515. var _context3, _context4;
  12516. return ajax({
  12517. method: 'PUT',
  12518. url: (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = "".concat(this.baseURL, "/")).call(_context4, uploadId, "/")).call(_context3, partNumber),
  12519. headers: {
  12520. Authorization: this.upToken
  12521. },
  12522. data: data,
  12523. onprogress: this.onProgress
  12524. }).then(function (_ref2) {
  12525. var etag = _ref2.etag;
  12526. return {
  12527. partNumber: partNumber,
  12528. etag: etag
  12529. };
  12530. });
  12531. }
  12532. }, {
  12533. key: "stopUpload",
  12534. value: function stopUpload(uploadId) {
  12535. var _context5;
  12536. return ajax({
  12537. method: 'DELETE',
  12538. url: (0, _concat.default)(_context5 = "".concat(this.baseURL, "/")).call(_context5, uploadId),
  12539. headers: {
  12540. Authorization: this.upToken
  12541. }
  12542. });
  12543. }
  12544. }, {
  12545. key: "upload",
  12546. value: function upload() {
  12547. var _this2 = this;
  12548. var parts = [];
  12549. return this.getUploadId().then(function (uploadId) {
  12550. var uploadPart = function uploadPart() {
  12551. return _promise.default.resolve(_this2.getChunk()).then(function (chunk) {
  12552. if (!chunk) {
  12553. return;
  12554. }
  12555. var partNumber = parts.length + 1;
  12556. return _this2.uploadPart(uploadId, partNumber, chunk).then(function (part) {
  12557. parts.push(part);
  12558. _this2.uploadedChunks++;
  12559. return uploadPart();
  12560. });
  12561. }).catch(function (error) {
  12562. return _this2.stopUpload(uploadId).then(function () {
  12563. return _promise.default.reject(error);
  12564. });
  12565. });
  12566. };
  12567. return uploadPart().then(function () {
  12568. var _context6;
  12569. return ajax({
  12570. method: 'POST',
  12571. url: (0, _concat.default)(_context6 = "".concat(_this2.baseURL, "/")).call(_context6, uploadId),
  12572. headers: {
  12573. Authorization: _this2.upToken
  12574. },
  12575. data: {
  12576. parts: parts,
  12577. fname: _this2.file.attributes.name,
  12578. mimeType: _this2.file.attributes.mime_type
  12579. }
  12580. });
  12581. });
  12582. }).then(function () {
  12583. _this2.file.attributes.url = _this2.uploadInfo.url;
  12584. _this2.file._bucket = _this2.uploadInfo.bucket;
  12585. _this2.file.id = _this2.uploadInfo.objectId;
  12586. return _this2.file;
  12587. });
  12588. }
  12589. }]);
  12590. return ShardUploader;
  12591. }();
  12592. var BlobUploader = /*#__PURE__*/function (_ShardUploader) {
  12593. (0, _inherits2.default)(BlobUploader, _ShardUploader);
  12594. var _super = _createSuper(BlobUploader);
  12595. function BlobUploader(uploadInfo, data, file, saveOptions) {
  12596. var _this3;
  12597. (0, _classCallCheck2.default)(this, BlobUploader);
  12598. _this3 = _super.call(this, uploadInfo, data, file, saveOptions);
  12599. _this3.size = data.size;
  12600. return _this3;
  12601. }
  12602. /**
  12603. * @returns {Blob | null}
  12604. */
  12605. (0, _createClass2.default)(BlobUploader, [{
  12606. key: "getChunk",
  12607. value: function getChunk() {
  12608. var _context7;
  12609. if (this.offset >= this.size) {
  12610. return null;
  12611. }
  12612. var chunk = (0, _slice.default)(_context7 = this.data).call(_context7, this.offset, this.offset + CHUNK_SIZE);
  12613. this.offset += chunk.size;
  12614. return chunk;
  12615. }
  12616. }]);
  12617. return BlobUploader;
  12618. }(ShardUploader);
  12619. function isBlob(data) {
  12620. return typeof Blob !== 'undefined' && data instanceof Blob;
  12621. }
  12622. module.exports = function (uploadInfo, data, file) {
  12623. var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  12624. if (isBlob(data) && data.size >= SHARD_THRESHOLD) {
  12625. return new BlobUploader(uploadInfo, data, file, saveOptions).upload();
  12626. }
  12627. return upload(uploadInfo, data, file, saveOptions);
  12628. };
  12629. /***/ }),
  12630. /* 455 */
  12631. /***/ (function(module, exports, __webpack_require__) {
  12632. module.exports = __webpack_require__(239);
  12633. /***/ }),
  12634. /* 456 */
  12635. /***/ (function(module, exports, __webpack_require__) {
  12636. __webpack_require__(78);
  12637. __webpack_require__(457);
  12638. var path = __webpack_require__(10);
  12639. module.exports = path.Array.from;
  12640. /***/ }),
  12641. /* 457 */
  12642. /***/ (function(module, exports, __webpack_require__) {
  12643. var $ = __webpack_require__(0);
  12644. var from = __webpack_require__(458);
  12645. var checkCorrectnessOfIteration = __webpack_require__(168);
  12646. var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
  12647. // eslint-disable-next-line es-x/no-array-from -- required for testing
  12648. Array.from(iterable);
  12649. });
  12650. // `Array.from` method
  12651. // https://tc39.es/ecma262/#sec-array.from
  12652. $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
  12653. from: from
  12654. });
  12655. /***/ }),
  12656. /* 458 */
  12657. /***/ (function(module, exports, __webpack_require__) {
  12658. "use strict";
  12659. var bind = __webpack_require__(45);
  12660. var call = __webpack_require__(13);
  12661. var toObject = __webpack_require__(34);
  12662. var callWithSafeIterationClosing = __webpack_require__(459);
  12663. var isArrayIteratorMethod = __webpack_require__(156);
  12664. var isConstructor = __webpack_require__(101);
  12665. var lengthOfArrayLike = __webpack_require__(46);
  12666. var createProperty = __webpack_require__(106);
  12667. var getIterator = __webpack_require__(157);
  12668. var getIteratorMethod = __webpack_require__(99);
  12669. var $Array = Array;
  12670. // `Array.from` method implementation
  12671. // https://tc39.es/ecma262/#sec-array.from
  12672. module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  12673. var O = toObject(arrayLike);
  12674. var IS_CONSTRUCTOR = isConstructor(this);
  12675. var argumentsLength = arguments.length;
  12676. var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
  12677. var mapping = mapfn !== undefined;
  12678. if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
  12679. var iteratorMethod = getIteratorMethod(O);
  12680. var index = 0;
  12681. var length, result, step, iterator, next, value;
  12682. // if the target is not iterable or it's an array with the default iterator - use a simple case
  12683. if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
  12684. iterator = getIterator(O, iteratorMethod);
  12685. next = iterator.next;
  12686. result = IS_CONSTRUCTOR ? new this() : [];
  12687. for (;!(step = call(next, iterator)).done; index++) {
  12688. value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
  12689. createProperty(result, index, value);
  12690. }
  12691. } else {
  12692. length = lengthOfArrayLike(O);
  12693. result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
  12694. for (;length > index; index++) {
  12695. value = mapping ? mapfn(O[index], index) : O[index];
  12696. createProperty(result, index, value);
  12697. }
  12698. }
  12699. result.length = index;
  12700. return result;
  12701. };
  12702. /***/ }),
  12703. /* 459 */
  12704. /***/ (function(module, exports, __webpack_require__) {
  12705. var anObject = __webpack_require__(19);
  12706. var iteratorClose = __webpack_require__(158);
  12707. // call something on iterator step with safe closing on error
  12708. module.exports = function (iterator, fn, value, ENTRIES) {
  12709. try {
  12710. return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
  12711. } catch (error) {
  12712. iteratorClose(iterator, 'throw', error);
  12713. }
  12714. };
  12715. /***/ }),
  12716. /* 460 */
  12717. /***/ (function(module, exports, __webpack_require__) {
  12718. module.exports = __webpack_require__(461);
  12719. /***/ }),
  12720. /* 461 */
  12721. /***/ (function(module, exports, __webpack_require__) {
  12722. var parent = __webpack_require__(462);
  12723. module.exports = parent;
  12724. /***/ }),
  12725. /* 462 */
  12726. /***/ (function(module, exports, __webpack_require__) {
  12727. var parent = __webpack_require__(463);
  12728. module.exports = parent;
  12729. /***/ }),
  12730. /* 463 */
  12731. /***/ (function(module, exports, __webpack_require__) {
  12732. var parent = __webpack_require__(464);
  12733. __webpack_require__(51);
  12734. module.exports = parent;
  12735. /***/ }),
  12736. /* 464 */
  12737. /***/ (function(module, exports, __webpack_require__) {
  12738. __webpack_require__(48);
  12739. __webpack_require__(78);
  12740. var getIteratorMethod = __webpack_require__(99);
  12741. module.exports = getIteratorMethod;
  12742. /***/ }),
  12743. /* 465 */
  12744. /***/ (function(module, exports, __webpack_require__) {
  12745. module.exports = __webpack_require__(466);
  12746. /***/ }),
  12747. /* 466 */
  12748. /***/ (function(module, exports, __webpack_require__) {
  12749. var parent = __webpack_require__(467);
  12750. module.exports = parent;
  12751. /***/ }),
  12752. /* 467 */
  12753. /***/ (function(module, exports, __webpack_require__) {
  12754. __webpack_require__(468);
  12755. var path = __webpack_require__(10);
  12756. module.exports = path.Reflect.construct;
  12757. /***/ }),
  12758. /* 468 */
  12759. /***/ (function(module, exports, __webpack_require__) {
  12760. var $ = __webpack_require__(0);
  12761. var getBuiltIn = __webpack_require__(18);
  12762. var apply = __webpack_require__(69);
  12763. var bind = __webpack_require__(242);
  12764. var aConstructor = __webpack_require__(164);
  12765. var anObject = __webpack_require__(19);
  12766. var isObject = __webpack_require__(11);
  12767. var create = __webpack_require__(47);
  12768. var fails = __webpack_require__(3);
  12769. var nativeConstruct = getBuiltIn('Reflect', 'construct');
  12770. var ObjectPrototype = Object.prototype;
  12771. var push = [].push;
  12772. // `Reflect.construct` method
  12773. // https://tc39.es/ecma262/#sec-reflect.construct
  12774. // MS Edge supports only 2 arguments and argumentsList argument is optional
  12775. // FF Nightly sets third argument as `new.target`, but does not create `this` from it
  12776. var NEW_TARGET_BUG = fails(function () {
  12777. function F() { /* empty */ }
  12778. return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F);
  12779. });
  12780. var ARGS_BUG = !fails(function () {
  12781. nativeConstruct(function () { /* empty */ });
  12782. });
  12783. var FORCED = NEW_TARGET_BUG || ARGS_BUG;
  12784. $({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {
  12785. construct: function construct(Target, args /* , newTarget */) {
  12786. aConstructor(Target);
  12787. anObject(args);
  12788. var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
  12789. if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
  12790. if (Target == newTarget) {
  12791. // w/o altered newTarget, optimization for 0-4 arguments
  12792. switch (args.length) {
  12793. case 0: return new Target();
  12794. case 1: return new Target(args[0]);
  12795. case 2: return new Target(args[0], args[1]);
  12796. case 3: return new Target(args[0], args[1], args[2]);
  12797. case 4: return new Target(args[0], args[1], args[2], args[3]);
  12798. }
  12799. // w/o altered newTarget, lot of arguments case
  12800. var $args = [null];
  12801. apply(push, $args, args);
  12802. return new (apply(bind, Target, $args))();
  12803. }
  12804. // with altered newTarget, not support built-in constructors
  12805. var proto = newTarget.prototype;
  12806. var instance = create(isObject(proto) ? proto : ObjectPrototype);
  12807. var result = apply(Target, instance, args);
  12808. return isObject(result) ? result : instance;
  12809. }
  12810. });
  12811. /***/ }),
  12812. /* 469 */
  12813. /***/ (function(module, exports, __webpack_require__) {
  12814. var _Object$create = __webpack_require__(470);
  12815. var _Object$defineProperty = __webpack_require__(145);
  12816. var setPrototypeOf = __webpack_require__(480);
  12817. function _inherits(subClass, superClass) {
  12818. if (typeof superClass !== "function" && superClass !== null) {
  12819. throw new TypeError("Super expression must either be null or a function");
  12820. }
  12821. subClass.prototype = _Object$create(superClass && superClass.prototype, {
  12822. constructor: {
  12823. value: subClass,
  12824. writable: true,
  12825. configurable: true
  12826. }
  12827. });
  12828. _Object$defineProperty(subClass, "prototype", {
  12829. writable: false
  12830. });
  12831. if (superClass) setPrototypeOf(subClass, superClass);
  12832. }
  12833. module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12834. /***/ }),
  12835. /* 470 */
  12836. /***/ (function(module, exports, __webpack_require__) {
  12837. module.exports = __webpack_require__(471);
  12838. /***/ }),
  12839. /* 471 */
  12840. /***/ (function(module, exports, __webpack_require__) {
  12841. module.exports = __webpack_require__(472);
  12842. /***/ }),
  12843. /* 472 */
  12844. /***/ (function(module, exports, __webpack_require__) {
  12845. var parent = __webpack_require__(473);
  12846. module.exports = parent;
  12847. /***/ }),
  12848. /* 473 */
  12849. /***/ (function(module, exports, __webpack_require__) {
  12850. var parent = __webpack_require__(474);
  12851. module.exports = parent;
  12852. /***/ }),
  12853. /* 474 */
  12854. /***/ (function(module, exports, __webpack_require__) {
  12855. var parent = __webpack_require__(475);
  12856. module.exports = parent;
  12857. /***/ }),
  12858. /* 475 */
  12859. /***/ (function(module, exports, __webpack_require__) {
  12860. __webpack_require__(476);
  12861. var path = __webpack_require__(10);
  12862. var Object = path.Object;
  12863. module.exports = function create(P, D) {
  12864. return Object.create(P, D);
  12865. };
  12866. /***/ }),
  12867. /* 476 */
  12868. /***/ (function(module, exports, __webpack_require__) {
  12869. // TODO: Remove from `core-js@4`
  12870. var $ = __webpack_require__(0);
  12871. var DESCRIPTORS = __webpack_require__(16);
  12872. var create = __webpack_require__(47);
  12873. // `Object.create` method
  12874. // https://tc39.es/ecma262/#sec-object.create
  12875. $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
  12876. create: create
  12877. });
  12878. /***/ }),
  12879. /* 477 */
  12880. /***/ (function(module, exports, __webpack_require__) {
  12881. module.exports = __webpack_require__(478);
  12882. /***/ }),
  12883. /* 478 */
  12884. /***/ (function(module, exports, __webpack_require__) {
  12885. var parent = __webpack_require__(479);
  12886. module.exports = parent;
  12887. /***/ }),
  12888. /* 479 */
  12889. /***/ (function(module, exports, __webpack_require__) {
  12890. var parent = __webpack_require__(230);
  12891. module.exports = parent;
  12892. /***/ }),
  12893. /* 480 */
  12894. /***/ (function(module, exports, __webpack_require__) {
  12895. var _Object$setPrototypeOf = __webpack_require__(243);
  12896. var _bindInstanceProperty = __webpack_require__(244);
  12897. function _setPrototypeOf(o, p) {
  12898. var _context;
  12899. module.exports = _setPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$setPrototypeOf).call(_context) : function _setPrototypeOf(o, p) {
  12900. o.__proto__ = p;
  12901. return o;
  12902. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12903. return _setPrototypeOf(o, p);
  12904. }
  12905. module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12906. /***/ }),
  12907. /* 481 */
  12908. /***/ (function(module, exports, __webpack_require__) {
  12909. module.exports = __webpack_require__(482);
  12910. /***/ }),
  12911. /* 482 */
  12912. /***/ (function(module, exports, __webpack_require__) {
  12913. var parent = __webpack_require__(483);
  12914. module.exports = parent;
  12915. /***/ }),
  12916. /* 483 */
  12917. /***/ (function(module, exports, __webpack_require__) {
  12918. var parent = __webpack_require__(228);
  12919. module.exports = parent;
  12920. /***/ }),
  12921. /* 484 */
  12922. /***/ (function(module, exports, __webpack_require__) {
  12923. module.exports = __webpack_require__(485);
  12924. /***/ }),
  12925. /* 485 */
  12926. /***/ (function(module, exports, __webpack_require__) {
  12927. var parent = __webpack_require__(486);
  12928. module.exports = parent;
  12929. /***/ }),
  12930. /* 486 */
  12931. /***/ (function(module, exports, __webpack_require__) {
  12932. var parent = __webpack_require__(487);
  12933. module.exports = parent;
  12934. /***/ }),
  12935. /* 487 */
  12936. /***/ (function(module, exports, __webpack_require__) {
  12937. var parent = __webpack_require__(488);
  12938. module.exports = parent;
  12939. /***/ }),
  12940. /* 488 */
  12941. /***/ (function(module, exports, __webpack_require__) {
  12942. var isPrototypeOf = __webpack_require__(21);
  12943. var method = __webpack_require__(489);
  12944. var FunctionPrototype = Function.prototype;
  12945. module.exports = function (it) {
  12946. var own = it.bind;
  12947. return it === FunctionPrototype || (isPrototypeOf(FunctionPrototype, it) && own === FunctionPrototype.bind) ? method : own;
  12948. };
  12949. /***/ }),
  12950. /* 489 */
  12951. /***/ (function(module, exports, __webpack_require__) {
  12952. __webpack_require__(490);
  12953. var entryVirtual = __webpack_require__(41);
  12954. module.exports = entryVirtual('Function').bind;
  12955. /***/ }),
  12956. /* 490 */
  12957. /***/ (function(module, exports, __webpack_require__) {
  12958. // TODO: Remove from `core-js@4`
  12959. var $ = __webpack_require__(0);
  12960. var bind = __webpack_require__(242);
  12961. // `Function.prototype.bind` method
  12962. // https://tc39.es/ecma262/#sec-function.prototype.bind
  12963. $({ target: 'Function', proto: true, forced: Function.bind !== bind }, {
  12964. bind: bind
  12965. });
  12966. /***/ }),
  12967. /* 491 */
  12968. /***/ (function(module, exports, __webpack_require__) {
  12969. var _typeof = __webpack_require__(109)["default"];
  12970. var assertThisInitialized = __webpack_require__(492);
  12971. function _possibleConstructorReturn(self, call) {
  12972. if (call && (_typeof(call) === "object" || typeof call === "function")) {
  12973. return call;
  12974. } else if (call !== void 0) {
  12975. throw new TypeError("Derived constructors may only return object or undefined");
  12976. }
  12977. return assertThisInitialized(self);
  12978. }
  12979. module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12980. /***/ }),
  12981. /* 492 */
  12982. /***/ (function(module, exports) {
  12983. function _assertThisInitialized(self) {
  12984. if (self === void 0) {
  12985. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  12986. }
  12987. return self;
  12988. }
  12989. module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
  12990. /***/ }),
  12991. /* 493 */
  12992. /***/ (function(module, exports, __webpack_require__) {
  12993. var _Object$setPrototypeOf = __webpack_require__(243);
  12994. var _bindInstanceProperty = __webpack_require__(244);
  12995. var _Object$getPrototypeOf = __webpack_require__(494);
  12996. function _getPrototypeOf(o) {
  12997. var _context;
  12998. module.exports = _getPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$getPrototypeOf).call(_context) : function _getPrototypeOf(o) {
  12999. return o.__proto__ || _Object$getPrototypeOf(o);
  13000. }, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13001. return _getPrototypeOf(o);
  13002. }
  13003. module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13004. /***/ }),
  13005. /* 494 */
  13006. /***/ (function(module, exports, __webpack_require__) {
  13007. module.exports = __webpack_require__(495);
  13008. /***/ }),
  13009. /* 495 */
  13010. /***/ (function(module, exports, __webpack_require__) {
  13011. module.exports = __webpack_require__(496);
  13012. /***/ }),
  13013. /* 496 */
  13014. /***/ (function(module, exports, __webpack_require__) {
  13015. var parent = __webpack_require__(497);
  13016. module.exports = parent;
  13017. /***/ }),
  13018. /* 497 */
  13019. /***/ (function(module, exports, __webpack_require__) {
  13020. var parent = __webpack_require__(222);
  13021. module.exports = parent;
  13022. /***/ }),
  13023. /* 498 */
  13024. /***/ (function(module, exports) {
  13025. function _classCallCheck(instance, Constructor) {
  13026. if (!(instance instanceof Constructor)) {
  13027. throw new TypeError("Cannot call a class as a function");
  13028. }
  13029. }
  13030. module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13031. /***/ }),
  13032. /* 499 */
  13033. /***/ (function(module, exports, __webpack_require__) {
  13034. var _Object$defineProperty = __webpack_require__(145);
  13035. function _defineProperties(target, props) {
  13036. for (var i = 0; i < props.length; i++) {
  13037. var descriptor = props[i];
  13038. descriptor.enumerable = descriptor.enumerable || false;
  13039. descriptor.configurable = true;
  13040. if ("value" in descriptor) descriptor.writable = true;
  13041. _Object$defineProperty(target, descriptor.key, descriptor);
  13042. }
  13043. }
  13044. function _createClass(Constructor, protoProps, staticProps) {
  13045. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  13046. if (staticProps) _defineProperties(Constructor, staticProps);
  13047. _Object$defineProperty(Constructor, "prototype", {
  13048. writable: false
  13049. });
  13050. return Constructor;
  13051. }
  13052. module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
  13053. /***/ }),
  13054. /* 500 */
  13055. /***/ (function(module, exports, __webpack_require__) {
  13056. "use strict";
  13057. var _interopRequireDefault = __webpack_require__(1);
  13058. var _slice = _interopRequireDefault(__webpack_require__(87));
  13059. // base64 character set, plus padding character (=)
  13060. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  13061. module.exports = function (string) {
  13062. var result = '';
  13063. for (var i = 0; i < string.length;) {
  13064. var a = string.charCodeAt(i++);
  13065. var b = string.charCodeAt(i++);
  13066. var c = string.charCodeAt(i++);
  13067. if (a > 255 || b > 255 || c > 255) {
  13068. throw new TypeError('Failed to encode base64: The string to be encoded contains characters outside of the Latin1 range.');
  13069. }
  13070. var bitmap = a << 16 | b << 8 | c;
  13071. result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) + b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
  13072. } // To determine the final padding
  13073. var rest = string.length % 3; // If there's need of padding, replace the last 'A's with equal signs
  13074. return rest ? (0, _slice.default)(result).call(result, 0, rest - 3) + '==='.substring(rest) : result;
  13075. };
  13076. /***/ }),
  13077. /* 501 */
  13078. /***/ (function(module, exports, __webpack_require__) {
  13079. "use strict";
  13080. var _ = __webpack_require__(2);
  13081. var ajax = __webpack_require__(108);
  13082. module.exports = function upload(uploadInfo, data, file) {
  13083. var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  13084. return ajax({
  13085. url: uploadInfo.upload_url,
  13086. method: 'PUT',
  13087. data: data,
  13088. headers: _.extend({
  13089. 'Content-Type': file.get('mime_type'),
  13090. 'Cache-Control': 'public, max-age=31536000'
  13091. }, file._uploadHeaders),
  13092. onprogress: saveOptions.onprogress
  13093. }).then(function () {
  13094. file.attributes.url = uploadInfo.url;
  13095. file._bucket = uploadInfo.bucket;
  13096. file.id = uploadInfo.objectId;
  13097. return file;
  13098. });
  13099. };
  13100. /***/ }),
  13101. /* 502 */
  13102. /***/ (function(module, exports, __webpack_require__) {
  13103. (function(){
  13104. var crypt = __webpack_require__(503),
  13105. utf8 = __webpack_require__(245).utf8,
  13106. isBuffer = __webpack_require__(504),
  13107. bin = __webpack_require__(245).bin,
  13108. // The core
  13109. md5 = function (message, options) {
  13110. // Convert to byte array
  13111. if (message.constructor == String)
  13112. if (options && options.encoding === 'binary')
  13113. message = bin.stringToBytes(message);
  13114. else
  13115. message = utf8.stringToBytes(message);
  13116. else if (isBuffer(message))
  13117. message = Array.prototype.slice.call(message, 0);
  13118. else if (!Array.isArray(message))
  13119. message = message.toString();
  13120. // else, assume byte array already
  13121. var m = crypt.bytesToWords(message),
  13122. l = message.length * 8,
  13123. a = 1732584193,
  13124. b = -271733879,
  13125. c = -1732584194,
  13126. d = 271733878;
  13127. // Swap endian
  13128. for (var i = 0; i < m.length; i++) {
  13129. m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
  13130. ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
  13131. }
  13132. // Padding
  13133. m[l >>> 5] |= 0x80 << (l % 32);
  13134. m[(((l + 64) >>> 9) << 4) + 14] = l;
  13135. // Method shortcuts
  13136. var FF = md5._ff,
  13137. GG = md5._gg,
  13138. HH = md5._hh,
  13139. II = md5._ii;
  13140. for (var i = 0; i < m.length; i += 16) {
  13141. var aa = a,
  13142. bb = b,
  13143. cc = c,
  13144. dd = d;
  13145. a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
  13146. d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
  13147. c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
  13148. b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
  13149. a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
  13150. d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
  13151. c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
  13152. b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
  13153. a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
  13154. d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
  13155. c = FF(c, d, a, b, m[i+10], 17, -42063);
  13156. b = FF(b, c, d, a, m[i+11], 22, -1990404162);
  13157. a = FF(a, b, c, d, m[i+12], 7, 1804603682);
  13158. d = FF(d, a, b, c, m[i+13], 12, -40341101);
  13159. c = FF(c, d, a, b, m[i+14], 17, -1502002290);
  13160. b = FF(b, c, d, a, m[i+15], 22, 1236535329);
  13161. a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
  13162. d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
  13163. c = GG(c, d, a, b, m[i+11], 14, 643717713);
  13164. b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
  13165. a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
  13166. d = GG(d, a, b, c, m[i+10], 9, 38016083);
  13167. c = GG(c, d, a, b, m[i+15], 14, -660478335);
  13168. b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
  13169. a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
  13170. d = GG(d, a, b, c, m[i+14], 9, -1019803690);
  13171. c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
  13172. b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
  13173. a = GG(a, b, c, d, m[i+13], 5, -1444681467);
  13174. d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
  13175. c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
  13176. b = GG(b, c, d, a, m[i+12], 20, -1926607734);
  13177. a = HH(a, b, c, d, m[i+ 5], 4, -378558);
  13178. d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
  13179. c = HH(c, d, a, b, m[i+11], 16, 1839030562);
  13180. b = HH(b, c, d, a, m[i+14], 23, -35309556);
  13181. a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
  13182. d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
  13183. c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
  13184. b = HH(b, c, d, a, m[i+10], 23, -1094730640);
  13185. a = HH(a, b, c, d, m[i+13], 4, 681279174);
  13186. d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
  13187. c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
  13188. b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
  13189. a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
  13190. d = HH(d, a, b, c, m[i+12], 11, -421815835);
  13191. c = HH(c, d, a, b, m[i+15], 16, 530742520);
  13192. b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
  13193. a = II(a, b, c, d, m[i+ 0], 6, -198630844);
  13194. d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
  13195. c = II(c, d, a, b, m[i+14], 15, -1416354905);
  13196. b = II(b, c, d, a, m[i+ 5], 21, -57434055);
  13197. a = II(a, b, c, d, m[i+12], 6, 1700485571);
  13198. d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
  13199. c = II(c, d, a, b, m[i+10], 15, -1051523);
  13200. b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
  13201. a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
  13202. d = II(d, a, b, c, m[i+15], 10, -30611744);
  13203. c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
  13204. b = II(b, c, d, a, m[i+13], 21, 1309151649);
  13205. a = II(a, b, c, d, m[i+ 4], 6, -145523070);
  13206. d = II(d, a, b, c, m[i+11], 10, -1120210379);
  13207. c = II(c, d, a, b, m[i+ 2], 15, 718787259);
  13208. b = II(b, c, d, a, m[i+ 9], 21, -343485551);
  13209. a = (a + aa) >>> 0;
  13210. b = (b + bb) >>> 0;
  13211. c = (c + cc) >>> 0;
  13212. d = (d + dd) >>> 0;
  13213. }
  13214. return crypt.endian([a, b, c, d]);
  13215. };
  13216. // Auxiliary functions
  13217. md5._ff = function (a, b, c, d, x, s, t) {
  13218. var n = a + (b & c | ~b & d) + (x >>> 0) + t;
  13219. return ((n << s) | (n >>> (32 - s))) + b;
  13220. };
  13221. md5._gg = function (a, b, c, d, x, s, t) {
  13222. var n = a + (b & d | c & ~d) + (x >>> 0) + t;
  13223. return ((n << s) | (n >>> (32 - s))) + b;
  13224. };
  13225. md5._hh = function (a, b, c, d, x, s, t) {
  13226. var n = a + (b ^ c ^ d) + (x >>> 0) + t;
  13227. return ((n << s) | (n >>> (32 - s))) + b;
  13228. };
  13229. md5._ii = function (a, b, c, d, x, s, t) {
  13230. var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
  13231. return ((n << s) | (n >>> (32 - s))) + b;
  13232. };
  13233. // Package private blocksize
  13234. md5._blocksize = 16;
  13235. md5._digestsize = 16;
  13236. module.exports = function (message, options) {
  13237. if (message === undefined || message === null)
  13238. throw new Error('Illegal argument ' + message);
  13239. var digestbytes = crypt.wordsToBytes(md5(message, options));
  13240. return options && options.asBytes ? digestbytes :
  13241. options && options.asString ? bin.bytesToString(digestbytes) :
  13242. crypt.bytesToHex(digestbytes);
  13243. };
  13244. })();
  13245. /***/ }),
  13246. /* 503 */
  13247. /***/ (function(module, exports) {
  13248. (function() {
  13249. var base64map
  13250. = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
  13251. crypt = {
  13252. // Bit-wise rotation left
  13253. rotl: function(n, b) {
  13254. return (n << b) | (n >>> (32 - b));
  13255. },
  13256. // Bit-wise rotation right
  13257. rotr: function(n, b) {
  13258. return (n << (32 - b)) | (n >>> b);
  13259. },
  13260. // Swap big-endian to little-endian and vice versa
  13261. endian: function(n) {
  13262. // If number given, swap endian
  13263. if (n.constructor == Number) {
  13264. return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
  13265. }
  13266. // Else, assume array and swap all items
  13267. for (var i = 0; i < n.length; i++)
  13268. n[i] = crypt.endian(n[i]);
  13269. return n;
  13270. },
  13271. // Generate an array of any length of random bytes
  13272. randomBytes: function(n) {
  13273. for (var bytes = []; n > 0; n--)
  13274. bytes.push(Math.floor(Math.random() * 256));
  13275. return bytes;
  13276. },
  13277. // Convert a byte array to big-endian 32-bit words
  13278. bytesToWords: function(bytes) {
  13279. for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
  13280. words[b >>> 5] |= bytes[i] << (24 - b % 32);
  13281. return words;
  13282. },
  13283. // Convert big-endian 32-bit words to a byte array
  13284. wordsToBytes: function(words) {
  13285. for (var bytes = [], b = 0; b < words.length * 32; b += 8)
  13286. bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
  13287. return bytes;
  13288. },
  13289. // Convert a byte array to a hex string
  13290. bytesToHex: function(bytes) {
  13291. for (var hex = [], i = 0; i < bytes.length; i++) {
  13292. hex.push((bytes[i] >>> 4).toString(16));
  13293. hex.push((bytes[i] & 0xF).toString(16));
  13294. }
  13295. return hex.join('');
  13296. },
  13297. // Convert a hex string to a byte array
  13298. hexToBytes: function(hex) {
  13299. for (var bytes = [], c = 0; c < hex.length; c += 2)
  13300. bytes.push(parseInt(hex.substr(c, 2), 16));
  13301. return bytes;
  13302. },
  13303. // Convert a byte array to a base-64 string
  13304. bytesToBase64: function(bytes) {
  13305. for (var base64 = [], i = 0; i < bytes.length; i += 3) {
  13306. var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
  13307. for (var j = 0; j < 4; j++)
  13308. if (i * 8 + j * 6 <= bytes.length * 8)
  13309. base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
  13310. else
  13311. base64.push('=');
  13312. }
  13313. return base64.join('');
  13314. },
  13315. // Convert a base-64 string to a byte array
  13316. base64ToBytes: function(base64) {
  13317. // Remove non-base-64 characters
  13318. base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
  13319. for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
  13320. imod4 = ++i % 4) {
  13321. if (imod4 == 0) continue;
  13322. bytes.push(((base64map.indexOf(base64.charAt(i - 1))
  13323. & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
  13324. | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
  13325. }
  13326. return bytes;
  13327. }
  13328. };
  13329. module.exports = crypt;
  13330. })();
  13331. /***/ }),
  13332. /* 504 */
  13333. /***/ (function(module, exports) {
  13334. /*!
  13335. * Determine if an object is a Buffer
  13336. *
  13337. * @author Feross Aboukhadijeh <https://feross.org>
  13338. * @license MIT
  13339. */
  13340. // The _isBuffer check is for Safari 5-7 support, because it's missing
  13341. // Object.prototype.constructor. Remove this eventually
  13342. module.exports = function (obj) {
  13343. return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
  13344. }
  13345. function isBuffer (obj) {
  13346. return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
  13347. }
  13348. // For Node v0.10 support. Remove this eventually.
  13349. function isSlowBuffer (obj) {
  13350. return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
  13351. }
  13352. /***/ }),
  13353. /* 505 */
  13354. /***/ (function(module, exports, __webpack_require__) {
  13355. "use strict";
  13356. var _interopRequireDefault = __webpack_require__(1);
  13357. var _indexOf = _interopRequireDefault(__webpack_require__(86));
  13358. var dataURItoBlob = function dataURItoBlob(dataURI, type) {
  13359. var _context;
  13360. var byteString; // 传入的 base64,不是 dataURL
  13361. if ((0, _indexOf.default)(dataURI).call(dataURI, 'base64') < 0) {
  13362. byteString = atob(dataURI);
  13363. } else if ((0, _indexOf.default)(_context = dataURI.split(',')[0]).call(_context, 'base64') >= 0) {
  13364. type = type || dataURI.split(',')[0].split(':')[1].split(';')[0];
  13365. byteString = atob(dataURI.split(',')[1]);
  13366. } else {
  13367. byteString = unescape(dataURI.split(',')[1]);
  13368. }
  13369. var ia = new Uint8Array(byteString.length);
  13370. for (var i = 0; i < byteString.length; i++) {
  13371. ia[i] = byteString.charCodeAt(i);
  13372. }
  13373. return new Blob([ia], {
  13374. type: type
  13375. });
  13376. };
  13377. module.exports = dataURItoBlob;
  13378. /***/ }),
  13379. /* 506 */
  13380. /***/ (function(module, exports, __webpack_require__) {
  13381. "use strict";
  13382. var _interopRequireDefault = __webpack_require__(1);
  13383. var _slicedToArray2 = _interopRequireDefault(__webpack_require__(507));
  13384. var _map = _interopRequireDefault(__webpack_require__(42));
  13385. var _indexOf = _interopRequireDefault(__webpack_require__(86));
  13386. var _find = _interopRequireDefault(__webpack_require__(110));
  13387. var _promise = _interopRequireDefault(__webpack_require__(12));
  13388. var _concat = _interopRequireDefault(__webpack_require__(30));
  13389. var _keys2 = _interopRequireDefault(__webpack_require__(55));
  13390. var _stringify = _interopRequireDefault(__webpack_require__(36));
  13391. var _defineProperty = _interopRequireDefault(__webpack_require__(143));
  13392. var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(246));
  13393. var _ = __webpack_require__(2);
  13394. var AVError = __webpack_require__(43);
  13395. var _require = __webpack_require__(26),
  13396. _request = _require._request;
  13397. var _require2 = __webpack_require__(29),
  13398. isNullOrUndefined = _require2.isNullOrUndefined,
  13399. ensureArray = _require2.ensureArray,
  13400. transformFetchOptions = _require2.transformFetchOptions,
  13401. setValue = _require2.setValue,
  13402. findValue = _require2.findValue,
  13403. isPlainObject = _require2.isPlainObject,
  13404. continueWhile = _require2.continueWhile;
  13405. var recursiveToPointer = function recursiveToPointer(value) {
  13406. if (_.isArray(value)) return (0, _map.default)(value).call(value, recursiveToPointer);
  13407. if (isPlainObject(value)) return _.mapObject(value, recursiveToPointer);
  13408. if (_.isObject(value) && value._toPointer) return value._toPointer();
  13409. return value;
  13410. };
  13411. var RESERVED_KEYS = ['objectId', 'createdAt', 'updatedAt'];
  13412. var checkReservedKey = function checkReservedKey(key) {
  13413. if ((0, _indexOf.default)(RESERVED_KEYS).call(RESERVED_KEYS, key) !== -1) {
  13414. throw new Error("key[".concat(key, "] is reserved"));
  13415. }
  13416. };
  13417. var handleBatchResults = function handleBatchResults(results) {
  13418. var firstError = (0, _find.default)(_).call(_, results, function (result) {
  13419. return result instanceof Error;
  13420. });
  13421. if (!firstError) {
  13422. return results;
  13423. }
  13424. var error = new AVError(firstError.code, firstError.message);
  13425. error.results = results;
  13426. throw error;
  13427. }; // Helper function to get a value from a Backbone object as a property
  13428. // or as a function.
  13429. function getValue(object, prop) {
  13430. if (!(object && object[prop])) {
  13431. return null;
  13432. }
  13433. return _.isFunction(object[prop]) ? object[prop]() : object[prop];
  13434. } // AV.Object is analogous to the Java AVObject.
  13435. // It also implements the same interface as a Backbone model.
  13436. module.exports = function (AV) {
  13437. /**
  13438. * Creates a new model with defined attributes. A client id (cid) is
  13439. * automatically generated and assigned for you.
  13440. *
  13441. * <p>You won't normally call this method directly. It is recommended that
  13442. * you use a subclass of <code>AV.Object</code> instead, created by calling
  13443. * <code>extend</code>.</p>
  13444. *
  13445. * <p>However, if you don't want to use a subclass, or aren't sure which
  13446. * subclass is appropriate, you can use this form:<pre>
  13447. * var object = new AV.Object("ClassName");
  13448. * </pre>
  13449. * That is basically equivalent to:<pre>
  13450. * var MyClass = AV.Object.extend("ClassName");
  13451. * var object = new MyClass();
  13452. * </pre></p>
  13453. *
  13454. * @param {Object} attributes The initial set of data to store in the object.
  13455. * @param {Object} options A set of Backbone-like options for creating the
  13456. * object. The only option currently supported is "collection".
  13457. * @see AV.Object.extend
  13458. *
  13459. * @class
  13460. *
  13461. * <p>The fundamental unit of AV data, which implements the Backbone Model
  13462. * interface.</p>
  13463. */
  13464. AV.Object = function (attributes, options) {
  13465. // Allow new AV.Object("ClassName") as a shortcut to _create.
  13466. if (_.isString(attributes)) {
  13467. return AV.Object._create.apply(this, arguments);
  13468. }
  13469. attributes = attributes || {};
  13470. if (options && options.parse) {
  13471. attributes = this.parse(attributes);
  13472. attributes = this._mergeMagicFields(attributes);
  13473. }
  13474. var defaults = getValue(this, 'defaults');
  13475. if (defaults) {
  13476. attributes = _.extend({}, defaults, attributes);
  13477. }
  13478. if (options && options.collection) {
  13479. this.collection = options.collection;
  13480. }
  13481. this._serverData = {}; // The last known data for this object from cloud.
  13482. this._opSetQueue = [{}]; // List of sets of changes to the data.
  13483. this._flags = {};
  13484. this.attributes = {}; // The best estimate of this's current data.
  13485. this._hashedJSON = {}; // Hash of values of containers at last save.
  13486. this._escapedAttributes = {};
  13487. this.cid = _.uniqueId('c');
  13488. this.changed = {};
  13489. this._silent = {};
  13490. this._pending = {};
  13491. this.set(attributes, {
  13492. silent: true
  13493. });
  13494. this.changed = {};
  13495. this._silent = {};
  13496. this._pending = {};
  13497. this._hasData = true;
  13498. this._previousAttributes = _.clone(this.attributes);
  13499. this.initialize.apply(this, arguments);
  13500. };
  13501. /**
  13502. * @lends AV.Object.prototype
  13503. * @property {String} id The objectId of the AV Object.
  13504. */
  13505. /**
  13506. * Saves the given list of AV.Object.
  13507. * If any error is encountered, stops and calls the error handler.
  13508. *
  13509. * @example
  13510. * AV.Object.saveAll([object1, object2, ...]).then(function(list) {
  13511. * // All the objects were saved.
  13512. * }, function(error) {
  13513. * // An error occurred while saving one of the objects.
  13514. * });
  13515. *
  13516. * @param {Array} list A list of <code>AV.Object</code>.
  13517. */
  13518. AV.Object.saveAll = function (list, options) {
  13519. return AV.Object._deepSaveAsync(list, null, options);
  13520. };
  13521. /**
  13522. * Fetch the given list of AV.Object.
  13523. *
  13524. * @param {AV.Object[]} objects A list of <code>AV.Object</code>
  13525. * @param {AuthOptions} options
  13526. * @return {Promise.<AV.Object[]>} The given list of <code>AV.Object</code>, updated
  13527. */
  13528. AV.Object.fetchAll = function (objects, options) {
  13529. return _promise.default.resolve().then(function () {
  13530. return _request('batch', null, null, 'POST', {
  13531. requests: (0, _map.default)(_).call(_, objects, function (object) {
  13532. var _context;
  13533. if (!object.className) throw new Error('object must have className to fetch');
  13534. if (!object.id) throw new Error('object must have id to fetch');
  13535. if (object.dirty()) throw new Error('object is modified but not saved');
  13536. return {
  13537. method: 'GET',
  13538. path: (0, _concat.default)(_context = "/1.1/classes/".concat(object.className, "/")).call(_context, object.id)
  13539. };
  13540. })
  13541. }, options);
  13542. }).then(function (response) {
  13543. var results = (0, _map.default)(_).call(_, objects, function (object, i) {
  13544. if (response[i].success) {
  13545. var fetchedAttrs = object.parse(response[i].success);
  13546. object._cleanupUnsetKeys(fetchedAttrs);
  13547. object._finishFetch(fetchedAttrs);
  13548. return object;
  13549. }
  13550. if (response[i].success === null) {
  13551. return new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
  13552. }
  13553. return new AVError(response[i].error.code, response[i].error.error);
  13554. });
  13555. return handleBatchResults(results);
  13556. });
  13557. }; // Attach all inheritable methods to the AV.Object prototype.
  13558. _.extend(AV.Object.prototype, AV.Events,
  13559. /** @lends AV.Object.prototype */
  13560. {
  13561. _fetchWhenSave: false,
  13562. /**
  13563. * Initialize is an empty function by default. Override it with your own
  13564. * initialization logic.
  13565. */
  13566. initialize: function initialize() {},
  13567. /**
  13568. * Set whether to enable fetchWhenSave option when updating object.
  13569. * When set true, SDK would fetch the latest object after saving.
  13570. * Default is false.
  13571. *
  13572. * @deprecated use AV.Object#save with options.fetchWhenSave instead
  13573. * @param {boolean} enable true to enable fetchWhenSave option.
  13574. */
  13575. fetchWhenSave: function fetchWhenSave(enable) {
  13576. console.warn('AV.Object#fetchWhenSave is deprecated, use AV.Object#save with options.fetchWhenSave instead.');
  13577. if (!_.isBoolean(enable)) {
  13578. throw new Error('Expect boolean value for fetchWhenSave');
  13579. }
  13580. this._fetchWhenSave = enable;
  13581. },
  13582. /**
  13583. * Returns the object's objectId.
  13584. * @return {String} the objectId.
  13585. */
  13586. getObjectId: function getObjectId() {
  13587. return this.id;
  13588. },
  13589. /**
  13590. * Returns the object's createdAt attribute.
  13591. * @return {Date}
  13592. */
  13593. getCreatedAt: function getCreatedAt() {
  13594. return this.createdAt;
  13595. },
  13596. /**
  13597. * Returns the object's updatedAt attribute.
  13598. * @return {Date}
  13599. */
  13600. getUpdatedAt: function getUpdatedAt() {
  13601. return this.updatedAt;
  13602. },
  13603. /**
  13604. * Returns a JSON version of the object.
  13605. * @return {Object}
  13606. */
  13607. toJSON: function toJSON(key, holder) {
  13608. var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
  13609. return this._toFullJSON(seenObjects, false);
  13610. },
  13611. /**
  13612. * Returns a JSON version of the object with meta data.
  13613. * Inverse to {@link AV.parseJSON}
  13614. * @since 3.0.0
  13615. * @return {Object}
  13616. */
  13617. toFullJSON: function toFullJSON() {
  13618. var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  13619. return this._toFullJSON(seenObjects);
  13620. },
  13621. _toFullJSON: function _toFullJSON(seenObjects) {
  13622. var _this = this;
  13623. var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  13624. var json = _.clone(this.attributes);
  13625. if (_.isArray(seenObjects)) {
  13626. var newSeenObjects = (0, _concat.default)(seenObjects).call(seenObjects, this);
  13627. }
  13628. AV._objectEach(json, function (val, key) {
  13629. json[key] = AV._encode(val, newSeenObjects, undefined, full);
  13630. });
  13631. AV._objectEach(this._operations, function (val, key) {
  13632. json[key] = val;
  13633. });
  13634. if (_.has(this, 'id')) {
  13635. json.objectId = this.id;
  13636. }
  13637. ['createdAt', 'updatedAt'].forEach(function (key) {
  13638. if (_.has(_this, key)) {
  13639. var val = _this[key];
  13640. json[key] = _.isDate(val) ? val.toJSON() : val;
  13641. }
  13642. });
  13643. if (full) {
  13644. json.__type = 'Object';
  13645. if (_.isArray(seenObjects) && seenObjects.length) json.__type = 'Pointer';
  13646. json.className = this.className;
  13647. }
  13648. return json;
  13649. },
  13650. /**
  13651. * Updates _hashedJSON to reflect the current state of this object.
  13652. * Adds any changed hash values to the set of pending changes.
  13653. * @private
  13654. */
  13655. _refreshCache: function _refreshCache() {
  13656. var self = this;
  13657. if (self._refreshingCache) {
  13658. return;
  13659. }
  13660. self._refreshingCache = true;
  13661. AV._objectEach(this.attributes, function (value, key) {
  13662. if (value instanceof AV.Object) {
  13663. value._refreshCache();
  13664. } else if (_.isObject(value)) {
  13665. if (self._resetCacheForKey(key)) {
  13666. self.set(key, new AV.Op.Set(value), {
  13667. silent: true
  13668. });
  13669. }
  13670. }
  13671. });
  13672. delete self._refreshingCache;
  13673. },
  13674. /**
  13675. * Returns true if this object has been modified since its last
  13676. * save/refresh. If an attribute is specified, it returns true only if that
  13677. * particular attribute has been modified since the last save/refresh.
  13678. * @param {String} attr An attribute name (optional).
  13679. * @return {Boolean}
  13680. */
  13681. dirty: function dirty(attr) {
  13682. this._refreshCache();
  13683. var currentChanges = _.last(this._opSetQueue);
  13684. if (attr) {
  13685. return currentChanges[attr] ? true : false;
  13686. }
  13687. if (!this.id) {
  13688. return true;
  13689. }
  13690. if ((0, _keys2.default)(_).call(_, currentChanges).length > 0) {
  13691. return true;
  13692. }
  13693. return false;
  13694. },
  13695. /**
  13696. * Returns the keys of the modified attribute since its last save/refresh.
  13697. * @return {String[]}
  13698. */
  13699. dirtyKeys: function dirtyKeys() {
  13700. this._refreshCache();
  13701. var currentChanges = _.last(this._opSetQueue);
  13702. return (0, _keys2.default)(_).call(_, currentChanges);
  13703. },
  13704. /**
  13705. * Gets a Pointer referencing this Object.
  13706. * @private
  13707. */
  13708. _toPointer: function _toPointer() {
  13709. // if (!this.id) {
  13710. // throw new Error("Can't serialize an unsaved AV.Object");
  13711. // }
  13712. return {
  13713. __type: 'Pointer',
  13714. className: this.className,
  13715. objectId: this.id
  13716. };
  13717. },
  13718. /**
  13719. * Gets the value of an attribute.
  13720. * @param {String} attr The string name of an attribute.
  13721. */
  13722. get: function get(attr) {
  13723. switch (attr) {
  13724. case 'objectId':
  13725. return this.id;
  13726. case 'createdAt':
  13727. case 'updatedAt':
  13728. return this[attr];
  13729. default:
  13730. return this.attributes[attr];
  13731. }
  13732. },
  13733. /**
  13734. * Gets a relation on the given class for the attribute.
  13735. * @param {String} attr The attribute to get the relation for.
  13736. * @return {AV.Relation}
  13737. */
  13738. relation: function relation(attr) {
  13739. var value = this.get(attr);
  13740. if (value) {
  13741. if (!(value instanceof AV.Relation)) {
  13742. throw new Error('Called relation() on non-relation field ' + attr);
  13743. }
  13744. value._ensureParentAndKey(this, attr);
  13745. return value;
  13746. } else {
  13747. return new AV.Relation(this, attr);
  13748. }
  13749. },
  13750. /**
  13751. * Gets the HTML-escaped value of an attribute.
  13752. */
  13753. escape: function escape(attr) {
  13754. var html = this._escapedAttributes[attr];
  13755. if (html) {
  13756. return html;
  13757. }
  13758. var val = this.attributes[attr];
  13759. var escaped;
  13760. if (isNullOrUndefined(val)) {
  13761. escaped = '';
  13762. } else {
  13763. escaped = _.escape(val.toString());
  13764. }
  13765. this._escapedAttributes[attr] = escaped;
  13766. return escaped;
  13767. },
  13768. /**
  13769. * Returns <code>true</code> if the attribute contains a value that is not
  13770. * null or undefined.
  13771. * @param {String} attr The string name of the attribute.
  13772. * @return {Boolean}
  13773. */
  13774. has: function has(attr) {
  13775. return !isNullOrUndefined(this.attributes[attr]);
  13776. },
  13777. /**
  13778. * Pulls "special" fields like objectId, createdAt, etc. out of attrs
  13779. * and puts them on "this" directly. Removes them from attrs.
  13780. * @param attrs - A dictionary with the data for this AV.Object.
  13781. * @private
  13782. */
  13783. _mergeMagicFields: function _mergeMagicFields(attrs) {
  13784. // Check for changes of magic fields.
  13785. var model = this;
  13786. var specialFields = ['objectId', 'createdAt', 'updatedAt'];
  13787. AV._arrayEach(specialFields, function (attr) {
  13788. if (attrs[attr]) {
  13789. if (attr === 'objectId') {
  13790. model.id = attrs[attr];
  13791. } else if ((attr === 'createdAt' || attr === 'updatedAt') && !_.isDate(attrs[attr])) {
  13792. model[attr] = AV._parseDate(attrs[attr]);
  13793. } else {
  13794. model[attr] = attrs[attr];
  13795. }
  13796. delete attrs[attr];
  13797. }
  13798. });
  13799. return attrs;
  13800. },
  13801. /**
  13802. * Returns the json to be sent to the server.
  13803. * @private
  13804. */
  13805. _startSave: function _startSave() {
  13806. this._opSetQueue.push({});
  13807. },
  13808. /**
  13809. * Called when a save fails because of an error. Any changes that were part
  13810. * of the save need to be merged with changes made after the save. This
  13811. * might throw an exception is you do conflicting operations. For example,
  13812. * if you do:
  13813. * object.set("foo", "bar");
  13814. * object.set("invalid field name", "baz");
  13815. * object.save();
  13816. * object.increment("foo");
  13817. * then this will throw when the save fails and the client tries to merge
  13818. * "bar" with the +1.
  13819. * @private
  13820. */
  13821. _cancelSave: function _cancelSave() {
  13822. var failedChanges = _.first(this._opSetQueue);
  13823. this._opSetQueue = _.rest(this._opSetQueue);
  13824. var nextChanges = _.first(this._opSetQueue);
  13825. AV._objectEach(failedChanges, function (op, key) {
  13826. var op1 = failedChanges[key];
  13827. var op2 = nextChanges[key];
  13828. if (op1 && op2) {
  13829. nextChanges[key] = op2._mergeWithPrevious(op1);
  13830. } else if (op1) {
  13831. nextChanges[key] = op1;
  13832. }
  13833. });
  13834. this._saving = this._saving - 1;
  13835. },
  13836. /**
  13837. * Called when a save completes successfully. This merges the changes that
  13838. * were saved into the known server data, and overrides it with any data
  13839. * sent directly from the server.
  13840. * @private
  13841. */
  13842. _finishSave: function _finishSave(serverData) {
  13843. var _context2;
  13844. // Grab a copy of any object referenced by this object. These instances
  13845. // may have already been fetched, and we don't want to lose their data.
  13846. // Note that doing it like this means we will unify separate copies of the
  13847. // same object, but that's a risk we have to take.
  13848. var fetchedObjects = {};
  13849. AV._traverse(this.attributes, function (object) {
  13850. if (object instanceof AV.Object && object.id && object._hasData) {
  13851. fetchedObjects[object.id] = object;
  13852. }
  13853. });
  13854. var savedChanges = _.first(this._opSetQueue);
  13855. this._opSetQueue = _.rest(this._opSetQueue);
  13856. this._applyOpSet(savedChanges, this._serverData);
  13857. this._mergeMagicFields(serverData);
  13858. var self = this;
  13859. AV._objectEach(serverData, function (value, key) {
  13860. self._serverData[key] = AV._decode(value, key); // Look for any objects that might have become unfetched and fix them
  13861. // by replacing their values with the previously observed values.
  13862. var fetched = AV._traverse(self._serverData[key], function (object) {
  13863. if (object instanceof AV.Object && fetchedObjects[object.id]) {
  13864. return fetchedObjects[object.id];
  13865. }
  13866. });
  13867. if (fetched) {
  13868. self._serverData[key] = fetched;
  13869. }
  13870. });
  13871. this._rebuildAllEstimatedData();
  13872. var opSetQueue = (0, _map.default)(_context2 = this._opSetQueue).call(_context2, _.clone);
  13873. this._refreshCache();
  13874. this._opSetQueue = opSetQueue;
  13875. this._saving = this._saving - 1;
  13876. },
  13877. /**
  13878. * Called when a fetch or login is complete to set the known server data to
  13879. * the given object.
  13880. * @private
  13881. */
  13882. _finishFetch: function _finishFetch(serverData, hasData) {
  13883. // Clear out any changes the user might have made previously.
  13884. this._opSetQueue = [{}]; // Bring in all the new server data.
  13885. this._mergeMagicFields(serverData);
  13886. var self = this;
  13887. AV._objectEach(serverData, function (value, key) {
  13888. self._serverData[key] = AV._decode(value, key);
  13889. }); // Refresh the attributes.
  13890. this._rebuildAllEstimatedData(); // Clear out the cache of mutable containers.
  13891. this._refreshCache();
  13892. this._opSetQueue = [{}];
  13893. this._hasData = hasData;
  13894. },
  13895. /**
  13896. * Applies the set of AV.Op in opSet to the object target.
  13897. * @private
  13898. */
  13899. _applyOpSet: function _applyOpSet(opSet, target) {
  13900. var self = this;
  13901. AV._objectEach(opSet, function (change, key) {
  13902. var _findValue = findValue(target, key),
  13903. _findValue2 = (0, _slicedToArray2.default)(_findValue, 3),
  13904. value = _findValue2[0],
  13905. actualTarget = _findValue2[1],
  13906. actualKey = _findValue2[2];
  13907. setValue(target, key, change._estimate(value, self, key));
  13908. if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
  13909. delete actualTarget[actualKey];
  13910. }
  13911. });
  13912. },
  13913. /**
  13914. * Replaces the cached value for key with the current value.
  13915. * Returns true if the new value is different than the old value.
  13916. * @private
  13917. */
  13918. _resetCacheForKey: function _resetCacheForKey(key) {
  13919. var value = this.attributes[key];
  13920. if (_.isObject(value) && !(value instanceof AV.Object) && !(value instanceof AV.File)) {
  13921. var json = (0, _stringify.default)(recursiveToPointer(value));
  13922. if (this._hashedJSON[key] !== json) {
  13923. var wasSet = !!this._hashedJSON[key];
  13924. this._hashedJSON[key] = json;
  13925. return wasSet;
  13926. }
  13927. }
  13928. return false;
  13929. },
  13930. /**
  13931. * Populates attributes[key] by starting with the last known data from the
  13932. * server, and applying all of the local changes that have been made to that
  13933. * key since then.
  13934. * @private
  13935. */
  13936. _rebuildEstimatedDataForKey: function _rebuildEstimatedDataForKey(key) {
  13937. var self = this;
  13938. delete this.attributes[key];
  13939. if (this._serverData[key]) {
  13940. this.attributes[key] = this._serverData[key];
  13941. }
  13942. AV._arrayEach(this._opSetQueue, function (opSet) {
  13943. var op = opSet[key];
  13944. if (op) {
  13945. var _findValue3 = findValue(self.attributes, key),
  13946. _findValue4 = (0, _slicedToArray2.default)(_findValue3, 4),
  13947. value = _findValue4[0],
  13948. actualTarget = _findValue4[1],
  13949. actualKey = _findValue4[2],
  13950. firstKey = _findValue4[3];
  13951. setValue(self.attributes, key, op._estimate(value, self, key));
  13952. if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
  13953. delete actualTarget[actualKey];
  13954. }
  13955. self._resetCacheForKey(firstKey);
  13956. }
  13957. });
  13958. },
  13959. /**
  13960. * Populates attributes by starting with the last known data from the
  13961. * server, and applying all of the local changes that have been made since
  13962. * then.
  13963. * @private
  13964. */
  13965. _rebuildAllEstimatedData: function _rebuildAllEstimatedData() {
  13966. var self = this;
  13967. var previousAttributes = _.clone(this.attributes);
  13968. this.attributes = _.clone(this._serverData);
  13969. AV._arrayEach(this._opSetQueue, function (opSet) {
  13970. self._applyOpSet(opSet, self.attributes);
  13971. AV._objectEach(opSet, function (op, key) {
  13972. self._resetCacheForKey(key);
  13973. });
  13974. }); // Trigger change events for anything that changed because of the fetch.
  13975. AV._objectEach(previousAttributes, function (oldValue, key) {
  13976. if (self.attributes[key] !== oldValue) {
  13977. self.trigger('change:' + key, self, self.attributes[key], {});
  13978. }
  13979. });
  13980. AV._objectEach(this.attributes, function (newValue, key) {
  13981. if (!_.has(previousAttributes, key)) {
  13982. self.trigger('change:' + key, self, newValue, {});
  13983. }
  13984. });
  13985. },
  13986. /**
  13987. * Sets a hash of model attributes on the object, firing
  13988. * <code>"change"</code> unless you choose to silence it.
  13989. *
  13990. * <p>You can call it with an object containing keys and values, or with one
  13991. * key and value. For example:</p>
  13992. *
  13993. * @example
  13994. * gameTurn.set({
  13995. * player: player1,
  13996. * diceRoll: 2
  13997. * });
  13998. *
  13999. * game.set("currentPlayer", player2);
  14000. *
  14001. * game.set("finished", true);
  14002. *
  14003. * @param {String} key The key to set.
  14004. * @param {Any} value The value to give it.
  14005. * @param {Object} [options]
  14006. * @param {Boolean} [options.silent]
  14007. * @return {AV.Object} self if succeeded, throws if the value is not valid.
  14008. * @see AV.Object#validate
  14009. */
  14010. set: function set(key, value, options) {
  14011. var attrs;
  14012. if (_.isObject(key) || isNullOrUndefined(key)) {
  14013. attrs = _.mapObject(key, function (v, k) {
  14014. checkReservedKey(k);
  14015. return AV._decode(v, k);
  14016. });
  14017. options = value;
  14018. } else {
  14019. attrs = {};
  14020. checkReservedKey(key);
  14021. attrs[key] = AV._decode(value, key);
  14022. } // Extract attributes and options.
  14023. options = options || {};
  14024. if (!attrs) {
  14025. return this;
  14026. }
  14027. if (attrs instanceof AV.Object) {
  14028. attrs = attrs.attributes;
  14029. } // If the unset option is used, every attribute should be a Unset.
  14030. if (options.unset) {
  14031. AV._objectEach(attrs, function (unused_value, key) {
  14032. attrs[key] = new AV.Op.Unset();
  14033. });
  14034. } // Apply all the attributes to get the estimated values.
  14035. var dataToValidate = _.clone(attrs);
  14036. var self = this;
  14037. AV._objectEach(dataToValidate, function (value, key) {
  14038. if (value instanceof AV.Op) {
  14039. dataToValidate[key] = value._estimate(self.attributes[key], self, key);
  14040. if (dataToValidate[key] === AV.Op._UNSET) {
  14041. delete dataToValidate[key];
  14042. }
  14043. }
  14044. }); // Run validation.
  14045. this._validate(attrs, options);
  14046. options.changes = {};
  14047. var escaped = this._escapedAttributes; // Update attributes.
  14048. AV._arrayEach((0, _keys2.default)(_).call(_, attrs), function (attr) {
  14049. var val = attrs[attr]; // If this is a relation object we need to set the parent correctly,
  14050. // since the location where it was parsed does not have access to
  14051. // this object.
  14052. if (val instanceof AV.Relation) {
  14053. val.parent = self;
  14054. }
  14055. if (!(val instanceof AV.Op)) {
  14056. val = new AV.Op.Set(val);
  14057. } // See if this change will actually have any effect.
  14058. var isRealChange = true;
  14059. if (val instanceof AV.Op.Set && _.isEqual(self.attributes[attr], val.value)) {
  14060. isRealChange = false;
  14061. }
  14062. if (isRealChange) {
  14063. delete escaped[attr];
  14064. if (options.silent) {
  14065. self._silent[attr] = true;
  14066. } else {
  14067. options.changes[attr] = true;
  14068. }
  14069. }
  14070. var currentChanges = _.last(self._opSetQueue);
  14071. currentChanges[attr] = val._mergeWithPrevious(currentChanges[attr]);
  14072. self._rebuildEstimatedDataForKey(attr);
  14073. if (isRealChange) {
  14074. self.changed[attr] = self.attributes[attr];
  14075. if (!options.silent) {
  14076. self._pending[attr] = true;
  14077. }
  14078. } else {
  14079. delete self.changed[attr];
  14080. delete self._pending[attr];
  14081. }
  14082. });
  14083. if (!options.silent) {
  14084. this.change(options);
  14085. }
  14086. return this;
  14087. },
  14088. /**
  14089. * Remove an attribute from the model, firing <code>"change"</code> unless
  14090. * you choose to silence it. This is a noop if the attribute doesn't
  14091. * exist.
  14092. * @param key {String} The key.
  14093. */
  14094. unset: function unset(attr, options) {
  14095. options = options || {};
  14096. options.unset = true;
  14097. return this.set(attr, null, options);
  14098. },
  14099. /**
  14100. * Atomically increments the value of the given attribute the next time the
  14101. * object is saved. If no amount is specified, 1 is used by default.
  14102. *
  14103. * @param key {String} The key.
  14104. * @param amount {Number} The amount to increment by.
  14105. */
  14106. increment: function increment(attr, amount) {
  14107. if (_.isUndefined(amount) || _.isNull(amount)) {
  14108. amount = 1;
  14109. }
  14110. return this.set(attr, new AV.Op.Increment(amount));
  14111. },
  14112. /**
  14113. * Atomically add an object to the end of the array associated with a given
  14114. * key.
  14115. * @param key {String} The key.
  14116. * @param item {} The item to add.
  14117. */
  14118. add: function add(attr, item) {
  14119. return this.set(attr, new AV.Op.Add(ensureArray(item)));
  14120. },
  14121. /**
  14122. * Atomically add an object to the array associated with a given key, only
  14123. * if it is not already present in the array. The position of the insert is
  14124. * not guaranteed.
  14125. *
  14126. * @param key {String} The key.
  14127. * @param item {} The object to add.
  14128. */
  14129. addUnique: function addUnique(attr, item) {
  14130. return this.set(attr, new AV.Op.AddUnique(ensureArray(item)));
  14131. },
  14132. /**
  14133. * Atomically remove all instances of an object from the array associated
  14134. * with a given key.
  14135. *
  14136. * @param key {String} The key.
  14137. * @param item {} The object to remove.
  14138. */
  14139. remove: function remove(attr, item) {
  14140. return this.set(attr, new AV.Op.Remove(ensureArray(item)));
  14141. },
  14142. /**
  14143. * Atomically apply a "bit and" operation on the value associated with a
  14144. * given key.
  14145. *
  14146. * @param key {String} The key.
  14147. * @param value {Number} The value to apply.
  14148. */
  14149. bitAnd: function bitAnd(attr, value) {
  14150. return this.set(attr, new AV.Op.BitAnd(value));
  14151. },
  14152. /**
  14153. * Atomically apply a "bit or" operation on the value associated with a
  14154. * given key.
  14155. *
  14156. * @param key {String} The key.
  14157. * @param value {Number} The value to apply.
  14158. */
  14159. bitOr: function bitOr(attr, value) {
  14160. return this.set(attr, new AV.Op.BitOr(value));
  14161. },
  14162. /**
  14163. * Atomically apply a "bit xor" operation on the value associated with a
  14164. * given key.
  14165. *
  14166. * @param key {String} The key.
  14167. * @param value {Number} The value to apply.
  14168. */
  14169. bitXor: function bitXor(attr, value) {
  14170. return this.set(attr, new AV.Op.BitXor(value));
  14171. },
  14172. /**
  14173. * Returns an instance of a subclass of AV.Op describing what kind of
  14174. * modification has been performed on this field since the last time it was
  14175. * saved. For example, after calling object.increment("x"), calling
  14176. * object.op("x") would return an instance of AV.Op.Increment.
  14177. *
  14178. * @param key {String} The key.
  14179. * @returns {AV.Op} The operation, or undefined if none.
  14180. */
  14181. op: function op(attr) {
  14182. return _.last(this._opSetQueue)[attr];
  14183. },
  14184. /**
  14185. * Clear all attributes on the model, firing <code>"change"</code> unless
  14186. * you choose to silence it.
  14187. */
  14188. clear: function clear(options) {
  14189. options = options || {};
  14190. options.unset = true;
  14191. var keysToClear = _.extend(this.attributes, this._operations);
  14192. return this.set(keysToClear, options);
  14193. },
  14194. /**
  14195. * Clears any (or specific) changes to the model made since the last save.
  14196. * @param {string|string[]} [keys] specify keys to revert.
  14197. */
  14198. revert: function revert(keys) {
  14199. var lastOp = _.last(this._opSetQueue);
  14200. var _keys = ensureArray(keys || (0, _keys2.default)(_).call(_, lastOp));
  14201. _keys.forEach(function (key) {
  14202. delete lastOp[key];
  14203. });
  14204. this._rebuildAllEstimatedData();
  14205. return this;
  14206. },
  14207. /**
  14208. * Returns a JSON-encoded set of operations to be sent with the next save
  14209. * request.
  14210. * @private
  14211. */
  14212. _getSaveJSON: function _getSaveJSON() {
  14213. var json = _.clone(_.first(this._opSetQueue));
  14214. AV._objectEach(json, function (op, key) {
  14215. json[key] = op.toJSON();
  14216. });
  14217. return json;
  14218. },
  14219. /**
  14220. * Returns true if this object can be serialized for saving.
  14221. * @private
  14222. */
  14223. _canBeSerialized: function _canBeSerialized() {
  14224. return AV.Object._canBeSerializedAsValue(this.attributes);
  14225. },
  14226. /**
  14227. * Fetch the model from the server. If the server's representation of the
  14228. * model differs from its current attributes, they will be overriden,
  14229. * triggering a <code>"change"</code> event.
  14230. * @param {Object} fetchOptions Optional options to set 'keys',
  14231. * 'include' and 'includeACL' option.
  14232. * @param {AuthOptions} options
  14233. * @return {Promise} A promise that is fulfilled when the fetch
  14234. * completes.
  14235. */
  14236. fetch: function fetch() {
  14237. var fetchOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  14238. var options = arguments.length > 1 ? arguments[1] : undefined;
  14239. if (!this.id) {
  14240. throw new Error('Cannot fetch unsaved object');
  14241. }
  14242. var self = this;
  14243. var request = _request('classes', this.className, this.id, 'GET', transformFetchOptions(fetchOptions), options);
  14244. return request.then(function (response) {
  14245. var fetchedAttrs = self.parse(response);
  14246. self._cleanupUnsetKeys(fetchedAttrs, (0, _keys2.default)(fetchOptions) ? ensureArray((0, _keys2.default)(fetchOptions)).join(',').split(',') : undefined);
  14247. self._finishFetch(fetchedAttrs, true);
  14248. return self;
  14249. });
  14250. },
  14251. _cleanupUnsetKeys: function _cleanupUnsetKeys(fetchedAttrs) {
  14252. var _this2 = this;
  14253. var fetchedKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _keys2.default)(_).call(_, this._serverData);
  14254. _.forEach(fetchedKeys, function (key) {
  14255. if (fetchedAttrs[key] === undefined) delete _this2._serverData[key];
  14256. });
  14257. },
  14258. /**
  14259. * Set a hash of model attributes, and save the model to the server.
  14260. * updatedAt will be updated when the request returns.
  14261. * You can either call it as:<pre>
  14262. * object.save();</pre>
  14263. * or<pre>
  14264. * object.save(null, options);</pre>
  14265. * or<pre>
  14266. * object.save(attrs, options);</pre>
  14267. * or<pre>
  14268. * object.save(key, value, options);</pre>
  14269. *
  14270. * @example
  14271. * gameTurn.save({
  14272. * player: "Jake Cutter",
  14273. * diceRoll: 2
  14274. * }).then(function(gameTurnAgain) {
  14275. * // The save was successful.
  14276. * }, function(error) {
  14277. * // The save failed. Error is an instance of AVError.
  14278. * });
  14279. *
  14280. * @param {AuthOptions} options AuthOptions plus:
  14281. * @param {Boolean} options.fetchWhenSave fetch and update object after save succeeded
  14282. * @param {AV.Query} options.query Save object only when it matches the query
  14283. * @return {Promise} A promise that is fulfilled when the save
  14284. * completes.
  14285. * @see AVError
  14286. */
  14287. save: function save(arg1, arg2, arg3) {
  14288. var attrs, current, options;
  14289. if (_.isObject(arg1) || isNullOrUndefined(arg1)) {
  14290. attrs = arg1;
  14291. options = arg2;
  14292. } else {
  14293. attrs = {};
  14294. attrs[arg1] = arg2;
  14295. options = arg3;
  14296. }
  14297. options = _.clone(options) || {};
  14298. if (options.wait) {
  14299. current = _.clone(this.attributes);
  14300. }
  14301. var setOptions = _.clone(options) || {};
  14302. if (setOptions.wait) {
  14303. setOptions.silent = true;
  14304. }
  14305. if (attrs) {
  14306. this.set(attrs, setOptions);
  14307. }
  14308. var model = this;
  14309. var unsavedChildren = [];
  14310. var unsavedFiles = [];
  14311. AV.Object._findUnsavedChildren(model, unsavedChildren, unsavedFiles);
  14312. if (unsavedChildren.length + unsavedFiles.length > 1) {
  14313. return AV.Object._deepSaveAsync(this, model, options);
  14314. }
  14315. this._startSave();
  14316. this._saving = (this._saving || 0) + 1;
  14317. this._allPreviousSaves = this._allPreviousSaves || _promise.default.resolve();
  14318. this._allPreviousSaves = this._allPreviousSaves.catch(function (e) {}).then(function () {
  14319. var method = model.id ? 'PUT' : 'POST';
  14320. var json = model._getSaveJSON();
  14321. var query = {};
  14322. if (model._fetchWhenSave || options.fetchWhenSave) {
  14323. query['new'] = 'true';
  14324. } // user login option
  14325. if (options._failOnNotExist) {
  14326. query.failOnNotExist = 'true';
  14327. }
  14328. if (options.query) {
  14329. var queryParams;
  14330. if (typeof options.query._getParams === 'function') {
  14331. queryParams = options.query._getParams();
  14332. if (queryParams) {
  14333. query.where = queryParams.where;
  14334. }
  14335. }
  14336. if (!query.where) {
  14337. var error = new Error('options.query is not an AV.Query');
  14338. throw error;
  14339. }
  14340. }
  14341. _.extend(json, model._flags);
  14342. var route = 'classes';
  14343. var className = model.className;
  14344. if (model.className === '_User' && !model.id) {
  14345. // Special-case user sign-up.
  14346. route = 'users';
  14347. className = null;
  14348. } //hook makeRequest in options.
  14349. var makeRequest = options._makeRequest || _request;
  14350. var requestPromise = makeRequest(route, className, model.id, method, json, options, query);
  14351. requestPromise = requestPromise.then(function (resp) {
  14352. var serverAttrs = model.parse(resp);
  14353. if (options.wait) {
  14354. serverAttrs = _.extend(attrs || {}, serverAttrs);
  14355. }
  14356. model._finishSave(serverAttrs);
  14357. if (options.wait) {
  14358. model.set(current, setOptions);
  14359. }
  14360. return model;
  14361. }, function (error) {
  14362. model._cancelSave();
  14363. throw error;
  14364. });
  14365. return requestPromise;
  14366. });
  14367. return this._allPreviousSaves;
  14368. },
  14369. /**
  14370. * Destroy this model on the server if it was already persisted.
  14371. * Optimistically removes the model from its collection, if it has one.
  14372. * @param {AuthOptions} options AuthOptions plus:
  14373. * @param {Boolean} [options.wait] wait for the server to respond
  14374. * before removal.
  14375. *
  14376. * @return {Promise} A promise that is fulfilled when the destroy
  14377. * completes.
  14378. */
  14379. destroy: function destroy(options) {
  14380. options = options || {};
  14381. var model = this;
  14382. var triggerDestroy = function triggerDestroy() {
  14383. model.trigger('destroy', model, model.collection, options);
  14384. };
  14385. if (!this.id) {
  14386. return triggerDestroy();
  14387. }
  14388. if (!options.wait) {
  14389. triggerDestroy();
  14390. }
  14391. var request = _request('classes', this.className, this.id, 'DELETE', this._flags, options);
  14392. return request.then(function () {
  14393. if (options.wait) {
  14394. triggerDestroy();
  14395. }
  14396. return model;
  14397. });
  14398. },
  14399. /**
  14400. * Converts a response into the hash of attributes to be set on the model.
  14401. * @ignore
  14402. */
  14403. parse: function parse(resp) {
  14404. var output = _.clone(resp);
  14405. ['createdAt', 'updatedAt'].forEach(function (key) {
  14406. if (output[key]) {
  14407. output[key] = AV._parseDate(output[key]);
  14408. }
  14409. });
  14410. if (output.createdAt && !output.updatedAt) {
  14411. output.updatedAt = output.createdAt;
  14412. }
  14413. return output;
  14414. },
  14415. /**
  14416. * Creates a new model with identical attributes to this one.
  14417. * @return {AV.Object}
  14418. */
  14419. clone: function clone() {
  14420. return new this.constructor(this.attributes);
  14421. },
  14422. /**
  14423. * Returns true if this object has never been saved to AV.
  14424. * @return {Boolean}
  14425. */
  14426. isNew: function isNew() {
  14427. return !this.id;
  14428. },
  14429. /**
  14430. * Call this method to manually fire a `"change"` event for this model and
  14431. * a `"change:attribute"` event for each changed attribute.
  14432. * Calling this will cause all objects observing the model to update.
  14433. */
  14434. change: function change(options) {
  14435. options = options || {};
  14436. var changing = this._changing;
  14437. this._changing = true; // Silent changes become pending changes.
  14438. var self = this;
  14439. AV._objectEach(this._silent, function (attr) {
  14440. self._pending[attr] = true;
  14441. }); // Silent changes are triggered.
  14442. var changes = _.extend({}, options.changes, this._silent);
  14443. this._silent = {};
  14444. AV._objectEach(changes, function (unused_value, attr) {
  14445. self.trigger('change:' + attr, self, self.get(attr), options);
  14446. });
  14447. if (changing) {
  14448. return this;
  14449. } // This is to get around lint not letting us make a function in a loop.
  14450. var deleteChanged = function deleteChanged(value, attr) {
  14451. if (!self._pending[attr] && !self._silent[attr]) {
  14452. delete self.changed[attr];
  14453. }
  14454. }; // Continue firing `"change"` events while there are pending changes.
  14455. while (!_.isEmpty(this._pending)) {
  14456. this._pending = {};
  14457. this.trigger('change', this, options); // Pending and silent changes still remain.
  14458. AV._objectEach(this.changed, deleteChanged);
  14459. self._previousAttributes = _.clone(this.attributes);
  14460. }
  14461. this._changing = false;
  14462. return this;
  14463. },
  14464. /**
  14465. * Gets the previous value of an attribute, recorded at the time the last
  14466. * <code>"change"</code> event was fired.
  14467. * @param {String} attr Name of the attribute to get.
  14468. */
  14469. previous: function previous(attr) {
  14470. if (!arguments.length || !this._previousAttributes) {
  14471. return null;
  14472. }
  14473. return this._previousAttributes[attr];
  14474. },
  14475. /**
  14476. * Gets all of the attributes of the model at the time of the previous
  14477. * <code>"change"</code> event.
  14478. * @return {Object}
  14479. */
  14480. previousAttributes: function previousAttributes() {
  14481. return _.clone(this._previousAttributes);
  14482. },
  14483. /**
  14484. * Checks if the model is currently in a valid state. It's only possible to
  14485. * get into an *invalid* state if you're using silent changes.
  14486. * @return {Boolean}
  14487. */
  14488. isValid: function isValid() {
  14489. try {
  14490. this.validate(this.attributes);
  14491. } catch (error) {
  14492. return false;
  14493. }
  14494. return true;
  14495. },
  14496. /**
  14497. * You should not call this function directly unless you subclass
  14498. * <code>AV.Object</code>, in which case you can override this method
  14499. * to provide additional validation on <code>set</code> and
  14500. * <code>save</code>. Your implementation should throw an Error if
  14501. * the attrs is invalid
  14502. *
  14503. * @param {Object} attrs The current data to validate.
  14504. * @see AV.Object#set
  14505. */
  14506. validate: function validate(attrs) {
  14507. if (_.has(attrs, 'ACL') && !(attrs.ACL instanceof AV.ACL)) {
  14508. throw new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
  14509. }
  14510. },
  14511. /**
  14512. * Run validation against a set of incoming attributes, returning `true`
  14513. * if all is well. If a specific `error` callback has been passed,
  14514. * call that instead of firing the general `"error"` event.
  14515. * @private
  14516. */
  14517. _validate: function _validate(attrs, options) {
  14518. if (options.silent || !this.validate) {
  14519. return;
  14520. }
  14521. attrs = _.extend({}, this.attributes, attrs);
  14522. this.validate(attrs);
  14523. },
  14524. /**
  14525. * Returns the ACL for this object.
  14526. * @returns {AV.ACL} An instance of AV.ACL.
  14527. * @see AV.Object#get
  14528. */
  14529. getACL: function getACL() {
  14530. return this.get('ACL');
  14531. },
  14532. /**
  14533. * Sets the ACL to be used for this object.
  14534. * @param {AV.ACL} acl An instance of AV.ACL.
  14535. * @param {Object} options Optional Backbone-like options object to be
  14536. * passed in to set.
  14537. * @return {AV.Object} self
  14538. * @see AV.Object#set
  14539. */
  14540. setACL: function setACL(acl, options) {
  14541. return this.set('ACL', acl, options);
  14542. },
  14543. disableBeforeHook: function disableBeforeHook() {
  14544. this.ignoreHook('beforeSave');
  14545. this.ignoreHook('beforeUpdate');
  14546. this.ignoreHook('beforeDelete');
  14547. },
  14548. disableAfterHook: function disableAfterHook() {
  14549. this.ignoreHook('afterSave');
  14550. this.ignoreHook('afterUpdate');
  14551. this.ignoreHook('afterDelete');
  14552. },
  14553. ignoreHook: function ignoreHook(hookName) {
  14554. if (!_.contains(['beforeSave', 'afterSave', 'beforeUpdate', 'afterUpdate', 'beforeDelete', 'afterDelete'], hookName)) {
  14555. throw new Error('Unsupported hookName: ' + hookName);
  14556. }
  14557. if (!AV.hookKey) {
  14558. throw new Error('ignoreHook required hookKey');
  14559. }
  14560. if (!this._flags.__ignore_hooks) {
  14561. this._flags.__ignore_hooks = [];
  14562. }
  14563. this._flags.__ignore_hooks.push(hookName);
  14564. }
  14565. });
  14566. /**
  14567. * Creates an instance of a subclass of AV.Object for the give classname
  14568. * and id.
  14569. * @param {String|Function} class the className or a subclass of AV.Object.
  14570. * @param {String} id The object id of this model.
  14571. * @return {AV.Object} A new subclass instance of AV.Object.
  14572. */
  14573. AV.Object.createWithoutData = function (klass, id, hasData) {
  14574. var _klass;
  14575. if (_.isString(klass)) {
  14576. _klass = AV.Object._getSubclass(klass);
  14577. } else if (klass.prototype && klass.prototype instanceof AV.Object) {
  14578. _klass = klass;
  14579. } else {
  14580. throw new Error('class must be a string or a subclass of AV.Object.');
  14581. }
  14582. if (!id) {
  14583. throw new TypeError('The objectId must be provided');
  14584. }
  14585. var object = new _klass();
  14586. object.id = id;
  14587. object._hasData = hasData;
  14588. return object;
  14589. };
  14590. /**
  14591. * Delete objects in batch.
  14592. * @param {AV.Object[]} objects The <code>AV.Object</code> array to be deleted.
  14593. * @param {AuthOptions} options
  14594. * @return {Promise} A promise that is fulfilled when the save
  14595. * completes.
  14596. */
  14597. AV.Object.destroyAll = function (objects) {
  14598. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  14599. if (!objects || objects.length === 0) {
  14600. return _promise.default.resolve();
  14601. }
  14602. var objectsByClassNameAndFlags = _.groupBy(objects, function (object) {
  14603. return (0, _stringify.default)({
  14604. className: object.className,
  14605. flags: object._flags
  14606. });
  14607. });
  14608. var body = {
  14609. requests: (0, _map.default)(_).call(_, objectsByClassNameAndFlags, function (objects) {
  14610. var _context3;
  14611. var ids = (0, _map.default)(_).call(_, objects, 'id').join(',');
  14612. return {
  14613. method: 'DELETE',
  14614. path: (0, _concat.default)(_context3 = "/1.1/classes/".concat(objects[0].className, "/")).call(_context3, ids),
  14615. body: objects[0]._flags
  14616. };
  14617. })
  14618. };
  14619. return _request('batch', null, null, 'POST', body, options).then(function (response) {
  14620. var firstError = (0, _find.default)(_).call(_, response, function (result) {
  14621. return !result.success;
  14622. });
  14623. if (firstError) throw new AVError(firstError.error.code, firstError.error.error);
  14624. return undefined;
  14625. });
  14626. };
  14627. /**
  14628. * Returns the appropriate subclass for making new instances of the given
  14629. * className string.
  14630. * @private
  14631. */
  14632. AV.Object._getSubclass = function (className) {
  14633. if (!_.isString(className)) {
  14634. throw new Error('AV.Object._getSubclass requires a string argument.');
  14635. }
  14636. var ObjectClass = AV.Object._classMap[className];
  14637. if (!ObjectClass) {
  14638. ObjectClass = AV.Object.extend(className);
  14639. AV.Object._classMap[className] = ObjectClass;
  14640. }
  14641. return ObjectClass;
  14642. };
  14643. /**
  14644. * Creates an instance of a subclass of AV.Object for the given classname.
  14645. * @private
  14646. */
  14647. AV.Object._create = function (className, attributes, options) {
  14648. var ObjectClass = AV.Object._getSubclass(className);
  14649. return new ObjectClass(attributes, options);
  14650. }; // Set up a map of className to class so that we can create new instances of
  14651. // AV Objects from JSON automatically.
  14652. AV.Object._classMap = {};
  14653. AV.Object._extend = AV._extend;
  14654. /**
  14655. * Creates a new model with defined attributes,
  14656. * It's the same with
  14657. * <pre>
  14658. * new AV.Object(attributes, options);
  14659. * </pre>
  14660. * @param {Object} attributes The initial set of data to store in the object.
  14661. * @param {Object} options A set of Backbone-like options for creating the
  14662. * object. The only option currently supported is "collection".
  14663. * @return {AV.Object}
  14664. * @since v0.4.4
  14665. * @see AV.Object
  14666. * @see AV.Object.extend
  14667. */
  14668. AV.Object['new'] = function (attributes, options) {
  14669. return new AV.Object(attributes, options);
  14670. };
  14671. /**
  14672. * Creates a new subclass of AV.Object for the given AV class name.
  14673. *
  14674. * <p>Every extension of a AV class will inherit from the most recent
  14675. * previous extension of that class. When a AV.Object is automatically
  14676. * created by parsing JSON, it will use the most recent extension of that
  14677. * class.</p>
  14678. *
  14679. * @example
  14680. * var MyClass = AV.Object.extend("MyClass", {
  14681. * // Instance properties
  14682. * }, {
  14683. * // Class properties
  14684. * });
  14685. *
  14686. * @param {String} className The name of the AV class backing this model.
  14687. * @param {Object} protoProps Instance properties to add to instances of the
  14688. * class returned from this method.
  14689. * @param {Object} classProps Class properties to add the class returned from
  14690. * this method.
  14691. * @return {Class} A new subclass of AV.Object.
  14692. */
  14693. AV.Object.extend = function (className, protoProps, classProps) {
  14694. // Handle the case with only two args.
  14695. if (!_.isString(className)) {
  14696. if (className && _.has(className, 'className')) {
  14697. return AV.Object.extend(className.className, className, protoProps);
  14698. } else {
  14699. throw new Error("AV.Object.extend's first argument should be the className.");
  14700. }
  14701. } // If someone tries to subclass "User", coerce it to the right type.
  14702. if (className === 'User') {
  14703. className = '_User';
  14704. }
  14705. var NewClassObject = null;
  14706. if (_.has(AV.Object._classMap, className)) {
  14707. var OldClassObject = AV.Object._classMap[className]; // This new subclass has been told to extend both from "this" and from
  14708. // OldClassObject. This is multiple inheritance, which isn't supported.
  14709. // For now, let's just pick one.
  14710. if (protoProps || classProps) {
  14711. NewClassObject = OldClassObject._extend(protoProps, classProps);
  14712. } else {
  14713. return OldClassObject;
  14714. }
  14715. } else {
  14716. protoProps = protoProps || {};
  14717. protoProps._className = className;
  14718. NewClassObject = this._extend(protoProps, classProps);
  14719. } // Extending a subclass should reuse the classname automatically.
  14720. NewClassObject.extend = function (arg0) {
  14721. var _context4;
  14722. if (_.isString(arg0) || arg0 && _.has(arg0, 'className')) {
  14723. return AV.Object.extend.apply(NewClassObject, arguments);
  14724. }
  14725. var newArguments = (0, _concat.default)(_context4 = [className]).call(_context4, _.toArray(arguments));
  14726. return AV.Object.extend.apply(NewClassObject, newArguments);
  14727. }; // Add the query property descriptor.
  14728. (0, _defineProperty.default)(NewClassObject, 'query', (0, _getOwnPropertyDescriptor.default)(AV.Object, 'query'));
  14729. NewClassObject['new'] = function (attributes, options) {
  14730. return new NewClassObject(attributes, options);
  14731. };
  14732. AV.Object._classMap[className] = NewClassObject;
  14733. return NewClassObject;
  14734. }; // ES6 class syntax support
  14735. (0, _defineProperty.default)(AV.Object.prototype, 'className', {
  14736. get: function get() {
  14737. var className = this._className || this.constructor._LCClassName || this.constructor.name; // If someone tries to subclass "User", coerce it to the right type.
  14738. if (className === 'User') {
  14739. return '_User';
  14740. }
  14741. return className;
  14742. }
  14743. });
  14744. /**
  14745. * Register a class.
  14746. * If a subclass of <code>AV.Object</code> is defined with your own implement
  14747. * rather then <code>AV.Object.extend</code>, the subclass must be registered.
  14748. * @param {Function} klass A subclass of <code>AV.Object</code>
  14749. * @param {String} [name] Specify the name of the class. Useful when the class might be uglified.
  14750. * @example
  14751. * class Person extend AV.Object {}
  14752. * AV.Object.register(Person);
  14753. */
  14754. AV.Object.register = function (klass, name) {
  14755. if (!(klass.prototype instanceof AV.Object)) {
  14756. throw new Error('registered class is not a subclass of AV.Object');
  14757. }
  14758. var className = name || klass.name;
  14759. if (!className.length) {
  14760. throw new Error('registered class must be named');
  14761. }
  14762. if (name) {
  14763. klass._LCClassName = name;
  14764. }
  14765. AV.Object._classMap[className] = klass;
  14766. };
  14767. /**
  14768. * Get a new Query of the current class
  14769. * @name query
  14770. * @memberof AV.Object
  14771. * @type AV.Query
  14772. * @readonly
  14773. * @since v3.1.0
  14774. * @example
  14775. * const Post = AV.Object.extend('Post');
  14776. * Post.query.equalTo('author', 'leancloud').find().then();
  14777. */
  14778. (0, _defineProperty.default)(AV.Object, 'query', {
  14779. get: function get() {
  14780. return new AV.Query(this.prototype.className);
  14781. }
  14782. });
  14783. AV.Object._findUnsavedChildren = function (objects, children, files) {
  14784. AV._traverse(objects, function (object) {
  14785. if (object instanceof AV.Object) {
  14786. if (object.dirty()) {
  14787. children.push(object);
  14788. }
  14789. return;
  14790. }
  14791. if (object instanceof AV.File) {
  14792. if (!object.id) {
  14793. files.push(object);
  14794. }
  14795. return;
  14796. }
  14797. });
  14798. };
  14799. AV.Object._canBeSerializedAsValue = function (object) {
  14800. var canBeSerializedAsValue = true;
  14801. if (object instanceof AV.Object || object instanceof AV.File) {
  14802. canBeSerializedAsValue = !!object.id;
  14803. } else if (_.isArray(object)) {
  14804. AV._arrayEach(object, function (child) {
  14805. if (!AV.Object._canBeSerializedAsValue(child)) {
  14806. canBeSerializedAsValue = false;
  14807. }
  14808. });
  14809. } else if (_.isObject(object)) {
  14810. AV._objectEach(object, function (child) {
  14811. if (!AV.Object._canBeSerializedAsValue(child)) {
  14812. canBeSerializedAsValue = false;
  14813. }
  14814. });
  14815. }
  14816. return canBeSerializedAsValue;
  14817. };
  14818. AV.Object._deepSaveAsync = function (object, model, options) {
  14819. var unsavedChildren = [];
  14820. var unsavedFiles = [];
  14821. AV.Object._findUnsavedChildren(object, unsavedChildren, unsavedFiles);
  14822. unsavedFiles = _.uniq(unsavedFiles);
  14823. var promise = _promise.default.resolve();
  14824. _.each(unsavedFiles, function (file) {
  14825. promise = promise.then(function () {
  14826. return file.save();
  14827. });
  14828. });
  14829. var objects = _.uniq(unsavedChildren);
  14830. var remaining = _.uniq(objects);
  14831. return promise.then(function () {
  14832. return continueWhile(function () {
  14833. return remaining.length > 0;
  14834. }, function () {
  14835. // Gather up all the objects that can be saved in this batch.
  14836. var batch = [];
  14837. var newRemaining = [];
  14838. AV._arrayEach(remaining, function (object) {
  14839. if (object._canBeSerialized()) {
  14840. batch.push(object);
  14841. } else {
  14842. newRemaining.push(object);
  14843. }
  14844. });
  14845. remaining = newRemaining; // If we can't save any objects, there must be a circular reference.
  14846. if (batch.length === 0) {
  14847. return _promise.default.reject(new AVError(AVError.OTHER_CAUSE, 'Tried to save a batch with a cycle.'));
  14848. } // Reserve a spot in every object's save queue.
  14849. var readyToStart = _promise.default.resolve((0, _map.default)(_).call(_, batch, function (object) {
  14850. return object._allPreviousSaves || _promise.default.resolve();
  14851. })); // Save a single batch, whether previous saves succeeded or failed.
  14852. var bathSavePromise = readyToStart.then(function () {
  14853. return _request('batch', null, null, 'POST', {
  14854. requests: (0, _map.default)(_).call(_, batch, function (object) {
  14855. var method = object.id ? 'PUT' : 'POST';
  14856. var json = object._getSaveJSON();
  14857. _.extend(json, object._flags);
  14858. var route = 'classes';
  14859. var className = object.className;
  14860. var path = "/".concat(route, "/").concat(className);
  14861. if (object.className === '_User' && !object.id) {
  14862. // Special-case user sign-up.
  14863. path = '/users';
  14864. }
  14865. var path = "/1.1".concat(path);
  14866. if (object.id) {
  14867. path = path + '/' + object.id;
  14868. }
  14869. object._startSave();
  14870. return {
  14871. method: method,
  14872. path: path,
  14873. body: json,
  14874. params: options && options.fetchWhenSave ? {
  14875. fetchWhenSave: true
  14876. } : undefined
  14877. };
  14878. })
  14879. }, options).then(function (response) {
  14880. var results = (0, _map.default)(_).call(_, batch, function (object, i) {
  14881. if (response[i].success) {
  14882. object._finishSave(object.parse(response[i].success));
  14883. return object;
  14884. }
  14885. object._cancelSave();
  14886. return new AVError(response[i].error.code, response[i].error.error);
  14887. });
  14888. return handleBatchResults(results);
  14889. });
  14890. });
  14891. AV._arrayEach(batch, function (object) {
  14892. object._allPreviousSaves = bathSavePromise;
  14893. });
  14894. return bathSavePromise;
  14895. });
  14896. }).then(function () {
  14897. return object;
  14898. });
  14899. };
  14900. };
  14901. /***/ }),
  14902. /* 507 */
  14903. /***/ (function(module, exports, __webpack_require__) {
  14904. var arrayWithHoles = __webpack_require__(508);
  14905. var iterableToArrayLimit = __webpack_require__(516);
  14906. var unsupportedIterableToArray = __webpack_require__(517);
  14907. var nonIterableRest = __webpack_require__(527);
  14908. function _slicedToArray(arr, i) {
  14909. return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
  14910. }
  14911. module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  14912. /***/ }),
  14913. /* 508 */
  14914. /***/ (function(module, exports, __webpack_require__) {
  14915. var _Array$isArray = __webpack_require__(509);
  14916. function _arrayWithHoles(arr) {
  14917. if (_Array$isArray(arr)) return arr;
  14918. }
  14919. module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
  14920. /***/ }),
  14921. /* 509 */
  14922. /***/ (function(module, exports, __webpack_require__) {
  14923. module.exports = __webpack_require__(510);
  14924. /***/ }),
  14925. /* 510 */
  14926. /***/ (function(module, exports, __webpack_require__) {
  14927. module.exports = __webpack_require__(511);
  14928. /***/ }),
  14929. /* 511 */
  14930. /***/ (function(module, exports, __webpack_require__) {
  14931. var parent = __webpack_require__(512);
  14932. module.exports = parent;
  14933. /***/ }),
  14934. /* 512 */
  14935. /***/ (function(module, exports, __webpack_require__) {
  14936. var parent = __webpack_require__(513);
  14937. module.exports = parent;
  14938. /***/ }),
  14939. /* 513 */
  14940. /***/ (function(module, exports, __webpack_require__) {
  14941. var parent = __webpack_require__(514);
  14942. module.exports = parent;
  14943. /***/ }),
  14944. /* 514 */
  14945. /***/ (function(module, exports, __webpack_require__) {
  14946. __webpack_require__(515);
  14947. var path = __webpack_require__(10);
  14948. module.exports = path.Array.isArray;
  14949. /***/ }),
  14950. /* 515 */
  14951. /***/ (function(module, exports, __webpack_require__) {
  14952. var $ = __webpack_require__(0);
  14953. var isArray = __webpack_require__(85);
  14954. // `Array.isArray` method
  14955. // https://tc39.es/ecma262/#sec-array.isarray
  14956. $({ target: 'Array', stat: true }, {
  14957. isArray: isArray
  14958. });
  14959. /***/ }),
  14960. /* 516 */
  14961. /***/ (function(module, exports, __webpack_require__) {
  14962. var _Symbol = __webpack_require__(231);
  14963. var _getIteratorMethod = __webpack_require__(241);
  14964. function _iterableToArrayLimit(arr, i) {
  14965. var _i = arr == null ? null : typeof _Symbol !== "undefined" && _getIteratorMethod(arr) || arr["@@iterator"];
  14966. if (_i == null) return;
  14967. var _arr = [];
  14968. var _n = true;
  14969. var _d = false;
  14970. var _s, _e;
  14971. try {
  14972. for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
  14973. _arr.push(_s.value);
  14974. if (i && _arr.length === i) break;
  14975. }
  14976. } catch (err) {
  14977. _d = true;
  14978. _e = err;
  14979. } finally {
  14980. try {
  14981. if (!_n && _i["return"] != null) _i["return"]();
  14982. } finally {
  14983. if (_d) throw _e;
  14984. }
  14985. }
  14986. return _arr;
  14987. }
  14988. module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
  14989. /***/ }),
  14990. /* 517 */
  14991. /***/ (function(module, exports, __webpack_require__) {
  14992. var _sliceInstanceProperty = __webpack_require__(518);
  14993. var _Array$from = __webpack_require__(522);
  14994. var arrayLikeToArray = __webpack_require__(526);
  14995. function _unsupportedIterableToArray(o, minLen) {
  14996. var _context;
  14997. if (!o) return;
  14998. if (typeof o === "string") return arrayLikeToArray(o, minLen);
  14999. var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
  15000. if (n === "Object" && o.constructor) n = o.constructor.name;
  15001. if (n === "Map" || n === "Set") return _Array$from(o);
  15002. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
  15003. }
  15004. module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15005. /***/ }),
  15006. /* 518 */
  15007. /***/ (function(module, exports, __webpack_require__) {
  15008. module.exports = __webpack_require__(519);
  15009. /***/ }),
  15010. /* 519 */
  15011. /***/ (function(module, exports, __webpack_require__) {
  15012. module.exports = __webpack_require__(520);
  15013. /***/ }),
  15014. /* 520 */
  15015. /***/ (function(module, exports, __webpack_require__) {
  15016. var parent = __webpack_require__(521);
  15017. module.exports = parent;
  15018. /***/ }),
  15019. /* 521 */
  15020. /***/ (function(module, exports, __webpack_require__) {
  15021. var parent = __webpack_require__(229);
  15022. module.exports = parent;
  15023. /***/ }),
  15024. /* 522 */
  15025. /***/ (function(module, exports, __webpack_require__) {
  15026. module.exports = __webpack_require__(523);
  15027. /***/ }),
  15028. /* 523 */
  15029. /***/ (function(module, exports, __webpack_require__) {
  15030. module.exports = __webpack_require__(524);
  15031. /***/ }),
  15032. /* 524 */
  15033. /***/ (function(module, exports, __webpack_require__) {
  15034. var parent = __webpack_require__(525);
  15035. module.exports = parent;
  15036. /***/ }),
  15037. /* 525 */
  15038. /***/ (function(module, exports, __webpack_require__) {
  15039. var parent = __webpack_require__(239);
  15040. module.exports = parent;
  15041. /***/ }),
  15042. /* 526 */
  15043. /***/ (function(module, exports) {
  15044. function _arrayLikeToArray(arr, len) {
  15045. if (len == null || len > arr.length) len = arr.length;
  15046. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  15047. arr2[i] = arr[i];
  15048. }
  15049. return arr2;
  15050. }
  15051. module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15052. /***/ }),
  15053. /* 527 */
  15054. /***/ (function(module, exports) {
  15055. function _nonIterableRest() {
  15056. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  15057. }
  15058. module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
  15059. /***/ }),
  15060. /* 528 */
  15061. /***/ (function(module, exports, __webpack_require__) {
  15062. var parent = __webpack_require__(529);
  15063. module.exports = parent;
  15064. /***/ }),
  15065. /* 529 */
  15066. /***/ (function(module, exports, __webpack_require__) {
  15067. __webpack_require__(530);
  15068. var path = __webpack_require__(10);
  15069. var Object = path.Object;
  15070. var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {
  15071. return Object.getOwnPropertyDescriptor(it, key);
  15072. };
  15073. if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;
  15074. /***/ }),
  15075. /* 530 */
  15076. /***/ (function(module, exports, __webpack_require__) {
  15077. var $ = __webpack_require__(0);
  15078. var fails = __webpack_require__(3);
  15079. var toIndexedObject = __webpack_require__(33);
  15080. var nativeGetOwnPropertyDescriptor = __webpack_require__(71).f;
  15081. var DESCRIPTORS = __webpack_require__(16);
  15082. var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
  15083. var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
  15084. // `Object.getOwnPropertyDescriptor` method
  15085. // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
  15086. $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
  15087. getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
  15088. return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
  15089. }
  15090. });
  15091. /***/ }),
  15092. /* 531 */
  15093. /***/ (function(module, exports, __webpack_require__) {
  15094. "use strict";
  15095. var _ = __webpack_require__(2);
  15096. var AVError = __webpack_require__(43);
  15097. module.exports = function (AV) {
  15098. AV.Role = AV.Object.extend('_Role',
  15099. /** @lends AV.Role.prototype */
  15100. {
  15101. // Instance Methods
  15102. /**
  15103. * Represents a Role on the AV server. Roles represent groupings of
  15104. * Users for the purposes of granting permissions (e.g. specifying an ACL
  15105. * for an Object). Roles are specified by their sets of child users and
  15106. * child roles, all of which are granted any permissions that the parent
  15107. * role has.
  15108. *
  15109. * <p>Roles must have a name (which cannot be changed after creation of the
  15110. * role), and must specify an ACL.</p>
  15111. * An AV.Role is a local representation of a role persisted to the AV
  15112. * cloud.
  15113. * @class AV.Role
  15114. * @param {String} name The name of the Role to create.
  15115. * @param {AV.ACL} acl The ACL for this role.
  15116. */
  15117. constructor: function constructor(name, acl) {
  15118. if (_.isString(name)) {
  15119. AV.Object.prototype.constructor.call(this, null, null);
  15120. this.setName(name);
  15121. } else {
  15122. AV.Object.prototype.constructor.call(this, name, acl);
  15123. }
  15124. if (acl) {
  15125. if (!(acl instanceof AV.ACL)) {
  15126. throw new TypeError('acl must be an instance of AV.ACL');
  15127. } else {
  15128. this.setACL(acl);
  15129. }
  15130. }
  15131. },
  15132. /**
  15133. * Gets the name of the role. You can alternatively call role.get("name")
  15134. *
  15135. * @return {String} the name of the role.
  15136. */
  15137. getName: function getName() {
  15138. return this.get('name');
  15139. },
  15140. /**
  15141. * Sets the name for a role. This value must be set before the role has
  15142. * been saved to the server, and cannot be set once the role has been
  15143. * saved.
  15144. *
  15145. * <p>
  15146. * A role's name can only contain alphanumeric characters, _, -, and
  15147. * spaces.
  15148. * </p>
  15149. *
  15150. * <p>This is equivalent to calling role.set("name", name)</p>
  15151. *
  15152. * @param {String} name The name of the role.
  15153. */
  15154. setName: function setName(name, options) {
  15155. return this.set('name', name, options);
  15156. },
  15157. /**
  15158. * Gets the AV.Relation for the AV.Users that are direct
  15159. * children of this role. These users are granted any privileges that this
  15160. * role has been granted (e.g. read or write access through ACLs). You can
  15161. * add or remove users from the role through this relation.
  15162. *
  15163. * <p>This is equivalent to calling role.relation("users")</p>
  15164. *
  15165. * @return {AV.Relation} the relation for the users belonging to this
  15166. * role.
  15167. */
  15168. getUsers: function getUsers() {
  15169. return this.relation('users');
  15170. },
  15171. /**
  15172. * Gets the AV.Relation for the AV.Roles that are direct
  15173. * children of this role. These roles' users are granted any privileges that
  15174. * this role has been granted (e.g. read or write access through ACLs). You
  15175. * can add or remove child roles from this role through this relation.
  15176. *
  15177. * <p>This is equivalent to calling role.relation("roles")</p>
  15178. *
  15179. * @return {AV.Relation} the relation for the roles belonging to this
  15180. * role.
  15181. */
  15182. getRoles: function getRoles() {
  15183. return this.relation('roles');
  15184. },
  15185. /**
  15186. * @ignore
  15187. */
  15188. validate: function validate(attrs, options) {
  15189. if ('name' in attrs && attrs.name !== this.getName()) {
  15190. var newName = attrs.name;
  15191. if (this.id && this.id !== attrs.objectId) {
  15192. // Check to see if the objectId being set matches this.id.
  15193. // This happens during a fetch -- the id is set before calling fetch.
  15194. // Let the name be set in this case.
  15195. return new AVError(AVError.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
  15196. }
  15197. if (!_.isString(newName)) {
  15198. return new AVError(AVError.OTHER_CAUSE, "A role's name must be a String.");
  15199. }
  15200. if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
  15201. return new AVError(AVError.OTHER_CAUSE, "A role's name can only contain alphanumeric characters, _," + ' -, and spaces.');
  15202. }
  15203. }
  15204. if (AV.Object.prototype.validate) {
  15205. return AV.Object.prototype.validate.call(this, attrs, options);
  15206. }
  15207. return false;
  15208. }
  15209. });
  15210. };
  15211. /***/ }),
  15212. /* 532 */
  15213. /***/ (function(module, exports, __webpack_require__) {
  15214. "use strict";
  15215. var _interopRequireDefault = __webpack_require__(1);
  15216. var _defineProperty2 = _interopRequireDefault(__webpack_require__(533));
  15217. var _promise = _interopRequireDefault(__webpack_require__(12));
  15218. var _map = _interopRequireDefault(__webpack_require__(42));
  15219. var _find = _interopRequireDefault(__webpack_require__(110));
  15220. var _stringify = _interopRequireDefault(__webpack_require__(36));
  15221. var _ = __webpack_require__(2);
  15222. var uuid = __webpack_require__(221);
  15223. var AVError = __webpack_require__(43);
  15224. var _require = __webpack_require__(26),
  15225. AVRequest = _require._request,
  15226. request = _require.request;
  15227. var _require2 = __webpack_require__(68),
  15228. getAdapter = _require2.getAdapter;
  15229. var PLATFORM_ANONYMOUS = 'anonymous';
  15230. var PLATFORM_QQAPP = 'lc_qqapp';
  15231. var mergeUnionDataIntoAuthData = function mergeUnionDataIntoAuthData() {
  15232. var defaultUnionIdPlatform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'weixin';
  15233. return function (authData, unionId) {
  15234. var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  15235. _ref$unionIdPlatform = _ref.unionIdPlatform,
  15236. unionIdPlatform = _ref$unionIdPlatform === void 0 ? defaultUnionIdPlatform : _ref$unionIdPlatform,
  15237. _ref$asMainAccount = _ref.asMainAccount,
  15238. asMainAccount = _ref$asMainAccount === void 0 ? false : _ref$asMainAccount;
  15239. if (typeof unionId !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionId is not a string');
  15240. if (typeof unionIdPlatform !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionIdPlatform is not a string');
  15241. return _.extend({}, authData, {
  15242. platform: unionIdPlatform,
  15243. unionid: unionId,
  15244. main_account: Boolean(asMainAccount)
  15245. });
  15246. };
  15247. };
  15248. module.exports = function (AV) {
  15249. /**
  15250. * @class
  15251. *
  15252. * <p>An AV.User object is a local representation of a user persisted to the
  15253. * LeanCloud server. This class is a subclass of an AV.Object, and retains the
  15254. * same functionality of an AV.Object, but also extends it with various
  15255. * user specific methods, like authentication, signing up, and validation of
  15256. * uniqueness.</p>
  15257. */
  15258. AV.User = AV.Object.extend('_User',
  15259. /** @lends AV.User.prototype */
  15260. {
  15261. // Instance Variables
  15262. _isCurrentUser: false,
  15263. // Instance Methods
  15264. /**
  15265. * Internal method to handle special fields in a _User response.
  15266. * @private
  15267. */
  15268. _mergeMagicFields: function _mergeMagicFields(attrs) {
  15269. if (attrs.sessionToken) {
  15270. this._sessionToken = attrs.sessionToken;
  15271. delete attrs.sessionToken;
  15272. }
  15273. return AV.User.__super__._mergeMagicFields.call(this, attrs);
  15274. },
  15275. /**
  15276. * Removes null values from authData (which exist temporarily for
  15277. * unlinking)
  15278. * @private
  15279. */
  15280. _cleanupAuthData: function _cleanupAuthData() {
  15281. if (!this.isCurrent()) {
  15282. return;
  15283. }
  15284. var authData = this.get('authData');
  15285. if (!authData) {
  15286. return;
  15287. }
  15288. AV._objectEach(this.get('authData'), function (value, key) {
  15289. if (!authData[key]) {
  15290. delete authData[key];
  15291. }
  15292. });
  15293. },
  15294. /**
  15295. * Synchronizes authData for all providers.
  15296. * @private
  15297. */
  15298. _synchronizeAllAuthData: function _synchronizeAllAuthData() {
  15299. var authData = this.get('authData');
  15300. if (!authData) {
  15301. return;
  15302. }
  15303. var self = this;
  15304. AV._objectEach(this.get('authData'), function (value, key) {
  15305. self._synchronizeAuthData(key);
  15306. });
  15307. },
  15308. /**
  15309. * Synchronizes auth data for a provider (e.g. puts the access token in the
  15310. * right place to be used by the Facebook SDK).
  15311. * @private
  15312. */
  15313. _synchronizeAuthData: function _synchronizeAuthData(provider) {
  15314. if (!this.isCurrent()) {
  15315. return;
  15316. }
  15317. var authType;
  15318. if (_.isString(provider)) {
  15319. authType = provider;
  15320. provider = AV.User._authProviders[authType];
  15321. } else {
  15322. authType = provider.getAuthType();
  15323. }
  15324. var authData = this.get('authData');
  15325. if (!authData || !provider) {
  15326. return;
  15327. }
  15328. var success = provider.restoreAuthentication(authData[authType]);
  15329. if (!success) {
  15330. this.dissociateAuthData(provider);
  15331. }
  15332. },
  15333. _handleSaveResult: function _handleSaveResult(makeCurrent) {
  15334. // Clean up and synchronize the authData object, removing any unset values
  15335. if (makeCurrent && !AV._config.disableCurrentUser) {
  15336. this._isCurrentUser = true;
  15337. }
  15338. this._cleanupAuthData();
  15339. this._synchronizeAllAuthData(); // Don't keep the password around.
  15340. delete this._serverData.password;
  15341. this._rebuildEstimatedDataForKey('password');
  15342. this._refreshCache();
  15343. if ((makeCurrent || this.isCurrent()) && !AV._config.disableCurrentUser) {
  15344. // Some old version of leanengine-node-sdk will overwrite
  15345. // AV.User._saveCurrentUser which returns no Promise.
  15346. // So we need a Promise wrapper.
  15347. return _promise.default.resolve(AV.User._saveCurrentUser(this));
  15348. } else {
  15349. return _promise.default.resolve();
  15350. }
  15351. },
  15352. /**
  15353. * Unlike in the Android/iOS SDKs, logInWith is unnecessary, since you can
  15354. * call linkWith on the user (even if it doesn't exist yet on the server).
  15355. * @private
  15356. */
  15357. _linkWith: function _linkWith(provider, data) {
  15358. var _this = this;
  15359. var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  15360. _ref2$failOnNotExist = _ref2.failOnNotExist,
  15361. failOnNotExist = _ref2$failOnNotExist === void 0 ? false : _ref2$failOnNotExist;
  15362. var authType;
  15363. if (_.isString(provider)) {
  15364. authType = provider;
  15365. provider = AV.User._authProviders[provider];
  15366. } else {
  15367. authType = provider.getAuthType();
  15368. }
  15369. if (data) {
  15370. return this.save({
  15371. authData: (0, _defineProperty2.default)({}, authType, data)
  15372. }, {
  15373. fetchWhenSave: !!this.get('authData'),
  15374. _failOnNotExist: failOnNotExist
  15375. }).then(function (model) {
  15376. return model._handleSaveResult(true).then(function () {
  15377. return model;
  15378. });
  15379. });
  15380. } else {
  15381. return provider.authenticate().then(function (result) {
  15382. return _this._linkWith(provider, result);
  15383. });
  15384. }
  15385. },
  15386. /**
  15387. * Associate the user with a third party authData.
  15388. * @since 3.3.0
  15389. * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
  15390. * @param {string} platform Available platform for sign up.
  15391. * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
  15392. * @example user.associateWithAuthData({
  15393. * openid: 'abc123',
  15394. * access_token: '123abc',
  15395. * expires_in: 1382686496
  15396. * }, 'weixin').then(function(user) {
  15397. * //Access user here
  15398. * }).catch(function(error) {
  15399. * //console.error("error: ", error);
  15400. * });
  15401. */
  15402. associateWithAuthData: function associateWithAuthData(authData, platform) {
  15403. return this._linkWith(platform, authData);
  15404. },
  15405. /**
  15406. * Associate the user with a third party authData and unionId.
  15407. * @since 3.5.0
  15408. * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
  15409. * @param {string} platform Available platform for sign up.
  15410. * @param {string} unionId
  15411. * @param {Object} [unionLoginOptions]
  15412. * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
  15413. * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
  15414. * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
  15415. * @example user.associateWithAuthDataAndUnionId({
  15416. * openid: 'abc123',
  15417. * access_token: '123abc',
  15418. * expires_in: 1382686496
  15419. * }, 'weixin', 'union123', {
  15420. * unionIdPlatform: 'weixin',
  15421. * asMainAccount: true,
  15422. * }).then(function(user) {
  15423. * //Access user here
  15424. * }).catch(function(error) {
  15425. * //console.error("error: ", error);
  15426. * });
  15427. */
  15428. associateWithAuthDataAndUnionId: function associateWithAuthDataAndUnionId(authData, platform, unionId, unionOptions) {
  15429. return this._linkWith(platform, mergeUnionDataIntoAuthData()(authData, unionId, unionOptions));
  15430. },
  15431. /**
  15432. * Associate the user with the identity of the current mini-app.
  15433. * @since 4.6.0
  15434. * @param {Object} [authInfo]
  15435. * @param {Object} [option]
  15436. * @param {Boolean} [option.failOnNotExist] If true, the login request will fail when no user matches this authInfo.authData exists.
  15437. * @return {Promise<AV.User>}
  15438. */
  15439. associateWithMiniApp: function associateWithMiniApp(authInfo, option) {
  15440. var _this2 = this;
  15441. if (authInfo === undefined) {
  15442. var getAuthInfo = getAdapter('getAuthInfo');
  15443. return getAuthInfo().then(function (authInfo) {
  15444. return _this2._linkWith(authInfo.provider, authInfo.authData, option);
  15445. });
  15446. }
  15447. return this._linkWith(authInfo.provider, authInfo.authData, option);
  15448. },
  15449. /**
  15450. * 将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的微信帐号。
  15451. * 仅在 QQ 小程序中可用。
  15452. *
  15453. * @deprecated Please use {@link AV.User#associateWithMiniApp}
  15454. * @since 4.2.0
  15455. * @param {Object} [options]
  15456. * @param {boolean} [options.preferUnionId = false] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
  15457. * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
  15458. * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
  15459. * @return {Promise<AV.User>}
  15460. */
  15461. associateWithQQApp: function associateWithQQApp() {
  15462. var _this3 = this;
  15463. var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15464. _ref3$preferUnionId = _ref3.preferUnionId,
  15465. preferUnionId = _ref3$preferUnionId === void 0 ? false : _ref3$preferUnionId,
  15466. _ref3$unionIdPlatform = _ref3.unionIdPlatform,
  15467. unionIdPlatform = _ref3$unionIdPlatform === void 0 ? 'qq' : _ref3$unionIdPlatform,
  15468. _ref3$asMainAccount = _ref3.asMainAccount,
  15469. asMainAccount = _ref3$asMainAccount === void 0 ? true : _ref3$asMainAccount;
  15470. var getAuthInfo = getAdapter('getAuthInfo');
  15471. return getAuthInfo({
  15472. preferUnionId: preferUnionId,
  15473. asMainAccount: asMainAccount,
  15474. platform: unionIdPlatform
  15475. }).then(function (authInfo) {
  15476. authInfo.provider = PLATFORM_QQAPP;
  15477. return _this3.associateWithMiniApp(authInfo);
  15478. });
  15479. },
  15480. /**
  15481. * 将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
  15482. * 仅在微信小程序中可用。
  15483. *
  15484. * @deprecated Please use {@link AV.User#associateWithMiniApp}
  15485. * @since 3.13.0
  15486. * @param {Object} [options]
  15487. * @param {boolean} [options.preferUnionId = false] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否将 UnionId 保存在用户账号中。
  15488. * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
  15489. * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
  15490. * @return {Promise<AV.User>}
  15491. */
  15492. associateWithWeapp: function associateWithWeapp() {
  15493. var _this4 = this;
  15494. var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15495. _ref4$preferUnionId = _ref4.preferUnionId,
  15496. preferUnionId = _ref4$preferUnionId === void 0 ? false : _ref4$preferUnionId,
  15497. _ref4$unionIdPlatform = _ref4.unionIdPlatform,
  15498. unionIdPlatform = _ref4$unionIdPlatform === void 0 ? 'weixin' : _ref4$unionIdPlatform,
  15499. _ref4$asMainAccount = _ref4.asMainAccount,
  15500. asMainAccount = _ref4$asMainAccount === void 0 ? true : _ref4$asMainAccount;
  15501. var getAuthInfo = getAdapter('getAuthInfo');
  15502. return getAuthInfo({
  15503. preferUnionId: preferUnionId,
  15504. asMainAccount: asMainAccount,
  15505. platform: unionIdPlatform
  15506. }).then(function (authInfo) {
  15507. return _this4.associateWithMiniApp(authInfo);
  15508. });
  15509. },
  15510. /**
  15511. * @deprecated renamed to {@link AV.User#associateWithWeapp}
  15512. * @return {Promise<AV.User>}
  15513. */
  15514. linkWithWeapp: function linkWithWeapp(options) {
  15515. console.warn('DEPRECATED: User#linkWithWeapp 已废弃,请使用 User#associateWithWeapp 代替');
  15516. return this.associateWithWeapp(options);
  15517. },
  15518. /**
  15519. * 将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的 QQ 帐号。
  15520. * 仅在 QQ 小程序中可用。
  15521. *
  15522. * @deprecated Please use {@link AV.User#associateWithMiniApp}
  15523. * @since 4.2.0
  15524. * @param {string} unionId
  15525. * @param {Object} [unionOptions]
  15526. * @param {string} [unionOptions.unionIdPlatform = 'qq'] unionId platform
  15527. * @param {boolean} [unionOptions.asMainAccount = false] If true, the unionId will be associated with the user.
  15528. * @return {Promise<AV.User>}
  15529. */
  15530. associateWithQQAppWithUnionId: function associateWithQQAppWithUnionId(unionId) {
  15531. var _this5 = this;
  15532. var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  15533. _ref5$unionIdPlatform = _ref5.unionIdPlatform,
  15534. unionIdPlatform = _ref5$unionIdPlatform === void 0 ? 'qq' : _ref5$unionIdPlatform,
  15535. _ref5$asMainAccount = _ref5.asMainAccount,
  15536. asMainAccount = _ref5$asMainAccount === void 0 ? false : _ref5$asMainAccount;
  15537. var getAuthInfo = getAdapter('getAuthInfo');
  15538. return getAuthInfo({
  15539. platform: unionIdPlatform
  15540. }).then(function (authInfo) {
  15541. authInfo = AV.User.mergeUnionId(authInfo, unionId, {
  15542. asMainAccount: asMainAccount
  15543. });
  15544. authInfo.provider = PLATFORM_QQAPP;
  15545. return _this5.associateWithMiniApp(authInfo);
  15546. });
  15547. },
  15548. /**
  15549. * 将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
  15550. * 仅在微信小程序中可用。
  15551. *
  15552. * @deprecated Please use {@link AV.User#associateWithMiniApp}
  15553. * @since 3.13.0
  15554. * @param {string} unionId
  15555. * @param {Object} [unionOptions]
  15556. * @param {string} [unionOptions.unionIdPlatform = 'weixin'] unionId platform
  15557. * @param {boolean} [unionOptions.asMainAccount = false] If true, the unionId will be associated with the user.
  15558. * @return {Promise<AV.User>}
  15559. */
  15560. associateWithWeappWithUnionId: function associateWithWeappWithUnionId(unionId) {
  15561. var _this6 = this;
  15562. var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  15563. _ref6$unionIdPlatform = _ref6.unionIdPlatform,
  15564. unionIdPlatform = _ref6$unionIdPlatform === void 0 ? 'weixin' : _ref6$unionIdPlatform,
  15565. _ref6$asMainAccount = _ref6.asMainAccount,
  15566. asMainAccount = _ref6$asMainAccount === void 0 ? false : _ref6$asMainAccount;
  15567. var getAuthInfo = getAdapter('getAuthInfo');
  15568. return getAuthInfo({
  15569. platform: unionIdPlatform
  15570. }).then(function (authInfo) {
  15571. authInfo = AV.User.mergeUnionId(authInfo, unionId, {
  15572. asMainAccount: asMainAccount
  15573. });
  15574. return _this6.associateWithMiniApp(authInfo);
  15575. });
  15576. },
  15577. /**
  15578. * Unlinks a user from a service.
  15579. * @param {string} platform
  15580. * @return {Promise<AV.User>}
  15581. * @since 3.3.0
  15582. */
  15583. dissociateAuthData: function dissociateAuthData(provider) {
  15584. this.unset("authData.".concat(provider));
  15585. return this.save().then(function (model) {
  15586. return model._handleSaveResult(true).then(function () {
  15587. return model;
  15588. });
  15589. });
  15590. },
  15591. /**
  15592. * @private
  15593. * @deprecated
  15594. */
  15595. _unlinkFrom: function _unlinkFrom(provider) {
  15596. console.warn('DEPRECATED: User#_unlinkFrom 已废弃,请使用 User#dissociateAuthData 代替');
  15597. return this.dissociateAuthData(provider);
  15598. },
  15599. /**
  15600. * Checks whether a user is linked to a service.
  15601. * @private
  15602. */
  15603. _isLinked: function _isLinked(provider) {
  15604. var authType;
  15605. if (_.isString(provider)) {
  15606. authType = provider;
  15607. } else {
  15608. authType = provider.getAuthType();
  15609. }
  15610. var authData = this.get('authData') || {};
  15611. return !!authData[authType];
  15612. },
  15613. /**
  15614. * Checks whether a user is anonymous.
  15615. * @since 3.9.0
  15616. * @return {boolean}
  15617. */
  15618. isAnonymous: function isAnonymous() {
  15619. return this._isLinked(PLATFORM_ANONYMOUS);
  15620. },
  15621. logOut: function logOut() {
  15622. this._logOutWithAll();
  15623. this._isCurrentUser = false;
  15624. },
  15625. /**
  15626. * Deauthenticates all providers.
  15627. * @private
  15628. */
  15629. _logOutWithAll: function _logOutWithAll() {
  15630. var authData = this.get('authData');
  15631. if (!authData) {
  15632. return;
  15633. }
  15634. var self = this;
  15635. AV._objectEach(this.get('authData'), function (value, key) {
  15636. self._logOutWith(key);
  15637. });
  15638. },
  15639. /**
  15640. * Deauthenticates a single provider (e.g. removing access tokens from the
  15641. * Facebook SDK).
  15642. * @private
  15643. */
  15644. _logOutWith: function _logOutWith(provider) {
  15645. if (!this.isCurrent()) {
  15646. return;
  15647. }
  15648. if (_.isString(provider)) {
  15649. provider = AV.User._authProviders[provider];
  15650. }
  15651. if (provider && provider.deauthenticate) {
  15652. provider.deauthenticate();
  15653. }
  15654. },
  15655. /**
  15656. * Signs up a new user. You should call this instead of save for
  15657. * new AV.Users. This will create a new AV.User on the server, and
  15658. * also persist the session on disk so that you can access the user using
  15659. * <code>current</code>.
  15660. *
  15661. * <p>A username and password must be set before calling signUp.</p>
  15662. *
  15663. * @param {Object} attrs Extra fields to set on the new user, or null.
  15664. * @param {AuthOptions} options
  15665. * @return {Promise} A promise that is fulfilled when the signup
  15666. * finishes.
  15667. * @see AV.User.signUp
  15668. */
  15669. signUp: function signUp(attrs, options) {
  15670. var error;
  15671. var username = attrs && attrs.username || this.get('username');
  15672. if (!username || username === '') {
  15673. error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty name.');
  15674. throw error;
  15675. }
  15676. var password = attrs && attrs.password || this.get('password');
  15677. if (!password || password === '') {
  15678. error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty password.');
  15679. throw error;
  15680. }
  15681. return this.save(attrs, options).then(function (model) {
  15682. if (model.isAnonymous()) {
  15683. model.unset("authData.".concat(PLATFORM_ANONYMOUS));
  15684. model._opSetQueue = [{}];
  15685. }
  15686. return model._handleSaveResult(true).then(function () {
  15687. return model;
  15688. });
  15689. });
  15690. },
  15691. /**
  15692. * Signs up a new user with mobile phone and sms code.
  15693. * You should call this instead of save for
  15694. * new AV.Users. This will create a new AV.User on the server, and
  15695. * also persist the session on disk so that you can access the user using
  15696. * <code>current</code>.
  15697. *
  15698. * <p>A username and password must be set before calling signUp.</p>
  15699. *
  15700. * @param {Object} attrs Extra fields to set on the new user, or null.
  15701. * @param {AuthOptions} options
  15702. * @return {Promise} A promise that is fulfilled when the signup
  15703. * finishes.
  15704. * @see AV.User.signUpOrlogInWithMobilePhone
  15705. * @see AV.Cloud.requestSmsCode
  15706. */
  15707. signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(attrs) {
  15708. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15709. var error;
  15710. var mobilePhoneNumber = attrs && attrs.mobilePhoneNumber || this.get('mobilePhoneNumber');
  15711. if (!mobilePhoneNumber || mobilePhoneNumber === '') {
  15712. error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty mobilePhoneNumber.');
  15713. throw error;
  15714. }
  15715. var smsCode = attrs && attrs.smsCode || this.get('smsCode');
  15716. if (!smsCode || smsCode === '') {
  15717. error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty smsCode.');
  15718. throw error;
  15719. }
  15720. options._makeRequest = function (route, className, id, method, json) {
  15721. return AVRequest('usersByMobilePhone', null, null, 'POST', json);
  15722. };
  15723. return this.save(attrs, options).then(function (model) {
  15724. delete model.attributes.smsCode;
  15725. delete model._serverData.smsCode;
  15726. return model._handleSaveResult(true).then(function () {
  15727. return model;
  15728. });
  15729. });
  15730. },
  15731. /**
  15732. * The same with {@link AV.User.loginWithAuthData}, except that you can set attributes before login.
  15733. * @since 3.7.0
  15734. */
  15735. loginWithAuthData: function loginWithAuthData(authData, platform, options) {
  15736. return this._linkWith(platform, authData, options);
  15737. },
  15738. /**
  15739. * The same with {@link AV.User.loginWithAuthDataAndUnionId}, except that you can set attributes before login.
  15740. * @since 3.7.0
  15741. */
  15742. loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
  15743. return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
  15744. },
  15745. /**
  15746. * The same with {@link AV.User.loginWithWeapp}, except that you can set attributes before login.
  15747. * @deprecated please use {@link AV.User#loginWithMiniApp}
  15748. * @since 3.7.0
  15749. * @param {Object} [options]
  15750. * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
  15751. * @param {boolean} [options.preferUnionId] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否使用 UnionId 登录。(since 3.13.0)
  15752. * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
  15753. * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
  15754. * @return {Promise<AV.User>}
  15755. */
  15756. loginWithWeapp: function loginWithWeapp() {
  15757. var _this7 = this;
  15758. var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15759. _ref7$preferUnionId = _ref7.preferUnionId,
  15760. preferUnionId = _ref7$preferUnionId === void 0 ? false : _ref7$preferUnionId,
  15761. _ref7$unionIdPlatform = _ref7.unionIdPlatform,
  15762. unionIdPlatform = _ref7$unionIdPlatform === void 0 ? 'weixin' : _ref7$unionIdPlatform,
  15763. _ref7$asMainAccount = _ref7.asMainAccount,
  15764. asMainAccount = _ref7$asMainAccount === void 0 ? true : _ref7$asMainAccount,
  15765. _ref7$failOnNotExist = _ref7.failOnNotExist,
  15766. failOnNotExist = _ref7$failOnNotExist === void 0 ? false : _ref7$failOnNotExist;
  15767. var getAuthInfo = getAdapter('getAuthInfo');
  15768. return getAuthInfo({
  15769. preferUnionId: preferUnionId,
  15770. asMainAccount: asMainAccount,
  15771. platform: unionIdPlatform
  15772. }).then(function (authInfo) {
  15773. return _this7.loginWithMiniApp(authInfo, {
  15774. failOnNotExist: failOnNotExist
  15775. });
  15776. });
  15777. },
  15778. /**
  15779. * The same with {@link AV.User.loginWithWeappWithUnionId}, except that you can set attributes before login.
  15780. * @deprecated please use {@link AV.User#loginWithMiniApp}
  15781. * @since 3.13.0
  15782. */
  15783. loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
  15784. var _this8 = this;
  15785. var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  15786. _ref8$unionIdPlatform = _ref8.unionIdPlatform,
  15787. unionIdPlatform = _ref8$unionIdPlatform === void 0 ? 'weixin' : _ref8$unionIdPlatform,
  15788. _ref8$asMainAccount = _ref8.asMainAccount,
  15789. asMainAccount = _ref8$asMainAccount === void 0 ? false : _ref8$asMainAccount,
  15790. _ref8$failOnNotExist = _ref8.failOnNotExist,
  15791. failOnNotExist = _ref8$failOnNotExist === void 0 ? false : _ref8$failOnNotExist;
  15792. var getAuthInfo = getAdapter('getAuthInfo');
  15793. return getAuthInfo({
  15794. platform: unionIdPlatform
  15795. }).then(function (authInfo) {
  15796. authInfo = AV.User.mergeUnionId(authInfo, unionId, {
  15797. asMainAccount: asMainAccount
  15798. });
  15799. return _this8.loginWithMiniApp(authInfo, {
  15800. failOnNotExist: failOnNotExist
  15801. });
  15802. });
  15803. },
  15804. /**
  15805. * The same with {@link AV.User.loginWithQQApp}, except that you can set attributes before login.
  15806. * @deprecated please use {@link AV.User#loginWithMiniApp}
  15807. * @since 4.2.0
  15808. * @param {Object} [options]
  15809. * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
  15810. * @param {boolean} [options.preferUnionId] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
  15811. * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
  15812. * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
  15813. */
  15814. loginWithQQApp: function loginWithQQApp() {
  15815. var _this9 = this;
  15816. var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  15817. _ref9$preferUnionId = _ref9.preferUnionId,
  15818. preferUnionId = _ref9$preferUnionId === void 0 ? false : _ref9$preferUnionId,
  15819. _ref9$unionIdPlatform = _ref9.unionIdPlatform,
  15820. unionIdPlatform = _ref9$unionIdPlatform === void 0 ? 'qq' : _ref9$unionIdPlatform,
  15821. _ref9$asMainAccount = _ref9.asMainAccount,
  15822. asMainAccount = _ref9$asMainAccount === void 0 ? true : _ref9$asMainAccount,
  15823. _ref9$failOnNotExist = _ref9.failOnNotExist,
  15824. failOnNotExist = _ref9$failOnNotExist === void 0 ? false : _ref9$failOnNotExist;
  15825. var getAuthInfo = getAdapter('getAuthInfo');
  15826. return getAuthInfo({
  15827. preferUnionId: preferUnionId,
  15828. asMainAccount: asMainAccount,
  15829. platform: unionIdPlatform
  15830. }).then(function (authInfo) {
  15831. authInfo.provider = PLATFORM_QQAPP;
  15832. return _this9.loginWithMiniApp(authInfo, {
  15833. failOnNotExist: failOnNotExist
  15834. });
  15835. });
  15836. },
  15837. /**
  15838. * The same with {@link AV.User.loginWithQQAppWithUnionId}, except that you can set attributes before login.
  15839. * @deprecated please use {@link AV.User#loginWithMiniApp}
  15840. * @since 4.2.0
  15841. */
  15842. loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
  15843. var _this10 = this;
  15844. var _ref10 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  15845. _ref10$unionIdPlatfor = _ref10.unionIdPlatform,
  15846. unionIdPlatform = _ref10$unionIdPlatfor === void 0 ? 'qq' : _ref10$unionIdPlatfor,
  15847. _ref10$asMainAccount = _ref10.asMainAccount,
  15848. asMainAccount = _ref10$asMainAccount === void 0 ? false : _ref10$asMainAccount,
  15849. _ref10$failOnNotExist = _ref10.failOnNotExist,
  15850. failOnNotExist = _ref10$failOnNotExist === void 0 ? false : _ref10$failOnNotExist;
  15851. var getAuthInfo = getAdapter('getAuthInfo');
  15852. return getAuthInfo({
  15853. platform: unionIdPlatform
  15854. }).then(function (authInfo) {
  15855. authInfo = AV.User.mergeUnionId(authInfo, unionId, {
  15856. asMainAccount: asMainAccount
  15857. });
  15858. authInfo.provider = PLATFORM_QQAPP;
  15859. return _this10.loginWithMiniApp(authInfo, {
  15860. failOnNotExist: failOnNotExist
  15861. });
  15862. });
  15863. },
  15864. /**
  15865. * The same with {@link AV.User.loginWithMiniApp}, except that you can set attributes before login.
  15866. * @since 4.6.0
  15867. */
  15868. loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
  15869. var _this11 = this;
  15870. if (authInfo === undefined) {
  15871. var getAuthInfo = getAdapter('getAuthInfo');
  15872. return getAuthInfo().then(function (authInfo) {
  15873. return _this11.loginWithAuthData(authInfo.authData, authInfo.provider, option);
  15874. });
  15875. }
  15876. return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
  15877. },
  15878. /**
  15879. * Logs in a AV.User. On success, this saves the session to localStorage,
  15880. * so you can retrieve the currently logged in user using
  15881. * <code>current</code>.
  15882. *
  15883. * <p>A username and password must be set before calling logIn.</p>
  15884. *
  15885. * @see AV.User.logIn
  15886. * @return {Promise} A promise that is fulfilled with the user when
  15887. * the login is complete.
  15888. */
  15889. logIn: function logIn() {
  15890. var model = this;
  15891. var request = AVRequest('login', null, null, 'POST', this.toJSON());
  15892. return request.then(function (resp) {
  15893. var serverAttrs = model.parse(resp);
  15894. model._finishFetch(serverAttrs);
  15895. return model._handleSaveResult(true).then(function () {
  15896. if (!serverAttrs.smsCode) delete model.attributes['smsCode'];
  15897. return model;
  15898. });
  15899. });
  15900. },
  15901. /**
  15902. * @see AV.Object#save
  15903. */
  15904. save: function save(arg1, arg2, arg3) {
  15905. var attrs, options;
  15906. if (_.isObject(arg1) || _.isNull(arg1) || _.isUndefined(arg1)) {
  15907. attrs = arg1;
  15908. options = arg2;
  15909. } else {
  15910. attrs = {};
  15911. attrs[arg1] = arg2;
  15912. options = arg3;
  15913. }
  15914. options = options || {};
  15915. return AV.Object.prototype.save.call(this, attrs, options).then(function (model) {
  15916. return model._handleSaveResult(false).then(function () {
  15917. return model;
  15918. });
  15919. });
  15920. },
  15921. /**
  15922. * Follow a user
  15923. * @since 0.3.0
  15924. * @param {Object | AV.User | String} options if an AV.User or string is given, it will be used as the target user.
  15925. * @param {AV.User | String} options.user The target user or user's objectId to follow.
  15926. * @param {Object} [options.attributes] key-value attributes dictionary to be used as
  15927. * conditions of followerQuery/followeeQuery.
  15928. * @param {AuthOptions} [authOptions]
  15929. */
  15930. follow: function follow(options, authOptions) {
  15931. if (!this.id) {
  15932. throw new Error('Please signin.');
  15933. }
  15934. var user;
  15935. var attributes;
  15936. if (options.user) {
  15937. user = options.user;
  15938. attributes = options.attributes;
  15939. } else {
  15940. user = options;
  15941. }
  15942. var userObjectId = _.isString(user) ? user : user.id;
  15943. if (!userObjectId) {
  15944. throw new Error('Invalid target user.');
  15945. }
  15946. var route = 'users/' + this.id + '/friendship/' + userObjectId;
  15947. var request = AVRequest(route, null, null, 'POST', AV._encode(attributes), authOptions);
  15948. return request;
  15949. },
  15950. /**
  15951. * Unfollow a user.
  15952. * @since 0.3.0
  15953. * @param {Object | AV.User | String} options if an AV.User or string is given, it will be used as the target user.
  15954. * @param {AV.User | String} options.user The target user or user's objectId to unfollow.
  15955. * @param {AuthOptions} [authOptions]
  15956. */
  15957. unfollow: function unfollow(options, authOptions) {
  15958. if (!this.id) {
  15959. throw new Error('Please signin.');
  15960. }
  15961. var user;
  15962. if (options.user) {
  15963. user = options.user;
  15964. } else {
  15965. user = options;
  15966. }
  15967. var userObjectId = _.isString(user) ? user : user.id;
  15968. if (!userObjectId) {
  15969. throw new Error('Invalid target user.');
  15970. }
  15971. var route = 'users/' + this.id + '/friendship/' + userObjectId;
  15972. var request = AVRequest(route, null, null, 'DELETE', null, authOptions);
  15973. return request;
  15974. },
  15975. /**
  15976. * Get the user's followers and followees.
  15977. * @since 4.8.0
  15978. * @param {Object} [options]
  15979. * @param {Number} [options.skip]
  15980. * @param {Number} [options.limit]
  15981. * @param {AuthOptions} [authOptions]
  15982. */
  15983. getFollowersAndFollowees: function getFollowersAndFollowees(options, authOptions) {
  15984. if (!this.id) {
  15985. throw new Error('Please signin.');
  15986. }
  15987. return request({
  15988. method: 'GET',
  15989. path: "/users/".concat(this.id, "/followersAndFollowees"),
  15990. query: {
  15991. skip: options && options.skip,
  15992. limit: options && options.limit,
  15993. include: 'follower,followee',
  15994. keys: 'follower,followee'
  15995. },
  15996. authOptions: authOptions
  15997. }).then(function (_ref11) {
  15998. var followers = _ref11.followers,
  15999. followees = _ref11.followees;
  16000. return {
  16001. followers: (0, _map.default)(followers).call(followers, function (_ref12) {
  16002. var follower = _ref12.follower;
  16003. return AV._decode(follower);
  16004. }),
  16005. followees: (0, _map.default)(followees).call(followees, function (_ref13) {
  16006. var followee = _ref13.followee;
  16007. return AV._decode(followee);
  16008. })
  16009. };
  16010. });
  16011. },
  16012. /**
  16013. *Create a follower query to query the user's followers.
  16014. * @since 0.3.0
  16015. * @see AV.User#followerQuery
  16016. */
  16017. followerQuery: function followerQuery() {
  16018. return AV.User.followerQuery(this.id);
  16019. },
  16020. /**
  16021. *Create a followee query to query the user's followees.
  16022. * @since 0.3.0
  16023. * @see AV.User#followeeQuery
  16024. */
  16025. followeeQuery: function followeeQuery() {
  16026. return AV.User.followeeQuery(this.id);
  16027. },
  16028. /**
  16029. * @see AV.Object#fetch
  16030. */
  16031. fetch: function fetch(fetchOptions, options) {
  16032. return AV.Object.prototype.fetch.call(this, fetchOptions, options).then(function (model) {
  16033. return model._handleSaveResult(false).then(function () {
  16034. return model;
  16035. });
  16036. });
  16037. },
  16038. /**
  16039. * Update user's new password safely based on old password.
  16040. * @param {String} oldPassword the old password.
  16041. * @param {String} newPassword the new password.
  16042. * @param {AuthOptions} options
  16043. */
  16044. updatePassword: function updatePassword(oldPassword, newPassword, options) {
  16045. var _this12 = this;
  16046. var route = 'users/' + this.id + '/updatePassword';
  16047. var params = {
  16048. old_password: oldPassword,
  16049. new_password: newPassword
  16050. };
  16051. var request = AVRequest(route, null, null, 'PUT', params, options);
  16052. return request.then(function (resp) {
  16053. _this12._finishFetch(_this12.parse(resp));
  16054. return _this12._handleSaveResult(true).then(function () {
  16055. return resp;
  16056. });
  16057. });
  16058. },
  16059. /**
  16060. * Returns true if <code>current</code> would return this user.
  16061. * @see AV.User#current
  16062. */
  16063. isCurrent: function isCurrent() {
  16064. return this._isCurrentUser;
  16065. },
  16066. /**
  16067. * Returns get("username").
  16068. * @return {String}
  16069. * @see AV.Object#get
  16070. */
  16071. getUsername: function getUsername() {
  16072. return this.get('username');
  16073. },
  16074. /**
  16075. * Returns get("mobilePhoneNumber").
  16076. * @return {String}
  16077. * @see AV.Object#get
  16078. */
  16079. getMobilePhoneNumber: function getMobilePhoneNumber() {
  16080. return this.get('mobilePhoneNumber');
  16081. },
  16082. /**
  16083. * Calls set("mobilePhoneNumber", phoneNumber, options) and returns the result.
  16084. * @param {String} mobilePhoneNumber
  16085. * @return {Boolean}
  16086. * @see AV.Object#set
  16087. */
  16088. setMobilePhoneNumber: function setMobilePhoneNumber(phone, options) {
  16089. return this.set('mobilePhoneNumber', phone, options);
  16090. },
  16091. /**
  16092. * Calls set("username", username, options) and returns the result.
  16093. * @param {String} username
  16094. * @return {Boolean}
  16095. * @see AV.Object#set
  16096. */
  16097. setUsername: function setUsername(username, options) {
  16098. return this.set('username', username, options);
  16099. },
  16100. /**
  16101. * Calls set("password", password, options) and returns the result.
  16102. * @param {String} password
  16103. * @return {Boolean}
  16104. * @see AV.Object#set
  16105. */
  16106. setPassword: function setPassword(password, options) {
  16107. return this.set('password', password, options);
  16108. },
  16109. /**
  16110. * Returns get("email").
  16111. * @return {String}
  16112. * @see AV.Object#get
  16113. */
  16114. getEmail: function getEmail() {
  16115. return this.get('email');
  16116. },
  16117. /**
  16118. * Calls set("email", email, options) and returns the result.
  16119. * @param {String} email
  16120. * @param {AuthOptions} options
  16121. * @return {Boolean}
  16122. * @see AV.Object#set
  16123. */
  16124. setEmail: function setEmail(email, options) {
  16125. return this.set('email', email, options);
  16126. },
  16127. /**
  16128. * Checks whether this user is the current user and has been authenticated.
  16129. * @deprecated 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),
  16130. * 如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id
  16131. * @return (Boolean) whether this user is the current user and is logged in.
  16132. */
  16133. authenticated: function authenticated() {
  16134. console.warn('DEPRECATED: 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id。');
  16135. return !!this._sessionToken && !AV._config.disableCurrentUser && AV.User.current() && AV.User.current().id === this.id;
  16136. },
  16137. /**
  16138. * Detects if current sessionToken is valid.
  16139. *
  16140. * @since 2.0.0
  16141. * @return Promise.<Boolean>
  16142. */
  16143. isAuthenticated: function isAuthenticated() {
  16144. var _this13 = this;
  16145. return _promise.default.resolve().then(function () {
  16146. return !!_this13._sessionToken && AV.User._fetchUserBySessionToken(_this13._sessionToken).then(function () {
  16147. return true;
  16148. }, function (error) {
  16149. if (error.code === 211) {
  16150. return false;
  16151. }
  16152. throw error;
  16153. });
  16154. });
  16155. },
  16156. /**
  16157. * Get sessionToken of current user.
  16158. * @return {String} sessionToken
  16159. */
  16160. getSessionToken: function getSessionToken() {
  16161. return this._sessionToken;
  16162. },
  16163. /**
  16164. * Refresh sessionToken of current user.
  16165. * @since 2.1.0
  16166. * @param {AuthOptions} [options]
  16167. * @return {Promise.<AV.User>} user with refreshed sessionToken
  16168. */
  16169. refreshSessionToken: function refreshSessionToken(options) {
  16170. var _this14 = this;
  16171. return AVRequest("users/".concat(this.id, "/refreshSessionToken"), null, null, 'PUT', null, options).then(function (response) {
  16172. _this14._finishFetch(response);
  16173. return _this14._handleSaveResult(true).then(function () {
  16174. return _this14;
  16175. });
  16176. });
  16177. },
  16178. /**
  16179. * Get this user's Roles.
  16180. * @param {AuthOptions} [options]
  16181. * @return {Promise.<AV.Role[]>} A promise that is fulfilled with the roles when
  16182. * the query is complete.
  16183. */
  16184. getRoles: function getRoles(options) {
  16185. var _context;
  16186. return (0, _find.default)(_context = AV.Relation.reverseQuery('_Role', 'users', this)).call(_context, options);
  16187. }
  16188. },
  16189. /** @lends AV.User */
  16190. {
  16191. // Class Variables
  16192. // The currently logged-in user.
  16193. _currentUser: null,
  16194. // Whether currentUser is known to match the serialized version on disk.
  16195. // This is useful for saving a localstorage check if you try to load
  16196. // _currentUser frequently while there is none stored.
  16197. _currentUserMatchesDisk: false,
  16198. // The localStorage key suffix that the current user is stored under.
  16199. _CURRENT_USER_KEY: 'currentUser',
  16200. // The mapping of auth provider names to actual providers
  16201. _authProviders: {},
  16202. // Class Methods
  16203. /**
  16204. * Signs up a new user with a username (or email) and password.
  16205. * This will create a new AV.User on the server, and also persist the
  16206. * session in localStorage so that you can access the user using
  16207. * {@link #current}.
  16208. *
  16209. * @param {String} username The username (or email) to sign up with.
  16210. * @param {String} password The password to sign up with.
  16211. * @param {Object} [attrs] Extra fields to set on the new user.
  16212. * @param {AuthOptions} [options]
  16213. * @return {Promise} A promise that is fulfilled with the user when
  16214. * the signup completes.
  16215. * @see AV.User#signUp
  16216. */
  16217. signUp: function signUp(username, password, attrs, options) {
  16218. attrs = attrs || {};
  16219. attrs.username = username;
  16220. attrs.password = password;
  16221. var user = AV.Object._create('_User');
  16222. return user.signUp(attrs, options);
  16223. },
  16224. /**
  16225. * Logs in a user with a username (or email) and password. On success, this
  16226. * saves the session to disk, so you can retrieve the currently logged in
  16227. * user using <code>current</code>.
  16228. *
  16229. * @param {String} username The username (or email) to log in with.
  16230. * @param {String} password The password to log in with.
  16231. * @return {Promise} A promise that is fulfilled with the user when
  16232. * the login completes.
  16233. * @see AV.User#logIn
  16234. */
  16235. logIn: function logIn(username, password) {
  16236. var user = AV.Object._create('_User');
  16237. user._finishFetch({
  16238. username: username,
  16239. password: password
  16240. });
  16241. return user.logIn();
  16242. },
  16243. /**
  16244. * Logs in a user with a session token. On success, this saves the session
  16245. * to disk, so you can retrieve the currently logged in user using
  16246. * <code>current</code>.
  16247. *
  16248. * @param {String} sessionToken The sessionToken to log in with.
  16249. * @return {Promise} A promise that is fulfilled with the user when
  16250. * the login completes.
  16251. */
  16252. become: function become(sessionToken) {
  16253. return this._fetchUserBySessionToken(sessionToken).then(function (user) {
  16254. return user._handleSaveResult(true).then(function () {
  16255. return user;
  16256. });
  16257. });
  16258. },
  16259. _fetchUserBySessionToken: function _fetchUserBySessionToken(sessionToken) {
  16260. if (sessionToken === undefined) {
  16261. return _promise.default.reject(new Error('The sessionToken cannot be undefined'));
  16262. }
  16263. var user = AV.Object._create('_User');
  16264. return request({
  16265. method: 'GET',
  16266. path: '/users/me',
  16267. authOptions: {
  16268. sessionToken: sessionToken
  16269. }
  16270. }).then(function (resp) {
  16271. var serverAttrs = user.parse(resp);
  16272. user._finishFetch(serverAttrs);
  16273. return user;
  16274. });
  16275. },
  16276. /**
  16277. * Logs in a user with a mobile phone number and sms code sent by
  16278. * AV.User.requestLoginSmsCode.On success, this
  16279. * saves the session to disk, so you can retrieve the currently logged in
  16280. * user using <code>current</code>.
  16281. *
  16282. * @param {String} mobilePhone The user's mobilePhoneNumber
  16283. * @param {String} smsCode The sms code sent by AV.User.requestLoginSmsCode
  16284. * @return {Promise} A promise that is fulfilled with the user when
  16285. * the login completes.
  16286. * @see AV.User#logIn
  16287. */
  16288. logInWithMobilePhoneSmsCode: function logInWithMobilePhoneSmsCode(mobilePhone, smsCode) {
  16289. var user = AV.Object._create('_User');
  16290. user._finishFetch({
  16291. mobilePhoneNumber: mobilePhone,
  16292. smsCode: smsCode
  16293. });
  16294. return user.logIn();
  16295. },
  16296. /**
  16297. * Signs up or logs in a user with a mobilePhoneNumber and smsCode.
  16298. * On success, this saves the session to disk, so you can retrieve the currently
  16299. * logged in user using <code>current</code>.
  16300. *
  16301. * @param {String} mobilePhoneNumber The user's mobilePhoneNumber.
  16302. * @param {String} smsCode The sms code sent by AV.Cloud.requestSmsCode
  16303. * @param {Object} attributes The user's other attributes such as username etc.
  16304. * @param {AuthOptions} options
  16305. * @return {Promise} A promise that is fulfilled with the user when
  16306. * the login completes.
  16307. * @see AV.User#signUpOrlogInWithMobilePhone
  16308. * @see AV.Cloud.requestSmsCode
  16309. */
  16310. signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(mobilePhoneNumber, smsCode, attrs, options) {
  16311. attrs = attrs || {};
  16312. attrs.mobilePhoneNumber = mobilePhoneNumber;
  16313. attrs.smsCode = smsCode;
  16314. var user = AV.Object._create('_User');
  16315. return user.signUpOrlogInWithMobilePhone(attrs, options);
  16316. },
  16317. /**
  16318. * Logs in a user with a mobile phone number and password. On success, this
  16319. * saves the session to disk, so you can retrieve the currently logged in
  16320. * user using <code>current</code>.
  16321. *
  16322. * @param {String} mobilePhone The user's mobilePhoneNumber
  16323. * @param {String} password The password to log in with.
  16324. * @return {Promise} A promise that is fulfilled with the user when
  16325. * the login completes.
  16326. * @see AV.User#logIn
  16327. */
  16328. logInWithMobilePhone: function logInWithMobilePhone(mobilePhone, password) {
  16329. var user = AV.Object._create('_User');
  16330. user._finishFetch({
  16331. mobilePhoneNumber: mobilePhone,
  16332. password: password
  16333. });
  16334. return user.logIn();
  16335. },
  16336. /**
  16337. * Logs in a user with email and password.
  16338. *
  16339. * @since 3.13.0
  16340. * @param {String} email The user's email.
  16341. * @param {String} password The password to log in with.
  16342. * @return {Promise} A promise that is fulfilled with the user when
  16343. * the login completes.
  16344. */
  16345. loginWithEmail: function loginWithEmail(email, password) {
  16346. var user = AV.Object._create('_User');
  16347. user._finishFetch({
  16348. email: email,
  16349. password: password
  16350. });
  16351. return user.logIn();
  16352. },
  16353. /**
  16354. * Signs up or logs in a user with a third party auth data(AccessToken).
  16355. * On success, this saves the session to disk, so you can retrieve the currently
  16356. * logged in user using <code>current</code>.
  16357. *
  16358. * @since 3.7.0
  16359. * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
  16360. * @param {string} platform Available platform for sign up.
  16361. * @param {Object} [options]
  16362. * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
  16363. * @return {Promise} A promise that is fulfilled with the user when
  16364. * the login completes.
  16365. * @example AV.User.loginWithAuthData({
  16366. * openid: 'abc123',
  16367. * access_token: '123abc',
  16368. * expires_in: 1382686496
  16369. * }, 'weixin').then(function(user) {
  16370. * //Access user here
  16371. * }).catch(function(error) {
  16372. * //console.error("error: ", error);
  16373. * });
  16374. * @see {@link https://leancloud.cn/docs/js_guide.html#绑定第三方平台账户}
  16375. */
  16376. loginWithAuthData: function loginWithAuthData(authData, platform, options) {
  16377. return AV.User._logInWith(platform, authData, options);
  16378. },
  16379. /**
  16380. * @deprecated renamed to {@link AV.User.loginWithAuthData}
  16381. */
  16382. signUpOrlogInWithAuthData: function signUpOrlogInWithAuthData() {
  16383. console.warn('DEPRECATED: User.signUpOrlogInWithAuthData 已废弃,请使用 User#loginWithAuthData 代替');
  16384. return this.loginWithAuthData.apply(this, arguments);
  16385. },
  16386. /**
  16387. * Signs up or logs in a user with a third party authData and unionId.
  16388. * @since 3.7.0
  16389. * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
  16390. * @param {string} platform Available platform for sign up.
  16391. * @param {string} unionId
  16392. * @param {Object} [unionLoginOptions]
  16393. * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
  16394. * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
  16395. * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
  16396. * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
  16397. * @example AV.User.loginWithAuthDataAndUnionId({
  16398. * openid: 'abc123',
  16399. * access_token: '123abc',
  16400. * expires_in: 1382686496
  16401. * }, 'weixin', 'union123', {
  16402. * unionIdPlatform: 'weixin',
  16403. * asMainAccount: true,
  16404. * }).then(function(user) {
  16405. * //Access user here
  16406. * }).catch(function(error) {
  16407. * //console.error("error: ", error);
  16408. * });
  16409. */
  16410. loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
  16411. return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
  16412. },
  16413. /**
  16414. * @deprecated renamed to {@link AV.User.loginWithAuthDataAndUnionId}
  16415. * @since 3.5.0
  16416. */
  16417. signUpOrlogInWithAuthDataAndUnionId: function signUpOrlogInWithAuthDataAndUnionId() {
  16418. console.warn('DEPRECATED: User.signUpOrlogInWithAuthDataAndUnionId 已废弃,请使用 User#loginWithAuthDataAndUnionId 代替');
  16419. return this.loginWithAuthDataAndUnionId.apply(this, arguments);
  16420. },
  16421. /**
  16422. * Merge unionId into authInfo.
  16423. * @since 4.6.0
  16424. * @param {Object} authInfo
  16425. * @param {String} unionId
  16426. * @param {Object} [unionIdOption]
  16427. * @param {Boolean} [unionIdOption.asMainAccount] If true, the unionId will be associated with the user.
  16428. */
  16429. mergeUnionId: function mergeUnionId(authInfo, unionId) {
  16430. var _ref14 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  16431. _ref14$asMainAccount = _ref14.asMainAccount,
  16432. asMainAccount = _ref14$asMainAccount === void 0 ? false : _ref14$asMainAccount;
  16433. authInfo = JSON.parse((0, _stringify.default)(authInfo));
  16434. var _authInfo = authInfo,
  16435. authData = _authInfo.authData,
  16436. platform = _authInfo.platform;
  16437. authData.platform = platform;
  16438. authData.main_account = asMainAccount;
  16439. authData.unionid = unionId;
  16440. return authInfo;
  16441. },
  16442. /**
  16443. * 使用当前使用微信小程序的微信用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
  16444. * 仅在微信小程序中可用。
  16445. *
  16446. * @deprecated please use {@link AV.User.loginWithMiniApp}
  16447. * @since 2.0.0
  16448. * @param {Object} [options]
  16449. * @param {boolean} [options.preferUnionId] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否使用 UnionId 登录。(since 3.13.0)
  16450. * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
  16451. * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
  16452. * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists. (since v3.7.0)
  16453. * @return {Promise.<AV.User>}
  16454. */
  16455. loginWithWeapp: function loginWithWeapp() {
  16456. var _this15 = this;
  16457. var _ref15 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16458. _ref15$preferUnionId = _ref15.preferUnionId,
  16459. preferUnionId = _ref15$preferUnionId === void 0 ? false : _ref15$preferUnionId,
  16460. _ref15$unionIdPlatfor = _ref15.unionIdPlatform,
  16461. unionIdPlatform = _ref15$unionIdPlatfor === void 0 ? 'weixin' : _ref15$unionIdPlatfor,
  16462. _ref15$asMainAccount = _ref15.asMainAccount,
  16463. asMainAccount = _ref15$asMainAccount === void 0 ? true : _ref15$asMainAccount,
  16464. _ref15$failOnNotExist = _ref15.failOnNotExist,
  16465. failOnNotExist = _ref15$failOnNotExist === void 0 ? false : _ref15$failOnNotExist;
  16466. var getAuthInfo = getAdapter('getAuthInfo');
  16467. return getAuthInfo({
  16468. preferUnionId: preferUnionId,
  16469. asMainAccount: asMainAccount,
  16470. platform: unionIdPlatform
  16471. }).then(function (authInfo) {
  16472. return _this15.loginWithMiniApp(authInfo, {
  16473. failOnNotExist: failOnNotExist
  16474. });
  16475. });
  16476. },
  16477. /**
  16478. * 使用当前使用微信小程序的微信用户身份注册或登录,
  16479. * 仅在微信小程序中可用。
  16480. *
  16481. * @deprecated please use {@link AV.User.loginWithMiniApp}
  16482. * @since 3.13.0
  16483. * @param {Object} [unionLoginOptions]
  16484. * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
  16485. * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
  16486. * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists. * @return {Promise.<AV.User>}
  16487. */
  16488. loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
  16489. var _this16 = this;
  16490. var _ref16 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  16491. _ref16$unionIdPlatfor = _ref16.unionIdPlatform,
  16492. unionIdPlatform = _ref16$unionIdPlatfor === void 0 ? 'weixin' : _ref16$unionIdPlatfor,
  16493. _ref16$asMainAccount = _ref16.asMainAccount,
  16494. asMainAccount = _ref16$asMainAccount === void 0 ? false : _ref16$asMainAccount,
  16495. _ref16$failOnNotExist = _ref16.failOnNotExist,
  16496. failOnNotExist = _ref16$failOnNotExist === void 0 ? false : _ref16$failOnNotExist;
  16497. var getAuthInfo = getAdapter('getAuthInfo');
  16498. return getAuthInfo({
  16499. platform: unionIdPlatform
  16500. }).then(function (authInfo) {
  16501. authInfo = AV.User.mergeUnionId(authInfo, unionId, {
  16502. asMainAccount: asMainAccount
  16503. });
  16504. return _this16.loginWithMiniApp(authInfo, {
  16505. failOnNotExist: failOnNotExist
  16506. });
  16507. });
  16508. },
  16509. /**
  16510. * 使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
  16511. * 仅在 QQ 小程序中可用。
  16512. *
  16513. * @deprecated please use {@link AV.User.loginWithMiniApp}
  16514. * @since 4.2.0
  16515. * @param {Object} [options]
  16516. * @param {boolean} [options.preferUnionId] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
  16517. * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
  16518. * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
  16519. * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists. (since v3.7.0)
  16520. * @return {Promise.<AV.User>}
  16521. */
  16522. loginWithQQApp: function loginWithQQApp() {
  16523. var _this17 = this;
  16524. var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  16525. _ref17$preferUnionId = _ref17.preferUnionId,
  16526. preferUnionId = _ref17$preferUnionId === void 0 ? false : _ref17$preferUnionId,
  16527. _ref17$unionIdPlatfor = _ref17.unionIdPlatform,
  16528. unionIdPlatform = _ref17$unionIdPlatfor === void 0 ? 'qq' : _ref17$unionIdPlatfor,
  16529. _ref17$asMainAccount = _ref17.asMainAccount,
  16530. asMainAccount = _ref17$asMainAccount === void 0 ? true : _ref17$asMainAccount,
  16531. _ref17$failOnNotExist = _ref17.failOnNotExist,
  16532. failOnNotExist = _ref17$failOnNotExist === void 0 ? false : _ref17$failOnNotExist;
  16533. var getAuthInfo = getAdapter('getAuthInfo');
  16534. return getAuthInfo({
  16535. preferUnionId: preferUnionId,
  16536. asMainAccount: asMainAccount,
  16537. platform: unionIdPlatform
  16538. }).then(function (authInfo) {
  16539. authInfo.provider = PLATFORM_QQAPP;
  16540. return _this17.loginWithMiniApp(authInfo, {
  16541. failOnNotExist: failOnNotExist
  16542. });
  16543. });
  16544. },
  16545. /**
  16546. * 使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,
  16547. * 仅在 QQ 小程序中可用。
  16548. *
  16549. * @deprecated please use {@link AV.User.loginWithMiniApp}
  16550. * @since 4.2.0
  16551. * @param {Object} [unionLoginOptions]
  16552. * @param {string} [unionLoginOptions.unionIdPlatform = 'qq'] unionId platform
  16553. * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
  16554. * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
  16555. * @return {Promise.<AV.User>}
  16556. */
  16557. loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
  16558. var _this18 = this;
  16559. var _ref18 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  16560. _ref18$unionIdPlatfor = _ref18.unionIdPlatform,
  16561. unionIdPlatform = _ref18$unionIdPlatfor === void 0 ? 'qq' : _ref18$unionIdPlatfor,
  16562. _ref18$asMainAccount = _ref18.asMainAccount,
  16563. asMainAccount = _ref18$asMainAccount === void 0 ? false : _ref18$asMainAccount,
  16564. _ref18$failOnNotExist = _ref18.failOnNotExist,
  16565. failOnNotExist = _ref18$failOnNotExist === void 0 ? false : _ref18$failOnNotExist;
  16566. var getAuthInfo = getAdapter('getAuthInfo');
  16567. return getAuthInfo({
  16568. platform: unionIdPlatform
  16569. }).then(function (authInfo) {
  16570. authInfo = AV.User.mergeUnionId(authInfo, unionId, {
  16571. asMainAccount: asMainAccount
  16572. });
  16573. authInfo.provider = PLATFORM_QQAPP;
  16574. return _this18.loginWithMiniApp(authInfo, {
  16575. failOnNotExist: failOnNotExist
  16576. });
  16577. });
  16578. },
  16579. /**
  16580. * Register or login using the identity of the current mini-app.
  16581. * @param {Object} authInfo
  16582. * @param {Object} [option]
  16583. * @param {Boolean} [option.failOnNotExist] If true, the login request will fail when no user matches this authInfo.authData exists.
  16584. */
  16585. loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
  16586. var _this19 = this;
  16587. if (authInfo === undefined) {
  16588. var getAuthInfo = getAdapter('getAuthInfo');
  16589. return getAuthInfo().then(function (authInfo) {
  16590. return _this19.loginWithAuthData(authInfo.authData, authInfo.provider, option);
  16591. });
  16592. }
  16593. return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
  16594. },
  16595. /**
  16596. * Only use for DI in tests to produce deterministic IDs.
  16597. */
  16598. _genId: function _genId() {
  16599. return uuid();
  16600. },
  16601. /**
  16602. * Creates an anonymous user.
  16603. *
  16604. * @since 3.9.0
  16605. * @return {Promise.<AV.User>}
  16606. */
  16607. loginAnonymously: function loginAnonymously() {
  16608. return this.loginWithAuthData({
  16609. id: AV.User._genId()
  16610. }, 'anonymous');
  16611. },
  16612. associateWithAuthData: function associateWithAuthData(userObj, platform, authData) {
  16613. console.warn('DEPRECATED: User.associateWithAuthData 已废弃,请使用 User#associateWithAuthData 代替');
  16614. return userObj._linkWith(platform, authData);
  16615. },
  16616. /**
  16617. * Logs out the currently logged in user session. This will remove the
  16618. * session from disk, log out of linked services, and future calls to
  16619. * <code>current</code> will return <code>null</code>.
  16620. * @return {Promise}
  16621. */
  16622. logOut: function logOut() {
  16623. if (AV._config.disableCurrentUser) {
  16624. console.warn('AV.User.current() was disabled in multi-user environment, call logOut() from user object instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html');
  16625. return _promise.default.resolve(null);
  16626. }
  16627. if (AV.User._currentUser !== null) {
  16628. AV.User._currentUser._logOutWithAll();
  16629. AV.User._currentUser._isCurrentUser = false;
  16630. }
  16631. AV.User._currentUserMatchesDisk = true;
  16632. AV.User._currentUser = null;
  16633. return AV.localStorage.removeItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function () {
  16634. return AV._refreshSubscriptionId();
  16635. });
  16636. },
  16637. /**
  16638. *Create a follower query for special user to query the user's followers.
  16639. * @param {String} userObjectId The user object id.
  16640. * @return {AV.FriendShipQuery}
  16641. * @since 0.3.0
  16642. */
  16643. followerQuery: function followerQuery(userObjectId) {
  16644. if (!userObjectId || !_.isString(userObjectId)) {
  16645. throw new Error('Invalid user object id.');
  16646. }
  16647. var query = new AV.FriendShipQuery('_Follower');
  16648. query._friendshipTag = 'follower';
  16649. query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
  16650. return query;
  16651. },
  16652. /**
  16653. *Create a followee query for special user to query the user's followees.
  16654. * @param {String} userObjectId The user object id.
  16655. * @return {AV.FriendShipQuery}
  16656. * @since 0.3.0
  16657. */
  16658. followeeQuery: function followeeQuery(userObjectId) {
  16659. if (!userObjectId || !_.isString(userObjectId)) {
  16660. throw new Error('Invalid user object id.');
  16661. }
  16662. var query = new AV.FriendShipQuery('_Followee');
  16663. query._friendshipTag = 'followee';
  16664. query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
  16665. return query;
  16666. },
  16667. /**
  16668. * Requests a password reset email to be sent to the specified email address
  16669. * associated with the user account. This email allows the user to securely
  16670. * reset their password on the AV site.
  16671. *
  16672. * @param {String} email The email address associated with the user that
  16673. * forgot their password.
  16674. * @return {Promise}
  16675. */
  16676. requestPasswordReset: function requestPasswordReset(email) {
  16677. var json = {
  16678. email: email
  16679. };
  16680. var request = AVRequest('requestPasswordReset', null, null, 'POST', json);
  16681. return request;
  16682. },
  16683. /**
  16684. * Requests a verify email to be sent to the specified email address
  16685. * associated with the user account. This email allows the user to securely
  16686. * verify their email address on the AV site.
  16687. *
  16688. * @param {String} email The email address associated with the user that
  16689. * doesn't verify their email address.
  16690. * @return {Promise}
  16691. */
  16692. requestEmailVerify: function requestEmailVerify(email) {
  16693. var json = {
  16694. email: email
  16695. };
  16696. var request = AVRequest('requestEmailVerify', null, null, 'POST', json);
  16697. return request;
  16698. },
  16699. /**
  16700. * Requests a verify sms code to be sent to the specified mobile phone
  16701. * number associated with the user account. This sms code allows the user to
  16702. * verify their mobile phone number by calling AV.User.verifyMobilePhone
  16703. *
  16704. * @param {String} mobilePhoneNumber The mobile phone number associated with the
  16705. * user that doesn't verify their mobile phone number.
  16706. * @param {SMSAuthOptions} [options]
  16707. * @return {Promise}
  16708. */
  16709. requestMobilePhoneVerify: function requestMobilePhoneVerify(mobilePhoneNumber) {
  16710. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16711. var data = {
  16712. mobilePhoneNumber: mobilePhoneNumber
  16713. };
  16714. if (options.validateToken) {
  16715. data.validate_token = options.validateToken;
  16716. }
  16717. var request = AVRequest('requestMobilePhoneVerify', null, null, 'POST', data, options);
  16718. return request;
  16719. },
  16720. /**
  16721. * Requests a reset password sms code to be sent to the specified mobile phone
  16722. * number associated with the user account. This sms code allows the user to
  16723. * reset their account's password by calling AV.User.resetPasswordBySmsCode
  16724. *
  16725. * @param {String} mobilePhoneNumber The mobile phone number associated with the
  16726. * user that doesn't verify their mobile phone number.
  16727. * @param {SMSAuthOptions} [options]
  16728. * @return {Promise}
  16729. */
  16730. requestPasswordResetBySmsCode: function requestPasswordResetBySmsCode(mobilePhoneNumber) {
  16731. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16732. var data = {
  16733. mobilePhoneNumber: mobilePhoneNumber
  16734. };
  16735. if (options.validateToken) {
  16736. data.validate_token = options.validateToken;
  16737. }
  16738. var request = AVRequest('requestPasswordResetBySmsCode', null, null, 'POST', data, options);
  16739. return request;
  16740. },
  16741. /**
  16742. * Requests a change mobile phone number sms code to be sent to the mobilePhoneNumber.
  16743. * This sms code allows current user to reset it's mobilePhoneNumber by
  16744. * calling {@link AV.User.changePhoneNumber}
  16745. * @since 4.7.0
  16746. * @param {String} mobilePhoneNumber
  16747. * @param {Number} [ttl] ttl of sms code (default is 6 minutes)
  16748. * @param {SMSAuthOptions} [options]
  16749. * @return {Promise}
  16750. */
  16751. requestChangePhoneNumber: function requestChangePhoneNumber(mobilePhoneNumber, ttl, options) {
  16752. var data = {
  16753. mobilePhoneNumber: mobilePhoneNumber
  16754. };
  16755. if (ttl) {
  16756. data.ttl = options.ttl;
  16757. }
  16758. if (options && options.validateToken) {
  16759. data.validate_token = options.validateToken;
  16760. }
  16761. return AVRequest('requestChangePhoneNumber', null, null, 'POST', data, options);
  16762. },
  16763. /**
  16764. * Makes a call to reset user's account mobilePhoneNumber by sms code.
  16765. * The sms code is sent by {@link AV.User.requestChangePhoneNumber}
  16766. * @since 4.7.0
  16767. * @param {String} mobilePhoneNumber
  16768. * @param {String} code The sms code.
  16769. * @return {Promise}
  16770. */
  16771. changePhoneNumber: function changePhoneNumber(mobilePhoneNumber, code) {
  16772. var data = {
  16773. mobilePhoneNumber: mobilePhoneNumber,
  16774. code: code
  16775. };
  16776. return AVRequest('changePhoneNumber', null, null, 'POST', data);
  16777. },
  16778. /**
  16779. * Makes a call to reset user's account password by sms code and new password.
  16780. * The sms code is sent by AV.User.requestPasswordResetBySmsCode.
  16781. * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
  16782. * @param {String} password The new password.
  16783. * @return {Promise} A promise that will be resolved with the result
  16784. * of the function.
  16785. */
  16786. resetPasswordBySmsCode: function resetPasswordBySmsCode(code, password) {
  16787. var json = {
  16788. password: password
  16789. };
  16790. var request = AVRequest('resetPasswordBySmsCode', null, code, 'PUT', json);
  16791. return request;
  16792. },
  16793. /**
  16794. * Makes a call to verify sms code that sent by AV.User.Cloud.requestSmsCode
  16795. * If verify successfully,the user mobilePhoneVerified attribute will be true.
  16796. * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
  16797. * @return {Promise} A promise that will be resolved with the result
  16798. * of the function.
  16799. */
  16800. verifyMobilePhone: function verifyMobilePhone(code) {
  16801. var request = AVRequest('verifyMobilePhone', null, code, 'POST', null);
  16802. return request;
  16803. },
  16804. /**
  16805. * Requests a logIn sms code to be sent to the specified mobile phone
  16806. * number associated with the user account. This sms code allows the user to
  16807. * login by AV.User.logInWithMobilePhoneSmsCode function.
  16808. *
  16809. * @param {String} mobilePhoneNumber The mobile phone number associated with the
  16810. * user that want to login by AV.User.logInWithMobilePhoneSmsCode
  16811. * @param {SMSAuthOptions} [options]
  16812. * @return {Promise}
  16813. */
  16814. requestLoginSmsCode: function requestLoginSmsCode(mobilePhoneNumber) {
  16815. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16816. var data = {
  16817. mobilePhoneNumber: mobilePhoneNumber
  16818. };
  16819. if (options.validateToken) {
  16820. data.validate_token = options.validateToken;
  16821. }
  16822. var request = AVRequest('requestLoginSmsCode', null, null, 'POST', data, options);
  16823. return request;
  16824. },
  16825. /**
  16826. * Retrieves the currently logged in AVUser with a valid session,
  16827. * either from memory or localStorage, if necessary.
  16828. * @return {Promise.<AV.User>} resolved with the currently logged in AV.User.
  16829. */
  16830. currentAsync: function currentAsync() {
  16831. if (AV._config.disableCurrentUser) {
  16832. console.warn('AV.User.currentAsync() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html');
  16833. return _promise.default.resolve(null);
  16834. }
  16835. if (AV.User._currentUser) {
  16836. return _promise.default.resolve(AV.User._currentUser);
  16837. }
  16838. if (AV.User._currentUserMatchesDisk) {
  16839. return _promise.default.resolve(AV.User._currentUser);
  16840. }
  16841. return AV.localStorage.getItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function (userData) {
  16842. if (!userData) {
  16843. return null;
  16844. } // Load the user from local storage.
  16845. AV.User._currentUserMatchesDisk = true;
  16846. AV.User._currentUser = AV.Object._create('_User');
  16847. AV.User._currentUser._isCurrentUser = true;
  16848. var json = JSON.parse(userData);
  16849. AV.User._currentUser.id = json._id;
  16850. delete json._id;
  16851. AV.User._currentUser._sessionToken = json._sessionToken;
  16852. delete json._sessionToken;
  16853. AV.User._currentUser._finishFetch(json); //AV.User._currentUser.set(json);
  16854. AV.User._currentUser._synchronizeAllAuthData();
  16855. AV.User._currentUser._refreshCache();
  16856. AV.User._currentUser._opSetQueue = [{}];
  16857. return AV.User._currentUser;
  16858. });
  16859. },
  16860. /**
  16861. * Retrieves the currently logged in AVUser with a valid session,
  16862. * either from memory or localStorage, if necessary.
  16863. * @return {AV.User} The currently logged in AV.User.
  16864. */
  16865. current: function current() {
  16866. if (AV._config.disableCurrentUser) {
  16867. console.warn('AV.User.current() was disabled in multi-user environment, access user from request instead https://leancloud.cn/docs/leanengine-node-sdk-upgrade-1.html');
  16868. return null;
  16869. }
  16870. if (AV.localStorage.async) {
  16871. var error = new Error('Synchronous API User.current() is not available in this runtime. Use User.currentAsync() instead.');
  16872. error.code = 'SYNC_API_NOT_AVAILABLE';
  16873. throw error;
  16874. }
  16875. if (AV.User._currentUser) {
  16876. return AV.User._currentUser;
  16877. }
  16878. if (AV.User._currentUserMatchesDisk) {
  16879. return AV.User._currentUser;
  16880. } // Load the user from local storage.
  16881. AV.User._currentUserMatchesDisk = true;
  16882. var userData = AV.localStorage.getItem(AV._getAVPath(AV.User._CURRENT_USER_KEY));
  16883. if (!userData) {
  16884. return null;
  16885. }
  16886. AV.User._currentUser = AV.Object._create('_User');
  16887. AV.User._currentUser._isCurrentUser = true;
  16888. var json = JSON.parse(userData);
  16889. AV.User._currentUser.id = json._id;
  16890. delete json._id;
  16891. AV.User._currentUser._sessionToken = json._sessionToken;
  16892. delete json._sessionToken;
  16893. AV.User._currentUser._finishFetch(json); //AV.User._currentUser.set(json);
  16894. AV.User._currentUser._synchronizeAllAuthData();
  16895. AV.User._currentUser._refreshCache();
  16896. AV.User._currentUser._opSetQueue = [{}];
  16897. return AV.User._currentUser;
  16898. },
  16899. /**
  16900. * Persists a user as currentUser to localStorage, and into the singleton.
  16901. * @private
  16902. */
  16903. _saveCurrentUser: function _saveCurrentUser(user) {
  16904. var promise;
  16905. if (AV.User._currentUser !== user) {
  16906. promise = AV.User.logOut();
  16907. } else {
  16908. promise = _promise.default.resolve();
  16909. }
  16910. return promise.then(function () {
  16911. user._isCurrentUser = true;
  16912. AV.User._currentUser = user;
  16913. var json = user._toFullJSON();
  16914. json._id = user.id;
  16915. json._sessionToken = user._sessionToken;
  16916. return AV.localStorage.setItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY), (0, _stringify.default)(json)).then(function () {
  16917. AV.User._currentUserMatchesDisk = true;
  16918. return AV._refreshSubscriptionId();
  16919. });
  16920. });
  16921. },
  16922. _registerAuthenticationProvider: function _registerAuthenticationProvider(provider) {
  16923. AV.User._authProviders[provider.getAuthType()] = provider; // Synchronize the current user with the auth provider.
  16924. if (!AV._config.disableCurrentUser && AV.User.current()) {
  16925. AV.User.current()._synchronizeAuthData(provider.getAuthType());
  16926. }
  16927. },
  16928. _logInWith: function _logInWith(provider, authData, options) {
  16929. var user = AV.Object._create('_User');
  16930. return user._linkWith(provider, authData, options);
  16931. }
  16932. });
  16933. };
  16934. /***/ }),
  16935. /* 533 */
  16936. /***/ (function(module, exports, __webpack_require__) {
  16937. var _Object$defineProperty = __webpack_require__(145);
  16938. function _defineProperty(obj, key, value) {
  16939. if (key in obj) {
  16940. _Object$defineProperty(obj, key, {
  16941. value: value,
  16942. enumerable: true,
  16943. configurable: true,
  16944. writable: true
  16945. });
  16946. } else {
  16947. obj[key] = value;
  16948. }
  16949. return obj;
  16950. }
  16951. module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
  16952. /***/ }),
  16953. /* 534 */
  16954. /***/ (function(module, exports, __webpack_require__) {
  16955. "use strict";
  16956. var _interopRequireDefault = __webpack_require__(1);
  16957. var _map = _interopRequireDefault(__webpack_require__(42));
  16958. var _promise = _interopRequireDefault(__webpack_require__(12));
  16959. var _keys = _interopRequireDefault(__webpack_require__(55));
  16960. var _stringify = _interopRequireDefault(__webpack_require__(36));
  16961. var _find = _interopRequireDefault(__webpack_require__(110));
  16962. var _concat = _interopRequireDefault(__webpack_require__(30));
  16963. var _ = __webpack_require__(2);
  16964. var debug = __webpack_require__(67)('leancloud:query');
  16965. var AVError = __webpack_require__(43);
  16966. var _require = __webpack_require__(26),
  16967. _request = _require._request,
  16968. request = _require.request;
  16969. var _require2 = __webpack_require__(29),
  16970. ensureArray = _require2.ensureArray,
  16971. transformFetchOptions = _require2.transformFetchOptions,
  16972. continueWhile = _require2.continueWhile;
  16973. var requires = function requires(value, message) {
  16974. if (value === undefined) {
  16975. throw new Error(message);
  16976. }
  16977. }; // AV.Query is a way to create a list of AV.Objects.
  16978. module.exports = function (AV) {
  16979. /**
  16980. * Creates a new AV.Query for the given AV.Object subclass.
  16981. * @param {Class|String} objectClass An instance of a subclass of AV.Object, or a AV className string.
  16982. * @class
  16983. *
  16984. * <p>AV.Query defines a query that is used to fetch AV.Objects. The
  16985. * most common use case is finding all objects that match a query through the
  16986. * <code>find</code> method. For example, this sample code fetches all objects
  16987. * of class <code>MyClass</code>. It calls a different function depending on
  16988. * whether the fetch succeeded or not.
  16989. *
  16990. * <pre>
  16991. * var query = new AV.Query(MyClass);
  16992. * query.find().then(function(results) {
  16993. * // results is an array of AV.Object.
  16994. * }, function(error) {
  16995. * // error is an instance of AVError.
  16996. * });</pre></p>
  16997. *
  16998. * <p>An AV.Query can also be used to retrieve a single object whose id is
  16999. * known, through the get method. For example, this sample code fetches an
  17000. * object of class <code>MyClass</code> and id <code>myId</code>. It calls a
  17001. * different function depending on whether the fetch succeeded or not.
  17002. *
  17003. * <pre>
  17004. * var query = new AV.Query(MyClass);
  17005. * query.get(myId).then(function(object) {
  17006. * // object is an instance of AV.Object.
  17007. * }, function(error) {
  17008. * // error is an instance of AVError.
  17009. * });</pre></p>
  17010. *
  17011. * <p>An AV.Query can also be used to count the number of objects that match
  17012. * the query without retrieving all of those objects. For example, this
  17013. * sample code counts the number of objects of the class <code>MyClass</code>
  17014. * <pre>
  17015. * var query = new AV.Query(MyClass);
  17016. * query.count().then(function(number) {
  17017. * // There are number instances of MyClass.
  17018. * }, function(error) {
  17019. * // error is an instance of AVError.
  17020. * });</pre></p>
  17021. */
  17022. AV.Query = function (objectClass) {
  17023. if (_.isString(objectClass)) {
  17024. objectClass = AV.Object._getSubclass(objectClass);
  17025. }
  17026. this.objectClass = objectClass;
  17027. this.className = objectClass.prototype.className;
  17028. this._where = {};
  17029. this._include = [];
  17030. this._select = [];
  17031. this._limit = -1; // negative limit means, do not send a limit
  17032. this._skip = 0;
  17033. this._defaultParams = {};
  17034. };
  17035. /**
  17036. * Constructs a AV.Query that is the OR of the passed in queries. For
  17037. * example:
  17038. * <pre>var compoundQuery = AV.Query.or(query1, query2, query3);</pre>
  17039. *
  17040. * will create a compoundQuery that is an or of the query1, query2, and
  17041. * query3.
  17042. * @param {...AV.Query} var_args The list of queries to OR.
  17043. * @return {AV.Query} The query that is the OR of the passed in queries.
  17044. */
  17045. AV.Query.or = function () {
  17046. var queries = _.toArray(arguments);
  17047. var className = null;
  17048. AV._arrayEach(queries, function (q) {
  17049. if (_.isNull(className)) {
  17050. className = q.className;
  17051. }
  17052. if (className !== q.className) {
  17053. throw new Error('All queries must be for the same class');
  17054. }
  17055. });
  17056. var query = new AV.Query(className);
  17057. query._orQuery(queries);
  17058. return query;
  17059. };
  17060. /**
  17061. * Constructs a AV.Query that is the AND of the passed in queries. For
  17062. * example:
  17063. * <pre>var compoundQuery = AV.Query.and(query1, query2, query3);</pre>
  17064. *
  17065. * will create a compoundQuery that is an 'and' of the query1, query2, and
  17066. * query3.
  17067. * @param {...AV.Query} var_args The list of queries to AND.
  17068. * @return {AV.Query} The query that is the AND of the passed in queries.
  17069. */
  17070. AV.Query.and = function () {
  17071. var queries = _.toArray(arguments);
  17072. var className = null;
  17073. AV._arrayEach(queries, function (q) {
  17074. if (_.isNull(className)) {
  17075. className = q.className;
  17076. }
  17077. if (className !== q.className) {
  17078. throw new Error('All queries must be for the same class');
  17079. }
  17080. });
  17081. var query = new AV.Query(className);
  17082. query._andQuery(queries);
  17083. return query;
  17084. };
  17085. /**
  17086. * Retrieves a list of AVObjects that satisfy the CQL.
  17087. * CQL syntax please see {@link https://leancloud.cn/docs/cql_guide.html CQL Guide}.
  17088. *
  17089. * @param {String} cql A CQL string, see {@link https://leancloud.cn/docs/cql_guide.html CQL Guide}.
  17090. * @param {Array} pvalues An array contains placeholder values.
  17091. * @param {AuthOptions} options
  17092. * @return {Promise} A promise that is resolved with the results when
  17093. * the query completes.
  17094. */
  17095. AV.Query.doCloudQuery = function (cql, pvalues, options) {
  17096. var params = {
  17097. cql: cql
  17098. };
  17099. if (_.isArray(pvalues)) {
  17100. params.pvalues = pvalues;
  17101. } else {
  17102. options = pvalues;
  17103. }
  17104. var request = _request('cloudQuery', null, null, 'GET', params, options);
  17105. return request.then(function (response) {
  17106. //query to process results.
  17107. var query = new AV.Query(response.className);
  17108. var results = (0, _map.default)(_).call(_, response.results, function (json) {
  17109. var obj = query._newObject(response);
  17110. if (obj._finishFetch) {
  17111. obj._finishFetch(query._processResult(json), true);
  17112. }
  17113. return obj;
  17114. });
  17115. return {
  17116. results: results,
  17117. count: response.count,
  17118. className: response.className
  17119. };
  17120. });
  17121. };
  17122. /**
  17123. * Return a query with conditions from json.
  17124. * This can be useful to send a query from server side to client side.
  17125. * @since 4.0.0
  17126. * @param {Object} json from {@link AV.Query#toJSON}
  17127. * @return {AV.Query}
  17128. */
  17129. AV.Query.fromJSON = function (_ref) {
  17130. var className = _ref.className,
  17131. where = _ref.where,
  17132. include = _ref.include,
  17133. select = _ref.select,
  17134. includeACL = _ref.includeACL,
  17135. limit = _ref.limit,
  17136. skip = _ref.skip,
  17137. order = _ref.order;
  17138. if (typeof className !== 'string') {
  17139. throw new TypeError('Invalid Query JSON, className must be a String.');
  17140. }
  17141. var query = new AV.Query(className);
  17142. _.extend(query, {
  17143. _where: where,
  17144. _include: include,
  17145. _select: select,
  17146. _includeACL: includeACL,
  17147. _limit: limit,
  17148. _skip: skip,
  17149. _order: order
  17150. });
  17151. return query;
  17152. };
  17153. AV.Query._extend = AV._extend;
  17154. _.extend(AV.Query.prototype,
  17155. /** @lends AV.Query.prototype */
  17156. {
  17157. //hook to iterate result. Added by dennis<xzhuang@avoscloud.com>.
  17158. _processResult: function _processResult(obj) {
  17159. return obj;
  17160. },
  17161. /**
  17162. * Constructs an AV.Object whose id is already known by fetching data from
  17163. * the server.
  17164. *
  17165. * @param {String} objectId The id of the object to be fetched.
  17166. * @param {AuthOptions} options
  17167. * @return {Promise.<AV.Object>}
  17168. */
  17169. get: function get(objectId, options) {
  17170. if (!_.isString(objectId)) {
  17171. throw new Error('objectId must be a string');
  17172. }
  17173. if (objectId === '') {
  17174. return _promise.default.reject(new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.'));
  17175. }
  17176. var obj = this._newObject();
  17177. obj.id = objectId;
  17178. var queryJSON = this._getParams();
  17179. var fetchOptions = {};
  17180. if ((0, _keys.default)(queryJSON)) fetchOptions.keys = (0, _keys.default)(queryJSON);
  17181. if (queryJSON.include) fetchOptions.include = queryJSON.include;
  17182. if (queryJSON.includeACL) fetchOptions.includeACL = queryJSON.includeACL;
  17183. return _request('classes', this.className, objectId, 'GET', transformFetchOptions(fetchOptions), options).then(function (response) {
  17184. if (_.isEmpty(response)) throw new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
  17185. obj._finishFetch(obj.parse(response), true);
  17186. return obj;
  17187. });
  17188. },
  17189. /**
  17190. * Returns a JSON representation of this query.
  17191. * @return {Object}
  17192. */
  17193. toJSON: function toJSON() {
  17194. var className = this.className,
  17195. where = this._where,
  17196. include = this._include,
  17197. select = this._select,
  17198. includeACL = this._includeACL,
  17199. limit = this._limit,
  17200. skip = this._skip,
  17201. order = this._order;
  17202. return {
  17203. className: className,
  17204. where: where,
  17205. include: include,
  17206. select: select,
  17207. includeACL: includeACL,
  17208. limit: limit,
  17209. skip: skip,
  17210. order: order
  17211. };
  17212. },
  17213. _getParams: function _getParams() {
  17214. var params = _.extend({}, this._defaultParams, {
  17215. where: this._where
  17216. });
  17217. if (this._include.length > 0) {
  17218. params.include = this._include.join(',');
  17219. }
  17220. if (this._select.length > 0) {
  17221. params.keys = this._select.join(',');
  17222. }
  17223. if (this._includeACL !== undefined) {
  17224. params.returnACL = this._includeACL;
  17225. }
  17226. if (this._limit >= 0) {
  17227. params.limit = this._limit;
  17228. }
  17229. if (this._skip > 0) {
  17230. params.skip = this._skip;
  17231. }
  17232. if (this._order !== undefined) {
  17233. params.order = this._order;
  17234. }
  17235. return params;
  17236. },
  17237. _newObject: function _newObject(response) {
  17238. var obj;
  17239. if (response && response.className) {
  17240. obj = new AV.Object(response.className);
  17241. } else {
  17242. obj = new this.objectClass();
  17243. }
  17244. return obj;
  17245. },
  17246. _createRequest: function _createRequest() {
  17247. var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._getParams();
  17248. var options = arguments.length > 1 ? arguments[1] : undefined;
  17249. var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "/classes/".concat(this.className);
  17250. if (encodeURIComponent((0, _stringify.default)(params)).length > 2000) {
  17251. var body = {
  17252. requests: [{
  17253. method: 'GET',
  17254. path: "/1.1".concat(path),
  17255. params: params
  17256. }]
  17257. };
  17258. return request({
  17259. path: '/batch',
  17260. method: 'POST',
  17261. data: body,
  17262. authOptions: options
  17263. }).then(function (response) {
  17264. var result = response[0];
  17265. if (result.success) {
  17266. return result.success;
  17267. }
  17268. var error = new AVError(result.error.code, result.error.error || 'Unknown batch error');
  17269. throw error;
  17270. });
  17271. }
  17272. return request({
  17273. method: 'GET',
  17274. path: path,
  17275. query: params,
  17276. authOptions: options
  17277. });
  17278. },
  17279. _parseResponse: function _parseResponse(response) {
  17280. var _this = this;
  17281. return (0, _map.default)(_).call(_, response.results, function (json) {
  17282. var obj = _this._newObject(response);
  17283. if (obj._finishFetch) {
  17284. obj._finishFetch(_this._processResult(json), true);
  17285. }
  17286. return obj;
  17287. });
  17288. },
  17289. /**
  17290. * Retrieves a list of AVObjects that satisfy this query.
  17291. *
  17292. * @param {AuthOptions} options
  17293. * @return {Promise} A promise that is resolved with the results when
  17294. * the query completes.
  17295. */
  17296. find: function find(options) {
  17297. var request = this._createRequest(undefined, options);
  17298. return request.then(this._parseResponse.bind(this));
  17299. },
  17300. /**
  17301. * Retrieves both AVObjects and total count.
  17302. *
  17303. * @since 4.12.0
  17304. * @param {AuthOptions} options
  17305. * @return {Promise} A tuple contains results and count.
  17306. */
  17307. findAndCount: function findAndCount(options) {
  17308. var _this2 = this;
  17309. var params = this._getParams();
  17310. params.count = 1;
  17311. var request = this._createRequest(params, options);
  17312. return request.then(function (response) {
  17313. return [_this2._parseResponse(response), response.count];
  17314. });
  17315. },
  17316. /**
  17317. * scan a Query. masterKey required.
  17318. *
  17319. * @since 2.1.0
  17320. * @param {object} [options]
  17321. * @param {string} [options.orderedBy] specify the key to sort
  17322. * @param {number} [options.batchSize] specify the batch size for each request
  17323. * @param {AuthOptions} [authOptions]
  17324. * @return {AsyncIterator.<AV.Object>}
  17325. * @example const testIterator = {
  17326. * [Symbol.asyncIterator]() {
  17327. * return new Query('Test').scan(undefined, { useMasterKey: true });
  17328. * },
  17329. * };
  17330. * for await (const test of testIterator) {
  17331. * console.log(test.id);
  17332. * }
  17333. */
  17334. scan: function scan() {
  17335. var _this3 = this;
  17336. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  17337. orderedBy = _ref2.orderedBy,
  17338. batchSize = _ref2.batchSize;
  17339. var authOptions = arguments.length > 1 ? arguments[1] : undefined;
  17340. var condition = this._getParams();
  17341. debug('scan %O', condition);
  17342. if (condition.order) {
  17343. console.warn('The order of the query is ignored for Query#scan. Checkout the orderedBy option of Query#scan.');
  17344. delete condition.order;
  17345. }
  17346. if (condition.skip) {
  17347. console.warn('The skip option of the query is ignored for Query#scan.');
  17348. delete condition.skip;
  17349. }
  17350. if (condition.limit) {
  17351. console.warn('The limit option of the query is ignored for Query#scan.');
  17352. delete condition.limit;
  17353. }
  17354. if (orderedBy) condition.scan_key = orderedBy;
  17355. if (batchSize) condition.limit = batchSize;
  17356. var cursor;
  17357. var remainResults = [];
  17358. return {
  17359. next: function next() {
  17360. if (remainResults.length) {
  17361. return _promise.default.resolve({
  17362. done: false,
  17363. value: remainResults.shift()
  17364. });
  17365. }
  17366. if (cursor === null) {
  17367. return _promise.default.resolve({
  17368. done: true
  17369. });
  17370. }
  17371. return _request('scan/classes', _this3.className, null, 'GET', cursor ? _.extend({}, condition, {
  17372. cursor: cursor
  17373. }) : condition, authOptions).then(function (response) {
  17374. cursor = response.cursor;
  17375. if (response.results.length) {
  17376. var results = _this3._parseResponse(response);
  17377. results.forEach(function (result) {
  17378. return remainResults.push(result);
  17379. });
  17380. }
  17381. if (cursor === null && remainResults.length === 0) {
  17382. return {
  17383. done: true
  17384. };
  17385. }
  17386. return {
  17387. done: false,
  17388. value: remainResults.shift()
  17389. };
  17390. });
  17391. }
  17392. };
  17393. },
  17394. /**
  17395. * Delete objects retrieved by this query.
  17396. * @param {AuthOptions} options
  17397. * @return {Promise} A promise that is fulfilled when the save
  17398. * completes.
  17399. */
  17400. destroyAll: function destroyAll(options) {
  17401. var self = this;
  17402. return (0, _find.default)(self).call(self, options).then(function (objects) {
  17403. return AV.Object.destroyAll(objects, options);
  17404. });
  17405. },
  17406. /**
  17407. * Counts the number of objects that match this query.
  17408. *
  17409. * @param {AuthOptions} options
  17410. * @return {Promise} A promise that is resolved with the count when
  17411. * the query completes.
  17412. */
  17413. count: function count(options) {
  17414. var params = this._getParams();
  17415. params.limit = 0;
  17416. params.count = 1;
  17417. var request = this._createRequest(params, options);
  17418. return request.then(function (response) {
  17419. return response.count;
  17420. });
  17421. },
  17422. /**
  17423. * Retrieves at most one AV.Object that satisfies this query.
  17424. *
  17425. * @param {AuthOptions} options
  17426. * @return {Promise} A promise that is resolved with the object when
  17427. * the query completes.
  17428. */
  17429. first: function first(options) {
  17430. var self = this;
  17431. var params = this._getParams();
  17432. params.limit = 1;
  17433. var request = this._createRequest(params, options);
  17434. return request.then(function (response) {
  17435. return (0, _map.default)(_).call(_, response.results, function (json) {
  17436. var obj = self._newObject();
  17437. if (obj._finishFetch) {
  17438. obj._finishFetch(self._processResult(json), true);
  17439. }
  17440. return obj;
  17441. })[0];
  17442. });
  17443. },
  17444. /**
  17445. * Sets the number of results to skip before returning any results.
  17446. * This is useful for pagination.
  17447. * Default is to skip zero results.
  17448. * @param {Number} n the number of results to skip.
  17449. * @return {AV.Query} Returns the query, so you can chain this call.
  17450. */
  17451. skip: function skip(n) {
  17452. requires(n, 'undefined is not a valid skip value');
  17453. this._skip = n;
  17454. return this;
  17455. },
  17456. /**
  17457. * Sets the limit of the number of results to return. The default limit is
  17458. * 100, with a maximum of 1000 results being returned at a time.
  17459. * @param {Number} n the number of results to limit to.
  17460. * @return {AV.Query} Returns the query, so you can chain this call.
  17461. */
  17462. limit: function limit(n) {
  17463. requires(n, 'undefined is not a valid limit value');
  17464. this._limit = n;
  17465. return this;
  17466. },
  17467. /**
  17468. * Add a constraint to the query that requires a particular key's value to
  17469. * be equal to the provided value.
  17470. * @param {String} key The key to check.
  17471. * @param value The value that the AV.Object must contain.
  17472. * @return {AV.Query} Returns the query, so you can chain this call.
  17473. */
  17474. equalTo: function equalTo(key, value) {
  17475. requires(key, 'undefined is not a valid key');
  17476. requires(value, 'undefined is not a valid value');
  17477. this._where[key] = AV._encode(value);
  17478. return this;
  17479. },
  17480. /**
  17481. * Helper for condition queries
  17482. * @private
  17483. */
  17484. _addCondition: function _addCondition(key, condition, value) {
  17485. requires(key, 'undefined is not a valid condition key');
  17486. requires(condition, 'undefined is not a valid condition');
  17487. requires(value, 'undefined is not a valid condition value'); // Check if we already have a condition
  17488. if (!this._where[key]) {
  17489. this._where[key] = {};
  17490. }
  17491. this._where[key][condition] = AV._encode(value);
  17492. return this;
  17493. },
  17494. /**
  17495. * Add a constraint to the query that requires a particular
  17496. * <strong>array</strong> key's length to be equal to the provided value.
  17497. * @param {String} key The array key to check.
  17498. * @param {number} value The length value.
  17499. * @return {AV.Query} Returns the query, so you can chain this call.
  17500. */
  17501. sizeEqualTo: function sizeEqualTo(key, value) {
  17502. this._addCondition(key, '$size', value);
  17503. return this;
  17504. },
  17505. /**
  17506. * Add a constraint to the query that requires a particular key's value to
  17507. * be not equal to the provided value.
  17508. * @param {String} key The key to check.
  17509. * @param value The value that must not be equalled.
  17510. * @return {AV.Query} Returns the query, so you can chain this call.
  17511. */
  17512. notEqualTo: function notEqualTo(key, value) {
  17513. this._addCondition(key, '$ne', value);
  17514. return this;
  17515. },
  17516. /**
  17517. * Add a constraint to the query that requires a particular key's value to
  17518. * be less than the provided value.
  17519. * @param {String} key The key to check.
  17520. * @param value The value that provides an upper bound.
  17521. * @return {AV.Query} Returns the query, so you can chain this call.
  17522. */
  17523. lessThan: function lessThan(key, value) {
  17524. this._addCondition(key, '$lt', value);
  17525. return this;
  17526. },
  17527. /**
  17528. * Add a constraint to the query that requires a particular key's value to
  17529. * be greater than the provided value.
  17530. * @param {String} key The key to check.
  17531. * @param value The value that provides an lower bound.
  17532. * @return {AV.Query} Returns the query, so you can chain this call.
  17533. */
  17534. greaterThan: function greaterThan(key, value) {
  17535. this._addCondition(key, '$gt', value);
  17536. return this;
  17537. },
  17538. /**
  17539. * Add a constraint to the query that requires a particular key's value to
  17540. * be less than or equal to the provided value.
  17541. * @param {String} key The key to check.
  17542. * @param value The value that provides an upper bound.
  17543. * @return {AV.Query} Returns the query, so you can chain this call.
  17544. */
  17545. lessThanOrEqualTo: function lessThanOrEqualTo(key, value) {
  17546. this._addCondition(key, '$lte', value);
  17547. return this;
  17548. },
  17549. /**
  17550. * Add a constraint to the query that requires a particular key's value to
  17551. * be greater than or equal to the provided value.
  17552. * @param {String} key The key to check.
  17553. * @param value The value that provides an lower bound.
  17554. * @return {AV.Query} Returns the query, so you can chain this call.
  17555. */
  17556. greaterThanOrEqualTo: function greaterThanOrEqualTo(key, value) {
  17557. this._addCondition(key, '$gte', value);
  17558. return this;
  17559. },
  17560. /**
  17561. * Add a constraint to the query that requires a particular key's value to
  17562. * be contained in the provided list of values.
  17563. * @param {String} key The key to check.
  17564. * @param {Array} values The values that will match.
  17565. * @return {AV.Query} Returns the query, so you can chain this call.
  17566. */
  17567. containedIn: function containedIn(key, values) {
  17568. this._addCondition(key, '$in', values);
  17569. return this;
  17570. },
  17571. /**
  17572. * Add a constraint to the query that requires a particular key's value to
  17573. * not be contained in the provided list of values.
  17574. * @param {String} key The key to check.
  17575. * @param {Array} values The values that will not match.
  17576. * @return {AV.Query} Returns the query, so you can chain this call.
  17577. */
  17578. notContainedIn: function notContainedIn(key, values) {
  17579. this._addCondition(key, '$nin', values);
  17580. return this;
  17581. },
  17582. /**
  17583. * Add a constraint to the query that requires a particular key's value to
  17584. * contain each one of the provided list of values.
  17585. * @param {String} key The key to check. This key's value must be an array.
  17586. * @param {Array} values The values that will match.
  17587. * @return {AV.Query} Returns the query, so you can chain this call.
  17588. */
  17589. containsAll: function containsAll(key, values) {
  17590. this._addCondition(key, '$all', values);
  17591. return this;
  17592. },
  17593. /**
  17594. * Add a constraint for finding objects that contain the given key.
  17595. * @param {String} key The key that should exist.
  17596. * @return {AV.Query} Returns the query, so you can chain this call.
  17597. */
  17598. exists: function exists(key) {
  17599. this._addCondition(key, '$exists', true);
  17600. return this;
  17601. },
  17602. /**
  17603. * Add a constraint for finding objects that do not contain a given key.
  17604. * @param {String} key The key that should not exist
  17605. * @return {AV.Query} Returns the query, so you can chain this call.
  17606. */
  17607. doesNotExist: function doesNotExist(key) {
  17608. this._addCondition(key, '$exists', false);
  17609. return this;
  17610. },
  17611. /**
  17612. * Add a regular expression constraint for finding string values that match
  17613. * the provided regular expression.
  17614. * This may be slow for large datasets.
  17615. * @param {String} key The key that the string to match is stored in.
  17616. * @param {RegExp} regex The regular expression pattern to match.
  17617. * @return {AV.Query} Returns the query, so you can chain this call.
  17618. */
  17619. matches: function matches(key, regex, modifiers) {
  17620. this._addCondition(key, '$regex', regex);
  17621. if (!modifiers) {
  17622. modifiers = '';
  17623. } // Javascript regex options support mig as inline options but store them
  17624. // as properties of the object. We support mi & should migrate them to
  17625. // modifiers
  17626. if (regex.ignoreCase) {
  17627. modifiers += 'i';
  17628. }
  17629. if (regex.multiline) {
  17630. modifiers += 'm';
  17631. }
  17632. if (modifiers && modifiers.length) {
  17633. this._addCondition(key, '$options', modifiers);
  17634. }
  17635. return this;
  17636. },
  17637. /**
  17638. * Add a constraint that requires that a key's value matches a AV.Query
  17639. * constraint.
  17640. * @param {String} key The key that the contains the object to match the
  17641. * query.
  17642. * @param {AV.Query} query The query that should match.
  17643. * @return {AV.Query} Returns the query, so you can chain this call.
  17644. */
  17645. matchesQuery: function matchesQuery(key, query) {
  17646. var queryJSON = query._getParams();
  17647. queryJSON.className = query.className;
  17648. this._addCondition(key, '$inQuery', queryJSON);
  17649. return this;
  17650. },
  17651. /**
  17652. * Add a constraint that requires that a key's value not matches a
  17653. * AV.Query constraint.
  17654. * @param {String} key The key that the contains the object to match the
  17655. * query.
  17656. * @param {AV.Query} query The query that should not match.
  17657. * @return {AV.Query} Returns the query, so you can chain this call.
  17658. */
  17659. doesNotMatchQuery: function doesNotMatchQuery(key, query) {
  17660. var queryJSON = query._getParams();
  17661. queryJSON.className = query.className;
  17662. this._addCondition(key, '$notInQuery', queryJSON);
  17663. return this;
  17664. },
  17665. /**
  17666. * Add a constraint that requires that a key's value matches a value in
  17667. * an object returned by a different AV.Query.
  17668. * @param {String} key The key that contains the value that is being
  17669. * matched.
  17670. * @param {String} queryKey The key in the objects returned by the query to
  17671. * match against.
  17672. * @param {AV.Query} query The query to run.
  17673. * @return {AV.Query} Returns the query, so you can chain this call.
  17674. */
  17675. matchesKeyInQuery: function matchesKeyInQuery(key, queryKey, query) {
  17676. var queryJSON = query._getParams();
  17677. queryJSON.className = query.className;
  17678. this._addCondition(key, '$select', {
  17679. key: queryKey,
  17680. query: queryJSON
  17681. });
  17682. return this;
  17683. },
  17684. /**
  17685. * Add a constraint that requires that a key's value not match a value in
  17686. * an object returned by a different AV.Query.
  17687. * @param {String} key The key that contains the value that is being
  17688. * excluded.
  17689. * @param {String} queryKey The key in the objects returned by the query to
  17690. * match against.
  17691. * @param {AV.Query} query The query to run.
  17692. * @return {AV.Query} Returns the query, so you can chain this call.
  17693. */
  17694. doesNotMatchKeyInQuery: function doesNotMatchKeyInQuery(key, queryKey, query) {
  17695. var queryJSON = query._getParams();
  17696. queryJSON.className = query.className;
  17697. this._addCondition(key, '$dontSelect', {
  17698. key: queryKey,
  17699. query: queryJSON
  17700. });
  17701. return this;
  17702. },
  17703. /**
  17704. * Add constraint that at least one of the passed in queries matches.
  17705. * @param {Array} queries
  17706. * @return {AV.Query} Returns the query, so you can chain this call.
  17707. * @private
  17708. */
  17709. _orQuery: function _orQuery(queries) {
  17710. var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
  17711. return q._getParams().where;
  17712. });
  17713. this._where.$or = queryJSON;
  17714. return this;
  17715. },
  17716. /**
  17717. * Add constraint that both of the passed in queries matches.
  17718. * @param {Array} queries
  17719. * @return {AV.Query} Returns the query, so you can chain this call.
  17720. * @private
  17721. */
  17722. _andQuery: function _andQuery(queries) {
  17723. var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
  17724. return q._getParams().where;
  17725. });
  17726. this._where.$and = queryJSON;
  17727. return this;
  17728. },
  17729. /**
  17730. * Converts a string into a regex that matches it.
  17731. * Surrounding with \Q .. \E does this, we just need to escape \E's in
  17732. * the text separately.
  17733. * @private
  17734. */
  17735. _quote: function _quote(s) {
  17736. return '\\Q' + s.replace('\\E', '\\E\\\\E\\Q') + '\\E';
  17737. },
  17738. /**
  17739. * Add a constraint for finding string values that contain a provided
  17740. * string. This may be slow for large datasets.
  17741. * @param {String} key The key that the string to match is stored in.
  17742. * @param {String} substring The substring that the value must contain.
  17743. * @return {AV.Query} Returns the query, so you can chain this call.
  17744. */
  17745. contains: function contains(key, value) {
  17746. this._addCondition(key, '$regex', this._quote(value));
  17747. return this;
  17748. },
  17749. /**
  17750. * Add a constraint for finding string values that start with a provided
  17751. * string. This query will use the backend index, so it will be fast even
  17752. * for large datasets.
  17753. * @param {String} key The key that the string to match is stored in.
  17754. * @param {String} prefix The substring that the value must start with.
  17755. * @return {AV.Query} Returns the query, so you can chain this call.
  17756. */
  17757. startsWith: function startsWith(key, value) {
  17758. this._addCondition(key, '$regex', '^' + this._quote(value));
  17759. return this;
  17760. },
  17761. /**
  17762. * Add a constraint for finding string values that end with a provided
  17763. * string. This will be slow for large datasets.
  17764. * @param {String} key The key that the string to match is stored in.
  17765. * @param {String} suffix The substring that the value must end with.
  17766. * @return {AV.Query} Returns the query, so you can chain this call.
  17767. */
  17768. endsWith: function endsWith(key, value) {
  17769. this._addCondition(key, '$regex', this._quote(value) + '$');
  17770. return this;
  17771. },
  17772. /**
  17773. * Sorts the results in ascending order by the given key.
  17774. *
  17775. * @param {String} key The key to order by.
  17776. * @return {AV.Query} Returns the query, so you can chain this call.
  17777. */
  17778. ascending: function ascending(key) {
  17779. requires(key, 'undefined is not a valid key');
  17780. this._order = key;
  17781. return this;
  17782. },
  17783. /**
  17784. * Also sorts the results in ascending order by the given key. The previous sort keys have
  17785. * precedence over this key.
  17786. *
  17787. * @param {String} key The key to order by
  17788. * @return {AV.Query} Returns the query so you can chain this call.
  17789. */
  17790. addAscending: function addAscending(key) {
  17791. requires(key, 'undefined is not a valid key');
  17792. if (this._order) this._order += ',' + key;else this._order = key;
  17793. return this;
  17794. },
  17795. /**
  17796. * Sorts the results in descending order by the given key.
  17797. *
  17798. * @param {String} key The key to order by.
  17799. * @return {AV.Query} Returns the query, so you can chain this call.
  17800. */
  17801. descending: function descending(key) {
  17802. requires(key, 'undefined is not a valid key');
  17803. this._order = '-' + key;
  17804. return this;
  17805. },
  17806. /**
  17807. * Also sorts the results in descending order by the given key. The previous sort keys have
  17808. * precedence over this key.
  17809. *
  17810. * @param {String} key The key to order by
  17811. * @return {AV.Query} Returns the query so you can chain this call.
  17812. */
  17813. addDescending: function addDescending(key) {
  17814. requires(key, 'undefined is not a valid key');
  17815. if (this._order) this._order += ',-' + key;else this._order = '-' + key;
  17816. return this;
  17817. },
  17818. /**
  17819. * Add a proximity based constraint for finding objects with key point
  17820. * values near the point given.
  17821. * @param {String} key The key that the AV.GeoPoint is stored in.
  17822. * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
  17823. * @return {AV.Query} Returns the query, so you can chain this call.
  17824. */
  17825. near: function near(key, point) {
  17826. if (!(point instanceof AV.GeoPoint)) {
  17827. // Try to cast it to a GeoPoint, so that near("loc", [20,30]) works.
  17828. point = new AV.GeoPoint(point);
  17829. }
  17830. this._addCondition(key, '$nearSphere', point);
  17831. return this;
  17832. },
  17833. /**
  17834. * Add a proximity based constraint for finding objects with key point
  17835. * values near the point given and within the maximum distance given.
  17836. * @param {String} key The key that the AV.GeoPoint is stored in.
  17837. * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
  17838. * @param maxDistance Maximum distance (in radians) of results to return.
  17839. * @return {AV.Query} Returns the query, so you can chain this call.
  17840. */
  17841. withinRadians: function withinRadians(key, point, distance) {
  17842. this.near(key, point);
  17843. this._addCondition(key, '$maxDistance', distance);
  17844. return this;
  17845. },
  17846. /**
  17847. * Add a proximity based constraint for finding objects with key point
  17848. * values near the point given and within the maximum distance given.
  17849. * Radius of earth used is 3958.8 miles.
  17850. * @param {String} key The key that the AV.GeoPoint is stored in.
  17851. * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
  17852. * @param {Number} maxDistance Maximum distance (in miles) of results to
  17853. * return.
  17854. * @return {AV.Query} Returns the query, so you can chain this call.
  17855. */
  17856. withinMiles: function withinMiles(key, point, distance) {
  17857. return this.withinRadians(key, point, distance / 3958.8);
  17858. },
  17859. /**
  17860. * Add a proximity based constraint for finding objects with key point
  17861. * values near the point given and within the maximum distance given.
  17862. * Radius of earth used is 6371.0 kilometers.
  17863. * @param {String} key The key that the AV.GeoPoint is stored in.
  17864. * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
  17865. * @param {Number} maxDistance Maximum distance (in kilometers) of results
  17866. * to return.
  17867. * @return {AV.Query} Returns the query, so you can chain this call.
  17868. */
  17869. withinKilometers: function withinKilometers(key, point, distance) {
  17870. return this.withinRadians(key, point, distance / 6371.0);
  17871. },
  17872. /**
  17873. * Add a constraint to the query that requires a particular key's
  17874. * coordinates be contained within a given rectangular geographic bounding
  17875. * box.
  17876. * @param {String} key The key to be constrained.
  17877. * @param {AV.GeoPoint} southwest
  17878. * The lower-left inclusive corner of the box.
  17879. * @param {AV.GeoPoint} northeast
  17880. * The upper-right inclusive corner of the box.
  17881. * @return {AV.Query} Returns the query, so you can chain this call.
  17882. */
  17883. withinGeoBox: function withinGeoBox(key, southwest, northeast) {
  17884. if (!(southwest instanceof AV.GeoPoint)) {
  17885. southwest = new AV.GeoPoint(southwest);
  17886. }
  17887. if (!(northeast instanceof AV.GeoPoint)) {
  17888. northeast = new AV.GeoPoint(northeast);
  17889. }
  17890. this._addCondition(key, '$within', {
  17891. $box: [southwest, northeast]
  17892. });
  17893. return this;
  17894. },
  17895. /**
  17896. * Include nested AV.Objects for the provided key. You can use dot
  17897. * notation to specify which fields in the included object are also fetch.
  17898. * @param {String[]} keys The name of the key to include.
  17899. * @return {AV.Query} Returns the query, so you can chain this call.
  17900. */
  17901. include: function include(keys) {
  17902. var _this4 = this;
  17903. requires(keys, 'undefined is not a valid key');
  17904. _.forEach(arguments, function (keys) {
  17905. var _context;
  17906. _this4._include = (0, _concat.default)(_context = _this4._include).call(_context, ensureArray(keys));
  17907. });
  17908. return this;
  17909. },
  17910. /**
  17911. * Include the ACL.
  17912. * @param {Boolean} [value=true] Whether to include the ACL
  17913. * @return {AV.Query} Returns the query, so you can chain this call.
  17914. */
  17915. includeACL: function includeACL() {
  17916. var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  17917. this._includeACL = value;
  17918. return this;
  17919. },
  17920. /**
  17921. * Restrict the fields of the returned AV.Objects to include only the
  17922. * provided keys. If this is called multiple times, then all of the keys
  17923. * specified in each of the calls will be included.
  17924. * @param {String[]} keys The names of the keys to include.
  17925. * @return {AV.Query} Returns the query, so you can chain this call.
  17926. */
  17927. select: function select(keys) {
  17928. var _this5 = this;
  17929. requires(keys, 'undefined is not a valid key');
  17930. _.forEach(arguments, function (keys) {
  17931. var _context2;
  17932. _this5._select = (0, _concat.default)(_context2 = _this5._select).call(_context2, ensureArray(keys));
  17933. });
  17934. return this;
  17935. },
  17936. /**
  17937. * Iterates over each result of a query, calling a callback for each one. If
  17938. * the callback returns a promise, the iteration will not continue until
  17939. * that promise has been fulfilled. If the callback returns a rejected
  17940. * promise, then iteration will stop with that error. The items are
  17941. * processed in an unspecified order. The query may not have any sort order,
  17942. * and may not use limit or skip.
  17943. * @param callback {Function} Callback that will be called with each result
  17944. * of the query.
  17945. * @return {Promise} A promise that will be fulfilled once the
  17946. * iteration has completed.
  17947. */
  17948. each: function each(callback) {
  17949. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17950. if (this._order || this._skip || this._limit >= 0) {
  17951. var error = new Error('Cannot iterate on a query with sort, skip, or limit.');
  17952. return _promise.default.reject(error);
  17953. }
  17954. var query = new AV.Query(this.objectClass); // We can override the batch size from the options.
  17955. // This is undocumented, but useful for testing.
  17956. query._limit = options.batchSize || 100;
  17957. query._where = _.clone(this._where);
  17958. query._include = _.clone(this._include);
  17959. query.ascending('objectId');
  17960. var finished = false;
  17961. return continueWhile(function () {
  17962. return !finished;
  17963. }, function () {
  17964. return (0, _find.default)(query).call(query, options).then(function (results) {
  17965. var callbacksDone = _promise.default.resolve();
  17966. _.each(results, function (result) {
  17967. callbacksDone = callbacksDone.then(function () {
  17968. return callback(result);
  17969. });
  17970. });
  17971. return callbacksDone.then(function () {
  17972. if (results.length >= query._limit) {
  17973. query.greaterThan('objectId', results[results.length - 1].id);
  17974. } else {
  17975. finished = true;
  17976. }
  17977. });
  17978. });
  17979. });
  17980. },
  17981. /**
  17982. * Subscribe the changes of this query.
  17983. *
  17984. * LiveQuery is not included in the default bundle: {@link https://url.leanapp.cn/enable-live-query}.
  17985. *
  17986. * @since 3.0.0
  17987. * @return {AV.LiveQuery} An eventemitter which can be used to get LiveQuery updates;
  17988. */
  17989. subscribe: function subscribe(options) {
  17990. return AV.LiveQuery.init(this, options);
  17991. }
  17992. });
  17993. AV.FriendShipQuery = AV.Query._extend({
  17994. _newObject: function _newObject() {
  17995. var UserClass = AV.Object._getSubclass('_User');
  17996. return new UserClass();
  17997. },
  17998. _processResult: function _processResult(json) {
  17999. if (json && json[this._friendshipTag]) {
  18000. var user = json[this._friendshipTag];
  18001. if (user.__type === 'Pointer' && user.className === '_User') {
  18002. delete user.__type;
  18003. delete user.className;
  18004. }
  18005. return user;
  18006. } else {
  18007. return null;
  18008. }
  18009. }
  18010. });
  18011. };
  18012. /***/ }),
  18013. /* 535 */
  18014. /***/ (function(module, exports, __webpack_require__) {
  18015. "use strict";
  18016. var _interopRequireDefault = __webpack_require__(1);
  18017. var _promise = _interopRequireDefault(__webpack_require__(12));
  18018. var _keys = _interopRequireDefault(__webpack_require__(55));
  18019. var _ = __webpack_require__(2);
  18020. var EventEmitter = __webpack_require__(224);
  18021. var _require = __webpack_require__(29),
  18022. inherits = _require.inherits;
  18023. var _require2 = __webpack_require__(26),
  18024. request = _require2.request;
  18025. var subscribe = function subscribe(queryJSON, subscriptionId) {
  18026. return request({
  18027. method: 'POST',
  18028. path: '/LiveQuery/subscribe',
  18029. data: {
  18030. query: queryJSON,
  18031. id: subscriptionId
  18032. }
  18033. });
  18034. };
  18035. module.exports = function (AV) {
  18036. var requireRealtime = function requireRealtime() {
  18037. if (!AV._config.realtime) {
  18038. throw new Error('LiveQuery not supported. Please use the LiveQuery bundle. https://url.leanapp.cn/enable-live-query');
  18039. }
  18040. };
  18041. /**
  18042. * @class
  18043. * A LiveQuery, created by {@link AV.Query#subscribe} is an EventEmitter notifies changes of the Query.
  18044. * @since 3.0.0
  18045. */
  18046. AV.LiveQuery = inherits(EventEmitter,
  18047. /** @lends AV.LiveQuery.prototype */
  18048. {
  18049. constructor: function constructor(id, client, queryJSON, subscriptionId) {
  18050. var _this = this;
  18051. EventEmitter.apply(this);
  18052. this.id = id;
  18053. this._client = client;
  18054. this._client.register(this);
  18055. this._queryJSON = queryJSON;
  18056. this._subscriptionId = subscriptionId;
  18057. this._onMessage = this._dispatch.bind(this);
  18058. this._onReconnect = function () {
  18059. subscribe(_this._queryJSON, _this._subscriptionId).catch(function (error) {
  18060. return console.error("LiveQuery resubscribe error: ".concat(error.message));
  18061. });
  18062. };
  18063. client.on('message', this._onMessage);
  18064. client.on('reconnect', this._onReconnect);
  18065. },
  18066. _dispatch: function _dispatch(message) {
  18067. var _this2 = this;
  18068. message.forEach(function (_ref) {
  18069. var op = _ref.op,
  18070. object = _ref.object,
  18071. queryId = _ref.query_id,
  18072. updatedKeys = _ref.updatedKeys;
  18073. if (queryId !== _this2.id) return;
  18074. var target = AV.parseJSON(_.extend({
  18075. __type: object.className === '_File' ? 'File' : 'Object'
  18076. }, object));
  18077. if (updatedKeys) {
  18078. /**
  18079. * An existing AV.Object which fulfills the Query you subscribe is updated.
  18080. * @event AV.LiveQuery#update
  18081. * @param {AV.Object|AV.File} target updated object
  18082. * @param {String[]} updatedKeys updated keys
  18083. */
  18084. /**
  18085. * An existing AV.Object which doesn't fulfill the Query is updated and now it fulfills the Query.
  18086. * @event AV.LiveQuery#enter
  18087. * @param {AV.Object|AV.File} target updated object
  18088. * @param {String[]} updatedKeys updated keys
  18089. */
  18090. /**
  18091. * An existing AV.Object which fulfills the Query is updated and now it doesn't fulfill the Query.
  18092. * @event AV.LiveQuery#leave
  18093. * @param {AV.Object|AV.File} target updated object
  18094. * @param {String[]} updatedKeys updated keys
  18095. */
  18096. _this2.emit(op, target, updatedKeys);
  18097. } else {
  18098. /**
  18099. * A new AV.Object which fulfills the Query you subscribe is created.
  18100. * @event AV.LiveQuery#create
  18101. * @param {AV.Object|AV.File} target updated object
  18102. */
  18103. /**
  18104. * An existing AV.Object which fulfills the Query you subscribe is deleted.
  18105. * @event AV.LiveQuery#delete
  18106. * @param {AV.Object|AV.File} target updated object
  18107. */
  18108. _this2.emit(op, target);
  18109. }
  18110. });
  18111. },
  18112. /**
  18113. * unsubscribe the query
  18114. *
  18115. * @return {Promise}
  18116. */
  18117. unsubscribe: function unsubscribe() {
  18118. var client = this._client;
  18119. client.off('message', this._onMessage);
  18120. client.off('reconnect', this._onReconnect);
  18121. client.deregister(this);
  18122. return request({
  18123. method: 'POST',
  18124. path: '/LiveQuery/unsubscribe',
  18125. data: {
  18126. id: client.id,
  18127. query_id: this.id
  18128. }
  18129. });
  18130. }
  18131. },
  18132. /** @lends AV.LiveQuery */
  18133. {
  18134. init: function init(query) {
  18135. var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  18136. _ref2$subscriptionId = _ref2.subscriptionId,
  18137. userDefinedSubscriptionId = _ref2$subscriptionId === void 0 ? AV._getSubscriptionId() : _ref2$subscriptionId;
  18138. requireRealtime();
  18139. if (!(query instanceof AV.Query)) throw new TypeError('LiveQuery must be inited with a Query');
  18140. return _promise.default.resolve(userDefinedSubscriptionId).then(function (subscriptionId) {
  18141. return AV._config.realtime.createLiveQueryClient(subscriptionId).then(function (liveQueryClient) {
  18142. var _query$_getParams = query._getParams(),
  18143. where = _query$_getParams.where,
  18144. keys = (0, _keys.default)(_query$_getParams),
  18145. returnACL = _query$_getParams.returnACL;
  18146. var queryJSON = {
  18147. where: where,
  18148. keys: keys,
  18149. returnACL: returnACL,
  18150. className: query.className
  18151. };
  18152. var promise = subscribe(queryJSON, subscriptionId).then(function (_ref3) {
  18153. var queryId = _ref3.query_id;
  18154. return new AV.LiveQuery(queryId, liveQueryClient, queryJSON, subscriptionId);
  18155. }).finally(function () {
  18156. liveQueryClient.deregister(promise);
  18157. });
  18158. liveQueryClient.register(promise);
  18159. return promise;
  18160. });
  18161. });
  18162. },
  18163. /**
  18164. * Pause the LiveQuery connection. This is useful to deactivate the SDK when the app is swtiched to background.
  18165. * @static
  18166. * @return void
  18167. */
  18168. pause: function pause() {
  18169. requireRealtime();
  18170. return AV._config.realtime.pause();
  18171. },
  18172. /**
  18173. * Resume the LiveQuery connection. All subscriptions will be restored after reconnection.
  18174. * @static
  18175. * @return void
  18176. */
  18177. resume: function resume() {
  18178. requireRealtime();
  18179. return AV._config.realtime.resume();
  18180. }
  18181. });
  18182. };
  18183. /***/ }),
  18184. /* 536 */
  18185. /***/ (function(module, exports, __webpack_require__) {
  18186. "use strict";
  18187. var _ = __webpack_require__(2);
  18188. var _require = __webpack_require__(29),
  18189. tap = _require.tap;
  18190. module.exports = function (AV) {
  18191. /**
  18192. * @class
  18193. * @example
  18194. * AV.Captcha.request().then(captcha => {
  18195. * captcha.bind({
  18196. * textInput: 'code', // the id for textInput
  18197. * image: 'captcha',
  18198. * verifyButton: 'verify',
  18199. * }, {
  18200. * success: (validateCode) => {}, // next step
  18201. * error: (error) => {}, // present error.message to user
  18202. * });
  18203. * });
  18204. */
  18205. AV.Captcha = function Captcha(options, authOptions) {
  18206. this._options = options;
  18207. this._authOptions = authOptions;
  18208. /**
  18209. * The image url of the captcha
  18210. * @type string
  18211. */
  18212. this.url = undefined;
  18213. /**
  18214. * The captchaToken of the captcha.
  18215. * @type string
  18216. */
  18217. this.captchaToken = undefined;
  18218. /**
  18219. * The validateToken of the captcha.
  18220. * @type string
  18221. */
  18222. this.validateToken = undefined;
  18223. };
  18224. /**
  18225. * Refresh the captcha
  18226. * @return {Promise.<string>} a new capcha url
  18227. */
  18228. AV.Captcha.prototype.refresh = function refresh() {
  18229. var _this = this;
  18230. return AV.Cloud._requestCaptcha(this._options, this._authOptions).then(function (_ref) {
  18231. var captchaToken = _ref.captchaToken,
  18232. url = _ref.url;
  18233. _.extend(_this, {
  18234. captchaToken: captchaToken,
  18235. url: url
  18236. });
  18237. return url;
  18238. });
  18239. };
  18240. /**
  18241. * Verify the captcha
  18242. * @param {String} code The code from user input
  18243. * @return {Promise.<string>} validateToken if the code is valid
  18244. */
  18245. AV.Captcha.prototype.verify = function verify(code) {
  18246. var _this2 = this;
  18247. return AV.Cloud.verifyCaptcha(code, this.captchaToken).then(tap(function (validateToken) {
  18248. return _this2.validateToken = validateToken;
  18249. }));
  18250. };
  18251. if (false) {
  18252. /**
  18253. * Bind the captcha to HTMLElements. <b>ONLY AVAILABLE in browsers</b>.
  18254. * @param [elements]
  18255. * @param {String|HTMLInputElement} [elements.textInput] An input element typed text, or the id for the element.
  18256. * @param {String|HTMLImageElement} [elements.image] An image element, or the id for the element.
  18257. * @param {String|HTMLElement} [elements.verifyButton] A button element, or the id for the element.
  18258. * @param [callbacks]
  18259. * @param {Function} [callbacks.success] Success callback will be called if the code is verified. The param `validateCode` can be used for further SMS request.
  18260. * @param {Function} [callbacks.error] Error callback will be called if something goes wrong, detailed in param `error.message`.
  18261. */
  18262. AV.Captcha.prototype.bind = function bind(_ref2, _ref3) {
  18263. var _this3 = this;
  18264. var textInput = _ref2.textInput,
  18265. image = _ref2.image,
  18266. verifyButton = _ref2.verifyButton;
  18267. var success = _ref3.success,
  18268. error = _ref3.error;
  18269. if (typeof textInput === 'string') {
  18270. textInput = document.getElementById(textInput);
  18271. if (!textInput) throw new Error("textInput with id ".concat(textInput, " not found"));
  18272. }
  18273. if (typeof image === 'string') {
  18274. image = document.getElementById(image);
  18275. if (!image) throw new Error("image with id ".concat(image, " not found"));
  18276. }
  18277. if (typeof verifyButton === 'string') {
  18278. verifyButton = document.getElementById(verifyButton);
  18279. if (!verifyButton) throw new Error("verifyButton with id ".concat(verifyButton, " not found"));
  18280. }
  18281. this.__refresh = function () {
  18282. return _this3.refresh().then(function (url) {
  18283. image.src = url;
  18284. if (textInput) {
  18285. textInput.value = '';
  18286. textInput.focus();
  18287. }
  18288. }).catch(function (err) {
  18289. return console.warn("refresh captcha fail: ".concat(err.message));
  18290. });
  18291. };
  18292. if (image) {
  18293. this.__image = image;
  18294. image.src = this.url;
  18295. image.addEventListener('click', this.__refresh);
  18296. }
  18297. this.__verify = function () {
  18298. var code = textInput.value;
  18299. _this3.verify(code).catch(function (err) {
  18300. _this3.__refresh();
  18301. throw err;
  18302. }).then(success, error).catch(function (err) {
  18303. return console.warn("verify captcha fail: ".concat(err.message));
  18304. });
  18305. };
  18306. if (textInput && verifyButton) {
  18307. this.__verifyButton = verifyButton;
  18308. verifyButton.addEventListener('click', this.__verify);
  18309. }
  18310. };
  18311. /**
  18312. * unbind the captcha from HTMLElements. <b>ONLY AVAILABLE in browsers</b>.
  18313. */
  18314. AV.Captcha.prototype.unbind = function unbind() {
  18315. if (this.__image) this.__image.removeEventListener('click', this.__refresh);
  18316. if (this.__verifyButton) this.__verifyButton.removeEventListener('click', this.__verify);
  18317. };
  18318. }
  18319. /**
  18320. * Request a captcha
  18321. * @param [options]
  18322. * @param {Number} [options.width] width(px) of the captcha, ranged 60-200
  18323. * @param {Number} [options.height] height(px) of the captcha, ranged 30-100
  18324. * @param {Number} [options.size=4] length of the captcha, ranged 3-6. MasterKey required.
  18325. * @param {Number} [options.ttl=60] time to live(s), ranged 10-180. MasterKey required.
  18326. * @return {Promise.<AV.Captcha>}
  18327. */
  18328. AV.Captcha.request = function (options, authOptions) {
  18329. var captcha = new AV.Captcha(options, authOptions);
  18330. return captcha.refresh().then(function () {
  18331. return captcha;
  18332. });
  18333. };
  18334. };
  18335. /***/ }),
  18336. /* 537 */
  18337. /***/ (function(module, exports, __webpack_require__) {
  18338. "use strict";
  18339. var _interopRequireDefault = __webpack_require__(1);
  18340. var _promise = _interopRequireDefault(__webpack_require__(12));
  18341. var _ = __webpack_require__(2);
  18342. var _require = __webpack_require__(26),
  18343. _request = _require._request,
  18344. request = _require.request;
  18345. module.exports = function (AV) {
  18346. /**
  18347. * Contains functions for calling and declaring
  18348. * <p><strong><em>
  18349. * Some functions are only available from Cloud Code.
  18350. * </em></strong></p>
  18351. *
  18352. * @namespace
  18353. * @borrows AV.Captcha.request as requestCaptcha
  18354. */
  18355. AV.Cloud = AV.Cloud || {};
  18356. _.extend(AV.Cloud,
  18357. /** @lends AV.Cloud */
  18358. {
  18359. /**
  18360. * Makes a call to a cloud function.
  18361. * @param {String} name The function name.
  18362. * @param {Object} [data] The parameters to send to the cloud function.
  18363. * @param {AuthOptions} [options]
  18364. * @return {Promise} A promise that will be resolved with the result
  18365. * of the function.
  18366. */
  18367. run: function run(name, data, options) {
  18368. return request({
  18369. service: 'engine',
  18370. method: 'POST',
  18371. path: "/functions/".concat(name),
  18372. data: AV._encode(data, null, true),
  18373. authOptions: options
  18374. }).then(function (resp) {
  18375. return AV._decode(resp).result;
  18376. });
  18377. },
  18378. /**
  18379. * Makes a call to a cloud function, you can send {AV.Object} as param or a field of param; the response
  18380. * from server will also be parsed as an {AV.Object}, array of {AV.Object}, or object includes {AV.Object}
  18381. * @param {String} name The function name.
  18382. * @param {Object} [data] The parameters to send to the cloud function.
  18383. * @param {AuthOptions} [options]
  18384. * @return {Promise} A promise that will be resolved with the result of the function.
  18385. */
  18386. rpc: function rpc(name, data, options) {
  18387. if (_.isArray(data)) {
  18388. return _promise.default.reject(new Error("Can't pass Array as the param of rpc function in JavaScript SDK."));
  18389. }
  18390. return request({
  18391. service: 'engine',
  18392. method: 'POST',
  18393. path: "/call/".concat(name),
  18394. data: AV._encodeObjectOrArray(data),
  18395. authOptions: options
  18396. }).then(function (resp) {
  18397. return AV._decode(resp).result;
  18398. });
  18399. },
  18400. /**
  18401. * Make a call to request server date time.
  18402. * @return {Promise.<Date>} A promise that will be resolved with the result
  18403. * of the function.
  18404. * @since 0.5.9
  18405. */
  18406. getServerDate: function getServerDate() {
  18407. return _request('date', null, null, 'GET').then(function (resp) {
  18408. return AV._decode(resp);
  18409. });
  18410. },
  18411. /**
  18412. * Makes a call to request an sms code for operation verification.
  18413. * @param {String|Object} data The mobile phone number string or a JSON
  18414. * object that contains mobilePhoneNumber,template,sign,op,ttl,name etc.
  18415. * @param {String} data.mobilePhoneNumber
  18416. * @param {String} [data.template] sms template name
  18417. * @param {String} [data.sign] sms signature name
  18418. * @param {String} [data.smsType] sending code by `sms` (default) or `voice` call
  18419. * @param {SMSAuthOptions} [options]
  18420. * @return {Promise} A promise that will be resolved if the request succeed
  18421. */
  18422. requestSmsCode: function requestSmsCode(data) {
  18423. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18424. if (_.isString(data)) {
  18425. data = {
  18426. mobilePhoneNumber: data
  18427. };
  18428. }
  18429. if (!data.mobilePhoneNumber) {
  18430. throw new Error('Missing mobilePhoneNumber.');
  18431. }
  18432. if (options.validateToken) {
  18433. data = _.extend({}, data, {
  18434. validate_token: options.validateToken
  18435. });
  18436. }
  18437. return _request('requestSmsCode', null, null, 'POST', data, options);
  18438. },
  18439. /**
  18440. * Makes a call to verify sms code that sent by AV.Cloud.requestSmsCode
  18441. * @param {String} code The sms code sent by AV.Cloud.requestSmsCode
  18442. * @param {phone} phone The mobile phoner number.
  18443. * @return {Promise} A promise that will be resolved with the result
  18444. * of the function.
  18445. */
  18446. verifySmsCode: function verifySmsCode(code, phone) {
  18447. if (!code) throw new Error('Missing sms code.');
  18448. var params = {};
  18449. if (_.isString(phone)) {
  18450. params['mobilePhoneNumber'] = phone;
  18451. }
  18452. return _request('verifySmsCode', code, null, 'POST', params);
  18453. },
  18454. _requestCaptcha: function _requestCaptcha(options, authOptions) {
  18455. return _request('requestCaptcha', null, null, 'GET', options, authOptions).then(function (_ref) {
  18456. var url = _ref.captcha_url,
  18457. captchaToken = _ref.captcha_token;
  18458. return {
  18459. captchaToken: captchaToken,
  18460. url: url
  18461. };
  18462. });
  18463. },
  18464. /**
  18465. * Request a captcha.
  18466. */
  18467. requestCaptcha: AV.Captcha.request,
  18468. /**
  18469. * Verify captcha code. This is the low-level API for captcha.
  18470. * Checkout {@link AV.Captcha} for high abstract APIs.
  18471. * @param {String} code the code from user input
  18472. * @param {String} captchaToken captchaToken returned by {@link AV.Cloud.requestCaptcha}
  18473. * @return {Promise.<String>} validateToken if the code is valid
  18474. */
  18475. verifyCaptcha: function verifyCaptcha(code, captchaToken) {
  18476. return _request('verifyCaptcha', null, null, 'POST', {
  18477. captcha_code: code,
  18478. captcha_token: captchaToken
  18479. }).then(function (_ref2) {
  18480. var validateToken = _ref2.validate_token;
  18481. return validateToken;
  18482. });
  18483. }
  18484. });
  18485. };
  18486. /***/ }),
  18487. /* 538 */
  18488. /***/ (function(module, exports, __webpack_require__) {
  18489. "use strict";
  18490. var request = __webpack_require__(26).request;
  18491. module.exports = function (AV) {
  18492. AV.Installation = AV.Object.extend('_Installation');
  18493. /**
  18494. * @namespace
  18495. */
  18496. AV.Push = AV.Push || {};
  18497. /**
  18498. * Sends a push notification.
  18499. * @param {Object} data The data of the push notification.
  18500. * @param {String[]} [data.channels] An Array of channels to push to.
  18501. * @param {Date} [data.push_time] A Date object for when to send the push.
  18502. * @param {Date} [data.expiration_time] A Date object for when to expire
  18503. * the push.
  18504. * @param {Number} [data.expiration_interval] The seconds from now to expire the push.
  18505. * @param {Number} [data.flow_control] The clients to notify per second
  18506. * @param {AV.Query} [data.where] An AV.Query over AV.Installation that is used to match
  18507. * a set of installations to push to.
  18508. * @param {String} [data.cql] A CQL statement over AV.Installation that is used to match
  18509. * a set of installations to push to.
  18510. * @param {Object} data.data The data to send as part of the push.
  18511. More details: https://url.leanapp.cn/pushData
  18512. * @param {AuthOptions} [options]
  18513. * @return {Promise}
  18514. */
  18515. AV.Push.send = function (data, options) {
  18516. if (data.where) {
  18517. data.where = data.where._getParams().where;
  18518. }
  18519. if (data.where && data.cql) {
  18520. throw new Error("Both where and cql can't be set");
  18521. }
  18522. if (data.push_time) {
  18523. data.push_time = data.push_time.toJSON();
  18524. }
  18525. if (data.expiration_time) {
  18526. data.expiration_time = data.expiration_time.toJSON();
  18527. }
  18528. if (data.expiration_time && data.expiration_interval) {
  18529. throw new Error("Both expiration_time and expiration_interval can't be set");
  18530. }
  18531. return request({
  18532. service: 'push',
  18533. method: 'POST',
  18534. path: '/push',
  18535. data: data,
  18536. authOptions: options
  18537. });
  18538. };
  18539. };
  18540. /***/ }),
  18541. /* 539 */
  18542. /***/ (function(module, exports, __webpack_require__) {
  18543. "use strict";
  18544. var _interopRequireDefault = __webpack_require__(1);
  18545. var _promise = _interopRequireDefault(__webpack_require__(12));
  18546. var _typeof2 = _interopRequireDefault(__webpack_require__(109));
  18547. var _ = __webpack_require__(2);
  18548. var AVRequest = __webpack_require__(26)._request;
  18549. var _require = __webpack_require__(29),
  18550. getSessionToken = _require.getSessionToken;
  18551. module.exports = function (AV) {
  18552. var getUser = function getUser() {
  18553. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  18554. var sessionToken = getSessionToken(options);
  18555. if (sessionToken) {
  18556. return AV.User._fetchUserBySessionToken(getSessionToken(options));
  18557. }
  18558. return AV.User.currentAsync();
  18559. };
  18560. var getUserPointer = function getUserPointer(options) {
  18561. return getUser(options).then(function (currUser) {
  18562. return AV.Object.createWithoutData('_User', currUser.id)._toPointer();
  18563. });
  18564. };
  18565. /**
  18566. * Contains functions to deal with Status in LeanCloud.
  18567. * @class
  18568. */
  18569. AV.Status = function (imageUrl, message) {
  18570. this.data = {};
  18571. this.inboxType = 'default';
  18572. this.query = null;
  18573. if (imageUrl && (0, _typeof2.default)(imageUrl) === 'object') {
  18574. this.data = imageUrl;
  18575. } else {
  18576. if (imageUrl) {
  18577. this.data.image = imageUrl;
  18578. }
  18579. if (message) {
  18580. this.data.message = message;
  18581. }
  18582. }
  18583. return this;
  18584. };
  18585. _.extend(AV.Status.prototype,
  18586. /** @lends AV.Status.prototype */
  18587. {
  18588. /**
  18589. * Gets the value of an attribute in status data.
  18590. * @param {String} attr The string name of an attribute.
  18591. */
  18592. get: function get(attr) {
  18593. return this.data[attr];
  18594. },
  18595. /**
  18596. * Sets a hash of model attributes on the status data.
  18597. * @param {String} key The key to set.
  18598. * @param {any} value The value to give it.
  18599. */
  18600. set: function set(key, value) {
  18601. this.data[key] = value;
  18602. return this;
  18603. },
  18604. /**
  18605. * Destroy this status,then it will not be avaiable in other user's inboxes.
  18606. * @param {AuthOptions} options
  18607. * @return {Promise} A promise that is fulfilled when the destroy
  18608. * completes.
  18609. */
  18610. destroy: function destroy(options) {
  18611. if (!this.id) return _promise.default.reject(new Error('The status id is not exists.'));
  18612. var request = AVRequest('statuses', null, this.id, 'DELETE', options);
  18613. return request;
  18614. },
  18615. /**
  18616. * Cast the AV.Status object to an AV.Object pointer.
  18617. * @return {AV.Object} A AV.Object pointer.
  18618. */
  18619. toObject: function toObject() {
  18620. if (!this.id) return null;
  18621. return AV.Object.createWithoutData('_Status', this.id);
  18622. },
  18623. _getDataJSON: function _getDataJSON() {
  18624. var json = _.clone(this.data);
  18625. return AV._encode(json);
  18626. },
  18627. /**
  18628. * Send a status by a AV.Query object.
  18629. * @since 0.3.0
  18630. * @param {AuthOptions} options
  18631. * @return {Promise} A promise that is fulfilled when the send
  18632. * completes.
  18633. * @example
  18634. * // send a status to male users
  18635. * var status = new AVStatus('image url', 'a message');
  18636. * status.query = new AV.Query('_User');
  18637. * status.query.equalTo('gender', 'male');
  18638. * status.send().then(function(){
  18639. * //send status successfully.
  18640. * }, function(err){
  18641. * //an error threw.
  18642. * console.dir(err);
  18643. * });
  18644. */
  18645. send: function send() {
  18646. var _this = this;
  18647. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  18648. if (!getSessionToken(options) && !AV.User.current()) {
  18649. throw new Error('Please signin an user.');
  18650. }
  18651. if (!this.query) {
  18652. return AV.Status.sendStatusToFollowers(this, options);
  18653. }
  18654. return getUserPointer(options).then(function (currUser) {
  18655. var query = _this.query._getParams();
  18656. query.className = _this.query.className;
  18657. var data = {};
  18658. data.query = query;
  18659. _this.data = _this.data || {};
  18660. _this.data.source = _this.data.source || currUser;
  18661. data.data = _this._getDataJSON();
  18662. data.inboxType = _this.inboxType || 'default';
  18663. return AVRequest('statuses', null, null, 'POST', data, options);
  18664. }).then(function (response) {
  18665. _this.id = response.objectId;
  18666. _this.createdAt = AV._parseDate(response.createdAt);
  18667. return _this;
  18668. });
  18669. },
  18670. _finishFetch: function _finishFetch(serverData) {
  18671. this.id = serverData.objectId;
  18672. this.createdAt = AV._parseDate(serverData.createdAt);
  18673. this.updatedAt = AV._parseDate(serverData.updatedAt);
  18674. this.messageId = serverData.messageId;
  18675. delete serverData.messageId;
  18676. delete serverData.objectId;
  18677. delete serverData.createdAt;
  18678. delete serverData.updatedAt;
  18679. this.data = AV._decode(serverData);
  18680. }
  18681. });
  18682. /**
  18683. * Send a status to current signined user's followers.
  18684. * @since 0.3.0
  18685. * @param {AV.Status} status A status object to be send to followers.
  18686. * @param {AuthOptions} options
  18687. * @return {Promise} A promise that is fulfilled when the send
  18688. * completes.
  18689. * @example
  18690. * var status = new AVStatus('image url', 'a message');
  18691. * AV.Status.sendStatusToFollowers(status).then(function(){
  18692. * //send status successfully.
  18693. * }, function(err){
  18694. * //an error threw.
  18695. * console.dir(err);
  18696. * });
  18697. */
  18698. AV.Status.sendStatusToFollowers = function (status) {
  18699. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18700. if (!getSessionToken(options) && !AV.User.current()) {
  18701. throw new Error('Please signin an user.');
  18702. }
  18703. return getUserPointer(options).then(function (currUser) {
  18704. var query = {};
  18705. query.className = '_Follower';
  18706. query.keys = 'follower';
  18707. query.where = {
  18708. user: currUser
  18709. };
  18710. var data = {};
  18711. data.query = query;
  18712. status.data = status.data || {};
  18713. status.data.source = status.data.source || currUser;
  18714. data.data = status._getDataJSON();
  18715. data.inboxType = status.inboxType || 'default';
  18716. var request = AVRequest('statuses', null, null, 'POST', data, options);
  18717. return request.then(function (response) {
  18718. status.id = response.objectId;
  18719. status.createdAt = AV._parseDate(response.createdAt);
  18720. return status;
  18721. });
  18722. });
  18723. };
  18724. /**
  18725. * <p>Send a status from current signined user to other user's private status inbox.</p>
  18726. * @since 0.3.0
  18727. * @param {AV.Status} status A status object to be send to followers.
  18728. * @param {String} target The target user or user's objectId.
  18729. * @param {AuthOptions} options
  18730. * @return {Promise} A promise that is fulfilled when the send
  18731. * completes.
  18732. * @example
  18733. * // send a private status to user '52e84e47e4b0f8de283b079b'
  18734. * var status = new AVStatus('image url', 'a message');
  18735. * AV.Status.sendPrivateStatus(status, '52e84e47e4b0f8de283b079b').then(function(){
  18736. * //send status successfully.
  18737. * }, function(err){
  18738. * //an error threw.
  18739. * console.dir(err);
  18740. * });
  18741. */
  18742. AV.Status.sendPrivateStatus = function (status, target) {
  18743. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  18744. if (!getSessionToken(options) && !AV.User.current()) {
  18745. throw new Error('Please signin an user.');
  18746. }
  18747. if (!target) {
  18748. throw new Error('Invalid target user.');
  18749. }
  18750. var userObjectId = _.isString(target) ? target : target.id;
  18751. if (!userObjectId) {
  18752. throw new Error('Invalid target user.');
  18753. }
  18754. return getUserPointer(options).then(function (currUser) {
  18755. var query = {};
  18756. query.className = '_User';
  18757. query.where = {
  18758. objectId: userObjectId
  18759. };
  18760. var data = {};
  18761. data.query = query;
  18762. status.data = status.data || {};
  18763. status.data.source = status.data.source || currUser;
  18764. data.data = status._getDataJSON();
  18765. data.inboxType = 'private';
  18766. status.inboxType = 'private';
  18767. var request = AVRequest('statuses', null, null, 'POST', data, options);
  18768. return request.then(function (response) {
  18769. status.id = response.objectId;
  18770. status.createdAt = AV._parseDate(response.createdAt);
  18771. return status;
  18772. });
  18773. });
  18774. };
  18775. /**
  18776. * Count unread statuses in someone's inbox.
  18777. * @since 0.3.0
  18778. * @param {AV.User} owner The status owner.
  18779. * @param {String} inboxType The inbox type, 'default' by default.
  18780. * @param {AuthOptions} options
  18781. * @return {Promise} A promise that is fulfilled when the count
  18782. * completes.
  18783. * @example
  18784. * AV.Status.countUnreadStatuses(AV.User.current()).then(function(response){
  18785. * console.log(response.unread); //unread statuses number.
  18786. * console.log(response.total); //total statuses number.
  18787. * });
  18788. */
  18789. AV.Status.countUnreadStatuses = function (owner) {
  18790. var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
  18791. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  18792. if (!_.isString(inboxType)) options = inboxType;
  18793. if (!getSessionToken(options) && owner == null && !AV.User.current()) {
  18794. throw new Error('Please signin an user or pass the owner objectId.');
  18795. }
  18796. return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
  18797. var params = {};
  18798. params.inboxType = AV._encode(inboxType);
  18799. params.owner = AV._encode(owner);
  18800. return AVRequest('subscribe/statuses/count', null, null, 'GET', params, options);
  18801. });
  18802. };
  18803. /**
  18804. * reset unread statuses count in someone's inbox.
  18805. * @since 2.1.0
  18806. * @param {AV.User} owner The status owner.
  18807. * @param {String} inboxType The inbox type, 'default' by default.
  18808. * @param {AuthOptions} options
  18809. * @return {Promise} A promise that is fulfilled when the reset
  18810. * completes.
  18811. * @example
  18812. * AV.Status.resetUnreadCount(AV.User.current()).then(function(response){
  18813. * console.log(response.unread); //unread statuses number.
  18814. * console.log(response.total); //total statuses number.
  18815. * });
  18816. */
  18817. AV.Status.resetUnreadCount = function (owner) {
  18818. var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
  18819. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  18820. if (!_.isString(inboxType)) options = inboxType;
  18821. if (!getSessionToken(options) && owner == null && !AV.User.current()) {
  18822. throw new Error('Please signin an user or pass the owner objectId.');
  18823. }
  18824. return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
  18825. var params = {};
  18826. params.inboxType = AV._encode(inboxType);
  18827. params.owner = AV._encode(owner);
  18828. return AVRequest('subscribe/statuses/resetUnreadCount', null, null, 'POST', params, options);
  18829. });
  18830. };
  18831. /**
  18832. * Create a status query to find someone's published statuses.
  18833. * @since 0.3.0
  18834. * @param {AV.User} source The status source, typically the publisher.
  18835. * @return {AV.Query} The query object for status.
  18836. * @example
  18837. * //Find current user's published statuses.
  18838. * var query = AV.Status.statusQuery(AV.User.current());
  18839. * query.find().then(function(statuses){
  18840. * //process statuses
  18841. * });
  18842. */
  18843. AV.Status.statusQuery = function (source) {
  18844. var query = new AV.Query('_Status');
  18845. if (source) {
  18846. query.equalTo('source', source);
  18847. }
  18848. return query;
  18849. };
  18850. /**
  18851. * <p>AV.InboxQuery defines a query that is used to fetch somebody's inbox statuses.</p>
  18852. * @class
  18853. */
  18854. AV.InboxQuery = AV.Query._extend(
  18855. /** @lends AV.InboxQuery.prototype */
  18856. {
  18857. _objectClass: AV.Status,
  18858. _sinceId: 0,
  18859. _maxId: 0,
  18860. _inboxType: 'default',
  18861. _owner: null,
  18862. _newObject: function _newObject() {
  18863. return new AV.Status();
  18864. },
  18865. _createRequest: function _createRequest(params, options) {
  18866. return AV.InboxQuery.__super__._createRequest.call(this, params, options, '/subscribe/statuses');
  18867. },
  18868. /**
  18869. * Sets the messageId of results to skip before returning any results.
  18870. * This is useful for pagination.
  18871. * Default is zero.
  18872. * @param {Number} n the mesage id.
  18873. * @return {AV.InboxQuery} Returns the query, so you can chain this call.
  18874. */
  18875. sinceId: function sinceId(id) {
  18876. this._sinceId = id;
  18877. return this;
  18878. },
  18879. /**
  18880. * Sets the maximal messageId of results。
  18881. * This is useful for pagination.
  18882. * Default is zero that is no limition.
  18883. * @param {Number} n the mesage id.
  18884. * @return {AV.InboxQuery} Returns the query, so you can chain this call.
  18885. */
  18886. maxId: function maxId(id) {
  18887. this._maxId = id;
  18888. return this;
  18889. },
  18890. /**
  18891. * Sets the owner of the querying inbox.
  18892. * @param {AV.User} owner The inbox owner.
  18893. * @return {AV.InboxQuery} Returns the query, so you can chain this call.
  18894. */
  18895. owner: function owner(_owner) {
  18896. this._owner = _owner;
  18897. return this;
  18898. },
  18899. /**
  18900. * Sets the querying inbox type.default is 'default'.
  18901. * @param {String} type The inbox type.
  18902. * @return {AV.InboxQuery} Returns the query, so you can chain this call.
  18903. */
  18904. inboxType: function inboxType(type) {
  18905. this._inboxType = type;
  18906. return this;
  18907. },
  18908. _getParams: function _getParams() {
  18909. var params = AV.InboxQuery.__super__._getParams.call(this);
  18910. params.owner = AV._encode(this._owner);
  18911. params.inboxType = AV._encode(this._inboxType);
  18912. params.sinceId = AV._encode(this._sinceId);
  18913. params.maxId = AV._encode(this._maxId);
  18914. return params;
  18915. }
  18916. });
  18917. /**
  18918. * Create a inbox status query to find someone's inbox statuses.
  18919. * @since 0.3.0
  18920. * @param {AV.User} owner The inbox's owner
  18921. * @param {String} inboxType The inbox type,'default' by default.
  18922. * @return {AV.InboxQuery} The inbox query object.
  18923. * @see AV.InboxQuery
  18924. * @example
  18925. * //Find current user's default inbox statuses.
  18926. * var query = AV.Status.inboxQuery(AV.User.current());
  18927. * //find the statuses after the last message id
  18928. * query.sinceId(lastMessageId);
  18929. * query.find().then(function(statuses){
  18930. * //process statuses
  18931. * });
  18932. */
  18933. AV.Status.inboxQuery = function (owner, inboxType) {
  18934. var query = new AV.InboxQuery(AV.Status);
  18935. if (owner) {
  18936. query._owner = owner;
  18937. }
  18938. if (inboxType) {
  18939. query._inboxType = inboxType;
  18940. }
  18941. return query;
  18942. };
  18943. };
  18944. /***/ }),
  18945. /* 540 */
  18946. /***/ (function(module, exports, __webpack_require__) {
  18947. "use strict";
  18948. var _interopRequireDefault = __webpack_require__(1);
  18949. var _stringify = _interopRequireDefault(__webpack_require__(36));
  18950. var _map = _interopRequireDefault(__webpack_require__(42));
  18951. var _ = __webpack_require__(2);
  18952. var AVRequest = __webpack_require__(26)._request;
  18953. module.exports = function (AV) {
  18954. /**
  18955. * A builder to generate sort string for app searching.For example:
  18956. * @class
  18957. * @since 0.5.1
  18958. * @example
  18959. * var builder = new AV.SearchSortBuilder();
  18960. * builder.ascending('key1').descending('key2','max');
  18961. * var query = new AV.SearchQuery('Player');
  18962. * query.sortBy(builder);
  18963. * query.find().then();
  18964. */
  18965. AV.SearchSortBuilder = function () {
  18966. this._sortFields = [];
  18967. };
  18968. _.extend(AV.SearchSortBuilder.prototype,
  18969. /** @lends AV.SearchSortBuilder.prototype */
  18970. {
  18971. _addField: function _addField(key, order, mode, missing) {
  18972. var field = {};
  18973. field[key] = {
  18974. order: order || 'asc',
  18975. mode: mode || 'avg',
  18976. missing: '_' + (missing || 'last')
  18977. };
  18978. this._sortFields.push(field);
  18979. return this;
  18980. },
  18981. /**
  18982. * Sorts the results in ascending order by the given key and options.
  18983. *
  18984. * @param {String} key The key to order by.
  18985. * @param {String} mode The sort mode, default is 'avg', you can choose
  18986. * 'max' or 'min' too.
  18987. * @param {String} missing The missing key behaviour, default is 'last',
  18988. * you can choose 'first' too.
  18989. * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
  18990. */
  18991. ascending: function ascending(key, mode, missing) {
  18992. return this._addField(key, 'asc', mode, missing);
  18993. },
  18994. /**
  18995. * Sorts the results in descending order by the given key and options.
  18996. *
  18997. * @param {String} key The key to order by.
  18998. * @param {String} mode The sort mode, default is 'avg', you can choose
  18999. * 'max' or 'min' too.
  19000. * @param {String} missing The missing key behaviour, default is 'last',
  19001. * you can choose 'first' too.
  19002. * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
  19003. */
  19004. descending: function descending(key, mode, missing) {
  19005. return this._addField(key, 'desc', mode, missing);
  19006. },
  19007. /**
  19008. * Add a proximity based constraint for finding objects with key point
  19009. * values near the point given.
  19010. * @param {String} key The key that the AV.GeoPoint is stored in.
  19011. * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
  19012. * @param {Object} options The other options such as mode,order, unit etc.
  19013. * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
  19014. */
  19015. whereNear: function whereNear(key, point, options) {
  19016. options = options || {};
  19017. var field = {};
  19018. var geo = {
  19019. lat: point.latitude,
  19020. lon: point.longitude
  19021. };
  19022. var m = {
  19023. order: options.order || 'asc',
  19024. mode: options.mode || 'avg',
  19025. unit: options.unit || 'km'
  19026. };
  19027. m[key] = geo;
  19028. field['_geo_distance'] = m;
  19029. this._sortFields.push(field);
  19030. return this;
  19031. },
  19032. /**
  19033. * Build a sort string by configuration.
  19034. * @return {String} the sort string.
  19035. */
  19036. build: function build() {
  19037. return (0, _stringify.default)(AV._encode(this._sortFields));
  19038. }
  19039. });
  19040. /**
  19041. * App searching query.Use just like AV.Query:
  19042. *
  19043. * Visit <a href='https://leancloud.cn/docs/app_search_guide.html'>App Searching Guide</a>
  19044. * for more details.
  19045. * @class
  19046. * @since 0.5.1
  19047. * @example
  19048. * var query = new AV.SearchQuery('Player');
  19049. * query.queryString('*');
  19050. * query.find().then(function(results) {
  19051. * console.log('Found %d objects', query.hits());
  19052. * //Process results
  19053. * });
  19054. */
  19055. AV.SearchQuery = AV.Query._extend(
  19056. /** @lends AV.SearchQuery.prototype */
  19057. {
  19058. _sid: null,
  19059. _hits: 0,
  19060. _queryString: null,
  19061. _highlights: null,
  19062. _sortBuilder: null,
  19063. _clazz: null,
  19064. constructor: function constructor(className) {
  19065. if (className) {
  19066. this._clazz = className;
  19067. } else {
  19068. className = '__INVALID_CLASS';
  19069. }
  19070. AV.Query.call(this, className);
  19071. },
  19072. _createRequest: function _createRequest(params, options) {
  19073. return AVRequest('search/select', null, null, 'GET', params || this._getParams(), options);
  19074. },
  19075. /**
  19076. * Sets the sid of app searching query.Default is null.
  19077. * @param {String} sid Scroll id for searching.
  19078. * @return {AV.SearchQuery} Returns the query, so you can chain this call.
  19079. */
  19080. sid: function sid(_sid) {
  19081. this._sid = _sid;
  19082. return this;
  19083. },
  19084. /**
  19085. * Sets the query string of app searching.
  19086. * @param {String} q The query string.
  19087. * @return {AV.SearchQuery} Returns the query, so you can chain this call.
  19088. */
  19089. queryString: function queryString(q) {
  19090. this._queryString = q;
  19091. return this;
  19092. },
  19093. /**
  19094. * Sets the highlight fields. Such as
  19095. * <pre><code>
  19096. * query.highlights('title');
  19097. * //or pass an array.
  19098. * query.highlights(['title', 'content'])
  19099. * </code></pre>
  19100. * @param {String|String[]} highlights a list of fields.
  19101. * @return {AV.SearchQuery} Returns the query, so you can chain this call.
  19102. */
  19103. highlights: function highlights(_highlights) {
  19104. var objects;
  19105. if (_highlights && _.isString(_highlights)) {
  19106. objects = _.toArray(arguments);
  19107. } else {
  19108. objects = _highlights;
  19109. }
  19110. this._highlights = objects;
  19111. return this;
  19112. },
  19113. /**
  19114. * Sets the sort builder for this query.
  19115. * @see AV.SearchSortBuilder
  19116. * @param { AV.SearchSortBuilder} builder The sort builder.
  19117. * @return {AV.SearchQuery} Returns the query, so you can chain this call.
  19118. *
  19119. */
  19120. sortBy: function sortBy(builder) {
  19121. this._sortBuilder = builder;
  19122. return this;
  19123. },
  19124. /**
  19125. * Returns the number of objects that match this query.
  19126. * @return {Number}
  19127. */
  19128. hits: function hits() {
  19129. if (!this._hits) {
  19130. this._hits = 0;
  19131. }
  19132. return this._hits;
  19133. },
  19134. _processResult: function _processResult(json) {
  19135. delete json['className'];
  19136. delete json['_app_url'];
  19137. delete json['_deeplink'];
  19138. return json;
  19139. },
  19140. /**
  19141. * Returns true when there are more documents can be retrieved by this
  19142. * query instance, you can call find function to get more results.
  19143. * @see AV.SearchQuery#find
  19144. * @return {Boolean}
  19145. */
  19146. hasMore: function hasMore() {
  19147. return !this._hitEnd;
  19148. },
  19149. /**
  19150. * Reset current query instance state(such as sid, hits etc) except params
  19151. * for a new searching. After resetting, hasMore() will return true.
  19152. */
  19153. reset: function reset() {
  19154. this._hitEnd = false;
  19155. this._sid = null;
  19156. this._hits = 0;
  19157. },
  19158. /**
  19159. * Retrieves a list of AVObjects that satisfy this query.
  19160. * Either options.success or options.error is called when the find
  19161. * completes.
  19162. *
  19163. * @see AV.Query#find
  19164. * @param {AuthOptions} options
  19165. * @return {Promise} A promise that is resolved with the results when
  19166. * the query completes.
  19167. */
  19168. find: function find(options) {
  19169. var self = this;
  19170. var request = this._createRequest(undefined, options);
  19171. return request.then(function (response) {
  19172. //update sid for next querying.
  19173. if (response.sid) {
  19174. self._oldSid = self._sid;
  19175. self._sid = response.sid;
  19176. } else {
  19177. self._sid = null;
  19178. self._hitEnd = true;
  19179. }
  19180. self._hits = response.hits || 0;
  19181. return (0, _map.default)(_).call(_, response.results, function (json) {
  19182. if (json.className) {
  19183. response.className = json.className;
  19184. }
  19185. var obj = self._newObject(response);
  19186. obj.appURL = json['_app_url'];
  19187. obj._finishFetch(self._processResult(json), true);
  19188. return obj;
  19189. });
  19190. });
  19191. },
  19192. _getParams: function _getParams() {
  19193. var params = AV.SearchQuery.__super__._getParams.call(this);
  19194. delete params.where;
  19195. if (this._clazz) {
  19196. params.clazz = this.className;
  19197. }
  19198. if (this._sid) {
  19199. params.sid = this._sid;
  19200. }
  19201. if (!this._queryString) {
  19202. throw new Error('Please set query string.');
  19203. } else {
  19204. params.q = this._queryString;
  19205. }
  19206. if (this._highlights) {
  19207. params.highlights = this._highlights.join(',');
  19208. }
  19209. if (this._sortBuilder && params.order) {
  19210. throw new Error('sort and order can not be set at same time.');
  19211. }
  19212. if (this._sortBuilder) {
  19213. params.sort = this._sortBuilder.build();
  19214. }
  19215. return params;
  19216. }
  19217. });
  19218. };
  19219. /**
  19220. * Sorts the results in ascending order by the given key.
  19221. *
  19222. * @method AV.SearchQuery#ascending
  19223. * @param {String} key The key to order by.
  19224. * @return {AV.SearchQuery} Returns the query, so you can chain this call.
  19225. */
  19226. /**
  19227. * Also sorts the results in ascending order by the given key. The previous sort keys have
  19228. * precedence over this key.
  19229. *
  19230. * @method AV.SearchQuery#addAscending
  19231. * @param {String} key The key to order by
  19232. * @return {AV.SearchQuery} Returns the query so you can chain this call.
  19233. */
  19234. /**
  19235. * Sorts the results in descending order by the given key.
  19236. *
  19237. * @method AV.SearchQuery#descending
  19238. * @param {String} key The key to order by.
  19239. * @return {AV.SearchQuery} Returns the query, so you can chain this call.
  19240. */
  19241. /**
  19242. * Also sorts the results in descending order by the given key. The previous sort keys have
  19243. * precedence over this key.
  19244. *
  19245. * @method AV.SearchQuery#addDescending
  19246. * @param {String} key The key to order by
  19247. * @return {AV.SearchQuery} Returns the query so you can chain this call.
  19248. */
  19249. /**
  19250. * Include nested AV.Objects for the provided key. You can use dot
  19251. * notation to specify which fields in the included object are also fetch.
  19252. * @method AV.SearchQuery#include
  19253. * @param {String[]} keys The name of the key to include.
  19254. * @return {AV.SearchQuery} Returns the query, so you can chain this call.
  19255. */
  19256. /**
  19257. * Sets the number of results to skip before returning any results.
  19258. * This is useful for pagination.
  19259. * Default is to skip zero results.
  19260. * @method AV.SearchQuery#skip
  19261. * @param {Number} n the number of results to skip.
  19262. * @return {AV.SearchQuery} Returns the query, so you can chain this call.
  19263. */
  19264. /**
  19265. * Sets the limit of the number of results to return. The default limit is
  19266. * 100, with a maximum of 1000 results being returned at a time.
  19267. * @method AV.SearchQuery#limit
  19268. * @param {Number} n the number of results to limit to.
  19269. * @return {AV.SearchQuery} Returns the query, so you can chain this call.
  19270. */
  19271. /***/ }),
  19272. /* 541 */
  19273. /***/ (function(module, exports, __webpack_require__) {
  19274. "use strict";
  19275. var _interopRequireDefault = __webpack_require__(1);
  19276. var _promise = _interopRequireDefault(__webpack_require__(12));
  19277. var _ = __webpack_require__(2);
  19278. var AVError = __webpack_require__(43);
  19279. var _require = __webpack_require__(26),
  19280. request = _require.request;
  19281. module.exports = function (AV) {
  19282. /**
  19283. * 包含了使用了 LeanCloud
  19284. * <a href='/docs/leaninsight_guide.html'>离线数据分析功能</a>的函数。
  19285. * <p><strong><em>
  19286. * 仅在云引擎运行环境下有效。
  19287. * </em></strong></p>
  19288. * @namespace
  19289. */
  19290. AV.Insight = AV.Insight || {};
  19291. _.extend(AV.Insight,
  19292. /** @lends AV.Insight */
  19293. {
  19294. /**
  19295. * 开始一个 Insight 任务。结果里将返回 Job id,你可以拿得到的 id 使用
  19296. * AV.Insight.JobQuery 查询任务状态和结果。
  19297. * @param {Object} jobConfig 任务配置的 JSON 对象,例如:<code><pre>
  19298. * { "sql" : "select count(*) as c,gender from _User group by gender",
  19299. * "saveAs": {
  19300. * "className" : "UserGender",
  19301. * "limit": 1
  19302. * }
  19303. * }
  19304. * </pre></code>
  19305. * sql 指定任务执行的 SQL 语句, saveAs(可选) 指定将结果保存在哪张表里,limit 最大 1000。
  19306. * @param {AuthOptions} [options]
  19307. * @return {Promise} A promise that will be resolved with the result
  19308. * of the function.
  19309. */
  19310. startJob: function startJob(jobConfig, options) {
  19311. if (!jobConfig || !jobConfig.sql) {
  19312. throw new Error('Please provide the sql to run the job.');
  19313. }
  19314. var data = {
  19315. jobConfig: jobConfig,
  19316. appId: AV.applicationId
  19317. };
  19318. return request({
  19319. path: '/bigquery/jobs',
  19320. method: 'POST',
  19321. data: AV._encode(data, null, true),
  19322. authOptions: options,
  19323. signKey: false
  19324. }).then(function (resp) {
  19325. return AV._decode(resp).id;
  19326. });
  19327. },
  19328. /**
  19329. * 监听 Insight 任务事件(未来推出独立部署的离线分析服务后开放)
  19330. * <p><strong><em>
  19331. * 仅在云引擎运行环境下有效。
  19332. * </em></strong></p>
  19333. * @param {String} event 监听的事件,目前尚不支持。
  19334. * @param {Function} 监听回调函数,接收 (err, id) 两个参数,err 表示错误信息,
  19335. * id 表示任务 id。接下来你可以拿这个 id 使用AV.Insight.JobQuery 查询任务状态和结果。
  19336. *
  19337. */
  19338. on: function on(event, cb) {}
  19339. });
  19340. /**
  19341. * 创建一个对象,用于查询 Insight 任务状态和结果。
  19342. * @class
  19343. * @param {String} id 任务 id
  19344. * @since 0.5.5
  19345. */
  19346. AV.Insight.JobQuery = function (id, className) {
  19347. if (!id) {
  19348. throw new Error('Please provide the job id.');
  19349. }
  19350. this.id = id;
  19351. this.className = className;
  19352. this._skip = 0;
  19353. this._limit = 100;
  19354. };
  19355. _.extend(AV.Insight.JobQuery.prototype,
  19356. /** @lends AV.Insight.JobQuery.prototype */
  19357. {
  19358. /**
  19359. * Sets the number of results to skip before returning any results.
  19360. * This is useful for pagination.
  19361. * Default is to skip zero results.
  19362. * @param {Number} n the number of results to skip.
  19363. * @return {AV.Query} Returns the query, so you can chain this call.
  19364. */
  19365. skip: function skip(n) {
  19366. this._skip = n;
  19367. return this;
  19368. },
  19369. /**
  19370. * Sets the limit of the number of results to return. The default limit is
  19371. * 100, with a maximum of 1000 results being returned at a time.
  19372. * @param {Number} n the number of results to limit to.
  19373. * @return {AV.Query} Returns the query, so you can chain this call.
  19374. */
  19375. limit: function limit(n) {
  19376. this._limit = n;
  19377. return this;
  19378. },
  19379. /**
  19380. * 查询任务状态和结果,任务结果为一个 JSON 对象,包括 status 表示任务状态, totalCount 表示总数,
  19381. * results 数组表示任务结果数组,previewCount 表示可以返回的结果总数,任务的开始和截止时间
  19382. * startTime、endTime 等信息。
  19383. *
  19384. * @param {AuthOptions} [options]
  19385. * @return {Promise} A promise that will be resolved with the result
  19386. * of the function.
  19387. *
  19388. */
  19389. find: function find(options) {
  19390. var params = {
  19391. skip: this._skip,
  19392. limit: this._limit
  19393. };
  19394. return request({
  19395. path: "/bigquery/jobs/".concat(this.id),
  19396. method: 'GET',
  19397. query: params,
  19398. authOptions: options,
  19399. signKey: false
  19400. }).then(function (response) {
  19401. if (response.error) {
  19402. return _promise.default.reject(new AVError(response.code, response.error));
  19403. }
  19404. return _promise.default.resolve(response);
  19405. });
  19406. }
  19407. });
  19408. };
  19409. /***/ }),
  19410. /* 542 */
  19411. /***/ (function(module, exports, __webpack_require__) {
  19412. "use strict";
  19413. var _interopRequireDefault = __webpack_require__(1);
  19414. var _promise = _interopRequireDefault(__webpack_require__(12));
  19415. var _ = __webpack_require__(2);
  19416. var _require = __webpack_require__(26),
  19417. LCRequest = _require.request;
  19418. var _require2 = __webpack_require__(29),
  19419. getSessionToken = _require2.getSessionToken;
  19420. module.exports = function (AV) {
  19421. var getUserWithSessionToken = function getUserWithSessionToken(authOptions) {
  19422. if (authOptions.user) {
  19423. if (!authOptions.user._sessionToken) {
  19424. throw new Error('authOptions.user is not signed in.');
  19425. }
  19426. return _promise.default.resolve(authOptions.user);
  19427. }
  19428. if (authOptions.sessionToken) {
  19429. return AV.User._fetchUserBySessionToken(authOptions.sessionToken);
  19430. }
  19431. return AV.User.currentAsync();
  19432. };
  19433. var getSessionTokenAsync = function getSessionTokenAsync(authOptions) {
  19434. var sessionToken = getSessionToken(authOptions);
  19435. if (sessionToken) {
  19436. return _promise.default.resolve(sessionToken);
  19437. }
  19438. return AV.User.currentAsync().then(function (user) {
  19439. if (user) {
  19440. return user.getSessionToken();
  19441. }
  19442. });
  19443. };
  19444. /**
  19445. * Contains functions to deal with Friendship in LeanCloud.
  19446. * @class
  19447. */
  19448. AV.Friendship = {
  19449. /**
  19450. * Request friendship.
  19451. * @since 4.8.0
  19452. * @param {String | AV.User | Object} options if an AV.User or string is given, it will be used as the friend.
  19453. * @param {AV.User | string} options.friend The friend (or friend's objectId) to follow.
  19454. * @param {Object} [options.attributes] key-value attributes dictionary to be used as conditions of followeeQuery.
  19455. * @param {AuthOptions} [authOptions]
  19456. * @return {Promise<void>}
  19457. */
  19458. request: function request(options) {
  19459. var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  19460. var friend;
  19461. var attributes;
  19462. if (options.friend) {
  19463. friend = options.friend;
  19464. attributes = options.attributes;
  19465. } else {
  19466. friend = options;
  19467. }
  19468. var friendObj = _.isString(friend) ? AV.Object.createWithoutData('_User', friend) : friend;
  19469. return getUserWithSessionToken(authOptions).then(function (userObj) {
  19470. if (!userObj) {
  19471. throw new Error('Please signin an user.');
  19472. }
  19473. return LCRequest({
  19474. method: 'POST',
  19475. path: '/users/friendshipRequests',
  19476. data: {
  19477. user: userObj._toPointer(),
  19478. friend: friendObj._toPointer(),
  19479. friendship: attributes
  19480. },
  19481. authOptions: authOptions
  19482. });
  19483. });
  19484. },
  19485. /**
  19486. * Accept a friendship request.
  19487. * @since 4.8.0
  19488. * @param {AV.Object | string | Object} options if an AV.Object or string is given, it will be used as the request in _FriendshipRequest.
  19489. * @param {AV.Object} options.request The request (or it's objectId) to be accepted.
  19490. * @param {Object} [options.attributes] key-value attributes dictionary to be used as conditions of {@link AV#followeeQuery}.
  19491. * @param {AuthOptions} [authOptions]
  19492. * @return {Promise<void>}
  19493. */
  19494. acceptRequest: function acceptRequest(options) {
  19495. var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  19496. var request;
  19497. var attributes;
  19498. if (options.request) {
  19499. request = options.request;
  19500. attributes = options.attributes;
  19501. } else {
  19502. request = options;
  19503. }
  19504. var requestId = _.isString(request) ? request : request.id;
  19505. return getSessionTokenAsync(authOptions).then(function (sessionToken) {
  19506. if (!sessionToken) {
  19507. throw new Error('Please signin an user.');
  19508. }
  19509. return LCRequest({
  19510. method: 'PUT',
  19511. path: '/users/friendshipRequests/' + requestId + '/accept',
  19512. data: {
  19513. friendship: AV._encode(attributes)
  19514. },
  19515. authOptions: authOptions
  19516. });
  19517. });
  19518. },
  19519. /**
  19520. * Decline a friendship request.
  19521. * @param {AV.Object | string} request The request (or it's objectId) to be declined.
  19522. * @param {AuthOptions} [authOptions]
  19523. * @return {Promise<void>}
  19524. */
  19525. declineRequest: function declineRequest(request) {
  19526. var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  19527. var requestId = _.isString(request) ? request : request.id;
  19528. return getSessionTokenAsync(authOptions).then(function (sessionToken) {
  19529. if (!sessionToken) {
  19530. throw new Error('Please signin an user.');
  19531. }
  19532. return LCRequest({
  19533. method: 'PUT',
  19534. path: '/users/friendshipRequests/' + requestId + '/decline',
  19535. authOptions: authOptions
  19536. });
  19537. });
  19538. }
  19539. };
  19540. };
  19541. /***/ }),
  19542. /* 543 */
  19543. /***/ (function(module, exports, __webpack_require__) {
  19544. "use strict";
  19545. var _interopRequireDefault = __webpack_require__(1);
  19546. var _stringify = _interopRequireDefault(__webpack_require__(36));
  19547. var _ = __webpack_require__(2);
  19548. var _require = __webpack_require__(26),
  19549. _request = _require._request;
  19550. var AV = __webpack_require__(65);
  19551. var serializeMessage = function serializeMessage(message) {
  19552. if (typeof message === 'string') {
  19553. return message;
  19554. }
  19555. if (typeof message.getPayload === 'function') {
  19556. return (0, _stringify.default)(message.getPayload());
  19557. }
  19558. return (0, _stringify.default)(message);
  19559. };
  19560. /**
  19561. * <p>An AV.Conversation is a local representation of a LeanCloud realtime's
  19562. * conversation. This class is a subclass of AV.Object, and retains the
  19563. * same functionality of an AV.Object, but also extends it with various
  19564. * conversation specific methods, like get members, creators of this conversation.
  19565. * </p>
  19566. *
  19567. * @class AV.Conversation
  19568. * @param {String} name The name of the Role to create.
  19569. * @param {Object} [options]
  19570. * @param {Boolean} [options.isSystem] Set this conversation as system conversation.
  19571. * @param {Boolean} [options.isTransient] Set this conversation as transient conversation.
  19572. */
  19573. module.exports = AV.Object.extend('_Conversation',
  19574. /** @lends AV.Conversation.prototype */
  19575. {
  19576. constructor: function constructor(name) {
  19577. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  19578. AV.Object.prototype.constructor.call(this, null, null);
  19579. this.set('name', name);
  19580. if (options.isSystem !== undefined) {
  19581. this.set('sys', options.isSystem ? true : false);
  19582. }
  19583. if (options.isTransient !== undefined) {
  19584. this.set('tr', options.isTransient ? true : false);
  19585. }
  19586. },
  19587. /**
  19588. * Get current conversation's creator.
  19589. *
  19590. * @return {String}
  19591. */
  19592. getCreator: function getCreator() {
  19593. return this.get('c');
  19594. },
  19595. /**
  19596. * Get the last message's time.
  19597. *
  19598. * @return {Date}
  19599. */
  19600. getLastMessageAt: function getLastMessageAt() {
  19601. return this.get('lm');
  19602. },
  19603. /**
  19604. * Get this conversation's members
  19605. *
  19606. * @return {String[]}
  19607. */
  19608. getMembers: function getMembers() {
  19609. return this.get('m');
  19610. },
  19611. /**
  19612. * Add a member to this conversation
  19613. *
  19614. * @param {String} member
  19615. */
  19616. addMember: function addMember(member) {
  19617. return this.add('m', member);
  19618. },
  19619. /**
  19620. * Get this conversation's members who set this conversation as muted.
  19621. *
  19622. * @return {String[]}
  19623. */
  19624. getMutedMembers: function getMutedMembers() {
  19625. return this.get('mu');
  19626. },
  19627. /**
  19628. * Get this conversation's name field.
  19629. *
  19630. * @return String
  19631. */
  19632. getName: function getName() {
  19633. return this.get('name');
  19634. },
  19635. /**
  19636. * Returns true if this conversation is transient conversation.
  19637. *
  19638. * @return {Boolean}
  19639. */
  19640. isTransient: function isTransient() {
  19641. return this.get('tr');
  19642. },
  19643. /**
  19644. * Returns true if this conversation is system conversation.
  19645. *
  19646. * @return {Boolean}
  19647. */
  19648. isSystem: function isSystem() {
  19649. return this.get('sys');
  19650. },
  19651. /**
  19652. * Send realtime message to this conversation, using HTTP request.
  19653. *
  19654. * @param {String} fromClient Sender's client id.
  19655. * @param {String|Object} message The message which will send to conversation.
  19656. * It could be a raw string, or an object with a `toJSON` method, like a
  19657. * realtime SDK's Message object. See more: {@link https://leancloud.cn/docs/realtime_guide-js.html#消息}
  19658. * @param {Object} [options]
  19659. * @param {Boolean} [options.transient] Whether send this message as transient message or not.
  19660. * @param {String[]} [options.toClients] Ids of clients to send to. This option can be used only in system conversation.
  19661. * @param {Object} [options.pushData] Push data to this message. See more: {@link https://url.leanapp.cn/pushData 推送消息内容}
  19662. * @param {AuthOptions} [authOptions]
  19663. * @return {Promise}
  19664. */
  19665. send: function send(fromClient, message) {
  19666. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  19667. var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  19668. var data = {
  19669. from_peer: fromClient,
  19670. conv_id: this.id,
  19671. transient: false,
  19672. message: serializeMessage(message)
  19673. };
  19674. if (options.toClients !== undefined) {
  19675. data.to_peers = options.toClients;
  19676. }
  19677. if (options.transient !== undefined) {
  19678. data.transient = options.transient ? true : false;
  19679. }
  19680. if (options.pushData !== undefined) {
  19681. data.push_data = options.pushData;
  19682. }
  19683. return _request('rtm', 'messages', null, 'POST', data, authOptions);
  19684. },
  19685. /**
  19686. * Send realtime broadcast message to all clients, via this conversation, using HTTP request.
  19687. *
  19688. * @param {String} fromClient Sender's client id.
  19689. * @param {String|Object} message The message which will send to conversation.
  19690. * It could be a raw string, or an object with a `toJSON` method, like a
  19691. * realtime SDK's Message object. See more: {@link https://leancloud.cn/docs/realtime_guide-js.html#消息}.
  19692. * @param {Object} [options]
  19693. * @param {Object} [options.pushData] Push data to this message. See more: {@link https://url.leanapp.cn/pushData 推送消息内容}.
  19694. * @param {Object} [options.validTill] The message will valid till this time.
  19695. * @param {AuthOptions} [authOptions]
  19696. * @return {Promise}
  19697. */
  19698. broadcast: function broadcast(fromClient, message) {
  19699. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  19700. var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  19701. var data = {
  19702. from_peer: fromClient,
  19703. conv_id: this.id,
  19704. message: serializeMessage(message)
  19705. };
  19706. if (options.pushData !== undefined) {
  19707. data.push = options.pushData;
  19708. }
  19709. if (options.validTill !== undefined) {
  19710. var ts = options.validTill;
  19711. if (_.isDate(ts)) {
  19712. ts = ts.getTime();
  19713. }
  19714. options.valid_till = ts;
  19715. }
  19716. return _request('rtm', 'broadcast', null, 'POST', data, authOptions);
  19717. }
  19718. });
  19719. /***/ }),
  19720. /* 544 */
  19721. /***/ (function(module, exports, __webpack_require__) {
  19722. "use strict";
  19723. var _interopRequireDefault = __webpack_require__(1);
  19724. var _promise = _interopRequireDefault(__webpack_require__(12));
  19725. var _map = _interopRequireDefault(__webpack_require__(42));
  19726. var _concat = _interopRequireDefault(__webpack_require__(30));
  19727. var _ = __webpack_require__(2);
  19728. var _require = __webpack_require__(26),
  19729. request = _require.request;
  19730. var _require2 = __webpack_require__(29),
  19731. ensureArray = _require2.ensureArray,
  19732. parseDate = _require2.parseDate;
  19733. var AV = __webpack_require__(65);
  19734. /**
  19735. * The version change interval for Leaderboard
  19736. * @enum
  19737. */
  19738. AV.LeaderboardVersionChangeInterval = {
  19739. NEVER: 'never',
  19740. DAY: 'day',
  19741. WEEK: 'week',
  19742. MONTH: 'month'
  19743. };
  19744. /**
  19745. * The order of the leaderboard results
  19746. * @enum
  19747. */
  19748. AV.LeaderboardOrder = {
  19749. ASCENDING: 'ascending',
  19750. DESCENDING: 'descending'
  19751. };
  19752. /**
  19753. * The update strategy for Leaderboard
  19754. * @enum
  19755. */
  19756. AV.LeaderboardUpdateStrategy = {
  19757. /** Only keep the best statistic. If the leaderboard is in descending order, the best statistic is the highest one. */
  19758. BETTER: 'better',
  19759. /** Keep the last updated statistic */
  19760. LAST: 'last',
  19761. /** Keep the sum of all updated statistics */
  19762. SUM: 'sum'
  19763. };
  19764. /**
  19765. * @typedef {Object} Ranking
  19766. * @property {number} rank Starts at 0
  19767. * @property {number} value the statistic value of this ranking
  19768. * @property {AV.User} user The user of this ranking
  19769. * @property {Statistic[]} [includedStatistics] Other statistics of the user, specified by the `includeStatistic` option of `AV.Leaderboard.getResults()`
  19770. */
  19771. /**
  19772. * @typedef {Object} LeaderboardArchive
  19773. * @property {string} statisticName
  19774. * @property {number} version version of the leaderboard
  19775. * @property {string} status
  19776. * @property {string} url URL for the downloadable archive
  19777. * @property {Date} activatedAt time when this version became active
  19778. * @property {Date} deactivatedAt time when this version was deactivated by a version incrementing
  19779. */
  19780. /**
  19781. * @class
  19782. */
  19783. function Statistic(_ref) {
  19784. var name = _ref.name,
  19785. value = _ref.value,
  19786. version = _ref.version;
  19787. /**
  19788. * @type {string}
  19789. */
  19790. this.name = name;
  19791. /**
  19792. * @type {number}
  19793. */
  19794. this.value = value;
  19795. /**
  19796. * @type {number?}
  19797. */
  19798. this.version = version;
  19799. }
  19800. var parseStatisticData = function parseStatisticData(statisticData) {
  19801. var _AV$_decode = AV._decode(statisticData),
  19802. name = _AV$_decode.statisticName,
  19803. value = _AV$_decode.statisticValue,
  19804. version = _AV$_decode.version;
  19805. return new Statistic({
  19806. name: name,
  19807. value: value,
  19808. version: version
  19809. });
  19810. };
  19811. /**
  19812. * @class
  19813. */
  19814. AV.Leaderboard = function Leaderboard(statisticName) {
  19815. /**
  19816. * @type {string}
  19817. */
  19818. this.statisticName = statisticName;
  19819. /**
  19820. * @type {AV.LeaderboardOrder}
  19821. */
  19822. this.order = undefined;
  19823. /**
  19824. * @type {AV.LeaderboardUpdateStrategy}
  19825. */
  19826. this.updateStrategy = undefined;
  19827. /**
  19828. * @type {AV.LeaderboardVersionChangeInterval}
  19829. */
  19830. this.versionChangeInterval = undefined;
  19831. /**
  19832. * @type {number}
  19833. */
  19834. this.version = undefined;
  19835. /**
  19836. * @type {Date?}
  19837. */
  19838. this.nextResetAt = undefined;
  19839. /**
  19840. * @type {Date?}
  19841. */
  19842. this.createdAt = undefined;
  19843. };
  19844. var Leaderboard = AV.Leaderboard;
  19845. /**
  19846. * Create an instance of Leaderboard for the give statistic name.
  19847. * @param {string} statisticName
  19848. * @return {AV.Leaderboard}
  19849. */
  19850. AV.Leaderboard.createWithoutData = function (statisticName) {
  19851. return new Leaderboard(statisticName);
  19852. };
  19853. /**
  19854. * (masterKey required) Create a new Leaderboard.
  19855. * @param {Object} options
  19856. * @param {string} options.statisticName
  19857. * @param {AV.LeaderboardOrder} options.order
  19858. * @param {AV.LeaderboardVersionChangeInterval} [options.versionChangeInterval] default to WEEK
  19859. * @param {AV.LeaderboardUpdateStrategy} [options.updateStrategy] default to BETTER
  19860. * @param {AuthOptions} [authOptions]
  19861. * @return {Promise<AV.Leaderboard>}
  19862. */
  19863. AV.Leaderboard.createLeaderboard = function (_ref2, authOptions) {
  19864. var statisticName = _ref2.statisticName,
  19865. order = _ref2.order,
  19866. versionChangeInterval = _ref2.versionChangeInterval,
  19867. updateStrategy = _ref2.updateStrategy;
  19868. return request({
  19869. method: 'POST',
  19870. path: '/leaderboard/leaderboards',
  19871. data: {
  19872. statisticName: statisticName,
  19873. order: order,
  19874. versionChangeInterval: versionChangeInterval,
  19875. updateStrategy: updateStrategy
  19876. },
  19877. authOptions: authOptions
  19878. }).then(function (data) {
  19879. var leaderboard = new Leaderboard(statisticName);
  19880. return leaderboard._finishFetch(data);
  19881. });
  19882. };
  19883. /**
  19884. * Get the Leaderboard with the specified statistic name.
  19885. * @param {string} statisticName
  19886. * @param {AuthOptions} [authOptions]
  19887. * @return {Promise<AV.Leaderboard>}
  19888. */
  19889. AV.Leaderboard.getLeaderboard = function (statisticName, authOptions) {
  19890. return Leaderboard.createWithoutData(statisticName).fetch(authOptions);
  19891. };
  19892. /**
  19893. * Get Statistics for the specified user.
  19894. * @param {AV.User} user The specified AV.User pointer.
  19895. * @param {Object} [options]
  19896. * @param {string[]} [options.statisticNames] Specify the statisticNames. If not set, all statistics of the user will be fetched.
  19897. * @param {AuthOptions} [authOptions]
  19898. * @return {Promise<Statistic[]>}
  19899. */
  19900. AV.Leaderboard.getStatistics = function (user) {
  19901. var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  19902. statisticNames = _ref3.statisticNames;
  19903. var authOptions = arguments.length > 2 ? arguments[2] : undefined;
  19904. return _promise.default.resolve().then(function () {
  19905. if (!(user && user.id)) throw new Error('user must be an AV.User');
  19906. return request({
  19907. method: 'GET',
  19908. path: "/leaderboard/users/".concat(user.id, "/statistics"),
  19909. query: {
  19910. statistics: statisticNames ? ensureArray(statisticNames).join(',') : undefined
  19911. },
  19912. authOptions: authOptions
  19913. }).then(function (_ref4) {
  19914. var results = _ref4.results;
  19915. return (0, _map.default)(results).call(results, parseStatisticData);
  19916. });
  19917. });
  19918. };
  19919. /**
  19920. * Update Statistics for the specified user.
  19921. * @param {AV.User} user The specified AV.User pointer.
  19922. * @param {Object} statistics A name-value pair representing the statistics to update.
  19923. * @param {AuthOptions} [options] AuthOptions plus:
  19924. * @param {boolean} [options.overwrite] Wethere to overwrite these statistics disregarding the updateStrategy of there leaderboards
  19925. * @return {Promise<Statistic[]>}
  19926. */
  19927. AV.Leaderboard.updateStatistics = function (user, statistics) {
  19928. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  19929. return _promise.default.resolve().then(function () {
  19930. if (!(user && user.id)) throw new Error('user must be an AV.User');
  19931. var data = (0, _map.default)(_).call(_, statistics, function (value, key) {
  19932. return {
  19933. statisticName: key,
  19934. statisticValue: value
  19935. };
  19936. });
  19937. var overwrite = options.overwrite;
  19938. return request({
  19939. method: 'POST',
  19940. path: "/leaderboard/users/".concat(user.id, "/statistics"),
  19941. query: {
  19942. overwrite: overwrite ? 1 : undefined
  19943. },
  19944. data: data,
  19945. authOptions: options
  19946. }).then(function (_ref5) {
  19947. var results = _ref5.results;
  19948. return (0, _map.default)(results).call(results, parseStatisticData);
  19949. });
  19950. });
  19951. };
  19952. /**
  19953. * Delete Statistics for the specified user.
  19954. * @param {AV.User} user The specified AV.User pointer.
  19955. * @param {Object} statistics A name-value pair representing the statistics to delete.
  19956. * @param {AuthOptions} [options]
  19957. * @return {Promise<void>}
  19958. */
  19959. AV.Leaderboard.deleteStatistics = function (user, statisticNames, authOptions) {
  19960. return _promise.default.resolve().then(function () {
  19961. if (!(user && user.id)) throw new Error('user must be an AV.User');
  19962. return request({
  19963. method: 'DELETE',
  19964. path: "/leaderboard/users/".concat(user.id, "/statistics"),
  19965. query: {
  19966. statistics: ensureArray(statisticNames).join(',')
  19967. },
  19968. authOptions: authOptions
  19969. }).then(function () {
  19970. return undefined;
  19971. });
  19972. });
  19973. };
  19974. _.extend(Leaderboard.prototype,
  19975. /** @lends AV.Leaderboard.prototype */
  19976. {
  19977. _finishFetch: function _finishFetch(data) {
  19978. var _this = this;
  19979. _.forEach(data, function (value, key) {
  19980. if (key === 'updatedAt' || key === 'objectId') return;
  19981. if (key === 'expiredAt') {
  19982. key = 'nextResetAt';
  19983. }
  19984. if (key === 'createdAt') {
  19985. value = parseDate(value);
  19986. }
  19987. if (value && value.__type === 'Date') {
  19988. value = parseDate(value.iso);
  19989. }
  19990. _this[key] = value;
  19991. });
  19992. return this;
  19993. },
  19994. /**
  19995. * Fetch data from the srever.
  19996. * @param {AuthOptions} [authOptions]
  19997. * @return {Promise<AV.Leaderboard>}
  19998. */
  19999. fetch: function fetch(authOptions) {
  20000. var _this2 = this;
  20001. return request({
  20002. method: 'GET',
  20003. path: "/leaderboard/leaderboards/".concat(this.statisticName),
  20004. authOptions: authOptions
  20005. }).then(function (data) {
  20006. return _this2._finishFetch(data);
  20007. });
  20008. },
  20009. /**
  20010. * Counts the number of users participated in this leaderboard
  20011. * @param {Object} [options]
  20012. * @param {number} [options.version] Specify the version of the leaderboard
  20013. * @param {AuthOptions} [authOptions]
  20014. * @return {Promise<number>}
  20015. */
  20016. count: function count() {
  20017. var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  20018. version = _ref6.version;
  20019. var authOptions = arguments.length > 1 ? arguments[1] : undefined;
  20020. return request({
  20021. method: 'GET',
  20022. path: "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks"),
  20023. query: {
  20024. count: 1,
  20025. limit: 0,
  20026. version: version
  20027. },
  20028. authOptions: authOptions
  20029. }).then(function (_ref7) {
  20030. var count = _ref7.count;
  20031. return count;
  20032. });
  20033. },
  20034. _getResults: function _getResults(_ref8, authOptions, userId) {
  20035. var _context;
  20036. var skip = _ref8.skip,
  20037. limit = _ref8.limit,
  20038. selectUserKeys = _ref8.selectUserKeys,
  20039. includeUserKeys = _ref8.includeUserKeys,
  20040. includeStatistics = _ref8.includeStatistics,
  20041. version = _ref8.version;
  20042. return request({
  20043. method: 'GET',
  20044. path: (0, _concat.default)(_context = "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks")).call(_context, userId ? "/".concat(userId) : ''),
  20045. query: {
  20046. skip: skip,
  20047. limit: limit,
  20048. selectUserKeys: _.union(ensureArray(selectUserKeys), ensureArray(includeUserKeys)).join(',') || undefined,
  20049. includeUser: includeUserKeys ? ensureArray(includeUserKeys).join(',') : undefined,
  20050. includeStatistics: includeStatistics ? ensureArray(includeStatistics).join(',') : undefined,
  20051. version: version
  20052. },
  20053. authOptions: authOptions
  20054. }).then(function (_ref9) {
  20055. var rankings = _ref9.results;
  20056. return (0, _map.default)(rankings).call(rankings, function (rankingData) {
  20057. var _AV$_decode2 = AV._decode(rankingData),
  20058. user = _AV$_decode2.user,
  20059. value = _AV$_decode2.statisticValue,
  20060. rank = _AV$_decode2.rank,
  20061. _AV$_decode2$statisti = _AV$_decode2.statistics,
  20062. statistics = _AV$_decode2$statisti === void 0 ? [] : _AV$_decode2$statisti;
  20063. return {
  20064. user: user,
  20065. value: value,
  20066. rank: rank,
  20067. includedStatistics: (0, _map.default)(statistics).call(statistics, parseStatisticData)
  20068. };
  20069. });
  20070. });
  20071. },
  20072. /**
  20073. * Retrieve a list of ranked users for this Leaderboard.
  20074. * @param {Object} [options]
  20075. * @param {number} [options.skip] The number of results to skip. This is useful for pagination.
  20076. * @param {number} [options.limit] The limit of the number of results.
  20077. * @param {string[]} [options.selectUserKeys] Specify keys of the users to include in the Rankings
  20078. * @param {string[]} [options.includeUserKeys] If the value of a selected user keys is a Pointer, use this options to include its value.
  20079. * @param {string[]} [options.includeStatistics] Specify other statistics to include in the Rankings
  20080. * @param {number} [options.version] Specify the version of the leaderboard
  20081. * @param {AuthOptions} [authOptions]
  20082. * @return {Promise<Ranking[]>}
  20083. */
  20084. getResults: function getResults() {
  20085. var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  20086. skip = _ref10.skip,
  20087. limit = _ref10.limit,
  20088. selectUserKeys = _ref10.selectUserKeys,
  20089. includeUserKeys = _ref10.includeUserKeys,
  20090. includeStatistics = _ref10.includeStatistics,
  20091. version = _ref10.version;
  20092. var authOptions = arguments.length > 1 ? arguments[1] : undefined;
  20093. return this._getResults({
  20094. skip: skip,
  20095. limit: limit,
  20096. selectUserKeys: selectUserKeys,
  20097. includeUserKeys: includeUserKeys,
  20098. includeStatistics: includeStatistics,
  20099. version: version
  20100. }, authOptions);
  20101. },
  20102. /**
  20103. * Retrieve a list of ranked users for this Leaderboard, centered on the specified user.
  20104. * @param {AV.User} user The specified AV.User pointer.
  20105. * @param {Object} [options]
  20106. * @param {number} [options.limit] The limit of the number of results.
  20107. * @param {string[]} [options.selectUserKeys] Specify keys of the users to include in the Rankings
  20108. * @param {string[]} [options.includeUserKeys] If the value of a selected user keys is a Pointer, use this options to include its value.
  20109. * @param {string[]} [options.includeStatistics] Specify other statistics to include in the Rankings
  20110. * @param {number} [options.version] Specify the version of the leaderboard
  20111. * @param {AuthOptions} [authOptions]
  20112. * @return {Promise<Ranking[]>}
  20113. */
  20114. getResultsAroundUser: function getResultsAroundUser(user) {
  20115. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  20116. var authOptions = arguments.length > 2 ? arguments[2] : undefined;
  20117. // getResultsAroundUser(options, authOptions)
  20118. if (user && typeof user.id !== 'string') {
  20119. return this.getResultsAroundUser(undefined, user, options);
  20120. }
  20121. var limit = options.limit,
  20122. selectUserKeys = options.selectUserKeys,
  20123. includeUserKeys = options.includeUserKeys,
  20124. includeStatistics = options.includeStatistics,
  20125. version = options.version;
  20126. return this._getResults({
  20127. limit: limit,
  20128. selectUserKeys: selectUserKeys,
  20129. includeUserKeys: includeUserKeys,
  20130. includeStatistics: includeStatistics,
  20131. version: version
  20132. }, authOptions, user ? user.id : 'self');
  20133. },
  20134. _update: function _update(data, authOptions) {
  20135. var _this3 = this;
  20136. return request({
  20137. method: 'PUT',
  20138. path: "/leaderboard/leaderboards/".concat(this.statisticName),
  20139. data: data,
  20140. authOptions: authOptions
  20141. }).then(function (result) {
  20142. return _this3._finishFetch(result);
  20143. });
  20144. },
  20145. /**
  20146. * (masterKey required) Update the version change interval of the Leaderboard.
  20147. * @param {AV.LeaderboardVersionChangeInterval} versionChangeInterval
  20148. * @param {AuthOptions} [authOptions]
  20149. * @return {Promise<AV.Leaderboard>}
  20150. */
  20151. updateVersionChangeInterval: function updateVersionChangeInterval(versionChangeInterval, authOptions) {
  20152. return this._update({
  20153. versionChangeInterval: versionChangeInterval
  20154. }, authOptions);
  20155. },
  20156. /**
  20157. * (masterKey required) Update the version change interval of the Leaderboard.
  20158. * @param {AV.LeaderboardUpdateStrategy} updateStrategy
  20159. * @param {AuthOptions} [authOptions]
  20160. * @return {Promise<AV.Leaderboard>}
  20161. */
  20162. updateUpdateStrategy: function updateUpdateStrategy(updateStrategy, authOptions) {
  20163. return this._update({
  20164. updateStrategy: updateStrategy
  20165. }, authOptions);
  20166. },
  20167. /**
  20168. * (masterKey required) Reset the Leaderboard. The version of the Leaderboard will be incremented by 1.
  20169. * @param {AuthOptions} [authOptions]
  20170. * @return {Promise<AV.Leaderboard>}
  20171. */
  20172. reset: function reset(authOptions) {
  20173. var _this4 = this;
  20174. return request({
  20175. method: 'PUT',
  20176. path: "/leaderboard/leaderboards/".concat(this.statisticName, "/incrementVersion"),
  20177. authOptions: authOptions
  20178. }).then(function (data) {
  20179. return _this4._finishFetch(data);
  20180. });
  20181. },
  20182. /**
  20183. * (masterKey required) Delete the Leaderboard and its all archived versions.
  20184. * @param {AuthOptions} [authOptions]
  20185. * @return {void}
  20186. */
  20187. destroy: function destroy(authOptions) {
  20188. return AV.request({
  20189. method: 'DELETE',
  20190. path: "/leaderboard/leaderboards/".concat(this.statisticName),
  20191. authOptions: authOptions
  20192. }).then(function () {
  20193. return undefined;
  20194. });
  20195. },
  20196. /**
  20197. * (masterKey required) Get archived versions.
  20198. * @param {Object} [options]
  20199. * @param {number} [options.skip] The number of results to skip. This is useful for pagination.
  20200. * @param {number} [options.limit] The limit of the number of results.
  20201. * @param {AuthOptions} [authOptions]
  20202. * @return {Promise<LeaderboardArchive[]>}
  20203. */
  20204. getArchives: function getArchives() {
  20205. var _this5 = this;
  20206. var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  20207. skip = _ref11.skip,
  20208. limit = _ref11.limit;
  20209. var authOptions = arguments.length > 1 ? arguments[1] : undefined;
  20210. return request({
  20211. method: 'GET',
  20212. path: "/leaderboard/leaderboards/".concat(this.statisticName, "/archives"),
  20213. query: {
  20214. skip: skip,
  20215. limit: limit
  20216. },
  20217. authOptions: authOptions
  20218. }).then(function (_ref12) {
  20219. var results = _ref12.results;
  20220. return (0, _map.default)(results).call(results, function (_ref13) {
  20221. var version = _ref13.version,
  20222. status = _ref13.status,
  20223. url = _ref13.url,
  20224. activatedAt = _ref13.activatedAt,
  20225. deactivatedAt = _ref13.deactivatedAt;
  20226. return {
  20227. statisticName: _this5.statisticName,
  20228. version: version,
  20229. status: status,
  20230. url: url,
  20231. activatedAt: parseDate(activatedAt.iso),
  20232. deactivatedAt: parseDate(deactivatedAt.iso)
  20233. };
  20234. });
  20235. });
  20236. }
  20237. });
  20238. /***/ }),
  20239. /* 545 */
  20240. /***/ (function(module, exports, __webpack_require__) {
  20241. "use strict";
  20242. var adapters = __webpack_require__(546);
  20243. module.exports = function (AV) {
  20244. AV.setAdapters(adapters);
  20245. return AV;
  20246. };
  20247. /***/ }),
  20248. /* 546 */
  20249. /***/ (function(module, exports, __webpack_require__) {
  20250. "use strict";
  20251. var _interopRequireDefault = __webpack_require__(1);
  20252. var _typeof2 = _interopRequireDefault(__webpack_require__(109));
  20253. var _defineProperty = _interopRequireDefault(__webpack_require__(143));
  20254. var _setPrototypeOf = _interopRequireDefault(__webpack_require__(227));
  20255. var _assign2 = _interopRequireDefault(__webpack_require__(547));
  20256. var _indexOf = _interopRequireDefault(__webpack_require__(86));
  20257. var _getOwnPropertySymbols = _interopRequireDefault(__webpack_require__(552));
  20258. var _promise = _interopRequireDefault(__webpack_require__(12));
  20259. var _symbol = _interopRequireDefault(__webpack_require__(240));
  20260. var _iterator = _interopRequireDefault(__webpack_require__(555));
  20261. var _weakMap = _interopRequireDefault(__webpack_require__(556));
  20262. var _keys = _interopRequireDefault(__webpack_require__(141));
  20263. var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(246));
  20264. var _getPrototypeOf = _interopRequireDefault(__webpack_require__(142));
  20265. var _map = _interopRequireDefault(__webpack_require__(564));
  20266. (0, _defineProperty.default)(exports, '__esModule', {
  20267. value: true
  20268. });
  20269. /******************************************************************************
  20270. Copyright (c) Microsoft Corporation.
  20271. Permission to use, copy, modify, and/or distribute this software for any
  20272. purpose with or without fee is hereby granted.
  20273. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  20274. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  20275. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  20276. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  20277. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  20278. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20279. PERFORMANCE OF THIS SOFTWARE.
  20280. ***************************************************************************** */
  20281. /* global Reflect, Promise */
  20282. var _extendStatics$ = function extendStatics$1(d, b) {
  20283. _extendStatics$ = _setPrototypeOf.default || {
  20284. __proto__: []
  20285. } instanceof Array && function (d, b) {
  20286. d.__proto__ = b;
  20287. } || function (d, b) {
  20288. for (var p in b) {
  20289. if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
  20290. }
  20291. };
  20292. return _extendStatics$(d, b);
  20293. };
  20294. function __extends$1(d, b) {
  20295. if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  20296. _extendStatics$(d, b);
  20297. function __() {
  20298. this.constructor = d;
  20299. }
  20300. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  20301. }
  20302. var _assign = function __assign() {
  20303. _assign = _assign2.default || function __assign(t) {
  20304. for (var s, i = 1, n = arguments.length; i < n; i++) {
  20305. s = arguments[i];
  20306. for (var p in s) {
  20307. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  20308. }
  20309. }
  20310. return t;
  20311. };
  20312. return _assign.apply(this, arguments);
  20313. };
  20314. function __rest(s, e) {
  20315. var t = {};
  20316. for (var p in s) {
  20317. if (Object.prototype.hasOwnProperty.call(s, p) && (0, _indexOf.default)(e).call(e, p) < 0) t[p] = s[p];
  20318. }
  20319. if (s != null && typeof _getOwnPropertySymbols.default === "function") for (var i = 0, p = (0, _getOwnPropertySymbols.default)(s); i < p.length; i++) {
  20320. if ((0, _indexOf.default)(e).call(e, p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  20321. }
  20322. return t;
  20323. }
  20324. function __awaiter(thisArg, _arguments, P, generator) {
  20325. function adopt(value) {
  20326. return value instanceof P ? value : new P(function (resolve) {
  20327. resolve(value);
  20328. });
  20329. }
  20330. return new (P || (P = _promise.default))(function (resolve, reject) {
  20331. function fulfilled(value) {
  20332. try {
  20333. step(generator.next(value));
  20334. } catch (e) {
  20335. reject(e);
  20336. }
  20337. }
  20338. function rejected(value) {
  20339. try {
  20340. step(generator["throw"](value));
  20341. } catch (e) {
  20342. reject(e);
  20343. }
  20344. }
  20345. function step(result) {
  20346. result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
  20347. }
  20348. step((generator = generator.apply(thisArg, _arguments || [])).next());
  20349. });
  20350. }
  20351. function __generator(thisArg, body) {
  20352. var _ = {
  20353. label: 0,
  20354. sent: function sent() {
  20355. if (t[0] & 1) throw t[1];
  20356. return t[1];
  20357. },
  20358. trys: [],
  20359. ops: []
  20360. },
  20361. f,
  20362. y,
  20363. t,
  20364. g;
  20365. return g = {
  20366. next: verb(0),
  20367. "throw": verb(1),
  20368. "return": verb(2)
  20369. }, typeof _symbol.default === "function" && (g[_iterator.default] = function () {
  20370. return this;
  20371. }), g;
  20372. function verb(n) {
  20373. return function (v) {
  20374. return step([n, v]);
  20375. };
  20376. }
  20377. function step(op) {
  20378. if (f) throw new TypeError("Generator is already executing.");
  20379. while (_) {
  20380. try {
  20381. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  20382. if (y = 0, t) op = [op[0] & 2, t.value];
  20383. switch (op[0]) {
  20384. case 0:
  20385. case 1:
  20386. t = op;
  20387. break;
  20388. case 4:
  20389. _.label++;
  20390. return {
  20391. value: op[1],
  20392. done: false
  20393. };
  20394. case 5:
  20395. _.label++;
  20396. y = op[1];
  20397. op = [0];
  20398. continue;
  20399. case 7:
  20400. op = _.ops.pop();
  20401. _.trys.pop();
  20402. continue;
  20403. default:
  20404. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
  20405. _ = 0;
  20406. continue;
  20407. }
  20408. if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
  20409. _.label = op[1];
  20410. break;
  20411. }
  20412. if (op[0] === 6 && _.label < t[1]) {
  20413. _.label = t[1];
  20414. t = op;
  20415. break;
  20416. }
  20417. if (t && _.label < t[2]) {
  20418. _.label = t[2];
  20419. _.ops.push(op);
  20420. break;
  20421. }
  20422. if (t[2]) _.ops.pop();
  20423. _.trys.pop();
  20424. continue;
  20425. }
  20426. op = body.call(thisArg, _);
  20427. } catch (e) {
  20428. op = [6, e];
  20429. y = 0;
  20430. } finally {
  20431. f = t = 0;
  20432. }
  20433. }
  20434. if (op[0] & 5) throw op[1];
  20435. return {
  20436. value: op[0] ? op[1] : void 0,
  20437. done: true
  20438. };
  20439. }
  20440. }
  20441. var PROVIDER = "lc_weapp";
  20442. var PLATFORM = "weixin";
  20443. function getLoginCode() {
  20444. return new _promise.default(function (resolve, reject) {
  20445. wx.login({
  20446. success: function success(res) {
  20447. return res.code ? resolve(res.code) : reject(new Error(res.errMsg));
  20448. },
  20449. fail: function fail(_a) {
  20450. var errMsg = _a.errMsg;
  20451. return reject(new Error(errMsg));
  20452. }
  20453. });
  20454. });
  20455. }
  20456. var getAuthInfo = function getAuthInfo(_a) {
  20457. var _b = _a === void 0 ? {} : _a,
  20458. _c = _b.platform,
  20459. platform = _c === void 0 ? PLATFORM : _c,
  20460. _d = _b.preferUnionId,
  20461. preferUnionId = _d === void 0 ? false : _d,
  20462. _e = _b.asMainAccount,
  20463. asMainAccount = _e === void 0 ? false : _e;
  20464. return __awaiter(this, void 0, void 0, function () {
  20465. var code, authData;
  20466. return __generator(this, function (_f) {
  20467. switch (_f.label) {
  20468. case 0:
  20469. return [4
  20470. /*yield*/
  20471. , getLoginCode()];
  20472. case 1:
  20473. code = _f.sent();
  20474. authData = {
  20475. code: code
  20476. };
  20477. if (preferUnionId) {
  20478. authData.platform = platform;
  20479. authData.main_account = asMainAccount;
  20480. }
  20481. return [2
  20482. /*return*/
  20483. , {
  20484. authData: authData,
  20485. platform: platform,
  20486. provider: PROVIDER
  20487. }];
  20488. }
  20489. });
  20490. });
  20491. };
  20492. var storage = {
  20493. getItem: function getItem(key) {
  20494. return wx.getStorageSync(key);
  20495. },
  20496. setItem: function setItem(key, value) {
  20497. return wx.setStorageSync(key, value);
  20498. },
  20499. removeItem: function removeItem(key) {
  20500. return wx.removeStorageSync(key);
  20501. },
  20502. clear: function clear() {
  20503. return wx.clearStorageSync();
  20504. }
  20505. };
  20506. /******************************************************************************
  20507. Copyright (c) Microsoft Corporation.
  20508. Permission to use, copy, modify, and/or distribute this software for any
  20509. purpose with or without fee is hereby granted.
  20510. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  20511. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  20512. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  20513. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  20514. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  20515. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20516. PERFORMANCE OF THIS SOFTWARE.
  20517. ***************************************************************************** */
  20518. /* global Reflect, Promise */
  20519. var _extendStatics = function extendStatics(d, b) {
  20520. _extendStatics = _setPrototypeOf.default || {
  20521. __proto__: []
  20522. } instanceof Array && function (d, b) {
  20523. d.__proto__ = b;
  20524. } || function (d, b) {
  20525. for (var p in b) {
  20526. if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
  20527. }
  20528. };
  20529. return _extendStatics(d, b);
  20530. };
  20531. function __extends(d, b) {
  20532. if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  20533. _extendStatics(d, b);
  20534. function __() {
  20535. this.constructor = d;
  20536. }
  20537. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  20538. }
  20539. var AbortError =
  20540. /** @class */
  20541. function (_super) {
  20542. __extends(AbortError, _super);
  20543. function AbortError() {
  20544. var _this = _super !== null && _super.apply(this, arguments) || this;
  20545. _this.name = "AbortError";
  20546. return _this;
  20547. }
  20548. return AbortError;
  20549. }(Error);
  20550. var request = function request(url, options) {
  20551. if (options === void 0) {
  20552. options = {};
  20553. }
  20554. var method = options.method,
  20555. data = options.data,
  20556. headers = options.headers,
  20557. signal = options.signal;
  20558. if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
  20559. return _promise.default.reject(new AbortError("Request aborted"));
  20560. }
  20561. return new _promise.default(function (resolve, reject) {
  20562. var task = wx.request({
  20563. url: url,
  20564. method: method,
  20565. data: data,
  20566. header: headers,
  20567. complete: function complete(res) {
  20568. signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", abortListener);
  20569. if (!res.statusCode) {
  20570. reject(new Error(res.errMsg));
  20571. return;
  20572. }
  20573. resolve({
  20574. ok: !(res.statusCode >= 400),
  20575. status: res.statusCode,
  20576. headers: res.header,
  20577. data: res.data
  20578. });
  20579. }
  20580. });
  20581. var abortListener = function abortListener() {
  20582. reject(new AbortError("Request aborted"));
  20583. task.abort();
  20584. };
  20585. signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", abortListener);
  20586. });
  20587. };
  20588. var upload = function upload(url, file, options) {
  20589. if (options === void 0) {
  20590. options = {};
  20591. }
  20592. var headers = options.headers,
  20593. data = options.data,
  20594. onprogress = options.onprogress,
  20595. signal = options.signal;
  20596. if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
  20597. return _promise.default.reject(new AbortError("Request aborted"));
  20598. }
  20599. if (!(file && file.data && file.data.uri)) {
  20600. return _promise.default.reject(new TypeError("File data must be an object like { uri: localPath }."));
  20601. }
  20602. return new _promise.default(function (resolve, reject) {
  20603. var task = wx.uploadFile({
  20604. url: url,
  20605. header: headers,
  20606. filePath: file.data.uri,
  20607. name: file.field,
  20608. formData: data,
  20609. success: function success(response) {
  20610. var status = response.statusCode,
  20611. data = response.data,
  20612. rest = __rest(response, ["statusCode", "data"]);
  20613. resolve(_assign(_assign({}, rest), {
  20614. data: typeof data === "string" ? JSON.parse(data) : data,
  20615. status: status,
  20616. ok: !(status >= 400)
  20617. }));
  20618. },
  20619. fail: function fail(response) {
  20620. reject(new Error(response.errMsg));
  20621. },
  20622. complete: function complete() {
  20623. signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", abortListener);
  20624. }
  20625. });
  20626. var abortListener = function abortListener() {
  20627. reject(new AbortError("Request aborted"));
  20628. task.abort();
  20629. };
  20630. signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", abortListener);
  20631. if (onprogress) {
  20632. task.onProgressUpdate(function (event) {
  20633. return onprogress({
  20634. loaded: event.totalBytesSent,
  20635. total: event.totalBytesExpectedToSend,
  20636. percent: event.progress
  20637. });
  20638. });
  20639. }
  20640. });
  20641. };
  20642. /**
  20643. * @author Toru Nagashima <https://github.com/mysticatea>
  20644. * @copyright 2015 Toru Nagashima. All rights reserved.
  20645. * See LICENSE file in root directory for full license.
  20646. */
  20647. /**
  20648. * @typedef {object} PrivateData
  20649. * @property {EventTarget} eventTarget The event target.
  20650. * @property {{type:string}} event The original event object.
  20651. * @property {number} eventPhase The current event phase.
  20652. * @property {EventTarget|null} currentTarget The current event target.
  20653. * @property {boolean} canceled The flag to prevent default.
  20654. * @property {boolean} stopped The flag to stop propagation.
  20655. * @property {boolean} immediateStopped The flag to stop propagation immediately.
  20656. * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.
  20657. * @property {number} timeStamp The unix time.
  20658. * @private
  20659. */
  20660. /**
  20661. * Private data for event wrappers.
  20662. * @type {WeakMap<Event, PrivateData>}
  20663. * @private
  20664. */
  20665. var privateData = new _weakMap.default();
  20666. /**
  20667. * Cache for wrapper classes.
  20668. * @type {WeakMap<Object, Function>}
  20669. * @private
  20670. */
  20671. var wrappers = new _weakMap.default();
  20672. /**
  20673. * Get private data.
  20674. * @param {Event} event The event object to get private data.
  20675. * @returns {PrivateData} The private data of the event.
  20676. * @private
  20677. */
  20678. function pd(event) {
  20679. var retv = privateData.get(event);
  20680. console.assert(retv != null, "'this' is expected an Event object, but got", event);
  20681. return retv;
  20682. }
  20683. /**
  20684. * https://dom.spec.whatwg.org/#set-the-canceled-flag
  20685. * @param data {PrivateData} private data.
  20686. */
  20687. function setCancelFlag(data) {
  20688. if (data.passiveListener != null) {
  20689. if (typeof console !== "undefined" && typeof console.error === "function") {
  20690. console.error("Unable to preventDefault inside passive event listener invocation.", data.passiveListener);
  20691. }
  20692. return;
  20693. }
  20694. if (!data.event.cancelable) {
  20695. return;
  20696. }
  20697. data.canceled = true;
  20698. if (typeof data.event.preventDefault === "function") {
  20699. data.event.preventDefault();
  20700. }
  20701. }
  20702. /**
  20703. * @see https://dom.spec.whatwg.org/#interface-event
  20704. * @private
  20705. */
  20706. /**
  20707. * The event wrapper.
  20708. * @constructor
  20709. * @param {EventTarget} eventTarget The event target of this dispatching.
  20710. * @param {Event|{type:string}} event The original event to wrap.
  20711. */
  20712. function Event(eventTarget, event) {
  20713. privateData.set(this, {
  20714. eventTarget: eventTarget,
  20715. event: event,
  20716. eventPhase: 2,
  20717. currentTarget: eventTarget,
  20718. canceled: false,
  20719. stopped: false,
  20720. immediateStopped: false,
  20721. passiveListener: null,
  20722. timeStamp: event.timeStamp || Date.now()
  20723. }); // https://heycam.github.io/webidl/#Unforgeable
  20724. (0, _defineProperty.default)(this, "isTrusted", {
  20725. value: false,
  20726. enumerable: true
  20727. }); // Define accessors
  20728. var keys = (0, _keys.default)(event);
  20729. for (var i = 0; i < keys.length; ++i) {
  20730. var key = keys[i];
  20731. if (!(key in this)) {
  20732. (0, _defineProperty.default)(this, key, defineRedirectDescriptor(key));
  20733. }
  20734. }
  20735. } // Should be enumerable, but class methods are not enumerable.
  20736. Event.prototype = {
  20737. /**
  20738. * The type of this event.
  20739. * @type {string}
  20740. */
  20741. get type() {
  20742. return pd(this).event.type;
  20743. },
  20744. /**
  20745. * The target of this event.
  20746. * @type {EventTarget}
  20747. */
  20748. get target() {
  20749. return pd(this).eventTarget;
  20750. },
  20751. /**
  20752. * The target of this event.
  20753. * @type {EventTarget}
  20754. */
  20755. get currentTarget() {
  20756. return pd(this).currentTarget;
  20757. },
  20758. /**
  20759. * @returns {EventTarget[]} The composed path of this event.
  20760. */
  20761. composedPath: function composedPath() {
  20762. var currentTarget = pd(this).currentTarget;
  20763. if (currentTarget == null) {
  20764. return [];
  20765. }
  20766. return [currentTarget];
  20767. },
  20768. /**
  20769. * Constant of NONE.
  20770. * @type {number}
  20771. */
  20772. get NONE() {
  20773. return 0;
  20774. },
  20775. /**
  20776. * Constant of CAPTURING_PHASE.
  20777. * @type {number}
  20778. */
  20779. get CAPTURING_PHASE() {
  20780. return 1;
  20781. },
  20782. /**
  20783. * Constant of AT_TARGET.
  20784. * @type {number}
  20785. */
  20786. get AT_TARGET() {
  20787. return 2;
  20788. },
  20789. /**
  20790. * Constant of BUBBLING_PHASE.
  20791. * @type {number}
  20792. */
  20793. get BUBBLING_PHASE() {
  20794. return 3;
  20795. },
  20796. /**
  20797. * The target of this event.
  20798. * @type {number}
  20799. */
  20800. get eventPhase() {
  20801. return pd(this).eventPhase;
  20802. },
  20803. /**
  20804. * Stop event bubbling.
  20805. * @returns {void}
  20806. */
  20807. stopPropagation: function stopPropagation() {
  20808. var data = pd(this);
  20809. data.stopped = true;
  20810. if (typeof data.event.stopPropagation === "function") {
  20811. data.event.stopPropagation();
  20812. }
  20813. },
  20814. /**
  20815. * Stop event bubbling.
  20816. * @returns {void}
  20817. */
  20818. stopImmediatePropagation: function stopImmediatePropagation() {
  20819. var data = pd(this);
  20820. data.stopped = true;
  20821. data.immediateStopped = true;
  20822. if (typeof data.event.stopImmediatePropagation === "function") {
  20823. data.event.stopImmediatePropagation();
  20824. }
  20825. },
  20826. /**
  20827. * The flag to be bubbling.
  20828. * @type {boolean}
  20829. */
  20830. get bubbles() {
  20831. return Boolean(pd(this).event.bubbles);
  20832. },
  20833. /**
  20834. * The flag to be cancelable.
  20835. * @type {boolean}
  20836. */
  20837. get cancelable() {
  20838. return Boolean(pd(this).event.cancelable);
  20839. },
  20840. /**
  20841. * Cancel this event.
  20842. * @returns {void}
  20843. */
  20844. preventDefault: function preventDefault() {
  20845. setCancelFlag(pd(this));
  20846. },
  20847. /**
  20848. * The flag to indicate cancellation state.
  20849. * @type {boolean}
  20850. */
  20851. get defaultPrevented() {
  20852. return pd(this).canceled;
  20853. },
  20854. /**
  20855. * The flag to be composed.
  20856. * @type {boolean}
  20857. */
  20858. get composed() {
  20859. return Boolean(pd(this).event.composed);
  20860. },
  20861. /**
  20862. * The unix time of this event.
  20863. * @type {number}
  20864. */
  20865. get timeStamp() {
  20866. return pd(this).timeStamp;
  20867. },
  20868. /**
  20869. * The target of this event.
  20870. * @type {EventTarget}
  20871. * @deprecated
  20872. */
  20873. get srcElement() {
  20874. return pd(this).eventTarget;
  20875. },
  20876. /**
  20877. * The flag to stop event bubbling.
  20878. * @type {boolean}
  20879. * @deprecated
  20880. */
  20881. get cancelBubble() {
  20882. return pd(this).stopped;
  20883. },
  20884. set cancelBubble(value) {
  20885. if (!value) {
  20886. return;
  20887. }
  20888. var data = pd(this);
  20889. data.stopped = true;
  20890. if (typeof data.event.cancelBubble === "boolean") {
  20891. data.event.cancelBubble = true;
  20892. }
  20893. },
  20894. /**
  20895. * The flag to indicate cancellation state.
  20896. * @type {boolean}
  20897. * @deprecated
  20898. */
  20899. get returnValue() {
  20900. return !pd(this).canceled;
  20901. },
  20902. set returnValue(value) {
  20903. if (!value) {
  20904. setCancelFlag(pd(this));
  20905. }
  20906. },
  20907. /**
  20908. * Initialize this event object. But do nothing under event dispatching.
  20909. * @param {string} type The event type.
  20910. * @param {boolean} [bubbles=false] The flag to be possible to bubble up.
  20911. * @param {boolean} [cancelable=false] The flag to be possible to cancel.
  20912. * @deprecated
  20913. */
  20914. initEvent: function initEvent() {// Do nothing.
  20915. }
  20916. }; // `constructor` is not enumerable.
  20917. (0, _defineProperty.default)(Event.prototype, "constructor", {
  20918. value: Event,
  20919. configurable: true,
  20920. writable: true
  20921. }); // Ensure `event instanceof window.Event` is `true`.
  20922. if (typeof window !== "undefined" && typeof window.Event !== "undefined") {
  20923. (0, _setPrototypeOf.default)(Event.prototype, window.Event.prototype); // Make association for wrappers.
  20924. wrappers.set(window.Event.prototype, Event);
  20925. }
  20926. /**
  20927. * Get the property descriptor to redirect a given property.
  20928. * @param {string} key Property name to define property descriptor.
  20929. * @returns {PropertyDescriptor} The property descriptor to redirect the property.
  20930. * @private
  20931. */
  20932. function defineRedirectDescriptor(key) {
  20933. return {
  20934. get: function get() {
  20935. return pd(this).event[key];
  20936. },
  20937. set: function set(value) {
  20938. pd(this).event[key] = value;
  20939. },
  20940. configurable: true,
  20941. enumerable: true
  20942. };
  20943. }
  20944. /**
  20945. * Get the property descriptor to call a given method property.
  20946. * @param {string} key Property name to define property descriptor.
  20947. * @returns {PropertyDescriptor} The property descriptor to call the method property.
  20948. * @private
  20949. */
  20950. function defineCallDescriptor(key) {
  20951. return {
  20952. value: function value() {
  20953. var event = pd(this).event;
  20954. return event[key].apply(event, arguments);
  20955. },
  20956. configurable: true,
  20957. enumerable: true
  20958. };
  20959. }
  20960. /**
  20961. * Define new wrapper class.
  20962. * @param {Function} BaseEvent The base wrapper class.
  20963. * @param {Object} proto The prototype of the original event.
  20964. * @returns {Function} The defined wrapper class.
  20965. * @private
  20966. */
  20967. function defineWrapper(BaseEvent, proto) {
  20968. var keys = (0, _keys.default)(proto);
  20969. if (keys.length === 0) {
  20970. return BaseEvent;
  20971. }
  20972. /** CustomEvent */
  20973. function CustomEvent(eventTarget, event) {
  20974. BaseEvent.call(this, eventTarget, event);
  20975. }
  20976. CustomEvent.prototype = Object.create(BaseEvent.prototype, {
  20977. constructor: {
  20978. value: CustomEvent,
  20979. configurable: true,
  20980. writable: true
  20981. }
  20982. }); // Define accessors.
  20983. for (var i = 0; i < keys.length; ++i) {
  20984. var key = keys[i];
  20985. if (!(key in BaseEvent.prototype)) {
  20986. var descriptor = (0, _getOwnPropertyDescriptor.default)(proto, key);
  20987. var isFunc = typeof descriptor.value === "function";
  20988. (0, _defineProperty.default)(CustomEvent.prototype, key, isFunc ? defineCallDescriptor(key) : defineRedirectDescriptor(key));
  20989. }
  20990. }
  20991. return CustomEvent;
  20992. }
  20993. /**
  20994. * Get the wrapper class of a given prototype.
  20995. * @param {Object} proto The prototype of the original event to get its wrapper.
  20996. * @returns {Function} The wrapper class.
  20997. * @private
  20998. */
  20999. function getWrapper(proto) {
  21000. if (proto == null || proto === Object.prototype) {
  21001. return Event;
  21002. }
  21003. var wrapper = wrappers.get(proto);
  21004. if (wrapper == null) {
  21005. wrapper = defineWrapper(getWrapper((0, _getPrototypeOf.default)(proto)), proto);
  21006. wrappers.set(proto, wrapper);
  21007. }
  21008. return wrapper;
  21009. }
  21010. /**
  21011. * Wrap a given event to management a dispatching.
  21012. * @param {EventTarget} eventTarget The event target of this dispatching.
  21013. * @param {Object} event The event to wrap.
  21014. * @returns {Event} The wrapper instance.
  21015. * @private
  21016. */
  21017. function wrapEvent(eventTarget, event) {
  21018. var Wrapper = getWrapper((0, _getPrototypeOf.default)(event));
  21019. return new Wrapper(eventTarget, event);
  21020. }
  21021. /**
  21022. * Get the immediateStopped flag of a given event.
  21023. * @param {Event} event The event to get.
  21024. * @returns {boolean} The flag to stop propagation immediately.
  21025. * @private
  21026. */
  21027. function isStopped(event) {
  21028. return pd(event).immediateStopped;
  21029. }
  21030. /**
  21031. * Set the current event phase of a given event.
  21032. * @param {Event} event The event to set current target.
  21033. * @param {number} eventPhase New event phase.
  21034. * @returns {void}
  21035. * @private
  21036. */
  21037. function setEventPhase(event, eventPhase) {
  21038. pd(event).eventPhase = eventPhase;
  21039. }
  21040. /**
  21041. * Set the current target of a given event.
  21042. * @param {Event} event The event to set current target.
  21043. * @param {EventTarget|null} currentTarget New current target.
  21044. * @returns {void}
  21045. * @private
  21046. */
  21047. function setCurrentTarget(event, currentTarget) {
  21048. pd(event).currentTarget = currentTarget;
  21049. }
  21050. /**
  21051. * Set a passive listener of a given event.
  21052. * @param {Event} event The event to set current target.
  21053. * @param {Function|null} passiveListener New passive listener.
  21054. * @returns {void}
  21055. * @private
  21056. */
  21057. function setPassiveListener(event, passiveListener) {
  21058. pd(event).passiveListener = passiveListener;
  21059. }
  21060. /**
  21061. * @typedef {object} ListenerNode
  21062. * @property {Function} listener
  21063. * @property {1|2|3} listenerType
  21064. * @property {boolean} passive
  21065. * @property {boolean} once
  21066. * @property {ListenerNode|null} next
  21067. * @private
  21068. */
  21069. /**
  21070. * @type {WeakMap<object, Map<string, ListenerNode>>}
  21071. * @private
  21072. */
  21073. var listenersMap = new _weakMap.default(); // Listener types
  21074. var CAPTURE = 1;
  21075. var BUBBLE = 2;
  21076. var ATTRIBUTE = 3;
  21077. /**
  21078. * Check whether a given value is an object or not.
  21079. * @param {any} x The value to check.
  21080. * @returns {boolean} `true` if the value is an object.
  21081. */
  21082. function isObject(x) {
  21083. return x !== null && (0, _typeof2.default)(x) === "object"; //eslint-disable-line no-restricted-syntax
  21084. }
  21085. /**
  21086. * Get listeners.
  21087. * @param {EventTarget} eventTarget The event target to get.
  21088. * @returns {Map<string, ListenerNode>} The listeners.
  21089. * @private
  21090. */
  21091. function getListeners(eventTarget) {
  21092. var listeners = listenersMap.get(eventTarget);
  21093. if (listeners == null) {
  21094. throw new TypeError("'this' is expected an EventTarget object, but got another value.");
  21095. }
  21096. return listeners;
  21097. }
  21098. /**
  21099. * Get the property descriptor for the event attribute of a given event.
  21100. * @param {string} eventName The event name to get property descriptor.
  21101. * @returns {PropertyDescriptor} The property descriptor.
  21102. * @private
  21103. */
  21104. function defineEventAttributeDescriptor(eventName) {
  21105. return {
  21106. get: function get() {
  21107. var listeners = getListeners(this);
  21108. var node = listeners.get(eventName);
  21109. while (node != null) {
  21110. if (node.listenerType === ATTRIBUTE) {
  21111. return node.listener;
  21112. }
  21113. node = node.next;
  21114. }
  21115. return null;
  21116. },
  21117. set: function set(listener) {
  21118. if (typeof listener !== "function" && !isObject(listener)) {
  21119. listener = null; // eslint-disable-line no-param-reassign
  21120. }
  21121. var listeners = getListeners(this); // Traverse to the tail while removing old value.
  21122. var prev = null;
  21123. var node = listeners.get(eventName);
  21124. while (node != null) {
  21125. if (node.listenerType === ATTRIBUTE) {
  21126. // Remove old value.
  21127. if (prev !== null) {
  21128. prev.next = node.next;
  21129. } else if (node.next !== null) {
  21130. listeners.set(eventName, node.next);
  21131. } else {
  21132. listeners.delete(eventName);
  21133. }
  21134. } else {
  21135. prev = node;
  21136. }
  21137. node = node.next;
  21138. } // Add new value.
  21139. if (listener !== null) {
  21140. var newNode = {
  21141. listener: listener,
  21142. listenerType: ATTRIBUTE,
  21143. passive: false,
  21144. once: false,
  21145. next: null
  21146. };
  21147. if (prev === null) {
  21148. listeners.set(eventName, newNode);
  21149. } else {
  21150. prev.next = newNode;
  21151. }
  21152. }
  21153. },
  21154. configurable: true,
  21155. enumerable: true
  21156. };
  21157. }
  21158. /**
  21159. * Define an event attribute (e.g. `eventTarget.onclick`).
  21160. * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.
  21161. * @param {string} eventName The event name to define.
  21162. * @returns {void}
  21163. */
  21164. function defineEventAttribute(eventTargetPrototype, eventName) {
  21165. (0, _defineProperty.default)(eventTargetPrototype, "on".concat(eventName), defineEventAttributeDescriptor(eventName));
  21166. }
  21167. /**
  21168. * Define a custom EventTarget with event attributes.
  21169. * @param {string[]} eventNames Event names for event attributes.
  21170. * @returns {EventTarget} The custom EventTarget.
  21171. * @private
  21172. */
  21173. function defineCustomEventTarget(eventNames) {
  21174. /** CustomEventTarget */
  21175. function CustomEventTarget() {
  21176. EventTarget.call(this);
  21177. }
  21178. CustomEventTarget.prototype = Object.create(EventTarget.prototype, {
  21179. constructor: {
  21180. value: CustomEventTarget,
  21181. configurable: true,
  21182. writable: true
  21183. }
  21184. });
  21185. for (var i = 0; i < eventNames.length; ++i) {
  21186. defineEventAttribute(CustomEventTarget.prototype, eventNames[i]);
  21187. }
  21188. return CustomEventTarget;
  21189. }
  21190. /**
  21191. * EventTarget.
  21192. *
  21193. * - This is constructor if no arguments.
  21194. * - This is a function which returns a CustomEventTarget constructor if there are arguments.
  21195. *
  21196. * For example:
  21197. *
  21198. * class A extends EventTarget {}
  21199. * class B extends EventTarget("message") {}
  21200. * class C extends EventTarget("message", "error") {}
  21201. * class D extends EventTarget(["message", "error"]) {}
  21202. */
  21203. function EventTarget() {
  21204. /*eslint-disable consistent-return */
  21205. if (this instanceof EventTarget) {
  21206. listenersMap.set(this, new _map.default());
  21207. return;
  21208. }
  21209. if (arguments.length === 1 && Array.isArray(arguments[0])) {
  21210. return defineCustomEventTarget(arguments[0]);
  21211. }
  21212. if (arguments.length > 0) {
  21213. var types = new Array(arguments.length);
  21214. for (var i = 0; i < arguments.length; ++i) {
  21215. types[i] = arguments[i];
  21216. }
  21217. return defineCustomEventTarget(types);
  21218. }
  21219. throw new TypeError("Cannot call a class as a function");
  21220. /*eslint-enable consistent-return */
  21221. } // Should be enumerable, but class methods are not enumerable.
  21222. EventTarget.prototype = {
  21223. /**
  21224. * Add a given listener to this event target.
  21225. * @param {string} eventName The event name to add.
  21226. * @param {Function} listener The listener to add.
  21227. * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.
  21228. * @returns {void}
  21229. */
  21230. addEventListener: function addEventListener(eventName, listener, options) {
  21231. if (listener == null) {
  21232. return;
  21233. }
  21234. if (typeof listener !== "function" && !isObject(listener)) {
  21235. throw new TypeError("'listener' should be a function or an object.");
  21236. }
  21237. var listeners = getListeners(this);
  21238. var optionsIsObj = isObject(options);
  21239. var capture = optionsIsObj ? Boolean(options.capture) : Boolean(options);
  21240. var listenerType = capture ? CAPTURE : BUBBLE;
  21241. var newNode = {
  21242. listener: listener,
  21243. listenerType: listenerType,
  21244. passive: optionsIsObj && Boolean(options.passive),
  21245. once: optionsIsObj && Boolean(options.once),
  21246. next: null
  21247. }; // Set it as the first node if the first node is null.
  21248. var node = listeners.get(eventName);
  21249. if (node === undefined) {
  21250. listeners.set(eventName, newNode);
  21251. return;
  21252. } // Traverse to the tail while checking duplication..
  21253. var prev = null;
  21254. while (node != null) {
  21255. if (node.listener === listener && node.listenerType === listenerType) {
  21256. // Should ignore duplication.
  21257. return;
  21258. }
  21259. prev = node;
  21260. node = node.next;
  21261. } // Add it.
  21262. prev.next = newNode;
  21263. },
  21264. /**
  21265. * Remove a given listener from this event target.
  21266. * @param {string} eventName The event name to remove.
  21267. * @param {Function} listener The listener to remove.
  21268. * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.
  21269. * @returns {void}
  21270. */
  21271. removeEventListener: function removeEventListener(eventName, listener, options) {
  21272. if (listener == null) {
  21273. return;
  21274. }
  21275. var listeners = getListeners(this);
  21276. var capture = isObject(options) ? Boolean(options.capture) : Boolean(options);
  21277. var listenerType = capture ? CAPTURE : BUBBLE;
  21278. var prev = null;
  21279. var node = listeners.get(eventName);
  21280. while (node != null) {
  21281. if (node.listener === listener && node.listenerType === listenerType) {
  21282. if (prev !== null) {
  21283. prev.next = node.next;
  21284. } else if (node.next !== null) {
  21285. listeners.set(eventName, node.next);
  21286. } else {
  21287. listeners.delete(eventName);
  21288. }
  21289. return;
  21290. }
  21291. prev = node;
  21292. node = node.next;
  21293. }
  21294. },
  21295. /**
  21296. * Dispatch a given event.
  21297. * @param {Event|{type:string}} event The event to dispatch.
  21298. * @returns {boolean} `false` if canceled.
  21299. */
  21300. dispatchEvent: function dispatchEvent(event) {
  21301. if (event == null || typeof event.type !== "string") {
  21302. throw new TypeError('"event.type" should be a string.');
  21303. } // If listeners aren't registered, terminate.
  21304. var listeners = getListeners(this);
  21305. var eventName = event.type;
  21306. var node = listeners.get(eventName);
  21307. if (node == null) {
  21308. return true;
  21309. } // Since we cannot rewrite several properties, so wrap object.
  21310. var wrappedEvent = wrapEvent(this, event); // This doesn't process capturing phase and bubbling phase.
  21311. // This isn't participating in a tree.
  21312. var prev = null;
  21313. while (node != null) {
  21314. // Remove this listener if it's once
  21315. if (node.once) {
  21316. if (prev !== null) {
  21317. prev.next = node.next;
  21318. } else if (node.next !== null) {
  21319. listeners.set(eventName, node.next);
  21320. } else {
  21321. listeners.delete(eventName);
  21322. }
  21323. } else {
  21324. prev = node;
  21325. } // Call this listener
  21326. setPassiveListener(wrappedEvent, node.passive ? node.listener : null);
  21327. if (typeof node.listener === "function") {
  21328. try {
  21329. node.listener.call(this, wrappedEvent);
  21330. } catch (err) {
  21331. if (typeof console !== "undefined" && typeof console.error === "function") {
  21332. console.error(err);
  21333. }
  21334. }
  21335. } else if (node.listenerType !== ATTRIBUTE && typeof node.listener.handleEvent === "function") {
  21336. node.listener.handleEvent(wrappedEvent);
  21337. } // Break if `event.stopImmediatePropagation` was called.
  21338. if (isStopped(wrappedEvent)) {
  21339. break;
  21340. }
  21341. node = node.next;
  21342. }
  21343. setPassiveListener(wrappedEvent, null);
  21344. setEventPhase(wrappedEvent, 0);
  21345. setCurrentTarget(wrappedEvent, null);
  21346. return !wrappedEvent.defaultPrevented;
  21347. }
  21348. }; // `constructor` is not enumerable.
  21349. (0, _defineProperty.default)(EventTarget.prototype, "constructor", {
  21350. value: EventTarget,
  21351. configurable: true,
  21352. writable: true
  21353. }); // Ensure `eventTarget instanceof window.EventTarget` is `true`.
  21354. if (typeof window !== "undefined" && typeof window.EventTarget !== "undefined") {
  21355. (0, _setPrototypeOf.default)(EventTarget.prototype, window.EventTarget.prototype);
  21356. }
  21357. var WS =
  21358. /** @class */
  21359. function (_super) {
  21360. __extends$1(WS, _super);
  21361. function WS(url, protocol) {
  21362. var _this = _super.call(this) || this;
  21363. _this._readyState = WS.CLOSED;
  21364. if (!url) {
  21365. throw new TypeError("Failed to construct 'WebSocket': url required");
  21366. }
  21367. _this._url = url;
  21368. _this._protocol = protocol;
  21369. return _this;
  21370. }
  21371. (0, _defineProperty.default)(WS.prototype, "url", {
  21372. get: function get() {
  21373. return this._url;
  21374. },
  21375. enumerable: false,
  21376. configurable: true
  21377. });
  21378. (0, _defineProperty.default)(WS.prototype, "protocol", {
  21379. get: function get() {
  21380. return this._protocol;
  21381. },
  21382. enumerable: false,
  21383. configurable: true
  21384. });
  21385. (0, _defineProperty.default)(WS.prototype, "readyState", {
  21386. get: function get() {
  21387. return this._readyState;
  21388. },
  21389. enumerable: false,
  21390. configurable: true
  21391. });
  21392. WS.CONNECTING = 0;
  21393. WS.OPEN = 1;
  21394. WS.CLOSING = 2;
  21395. WS.CLOSED = 3;
  21396. return WS;
  21397. }(EventTarget("open", "error", "message", "close"));
  21398. var WechatWS =
  21399. /** @class */
  21400. function (_super) {
  21401. __extends$1(WechatWS, _super);
  21402. function WechatWS(url, protocol) {
  21403. var _this = _super.call(this, url, protocol) || this;
  21404. if (protocol && !(wx.canIUse && wx.canIUse("connectSocket.object.protocols"))) {
  21405. throw new Error("subprotocol not supported in weapp");
  21406. }
  21407. _this._readyState = WS.CONNECTING;
  21408. var errorHandler = function errorHandler(event) {
  21409. _this._readyState = WS.CLOSED;
  21410. _this.dispatchEvent({
  21411. type: "error",
  21412. message: event.errMsg
  21413. });
  21414. };
  21415. var socketTask = wx.connectSocket({
  21416. url: url,
  21417. protocols: _this._protocol === undefined || Array.isArray(_this._protocol) ? _this._protocol : [_this._protocol],
  21418. fail: function fail(error) {
  21419. return setTimeout(function () {
  21420. return errorHandler(error);
  21421. }, 0);
  21422. }
  21423. });
  21424. _this._socketTask = socketTask;
  21425. socketTask.onOpen(function () {
  21426. _this._readyState = WS.OPEN;
  21427. _this.dispatchEvent({
  21428. type: "open"
  21429. });
  21430. });
  21431. socketTask.onError(errorHandler);
  21432. socketTask.onMessage(function (event) {
  21433. var data = event.data;
  21434. _this.dispatchEvent({
  21435. data: data,
  21436. type: "message"
  21437. });
  21438. });
  21439. socketTask.onClose(function (event) {
  21440. _this._readyState = WS.CLOSED;
  21441. var code = event.code,
  21442. reason = event.reason;
  21443. _this.dispatchEvent({
  21444. code: code,
  21445. reason: reason,
  21446. type: "close"
  21447. });
  21448. });
  21449. return _this;
  21450. }
  21451. WechatWS.prototype.close = function () {
  21452. if (this.readyState === WS.CLOSED) return;
  21453. if (this.readyState === WS.CONNECTING) {
  21454. console.warn("close WebSocket which is connecting might not work");
  21455. }
  21456. this._socketTask.close({});
  21457. };
  21458. WechatWS.prototype.send = function (data) {
  21459. if (this.readyState !== WS.OPEN) {
  21460. throw new Error("INVALID_STATE_ERR");
  21461. }
  21462. if (!(typeof data === "string" || data instanceof ArrayBuffer)) {
  21463. throw new TypeError("only String/ArrayBuffer supported");
  21464. }
  21465. this._socketTask.send({
  21466. data: data
  21467. });
  21468. };
  21469. return WechatWS;
  21470. }(WS);
  21471. var WebSocket = WechatWS;
  21472. var platformInfo = {
  21473. name: "Weapp"
  21474. };
  21475. exports.WebSocket = WebSocket;
  21476. exports.getAuthInfo = getAuthInfo;
  21477. exports.platformInfo = platformInfo;
  21478. exports.request = request;
  21479. exports.storage = storage;
  21480. exports.upload = upload;
  21481. /***/ }),
  21482. /* 547 */
  21483. /***/ (function(module, exports, __webpack_require__) {
  21484. module.exports = __webpack_require__(548);
  21485. /***/ }),
  21486. /* 548 */
  21487. /***/ (function(module, exports, __webpack_require__) {
  21488. var parent = __webpack_require__(549);
  21489. module.exports = parent;
  21490. /***/ }),
  21491. /* 549 */
  21492. /***/ (function(module, exports, __webpack_require__) {
  21493. __webpack_require__(550);
  21494. var path = __webpack_require__(10);
  21495. module.exports = path.Object.assign;
  21496. /***/ }),
  21497. /* 550 */
  21498. /***/ (function(module, exports, __webpack_require__) {
  21499. var $ = __webpack_require__(0);
  21500. var assign = __webpack_require__(551);
  21501. // `Object.assign` method
  21502. // https://tc39.es/ecma262/#sec-object.assign
  21503. // eslint-disable-next-line es-x/no-object-assign -- required for testing
  21504. $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
  21505. assign: assign
  21506. });
  21507. /***/ }),
  21508. /* 551 */
  21509. /***/ (function(module, exports, __webpack_require__) {
  21510. "use strict";
  21511. var DESCRIPTORS = __webpack_require__(16);
  21512. var uncurryThis = __webpack_require__(4);
  21513. var call = __webpack_require__(13);
  21514. var fails = __webpack_require__(3);
  21515. var objectKeys = __webpack_require__(98);
  21516. var getOwnPropertySymbolsModule = __webpack_require__(97);
  21517. var propertyIsEnumerableModule = __webpack_require__(113);
  21518. var toObject = __webpack_require__(34);
  21519. var IndexedObject = __webpack_require__(114);
  21520. // eslint-disable-next-line es-x/no-object-assign -- safe
  21521. var $assign = Object.assign;
  21522. // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
  21523. var defineProperty = Object.defineProperty;
  21524. var concat = uncurryThis([].concat);
  21525. // `Object.assign` method
  21526. // https://tc39.es/ecma262/#sec-object.assign
  21527. module.exports = !$assign || fails(function () {
  21528. // should have correct order of operations (Edge bug)
  21529. if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
  21530. enumerable: true,
  21531. get: function () {
  21532. defineProperty(this, 'b', {
  21533. value: 3,
  21534. enumerable: false
  21535. });
  21536. }
  21537. }), { b: 2 })).b !== 1) return true;
  21538. // should work with symbols and should have deterministic property order (V8 bug)
  21539. var A = {};
  21540. var B = {};
  21541. // eslint-disable-next-line es-x/no-symbol -- safe
  21542. var symbol = Symbol();
  21543. var alphabet = 'abcdefghijklmnopqrst';
  21544. A[symbol] = 7;
  21545. alphabet.split('').forEach(function (chr) { B[chr] = chr; });
  21546. return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
  21547. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
  21548. var T = toObject(target);
  21549. var argumentsLength = arguments.length;
  21550. var index = 1;
  21551. var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
  21552. var propertyIsEnumerable = propertyIsEnumerableModule.f;
  21553. while (argumentsLength > index) {
  21554. var S = IndexedObject(arguments[index++]);
  21555. var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
  21556. var length = keys.length;
  21557. var j = 0;
  21558. var key;
  21559. while (length > j) {
  21560. key = keys[j++];
  21561. if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
  21562. }
  21563. } return T;
  21564. } : $assign;
  21565. /***/ }),
  21566. /* 552 */
  21567. /***/ (function(module, exports, __webpack_require__) {
  21568. module.exports = __webpack_require__(553);
  21569. /***/ }),
  21570. /* 553 */
  21571. /***/ (function(module, exports, __webpack_require__) {
  21572. var parent = __webpack_require__(554);
  21573. module.exports = parent;
  21574. /***/ }),
  21575. /* 554 */
  21576. /***/ (function(module, exports, __webpack_require__) {
  21577. __webpack_require__(233);
  21578. var path = __webpack_require__(10);
  21579. module.exports = path.Object.getOwnPropertySymbols;
  21580. /***/ }),
  21581. /* 555 */
  21582. /***/ (function(module, exports, __webpack_require__) {
  21583. module.exports = __webpack_require__(238);
  21584. /***/ }),
  21585. /* 556 */
  21586. /***/ (function(module, exports, __webpack_require__) {
  21587. module.exports = __webpack_require__(557);
  21588. /***/ }),
  21589. /* 557 */
  21590. /***/ (function(module, exports, __webpack_require__) {
  21591. var parent = __webpack_require__(558);
  21592. __webpack_require__(51);
  21593. module.exports = parent;
  21594. /***/ }),
  21595. /* 558 */
  21596. /***/ (function(module, exports, __webpack_require__) {
  21597. __webpack_require__(48);
  21598. __webpack_require__(60);
  21599. __webpack_require__(559);
  21600. var path = __webpack_require__(10);
  21601. module.exports = path.WeakMap;
  21602. /***/ }),
  21603. /* 559 */
  21604. /***/ (function(module, exports, __webpack_require__) {
  21605. // TODO: Remove this module from `core-js@4` since it's replaced to module below
  21606. __webpack_require__(560);
  21607. /***/ }),
  21608. /* 560 */
  21609. /***/ (function(module, exports, __webpack_require__) {
  21610. "use strict";
  21611. var global = __webpack_require__(6);
  21612. var uncurryThis = __webpack_require__(4);
  21613. var defineBuiltIns = __webpack_require__(146);
  21614. var InternalMetadataModule = __webpack_require__(111);
  21615. var collection = __webpack_require__(248);
  21616. var collectionWeak = __webpack_require__(563);
  21617. var isObject = __webpack_require__(11);
  21618. var isExtensible = __webpack_require__(247);
  21619. var enforceInternalState = __webpack_require__(38).enforce;
  21620. var NATIVE_WEAK_MAP = __webpack_require__(160);
  21621. var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
  21622. var InternalWeakMap;
  21623. var wrapper = function (init) {
  21624. return function WeakMap() {
  21625. return init(this, arguments.length ? arguments[0] : undefined);
  21626. };
  21627. };
  21628. // `WeakMap` constructor
  21629. // https://tc39.es/ecma262/#sec-weakmap-constructor
  21630. var $WeakMap = collection('WeakMap', wrapper, collectionWeak);
  21631. // IE11 WeakMap frozen keys fix
  21632. // We can't use feature detection because it crash some old IE builds
  21633. // https://github.com/zloirock/core-js/issues/485
  21634. if (NATIVE_WEAK_MAP && IS_IE11) {
  21635. InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);
  21636. InternalMetadataModule.enable();
  21637. var WeakMapPrototype = $WeakMap.prototype;
  21638. var nativeDelete = uncurryThis(WeakMapPrototype['delete']);
  21639. var nativeHas = uncurryThis(WeakMapPrototype.has);
  21640. var nativeGet = uncurryThis(WeakMapPrototype.get);
  21641. var nativeSet = uncurryThis(WeakMapPrototype.set);
  21642. defineBuiltIns(WeakMapPrototype, {
  21643. 'delete': function (key) {
  21644. if (isObject(key) && !isExtensible(key)) {
  21645. var state = enforceInternalState(this);
  21646. if (!state.frozen) state.frozen = new InternalWeakMap();
  21647. return nativeDelete(this, key) || state.frozen['delete'](key);
  21648. } return nativeDelete(this, key);
  21649. },
  21650. has: function has(key) {
  21651. if (isObject(key) && !isExtensible(key)) {
  21652. var state = enforceInternalState(this);
  21653. if (!state.frozen) state.frozen = new InternalWeakMap();
  21654. return nativeHas(this, key) || state.frozen.has(key);
  21655. } return nativeHas(this, key);
  21656. },
  21657. get: function get(key) {
  21658. if (isObject(key) && !isExtensible(key)) {
  21659. var state = enforceInternalState(this);
  21660. if (!state.frozen) state.frozen = new InternalWeakMap();
  21661. return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);
  21662. } return nativeGet(this, key);
  21663. },
  21664. set: function set(key, value) {
  21665. if (isObject(key) && !isExtensible(key)) {
  21666. var state = enforceInternalState(this);
  21667. if (!state.frozen) state.frozen = new InternalWeakMap();
  21668. nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);
  21669. } else nativeSet(this, key, value);
  21670. return this;
  21671. }
  21672. });
  21673. }
  21674. /***/ }),
  21675. /* 561 */
  21676. /***/ (function(module, exports, __webpack_require__) {
  21677. // FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it
  21678. var fails = __webpack_require__(3);
  21679. module.exports = fails(function () {
  21680. if (typeof ArrayBuffer == 'function') {
  21681. var buffer = new ArrayBuffer(8);
  21682. // eslint-disable-next-line es-x/no-object-isextensible, es-x/no-object-defineproperty -- safe
  21683. if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
  21684. }
  21685. });
  21686. /***/ }),
  21687. /* 562 */
  21688. /***/ (function(module, exports, __webpack_require__) {
  21689. var fails = __webpack_require__(3);
  21690. module.exports = !fails(function () {
  21691. // eslint-disable-next-line es-x/no-object-isextensible, es-x/no-object-preventextensions -- required for testing
  21692. return Object.isExtensible(Object.preventExtensions({}));
  21693. });
  21694. /***/ }),
  21695. /* 563 */
  21696. /***/ (function(module, exports, __webpack_require__) {
  21697. "use strict";
  21698. var uncurryThis = __webpack_require__(4);
  21699. var defineBuiltIns = __webpack_require__(146);
  21700. var getWeakData = __webpack_require__(111).getWeakData;
  21701. var anObject = __webpack_require__(19);
  21702. var isObject = __webpack_require__(11);
  21703. var anInstance = __webpack_require__(100);
  21704. var iterate = __webpack_require__(37);
  21705. var ArrayIterationModule = __webpack_require__(66);
  21706. var hasOwn = __webpack_require__(14);
  21707. var InternalStateModule = __webpack_require__(38);
  21708. var setInternalState = InternalStateModule.set;
  21709. var internalStateGetterFor = InternalStateModule.getterFor;
  21710. var find = ArrayIterationModule.find;
  21711. var findIndex = ArrayIterationModule.findIndex;
  21712. var splice = uncurryThis([].splice);
  21713. var id = 0;
  21714. // fallback for uncaught frozen keys
  21715. var uncaughtFrozenStore = function (store) {
  21716. return store.frozen || (store.frozen = new UncaughtFrozenStore());
  21717. };
  21718. var UncaughtFrozenStore = function () {
  21719. this.entries = [];
  21720. };
  21721. var findUncaughtFrozen = function (store, key) {
  21722. return find(store.entries, function (it) {
  21723. return it[0] === key;
  21724. });
  21725. };
  21726. UncaughtFrozenStore.prototype = {
  21727. get: function (key) {
  21728. var entry = findUncaughtFrozen(this, key);
  21729. if (entry) return entry[1];
  21730. },
  21731. has: function (key) {
  21732. return !!findUncaughtFrozen(this, key);
  21733. },
  21734. set: function (key, value) {
  21735. var entry = findUncaughtFrozen(this, key);
  21736. if (entry) entry[1] = value;
  21737. else this.entries.push([key, value]);
  21738. },
  21739. 'delete': function (key) {
  21740. var index = findIndex(this.entries, function (it) {
  21741. return it[0] === key;
  21742. });
  21743. if (~index) splice(this.entries, index, 1);
  21744. return !!~index;
  21745. }
  21746. };
  21747. module.exports = {
  21748. getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
  21749. var Constructor = wrapper(function (that, iterable) {
  21750. anInstance(that, Prototype);
  21751. setInternalState(that, {
  21752. type: CONSTRUCTOR_NAME,
  21753. id: id++,
  21754. frozen: undefined
  21755. });
  21756. if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
  21757. });
  21758. var Prototype = Constructor.prototype;
  21759. var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
  21760. var define = function (that, key, value) {
  21761. var state = getInternalState(that);
  21762. var data = getWeakData(anObject(key), true);
  21763. if (data === true) uncaughtFrozenStore(state).set(key, value);
  21764. else data[state.id] = value;
  21765. return that;
  21766. };
  21767. defineBuiltIns(Prototype, {
  21768. // `{ WeakMap, WeakSet }.prototype.delete(key)` methods
  21769. // https://tc39.es/ecma262/#sec-weakmap.prototype.delete
  21770. // https://tc39.es/ecma262/#sec-weakset.prototype.delete
  21771. 'delete': function (key) {
  21772. var state = getInternalState(this);
  21773. if (!isObject(key)) return false;
  21774. var data = getWeakData(key);
  21775. if (data === true) return uncaughtFrozenStore(state)['delete'](key);
  21776. return data && hasOwn(data, state.id) && delete data[state.id];
  21777. },
  21778. // `{ WeakMap, WeakSet }.prototype.has(key)` methods
  21779. // https://tc39.es/ecma262/#sec-weakmap.prototype.has
  21780. // https://tc39.es/ecma262/#sec-weakset.prototype.has
  21781. has: function has(key) {
  21782. var state = getInternalState(this);
  21783. if (!isObject(key)) return false;
  21784. var data = getWeakData(key);
  21785. if (data === true) return uncaughtFrozenStore(state).has(key);
  21786. return data && hasOwn(data, state.id);
  21787. }
  21788. });
  21789. defineBuiltIns(Prototype, IS_MAP ? {
  21790. // `WeakMap.prototype.get(key)` method
  21791. // https://tc39.es/ecma262/#sec-weakmap.prototype.get
  21792. get: function get(key) {
  21793. var state = getInternalState(this);
  21794. if (isObject(key)) {
  21795. var data = getWeakData(key);
  21796. if (data === true) return uncaughtFrozenStore(state).get(key);
  21797. return data ? data[state.id] : undefined;
  21798. }
  21799. },
  21800. // `WeakMap.prototype.set(key, value)` method
  21801. // https://tc39.es/ecma262/#sec-weakmap.prototype.set
  21802. set: function set(key, value) {
  21803. return define(this, key, value);
  21804. }
  21805. } : {
  21806. // `WeakSet.prototype.add(value)` method
  21807. // https://tc39.es/ecma262/#sec-weakset.prototype.add
  21808. add: function add(value) {
  21809. return define(this, value, true);
  21810. }
  21811. });
  21812. return Constructor;
  21813. }
  21814. };
  21815. /***/ }),
  21816. /* 564 */
  21817. /***/ (function(module, exports, __webpack_require__) {
  21818. module.exports = __webpack_require__(565);
  21819. /***/ }),
  21820. /* 565 */
  21821. /***/ (function(module, exports, __webpack_require__) {
  21822. var parent = __webpack_require__(566);
  21823. __webpack_require__(51);
  21824. module.exports = parent;
  21825. /***/ }),
  21826. /* 566 */
  21827. /***/ (function(module, exports, __webpack_require__) {
  21828. __webpack_require__(48);
  21829. __webpack_require__(567);
  21830. __webpack_require__(60);
  21831. __webpack_require__(78);
  21832. var path = __webpack_require__(10);
  21833. module.exports = path.Map;
  21834. /***/ }),
  21835. /* 567 */
  21836. /***/ (function(module, exports, __webpack_require__) {
  21837. // TODO: Remove this module from `core-js@4` since it's replaced to module below
  21838. __webpack_require__(568);
  21839. /***/ }),
  21840. /* 568 */
  21841. /***/ (function(module, exports, __webpack_require__) {
  21842. "use strict";
  21843. var collection = __webpack_require__(248);
  21844. var collectionStrong = __webpack_require__(569);
  21845. // `Map` constructor
  21846. // https://tc39.es/ecma262/#sec-map-objects
  21847. collection('Map', function (init) {
  21848. return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
  21849. }, collectionStrong);
  21850. /***/ }),
  21851. /* 569 */
  21852. /***/ (function(module, exports, __webpack_require__) {
  21853. "use strict";
  21854. var defineProperty = __webpack_require__(22).f;
  21855. var create = __webpack_require__(47);
  21856. var defineBuiltIns = __webpack_require__(146);
  21857. var bind = __webpack_require__(45);
  21858. var anInstance = __webpack_require__(100);
  21859. var iterate = __webpack_require__(37);
  21860. var defineIterator = __webpack_require__(124);
  21861. var setSpecies = __webpack_require__(162);
  21862. var DESCRIPTORS = __webpack_require__(16);
  21863. var fastKey = __webpack_require__(111).fastKey;
  21864. var InternalStateModule = __webpack_require__(38);
  21865. var setInternalState = InternalStateModule.set;
  21866. var internalStateGetterFor = InternalStateModule.getterFor;
  21867. module.exports = {
  21868. getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
  21869. var Constructor = wrapper(function (that, iterable) {
  21870. anInstance(that, Prototype);
  21871. setInternalState(that, {
  21872. type: CONSTRUCTOR_NAME,
  21873. index: create(null),
  21874. first: undefined,
  21875. last: undefined,
  21876. size: 0
  21877. });
  21878. if (!DESCRIPTORS) that.size = 0;
  21879. if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
  21880. });
  21881. var Prototype = Constructor.prototype;
  21882. var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
  21883. var define = function (that, key, value) {
  21884. var state = getInternalState(that);
  21885. var entry = getEntry(that, key);
  21886. var previous, index;
  21887. // change existing entry
  21888. if (entry) {
  21889. entry.value = value;
  21890. // create new entry
  21891. } else {
  21892. state.last = entry = {
  21893. index: index = fastKey(key, true),
  21894. key: key,
  21895. value: value,
  21896. previous: previous = state.last,
  21897. next: undefined,
  21898. removed: false
  21899. };
  21900. if (!state.first) state.first = entry;
  21901. if (previous) previous.next = entry;
  21902. if (DESCRIPTORS) state.size++;
  21903. else that.size++;
  21904. // add to index
  21905. if (index !== 'F') state.index[index] = entry;
  21906. } return that;
  21907. };
  21908. var getEntry = function (that, key) {
  21909. var state = getInternalState(that);
  21910. // fast case
  21911. var index = fastKey(key);
  21912. var entry;
  21913. if (index !== 'F') return state.index[index];
  21914. // frozen object case
  21915. for (entry = state.first; entry; entry = entry.next) {
  21916. if (entry.key == key) return entry;
  21917. }
  21918. };
  21919. defineBuiltIns(Prototype, {
  21920. // `{ Map, Set }.prototype.clear()` methods
  21921. // https://tc39.es/ecma262/#sec-map.prototype.clear
  21922. // https://tc39.es/ecma262/#sec-set.prototype.clear
  21923. clear: function clear() {
  21924. var that = this;
  21925. var state = getInternalState(that);
  21926. var data = state.index;
  21927. var entry = state.first;
  21928. while (entry) {
  21929. entry.removed = true;
  21930. if (entry.previous) entry.previous = entry.previous.next = undefined;
  21931. delete data[entry.index];
  21932. entry = entry.next;
  21933. }
  21934. state.first = state.last = undefined;
  21935. if (DESCRIPTORS) state.size = 0;
  21936. else that.size = 0;
  21937. },
  21938. // `{ Map, Set }.prototype.delete(key)` methods
  21939. // https://tc39.es/ecma262/#sec-map.prototype.delete
  21940. // https://tc39.es/ecma262/#sec-set.prototype.delete
  21941. 'delete': function (key) {
  21942. var that = this;
  21943. var state = getInternalState(that);
  21944. var entry = getEntry(that, key);
  21945. if (entry) {
  21946. var next = entry.next;
  21947. var prev = entry.previous;
  21948. delete state.index[entry.index];
  21949. entry.removed = true;
  21950. if (prev) prev.next = next;
  21951. if (next) next.previous = prev;
  21952. if (state.first == entry) state.first = next;
  21953. if (state.last == entry) state.last = prev;
  21954. if (DESCRIPTORS) state.size--;
  21955. else that.size--;
  21956. } return !!entry;
  21957. },
  21958. // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods
  21959. // https://tc39.es/ecma262/#sec-map.prototype.foreach
  21960. // https://tc39.es/ecma262/#sec-set.prototype.foreach
  21961. forEach: function forEach(callbackfn /* , that = undefined */) {
  21962. var state = getInternalState(this);
  21963. var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  21964. var entry;
  21965. while (entry = entry ? entry.next : state.first) {
  21966. boundFunction(entry.value, entry.key, this);
  21967. // revert to the last existing entry
  21968. while (entry && entry.removed) entry = entry.previous;
  21969. }
  21970. },
  21971. // `{ Map, Set}.prototype.has(key)` methods
  21972. // https://tc39.es/ecma262/#sec-map.prototype.has
  21973. // https://tc39.es/ecma262/#sec-set.prototype.has
  21974. has: function has(key) {
  21975. return !!getEntry(this, key);
  21976. }
  21977. });
  21978. defineBuiltIns(Prototype, IS_MAP ? {
  21979. // `Map.prototype.get(key)` method
  21980. // https://tc39.es/ecma262/#sec-map.prototype.get
  21981. get: function get(key) {
  21982. var entry = getEntry(this, key);
  21983. return entry && entry.value;
  21984. },
  21985. // `Map.prototype.set(key, value)` method
  21986. // https://tc39.es/ecma262/#sec-map.prototype.set
  21987. set: function set(key, value) {
  21988. return define(this, key === 0 ? 0 : key, value);
  21989. }
  21990. } : {
  21991. // `Set.prototype.add(value)` method
  21992. // https://tc39.es/ecma262/#sec-set.prototype.add
  21993. add: function add(value) {
  21994. return define(this, value = value === 0 ? 0 : value, value);
  21995. }
  21996. });
  21997. if (DESCRIPTORS) defineProperty(Prototype, 'size', {
  21998. get: function () {
  21999. return getInternalState(this).size;
  22000. }
  22001. });
  22002. return Constructor;
  22003. },
  22004. setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
  22005. var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
  22006. var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
  22007. var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
  22008. // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods
  22009. // https://tc39.es/ecma262/#sec-map.prototype.entries
  22010. // https://tc39.es/ecma262/#sec-map.prototype.keys
  22011. // https://tc39.es/ecma262/#sec-map.prototype.values
  22012. // https://tc39.es/ecma262/#sec-map.prototype-@@iterator
  22013. // https://tc39.es/ecma262/#sec-set.prototype.entries
  22014. // https://tc39.es/ecma262/#sec-set.prototype.keys
  22015. // https://tc39.es/ecma262/#sec-set.prototype.values
  22016. // https://tc39.es/ecma262/#sec-set.prototype-@@iterator
  22017. defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
  22018. setInternalState(this, {
  22019. type: ITERATOR_NAME,
  22020. target: iterated,
  22021. state: getInternalCollectionState(iterated),
  22022. kind: kind,
  22023. last: undefined
  22024. });
  22025. }, function () {
  22026. var state = getInternalIteratorState(this);
  22027. var kind = state.kind;
  22028. var entry = state.last;
  22029. // revert to the last existing entry
  22030. while (entry && entry.removed) entry = entry.previous;
  22031. // get next entry
  22032. if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
  22033. // or finish the iteration
  22034. state.target = undefined;
  22035. return { value: undefined, done: true };
  22036. }
  22037. // return step by kind
  22038. if (kind == 'keys') return { value: entry.key, done: false };
  22039. if (kind == 'values') return { value: entry.value, done: false };
  22040. return { value: [entry.key, entry.value], done: false };
  22041. }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
  22042. // `{ Map, Set }.prototype[@@species]` accessors
  22043. // https://tc39.es/ecma262/#sec-get-map-@@species
  22044. // https://tc39.es/ecma262/#sec-get-set-@@species
  22045. setSpecies(CONSTRUCTOR_NAME);
  22046. }
  22047. };
  22048. /***/ })
  22049. /******/ ]);
  22050. });
  22051. //# sourceMappingURL=av-weapp.js.map