12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547 |
- (function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory();
- else if(typeof define === 'function' && define.amd)
- define([], factory);
- else if(typeof exports === 'object')
- exports["AV"] = factory();
- else
- root["AV"] = factory();
- })(typeof self !== 'undefined' ? self : this, function() {
- return /******/ (function(modules) { // webpackBootstrap
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId]) {
- /******/ return installedModules[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /******/
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, {
- /******/ configurable: false,
- /******/ enumerable: true,
- /******/ get: getter
- /******/ });
- /******/ }
- /******/ };
- /******/
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "";
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = 249);
- /******/ })
- /************************************************************************/
- /******/ ([
- /* 0 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var global = __webpack_require__(6);
- var apply = __webpack_require__(69);
- var uncurryThis = __webpack_require__(4);
- var isCallable = __webpack_require__(7);
- var getOwnPropertyDescriptor = __webpack_require__(71).f;
- var isForced = __webpack_require__(149);
- var path = __webpack_require__(10);
- var bind = __webpack_require__(45);
- var createNonEnumerableProperty = __webpack_require__(35);
- var hasOwn = __webpack_require__(14);
- var wrapConstructor = function (NativeConstructor) {
- var Wrapper = function (a, b, c) {
- if (this instanceof Wrapper) {
- switch (arguments.length) {
- case 0: return new NativeConstructor();
- case 1: return new NativeConstructor(a);
- case 2: return new NativeConstructor(a, b);
- } return new NativeConstructor(a, b, c);
- } return apply(NativeConstructor, this, arguments);
- };
- Wrapper.prototype = NativeConstructor.prototype;
- return Wrapper;
- };
- /*
- options.target - name of the target object
- options.global - target is the global object
- options.stat - export as static methods of target
- options.proto - export as prototype methods of target
- options.real - real prototype method for the `pure` version
- options.forced - export even if the native feature is available
- options.bind - bind methods to the target, required for the `pure` version
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
- options.sham - add a flag to not completely full polyfills
- options.enumerable - export as enumerable property
- options.dontCallGetSet - prevent calling a getter on target
- options.name - the .name of the function if it does not match the key
- */
- module.exports = function (options, source) {
- var TARGET = options.target;
- var GLOBAL = options.global;
- var STATIC = options.stat;
- var PROTO = options.proto;
- var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;
- var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];
- var targetPrototype = target.prototype;
- var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
- var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
- for (key in source) {
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
- // contains in native
- USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key);
- targetProperty = target[key];
- if (USE_NATIVE) if (options.dontCallGetSet) {
- descriptor = getOwnPropertyDescriptor(nativeSource, key);
- nativeProperty = descriptor && descriptor.value;
- } else nativeProperty = nativeSource[key];
- // export native or implementation
- sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];
- if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;
- // bind timers to global for call from export context
- if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);
- // wrap global constructors for prevent changs in this version
- else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);
- // make static versions for prototype methods
- else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);
- // default case
- else resultProperty = sourceProperty;
- // add a flag to not completely full polyfills
- if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {
- createNonEnumerableProperty(resultProperty, 'sham', true);
- }
- createNonEnumerableProperty(target, key, resultProperty);
- if (PROTO) {
- VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
- if (!hasOwn(path, VIRTUAL_PROTOTYPE)) {
- createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});
- }
- // export virtual prototype methods
- createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);
- // export real prototype methods
- if (options.real && targetPrototype && !targetPrototype[key]) {
- createNonEnumerableProperty(targetPrototype, key, sourceProperty);
- }
- }
- }
- };
- /***/ }),
- /* 1 */
- /***/ (function(module, exports) {
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- };
- }
- module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 2 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__index_default_js__ = __webpack_require__(290);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_0__index_default_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__index_js__ = __webpack_require__(126);
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["VERSION"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["restArguments"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isObject"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNull"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isUndefined"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isBoolean"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isElement"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isString"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNumber"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDate"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isRegExp"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isError"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSymbol"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArrayBuffer"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isDataView"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArray"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFunction"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isArguments"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isFinite"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isNaN"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isTypedArray"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEmpty"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMatch"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isEqual"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isMap"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakMap"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isSet"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["isWeakSet"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["keys"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["allKeys"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["values"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pairs"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invert"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["functions"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["methods"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extend"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["extendOwn"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["assign"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defaults"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["create"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["clone"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tap"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["get"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["has"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mapObject"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["identity"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["constant"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["noop"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toPath"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["property"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["propertyOf"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matcher"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["matches"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["times"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["random"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["now"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["escape"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unescape"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["templateSettings"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["template"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["result"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniqueId"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chain"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["iteratee"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partial"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bind"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["bindAll"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["memoize"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["delay"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["defer"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["throttle"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["debounce"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["wrap"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["negate"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compose"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["after"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["before"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["once"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findKey"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findIndex"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findLastIndex"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortedIndex"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexOf"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["lastIndexOf"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["find"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["detect"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["findWhere"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["each"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["forEach"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["map"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["collect"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduce"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldl"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["inject"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reduceRight"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["foldr"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["filter"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["select"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["reject"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["every"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["all"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["some"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["any"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["contains"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["includes"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["include"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["invoke"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pluck"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["where"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["max"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["min"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["shuffle"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sample"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["sortBy"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["groupBy"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["indexBy"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["countBy"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["partition"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["toArray"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["size"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["pick"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["omit"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["first"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["head"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["take"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["initial"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["last"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["rest"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["tail"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["drop"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["compact"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["flatten"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["without"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["uniq"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unique"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["union"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["intersection"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["difference"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["unzip"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["transpose"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["zip"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["object"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["range"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["chunk"]; });
- /* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_1__index_js__["mixin"]; });
- // ESM Exports
- // ===========
- // This module is the package entry point for ES module users. In other words,
- // it is the module they are interfacing with when they import from the whole
- // package instead of from a submodule, like this:
- //
- // ```js
- // import { map } from 'underscore';
- // ```
- //
- // The difference with `./index-default`, which is the package entry point for
- // CommonJS, AMD and UMD users, is purely technical. In ES modules, named and
- // default exports are considered to be siblings, so when you have a default
- // export, its properties are not automatically available as named exports. For
- // this reason, we re-export the named exports in addition to providing the same
- // default export as in `./index-default`.
- /***/ }),
- /* 3 */
- /***/ (function(module, exports) {
- module.exports = function (exec) {
- try {
- return !!exec();
- } catch (error) {
- return true;
- }
- };
- /***/ }),
- /* 4 */
- /***/ (function(module, exports, __webpack_require__) {
- var NATIVE_BIND = __webpack_require__(70);
- var FunctionPrototype = Function.prototype;
- var bind = FunctionPrototype.bind;
- var call = FunctionPrototype.call;
- var uncurryThis = NATIVE_BIND && bind.bind(call, call);
- module.exports = NATIVE_BIND ? function (fn) {
- return fn && uncurryThis(fn);
- } : function (fn) {
- return fn && function () {
- return call.apply(fn, arguments);
- };
- };
- /***/ }),
- /* 5 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return VERSION; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return root; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ArrayProto; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ObjProto; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return SymbolProto; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return push; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return slice; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return toString; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return hasOwnProperty; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return supportsArrayBuffer; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return supportsDataView; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return nativeIsArray; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return nativeKeys; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return nativeCreate; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return nativeIsView; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return _isNaN; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _isFinite; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return hasEnumBug; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return nonEnumerableProps; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MAX_ARRAY_INDEX; });
- // Current version.
- var VERSION = '1.12.1';
- // Establish the root object, `window` (`self`) in the browser, `global`
- // on the server, or `this` in some virtual machines. We use `self`
- // instead of `window` for `WebWorker` support.
- var root = typeof self == 'object' && self.self === self && self ||
- typeof global == 'object' && global.global === global && global ||
- Function('return this')() ||
- {};
- // Save bytes in the minified (but not gzipped) version:
- var ArrayProto = Array.prototype, ObjProto = Object.prototype;
- var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
- // Create quick reference variables for speed access to core prototypes.
- var push = ArrayProto.push,
- slice = ArrayProto.slice,
- toString = ObjProto.toString,
- hasOwnProperty = ObjProto.hasOwnProperty;
- // Modern feature detection.
- var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',
- supportsDataView = typeof DataView !== 'undefined';
- // All **ECMAScript 5+** native function implementations that we hope to use
- // are declared here.
- var nativeIsArray = Array.isArray,
- nativeKeys = Object.keys,
- nativeCreate = Object.create,
- nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
- // Create references to these builtin functions because we override them.
- var _isNaN = isNaN,
- _isFinite = isFinite;
- // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
- var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
- var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
- 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
- // The largest integer that can be represented exactly.
- var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
- /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(112)))
- /***/ }),
- /* 6 */
- /***/ (function(module, exports, __webpack_require__) {
- /* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
- return it && it.Math == Math && it;
- };
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
- module.exports =
- // eslint-disable-next-line es-x/no-global-this -- safe
- check(typeof globalThis == 'object' && globalThis) ||
- check(typeof window == 'object' && window) ||
- // eslint-disable-next-line no-restricted-globals -- safe
- check(typeof self == 'object' && self) ||
- check(typeof global == 'object' && global) ||
- // eslint-disable-next-line no-new-func -- fallback
- (function () { return this; })() || Function('return this')();
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(112)))
- /***/ }),
- /* 7 */
- /***/ (function(module, exports) {
- // `IsCallable` abstract operation
- // https://tc39.es/ecma262/#sec-iscallable
- module.exports = function (argument) {
- return typeof argument == 'function';
- };
- /***/ }),
- /* 8 */
- /***/ (function(module, exports, __webpack_require__) {
- var path = __webpack_require__(10);
- var hasOwn = __webpack_require__(14);
- var wrappedWellKnownSymbolModule = __webpack_require__(144);
- var defineProperty = __webpack_require__(22).f;
- module.exports = function (NAME) {
- var Symbol = path.Symbol || (path.Symbol = {});
- if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {
- value: wrappedWellKnownSymbolModule.f(NAME)
- });
- };
- /***/ }),
- /* 9 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(6);
- var shared = __webpack_require__(73);
- var hasOwn = __webpack_require__(14);
- var uid = __webpack_require__(92);
- var NATIVE_SYMBOL = __webpack_require__(57);
- var USE_SYMBOL_AS_UID = __webpack_require__(147);
- var WellKnownSymbolsStore = shared('wks');
- var Symbol = global.Symbol;
- var symbolFor = Symbol && Symbol['for'];
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
- module.exports = function (name) {
- if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
- var description = 'Symbol.' + name;
- if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {
- WellKnownSymbolsStore[name] = Symbol[name];
- } else if (USE_SYMBOL_AS_UID && symbolFor) {
- WellKnownSymbolsStore[name] = symbolFor(description);
- } else {
- WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
- }
- } return WellKnownSymbolsStore[name];
- };
- /***/ }),
- /* 10 */
- /***/ (function(module, exports) {
- module.exports = {};
- /***/ }),
- /* 11 */
- /***/ (function(module, exports, __webpack_require__) {
- var isCallable = __webpack_require__(7);
- module.exports = function (it) {
- return typeof it == 'object' ? it !== null : isCallable(it);
- };
- /***/ }),
- /* 12 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(252);
- /***/ }),
- /* 13 */
- /***/ (function(module, exports, __webpack_require__) {
- var NATIVE_BIND = __webpack_require__(70);
- var call = Function.prototype.call;
- module.exports = NATIVE_BIND ? call.bind(call) : function () {
- return call.apply(call, arguments);
- };
- /***/ }),
- /* 14 */
- /***/ (function(module, exports, __webpack_require__) {
- var uncurryThis = __webpack_require__(4);
- var toObject = __webpack_require__(34);
- var hasOwnProperty = uncurryThis({}.hasOwnProperty);
- // `HasOwnProperty` abstract operation
- // https://tc39.es/ecma262/#sec-hasownproperty
- // eslint-disable-next-line es-x/no-object-hasown -- safe
- module.exports = Object.hasOwn || function hasOwn(it, key) {
- return hasOwnProperty(toObject(it), key);
- };
- /***/ }),
- /* 15 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = keys;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(40);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__ = __webpack_require__(180);
- // Retrieve the names of an object's own properties.
- // Delegates to **ECMAScript 5**'s native `Object.keys`.
- function keys(obj) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return [];
- if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["m" /* nativeKeys */])(obj);
- var keys = [];
- for (var key in obj) if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, key)) keys.push(key);
- // Ahem, IE < 9.
- if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_3__collectNonEnumProps_js__["a" /* default */])(obj, keys);
- return keys;
- }
- /***/ }),
- /* 16 */
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__(3);
- // Detect IE8's incomplete defineProperty implementation
- module.exports = !fails(function () {
- // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
- });
- /***/ }),
- /* 17 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = tagTester;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
- // Internal function for creating a `toString`-based type tester.
- function tagTester(name) {
- var tag = '[object ' + name + ']';
- return function(obj) {
- return __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === tag;
- };
- }
- /***/ }),
- /* 18 */
- /***/ (function(module, exports, __webpack_require__) {
- var path = __webpack_require__(10);
- var global = __webpack_require__(6);
- var isCallable = __webpack_require__(7);
- var aFunction = function (variable) {
- return isCallable(variable) ? variable : undefined;
- };
- module.exports = function (namespace, method) {
- return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
- : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
- };
- /***/ }),
- /* 19 */
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__(11);
- var $String = String;
- var $TypeError = TypeError;
- // `Assert: Type(argument) is Object`
- module.exports = function (argument) {
- if (isObject(argument)) return argument;
- throw $TypeError($String(argument) + ' is not an object');
- };
- /***/ }),
- /* 20 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = cb;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(190);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__iteratee_js__ = __webpack_require__(191);
- // The function we call internally to generate a callback. It invokes
- // `_.iteratee` if overridden, otherwise `baseIteratee`.
- function cb(value, context, argCount) {
- 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);
- return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" /* default */])(value, context, argCount);
- }
- /***/ }),
- /* 21 */
- /***/ (function(module, exports, __webpack_require__) {
- var uncurryThis = __webpack_require__(4);
- module.exports = uncurryThis({}.isPrototypeOf);
- /***/ }),
- /* 22 */
- /***/ (function(module, exports, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__(16);
- var IE8_DOM_DEFINE = __webpack_require__(148);
- var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(150);
- var anObject = __webpack_require__(19);
- var toPropertyKey = __webpack_require__(88);
- var $TypeError = TypeError;
- // eslint-disable-next-line es-x/no-object-defineproperty -- safe
- var $defineProperty = Object.defineProperty;
- // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- var ENUMERABLE = 'enumerable';
- var CONFIGURABLE = 'configurable';
- var WRITABLE = 'writable';
- // `Object.defineProperty` method
- // https://tc39.es/ecma262/#sec-object.defineproperty
- exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
- anObject(O);
- P = toPropertyKey(P);
- anObject(Attributes);
- if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
- var current = $getOwnPropertyDescriptor(O, P);
- if (current && current[WRITABLE]) {
- O[P] = Attributes.value;
- Attributes = {
- configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
- enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
- writable: false
- };
- }
- } return $defineProperty(O, P, Attributes);
- } : $defineProperty : function defineProperty(O, P, Attributes) {
- anObject(O);
- P = toPropertyKey(P);
- anObject(Attributes);
- if (IE8_DOM_DEFINE) try {
- return $defineProperty(O, P, Attributes);
- } catch (error) { /* empty */ }
- if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');
- if ('value' in Attributes) O[P] = Attributes.value;
- return O;
- };
- /***/ }),
- /* 23 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = restArguments;
- // Some functions take a variable number of arguments, or a few expected
- // arguments at the beginning and then a variable number of values to operate
- // on. This helper accumulates all remaining arguments past the function’s
- // argument length (or an explicit `startIndex`), into an array that becomes
- // the last argument. Similar to ES6’s "rest parameter".
- function restArguments(func, startIndex) {
- startIndex = startIndex == null ? func.length - 1 : +startIndex;
- return function() {
- var length = Math.max(arguments.length - startIndex, 0),
- rest = Array(length),
- index = 0;
- for (; index < length; index++) {
- rest[index] = arguments[index + startIndex];
- }
- switch (startIndex) {
- case 0: return func.call(this, rest);
- case 1: return func.call(this, arguments[0], rest);
- case 2: return func.call(this, arguments[0], arguments[1], rest);
- }
- var args = Array(startIndex + 1);
- for (index = 0; index < startIndex; index++) {
- args[index] = arguments[index];
- }
- args[startIndex] = rest;
- return func.apply(this, args);
- };
- }
- /***/ }),
- /* 24 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = _;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
- // If Underscore is called as a function, it returns a wrapped object that can
- // be used OO-style. This wrapper holds altered versions of all functions added
- // through `_.mixin`. Wrapped objects may be chained.
- function _(obj) {
- if (obj instanceof _) return obj;
- if (!(this instanceof _)) return new _(obj);
- this._wrapped = obj;
- }
- _.VERSION = __WEBPACK_IMPORTED_MODULE_0__setup_js__["e" /* VERSION */];
- // Extracts the result from a wrapped and chained object.
- _.prototype.value = function() {
- return this._wrapped;
- };
- // Provide unwrapping proxies for some methods used in engine operations
- // such as arithmetic and JSON stringification.
- _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
- _.prototype.toString = function() {
- return String(this._wrapped);
- };
- /***/ }),
- /* 25 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(178);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
- // Internal helper for collection methods to determine whether a collection
- // should be iterated as an array or as an object.
- // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
- // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */]));
- /***/ }),
- /* 26 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _concat = _interopRequireDefault(__webpack_require__(30));
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _ = __webpack_require__(2);
- var md5 = __webpack_require__(502);
- var _require = __webpack_require__(2),
- extend = _require.extend;
- var AV = __webpack_require__(65);
- var AVError = __webpack_require__(43);
- var _require2 = __webpack_require__(29),
- getSessionToken = _require2.getSessionToken;
- var ajax = __webpack_require__(108); // 计算 X-LC-Sign 的签名方法
- var sign = function sign(key, isMasterKey) {
- var _context2;
- var now = new Date().getTime();
- var signature = md5(now + key);
- if (isMasterKey) {
- var _context;
- return (0, _concat.default)(_context = "".concat(signature, ",")).call(_context, now, ",master");
- }
- return (0, _concat.default)(_context2 = "".concat(signature, ",")).call(_context2, now);
- };
- var setAppKey = function setAppKey(headers, signKey) {
- if (signKey) {
- headers['X-LC-Sign'] = sign(AV.applicationKey);
- } else {
- headers['X-LC-Key'] = AV.applicationKey;
- }
- };
- var setHeaders = function setHeaders() {
- var authOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var signKey = arguments.length > 1 ? arguments[1] : undefined;
- var headers = {
- 'X-LC-Id': AV.applicationId,
- 'Content-Type': 'application/json;charset=UTF-8'
- };
- var useMasterKey = false;
- if (typeof authOptions.useMasterKey === 'boolean') {
- useMasterKey = authOptions.useMasterKey;
- } else if (typeof AV._config.useMasterKey === 'boolean') {
- useMasterKey = AV._config.useMasterKey;
- }
- if (useMasterKey) {
- if (AV.masterKey) {
- if (signKey) {
- headers['X-LC-Sign'] = sign(AV.masterKey, true);
- } else {
- headers['X-LC-Key'] = "".concat(AV.masterKey, ",master");
- }
- } else {
- console.warn('masterKey is not set, fall back to use appKey');
- setAppKey(headers, signKey);
- }
- } else {
- setAppKey(headers, signKey);
- }
- if (AV.hookKey) {
- headers['X-LC-Hook-Key'] = AV.hookKey;
- }
- if (AV._config.production !== null) {
- headers['X-LC-Prod'] = String(AV._config.production);
- }
- headers[ false ? 'User-Agent' : 'X-LC-UA'] = AV._sharedConfig.userAgent;
- return _promise.default.resolve().then(function () {
- // Pass the session token
- var sessionToken = getSessionToken(authOptions);
- if (sessionToken) {
- headers['X-LC-Session'] = sessionToken;
- } else if (!AV._config.disableCurrentUser) {
- return AV.User.currentAsync().then(function (currentUser) {
- if (currentUser && currentUser._sessionToken) {
- headers['X-LC-Session'] = currentUser._sessionToken;
- }
- return headers;
- });
- }
- return headers;
- });
- };
- var createApiUrl = function createApiUrl(_ref) {
- var _ref$service = _ref.service,
- service = _ref$service === void 0 ? 'api' : _ref$service,
- _ref$version = _ref.version,
- version = _ref$version === void 0 ? '1.1' : _ref$version,
- path = _ref.path;
- var apiURL = AV._config.serverURLs[service];
- if (!apiURL) throw new Error("undefined server URL for ".concat(service));
- if (apiURL.charAt(apiURL.length - 1) !== '/') {
- apiURL += '/';
- }
- apiURL += version;
- if (path) {
- apiURL += path;
- }
- return apiURL;
- };
- /**
- * Low level REST API client. Call REST endpoints with authorization headers.
- * @function AV.request
- * @since 3.0.0
- * @param {Object} options
- * @param {String} options.method HTTP method
- * @param {String} options.path endpoint path, e.g. `/classes/Test/55759577e4b029ae6015ac20`
- * @param {Object} [options.query] query string dict
- * @param {Object} [options.data] HTTP body
- * @param {AuthOptions} [options.authOptions]
- * @param {String} [options.service = 'api']
- * @param {String} [options.version = '1.1']
- */
- var request = function request(_ref2) {
- var service = _ref2.service,
- version = _ref2.version,
- method = _ref2.method,
- path = _ref2.path,
- query = _ref2.query,
- data = _ref2.data,
- authOptions = _ref2.authOptions,
- _ref2$signKey = _ref2.signKey,
- signKey = _ref2$signKey === void 0 ? true : _ref2$signKey;
- if (!(AV.applicationId && (AV.applicationKey || AV.masterKey))) {
- throw new Error('Not initialized');
- }
- if (AV._appRouter) {
- AV._appRouter.refresh();
- }
- var timeout = AV._config.requestTimeout;
- var url = createApiUrl({
- service: service,
- path: path,
- version: version
- });
- return setHeaders(authOptions, signKey).then(function (headers) {
- return ajax({
- method: method,
- url: url,
- query: query,
- data: data,
- headers: headers,
- timeout: timeout
- }).catch(function (error) {
- var errorJSON = {
- code: error.code || -1,
- error: error.message || error.responseText
- };
- if (error.response && error.response.code) {
- errorJSON = error.response;
- } else if (error.responseText) {
- try {
- errorJSON = JSON.parse(error.responseText);
- } catch (e) {// If we fail to parse the error text, that's okay.
- }
- }
- errorJSON.rawMessage = errorJSON.rawMessage || errorJSON.error;
- if (!AV._sharedConfig.keepErrorRawMessage) {
- var _context3, _context4;
- errorJSON.error += (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = " [".concat(error.statusCode || 'N/A', " ")).call(_context4, method, " ")).call(_context3, url, "]");
- } // Transform the error into an instance of AVError by trying to parse
- // the error string as JSON.
- var err = new AVError(errorJSON.code, errorJSON.error);
- delete errorJSON.error;
- throw _.extend(err, errorJSON);
- });
- });
- }; // lagecy request
- var _request = function _request(route, className, objectId, method, data, authOptions, query) {
- var path = '';
- if (route) path += "/".concat(route);
- if (className) path += "/".concat(className);
- if (objectId) path += "/".concat(objectId); // for migeration
- if (data && data._fetchWhenSave) throw new Error('_fetchWhenSave should be in the query');
- if (data && data._where) throw new Error('_where should be in the query');
- if (method && method.toLowerCase() === 'get') {
- query = extend({}, query, data);
- data = null;
- }
- return request({
- method: method,
- path: path,
- query: query,
- data: data,
- authOptions: authOptions
- });
- };
- AV.request = request;
- module.exports = {
- _request: _request,
- request: request
- };
- /***/ }),
- /* 27 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
- var isFunction = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Function');
- // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old
- // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).
- var nodelist = __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" /* root */].document && __WEBPACK_IMPORTED_MODULE_1__setup_js__["p" /* root */].document.childNodes;
- if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
- isFunction = function(obj) {
- return typeof obj == 'function' || false;
- };
- }
- /* harmony default export */ __webpack_exports__["a"] = (isFunction);
- /***/ }),
- /* 28 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(179);
- // Internal helper to obtain the `length` property of an object.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" /* default */])('length'));
- /***/ }),
- /* 29 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _keys = _interopRequireDefault(__webpack_require__(55));
- var _getPrototypeOf = _interopRequireDefault(__webpack_require__(142));
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _ = __webpack_require__(2); // Helper function to check null or undefined.
- var isNullOrUndefined = function isNullOrUndefined(x) {
- return _.isNull(x) || _.isUndefined(x);
- };
- var ensureArray = function ensureArray(target) {
- if (_.isArray(target)) {
- return target;
- }
- if (target === undefined || target === null) {
- return [];
- }
- return [target];
- };
- var transformFetchOptions = function transformFetchOptions() {
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- keys = (0, _keys.default)(_ref),
- include = _ref.include,
- includeACL = _ref.includeACL;
- var fetchOptions = {};
- if (keys) {
- fetchOptions.keys = ensureArray(keys).join(',');
- }
- if (include) {
- fetchOptions.include = ensureArray(include).join(',');
- }
- if (includeACL) {
- fetchOptions.returnACL = includeACL;
- }
- return fetchOptions;
- };
- var getSessionToken = function getSessionToken(authOptions) {
- if (authOptions.sessionToken) {
- return authOptions.sessionToken;
- }
- if (authOptions.user && typeof authOptions.user.getSessionToken === 'function') {
- return authOptions.user.getSessionToken();
- }
- };
- var tap = function tap(interceptor) {
- return function (value) {
- return interceptor(value), value;
- };
- }; // Shared empty constructor function to aid in prototype-chain creation.
- var EmptyConstructor = function EmptyConstructor() {}; // Helper function to correctly set up the prototype chain, for subclasses.
- // Similar to `goog.inherits`, but uses a hash of prototype properties and
- // class properties to be extended.
- var inherits = function inherits(parent, protoProps, staticProps) {
- var child; // The constructor function for the new subclass is either defined by you
- // (the "constructor" property in your `extend` definition), or defaulted
- // by us to simply call the parent's constructor.
- if (protoProps && protoProps.hasOwnProperty('constructor')) {
- child = protoProps.constructor;
- } else {
- /** @ignore */
- child = function child() {
- parent.apply(this, arguments);
- };
- } // Inherit class (static) properties from parent.
- _.extend(child, parent); // Set the prototype chain to inherit from `parent`, without calling
- // `parent`'s constructor function.
- EmptyConstructor.prototype = parent.prototype;
- child.prototype = new EmptyConstructor(); // Add prototype properties (instance properties) to the subclass,
- // if supplied.
- if (protoProps) {
- _.extend(child.prototype, protoProps);
- } // Add static properties to the constructor function, if supplied.
- if (staticProps) {
- _.extend(child, staticProps);
- } // Correctly set child's `prototype.constructor`.
- child.prototype.constructor = child; // Set a convenience property in case the parent's prototype is
- // needed later.
- child.__super__ = parent.prototype;
- return child;
- };
- var parseDate = function parseDate(iso8601) {
- return new Date(iso8601);
- };
- var setValue = function setValue(target, key, value) {
- // '.' is not allowed in Class keys, escaping is not in concern now.
- var segs = key.split('.');
- var lastSeg = segs.pop();
- var currentTarget = target;
- segs.forEach(function (seg) {
- if (currentTarget[seg] === undefined) currentTarget[seg] = {};
- currentTarget = currentTarget[seg];
- });
- currentTarget[lastSeg] = value;
- return target;
- };
- var findValue = function findValue(target, key) {
- var segs = key.split('.');
- var firstSeg = segs[0];
- var lastSeg = segs.pop();
- var currentTarget = target;
- for (var i = 0; i < segs.length; i++) {
- currentTarget = currentTarget[segs[i]];
- if (currentTarget === undefined) {
- return [undefined, undefined, lastSeg];
- }
- }
- var value = currentTarget[lastSeg];
- return [value, currentTarget, lastSeg, firstSeg];
- };
- var isPlainObject = function isPlainObject(obj) {
- return _.isObject(obj) && (0, _getPrototypeOf.default)(obj) === Object.prototype;
- };
- var continueWhile = function continueWhile(predicate, asyncFunction) {
- if (predicate()) {
- return asyncFunction().then(function () {
- return continueWhile(predicate, asyncFunction);
- });
- }
- return _promise.default.resolve();
- };
- module.exports = {
- isNullOrUndefined: isNullOrUndefined,
- ensureArray: ensureArray,
- transformFetchOptions: transformFetchOptions,
- getSessionToken: getSessionToken,
- tap: tap,
- inherits: inherits,
- parseDate: parseDate,
- setValue: setValue,
- findValue: findValue,
- isPlainObject: isPlainObject,
- continueWhile: continueWhile
- };
- /***/ }),
- /* 30 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(362);
- /***/ }),
- /* 31 */
- /***/ (function(module, exports, __webpack_require__) {
- var isCallable = __webpack_require__(7);
- var tryToString = __webpack_require__(72);
- var $TypeError = TypeError;
- // `Assert: IsCallable(argument) is true`
- module.exports = function (argument) {
- if (isCallable(argument)) return argument;
- throw $TypeError(tryToString(argument) + ' is not a function');
- };
- /***/ }),
- /* 32 */
- /***/ (function(module, exports) {
- module.exports = true;
- /***/ }),
- /* 33 */
- /***/ (function(module, exports, __webpack_require__) {
- // toObject with fallback for non-array-like ES3 strings
- var IndexedObject = __webpack_require__(114);
- var requireObjectCoercible = __webpack_require__(115);
- module.exports = function (it) {
- return IndexedObject(requireObjectCoercible(it));
- };
- /***/ }),
- /* 34 */
- /***/ (function(module, exports, __webpack_require__) {
- var requireObjectCoercible = __webpack_require__(115);
- var $Object = Object;
- // `ToObject` abstract operation
- // https://tc39.es/ecma262/#sec-toobject
- module.exports = function (argument) {
- return $Object(requireObjectCoercible(argument));
- };
- /***/ }),
- /* 35 */
- /***/ (function(module, exports, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__(16);
- var definePropertyModule = __webpack_require__(22);
- var createPropertyDescriptor = __webpack_require__(44);
- module.exports = DESCRIPTORS ? function (object, key, value) {
- return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
- } : function (object, key, value) {
- object[key] = value;
- return object;
- };
- /***/ }),
- /* 36 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(374);
- /***/ }),
- /* 37 */
- /***/ (function(module, exports, __webpack_require__) {
- var bind = __webpack_require__(45);
- var call = __webpack_require__(13);
- var anObject = __webpack_require__(19);
- var tryToString = __webpack_require__(72);
- var isArrayIteratorMethod = __webpack_require__(156);
- var lengthOfArrayLike = __webpack_require__(46);
- var isPrototypeOf = __webpack_require__(21);
- var getIterator = __webpack_require__(157);
- var getIteratorMethod = __webpack_require__(99);
- var iteratorClose = __webpack_require__(158);
- var $TypeError = TypeError;
- var Result = function (stopped, result) {
- this.stopped = stopped;
- this.result = result;
- };
- var ResultPrototype = Result.prototype;
- module.exports = function (iterable, unboundFunction, options) {
- var that = options && options.that;
- var AS_ENTRIES = !!(options && options.AS_ENTRIES);
- var IS_ITERATOR = !!(options && options.IS_ITERATOR);
- var INTERRUPTED = !!(options && options.INTERRUPTED);
- var fn = bind(unboundFunction, that);
- var iterator, iterFn, index, length, result, next, step;
- var stop = function (condition) {
- if (iterator) iteratorClose(iterator, 'normal', condition);
- return new Result(true, condition);
- };
- var callFn = function (value) {
- if (AS_ENTRIES) {
- anObject(value);
- return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
- } return INTERRUPTED ? fn(value, stop) : fn(value);
- };
- if (IS_ITERATOR) {
- iterator = iterable;
- } else {
- iterFn = getIteratorMethod(iterable);
- if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
- // optimisation for array iterators
- if (isArrayIteratorMethod(iterFn)) {
- for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
- result = callFn(iterable[index]);
- if (result && isPrototypeOf(ResultPrototype, result)) return result;
- } return new Result(false);
- }
- iterator = getIterator(iterable, iterFn);
- }
- next = iterator.next;
- while (!(step = call(next, iterator)).done) {
- try {
- result = callFn(step.value);
- } catch (error) {
- iteratorClose(iterator, 'throw', error);
- }
- if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
- } return new Result(false);
- };
- /***/ }),
- /* 38 */
- /***/ (function(module, exports, __webpack_require__) {
- var NATIVE_WEAK_MAP = __webpack_require__(160);
- var global = __webpack_require__(6);
- var uncurryThis = __webpack_require__(4);
- var isObject = __webpack_require__(11);
- var createNonEnumerableProperty = __webpack_require__(35);
- var hasOwn = __webpack_require__(14);
- var shared = __webpack_require__(117);
- var sharedKey = __webpack_require__(94);
- var hiddenKeys = __webpack_require__(74);
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
- var TypeError = global.TypeError;
- var WeakMap = global.WeakMap;
- var set, get, has;
- var enforce = function (it) {
- return has(it) ? get(it) : set(it, {});
- };
- var getterFor = function (TYPE) {
- return function (it) {
- var state;
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
- throw TypeError('Incompatible receiver, ' + TYPE + ' required');
- } return state;
- };
- };
- if (NATIVE_WEAK_MAP || shared.state) {
- var store = shared.state || (shared.state = new WeakMap());
- var wmget = uncurryThis(store.get);
- var wmhas = uncurryThis(store.has);
- var wmset = uncurryThis(store.set);
- set = function (it, metadata) {
- if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
- metadata.facade = it;
- wmset(store, it, metadata);
- return metadata;
- };
- get = function (it) {
- return wmget(store, it) || {};
- };
- has = function (it) {
- return wmhas(store, it);
- };
- } else {
- var STATE = sharedKey('state');
- hiddenKeys[STATE] = true;
- set = function (it, metadata) {
- if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
- metadata.facade = it;
- createNonEnumerableProperty(it, STATE, metadata);
- return metadata;
- };
- get = function (it) {
- return hasOwn(it, STATE) ? it[STATE] : {};
- };
- has = function (it) {
- return hasOwn(it, STATE);
- };
- }
- module.exports = {
- set: set,
- get: get,
- has: has,
- enforce: enforce,
- getterFor: getterFor
- };
- /***/ }),
- /* 39 */
- /***/ (function(module, exports, __webpack_require__) {
- var createNonEnumerableProperty = __webpack_require__(35);
- module.exports = function (target, key, value, options) {
- if (options && options.enumerable) target[key] = value;
- else createNonEnumerableProperty(target, key, value);
- return target;
- };
- /***/ }),
- /* 40 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = has;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
- // Internal function to check whether `key` is an own property name of `obj`.
- function has(obj, key) {
- return obj != null && __WEBPACK_IMPORTED_MODULE_0__setup_js__["i" /* hasOwnProperty */].call(obj, key);
- }
- /***/ }),
- /* 41 */
- /***/ (function(module, exports, __webpack_require__) {
- var path = __webpack_require__(10);
- module.exports = function (CONSTRUCTOR) {
- return path[CONSTRUCTOR + 'Prototype'];
- };
- /***/ }),
- /* 42 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(367);
- /***/ }),
- /* 43 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _setPrototypeOf = _interopRequireDefault(__webpack_require__(227));
- var _getPrototypeOf = _interopRequireDefault(__webpack_require__(142));
- var _ = __webpack_require__(2);
- /**
- * @class AV.Error
- */
- function AVError(code, message) {
- if (this instanceof AVError ? this.constructor : void 0) {
- var error = new Error(message);
- (0, _setPrototypeOf.default)(error, (0, _getPrototypeOf.default)(this));
- error.code = code;
- return error;
- }
- return new AVError(code, message);
- }
- AVError.prototype = Object.create(Error.prototype, {
- constructor: {
- value: Error,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- (0, _setPrototypeOf.default)(AVError, Error);
- _.extend(AVError,
- /** @lends AV.Error */
- {
- /**
- * Error code indicating some error other than those enumerated here.
- * @constant
- */
- OTHER_CAUSE: -1,
- /**
- * Error code indicating that something has gone wrong with the server.
- * If you get this error code, it is AV's fault.
- * @constant
- */
- INTERNAL_SERVER_ERROR: 1,
- /**
- * Error code indicating the connection to the AV servers failed.
- * @constant
- */
- CONNECTION_FAILED: 100,
- /**
- * Error code indicating the specified object doesn't exist.
- * @constant
- */
- OBJECT_NOT_FOUND: 101,
- /**
- * Error code indicating you tried to query with a datatype that doesn't
- * support it, like exact matching an array or object.
- * @constant
- */
- INVALID_QUERY: 102,
- /**
- * Error code indicating a missing or invalid classname. Classnames are
- * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the
- * only valid characters.
- * @constant
- */
- INVALID_CLASS_NAME: 103,
- /**
- * Error code indicating an unspecified object id.
- * @constant
- */
- MISSING_OBJECT_ID: 104,
- /**
- * Error code indicating an invalid key name. Keys are case-sensitive. They
- * must start with a letter, and a-zA-Z0-9_ are the only valid characters.
- * @constant
- */
- INVALID_KEY_NAME: 105,
- /**
- * Error code indicating a malformed pointer. You should not see this unless
- * you have been mucking about changing internal AV code.
- * @constant
- */
- INVALID_POINTER: 106,
- /**
- * Error code indicating that badly formed JSON was received upstream. This
- * either indicates you have done something unusual with modifying how
- * things encode to JSON, or the network is failing badly.
- * @constant
- */
- INVALID_JSON: 107,
- /**
- * Error code indicating that the feature you tried to access is only
- * available internally for testing purposes.
- * @constant
- */
- COMMAND_UNAVAILABLE: 108,
- /**
- * You must call AV.initialize before using the AV library.
- * @constant
- */
- NOT_INITIALIZED: 109,
- /**
- * Error code indicating that a field was set to an inconsistent type.
- * @constant
- */
- INCORRECT_TYPE: 111,
- /**
- * Error code indicating an invalid channel name. A channel name is either
- * an empty string (the broadcast channel) or contains only a-zA-Z0-9_
- * characters.
- * @constant
- */
- INVALID_CHANNEL_NAME: 112,
- /**
- * Error code indicating that push is misconfigured.
- * @constant
- */
- PUSH_MISCONFIGURED: 115,
- /**
- * Error code indicating that the object is too large.
- * @constant
- */
- OBJECT_TOO_LARGE: 116,
- /**
- * Error code indicating that the operation isn't allowed for clients.
- * @constant
- */
- OPERATION_FORBIDDEN: 119,
- /**
- * Error code indicating the result was not found in the cache.
- * @constant
- */
- CACHE_MISS: 120,
- /**
- * Error code indicating that an invalid key was used in a nested
- * JSONObject.
- * @constant
- */
- INVALID_NESTED_KEY: 121,
- /**
- * Error code indicating that an invalid filename was used for AVFile.
- * A valid file name contains only a-zA-Z0-9_. characters and is between 1
- * and 128 characters.
- * @constant
- */
- INVALID_FILE_NAME: 122,
- /**
- * Error code indicating an invalid ACL was provided.
- * @constant
- */
- INVALID_ACL: 123,
- /**
- * Error code indicating that the request timed out on the server. Typically
- * this indicates that the request is too expensive to run.
- * @constant
- */
- TIMEOUT: 124,
- /**
- * Error code indicating that the email address was invalid.
- * @constant
- */
- INVALID_EMAIL_ADDRESS: 125,
- /**
- * Error code indicating a missing content type.
- * @constant
- */
- MISSING_CONTENT_TYPE: 126,
- /**
- * Error code indicating a missing content length.
- * @constant
- */
- MISSING_CONTENT_LENGTH: 127,
- /**
- * Error code indicating an invalid content length.
- * @constant
- */
- INVALID_CONTENT_LENGTH: 128,
- /**
- * Error code indicating a file that was too large.
- * @constant
- */
- FILE_TOO_LARGE: 129,
- /**
- * Error code indicating an error saving a file.
- * @constant
- */
- FILE_SAVE_ERROR: 130,
- /**
- * Error code indicating an error deleting a file.
- * @constant
- */
- FILE_DELETE_ERROR: 153,
- /**
- * Error code indicating that a unique field was given a value that is
- * already taken.
- * @constant
- */
- DUPLICATE_VALUE: 137,
- /**
- * Error code indicating that a role's name is invalid.
- * @constant
- */
- INVALID_ROLE_NAME: 139,
- /**
- * Error code indicating that an application quota was exceeded. Upgrade to
- * resolve.
- * @constant
- */
- EXCEEDED_QUOTA: 140,
- /**
- * Error code indicating that a Cloud Code script failed.
- * @constant
- */
- SCRIPT_FAILED: 141,
- /**
- * Error code indicating that a Cloud Code validation failed.
- * @constant
- */
- VALIDATION_ERROR: 142,
- /**
- * Error code indicating that invalid image data was provided.
- * @constant
- */
- INVALID_IMAGE_DATA: 150,
- /**
- * Error code indicating an unsaved file.
- * @constant
- */
- UNSAVED_FILE_ERROR: 151,
- /**
- * Error code indicating an invalid push time.
- * @constant
- */
- INVALID_PUSH_TIME_ERROR: 152,
- /**
- * Error code indicating that the username is missing or empty.
- * @constant
- */
- USERNAME_MISSING: 200,
- /**
- * Error code indicating that the password is missing or empty.
- * @constant
- */
- PASSWORD_MISSING: 201,
- /**
- * Error code indicating that the username has already been taken.
- * @constant
- */
- USERNAME_TAKEN: 202,
- /**
- * Error code indicating that the email has already been taken.
- * @constant
- */
- EMAIL_TAKEN: 203,
- /**
- * Error code indicating that the email is missing, but must be specified.
- * @constant
- */
- EMAIL_MISSING: 204,
- /**
- * Error code indicating that a user with the specified email was not found.
- * @constant
- */
- EMAIL_NOT_FOUND: 205,
- /**
- * Error code indicating that a user object without a valid session could
- * not be altered.
- * @constant
- */
- SESSION_MISSING: 206,
- /**
- * Error code indicating that a user can only be created through signup.
- * @constant
- */
- MUST_CREATE_USER_THROUGH_SIGNUP: 207,
- /**
- * Error code indicating that an an account being linked is already linked
- * to another user.
- * @constant
- */
- ACCOUNT_ALREADY_LINKED: 208,
- /**
- * Error code indicating that a user cannot be linked to an account because
- * that account's id could not be found.
- * @constant
- */
- LINKED_ID_MISSING: 250,
- /**
- * Error code indicating that a user with a linked (e.g. Facebook) account
- * has an invalid session.
- * @constant
- */
- INVALID_LINKED_SESSION: 251,
- /**
- * Error code indicating that a service being linked (e.g. Facebook or
- * Twitter) is unsupported.
- * @constant
- */
- UNSUPPORTED_SERVICE: 252,
- /**
- * Error code indicating a real error code is unavailable because
- * we had to use an XDomainRequest object to allow CORS requests in
- * Internet Explorer, which strips the body from HTTP responses that have
- * a non-2XX status code.
- * @constant
- */
- X_DOMAIN_REQUEST: 602
- });
- module.exports = AVError;
- /***/ }),
- /* 44 */
- /***/ (function(module, exports) {
- module.exports = function (bitmap, value) {
- return {
- enumerable: !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable: !(bitmap & 4),
- value: value
- };
- };
- /***/ }),
- /* 45 */
- /***/ (function(module, exports, __webpack_require__) {
- var uncurryThis = __webpack_require__(4);
- var aCallable = __webpack_require__(31);
- var NATIVE_BIND = __webpack_require__(70);
- var bind = uncurryThis(uncurryThis.bind);
- // optional / simple context binding
- module.exports = function (fn, that) {
- aCallable(fn);
- return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {
- return fn.apply(that, arguments);
- };
- };
- /***/ }),
- /* 46 */
- /***/ (function(module, exports, __webpack_require__) {
- var toLength = __webpack_require__(263);
- // `LengthOfArrayLike` abstract operation
- // https://tc39.es/ecma262/#sec-lengthofarraylike
- module.exports = function (obj) {
- return toLength(obj.length);
- };
- /***/ }),
- /* 47 */
- /***/ (function(module, exports, __webpack_require__) {
- /* global ActiveXObject -- old IE, WSH */
- var anObject = __webpack_require__(19);
- var definePropertiesModule = __webpack_require__(154);
- var enumBugKeys = __webpack_require__(121);
- var hiddenKeys = __webpack_require__(74);
- var html = __webpack_require__(155);
- var documentCreateElement = __webpack_require__(118);
- var sharedKey = __webpack_require__(94);
- var GT = '>';
- var LT = '<';
- var PROTOTYPE = 'prototype';
- var SCRIPT = 'script';
- var IE_PROTO = sharedKey('IE_PROTO');
- var EmptyConstructor = function () { /* empty */ };
- var scriptTag = function (content) {
- return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
- };
- // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
- var NullProtoObjectViaActiveX = function (activeXDocument) {
- activeXDocument.write(scriptTag(''));
- activeXDocument.close();
- var temp = activeXDocument.parentWindow.Object;
- activeXDocument = null; // avoid memory leak
- return temp;
- };
- // Create object with fake `null` prototype: use iframe Object with cleared prototype
- var NullProtoObjectViaIFrame = function () {
- // Thrash, waste and sodomy: IE GC bug
- var iframe = documentCreateElement('iframe');
- var JS = 'java' + SCRIPT + ':';
- var iframeDocument;
- iframe.style.display = 'none';
- html.appendChild(iframe);
- // https://github.com/zloirock/core-js/issues/475
- iframe.src = String(JS);
- iframeDocument = iframe.contentWindow.document;
- iframeDocument.open();
- iframeDocument.write(scriptTag('document.F=Object'));
- iframeDocument.close();
- return iframeDocument.F;
- };
- // Check for document.domain and active x support
- // No need to use active x approach when document.domain is not set
- // see https://github.com/es-shims/es5-shim/issues/150
- // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
- // avoid IE GC bug
- var activeXDocument;
- var NullProtoObject = function () {
- try {
- activeXDocument = new ActiveXObject('htmlfile');
- } catch (error) { /* ignore */ }
- NullProtoObject = typeof document != 'undefined'
- ? document.domain && activeXDocument
- ? NullProtoObjectViaActiveX(activeXDocument) // old IE
- : NullProtoObjectViaIFrame()
- : NullProtoObjectViaActiveX(activeXDocument); // WSH
- var length = enumBugKeys.length;
- while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
- return NullProtoObject();
- };
- hiddenKeys[IE_PROTO] = true;
- // `Object.create` method
- // https://tc39.es/ecma262/#sec-object.create
- // eslint-disable-next-line es-x/no-object-create -- safe
- module.exports = Object.create || function create(O, Properties) {
- var result;
- if (O !== null) {
- EmptyConstructor[PROTOTYPE] = anObject(O);
- result = new EmptyConstructor();
- EmptyConstructor[PROTOTYPE] = null;
- // add "__proto__" for Object.getPrototypeOf polyfill
- result[IE_PROTO] = O;
- } else result = NullProtoObject();
- return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
- };
- /***/ }),
- /* 48 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var toIndexedObject = __webpack_require__(33);
- var addToUnscopables = __webpack_require__(159);
- var Iterators = __webpack_require__(58);
- var InternalStateModule = __webpack_require__(38);
- var defineProperty = __webpack_require__(22).f;
- var defineIterator = __webpack_require__(124);
- var IS_PURE = __webpack_require__(32);
- var DESCRIPTORS = __webpack_require__(16);
- var ARRAY_ITERATOR = 'Array Iterator';
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
- // `Array.prototype.entries` method
- // https://tc39.es/ecma262/#sec-array.prototype.entries
- // `Array.prototype.keys` method
- // https://tc39.es/ecma262/#sec-array.prototype.keys
- // `Array.prototype.values` method
- // https://tc39.es/ecma262/#sec-array.prototype.values
- // `Array.prototype[@@iterator]` method
- // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
- // `CreateArrayIterator` internal method
- // https://tc39.es/ecma262/#sec-createarrayiterator
- module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
- setInternalState(this, {
- type: ARRAY_ITERATOR,
- target: toIndexedObject(iterated), // target
- index: 0, // next index
- kind: kind // kind
- });
- // `%ArrayIteratorPrototype%.next` method
- // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
- }, function () {
- var state = getInternalState(this);
- var target = state.target;
- var kind = state.kind;
- var index = state.index++;
- if (!target || index >= target.length) {
- state.target = undefined;
- return { value: undefined, done: true };
- }
- if (kind == 'keys') return { value: index, done: false };
- if (kind == 'values') return { value: target[index], done: false };
- return { value: [index, target[index]], done: false };
- }, 'values');
- // argumentsList[@@iterator] is %ArrayProto_values%
- // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
- // https://tc39.es/ecma262/#sec-createmappedargumentsobject
- var values = Iterators.Arguments = Iterators.Array;
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
- addToUnscopables('keys');
- addToUnscopables('values');
- addToUnscopables('entries');
- // V8 ~ Chrome 45- bug
- if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {
- defineProperty(values, 'name', { value: 'values' });
- } catch (error) { /* empty */ }
- /***/ }),
- /* 49 */
- /***/ (function(module, exports, __webpack_require__) {
- var TO_STRING_TAG_SUPPORT = __webpack_require__(122);
- var defineProperty = __webpack_require__(22).f;
- var createNonEnumerableProperty = __webpack_require__(35);
- var hasOwn = __webpack_require__(14);
- var toString = __webpack_require__(270);
- var wellKnownSymbol = __webpack_require__(9);
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- module.exports = function (it, TAG, STATIC, SET_METHOD) {
- if (it) {
- var target = STATIC ? it : it.prototype;
- if (!hasOwn(target, TO_STRING_TAG)) {
- defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
- }
- if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
- createNonEnumerableProperty(target, 'toString', toString);
- }
- }
- };
- /***/ }),
- /* 50 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var aCallable = __webpack_require__(31);
- var PromiseCapability = function (C) {
- var resolve, reject;
- this.promise = new C(function ($$resolve, $$reject) {
- if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
- resolve = $$resolve;
- reject = $$reject;
- });
- this.resolve = aCallable(resolve);
- this.reject = aCallable(reject);
- };
- // `NewPromiseCapability` abstract operation
- // https://tc39.es/ecma262/#sec-newpromisecapability
- module.exports.f = function (C) {
- return new PromiseCapability(C);
- };
- /***/ }),
- /* 51 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(48);
- var DOMIterables = __webpack_require__(289);
- var global = __webpack_require__(6);
- var classof = __webpack_require__(59);
- var createNonEnumerableProperty = __webpack_require__(35);
- var Iterators = __webpack_require__(58);
- var wellKnownSymbol = __webpack_require__(9);
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- for (var COLLECTION_NAME in DOMIterables) {
- var Collection = global[COLLECTION_NAME];
- var CollectionPrototype = Collection && Collection.prototype;
- if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {
- createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
- }
- Iterators[COLLECTION_NAME] = Iterators.Array;
- }
- /***/ }),
- /* 52 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = isObject;
- // Is a given variable an object?
- function isObject(obj) {
- var type = typeof obj;
- return type === 'function' || type === 'object' && !!obj;
- }
- /***/ }),
- /* 53 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tagTester_js__ = __webpack_require__(17);
- // Is a given value an array?
- // Delegates to ECMA5's native `Array.isArray`.
- /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__setup_js__["k" /* nativeIsArray */] || Object(__WEBPACK_IMPORTED_MODULE_1__tagTester_js__["a" /* default */])('Array'));
- /***/ }),
- /* 54 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = each;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(82);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
- // The cornerstone for collection functions, an `each`
- // implementation, aka `forEach`.
- // Handles raw objects in addition to array-likes. Treats all
- // sparse array-likes as if they were dense.
- function each(obj, iteratee, context) {
- iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" /* default */])(iteratee, context);
- var i, length;
- if (Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj)) {
- for (i = 0, length = obj.length; i < length; i++) {
- iteratee(obj[i], i, obj);
- }
- } else {
- var _keys = Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj);
- for (i = 0, length = _keys.length; i < length; i++) {
- iteratee(obj[_keys[i]], _keys[i], obj);
- }
- }
- return obj;
- }
- /***/ }),
- /* 55 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(381);
- /***/ }),
- /* 56 */
- /***/ (function(module, exports, __webpack_require__) {
- var uncurryThis = __webpack_require__(4);
- var toString = uncurryThis({}.toString);
- var stringSlice = uncurryThis(''.slice);
- module.exports = function (it) {
- return stringSlice(toString(it), 8, -1);
- };
- /***/ }),
- /* 57 */
- /***/ (function(module, exports, __webpack_require__) {
- /* eslint-disable es-x/no-symbol -- required for testing */
- var V8_VERSION = __webpack_require__(90);
- var fails = __webpack_require__(3);
- // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
- module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
- var symbol = Symbol();
- // Chrome 38 Symbol has incorrect toString conversion
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
- return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
- });
- /***/ }),
- /* 58 */
- /***/ (function(module, exports) {
- module.exports = {};
- /***/ }),
- /* 59 */
- /***/ (function(module, exports, __webpack_require__) {
- var TO_STRING_TAG_SUPPORT = __webpack_require__(122);
- var isCallable = __webpack_require__(7);
- var classofRaw = __webpack_require__(56);
- var wellKnownSymbol = __webpack_require__(9);
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- var $Object = Object;
- // ES3 wrong here
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
- // fallback for IE11 Script Access Denied error
- var tryGet = function (it, key) {
- try {
- return it[key];
- } catch (error) { /* empty */ }
- };
- // getting tag from ES6+ `Object.prototype.toString`
- module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
- var O, tag, result;
- return it === undefined ? 'Undefined' : it === null ? 'Null'
- // @@toStringTag case
- : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
- // builtinTag case
- : CORRECT_ARGUMENTS ? classofRaw(O)
- // ES3 arguments fallback
- : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
- };
- /***/ }),
- /* 60 */
- /***/ (function(module, exports) {
- // empty
- /***/ }),
- /* 61 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(6);
- module.exports = global.Promise;
- /***/ }),
- /* 62 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = values;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
- // Retrieve the values of an object's properties.
- function values(obj) {
- var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
- var length = _keys.length;
- var values = Array(length);
- for (var i = 0; i < length; i++) {
- values[i] = obj[_keys[i]];
- }
- return values;
- }
- /***/ }),
- /* 63 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = flatten;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArray_js__ = __webpack_require__(53);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(129);
- // Internal implementation of a recursive `flatten` function.
- function flatten(input, depth, strict, output) {
- output = output || [];
- if (!depth && depth !== 0) {
- depth = Infinity;
- } else if (depth <= 0) {
- return output.concat(input);
- }
- var idx = output.length;
- for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(input); i < length; i++) {
- var value = input[i];
- 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))) {
- // Flatten current level of array or arguments object.
- if (depth > 1) {
- flatten(value, depth - 1, strict, output);
- idx = output.length;
- } else {
- var j = 0, len = value.length;
- while (j < len) output[idx++] = value[j++];
- }
- } else if (!strict) {
- output[idx++] = value;
- }
- }
- return output;
- }
- /***/ }),
- /* 64 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = map;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
- // Return the results of applying the iteratee to each element.
- function map(obj, iteratee, context) {
- iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
- var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
- length = (_keys || obj).length,
- results = Array(length);
- for (var index = 0; index < length; index++) {
- var currentKey = _keys ? _keys[index] : index;
- results[index] = iteratee(obj[currentKey], currentKey, obj);
- }
- return results;
- }
- /***/ }),
- /* 65 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {
- var _interopRequireDefault = __webpack_require__(1);
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _concat = _interopRequireDefault(__webpack_require__(30));
- var _map = _interopRequireDefault(__webpack_require__(42));
- var _keys = _interopRequireDefault(__webpack_require__(141));
- var _stringify = _interopRequireDefault(__webpack_require__(36));
- var _indexOf = _interopRequireDefault(__webpack_require__(86));
- var _keys2 = _interopRequireDefault(__webpack_require__(55));
- var _ = __webpack_require__(2);
- var uuid = __webpack_require__(221);
- var debug = __webpack_require__(67);
- var _require = __webpack_require__(29),
- inherits = _require.inherits,
- parseDate = _require.parseDate;
- var version = __webpack_require__(223);
- var _require2 = __webpack_require__(68),
- setAdapters = _require2.setAdapters,
- adapterManager = _require2.adapterManager;
- var AV = global.AV || {}; // All internal configuration items
- AV._config = {
- serverURLs: {},
- useMasterKey: false,
- production: null,
- realtime: null,
- requestTimeout: null
- };
- var initialUserAgent = "LeanCloud-JS-SDK/".concat(version); // configs shared by all AV instances
- AV._sharedConfig = {
- userAgent: initialUserAgent,
- liveQueryRealtime: null
- };
- adapterManager.on('platformInfo', function (platformInfo) {
- var ua = initialUserAgent;
- if (platformInfo) {
- if (platformInfo.userAgent) {
- ua = platformInfo.userAgent;
- } else {
- var comments = platformInfo.name;
- if (platformInfo.version) {
- comments += "/".concat(platformInfo.version);
- }
- if (platformInfo.extra) {
- comments += "; ".concat(platformInfo.extra);
- }
- ua += " (".concat(comments, ")");
- }
- }
- AV._sharedConfig.userAgent = ua;
- });
- /**
- * Contains all AV API classes and functions.
- * @namespace AV
- */
- /**
- * Returns prefix for localStorage keys used by this instance of AV.
- * @param {String} path The relative suffix to append to it.
- * null or undefined is treated as the empty string.
- * @return {String} The full key name.
- * @private
- */
- AV._getAVPath = function (path) {
- if (!AV.applicationId) {
- throw new Error('You need to call AV.initialize before using AV.');
- }
- if (!path) {
- path = '';
- }
- if (!_.isString(path)) {
- throw new Error("Tried to get a localStorage path that wasn't a String.");
- }
- if (path[0] === '/') {
- path = path.substring(1);
- }
- return 'AV/' + AV.applicationId + '/' + path;
- };
- /**
- * Returns the unique string for this app on this machine.
- * Gets reset when localStorage is cleared.
- * @private
- */
- AV._installationId = null;
- AV._getInstallationId = function () {
- // See if it's cached in RAM.
- if (AV._installationId) {
- return _promise.default.resolve(AV._installationId);
- } // Try to get it from localStorage.
- var path = AV._getAVPath('installationId');
- return AV.localStorage.getItemAsync(path).then(function (_installationId) {
- AV._installationId = _installationId;
- if (!AV._installationId) {
- // It wasn't in localStorage, so create a new one.
- AV._installationId = _installationId = uuid();
- return AV.localStorage.setItemAsync(path, _installationId).then(function () {
- return _installationId;
- });
- }
- return _installationId;
- });
- };
- AV._subscriptionId = null;
- AV._refreshSubscriptionId = function () {
- var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : AV._getAVPath('subscriptionId');
- var subscriptionId = AV._subscriptionId = uuid();
- return AV.localStorage.setItemAsync(path, subscriptionId).then(function () {
- return subscriptionId;
- });
- };
- AV._getSubscriptionId = function () {
- // See if it's cached in RAM.
- if (AV._subscriptionId) {
- return _promise.default.resolve(AV._subscriptionId);
- } // Try to get it from localStorage.
- var path = AV._getAVPath('subscriptionId');
- return AV.localStorage.getItemAsync(path).then(function (_subscriptionId) {
- AV._subscriptionId = _subscriptionId;
- if (!AV._subscriptionId) {
- // It wasn't in localStorage, so create a new one.
- _subscriptionId = AV._refreshSubscriptionId(path);
- }
- return _subscriptionId;
- });
- };
- AV._parseDate = parseDate; // A self-propagating extend function.
- AV._extend = function (protoProps, classProps) {
- var child = inherits(this, protoProps, classProps);
- child.extend = this.extend;
- return child;
- };
- /**
- * Converts a value in a AV Object into the appropriate representation.
- * This is the JS equivalent of Java's AV.maybeReferenceAndEncode(Object)
- * if seenObjects is falsey. Otherwise any AV.Objects not in
- * seenObjects will be fully embedded rather than encoded
- * as a pointer. This array will be used to prevent going into an infinite
- * loop because we have circular references. If <seenObjects>
- * is set, then none of the AV Objects that are serialized can be dirty.
- * @private
- */
- AV._encode = function (value, seenObjects, disallowObjects) {
- var full = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
- if (value instanceof AV.Object) {
- if (disallowObjects) {
- throw new Error('AV.Objects not allowed here');
- }
- if (!seenObjects || _.include(seenObjects, value) || !value._hasData) {
- return value._toPointer();
- }
- return value._toFullJSON((0, _concat.default)(seenObjects).call(seenObjects, value), full);
- }
- if (value instanceof AV.ACL) {
- return value.toJSON();
- }
- if (_.isDate(value)) {
- return full ? {
- __type: 'Date',
- iso: value.toJSON()
- } : value.toJSON();
- }
- if (value instanceof AV.GeoPoint) {
- return value.toJSON();
- }
- if (_.isArray(value)) {
- return (0, _map.default)(_).call(_, value, function (x) {
- return AV._encode(x, seenObjects, disallowObjects, full);
- });
- }
- if (_.isRegExp(value)) {
- return value.source;
- }
- if (value instanceof AV.Relation) {
- return value.toJSON();
- }
- if (value instanceof AV.Op) {
- return value.toJSON();
- }
- if (value instanceof AV.File) {
- if (!value.url() && !value.id) {
- throw new Error('Tried to save an object containing an unsaved file.');
- }
- return value._toFullJSON(seenObjects, full);
- }
- if (_.isObject(value)) {
- return _.mapObject(value, function (v, k) {
- return AV._encode(v, seenObjects, disallowObjects, full);
- });
- }
- return value;
- };
- /**
- * The inverse function of AV._encode.
- * @private
- */
- AV._decode = function (value, key) {
- if (!_.isObject(value) || _.isDate(value)) {
- return value;
- }
- if (_.isArray(value)) {
- return (0, _map.default)(_).call(_, value, function (v) {
- return AV._decode(v);
- });
- }
- if (value instanceof AV.Object) {
- return value;
- }
- if (value instanceof AV.File) {
- return value;
- }
- if (value instanceof AV.Op) {
- return value;
- }
- if (value instanceof AV.GeoPoint) {
- return value;
- }
- if (value instanceof AV.ACL) {
- return value;
- }
- if (key === 'ACL') {
- return new AV.ACL(value);
- }
- if (value.__op) {
- return AV.Op._decode(value);
- }
- var className;
- if (value.__type === 'Pointer') {
- className = value.className;
- var pointer = AV.Object._create(className);
- if ((0, _keys.default)(value).length > 3) {
- var v = _.clone(value);
- delete v.__type;
- delete v.className;
- pointer._finishFetch(v, true);
- } else {
- pointer._finishFetch({
- objectId: value.objectId
- }, false);
- }
- return pointer;
- }
- if (value.__type === 'Object') {
- // It's an Object included in a query result.
- className = value.className;
- var _v = _.clone(value);
- delete _v.__type;
- delete _v.className;
- var object = AV.Object._create(className);
- object._finishFetch(_v, true);
- return object;
- }
- if (value.__type === 'Date') {
- return AV._parseDate(value.iso);
- }
- if (value.__type === 'GeoPoint') {
- return new AV.GeoPoint({
- latitude: value.latitude,
- longitude: value.longitude
- });
- }
- if (value.__type === 'Relation') {
- if (!key) throw new Error('key missing decoding a Relation');
- var relation = new AV.Relation(null, key);
- relation.targetClassName = value.className;
- return relation;
- }
- if (value.__type === 'File') {
- var file = new AV.File(value.name);
- var _v2 = _.clone(value);
- delete _v2.__type;
- file._finishFetch(_v2);
- return file;
- }
- return _.mapObject(value, AV._decode);
- };
- /**
- * The inverse function of {@link AV.Object#toFullJSON}.
- * @since 3.0.0
- * @method
- * @param {Object}
- * return {AV.Object|AV.File|any}
- */
- AV.parseJSON = AV._decode;
- /**
- * Similar to JSON.parse, except that AV internal types will be used if possible.
- * Inverse to {@link AV.stringify}
- * @since 3.14.0
- * @param {string} text the string to parse.
- * @return {AV.Object|AV.File|any}
- */
- AV.parse = function (text) {
- return AV.parseJSON(JSON.parse(text));
- };
- /**
- * Serialize a target containing AV.Object, similar to JSON.stringify.
- * Inverse to {@link AV.parse}
- * @since 3.14.0
- * @return {string}
- */
- AV.stringify = function (target) {
- return (0, _stringify.default)(AV._encode(target, [], false, true));
- };
- AV._encodeObjectOrArray = function (value) {
- var encodeAVObject = function encodeAVObject(object) {
- if (object && object._toFullJSON) {
- object = object._toFullJSON([]);
- }
- return _.mapObject(object, function (value) {
- return AV._encode(value, []);
- });
- };
- if (_.isArray(value)) {
- return (0, _map.default)(value).call(value, function (object) {
- return encodeAVObject(object);
- });
- } else {
- return encodeAVObject(value);
- }
- };
- AV._arrayEach = _.each;
- /**
- * Does a deep traversal of every item in object, calling func on every one.
- * @param {Object} object The object or array to traverse deeply.
- * @param {Function} func The function to call for every item. It will
- * be passed the item as an argument. If it returns a truthy value, that
- * value will replace the item in its parent container.
- * @returns {} the result of calling func on the top-level object itself.
- * @private
- */
- AV._traverse = function (object, func, seen) {
- if (object instanceof AV.Object) {
- seen = seen || [];
- if ((0, _indexOf.default)(_).call(_, seen, object) >= 0) {
- // We've already visited this object in this call.
- return;
- }
- seen.push(object);
- AV._traverse(object.attributes, func, seen);
- return func(object);
- }
- if (object instanceof AV.Relation || object instanceof AV.File) {
- // Nothing needs to be done, but we don't want to recurse into the
- // object's parent infinitely, so we catch this case.
- return func(object);
- }
- if (_.isArray(object)) {
- _.each(object, function (child, index) {
- var newChild = AV._traverse(child, func, seen);
- if (newChild) {
- object[index] = newChild;
- }
- });
- return func(object);
- }
- if (_.isObject(object)) {
- AV._each(object, function (child, key) {
- var newChild = AV._traverse(child, func, seen);
- if (newChild) {
- object[key] = newChild;
- }
- });
- return func(object);
- }
- return func(object);
- };
- /**
- * This is like _.each, except:
- * * it doesn't work for so-called array-like objects,
- * * it does work for dictionaries with a "length" attribute.
- * @private
- */
- AV._objectEach = AV._each = function (obj, callback) {
- if (_.isObject(obj)) {
- _.each((0, _keys2.default)(_).call(_, obj), function (key) {
- callback(obj[key], key);
- });
- } else {
- _.each(obj, callback);
- }
- };
- /**
- * @namespace
- * @since 3.14.0
- */
- AV.debug = {
- /**
- * Enable debug
- */
- enable: function enable() {
- var namespaces = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'leancloud*';
- return debug.enable(namespaces);
- },
- /**
- * Disable debug
- */
- disable: debug.disable
- };
- /**
- * Specify Adapters
- * @since 4.4.0
- * @function
- * @param {Adapters} newAdapters See {@link https://url.leanapp.cn/adapter-type-definitions @leancloud/adapter-types} for detailed definitions.
- */
- AV.setAdapters = setAdapters;
- module.exports = AV;
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(112)))
- /***/ }),
- /* 66 */
- /***/ (function(module, exports, __webpack_require__) {
- var bind = __webpack_require__(45);
- var uncurryThis = __webpack_require__(4);
- var IndexedObject = __webpack_require__(114);
- var toObject = __webpack_require__(34);
- var lengthOfArrayLike = __webpack_require__(46);
- var arraySpeciesCreate = __webpack_require__(219);
- var push = uncurryThis([].push);
- // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
- var createMethod = function (TYPE) {
- var IS_MAP = TYPE == 1;
- var IS_FILTER = TYPE == 2;
- var IS_SOME = TYPE == 3;
- var IS_EVERY = TYPE == 4;
- var IS_FIND_INDEX = TYPE == 6;
- var IS_FILTER_REJECT = TYPE == 7;
- var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
- return function ($this, callbackfn, that, specificCreate) {
- var O = toObject($this);
- var self = IndexedObject(O);
- var boundFunction = bind(callbackfn, that);
- var length = lengthOfArrayLike(self);
- var index = 0;
- var create = specificCreate || arraySpeciesCreate;
- var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
- var value, result;
- for (;length > index; index++) if (NO_HOLES || index in self) {
- value = self[index];
- result = boundFunction(value, index, O);
- if (TYPE) {
- if (IS_MAP) target[index] = result; // map
- else if (result) switch (TYPE) {
- case 3: return true; // some
- case 5: return value; // find
- case 6: return index; // findIndex
- case 2: push(target, value); // filter
- } else switch (TYPE) {
- case 4: return false; // every
- case 7: push(target, value); // filterReject
- }
- }
- }
- return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
- };
- };
- module.exports = {
- // `Array.prototype.forEach` method
- // https://tc39.es/ecma262/#sec-array.prototype.foreach
- forEach: createMethod(0),
- // `Array.prototype.map` method
- // https://tc39.es/ecma262/#sec-array.prototype.map
- map: createMethod(1),
- // `Array.prototype.filter` method
- // https://tc39.es/ecma262/#sec-array.prototype.filter
- filter: createMethod(2),
- // `Array.prototype.some` method
- // https://tc39.es/ecma262/#sec-array.prototype.some
- some: createMethod(3),
- // `Array.prototype.every` method
- // https://tc39.es/ecma262/#sec-array.prototype.every
- every: createMethod(4),
- // `Array.prototype.find` method
- // https://tc39.es/ecma262/#sec-array.prototype.find
- find: createMethod(5),
- // `Array.prototype.findIndex` method
- // https://tc39.es/ecma262/#sec-array.prototype.findIndex
- findIndex: createMethod(6),
- // `Array.prototype.filterReject` method
- // https://github.com/tc39/proposal-array-filtering
- filterReject: createMethod(7)
- };
- /***/ }),
- /* 67 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- 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); }
- /* eslint-env browser */
- /**
- * This is the web browser implementation of `debug()`.
- */
- exports.log = log;
- exports.formatArgs = formatArgs;
- exports.save = save;
- exports.load = load;
- exports.useColors = useColors;
- exports.storage = localstorage();
- /**
- * Colors.
- */
- 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'];
- /**
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
- * and the Firebug extension (any Firefox version) are known
- * to support "%c" CSS customizations.
- *
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
- */
- // eslint-disable-next-line complexity
- function useColors() {
- // NB: In an Electron preload script, document will be defined but not fully
- // initialized. Since we know we're in Chrome, we'll just detect this case
- // explicitly
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
- return true;
- } // Internet Explorer and Edge do not support colors.
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
- return false;
- } // Is webkit? http://stackoverflow.com/a/16459606/376773
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
- return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
- typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
- 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
- typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
- }
- /**
- * Colorize log arguments if enabled.
- *
- * @api public
- */
- function formatArgs(args) {
- args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
- if (!this.useColors) {
- return;
- }
- var c = 'color: ' + this.color;
- args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
- // arguments passed either before or after the %c, so we need to
- // figure out the correct index to insert the CSS into
- var index = 0;
- var lastC = 0;
- args[0].replace(/%[a-zA-Z%]/g, function (match) {
- if (match === '%%') {
- return;
- }
- index++;
- if (match === '%c') {
- // We only are interested in the *last* %c
- // (the user may have provided their own)
- lastC = index;
- }
- });
- args.splice(lastC, 0, c);
- }
- /**
- * Invokes `console.log()` when available.
- * No-op when `console.log` is not a "function".
- *
- * @api public
- */
- function log() {
- var _console;
- // This hackery is required for IE8/9, where
- // the `console.log` function doesn't have 'apply'
- return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
- }
- /**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
- function save(namespaces) {
- try {
- if (namespaces) {
- exports.storage.setItem('debug', namespaces);
- } else {
- exports.storage.removeItem('debug');
- }
- } catch (error) {// Swallow
- // XXX (@Qix-) should we be logging these?
- }
- }
- /**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
- function load() {
- var r;
- try {
- r = exports.storage.getItem('debug');
- } catch (error) {} // Swallow
- // XXX (@Qix-) should we be logging these?
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
- if (!r && typeof process !== 'undefined' && 'env' in process) {
- r = process.env.DEBUG;
- }
- return r;
- }
- /**
- * Localstorage attempts to return the localstorage.
- *
- * This is necessary because safari throws
- * when a user disables cookies/localstorage
- * and you attempt to access it.
- *
- * @return {LocalStorage}
- * @api private
- */
- function localstorage() {
- try {
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
- // The Browser also has localStorage in the global context.
- return localStorage;
- } catch (error) {// Swallow
- // XXX (@Qix-) should we be logging these?
- }
- }
- module.exports = __webpack_require__(386)(exports);
- var formatters = module.exports.formatters;
- /**
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
- */
- formatters.j = function (v) {
- try {
- return JSON.stringify(v);
- } catch (error) {
- return '[UnexpectedJSONParseError]: ' + error.message;
- }
- };
- /***/ }),
- /* 68 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _keys = _interopRequireDefault(__webpack_require__(55));
- var _ = __webpack_require__(2);
- var EventEmitter = __webpack_require__(224);
- var _require = __webpack_require__(29),
- inherits = _require.inherits;
- var AdapterManager = inherits(EventEmitter, {
- constructor: function constructor() {
- EventEmitter.apply(this);
- this._adapters = {};
- },
- getAdapter: function getAdapter(name) {
- var adapter = this._adapters[name];
- if (adapter === undefined) {
- throw new Error("".concat(name, " adapter is not configured"));
- }
- return adapter;
- },
- setAdapters: function setAdapters(newAdapters) {
- var _this = this;
- _.extend(this._adapters, newAdapters);
- (0, _keys.default)(_).call(_, newAdapters).forEach(function (name) {
- return _this.emit(name, newAdapters[name]);
- });
- }
- });
- var adapterManager = new AdapterManager();
- module.exports = {
- getAdapter: adapterManager.getAdapter.bind(adapterManager),
- setAdapters: adapterManager.setAdapters.bind(adapterManager),
- adapterManager: adapterManager
- };
- /***/ }),
- /* 69 */
- /***/ (function(module, exports, __webpack_require__) {
- var NATIVE_BIND = __webpack_require__(70);
- var FunctionPrototype = Function.prototype;
- var apply = FunctionPrototype.apply;
- var call = FunctionPrototype.call;
- // eslint-disable-next-line es-x/no-reflect -- safe
- module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {
- return call.apply(apply, arguments);
- });
- /***/ }),
- /* 70 */
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__(3);
- module.exports = !fails(function () {
- // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
- var test = (function () { /* empty */ }).bind();
- // eslint-disable-next-line no-prototype-builtins -- safe
- return typeof test != 'function' || test.hasOwnProperty('prototype');
- });
- /***/ }),
- /* 71 */
- /***/ (function(module, exports, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__(16);
- var call = __webpack_require__(13);
- var propertyIsEnumerableModule = __webpack_require__(113);
- var createPropertyDescriptor = __webpack_require__(44);
- var toIndexedObject = __webpack_require__(33);
- var toPropertyKey = __webpack_require__(88);
- var hasOwn = __webpack_require__(14);
- var IE8_DOM_DEFINE = __webpack_require__(148);
- // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- // `Object.getOwnPropertyDescriptor` method
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
- exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
- O = toIndexedObject(O);
- P = toPropertyKey(P);
- if (IE8_DOM_DEFINE) try {
- return $getOwnPropertyDescriptor(O, P);
- } catch (error) { /* empty */ }
- if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
- };
- /***/ }),
- /* 72 */
- /***/ (function(module, exports) {
- var $String = String;
- module.exports = function (argument) {
- try {
- return $String(argument);
- } catch (error) {
- return 'Object';
- }
- };
- /***/ }),
- /* 73 */
- /***/ (function(module, exports, __webpack_require__) {
- var IS_PURE = __webpack_require__(32);
- var store = __webpack_require__(117);
- (module.exports = function (key, value) {
- return store[key] || (store[key] = value !== undefined ? value : {});
- })('versions', []).push({
- version: '3.23.3',
- mode: IS_PURE ? 'pure' : 'global',
- copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
- license: 'https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE',
- source: 'https://github.com/zloirock/core-js'
- });
- /***/ }),
- /* 74 */
- /***/ (function(module, exports) {
- module.exports = {};
- /***/ }),
- /* 75 */
- /***/ (function(module, exports, __webpack_require__) {
- var classof = __webpack_require__(59);
- var $String = String;
- module.exports = function (argument) {
- if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
- return $String(argument);
- };
- /***/ }),
- /* 76 */
- /***/ (function(module, exports) {
- module.exports = function (exec) {
- try {
- return { error: false, value: exec() };
- } catch (error) {
- return { error: true, value: error };
- }
- };
- /***/ }),
- /* 77 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(6);
- var NativePromiseConstructor = __webpack_require__(61);
- var isCallable = __webpack_require__(7);
- var isForced = __webpack_require__(149);
- var inspectSource = __webpack_require__(123);
- var wellKnownSymbol = __webpack_require__(9);
- var IS_BROWSER = __webpack_require__(279);
- var IS_PURE = __webpack_require__(32);
- var V8_VERSION = __webpack_require__(90);
- var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
- var SPECIES = wellKnownSymbol('species');
- var SUBCLASSING = false;
- var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);
- var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {
- var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
- var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
- // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
- // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
- // We can't detect it synchronously, so just check versions
- if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
- // We need Promise#{ catch, finally } in the pure version for preventing prototype pollution
- if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;
- // We can't use @@species feature detection in V8 since it causes
- // deoptimization and performance degradation
- // https://github.com/zloirock/core-js/issues/679
- if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
- // Detect correctness of subclassing with @@species support
- var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });
- var FakePromise = function (exec) {
- exec(function () { /* empty */ }, function () { /* empty */ });
- };
- var constructor = promise.constructor = {};
- constructor[SPECIES] = FakePromise;
- SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
- if (!SUBCLASSING) return true;
- // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
- return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT;
- });
- module.exports = {
- CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
- REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
- SUBCLASSING: SUBCLASSING
- };
- /***/ }),
- /* 78 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var charAt = __webpack_require__(288).charAt;
- var toString = __webpack_require__(75);
- var InternalStateModule = __webpack_require__(38);
- var defineIterator = __webpack_require__(124);
- var STRING_ITERATOR = 'String Iterator';
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
- // `String.prototype[@@iterator]` method
- // https://tc39.es/ecma262/#sec-string.prototype-@@iterator
- defineIterator(String, 'String', function (iterated) {
- setInternalState(this, {
- type: STRING_ITERATOR,
- string: toString(iterated),
- index: 0
- });
- // `%StringIteratorPrototype%.next` method
- // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
- }, function next() {
- var state = getInternalState(this);
- var string = state.string;
- var index = state.index;
- var point;
- if (index >= string.length) return { value: undefined, done: true };
- point = charAt(string, index);
- state.index += point.length;
- return { value: point, done: false };
- });
- /***/ }),
- /* 79 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasStringTagBug; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return isIE11; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__ = __webpack_require__(296);
- // In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`.
- // In IE 11, the most common among them, this problem also applies to
- // `Map`, `WeakMap` and `Set`.
- var hasStringTagBug = (
- __WEBPACK_IMPORTED_MODULE_0__setup_js__["s" /* supportsDataView */] && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" /* default */])(new DataView(new ArrayBuffer(8)))
- ),
- isIE11 = (typeof Map !== 'undefined' && Object(__WEBPACK_IMPORTED_MODULE_1__hasObjectTag_js__["a" /* default */])(new Map));
- /***/ }),
- /* 80 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = allKeys;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__ = __webpack_require__(180);
- // Retrieve all the enumerable property names of an object.
- function allKeys(obj) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return [];
- var keys = [];
- for (var key in obj) keys.push(key);
- // Ahem, IE < 9.
- if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["h" /* hasEnumBug */]) Object(__WEBPACK_IMPORTED_MODULE_2__collectNonEnumProps_js__["a" /* default */])(obj, keys);
- return keys;
- }
- /***/ }),
- /* 81 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = toPath;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(189);
- // Internal wrapper for `_.toPath` to enable minification.
- // Similar to `cb` for `_.iteratee`.
- function toPath(path) {
- return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].toPath(path);
- }
- /***/ }),
- /* 82 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = optimizeCb;
- // Internal function that returns an efficient (for current engines) version
- // of the passed-in callback, to be repeatedly applied in other Underscore
- // functions.
- function optimizeCb(func, context, argCount) {
- if (context === void 0) return func;
- switch (argCount == null ? 3 : argCount) {
- case 1: return function(value) {
- return func.call(context, value);
- };
- // The 2-argument case is omitted because we’re not using it.
- case 3: return function(value, index, collection) {
- return func.call(context, value, index, collection);
- };
- case 4: return function(accumulator, value, index, collection) {
- return func.call(context, accumulator, value, index, collection);
- };
- }
- return function() {
- return func.apply(context, arguments);
- };
- }
- /***/ }),
- /* 83 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = filter;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
- // Return all the elements that pass a truth test.
- function filter(obj, predicate, context) {
- var results = [];
- predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
- Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(obj, function(value, index, list) {
- if (predicate(value, index, list)) results.push(value);
- });
- return results;
- }
- /***/ }),
- /* 84 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = contains;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(62);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__indexOf_js__ = __webpack_require__(205);
- // Determine if the array or object contains a given item (using `===`).
- function contains(obj, item, fromIndex, guard) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
- if (typeof fromIndex != 'number' || guard) fromIndex = 0;
- return Object(__WEBPACK_IMPORTED_MODULE_2__indexOf_js__["a" /* default */])(obj, item, fromIndex) >= 0;
- }
- /***/ }),
- /* 85 */
- /***/ (function(module, exports, __webpack_require__) {
- var classof = __webpack_require__(56);
- // `IsArray` abstract operation
- // https://tc39.es/ecma262/#sec-isarray
- // eslint-disable-next-line es-x/no-array-isarray -- safe
- module.exports = Array.isArray || function isArray(argument) {
- return classof(argument) == 'Array';
- };
- /***/ }),
- /* 86 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(376);
- /***/ }),
- /* 87 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(229);
- /***/ }),
- /* 88 */
- /***/ (function(module, exports, __webpack_require__) {
- var toPrimitive = __webpack_require__(256);
- var isSymbol = __webpack_require__(89);
- // `ToPropertyKey` abstract operation
- // https://tc39.es/ecma262/#sec-topropertykey
- module.exports = function (argument) {
- var key = toPrimitive(argument, 'string');
- return isSymbol(key) ? key : key + '';
- };
- /***/ }),
- /* 89 */
- /***/ (function(module, exports, __webpack_require__) {
- var getBuiltIn = __webpack_require__(18);
- var isCallable = __webpack_require__(7);
- var isPrototypeOf = __webpack_require__(21);
- var USE_SYMBOL_AS_UID = __webpack_require__(147);
- var $Object = Object;
- module.exports = USE_SYMBOL_AS_UID ? function (it) {
- return typeof it == 'symbol';
- } : function (it) {
- var $Symbol = getBuiltIn('Symbol');
- return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
- };
- /***/ }),
- /* 90 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(6);
- var userAgent = __webpack_require__(91);
- var process = global.process;
- var Deno = global.Deno;
- var versions = process && process.versions || Deno && Deno.version;
- var v8 = versions && versions.v8;
- var match, version;
- if (v8) {
- match = v8.split('.');
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
- // but their correct versions are not interesting for us
- version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
- }
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
- // so check `userAgent` even if `.v8` exists, but 0
- if (!version && userAgent) {
- match = userAgent.match(/Edge\/(\d+)/);
- if (!match || match[1] >= 74) {
- match = userAgent.match(/Chrome\/(\d+)/);
- if (match) version = +match[1];
- }
- }
- module.exports = version;
- /***/ }),
- /* 91 */
- /***/ (function(module, exports, __webpack_require__) {
- var getBuiltIn = __webpack_require__(18);
- module.exports = getBuiltIn('navigator', 'userAgent') || '';
- /***/ }),
- /* 92 */
- /***/ (function(module, exports, __webpack_require__) {
- var uncurryThis = __webpack_require__(4);
- var id = 0;
- var postfix = Math.random();
- var toString = uncurryThis(1.0.toString);
- module.exports = function (key) {
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
- };
- /***/ }),
- /* 93 */
- /***/ (function(module, exports, __webpack_require__) {
- var hasOwn = __webpack_require__(14);
- var isCallable = __webpack_require__(7);
- var toObject = __webpack_require__(34);
- var sharedKey = __webpack_require__(94);
- var CORRECT_PROTOTYPE_GETTER = __webpack_require__(151);
- var IE_PROTO = sharedKey('IE_PROTO');
- var $Object = Object;
- var ObjectPrototype = $Object.prototype;
- // `Object.getPrototypeOf` method
- // https://tc39.es/ecma262/#sec-object.getprototypeof
- // eslint-disable-next-line es-x/no-object-getprototypeof -- safe
- module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
- var object = toObject(O);
- if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
- var constructor = object.constructor;
- if (isCallable(constructor) && object instanceof constructor) {
- return constructor.prototype;
- } return object instanceof $Object ? ObjectPrototype : null;
- };
- /***/ }),
- /* 94 */
- /***/ (function(module, exports, __webpack_require__) {
- var shared = __webpack_require__(73);
- var uid = __webpack_require__(92);
- var keys = shared('keys');
- module.exports = function (key) {
- return keys[key] || (keys[key] = uid(key));
- };
- /***/ }),
- /* 95 */
- /***/ (function(module, exports, __webpack_require__) {
- /* eslint-disable no-proto -- safe */
- var uncurryThis = __webpack_require__(4);
- var anObject = __webpack_require__(19);
- var aPossiblePrototype = __webpack_require__(259);
- // `Object.setPrototypeOf` method
- // https://tc39.es/ecma262/#sec-object.setprototypeof
- // Works with __proto__ only. Old v8 can't work with null proto objects.
- // eslint-disable-next-line es-x/no-object-setprototypeof -- safe
- module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
- var CORRECT_SETTER = false;
- var test = {};
- var setter;
- try {
- // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
- setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
- setter(test, []);
- CORRECT_SETTER = test instanceof Array;
- } catch (error) { /* empty */ }
- return function setPrototypeOf(O, proto) {
- anObject(O);
- aPossiblePrototype(proto);
- if (CORRECT_SETTER) setter(O, proto);
- else O.__proto__ = proto;
- return O;
- };
- }() : undefined);
- /***/ }),
- /* 96 */
- /***/ (function(module, exports, __webpack_require__) {
- var internalObjectKeys = __webpack_require__(152);
- var enumBugKeys = __webpack_require__(121);
- var hiddenKeys = enumBugKeys.concat('length', 'prototype');
- // `Object.getOwnPropertyNames` method
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
- // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
- exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
- return internalObjectKeys(O, hiddenKeys);
- };
- /***/ }),
- /* 97 */
- /***/ (function(module, exports) {
- // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
- exports.f = Object.getOwnPropertySymbols;
- /***/ }),
- /* 98 */
- /***/ (function(module, exports, __webpack_require__) {
- var internalObjectKeys = __webpack_require__(152);
- var enumBugKeys = __webpack_require__(121);
- // `Object.keys` method
- // https://tc39.es/ecma262/#sec-object.keys
- // eslint-disable-next-line es-x/no-object-keys -- safe
- module.exports = Object.keys || function keys(O) {
- return internalObjectKeys(O, enumBugKeys);
- };
- /***/ }),
- /* 99 */
- /***/ (function(module, exports, __webpack_require__) {
- var classof = __webpack_require__(59);
- var getMethod = __webpack_require__(116);
- var Iterators = __webpack_require__(58);
- var wellKnownSymbol = __webpack_require__(9);
- var ITERATOR = wellKnownSymbol('iterator');
- module.exports = function (it) {
- if (it != undefined) return getMethod(it, ITERATOR)
- || getMethod(it, '@@iterator')
- || Iterators[classof(it)];
- };
- /***/ }),
- /* 100 */
- /***/ (function(module, exports, __webpack_require__) {
- var isPrototypeOf = __webpack_require__(21);
- var $TypeError = TypeError;
- module.exports = function (it, Prototype) {
- if (isPrototypeOf(Prototype, it)) return it;
- throw $TypeError('Incorrect invocation');
- };
- /***/ }),
- /* 101 */
- /***/ (function(module, exports, __webpack_require__) {
- var uncurryThis = __webpack_require__(4);
- var fails = __webpack_require__(3);
- var isCallable = __webpack_require__(7);
- var classof = __webpack_require__(59);
- var getBuiltIn = __webpack_require__(18);
- var inspectSource = __webpack_require__(123);
- var noop = function () { /* empty */ };
- var empty = [];
- var construct = getBuiltIn('Reflect', 'construct');
- var constructorRegExp = /^\s*(?:class|function)\b/;
- var exec = uncurryThis(constructorRegExp.exec);
- var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
- var isConstructorModern = function isConstructor(argument) {
- if (!isCallable(argument)) return false;
- try {
- construct(noop, empty, argument);
- return true;
- } catch (error) {
- return false;
- }
- };
- var isConstructorLegacy = function isConstructor(argument) {
- if (!isCallable(argument)) return false;
- switch (classof(argument)) {
- case 'AsyncFunction':
- case 'GeneratorFunction':
- case 'AsyncGeneratorFunction': return false;
- }
- try {
- // we can't check .prototype since constructors produced by .bind haven't it
- // `Function#toString` throws on some built-it function in some legacy engines
- // (for example, `DOMQuad` and similar in FF41-)
- return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
- } catch (error) {
- return true;
- }
- };
- isConstructorLegacy.sham = true;
- // `IsConstructor` abstract operation
- // https://tc39.es/ecma262/#sec-isconstructor
- module.exports = !construct || fails(function () {
- var called;
- return isConstructorModern(isConstructorModern.call)
- || !isConstructorModern(Object)
- || !isConstructorModern(function () { called = true; })
- || called;
- }) ? isConstructorLegacy : isConstructorModern;
- /***/ }),
- /* 102 */
- /***/ (function(module, exports, __webpack_require__) {
- var uncurryThis = __webpack_require__(4);
- module.exports = uncurryThis([].slice);
- /***/ }),
- /* 103 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = matcher;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__extendOwn_js__ = __webpack_require__(133);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isMatch_js__ = __webpack_require__(181);
- // Returns a predicate for checking whether an object has a given set of
- // `key:value` pairs.
- function matcher(attrs) {
- attrs = Object(__WEBPACK_IMPORTED_MODULE_0__extendOwn_js__["a" /* default */])({}, attrs);
- return function(obj) {
- return Object(__WEBPACK_IMPORTED_MODULE_1__isMatch_js__["a" /* default */])(obj, attrs);
- };
- }
- /***/ }),
- /* 104 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__executeBound_js__ = __webpack_require__(197);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(24);
- // Partially apply a function by creating a version that has had some of its
- // arguments pre-filled, without changing its dynamic `this` context. `_` acts
- // as a placeholder by default, allowing any combination of arguments to be
- // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.
- var partial = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, boundArgs) {
- var placeholder = partial.placeholder;
- var bound = function() {
- var position = 0, length = boundArgs.length;
- var args = Array(length);
- for (var i = 0; i < length; i++) {
- args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
- }
- while (position < arguments.length) args.push(arguments[position++]);
- return Object(__WEBPACK_IMPORTED_MODULE_1__executeBound_js__["a" /* default */])(func, bound, this, this, args);
- };
- return bound;
- });
- partial.placeholder = __WEBPACK_IMPORTED_MODULE_2__underscore_js__["a" /* default */];
- /* harmony default export */ __webpack_exports__["a"] = (partial);
- /***/ }),
- /* 105 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = group;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
- // An internal function used for aggregate "group by" operations.
- function group(behavior, partition) {
- return function(obj, iteratee, context) {
- var result = partition ? [[], []] : {};
- iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
- Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(obj, function(value, index) {
- var key = iteratee(value, index, obj);
- behavior(result, value, key);
- });
- return result;
- };
- }
- /***/ }),
- /* 106 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var toPropertyKey = __webpack_require__(88);
- var definePropertyModule = __webpack_require__(22);
- var createPropertyDescriptor = __webpack_require__(44);
- module.exports = function (object, key, value) {
- var propertyKey = toPropertyKey(key);
- if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
- else object[propertyKey] = value;
- };
- /***/ }),
- /* 107 */
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__(3);
- var wellKnownSymbol = __webpack_require__(9);
- var V8_VERSION = __webpack_require__(90);
- var SPECIES = wellKnownSymbol('species');
- module.exports = function (METHOD_NAME) {
- // We can't use this feature detection in V8 since it causes
- // deoptimization and serious performance degradation
- // https://github.com/zloirock/core-js/issues/677
- return V8_VERSION >= 51 || !fails(function () {
- var array = [];
- var constructor = array.constructor = {};
- constructor[SPECIES] = function () {
- return { foo: 1 };
- };
- return array[METHOD_NAME](Boolean).foo !== 1;
- });
- };
- /***/ }),
- /* 108 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _typeof2 = _interopRequireDefault(__webpack_require__(109));
- var _filter = _interopRequireDefault(__webpack_require__(437));
- var _map = _interopRequireDefault(__webpack_require__(42));
- var _keys = _interopRequireDefault(__webpack_require__(141));
- var _stringify = _interopRequireDefault(__webpack_require__(36));
- var _concat = _interopRequireDefault(__webpack_require__(30));
- var _ = __webpack_require__(2);
- var _require = __webpack_require__(442),
- timeout = _require.timeout;
- var debug = __webpack_require__(67);
- var debugRequest = debug('leancloud:request');
- var debugRequestError = debug('leancloud:request:error');
- var _require2 = __webpack_require__(68),
- getAdapter = _require2.getAdapter;
- var requestsCount = 0;
- var ajax = function ajax(_ref) {
- var method = _ref.method,
- url = _ref.url,
- query = _ref.query,
- data = _ref.data,
- _ref$headers = _ref.headers,
- headers = _ref$headers === void 0 ? {} : _ref$headers,
- time = _ref.timeout,
- onprogress = _ref.onprogress;
- if (query) {
- var _context, _context2, _context4;
- var queryString = (0, _filter.default)(_context = (0, _map.default)(_context2 = (0, _keys.default)(query)).call(_context2, function (key) {
- var _context3;
- var value = query[key];
- if (value === undefined) return undefined;
- var v = (0, _typeof2.default)(value) === 'object' ? (0, _stringify.default)(value) : value;
- return (0, _concat.default)(_context3 = "".concat(encodeURIComponent(key), "=")).call(_context3, encodeURIComponent(v));
- })).call(_context, function (qs) {
- return qs;
- }).join('&');
- url = (0, _concat.default)(_context4 = "".concat(url, "?")).call(_context4, queryString);
- }
- var count = requestsCount++;
- debugRequest('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
- var request = getAdapter('request');
- var promise = request(url, {
- method: method,
- headers: headers,
- data: data,
- onprogress: onprogress
- }).then(function (response) {
- debugRequest('response(%d) %d %O %o', count, response.status, response.data || response.text, response.header);
- if (response.ok === false) {
- var error = new Error();
- error.response = response;
- throw error;
- }
- return response.data;
- }).catch(function (error) {
- if (error.response) {
- if (!debug.enabled('leancloud:request')) {
- debugRequestError('request(%d) %s %s %o %o %o', count, method, url, query, data, headers);
- }
- debugRequestError('response(%d) %d %O %o', count, error.response.status, error.response.data || error.response.text, error.response.header);
- error.statusCode = error.response.status;
- error.responseText = error.response.text;
- error.response = error.response.data;
- }
- throw error;
- });
- return time ? timeout(promise, time) : promise;
- };
- module.exports = ajax;
- /***/ }),
- /* 109 */
- /***/ (function(module, exports, __webpack_require__) {
- var _Symbol = __webpack_require__(231);
- var _Symbol$iterator = __webpack_require__(432);
- function _typeof(obj) {
- "@babel/helpers - typeof";
- return (module.exports = _typeof = "function" == typeof _Symbol && "symbol" == typeof _Symbol$iterator ? function (obj) {
- return typeof obj;
- } : function (obj) {
- return obj && "function" == typeof _Symbol && obj.constructor === _Symbol && obj !== _Symbol.prototype ? "symbol" : typeof obj;
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
- }
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 110 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(447);
- /***/ }),
- /* 111 */
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__(0);
- var uncurryThis = __webpack_require__(4);
- var hiddenKeys = __webpack_require__(74);
- var isObject = __webpack_require__(11);
- var hasOwn = __webpack_require__(14);
- var defineProperty = __webpack_require__(22).f;
- var getOwnPropertyNamesModule = __webpack_require__(96);
- var getOwnPropertyNamesExternalModule = __webpack_require__(234);
- var isExtensible = __webpack_require__(247);
- var uid = __webpack_require__(92);
- var FREEZING = __webpack_require__(562);
- var REQUIRED = false;
- var METADATA = uid('meta');
- var id = 0;
- var setMetadata = function (it) {
- defineProperty(it, METADATA, { value: {
- objectID: 'O' + id++, // object ID
- weakData: {} // weak collections IDs
- } });
- };
- var fastKey = function (it, create) {
- // return a primitive with prefix
- if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
- if (!hasOwn(it, METADATA)) {
- // can't set metadata to uncaught frozen object
- if (!isExtensible(it)) return 'F';
- // not necessary to add metadata
- if (!create) return 'E';
- // add missing metadata
- setMetadata(it);
- // return object ID
- } return it[METADATA].objectID;
- };
- var getWeakData = function (it, create) {
- if (!hasOwn(it, METADATA)) {
- // can't set metadata to uncaught frozen object
- if (!isExtensible(it)) return true;
- // not necessary to add metadata
- if (!create) return false;
- // add missing metadata
- setMetadata(it);
- // return the store of weak collections IDs
- } return it[METADATA].weakData;
- };
- // add metadata on freeze-family methods calling
- var onFreeze = function (it) {
- if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it);
- return it;
- };
- var enable = function () {
- meta.enable = function () { /* empty */ };
- REQUIRED = true;
- var getOwnPropertyNames = getOwnPropertyNamesModule.f;
- var splice = uncurryThis([].splice);
- var test = {};
- test[METADATA] = 1;
- // prevent exposing of metadata key
- if (getOwnPropertyNames(test).length) {
- getOwnPropertyNamesModule.f = function (it) {
- var result = getOwnPropertyNames(it);
- for (var i = 0, length = result.length; i < length; i++) {
- if (result[i] === METADATA) {
- splice(result, i, 1);
- break;
- }
- } return result;
- };
- $({ target: 'Object', stat: true, forced: true }, {
- getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
- });
- }
- };
- var meta = module.exports = {
- enable: enable,
- fastKey: fastKey,
- getWeakData: getWeakData,
- onFreeze: onFreeze
- };
- hiddenKeys[METADATA] = true;
- /***/ }),
- /* 112 */
- /***/ (function(module, exports) {
- var g;
- // This works in non-strict mode
- g = (function() {
- return this;
- })();
- try {
- // This works if eval is allowed (see CSP)
- g = g || Function("return this")() || (1,eval)("this");
- } catch(e) {
- // This works if the window reference is available
- if(typeof window === "object")
- g = window;
- }
- // g can still be undefined, but nothing to do about it...
- // We return undefined, instead of nothing here, so it's
- // easier to handle this case. if(!global) { ...}
- module.exports = g;
- /***/ }),
- /* 113 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
- // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- // Nashorn ~ JDK8 bug
- var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
- // `Object.prototype.propertyIsEnumerable` method implementation
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
- exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
- var descriptor = getOwnPropertyDescriptor(this, V);
- return !!descriptor && descriptor.enumerable;
- } : $propertyIsEnumerable;
- /***/ }),
- /* 114 */
- /***/ (function(module, exports, __webpack_require__) {
- var uncurryThis = __webpack_require__(4);
- var fails = __webpack_require__(3);
- var classof = __webpack_require__(56);
- var $Object = Object;
- var split = uncurryThis(''.split);
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
- module.exports = fails(function () {
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
- // eslint-disable-next-line no-prototype-builtins -- safe
- return !$Object('z').propertyIsEnumerable(0);
- }) ? function (it) {
- return classof(it) == 'String' ? split(it, '') : $Object(it);
- } : $Object;
- /***/ }),
- /* 115 */
- /***/ (function(module, exports) {
- var $TypeError = TypeError;
- // `RequireObjectCoercible` abstract operation
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
- module.exports = function (it) {
- if (it == undefined) throw $TypeError("Can't call method on " + it);
- return it;
- };
- /***/ }),
- /* 116 */
- /***/ (function(module, exports, __webpack_require__) {
- var aCallable = __webpack_require__(31);
- // `GetMethod` abstract operation
- // https://tc39.es/ecma262/#sec-getmethod
- module.exports = function (V, P) {
- var func = V[P];
- return func == null ? undefined : aCallable(func);
- };
- /***/ }),
- /* 117 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(6);
- var defineGlobalProperty = __webpack_require__(258);
- var SHARED = '__core-js_shared__';
- var store = global[SHARED] || defineGlobalProperty(SHARED, {});
- module.exports = store;
- /***/ }),
- /* 118 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(6);
- var isObject = __webpack_require__(11);
- var document = global.document;
- // typeof document.createElement is 'object' in old IE
- var EXISTS = isObject(document) && isObject(document.createElement);
- module.exports = function (it) {
- return EXISTS ? document.createElement(it) : {};
- };
- /***/ }),
- /* 119 */
- /***/ (function(module, exports, __webpack_require__) {
- var toIntegerOrInfinity = __webpack_require__(120);
- var max = Math.max;
- var min = Math.min;
- // Helper for a popular repeating case of the spec:
- // Let integer be ? ToInteger(index).
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
- module.exports = function (index, length) {
- var integer = toIntegerOrInfinity(index);
- return integer < 0 ? max(integer + length, 0) : min(integer, length);
- };
- /***/ }),
- /* 120 */
- /***/ (function(module, exports, __webpack_require__) {
- var trunc = __webpack_require__(262);
- // `ToIntegerOrInfinity` abstract operation
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
- module.exports = function (argument) {
- var number = +argument;
- // eslint-disable-next-line no-self-compare -- NaN check
- return number !== number || number === 0 ? 0 : trunc(number);
- };
- /***/ }),
- /* 121 */
- /***/ (function(module, exports) {
- // IE8- don't enum bug keys
- module.exports = [
- 'constructor',
- 'hasOwnProperty',
- 'isPrototypeOf',
- 'propertyIsEnumerable',
- 'toLocaleString',
- 'toString',
- 'valueOf'
- ];
- /***/ }),
- /* 122 */
- /***/ (function(module, exports, __webpack_require__) {
- var wellKnownSymbol = __webpack_require__(9);
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- var test = {};
- test[TO_STRING_TAG] = 'z';
- module.exports = String(test) === '[object z]';
- /***/ }),
- /* 123 */
- /***/ (function(module, exports, __webpack_require__) {
- var uncurryThis = __webpack_require__(4);
- var isCallable = __webpack_require__(7);
- var store = __webpack_require__(117);
- var functionToString = uncurryThis(Function.toString);
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
- if (!isCallable(store.inspectSource)) {
- store.inspectSource = function (it) {
- return functionToString(it);
- };
- }
- module.exports = store.inspectSource;
- /***/ }),
- /* 124 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var call = __webpack_require__(13);
- var IS_PURE = __webpack_require__(32);
- var FunctionName = __webpack_require__(268);
- var isCallable = __webpack_require__(7);
- var createIteratorConstructor = __webpack_require__(269);
- var getPrototypeOf = __webpack_require__(93);
- var setPrototypeOf = __webpack_require__(95);
- var setToStringTag = __webpack_require__(49);
- var createNonEnumerableProperty = __webpack_require__(35);
- var defineBuiltIn = __webpack_require__(39);
- var wellKnownSymbol = __webpack_require__(9);
- var Iterators = __webpack_require__(58);
- var IteratorsCore = __webpack_require__(161);
- var PROPER_FUNCTION_NAME = FunctionName.PROPER;
- var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
- var ITERATOR = wellKnownSymbol('iterator');
- var KEYS = 'keys';
- var VALUES = 'values';
- var ENTRIES = 'entries';
- var returnThis = function () { return this; };
- module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
- createIteratorConstructor(IteratorConstructor, NAME, next);
- var getIterationMethod = function (KIND) {
- if (KIND === DEFAULT && defaultIterator) return defaultIterator;
- if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
- switch (KIND) {
- case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
- case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
- case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
- } return function () { return new IteratorConstructor(this); };
- };
- var TO_STRING_TAG = NAME + ' Iterator';
- var INCORRECT_VALUES_NAME = false;
- var IterablePrototype = Iterable.prototype;
- var nativeIterator = IterablePrototype[ITERATOR]
- || IterablePrototype['@@iterator']
- || DEFAULT && IterablePrototype[DEFAULT];
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
- var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
- var CurrentIteratorPrototype, methods, KEY;
- // fix native
- if (anyNativeIterator) {
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
- if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
- if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
- if (setPrototypeOf) {
- setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
- } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
- defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
- }
- }
- // Set @@toStringTag to native iterators
- setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
- if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
- }
- }
- // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
- if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
- if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
- createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
- } else {
- INCORRECT_VALUES_NAME = true;
- defaultIterator = function values() { return call(nativeIterator, this); };
- }
- }
- // export additional methods
- if (DEFAULT) {
- methods = {
- values: getIterationMethod(VALUES),
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
- entries: getIterationMethod(ENTRIES)
- };
- if (FORCED) for (KEY in methods) {
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
- defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
- }
- } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
- }
- // define iterator
- if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
- defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
- }
- Iterators[NAME] = defaultIterator;
- return methods;
- };
- /***/ }),
- /* 125 */
- /***/ (function(module, exports, __webpack_require__) {
- var classof = __webpack_require__(56);
- var global = __webpack_require__(6);
- module.exports = classof(global.process) == 'process';
- /***/ }),
- /* 126 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return __WEBPACK_IMPORTED_MODULE_0__setup_js__["e"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__restArguments_js__ = __webpack_require__(23);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "restArguments", function() { return __WEBPACK_IMPORTED_MODULE_1__restArguments_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(52);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return __WEBPACK_IMPORTED_MODULE_2__isObject_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isNull_js__ = __webpack_require__(291);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return __WEBPACK_IMPORTED_MODULE_3__isNull_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__ = __webpack_require__(170);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return __WEBPACK_IMPORTED_MODULE_4__isUndefined_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__ = __webpack_require__(171);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return __WEBPACK_IMPORTED_MODULE_5__isBoolean_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isElement_js__ = __webpack_require__(292);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isElement", function() { return __WEBPACK_IMPORTED_MODULE_6__isElement_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__isString_js__ = __webpack_require__(127);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return __WEBPACK_IMPORTED_MODULE_7__isString_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__isNumber_js__ = __webpack_require__(172);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return __WEBPACK_IMPORTED_MODULE_8__isNumber_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__isDate_js__ = __webpack_require__(293);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return __WEBPACK_IMPORTED_MODULE_9__isDate_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__ = __webpack_require__(294);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isRegExp", function() { return __WEBPACK_IMPORTED_MODULE_10__isRegExp_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__isError_js__ = __webpack_require__(295);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isError", function() { return __WEBPACK_IMPORTED_MODULE_11__isError_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__ = __webpack_require__(173);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isSymbol", function() { return __WEBPACK_IMPORTED_MODULE_12__isSymbol_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__ = __webpack_require__(174);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return __WEBPACK_IMPORTED_MODULE_13__isArrayBuffer_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__isDataView_js__ = __webpack_require__(128);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isDataView", function() { return __WEBPACK_IMPORTED_MODULE_14__isDataView_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__isArray_js__ = __webpack_require__(53);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return __WEBPACK_IMPORTED_MODULE_15__isArray_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__isFunction_js__ = __webpack_require__(27);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return __WEBPACK_IMPORTED_MODULE_16__isFunction_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__isArguments_js__ = __webpack_require__(129);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isArguments", function() { return __WEBPACK_IMPORTED_MODULE_17__isArguments_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__isFinite_js__ = __webpack_require__(297);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return __WEBPACK_IMPORTED_MODULE_18__isFinite_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__isNaN_js__ = __webpack_require__(175);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return __WEBPACK_IMPORTED_MODULE_19__isNaN_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__ = __webpack_require__(176);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isTypedArray", function() { return __WEBPACK_IMPORTED_MODULE_20__isTypedArray_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__ = __webpack_require__(299);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_21__isEmpty_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__isMatch_js__ = __webpack_require__(181);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isMatch", function() { return __WEBPACK_IMPORTED_MODULE_22__isMatch_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__isEqual_js__ = __webpack_require__(300);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEqual", function() { return __WEBPACK_IMPORTED_MODULE_23__isEqual_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__isMap_js__ = __webpack_require__(302);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isMap", function() { return __WEBPACK_IMPORTED_MODULE_24__isMap_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__ = __webpack_require__(303);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isWeakMap", function() { return __WEBPACK_IMPORTED_MODULE_25__isWeakMap_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__isSet_js__ = __webpack_require__(304);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isSet", function() { return __WEBPACK_IMPORTED_MODULE_26__isSet_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__ = __webpack_require__(305);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isWeakSet", function() { return __WEBPACK_IMPORTED_MODULE_27__isWeakSet_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__keys_js__ = __webpack_require__(15);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return __WEBPACK_IMPORTED_MODULE_28__keys_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__allKeys_js__ = __webpack_require__(80);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "allKeys", function() { return __WEBPACK_IMPORTED_MODULE_29__allKeys_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__values_js__ = __webpack_require__(62);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "values", function() { return __WEBPACK_IMPORTED_MODULE_30__values_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__pairs_js__ = __webpack_require__(306);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_31__pairs_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__invert_js__ = __webpack_require__(182);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "invert", function() { return __WEBPACK_IMPORTED_MODULE_32__invert_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__functions_js__ = __webpack_require__(183);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "functions", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "methods", function() { return __WEBPACK_IMPORTED_MODULE_33__functions_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__extend_js__ = __webpack_require__(184);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "extend", function() { return __WEBPACK_IMPORTED_MODULE_34__extend_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__ = __webpack_require__(133);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "extendOwn", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "assign", function() { return __WEBPACK_IMPORTED_MODULE_35__extendOwn_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__defaults_js__ = __webpack_require__(185);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return __WEBPACK_IMPORTED_MODULE_36__defaults_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__create_js__ = __webpack_require__(307);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return __WEBPACK_IMPORTED_MODULE_37__create_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__clone_js__ = __webpack_require__(187);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return __WEBPACK_IMPORTED_MODULE_38__clone_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__tap_js__ = __webpack_require__(308);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_39__tap_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__get_js__ = __webpack_require__(188);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return __WEBPACK_IMPORTED_MODULE_40__get_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__has_js__ = __webpack_require__(309);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "has", function() { return __WEBPACK_IMPORTED_MODULE_41__has_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__mapObject_js__ = __webpack_require__(310);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mapObject", function() { return __WEBPACK_IMPORTED_MODULE_42__mapObject_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__identity_js__ = __webpack_require__(135);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_43__identity_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__constant_js__ = __webpack_require__(177);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "constant", function() { return __WEBPACK_IMPORTED_MODULE_44__constant_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__noop_js__ = __webpack_require__(192);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_45__noop_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__toPath_js__ = __webpack_require__(189);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toPath", function() { return __WEBPACK_IMPORTED_MODULE_46__toPath_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__property_js__ = __webpack_require__(136);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "property", function() { return __WEBPACK_IMPORTED_MODULE_47__property_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__ = __webpack_require__(311);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "propertyOf", function() { return __WEBPACK_IMPORTED_MODULE_48__propertyOf_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__matcher_js__ = __webpack_require__(103);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matcher", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return __WEBPACK_IMPORTED_MODULE_49__matcher_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__times_js__ = __webpack_require__(312);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "times", function() { return __WEBPACK_IMPORTED_MODULE_50__times_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__random_js__ = __webpack_require__(193);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "random", function() { return __WEBPACK_IMPORTED_MODULE_51__random_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__now_js__ = __webpack_require__(137);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "now", function() { return __WEBPACK_IMPORTED_MODULE_52__now_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__escape_js__ = __webpack_require__(313);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return __WEBPACK_IMPORTED_MODULE_53__escape_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__unescape_js__ = __webpack_require__(314);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unescape", function() { return __WEBPACK_IMPORTED_MODULE_54__unescape_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__ = __webpack_require__(196);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "templateSettings", function() { return __WEBPACK_IMPORTED_MODULE_55__templateSettings_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__template_js__ = __webpack_require__(316);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "template", function() { return __WEBPACK_IMPORTED_MODULE_56__template_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__result_js__ = __webpack_require__(317);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "result", function() { return __WEBPACK_IMPORTED_MODULE_57__result_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__ = __webpack_require__(318);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniqueId", function() { return __WEBPACK_IMPORTED_MODULE_58__uniqueId_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__chain_js__ = __webpack_require__(319);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "chain", function() { return __WEBPACK_IMPORTED_MODULE_59__chain_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__iteratee_js__ = __webpack_require__(191);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "iteratee", function() { return __WEBPACK_IMPORTED_MODULE_60__iteratee_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__partial_js__ = __webpack_require__(104);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partial", function() { return __WEBPACK_IMPORTED_MODULE_61__partial_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__bind_js__ = __webpack_require__(198);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bind", function() { return __WEBPACK_IMPORTED_MODULE_62__bind_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__bindAll_js__ = __webpack_require__(320);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindAll", function() { return __WEBPACK_IMPORTED_MODULE_63__bindAll_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__memoize_js__ = __webpack_require__(321);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "memoize", function() { return __WEBPACK_IMPORTED_MODULE_64__memoize_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__delay_js__ = __webpack_require__(199);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_65__delay_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__defer_js__ = __webpack_require__(322);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_66__defer_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__throttle_js__ = __webpack_require__(323);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_67__throttle_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__debounce_js__ = __webpack_require__(324);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_68__debounce_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__wrap_js__ = __webpack_require__(325);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "wrap", function() { return __WEBPACK_IMPORTED_MODULE_69__wrap_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__negate_js__ = __webpack_require__(138);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "negate", function() { return __WEBPACK_IMPORTED_MODULE_70__negate_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__compose_js__ = __webpack_require__(326);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_71__compose_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__after_js__ = __webpack_require__(327);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "after", function() { return __WEBPACK_IMPORTED_MODULE_72__after_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__before_js__ = __webpack_require__(200);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "before", function() { return __WEBPACK_IMPORTED_MODULE_73__before_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__once_js__ = __webpack_require__(328);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return __WEBPACK_IMPORTED_MODULE_74__once_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__findKey_js__ = __webpack_require__(201);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findKey", function() { return __WEBPACK_IMPORTED_MODULE_75__findKey_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__findIndex_js__ = __webpack_require__(139);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_76__findIndex_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__ = __webpack_require__(203);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findLastIndex", function() { return __WEBPACK_IMPORTED_MODULE_77__findLastIndex_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__ = __webpack_require__(204);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sortedIndex", function() { return __WEBPACK_IMPORTED_MODULE_78__sortedIndex_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__indexOf_js__ = __webpack_require__(205);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "indexOf", function() { return __WEBPACK_IMPORTED_MODULE_79__indexOf_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__ = __webpack_require__(329);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "lastIndexOf", function() { return __WEBPACK_IMPORTED_MODULE_80__lastIndexOf_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__find_js__ = __webpack_require__(207);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "detect", function() { return __WEBPACK_IMPORTED_MODULE_81__find_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__findWhere_js__ = __webpack_require__(330);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findWhere", function() { return __WEBPACK_IMPORTED_MODULE_82__findWhere_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__each_js__ = __webpack_require__(54);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "each", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return __WEBPACK_IMPORTED_MODULE_83__each_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__map_js__ = __webpack_require__(64);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "collect", function() { return __WEBPACK_IMPORTED_MODULE_84__map_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__reduce_js__ = __webpack_require__(331);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "foldl", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "inject", function() { return __WEBPACK_IMPORTED_MODULE_85__reduce_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__ = __webpack_require__(332);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduceRight", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "foldr", function() { return __WEBPACK_IMPORTED_MODULE_86__reduceRight_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__filter_js__ = __webpack_require__(83);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_87__filter_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__reject_js__ = __webpack_require__(333);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reject", function() { return __WEBPACK_IMPORTED_MODULE_88__reject_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__every_js__ = __webpack_require__(334);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "all", function() { return __WEBPACK_IMPORTED_MODULE_89__every_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__some_js__ = __webpack_require__(335);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "some", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "any", function() { return __WEBPACK_IMPORTED_MODULE_90__some_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__contains_js__ = __webpack_require__(84);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "contains", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "includes", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "include", function() { return __WEBPACK_IMPORTED_MODULE_91__contains_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__invoke_js__ = __webpack_require__(336);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "invoke", function() { return __WEBPACK_IMPORTED_MODULE_92__invoke_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__pluck_js__ = __webpack_require__(140);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_93__pluck_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__where_js__ = __webpack_require__(337);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "where", function() { return __WEBPACK_IMPORTED_MODULE_94__where_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__max_js__ = __webpack_require__(209);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_95__max_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__min_js__ = __webpack_require__(338);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_96__min_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__shuffle_js__ = __webpack_require__(339);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "shuffle", function() { return __WEBPACK_IMPORTED_MODULE_97__shuffle_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__sample_js__ = __webpack_require__(210);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_98__sample_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__sortBy_js__ = __webpack_require__(340);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sortBy", function() { return __WEBPACK_IMPORTED_MODULE_99__sortBy_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__groupBy_js__ = __webpack_require__(341);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_100__groupBy_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__indexBy_js__ = __webpack_require__(342);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "indexBy", function() { return __WEBPACK_IMPORTED_MODULE_101__indexBy_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__countBy_js__ = __webpack_require__(343);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "countBy", function() { return __WEBPACK_IMPORTED_MODULE_102__countBy_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_103__partition_js__ = __webpack_require__(344);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_103__partition_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_104__toArray_js__ = __webpack_require__(345);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_104__toArray_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_105__size_js__ = __webpack_require__(346);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "size", function() { return __WEBPACK_IMPORTED_MODULE_105__size_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_106__pick_js__ = __webpack_require__(211);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pick", function() { return __WEBPACK_IMPORTED_MODULE_106__pick_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_107__omit_js__ = __webpack_require__(348);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "omit", function() { return __WEBPACK_IMPORTED_MODULE_107__omit_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_108__first_js__ = __webpack_require__(349);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "head", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_108__first_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_109__initial_js__ = __webpack_require__(212);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "initial", function() { return __WEBPACK_IMPORTED_MODULE_109__initial_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_110__last_js__ = __webpack_require__(350);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_110__last_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_111__rest_js__ = __webpack_require__(213);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "rest", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "drop", function() { return __WEBPACK_IMPORTED_MODULE_111__rest_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_112__compact_js__ = __webpack_require__(351);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compact", function() { return __WEBPACK_IMPORTED_MODULE_112__compact_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_113__flatten_js__ = __webpack_require__(352);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return __WEBPACK_IMPORTED_MODULE_113__flatten_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_114__without_js__ = __webpack_require__(353);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "without", function() { return __WEBPACK_IMPORTED_MODULE_114__without_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_115__uniq_js__ = __webpack_require__(215);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "uniq", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unique", function() { return __WEBPACK_IMPORTED_MODULE_115__uniq_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_116__union_js__ = __webpack_require__(354);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "union", function() { return __WEBPACK_IMPORTED_MODULE_116__union_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_117__intersection_js__ = __webpack_require__(355);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "intersection", function() { return __WEBPACK_IMPORTED_MODULE_117__intersection_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_118__difference_js__ = __webpack_require__(214);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "difference", function() { return __WEBPACK_IMPORTED_MODULE_118__difference_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_119__unzip_js__ = __webpack_require__(216);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "unzip", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return __WEBPACK_IMPORTED_MODULE_119__unzip_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_120__zip_js__ = __webpack_require__(356);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_120__zip_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_121__object_js__ = __webpack_require__(357);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "object", function() { return __WEBPACK_IMPORTED_MODULE_121__object_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_122__range_js__ = __webpack_require__(358);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_122__range_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_123__chunk_js__ = __webpack_require__(359);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "chunk", function() { return __WEBPACK_IMPORTED_MODULE_123__chunk_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_124__mixin_js__ = __webpack_require__(360);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mixin", function() { return __WEBPACK_IMPORTED_MODULE_124__mixin_js__["a"]; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__ = __webpack_require__(361);
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return __WEBPACK_IMPORTED_MODULE_125__underscore_array_methods_js__["a"]; });
- // Named Exports
- // =============
- // Underscore.js 1.12.1
- // https://underscorejs.org
- // (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- // Underscore may be freely distributed under the MIT license.
- // Baseline setup.
- // Object Functions
- // ----------------
- // Our most fundamental functions operate on any JavaScript object.
- // Most functions in Underscore depend on at least one function in this section.
- // A group of functions that check the types of core JavaScript values.
- // These are often informally referred to as the "isType" functions.
- // Functions that treat an object as a dictionary of key-value pairs.
- // Utility Functions
- // -----------------
- // A bit of a grab bag: Predicate-generating functions for use with filters and
- // loops, string escaping and templating, create random numbers and unique ids,
- // and functions that facilitate Underscore's chaining and iteration conventions.
- // Function (ahem) Functions
- // -------------------------
- // These functions take a function as an argument and return a new function
- // as the result. Also known as higher-order functions.
- // Finders
- // -------
- // Functions that extract (the position of) a single element from an object
- // or array based on some criterion.
- // Collection Functions
- // --------------------
- // Functions that work on any collection of elements: either an array, or
- // an object of key-value pairs.
- // `_.pick` and `_.omit` are actually object functions, but we put
- // them here in order to create a more natural reading order in the
- // monolithic build as they depend on `_.contains`.
- // Array Functions
- // ---------------
- // Functions that operate on arrays (and array-likes) only, because they’re
- // expressed in terms of operations on an ordered list of values.
- // OOP
- // ---
- // These modules support the "object-oriented" calling style. See also
- // `underscore.js` and `index-default.js`.
- /***/ }),
- /* 127 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('String'));
- /***/ }),
- /* 128 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isArrayBuffer_js__ = __webpack_require__(174);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__ = __webpack_require__(79);
- var isDataView = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('DataView');
- // In IE 10 - Edge 13, we need a different heuristic
- // to determine whether an object is a `DataView`.
- function ie10IsDataView(obj) {
- 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);
- }
- /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_3__stringTagBug_js__["a" /* hasStringTagBug */] ? ie10IsDataView : isDataView);
- /***/ }),
- /* 129 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(40);
- var isArguments = Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Arguments');
- // Define a fallback version of the method in browsers (ahem, IE < 9), where
- // there isn't any inspectable "Arguments" type.
- (function() {
- if (!isArguments(arguments)) {
- isArguments = function(obj) {
- return Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(obj, 'callee');
- };
- }
- }());
- /* harmony default export */ __webpack_exports__["a"] = (isArguments);
- /***/ }),
- /* 130 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__ = __webpack_require__(179);
- // Internal helper to obtain the `byteLength` property of an object.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__shallowProperty_js__["a" /* default */])('byteLength'));
- /***/ }),
- /* 131 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = ie11fingerprint;
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return mapMethods; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return weakMapMethods; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return setMethods; });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__allKeys_js__ = __webpack_require__(80);
- // Since the regular `Object.prototype.toString` type tests don't work for
- // some types in IE 11, we use a fingerprinting heuristic instead, based
- // on the methods. It's not great, but it's the best we got.
- // The fingerprint method lists are defined below.
- function ie11fingerprint(methods) {
- var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(methods);
- return function(obj) {
- if (obj == null) return false;
- // `Map`, `WeakMap` and `Set` have no enumerable keys.
- var keys = Object(__WEBPACK_IMPORTED_MODULE_2__allKeys_js__["a" /* default */])(obj);
- if (Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(keys)) return false;
- for (var i = 0; i < length; i++) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj[methods[i]])) return false;
- }
- // If we are testing against `WeakMap`, we need to ensure that
- // `obj` doesn't have a `forEach` method in order to distinguish
- // it from a regular `Map`.
- return methods !== weakMapMethods || !Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(obj[forEachName]);
- };
- }
- // In the interest of compact minification, we write
- // each string in the fingerprints only once.
- var forEachName = 'forEach',
- hasName = 'has',
- commonInit = ['clear', 'delete'],
- mapTail = ['get', hasName, 'set'];
- // `Map`, `WeakMap` and `Set` each have slightly different
- // combinations of the above sublists.
- var mapMethods = commonInit.concat(forEachName, mapTail),
- weakMapMethods = commonInit.concat(mapTail),
- setMethods = ['add'].concat(commonInit, forEachName, hasName);
- /***/ }),
- /* 132 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = createAssigner;
- // An internal function for creating assigner functions.
- function createAssigner(keysFunc, defaults) {
- return function(obj) {
- var length = arguments.length;
- if (defaults) obj = Object(obj);
- if (length < 2 || obj == null) return obj;
- for (var index = 1; index < length; index++) {
- var source = arguments[index],
- keys = keysFunc(source),
- l = keys.length;
- for (var i = 0; i < l; i++) {
- var key = keys[i];
- if (!defaults || obj[key] === void 0) obj[key] = source[key];
- }
- }
- return obj;
- };
- }
- /***/ }),
- /* 133 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(132);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
- // Assigns a given object with all the own properties in the passed-in
- // object(s).
- // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */]));
- /***/ }),
- /* 134 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = deepGet;
- // Internal function to obtain a nested property in `obj` along `path`.
- function deepGet(obj, path) {
- var length = path.length;
- for (var i = 0; i < length; i++) {
- if (obj == null) return void 0;
- obj = obj[path[i]];
- }
- return length ? obj : void 0;
- }
- /***/ }),
- /* 135 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = identity;
- // Keep the identity function around for default iteratees.
- function identity(value) {
- return value;
- }
- /***/ }),
- /* 136 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = property;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__deepGet_js__ = __webpack_require__(134);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(81);
- // Creates a function that, when passed an object, will traverse that object’s
- // properties down the given `path`, specified as an array of keys or indices.
- function property(path) {
- path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
- return function(obj) {
- return Object(__WEBPACK_IMPORTED_MODULE_0__deepGet_js__["a" /* default */])(obj, path);
- };
- }
- /***/ }),
- /* 137 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // A (possibly faster) way to get the current timestamp as an integer.
- /* harmony default export */ __webpack_exports__["a"] = (Date.now || function() {
- return new Date().getTime();
- });
- /***/ }),
- /* 138 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = negate;
- // Returns a negated version of the passed-in predicate.
- function negate(predicate) {
- return function() {
- return !predicate.apply(this, arguments);
- };
- }
- /***/ }),
- /* 139 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(202);
- // Returns the first index on an array-like that passes a truth test.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" /* default */])(1));
- /***/ }),
- /* 140 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = pluck;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__map_js__ = __webpack_require__(64);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__property_js__ = __webpack_require__(136);
- // Convenience version of a common use case of `_.map`: fetching a property.
- function pluck(obj, key) {
- return Object(__WEBPACK_IMPORTED_MODULE_0__map_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__property_js__["a" /* default */])(key));
- }
- /***/ }),
- /* 141 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(371);
- /***/ }),
- /* 142 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(222);
- /***/ }),
- /* 143 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(230);
- /***/ }),
- /* 144 */
- /***/ (function(module, exports, __webpack_require__) {
- var wellKnownSymbol = __webpack_require__(9);
- exports.f = wellKnownSymbol;
- /***/ }),
- /* 145 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(477);
- /***/ }),
- /* 146 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineBuiltIn = __webpack_require__(39);
- module.exports = function (target, src, options) {
- for (var key in src) {
- if (options && options.unsafe && target[key]) target[key] = src[key];
- else defineBuiltIn(target, key, src[key], options);
- } return target;
- };
- /***/ }),
- /* 147 */
- /***/ (function(module, exports, __webpack_require__) {
- /* eslint-disable es-x/no-symbol -- required for testing */
- var NATIVE_SYMBOL = __webpack_require__(57);
- module.exports = NATIVE_SYMBOL
- && !Symbol.sham
- && typeof Symbol.iterator == 'symbol';
- /***/ }),
- /* 148 */
- /***/ (function(module, exports, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__(16);
- var fails = __webpack_require__(3);
- var createElement = __webpack_require__(118);
- // Thanks to IE8 for its funny defineProperty
- module.exports = !DESCRIPTORS && !fails(function () {
- // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
- return Object.defineProperty(createElement('div'), 'a', {
- get: function () { return 7; }
- }).a != 7;
- });
- /***/ }),
- /* 149 */
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__(3);
- var isCallable = __webpack_require__(7);
- var replacement = /#|\.prototype\./;
- var isForced = function (feature, detection) {
- var value = data[normalize(feature)];
- return value == POLYFILL ? true
- : value == NATIVE ? false
- : isCallable(detection) ? fails(detection)
- : !!detection;
- };
- var normalize = isForced.normalize = function (string) {
- return String(string).replace(replacement, '.').toLowerCase();
- };
- var data = isForced.data = {};
- var NATIVE = isForced.NATIVE = 'N';
- var POLYFILL = isForced.POLYFILL = 'P';
- module.exports = isForced;
- /***/ }),
- /* 150 */
- /***/ (function(module, exports, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__(16);
- var fails = __webpack_require__(3);
- // V8 ~ Chrome 36-
- // https://bugs.chromium.org/p/v8/issues/detail?id=3334
- module.exports = DESCRIPTORS && fails(function () {
- // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
- return Object.defineProperty(function () { /* empty */ }, 'prototype', {
- value: 42,
- writable: false
- }).prototype != 42;
- });
- /***/ }),
- /* 151 */
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__(3);
- module.exports = !fails(function () {
- function F() { /* empty */ }
- F.prototype.constructor = null;
- // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
- return Object.getPrototypeOf(new F()) !== F.prototype;
- });
- /***/ }),
- /* 152 */
- /***/ (function(module, exports, __webpack_require__) {
- var uncurryThis = __webpack_require__(4);
- var hasOwn = __webpack_require__(14);
- var toIndexedObject = __webpack_require__(33);
- var indexOf = __webpack_require__(153).indexOf;
- var hiddenKeys = __webpack_require__(74);
- var push = uncurryThis([].push);
- module.exports = function (object, names) {
- var O = toIndexedObject(object);
- var i = 0;
- var result = [];
- var key;
- for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
- // Don't enum bug & hidden keys
- while (names.length > i) if (hasOwn(O, key = names[i++])) {
- ~indexOf(result, key) || push(result, key);
- }
- return result;
- };
- /***/ }),
- /* 153 */
- /***/ (function(module, exports, __webpack_require__) {
- var toIndexedObject = __webpack_require__(33);
- var toAbsoluteIndex = __webpack_require__(119);
- var lengthOfArrayLike = __webpack_require__(46);
- // `Array.prototype.{ indexOf, includes }` methods implementation
- var createMethod = function (IS_INCLUDES) {
- return function ($this, el, fromIndex) {
- var O = toIndexedObject($this);
- var length = lengthOfArrayLike(O);
- var index = toAbsoluteIndex(fromIndex, length);
- var value;
- // Array#includes uses SameValueZero equality algorithm
- // eslint-disable-next-line no-self-compare -- NaN check
- if (IS_INCLUDES && el != el) while (length > index) {
- value = O[index++];
- // eslint-disable-next-line no-self-compare -- NaN check
- if (value != value) return true;
- // Array#indexOf ignores holes, Array#includes - not
- } else for (;length > index; index++) {
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
- } return !IS_INCLUDES && -1;
- };
- };
- module.exports = {
- // `Array.prototype.includes` method
- // https://tc39.es/ecma262/#sec-array.prototype.includes
- includes: createMethod(true),
- // `Array.prototype.indexOf` method
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
- indexOf: createMethod(false)
- };
- /***/ }),
- /* 154 */
- /***/ (function(module, exports, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__(16);
- var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(150);
- var definePropertyModule = __webpack_require__(22);
- var anObject = __webpack_require__(19);
- var toIndexedObject = __webpack_require__(33);
- var objectKeys = __webpack_require__(98);
- // `Object.defineProperties` method
- // https://tc39.es/ecma262/#sec-object.defineproperties
- // eslint-disable-next-line es-x/no-object-defineproperties -- safe
- exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
- anObject(O);
- var props = toIndexedObject(Properties);
- var keys = objectKeys(Properties);
- var length = keys.length;
- var index = 0;
- var key;
- while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
- return O;
- };
- /***/ }),
- /* 155 */
- /***/ (function(module, exports, __webpack_require__) {
- var getBuiltIn = __webpack_require__(18);
- module.exports = getBuiltIn('document', 'documentElement');
- /***/ }),
- /* 156 */
- /***/ (function(module, exports, __webpack_require__) {
- var wellKnownSymbol = __webpack_require__(9);
- var Iterators = __webpack_require__(58);
- var ITERATOR = wellKnownSymbol('iterator');
- var ArrayPrototype = Array.prototype;
- // check on default Array iterator
- module.exports = function (it) {
- return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
- };
- /***/ }),
- /* 157 */
- /***/ (function(module, exports, __webpack_require__) {
- var call = __webpack_require__(13);
- var aCallable = __webpack_require__(31);
- var anObject = __webpack_require__(19);
- var tryToString = __webpack_require__(72);
- var getIteratorMethod = __webpack_require__(99);
- var $TypeError = TypeError;
- module.exports = function (argument, usingIterator) {
- var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
- if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
- throw $TypeError(tryToString(argument) + ' is not iterable');
- };
- /***/ }),
- /* 158 */
- /***/ (function(module, exports, __webpack_require__) {
- var call = __webpack_require__(13);
- var anObject = __webpack_require__(19);
- var getMethod = __webpack_require__(116);
- module.exports = function (iterator, kind, value) {
- var innerResult, innerError;
- anObject(iterator);
- try {
- innerResult = getMethod(iterator, 'return');
- if (!innerResult) {
- if (kind === 'throw') throw value;
- return value;
- }
- innerResult = call(innerResult, iterator);
- } catch (error) {
- innerError = true;
- innerResult = error;
- }
- if (kind === 'throw') throw value;
- if (innerError) throw innerResult;
- anObject(innerResult);
- return value;
- };
- /***/ }),
- /* 159 */
- /***/ (function(module, exports) {
- module.exports = function () { /* empty */ };
- /***/ }),
- /* 160 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(6);
- var isCallable = __webpack_require__(7);
- var inspectSource = __webpack_require__(123);
- var WeakMap = global.WeakMap;
- module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
- /***/ }),
- /* 161 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var fails = __webpack_require__(3);
- var isCallable = __webpack_require__(7);
- var create = __webpack_require__(47);
- var getPrototypeOf = __webpack_require__(93);
- var defineBuiltIn = __webpack_require__(39);
- var wellKnownSymbol = __webpack_require__(9);
- var IS_PURE = __webpack_require__(32);
- var ITERATOR = wellKnownSymbol('iterator');
- var BUGGY_SAFARI_ITERATORS = false;
- // `%IteratorPrototype%` object
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
- var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
- /* eslint-disable es-x/no-array-prototype-keys -- safe */
- if ([].keys) {
- arrayIterator = [].keys();
- // Safari 8 has buggy iterators w/o `next`
- if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
- else {
- PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
- }
- }
- var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
- var test = {};
- // FF44- legacy iterators case
- return IteratorPrototype[ITERATOR].call(test) !== test;
- });
- if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
- else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
- // `%IteratorPrototype%[@@iterator]()` method
- // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
- if (!isCallable(IteratorPrototype[ITERATOR])) {
- defineBuiltIn(IteratorPrototype, ITERATOR, function () {
- return this;
- });
- }
- module.exports = {
- IteratorPrototype: IteratorPrototype,
- BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
- };
- /***/ }),
- /* 162 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var getBuiltIn = __webpack_require__(18);
- var definePropertyModule = __webpack_require__(22);
- var wellKnownSymbol = __webpack_require__(9);
- var DESCRIPTORS = __webpack_require__(16);
- var SPECIES = wellKnownSymbol('species');
- module.exports = function (CONSTRUCTOR_NAME) {
- var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
- var defineProperty = definePropertyModule.f;
- if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
- defineProperty(Constructor, SPECIES, {
- configurable: true,
- get: function () { return this; }
- });
- }
- };
- /***/ }),
- /* 163 */
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__(19);
- var aConstructor = __webpack_require__(164);
- var wellKnownSymbol = __webpack_require__(9);
- var SPECIES = wellKnownSymbol('species');
- // `SpeciesConstructor` abstract operation
- // https://tc39.es/ecma262/#sec-speciesconstructor
- module.exports = function (O, defaultConstructor) {
- var C = anObject(O).constructor;
- var S;
- return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
- };
- /***/ }),
- /* 164 */
- /***/ (function(module, exports, __webpack_require__) {
- var isConstructor = __webpack_require__(101);
- var tryToString = __webpack_require__(72);
- var $TypeError = TypeError;
- // `Assert: IsConstructor(argument) is true`
- module.exports = function (argument) {
- if (isConstructor(argument)) return argument;
- throw $TypeError(tryToString(argument) + ' is not a constructor');
- };
- /***/ }),
- /* 165 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(6);
- var apply = __webpack_require__(69);
- var bind = __webpack_require__(45);
- var isCallable = __webpack_require__(7);
- var hasOwn = __webpack_require__(14);
- var fails = __webpack_require__(3);
- var html = __webpack_require__(155);
- var arraySlice = __webpack_require__(102);
- var createElement = __webpack_require__(118);
- var validateArgumentsLength = __webpack_require__(273);
- var IS_IOS = __webpack_require__(166);
- var IS_NODE = __webpack_require__(125);
- var set = global.setImmediate;
- var clear = global.clearImmediate;
- var process = global.process;
- var Dispatch = global.Dispatch;
- var Function = global.Function;
- var MessageChannel = global.MessageChannel;
- var String = global.String;
- var counter = 0;
- var queue = {};
- var ONREADYSTATECHANGE = 'onreadystatechange';
- var location, defer, channel, port;
- try {
- // Deno throws a ReferenceError on `location` access without `--location` flag
- location = global.location;
- } catch (error) { /* empty */ }
- var run = function (id) {
- if (hasOwn(queue, id)) {
- var fn = queue[id];
- delete queue[id];
- fn();
- }
- };
- var runner = function (id) {
- return function () {
- run(id);
- };
- };
- var listener = function (event) {
- run(event.data);
- };
- var post = function (id) {
- // old engines have not location.origin
- global.postMessage(String(id), location.protocol + '//' + location.host);
- };
- // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
- if (!set || !clear) {
- set = function setImmediate(handler) {
- validateArgumentsLength(arguments.length, 1);
- var fn = isCallable(handler) ? handler : Function(handler);
- var args = arraySlice(arguments, 1);
- queue[++counter] = function () {
- apply(fn, undefined, args);
- };
- defer(counter);
- return counter;
- };
- clear = function clearImmediate(id) {
- delete queue[id];
- };
- // Node.js 0.8-
- if (IS_NODE) {
- defer = function (id) {
- process.nextTick(runner(id));
- };
- // Sphere (JS game engine) Dispatch API
- } else if (Dispatch && Dispatch.now) {
- defer = function (id) {
- Dispatch.now(runner(id));
- };
- // Browsers with MessageChannel, includes WebWorkers
- // except iOS - https://github.com/zloirock/core-js/issues/624
- } else if (MessageChannel && !IS_IOS) {
- channel = new MessageChannel();
- port = channel.port2;
- channel.port1.onmessage = listener;
- defer = bind(port.postMessage, port);
- // Browsers with postMessage, skip WebWorkers
- // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
- } else if (
- global.addEventListener &&
- isCallable(global.postMessage) &&
- !global.importScripts &&
- location && location.protocol !== 'file:' &&
- !fails(post)
- ) {
- defer = post;
- global.addEventListener('message', listener, false);
- // IE8-
- } else if (ONREADYSTATECHANGE in createElement('script')) {
- defer = function (id) {
- html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
- html.removeChild(this);
- run(id);
- };
- };
- // Rest old browsers
- } else {
- defer = function (id) {
- setTimeout(runner(id), 0);
- };
- }
- }
- module.exports = {
- set: set,
- clear: clear
- };
- /***/ }),
- /* 166 */
- /***/ (function(module, exports, __webpack_require__) {
- var userAgent = __webpack_require__(91);
- module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
- /***/ }),
- /* 167 */
- /***/ (function(module, exports, __webpack_require__) {
- var NativePromiseConstructor = __webpack_require__(61);
- var checkCorrectnessOfIteration = __webpack_require__(168);
- var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
- module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {
- NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });
- });
- /***/ }),
- /* 168 */
- /***/ (function(module, exports, __webpack_require__) {
- var wellKnownSymbol = __webpack_require__(9);
- var ITERATOR = wellKnownSymbol('iterator');
- var SAFE_CLOSING = false;
- try {
- var called = 0;
- var iteratorWithReturn = {
- next: function () {
- return { done: !!called++ };
- },
- 'return': function () {
- SAFE_CLOSING = true;
- }
- };
- iteratorWithReturn[ITERATOR] = function () {
- return this;
- };
- // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing
- Array.from(iteratorWithReturn, function () { throw 2; });
- } catch (error) { /* empty */ }
- module.exports = function (exec, SKIP_CLOSING) {
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
- var ITERATION_SUPPORT = false;
- try {
- var object = {};
- object[ITERATOR] = function () {
- return {
- next: function () {
- return { done: ITERATION_SUPPORT = true };
- }
- };
- };
- exec(object);
- } catch (error) { /* empty */ }
- return ITERATION_SUPPORT;
- };
- /***/ }),
- /* 169 */
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__(19);
- var isObject = __webpack_require__(11);
- var newPromiseCapability = __webpack_require__(50);
- module.exports = function (C, x) {
- anObject(C);
- if (isObject(x) && x.constructor === C) return x;
- var promiseCapability = newPromiseCapability.f(C);
- var resolve = promiseCapability.resolve;
- resolve(x);
- return promiseCapability.promise;
- };
- /***/ }),
- /* 170 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = isUndefined;
- // Is a given variable undefined?
- function isUndefined(obj) {
- return obj === void 0;
- }
- /***/ }),
- /* 171 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = isBoolean;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
- // Is a given value a boolean?
- function isBoolean(obj) {
- return obj === true || obj === false || __WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj) === '[object Boolean]';
- }
- /***/ }),
- /* 172 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Number'));
- /***/ }),
- /* 173 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Symbol'));
- /***/ }),
- /* 174 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('ArrayBuffer'));
- /***/ }),
- /* 175 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = isNaN;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isNumber_js__ = __webpack_require__(172);
- // Is the given value `NaN`?
- function isNaN(obj) {
- return Object(__WEBPACK_IMPORTED_MODULE_1__isNumber_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["g" /* _isNaN */])(obj);
- }
- /***/ }),
- /* 176 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isDataView_js__ = __webpack_require__(128);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constant_js__ = __webpack_require__(177);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__ = __webpack_require__(298);
- // Is a given value a typed array?
- var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
- function isTypedArray(obj) {
- // `ArrayBuffer.isView` is the most future-proof, so use it when available.
- // Otherwise, fall back on the above regular expression.
- 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)) :
- Object(__WEBPACK_IMPORTED_MODULE_3__isBufferLike_js__["a" /* default */])(obj) && typedArrayPattern.test(__WEBPACK_IMPORTED_MODULE_0__setup_js__["t" /* toString */].call(obj));
- }
- /* 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));
- /***/ }),
- /* 177 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = constant;
- // Predicate-generating function. Often useful outside of Underscore.
- function constant(value) {
- return function() {
- return value;
- };
- }
- /***/ }),
- /* 178 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = createSizePropertyCheck;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
- // Common internal logic for `isArrayLike` and `isBufferLike`.
- function createSizePropertyCheck(getSizeProperty) {
- return function(collection) {
- var sizeProperty = getSizeProperty(collection);
- return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= __WEBPACK_IMPORTED_MODULE_0__setup_js__["b" /* MAX_ARRAY_INDEX */];
- }
- }
- /***/ }),
- /* 179 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = shallowProperty;
- // Internal helper to generate a function to obtain property `key` from `obj`.
- function shallowProperty(key) {
- return function(obj) {
- return obj == null ? void 0 : obj[key];
- };
- }
- /***/ }),
- /* 180 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = collectNonEnumProps;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__has_js__ = __webpack_require__(40);
- // Internal helper to create a simple lookup structure.
- // `collectNonEnumProps` used to depend on `_.contains`, but this led to
- // circular imports. `emulatedSet` is a one-off solution that only works for
- // arrays of strings.
- function emulatedSet(keys) {
- var hash = {};
- for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
- return {
- contains: function(key) { return hash[key]; },
- push: function(key) {
- hash[key] = true;
- return keys.push(key);
- }
- };
- }
- // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't
- // be iterated by `for key in ...` and thus missed. Extends `keys` in place if
- // needed.
- function collectNonEnumProps(obj, keys) {
- keys = emulatedSet(keys);
- var nonEnumIdx = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" /* nonEnumerableProps */].length;
- var constructor = obj.constructor;
- var proto = Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(constructor) && constructor.prototype || __WEBPACK_IMPORTED_MODULE_0__setup_js__["c" /* ObjProto */];
- // Constructor is a special case.
- var prop = 'constructor';
- if (Object(__WEBPACK_IMPORTED_MODULE_2__has_js__["a" /* default */])(obj, prop) && !keys.contains(prop)) keys.push(prop);
- while (nonEnumIdx--) {
- prop = __WEBPACK_IMPORTED_MODULE_0__setup_js__["n" /* nonEnumerableProps */][nonEnumIdx];
- if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
- keys.push(prop);
- }
- }
- }
- /***/ }),
- /* 181 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = isMatch;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
- // Returns whether an object has a given set of `key:value` pairs.
- function isMatch(object, attrs) {
- var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(attrs), length = _keys.length;
- if (object == null) return !length;
- var obj = Object(object);
- for (var i = 0; i < length; i++) {
- var key = _keys[i];
- if (attrs[key] !== obj[key] || !(key in obj)) return false;
- }
- return true;
- }
- /***/ }),
- /* 182 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = invert;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
- // Invert the keys and values of an object. The values must be serializable.
- function invert(obj) {
- var result = {};
- var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
- for (var i = 0, length = _keys.length; i < length; i++) {
- result[obj[_keys[i]]] = _keys[i];
- }
- return result;
- }
- /***/ }),
- /* 183 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = functions;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(27);
- // Return a sorted list of the function names available on the object.
- function functions(obj) {
- var names = [];
- for (var key in obj) {
- if (Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(obj[key])) names.push(key);
- }
- return names.sort();
- }
- /***/ }),
- /* 184 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(132);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(80);
- // Extend a given object with all the properties in passed-in object(s).
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" /* default */]));
- /***/ }),
- /* 185 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createAssigner_js__ = __webpack_require__(132);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__allKeys_js__ = __webpack_require__(80);
- // Fill in a given object with default properties.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createAssigner_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__allKeys_js__["a" /* default */], true));
- /***/ }),
- /* 186 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = baseCreate;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
- // Create a naked function reference for surrogate-prototype-swapping.
- function ctor() {
- return function(){};
- }
- // An internal function for creating a new object that inherits from another.
- function baseCreate(prototype) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(prototype)) return {};
- if (__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" /* nativeCreate */]) return Object(__WEBPACK_IMPORTED_MODULE_1__setup_js__["j" /* nativeCreate */])(prototype);
- var Ctor = ctor();
- Ctor.prototype = prototype;
- var result = new Ctor;
- Ctor.prototype = null;
- return result;
- }
- /***/ }),
- /* 187 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = clone;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isObject_js__ = __webpack_require__(52);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(53);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__extend_js__ = __webpack_require__(184);
- // Create a (shallow-cloned) duplicate of an object.
- function clone(obj) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_0__isObject_js__["a" /* default */])(obj)) return obj;
- return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(obj) ? obj.slice() : Object(__WEBPACK_IMPORTED_MODULE_2__extend_js__["a" /* default */])({}, obj);
- }
- /***/ }),
- /* 188 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = get;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__toPath_js__ = __webpack_require__(81);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__deepGet_js__ = __webpack_require__(134);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isUndefined_js__ = __webpack_require__(170);
- // Get the value of the (deep) property on `path` from `object`.
- // If any property in `path` does not exist or if the value is
- // `undefined`, return `defaultValue` instead.
- // The `path` is normalized through `_.toPath`.
- function get(object, path, defaultValue) {
- var value = Object(__WEBPACK_IMPORTED_MODULE_1__deepGet_js__["a" /* default */])(object, Object(__WEBPACK_IMPORTED_MODULE_0__toPath_js__["a" /* default */])(path));
- return Object(__WEBPACK_IMPORTED_MODULE_2__isUndefined_js__["a" /* default */])(value) ? defaultValue : value;
- }
- /***/ }),
- /* 189 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = toPath;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(53);
- // Normalize a (deep) property `path` to array.
- // Like `_.iteratee`, this function can be customized.
- function toPath(path) {
- return Object(__WEBPACK_IMPORTED_MODULE_1__isArray_js__["a" /* default */])(path) ? path : [path];
- }
- __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].toPath = toPath;
- /***/ }),
- /* 190 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = baseIteratee;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__identity_js__ = __webpack_require__(135);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObject_js__ = __webpack_require__(52);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArray_js__ = __webpack_require__(53);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__matcher_js__ = __webpack_require__(103);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__property_js__ = __webpack_require__(136);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__ = __webpack_require__(82);
- // An internal function to generate callbacks that can be applied to each
- // element in a collection, returning the desired result — either `_.identity`,
- // an arbitrary callback, a property matcher, or a property accessor.
- function baseIteratee(value, context, argCount) {
- if (value == null) return __WEBPACK_IMPORTED_MODULE_0__identity_js__["a" /* default */];
- if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(value)) return Object(__WEBPACK_IMPORTED_MODULE_6__optimizeCb_js__["a" /* default */])(value, context, argCount);
- 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);
- return Object(__WEBPACK_IMPORTED_MODULE_5__property_js__["a" /* default */])(value);
- }
- /***/ }),
- /* 191 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = iteratee;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__ = __webpack_require__(190);
- // External wrapper for our callback generator. Users may customize
- // `_.iteratee` if they want additional predicate/iteratee shorthand styles.
- // This abstraction hides the internal-only `argCount` argument.
- function iteratee(value, context) {
- return Object(__WEBPACK_IMPORTED_MODULE_1__baseIteratee_js__["a" /* default */])(value, context, Infinity);
- }
- __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].iteratee = iteratee;
- /***/ }),
- /* 192 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = noop;
- // Predicate-generating function. Often useful outside of Underscore.
- function noop(){}
- /***/ }),
- /* 193 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = random;
- // Return a random integer between `min` and `max` (inclusive).
- function random(min, max) {
- if (max == null) {
- max = min;
- min = 0;
- }
- return min + Math.floor(Math.random() * (max - min + 1));
- }
- /***/ }),
- /* 194 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = createEscaper;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
- // Internal helper to generate functions for escaping and unescaping strings
- // to/from HTML interpolation.
- function createEscaper(map) {
- var escaper = function(match) {
- return map[match];
- };
- // Regexes for identifying a key that needs to be escaped.
- var source = '(?:' + Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(map).join('|') + ')';
- var testRegexp = RegExp(source);
- var replaceRegexp = RegExp(source, 'g');
- return function(string) {
- string = string == null ? '' : '' + string;
- return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
- };
- }
- /***/ }),
- /* 195 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // Internal list of HTML entities for escaping.
- /* harmony default export */ __webpack_exports__["a"] = ({
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- "'": ''',
- '`': '`'
- });
- /***/ }),
- /* 196 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
- // By default, Underscore uses ERB-style template delimiters. Change the
- // following template settings to use alternative delimiters.
- /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].templateSettings = {
- evaluate: /<%([\s\S]+?)%>/g,
- interpolate: /<%=([\s\S]+?)%>/g,
- escape: /<%-([\s\S]+?)%>/g
- });
- /***/ }),
- /* 197 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = executeBound;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(186);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isObject_js__ = __webpack_require__(52);
- // Internal function to execute `sourceFunc` bound to `context` with optional
- // `args`. Determines whether to execute a function as a constructor or as a
- // normal function.
- function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
- if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
- var self = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" /* default */])(sourceFunc.prototype);
- var result = sourceFunc.apply(self, args);
- if (Object(__WEBPACK_IMPORTED_MODULE_1__isObject_js__["a" /* default */])(result)) return result;
- return self;
- }
- /***/ }),
- /* 198 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__executeBound_js__ = __webpack_require__(197);
- // Create a function bound to a given object (assigning `this`, and arguments,
- // optionally).
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, context, args) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(func)) throw new TypeError('Bind must be called on a function');
- var bound = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(callArgs) {
- return Object(__WEBPACK_IMPORTED_MODULE_2__executeBound_js__["a" /* default */])(func, bound, context, this, args.concat(callArgs));
- });
- return bound;
- }));
- /***/ }),
- /* 199 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
- // Delays a function for the given number of milliseconds, and then calls
- // it with the arguments supplied.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(func, wait, args) {
- return setTimeout(function() {
- return func.apply(null, args);
- }, wait);
- }));
- /***/ }),
- /* 200 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = before;
- // Returns a function that will only be executed up to (but not including) the
- // Nth call.
- function before(times, func) {
- var memo;
- return function() {
- if (--times > 0) {
- memo = func.apply(this, arguments);
- }
- if (times <= 1) func = null;
- return memo;
- };
- }
- /***/ }),
- /* 201 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = findKey;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
- // Returns the first key on an object that passes a truth test.
- function findKey(obj, predicate, context) {
- predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
- var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj), key;
- for (var i = 0, length = _keys.length; i < length; i++) {
- key = _keys[i];
- if (predicate(obj[key], key, obj)) return key;
- }
- }
- /***/ }),
- /* 202 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = createPredicateIndexFinder;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
- // Internal function to generate `_.findIndex` and `_.findLastIndex`.
- function createPredicateIndexFinder(dir) {
- return function(array, predicate, context) {
- predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
- var length = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */])(array);
- var index = dir > 0 ? 0 : length - 1;
- for (; index >= 0 && index < length; index += dir) {
- if (predicate(array[index], index, array)) return index;
- }
- return -1;
- };
- }
- /***/ }),
- /* 203 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__ = __webpack_require__(202);
- // Returns the last index on an array-like that passes a truth test.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createPredicateIndexFinder_js__["a" /* default */])(-1));
- /***/ }),
- /* 204 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = sortedIndex;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
- // Use a comparator function to figure out the smallest index at which
- // an object should be inserted so as to maintain order. Uses binary search.
- function sortedIndex(array, obj, iteratee, context) {
- iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context, 1);
- var value = iteratee(obj);
- var low = 0, high = Object(__WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */])(array);
- while (low < high) {
- var mid = Math.floor((low + high) / 2);
- if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
- }
- return low;
- }
- /***/ }),
- /* 205 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sortedIndex_js__ = __webpack_require__(204);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(139);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__createIndexFinder_js__ = __webpack_require__(206);
- // Return the position of the first occurrence of an item in an array,
- // or -1 if the item is not included in the array.
- // If the array is large and already in sort order, pass `true`
- // for **isSorted** to use binary search.
- /* 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 */]));
- /***/ }),
- /* 206 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = createIndexFinder;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isNaN_js__ = __webpack_require__(175);
- // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.
- function createIndexFinder(dir, predicateFind, sortedIndex) {
- return function(array, item, idx) {
- var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(array);
- if (typeof idx == 'number') {
- if (dir > 0) {
- i = idx >= 0 ? idx : Math.max(idx + length, i);
- } else {
- length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
- }
- } else if (sortedIndex && idx && length) {
- idx = sortedIndex(array, item);
- return array[idx] === item ? idx : -1;
- }
- if (item !== item) {
- idx = predicateFind(__WEBPACK_IMPORTED_MODULE_1__setup_js__["q" /* slice */].call(array, i, length), __WEBPACK_IMPORTED_MODULE_2__isNaN_js__["a" /* default */]);
- return idx >= 0 ? idx + i : -1;
- }
- for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
- if (array[idx] === item) return idx;
- }
- return -1;
- };
- }
- /***/ }),
- /* 207 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = find;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__findIndex_js__ = __webpack_require__(139);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__findKey_js__ = __webpack_require__(201);
- // Return the first value which passes a truth test.
- function find(obj, predicate, context) {
- 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 */];
- var key = keyFinder(obj, predicate, context);
- if (key !== void 0 && key !== -1) return obj[key];
- }
- /***/ }),
- /* 208 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = createReduce;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(82);
- // Internal helper to create a reducing function, iterating left or right.
- function createReduce(dir) {
- // Wrap code that reassigns argument variables in a separate function than
- // the one that accesses `arguments.length` to avoid a perf hit. (#1991)
- var reducer = function(obj, iteratee, memo, initial) {
- var _keys = !Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj),
- length = (_keys || obj).length,
- index = dir > 0 ? 0 : length - 1;
- if (!initial) {
- memo = obj[_keys ? _keys[index] : index];
- index += dir;
- }
- for (; index >= 0 && index < length; index += dir) {
- var currentKey = _keys ? _keys[index] : index;
- memo = iteratee(memo, obj[currentKey], currentKey, obj);
- }
- return memo;
- };
- return function(obj, iteratee, memo, context) {
- var initial = arguments.length >= 3;
- return reducer(obj, Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" /* default */])(iteratee, context, 4), memo, initial);
- };
- }
- /***/ }),
- /* 209 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = max;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(62);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(20);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(54);
- // Return the maximum element (or element-based computation).
- function max(obj, iteratee, context) {
- var result = -Infinity, lastComputed = -Infinity,
- value, computed;
- if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
- obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
- for (var i = 0, length = obj.length; i < length; i++) {
- value = obj[i];
- if (value != null && value > result) {
- result = value;
- }
- }
- } else {
- iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(iteratee, context);
- Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" /* default */])(obj, function(v, index, list) {
- computed = iteratee(v, index, list);
- if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
- result = v;
- lastComputed = computed;
- }
- });
- }
- return result;
- }
- /***/ }),
- /* 210 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = sample;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__clone_js__ = __webpack_require__(187);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__values_js__ = __webpack_require__(62);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__getLength_js__ = __webpack_require__(28);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__random_js__ = __webpack_require__(193);
- // Sample **n** random values from a collection using the modern version of the
- // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
- // If **n** is not specified, returns a single random element.
- // The internal `guard` argument allows it to work with `_.map`.
- function sample(obj, n, guard) {
- if (n == null || guard) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj)) obj = Object(__WEBPACK_IMPORTED_MODULE_2__values_js__["a" /* default */])(obj);
- return obj[Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" /* default */])(obj.length - 1)];
- }
- 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);
- var length = Object(__WEBPACK_IMPORTED_MODULE_3__getLength_js__["a" /* default */])(sample);
- n = Math.max(Math.min(n, length), 0);
- var last = length - 1;
- for (var index = 0; index < n; index++) {
- var rand = Object(__WEBPACK_IMPORTED_MODULE_4__random_js__["a" /* default */])(index, last);
- var temp = sample[index];
- sample[index] = sample[rand];
- sample[rand] = temp;
- }
- return sample.slice(0, n);
- }
- /***/ }),
- /* 211 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__ = __webpack_require__(82);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__allKeys_js__ = __webpack_require__(80);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__ = __webpack_require__(347);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__flatten_js__ = __webpack_require__(63);
- // Return a copy of the object only containing the allowed properties.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
- var result = {}, iteratee = keys[0];
- if (obj == null) return result;
- if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(iteratee)) {
- if (keys.length > 1) iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__optimizeCb_js__["a" /* default */])(iteratee, keys[1]);
- keys = Object(__WEBPACK_IMPORTED_MODULE_3__allKeys_js__["a" /* default */])(obj);
- } else {
- iteratee = __WEBPACK_IMPORTED_MODULE_4__keyInObj_js__["a" /* default */];
- keys = Object(__WEBPACK_IMPORTED_MODULE_5__flatten_js__["a" /* default */])(keys, false, false);
- obj = Object(obj);
- }
- for (var i = 0, length = keys.length; i < length; i++) {
- var key = keys[i];
- var value = obj[key];
- if (iteratee(value, key, obj)) result[key] = value;
- }
- return result;
- }));
- /***/ }),
- /* 212 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = initial;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
- // Returns everything but the last entry of the array. Especially useful on
- // the arguments object. Passing **n** will return all the values in
- // the array, excluding the last N.
- function initial(array, n, guard) {
- return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
- }
- /***/ }),
- /* 213 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = rest;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
- // Returns everything but the first entry of the `array`. Especially useful on
- // the `arguments` object. Passing an **n** will return the rest N values in the
- // `array`.
- function rest(array, n, guard) {
- return __WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, n == null || guard ? 1 : n);
- }
- /***/ }),
- /* 214 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(63);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__filter_js__ = __webpack_require__(83);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(84);
- // Take the difference between one array and a number of other arrays.
- // Only the elements present in just the first array will remain.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(array, rest) {
- rest = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" /* default */])(rest, true, true);
- return Object(__WEBPACK_IMPORTED_MODULE_2__filter_js__["a" /* default */])(array, function(value){
- return !Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(rest, value);
- });
- }));
- /***/ }),
- /* 215 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = uniq;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isBoolean_js__ = __webpack_require__(171);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__cb_js__ = __webpack_require__(20);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getLength_js__ = __webpack_require__(28);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__contains_js__ = __webpack_require__(84);
- // Produce a duplicate-free version of the array. If the array has already
- // been sorted, you have the option of using a faster algorithm.
- // The faster algorithm will not work with an iteratee if the iteratee
- // is not a one-to-one function, so providing an iteratee will disable
- // the faster algorithm.
- function uniq(array, isSorted, iteratee, context) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_0__isBoolean_js__["a" /* default */])(isSorted)) {
- context = iteratee;
- iteratee = isSorted;
- isSorted = false;
- }
- if (iteratee != null) iteratee = Object(__WEBPACK_IMPORTED_MODULE_1__cb_js__["a" /* default */])(iteratee, context);
- var result = [];
- var seen = [];
- for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_2__getLength_js__["a" /* default */])(array); i < length; i++) {
- var value = array[i],
- computed = iteratee ? iteratee(value, i, array) : value;
- if (isSorted && !iteratee) {
- if (!i || seen !== computed) result.push(value);
- seen = computed;
- } else if (iteratee) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(seen, computed)) {
- seen.push(computed);
- result.push(value);
- }
- } else if (!Object(__WEBPACK_IMPORTED_MODULE_3__contains_js__["a" /* default */])(result, value)) {
- result.push(value);
- }
- }
- return result;
- }
- /***/ }),
- /* 216 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = unzip;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__max_js__ = __webpack_require__(209);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getLength_js__ = __webpack_require__(28);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pluck_js__ = __webpack_require__(140);
- // Complement of zip. Unzip accepts an array of arrays and groups
- // each array's elements on shared indices.
- function unzip(array) {
- var length = array && Object(__WEBPACK_IMPORTED_MODULE_0__max_js__["a" /* default */])(array, __WEBPACK_IMPORTED_MODULE_1__getLength_js__["a" /* default */]).length || 0;
- var result = Array(length);
- for (var index = 0; index < length; index++) {
- result[index] = Object(__WEBPACK_IMPORTED_MODULE_2__pluck_js__["a" /* default */])(array, index);
- }
- return result;
- }
- /***/ }),
- /* 217 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = chainResult;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
- // Helper function to continue chaining intermediate results.
- function chainResult(instance, obj) {
- return instance._chain ? Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */])(obj).chain() : obj;
- }
- /***/ }),
- /* 218 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var fails = __webpack_require__(3);
- var isArray = __webpack_require__(85);
- var isObject = __webpack_require__(11);
- var toObject = __webpack_require__(34);
- var lengthOfArrayLike = __webpack_require__(46);
- var doesNotExceedSafeInteger = __webpack_require__(365);
- var createProperty = __webpack_require__(106);
- var arraySpeciesCreate = __webpack_require__(219);
- var arrayMethodHasSpeciesSupport = __webpack_require__(107);
- var wellKnownSymbol = __webpack_require__(9);
- var V8_VERSION = __webpack_require__(90);
- var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
- // We can't use this feature detection in V8 since it causes
- // deoptimization and serious performance degradation
- // https://github.com/zloirock/core-js/issues/679
- var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
- var array = [];
- array[IS_CONCAT_SPREADABLE] = false;
- return array.concat()[0] !== array;
- });
- var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
- var isConcatSpreadable = function (O) {
- if (!isObject(O)) return false;
- var spreadable = O[IS_CONCAT_SPREADABLE];
- return spreadable !== undefined ? !!spreadable : isArray(O);
- };
- var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
- // `Array.prototype.concat` method
- // https://tc39.es/ecma262/#sec-array.prototype.concat
- // with adding support of @@isConcatSpreadable and @@species
- $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- concat: function concat(arg) {
- var O = toObject(this);
- var A = arraySpeciesCreate(O, 0);
- var n = 0;
- var i, k, length, len, E;
- for (i = -1, length = arguments.length; i < length; i++) {
- E = i === -1 ? O : arguments[i];
- if (isConcatSpreadable(E)) {
- len = lengthOfArrayLike(E);
- doesNotExceedSafeInteger(n + len);
- for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
- } else {
- doesNotExceedSafeInteger(n + 1);
- createProperty(A, n++, E);
- }
- }
- A.length = n;
- return A;
- }
- });
- /***/ }),
- /* 219 */
- /***/ (function(module, exports, __webpack_require__) {
- var arraySpeciesConstructor = __webpack_require__(366);
- // `ArraySpeciesCreate` abstract operation
- // https://tc39.es/ecma262/#sec-arrayspeciescreate
- module.exports = function (originalArray, length) {
- return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
- };
- /***/ }),
- /* 220 */
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__(0);
- var getBuiltIn = __webpack_require__(18);
- var apply = __webpack_require__(69);
- var call = __webpack_require__(13);
- var uncurryThis = __webpack_require__(4);
- var fails = __webpack_require__(3);
- var isArray = __webpack_require__(85);
- var isCallable = __webpack_require__(7);
- var isObject = __webpack_require__(11);
- var isSymbol = __webpack_require__(89);
- var arraySlice = __webpack_require__(102);
- var NATIVE_SYMBOL = __webpack_require__(57);
- var $stringify = getBuiltIn('JSON', 'stringify');
- var exec = uncurryThis(/./.exec);
- var charAt = uncurryThis(''.charAt);
- var charCodeAt = uncurryThis(''.charCodeAt);
- var replace = uncurryThis(''.replace);
- var numberToString = uncurryThis(1.0.toString);
- var tester = /[\uD800-\uDFFF]/g;
- var low = /^[\uD800-\uDBFF]$/;
- var hi = /^[\uDC00-\uDFFF]$/;
- var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {
- var symbol = getBuiltIn('Symbol')();
- // MS Edge converts symbol values to JSON as {}
- return $stringify([symbol]) != '[null]'
- // WebKit converts symbol values to JSON as null
- || $stringify({ a: symbol }) != '{}'
- // V8 throws on boxed symbols
- || $stringify(Object(symbol)) != '{}';
- });
- // https://github.com/tc39/proposal-well-formed-stringify
- var ILL_FORMED_UNICODE = fails(function () {
- return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
- || $stringify('\uDEAD') !== '"\\udead"';
- });
- var stringifyWithSymbolsFix = function (it, replacer) {
- var args = arraySlice(arguments);
- var $replacer = replacer;
- if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
- if (!isArray(replacer)) replacer = function (key, value) {
- if (isCallable($replacer)) value = call($replacer, this, key, value);
- if (!isSymbol(value)) return value;
- };
- args[1] = replacer;
- return apply($stringify, null, args);
- };
- var fixIllFormed = function (match, offset, string) {
- var prev = charAt(string, offset - 1);
- var next = charAt(string, offset + 1);
- if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {
- return '\\u' + numberToString(charCodeAt(match, 0), 16);
- } return match;
- };
- if ($stringify) {
- // `JSON.stringify` method
- // https://tc39.es/ecma262/#sec-json.stringify
- $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- stringify: function stringify(it, replacer, space) {
- var args = arraySlice(arguments);
- var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
- return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;
- }
- });
- }
- /***/ }),
- /* 221 */
- /***/ (function(module, exports, __webpack_require__) {
- var rng = __webpack_require__(384);
- var bytesToUuid = __webpack_require__(385);
- function v4(options, buf, offset) {
- var i = buf && offset || 0;
- if (typeof(options) == 'string') {
- buf = options === 'binary' ? new Array(16) : null;
- options = null;
- }
- options = options || {};
- var rnds = options.random || (options.rng || rng)();
- // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
- rnds[6] = (rnds[6] & 0x0f) | 0x40;
- rnds[8] = (rnds[8] & 0x3f) | 0x80;
- // Copy bytes to buffer, if provided
- if (buf) {
- for (var ii = 0; ii < 16; ++ii) {
- buf[i + ii] = rnds[ii];
- }
- }
- return buf || bytesToUuid(rnds);
- }
- module.exports = v4;
- /***/ }),
- /* 222 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(388);
- module.exports = parent;
- /***/ }),
- /* 223 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- module.exports = '4.13.4';
- /***/ }),
- /* 224 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var has = Object.prototype.hasOwnProperty
- , prefix = '~';
- /**
- * Constructor to create a storage for our `EE` objects.
- * An `Events` instance is a plain object whose properties are event names.
- *
- * @constructor
- * @api private
- */
- function Events() {}
- //
- // We try to not inherit from `Object.prototype`. In some engines creating an
- // instance in this way is faster than calling `Object.create(null)` directly.
- // If `Object.create(null)` is not supported we prefix the event names with a
- // character to make sure that the built-in object properties are not
- // overridden or used as an attack vector.
- //
- if (Object.create) {
- Events.prototype = Object.create(null);
- //
- // This hack is needed because the `__proto__` property is still inherited in
- // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
- //
- if (!new Events().__proto__) prefix = false;
- }
- /**
- * Representation of a single event listener.
- *
- * @param {Function} fn The listener function.
- * @param {Mixed} context The context to invoke the listener with.
- * @param {Boolean} [once=false] Specify if the listener is a one-time listener.
- * @constructor
- * @api private
- */
- function EE(fn, context, once) {
- this.fn = fn;
- this.context = context;
- this.once = once || false;
- }
- /**
- * Minimal `EventEmitter` interface that is molded against the Node.js
- * `EventEmitter` interface.
- *
- * @constructor
- * @api public
- */
- function EventEmitter() {
- this._events = new Events();
- this._eventsCount = 0;
- }
- /**
- * Return an array listing the events for which the emitter has registered
- * listeners.
- *
- * @returns {Array}
- * @api public
- */
- EventEmitter.prototype.eventNames = function eventNames() {
- var names = []
- , events
- , name;
- if (this._eventsCount === 0) return names;
- for (name in (events = this._events)) {
- if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
- }
- if (Object.getOwnPropertySymbols) {
- return names.concat(Object.getOwnPropertySymbols(events));
- }
- return names;
- };
- /**
- * Return the listeners registered for a given event.
- *
- * @param {String|Symbol} event The event name.
- * @param {Boolean} exists Only check if there are listeners.
- * @returns {Array|Boolean}
- * @api public
- */
- EventEmitter.prototype.listeners = function listeners(event, exists) {
- var evt = prefix ? prefix + event : event
- , available = this._events[evt];
- if (exists) return !!available;
- if (!available) return [];
- if (available.fn) return [available.fn];
- for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {
- ee[i] = available[i].fn;
- }
- return ee;
- };
- /**
- * Calls each of the listeners registered for a given event.
- *
- * @param {String|Symbol} event The event name.
- * @returns {Boolean} `true` if the event had listeners, else `false`.
- * @api public
- */
- EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
- var evt = prefix ? prefix + event : event;
- if (!this._events[evt]) return false;
- var listeners = this._events[evt]
- , len = arguments.length
- , args
- , i;
- if (listeners.fn) {
- if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
- switch (len) {
- case 1: return listeners.fn.call(listeners.context), true;
- case 2: return listeners.fn.call(listeners.context, a1), true;
- case 3: return listeners.fn.call(listeners.context, a1, a2), true;
- case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
- case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
- case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
- }
- for (i = 1, args = new Array(len -1); i < len; i++) {
- args[i - 1] = arguments[i];
- }
- listeners.fn.apply(listeners.context, args);
- } else {
- var length = listeners.length
- , j;
- for (i = 0; i < length; i++) {
- if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
- switch (len) {
- case 1: listeners[i].fn.call(listeners[i].context); break;
- case 2: listeners[i].fn.call(listeners[i].context, a1); break;
- case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
- case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
- default:
- if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
- args[j - 1] = arguments[j];
- }
- listeners[i].fn.apply(listeners[i].context, args);
- }
- }
- }
- return true;
- };
- /**
- * Add a listener for a given event.
- *
- * @param {String|Symbol} event The event name.
- * @param {Function} fn The listener function.
- * @param {Mixed} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @api public
- */
- EventEmitter.prototype.on = function on(event, fn, context) {
- var listener = new EE(fn, context || this)
- , evt = prefix ? prefix + event : event;
- if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
- else if (!this._events[evt].fn) this._events[evt].push(listener);
- else this._events[evt] = [this._events[evt], listener];
- return this;
- };
- /**
- * Add a one-time listener for a given event.
- *
- * @param {String|Symbol} event The event name.
- * @param {Function} fn The listener function.
- * @param {Mixed} [context=this] The context to invoke the listener with.
- * @returns {EventEmitter} `this`.
- * @api public
- */
- EventEmitter.prototype.once = function once(event, fn, context) {
- var listener = new EE(fn, context || this, true)
- , evt = prefix ? prefix + event : event;
- if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;
- else if (!this._events[evt].fn) this._events[evt].push(listener);
- else this._events[evt] = [this._events[evt], listener];
- return this;
- };
- /**
- * Remove the listeners of a given event.
- *
- * @param {String|Symbol} event The event name.
- * @param {Function} fn Only remove the listeners that match this function.
- * @param {Mixed} context Only remove the listeners that have this context.
- * @param {Boolean} once Only remove one-time listeners.
- * @returns {EventEmitter} `this`.
- * @api public
- */
- EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
- var evt = prefix ? prefix + event : event;
- if (!this._events[evt]) return this;
- if (!fn) {
- if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- return this;
- }
- var listeners = this._events[evt];
- if (listeners.fn) {
- if (
- listeners.fn === fn
- && (!once || listeners.once)
- && (!context || listeners.context === context)
- ) {
- if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- }
- } else {
- for (var i = 0, events = [], length = listeners.length; i < length; i++) {
- if (
- listeners[i].fn !== fn
- || (once && !listeners[i].once)
- || (context && listeners[i].context !== context)
- ) {
- events.push(listeners[i]);
- }
- }
- //
- // Reset the array, or remove it completely if we have no more listeners.
- //
- if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
- else if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- }
- return this;
- };
- /**
- * Remove all listeners, or those of the specified event.
- *
- * @param {String|Symbol} [event] The event name.
- * @returns {EventEmitter} `this`.
- * @api public
- */
- EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
- var evt;
- if (event) {
- evt = prefix ? prefix + event : event;
- if (this._events[evt]) {
- if (--this._eventsCount === 0) this._events = new Events();
- else delete this._events[evt];
- }
- } else {
- this._events = new Events();
- this._eventsCount = 0;
- }
- return this;
- };
- //
- // Alias methods names because people roll like that.
- //
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
- EventEmitter.prototype.addListener = EventEmitter.prototype.on;
- //
- // This function doesn't apply anymore.
- //
- EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
- return this;
- };
- //
- // Expose the prefix.
- //
- EventEmitter.prefixed = prefix;
- //
- // Allow `EventEmitter` to be imported as module namespace.
- //
- EventEmitter.EventEmitter = EventEmitter;
- //
- // Expose the module.
- //
- if (true) {
- module.exports = EventEmitter;
- }
- /***/ }),
- /* 225 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _require = __webpack_require__(68),
- getAdapter = _require.getAdapter;
- var syncApiNames = ['getItem', 'setItem', 'removeItem', 'clear'];
- var localStorage = {
- get async() {
- return getAdapter('storage').async;
- }
- }; // wrap sync apis with async ones.
- syncApiNames.forEach(function (apiName) {
- localStorage[apiName + 'Async'] = function () {
- var storage = getAdapter('storage');
- return _promise.default.resolve(storage[apiName].apply(storage, arguments));
- };
- localStorage[apiName] = function () {
- var storage = getAdapter('storage');
- if (!storage.async) {
- return storage[apiName].apply(storage, arguments);
- }
- var error = new Error('Synchronous API [' + apiName + '] is not available in this runtime.');
- error.code = 'SYNC_API_NOT_AVAILABLE';
- throw error;
- };
- });
- module.exports = localStorage;
- /***/ }),
- /* 226 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _concat = _interopRequireDefault(__webpack_require__(30));
- var _stringify = _interopRequireDefault(__webpack_require__(36));
- var storage = __webpack_require__(225);
- var AV = __webpack_require__(65);
- var removeAsync = exports.removeAsync = storage.removeItemAsync.bind(storage);
- var getCacheData = function getCacheData(cacheData, key) {
- try {
- cacheData = JSON.parse(cacheData);
- } catch (e) {
- return null;
- }
- if (cacheData) {
- var expired = cacheData.expiredAt && cacheData.expiredAt < Date.now();
- if (!expired) {
- return cacheData.value;
- }
- return removeAsync(key).then(function () {
- return null;
- });
- }
- return null;
- };
- exports.getAsync = function (key) {
- var _context;
- key = (0, _concat.default)(_context = "AV/".concat(AV.applicationId, "/")).call(_context, key);
- return storage.getItemAsync(key).then(function (cache) {
- return getCacheData(cache, key);
- });
- };
- exports.setAsync = function (key, value, ttl) {
- var _context2;
- var cache = {
- value: value
- };
- if (typeof ttl === 'number') {
- cache.expiredAt = Date.now() + ttl;
- }
- return storage.setItemAsync((0, _concat.default)(_context2 = "AV/".concat(AV.applicationId, "/")).call(_context2, key), (0, _stringify.default)(cache));
- };
- /***/ }),
- /* 227 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(228);
- /***/ }),
- /* 228 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(390);
- module.exports = parent;
- /***/ }),
- /* 229 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(393);
- module.exports = parent;
- /***/ }),
- /* 230 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(396);
- module.exports = parent;
- /***/ }),
- /* 231 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(399);
- /***/ }),
- /* 232 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(402);
- __webpack_require__(51);
- module.exports = parent;
- /***/ }),
- /* 233 */
- /***/ (function(module, exports, __webpack_require__) {
- // TODO: Remove this module from `core-js@4` since it's split to modules listed below
- __webpack_require__(403);
- __webpack_require__(405);
- __webpack_require__(406);
- __webpack_require__(220);
- __webpack_require__(407);
- /***/ }),
- /* 234 */
- /***/ (function(module, exports, __webpack_require__) {
- /* eslint-disable es-x/no-object-getownpropertynames -- safe */
- var classof = __webpack_require__(56);
- var toIndexedObject = __webpack_require__(33);
- var $getOwnPropertyNames = __webpack_require__(96).f;
- var arraySlice = __webpack_require__(404);
- var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
- ? Object.getOwnPropertyNames(window) : [];
- var getWindowNames = function (it) {
- try {
- return $getOwnPropertyNames(it);
- } catch (error) {
- return arraySlice(windowNames);
- }
- };
- // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
- module.exports.f = function getOwnPropertyNames(it) {
- return windowNames && classof(it) == 'Window'
- ? getWindowNames(it)
- : $getOwnPropertyNames(toIndexedObject(it));
- };
- /***/ }),
- /* 235 */
- /***/ (function(module, exports, __webpack_require__) {
- var call = __webpack_require__(13);
- var getBuiltIn = __webpack_require__(18);
- var wellKnownSymbol = __webpack_require__(9);
- var defineBuiltIn = __webpack_require__(39);
- module.exports = function () {
- var Symbol = getBuiltIn('Symbol');
- var SymbolPrototype = Symbol && Symbol.prototype;
- var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
- var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
- if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
- // `Symbol.prototype[@@toPrimitive]` method
- // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
- // eslint-disable-next-line no-unused-vars -- required for .length
- defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {
- return call(valueOf, this);
- }, { arity: 1 });
- }
- };
- /***/ }),
- /* 236 */
- /***/ (function(module, exports, __webpack_require__) {
- var NATIVE_SYMBOL = __webpack_require__(57);
- /* eslint-disable es-x/no-symbol -- safe */
- module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;
- /***/ }),
- /* 237 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.iterator` well-known symbol
- // https://tc39.es/ecma262/#sec-symbol.iterator
- defineWellKnownSymbol('iterator');
- /***/ }),
- /* 238 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(436);
- __webpack_require__(51);
- module.exports = parent;
- /***/ }),
- /* 239 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(456);
- module.exports = parent;
- /***/ }),
- /* 240 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(232);
- /***/ }),
- /* 241 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(460);
- /***/ }),
- /* 242 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var uncurryThis = __webpack_require__(4);
- var aCallable = __webpack_require__(31);
- var isObject = __webpack_require__(11);
- var hasOwn = __webpack_require__(14);
- var arraySlice = __webpack_require__(102);
- var NATIVE_BIND = __webpack_require__(70);
- var $Function = Function;
- var concat = uncurryThis([].concat);
- var join = uncurryThis([].join);
- var factories = {};
- var construct = function (C, argsLength, args) {
- if (!hasOwn(factories, argsLength)) {
- for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
- factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
- } return factories[argsLength](C, args);
- };
- // `Function.prototype.bind` method implementation
- // https://tc39.es/ecma262/#sec-function.prototype.bind
- module.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {
- var F = aCallable(this);
- var Prototype = F.prototype;
- var partArgs = arraySlice(arguments, 1);
- var boundFunction = function bound(/* args... */) {
- var args = concat(partArgs, arraySlice(arguments));
- return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
- };
- if (isObject(Prototype)) boundFunction.prototype = Prototype;
- return boundFunction;
- };
- /***/ }),
- /* 243 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(481);
- /***/ }),
- /* 244 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(484);
- /***/ }),
- /* 245 */
- /***/ (function(module, exports) {
- var charenc = {
- // UTF-8 encoding
- utf8: {
- // Convert a string to a byte array
- stringToBytes: function(str) {
- return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
- },
- // Convert a byte array to a string
- bytesToString: function(bytes) {
- return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
- }
- },
- // Binary encoding
- bin: {
- // Convert a string to a byte array
- stringToBytes: function(str) {
- for (var bytes = [], i = 0; i < str.length; i++)
- bytes.push(str.charCodeAt(i) & 0xFF);
- return bytes;
- },
- // Convert a byte array to a string
- bytesToString: function(bytes) {
- for (var str = [], i = 0; i < bytes.length; i++)
- str.push(String.fromCharCode(bytes[i]));
- return str.join('');
- }
- }
- };
- module.exports = charenc;
- /***/ }),
- /* 246 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(528);
- /***/ }),
- /* 247 */
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__(3);
- var isObject = __webpack_require__(11);
- var classof = __webpack_require__(56);
- var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(561);
- // eslint-disable-next-line es-x/no-object-isextensible -- safe
- var $isExtensible = Object.isExtensible;
- var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
- // `Object.isExtensible` method
- // https://tc39.es/ecma262/#sec-object.isextensible
- module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {
- if (!isObject(it)) return false;
- if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return false;
- return $isExtensible ? $isExtensible(it) : true;
- } : $isExtensible;
- /***/ }),
- /* 248 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var global = __webpack_require__(6);
- var InternalMetadataModule = __webpack_require__(111);
- var fails = __webpack_require__(3);
- var createNonEnumerableProperty = __webpack_require__(35);
- var iterate = __webpack_require__(37);
- var anInstance = __webpack_require__(100);
- var isCallable = __webpack_require__(7);
- var isObject = __webpack_require__(11);
- var setToStringTag = __webpack_require__(49);
- var defineProperty = __webpack_require__(22).f;
- var forEach = __webpack_require__(66).forEach;
- var DESCRIPTORS = __webpack_require__(16);
- var InternalStateModule = __webpack_require__(38);
- var setInternalState = InternalStateModule.set;
- var internalStateGetterFor = InternalStateModule.getterFor;
- module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
- var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
- var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
- var ADDER = IS_MAP ? 'set' : 'add';
- var NativeConstructor = global[CONSTRUCTOR_NAME];
- var NativePrototype = NativeConstructor && NativeConstructor.prototype;
- var exported = {};
- var Constructor;
- if (!DESCRIPTORS || !isCallable(NativeConstructor)
- || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); }))
- ) {
- // create collection constructor
- Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
- InternalMetadataModule.enable();
- } else {
- Constructor = wrapper(function (target, iterable) {
- setInternalState(anInstance(target, Prototype), {
- type: CONSTRUCTOR_NAME,
- collection: new NativeConstructor()
- });
- if (iterable != undefined) iterate(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });
- });
- var Prototype = Constructor.prototype;
- var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
- forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {
- var IS_ADDER = KEY == 'add' || KEY == 'set';
- if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {
- createNonEnumerableProperty(Prototype, KEY, function (a, b) {
- var collection = getInternalState(this).collection;
- if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
- var result = collection[KEY](a === 0 ? 0 : a, b);
- return IS_ADDER ? this : result;
- });
- }
- });
- IS_WEAK || defineProperty(Prototype, 'size', {
- configurable: true,
- get: function () {
- return getInternalState(this).collection.size;
- }
- });
- }
- setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);
- exported[CONSTRUCTOR_NAME] = Constructor;
- $({ global: true, forced: true }, exported);
- if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
- return Constructor;
- };
- /***/ }),
- /* 249 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var AV = __webpack_require__(250);
- var useAdatpers = __webpack_require__(545);
- module.exports = useAdatpers(AV);
- /***/ }),
- /* 250 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- module.exports = __webpack_require__(251);
- /***/ }),
- /* 251 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _promise = _interopRequireDefault(__webpack_require__(12));
- /*!
- * LeanCloud JavaScript SDK
- * https://leancloud.cn
- *
- * Copyright 2016 LeanCloud.cn, Inc.
- * The LeanCloud JavaScript SDK is freely distributable under the MIT license.
- */
- var _ = __webpack_require__(2);
- var AV = __webpack_require__(65);
- AV._ = _;
- AV.version = __webpack_require__(223);
- AV.Promise = _promise.default;
- AV.localStorage = __webpack_require__(225);
- AV.Cache = __webpack_require__(226);
- AV.Error = __webpack_require__(43);
- __webpack_require__(392);
- __webpack_require__(443)(AV);
- __webpack_require__(444)(AV);
- __webpack_require__(445)(AV);
- __webpack_require__(446)(AV);
- __webpack_require__(451)(AV);
- __webpack_require__(452)(AV);
- __webpack_require__(506)(AV);
- __webpack_require__(531)(AV);
- __webpack_require__(532)(AV);
- __webpack_require__(534)(AV);
- __webpack_require__(535)(AV);
- __webpack_require__(536)(AV);
- __webpack_require__(537)(AV);
- __webpack_require__(538)(AV);
- __webpack_require__(539)(AV);
- __webpack_require__(540)(AV);
- __webpack_require__(541)(AV);
- __webpack_require__(542)(AV);
- AV.Conversation = __webpack_require__(543);
- __webpack_require__(544);
- module.exports = AV;
- /**
- * Options to controll the authentication for an operation
- * @typedef {Object} AuthOptions
- * @property {String} [sessionToken] Specify a user to excute the operation as.
- * @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.
- * @property {Boolean} [useMasterKey] Indicates whether masterKey is used for this operation. Only valid when masterKey is set.
- */
- /**
- * Options to controll the authentication for an SMS operation
- * @typedef {Object} SMSAuthOptions
- * @property {String} [sessionToken] Specify a user to excute the operation as.
- * @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.
- * @property {Boolean} [useMasterKey] Indicates whether masterKey is used for this operation. Only valid when masterKey is set.
- * @property {String} [validateToken] a validate token returned by {@link AV.Cloud.verifyCaptcha}
- */
- /***/ }),
- /* 252 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(253);
- __webpack_require__(51);
- module.exports = parent;
- /***/ }),
- /* 253 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(254);
- __webpack_require__(48);
- __webpack_require__(60);
- __webpack_require__(271);
- __webpack_require__(285);
- __webpack_require__(286);
- __webpack_require__(287);
- __webpack_require__(78);
- var path = __webpack_require__(10);
- module.exports = path.Promise;
- /***/ }),
- /* 254 */
- /***/ (function(module, exports, __webpack_require__) {
- // TODO: Remove this module from `core-js@4` since it's replaced to module below
- __webpack_require__(255);
- /***/ }),
- /* 255 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var isPrototypeOf = __webpack_require__(21);
- var getPrototypeOf = __webpack_require__(93);
- var setPrototypeOf = __webpack_require__(95);
- var copyConstructorProperties = __webpack_require__(260);
- var create = __webpack_require__(47);
- var createNonEnumerableProperty = __webpack_require__(35);
- var createPropertyDescriptor = __webpack_require__(44);
- var clearErrorStack = __webpack_require__(264);
- var installErrorCause = __webpack_require__(265);
- var iterate = __webpack_require__(37);
- var normalizeStringArgument = __webpack_require__(266);
- var wellKnownSymbol = __webpack_require__(9);
- var ERROR_STACK_INSTALLABLE = __webpack_require__(267);
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
- var $Error = Error;
- var push = [].push;
- var $AggregateError = function AggregateError(errors, message /* , options */) {
- var options = arguments.length > 2 ? arguments[2] : undefined;
- var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
- var that;
- if (setPrototypeOf) {
- that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
- } else {
- that = isInstance ? this : create(AggregateErrorPrototype);
- createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
- }
- if (message !== undefined) createNonEnumerableProperty(that, 'message', normalizeStringArgument(message));
- if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1));
- installErrorCause(that, options);
- var errorsArray = [];
- iterate(errors, push, { that: errorsArray });
- createNonEnumerableProperty(that, 'errors', errorsArray);
- return that;
- };
- if (setPrototypeOf) setPrototypeOf($AggregateError, $Error);
- else copyConstructorProperties($AggregateError, $Error, { name: true });
- var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, {
- constructor: createPropertyDescriptor(1, $AggregateError),
- message: createPropertyDescriptor(1, ''),
- name: createPropertyDescriptor(1, 'AggregateError')
- });
- // `AggregateError` constructor
- // https://tc39.es/ecma262/#sec-aggregate-error-constructor
- $({ global: true, constructor: true, arity: 2 }, {
- AggregateError: $AggregateError
- });
- /***/ }),
- /* 256 */
- /***/ (function(module, exports, __webpack_require__) {
- var call = __webpack_require__(13);
- var isObject = __webpack_require__(11);
- var isSymbol = __webpack_require__(89);
- var getMethod = __webpack_require__(116);
- var ordinaryToPrimitive = __webpack_require__(257);
- var wellKnownSymbol = __webpack_require__(9);
- var $TypeError = TypeError;
- var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
- // `ToPrimitive` abstract operation
- // https://tc39.es/ecma262/#sec-toprimitive
- module.exports = function (input, pref) {
- if (!isObject(input) || isSymbol(input)) return input;
- var exoticToPrim = getMethod(input, TO_PRIMITIVE);
- var result;
- if (exoticToPrim) {
- if (pref === undefined) pref = 'default';
- result = call(exoticToPrim, input, pref);
- if (!isObject(result) || isSymbol(result)) return result;
- throw $TypeError("Can't convert object to primitive value");
- }
- if (pref === undefined) pref = 'number';
- return ordinaryToPrimitive(input, pref);
- };
- /***/ }),
- /* 257 */
- /***/ (function(module, exports, __webpack_require__) {
- var call = __webpack_require__(13);
- var isCallable = __webpack_require__(7);
- var isObject = __webpack_require__(11);
- var $TypeError = TypeError;
- // `OrdinaryToPrimitive` abstract operation
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
- module.exports = function (input, pref) {
- var fn, val;
- if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
- if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
- if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
- throw $TypeError("Can't convert object to primitive value");
- };
- /***/ }),
- /* 258 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(6);
- // eslint-disable-next-line es-x/no-object-defineproperty -- safe
- var defineProperty = Object.defineProperty;
- module.exports = function (key, value) {
- try {
- defineProperty(global, key, { value: value, configurable: true, writable: true });
- } catch (error) {
- global[key] = value;
- } return value;
- };
- /***/ }),
- /* 259 */
- /***/ (function(module, exports, __webpack_require__) {
- var isCallable = __webpack_require__(7);
- var $String = String;
- var $TypeError = TypeError;
- module.exports = function (argument) {
- if (typeof argument == 'object' || isCallable(argument)) return argument;
- throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
- };
- /***/ }),
- /* 260 */
- /***/ (function(module, exports, __webpack_require__) {
- var hasOwn = __webpack_require__(14);
- var ownKeys = __webpack_require__(261);
- var getOwnPropertyDescriptorModule = __webpack_require__(71);
- var definePropertyModule = __webpack_require__(22);
- module.exports = function (target, source, exceptions) {
- var keys = ownKeys(source);
- var defineProperty = definePropertyModule.f;
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
- if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
- defineProperty(target, key, getOwnPropertyDescriptor(source, key));
- }
- }
- };
- /***/ }),
- /* 261 */
- /***/ (function(module, exports, __webpack_require__) {
- var getBuiltIn = __webpack_require__(18);
- var uncurryThis = __webpack_require__(4);
- var getOwnPropertyNamesModule = __webpack_require__(96);
- var getOwnPropertySymbolsModule = __webpack_require__(97);
- var anObject = __webpack_require__(19);
- var concat = uncurryThis([].concat);
- // all object keys, includes non-enumerable and symbols
- module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
- var keys = getOwnPropertyNamesModule.f(anObject(it));
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
- return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
- };
- /***/ }),
- /* 262 */
- /***/ (function(module, exports) {
- var ceil = Math.ceil;
- var floor = Math.floor;
- // `Math.trunc` method
- // https://tc39.es/ecma262/#sec-math.trunc
- // eslint-disable-next-line es-x/no-math-trunc -- safe
- module.exports = Math.trunc || function trunc(x) {
- var n = +x;
- return (n > 0 ? floor : ceil)(n);
- };
- /***/ }),
- /* 263 */
- /***/ (function(module, exports, __webpack_require__) {
- var toIntegerOrInfinity = __webpack_require__(120);
- var min = Math.min;
- // `ToLength` abstract operation
- // https://tc39.es/ecma262/#sec-tolength
- module.exports = function (argument) {
- return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
- };
- /***/ }),
- /* 264 */
- /***/ (function(module, exports, __webpack_require__) {
- var uncurryThis = __webpack_require__(4);
- var $Error = Error;
- var replace = uncurryThis(''.replace);
- var TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');
- var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
- var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
- module.exports = function (stack, dropEntries) {
- if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
- while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
- } return stack;
- };
- /***/ }),
- /* 265 */
- /***/ (function(module, exports, __webpack_require__) {
- var isObject = __webpack_require__(11);
- var createNonEnumerableProperty = __webpack_require__(35);
- // `InstallErrorCause` abstract operation
- // https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
- module.exports = function (O, options) {
- if (isObject(options) && 'cause' in options) {
- createNonEnumerableProperty(O, 'cause', options.cause);
- }
- };
- /***/ }),
- /* 266 */
- /***/ (function(module, exports, __webpack_require__) {
- var toString = __webpack_require__(75);
- module.exports = function (argument, $default) {
- return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
- };
- /***/ }),
- /* 267 */
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__(3);
- var createPropertyDescriptor = __webpack_require__(44);
- module.exports = !fails(function () {
- var error = Error('a');
- if (!('stack' in error)) return true;
- // eslint-disable-next-line es-x/no-object-defineproperty -- safe
- Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
- return error.stack !== 7;
- });
- /***/ }),
- /* 268 */
- /***/ (function(module, exports, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__(16);
- var hasOwn = __webpack_require__(14);
- var FunctionPrototype = Function.prototype;
- // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
- var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
- var EXISTS = hasOwn(FunctionPrototype, 'name');
- // additional protection from minified / mangled / dropped function names
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
- module.exports = {
- EXISTS: EXISTS,
- PROPER: PROPER,
- CONFIGURABLE: CONFIGURABLE
- };
- /***/ }),
- /* 269 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var IteratorPrototype = __webpack_require__(161).IteratorPrototype;
- var create = __webpack_require__(47);
- var createPropertyDescriptor = __webpack_require__(44);
- var setToStringTag = __webpack_require__(49);
- var Iterators = __webpack_require__(58);
- var returnThis = function () { return this; };
- module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
- var TO_STRING_TAG = NAME + ' Iterator';
- IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
- setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
- Iterators[TO_STRING_TAG] = returnThis;
- return IteratorConstructor;
- };
- /***/ }),
- /* 270 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var TO_STRING_TAG_SUPPORT = __webpack_require__(122);
- var classof = __webpack_require__(59);
- // `Object.prototype.toString` method implementation
- // https://tc39.es/ecma262/#sec-object.prototype.tostring
- module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
- return '[object ' + classof(this) + ']';
- };
- /***/ }),
- /* 271 */
- /***/ (function(module, exports, __webpack_require__) {
- // TODO: Remove this module from `core-js@4` since it's split to modules listed below
- __webpack_require__(272);
- __webpack_require__(280);
- __webpack_require__(281);
- __webpack_require__(282);
- __webpack_require__(283);
- __webpack_require__(284);
- /***/ }),
- /* 272 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var IS_PURE = __webpack_require__(32);
- var IS_NODE = __webpack_require__(125);
- var global = __webpack_require__(6);
- var call = __webpack_require__(13);
- var defineBuiltIn = __webpack_require__(39);
- var setPrototypeOf = __webpack_require__(95);
- var setToStringTag = __webpack_require__(49);
- var setSpecies = __webpack_require__(162);
- var aCallable = __webpack_require__(31);
- var isCallable = __webpack_require__(7);
- var isObject = __webpack_require__(11);
- var anInstance = __webpack_require__(100);
- var speciesConstructor = __webpack_require__(163);
- var task = __webpack_require__(165).set;
- var microtask = __webpack_require__(274);
- var hostReportErrors = __webpack_require__(277);
- var perform = __webpack_require__(76);
- var Queue = __webpack_require__(278);
- var InternalStateModule = __webpack_require__(38);
- var NativePromiseConstructor = __webpack_require__(61);
- var PromiseConstructorDetection = __webpack_require__(77);
- var newPromiseCapabilityModule = __webpack_require__(50);
- var PROMISE = 'Promise';
- var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
- var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
- var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
- var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
- var setInternalState = InternalStateModule.set;
- var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
- var PromiseConstructor = NativePromiseConstructor;
- var PromisePrototype = NativePromisePrototype;
- var TypeError = global.TypeError;
- var document = global.document;
- var process = global.process;
- var newPromiseCapability = newPromiseCapabilityModule.f;
- var newGenericPromiseCapability = newPromiseCapability;
- var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
- var UNHANDLED_REJECTION = 'unhandledrejection';
- var REJECTION_HANDLED = 'rejectionhandled';
- var PENDING = 0;
- var FULFILLED = 1;
- var REJECTED = 2;
- var HANDLED = 1;
- var UNHANDLED = 2;
- var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
- // helpers
- var isThenable = function (it) {
- var then;
- return isObject(it) && isCallable(then = it.then) ? then : false;
- };
- var callReaction = function (reaction, state) {
- var value = state.value;
- var ok = state.state == FULFILLED;
- var handler = ok ? reaction.ok : reaction.fail;
- var resolve = reaction.resolve;
- var reject = reaction.reject;
- var domain = reaction.domain;
- var result, then, exited;
- try {
- if (handler) {
- if (!ok) {
- if (state.rejection === UNHANDLED) onHandleUnhandled(state);
- state.rejection = HANDLED;
- }
- if (handler === true) result = value;
- else {
- if (domain) domain.enter();
- result = handler(value); // can throw
- if (domain) {
- domain.exit();
- exited = true;
- }
- }
- if (result === reaction.promise) {
- reject(TypeError('Promise-chain cycle'));
- } else if (then = isThenable(result)) {
- call(then, result, resolve, reject);
- } else resolve(result);
- } else reject(value);
- } catch (error) {
- if (domain && !exited) domain.exit();
- reject(error);
- }
- };
- var notify = function (state, isReject) {
- if (state.notified) return;
- state.notified = true;
- microtask(function () {
- var reactions = state.reactions;
- var reaction;
- while (reaction = reactions.get()) {
- callReaction(reaction, state);
- }
- state.notified = false;
- if (isReject && !state.rejection) onUnhandled(state);
- });
- };
- var dispatchEvent = function (name, promise, reason) {
- var event, handler;
- if (DISPATCH_EVENT) {
- event = document.createEvent('Event');
- event.promise = promise;
- event.reason = reason;
- event.initEvent(name, false, true);
- global.dispatchEvent(event);
- } else event = { promise: promise, reason: reason };
- if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
- else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
- };
- var onUnhandled = function (state) {
- call(task, global, function () {
- var promise = state.facade;
- var value = state.value;
- var IS_UNHANDLED = isUnhandled(state);
- var result;
- if (IS_UNHANDLED) {
- result = perform(function () {
- if (IS_NODE) {
- process.emit('unhandledRejection', value, promise);
- } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
- });
- // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
- state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
- if (result.error) throw result.value;
- }
- });
- };
- var isUnhandled = function (state) {
- return state.rejection !== HANDLED && !state.parent;
- };
- var onHandleUnhandled = function (state) {
- call(task, global, function () {
- var promise = state.facade;
- if (IS_NODE) {
- process.emit('rejectionHandled', promise);
- } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
- });
- };
- var bind = function (fn, state, unwrap) {
- return function (value) {
- fn(state, value, unwrap);
- };
- };
- var internalReject = function (state, value, unwrap) {
- if (state.done) return;
- state.done = true;
- if (unwrap) state = unwrap;
- state.value = value;
- state.state = REJECTED;
- notify(state, true);
- };
- var internalResolve = function (state, value, unwrap) {
- if (state.done) return;
- state.done = true;
- if (unwrap) state = unwrap;
- try {
- if (state.facade === value) throw TypeError("Promise can't be resolved itself");
- var then = isThenable(value);
- if (then) {
- microtask(function () {
- var wrapper = { done: false };
- try {
- call(then, value,
- bind(internalResolve, wrapper, state),
- bind(internalReject, wrapper, state)
- );
- } catch (error) {
- internalReject(wrapper, error, state);
- }
- });
- } else {
- state.value = value;
- state.state = FULFILLED;
- notify(state, false);
- }
- } catch (error) {
- internalReject({ done: false }, error, state);
- }
- };
- // constructor polyfill
- if (FORCED_PROMISE_CONSTRUCTOR) {
- // 25.4.3.1 Promise(executor)
- PromiseConstructor = function Promise(executor) {
- anInstance(this, PromisePrototype);
- aCallable(executor);
- call(Internal, this);
- var state = getInternalPromiseState(this);
- try {
- executor(bind(internalResolve, state), bind(internalReject, state));
- } catch (error) {
- internalReject(state, error);
- }
- };
- PromisePrototype = PromiseConstructor.prototype;
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- Internal = function Promise(executor) {
- setInternalState(this, {
- type: PROMISE,
- done: false,
- notified: false,
- parent: false,
- reactions: new Queue(),
- rejection: false,
- state: PENDING,
- value: undefined
- });
- };
- // `Promise.prototype.then` method
- // https://tc39.es/ecma262/#sec-promise.prototype.then
- Internal.prototype = defineBuiltIn(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
- var state = getInternalPromiseState(this);
- var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
- state.parent = true;
- reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
- reaction.fail = isCallable(onRejected) && onRejected;
- reaction.domain = IS_NODE ? process.domain : undefined;
- if (state.state == PENDING) state.reactions.add(reaction);
- else microtask(function () {
- callReaction(reaction, state);
- });
- return reaction.promise;
- });
- OwnPromiseCapability = function () {
- var promise = new Internal();
- var state = getInternalPromiseState(promise);
- this.promise = promise;
- this.resolve = bind(internalResolve, state);
- this.reject = bind(internalReject, state);
- };
- newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
- return C === PromiseConstructor || C === PromiseWrapper
- ? new OwnPromiseCapability(C)
- : newGenericPromiseCapability(C);
- };
- if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
- nativeThen = NativePromisePrototype.then;
- if (!NATIVE_PROMISE_SUBCLASSING) {
- // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
- defineBuiltIn(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
- var that = this;
- return new PromiseConstructor(function (resolve, reject) {
- call(nativeThen, that, resolve, reject);
- }).then(onFulfilled, onRejected);
- // https://github.com/zloirock/core-js/issues/640
- }, { unsafe: true });
- }
- // make `.constructor === Promise` work for native promise-based APIs
- try {
- delete NativePromisePrototype.constructor;
- } catch (error) { /* empty */ }
- // make `instanceof Promise` work for native promise-based APIs
- if (setPrototypeOf) {
- setPrototypeOf(NativePromisePrototype, PromisePrototype);
- }
- }
- }
- $({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
- Promise: PromiseConstructor
- });
- setToStringTag(PromiseConstructor, PROMISE, false, true);
- setSpecies(PROMISE);
- /***/ }),
- /* 273 */
- /***/ (function(module, exports) {
- var $TypeError = TypeError;
- module.exports = function (passed, required) {
- if (passed < required) throw $TypeError('Not enough arguments');
- return passed;
- };
- /***/ }),
- /* 274 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(6);
- var bind = __webpack_require__(45);
- var getOwnPropertyDescriptor = __webpack_require__(71).f;
- var macrotask = __webpack_require__(165).set;
- var IS_IOS = __webpack_require__(166);
- var IS_IOS_PEBBLE = __webpack_require__(275);
- var IS_WEBOS_WEBKIT = __webpack_require__(276);
- var IS_NODE = __webpack_require__(125);
- var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
- var document = global.document;
- var process = global.process;
- var Promise = global.Promise;
- // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
- var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
- var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
- var flush, head, last, notify, toggle, node, promise, then;
- // modern engines have queueMicrotask method
- if (!queueMicrotask) {
- flush = function () {
- var parent, fn;
- if (IS_NODE && (parent = process.domain)) parent.exit();
- while (head) {
- fn = head.fn;
- head = head.next;
- try {
- fn();
- } catch (error) {
- if (head) notify();
- else last = undefined;
- throw error;
- }
- } last = undefined;
- if (parent) parent.enter();
- };
- // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
- // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
- if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
- toggle = true;
- node = document.createTextNode('');
- new MutationObserver(flush).observe(node, { characterData: true });
- notify = function () {
- node.data = toggle = !toggle;
- };
- // environments with maybe non-completely correct, but existent Promise
- } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
- // Promise.resolve without an argument throws an error in LG WebOS 2
- promise = Promise.resolve(undefined);
- // workaround of WebKit ~ iOS Safari 10.1 bug
- promise.constructor = Promise;
- then = bind(promise.then, promise);
- notify = function () {
- then(flush);
- };
- // Node.js without promises
- } else if (IS_NODE) {
- notify = function () {
- process.nextTick(flush);
- };
- // for other environments - macrotask based on:
- // - setImmediate
- // - MessageChannel
- // - window.postMessage
- // - onreadystatechange
- // - setTimeout
- } else {
- // strange IE + webpack dev server bug - use .bind(global)
- macrotask = bind(macrotask, global);
- notify = function () {
- macrotask(flush);
- };
- }
- }
- module.exports = queueMicrotask || function (fn) {
- var task = { fn: fn, next: undefined };
- if (last) last.next = task;
- if (!head) {
- head = task;
- notify();
- } last = task;
- };
- /***/ }),
- /* 275 */
- /***/ (function(module, exports, __webpack_require__) {
- var userAgent = __webpack_require__(91);
- var global = __webpack_require__(6);
- module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;
- /***/ }),
- /* 276 */
- /***/ (function(module, exports, __webpack_require__) {
- var userAgent = __webpack_require__(91);
- module.exports = /web0s(?!.*chrome)/i.test(userAgent);
- /***/ }),
- /* 277 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(6);
- module.exports = function (a, b) {
- var console = global.console;
- if (console && console.error) {
- arguments.length == 1 ? console.error(a) : console.error(a, b);
- }
- };
- /***/ }),
- /* 278 */
- /***/ (function(module, exports) {
- var Queue = function () {
- this.head = null;
- this.tail = null;
- };
- Queue.prototype = {
- add: function (item) {
- var entry = { item: item, next: null };
- if (this.head) this.tail.next = entry;
- else this.head = entry;
- this.tail = entry;
- },
- get: function () {
- var entry = this.head;
- if (entry) {
- this.head = entry.next;
- if (this.tail === entry) this.tail = null;
- return entry.item;
- }
- }
- };
- module.exports = Queue;
- /***/ }),
- /* 279 */
- /***/ (function(module, exports) {
- module.exports = typeof window == 'object' && typeof Deno != 'object';
- /***/ }),
- /* 280 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var call = __webpack_require__(13);
- var aCallable = __webpack_require__(31);
- var newPromiseCapabilityModule = __webpack_require__(50);
- var perform = __webpack_require__(76);
- var iterate = __webpack_require__(37);
- var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(167);
- // `Promise.all` method
- // https://tc39.es/ecma262/#sec-promise.all
- $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
- all: function all(iterable) {
- var C = this;
- var capability = newPromiseCapabilityModule.f(C);
- var resolve = capability.resolve;
- var reject = capability.reject;
- var result = perform(function () {
- var $promiseResolve = aCallable(C.resolve);
- var values = [];
- var counter = 0;
- var remaining = 1;
- iterate(iterable, function (promise) {
- var index = counter++;
- var alreadyCalled = false;
- remaining++;
- call($promiseResolve, C, promise).then(function (value) {
- if (alreadyCalled) return;
- alreadyCalled = true;
- values[index] = value;
- --remaining || resolve(values);
- }, reject);
- });
- --remaining || resolve(values);
- });
- if (result.error) reject(result.value);
- return capability.promise;
- }
- });
- /***/ }),
- /* 281 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var IS_PURE = __webpack_require__(32);
- var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
- var NativePromiseConstructor = __webpack_require__(61);
- var getBuiltIn = __webpack_require__(18);
- var isCallable = __webpack_require__(7);
- var defineBuiltIn = __webpack_require__(39);
- var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
- // `Promise.prototype.catch` method
- // https://tc39.es/ecma262/#sec-promise.prototype.catch
- $({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
- 'catch': function (onRejected) {
- return this.then(undefined, onRejected);
- }
- });
- // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
- if (!IS_PURE && isCallable(NativePromiseConstructor)) {
- var method = getBuiltIn('Promise').prototype['catch'];
- if (NativePromisePrototype['catch'] !== method) {
- defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
- }
- }
- /***/ }),
- /* 282 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var call = __webpack_require__(13);
- var aCallable = __webpack_require__(31);
- var newPromiseCapabilityModule = __webpack_require__(50);
- var perform = __webpack_require__(76);
- var iterate = __webpack_require__(37);
- var PROMISE_STATICS_INCORRECT_ITERATION = __webpack_require__(167);
- // `Promise.race` method
- // https://tc39.es/ecma262/#sec-promise.race
- $({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
- race: function race(iterable) {
- var C = this;
- var capability = newPromiseCapabilityModule.f(C);
- var reject = capability.reject;
- var result = perform(function () {
- var $promiseResolve = aCallable(C.resolve);
- iterate(iterable, function (promise) {
- call($promiseResolve, C, promise).then(capability.resolve, reject);
- });
- });
- if (result.error) reject(result.value);
- return capability.promise;
- }
- });
- /***/ }),
- /* 283 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var call = __webpack_require__(13);
- var newPromiseCapabilityModule = __webpack_require__(50);
- var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
- // `Promise.reject` method
- // https://tc39.es/ecma262/#sec-promise.reject
- $({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
- reject: function reject(r) {
- var capability = newPromiseCapabilityModule.f(this);
- call(capability.reject, undefined, r);
- return capability.promise;
- }
- });
- /***/ }),
- /* 284 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var getBuiltIn = __webpack_require__(18);
- var IS_PURE = __webpack_require__(32);
- var NativePromiseConstructor = __webpack_require__(61);
- var FORCED_PROMISE_CONSTRUCTOR = __webpack_require__(77).CONSTRUCTOR;
- var promiseResolve = __webpack_require__(169);
- var PromiseConstructorWrapper = getBuiltIn('Promise');
- var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
- // `Promise.resolve` method
- // https://tc39.es/ecma262/#sec-promise.resolve
- $({ target: 'Promise', stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
- resolve: function resolve(x) {
- return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x);
- }
- });
- /***/ }),
- /* 285 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var call = __webpack_require__(13);
- var aCallable = __webpack_require__(31);
- var newPromiseCapabilityModule = __webpack_require__(50);
- var perform = __webpack_require__(76);
- var iterate = __webpack_require__(37);
- // `Promise.allSettled` method
- // https://tc39.es/ecma262/#sec-promise.allsettled
- $({ target: 'Promise', stat: true }, {
- allSettled: function allSettled(iterable) {
- var C = this;
- var capability = newPromiseCapabilityModule.f(C);
- var resolve = capability.resolve;
- var reject = capability.reject;
- var result = perform(function () {
- var promiseResolve = aCallable(C.resolve);
- var values = [];
- var counter = 0;
- var remaining = 1;
- iterate(iterable, function (promise) {
- var index = counter++;
- var alreadyCalled = false;
- remaining++;
- call(promiseResolve, C, promise).then(function (value) {
- if (alreadyCalled) return;
- alreadyCalled = true;
- values[index] = { status: 'fulfilled', value: value };
- --remaining || resolve(values);
- }, function (error) {
- if (alreadyCalled) return;
- alreadyCalled = true;
- values[index] = { status: 'rejected', reason: error };
- --remaining || resolve(values);
- });
- });
- --remaining || resolve(values);
- });
- if (result.error) reject(result.value);
- return capability.promise;
- }
- });
- /***/ }),
- /* 286 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var call = __webpack_require__(13);
- var aCallable = __webpack_require__(31);
- var getBuiltIn = __webpack_require__(18);
- var newPromiseCapabilityModule = __webpack_require__(50);
- var perform = __webpack_require__(76);
- var iterate = __webpack_require__(37);
- var PROMISE_ANY_ERROR = 'No one promise resolved';
- // `Promise.any` method
- // https://tc39.es/ecma262/#sec-promise.any
- $({ target: 'Promise', stat: true }, {
- any: function any(iterable) {
- var C = this;
- var AggregateError = getBuiltIn('AggregateError');
- var capability = newPromiseCapabilityModule.f(C);
- var resolve = capability.resolve;
- var reject = capability.reject;
- var result = perform(function () {
- var promiseResolve = aCallable(C.resolve);
- var errors = [];
- var counter = 0;
- var remaining = 1;
- var alreadyResolved = false;
- iterate(iterable, function (promise) {
- var index = counter++;
- var alreadyRejected = false;
- remaining++;
- call(promiseResolve, C, promise).then(function (value) {
- if (alreadyRejected || alreadyResolved) return;
- alreadyResolved = true;
- resolve(value);
- }, function (error) {
- if (alreadyRejected || alreadyResolved) return;
- alreadyRejected = true;
- errors[index] = error;
- --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
- });
- });
- --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
- });
- if (result.error) reject(result.value);
- return capability.promise;
- }
- });
- /***/ }),
- /* 287 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var IS_PURE = __webpack_require__(32);
- var NativePromiseConstructor = __webpack_require__(61);
- var fails = __webpack_require__(3);
- var getBuiltIn = __webpack_require__(18);
- var isCallable = __webpack_require__(7);
- var speciesConstructor = __webpack_require__(163);
- var promiseResolve = __webpack_require__(169);
- var defineBuiltIn = __webpack_require__(39);
- var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
- // Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829
- var NON_GENERIC = !!NativePromiseConstructor && fails(function () {
- // eslint-disable-next-line unicorn/no-thenable -- required for testing
- NativePromisePrototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });
- });
- // `Promise.prototype.finally` method
- // https://tc39.es/ecma262/#sec-promise.prototype.finally
- $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
- 'finally': function (onFinally) {
- var C = speciesConstructor(this, getBuiltIn('Promise'));
- var isFunction = isCallable(onFinally);
- return this.then(
- isFunction ? function (x) {
- return promiseResolve(C, onFinally()).then(function () { return x; });
- } : onFinally,
- isFunction ? function (e) {
- return promiseResolve(C, onFinally()).then(function () { throw e; });
- } : onFinally
- );
- }
- });
- // makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`
- if (!IS_PURE && isCallable(NativePromiseConstructor)) {
- var method = getBuiltIn('Promise').prototype['finally'];
- if (NativePromisePrototype['finally'] !== method) {
- defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });
- }
- }
- /***/ }),
- /* 288 */
- /***/ (function(module, exports, __webpack_require__) {
- var uncurryThis = __webpack_require__(4);
- var toIntegerOrInfinity = __webpack_require__(120);
- var toString = __webpack_require__(75);
- var requireObjectCoercible = __webpack_require__(115);
- var charAt = uncurryThis(''.charAt);
- var charCodeAt = uncurryThis(''.charCodeAt);
- var stringSlice = uncurryThis(''.slice);
- var createMethod = function (CONVERT_TO_STRING) {
- return function ($this, pos) {
- var S = toString(requireObjectCoercible($this));
- var position = toIntegerOrInfinity(pos);
- var size = S.length;
- var first, second;
- if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
- first = charCodeAt(S, position);
- return first < 0xD800 || first > 0xDBFF || position + 1 === size
- || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
- ? CONVERT_TO_STRING
- ? charAt(S, position)
- : first
- : CONVERT_TO_STRING
- ? stringSlice(S, position, position + 2)
- : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
- };
- };
- module.exports = {
- // `String.prototype.codePointAt` method
- // https://tc39.es/ecma262/#sec-string.prototype.codepointat
- codeAt: createMethod(false),
- // `String.prototype.at` method
- // https://github.com/mathiasbynens/String.prototype.at
- charAt: createMethod(true)
- };
- /***/ }),
- /* 289 */
- /***/ (function(module, exports) {
- // iterable DOM collections
- // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
- module.exports = {
- CSSRuleList: 0,
- CSSStyleDeclaration: 0,
- CSSValueList: 0,
- ClientRectList: 0,
- DOMRectList: 0,
- DOMStringList: 0,
- DOMTokenList: 1,
- DataTransferItemList: 0,
- FileList: 0,
- HTMLAllCollection: 0,
- HTMLCollection: 0,
- HTMLFormElement: 0,
- HTMLSelectElement: 0,
- MediaList: 0,
- MimeTypeArray: 0,
- NamedNodeMap: 0,
- NodeList: 1,
- PaintRequestList: 0,
- Plugin: 0,
- PluginArray: 0,
- SVGLengthList: 0,
- SVGNumberList: 0,
- SVGPathSegList: 0,
- SVGPointList: 0,
- SVGStringList: 0,
- SVGTransformList: 0,
- SourceBufferList: 0,
- StyleSheetList: 0,
- TextTrackCueList: 0,
- TextTrackList: 0,
- TouchList: 0
- };
- /***/ }),
- /* 290 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__index_js__ = __webpack_require__(126);
- // Default Export
- // ==============
- // In this module, we mix our bundled exports into the `_` object and export
- // the result. This is analogous to setting `module.exports = _` in CommonJS.
- // Hence, this module is also the entry point of our UMD bundle and the package
- // entry point for CommonJS and AMD users. In other words, this is (the source
- // of) the module you are interfacing with when you do any of the following:
- //
- // ```js
- // // CommonJS
- // var _ = require('underscore');
- //
- // // AMD
- // define(['underscore'], function(_) {...});
- //
- // // UMD in the browser
- // // _ is available as a global variable
- // ```
- // Add all of the Underscore functions to the wrapper object.
- var _ = Object(__WEBPACK_IMPORTED_MODULE_0__index_js__["mixin"])(__WEBPACK_IMPORTED_MODULE_0__index_js__);
- // Legacy Node.js API.
- _._ = _;
- // Export the Underscore API.
- /* harmony default export */ __webpack_exports__["a"] = (_);
- /***/ }),
- /* 291 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = isNull;
- // Is a given value equal to null?
- function isNull(obj) {
- return obj === null;
- }
- /***/ }),
- /* 292 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = isElement;
- // Is a given value a DOM element?
- function isElement(obj) {
- return !!(obj && obj.nodeType === 1);
- }
- /***/ }),
- /* 293 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Date'));
- /***/ }),
- /* 294 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('RegExp'));
- /***/ }),
- /* 295 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Error'));
- /***/ }),
- /* 296 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('Object'));
- /***/ }),
- /* 297 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = isFinite;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isSymbol_js__ = __webpack_require__(173);
- // Is a given object a finite number?
- function isFinite(obj) {
- return !Object(__WEBPACK_IMPORTED_MODULE_1__isSymbol_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_0__setup_js__["f" /* _isFinite */])(obj) && !isNaN(parseFloat(obj));
- }
- /***/ }),
- /* 298 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__ = __webpack_require__(178);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getByteLength_js__ = __webpack_require__(130);
- // Internal helper to determine whether we should spend extensive checks against
- // `ArrayBuffer` et al.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createSizePropertyCheck_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__getByteLength_js__["a" /* default */]));
- /***/ }),
- /* 299 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = isEmpty;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArray_js__ = __webpack_require__(53);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(127);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArguments_js__ = __webpack_require__(129);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__keys_js__ = __webpack_require__(15);
- // Is a given array, string, or object empty?
- // An "empty" object has no enumerable own-properties.
- function isEmpty(obj) {
- if (obj == null) return true;
- // Skip the more expensive `toString`-based type checks if `obj` has no
- // `.length`.
- var length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(obj);
- if (typeof length == 'number' && (
- 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)
- )) return length === 0;
- return Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__keys_js__["a" /* default */])(obj)) === 0;
- }
- /***/ }),
- /* 300 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = isEqual;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getByteLength_js__ = __webpack_require__(130);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__ = __webpack_require__(176);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__isFunction_js__ = __webpack_require__(27);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__ = __webpack_require__(79);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isDataView_js__ = __webpack_require__(128);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__keys_js__ = __webpack_require__(15);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__has_js__ = __webpack_require__(40);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__toBufferView_js__ = __webpack_require__(301);
- // We use this string twice, so give it a name for minification.
- var tagDataView = '[object DataView]';
- // Internal recursive comparison function for `_.isEqual`.
- function eq(a, b, aStack, bStack) {
- // Identical objects are equal. `0 === -0`, but they aren't identical.
- // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).
- if (a === b) return a !== 0 || 1 / a === 1 / b;
- // `null` or `undefined` only equal to itself (strict comparison).
- if (a == null || b == null) return false;
- // `NaN`s are equivalent, but non-reflexive.
- if (a !== a) return b !== b;
- // Exhaust primitive checks
- var type = typeof a;
- if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
- return deepEq(a, b, aStack, bStack);
- }
- // Internal recursive comparison function for `_.isEqual`.
- function deepEq(a, b, aStack, bStack) {
- // Unwrap any wrapped objects.
- if (a instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]) a = a._wrapped;
- if (b instanceof __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]) b = b._wrapped;
- // Compare `[[Class]]` names.
- var className = __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" /* toString */].call(a);
- if (className !== __WEBPACK_IMPORTED_MODULE_1__setup_js__["t" /* toString */].call(b)) return false;
- // Work around a bug in IE 10 - Edge 13.
- if (__WEBPACK_IMPORTED_MODULE_5__stringTagBug_js__["a" /* hasStringTagBug */] && className == '[object Object]' && Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" /* default */])(a)) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_6__isDataView_js__["a" /* default */])(b)) return false;
- className = tagDataView;
- }
- switch (className) {
- // These types are compared by value.
- case '[object RegExp]':
- // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
- case '[object String]':
- // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
- // equivalent to `new String("5")`.
- return '' + a === '' + b;
- case '[object Number]':
- // `NaN`s are equivalent, but non-reflexive.
- // Object(NaN) is equivalent to NaN.
- if (+a !== +a) return +b !== +b;
- // An `egal` comparison is performed for other numeric values.
- return +a === 0 ? 1 / +a === 1 / b : +a === +b;
- case '[object Date]':
- case '[object Boolean]':
- // Coerce dates and booleans to numeric primitive values. Dates are compared by their
- // millisecond representations. Note that invalid dates with millisecond representations
- // of `NaN` are not equivalent.
- return +a === +b;
- case '[object Symbol]':
- return __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" /* SymbolProto */].valueOf.call(a) === __WEBPACK_IMPORTED_MODULE_1__setup_js__["d" /* SymbolProto */].valueOf.call(b);
- case '[object ArrayBuffer]':
- case tagDataView:
- // Coerce to typed array so we can fall through.
- return deepEq(Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" /* default */])(a), Object(__WEBPACK_IMPORTED_MODULE_9__toBufferView_js__["a" /* default */])(b), aStack, bStack);
- }
- var areArrays = className === '[object Array]';
- if (!areArrays && Object(__WEBPACK_IMPORTED_MODULE_3__isTypedArray_js__["a" /* default */])(a)) {
- var byteLength = Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" /* default */])(a);
- if (byteLength !== Object(__WEBPACK_IMPORTED_MODULE_2__getByteLength_js__["a" /* default */])(b)) return false;
- if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
- areArrays = true;
- }
- if (!areArrays) {
- if (typeof a != 'object' || typeof b != 'object') return false;
- // Objects with different constructors are not equivalent, but `Object`s or `Array`s
- // from different frames are.
- var aCtor = a.constructor, bCtor = b.constructor;
- if (aCtor !== bCtor && !(Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" /* default */])(aCtor) && aCtor instanceof aCtor &&
- Object(__WEBPACK_IMPORTED_MODULE_4__isFunction_js__["a" /* default */])(bCtor) && bCtor instanceof bCtor)
- && ('constructor' in a && 'constructor' in b)) {
- return false;
- }
- }
- // Assume equality for cyclic structures. The algorithm for detecting cyclic
- // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
- // Initializing stack of traversed objects.
- // It's done here since we only need them for objects and arrays comparison.
- aStack = aStack || [];
- bStack = bStack || [];
- var length = aStack.length;
- while (length--) {
- // Linear search. Performance is inversely proportional to the number of
- // unique nested structures.
- if (aStack[length] === a) return bStack[length] === b;
- }
- // Add the first object to the stack of traversed objects.
- aStack.push(a);
- bStack.push(b);
- // Recursively compare objects and arrays.
- if (areArrays) {
- // Compare array lengths to determine if a deep comparison is necessary.
- length = a.length;
- if (length !== b.length) return false;
- // Deep compare the contents, ignoring non-numeric properties.
- while (length--) {
- if (!eq(a[length], b[length], aStack, bStack)) return false;
- }
- } else {
- // Deep compare objects.
- var _keys = Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" /* default */])(a), key;
- length = _keys.length;
- // Ensure that both objects contain the same number of properties before comparing deep equality.
- if (Object(__WEBPACK_IMPORTED_MODULE_7__keys_js__["a" /* default */])(b).length !== length) return false;
- while (length--) {
- // Deep compare each member
- key = _keys[length];
- if (!(Object(__WEBPACK_IMPORTED_MODULE_8__has_js__["a" /* default */])(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
- }
- }
- // Remove the first object from the stack of traversed objects.
- aStack.pop();
- bStack.pop();
- return true;
- }
- // Perform a deep comparison to check if two objects are equal.
- function isEqual(a, b) {
- return eq(a, b);
- }
- /***/ }),
- /* 301 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = toBufferView;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getByteLength_js__ = __webpack_require__(130);
- // Internal function to wrap or shallow-copy an ArrayBuffer,
- // typed array or DataView to a new view, reusing the buffer.
- function toBufferView(bufferSource) {
- return new Uint8Array(
- bufferSource.buffer || bufferSource,
- bufferSource.byteOffset || 0,
- Object(__WEBPACK_IMPORTED_MODULE_0__getByteLength_js__["a" /* default */])(bufferSource)
- );
- }
- /***/ }),
- /* 302 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(79);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(131);
- /* 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'));
- /***/ }),
- /* 303 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(79);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(131);
- /* 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'));
- /***/ }),
- /* 304 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stringTagBug_js__ = __webpack_require__(79);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__methodFingerprint_js__ = __webpack_require__(131);
- /* 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'));
- /***/ }),
- /* 305 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tagTester_js__ = __webpack_require__(17);
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__tagTester_js__["a" /* default */])('WeakSet'));
- /***/ }),
- /* 306 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = pairs;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__keys_js__ = __webpack_require__(15);
- // Convert an object into a list of `[key, value]` pairs.
- // The opposite of `_.object` with one argument.
- function pairs(obj) {
- var _keys = Object(__WEBPACK_IMPORTED_MODULE_0__keys_js__["a" /* default */])(obj);
- var length = _keys.length;
- var pairs = Array(length);
- for (var i = 0; i < length; i++) {
- pairs[i] = [_keys[i], obj[_keys[i]]];
- }
- return pairs;
- }
- /***/ }),
- /* 307 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = create;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseCreate_js__ = __webpack_require__(186);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__extendOwn_js__ = __webpack_require__(133);
- // Creates an object that inherits from the given prototype object.
- // If additional properties are provided then they will be added to the
- // created object.
- function create(prototype, props) {
- var result = Object(__WEBPACK_IMPORTED_MODULE_0__baseCreate_js__["a" /* default */])(prototype);
- if (props) Object(__WEBPACK_IMPORTED_MODULE_1__extendOwn_js__["a" /* default */])(result, props);
- return result;
- }
- /***/ }),
- /* 308 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = tap;
- // Invokes `interceptor` with the `obj` and then returns `obj`.
- // The primary purpose of this method is to "tap into" a method chain, in
- // order to perform operations on intermediate results within the chain.
- function tap(obj, interceptor) {
- interceptor(obj);
- return obj;
- }
- /***/ }),
- /* 309 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = has;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(40);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(81);
- // Shortcut function for checking if an object has a given property directly on
- // itself (in other words, not on a prototype). Unlike the internal `has`
- // function, this public version can also traverse nested properties.
- function has(obj, path) {
- path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
- var length = path.length;
- for (var i = 0; i < length; i++) {
- var key = path[i];
- if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" /* default */])(obj, key)) return false;
- obj = obj[key];
- }
- return !!length;
- }
- /***/ }),
- /* 310 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = mapObject;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
- // Returns the results of applying the `iteratee` to each element of `obj`.
- // In contrast to `_.map` it returns an object.
- function mapObject(obj, iteratee, context) {
- iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
- var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj),
- length = _keys.length,
- results = {};
- for (var index = 0; index < length; index++) {
- var currentKey = _keys[index];
- results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
- }
- return results;
- }
- /***/ }),
- /* 311 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = propertyOf;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__noop_js__ = __webpack_require__(192);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__get_js__ = __webpack_require__(188);
- // Generates a function for a given object that returns a given property.
- function propertyOf(obj) {
- if (obj == null) return __WEBPACK_IMPORTED_MODULE_0__noop_js__["a" /* default */];
- return function(path) {
- return Object(__WEBPACK_IMPORTED_MODULE_1__get_js__["a" /* default */])(obj, path);
- };
- }
- /***/ }),
- /* 312 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = times;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__ = __webpack_require__(82);
- // Run a function **n** times.
- function times(n, iteratee, context) {
- var accum = Array(Math.max(0, n));
- iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__optimizeCb_js__["a" /* default */])(iteratee, context, 1);
- for (var i = 0; i < n; i++) accum[i] = iteratee(i);
- return accum;
- }
- /***/ }),
- /* 313 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(194);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(195);
- // Function for escaping strings to HTML interpolation.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" /* default */]));
- /***/ }),
- /* 314 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createEscaper_js__ = __webpack_require__(194);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__ = __webpack_require__(315);
- // Function for unescaping strings from HTML interpolation.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createEscaper_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__unescapeMap_js__["a" /* default */]));
- /***/ }),
- /* 315 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__invert_js__ = __webpack_require__(182);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__escapeMap_js__ = __webpack_require__(195);
- // Internal list of HTML entities for unescaping.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__invert_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__escapeMap_js__["a" /* default */]));
- /***/ }),
- /* 316 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = template;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__defaults_js__ = __webpack_require__(185);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__underscore_js__ = __webpack_require__(24);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__templateSettings_js__ = __webpack_require__(196);
- // When customizing `_.templateSettings`, if you don't want to define an
- // interpolation, evaluation or escaping regex, we need one that is
- // guaranteed not to match.
- var noMatch = /(.)^/;
- // Certain characters need to be escaped so that they can be put into a
- // string literal.
- var escapes = {
- "'": "'",
- '\\': '\\',
- '\r': 'r',
- '\n': 'n',
- '\u2028': 'u2028',
- '\u2029': 'u2029'
- };
- var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
- function escapeChar(match) {
- return '\\' + escapes[match];
- }
- var bareIdentifier = /^\s*(\w|\$)+\s*$/;
- // JavaScript micro-templating, similar to John Resig's implementation.
- // Underscore templating handles arbitrary delimiters, preserves whitespace,
- // and correctly escapes quotes within interpolated code.
- // NB: `oldSettings` only exists for backwards compatibility.
- function template(text, settings, oldSettings) {
- if (!settings && oldSettings) settings = oldSettings;
- settings = Object(__WEBPACK_IMPORTED_MODULE_0__defaults_js__["a" /* default */])({}, settings, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" /* default */].templateSettings);
- // Combine delimiters into one regular expression via alternation.
- var matcher = RegExp([
- (settings.escape || noMatch).source,
- (settings.interpolate || noMatch).source,
- (settings.evaluate || noMatch).source
- ].join('|') + '|$', 'g');
- // Compile the template source, escaping string literals appropriately.
- var index = 0;
- var source = "__p+='";
- text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
- source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
- index = offset + match.length;
- if (escape) {
- source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
- } else if (interpolate) {
- source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
- } else if (evaluate) {
- source += "';\n" + evaluate + "\n__p+='";
- }
- // Adobe VMs need the match returned to produce the correct offset.
- return match;
- });
- source += "';\n";
- var argument = settings.variable;
- if (argument) {
- if (!bareIdentifier.test(argument)) throw new Error(argument);
- } else {
- // If a variable is not specified, place data values in local scope.
- source = 'with(obj||{}){\n' + source + '}\n';
- argument = 'obj';
- }
- source = "var __t,__p='',__j=Array.prototype.join," +
- "print=function(){__p+=__j.call(arguments,'');};\n" +
- source + 'return __p;\n';
- var render;
- try {
- render = new Function(argument, '_', source);
- } catch (e) {
- e.source = source;
- throw e;
- }
- var template = function(data) {
- return render.call(this, data, __WEBPACK_IMPORTED_MODULE_1__underscore_js__["a" /* default */]);
- };
- // Provide the compiled source as a convenience for precompilation.
- template.source = 'function(' + argument + '){\n' + source + '}';
- return template;
- }
- /***/ }),
- /* 317 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = result;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isFunction_js__ = __webpack_require__(27);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__toPath_js__ = __webpack_require__(81);
- // Traverses the children of `obj` along `path`. If a child is a function, it
- // is invoked with its parent as context. Returns the value of the final
- // child, or `fallback` if any child is undefined.
- function result(obj, path, fallback) {
- path = Object(__WEBPACK_IMPORTED_MODULE_1__toPath_js__["a" /* default */])(path);
- var length = path.length;
- if (!length) {
- return Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(fallback) ? fallback.call(obj) : fallback;
- }
- for (var i = 0; i < length; i++) {
- var prop = obj == null ? void 0 : obj[path[i]];
- if (prop === void 0) {
- prop = fallback;
- i = length; // Ensure we don't continue iterating.
- }
- obj = Object(__WEBPACK_IMPORTED_MODULE_0__isFunction_js__["a" /* default */])(prop) ? prop.call(obj) : prop;
- }
- return obj;
- }
- /***/ }),
- /* 318 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = uniqueId;
- // Generate a unique integer id (unique within the entire client session).
- // Useful for temporary DOM ids.
- var idCounter = 0;
- function uniqueId(prefix) {
- var id = ++idCounter + '';
- return prefix ? prefix + id : id;
- }
- /***/ }),
- /* 319 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = chain;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
- // Start chaining a wrapped Underscore object.
- function chain(obj) {
- var instance = Object(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */])(obj);
- instance._chain = true;
- return instance;
- }
- /***/ }),
- /* 320 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flatten_js__ = __webpack_require__(63);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bind_js__ = __webpack_require__(198);
- // Bind a number of an object's methods to that object. Remaining arguments
- // are the method names to be bound. Useful for ensuring that all callbacks
- // defined on an object belong to it.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
- keys = Object(__WEBPACK_IMPORTED_MODULE_1__flatten_js__["a" /* default */])(keys, false, false);
- var index = keys.length;
- if (index < 1) throw new Error('bindAll must be passed function names');
- while (index--) {
- var key = keys[index];
- obj[key] = Object(__WEBPACK_IMPORTED_MODULE_2__bind_js__["a" /* default */])(obj[key], obj);
- }
- return obj;
- }));
- /***/ }),
- /* 321 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = memoize;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has_js__ = __webpack_require__(40);
- // Memoize an expensive function by storing its results.
- function memoize(func, hasher) {
- var memoize = function(key) {
- var cache = memoize.cache;
- var address = '' + (hasher ? hasher.apply(this, arguments) : key);
- if (!Object(__WEBPACK_IMPORTED_MODULE_0__has_js__["a" /* default */])(cache, address)) cache[address] = func.apply(this, arguments);
- return cache[address];
- };
- memoize.cache = {};
- return memoize;
- }
- /***/ }),
- /* 322 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(104);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__delay_js__ = __webpack_require__(199);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__underscore_js__ = __webpack_require__(24);
- // Defers a function, scheduling it to run after the current call stack has
- // cleared.
- /* 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));
- /***/ }),
- /* 323 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = throttle;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__now_js__ = __webpack_require__(137);
- // Returns a function, that, when invoked, will only be triggered at most once
- // during a given window of time. Normally, the throttled function will run
- // as much as it can, without ever going more than once per `wait` duration;
- // but if you'd like to disable the execution on the leading edge, pass
- // `{leading: false}`. To disable execution on the trailing edge, ditto.
- function throttle(func, wait, options) {
- var timeout, context, args, result;
- var previous = 0;
- if (!options) options = {};
- var later = function() {
- previous = options.leading === false ? 0 : Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" /* default */])();
- timeout = null;
- result = func.apply(context, args);
- if (!timeout) context = args = null;
- };
- var throttled = function() {
- var _now = Object(__WEBPACK_IMPORTED_MODULE_0__now_js__["a" /* default */])();
- if (!previous && options.leading === false) previous = _now;
- var remaining = wait - (_now - previous);
- context = this;
- args = arguments;
- if (remaining <= 0 || remaining > wait) {
- if (timeout) {
- clearTimeout(timeout);
- timeout = null;
- }
- previous = _now;
- result = func.apply(context, args);
- if (!timeout) context = args = null;
- } else if (!timeout && options.trailing !== false) {
- timeout = setTimeout(later, remaining);
- }
- return result;
- };
- throttled.cancel = function() {
- clearTimeout(timeout);
- previous = 0;
- timeout = context = args = null;
- };
- return throttled;
- }
- /***/ }),
- /* 324 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = debounce;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__now_js__ = __webpack_require__(137);
- // When a sequence of calls of the returned function ends, the argument
- // function is triggered. The end of a sequence is defined by the `wait`
- // parameter. If `immediate` is passed, the argument function will be
- // triggered at the beginning of the sequence instead of at the end.
- function debounce(func, wait, immediate) {
- var timeout, previous, args, result, context;
- var later = function() {
- var passed = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" /* default */])() - previous;
- if (wait > passed) {
- timeout = setTimeout(later, wait - passed);
- } else {
- timeout = null;
- if (!immediate) result = func.apply(context, args);
- // This check is needed because `func` can recursively invoke `debounced`.
- if (!timeout) args = context = null;
- }
- };
- var debounced = Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(_args) {
- context = this;
- args = _args;
- previous = Object(__WEBPACK_IMPORTED_MODULE_1__now_js__["a" /* default */])();
- if (!timeout) {
- timeout = setTimeout(later, wait);
- if (immediate) result = func.apply(context, args);
- }
- return result;
- });
- debounced.cancel = function() {
- clearTimeout(timeout);
- timeout = args = context = null;
- };
- return debounced;
- }
- /***/ }),
- /* 325 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = wrap;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(104);
- // Returns the first function passed as an argument to the second,
- // allowing you to adjust arguments, run code before and after, and
- // conditionally execute the original function.
- function wrap(func, wrapper) {
- return Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(wrapper, func);
- }
- /***/ }),
- /* 326 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = compose;
- // Returns a function that is the composition of a list of functions, each
- // consuming the return value of the function that follows.
- function compose() {
- var args = arguments;
- var start = args.length - 1;
- return function() {
- var i = start;
- var result = args[start].apply(this, arguments);
- while (i--) result = args[i].call(this, result);
- return result;
- };
- }
- /***/ }),
- /* 327 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = after;
- // Returns a function that will only be executed on and after the Nth call.
- function after(times, func) {
- return function() {
- if (--times < 1) {
- return func.apply(this, arguments);
- }
- };
- }
- /***/ }),
- /* 328 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__partial_js__ = __webpack_require__(104);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__before_js__ = __webpack_require__(200);
- // Returns a function that will be executed at most one time, no matter how
- // often you call it. Useful for lazy initialization.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__partial_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__before_js__["a" /* default */], 2));
- /***/ }),
- /* 329 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__ = __webpack_require__(203);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__ = __webpack_require__(206);
- // Return the position of the last occurrence of an item in an array,
- // or -1 if the item is not included in the array.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_1__createIndexFinder_js__["a" /* default */])(-1, __WEBPACK_IMPORTED_MODULE_0__findLastIndex_js__["a" /* default */]));
- /***/ }),
- /* 330 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = findWhere;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__find_js__ = __webpack_require__(207);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(103);
- // Convenience version of a common use case of `_.find`: getting the first
- // object containing specific `key:value` pairs.
- function findWhere(obj, attrs) {
- return Object(__WEBPACK_IMPORTED_MODULE_0__find_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" /* default */])(attrs));
- }
- /***/ }),
- /* 331 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(208);
- // **Reduce** builds up a single result from a list of values, aka `inject`,
- // or `foldl`.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" /* default */])(1));
- /***/ }),
- /* 332 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createReduce_js__ = __webpack_require__(208);
- // The right-associative version of reduce, also known as `foldr`.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__createReduce_js__["a" /* default */])(-1));
- /***/ }),
- /* 333 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = reject;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(83);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__negate_js__ = __webpack_require__(138);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(20);
- // Return all the elements for which a truth test fails.
- function reject(obj, predicate, context) {
- 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);
- }
- /***/ }),
- /* 334 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = every;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
- // Determine whether all of the elements pass a truth test.
- function every(obj, predicate, context) {
- predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
- var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
- length = (_keys || obj).length;
- for (var index = 0; index < length; index++) {
- var currentKey = _keys ? _keys[index] : index;
- if (!predicate(obj[currentKey], currentKey, obj)) return false;
- }
- return true;
- }
- /***/ }),
- /* 335 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = some;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__ = __webpack_require__(25);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__keys_js__ = __webpack_require__(15);
- // Determine if at least one element in the object passes a truth test.
- function some(obj, predicate, context) {
- predicate = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(predicate, context);
- var _keys = !Object(__WEBPACK_IMPORTED_MODULE_1__isArrayLike_js__["a" /* default */])(obj) && Object(__WEBPACK_IMPORTED_MODULE_2__keys_js__["a" /* default */])(obj),
- length = (_keys || obj).length;
- for (var index = 0; index < length; index++) {
- var currentKey = _keys ? _keys[index] : index;
- if (predicate(obj[currentKey], currentKey, obj)) return true;
- }
- return false;
- }
- /***/ }),
- /* 336 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(64);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__deepGet_js__ = __webpack_require__(134);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__toPath_js__ = __webpack_require__(81);
- // Invoke a method (with arguments) on every item in a collection.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, path, args) {
- var contextPath, func;
- if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(path)) {
- func = path;
- } else {
- path = Object(__WEBPACK_IMPORTED_MODULE_4__toPath_js__["a" /* default */])(path);
- contextPath = path.slice(0, -1);
- path = path[path.length - 1];
- }
- return Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" /* default */])(obj, function(context) {
- var method = func;
- if (!method) {
- if (contextPath && contextPath.length) {
- context = Object(__WEBPACK_IMPORTED_MODULE_3__deepGet_js__["a" /* default */])(context, contextPath);
- }
- if (context == null) return void 0;
- method = context[path];
- }
- return method == null ? method : method.apply(context, args);
- });
- }));
- /***/ }),
- /* 337 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = where;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(83);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__matcher_js__ = __webpack_require__(103);
- // Convenience version of a common use case of `_.filter`: selecting only
- // objects containing specific `key:value` pairs.
- function where(obj, attrs) {
- return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(obj, Object(__WEBPACK_IMPORTED_MODULE_1__matcher_js__["a" /* default */])(attrs));
- }
- /***/ }),
- /* 338 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = min;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values_js__ = __webpack_require__(62);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__cb_js__ = __webpack_require__(20);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__each_js__ = __webpack_require__(54);
- // Return the minimum element (or element-based computation).
- function min(obj, iteratee, context) {
- var result = Infinity, lastComputed = Infinity,
- value, computed;
- if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
- obj = Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj : Object(__WEBPACK_IMPORTED_MODULE_1__values_js__["a" /* default */])(obj);
- for (var i = 0, length = obj.length; i < length; i++) {
- value = obj[i];
- if (value != null && value < result) {
- result = value;
- }
- }
- } else {
- iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__cb_js__["a" /* default */])(iteratee, context);
- Object(__WEBPACK_IMPORTED_MODULE_3__each_js__["a" /* default */])(obj, function(v, index, list) {
- computed = iteratee(v, index, list);
- if (computed < lastComputed || computed === Infinity && result === Infinity) {
- result = v;
- lastComputed = computed;
- }
- });
- }
- return result;
- }
- /***/ }),
- /* 339 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = shuffle;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sample_js__ = __webpack_require__(210);
- // Shuffle a collection.
- function shuffle(obj) {
- return Object(__WEBPACK_IMPORTED_MODULE_0__sample_js__["a" /* default */])(obj, Infinity);
- }
- /***/ }),
- /* 340 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = sortBy;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__cb_js__ = __webpack_require__(20);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pluck_js__ = __webpack_require__(140);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__map_js__ = __webpack_require__(64);
- // Sort the object's values by a criterion produced by an iteratee.
- function sortBy(obj, iteratee, context) {
- var index = 0;
- iteratee = Object(__WEBPACK_IMPORTED_MODULE_0__cb_js__["a" /* default */])(iteratee, context);
- return Object(__WEBPACK_IMPORTED_MODULE_1__pluck_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__map_js__["a" /* default */])(obj, function(value, key, list) {
- return {
- value: value,
- index: index++,
- criteria: iteratee(value, key, list)
- };
- }).sort(function(left, right) {
- var a = left.criteria;
- var b = right.criteria;
- if (a !== b) {
- if (a > b || a === void 0) return 1;
- if (a < b || b === void 0) return -1;
- }
- return left.index - right.index;
- }), 'value');
- }
- /***/ }),
- /* 341 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(40);
- // Groups the object's values by a criterion. Pass either a string attribute
- // to group by, or a function that returns the criterion.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
- if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(result, key)) result[key].push(value); else result[key] = [value];
- }));
- /***/ }),
- /* 342 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
- // Indexes the object's values by a criterion, similar to `_.groupBy`, but for
- // when you know that your index values will be unique.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
- result[key] = value;
- }));
- /***/ }),
- /* 343 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__has_js__ = __webpack_require__(40);
- // Counts instances of an object that group by a certain criterion. Pass
- // either a string attribute to count by, or a function that returns the
- // criterion.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, key) {
- if (Object(__WEBPACK_IMPORTED_MODULE_1__has_js__["a" /* default */])(result, key)) result[key]++; else result[key] = 1;
- }));
- /***/ }),
- /* 344 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_js__ = __webpack_require__(105);
- // Split a collection into two arrays: one whose elements all pass the given
- // truth test, and one whose elements all do not pass the truth test.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__group_js__["a" /* default */])(function(result, value, pass) {
- result[pass ? 0 : 1].push(value);
- }, true));
- /***/ }),
- /* 345 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = toArray;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArray_js__ = __webpack_require__(53);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__setup_js__ = __webpack_require__(5);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isString_js__ = __webpack_require__(127);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isArrayLike_js__ = __webpack_require__(25);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map_js__ = __webpack_require__(64);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__identity_js__ = __webpack_require__(135);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__values_js__ = __webpack_require__(62);
- // Safely create a real, live array from anything iterable.
- var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
- function toArray(obj) {
- if (!obj) return [];
- if (Object(__WEBPACK_IMPORTED_MODULE_0__isArray_js__["a" /* default */])(obj)) return __WEBPACK_IMPORTED_MODULE_1__setup_js__["q" /* slice */].call(obj);
- if (Object(__WEBPACK_IMPORTED_MODULE_2__isString_js__["a" /* default */])(obj)) {
- // Keep surrogate pair characters together.
- return obj.match(reStrSymbol);
- }
- 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 */]);
- return Object(__WEBPACK_IMPORTED_MODULE_6__values_js__["a" /* default */])(obj);
- }
- /***/ }),
- /* 346 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = size;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__ = __webpack_require__(25);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys_js__ = __webpack_require__(15);
- // Return the number of elements in a collection.
- function size(obj) {
- if (obj == null) return 0;
- return Object(__WEBPACK_IMPORTED_MODULE_0__isArrayLike_js__["a" /* default */])(obj) ? obj.length : Object(__WEBPACK_IMPORTED_MODULE_1__keys_js__["a" /* default */])(obj).length;
- }
- /***/ }),
- /* 347 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = keyInObj;
- // Internal `_.pick` helper function to determine whether `key` is an enumerable
- // property name of `obj`.
- function keyInObj(value, key, obj) {
- return key in obj;
- }
- /***/ }),
- /* 348 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__isFunction_js__ = __webpack_require__(27);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__negate_js__ = __webpack_require__(138);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__map_js__ = __webpack_require__(64);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__flatten_js__ = __webpack_require__(63);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__contains_js__ = __webpack_require__(84);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__pick_js__ = __webpack_require__(211);
- // Return a copy of the object without the disallowed properties.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(obj, keys) {
- var iteratee = keys[0], context;
- if (Object(__WEBPACK_IMPORTED_MODULE_1__isFunction_js__["a" /* default */])(iteratee)) {
- iteratee = Object(__WEBPACK_IMPORTED_MODULE_2__negate_js__["a" /* default */])(iteratee);
- if (keys.length > 1) context = keys[1];
- } else {
- keys = Object(__WEBPACK_IMPORTED_MODULE_3__map_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_4__flatten_js__["a" /* default */])(keys, false, false), String);
- iteratee = function(value, key) {
- return !Object(__WEBPACK_IMPORTED_MODULE_5__contains_js__["a" /* default */])(keys, key);
- };
- }
- return Object(__WEBPACK_IMPORTED_MODULE_6__pick_js__["a" /* default */])(obj, iteratee, context);
- }));
- /***/ }),
- /* 349 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = first;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__initial_js__ = __webpack_require__(212);
- // Get the first element of an array. Passing **n** will return the first N
- // values in the array. The **guard** check allows it to work with `_.map`.
- function first(array, n, guard) {
- if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
- if (n == null || guard) return array[0];
- return Object(__WEBPACK_IMPORTED_MODULE_0__initial_js__["a" /* default */])(array, array.length - n);
- }
- /***/ }),
- /* 350 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = last;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rest_js__ = __webpack_require__(213);
- // Get the last element of an array. Passing **n** will return the last N
- // values in the array.
- function last(array, n, guard) {
- if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
- if (n == null || guard) return array[array.length - 1];
- return Object(__WEBPACK_IMPORTED_MODULE_0__rest_js__["a" /* default */])(array, Math.max(0, array.length - n));
- }
- /***/ }),
- /* 351 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = compact;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter_js__ = __webpack_require__(83);
- // Trim out all falsy values from an array.
- function compact(array) {
- return Object(__WEBPACK_IMPORTED_MODULE_0__filter_js__["a" /* default */])(array, Boolean);
- }
- /***/ }),
- /* 352 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = flatten;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__flatten_js__ = __webpack_require__(63);
- // Flatten out an array, either recursively (by default), or up to `depth`.
- // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.
- function flatten(array, depth) {
- return Object(__WEBPACK_IMPORTED_MODULE_0__flatten_js__["a" /* default */])(array, depth, false);
- }
- /***/ }),
- /* 353 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__difference_js__ = __webpack_require__(214);
- // Return a version of the array that does not contain the specified value(s).
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(array, otherArrays) {
- return Object(__WEBPACK_IMPORTED_MODULE_1__difference_js__["a" /* default */])(array, otherArrays);
- }));
- /***/ }),
- /* 354 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__uniq_js__ = __webpack_require__(215);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__flatten_js__ = __webpack_require__(63);
- // Produce an array that contains the union: each distinct element from all of
- // the passed-in arrays.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(function(arrays) {
- return Object(__WEBPACK_IMPORTED_MODULE_1__uniq_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__flatten_js__["a" /* default */])(arrays, true, true));
- }));
- /***/ }),
- /* 355 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = intersection;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__contains_js__ = __webpack_require__(84);
- // Produce an array that contains every item shared between all the
- // passed-in arrays.
- function intersection(array) {
- var result = [];
- var argsLength = arguments.length;
- for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(array); i < length; i++) {
- var item = array[i];
- if (Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" /* default */])(result, item)) continue;
- var j;
- for (j = 1; j < argsLength; j++) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_1__contains_js__["a" /* default */])(arguments[j], item)) break;
- }
- if (j === argsLength) result.push(item);
- }
- return result;
- }
- /***/ }),
- /* 356 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__restArguments_js__ = __webpack_require__(23);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__unzip_js__ = __webpack_require__(216);
- // Zip together multiple lists into a single array -- elements that share
- // an index go together.
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__restArguments_js__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_1__unzip_js__["a" /* default */]));
- /***/ }),
- /* 357 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = object;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getLength_js__ = __webpack_require__(28);
- // Converts lists into objects. Pass either a single array of `[key, value]`
- // pairs, or two parallel arrays of the same length -- one of keys, and one of
- // the corresponding values. Passing by pairs is the reverse of `_.pairs`.
- function object(list, values) {
- var result = {};
- for (var i = 0, length = Object(__WEBPACK_IMPORTED_MODULE_0__getLength_js__["a" /* default */])(list); i < length; i++) {
- if (values) {
- result[list[i]] = values[i];
- } else {
- result[list[i][0]] = list[i][1];
- }
- }
- return result;
- }
- /***/ }),
- /* 358 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = range;
- // Generate an integer Array containing an arithmetic progression. A port of
- // the native Python `range()` function. See
- // [the Python documentation](https://docs.python.org/library/functions.html#range).
- function range(start, stop, step) {
- if (stop == null) {
- stop = start || 0;
- start = 0;
- }
- if (!step) {
- step = stop < start ? -1 : 1;
- }
- var length = Math.max(Math.ceil((stop - start) / step), 0);
- var range = Array(length);
- for (var idx = 0; idx < length; idx++, start += step) {
- range[idx] = start;
- }
- return range;
- }
- /***/ }),
- /* 359 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = chunk;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__setup_js__ = __webpack_require__(5);
- // Chunk a single array into multiple arrays, each containing `count` or fewer
- // items.
- function chunk(array, count) {
- if (count == null || count < 1) return [];
- var result = [];
- var i = 0, length = array.length;
- while (i < length) {
- result.push(__WEBPACK_IMPORTED_MODULE_0__setup_js__["q" /* slice */].call(array, i, i += count));
- }
- return result;
- }
- /***/ }),
- /* 360 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (immutable) */ __webpack_exports__["a"] = mixin;
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__functions_js__ = __webpack_require__(183);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__setup_js__ = __webpack_require__(5);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__chainResult_js__ = __webpack_require__(217);
- // Add your own custom functions to the Underscore object.
- function mixin(obj) {
- Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2__functions_js__["a" /* default */])(obj), function(name) {
- var func = __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */][name] = obj[name];
- __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
- var args = [this._wrapped];
- __WEBPACK_IMPORTED_MODULE_3__setup_js__["o" /* push */].apply(args, arguments);
- return Object(__WEBPACK_IMPORTED_MODULE_4__chainResult_js__["a" /* default */])(this, func.apply(__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */], args));
- };
- });
- return __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */];
- }
- /***/ }),
- /* 361 */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__underscore_js__ = __webpack_require__(24);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each_js__ = __webpack_require__(54);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__setup_js__ = __webpack_require__(5);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chainResult_js__ = __webpack_require__(217);
- // Add all mutator `Array` functions to the wrapper.
- Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
- var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" /* ArrayProto */][name];
- __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
- var obj = this._wrapped;
- if (obj != null) {
- method.apply(obj, arguments);
- if ((name === 'shift' || name === 'splice') && obj.length === 0) {
- delete obj[0];
- }
- }
- return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" /* default */])(this, obj);
- };
- });
- // Add all accessor `Array` functions to the wrapper.
- Object(__WEBPACK_IMPORTED_MODULE_1__each_js__["a" /* default */])(['concat', 'join', 'slice'], function(name) {
- var method = __WEBPACK_IMPORTED_MODULE_2__setup_js__["a" /* ArrayProto */][name];
- __WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */].prototype[name] = function() {
- var obj = this._wrapped;
- if (obj != null) obj = method.apply(obj, arguments);
- return Object(__WEBPACK_IMPORTED_MODULE_3__chainResult_js__["a" /* default */])(this, obj);
- };
- });
- /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__underscore_js__["a" /* default */]);
- /***/ }),
- /* 362 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(363);
- module.exports = parent;
- /***/ }),
- /* 363 */
- /***/ (function(module, exports, __webpack_require__) {
- var isPrototypeOf = __webpack_require__(21);
- var method = __webpack_require__(364);
- var ArrayPrototype = Array.prototype;
- module.exports = function (it) {
- var own = it.concat;
- return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.concat) ? method : own;
- };
- /***/ }),
- /* 364 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(218);
- var entryVirtual = __webpack_require__(41);
- module.exports = entryVirtual('Array').concat;
- /***/ }),
- /* 365 */
- /***/ (function(module, exports) {
- var $TypeError = TypeError;
- var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
- module.exports = function (it) {
- if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
- return it;
- };
- /***/ }),
- /* 366 */
- /***/ (function(module, exports, __webpack_require__) {
- var isArray = __webpack_require__(85);
- var isConstructor = __webpack_require__(101);
- var isObject = __webpack_require__(11);
- var wellKnownSymbol = __webpack_require__(9);
- var SPECIES = wellKnownSymbol('species');
- var $Array = Array;
- // a part of `ArraySpeciesCreate` abstract operation
- // https://tc39.es/ecma262/#sec-arrayspeciescreate
- module.exports = function (originalArray) {
- var C;
- if (isArray(originalArray)) {
- C = originalArray.constructor;
- // cross-realm fallback
- if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
- else if (isObject(C)) {
- C = C[SPECIES];
- if (C === null) C = undefined;
- }
- } return C === undefined ? $Array : C;
- };
- /***/ }),
- /* 367 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(368);
- module.exports = parent;
- /***/ }),
- /* 368 */
- /***/ (function(module, exports, __webpack_require__) {
- var isPrototypeOf = __webpack_require__(21);
- var method = __webpack_require__(369);
- var ArrayPrototype = Array.prototype;
- module.exports = function (it) {
- var own = it.map;
- return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.map) ? method : own;
- };
- /***/ }),
- /* 369 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(370);
- var entryVirtual = __webpack_require__(41);
- module.exports = entryVirtual('Array').map;
- /***/ }),
- /* 370 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var $map = __webpack_require__(66).map;
- var arrayMethodHasSpeciesSupport = __webpack_require__(107);
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
- // `Array.prototype.map` method
- // https://tc39.es/ecma262/#sec-array.prototype.map
- // with adding support of @@species
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
- map: function map(callbackfn /* , thisArg */) {
- return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /* 371 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(372);
- module.exports = parent;
- /***/ }),
- /* 372 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(373);
- var path = __webpack_require__(10);
- module.exports = path.Object.keys;
- /***/ }),
- /* 373 */
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__(0);
- var toObject = __webpack_require__(34);
- var nativeKeys = __webpack_require__(98);
- var fails = __webpack_require__(3);
- var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
- // `Object.keys` method
- // https://tc39.es/ecma262/#sec-object.keys
- $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
- keys: function keys(it) {
- return nativeKeys(toObject(it));
- }
- });
- /***/ }),
- /* 374 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(375);
- module.exports = parent;
- /***/ }),
- /* 375 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(220);
- var path = __webpack_require__(10);
- var apply = __webpack_require__(69);
- // eslint-disable-next-line es-x/no-json -- safe
- if (!path.JSON) path.JSON = { stringify: JSON.stringify };
- // eslint-disable-next-line no-unused-vars -- required for `.length`
- module.exports = function stringify(it, replacer, space) {
- return apply(path.JSON.stringify, null, arguments);
- };
- /***/ }),
- /* 376 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(377);
- module.exports = parent;
- /***/ }),
- /* 377 */
- /***/ (function(module, exports, __webpack_require__) {
- var isPrototypeOf = __webpack_require__(21);
- var method = __webpack_require__(378);
- var ArrayPrototype = Array.prototype;
- module.exports = function (it) {
- var own = it.indexOf;
- return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.indexOf) ? method : own;
- };
- /***/ }),
- /* 378 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(379);
- var entryVirtual = __webpack_require__(41);
- module.exports = entryVirtual('Array').indexOf;
- /***/ }),
- /* 379 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* eslint-disable es-x/no-array-prototype-indexof -- required for testing */
- var $ = __webpack_require__(0);
- var uncurryThis = __webpack_require__(4);
- var $IndexOf = __webpack_require__(153).indexOf;
- var arrayMethodIsStrict = __webpack_require__(380);
- var un$IndexOf = uncurryThis([].indexOf);
- var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
- var STRICT_METHOD = arrayMethodIsStrict('indexOf');
- // `Array.prototype.indexOf` method
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
- $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
- indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
- var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
- return NEGATIVE_ZERO
- // convert -0 to +0
- ? un$IndexOf(this, searchElement, fromIndex) || 0
- : $IndexOf(this, searchElement, fromIndex);
- }
- });
- /***/ }),
- /* 380 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var fails = __webpack_require__(3);
- module.exports = function (METHOD_NAME, argument) {
- var method = [][METHOD_NAME];
- return !!method && fails(function () {
- // eslint-disable-next-line no-useless-call -- required for testing
- method.call(null, argument || function () { return 1; }, 1);
- });
- };
- /***/ }),
- /* 381 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(51);
- var classof = __webpack_require__(59);
- var hasOwn = __webpack_require__(14);
- var isPrototypeOf = __webpack_require__(21);
- var method = __webpack_require__(382);
- var ArrayPrototype = Array.prototype;
- var DOMIterables = {
- DOMTokenList: true,
- NodeList: true
- };
- module.exports = function (it) {
- var own = it.keys;
- return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.keys)
- || hasOwn(DOMIterables, classof(it)) ? method : own;
- };
- /***/ }),
- /* 382 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(383);
- module.exports = parent;
- /***/ }),
- /* 383 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(48);
- __webpack_require__(60);
- var entryVirtual = __webpack_require__(41);
- module.exports = entryVirtual('Array').keys;
- /***/ }),
- /* 384 */
- /***/ (function(module, exports) {
- // Unique ID creation requires a high quality random # generator. In the
- // browser this is a little complicated due to unknown quality of Math.random()
- // and inconsistent support for the `crypto` API. We do the best we can via
- // feature-detection
- // getRandomValues needs to be invoked in a context where "this" is a Crypto
- // implementation. Also, find the complete implementation of crypto on IE11.
- var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
- (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
- if (getRandomValues) {
- // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
- var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
- module.exports = function whatwgRNG() {
- getRandomValues(rnds8);
- return rnds8;
- };
- } else {
- // Math.random()-based (RNG)
- //
- // If all else fails, use Math.random(). It's fast, but is of unspecified
- // quality.
- var rnds = new Array(16);
- module.exports = function mathRNG() {
- for (var i = 0, r; i < 16; i++) {
- if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
- rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
- }
- return rnds;
- };
- }
- /***/ }),
- /* 385 */
- /***/ (function(module, exports) {
- /**
- * Convert array of 16 byte values to UUID string format of the form:
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
- */
- var byteToHex = [];
- for (var i = 0; i < 256; ++i) {
- byteToHex[i] = (i + 0x100).toString(16).substr(1);
- }
- function bytesToUuid(buf, offset) {
- var i = offset || 0;
- var bth = byteToHex;
- // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
- return ([bth[buf[i++]], bth[buf[i++]],
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]],
- bth[buf[i++]], bth[buf[i++]],
- bth[buf[i++]], bth[buf[i++]]]).join('');
- }
- module.exports = bytesToUuid;
- /***/ }),
- /* 386 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /**
- * This is the common logic for both the Node.js and web browser
- * implementations of `debug()`.
- */
- function setup(env) {
- createDebug.debug = createDebug;
- createDebug.default = createDebug;
- createDebug.coerce = coerce;
- createDebug.disable = disable;
- createDebug.enable = enable;
- createDebug.enabled = enabled;
- createDebug.humanize = __webpack_require__(387);
- Object.keys(env).forEach(function (key) {
- createDebug[key] = env[key];
- });
- /**
- * Active `debug` instances.
- */
- createDebug.instances = [];
- /**
- * The currently active debug mode names, and names to skip.
- */
- createDebug.names = [];
- createDebug.skips = [];
- /**
- * Map of special "%n" handling functions, for the debug "format" argument.
- *
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
- */
- createDebug.formatters = {};
- /**
- * Selects a color for a debug namespace
- * @param {String} namespace The namespace string for the for the debug instance to be colored
- * @return {Number|String} An ANSI color code for the given namespace
- * @api private
- */
- function selectColor(namespace) {
- var hash = 0;
- for (var i = 0; i < namespace.length; i++) {
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
- hash |= 0; // Convert to 32bit integer
- }
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
- }
- createDebug.selectColor = selectColor;
- /**
- * Create a debugger with the given `namespace`.
- *
- * @param {String} namespace
- * @return {Function}
- * @api public
- */
- function createDebug(namespace) {
- var prevTime;
- function debug() {
- // Disabled?
- if (!debug.enabled) {
- return;
- }
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- var self = debug; // Set `diff` timestamp
- var curr = Number(new Date());
- var ms = curr - (prevTime || curr);
- self.diff = ms;
- self.prev = prevTime;
- self.curr = curr;
- prevTime = curr;
- args[0] = createDebug.coerce(args[0]);
- if (typeof args[0] !== 'string') {
- // Anything else let's inspect with %O
- args.unshift('%O');
- } // Apply any `formatters` transformations
- var index = 0;
- args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
- // If we encounter an escaped % then don't increase the array index
- if (match === '%%') {
- return match;
- }
- index++;
- var formatter = createDebug.formatters[format];
- if (typeof formatter === 'function') {
- var val = args[index];
- match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
- args.splice(index, 1);
- index--;
- }
- return match;
- }); // Apply env-specific formatting (colors, etc.)
- createDebug.formatArgs.call(self, args);
- var logFn = self.log || createDebug.log;
- logFn.apply(self, args);
- }
- debug.namespace = namespace;
- debug.enabled = createDebug.enabled(namespace);
- debug.useColors = createDebug.useColors();
- debug.color = selectColor(namespace);
- debug.destroy = destroy;
- debug.extend = extend; // Debug.formatArgs = formatArgs;
- // debug.rawLog = rawLog;
- // env-specific initialization logic for debug instances
- if (typeof createDebug.init === 'function') {
- createDebug.init(debug);
- }
- createDebug.instances.push(debug);
- return debug;
- }
- function destroy() {
- var index = createDebug.instances.indexOf(this);
- if (index !== -1) {
- createDebug.instances.splice(index, 1);
- return true;
- }
- return false;
- }
- function extend(namespace, delimiter) {
- return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
- }
- /**
- * Enables a debug mode by namespaces. This can include modes
- * separated by a colon and wildcards.
- *
- * @param {String} namespaces
- * @api public
- */
- function enable(namespaces) {
- createDebug.save(namespaces);
- createDebug.names = [];
- createDebug.skips = [];
- var i;
- var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
- var len = split.length;
- for (i = 0; i < len; i++) {
- if (!split[i]) {
- // ignore empty strings
- continue;
- }
- namespaces = split[i].replace(/\*/g, '.*?');
- if (namespaces[0] === '-') {
- createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
- } else {
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
- }
- }
- for (i = 0; i < createDebug.instances.length; i++) {
- var instance = createDebug.instances[i];
- instance.enabled = createDebug.enabled(instance.namespace);
- }
- }
- /**
- * Disable debug output.
- *
- * @api public
- */
- function disable() {
- createDebug.enable('');
- }
- /**
- * Returns true if the given mode name is enabled, false otherwise.
- *
- * @param {String} name
- * @return {Boolean}
- * @api public
- */
- function enabled(name) {
- if (name[name.length - 1] === '*') {
- return true;
- }
- var i;
- var len;
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
- if (createDebug.skips[i].test(name)) {
- return false;
- }
- }
- for (i = 0, len = createDebug.names.length; i < len; i++) {
- if (createDebug.names[i].test(name)) {
- return true;
- }
- }
- return false;
- }
- /**
- * Coerce `val`.
- *
- * @param {Mixed} val
- * @return {Mixed}
- * @api private
- */
- function coerce(val) {
- if (val instanceof Error) {
- return val.stack || val.message;
- }
- return val;
- }
- createDebug.enable(createDebug.load());
- return createDebug;
- }
- module.exports = setup;
- /***/ }),
- /* 387 */
- /***/ (function(module, exports) {
- /**
- * Helpers.
- */
- var s = 1000;
- var m = s * 60;
- var h = m * 60;
- var d = h * 24;
- var w = d * 7;
- var y = d * 365.25;
- /**
- * Parse or format the given `val`.
- *
- * Options:
- *
- * - `long` verbose formatting [false]
- *
- * @param {String|Number} val
- * @param {Object} [options]
- * @throws {Error} throw an error if val is not a non-empty string or a number
- * @return {String|Number}
- * @api public
- */
- module.exports = function(val, options) {
- options = options || {};
- var type = typeof val;
- if (type === 'string' && val.length > 0) {
- return parse(val);
- } else if (type === 'number' && isFinite(val)) {
- return options.long ? fmtLong(val) : fmtShort(val);
- }
- throw new Error(
- 'val is not a non-empty string or a valid number. val=' +
- JSON.stringify(val)
- );
- };
- /**
- * Parse the given `str` and return milliseconds.
- *
- * @param {String} str
- * @return {Number}
- * @api private
- */
- function parse(str) {
- str = String(str);
- if (str.length > 100) {
- return;
- }
- 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(
- str
- );
- if (!match) {
- return;
- }
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'yrs':
- case 'yr':
- case 'y':
- return n * y;
- case 'weeks':
- case 'week':
- case 'w':
- return n * w;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'hrs':
- case 'hr':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'mins':
- case 'min':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 'secs':
- case 'sec':
- case 's':
- return n * s;
- case 'milliseconds':
- case 'millisecond':
- case 'msecs':
- case 'msec':
- case 'ms':
- return n;
- default:
- return undefined;
- }
- }
- /**
- * Short format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
- function fmtShort(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return Math.round(ms / d) + 'd';
- }
- if (msAbs >= h) {
- return Math.round(ms / h) + 'h';
- }
- if (msAbs >= m) {
- return Math.round(ms / m) + 'm';
- }
- if (msAbs >= s) {
- return Math.round(ms / s) + 's';
- }
- return ms + 'ms';
- }
- /**
- * Long format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
- function fmtLong(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return plural(ms, msAbs, d, 'day');
- }
- if (msAbs >= h) {
- return plural(ms, msAbs, h, 'hour');
- }
- if (msAbs >= m) {
- return plural(ms, msAbs, m, 'minute');
- }
- if (msAbs >= s) {
- return plural(ms, msAbs, s, 'second');
- }
- return ms + ' ms';
- }
- /**
- * Pluralization helper.
- */
- function plural(ms, msAbs, n, name) {
- var isPlural = msAbs >= n * 1.5;
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
- }
- /***/ }),
- /* 388 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(389);
- var path = __webpack_require__(10);
- module.exports = path.Object.getPrototypeOf;
- /***/ }),
- /* 389 */
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__(0);
- var fails = __webpack_require__(3);
- var toObject = __webpack_require__(34);
- var nativeGetPrototypeOf = __webpack_require__(93);
- var CORRECT_PROTOTYPE_GETTER = __webpack_require__(151);
- var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
- // `Object.getPrototypeOf` method
- // https://tc39.es/ecma262/#sec-object.getprototypeof
- $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
- getPrototypeOf: function getPrototypeOf(it) {
- return nativeGetPrototypeOf(toObject(it));
- }
- });
- /***/ }),
- /* 390 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(391);
- var path = __webpack_require__(10);
- module.exports = path.Object.setPrototypeOf;
- /***/ }),
- /* 391 */
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__(0);
- var setPrototypeOf = __webpack_require__(95);
- // `Object.setPrototypeOf` method
- // https://tc39.es/ecma262/#sec-object.setprototypeof
- $({ target: 'Object', stat: true }, {
- setPrototypeOf: setPrototypeOf
- });
- /***/ }),
- /* 392 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _slice = _interopRequireDefault(__webpack_require__(87));
- var _concat = _interopRequireDefault(__webpack_require__(30));
- var _defineProperty = _interopRequireDefault(__webpack_require__(143));
- var AV = __webpack_require__(65);
- var AppRouter = __webpack_require__(398);
- var _require = __webpack_require__(29),
- isNullOrUndefined = _require.isNullOrUndefined;
- var _require2 = __webpack_require__(2),
- extend = _require2.extend,
- isObject = _require2.isObject,
- isEmpty = _require2.isEmpty;
- var isCNApp = function isCNApp(appId) {
- return (0, _slice.default)(appId).call(appId, -9) !== '-MdYXbMMI';
- };
- var fillServerURLs = function fillServerURLs(url) {
- return {
- push: url,
- stats: url,
- engine: url,
- api: url,
- rtm: url
- };
- };
- function getDefaultServerURLs(appId) {
- var _context, _context2, _context3, _context4, _context5;
- if (isCNApp(appId)) {
- return {};
- }
- var id = (0, _slice.default)(appId).call(appId, 0, 8).toLowerCase();
- var domain = 'lncldglobal.com';
- return {
- push: (0, _concat.default)(_context = "https://".concat(id, ".push.")).call(_context, domain),
- stats: (0, _concat.default)(_context2 = "https://".concat(id, ".stats.")).call(_context2, domain),
- engine: (0, _concat.default)(_context3 = "https://".concat(id, ".engine.")).call(_context3, domain),
- api: (0, _concat.default)(_context4 = "https://".concat(id, ".api.")).call(_context4, domain),
- rtm: (0, _concat.default)(_context5 = "https://".concat(id, ".rtm.")).call(_context5, domain)
- };
- }
- var _disableAppRouter = false;
- var _initialized = false;
- /**
- * URLs for services
- * @typedef {Object} ServerURLs
- * @property {String} [api] serverURL for API service
- * @property {String} [engine] serverURL for engine service
- * @property {String} [stats] serverURL for stats service
- * @property {String} [push] serverURL for push service
- * @property {String} [rtm] serverURL for LiveQuery service
- */
- /**
- * Call this method first to set up your authentication tokens for AV.
- * You can get your app keys from the LeanCloud dashboard on http://leancloud.cn .
- * @function AV.init
- * @param {Object} options
- * @param {String} options.appId application id
- * @param {String} options.appKey application key
- * @param {String} [options.masterKey] application master key
- * @param {Boolean} [options.production]
- * @param {String|ServerURLs} [options.serverURL] URLs for services. if a string was given, it will be applied for all services.
- * @param {Boolean} [options.disableCurrentUser]
- */
- AV.init = function init(options) {
- if (!isObject(options)) {
- return AV.init({
- appId: options,
- appKey: arguments.length <= 1 ? undefined : arguments[1],
- masterKey: arguments.length <= 2 ? undefined : arguments[2]
- });
- }
- var appId = options.appId,
- appKey = options.appKey,
- masterKey = options.masterKey,
- hookKey = options.hookKey,
- serverURL = options.serverURL,
- _options$serverURLs = options.serverURLs,
- serverURLs = _options$serverURLs === void 0 ? serverURL : _options$serverURLs,
- disableCurrentUser = options.disableCurrentUser,
- production = options.production,
- realtime = options.realtime;
- 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.');
- if (!appId) throw new TypeError('appId must be a string');
- if (!appKey) throw new TypeError('appKey must be a string');
- if ("Weapp" !== 'NODE_JS' && masterKey) console.warn('MasterKey is not supposed to be used at client side.');
- if (isCNApp(appId)) {
- if (!serverURLs && isEmpty(AV._config.serverURLs)) {
- throw new TypeError("serverURL option is required for apps from CN region");
- }
- }
- if (appId !== AV._config.applicationId) {
- // overwrite all keys when reinitializing as a new app
- AV._config.masterKey = masterKey;
- AV._config.hookKey = hookKey;
- } else {
- if (masterKey) AV._config.masterKey = masterKey;
- if (hookKey) AV._config.hookKey = hookKey;
- }
- AV._config.applicationId = appId;
- AV._config.applicationKey = appKey;
- if (!isNullOrUndefined(production)) {
- AV.setProduction(production);
- }
- if (typeof disableCurrentUser !== 'undefined') AV._config.disableCurrentUser = disableCurrentUser;
- var disableAppRouter = _disableAppRouter || typeof serverURLs !== 'undefined';
- if (!disableAppRouter) {
- AV._appRouter = new AppRouter(AV);
- }
- AV._setServerURLs(extend({}, getDefaultServerURLs(appId), AV._config.serverURLs, typeof serverURLs === 'string' ? fillServerURLs(serverURLs) : serverURLs), disableAppRouter);
- if (realtime) {
- AV._config.realtime = realtime;
- } else if (AV._sharedConfig.liveQueryRealtime) {
- var _AV$_config$serverURL = AV._config.serverURLs,
- api = _AV$_config$serverURL.api,
- rtm = _AV$_config$serverURL.rtm;
- AV._config.realtime = new AV._sharedConfig.liveQueryRealtime({
- appId: appId,
- appKey: appKey,
- server: {
- api: api,
- RTMRouter: rtm
- }
- });
- }
- _initialized = true;
- }; // If we're running in node.js, allow using the master key.
- if (false) {
- AV.Cloud = AV.Cloud || {};
- /**
- * Switches the LeanCloud SDK to using the Master key. The Master key grants
- * priveleged access to the data in LeanCloud and can be used to bypass ACLs and
- * other restrictions that are applied to the client SDKs.
- * <p><strong><em>Available in Cloud Code and Node.js only.</em></strong>
- * </p>
- */
- AV.Cloud.useMasterKey = function () {
- AV._config.useMasterKey = true;
- };
- }
- /**
- * Call this method to set production environment variable.
- * @function AV.setProduction
- * @param {Boolean} production True is production environment,and
- * it's true by default.
- */
- AV.setProduction = function (production) {
- if (!isNullOrUndefined(production)) {
- AV._config.production = production ? 1 : 0;
- } else {
- // change to default value
- AV._config.production = null;
- }
- };
- AV._setServerURLs = function (urls) {
- var disableAppRouter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
- if (typeof urls !== 'string') {
- extend(AV._config.serverURLs, urls);
- } else {
- AV._config.serverURLs = fillServerURLs(urls);
- }
- if (disableAppRouter) {
- if (AV._appRouter) {
- AV._appRouter.disable();
- } else {
- _disableAppRouter = true;
- }
- }
- };
- /**
- * Set server URLs for services.
- * @function AV.setServerURL
- * @since 4.3.0
- * @param {String|ServerURLs} urls URLs for services. if a string was given, it will be applied for all services.
- * You can also set them when initializing SDK with `options.serverURL`
- */
- AV.setServerURL = function (urls) {
- return AV._setServerURLs(urls);
- };
- AV.setServerURLs = AV.setServerURL;
- AV.keepErrorRawMessage = function (value) {
- AV._sharedConfig.keepErrorRawMessage = value;
- };
- /**
- * Set a deadline for requests to complete.
- * Note that file upload requests are not affected.
- * @function AV.setRequestTimeout
- * @since 3.6.0
- * @param {number} ms
- */
- AV.setRequestTimeout = function (ms) {
- AV._config.requestTimeout = ms;
- }; // backword compatible
- AV.initialize = AV.init;
- var defineConfig = function defineConfig(property) {
- return (0, _defineProperty.default)(AV, property, {
- get: function get() {
- return AV._config[property];
- },
- set: function set(value) {
- AV._config[property] = value;
- }
- });
- };
- ['applicationId', 'applicationKey', 'masterKey', 'hookKey'].forEach(defineConfig);
- /***/ }),
- /* 393 */
- /***/ (function(module, exports, __webpack_require__) {
- var isPrototypeOf = __webpack_require__(21);
- var method = __webpack_require__(394);
- var ArrayPrototype = Array.prototype;
- module.exports = function (it) {
- var own = it.slice;
- return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.slice) ? method : own;
- };
- /***/ }),
- /* 394 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(395);
- var entryVirtual = __webpack_require__(41);
- module.exports = entryVirtual('Array').slice;
- /***/ }),
- /* 395 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var isArray = __webpack_require__(85);
- var isConstructor = __webpack_require__(101);
- var isObject = __webpack_require__(11);
- var toAbsoluteIndex = __webpack_require__(119);
- var lengthOfArrayLike = __webpack_require__(46);
- var toIndexedObject = __webpack_require__(33);
- var createProperty = __webpack_require__(106);
- var wellKnownSymbol = __webpack_require__(9);
- var arrayMethodHasSpeciesSupport = __webpack_require__(107);
- var un$Slice = __webpack_require__(102);
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
- var SPECIES = wellKnownSymbol('species');
- var $Array = Array;
- var max = Math.max;
- // `Array.prototype.slice` method
- // https://tc39.es/ecma262/#sec-array.prototype.slice
- // fallback for not array-like ES3 strings and DOM objects
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
- slice: function slice(start, end) {
- var O = toIndexedObject(this);
- var length = lengthOfArrayLike(O);
- var k = toAbsoluteIndex(start, length);
- var fin = toAbsoluteIndex(end === undefined ? length : end, length);
- // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
- var Constructor, result, n;
- if (isArray(O)) {
- Constructor = O.constructor;
- // cross-realm fallback
- if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {
- Constructor = undefined;
- } else if (isObject(Constructor)) {
- Constructor = Constructor[SPECIES];
- if (Constructor === null) Constructor = undefined;
- }
- if (Constructor === $Array || Constructor === undefined) {
- return un$Slice(O, k, fin);
- }
- }
- result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));
- for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
- result.length = n;
- return result;
- }
- });
- /***/ }),
- /* 396 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(397);
- var path = __webpack_require__(10);
- var Object = path.Object;
- var defineProperty = module.exports = function defineProperty(it, key, desc) {
- return Object.defineProperty(it, key, desc);
- };
- if (Object.defineProperty.sham) defineProperty.sham = true;
- /***/ }),
- /* 397 */
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__(0);
- var DESCRIPTORS = __webpack_require__(16);
- var defineProperty = __webpack_require__(22).f;
- // `Object.defineProperty` method
- // https://tc39.es/ecma262/#sec-object.defineproperty
- // eslint-disable-next-line es-x/no-object-defineproperty -- safe
- $({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {
- defineProperty: defineProperty
- });
- /***/ }),
- /* 398 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var ajax = __webpack_require__(108);
- var Cache = __webpack_require__(226);
- function AppRouter(AV) {
- var _this = this;
- this.AV = AV;
- this.lockedUntil = 0;
- Cache.getAsync('serverURLs').then(function (data) {
- if (_this.disabled) return;
- if (!data) return _this.lock(0);
- var serverURLs = data.serverURLs,
- lockedUntil = data.lockedUntil;
- _this.AV._setServerURLs(serverURLs, false);
- _this.lockedUntil = lockedUntil;
- }).catch(function () {
- return _this.lock(0);
- });
- }
- AppRouter.prototype.disable = function disable() {
- this.disabled = true;
- };
- AppRouter.prototype.lock = function lock(ttl) {
- this.lockedUntil = Date.now() + ttl;
- };
- AppRouter.prototype.refresh = function refresh() {
- var _this2 = this;
- if (this.disabled) return;
- if (Date.now() < this.lockedUntil) return;
- this.lock(10);
- var url = 'https://app-router.com/2/route';
- return ajax({
- method: 'get',
- url: url,
- query: {
- appId: this.AV.applicationId
- }
- }).then(function (servers) {
- if (_this2.disabled) return;
- var ttl = servers.ttl;
- if (!ttl) throw new Error('missing ttl');
- ttl = ttl * 1000;
- var protocal = 'https://';
- var serverURLs = {
- push: protocal + servers.push_server,
- stats: protocal + servers.stats_server,
- engine: protocal + servers.engine_server,
- api: protocal + servers.api_server
- };
- _this2.AV._setServerURLs(serverURLs, false);
- _this2.lock(ttl);
- return Cache.setAsync('serverURLs', {
- serverURLs: serverURLs,
- lockedUntil: _this2.lockedUntil
- }, ttl);
- }).catch(function (error) {
- // bypass all errors
- console.warn("refresh server URLs failed: ".concat(error.message));
- _this2.lock(600);
- });
- };
- module.exports = AppRouter;
- /***/ }),
- /* 399 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(400);
- /***/ }),
- /* 400 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(401);
- __webpack_require__(424);
- __webpack_require__(425);
- __webpack_require__(426);
- __webpack_require__(427);
- __webpack_require__(428);
- // TODO: Remove from `core-js@4`
- __webpack_require__(429);
- __webpack_require__(430);
- __webpack_require__(431);
- module.exports = parent;
- /***/ }),
- /* 401 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(232);
- module.exports = parent;
- /***/ }),
- /* 402 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(218);
- __webpack_require__(60);
- __webpack_require__(233);
- __webpack_require__(408);
- __webpack_require__(409);
- __webpack_require__(410);
- __webpack_require__(411);
- __webpack_require__(237);
- __webpack_require__(412);
- __webpack_require__(413);
- __webpack_require__(414);
- __webpack_require__(415);
- __webpack_require__(416);
- __webpack_require__(417);
- __webpack_require__(418);
- __webpack_require__(419);
- __webpack_require__(420);
- __webpack_require__(421);
- __webpack_require__(422);
- __webpack_require__(423);
- var path = __webpack_require__(10);
- module.exports = path.Symbol;
- /***/ }),
- /* 403 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var global = __webpack_require__(6);
- var call = __webpack_require__(13);
- var uncurryThis = __webpack_require__(4);
- var IS_PURE = __webpack_require__(32);
- var DESCRIPTORS = __webpack_require__(16);
- var NATIVE_SYMBOL = __webpack_require__(57);
- var fails = __webpack_require__(3);
- var hasOwn = __webpack_require__(14);
- var isPrototypeOf = __webpack_require__(21);
- var anObject = __webpack_require__(19);
- var toIndexedObject = __webpack_require__(33);
- var toPropertyKey = __webpack_require__(88);
- var $toString = __webpack_require__(75);
- var createPropertyDescriptor = __webpack_require__(44);
- var nativeObjectCreate = __webpack_require__(47);
- var objectKeys = __webpack_require__(98);
- var getOwnPropertyNamesModule = __webpack_require__(96);
- var getOwnPropertyNamesExternal = __webpack_require__(234);
- var getOwnPropertySymbolsModule = __webpack_require__(97);
- var getOwnPropertyDescriptorModule = __webpack_require__(71);
- var definePropertyModule = __webpack_require__(22);
- var definePropertiesModule = __webpack_require__(154);
- var propertyIsEnumerableModule = __webpack_require__(113);
- var defineBuiltIn = __webpack_require__(39);
- var shared = __webpack_require__(73);
- var sharedKey = __webpack_require__(94);
- var hiddenKeys = __webpack_require__(74);
- var uid = __webpack_require__(92);
- var wellKnownSymbol = __webpack_require__(9);
- var wrappedWellKnownSymbolModule = __webpack_require__(144);
- var defineWellKnownSymbol = __webpack_require__(8);
- var defineSymbolToPrimitive = __webpack_require__(235);
- var setToStringTag = __webpack_require__(49);
- var InternalStateModule = __webpack_require__(38);
- var $forEach = __webpack_require__(66).forEach;
- var HIDDEN = sharedKey('hidden');
- var SYMBOL = 'Symbol';
- var PROTOTYPE = 'prototype';
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(SYMBOL);
- var ObjectPrototype = Object[PROTOTYPE];
- var $Symbol = global.Symbol;
- var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
- var TypeError = global.TypeError;
- var QObject = global.QObject;
- var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
- var nativeDefineProperty = definePropertyModule.f;
- var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
- var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
- var push = uncurryThis([].push);
- var AllSymbols = shared('symbols');
- var ObjectPrototypeSymbols = shared('op-symbols');
- var WellKnownSymbolsStore = shared('wks');
- // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
- var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
- // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
- var setSymbolDescriptor = DESCRIPTORS && fails(function () {
- return nativeObjectCreate(nativeDefineProperty({}, 'a', {
- get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
- })).a != 7;
- }) ? function (O, P, Attributes) {
- var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
- if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
- nativeDefineProperty(O, P, Attributes);
- if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
- nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
- }
- } : nativeDefineProperty;
- var wrap = function (tag, description) {
- var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
- setInternalState(symbol, {
- type: SYMBOL,
- tag: tag,
- description: description
- });
- if (!DESCRIPTORS) symbol.description = description;
- return symbol;
- };
- var $defineProperty = function defineProperty(O, P, Attributes) {
- if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
- anObject(O);
- var key = toPropertyKey(P);
- anObject(Attributes);
- if (hasOwn(AllSymbols, key)) {
- if (!Attributes.enumerable) {
- if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
- O[HIDDEN][key] = true;
- } else {
- if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
- Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
- } return setSymbolDescriptor(O, key, Attributes);
- } return nativeDefineProperty(O, key, Attributes);
- };
- var $defineProperties = function defineProperties(O, Properties) {
- anObject(O);
- var properties = toIndexedObject(Properties);
- var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
- $forEach(keys, function (key) {
- if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
- });
- return O;
- };
- var $create = function create(O, Properties) {
- return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
- };
- var $propertyIsEnumerable = function propertyIsEnumerable(V) {
- var P = toPropertyKey(V);
- var enumerable = call(nativePropertyIsEnumerable, this, P);
- if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;
- return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]
- ? enumerable : true;
- };
- var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
- var it = toIndexedObject(O);
- var key = toPropertyKey(P);
- if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;
- var descriptor = nativeGetOwnPropertyDescriptor(it, key);
- if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {
- descriptor.enumerable = true;
- }
- return descriptor;
- };
- var $getOwnPropertyNames = function getOwnPropertyNames(O) {
- var names = nativeGetOwnPropertyNames(toIndexedObject(O));
- var result = [];
- $forEach(names, function (key) {
- if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key);
- });
- return result;
- };
- var $getOwnPropertySymbols = function (O) {
- var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
- var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
- var result = [];
- $forEach(names, function (key) {
- if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
- push(result, AllSymbols[key]);
- }
- });
- return result;
- };
- // `Symbol` constructor
- // https://tc39.es/ecma262/#sec-symbol-constructor
- if (!NATIVE_SYMBOL) {
- $Symbol = function Symbol() {
- if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor');
- var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
- var tag = uid(description);
- var setter = function (value) {
- if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value);
- if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
- setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
- };
- if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
- return wrap(tag, description);
- };
- SymbolPrototype = $Symbol[PROTOTYPE];
- defineBuiltIn(SymbolPrototype, 'toString', function toString() {
- return getInternalState(this).tag;
- });
- defineBuiltIn($Symbol, 'withoutSetter', function (description) {
- return wrap(uid(description), description);
- });
- propertyIsEnumerableModule.f = $propertyIsEnumerable;
- definePropertyModule.f = $defineProperty;
- definePropertiesModule.f = $defineProperties;
- getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
- getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
- getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
- wrappedWellKnownSymbolModule.f = function (name) {
- return wrap(wellKnownSymbol(name), name);
- };
- if (DESCRIPTORS) {
- // https://github.com/tc39/proposal-Symbol-description
- nativeDefineProperty(SymbolPrototype, 'description', {
- configurable: true,
- get: function description() {
- return getInternalState(this).description;
- }
- });
- if (!IS_PURE) {
- defineBuiltIn(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
- }
- }
- }
- $({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
- Symbol: $Symbol
- });
- $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
- defineWellKnownSymbol(name);
- });
- $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
- useSetter: function () { USE_SETTER = true; },
- useSimple: function () { USE_SETTER = false; }
- });
- $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
- // `Object.create` method
- // https://tc39.es/ecma262/#sec-object.create
- create: $create,
- // `Object.defineProperty` method
- // https://tc39.es/ecma262/#sec-object.defineproperty
- defineProperty: $defineProperty,
- // `Object.defineProperties` method
- // https://tc39.es/ecma262/#sec-object.defineproperties
- defineProperties: $defineProperties,
- // `Object.getOwnPropertyDescriptor` method
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
- getOwnPropertyDescriptor: $getOwnPropertyDescriptor
- });
- $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
- // `Object.getOwnPropertyNames` method
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
- getOwnPropertyNames: $getOwnPropertyNames
- });
- // `Symbol.prototype[@@toPrimitive]` method
- // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
- defineSymbolToPrimitive();
- // `Symbol.prototype[@@toStringTag]` property
- // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
- setToStringTag($Symbol, SYMBOL);
- hiddenKeys[HIDDEN] = true;
- /***/ }),
- /* 404 */
- /***/ (function(module, exports, __webpack_require__) {
- var toAbsoluteIndex = __webpack_require__(119);
- var lengthOfArrayLike = __webpack_require__(46);
- var createProperty = __webpack_require__(106);
- var $Array = Array;
- var max = Math.max;
- module.exports = function (O, start, end) {
- var length = lengthOfArrayLike(O);
- var k = toAbsoluteIndex(start, length);
- var fin = toAbsoluteIndex(end === undefined ? length : end, length);
- var result = $Array(max(fin - k, 0));
- for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
- result.length = n;
- return result;
- };
- /***/ }),
- /* 405 */
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__(0);
- var getBuiltIn = __webpack_require__(18);
- var hasOwn = __webpack_require__(14);
- var toString = __webpack_require__(75);
- var shared = __webpack_require__(73);
- var NATIVE_SYMBOL_REGISTRY = __webpack_require__(236);
- var StringToSymbolRegistry = shared('string-to-symbol-registry');
- var SymbolToStringRegistry = shared('symbol-to-string-registry');
- // `Symbol.for` method
- // https://tc39.es/ecma262/#sec-symbol.for
- $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
- 'for': function (key) {
- var string = toString(key);
- if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
- var symbol = getBuiltIn('Symbol')(string);
- StringToSymbolRegistry[string] = symbol;
- SymbolToStringRegistry[symbol] = string;
- return symbol;
- }
- });
- /***/ }),
- /* 406 */
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__(0);
- var hasOwn = __webpack_require__(14);
- var isSymbol = __webpack_require__(89);
- var tryToString = __webpack_require__(72);
- var shared = __webpack_require__(73);
- var NATIVE_SYMBOL_REGISTRY = __webpack_require__(236);
- var SymbolToStringRegistry = shared('symbol-to-string-registry');
- // `Symbol.keyFor` method
- // https://tc39.es/ecma262/#sec-symbol.keyfor
- $({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
- keyFor: function keyFor(sym) {
- if (!isSymbol(sym)) throw TypeError(tryToString(sym) + ' is not a symbol');
- if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
- }
- });
- /***/ }),
- /* 407 */
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__(0);
- var NATIVE_SYMBOL = __webpack_require__(57);
- var fails = __webpack_require__(3);
- var getOwnPropertySymbolsModule = __webpack_require__(97);
- var toObject = __webpack_require__(34);
- // V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
- // https://bugs.chromium.org/p/v8/issues/detail?id=3443
- var FORCED = !NATIVE_SYMBOL || fails(function () { getOwnPropertySymbolsModule.f(1); });
- // `Object.getOwnPropertySymbols` method
- // https://tc39.es/ecma262/#sec-object.getownpropertysymbols
- $({ target: 'Object', stat: true, forced: FORCED }, {
- getOwnPropertySymbols: function getOwnPropertySymbols(it) {
- var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
- return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it)) : [];
- }
- });
- /***/ }),
- /* 408 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.asyncIterator` well-known symbol
- // https://tc39.es/ecma262/#sec-symbol.asynciterator
- defineWellKnownSymbol('asyncIterator');
- /***/ }),
- /* 409 */
- /***/ (function(module, exports) {
- // empty
- /***/ }),
- /* 410 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.hasInstance` well-known symbol
- // https://tc39.es/ecma262/#sec-symbol.hasinstance
- defineWellKnownSymbol('hasInstance');
- /***/ }),
- /* 411 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.isConcatSpreadable` well-known symbol
- // https://tc39.es/ecma262/#sec-symbol.isconcatspreadable
- defineWellKnownSymbol('isConcatSpreadable');
- /***/ }),
- /* 412 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.match` well-known symbol
- // https://tc39.es/ecma262/#sec-symbol.match
- defineWellKnownSymbol('match');
- /***/ }),
- /* 413 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.matchAll` well-known symbol
- // https://tc39.es/ecma262/#sec-symbol.matchall
- defineWellKnownSymbol('matchAll');
- /***/ }),
- /* 414 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.replace` well-known symbol
- // https://tc39.es/ecma262/#sec-symbol.replace
- defineWellKnownSymbol('replace');
- /***/ }),
- /* 415 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.search` well-known symbol
- // https://tc39.es/ecma262/#sec-symbol.search
- defineWellKnownSymbol('search');
- /***/ }),
- /* 416 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.species` well-known symbol
- // https://tc39.es/ecma262/#sec-symbol.species
- defineWellKnownSymbol('species');
- /***/ }),
- /* 417 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.split` well-known symbol
- // https://tc39.es/ecma262/#sec-symbol.split
- defineWellKnownSymbol('split');
- /***/ }),
- /* 418 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- var defineSymbolToPrimitive = __webpack_require__(235);
- // `Symbol.toPrimitive` well-known symbol
- // https://tc39.es/ecma262/#sec-symbol.toprimitive
- defineWellKnownSymbol('toPrimitive');
- // `Symbol.prototype[@@toPrimitive]` method
- // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
- defineSymbolToPrimitive();
- /***/ }),
- /* 419 */
- /***/ (function(module, exports, __webpack_require__) {
- var getBuiltIn = __webpack_require__(18);
- var defineWellKnownSymbol = __webpack_require__(8);
- var setToStringTag = __webpack_require__(49);
- // `Symbol.toStringTag` well-known symbol
- // https://tc39.es/ecma262/#sec-symbol.tostringtag
- defineWellKnownSymbol('toStringTag');
- // `Symbol.prototype[@@toStringTag]` property
- // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
- setToStringTag(getBuiltIn('Symbol'), 'Symbol');
- /***/ }),
- /* 420 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.unscopables` well-known symbol
- // https://tc39.es/ecma262/#sec-symbol.unscopables
- defineWellKnownSymbol('unscopables');
- /***/ }),
- /* 421 */
- /***/ (function(module, exports, __webpack_require__) {
- var global = __webpack_require__(6);
- var setToStringTag = __webpack_require__(49);
- // JSON[@@toStringTag] property
- // https://tc39.es/ecma262/#sec-json-@@tostringtag
- setToStringTag(global.JSON, 'JSON', true);
- /***/ }),
- /* 422 */
- /***/ (function(module, exports) {
- // empty
- /***/ }),
- /* 423 */
- /***/ (function(module, exports) {
- // empty
- /***/ }),
- /* 424 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.asyncDispose` well-known symbol
- // https://github.com/tc39/proposal-using-statement
- defineWellKnownSymbol('asyncDispose');
- /***/ }),
- /* 425 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.dispose` well-known symbol
- // https://github.com/tc39/proposal-using-statement
- defineWellKnownSymbol('dispose');
- /***/ }),
- /* 426 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.matcher` well-known symbol
- // https://github.com/tc39/proposal-pattern-matching
- defineWellKnownSymbol('matcher');
- /***/ }),
- /* 427 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.metadataKey` well-known symbol
- // https://github.com/tc39/proposal-decorator-metadata
- defineWellKnownSymbol('metadataKey');
- /***/ }),
- /* 428 */
- /***/ (function(module, exports, __webpack_require__) {
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.observable` well-known symbol
- // https://github.com/tc39/proposal-observable
- defineWellKnownSymbol('observable');
- /***/ }),
- /* 429 */
- /***/ (function(module, exports, __webpack_require__) {
- // TODO: Remove from `core-js@4`
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.metadata` well-known symbol
- // https://github.com/tc39/proposal-decorators
- defineWellKnownSymbol('metadata');
- /***/ }),
- /* 430 */
- /***/ (function(module, exports, __webpack_require__) {
- // TODO: remove from `core-js@4`
- var defineWellKnownSymbol = __webpack_require__(8);
- // `Symbol.patternMatch` well-known symbol
- // https://github.com/tc39/proposal-pattern-matching
- defineWellKnownSymbol('patternMatch');
- /***/ }),
- /* 431 */
- /***/ (function(module, exports, __webpack_require__) {
- // TODO: remove from `core-js@4`
- var defineWellKnownSymbol = __webpack_require__(8);
- defineWellKnownSymbol('replaceAll');
- /***/ }),
- /* 432 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(433);
- /***/ }),
- /* 433 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(434);
- /***/ }),
- /* 434 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(435);
- module.exports = parent;
- /***/ }),
- /* 435 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(238);
- module.exports = parent;
- /***/ }),
- /* 436 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(48);
- __webpack_require__(60);
- __webpack_require__(78);
- __webpack_require__(237);
- var WrappedWellKnownSymbolModule = __webpack_require__(144);
- module.exports = WrappedWellKnownSymbolModule.f('iterator');
- /***/ }),
- /* 437 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(438);
- /***/ }),
- /* 438 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(439);
- module.exports = parent;
- /***/ }),
- /* 439 */
- /***/ (function(module, exports, __webpack_require__) {
- var isPrototypeOf = __webpack_require__(21);
- var method = __webpack_require__(440);
- var ArrayPrototype = Array.prototype;
- module.exports = function (it) {
- var own = it.filter;
- return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.filter) ? method : own;
- };
- /***/ }),
- /* 440 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(441);
- var entryVirtual = __webpack_require__(41);
- module.exports = entryVirtual('Array').filter;
- /***/ }),
- /* 441 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var $filter = __webpack_require__(66).filter;
- var arrayMethodHasSpeciesSupport = __webpack_require__(107);
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
- // `Array.prototype.filter` method
- // https://tc39.es/ecma262/#sec-array.prototype.filter
- // with adding support of @@species
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
- filter: function filter(callbackfn /* , thisArg */) {
- return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- /***/ }),
- /* 442 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // Copyright (c) 2015-2017 David M. Lee, II
- /**
- * Local reference to TimeoutError
- * @private
- */
- var TimeoutError;
- /**
- * Rejects a promise with a {@link TimeoutError} if it does not settle within
- * the specified timeout.
- *
- * @param {Promise} promise The promise.
- * @param {number} timeoutMillis Number of milliseconds to wait on settling.
- * @returns {Promise} Either resolves/rejects with `promise`, or rejects with
- * `TimeoutError`, whichever settles first.
- */
- var timeout = module.exports.timeout = function(promise, timeoutMillis) {
- var error = new TimeoutError(),
- timeout;
- return Promise.race([
- promise,
- new Promise(function(resolve, reject) {
- timeout = setTimeout(function() {
- reject(error);
- }, timeoutMillis);
- }),
- ]).then(function(v) {
- clearTimeout(timeout);
- return v;
- }, function(err) {
- clearTimeout(timeout);
- throw err;
- });
- };
- /**
- * Exception indicating that the timeout expired.
- */
- TimeoutError = module.exports.TimeoutError = function() {
- Error.call(this)
- this.stack = Error().stack
- this.message = 'Timeout';
- };
- TimeoutError.prototype = Object.create(Error.prototype);
- TimeoutError.prototype.name = "TimeoutError";
- /***/ }),
- /* 443 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _slice = _interopRequireDefault(__webpack_require__(87));
- var _keys = _interopRequireDefault(__webpack_require__(55));
- var _concat = _interopRequireDefault(__webpack_require__(30));
- var _ = __webpack_require__(2);
- module.exports = function (AV) {
- var eventSplitter = /\s+/;
- var slice = (0, _slice.default)(Array.prototype);
- /**
- * @class
- *
- * <p>AV.Events is a fork of Backbone's Events module, provided for your
- * convenience.</p>
- *
- * <p>A module that can be mixed in to any object in order to provide
- * it with custom events. You may bind callback functions to an event
- * with `on`, or remove these functions with `off`.
- * Triggering an event fires all callbacks in the order that `on` was
- * called.
- *
- * @private
- * @example
- * var object = {};
- * _.extend(object, AV.Events);
- * object.on('expand', function(){ alert('expanded'); });
- * object.trigger('expand');</pre></p>
- *
- */
- AV.Events = {
- /**
- * Bind one or more space separated events, `events`, to a `callback`
- * function. Passing `"all"` will bind the callback to all events fired.
- */
- on: function on(events, callback, context) {
- var calls, event, node, tail, list;
- if (!callback) {
- return this;
- }
- events = events.split(eventSplitter);
- calls = this._callbacks || (this._callbacks = {}); // Create an immutable callback list, allowing traversal during
- // modification. The tail is an empty object that will always be used
- // as the next node.
- event = events.shift();
- while (event) {
- list = calls[event];
- node = list ? list.tail : {};
- node.next = tail = {};
- node.context = context;
- node.callback = callback;
- calls[event] = {
- tail: tail,
- next: list ? list.next : node
- };
- event = events.shift();
- }
- return this;
- },
- /**
- * Remove one or many callbacks. If `context` is null, removes all callbacks
- * with that function. If `callback` is null, removes all callbacks for the
- * event. If `events` is null, removes all bound callbacks for all events.
- */
- off: function off(events, callback, context) {
- var event, calls, node, tail, cb, ctx; // No events, or removing *all* events.
- if (!(calls = this._callbacks)) {
- return;
- }
- if (!(events || callback || context)) {
- delete this._callbacks;
- return this;
- } // Loop through the listed events and contexts, splicing them out of the
- // linked list of callbacks if appropriate.
- events = events ? events.split(eventSplitter) : (0, _keys.default)(_).call(_, calls);
- event = events.shift();
- while (event) {
- node = calls[event];
- delete calls[event];
- if (!node || !(callback || context)) {
- continue;
- } // Create a new list, omitting the indicated callbacks.
- tail = node.tail;
- node = node.next;
- while (node !== tail) {
- cb = node.callback;
- ctx = node.context;
- if (callback && cb !== callback || context && ctx !== context) {
- this.on(event, cb, ctx);
- }
- node = node.next;
- }
- event = events.shift();
- }
- return this;
- },
- /**
- * Trigger one or many events, firing all bound callbacks. Callbacks are
- * passed the same arguments as `trigger` is, apart from the event name
- * (unless you're listening on `"all"`, which will cause your callback to
- * receive the true name of the event as the first argument).
- */
- trigger: function trigger(events) {
- var event, node, calls, tail, args, all, rest;
- if (!(calls = this._callbacks)) {
- return this;
- }
- all = calls.all;
- events = events.split(eventSplitter);
- rest = slice.call(arguments, 1); // For each event, walk through the linked list of callbacks twice,
- // first to trigger the event, then to trigger any `"all"` callbacks.
- event = events.shift();
- while (event) {
- node = calls[event];
- if (node) {
- tail = node.tail;
- while ((node = node.next) !== tail) {
- node.callback.apply(node.context || this, rest);
- }
- }
- node = all;
- if (node) {
- var _context;
- tail = node.tail;
- args = (0, _concat.default)(_context = [event]).call(_context, rest);
- while ((node = node.next) !== tail) {
- node.callback.apply(node.context || this, args);
- }
- }
- event = events.shift();
- }
- return this;
- }
- };
- /**
- * @function
- */
- AV.Events.bind = AV.Events.on;
- /**
- * @function
- */
- AV.Events.unbind = AV.Events.off;
- };
- /***/ }),
- /* 444 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _ = __webpack_require__(2);
- /*global navigator: false */
- module.exports = function (AV) {
- /**
- * Creates a new GeoPoint with any of the following forms:<br>
- * @example
- * new GeoPoint(otherGeoPoint)
- * new GeoPoint(30, 30)
- * new GeoPoint([30, 30])
- * new GeoPoint({latitude: 30, longitude: 30})
- * new GeoPoint() // defaults to (0, 0)
- * @class
- *
- * <p>Represents a latitude / longitude point that may be associated
- * with a key in a AVObject or used as a reference point for geo queries.
- * This allows proximity-based queries on the key.</p>
- *
- * <p>Only one key in a class may contain a GeoPoint.</p>
- *
- * <p>Example:<pre>
- * var point = new AV.GeoPoint(30.0, -20.0);
- * var object = new AV.Object("PlaceObject");
- * object.set("location", point);
- * object.save();</pre></p>
- */
- AV.GeoPoint = function (arg1, arg2) {
- if (_.isArray(arg1)) {
- AV.GeoPoint._validate(arg1[0], arg1[1]);
- this.latitude = arg1[0];
- this.longitude = arg1[1];
- } else if (_.isObject(arg1)) {
- AV.GeoPoint._validate(arg1.latitude, arg1.longitude);
- this.latitude = arg1.latitude;
- this.longitude = arg1.longitude;
- } else if (_.isNumber(arg1) && _.isNumber(arg2)) {
- AV.GeoPoint._validate(arg1, arg2);
- this.latitude = arg1;
- this.longitude = arg2;
- } else {
- this.latitude = 0;
- this.longitude = 0;
- } // Add properties so that anyone using Webkit or Mozilla will get an error
- // if they try to set values that are out of bounds.
- var self = this;
- if (this.__defineGetter__ && this.__defineSetter__) {
- // Use _latitude and _longitude to actually store the values, and add
- // getters and setters for latitude and longitude.
- this._latitude = this.latitude;
- this._longitude = this.longitude;
- this.__defineGetter__('latitude', function () {
- return self._latitude;
- });
- this.__defineGetter__('longitude', function () {
- return self._longitude;
- });
- this.__defineSetter__('latitude', function (val) {
- AV.GeoPoint._validate(val, self.longitude);
- self._latitude = val;
- });
- this.__defineSetter__('longitude', function (val) {
- AV.GeoPoint._validate(self.latitude, val);
- self._longitude = val;
- });
- }
- };
- /**
- * @lends AV.GeoPoint.prototype
- * @property {float} latitude North-south portion of the coordinate, in range
- * [-90, 90]. Throws an exception if set out of range in a modern browser.
- * @property {float} longitude East-west portion of the coordinate, in range
- * [-180, 180]. Throws if set out of range in a modern browser.
- */
- /**
- * Throws an exception if the given lat-long is out of bounds.
- * @private
- */
- AV.GeoPoint._validate = function (latitude, longitude) {
- if (latitude < -90.0) {
- throw new Error('AV.GeoPoint latitude ' + latitude + ' < -90.0.');
- }
- if (latitude > 90.0) {
- throw new Error('AV.GeoPoint latitude ' + latitude + ' > 90.0.');
- }
- if (longitude < -180.0) {
- throw new Error('AV.GeoPoint longitude ' + longitude + ' < -180.0.');
- }
- if (longitude > 180.0) {
- throw new Error('AV.GeoPoint longitude ' + longitude + ' > 180.0.');
- }
- };
- /**
- * Creates a GeoPoint with the user's current location, if available.
- * @return {Promise.<AV.GeoPoint>}
- */
- AV.GeoPoint.current = function () {
- return new _promise.default(function (resolve, reject) {
- navigator.geolocation.getCurrentPosition(function (location) {
- resolve(new AV.GeoPoint({
- latitude: location.coords.latitude,
- longitude: location.coords.longitude
- }));
- }, reject);
- });
- };
- _.extend(AV.GeoPoint.prototype,
- /** @lends AV.GeoPoint.prototype */
- {
- /**
- * Returns a JSON representation of the GeoPoint, suitable for AV.
- * @return {Object}
- */
- toJSON: function toJSON() {
- AV.GeoPoint._validate(this.latitude, this.longitude);
- return {
- __type: 'GeoPoint',
- latitude: this.latitude,
- longitude: this.longitude
- };
- },
- /**
- * Returns the distance from this GeoPoint to another in radians.
- * @param {AV.GeoPoint} point the other AV.GeoPoint.
- * @return {Number}
- */
- radiansTo: function radiansTo(point) {
- var d2r = Math.PI / 180.0;
- var lat1rad = this.latitude * d2r;
- var long1rad = this.longitude * d2r;
- var lat2rad = point.latitude * d2r;
- var long2rad = point.longitude * d2r;
- var deltaLat = lat1rad - lat2rad;
- var deltaLong = long1rad - long2rad;
- var sinDeltaLatDiv2 = Math.sin(deltaLat / 2);
- var sinDeltaLongDiv2 = Math.sin(deltaLong / 2); // Square of half the straight line chord distance between both points.
- var a = sinDeltaLatDiv2 * sinDeltaLatDiv2 + Math.cos(lat1rad) * Math.cos(lat2rad) * sinDeltaLongDiv2 * sinDeltaLongDiv2;
- a = Math.min(1.0, a);
- return 2 * Math.asin(Math.sqrt(a));
- },
- /**
- * Returns the distance from this GeoPoint to another in kilometers.
- * @param {AV.GeoPoint} point the other AV.GeoPoint.
- * @return {Number}
- */
- kilometersTo: function kilometersTo(point) {
- return this.radiansTo(point) * 6371.0;
- },
- /**
- * Returns the distance from this GeoPoint to another in miles.
- * @param {AV.GeoPoint} point the other AV.GeoPoint.
- * @return {Number}
- */
- milesTo: function milesTo(point) {
- return this.radiansTo(point) * 3958.8;
- }
- });
- };
- /***/ }),
- /* 445 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _ = __webpack_require__(2);
- module.exports = function (AV) {
- var PUBLIC_KEY = '*';
- /**
- * Creates a new ACL.
- * If no argument is given, the ACL has no permissions for anyone.
- * If the argument is a AV.User, the ACL will have read and write
- * permission for only that user.
- * If the argument is any other JSON object, that object will be interpretted
- * as a serialized ACL created with toJSON().
- * @see AV.Object#setACL
- * @class
- *
- * <p>An ACL, or Access Control List can be added to any
- * <code>AV.Object</code> to restrict access to only a subset of users
- * of your application.</p>
- */
- AV.ACL = function (arg1) {
- var self = this;
- self.permissionsById = {};
- if (_.isObject(arg1)) {
- if (arg1 instanceof AV.User) {
- self.setReadAccess(arg1, true);
- self.setWriteAccess(arg1, true);
- } else {
- if (_.isFunction(arg1)) {
- throw new Error('AV.ACL() called with a function. Did you forget ()?');
- }
- AV._objectEach(arg1, function (accessList, userId) {
- if (!_.isString(userId)) {
- throw new Error('Tried to create an ACL with an invalid userId.');
- }
- self.permissionsById[userId] = {};
- AV._objectEach(accessList, function (allowed, permission) {
- if (permission !== 'read' && permission !== 'write') {
- throw new Error('Tried to create an ACL with an invalid permission type.');
- }
- if (!_.isBoolean(allowed)) {
- throw new Error('Tried to create an ACL with an invalid permission value.');
- }
- self.permissionsById[userId][permission] = allowed;
- });
- });
- }
- }
- };
- /**
- * Returns a JSON-encoded version of the ACL.
- * @return {Object}
- */
- AV.ACL.prototype.toJSON = function () {
- return _.clone(this.permissionsById);
- };
- AV.ACL.prototype._setAccess = function (accessType, userId, allowed) {
- if (userId instanceof AV.User) {
- userId = userId.id;
- } else if (userId instanceof AV.Role) {
- userId = 'role:' + userId.getName();
- }
- if (!_.isString(userId)) {
- throw new Error('userId must be a string.');
- }
- if (!_.isBoolean(allowed)) {
- throw new Error('allowed must be either true or false.');
- }
- var permissions = this.permissionsById[userId];
- if (!permissions) {
- if (!allowed) {
- // The user already doesn't have this permission, so no action needed.
- return;
- } else {
- permissions = {};
- this.permissionsById[userId] = permissions;
- }
- }
- if (allowed) {
- this.permissionsById[userId][accessType] = true;
- } else {
- delete permissions[accessType];
- if (_.isEmpty(permissions)) {
- delete this.permissionsById[userId];
- }
- }
- };
- AV.ACL.prototype._getAccess = function (accessType, userId) {
- if (userId instanceof AV.User) {
- userId = userId.id;
- } else if (userId instanceof AV.Role) {
- userId = 'role:' + userId.getName();
- }
- var permissions = this.permissionsById[userId];
- if (!permissions) {
- return false;
- }
- return permissions[accessType] ? true : false;
- };
- /**
- * Set whether the given user is allowed to read this object.
- * @param userId An instance of AV.User or its objectId.
- * @param {Boolean} allowed Whether that user should have read access.
- */
- AV.ACL.prototype.setReadAccess = function (userId, allowed) {
- this._setAccess('read', userId, allowed);
- };
- /**
- * Get whether the given user id is *explicitly* allowed to read this object.
- * Even if this returns false, the user may still be able to access it if
- * getPublicReadAccess returns true or a role that the user belongs to has
- * write access.
- * @param userId An instance of AV.User or its objectId, or a AV.Role.
- * @return {Boolean}
- */
- AV.ACL.prototype.getReadAccess = function (userId) {
- return this._getAccess('read', userId);
- };
- /**
- * Set whether the given user id is allowed to write this object.
- * @param userId An instance of AV.User or its objectId, or a AV.Role..
- * @param {Boolean} allowed Whether that user should have write access.
- */
- AV.ACL.prototype.setWriteAccess = function (userId, allowed) {
- this._setAccess('write', userId, allowed);
- };
- /**
- * Get whether the given user id is *explicitly* allowed to write this object.
- * Even if this returns false, the user may still be able to write it if
- * getPublicWriteAccess returns true or a role that the user belongs to has
- * write access.
- * @param userId An instance of AV.User or its objectId, or a AV.Role.
- * @return {Boolean}
- */
- AV.ACL.prototype.getWriteAccess = function (userId) {
- return this._getAccess('write', userId);
- };
- /**
- * Set whether the public is allowed to read this object.
- * @param {Boolean} allowed
- */
- AV.ACL.prototype.setPublicReadAccess = function (allowed) {
- this.setReadAccess(PUBLIC_KEY, allowed);
- };
- /**
- * Get whether the public is allowed to read this object.
- * @return {Boolean}
- */
- AV.ACL.prototype.getPublicReadAccess = function () {
- return this.getReadAccess(PUBLIC_KEY);
- };
- /**
- * Set whether the public is allowed to write this object.
- * @param {Boolean} allowed
- */
- AV.ACL.prototype.setPublicWriteAccess = function (allowed) {
- this.setWriteAccess(PUBLIC_KEY, allowed);
- };
- /**
- * Get whether the public is allowed to write this object.
- * @return {Boolean}
- */
- AV.ACL.prototype.getPublicWriteAccess = function () {
- return this.getWriteAccess(PUBLIC_KEY);
- };
- /**
- * Get whether users belonging to the given role are allowed
- * to read this object. Even if this returns false, the role may
- * still be able to write it if a parent role has read access.
- *
- * @param role The name of the role, or a AV.Role object.
- * @return {Boolean} true if the role has read access. false otherwise.
- * @throws {String} If role is neither a AV.Role nor a String.
- */
- AV.ACL.prototype.getRoleReadAccess = function (role) {
- if (role instanceof AV.Role) {
- // Normalize to the String name
- role = role.getName();
- }
- if (_.isString(role)) {
- return this.getReadAccess('role:' + role);
- }
- throw new Error('role must be a AV.Role or a String');
- };
- /**
- * Get whether users belonging to the given role are allowed
- * to write this object. Even if this returns false, the role may
- * still be able to write it if a parent role has write access.
- *
- * @param role The name of the role, or a AV.Role object.
- * @return {Boolean} true if the role has write access. false otherwise.
- * @throws {String} If role is neither a AV.Role nor a String.
- */
- AV.ACL.prototype.getRoleWriteAccess = function (role) {
- if (role instanceof AV.Role) {
- // Normalize to the String name
- role = role.getName();
- }
- if (_.isString(role)) {
- return this.getWriteAccess('role:' + role);
- }
- throw new Error('role must be a AV.Role or a String');
- };
- /**
- * Set whether users belonging to the given role are allowed
- * to read this object.
- *
- * @param role The name of the role, or a AV.Role object.
- * @param {Boolean} allowed Whether the given role can read this object.
- * @throws {String} If role is neither a AV.Role nor a String.
- */
- AV.ACL.prototype.setRoleReadAccess = function (role, allowed) {
- if (role instanceof AV.Role) {
- // Normalize to the String name
- role = role.getName();
- }
- if (_.isString(role)) {
- this.setReadAccess('role:' + role, allowed);
- return;
- }
- throw new Error('role must be a AV.Role or a String');
- };
- /**
- * Set whether users belonging to the given role are allowed
- * to write this object.
- *
- * @param role The name of the role, or a AV.Role object.
- * @param {Boolean} allowed Whether the given role can write this object.
- * @throws {String} If role is neither a AV.Role nor a String.
- */
- AV.ACL.prototype.setRoleWriteAccess = function (role, allowed) {
- if (role instanceof AV.Role) {
- // Normalize to the String name
- role = role.getName();
- }
- if (_.isString(role)) {
- this.setWriteAccess('role:' + role, allowed);
- return;
- }
- throw new Error('role must be a AV.Role or a String');
- };
- };
- /***/ }),
- /* 446 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _concat = _interopRequireDefault(__webpack_require__(30));
- var _find = _interopRequireDefault(__webpack_require__(110));
- var _indexOf = _interopRequireDefault(__webpack_require__(86));
- var _map = _interopRequireDefault(__webpack_require__(42));
- var _ = __webpack_require__(2);
- module.exports = function (AV) {
- /**
- * @private
- * @class
- * A AV.Op is an atomic operation that can be applied to a field in a
- * AV.Object. For example, calling <code>object.set("foo", "bar")</code>
- * is an example of a AV.Op.Set. Calling <code>object.unset("foo")</code>
- * is a AV.Op.Unset. These operations are stored in a AV.Object and
- * sent to the server as part of <code>object.save()</code> operations.
- * Instances of AV.Op should be immutable.
- *
- * You should not create subclasses of AV.Op or instantiate AV.Op
- * directly.
- */
- AV.Op = function () {
- this._initialize.apply(this, arguments);
- };
- _.extend(AV.Op.prototype,
- /** @lends AV.Op.prototype */
- {
- _initialize: function _initialize() {}
- });
- _.extend(AV.Op, {
- /**
- * To create a new Op, call AV.Op._extend();
- * @private
- */
- _extend: AV._extend,
- // A map of __op string to decoder function.
- _opDecoderMap: {},
- /**
- * Registers a function to convert a json object with an __op field into an
- * instance of a subclass of AV.Op.
- * @private
- */
- _registerDecoder: function _registerDecoder(opName, decoder) {
- AV.Op._opDecoderMap[opName] = decoder;
- },
- /**
- * Converts a json object into an instance of a subclass of AV.Op.
- * @private
- */
- _decode: function _decode(json) {
- var decoder = AV.Op._opDecoderMap[json.__op];
- if (decoder) {
- return decoder(json);
- } else {
- return undefined;
- }
- }
- });
- /*
- * Add a handler for Batch ops.
- */
- AV.Op._registerDecoder('Batch', function (json) {
- var op = null;
- AV._arrayEach(json.ops, function (nextOp) {
- nextOp = AV.Op._decode(nextOp);
- op = nextOp._mergeWithPrevious(op);
- });
- return op;
- });
- /**
- * @private
- * @class
- * A Set operation indicates that either the field was changed using
- * AV.Object.set, or it is a mutable container that was detected as being
- * changed.
- */
- AV.Op.Set = AV.Op._extend(
- /** @lends AV.Op.Set.prototype */
- {
- _initialize: function _initialize(value) {
- this._value = value;
- },
- /**
- * Returns the new value of this field after the set.
- */
- value: function value() {
- return this._value;
- },
- /**
- * Returns a JSON version of the operation suitable for sending to AV.
- * @return {Object}
- */
- toJSON: function toJSON() {
- return AV._encode(this.value());
- },
- _mergeWithPrevious: function _mergeWithPrevious(previous) {
- return this;
- },
- _estimate: function _estimate(oldValue) {
- return this.value();
- }
- });
- /**
- * A sentinel value that is returned by AV.Op.Unset._estimate to
- * indicate the field should be deleted. Basically, if you find _UNSET as a
- * value in your object, you should remove that key.
- */
- AV.Op._UNSET = {};
- /**
- * @private
- * @class
- * An Unset operation indicates that this field has been deleted from the
- * object.
- */
- AV.Op.Unset = AV.Op._extend(
- /** @lends AV.Op.Unset.prototype */
- {
- /**
- * Returns a JSON version of the operation suitable for sending to AV.
- * @return {Object}
- */
- toJSON: function toJSON() {
- return {
- __op: 'Delete'
- };
- },
- _mergeWithPrevious: function _mergeWithPrevious(previous) {
- return this;
- },
- _estimate: function _estimate(oldValue) {
- return AV.Op._UNSET;
- }
- });
- AV.Op._registerDecoder('Delete', function (json) {
- return new AV.Op.Unset();
- });
- /**
- * @private
- * @class
- * An Increment is an atomic operation where the numeric value for the field
- * will be increased by a given amount.
- */
- AV.Op.Increment = AV.Op._extend(
- /** @lends AV.Op.Increment.prototype */
- {
- _initialize: function _initialize(amount) {
- this._amount = amount;
- },
- /**
- * Returns the amount to increment by.
- * @return {Number} the amount to increment by.
- */
- amount: function amount() {
- return this._amount;
- },
- /**
- * Returns a JSON version of the operation suitable for sending to AV.
- * @return {Object}
- */
- toJSON: function toJSON() {
- return {
- __op: 'Increment',
- amount: this._amount
- };
- },
- _mergeWithPrevious: function _mergeWithPrevious(previous) {
- if (!previous) {
- return this;
- } else if (previous instanceof AV.Op.Unset) {
- return new AV.Op.Set(this.amount());
- } else if (previous instanceof AV.Op.Set) {
- return new AV.Op.Set(previous.value() + this.amount());
- } else if (previous instanceof AV.Op.Increment) {
- return new AV.Op.Increment(this.amount() + previous.amount());
- } else {
- throw new Error('Op is invalid after previous op.');
- }
- },
- _estimate: function _estimate(oldValue) {
- if (!oldValue) {
- return this.amount();
- }
- return oldValue + this.amount();
- }
- });
- AV.Op._registerDecoder('Increment', function (json) {
- return new AV.Op.Increment(json.amount);
- });
- /**
- * @private
- * @class
- * BitAnd is an atomic operation where the given value will be bit and to the
- * value than is stored in this field.
- */
- AV.Op.BitAnd = AV.Op._extend(
- /** @lends AV.Op.BitAnd.prototype */
- {
- _initialize: function _initialize(value) {
- this._value = value;
- },
- value: function value() {
- return this._value;
- },
- /**
- * Returns a JSON version of the operation suitable for sending to AV.
- * @return {Object}
- */
- toJSON: function toJSON() {
- return {
- __op: 'BitAnd',
- value: this.value()
- };
- },
- _mergeWithPrevious: function _mergeWithPrevious(previous) {
- if (!previous) {
- return this;
- } else if (previous instanceof AV.Op.Unset) {
- return new AV.Op.Set(0);
- } else if (previous instanceof AV.Op.Set) {
- return new AV.Op.Set(previous.value() & this.value());
- } else {
- throw new Error('Op is invalid after previous op.');
- }
- },
- _estimate: function _estimate(oldValue) {
- return oldValue & this.value();
- }
- });
- AV.Op._registerDecoder('BitAnd', function (json) {
- return new AV.Op.BitAnd(json.value);
- });
- /**
- * @private
- * @class
- * BitOr is an atomic operation where the given value will be bit and to the
- * value than is stored in this field.
- */
- AV.Op.BitOr = AV.Op._extend(
- /** @lends AV.Op.BitOr.prototype */
- {
- _initialize: function _initialize(value) {
- this._value = value;
- },
- value: function value() {
- return this._value;
- },
- /**
- * Returns a JSON version of the operation suitable for sending to AV.
- * @return {Object}
- */
- toJSON: function toJSON() {
- return {
- __op: 'BitOr',
- value: this.value()
- };
- },
- _mergeWithPrevious: function _mergeWithPrevious(previous) {
- if (!previous) {
- return this;
- } else if (previous instanceof AV.Op.Unset) {
- return new AV.Op.Set(this.value());
- } else if (previous instanceof AV.Op.Set) {
- return new AV.Op.Set(previous.value() | this.value());
- } else {
- throw new Error('Op is invalid after previous op.');
- }
- },
- _estimate: function _estimate(oldValue) {
- return oldValue | this.value();
- }
- });
- AV.Op._registerDecoder('BitOr', function (json) {
- return new AV.Op.BitOr(json.value);
- });
- /**
- * @private
- * @class
- * BitXor is an atomic operation where the given value will be bit and to the
- * value than is stored in this field.
- */
- AV.Op.BitXor = AV.Op._extend(
- /** @lends AV.Op.BitXor.prototype */
- {
- _initialize: function _initialize(value) {
- this._value = value;
- },
- value: function value() {
- return this._value;
- },
- /**
- * Returns a JSON version of the operation suitable for sending to AV.
- * @return {Object}
- */
- toJSON: function toJSON() {
- return {
- __op: 'BitXor',
- value: this.value()
- };
- },
- _mergeWithPrevious: function _mergeWithPrevious(previous) {
- if (!previous) {
- return this;
- } else if (previous instanceof AV.Op.Unset) {
- return new AV.Op.Set(this.value());
- } else if (previous instanceof AV.Op.Set) {
- return new AV.Op.Set(previous.value() ^ this.value());
- } else {
- throw new Error('Op is invalid after previous op.');
- }
- },
- _estimate: function _estimate(oldValue) {
- return oldValue ^ this.value();
- }
- });
- AV.Op._registerDecoder('BitXor', function (json) {
- return new AV.Op.BitXor(json.value);
- });
- /**
- * @private
- * @class
- * Add is an atomic operation where the given objects will be appended to the
- * array that is stored in this field.
- */
- AV.Op.Add = AV.Op._extend(
- /** @lends AV.Op.Add.prototype */
- {
- _initialize: function _initialize(objects) {
- this._objects = objects;
- },
- /**
- * Returns the objects to be added to the array.
- * @return {Array} The objects to be added to the array.
- */
- objects: function objects() {
- return this._objects;
- },
- /**
- * Returns a JSON version of the operation suitable for sending to AV.
- * @return {Object}
- */
- toJSON: function toJSON() {
- return {
- __op: 'Add',
- objects: AV._encode(this.objects())
- };
- },
- _mergeWithPrevious: function _mergeWithPrevious(previous) {
- if (!previous) {
- return this;
- } else if (previous instanceof AV.Op.Unset) {
- return new AV.Op.Set(this.objects());
- } else if (previous instanceof AV.Op.Set) {
- return new AV.Op.Set(this._estimate(previous.value()));
- } else if (previous instanceof AV.Op.Add) {
- var _context;
- return new AV.Op.Add((0, _concat.default)(_context = previous.objects()).call(_context, this.objects()));
- } else {
- throw new Error('Op is invalid after previous op.');
- }
- },
- _estimate: function _estimate(oldValue) {
- if (!oldValue) {
- return _.clone(this.objects());
- } else {
- return (0, _concat.default)(oldValue).call(oldValue, this.objects());
- }
- }
- });
- AV.Op._registerDecoder('Add', function (json) {
- return new AV.Op.Add(AV._decode(json.objects));
- });
- /**
- * @private
- * @class
- * AddUnique is an atomic operation where the given items will be appended to
- * the array that is stored in this field only if they were not already
- * present in the array.
- */
- AV.Op.AddUnique = AV.Op._extend(
- /** @lends AV.Op.AddUnique.prototype */
- {
- _initialize: function _initialize(objects) {
- this._objects = _.uniq(objects);
- },
- /**
- * Returns the objects to be added to the array.
- * @return {Array} The objects to be added to the array.
- */
- objects: function objects() {
- return this._objects;
- },
- /**
- * Returns a JSON version of the operation suitable for sending to AV.
- * @return {Object}
- */
- toJSON: function toJSON() {
- return {
- __op: 'AddUnique',
- objects: AV._encode(this.objects())
- };
- },
- _mergeWithPrevious: function _mergeWithPrevious(previous) {
- if (!previous) {
- return this;
- } else if (previous instanceof AV.Op.Unset) {
- return new AV.Op.Set(this.objects());
- } else if (previous instanceof AV.Op.Set) {
- return new AV.Op.Set(this._estimate(previous.value()));
- } else if (previous instanceof AV.Op.AddUnique) {
- return new AV.Op.AddUnique(this._estimate(previous.objects()));
- } else {
- throw new Error('Op is invalid after previous op.');
- }
- },
- _estimate: function _estimate(oldValue) {
- if (!oldValue) {
- return _.clone(this.objects());
- } else {
- // We can't just take the _.uniq(_.union(...)) of oldValue and
- // this.objects, because the uniqueness may not apply to oldValue
- // (especially if the oldValue was set via .set())
- var newValue = _.clone(oldValue);
- AV._arrayEach(this.objects(), function (obj) {
- if (obj instanceof AV.Object && obj.id) {
- var matchingObj = (0, _find.default)(_).call(_, newValue, function (anObj) {
- return anObj instanceof AV.Object && anObj.id === obj.id;
- });
- if (!matchingObj) {
- newValue.push(obj);
- } else {
- var index = (0, _indexOf.default)(_).call(_, newValue, matchingObj);
- newValue[index] = obj;
- }
- } else if (!_.contains(newValue, obj)) {
- newValue.push(obj);
- }
- });
- return newValue;
- }
- }
- });
- AV.Op._registerDecoder('AddUnique', function (json) {
- return new AV.Op.AddUnique(AV._decode(json.objects));
- });
- /**
- * @private
- * @class
- * Remove is an atomic operation where the given objects will be removed from
- * the array that is stored in this field.
- */
- AV.Op.Remove = AV.Op._extend(
- /** @lends AV.Op.Remove.prototype */
- {
- _initialize: function _initialize(objects) {
- this._objects = _.uniq(objects);
- },
- /**
- * Returns the objects to be removed from the array.
- * @return {Array} The objects to be removed from the array.
- */
- objects: function objects() {
- return this._objects;
- },
- /**
- * Returns a JSON version of the operation suitable for sending to AV.
- * @return {Object}
- */
- toJSON: function toJSON() {
- return {
- __op: 'Remove',
- objects: AV._encode(this.objects())
- };
- },
- _mergeWithPrevious: function _mergeWithPrevious(previous) {
- if (!previous) {
- return this;
- } else if (previous instanceof AV.Op.Unset) {
- return previous;
- } else if (previous instanceof AV.Op.Set) {
- return new AV.Op.Set(this._estimate(previous.value()));
- } else if (previous instanceof AV.Op.Remove) {
- return new AV.Op.Remove(_.union(previous.objects(), this.objects()));
- } else {
- throw new Error('Op is invalid after previous op.');
- }
- },
- _estimate: function _estimate(oldValue) {
- if (!oldValue) {
- return [];
- } else {
- var newValue = _.difference(oldValue, this.objects()); // If there are saved AV Objects being removed, also remove them.
- AV._arrayEach(this.objects(), function (obj) {
- if (obj instanceof AV.Object && obj.id) {
- newValue = _.reject(newValue, function (other) {
- return other instanceof AV.Object && other.id === obj.id;
- });
- }
- });
- return newValue;
- }
- }
- });
- AV.Op._registerDecoder('Remove', function (json) {
- return new AV.Op.Remove(AV._decode(json.objects));
- });
- /**
- * @private
- * @class
- * A Relation operation indicates that the field is an instance of
- * AV.Relation, and objects are being added to, or removed from, that
- * relation.
- */
- AV.Op.Relation = AV.Op._extend(
- /** @lends AV.Op.Relation.prototype */
- {
- _initialize: function _initialize(adds, removes) {
- this._targetClassName = null;
- var self = this;
- var pointerToId = function pointerToId(object) {
- if (object instanceof AV.Object) {
- if (!object.id) {
- throw new Error("You can't add an unsaved AV.Object to a relation.");
- }
- if (!self._targetClassName) {
- self._targetClassName = object.className;
- }
- if (self._targetClassName !== object.className) {
- throw new Error('Tried to create a AV.Relation with 2 different types: ' + self._targetClassName + ' and ' + object.className + '.');
- }
- return object.id;
- }
- return object;
- };
- this.relationsToAdd = _.uniq((0, _map.default)(_).call(_, adds, pointerToId));
- this.relationsToRemove = _.uniq((0, _map.default)(_).call(_, removes, pointerToId));
- },
- /**
- * Returns an array of unfetched AV.Object that are being added to the
- * relation.
- * @return {Array}
- */
- added: function added() {
- var self = this;
- return (0, _map.default)(_).call(_, this.relationsToAdd, function (objectId) {
- var object = AV.Object._create(self._targetClassName);
- object.id = objectId;
- return object;
- });
- },
- /**
- * Returns an array of unfetched AV.Object that are being removed from
- * the relation.
- * @return {Array}
- */
- removed: function removed() {
- var self = this;
- return (0, _map.default)(_).call(_, this.relationsToRemove, function (objectId) {
- var object = AV.Object._create(self._targetClassName);
- object.id = objectId;
- return object;
- });
- },
- /**
- * Returns a JSON version of the operation suitable for sending to AV.
- * @return {Object}
- */
- toJSON: function toJSON() {
- var adds = null;
- var removes = null;
- var self = this;
- var idToPointer = function idToPointer(id) {
- return {
- __type: 'Pointer',
- className: self._targetClassName,
- objectId: id
- };
- };
- var pointers = null;
- if (this.relationsToAdd.length > 0) {
- pointers = (0, _map.default)(_).call(_, this.relationsToAdd, idToPointer);
- adds = {
- __op: 'AddRelation',
- objects: pointers
- };
- }
- if (this.relationsToRemove.length > 0) {
- pointers = (0, _map.default)(_).call(_, this.relationsToRemove, idToPointer);
- removes = {
- __op: 'RemoveRelation',
- objects: pointers
- };
- }
- if (adds && removes) {
- return {
- __op: 'Batch',
- ops: [adds, removes]
- };
- }
- return adds || removes || {};
- },
- _mergeWithPrevious: function _mergeWithPrevious(previous) {
- if (!previous) {
- return this;
- } else if (previous instanceof AV.Op.Unset) {
- throw new Error("You can't modify a relation after deleting it.");
- } else if (previous instanceof AV.Op.Relation) {
- if (previous._targetClassName && previous._targetClassName !== this._targetClassName) {
- throw new Error('Related object must be of class ' + previous._targetClassName + ', but ' + this._targetClassName + ' was passed in.');
- }
- var newAdd = _.union(_.difference(previous.relationsToAdd, this.relationsToRemove), this.relationsToAdd);
- var newRemove = _.union(_.difference(previous.relationsToRemove, this.relationsToAdd), this.relationsToRemove);
- var newRelation = new AV.Op.Relation(newAdd, newRemove);
- newRelation._targetClassName = this._targetClassName;
- return newRelation;
- } else {
- throw new Error('Op is invalid after previous op.');
- }
- },
- _estimate: function _estimate(oldValue, object, key) {
- if (!oldValue) {
- var relation = new AV.Relation(object, key);
- relation.targetClassName = this._targetClassName;
- } else if (oldValue instanceof AV.Relation) {
- if (this._targetClassName) {
- if (oldValue.targetClassName) {
- if (oldValue.targetClassName !== this._targetClassName) {
- throw new Error('Related object must be a ' + oldValue.targetClassName + ', but a ' + this._targetClassName + ' was passed in.');
- }
- } else {
- oldValue.targetClassName = this._targetClassName;
- }
- }
- return oldValue;
- } else {
- throw new Error('Op is invalid after previous op.');
- }
- }
- });
- AV.Op._registerDecoder('AddRelation', function (json) {
- return new AV.Op.Relation(AV._decode(json.objects), []);
- });
- AV.Op._registerDecoder('RemoveRelation', function (json) {
- return new AV.Op.Relation([], AV._decode(json.objects));
- });
- };
- /***/ }),
- /* 447 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(448);
- module.exports = parent;
- /***/ }),
- /* 448 */
- /***/ (function(module, exports, __webpack_require__) {
- var isPrototypeOf = __webpack_require__(21);
- var method = __webpack_require__(449);
- var ArrayPrototype = Array.prototype;
- module.exports = function (it) {
- var own = it.find;
- return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.find) ? method : own;
- };
- /***/ }),
- /* 449 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(450);
- var entryVirtual = __webpack_require__(41);
- module.exports = entryVirtual('Array').find;
- /***/ }),
- /* 450 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__(0);
- var $find = __webpack_require__(66).find;
- var addToUnscopables = __webpack_require__(159);
- var FIND = 'find';
- var SKIPS_HOLES = true;
- // Shouldn't skip holes
- if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
- // `Array.prototype.find` method
- // https://tc39.es/ecma262/#sec-array.prototype.find
- $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
- find: function find(callbackfn /* , that = undefined */) {
- return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- }
- });
- // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
- addToUnscopables(FIND);
- /***/ }),
- /* 451 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _ = __webpack_require__(2);
- module.exports = function (AV) {
- /**
- * Creates a new Relation for the given parent object and key. This
- * constructor should rarely be used directly, but rather created by
- * {@link AV.Object#relation}.
- * @param {AV.Object} parent The parent of this relation.
- * @param {String} key The key for this relation on the parent.
- * @see AV.Object#relation
- * @class
- *
- * <p>
- * A class that is used to access all of the children of a many-to-many
- * relationship. Each instance of AV.Relation is associated with a
- * particular parent object and key.
- * </p>
- */
- AV.Relation = function (parent, key) {
- if (!_.isString(key)) {
- throw new TypeError('key must be a string');
- }
- this.parent = parent;
- this.key = key;
- this.targetClassName = null;
- };
- /**
- * Creates a query that can be used to query the parent objects in this relation.
- * @param {String} parentClass The parent class or name.
- * @param {String} relationKey The relation field key in parent.
- * @param {AV.Object} child The child object.
- * @return {AV.Query}
- */
- AV.Relation.reverseQuery = function (parentClass, relationKey, child) {
- var query = new AV.Query(parentClass);
- query.equalTo(relationKey, child._toPointer());
- return query;
- };
- _.extend(AV.Relation.prototype,
- /** @lends AV.Relation.prototype */
- {
- /**
- * Makes sure that this relation has the right parent and key.
- * @private
- */
- _ensureParentAndKey: function _ensureParentAndKey(parent, key) {
- this.parent = this.parent || parent;
- this.key = this.key || key;
- if (this.parent !== parent) {
- throw new Error('Internal Error. Relation retrieved from two different Objects.');
- }
- if (this.key !== key) {
- throw new Error('Internal Error. Relation retrieved from two different keys.');
- }
- },
- /**
- * Adds a AV.Object or an array of AV.Objects to the relation.
- * @param {AV.Object|AV.Object[]} objects The item or items to add.
- */
- add: function add(objects) {
- if (!_.isArray(objects)) {
- objects = [objects];
- }
- var change = new AV.Op.Relation(objects, []);
- this.parent.set(this.key, change);
- this.targetClassName = change._targetClassName;
- },
- /**
- * Removes a AV.Object or an array of AV.Objects from this relation.
- * @param {AV.Object|AV.Object[]} objects The item or items to remove.
- */
- remove: function remove(objects) {
- if (!_.isArray(objects)) {
- objects = [objects];
- }
- var change = new AV.Op.Relation([], objects);
- this.parent.set(this.key, change);
- this.targetClassName = change._targetClassName;
- },
- /**
- * Returns a JSON version of the object suitable for saving to disk.
- * @return {Object}
- */
- toJSON: function toJSON() {
- return {
- __type: 'Relation',
- className: this.targetClassName
- };
- },
- /**
- * Returns a AV.Query that is limited to objects in this
- * relation.
- * @return {AV.Query}
- */
- query: function query() {
- var targetClass;
- var query;
- if (!this.targetClassName) {
- targetClass = AV.Object._getSubclass(this.parent.className);
- query = new AV.Query(targetClass);
- query._defaultParams.redirectClassNameForKey = this.key;
- } else {
- targetClass = AV.Object._getSubclass(this.targetClassName);
- query = new AV.Query(targetClass);
- }
- query._addCondition('$relatedTo', 'object', this.parent._toPointer());
- query._addCondition('$relatedTo', 'key', this.key);
- return query;
- }
- });
- };
- /***/ }),
- /* 452 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _ = __webpack_require__(2);
- var cos = __webpack_require__(453);
- var qiniu = __webpack_require__(454);
- var s3 = __webpack_require__(501);
- var AVError = __webpack_require__(43);
- var _require = __webpack_require__(26),
- request = _require.request,
- AVRequest = _require._request;
- var _require2 = __webpack_require__(29),
- tap = _require2.tap,
- transformFetchOptions = _require2.transformFetchOptions;
- var debug = __webpack_require__(67)('leancloud:file');
- var parseBase64 = __webpack_require__(505);
- module.exports = function (AV) {
- // port from browserify path module
- // since react-native packager won't shim node modules.
- var extname = function extname(path) {
- if (!_.isString(path)) return '';
- return path.match(/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/)[4];
- };
- var b64Digit = function b64Digit(number) {
- if (number < 26) {
- return String.fromCharCode(65 + number);
- }
- if (number < 52) {
- return String.fromCharCode(97 + (number - 26));
- }
- if (number < 62) {
- return String.fromCharCode(48 + (number - 52));
- }
- if (number === 62) {
- return '+';
- }
- if (number === 63) {
- return '/';
- }
- throw new Error('Tried to encode large digit ' + number + ' in base64.');
- };
- var encodeBase64 = function encodeBase64(array) {
- var chunks = [];
- chunks.length = Math.ceil(array.length / 3);
- _.times(chunks.length, function (i) {
- var b1 = array[i * 3];
- var b2 = array[i * 3 + 1] || 0;
- var b3 = array[i * 3 + 2] || 0;
- var has2 = i * 3 + 1 < array.length;
- var has3 = i * 3 + 2 < array.length;
- 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('');
- });
- return chunks.join('');
- };
- /**
- * An AV.File is a local representation of a file that is saved to the AV
- * cloud.
- * @param name {String} The file's name. This will change to a unique value
- * once the file has finished saving.
- * @param data {Array} The data for the file, as either:
- * 1. an Array of byte value Numbers, or
- * 2. an Object like { base64: "..." } with a base64-encoded String.
- * 3. a Blob(File) selected with a file upload control in a browser.
- * 4. an Object like { blob: {uri: "..."} } that mimics Blob
- * in some non-browser environments such as React Native.
- * 5. a Buffer in Node.js runtime.
- * 6. a Stream in Node.js runtime.
- *
- * For example:<pre>
- * var fileUploadControl = $("#profilePhotoFileUpload")[0];
- * if (fileUploadControl.files.length > 0) {
- * var file = fileUploadControl.files[0];
- * var name = "photo.jpg";
- * var file = new AV.File(name, file);
- * file.save().then(function() {
- * // The file has been saved to AV.
- * }, function(error) {
- * // The file either could not be read, or could not be saved to AV.
- * });
- * }</pre>
- *
- * @class
- * @param [mimeType] {String} Content-Type header to use for the file. If
- * this is omitted, the content type will be inferred from the name's
- * extension.
- */
- AV.File = function (name, data, mimeType) {
- this.attributes = {
- name: name,
- url: '',
- metaData: {},
- // 用来存储转换后要上传的 base64 String
- base64: ''
- };
- if (_.isString(data)) {
- throw new TypeError('Creating an AV.File from a String is not yet supported.');
- }
- if (_.isArray(data)) {
- this.attributes.metaData.size = data.length;
- data = {
- base64: encodeBase64(data)
- };
- }
- this._extName = '';
- this._data = data;
- this._uploadHeaders = {};
- if (data && data.blob && typeof data.blob.uri === 'string') {
- this._extName = extname(data.blob.uri);
- }
- if (typeof Blob !== 'undefined' && data instanceof Blob) {
- if (data.size) {
- this.attributes.metaData.size = data.size;
- }
- if (data.name) {
- this._extName = extname(data.name);
- }
- }
- var owner;
- if (data && data.owner) {
- owner = data.owner;
- } else if (!AV._config.disableCurrentUser) {
- try {
- owner = AV.User.current();
- } catch (error) {
- if ('SYNC_API_NOT_AVAILABLE' !== error.code) {
- throw error;
- }
- }
- }
- this.attributes.metaData.owner = owner ? owner.id : 'unknown';
- this.set('mime_type', mimeType);
- };
- /**
- * Creates a fresh AV.File object with exists url for saving to AVOS Cloud.
- * @param {String} name the file name
- * @param {String} url the file url.
- * @param {Object} [metaData] the file metadata object.
- * @param {String} [type] Content-Type header to use for the file. If
- * this is omitted, the content type will be inferred from the name's
- * extension.
- * @return {AV.File} the file object
- */
- AV.File.withURL = function (name, url, metaData, type) {
- if (!name || !url) {
- throw new Error('Please provide file name and url');
- }
- var file = new AV.File(name, null, type); //copy metaData properties to file.
- if (metaData) {
- for (var prop in metaData) {
- if (!file.attributes.metaData[prop]) file.attributes.metaData[prop] = metaData[prop];
- }
- }
- file.attributes.url = url; //Mark the file is from external source.
- file.attributes.metaData.__source = 'external';
- file.attributes.metaData.size = 0;
- return file;
- };
- /**
- * Creates a file object with exists objectId.
- * @param {String} objectId The objectId string
- * @return {AV.File} the file object
- */
- AV.File.createWithoutData = function (objectId) {
- if (!objectId) {
- throw new TypeError('The objectId must be provided');
- }
- var file = new AV.File();
- file.id = objectId;
- return file;
- };
- /**
- * Request file censor.
- * @since 4.13.0
- * @param {String} objectId
- * @return {Promise.<string>}
- */
- AV.File.censor = function (objectId) {
- if (!AV._config.masterKey) {
- throw new Error('Cannot censor a file without masterKey');
- }
- return request({
- method: 'POST',
- path: "/files/".concat(objectId, "/censor"),
- authOptions: {
- useMasterKey: true
- }
- }).then(function (res) {
- return res.censorResult;
- });
- };
- _.extend(AV.File.prototype,
- /** @lends AV.File.prototype */
- {
- className: '_File',
- _toFullJSON: function _toFullJSON(seenObjects) {
- var _this = this;
- var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
- var json = _.clone(this.attributes);
- AV._objectEach(json, function (val, key) {
- json[key] = AV._encode(val, seenObjects, undefined, full);
- });
- AV._objectEach(this._operations, function (val, key) {
- json[key] = val;
- });
- if (_.has(this, 'id')) {
- json.objectId = this.id;
- }
- ['createdAt', 'updatedAt'].forEach(function (key) {
- if (_.has(_this, key)) {
- var val = _this[key];
- json[key] = _.isDate(val) ? val.toJSON() : val;
- }
- });
- if (full) {
- json.__type = 'File';
- }
- return json;
- },
- /**
- * Returns a JSON version of the file with meta data.
- * Inverse to {@link AV.parseJSON}
- * @since 3.0.0
- * @return {Object}
- */
- toFullJSON: function toFullJSON() {
- var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- return this._toFullJSON(seenObjects);
- },
- /**
- * Returns a JSON version of the object.
- * @return {Object}
- */
- toJSON: function toJSON(key, holder) {
- var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [this];
- return this._toFullJSON(seenObjects, false);
- },
- /**
- * Gets a Pointer referencing this file.
- * @private
- */
- _toPointer: function _toPointer() {
- return {
- __type: 'Pointer',
- className: this.className,
- objectId: this.id
- };
- },
- /**
- * Returns the ACL for this file.
- * @returns {AV.ACL} An instance of AV.ACL.
- */
- getACL: function getACL() {
- return this._acl;
- },
- /**
- * Sets the ACL to be used for this file.
- * @param {AV.ACL} acl An instance of AV.ACL.
- */
- setACL: function setACL(acl) {
- if (!(acl instanceof AV.ACL)) {
- return new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
- }
- this._acl = acl;
- return this;
- },
- /**
- * Gets the name of the file. Before save is called, this is the filename
- * given by the user. After save is called, that name gets prefixed with a
- * unique identifier.
- */
- name: function name() {
- return this.get('name');
- },
- /**
- * Gets the url of the file. It is only available after you save the file or
- * after you get the file from a AV.Object.
- * @return {String}
- */
- url: function url() {
- return this.get('url');
- },
- /**
- * Gets the attributs of the file object.
- * @param {String} The attribute name which want to get.
- * @returns {Any}
- */
- get: function get(attrName) {
- switch (attrName) {
- case 'objectId':
- return this.id;
- case 'url':
- case 'name':
- case 'mime_type':
- case 'metaData':
- case 'createdAt':
- case 'updatedAt':
- return this.attributes[attrName];
- default:
- return this.attributes.metaData[attrName];
- }
- },
- /**
- * Set the metaData of the file object.
- * @param {Object} Object is an key value Object for setting metaData.
- * @param {String} attr is an optional metadata key.
- * @param {Object} value is an optional metadata value.
- * @returns {String|Number|Array|Object}
- */
- set: function set() {
- var _this2 = this;
- var set = function set(attrName, value) {
- switch (attrName) {
- case 'name':
- case 'url':
- case 'mime_type':
- case 'base64':
- case 'metaData':
- _this2.attributes[attrName] = value;
- break;
- default:
- // File 并非一个 AVObject,不能完全自定义其他属性,所以只能都放在 metaData 上面
- _this2.attributes.metaData[attrName] = value;
- break;
- }
- };
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
- switch (args.length) {
- case 1:
- // 传入一个 Object
- for (var k in args[0]) {
- set(k, args[0][k]);
- }
- break;
- case 2:
- set(args[0], args[1]);
- break;
- }
- return this;
- },
- /**
- * Set a header for the upload request.
- * For more infomation, go to https://url.leanapp.cn/avfile-upload-headers
- *
- * @param {String} key header key
- * @param {String} value header value
- * @return {AV.File} this
- */
- setUploadHeader: function setUploadHeader(key, value) {
- this._uploadHeaders[key] = value;
- return this;
- },
- /**
- * <p>Returns the file's metadata JSON object if no arguments is given.Returns the
- * metadata value if a key is given.Set metadata value if key and value are both given.</p>
- * <p><pre>
- * var metadata = file.metaData(); //Get metadata JSON object.
- * var size = file.metaData('size'); // Get the size metadata value.
- * file.metaData('format', 'jpeg'); //set metadata attribute and value.
- *</pre></p>
- * @return {Object} The file's metadata JSON object.
- * @param {String} attr an optional metadata key.
- * @param {Object} value an optional metadata value.
- **/
- metaData: function metaData(attr, value) {
- if (attr && value) {
- this.attributes.metaData[attr] = value;
- return this;
- } else if (attr && !value) {
- return this.attributes.metaData[attr];
- } else {
- return this.attributes.metaData;
- }
- },
- /**
- * 如果文件是图片,获取图片的缩略图URL。可以传入宽度、高度、质量、格式等参数。
- * @return {String} 缩略图URL
- * @param {Number} width 宽度,单位:像素
- * @param {Number} heigth 高度,单位:像素
- * @param {Number} quality 质量,1-100的数字,默认100
- * @param {Number} scaleToFit 是否将图片自适应大小。默认为true。
- * @param {String} fmt 格式,默认为png,也可以为jpeg,gif等格式。
- */
- thumbnailURL: function thumbnailURL(width, height) {
- var quality = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
- var scaleToFit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
- var fmt = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'png';
- var url = this.attributes.url;
- if (!url) {
- throw new Error('Invalid url.');
- }
- if (!width || !height || width <= 0 || height <= 0) {
- throw new Error('Invalid width or height value.');
- }
- if (quality <= 0 || quality > 100) {
- throw new Error('Invalid quality value.');
- }
- var mode = scaleToFit ? 2 : 1;
- return url + '?imageView/' + mode + '/w/' + width + '/h/' + height + '/q/' + quality + '/format/' + fmt;
- },
- /**
- * Returns the file's size.
- * @return {Number} The file's size in bytes.
- **/
- size: function size() {
- return this.metaData().size;
- },
- /**
- * Returns the file's owner.
- * @return {String} The file's owner id.
- */
- ownerId: function ownerId() {
- return this.metaData().owner;
- },
- /**
- * Destroy the file.
- * @param {AuthOptions} options
- * @return {Promise} A promise that is fulfilled when the destroy
- * completes.
- */
- destroy: function destroy(options) {
- if (!this.id) {
- return _promise.default.reject(new Error('The file id does not eixst.'));
- }
- var request = AVRequest('files', null, this.id, 'DELETE', null, options);
- return request;
- },
- /**
- * Request Qiniu upload token
- * @param {string} type
- * @return {Promise} Resolved with the response
- * @private
- */
- _fileToken: function _fileToken(type, authOptions) {
- var name = this.attributes.name;
- var extName = extname(name);
- if (!extName && this._extName) {
- name += this._extName;
- extName = this._extName;
- }
- var data = {
- name: name,
- keep_file_name: authOptions.keepFileName,
- key: authOptions.key,
- ACL: this._acl,
- mime_type: type,
- metaData: this.attributes.metaData
- };
- return AVRequest('fileTokens', null, null, 'POST', data, authOptions);
- },
- /**
- * @callback UploadProgressCallback
- * @param {XMLHttpRequestProgressEvent} event - The progress event with 'loaded' and 'total' attributes
- */
- /**
- * Saves the file to the AV cloud.
- * @param {AuthOptions} [options] AuthOptions plus:
- * @param {UploadProgressCallback} [options.onprogress] 文件上传进度,在 Node.js 中无效,回调参数说明详见 {@link UploadProgressCallback}。
- * @param {boolean} [options.keepFileName = false] 保留下载文件的文件名。
- * @param {string} [options.key] 指定文件的 key。设置该选项需要使用 masterKey
- * @return {Promise} Promise that is resolved when the save finishes.
- */
- save: function save() {
- var _this3 = this;
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- if (this.id) {
- throw new Error('File is already saved.');
- }
- if (!this._previousSave) {
- if (this._data) {
- var mimeType = this.get('mime_type');
- this._previousSave = this._fileToken(mimeType, options).then(function (uploadInfo) {
- if (uploadInfo.mime_type) {
- mimeType = uploadInfo.mime_type;
- _this3.set('mime_type', mimeType);
- }
- _this3._token = uploadInfo.token;
- return _promise.default.resolve().then(function () {
- var data = _this3._data;
- if (data && data.base64) {
- return parseBase64(data.base64, mimeType);
- }
- if (data && data.blob) {
- if (!data.blob.type && mimeType) {
- data.blob.type = mimeType;
- }
- if (!data.blob.name) {
- data.blob.name = _this3.get('name');
- }
- return data.blob;
- }
- if (typeof Blob !== 'undefined' && data instanceof Blob) {
- return data;
- }
- throw new TypeError('malformed file data');
- }).then(function (data) {
- var _options = _.extend({}, options); // filter out download progress events
- if (options.onprogress) {
- _options.onprogress = function (event) {
- if (event.direction === 'download') return;
- return options.onprogress(event);
- };
- }
- switch (uploadInfo.provider) {
- case 's3':
- return s3(uploadInfo, data, _this3, _options);
- case 'qcloud':
- return cos(uploadInfo, data, _this3, _options);
- case 'qiniu':
- default:
- return qiniu(uploadInfo, data, _this3, _options);
- }
- }).then(tap(function () {
- return _this3._callback(true);
- }), function (error) {
- _this3._callback(false);
- throw error;
- });
- });
- } else if (this.attributes.url && this.attributes.metaData.__source === 'external') {
- // external link file.
- var data = {
- name: this.attributes.name,
- ACL: this._acl,
- metaData: this.attributes.metaData,
- mime_type: this.mimeType,
- url: this.attributes.url
- };
- this._previousSave = AVRequest('files', null, null, 'post', data, options).then(function (response) {
- _this3.id = response.objectId;
- return _this3;
- });
- }
- }
- return this._previousSave;
- },
- _callback: function _callback(success) {
- AVRequest('fileCallback', null, null, 'post', {
- token: this._token,
- result: success
- }).catch(debug);
- delete this._token;
- delete this._data;
- },
- /**
- * fetch the file from server. If the server's representation of the
- * model differs from its current attributes, they will be overriden,
- * @param {Object} fetchOptions Optional options to set 'keys',
- * 'include' and 'includeACL' option.
- * @param {AuthOptions} options
- * @return {Promise} A promise that is fulfilled when the fetch
- * completes.
- */
- fetch: function fetch(fetchOptions, options) {
- if (!this.id) {
- throw new Error('Cannot fetch unsaved file');
- }
- var request = AVRequest('files', null, this.id, 'GET', transformFetchOptions(fetchOptions), options);
- return request.then(this._finishFetch.bind(this));
- },
- _finishFetch: function _finishFetch(response) {
- var value = AV.Object.prototype.parse(response);
- value.attributes = {
- name: value.name,
- url: value.url,
- mime_type: value.mime_type,
- bucket: value.bucket
- };
- value.attributes.metaData = value.metaData || {};
- value.id = value.objectId; // clean
- delete value.objectId;
- delete value.metaData;
- delete value.url;
- delete value.name;
- delete value.mime_type;
- delete value.bucket;
- _.extend(this, value);
- return this;
- },
- /**
- * Request file censor
- * @since 4.13.0
- * @return {Promise.<string>}
- */
- censor: function censor() {
- if (!this.id) {
- throw new Error('Cannot censor an unsaved file');
- }
- return AV.File.censor(this.id);
- }
- });
- };
- /***/ }),
- /* 453 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _require = __webpack_require__(68),
- getAdapter = _require.getAdapter;
- var debug = __webpack_require__(67)('cos');
- module.exports = function (uploadInfo, data, file) {
- var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
- var url = uploadInfo.upload_url + '?sign=' + encodeURIComponent(uploadInfo.token);
- var fileFormData = {
- field: 'fileContent',
- data: data,
- name: file.attributes.name
- };
- var options = {
- headers: file._uploadHeaders,
- data: {
- op: 'upload'
- },
- onprogress: saveOptions.onprogress
- };
- debug('url: %s, file: %o, options: %o', url, fileFormData, options);
- var upload = getAdapter('upload');
- return upload(url, fileFormData, options).then(function (response) {
- debug(response.status, response.data);
- if (response.ok === false) {
- var error = new Error(response.status);
- error.response = response;
- throw error;
- }
- file.attributes.url = uploadInfo.url;
- file._bucket = uploadInfo.bucket;
- file.id = uploadInfo.objectId;
- return file;
- }, function (error) {
- var response = error.response;
- if (response) {
- debug(response.status, response.data);
- error.statusCode = response.status;
- error.response = response.data;
- }
- throw error;
- });
- };
- /***/ }),
- /* 454 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _sliceInstanceProperty2 = __webpack_require__(87);
- var _Array$from = __webpack_require__(455);
- var _Symbol = __webpack_require__(240);
- var _getIteratorMethod = __webpack_require__(241);
- var _Reflect$construct = __webpack_require__(465);
- var _interopRequireDefault = __webpack_require__(1);
- var _inherits2 = _interopRequireDefault(__webpack_require__(469));
- var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(491));
- var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(493));
- var _classCallCheck2 = _interopRequireDefault(__webpack_require__(498));
- var _createClass2 = _interopRequireDefault(__webpack_require__(499));
- var _stringify = _interopRequireDefault(__webpack_require__(36));
- var _concat = _interopRequireDefault(__webpack_require__(30));
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _slice = _interopRequireDefault(__webpack_require__(87));
- 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); }; }
- 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; } }
- 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; } } }; }
- 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); }
- 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; }
- var _require = __webpack_require__(68),
- getAdapter = _require.getAdapter;
- var debug = __webpack_require__(67)('leancloud:qiniu');
- var ajax = __webpack_require__(108);
- var btoa = __webpack_require__(500);
- var SHARD_THRESHOLD = 1024 * 1024 * 64;
- var CHUNK_SIZE = 1024 * 1024 * 16;
- function upload(uploadInfo, data, file) {
- var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
- // Get the uptoken to upload files to qiniu.
- var uptoken = uploadInfo.token;
- var url = uploadInfo.upload_url || 'https://upload.qiniup.com';
- var fileFormData = {
- field: 'file',
- data: data,
- name: file.attributes.name
- };
- var options = {
- headers: file._uploadHeaders,
- data: {
- name: file.attributes.name,
- key: uploadInfo.key,
- token: uptoken
- },
- onprogress: saveOptions.onprogress
- };
- debug('url: %s, file: %o, options: %o', url, fileFormData, options);
- var upload = getAdapter('upload');
- return upload(url, fileFormData, options).then(function (response) {
- debug(response.status, response.data);
- if (response.ok === false) {
- var message = response.status;
- if (response.data) {
- if (response.data.error) {
- message = response.data.error;
- } else {
- message = (0, _stringify.default)(response.data);
- }
- }
- var error = new Error(message);
- error.response = response;
- throw error;
- }
- file.attributes.url = uploadInfo.url;
- file._bucket = uploadInfo.bucket;
- file.id = uploadInfo.objectId;
- return file;
- }, function (error) {
- var response = error.response;
- if (response) {
- debug(response.status, response.data);
- error.statusCode = response.status;
- error.response = response.data;
- }
- throw error;
- });
- }
- function urlSafeBase64(string) {
- var base64 = btoa(unescape(encodeURIComponent(string)));
- var result = '';
- var _iterator = _createForOfIteratorHelper(base64),
- _step;
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var ch = _step.value;
- switch (ch) {
- case '+':
- result += '-';
- break;
- case '/':
- result += '_';
- break;
- default:
- result += ch;
- }
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
- return result;
- }
- var ShardUploader = /*#__PURE__*/function () {
- function ShardUploader(uploadInfo, data, file, saveOptions) {
- var _context,
- _context2,
- _this = this;
- (0, _classCallCheck2.default)(this, ShardUploader);
- this.uploadInfo = uploadInfo;
- this.data = data;
- this.file = file;
- this.size = undefined;
- this.offset = 0;
- this.uploadedChunks = 0;
- var key = urlSafeBase64(uploadInfo.key);
- var uploadURL = uploadInfo.upload_url || 'https://upload.qiniup.com';
- this.baseURL = (0, _concat.default)(_context = (0, _concat.default)(_context2 = "".concat(uploadURL, "/buckets/")).call(_context2, uploadInfo.bucket, "/objects/")).call(_context, key, "/uploads");
- this.upToken = 'UpToken ' + uploadInfo.token;
- this.uploaded = 0;
- if (saveOptions && saveOptions.onprogress) {
- this.onProgress = function (_ref) {
- var loaded = _ref.loaded;
- loaded += _this.uploadedChunks * CHUNK_SIZE;
- if (loaded <= _this.uploaded) {
- return;
- }
- if (_this.size) {
- saveOptions.onprogress({
- loaded: loaded,
- total: _this.size,
- percent: loaded / _this.size * 100
- });
- } else {
- saveOptions.onprogress({
- loaded: loaded
- });
- }
- _this.uploaded = loaded;
- };
- }
- }
- /**
- * @returns {Promise<string>}
- */
- (0, _createClass2.default)(ShardUploader, [{
- key: "getUploadId",
- value: function getUploadId() {
- return ajax({
- method: 'POST',
- url: this.baseURL,
- headers: {
- Authorization: this.upToken
- }
- }).then(function (res) {
- return res.uploadId;
- });
- }
- }, {
- key: "getChunk",
- value: function getChunk() {
- throw new Error('Not implemented');
- }
- /**
- * @param {string} uploadId
- * @param {number} partNumber
- * @param {any} data
- * @returns {Promise<{ partNumber: number, etag: string }>}
- */
- }, {
- key: "uploadPart",
- value: function uploadPart(uploadId, partNumber, data) {
- var _context3, _context4;
- return ajax({
- method: 'PUT',
- url: (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = "".concat(this.baseURL, "/")).call(_context4, uploadId, "/")).call(_context3, partNumber),
- headers: {
- Authorization: this.upToken
- },
- data: data,
- onprogress: this.onProgress
- }).then(function (_ref2) {
- var etag = _ref2.etag;
- return {
- partNumber: partNumber,
- etag: etag
- };
- });
- }
- }, {
- key: "stopUpload",
- value: function stopUpload(uploadId) {
- var _context5;
- return ajax({
- method: 'DELETE',
- url: (0, _concat.default)(_context5 = "".concat(this.baseURL, "/")).call(_context5, uploadId),
- headers: {
- Authorization: this.upToken
- }
- });
- }
- }, {
- key: "upload",
- value: function upload() {
- var _this2 = this;
- var parts = [];
- return this.getUploadId().then(function (uploadId) {
- var uploadPart = function uploadPart() {
- return _promise.default.resolve(_this2.getChunk()).then(function (chunk) {
- if (!chunk) {
- return;
- }
- var partNumber = parts.length + 1;
- return _this2.uploadPart(uploadId, partNumber, chunk).then(function (part) {
- parts.push(part);
- _this2.uploadedChunks++;
- return uploadPart();
- });
- }).catch(function (error) {
- return _this2.stopUpload(uploadId).then(function () {
- return _promise.default.reject(error);
- });
- });
- };
- return uploadPart().then(function () {
- var _context6;
- return ajax({
- method: 'POST',
- url: (0, _concat.default)(_context6 = "".concat(_this2.baseURL, "/")).call(_context6, uploadId),
- headers: {
- Authorization: _this2.upToken
- },
- data: {
- parts: parts,
- fname: _this2.file.attributes.name,
- mimeType: _this2.file.attributes.mime_type
- }
- });
- });
- }).then(function () {
- _this2.file.attributes.url = _this2.uploadInfo.url;
- _this2.file._bucket = _this2.uploadInfo.bucket;
- _this2.file.id = _this2.uploadInfo.objectId;
- return _this2.file;
- });
- }
- }]);
- return ShardUploader;
- }();
- var BlobUploader = /*#__PURE__*/function (_ShardUploader) {
- (0, _inherits2.default)(BlobUploader, _ShardUploader);
- var _super = _createSuper(BlobUploader);
- function BlobUploader(uploadInfo, data, file, saveOptions) {
- var _this3;
- (0, _classCallCheck2.default)(this, BlobUploader);
- _this3 = _super.call(this, uploadInfo, data, file, saveOptions);
- _this3.size = data.size;
- return _this3;
- }
- /**
- * @returns {Blob | null}
- */
- (0, _createClass2.default)(BlobUploader, [{
- key: "getChunk",
- value: function getChunk() {
- var _context7;
- if (this.offset >= this.size) {
- return null;
- }
- var chunk = (0, _slice.default)(_context7 = this.data).call(_context7, this.offset, this.offset + CHUNK_SIZE);
- this.offset += chunk.size;
- return chunk;
- }
- }]);
- return BlobUploader;
- }(ShardUploader);
- function isBlob(data) {
- return typeof Blob !== 'undefined' && data instanceof Blob;
- }
- module.exports = function (uploadInfo, data, file) {
- var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
- if (isBlob(data) && data.size >= SHARD_THRESHOLD) {
- return new BlobUploader(uploadInfo, data, file, saveOptions).upload();
- }
- return upload(uploadInfo, data, file, saveOptions);
- };
- /***/ }),
- /* 455 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(239);
- /***/ }),
- /* 456 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(78);
- __webpack_require__(457);
- var path = __webpack_require__(10);
- module.exports = path.Array.from;
- /***/ }),
- /* 457 */
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__(0);
- var from = __webpack_require__(458);
- var checkCorrectnessOfIteration = __webpack_require__(168);
- var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
- // eslint-disable-next-line es-x/no-array-from -- required for testing
- Array.from(iterable);
- });
- // `Array.from` method
- // https://tc39.es/ecma262/#sec-array.from
- $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
- from: from
- });
- /***/ }),
- /* 458 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var bind = __webpack_require__(45);
- var call = __webpack_require__(13);
- var toObject = __webpack_require__(34);
- var callWithSafeIterationClosing = __webpack_require__(459);
- var isArrayIteratorMethod = __webpack_require__(156);
- var isConstructor = __webpack_require__(101);
- var lengthOfArrayLike = __webpack_require__(46);
- var createProperty = __webpack_require__(106);
- var getIterator = __webpack_require__(157);
- var getIteratorMethod = __webpack_require__(99);
- var $Array = Array;
- // `Array.from` method implementation
- // https://tc39.es/ecma262/#sec-array.from
- module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
- var O = toObject(arrayLike);
- var IS_CONSTRUCTOR = isConstructor(this);
- var argumentsLength = arguments.length;
- var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
- var mapping = mapfn !== undefined;
- if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
- var iteratorMethod = getIteratorMethod(O);
- var index = 0;
- var length, result, step, iterator, next, value;
- // if the target is not iterable or it's an array with the default iterator - use a simple case
- if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
- iterator = getIterator(O, iteratorMethod);
- next = iterator.next;
- result = IS_CONSTRUCTOR ? new this() : [];
- for (;!(step = call(next, iterator)).done; index++) {
- value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
- createProperty(result, index, value);
- }
- } else {
- length = lengthOfArrayLike(O);
- result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
- for (;length > index; index++) {
- value = mapping ? mapfn(O[index], index) : O[index];
- createProperty(result, index, value);
- }
- }
- result.length = index;
- return result;
- };
- /***/ }),
- /* 459 */
- /***/ (function(module, exports, __webpack_require__) {
- var anObject = __webpack_require__(19);
- var iteratorClose = __webpack_require__(158);
- // call something on iterator step with safe closing on error
- module.exports = function (iterator, fn, value, ENTRIES) {
- try {
- return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
- } catch (error) {
- iteratorClose(iterator, 'throw', error);
- }
- };
- /***/ }),
- /* 460 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(461);
- /***/ }),
- /* 461 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(462);
- module.exports = parent;
- /***/ }),
- /* 462 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(463);
- module.exports = parent;
- /***/ }),
- /* 463 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(464);
- __webpack_require__(51);
- module.exports = parent;
- /***/ }),
- /* 464 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(48);
- __webpack_require__(78);
- var getIteratorMethod = __webpack_require__(99);
- module.exports = getIteratorMethod;
- /***/ }),
- /* 465 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(466);
- /***/ }),
- /* 466 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(467);
- module.exports = parent;
- /***/ }),
- /* 467 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(468);
- var path = __webpack_require__(10);
- module.exports = path.Reflect.construct;
- /***/ }),
- /* 468 */
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__(0);
- var getBuiltIn = __webpack_require__(18);
- var apply = __webpack_require__(69);
- var bind = __webpack_require__(242);
- var aConstructor = __webpack_require__(164);
- var anObject = __webpack_require__(19);
- var isObject = __webpack_require__(11);
- var create = __webpack_require__(47);
- var fails = __webpack_require__(3);
- var nativeConstruct = getBuiltIn('Reflect', 'construct');
- var ObjectPrototype = Object.prototype;
- var push = [].push;
- // `Reflect.construct` method
- // https://tc39.es/ecma262/#sec-reflect.construct
- // MS Edge supports only 2 arguments and argumentsList argument is optional
- // FF Nightly sets third argument as `new.target`, but does not create `this` from it
- var NEW_TARGET_BUG = fails(function () {
- function F() { /* empty */ }
- return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F);
- });
- var ARGS_BUG = !fails(function () {
- nativeConstruct(function () { /* empty */ });
- });
- var FORCED = NEW_TARGET_BUG || ARGS_BUG;
- $({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {
- construct: function construct(Target, args /* , newTarget */) {
- aConstructor(Target);
- anObject(args);
- var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
- if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
- if (Target == newTarget) {
- // w/o altered newTarget, optimization for 0-4 arguments
- switch (args.length) {
- case 0: return new Target();
- case 1: return new Target(args[0]);
- case 2: return new Target(args[0], args[1]);
- case 3: return new Target(args[0], args[1], args[2]);
- case 4: return new Target(args[0], args[1], args[2], args[3]);
- }
- // w/o altered newTarget, lot of arguments case
- var $args = [null];
- apply(push, $args, args);
- return new (apply(bind, Target, $args))();
- }
- // with altered newTarget, not support built-in constructors
- var proto = newTarget.prototype;
- var instance = create(isObject(proto) ? proto : ObjectPrototype);
- var result = apply(Target, instance, args);
- return isObject(result) ? result : instance;
- }
- });
- /***/ }),
- /* 469 */
- /***/ (function(module, exports, __webpack_require__) {
- var _Object$create = __webpack_require__(470);
- var _Object$defineProperty = __webpack_require__(145);
- var setPrototypeOf = __webpack_require__(480);
- function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function");
- }
- subClass.prototype = _Object$create(superClass && superClass.prototype, {
- constructor: {
- value: subClass,
- writable: true,
- configurable: true
- }
- });
- _Object$defineProperty(subClass, "prototype", {
- writable: false
- });
- if (superClass) setPrototypeOf(subClass, superClass);
- }
- module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 470 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(471);
- /***/ }),
- /* 471 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(472);
- /***/ }),
- /* 472 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(473);
- module.exports = parent;
- /***/ }),
- /* 473 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(474);
- module.exports = parent;
- /***/ }),
- /* 474 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(475);
- module.exports = parent;
- /***/ }),
- /* 475 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(476);
- var path = __webpack_require__(10);
- var Object = path.Object;
- module.exports = function create(P, D) {
- return Object.create(P, D);
- };
- /***/ }),
- /* 476 */
- /***/ (function(module, exports, __webpack_require__) {
- // TODO: Remove from `core-js@4`
- var $ = __webpack_require__(0);
- var DESCRIPTORS = __webpack_require__(16);
- var create = __webpack_require__(47);
- // `Object.create` method
- // https://tc39.es/ecma262/#sec-object.create
- $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
- create: create
- });
- /***/ }),
- /* 477 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(478);
- /***/ }),
- /* 478 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(479);
- module.exports = parent;
- /***/ }),
- /* 479 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(230);
- module.exports = parent;
- /***/ }),
- /* 480 */
- /***/ (function(module, exports, __webpack_require__) {
- var _Object$setPrototypeOf = __webpack_require__(243);
- var _bindInstanceProperty = __webpack_require__(244);
- function _setPrototypeOf(o, p) {
- var _context;
- module.exports = _setPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$setPrototypeOf).call(_context) : function _setPrototypeOf(o, p) {
- o.__proto__ = p;
- return o;
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
- return _setPrototypeOf(o, p);
- }
- module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 481 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(482);
- /***/ }),
- /* 482 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(483);
- module.exports = parent;
- /***/ }),
- /* 483 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(228);
- module.exports = parent;
- /***/ }),
- /* 484 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(485);
- /***/ }),
- /* 485 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(486);
- module.exports = parent;
- /***/ }),
- /* 486 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(487);
- module.exports = parent;
- /***/ }),
- /* 487 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(488);
- module.exports = parent;
- /***/ }),
- /* 488 */
- /***/ (function(module, exports, __webpack_require__) {
- var isPrototypeOf = __webpack_require__(21);
- var method = __webpack_require__(489);
- var FunctionPrototype = Function.prototype;
- module.exports = function (it) {
- var own = it.bind;
- return it === FunctionPrototype || (isPrototypeOf(FunctionPrototype, it) && own === FunctionPrototype.bind) ? method : own;
- };
- /***/ }),
- /* 489 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(490);
- var entryVirtual = __webpack_require__(41);
- module.exports = entryVirtual('Function').bind;
- /***/ }),
- /* 490 */
- /***/ (function(module, exports, __webpack_require__) {
- // TODO: Remove from `core-js@4`
- var $ = __webpack_require__(0);
- var bind = __webpack_require__(242);
- // `Function.prototype.bind` method
- // https://tc39.es/ecma262/#sec-function.prototype.bind
- $({ target: 'Function', proto: true, forced: Function.bind !== bind }, {
- bind: bind
- });
- /***/ }),
- /* 491 */
- /***/ (function(module, exports, __webpack_require__) {
- var _typeof = __webpack_require__(109)["default"];
- var assertThisInitialized = __webpack_require__(492);
- function _possibleConstructorReturn(self, call) {
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
- return call;
- } else if (call !== void 0) {
- throw new TypeError("Derived constructors may only return object or undefined");
- }
- return assertThisInitialized(self);
- }
- module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 492 */
- /***/ (function(module, exports) {
- function _assertThisInitialized(self) {
- if (self === void 0) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
- return self;
- }
- module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 493 */
- /***/ (function(module, exports, __webpack_require__) {
- var _Object$setPrototypeOf = __webpack_require__(243);
- var _bindInstanceProperty = __webpack_require__(244);
- var _Object$getPrototypeOf = __webpack_require__(494);
- function _getPrototypeOf(o) {
- var _context;
- module.exports = _getPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$getPrototypeOf).call(_context) : function _getPrototypeOf(o) {
- return o.__proto__ || _Object$getPrototypeOf(o);
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
- return _getPrototypeOf(o);
- }
- module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 494 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(495);
- /***/ }),
- /* 495 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(496);
- /***/ }),
- /* 496 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(497);
- module.exports = parent;
- /***/ }),
- /* 497 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(222);
- module.exports = parent;
- /***/ }),
- /* 498 */
- /***/ (function(module, exports) {
- function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 499 */
- /***/ (function(module, exports, __webpack_require__) {
- var _Object$defineProperty = __webpack_require__(145);
- function _defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor) descriptor.writable = true;
- _Object$defineProperty(target, descriptor.key, descriptor);
- }
- }
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
- if (staticProps) _defineProperties(Constructor, staticProps);
- _Object$defineProperty(Constructor, "prototype", {
- writable: false
- });
- return Constructor;
- }
- module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 500 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _slice = _interopRequireDefault(__webpack_require__(87));
- // base64 character set, plus padding character (=)
- var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
- module.exports = function (string) {
- var result = '';
- for (var i = 0; i < string.length;) {
- var a = string.charCodeAt(i++);
- var b = string.charCodeAt(i++);
- var c = string.charCodeAt(i++);
- if (a > 255 || b > 255 || c > 255) {
- throw new TypeError('Failed to encode base64: The string to be encoded contains characters outside of the Latin1 range.');
- }
- var bitmap = a << 16 | b << 8 | c;
- result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) + b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
- } // To determine the final padding
- var rest = string.length % 3; // If there's need of padding, replace the last 'A's with equal signs
- return rest ? (0, _slice.default)(result).call(result, 0, rest - 3) + '==='.substring(rest) : result;
- };
- /***/ }),
- /* 501 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _ = __webpack_require__(2);
- var ajax = __webpack_require__(108);
- module.exports = function upload(uploadInfo, data, file) {
- var saveOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
- return ajax({
- url: uploadInfo.upload_url,
- method: 'PUT',
- data: data,
- headers: _.extend({
- 'Content-Type': file.get('mime_type'),
- 'Cache-Control': 'public, max-age=31536000'
- }, file._uploadHeaders),
- onprogress: saveOptions.onprogress
- }).then(function () {
- file.attributes.url = uploadInfo.url;
- file._bucket = uploadInfo.bucket;
- file.id = uploadInfo.objectId;
- return file;
- });
- };
- /***/ }),
- /* 502 */
- /***/ (function(module, exports, __webpack_require__) {
- (function(){
- var crypt = __webpack_require__(503),
- utf8 = __webpack_require__(245).utf8,
- isBuffer = __webpack_require__(504),
- bin = __webpack_require__(245).bin,
- // The core
- md5 = function (message, options) {
- // Convert to byte array
- if (message.constructor == String)
- if (options && options.encoding === 'binary')
- message = bin.stringToBytes(message);
- else
- message = utf8.stringToBytes(message);
- else if (isBuffer(message))
- message = Array.prototype.slice.call(message, 0);
- else if (!Array.isArray(message))
- message = message.toString();
- // else, assume byte array already
- var m = crypt.bytesToWords(message),
- l = message.length * 8,
- a = 1732584193,
- b = -271733879,
- c = -1732584194,
- d = 271733878;
- // Swap endian
- for (var i = 0; i < m.length; i++) {
- m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
- ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
- }
- // Padding
- m[l >>> 5] |= 0x80 << (l % 32);
- m[(((l + 64) >>> 9) << 4) + 14] = l;
- // Method shortcuts
- var FF = md5._ff,
- GG = md5._gg,
- HH = md5._hh,
- II = md5._ii;
- for (var i = 0; i < m.length; i += 16) {
- var aa = a,
- bb = b,
- cc = c,
- dd = d;
- a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
- d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
- c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
- b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
- a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
- d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
- c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
- b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
- a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
- d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
- c = FF(c, d, a, b, m[i+10], 17, -42063);
- b = FF(b, c, d, a, m[i+11], 22, -1990404162);
- a = FF(a, b, c, d, m[i+12], 7, 1804603682);
- d = FF(d, a, b, c, m[i+13], 12, -40341101);
- c = FF(c, d, a, b, m[i+14], 17, -1502002290);
- b = FF(b, c, d, a, m[i+15], 22, 1236535329);
- a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
- d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
- c = GG(c, d, a, b, m[i+11], 14, 643717713);
- b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
- a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
- d = GG(d, a, b, c, m[i+10], 9, 38016083);
- c = GG(c, d, a, b, m[i+15], 14, -660478335);
- b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
- a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
- d = GG(d, a, b, c, m[i+14], 9, -1019803690);
- c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
- b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
- a = GG(a, b, c, d, m[i+13], 5, -1444681467);
- d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
- c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
- b = GG(b, c, d, a, m[i+12], 20, -1926607734);
- a = HH(a, b, c, d, m[i+ 5], 4, -378558);
- d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
- c = HH(c, d, a, b, m[i+11], 16, 1839030562);
- b = HH(b, c, d, a, m[i+14], 23, -35309556);
- a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
- d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
- c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
- b = HH(b, c, d, a, m[i+10], 23, -1094730640);
- a = HH(a, b, c, d, m[i+13], 4, 681279174);
- d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
- c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
- b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
- a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
- d = HH(d, a, b, c, m[i+12], 11, -421815835);
- c = HH(c, d, a, b, m[i+15], 16, 530742520);
- b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
- a = II(a, b, c, d, m[i+ 0], 6, -198630844);
- d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
- c = II(c, d, a, b, m[i+14], 15, -1416354905);
- b = II(b, c, d, a, m[i+ 5], 21, -57434055);
- a = II(a, b, c, d, m[i+12], 6, 1700485571);
- d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
- c = II(c, d, a, b, m[i+10], 15, -1051523);
- b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
- a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
- d = II(d, a, b, c, m[i+15], 10, -30611744);
- c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
- b = II(b, c, d, a, m[i+13], 21, 1309151649);
- a = II(a, b, c, d, m[i+ 4], 6, -145523070);
- d = II(d, a, b, c, m[i+11], 10, -1120210379);
- c = II(c, d, a, b, m[i+ 2], 15, 718787259);
- b = II(b, c, d, a, m[i+ 9], 21, -343485551);
- a = (a + aa) >>> 0;
- b = (b + bb) >>> 0;
- c = (c + cc) >>> 0;
- d = (d + dd) >>> 0;
- }
- return crypt.endian([a, b, c, d]);
- };
- // Auxiliary functions
- md5._ff = function (a, b, c, d, x, s, t) {
- var n = a + (b & c | ~b & d) + (x >>> 0) + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- };
- md5._gg = function (a, b, c, d, x, s, t) {
- var n = a + (b & d | c & ~d) + (x >>> 0) + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- };
- md5._hh = function (a, b, c, d, x, s, t) {
- var n = a + (b ^ c ^ d) + (x >>> 0) + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- };
- md5._ii = function (a, b, c, d, x, s, t) {
- var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- };
- // Package private blocksize
- md5._blocksize = 16;
- md5._digestsize = 16;
- module.exports = function (message, options) {
- if (message === undefined || message === null)
- throw new Error('Illegal argument ' + message);
- var digestbytes = crypt.wordsToBytes(md5(message, options));
- return options && options.asBytes ? digestbytes :
- options && options.asString ? bin.bytesToString(digestbytes) :
- crypt.bytesToHex(digestbytes);
- };
- })();
- /***/ }),
- /* 503 */
- /***/ (function(module, exports) {
- (function() {
- var base64map
- = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
- crypt = {
- // Bit-wise rotation left
- rotl: function(n, b) {
- return (n << b) | (n >>> (32 - b));
- },
- // Bit-wise rotation right
- rotr: function(n, b) {
- return (n << (32 - b)) | (n >>> b);
- },
- // Swap big-endian to little-endian and vice versa
- endian: function(n) {
- // If number given, swap endian
- if (n.constructor == Number) {
- return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
- }
- // Else, assume array and swap all items
- for (var i = 0; i < n.length; i++)
- n[i] = crypt.endian(n[i]);
- return n;
- },
- // Generate an array of any length of random bytes
- randomBytes: function(n) {
- for (var bytes = []; n > 0; n--)
- bytes.push(Math.floor(Math.random() * 256));
- return bytes;
- },
- // Convert a byte array to big-endian 32-bit words
- bytesToWords: function(bytes) {
- for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
- words[b >>> 5] |= bytes[i] << (24 - b % 32);
- return words;
- },
- // Convert big-endian 32-bit words to a byte array
- wordsToBytes: function(words) {
- for (var bytes = [], b = 0; b < words.length * 32; b += 8)
- bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
- return bytes;
- },
- // Convert a byte array to a hex string
- bytesToHex: function(bytes) {
- for (var hex = [], i = 0; i < bytes.length; i++) {
- hex.push((bytes[i] >>> 4).toString(16));
- hex.push((bytes[i] & 0xF).toString(16));
- }
- return hex.join('');
- },
- // Convert a hex string to a byte array
- hexToBytes: function(hex) {
- for (var bytes = [], c = 0; c < hex.length; c += 2)
- bytes.push(parseInt(hex.substr(c, 2), 16));
- return bytes;
- },
- // Convert a byte array to a base-64 string
- bytesToBase64: function(bytes) {
- for (var base64 = [], i = 0; i < bytes.length; i += 3) {
- var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
- for (var j = 0; j < 4; j++)
- if (i * 8 + j * 6 <= bytes.length * 8)
- base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
- else
- base64.push('=');
- }
- return base64.join('');
- },
- // Convert a base-64 string to a byte array
- base64ToBytes: function(base64) {
- // Remove non-base-64 characters
- base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
- for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
- imod4 = ++i % 4) {
- if (imod4 == 0) continue;
- bytes.push(((base64map.indexOf(base64.charAt(i - 1))
- & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
- | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
- }
- return bytes;
- }
- };
- module.exports = crypt;
- })();
- /***/ }),
- /* 504 */
- /***/ (function(module, exports) {
- /*!
- * Determine if an object is a Buffer
- *
- * @author Feross Aboukhadijeh <https://feross.org>
- * @license MIT
- */
- // The _isBuffer check is for Safari 5-7 support, because it's missing
- // Object.prototype.constructor. Remove this eventually
- module.exports = function (obj) {
- return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
- }
- function isBuffer (obj) {
- return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
- }
- // For Node v0.10 support. Remove this eventually.
- function isSlowBuffer (obj) {
- return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
- }
- /***/ }),
- /* 505 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _indexOf = _interopRequireDefault(__webpack_require__(86));
- var dataURItoBlob = function dataURItoBlob(dataURI, type) {
- var _context;
- var byteString; // 传入的 base64,不是 dataURL
- if ((0, _indexOf.default)(dataURI).call(dataURI, 'base64') < 0) {
- byteString = atob(dataURI);
- } else if ((0, _indexOf.default)(_context = dataURI.split(',')[0]).call(_context, 'base64') >= 0) {
- type = type || dataURI.split(',')[0].split(':')[1].split(';')[0];
- byteString = atob(dataURI.split(',')[1]);
- } else {
- byteString = unescape(dataURI.split(',')[1]);
- }
- var ia = new Uint8Array(byteString.length);
- for (var i = 0; i < byteString.length; i++) {
- ia[i] = byteString.charCodeAt(i);
- }
- return new Blob([ia], {
- type: type
- });
- };
- module.exports = dataURItoBlob;
- /***/ }),
- /* 506 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _slicedToArray2 = _interopRequireDefault(__webpack_require__(507));
- var _map = _interopRequireDefault(__webpack_require__(42));
- var _indexOf = _interopRequireDefault(__webpack_require__(86));
- var _find = _interopRequireDefault(__webpack_require__(110));
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _concat = _interopRequireDefault(__webpack_require__(30));
- var _keys2 = _interopRequireDefault(__webpack_require__(55));
- var _stringify = _interopRequireDefault(__webpack_require__(36));
- var _defineProperty = _interopRequireDefault(__webpack_require__(143));
- var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(246));
- var _ = __webpack_require__(2);
- var AVError = __webpack_require__(43);
- var _require = __webpack_require__(26),
- _request = _require._request;
- var _require2 = __webpack_require__(29),
- isNullOrUndefined = _require2.isNullOrUndefined,
- ensureArray = _require2.ensureArray,
- transformFetchOptions = _require2.transformFetchOptions,
- setValue = _require2.setValue,
- findValue = _require2.findValue,
- isPlainObject = _require2.isPlainObject,
- continueWhile = _require2.continueWhile;
- var recursiveToPointer = function recursiveToPointer(value) {
- if (_.isArray(value)) return (0, _map.default)(value).call(value, recursiveToPointer);
- if (isPlainObject(value)) return _.mapObject(value, recursiveToPointer);
- if (_.isObject(value) && value._toPointer) return value._toPointer();
- return value;
- };
- var RESERVED_KEYS = ['objectId', 'createdAt', 'updatedAt'];
- var checkReservedKey = function checkReservedKey(key) {
- if ((0, _indexOf.default)(RESERVED_KEYS).call(RESERVED_KEYS, key) !== -1) {
- throw new Error("key[".concat(key, "] is reserved"));
- }
- };
- var handleBatchResults = function handleBatchResults(results) {
- var firstError = (0, _find.default)(_).call(_, results, function (result) {
- return result instanceof Error;
- });
- if (!firstError) {
- return results;
- }
- var error = new AVError(firstError.code, firstError.message);
- error.results = results;
- throw error;
- }; // Helper function to get a value from a Backbone object as a property
- // or as a function.
- function getValue(object, prop) {
- if (!(object && object[prop])) {
- return null;
- }
- return _.isFunction(object[prop]) ? object[prop]() : object[prop];
- } // AV.Object is analogous to the Java AVObject.
- // It also implements the same interface as a Backbone model.
- module.exports = function (AV) {
- /**
- * Creates a new model with defined attributes. A client id (cid) is
- * automatically generated and assigned for you.
- *
- * <p>You won't normally call this method directly. It is recommended that
- * you use a subclass of <code>AV.Object</code> instead, created by calling
- * <code>extend</code>.</p>
- *
- * <p>However, if you don't want to use a subclass, or aren't sure which
- * subclass is appropriate, you can use this form:<pre>
- * var object = new AV.Object("ClassName");
- * </pre>
- * That is basically equivalent to:<pre>
- * var MyClass = AV.Object.extend("ClassName");
- * var object = new MyClass();
- * </pre></p>
- *
- * @param {Object} attributes The initial set of data to store in the object.
- * @param {Object} options A set of Backbone-like options for creating the
- * object. The only option currently supported is "collection".
- * @see AV.Object.extend
- *
- * @class
- *
- * <p>The fundamental unit of AV data, which implements the Backbone Model
- * interface.</p>
- */
- AV.Object = function (attributes, options) {
- // Allow new AV.Object("ClassName") as a shortcut to _create.
- if (_.isString(attributes)) {
- return AV.Object._create.apply(this, arguments);
- }
- attributes = attributes || {};
- if (options && options.parse) {
- attributes = this.parse(attributes);
- attributes = this._mergeMagicFields(attributes);
- }
- var defaults = getValue(this, 'defaults');
- if (defaults) {
- attributes = _.extend({}, defaults, attributes);
- }
- if (options && options.collection) {
- this.collection = options.collection;
- }
- this._serverData = {}; // The last known data for this object from cloud.
- this._opSetQueue = [{}]; // List of sets of changes to the data.
- this._flags = {};
- this.attributes = {}; // The best estimate of this's current data.
- this._hashedJSON = {}; // Hash of values of containers at last save.
- this._escapedAttributes = {};
- this.cid = _.uniqueId('c');
- this.changed = {};
- this._silent = {};
- this._pending = {};
- this.set(attributes, {
- silent: true
- });
- this.changed = {};
- this._silent = {};
- this._pending = {};
- this._hasData = true;
- this._previousAttributes = _.clone(this.attributes);
- this.initialize.apply(this, arguments);
- };
- /**
- * @lends AV.Object.prototype
- * @property {String} id The objectId of the AV Object.
- */
- /**
- * Saves the given list of AV.Object.
- * If any error is encountered, stops and calls the error handler.
- *
- * @example
- * AV.Object.saveAll([object1, object2, ...]).then(function(list) {
- * // All the objects were saved.
- * }, function(error) {
- * // An error occurred while saving one of the objects.
- * });
- *
- * @param {Array} list A list of <code>AV.Object</code>.
- */
- AV.Object.saveAll = function (list, options) {
- return AV.Object._deepSaveAsync(list, null, options);
- };
- /**
- * Fetch the given list of AV.Object.
- *
- * @param {AV.Object[]} objects A list of <code>AV.Object</code>
- * @param {AuthOptions} options
- * @return {Promise.<AV.Object[]>} The given list of <code>AV.Object</code>, updated
- */
- AV.Object.fetchAll = function (objects, options) {
- return _promise.default.resolve().then(function () {
- return _request('batch', null, null, 'POST', {
- requests: (0, _map.default)(_).call(_, objects, function (object) {
- var _context;
- if (!object.className) throw new Error('object must have className to fetch');
- if (!object.id) throw new Error('object must have id to fetch');
- if (object.dirty()) throw new Error('object is modified but not saved');
- return {
- method: 'GET',
- path: (0, _concat.default)(_context = "/1.1/classes/".concat(object.className, "/")).call(_context, object.id)
- };
- })
- }, options);
- }).then(function (response) {
- var results = (0, _map.default)(_).call(_, objects, function (object, i) {
- if (response[i].success) {
- var fetchedAttrs = object.parse(response[i].success);
- object._cleanupUnsetKeys(fetchedAttrs);
- object._finishFetch(fetchedAttrs);
- return object;
- }
- if (response[i].success === null) {
- return new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
- }
- return new AVError(response[i].error.code, response[i].error.error);
- });
- return handleBatchResults(results);
- });
- }; // Attach all inheritable methods to the AV.Object prototype.
- _.extend(AV.Object.prototype, AV.Events,
- /** @lends AV.Object.prototype */
- {
- _fetchWhenSave: false,
- /**
- * Initialize is an empty function by default. Override it with your own
- * initialization logic.
- */
- initialize: function initialize() {},
- /**
- * Set whether to enable fetchWhenSave option when updating object.
- * When set true, SDK would fetch the latest object after saving.
- * Default is false.
- *
- * @deprecated use AV.Object#save with options.fetchWhenSave instead
- * @param {boolean} enable true to enable fetchWhenSave option.
- */
- fetchWhenSave: function fetchWhenSave(enable) {
- console.warn('AV.Object#fetchWhenSave is deprecated, use AV.Object#save with options.fetchWhenSave instead.');
- if (!_.isBoolean(enable)) {
- throw new Error('Expect boolean value for fetchWhenSave');
- }
- this._fetchWhenSave = enable;
- },
- /**
- * Returns the object's objectId.
- * @return {String} the objectId.
- */
- getObjectId: function getObjectId() {
- return this.id;
- },
- /**
- * Returns the object's createdAt attribute.
- * @return {Date}
- */
- getCreatedAt: function getCreatedAt() {
- return this.createdAt;
- },
- /**
- * Returns the object's updatedAt attribute.
- * @return {Date}
- */
- getUpdatedAt: function getUpdatedAt() {
- return this.updatedAt;
- },
- /**
- * Returns a JSON version of the object.
- * @return {Object}
- */
- toJSON: function toJSON(key, holder) {
- var seenObjects = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
- return this._toFullJSON(seenObjects, false);
- },
- /**
- * Returns a JSON version of the object with meta data.
- * Inverse to {@link AV.parseJSON}
- * @since 3.0.0
- * @return {Object}
- */
- toFullJSON: function toFullJSON() {
- var seenObjects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- return this._toFullJSON(seenObjects);
- },
- _toFullJSON: function _toFullJSON(seenObjects) {
- var _this = this;
- var full = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
- var json = _.clone(this.attributes);
- if (_.isArray(seenObjects)) {
- var newSeenObjects = (0, _concat.default)(seenObjects).call(seenObjects, this);
- }
- AV._objectEach(json, function (val, key) {
- json[key] = AV._encode(val, newSeenObjects, undefined, full);
- });
- AV._objectEach(this._operations, function (val, key) {
- json[key] = val;
- });
- if (_.has(this, 'id')) {
- json.objectId = this.id;
- }
- ['createdAt', 'updatedAt'].forEach(function (key) {
- if (_.has(_this, key)) {
- var val = _this[key];
- json[key] = _.isDate(val) ? val.toJSON() : val;
- }
- });
- if (full) {
- json.__type = 'Object';
- if (_.isArray(seenObjects) && seenObjects.length) json.__type = 'Pointer';
- json.className = this.className;
- }
- return json;
- },
- /**
- * Updates _hashedJSON to reflect the current state of this object.
- * Adds any changed hash values to the set of pending changes.
- * @private
- */
- _refreshCache: function _refreshCache() {
- var self = this;
- if (self._refreshingCache) {
- return;
- }
- self._refreshingCache = true;
- AV._objectEach(this.attributes, function (value, key) {
- if (value instanceof AV.Object) {
- value._refreshCache();
- } else if (_.isObject(value)) {
- if (self._resetCacheForKey(key)) {
- self.set(key, new AV.Op.Set(value), {
- silent: true
- });
- }
- }
- });
- delete self._refreshingCache;
- },
- /**
- * Returns true if this object has been modified since its last
- * save/refresh. If an attribute is specified, it returns true only if that
- * particular attribute has been modified since the last save/refresh.
- * @param {String} attr An attribute name (optional).
- * @return {Boolean}
- */
- dirty: function dirty(attr) {
- this._refreshCache();
- var currentChanges = _.last(this._opSetQueue);
- if (attr) {
- return currentChanges[attr] ? true : false;
- }
- if (!this.id) {
- return true;
- }
- if ((0, _keys2.default)(_).call(_, currentChanges).length > 0) {
- return true;
- }
- return false;
- },
- /**
- * Returns the keys of the modified attribute since its last save/refresh.
- * @return {String[]}
- */
- dirtyKeys: function dirtyKeys() {
- this._refreshCache();
- var currentChanges = _.last(this._opSetQueue);
- return (0, _keys2.default)(_).call(_, currentChanges);
- },
- /**
- * Gets a Pointer referencing this Object.
- * @private
- */
- _toPointer: function _toPointer() {
- // if (!this.id) {
- // throw new Error("Can't serialize an unsaved AV.Object");
- // }
- return {
- __type: 'Pointer',
- className: this.className,
- objectId: this.id
- };
- },
- /**
- * Gets the value of an attribute.
- * @param {String} attr The string name of an attribute.
- */
- get: function get(attr) {
- switch (attr) {
- case 'objectId':
- return this.id;
- case 'createdAt':
- case 'updatedAt':
- return this[attr];
- default:
- return this.attributes[attr];
- }
- },
- /**
- * Gets a relation on the given class for the attribute.
- * @param {String} attr The attribute to get the relation for.
- * @return {AV.Relation}
- */
- relation: function relation(attr) {
- var value = this.get(attr);
- if (value) {
- if (!(value instanceof AV.Relation)) {
- throw new Error('Called relation() on non-relation field ' + attr);
- }
- value._ensureParentAndKey(this, attr);
- return value;
- } else {
- return new AV.Relation(this, attr);
- }
- },
- /**
- * Gets the HTML-escaped value of an attribute.
- */
- escape: function escape(attr) {
- var html = this._escapedAttributes[attr];
- if (html) {
- return html;
- }
- var val = this.attributes[attr];
- var escaped;
- if (isNullOrUndefined(val)) {
- escaped = '';
- } else {
- escaped = _.escape(val.toString());
- }
- this._escapedAttributes[attr] = escaped;
- return escaped;
- },
- /**
- * Returns <code>true</code> if the attribute contains a value that is not
- * null or undefined.
- * @param {String} attr The string name of the attribute.
- * @return {Boolean}
- */
- has: function has(attr) {
- return !isNullOrUndefined(this.attributes[attr]);
- },
- /**
- * Pulls "special" fields like objectId, createdAt, etc. out of attrs
- * and puts them on "this" directly. Removes them from attrs.
- * @param attrs - A dictionary with the data for this AV.Object.
- * @private
- */
- _mergeMagicFields: function _mergeMagicFields(attrs) {
- // Check for changes of magic fields.
- var model = this;
- var specialFields = ['objectId', 'createdAt', 'updatedAt'];
- AV._arrayEach(specialFields, function (attr) {
- if (attrs[attr]) {
- if (attr === 'objectId') {
- model.id = attrs[attr];
- } else if ((attr === 'createdAt' || attr === 'updatedAt') && !_.isDate(attrs[attr])) {
- model[attr] = AV._parseDate(attrs[attr]);
- } else {
- model[attr] = attrs[attr];
- }
- delete attrs[attr];
- }
- });
- return attrs;
- },
- /**
- * Returns the json to be sent to the server.
- * @private
- */
- _startSave: function _startSave() {
- this._opSetQueue.push({});
- },
- /**
- * Called when a save fails because of an error. Any changes that were part
- * of the save need to be merged with changes made after the save. This
- * might throw an exception is you do conflicting operations. For example,
- * if you do:
- * object.set("foo", "bar");
- * object.set("invalid field name", "baz");
- * object.save();
- * object.increment("foo");
- * then this will throw when the save fails and the client tries to merge
- * "bar" with the +1.
- * @private
- */
- _cancelSave: function _cancelSave() {
- var failedChanges = _.first(this._opSetQueue);
- this._opSetQueue = _.rest(this._opSetQueue);
- var nextChanges = _.first(this._opSetQueue);
- AV._objectEach(failedChanges, function (op, key) {
- var op1 = failedChanges[key];
- var op2 = nextChanges[key];
- if (op1 && op2) {
- nextChanges[key] = op2._mergeWithPrevious(op1);
- } else if (op1) {
- nextChanges[key] = op1;
- }
- });
- this._saving = this._saving - 1;
- },
- /**
- * Called when a save completes successfully. This merges the changes that
- * were saved into the known server data, and overrides it with any data
- * sent directly from the server.
- * @private
- */
- _finishSave: function _finishSave(serverData) {
- var _context2;
- // Grab a copy of any object referenced by this object. These instances
- // may have already been fetched, and we don't want to lose their data.
- // Note that doing it like this means we will unify separate copies of the
- // same object, but that's a risk we have to take.
- var fetchedObjects = {};
- AV._traverse(this.attributes, function (object) {
- if (object instanceof AV.Object && object.id && object._hasData) {
- fetchedObjects[object.id] = object;
- }
- });
- var savedChanges = _.first(this._opSetQueue);
- this._opSetQueue = _.rest(this._opSetQueue);
- this._applyOpSet(savedChanges, this._serverData);
- this._mergeMagicFields(serverData);
- var self = this;
- AV._objectEach(serverData, function (value, key) {
- self._serverData[key] = AV._decode(value, key); // Look for any objects that might have become unfetched and fix them
- // by replacing their values with the previously observed values.
- var fetched = AV._traverse(self._serverData[key], function (object) {
- if (object instanceof AV.Object && fetchedObjects[object.id]) {
- return fetchedObjects[object.id];
- }
- });
- if (fetched) {
- self._serverData[key] = fetched;
- }
- });
- this._rebuildAllEstimatedData();
- var opSetQueue = (0, _map.default)(_context2 = this._opSetQueue).call(_context2, _.clone);
- this._refreshCache();
- this._opSetQueue = opSetQueue;
- this._saving = this._saving - 1;
- },
- /**
- * Called when a fetch or login is complete to set the known server data to
- * the given object.
- * @private
- */
- _finishFetch: function _finishFetch(serverData, hasData) {
- // Clear out any changes the user might have made previously.
- this._opSetQueue = [{}]; // Bring in all the new server data.
- this._mergeMagicFields(serverData);
- var self = this;
- AV._objectEach(serverData, function (value, key) {
- self._serverData[key] = AV._decode(value, key);
- }); // Refresh the attributes.
- this._rebuildAllEstimatedData(); // Clear out the cache of mutable containers.
- this._refreshCache();
- this._opSetQueue = [{}];
- this._hasData = hasData;
- },
- /**
- * Applies the set of AV.Op in opSet to the object target.
- * @private
- */
- _applyOpSet: function _applyOpSet(opSet, target) {
- var self = this;
- AV._objectEach(opSet, function (change, key) {
- var _findValue = findValue(target, key),
- _findValue2 = (0, _slicedToArray2.default)(_findValue, 3),
- value = _findValue2[0],
- actualTarget = _findValue2[1],
- actualKey = _findValue2[2];
- setValue(target, key, change._estimate(value, self, key));
- if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
- delete actualTarget[actualKey];
- }
- });
- },
- /**
- * Replaces the cached value for key with the current value.
- * Returns true if the new value is different than the old value.
- * @private
- */
- _resetCacheForKey: function _resetCacheForKey(key) {
- var value = this.attributes[key];
- if (_.isObject(value) && !(value instanceof AV.Object) && !(value instanceof AV.File)) {
- var json = (0, _stringify.default)(recursiveToPointer(value));
- if (this._hashedJSON[key] !== json) {
- var wasSet = !!this._hashedJSON[key];
- this._hashedJSON[key] = json;
- return wasSet;
- }
- }
- return false;
- },
- /**
- * Populates attributes[key] by starting with the last known data from the
- * server, and applying all of the local changes that have been made to that
- * key since then.
- * @private
- */
- _rebuildEstimatedDataForKey: function _rebuildEstimatedDataForKey(key) {
- var self = this;
- delete this.attributes[key];
- if (this._serverData[key]) {
- this.attributes[key] = this._serverData[key];
- }
- AV._arrayEach(this._opSetQueue, function (opSet) {
- var op = opSet[key];
- if (op) {
- var _findValue3 = findValue(self.attributes, key),
- _findValue4 = (0, _slicedToArray2.default)(_findValue3, 4),
- value = _findValue4[0],
- actualTarget = _findValue4[1],
- actualKey = _findValue4[2],
- firstKey = _findValue4[3];
- setValue(self.attributes, key, op._estimate(value, self, key));
- if (actualTarget && actualTarget[actualKey] === AV.Op._UNSET) {
- delete actualTarget[actualKey];
- }
- self._resetCacheForKey(firstKey);
- }
- });
- },
- /**
- * Populates attributes by starting with the last known data from the
- * server, and applying all of the local changes that have been made since
- * then.
- * @private
- */
- _rebuildAllEstimatedData: function _rebuildAllEstimatedData() {
- var self = this;
- var previousAttributes = _.clone(this.attributes);
- this.attributes = _.clone(this._serverData);
- AV._arrayEach(this._opSetQueue, function (opSet) {
- self._applyOpSet(opSet, self.attributes);
- AV._objectEach(opSet, function (op, key) {
- self._resetCacheForKey(key);
- });
- }); // Trigger change events for anything that changed because of the fetch.
- AV._objectEach(previousAttributes, function (oldValue, key) {
- if (self.attributes[key] !== oldValue) {
- self.trigger('change:' + key, self, self.attributes[key], {});
- }
- });
- AV._objectEach(this.attributes, function (newValue, key) {
- if (!_.has(previousAttributes, key)) {
- self.trigger('change:' + key, self, newValue, {});
- }
- });
- },
- /**
- * Sets a hash of model attributes on the object, firing
- * <code>"change"</code> unless you choose to silence it.
- *
- * <p>You can call it with an object containing keys and values, or with one
- * key and value. For example:</p>
- *
- * @example
- * gameTurn.set({
- * player: player1,
- * diceRoll: 2
- * });
- *
- * game.set("currentPlayer", player2);
- *
- * game.set("finished", true);
- *
- * @param {String} key The key to set.
- * @param {Any} value The value to give it.
- * @param {Object} [options]
- * @param {Boolean} [options.silent]
- * @return {AV.Object} self if succeeded, throws if the value is not valid.
- * @see AV.Object#validate
- */
- set: function set(key, value, options) {
- var attrs;
- if (_.isObject(key) || isNullOrUndefined(key)) {
- attrs = _.mapObject(key, function (v, k) {
- checkReservedKey(k);
- return AV._decode(v, k);
- });
- options = value;
- } else {
- attrs = {};
- checkReservedKey(key);
- attrs[key] = AV._decode(value, key);
- } // Extract attributes and options.
- options = options || {};
- if (!attrs) {
- return this;
- }
- if (attrs instanceof AV.Object) {
- attrs = attrs.attributes;
- } // If the unset option is used, every attribute should be a Unset.
- if (options.unset) {
- AV._objectEach(attrs, function (unused_value, key) {
- attrs[key] = new AV.Op.Unset();
- });
- } // Apply all the attributes to get the estimated values.
- var dataToValidate = _.clone(attrs);
- var self = this;
- AV._objectEach(dataToValidate, function (value, key) {
- if (value instanceof AV.Op) {
- dataToValidate[key] = value._estimate(self.attributes[key], self, key);
- if (dataToValidate[key] === AV.Op._UNSET) {
- delete dataToValidate[key];
- }
- }
- }); // Run validation.
- this._validate(attrs, options);
- options.changes = {};
- var escaped = this._escapedAttributes; // Update attributes.
- AV._arrayEach((0, _keys2.default)(_).call(_, attrs), function (attr) {
- var val = attrs[attr]; // If this is a relation object we need to set the parent correctly,
- // since the location where it was parsed does not have access to
- // this object.
- if (val instanceof AV.Relation) {
- val.parent = self;
- }
- if (!(val instanceof AV.Op)) {
- val = new AV.Op.Set(val);
- } // See if this change will actually have any effect.
- var isRealChange = true;
- if (val instanceof AV.Op.Set && _.isEqual(self.attributes[attr], val.value)) {
- isRealChange = false;
- }
- if (isRealChange) {
- delete escaped[attr];
- if (options.silent) {
- self._silent[attr] = true;
- } else {
- options.changes[attr] = true;
- }
- }
- var currentChanges = _.last(self._opSetQueue);
- currentChanges[attr] = val._mergeWithPrevious(currentChanges[attr]);
- self._rebuildEstimatedDataForKey(attr);
- if (isRealChange) {
- self.changed[attr] = self.attributes[attr];
- if (!options.silent) {
- self._pending[attr] = true;
- }
- } else {
- delete self.changed[attr];
- delete self._pending[attr];
- }
- });
- if (!options.silent) {
- this.change(options);
- }
- return this;
- },
- /**
- * Remove an attribute from the model, firing <code>"change"</code> unless
- * you choose to silence it. This is a noop if the attribute doesn't
- * exist.
- * @param key {String} The key.
- */
- unset: function unset(attr, options) {
- options = options || {};
- options.unset = true;
- return this.set(attr, null, options);
- },
- /**
- * Atomically increments the value of the given attribute the next time the
- * object is saved. If no amount is specified, 1 is used by default.
- *
- * @param key {String} The key.
- * @param amount {Number} The amount to increment by.
- */
- increment: function increment(attr, amount) {
- if (_.isUndefined(amount) || _.isNull(amount)) {
- amount = 1;
- }
- return this.set(attr, new AV.Op.Increment(amount));
- },
- /**
- * Atomically add an object to the end of the array associated with a given
- * key.
- * @param key {String} The key.
- * @param item {} The item to add.
- */
- add: function add(attr, item) {
- return this.set(attr, new AV.Op.Add(ensureArray(item)));
- },
- /**
- * Atomically add an object to the array associated with a given key, only
- * if it is not already present in the array. The position of the insert is
- * not guaranteed.
- *
- * @param key {String} The key.
- * @param item {} The object to add.
- */
- addUnique: function addUnique(attr, item) {
- return this.set(attr, new AV.Op.AddUnique(ensureArray(item)));
- },
- /**
- * Atomically remove all instances of an object from the array associated
- * with a given key.
- *
- * @param key {String} The key.
- * @param item {} The object to remove.
- */
- remove: function remove(attr, item) {
- return this.set(attr, new AV.Op.Remove(ensureArray(item)));
- },
- /**
- * Atomically apply a "bit and" operation on the value associated with a
- * given key.
- *
- * @param key {String} The key.
- * @param value {Number} The value to apply.
- */
- bitAnd: function bitAnd(attr, value) {
- return this.set(attr, new AV.Op.BitAnd(value));
- },
- /**
- * Atomically apply a "bit or" operation on the value associated with a
- * given key.
- *
- * @param key {String} The key.
- * @param value {Number} The value to apply.
- */
- bitOr: function bitOr(attr, value) {
- return this.set(attr, new AV.Op.BitOr(value));
- },
- /**
- * Atomically apply a "bit xor" operation on the value associated with a
- * given key.
- *
- * @param key {String} The key.
- * @param value {Number} The value to apply.
- */
- bitXor: function bitXor(attr, value) {
- return this.set(attr, new AV.Op.BitXor(value));
- },
- /**
- * Returns an instance of a subclass of AV.Op describing what kind of
- * modification has been performed on this field since the last time it was
- * saved. For example, after calling object.increment("x"), calling
- * object.op("x") would return an instance of AV.Op.Increment.
- *
- * @param key {String} The key.
- * @returns {AV.Op} The operation, or undefined if none.
- */
- op: function op(attr) {
- return _.last(this._opSetQueue)[attr];
- },
- /**
- * Clear all attributes on the model, firing <code>"change"</code> unless
- * you choose to silence it.
- */
- clear: function clear(options) {
- options = options || {};
- options.unset = true;
- var keysToClear = _.extend(this.attributes, this._operations);
- return this.set(keysToClear, options);
- },
- /**
- * Clears any (or specific) changes to the model made since the last save.
- * @param {string|string[]} [keys] specify keys to revert.
- */
- revert: function revert(keys) {
- var lastOp = _.last(this._opSetQueue);
- var _keys = ensureArray(keys || (0, _keys2.default)(_).call(_, lastOp));
- _keys.forEach(function (key) {
- delete lastOp[key];
- });
- this._rebuildAllEstimatedData();
- return this;
- },
- /**
- * Returns a JSON-encoded set of operations to be sent with the next save
- * request.
- * @private
- */
- _getSaveJSON: function _getSaveJSON() {
- var json = _.clone(_.first(this._opSetQueue));
- AV._objectEach(json, function (op, key) {
- json[key] = op.toJSON();
- });
- return json;
- },
- /**
- * Returns true if this object can be serialized for saving.
- * @private
- */
- _canBeSerialized: function _canBeSerialized() {
- return AV.Object._canBeSerializedAsValue(this.attributes);
- },
- /**
- * Fetch the model from the server. If the server's representation of the
- * model differs from its current attributes, they will be overriden,
- * triggering a <code>"change"</code> event.
- * @param {Object} fetchOptions Optional options to set 'keys',
- * 'include' and 'includeACL' option.
- * @param {AuthOptions} options
- * @return {Promise} A promise that is fulfilled when the fetch
- * completes.
- */
- fetch: function fetch() {
- var fetchOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var options = arguments.length > 1 ? arguments[1] : undefined;
- if (!this.id) {
- throw new Error('Cannot fetch unsaved object');
- }
- var self = this;
- var request = _request('classes', this.className, this.id, 'GET', transformFetchOptions(fetchOptions), options);
- return request.then(function (response) {
- var fetchedAttrs = self.parse(response);
- self._cleanupUnsetKeys(fetchedAttrs, (0, _keys2.default)(fetchOptions) ? ensureArray((0, _keys2.default)(fetchOptions)).join(',').split(',') : undefined);
- self._finishFetch(fetchedAttrs, true);
- return self;
- });
- },
- _cleanupUnsetKeys: function _cleanupUnsetKeys(fetchedAttrs) {
- var _this2 = this;
- var fetchedKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _keys2.default)(_).call(_, this._serverData);
- _.forEach(fetchedKeys, function (key) {
- if (fetchedAttrs[key] === undefined) delete _this2._serverData[key];
- });
- },
- /**
- * Set a hash of model attributes, and save the model to the server.
- * updatedAt will be updated when the request returns.
- * You can either call it as:<pre>
- * object.save();</pre>
- * or<pre>
- * object.save(null, options);</pre>
- * or<pre>
- * object.save(attrs, options);</pre>
- * or<pre>
- * object.save(key, value, options);</pre>
- *
- * @example
- * gameTurn.save({
- * player: "Jake Cutter",
- * diceRoll: 2
- * }).then(function(gameTurnAgain) {
- * // The save was successful.
- * }, function(error) {
- * // The save failed. Error is an instance of AVError.
- * });
- *
- * @param {AuthOptions} options AuthOptions plus:
- * @param {Boolean} options.fetchWhenSave fetch and update object after save succeeded
- * @param {AV.Query} options.query Save object only when it matches the query
- * @return {Promise} A promise that is fulfilled when the save
- * completes.
- * @see AVError
- */
- save: function save(arg1, arg2, arg3) {
- var attrs, current, options;
- if (_.isObject(arg1) || isNullOrUndefined(arg1)) {
- attrs = arg1;
- options = arg2;
- } else {
- attrs = {};
- attrs[arg1] = arg2;
- options = arg3;
- }
- options = _.clone(options) || {};
- if (options.wait) {
- current = _.clone(this.attributes);
- }
- var setOptions = _.clone(options) || {};
- if (setOptions.wait) {
- setOptions.silent = true;
- }
- if (attrs) {
- this.set(attrs, setOptions);
- }
- var model = this;
- var unsavedChildren = [];
- var unsavedFiles = [];
- AV.Object._findUnsavedChildren(model, unsavedChildren, unsavedFiles);
- if (unsavedChildren.length + unsavedFiles.length > 1) {
- return AV.Object._deepSaveAsync(this, model, options);
- }
- this._startSave();
- this._saving = (this._saving || 0) + 1;
- this._allPreviousSaves = this._allPreviousSaves || _promise.default.resolve();
- this._allPreviousSaves = this._allPreviousSaves.catch(function (e) {}).then(function () {
- var method = model.id ? 'PUT' : 'POST';
- var json = model._getSaveJSON();
- var query = {};
- if (model._fetchWhenSave || options.fetchWhenSave) {
- query['new'] = 'true';
- } // user login option
- if (options._failOnNotExist) {
- query.failOnNotExist = 'true';
- }
- if (options.query) {
- var queryParams;
- if (typeof options.query._getParams === 'function') {
- queryParams = options.query._getParams();
- if (queryParams) {
- query.where = queryParams.where;
- }
- }
- if (!query.where) {
- var error = new Error('options.query is not an AV.Query');
- throw error;
- }
- }
- _.extend(json, model._flags);
- var route = 'classes';
- var className = model.className;
- if (model.className === '_User' && !model.id) {
- // Special-case user sign-up.
- route = 'users';
- className = null;
- } //hook makeRequest in options.
- var makeRequest = options._makeRequest || _request;
- var requestPromise = makeRequest(route, className, model.id, method, json, options, query);
- requestPromise = requestPromise.then(function (resp) {
- var serverAttrs = model.parse(resp);
- if (options.wait) {
- serverAttrs = _.extend(attrs || {}, serverAttrs);
- }
- model._finishSave(serverAttrs);
- if (options.wait) {
- model.set(current, setOptions);
- }
- return model;
- }, function (error) {
- model._cancelSave();
- throw error;
- });
- return requestPromise;
- });
- return this._allPreviousSaves;
- },
- /**
- * Destroy this model on the server if it was already persisted.
- * Optimistically removes the model from its collection, if it has one.
- * @param {AuthOptions} options AuthOptions plus:
- * @param {Boolean} [options.wait] wait for the server to respond
- * before removal.
- *
- * @return {Promise} A promise that is fulfilled when the destroy
- * completes.
- */
- destroy: function destroy(options) {
- options = options || {};
- var model = this;
- var triggerDestroy = function triggerDestroy() {
- model.trigger('destroy', model, model.collection, options);
- };
- if (!this.id) {
- return triggerDestroy();
- }
- if (!options.wait) {
- triggerDestroy();
- }
- var request = _request('classes', this.className, this.id, 'DELETE', this._flags, options);
- return request.then(function () {
- if (options.wait) {
- triggerDestroy();
- }
- return model;
- });
- },
- /**
- * Converts a response into the hash of attributes to be set on the model.
- * @ignore
- */
- parse: function parse(resp) {
- var output = _.clone(resp);
- ['createdAt', 'updatedAt'].forEach(function (key) {
- if (output[key]) {
- output[key] = AV._parseDate(output[key]);
- }
- });
- if (output.createdAt && !output.updatedAt) {
- output.updatedAt = output.createdAt;
- }
- return output;
- },
- /**
- * Creates a new model with identical attributes to this one.
- * @return {AV.Object}
- */
- clone: function clone() {
- return new this.constructor(this.attributes);
- },
- /**
- * Returns true if this object has never been saved to AV.
- * @return {Boolean}
- */
- isNew: function isNew() {
- return !this.id;
- },
- /**
- * Call this method to manually fire a `"change"` event for this model and
- * a `"change:attribute"` event for each changed attribute.
- * Calling this will cause all objects observing the model to update.
- */
- change: function change(options) {
- options = options || {};
- var changing = this._changing;
- this._changing = true; // Silent changes become pending changes.
- var self = this;
- AV._objectEach(this._silent, function (attr) {
- self._pending[attr] = true;
- }); // Silent changes are triggered.
- var changes = _.extend({}, options.changes, this._silent);
- this._silent = {};
- AV._objectEach(changes, function (unused_value, attr) {
- self.trigger('change:' + attr, self, self.get(attr), options);
- });
- if (changing) {
- return this;
- } // This is to get around lint not letting us make a function in a loop.
- var deleteChanged = function deleteChanged(value, attr) {
- if (!self._pending[attr] && !self._silent[attr]) {
- delete self.changed[attr];
- }
- }; // Continue firing `"change"` events while there are pending changes.
- while (!_.isEmpty(this._pending)) {
- this._pending = {};
- this.trigger('change', this, options); // Pending and silent changes still remain.
- AV._objectEach(this.changed, deleteChanged);
- self._previousAttributes = _.clone(this.attributes);
- }
- this._changing = false;
- return this;
- },
- /**
- * Gets the previous value of an attribute, recorded at the time the last
- * <code>"change"</code> event was fired.
- * @param {String} attr Name of the attribute to get.
- */
- previous: function previous(attr) {
- if (!arguments.length || !this._previousAttributes) {
- return null;
- }
- return this._previousAttributes[attr];
- },
- /**
- * Gets all of the attributes of the model at the time of the previous
- * <code>"change"</code> event.
- * @return {Object}
- */
- previousAttributes: function previousAttributes() {
- return _.clone(this._previousAttributes);
- },
- /**
- * Checks if the model is currently in a valid state. It's only possible to
- * get into an *invalid* state if you're using silent changes.
- * @return {Boolean}
- */
- isValid: function isValid() {
- try {
- this.validate(this.attributes);
- } catch (error) {
- return false;
- }
- return true;
- },
- /**
- * You should not call this function directly unless you subclass
- * <code>AV.Object</code>, in which case you can override this method
- * to provide additional validation on <code>set</code> and
- * <code>save</code>. Your implementation should throw an Error if
- * the attrs is invalid
- *
- * @param {Object} attrs The current data to validate.
- * @see AV.Object#set
- */
- validate: function validate(attrs) {
- if (_.has(attrs, 'ACL') && !(attrs.ACL instanceof AV.ACL)) {
- throw new AVError(AVError.OTHER_CAUSE, 'ACL must be a AV.ACL.');
- }
- },
- /**
- * Run validation against a set of incoming attributes, returning `true`
- * if all is well. If a specific `error` callback has been passed,
- * call that instead of firing the general `"error"` event.
- * @private
- */
- _validate: function _validate(attrs, options) {
- if (options.silent || !this.validate) {
- return;
- }
- attrs = _.extend({}, this.attributes, attrs);
- this.validate(attrs);
- },
- /**
- * Returns the ACL for this object.
- * @returns {AV.ACL} An instance of AV.ACL.
- * @see AV.Object#get
- */
- getACL: function getACL() {
- return this.get('ACL');
- },
- /**
- * Sets the ACL to be used for this object.
- * @param {AV.ACL} acl An instance of AV.ACL.
- * @param {Object} options Optional Backbone-like options object to be
- * passed in to set.
- * @return {AV.Object} self
- * @see AV.Object#set
- */
- setACL: function setACL(acl, options) {
- return this.set('ACL', acl, options);
- },
- disableBeforeHook: function disableBeforeHook() {
- this.ignoreHook('beforeSave');
- this.ignoreHook('beforeUpdate');
- this.ignoreHook('beforeDelete');
- },
- disableAfterHook: function disableAfterHook() {
- this.ignoreHook('afterSave');
- this.ignoreHook('afterUpdate');
- this.ignoreHook('afterDelete');
- },
- ignoreHook: function ignoreHook(hookName) {
- if (!_.contains(['beforeSave', 'afterSave', 'beforeUpdate', 'afterUpdate', 'beforeDelete', 'afterDelete'], hookName)) {
- throw new Error('Unsupported hookName: ' + hookName);
- }
- if (!AV.hookKey) {
- throw new Error('ignoreHook required hookKey');
- }
- if (!this._flags.__ignore_hooks) {
- this._flags.__ignore_hooks = [];
- }
- this._flags.__ignore_hooks.push(hookName);
- }
- });
- /**
- * Creates an instance of a subclass of AV.Object for the give classname
- * and id.
- * @param {String|Function} class the className or a subclass of AV.Object.
- * @param {String} id The object id of this model.
- * @return {AV.Object} A new subclass instance of AV.Object.
- */
- AV.Object.createWithoutData = function (klass, id, hasData) {
- var _klass;
- if (_.isString(klass)) {
- _klass = AV.Object._getSubclass(klass);
- } else if (klass.prototype && klass.prototype instanceof AV.Object) {
- _klass = klass;
- } else {
- throw new Error('class must be a string or a subclass of AV.Object.');
- }
- if (!id) {
- throw new TypeError('The objectId must be provided');
- }
- var object = new _klass();
- object.id = id;
- object._hasData = hasData;
- return object;
- };
- /**
- * Delete objects in batch.
- * @param {AV.Object[]} objects The <code>AV.Object</code> array to be deleted.
- * @param {AuthOptions} options
- * @return {Promise} A promise that is fulfilled when the save
- * completes.
- */
- AV.Object.destroyAll = function (objects) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- if (!objects || objects.length === 0) {
- return _promise.default.resolve();
- }
- var objectsByClassNameAndFlags = _.groupBy(objects, function (object) {
- return (0, _stringify.default)({
- className: object.className,
- flags: object._flags
- });
- });
- var body = {
- requests: (0, _map.default)(_).call(_, objectsByClassNameAndFlags, function (objects) {
- var _context3;
- var ids = (0, _map.default)(_).call(_, objects, 'id').join(',');
- return {
- method: 'DELETE',
- path: (0, _concat.default)(_context3 = "/1.1/classes/".concat(objects[0].className, "/")).call(_context3, ids),
- body: objects[0]._flags
- };
- })
- };
- return _request('batch', null, null, 'POST', body, options).then(function (response) {
- var firstError = (0, _find.default)(_).call(_, response, function (result) {
- return !result.success;
- });
- if (firstError) throw new AVError(firstError.error.code, firstError.error.error);
- return undefined;
- });
- };
- /**
- * Returns the appropriate subclass for making new instances of the given
- * className string.
- * @private
- */
- AV.Object._getSubclass = function (className) {
- if (!_.isString(className)) {
- throw new Error('AV.Object._getSubclass requires a string argument.');
- }
- var ObjectClass = AV.Object._classMap[className];
- if (!ObjectClass) {
- ObjectClass = AV.Object.extend(className);
- AV.Object._classMap[className] = ObjectClass;
- }
- return ObjectClass;
- };
- /**
- * Creates an instance of a subclass of AV.Object for the given classname.
- * @private
- */
- AV.Object._create = function (className, attributes, options) {
- var ObjectClass = AV.Object._getSubclass(className);
- return new ObjectClass(attributes, options);
- }; // Set up a map of className to class so that we can create new instances of
- // AV Objects from JSON automatically.
- AV.Object._classMap = {};
- AV.Object._extend = AV._extend;
- /**
- * Creates a new model with defined attributes,
- * It's the same with
- * <pre>
- * new AV.Object(attributes, options);
- * </pre>
- * @param {Object} attributes The initial set of data to store in the object.
- * @param {Object} options A set of Backbone-like options for creating the
- * object. The only option currently supported is "collection".
- * @return {AV.Object}
- * @since v0.4.4
- * @see AV.Object
- * @see AV.Object.extend
- */
- AV.Object['new'] = function (attributes, options) {
- return new AV.Object(attributes, options);
- };
- /**
- * Creates a new subclass of AV.Object for the given AV class name.
- *
- * <p>Every extension of a AV class will inherit from the most recent
- * previous extension of that class. When a AV.Object is automatically
- * created by parsing JSON, it will use the most recent extension of that
- * class.</p>
- *
- * @example
- * var MyClass = AV.Object.extend("MyClass", {
- * // Instance properties
- * }, {
- * // Class properties
- * });
- *
- * @param {String} className The name of the AV class backing this model.
- * @param {Object} protoProps Instance properties to add to instances of the
- * class returned from this method.
- * @param {Object} classProps Class properties to add the class returned from
- * this method.
- * @return {Class} A new subclass of AV.Object.
- */
- AV.Object.extend = function (className, protoProps, classProps) {
- // Handle the case with only two args.
- if (!_.isString(className)) {
- if (className && _.has(className, 'className')) {
- return AV.Object.extend(className.className, className, protoProps);
- } else {
- throw new Error("AV.Object.extend's first argument should be the className.");
- }
- } // If someone tries to subclass "User", coerce it to the right type.
- if (className === 'User') {
- className = '_User';
- }
- var NewClassObject = null;
- if (_.has(AV.Object._classMap, className)) {
- var OldClassObject = AV.Object._classMap[className]; // This new subclass has been told to extend both from "this" and from
- // OldClassObject. This is multiple inheritance, which isn't supported.
- // For now, let's just pick one.
- if (protoProps || classProps) {
- NewClassObject = OldClassObject._extend(protoProps, classProps);
- } else {
- return OldClassObject;
- }
- } else {
- protoProps = protoProps || {};
- protoProps._className = className;
- NewClassObject = this._extend(protoProps, classProps);
- } // Extending a subclass should reuse the classname automatically.
- NewClassObject.extend = function (arg0) {
- var _context4;
- if (_.isString(arg0) || arg0 && _.has(arg0, 'className')) {
- return AV.Object.extend.apply(NewClassObject, arguments);
- }
- var newArguments = (0, _concat.default)(_context4 = [className]).call(_context4, _.toArray(arguments));
- return AV.Object.extend.apply(NewClassObject, newArguments);
- }; // Add the query property descriptor.
- (0, _defineProperty.default)(NewClassObject, 'query', (0, _getOwnPropertyDescriptor.default)(AV.Object, 'query'));
- NewClassObject['new'] = function (attributes, options) {
- return new NewClassObject(attributes, options);
- };
- AV.Object._classMap[className] = NewClassObject;
- return NewClassObject;
- }; // ES6 class syntax support
- (0, _defineProperty.default)(AV.Object.prototype, 'className', {
- get: function get() {
- var className = this._className || this.constructor._LCClassName || this.constructor.name; // If someone tries to subclass "User", coerce it to the right type.
- if (className === 'User') {
- return '_User';
- }
- return className;
- }
- });
- /**
- * Register a class.
- * If a subclass of <code>AV.Object</code> is defined with your own implement
- * rather then <code>AV.Object.extend</code>, the subclass must be registered.
- * @param {Function} klass A subclass of <code>AV.Object</code>
- * @param {String} [name] Specify the name of the class. Useful when the class might be uglified.
- * @example
- * class Person extend AV.Object {}
- * AV.Object.register(Person);
- */
- AV.Object.register = function (klass, name) {
- if (!(klass.prototype instanceof AV.Object)) {
- throw new Error('registered class is not a subclass of AV.Object');
- }
- var className = name || klass.name;
- if (!className.length) {
- throw new Error('registered class must be named');
- }
- if (name) {
- klass._LCClassName = name;
- }
- AV.Object._classMap[className] = klass;
- };
- /**
- * Get a new Query of the current class
- * @name query
- * @memberof AV.Object
- * @type AV.Query
- * @readonly
- * @since v3.1.0
- * @example
- * const Post = AV.Object.extend('Post');
- * Post.query.equalTo('author', 'leancloud').find().then();
- */
- (0, _defineProperty.default)(AV.Object, 'query', {
- get: function get() {
- return new AV.Query(this.prototype.className);
- }
- });
- AV.Object._findUnsavedChildren = function (objects, children, files) {
- AV._traverse(objects, function (object) {
- if (object instanceof AV.Object) {
- if (object.dirty()) {
- children.push(object);
- }
- return;
- }
- if (object instanceof AV.File) {
- if (!object.id) {
- files.push(object);
- }
- return;
- }
- });
- };
- AV.Object._canBeSerializedAsValue = function (object) {
- var canBeSerializedAsValue = true;
- if (object instanceof AV.Object || object instanceof AV.File) {
- canBeSerializedAsValue = !!object.id;
- } else if (_.isArray(object)) {
- AV._arrayEach(object, function (child) {
- if (!AV.Object._canBeSerializedAsValue(child)) {
- canBeSerializedAsValue = false;
- }
- });
- } else if (_.isObject(object)) {
- AV._objectEach(object, function (child) {
- if (!AV.Object._canBeSerializedAsValue(child)) {
- canBeSerializedAsValue = false;
- }
- });
- }
- return canBeSerializedAsValue;
- };
- AV.Object._deepSaveAsync = function (object, model, options) {
- var unsavedChildren = [];
- var unsavedFiles = [];
- AV.Object._findUnsavedChildren(object, unsavedChildren, unsavedFiles);
- unsavedFiles = _.uniq(unsavedFiles);
- var promise = _promise.default.resolve();
- _.each(unsavedFiles, function (file) {
- promise = promise.then(function () {
- return file.save();
- });
- });
- var objects = _.uniq(unsavedChildren);
- var remaining = _.uniq(objects);
- return promise.then(function () {
- return continueWhile(function () {
- return remaining.length > 0;
- }, function () {
- // Gather up all the objects that can be saved in this batch.
- var batch = [];
- var newRemaining = [];
- AV._arrayEach(remaining, function (object) {
- if (object._canBeSerialized()) {
- batch.push(object);
- } else {
- newRemaining.push(object);
- }
- });
- remaining = newRemaining; // If we can't save any objects, there must be a circular reference.
- if (batch.length === 0) {
- return _promise.default.reject(new AVError(AVError.OTHER_CAUSE, 'Tried to save a batch with a cycle.'));
- } // Reserve a spot in every object's save queue.
- var readyToStart = _promise.default.resolve((0, _map.default)(_).call(_, batch, function (object) {
- return object._allPreviousSaves || _promise.default.resolve();
- })); // Save a single batch, whether previous saves succeeded or failed.
- var bathSavePromise = readyToStart.then(function () {
- return _request('batch', null, null, 'POST', {
- requests: (0, _map.default)(_).call(_, batch, function (object) {
- var method = object.id ? 'PUT' : 'POST';
- var json = object._getSaveJSON();
- _.extend(json, object._flags);
- var route = 'classes';
- var className = object.className;
- var path = "/".concat(route, "/").concat(className);
- if (object.className === '_User' && !object.id) {
- // Special-case user sign-up.
- path = '/users';
- }
- var path = "/1.1".concat(path);
- if (object.id) {
- path = path + '/' + object.id;
- }
- object._startSave();
- return {
- method: method,
- path: path,
- body: json,
- params: options && options.fetchWhenSave ? {
- fetchWhenSave: true
- } : undefined
- };
- })
- }, options).then(function (response) {
- var results = (0, _map.default)(_).call(_, batch, function (object, i) {
- if (response[i].success) {
- object._finishSave(object.parse(response[i].success));
- return object;
- }
- object._cancelSave();
- return new AVError(response[i].error.code, response[i].error.error);
- });
- return handleBatchResults(results);
- });
- });
- AV._arrayEach(batch, function (object) {
- object._allPreviousSaves = bathSavePromise;
- });
- return bathSavePromise;
- });
- }).then(function () {
- return object;
- });
- };
- };
- /***/ }),
- /* 507 */
- /***/ (function(module, exports, __webpack_require__) {
- var arrayWithHoles = __webpack_require__(508);
- var iterableToArrayLimit = __webpack_require__(516);
- var unsupportedIterableToArray = __webpack_require__(517);
- var nonIterableRest = __webpack_require__(527);
- function _slicedToArray(arr, i) {
- return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
- }
- module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 508 */
- /***/ (function(module, exports, __webpack_require__) {
- var _Array$isArray = __webpack_require__(509);
- function _arrayWithHoles(arr) {
- if (_Array$isArray(arr)) return arr;
- }
- module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 509 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(510);
- /***/ }),
- /* 510 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(511);
- /***/ }),
- /* 511 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(512);
- module.exports = parent;
- /***/ }),
- /* 512 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(513);
- module.exports = parent;
- /***/ }),
- /* 513 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(514);
- module.exports = parent;
- /***/ }),
- /* 514 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(515);
- var path = __webpack_require__(10);
- module.exports = path.Array.isArray;
- /***/ }),
- /* 515 */
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__(0);
- var isArray = __webpack_require__(85);
- // `Array.isArray` method
- // https://tc39.es/ecma262/#sec-array.isarray
- $({ target: 'Array', stat: true }, {
- isArray: isArray
- });
- /***/ }),
- /* 516 */
- /***/ (function(module, exports, __webpack_require__) {
- var _Symbol = __webpack_require__(231);
- var _getIteratorMethod = __webpack_require__(241);
- function _iterableToArrayLimit(arr, i) {
- var _i = arr == null ? null : typeof _Symbol !== "undefined" && _getIteratorMethod(arr) || arr["@@iterator"];
- if (_i == null) return;
- var _arr = [];
- var _n = true;
- var _d = false;
- var _s, _e;
- try {
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
- if (i && _arr.length === i) break;
- }
- } catch (err) {
- _d = true;
- _e = err;
- } finally {
- try {
- if (!_n && _i["return"] != null) _i["return"]();
- } finally {
- if (_d) throw _e;
- }
- }
- return _arr;
- }
- module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 517 */
- /***/ (function(module, exports, __webpack_require__) {
- var _sliceInstanceProperty = __webpack_require__(518);
- var _Array$from = __webpack_require__(522);
- var arrayLikeToArray = __webpack_require__(526);
- function _unsupportedIterableToArray(o, minLen) {
- var _context;
- if (!o) return;
- if (typeof o === "string") return arrayLikeToArray(o, minLen);
- var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 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);
- }
- module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 518 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(519);
- /***/ }),
- /* 519 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(520);
- /***/ }),
- /* 520 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(521);
- module.exports = parent;
- /***/ }),
- /* 521 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(229);
- module.exports = parent;
- /***/ }),
- /* 522 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(523);
- /***/ }),
- /* 523 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(524);
- /***/ }),
- /* 524 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(525);
- module.exports = parent;
- /***/ }),
- /* 525 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(239);
- module.exports = parent;
- /***/ }),
- /* 526 */
- /***/ (function(module, exports) {
- 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;
- }
- module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 527 */
- /***/ (function(module, exports) {
- function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
- }
- module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 528 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(529);
- module.exports = parent;
- /***/ }),
- /* 529 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(530);
- var path = __webpack_require__(10);
- var Object = path.Object;
- var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {
- return Object.getOwnPropertyDescriptor(it, key);
- };
- if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;
- /***/ }),
- /* 530 */
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__(0);
- var fails = __webpack_require__(3);
- var toIndexedObject = __webpack_require__(33);
- var nativeGetOwnPropertyDescriptor = __webpack_require__(71).f;
- var DESCRIPTORS = __webpack_require__(16);
- var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
- var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
- // `Object.getOwnPropertyDescriptor` method
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
- $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
- getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
- return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
- }
- });
- /***/ }),
- /* 531 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _ = __webpack_require__(2);
- var AVError = __webpack_require__(43);
- module.exports = function (AV) {
- AV.Role = AV.Object.extend('_Role',
- /** @lends AV.Role.prototype */
- {
- // Instance Methods
- /**
- * Represents a Role on the AV server. Roles represent groupings of
- * Users for the purposes of granting permissions (e.g. specifying an ACL
- * for an Object). Roles are specified by their sets of child users and
- * child roles, all of which are granted any permissions that the parent
- * role has.
- *
- * <p>Roles must have a name (which cannot be changed after creation of the
- * role), and must specify an ACL.</p>
- * An AV.Role is a local representation of a role persisted to the AV
- * cloud.
- * @class AV.Role
- * @param {String} name The name of the Role to create.
- * @param {AV.ACL} acl The ACL for this role.
- */
- constructor: function constructor(name, acl) {
- if (_.isString(name)) {
- AV.Object.prototype.constructor.call(this, null, null);
- this.setName(name);
- } else {
- AV.Object.prototype.constructor.call(this, name, acl);
- }
- if (acl) {
- if (!(acl instanceof AV.ACL)) {
- throw new TypeError('acl must be an instance of AV.ACL');
- } else {
- this.setACL(acl);
- }
- }
- },
- /**
- * Gets the name of the role. You can alternatively call role.get("name")
- *
- * @return {String} the name of the role.
- */
- getName: function getName() {
- return this.get('name');
- },
- /**
- * Sets the name for a role. This value must be set before the role has
- * been saved to the server, and cannot be set once the role has been
- * saved.
- *
- * <p>
- * A role's name can only contain alphanumeric characters, _, -, and
- * spaces.
- * </p>
- *
- * <p>This is equivalent to calling role.set("name", name)</p>
- *
- * @param {String} name The name of the role.
- */
- setName: function setName(name, options) {
- return this.set('name', name, options);
- },
- /**
- * Gets the AV.Relation for the AV.Users that are direct
- * children of this role. These users are granted any privileges that this
- * role has been granted (e.g. read or write access through ACLs). You can
- * add or remove users from the role through this relation.
- *
- * <p>This is equivalent to calling role.relation("users")</p>
- *
- * @return {AV.Relation} the relation for the users belonging to this
- * role.
- */
- getUsers: function getUsers() {
- return this.relation('users');
- },
- /**
- * Gets the AV.Relation for the AV.Roles that are direct
- * children of this role. These roles' users are granted any privileges that
- * this role has been granted (e.g. read or write access through ACLs). You
- * can add or remove child roles from this role through this relation.
- *
- * <p>This is equivalent to calling role.relation("roles")</p>
- *
- * @return {AV.Relation} the relation for the roles belonging to this
- * role.
- */
- getRoles: function getRoles() {
- return this.relation('roles');
- },
- /**
- * @ignore
- */
- validate: function validate(attrs, options) {
- if ('name' in attrs && attrs.name !== this.getName()) {
- var newName = attrs.name;
- if (this.id && this.id !== attrs.objectId) {
- // Check to see if the objectId being set matches this.id.
- // This happens during a fetch -- the id is set before calling fetch.
- // Let the name be set in this case.
- return new AVError(AVError.OTHER_CAUSE, "A role's name can only be set before it has been saved.");
- }
- if (!_.isString(newName)) {
- return new AVError(AVError.OTHER_CAUSE, "A role's name must be a String.");
- }
- if (!/^[0-9a-zA-Z\-_ ]+$/.test(newName)) {
- return new AVError(AVError.OTHER_CAUSE, "A role's name can only contain alphanumeric characters, _," + ' -, and spaces.');
- }
- }
- if (AV.Object.prototype.validate) {
- return AV.Object.prototype.validate.call(this, attrs, options);
- }
- return false;
- }
- });
- };
- /***/ }),
- /* 532 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _defineProperty2 = _interopRequireDefault(__webpack_require__(533));
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _map = _interopRequireDefault(__webpack_require__(42));
- var _find = _interopRequireDefault(__webpack_require__(110));
- var _stringify = _interopRequireDefault(__webpack_require__(36));
- var _ = __webpack_require__(2);
- var uuid = __webpack_require__(221);
- var AVError = __webpack_require__(43);
- var _require = __webpack_require__(26),
- AVRequest = _require._request,
- request = _require.request;
- var _require2 = __webpack_require__(68),
- getAdapter = _require2.getAdapter;
- var PLATFORM_ANONYMOUS = 'anonymous';
- var PLATFORM_QQAPP = 'lc_qqapp';
- var mergeUnionDataIntoAuthData = function mergeUnionDataIntoAuthData() {
- var defaultUnionIdPlatform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'weixin';
- return function (authData, unionId) {
- var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
- _ref$unionIdPlatform = _ref.unionIdPlatform,
- unionIdPlatform = _ref$unionIdPlatform === void 0 ? defaultUnionIdPlatform : _ref$unionIdPlatform,
- _ref$asMainAccount = _ref.asMainAccount,
- asMainAccount = _ref$asMainAccount === void 0 ? false : _ref$asMainAccount;
- if (typeof unionId !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionId is not a string');
- if (typeof unionIdPlatform !== 'string') throw new AVError(AVError.OTHER_CAUSE, 'unionIdPlatform is not a string');
- return _.extend({}, authData, {
- platform: unionIdPlatform,
- unionid: unionId,
- main_account: Boolean(asMainAccount)
- });
- };
- };
- module.exports = function (AV) {
- /**
- * @class
- *
- * <p>An AV.User object is a local representation of a user persisted to the
- * LeanCloud server. This class is a subclass of an AV.Object, and retains the
- * same functionality of an AV.Object, but also extends it with various
- * user specific methods, like authentication, signing up, and validation of
- * uniqueness.</p>
- */
- AV.User = AV.Object.extend('_User',
- /** @lends AV.User.prototype */
- {
- // Instance Variables
- _isCurrentUser: false,
- // Instance Methods
- /**
- * Internal method to handle special fields in a _User response.
- * @private
- */
- _mergeMagicFields: function _mergeMagicFields(attrs) {
- if (attrs.sessionToken) {
- this._sessionToken = attrs.sessionToken;
- delete attrs.sessionToken;
- }
- return AV.User.__super__._mergeMagicFields.call(this, attrs);
- },
- /**
- * Removes null values from authData (which exist temporarily for
- * unlinking)
- * @private
- */
- _cleanupAuthData: function _cleanupAuthData() {
- if (!this.isCurrent()) {
- return;
- }
- var authData = this.get('authData');
- if (!authData) {
- return;
- }
- AV._objectEach(this.get('authData'), function (value, key) {
- if (!authData[key]) {
- delete authData[key];
- }
- });
- },
- /**
- * Synchronizes authData for all providers.
- * @private
- */
- _synchronizeAllAuthData: function _synchronizeAllAuthData() {
- var authData = this.get('authData');
- if (!authData) {
- return;
- }
- var self = this;
- AV._objectEach(this.get('authData'), function (value, key) {
- self._synchronizeAuthData(key);
- });
- },
- /**
- * Synchronizes auth data for a provider (e.g. puts the access token in the
- * right place to be used by the Facebook SDK).
- * @private
- */
- _synchronizeAuthData: function _synchronizeAuthData(provider) {
- if (!this.isCurrent()) {
- return;
- }
- var authType;
- if (_.isString(provider)) {
- authType = provider;
- provider = AV.User._authProviders[authType];
- } else {
- authType = provider.getAuthType();
- }
- var authData = this.get('authData');
- if (!authData || !provider) {
- return;
- }
- var success = provider.restoreAuthentication(authData[authType]);
- if (!success) {
- this.dissociateAuthData(provider);
- }
- },
- _handleSaveResult: function _handleSaveResult(makeCurrent) {
- // Clean up and synchronize the authData object, removing any unset values
- if (makeCurrent && !AV._config.disableCurrentUser) {
- this._isCurrentUser = true;
- }
- this._cleanupAuthData();
- this._synchronizeAllAuthData(); // Don't keep the password around.
- delete this._serverData.password;
- this._rebuildEstimatedDataForKey('password');
- this._refreshCache();
- if ((makeCurrent || this.isCurrent()) && !AV._config.disableCurrentUser) {
- // Some old version of leanengine-node-sdk will overwrite
- // AV.User._saveCurrentUser which returns no Promise.
- // So we need a Promise wrapper.
- return _promise.default.resolve(AV.User._saveCurrentUser(this));
- } else {
- return _promise.default.resolve();
- }
- },
- /**
- * Unlike in the Android/iOS SDKs, logInWith is unnecessary, since you can
- * call linkWith on the user (even if it doesn't exist yet on the server).
- * @private
- */
- _linkWith: function _linkWith(provider, data) {
- var _this = this;
- var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
- _ref2$failOnNotExist = _ref2.failOnNotExist,
- failOnNotExist = _ref2$failOnNotExist === void 0 ? false : _ref2$failOnNotExist;
- var authType;
- if (_.isString(provider)) {
- authType = provider;
- provider = AV.User._authProviders[provider];
- } else {
- authType = provider.getAuthType();
- }
- if (data) {
- return this.save({
- authData: (0, _defineProperty2.default)({}, authType, data)
- }, {
- fetchWhenSave: !!this.get('authData'),
- _failOnNotExist: failOnNotExist
- }).then(function (model) {
- return model._handleSaveResult(true).then(function () {
- return model;
- });
- });
- } else {
- return provider.authenticate().then(function (result) {
- return _this._linkWith(provider, result);
- });
- }
- },
- /**
- * Associate the user with a third party authData.
- * @since 3.3.0
- * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
- * @param {string} platform Available platform for sign up.
- * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
- * @example user.associateWithAuthData({
- * openid: 'abc123',
- * access_token: '123abc',
- * expires_in: 1382686496
- * }, 'weixin').then(function(user) {
- * //Access user here
- * }).catch(function(error) {
- * //console.error("error: ", error);
- * });
- */
- associateWithAuthData: function associateWithAuthData(authData, platform) {
- return this._linkWith(platform, authData);
- },
- /**
- * Associate the user with a third party authData and unionId.
- * @since 3.5.0
- * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
- * @param {string} platform Available platform for sign up.
- * @param {string} unionId
- * @param {Object} [unionLoginOptions]
- * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
- * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
- * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
- * @example user.associateWithAuthDataAndUnionId({
- * openid: 'abc123',
- * access_token: '123abc',
- * expires_in: 1382686496
- * }, 'weixin', 'union123', {
- * unionIdPlatform: 'weixin',
- * asMainAccount: true,
- * }).then(function(user) {
- * //Access user here
- * }).catch(function(error) {
- * //console.error("error: ", error);
- * });
- */
- associateWithAuthDataAndUnionId: function associateWithAuthDataAndUnionId(authData, platform, unionId, unionOptions) {
- return this._linkWith(platform, mergeUnionDataIntoAuthData()(authData, unionId, unionOptions));
- },
- /**
- * Associate the user with the identity of the current mini-app.
- * @since 4.6.0
- * @param {Object} [authInfo]
- * @param {Object} [option]
- * @param {Boolean} [option.failOnNotExist] If true, the login request will fail when no user matches this authInfo.authData exists.
- * @return {Promise<AV.User>}
- */
- associateWithMiniApp: function associateWithMiniApp(authInfo, option) {
- var _this2 = this;
- if (authInfo === undefined) {
- var getAuthInfo = getAdapter('getAuthInfo');
- return getAuthInfo().then(function (authInfo) {
- return _this2._linkWith(authInfo.provider, authInfo.authData, option);
- });
- }
- return this._linkWith(authInfo.provider, authInfo.authData, option);
- },
- /**
- * 将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的微信帐号。
- * 仅在 QQ 小程序中可用。
- *
- * @deprecated Please use {@link AV.User#associateWithMiniApp}
- * @since 4.2.0
- * @param {Object} [options]
- * @param {boolean} [options.preferUnionId = false] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
- * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
- * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
- * @return {Promise<AV.User>}
- */
- associateWithQQApp: function associateWithQQApp() {
- var _this3 = this;
- var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- _ref3$preferUnionId = _ref3.preferUnionId,
- preferUnionId = _ref3$preferUnionId === void 0 ? false : _ref3$preferUnionId,
- _ref3$unionIdPlatform = _ref3.unionIdPlatform,
- unionIdPlatform = _ref3$unionIdPlatform === void 0 ? 'qq' : _ref3$unionIdPlatform,
- _ref3$asMainAccount = _ref3.asMainAccount,
- asMainAccount = _ref3$asMainAccount === void 0 ? true : _ref3$asMainAccount;
- var getAuthInfo = getAdapter('getAuthInfo');
- return getAuthInfo({
- preferUnionId: preferUnionId,
- asMainAccount: asMainAccount,
- platform: unionIdPlatform
- }).then(function (authInfo) {
- authInfo.provider = PLATFORM_QQAPP;
- return _this3.associateWithMiniApp(authInfo);
- });
- },
- /**
- * 将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
- * 仅在微信小程序中可用。
- *
- * @deprecated Please use {@link AV.User#associateWithMiniApp}
- * @since 3.13.0
- * @param {Object} [options]
- * @param {boolean} [options.preferUnionId = false] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否将 UnionId 保存在用户账号中。
- * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
- * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
- * @return {Promise<AV.User>}
- */
- associateWithWeapp: function associateWithWeapp() {
- var _this4 = this;
- var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- _ref4$preferUnionId = _ref4.preferUnionId,
- preferUnionId = _ref4$preferUnionId === void 0 ? false : _ref4$preferUnionId,
- _ref4$unionIdPlatform = _ref4.unionIdPlatform,
- unionIdPlatform = _ref4$unionIdPlatform === void 0 ? 'weixin' : _ref4$unionIdPlatform,
- _ref4$asMainAccount = _ref4.asMainAccount,
- asMainAccount = _ref4$asMainAccount === void 0 ? true : _ref4$asMainAccount;
- var getAuthInfo = getAdapter('getAuthInfo');
- return getAuthInfo({
- preferUnionId: preferUnionId,
- asMainAccount: asMainAccount,
- platform: unionIdPlatform
- }).then(function (authInfo) {
- return _this4.associateWithMiniApp(authInfo);
- });
- },
- /**
- * @deprecated renamed to {@link AV.User#associateWithWeapp}
- * @return {Promise<AV.User>}
- */
- linkWithWeapp: function linkWithWeapp(options) {
- console.warn('DEPRECATED: User#linkWithWeapp 已废弃,请使用 User#associateWithWeapp 代替');
- return this.associateWithWeapp(options);
- },
- /**
- * 将用户与 QQ 小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用 QQ 小程序的 QQ 帐号。
- * 仅在 QQ 小程序中可用。
- *
- * @deprecated Please use {@link AV.User#associateWithMiniApp}
- * @since 4.2.0
- * @param {string} unionId
- * @param {Object} [unionOptions]
- * @param {string} [unionOptions.unionIdPlatform = 'qq'] unionId platform
- * @param {boolean} [unionOptions.asMainAccount = false] If true, the unionId will be associated with the user.
- * @return {Promise<AV.User>}
- */
- associateWithQQAppWithUnionId: function associateWithQQAppWithUnionId(unionId) {
- var _this5 = this;
- var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- _ref5$unionIdPlatform = _ref5.unionIdPlatform,
- unionIdPlatform = _ref5$unionIdPlatform === void 0 ? 'qq' : _ref5$unionIdPlatform,
- _ref5$asMainAccount = _ref5.asMainAccount,
- asMainAccount = _ref5$asMainAccount === void 0 ? false : _ref5$asMainAccount;
- var getAuthInfo = getAdapter('getAuthInfo');
- return getAuthInfo({
- platform: unionIdPlatform
- }).then(function (authInfo) {
- authInfo = AV.User.mergeUnionId(authInfo, unionId, {
- asMainAccount: asMainAccount
- });
- authInfo.provider = PLATFORM_QQAPP;
- return _this5.associateWithMiniApp(authInfo);
- });
- },
- /**
- * 将用户与微信小程序用户进行关联。适用于为已经在用户系统中存在的用户关联当前使用微信小程序的微信帐号。
- * 仅在微信小程序中可用。
- *
- * @deprecated Please use {@link AV.User#associateWithMiniApp}
- * @since 3.13.0
- * @param {string} unionId
- * @param {Object} [unionOptions]
- * @param {string} [unionOptions.unionIdPlatform = 'weixin'] unionId platform
- * @param {boolean} [unionOptions.asMainAccount = false] If true, the unionId will be associated with the user.
- * @return {Promise<AV.User>}
- */
- associateWithWeappWithUnionId: function associateWithWeappWithUnionId(unionId) {
- var _this6 = this;
- var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- _ref6$unionIdPlatform = _ref6.unionIdPlatform,
- unionIdPlatform = _ref6$unionIdPlatform === void 0 ? 'weixin' : _ref6$unionIdPlatform,
- _ref6$asMainAccount = _ref6.asMainAccount,
- asMainAccount = _ref6$asMainAccount === void 0 ? false : _ref6$asMainAccount;
- var getAuthInfo = getAdapter('getAuthInfo');
- return getAuthInfo({
- platform: unionIdPlatform
- }).then(function (authInfo) {
- authInfo = AV.User.mergeUnionId(authInfo, unionId, {
- asMainAccount: asMainAccount
- });
- return _this6.associateWithMiniApp(authInfo);
- });
- },
- /**
- * Unlinks a user from a service.
- * @param {string} platform
- * @return {Promise<AV.User>}
- * @since 3.3.0
- */
- dissociateAuthData: function dissociateAuthData(provider) {
- this.unset("authData.".concat(provider));
- return this.save().then(function (model) {
- return model._handleSaveResult(true).then(function () {
- return model;
- });
- });
- },
- /**
- * @private
- * @deprecated
- */
- _unlinkFrom: function _unlinkFrom(provider) {
- console.warn('DEPRECATED: User#_unlinkFrom 已废弃,请使用 User#dissociateAuthData 代替');
- return this.dissociateAuthData(provider);
- },
- /**
- * Checks whether a user is linked to a service.
- * @private
- */
- _isLinked: function _isLinked(provider) {
- var authType;
- if (_.isString(provider)) {
- authType = provider;
- } else {
- authType = provider.getAuthType();
- }
- var authData = this.get('authData') || {};
- return !!authData[authType];
- },
- /**
- * Checks whether a user is anonymous.
- * @since 3.9.0
- * @return {boolean}
- */
- isAnonymous: function isAnonymous() {
- return this._isLinked(PLATFORM_ANONYMOUS);
- },
- logOut: function logOut() {
- this._logOutWithAll();
- this._isCurrentUser = false;
- },
- /**
- * Deauthenticates all providers.
- * @private
- */
- _logOutWithAll: function _logOutWithAll() {
- var authData = this.get('authData');
- if (!authData) {
- return;
- }
- var self = this;
- AV._objectEach(this.get('authData'), function (value, key) {
- self._logOutWith(key);
- });
- },
- /**
- * Deauthenticates a single provider (e.g. removing access tokens from the
- * Facebook SDK).
- * @private
- */
- _logOutWith: function _logOutWith(provider) {
- if (!this.isCurrent()) {
- return;
- }
- if (_.isString(provider)) {
- provider = AV.User._authProviders[provider];
- }
- if (provider && provider.deauthenticate) {
- provider.deauthenticate();
- }
- },
- /**
- * Signs up a new user. You should call this instead of save for
- * new AV.Users. This will create a new AV.User on the server, and
- * also persist the session on disk so that you can access the user using
- * <code>current</code>.
- *
- * <p>A username and password must be set before calling signUp.</p>
- *
- * @param {Object} attrs Extra fields to set on the new user, or null.
- * @param {AuthOptions} options
- * @return {Promise} A promise that is fulfilled when the signup
- * finishes.
- * @see AV.User.signUp
- */
- signUp: function signUp(attrs, options) {
- var error;
- var username = attrs && attrs.username || this.get('username');
- if (!username || username === '') {
- error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty name.');
- throw error;
- }
- var password = attrs && attrs.password || this.get('password');
- if (!password || password === '') {
- error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up user with an empty password.');
- throw error;
- }
- return this.save(attrs, options).then(function (model) {
- if (model.isAnonymous()) {
- model.unset("authData.".concat(PLATFORM_ANONYMOUS));
- model._opSetQueue = [{}];
- }
- return model._handleSaveResult(true).then(function () {
- return model;
- });
- });
- },
- /**
- * Signs up a new user with mobile phone and sms code.
- * You should call this instead of save for
- * new AV.Users. This will create a new AV.User on the server, and
- * also persist the session on disk so that you can access the user using
- * <code>current</code>.
- *
- * <p>A username and password must be set before calling signUp.</p>
- *
- * @param {Object} attrs Extra fields to set on the new user, or null.
- * @param {AuthOptions} options
- * @return {Promise} A promise that is fulfilled when the signup
- * finishes.
- * @see AV.User.signUpOrlogInWithMobilePhone
- * @see AV.Cloud.requestSmsCode
- */
- signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(attrs) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var error;
- var mobilePhoneNumber = attrs && attrs.mobilePhoneNumber || this.get('mobilePhoneNumber');
- if (!mobilePhoneNumber || mobilePhoneNumber === '') {
- error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty mobilePhoneNumber.');
- throw error;
- }
- var smsCode = attrs && attrs.smsCode || this.get('smsCode');
- if (!smsCode || smsCode === '') {
- error = new AVError(AVError.OTHER_CAUSE, 'Cannot sign up or login user by mobilePhoneNumber ' + 'with an empty smsCode.');
- throw error;
- }
- options._makeRequest = function (route, className, id, method, json) {
- return AVRequest('usersByMobilePhone', null, null, 'POST', json);
- };
- return this.save(attrs, options).then(function (model) {
- delete model.attributes.smsCode;
- delete model._serverData.smsCode;
- return model._handleSaveResult(true).then(function () {
- return model;
- });
- });
- },
- /**
- * The same with {@link AV.User.loginWithAuthData}, except that you can set attributes before login.
- * @since 3.7.0
- */
- loginWithAuthData: function loginWithAuthData(authData, platform, options) {
- return this._linkWith(platform, authData, options);
- },
- /**
- * The same with {@link AV.User.loginWithAuthDataAndUnionId}, except that you can set attributes before login.
- * @since 3.7.0
- */
- loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
- return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
- },
- /**
- * The same with {@link AV.User.loginWithWeapp}, except that you can set attributes before login.
- * @deprecated please use {@link AV.User#loginWithMiniApp}
- * @since 3.7.0
- * @param {Object} [options]
- * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
- * @param {boolean} [options.preferUnionId] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否使用 UnionId 登录。(since 3.13.0)
- * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
- * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
- * @return {Promise<AV.User>}
- */
- loginWithWeapp: function loginWithWeapp() {
- var _this7 = this;
- var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- _ref7$preferUnionId = _ref7.preferUnionId,
- preferUnionId = _ref7$preferUnionId === void 0 ? false : _ref7$preferUnionId,
- _ref7$unionIdPlatform = _ref7.unionIdPlatform,
- unionIdPlatform = _ref7$unionIdPlatform === void 0 ? 'weixin' : _ref7$unionIdPlatform,
- _ref7$asMainAccount = _ref7.asMainAccount,
- asMainAccount = _ref7$asMainAccount === void 0 ? true : _ref7$asMainAccount,
- _ref7$failOnNotExist = _ref7.failOnNotExist,
- failOnNotExist = _ref7$failOnNotExist === void 0 ? false : _ref7$failOnNotExist;
- var getAuthInfo = getAdapter('getAuthInfo');
- return getAuthInfo({
- preferUnionId: preferUnionId,
- asMainAccount: asMainAccount,
- platform: unionIdPlatform
- }).then(function (authInfo) {
- return _this7.loginWithMiniApp(authInfo, {
- failOnNotExist: failOnNotExist
- });
- });
- },
- /**
- * The same with {@link AV.User.loginWithWeappWithUnionId}, except that you can set attributes before login.
- * @deprecated please use {@link AV.User#loginWithMiniApp}
- * @since 3.13.0
- */
- loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
- var _this8 = this;
- var _ref8 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- _ref8$unionIdPlatform = _ref8.unionIdPlatform,
- unionIdPlatform = _ref8$unionIdPlatform === void 0 ? 'weixin' : _ref8$unionIdPlatform,
- _ref8$asMainAccount = _ref8.asMainAccount,
- asMainAccount = _ref8$asMainAccount === void 0 ? false : _ref8$asMainAccount,
- _ref8$failOnNotExist = _ref8.failOnNotExist,
- failOnNotExist = _ref8$failOnNotExist === void 0 ? false : _ref8$failOnNotExist;
- var getAuthInfo = getAdapter('getAuthInfo');
- return getAuthInfo({
- platform: unionIdPlatform
- }).then(function (authInfo) {
- authInfo = AV.User.mergeUnionId(authInfo, unionId, {
- asMainAccount: asMainAccount
- });
- return _this8.loginWithMiniApp(authInfo, {
- failOnNotExist: failOnNotExist
- });
- });
- },
- /**
- * The same with {@link AV.User.loginWithQQApp}, except that you can set attributes before login.
- * @deprecated please use {@link AV.User#loginWithMiniApp}
- * @since 4.2.0
- * @param {Object} [options]
- * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
- * @param {boolean} [options.preferUnionId] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
- * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
- * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
- */
- loginWithQQApp: function loginWithQQApp() {
- var _this9 = this;
- var _ref9 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- _ref9$preferUnionId = _ref9.preferUnionId,
- preferUnionId = _ref9$preferUnionId === void 0 ? false : _ref9$preferUnionId,
- _ref9$unionIdPlatform = _ref9.unionIdPlatform,
- unionIdPlatform = _ref9$unionIdPlatform === void 0 ? 'qq' : _ref9$unionIdPlatform,
- _ref9$asMainAccount = _ref9.asMainAccount,
- asMainAccount = _ref9$asMainAccount === void 0 ? true : _ref9$asMainAccount,
- _ref9$failOnNotExist = _ref9.failOnNotExist,
- failOnNotExist = _ref9$failOnNotExist === void 0 ? false : _ref9$failOnNotExist;
- var getAuthInfo = getAdapter('getAuthInfo');
- return getAuthInfo({
- preferUnionId: preferUnionId,
- asMainAccount: asMainAccount,
- platform: unionIdPlatform
- }).then(function (authInfo) {
- authInfo.provider = PLATFORM_QQAPP;
- return _this9.loginWithMiniApp(authInfo, {
- failOnNotExist: failOnNotExist
- });
- });
- },
- /**
- * The same with {@link AV.User.loginWithQQAppWithUnionId}, except that you can set attributes before login.
- * @deprecated please use {@link AV.User#loginWithMiniApp}
- * @since 4.2.0
- */
- loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
- var _this10 = this;
- var _ref10 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- _ref10$unionIdPlatfor = _ref10.unionIdPlatform,
- unionIdPlatform = _ref10$unionIdPlatfor === void 0 ? 'qq' : _ref10$unionIdPlatfor,
- _ref10$asMainAccount = _ref10.asMainAccount,
- asMainAccount = _ref10$asMainAccount === void 0 ? false : _ref10$asMainAccount,
- _ref10$failOnNotExist = _ref10.failOnNotExist,
- failOnNotExist = _ref10$failOnNotExist === void 0 ? false : _ref10$failOnNotExist;
- var getAuthInfo = getAdapter('getAuthInfo');
- return getAuthInfo({
- platform: unionIdPlatform
- }).then(function (authInfo) {
- authInfo = AV.User.mergeUnionId(authInfo, unionId, {
- asMainAccount: asMainAccount
- });
- authInfo.provider = PLATFORM_QQAPP;
- return _this10.loginWithMiniApp(authInfo, {
- failOnNotExist: failOnNotExist
- });
- });
- },
- /**
- * The same with {@link AV.User.loginWithMiniApp}, except that you can set attributes before login.
- * @since 4.6.0
- */
- loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
- var _this11 = this;
- if (authInfo === undefined) {
- var getAuthInfo = getAdapter('getAuthInfo');
- return getAuthInfo().then(function (authInfo) {
- return _this11.loginWithAuthData(authInfo.authData, authInfo.provider, option);
- });
- }
- return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
- },
- /**
- * Logs in a AV.User. On success, this saves the session to localStorage,
- * so you can retrieve the currently logged in user using
- * <code>current</code>.
- *
- * <p>A username and password must be set before calling logIn.</p>
- *
- * @see AV.User.logIn
- * @return {Promise} A promise that is fulfilled with the user when
- * the login is complete.
- */
- logIn: function logIn() {
- var model = this;
- var request = AVRequest('login', null, null, 'POST', this.toJSON());
- return request.then(function (resp) {
- var serverAttrs = model.parse(resp);
- model._finishFetch(serverAttrs);
- return model._handleSaveResult(true).then(function () {
- if (!serverAttrs.smsCode) delete model.attributes['smsCode'];
- return model;
- });
- });
- },
- /**
- * @see AV.Object#save
- */
- save: function save(arg1, arg2, arg3) {
- var attrs, options;
- if (_.isObject(arg1) || _.isNull(arg1) || _.isUndefined(arg1)) {
- attrs = arg1;
- options = arg2;
- } else {
- attrs = {};
- attrs[arg1] = arg2;
- options = arg3;
- }
- options = options || {};
- return AV.Object.prototype.save.call(this, attrs, options).then(function (model) {
- return model._handleSaveResult(false).then(function () {
- return model;
- });
- });
- },
- /**
- * Follow a user
- * @since 0.3.0
- * @param {Object | AV.User | String} options if an AV.User or string is given, it will be used as the target user.
- * @param {AV.User | String} options.user The target user or user's objectId to follow.
- * @param {Object} [options.attributes] key-value attributes dictionary to be used as
- * conditions of followerQuery/followeeQuery.
- * @param {AuthOptions} [authOptions]
- */
- follow: function follow(options, authOptions) {
- if (!this.id) {
- throw new Error('Please signin.');
- }
- var user;
- var attributes;
- if (options.user) {
- user = options.user;
- attributes = options.attributes;
- } else {
- user = options;
- }
- var userObjectId = _.isString(user) ? user : user.id;
- if (!userObjectId) {
- throw new Error('Invalid target user.');
- }
- var route = 'users/' + this.id + '/friendship/' + userObjectId;
- var request = AVRequest(route, null, null, 'POST', AV._encode(attributes), authOptions);
- return request;
- },
- /**
- * Unfollow a user.
- * @since 0.3.0
- * @param {Object | AV.User | String} options if an AV.User or string is given, it will be used as the target user.
- * @param {AV.User | String} options.user The target user or user's objectId to unfollow.
- * @param {AuthOptions} [authOptions]
- */
- unfollow: function unfollow(options, authOptions) {
- if (!this.id) {
- throw new Error('Please signin.');
- }
- var user;
- if (options.user) {
- user = options.user;
- } else {
- user = options;
- }
- var userObjectId = _.isString(user) ? user : user.id;
- if (!userObjectId) {
- throw new Error('Invalid target user.');
- }
- var route = 'users/' + this.id + '/friendship/' + userObjectId;
- var request = AVRequest(route, null, null, 'DELETE', null, authOptions);
- return request;
- },
- /**
- * Get the user's followers and followees.
- * @since 4.8.0
- * @param {Object} [options]
- * @param {Number} [options.skip]
- * @param {Number} [options.limit]
- * @param {AuthOptions} [authOptions]
- */
- getFollowersAndFollowees: function getFollowersAndFollowees(options, authOptions) {
- if (!this.id) {
- throw new Error('Please signin.');
- }
- return request({
- method: 'GET',
- path: "/users/".concat(this.id, "/followersAndFollowees"),
- query: {
- skip: options && options.skip,
- limit: options && options.limit,
- include: 'follower,followee',
- keys: 'follower,followee'
- },
- authOptions: authOptions
- }).then(function (_ref11) {
- var followers = _ref11.followers,
- followees = _ref11.followees;
- return {
- followers: (0, _map.default)(followers).call(followers, function (_ref12) {
- var follower = _ref12.follower;
- return AV._decode(follower);
- }),
- followees: (0, _map.default)(followees).call(followees, function (_ref13) {
- var followee = _ref13.followee;
- return AV._decode(followee);
- })
- };
- });
- },
- /**
- *Create a follower query to query the user's followers.
- * @since 0.3.0
- * @see AV.User#followerQuery
- */
- followerQuery: function followerQuery() {
- return AV.User.followerQuery(this.id);
- },
- /**
- *Create a followee query to query the user's followees.
- * @since 0.3.0
- * @see AV.User#followeeQuery
- */
- followeeQuery: function followeeQuery() {
- return AV.User.followeeQuery(this.id);
- },
- /**
- * @see AV.Object#fetch
- */
- fetch: function fetch(fetchOptions, options) {
- return AV.Object.prototype.fetch.call(this, fetchOptions, options).then(function (model) {
- return model._handleSaveResult(false).then(function () {
- return model;
- });
- });
- },
- /**
- * Update user's new password safely based on old password.
- * @param {String} oldPassword the old password.
- * @param {String} newPassword the new password.
- * @param {AuthOptions} options
- */
- updatePassword: function updatePassword(oldPassword, newPassword, options) {
- var _this12 = this;
- var route = 'users/' + this.id + '/updatePassword';
- var params = {
- old_password: oldPassword,
- new_password: newPassword
- };
- var request = AVRequest(route, null, null, 'PUT', params, options);
- return request.then(function (resp) {
- _this12._finishFetch(_this12.parse(resp));
- return _this12._handleSaveResult(true).then(function () {
- return resp;
- });
- });
- },
- /**
- * Returns true if <code>current</code> would return this user.
- * @see AV.User#current
- */
- isCurrent: function isCurrent() {
- return this._isCurrentUser;
- },
- /**
- * Returns get("username").
- * @return {String}
- * @see AV.Object#get
- */
- getUsername: function getUsername() {
- return this.get('username');
- },
- /**
- * Returns get("mobilePhoneNumber").
- * @return {String}
- * @see AV.Object#get
- */
- getMobilePhoneNumber: function getMobilePhoneNumber() {
- return this.get('mobilePhoneNumber');
- },
- /**
- * Calls set("mobilePhoneNumber", phoneNumber, options) and returns the result.
- * @param {String} mobilePhoneNumber
- * @return {Boolean}
- * @see AV.Object#set
- */
- setMobilePhoneNumber: function setMobilePhoneNumber(phone, options) {
- return this.set('mobilePhoneNumber', phone, options);
- },
- /**
- * Calls set("username", username, options) and returns the result.
- * @param {String} username
- * @return {Boolean}
- * @see AV.Object#set
- */
- setUsername: function setUsername(username, options) {
- return this.set('username', username, options);
- },
- /**
- * Calls set("password", password, options) and returns the result.
- * @param {String} password
- * @return {Boolean}
- * @see AV.Object#set
- */
- setPassword: function setPassword(password, options) {
- return this.set('password', password, options);
- },
- /**
- * Returns get("email").
- * @return {String}
- * @see AV.Object#get
- */
- getEmail: function getEmail() {
- return this.get('email');
- },
- /**
- * Calls set("email", email, options) and returns the result.
- * @param {String} email
- * @param {AuthOptions} options
- * @return {Boolean}
- * @see AV.Object#set
- */
- setEmail: function setEmail(email, options) {
- return this.set('email', email, options);
- },
- /**
- * Checks whether this user is the current user and has been authenticated.
- * @deprecated 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),
- * 如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id
- * @return (Boolean) whether this user is the current user and is logged in.
- */
- authenticated: function authenticated() {
- console.warn('DEPRECATED: 如果要判断当前用户的登录状态是否有效,请使用 currentUser.isAuthenticated().then(),如果要判断该用户是否是当前登录用户,请使用 user.id === currentUser.id。');
- return !!this._sessionToken && !AV._config.disableCurrentUser && AV.User.current() && AV.User.current().id === this.id;
- },
- /**
- * Detects if current sessionToken is valid.
- *
- * @since 2.0.0
- * @return Promise.<Boolean>
- */
- isAuthenticated: function isAuthenticated() {
- var _this13 = this;
- return _promise.default.resolve().then(function () {
- return !!_this13._sessionToken && AV.User._fetchUserBySessionToken(_this13._sessionToken).then(function () {
- return true;
- }, function (error) {
- if (error.code === 211) {
- return false;
- }
- throw error;
- });
- });
- },
- /**
- * Get sessionToken of current user.
- * @return {String} sessionToken
- */
- getSessionToken: function getSessionToken() {
- return this._sessionToken;
- },
- /**
- * Refresh sessionToken of current user.
- * @since 2.1.0
- * @param {AuthOptions} [options]
- * @return {Promise.<AV.User>} user with refreshed sessionToken
- */
- refreshSessionToken: function refreshSessionToken(options) {
- var _this14 = this;
- return AVRequest("users/".concat(this.id, "/refreshSessionToken"), null, null, 'PUT', null, options).then(function (response) {
- _this14._finishFetch(response);
- return _this14._handleSaveResult(true).then(function () {
- return _this14;
- });
- });
- },
- /**
- * Get this user's Roles.
- * @param {AuthOptions} [options]
- * @return {Promise.<AV.Role[]>} A promise that is fulfilled with the roles when
- * the query is complete.
- */
- getRoles: function getRoles(options) {
- var _context;
- return (0, _find.default)(_context = AV.Relation.reverseQuery('_Role', 'users', this)).call(_context, options);
- }
- },
- /** @lends AV.User */
- {
- // Class Variables
- // The currently logged-in user.
- _currentUser: null,
- // Whether currentUser is known to match the serialized version on disk.
- // This is useful for saving a localstorage check if you try to load
- // _currentUser frequently while there is none stored.
- _currentUserMatchesDisk: false,
- // The localStorage key suffix that the current user is stored under.
- _CURRENT_USER_KEY: 'currentUser',
- // The mapping of auth provider names to actual providers
- _authProviders: {},
- // Class Methods
- /**
- * Signs up a new user with a username (or email) and password.
- * This will create a new AV.User on the server, and also persist the
- * session in localStorage so that you can access the user using
- * {@link #current}.
- *
- * @param {String} username The username (or email) to sign up with.
- * @param {String} password The password to sign up with.
- * @param {Object} [attrs] Extra fields to set on the new user.
- * @param {AuthOptions} [options]
- * @return {Promise} A promise that is fulfilled with the user when
- * the signup completes.
- * @see AV.User#signUp
- */
- signUp: function signUp(username, password, attrs, options) {
- attrs = attrs || {};
- attrs.username = username;
- attrs.password = password;
- var user = AV.Object._create('_User');
- return user.signUp(attrs, options);
- },
- /**
- * Logs in a user with a username (or email) and password. On success, this
- * saves the session to disk, so you can retrieve the currently logged in
- * user using <code>current</code>.
- *
- * @param {String} username The username (or email) to log in with.
- * @param {String} password The password to log in with.
- * @return {Promise} A promise that is fulfilled with the user when
- * the login completes.
- * @see AV.User#logIn
- */
- logIn: function logIn(username, password) {
- var user = AV.Object._create('_User');
- user._finishFetch({
- username: username,
- password: password
- });
- return user.logIn();
- },
- /**
- * Logs in a user with a session token. On success, this saves the session
- * to disk, so you can retrieve the currently logged in user using
- * <code>current</code>.
- *
- * @param {String} sessionToken The sessionToken to log in with.
- * @return {Promise} A promise that is fulfilled with the user when
- * the login completes.
- */
- become: function become(sessionToken) {
- return this._fetchUserBySessionToken(sessionToken).then(function (user) {
- return user._handleSaveResult(true).then(function () {
- return user;
- });
- });
- },
- _fetchUserBySessionToken: function _fetchUserBySessionToken(sessionToken) {
- if (sessionToken === undefined) {
- return _promise.default.reject(new Error('The sessionToken cannot be undefined'));
- }
- var user = AV.Object._create('_User');
- return request({
- method: 'GET',
- path: '/users/me',
- authOptions: {
- sessionToken: sessionToken
- }
- }).then(function (resp) {
- var serverAttrs = user.parse(resp);
- user._finishFetch(serverAttrs);
- return user;
- });
- },
- /**
- * Logs in a user with a mobile phone number and sms code sent by
- * AV.User.requestLoginSmsCode.On success, this
- * saves the session to disk, so you can retrieve the currently logged in
- * user using <code>current</code>.
- *
- * @param {String} mobilePhone The user's mobilePhoneNumber
- * @param {String} smsCode The sms code sent by AV.User.requestLoginSmsCode
- * @return {Promise} A promise that is fulfilled with the user when
- * the login completes.
- * @see AV.User#logIn
- */
- logInWithMobilePhoneSmsCode: function logInWithMobilePhoneSmsCode(mobilePhone, smsCode) {
- var user = AV.Object._create('_User');
- user._finishFetch({
- mobilePhoneNumber: mobilePhone,
- smsCode: smsCode
- });
- return user.logIn();
- },
- /**
- * Signs up or logs in a user with a mobilePhoneNumber and smsCode.
- * On success, this saves the session to disk, so you can retrieve the currently
- * logged in user using <code>current</code>.
- *
- * @param {String} mobilePhoneNumber The user's mobilePhoneNumber.
- * @param {String} smsCode The sms code sent by AV.Cloud.requestSmsCode
- * @param {Object} attributes The user's other attributes such as username etc.
- * @param {AuthOptions} options
- * @return {Promise} A promise that is fulfilled with the user when
- * the login completes.
- * @see AV.User#signUpOrlogInWithMobilePhone
- * @see AV.Cloud.requestSmsCode
- */
- signUpOrlogInWithMobilePhone: function signUpOrlogInWithMobilePhone(mobilePhoneNumber, smsCode, attrs, options) {
- attrs = attrs || {};
- attrs.mobilePhoneNumber = mobilePhoneNumber;
- attrs.smsCode = smsCode;
- var user = AV.Object._create('_User');
- return user.signUpOrlogInWithMobilePhone(attrs, options);
- },
- /**
- * Logs in a user with a mobile phone number and password. On success, this
- * saves the session to disk, so you can retrieve the currently logged in
- * user using <code>current</code>.
- *
- * @param {String} mobilePhone The user's mobilePhoneNumber
- * @param {String} password The password to log in with.
- * @return {Promise} A promise that is fulfilled with the user when
- * the login completes.
- * @see AV.User#logIn
- */
- logInWithMobilePhone: function logInWithMobilePhone(mobilePhone, password) {
- var user = AV.Object._create('_User');
- user._finishFetch({
- mobilePhoneNumber: mobilePhone,
- password: password
- });
- return user.logIn();
- },
- /**
- * Logs in a user with email and password.
- *
- * @since 3.13.0
- * @param {String} email The user's email.
- * @param {String} password The password to log in with.
- * @return {Promise} A promise that is fulfilled with the user when
- * the login completes.
- */
- loginWithEmail: function loginWithEmail(email, password) {
- var user = AV.Object._create('_User');
- user._finishFetch({
- email: email,
- password: password
- });
- return user.logIn();
- },
- /**
- * Signs up or logs in a user with a third party auth data(AccessToken).
- * On success, this saves the session to disk, so you can retrieve the currently
- * logged in user using <code>current</code>.
- *
- * @since 3.7.0
- * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
- * @param {string} platform Available platform for sign up.
- * @param {Object} [options]
- * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
- * @return {Promise} A promise that is fulfilled with the user when
- * the login completes.
- * @example AV.User.loginWithAuthData({
- * openid: 'abc123',
- * access_token: '123abc',
- * expires_in: 1382686496
- * }, 'weixin').then(function(user) {
- * //Access user here
- * }).catch(function(error) {
- * //console.error("error: ", error);
- * });
- * @see {@link https://leancloud.cn/docs/js_guide.html#绑定第三方平台账户}
- */
- loginWithAuthData: function loginWithAuthData(authData, platform, options) {
- return AV.User._logInWith(platform, authData, options);
- },
- /**
- * @deprecated renamed to {@link AV.User.loginWithAuthData}
- */
- signUpOrlogInWithAuthData: function signUpOrlogInWithAuthData() {
- console.warn('DEPRECATED: User.signUpOrlogInWithAuthData 已废弃,请使用 User#loginWithAuthData 代替');
- return this.loginWithAuthData.apply(this, arguments);
- },
- /**
- * Signs up or logs in a user with a third party authData and unionId.
- * @since 3.7.0
- * @param {Object} authData The response json data returned from third party token, maybe like { openid: 'abc123', access_token: '123abc', expires_in: 1382686496 }
- * @param {string} platform Available platform for sign up.
- * @param {string} unionId
- * @param {Object} [unionLoginOptions]
- * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
- * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
- * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
- * @return {Promise<AV.User>} A promise that is fulfilled with the user when completed.
- * @example AV.User.loginWithAuthDataAndUnionId({
- * openid: 'abc123',
- * access_token: '123abc',
- * expires_in: 1382686496
- * }, 'weixin', 'union123', {
- * unionIdPlatform: 'weixin',
- * asMainAccount: true,
- * }).then(function(user) {
- * //Access user here
- * }).catch(function(error) {
- * //console.error("error: ", error);
- * });
- */
- loginWithAuthDataAndUnionId: function loginWithAuthDataAndUnionId(authData, platform, unionId, unionLoginOptions) {
- return this.loginWithAuthData(mergeUnionDataIntoAuthData()(authData, unionId, unionLoginOptions), platform, unionLoginOptions);
- },
- /**
- * @deprecated renamed to {@link AV.User.loginWithAuthDataAndUnionId}
- * @since 3.5.0
- */
- signUpOrlogInWithAuthDataAndUnionId: function signUpOrlogInWithAuthDataAndUnionId() {
- console.warn('DEPRECATED: User.signUpOrlogInWithAuthDataAndUnionId 已废弃,请使用 User#loginWithAuthDataAndUnionId 代替');
- return this.loginWithAuthDataAndUnionId.apply(this, arguments);
- },
- /**
- * Merge unionId into authInfo.
- * @since 4.6.0
- * @param {Object} authInfo
- * @param {String} unionId
- * @param {Object} [unionIdOption]
- * @param {Boolean} [unionIdOption.asMainAccount] If true, the unionId will be associated with the user.
- */
- mergeUnionId: function mergeUnionId(authInfo, unionId) {
- var _ref14 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
- _ref14$asMainAccount = _ref14.asMainAccount,
- asMainAccount = _ref14$asMainAccount === void 0 ? false : _ref14$asMainAccount;
- authInfo = JSON.parse((0, _stringify.default)(authInfo));
- var _authInfo = authInfo,
- authData = _authInfo.authData,
- platform = _authInfo.platform;
- authData.platform = platform;
- authData.main_account = asMainAccount;
- authData.unionid = unionId;
- return authInfo;
- },
- /**
- * 使用当前使用微信小程序的微信用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
- * 仅在微信小程序中可用。
- *
- * @deprecated please use {@link AV.User.loginWithMiniApp}
- * @since 2.0.0
- * @param {Object} [options]
- * @param {boolean} [options.preferUnionId] 当用户满足 {@link https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html 获取 UnionId 的条件} 时,是否使用 UnionId 登录。(since 3.13.0)
- * @param {string} [options.unionIdPlatform = 'weixin'] (only take effect when preferUnionId) unionId platform
- * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
- * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists. (since v3.7.0)
- * @return {Promise.<AV.User>}
- */
- loginWithWeapp: function loginWithWeapp() {
- var _this15 = this;
- var _ref15 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- _ref15$preferUnionId = _ref15.preferUnionId,
- preferUnionId = _ref15$preferUnionId === void 0 ? false : _ref15$preferUnionId,
- _ref15$unionIdPlatfor = _ref15.unionIdPlatform,
- unionIdPlatform = _ref15$unionIdPlatfor === void 0 ? 'weixin' : _ref15$unionIdPlatfor,
- _ref15$asMainAccount = _ref15.asMainAccount,
- asMainAccount = _ref15$asMainAccount === void 0 ? true : _ref15$asMainAccount,
- _ref15$failOnNotExist = _ref15.failOnNotExist,
- failOnNotExist = _ref15$failOnNotExist === void 0 ? false : _ref15$failOnNotExist;
- var getAuthInfo = getAdapter('getAuthInfo');
- return getAuthInfo({
- preferUnionId: preferUnionId,
- asMainAccount: asMainAccount,
- platform: unionIdPlatform
- }).then(function (authInfo) {
- return _this15.loginWithMiniApp(authInfo, {
- failOnNotExist: failOnNotExist
- });
- });
- },
- /**
- * 使用当前使用微信小程序的微信用户身份注册或登录,
- * 仅在微信小程序中可用。
- *
- * @deprecated please use {@link AV.User.loginWithMiniApp}
- * @since 3.13.0
- * @param {Object} [unionLoginOptions]
- * @param {string} [unionLoginOptions.unionIdPlatform = 'weixin'] unionId platform
- * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
- * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists. * @return {Promise.<AV.User>}
- */
- loginWithWeappWithUnionId: function loginWithWeappWithUnionId(unionId) {
- var _this16 = this;
- var _ref16 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- _ref16$unionIdPlatfor = _ref16.unionIdPlatform,
- unionIdPlatform = _ref16$unionIdPlatfor === void 0 ? 'weixin' : _ref16$unionIdPlatfor,
- _ref16$asMainAccount = _ref16.asMainAccount,
- asMainAccount = _ref16$asMainAccount === void 0 ? false : _ref16$asMainAccount,
- _ref16$failOnNotExist = _ref16.failOnNotExist,
- failOnNotExist = _ref16$failOnNotExist === void 0 ? false : _ref16$failOnNotExist;
- var getAuthInfo = getAdapter('getAuthInfo');
- return getAuthInfo({
- platform: unionIdPlatform
- }).then(function (authInfo) {
- authInfo = AV.User.mergeUnionId(authInfo, unionId, {
- asMainAccount: asMainAccount
- });
- return _this16.loginWithMiniApp(authInfo, {
- failOnNotExist: failOnNotExist
- });
- });
- },
- /**
- * 使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,成功后用户的 session 会在设备上持久化保存,之后可以使用 AV.User.current() 获取当前登录用户。
- * 仅在 QQ 小程序中可用。
- *
- * @deprecated please use {@link AV.User.loginWithMiniApp}
- * @since 4.2.0
- * @param {Object} [options]
- * @param {boolean} [options.preferUnionId] 如果服务端在登录时获取到了用户的 UnionId,是否将 UnionId 保存在用户账号中。
- * @param {string} [options.unionIdPlatform = 'qq'] (only take effect when preferUnionId) unionId platform
- * @param {boolean} [options.asMainAccount = true] (only take effect when preferUnionId) If true, the unionId will be associated with the user.
- * @param {boolean} [options.failOnNotExist] If true, the login request will fail when no user matches this authData exists. (since v3.7.0)
- * @return {Promise.<AV.User>}
- */
- loginWithQQApp: function loginWithQQApp() {
- var _this17 = this;
- var _ref17 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- _ref17$preferUnionId = _ref17.preferUnionId,
- preferUnionId = _ref17$preferUnionId === void 0 ? false : _ref17$preferUnionId,
- _ref17$unionIdPlatfor = _ref17.unionIdPlatform,
- unionIdPlatform = _ref17$unionIdPlatfor === void 0 ? 'qq' : _ref17$unionIdPlatfor,
- _ref17$asMainAccount = _ref17.asMainAccount,
- asMainAccount = _ref17$asMainAccount === void 0 ? true : _ref17$asMainAccount,
- _ref17$failOnNotExist = _ref17.failOnNotExist,
- failOnNotExist = _ref17$failOnNotExist === void 0 ? false : _ref17$failOnNotExist;
- var getAuthInfo = getAdapter('getAuthInfo');
- return getAuthInfo({
- preferUnionId: preferUnionId,
- asMainAccount: asMainAccount,
- platform: unionIdPlatform
- }).then(function (authInfo) {
- authInfo.provider = PLATFORM_QQAPP;
- return _this17.loginWithMiniApp(authInfo, {
- failOnNotExist: failOnNotExist
- });
- });
- },
- /**
- * 使用当前使用 QQ 小程序的 QQ 用户身份注册或登录,
- * 仅在 QQ 小程序中可用。
- *
- * @deprecated please use {@link AV.User.loginWithMiniApp}
- * @since 4.2.0
- * @param {Object} [unionLoginOptions]
- * @param {string} [unionLoginOptions.unionIdPlatform = 'qq'] unionId platform
- * @param {boolean} [unionLoginOptions.asMainAccount = false] If true, the unionId will be associated with the user.
- * @param {boolean} [unionLoginOptions.failOnNotExist] If true, the login request will fail when no user matches this authData exists.
- * @return {Promise.<AV.User>}
- */
- loginWithQQAppWithUnionId: function loginWithQQAppWithUnionId(unionId) {
- var _this18 = this;
- var _ref18 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- _ref18$unionIdPlatfor = _ref18.unionIdPlatform,
- unionIdPlatform = _ref18$unionIdPlatfor === void 0 ? 'qq' : _ref18$unionIdPlatfor,
- _ref18$asMainAccount = _ref18.asMainAccount,
- asMainAccount = _ref18$asMainAccount === void 0 ? false : _ref18$asMainAccount,
- _ref18$failOnNotExist = _ref18.failOnNotExist,
- failOnNotExist = _ref18$failOnNotExist === void 0 ? false : _ref18$failOnNotExist;
- var getAuthInfo = getAdapter('getAuthInfo');
- return getAuthInfo({
- platform: unionIdPlatform
- }).then(function (authInfo) {
- authInfo = AV.User.mergeUnionId(authInfo, unionId, {
- asMainAccount: asMainAccount
- });
- authInfo.provider = PLATFORM_QQAPP;
- return _this18.loginWithMiniApp(authInfo, {
- failOnNotExist: failOnNotExist
- });
- });
- },
- /**
- * Register or login using the identity of the current mini-app.
- * @param {Object} authInfo
- * @param {Object} [option]
- * @param {Boolean} [option.failOnNotExist] If true, the login request will fail when no user matches this authInfo.authData exists.
- */
- loginWithMiniApp: function loginWithMiniApp(authInfo, option) {
- var _this19 = this;
- if (authInfo === undefined) {
- var getAuthInfo = getAdapter('getAuthInfo');
- return getAuthInfo().then(function (authInfo) {
- return _this19.loginWithAuthData(authInfo.authData, authInfo.provider, option);
- });
- }
- return this.loginWithAuthData(authInfo.authData, authInfo.provider, option);
- },
- /**
- * Only use for DI in tests to produce deterministic IDs.
- */
- _genId: function _genId() {
- return uuid();
- },
- /**
- * Creates an anonymous user.
- *
- * @since 3.9.0
- * @return {Promise.<AV.User>}
- */
- loginAnonymously: function loginAnonymously() {
- return this.loginWithAuthData({
- id: AV.User._genId()
- }, 'anonymous');
- },
- associateWithAuthData: function associateWithAuthData(userObj, platform, authData) {
- console.warn('DEPRECATED: User.associateWithAuthData 已废弃,请使用 User#associateWithAuthData 代替');
- return userObj._linkWith(platform, authData);
- },
- /**
- * Logs out the currently logged in user session. This will remove the
- * session from disk, log out of linked services, and future calls to
- * <code>current</code> will return <code>null</code>.
- * @return {Promise}
- */
- logOut: function logOut() {
- if (AV._config.disableCurrentUser) {
- 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');
- return _promise.default.resolve(null);
- }
- if (AV.User._currentUser !== null) {
- AV.User._currentUser._logOutWithAll();
- AV.User._currentUser._isCurrentUser = false;
- }
- AV.User._currentUserMatchesDisk = true;
- AV.User._currentUser = null;
- return AV.localStorage.removeItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function () {
- return AV._refreshSubscriptionId();
- });
- },
- /**
- *Create a follower query for special user to query the user's followers.
- * @param {String} userObjectId The user object id.
- * @return {AV.FriendShipQuery}
- * @since 0.3.0
- */
- followerQuery: function followerQuery(userObjectId) {
- if (!userObjectId || !_.isString(userObjectId)) {
- throw new Error('Invalid user object id.');
- }
- var query = new AV.FriendShipQuery('_Follower');
- query._friendshipTag = 'follower';
- query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
- return query;
- },
- /**
- *Create a followee query for special user to query the user's followees.
- * @param {String} userObjectId The user object id.
- * @return {AV.FriendShipQuery}
- * @since 0.3.0
- */
- followeeQuery: function followeeQuery(userObjectId) {
- if (!userObjectId || !_.isString(userObjectId)) {
- throw new Error('Invalid user object id.');
- }
- var query = new AV.FriendShipQuery('_Followee');
- query._friendshipTag = 'followee';
- query.equalTo('user', AV.Object.createWithoutData('_User', userObjectId));
- return query;
- },
- /**
- * Requests a password reset email to be sent to the specified email address
- * associated with the user account. This email allows the user to securely
- * reset their password on the AV site.
- *
- * @param {String} email The email address associated with the user that
- * forgot their password.
- * @return {Promise}
- */
- requestPasswordReset: function requestPasswordReset(email) {
- var json = {
- email: email
- };
- var request = AVRequest('requestPasswordReset', null, null, 'POST', json);
- return request;
- },
- /**
- * Requests a verify email to be sent to the specified email address
- * associated with the user account. This email allows the user to securely
- * verify their email address on the AV site.
- *
- * @param {String} email The email address associated with the user that
- * doesn't verify their email address.
- * @return {Promise}
- */
- requestEmailVerify: function requestEmailVerify(email) {
- var json = {
- email: email
- };
- var request = AVRequest('requestEmailVerify', null, null, 'POST', json);
- return request;
- },
- /**
- * Requests a verify sms code to be sent to the specified mobile phone
- * number associated with the user account. This sms code allows the user to
- * verify their mobile phone number by calling AV.User.verifyMobilePhone
- *
- * @param {String} mobilePhoneNumber The mobile phone number associated with the
- * user that doesn't verify their mobile phone number.
- * @param {SMSAuthOptions} [options]
- * @return {Promise}
- */
- requestMobilePhoneVerify: function requestMobilePhoneVerify(mobilePhoneNumber) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var data = {
- mobilePhoneNumber: mobilePhoneNumber
- };
- if (options.validateToken) {
- data.validate_token = options.validateToken;
- }
- var request = AVRequest('requestMobilePhoneVerify', null, null, 'POST', data, options);
- return request;
- },
- /**
- * Requests a reset password sms code to be sent to the specified mobile phone
- * number associated with the user account. This sms code allows the user to
- * reset their account's password by calling AV.User.resetPasswordBySmsCode
- *
- * @param {String} mobilePhoneNumber The mobile phone number associated with the
- * user that doesn't verify their mobile phone number.
- * @param {SMSAuthOptions} [options]
- * @return {Promise}
- */
- requestPasswordResetBySmsCode: function requestPasswordResetBySmsCode(mobilePhoneNumber) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var data = {
- mobilePhoneNumber: mobilePhoneNumber
- };
- if (options.validateToken) {
- data.validate_token = options.validateToken;
- }
- var request = AVRequest('requestPasswordResetBySmsCode', null, null, 'POST', data, options);
- return request;
- },
- /**
- * Requests a change mobile phone number sms code to be sent to the mobilePhoneNumber.
- * This sms code allows current user to reset it's mobilePhoneNumber by
- * calling {@link AV.User.changePhoneNumber}
- * @since 4.7.0
- * @param {String} mobilePhoneNumber
- * @param {Number} [ttl] ttl of sms code (default is 6 minutes)
- * @param {SMSAuthOptions} [options]
- * @return {Promise}
- */
- requestChangePhoneNumber: function requestChangePhoneNumber(mobilePhoneNumber, ttl, options) {
- var data = {
- mobilePhoneNumber: mobilePhoneNumber
- };
- if (ttl) {
- data.ttl = options.ttl;
- }
- if (options && options.validateToken) {
- data.validate_token = options.validateToken;
- }
- return AVRequest('requestChangePhoneNumber', null, null, 'POST', data, options);
- },
- /**
- * Makes a call to reset user's account mobilePhoneNumber by sms code.
- * The sms code is sent by {@link AV.User.requestChangePhoneNumber}
- * @since 4.7.0
- * @param {String} mobilePhoneNumber
- * @param {String} code The sms code.
- * @return {Promise}
- */
- changePhoneNumber: function changePhoneNumber(mobilePhoneNumber, code) {
- var data = {
- mobilePhoneNumber: mobilePhoneNumber,
- code: code
- };
- return AVRequest('changePhoneNumber', null, null, 'POST', data);
- },
- /**
- * Makes a call to reset user's account password by sms code and new password.
- * The sms code is sent by AV.User.requestPasswordResetBySmsCode.
- * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
- * @param {String} password The new password.
- * @return {Promise} A promise that will be resolved with the result
- * of the function.
- */
- resetPasswordBySmsCode: function resetPasswordBySmsCode(code, password) {
- var json = {
- password: password
- };
- var request = AVRequest('resetPasswordBySmsCode', null, code, 'PUT', json);
- return request;
- },
- /**
- * Makes a call to verify sms code that sent by AV.User.Cloud.requestSmsCode
- * If verify successfully,the user mobilePhoneVerified attribute will be true.
- * @param {String} code The sms code sent by AV.User.Cloud.requestSmsCode
- * @return {Promise} A promise that will be resolved with the result
- * of the function.
- */
- verifyMobilePhone: function verifyMobilePhone(code) {
- var request = AVRequest('verifyMobilePhone', null, code, 'POST', null);
- return request;
- },
- /**
- * Requests a logIn sms code to be sent to the specified mobile phone
- * number associated with the user account. This sms code allows the user to
- * login by AV.User.logInWithMobilePhoneSmsCode function.
- *
- * @param {String} mobilePhoneNumber The mobile phone number associated with the
- * user that want to login by AV.User.logInWithMobilePhoneSmsCode
- * @param {SMSAuthOptions} [options]
- * @return {Promise}
- */
- requestLoginSmsCode: function requestLoginSmsCode(mobilePhoneNumber) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var data = {
- mobilePhoneNumber: mobilePhoneNumber
- };
- if (options.validateToken) {
- data.validate_token = options.validateToken;
- }
- var request = AVRequest('requestLoginSmsCode', null, null, 'POST', data, options);
- return request;
- },
- /**
- * Retrieves the currently logged in AVUser with a valid session,
- * either from memory or localStorage, if necessary.
- * @return {Promise.<AV.User>} resolved with the currently logged in AV.User.
- */
- currentAsync: function currentAsync() {
- if (AV._config.disableCurrentUser) {
- 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');
- return _promise.default.resolve(null);
- }
- if (AV.User._currentUser) {
- return _promise.default.resolve(AV.User._currentUser);
- }
- if (AV.User._currentUserMatchesDisk) {
- return _promise.default.resolve(AV.User._currentUser);
- }
- return AV.localStorage.getItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY)).then(function (userData) {
- if (!userData) {
- return null;
- } // Load the user from local storage.
- AV.User._currentUserMatchesDisk = true;
- AV.User._currentUser = AV.Object._create('_User');
- AV.User._currentUser._isCurrentUser = true;
- var json = JSON.parse(userData);
- AV.User._currentUser.id = json._id;
- delete json._id;
- AV.User._currentUser._sessionToken = json._sessionToken;
- delete json._sessionToken;
- AV.User._currentUser._finishFetch(json); //AV.User._currentUser.set(json);
- AV.User._currentUser._synchronizeAllAuthData();
- AV.User._currentUser._refreshCache();
- AV.User._currentUser._opSetQueue = [{}];
- return AV.User._currentUser;
- });
- },
- /**
- * Retrieves the currently logged in AVUser with a valid session,
- * either from memory or localStorage, if necessary.
- * @return {AV.User} The currently logged in AV.User.
- */
- current: function current() {
- if (AV._config.disableCurrentUser) {
- 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');
- return null;
- }
- if (AV.localStorage.async) {
- var error = new Error('Synchronous API User.current() is not available in this runtime. Use User.currentAsync() instead.');
- error.code = 'SYNC_API_NOT_AVAILABLE';
- throw error;
- }
- if (AV.User._currentUser) {
- return AV.User._currentUser;
- }
- if (AV.User._currentUserMatchesDisk) {
- return AV.User._currentUser;
- } // Load the user from local storage.
- AV.User._currentUserMatchesDisk = true;
- var userData = AV.localStorage.getItem(AV._getAVPath(AV.User._CURRENT_USER_KEY));
- if (!userData) {
- return null;
- }
- AV.User._currentUser = AV.Object._create('_User');
- AV.User._currentUser._isCurrentUser = true;
- var json = JSON.parse(userData);
- AV.User._currentUser.id = json._id;
- delete json._id;
- AV.User._currentUser._sessionToken = json._sessionToken;
- delete json._sessionToken;
- AV.User._currentUser._finishFetch(json); //AV.User._currentUser.set(json);
- AV.User._currentUser._synchronizeAllAuthData();
- AV.User._currentUser._refreshCache();
- AV.User._currentUser._opSetQueue = [{}];
- return AV.User._currentUser;
- },
- /**
- * Persists a user as currentUser to localStorage, and into the singleton.
- * @private
- */
- _saveCurrentUser: function _saveCurrentUser(user) {
- var promise;
- if (AV.User._currentUser !== user) {
- promise = AV.User.logOut();
- } else {
- promise = _promise.default.resolve();
- }
- return promise.then(function () {
- user._isCurrentUser = true;
- AV.User._currentUser = user;
- var json = user._toFullJSON();
- json._id = user.id;
- json._sessionToken = user._sessionToken;
- return AV.localStorage.setItemAsync(AV._getAVPath(AV.User._CURRENT_USER_KEY), (0, _stringify.default)(json)).then(function () {
- AV.User._currentUserMatchesDisk = true;
- return AV._refreshSubscriptionId();
- });
- });
- },
- _registerAuthenticationProvider: function _registerAuthenticationProvider(provider) {
- AV.User._authProviders[provider.getAuthType()] = provider; // Synchronize the current user with the auth provider.
- if (!AV._config.disableCurrentUser && AV.User.current()) {
- AV.User.current()._synchronizeAuthData(provider.getAuthType());
- }
- },
- _logInWith: function _logInWith(provider, authData, options) {
- var user = AV.Object._create('_User');
- return user._linkWith(provider, authData, options);
- }
- });
- };
- /***/ }),
- /* 533 */
- /***/ (function(module, exports, __webpack_require__) {
- var _Object$defineProperty = __webpack_require__(145);
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- _Object$defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
- return obj;
- }
- module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
- /***/ }),
- /* 534 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _map = _interopRequireDefault(__webpack_require__(42));
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _keys = _interopRequireDefault(__webpack_require__(55));
- var _stringify = _interopRequireDefault(__webpack_require__(36));
- var _find = _interopRequireDefault(__webpack_require__(110));
- var _concat = _interopRequireDefault(__webpack_require__(30));
- var _ = __webpack_require__(2);
- var debug = __webpack_require__(67)('leancloud:query');
- var AVError = __webpack_require__(43);
- var _require = __webpack_require__(26),
- _request = _require._request,
- request = _require.request;
- var _require2 = __webpack_require__(29),
- ensureArray = _require2.ensureArray,
- transformFetchOptions = _require2.transformFetchOptions,
- continueWhile = _require2.continueWhile;
- var requires = function requires(value, message) {
- if (value === undefined) {
- throw new Error(message);
- }
- }; // AV.Query is a way to create a list of AV.Objects.
- module.exports = function (AV) {
- /**
- * Creates a new AV.Query for the given AV.Object subclass.
- * @param {Class|String} objectClass An instance of a subclass of AV.Object, or a AV className string.
- * @class
- *
- * <p>AV.Query defines a query that is used to fetch AV.Objects. The
- * most common use case is finding all objects that match a query through the
- * <code>find</code> method. For example, this sample code fetches all objects
- * of class <code>MyClass</code>. It calls a different function depending on
- * whether the fetch succeeded or not.
- *
- * <pre>
- * var query = new AV.Query(MyClass);
- * query.find().then(function(results) {
- * // results is an array of AV.Object.
- * }, function(error) {
- * // error is an instance of AVError.
- * });</pre></p>
- *
- * <p>An AV.Query can also be used to retrieve a single object whose id is
- * known, through the get method. For example, this sample code fetches an
- * object of class <code>MyClass</code> and id <code>myId</code>. It calls a
- * different function depending on whether the fetch succeeded or not.
- *
- * <pre>
- * var query = new AV.Query(MyClass);
- * query.get(myId).then(function(object) {
- * // object is an instance of AV.Object.
- * }, function(error) {
- * // error is an instance of AVError.
- * });</pre></p>
- *
- * <p>An AV.Query can also be used to count the number of objects that match
- * the query without retrieving all of those objects. For example, this
- * sample code counts the number of objects of the class <code>MyClass</code>
- * <pre>
- * var query = new AV.Query(MyClass);
- * query.count().then(function(number) {
- * // There are number instances of MyClass.
- * }, function(error) {
- * // error is an instance of AVError.
- * });</pre></p>
- */
- AV.Query = function (objectClass) {
- if (_.isString(objectClass)) {
- objectClass = AV.Object._getSubclass(objectClass);
- }
- this.objectClass = objectClass;
- this.className = objectClass.prototype.className;
- this._where = {};
- this._include = [];
- this._select = [];
- this._limit = -1; // negative limit means, do not send a limit
- this._skip = 0;
- this._defaultParams = {};
- };
- /**
- * Constructs a AV.Query that is the OR of the passed in queries. For
- * example:
- * <pre>var compoundQuery = AV.Query.or(query1, query2, query3);</pre>
- *
- * will create a compoundQuery that is an or of the query1, query2, and
- * query3.
- * @param {...AV.Query} var_args The list of queries to OR.
- * @return {AV.Query} The query that is the OR of the passed in queries.
- */
- AV.Query.or = function () {
- var queries = _.toArray(arguments);
- var className = null;
- AV._arrayEach(queries, function (q) {
- if (_.isNull(className)) {
- className = q.className;
- }
- if (className !== q.className) {
- throw new Error('All queries must be for the same class');
- }
- });
- var query = new AV.Query(className);
- query._orQuery(queries);
- return query;
- };
- /**
- * Constructs a AV.Query that is the AND of the passed in queries. For
- * example:
- * <pre>var compoundQuery = AV.Query.and(query1, query2, query3);</pre>
- *
- * will create a compoundQuery that is an 'and' of the query1, query2, and
- * query3.
- * @param {...AV.Query} var_args The list of queries to AND.
- * @return {AV.Query} The query that is the AND of the passed in queries.
- */
- AV.Query.and = function () {
- var queries = _.toArray(arguments);
- var className = null;
- AV._arrayEach(queries, function (q) {
- if (_.isNull(className)) {
- className = q.className;
- }
- if (className !== q.className) {
- throw new Error('All queries must be for the same class');
- }
- });
- var query = new AV.Query(className);
- query._andQuery(queries);
- return query;
- };
- /**
- * Retrieves a list of AVObjects that satisfy the CQL.
- * CQL syntax please see {@link https://leancloud.cn/docs/cql_guide.html CQL Guide}.
- *
- * @param {String} cql A CQL string, see {@link https://leancloud.cn/docs/cql_guide.html CQL Guide}.
- * @param {Array} pvalues An array contains placeholder values.
- * @param {AuthOptions} options
- * @return {Promise} A promise that is resolved with the results when
- * the query completes.
- */
- AV.Query.doCloudQuery = function (cql, pvalues, options) {
- var params = {
- cql: cql
- };
- if (_.isArray(pvalues)) {
- params.pvalues = pvalues;
- } else {
- options = pvalues;
- }
- var request = _request('cloudQuery', null, null, 'GET', params, options);
- return request.then(function (response) {
- //query to process results.
- var query = new AV.Query(response.className);
- var results = (0, _map.default)(_).call(_, response.results, function (json) {
- var obj = query._newObject(response);
- if (obj._finishFetch) {
- obj._finishFetch(query._processResult(json), true);
- }
- return obj;
- });
- return {
- results: results,
- count: response.count,
- className: response.className
- };
- });
- };
- /**
- * Return a query with conditions from json.
- * This can be useful to send a query from server side to client side.
- * @since 4.0.0
- * @param {Object} json from {@link AV.Query#toJSON}
- * @return {AV.Query}
- */
- AV.Query.fromJSON = function (_ref) {
- var className = _ref.className,
- where = _ref.where,
- include = _ref.include,
- select = _ref.select,
- includeACL = _ref.includeACL,
- limit = _ref.limit,
- skip = _ref.skip,
- order = _ref.order;
- if (typeof className !== 'string') {
- throw new TypeError('Invalid Query JSON, className must be a String.');
- }
- var query = new AV.Query(className);
- _.extend(query, {
- _where: where,
- _include: include,
- _select: select,
- _includeACL: includeACL,
- _limit: limit,
- _skip: skip,
- _order: order
- });
- return query;
- };
- AV.Query._extend = AV._extend;
- _.extend(AV.Query.prototype,
- /** @lends AV.Query.prototype */
- {
- //hook to iterate result. Added by dennis<xzhuang@avoscloud.com>.
- _processResult: function _processResult(obj) {
- return obj;
- },
- /**
- * Constructs an AV.Object whose id is already known by fetching data from
- * the server.
- *
- * @param {String} objectId The id of the object to be fetched.
- * @param {AuthOptions} options
- * @return {Promise.<AV.Object>}
- */
- get: function get(objectId, options) {
- if (!_.isString(objectId)) {
- throw new Error('objectId must be a string');
- }
- if (objectId === '') {
- return _promise.default.reject(new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.'));
- }
- var obj = this._newObject();
- obj.id = objectId;
- var queryJSON = this._getParams();
- var fetchOptions = {};
- if ((0, _keys.default)(queryJSON)) fetchOptions.keys = (0, _keys.default)(queryJSON);
- if (queryJSON.include) fetchOptions.include = queryJSON.include;
- if (queryJSON.includeACL) fetchOptions.includeACL = queryJSON.includeACL;
- return _request('classes', this.className, objectId, 'GET', transformFetchOptions(fetchOptions), options).then(function (response) {
- if (_.isEmpty(response)) throw new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
- obj._finishFetch(obj.parse(response), true);
- return obj;
- });
- },
- /**
- * Returns a JSON representation of this query.
- * @return {Object}
- */
- toJSON: function toJSON() {
- var className = this.className,
- where = this._where,
- include = this._include,
- select = this._select,
- includeACL = this._includeACL,
- limit = this._limit,
- skip = this._skip,
- order = this._order;
- return {
- className: className,
- where: where,
- include: include,
- select: select,
- includeACL: includeACL,
- limit: limit,
- skip: skip,
- order: order
- };
- },
- _getParams: function _getParams() {
- var params = _.extend({}, this._defaultParams, {
- where: this._where
- });
- if (this._include.length > 0) {
- params.include = this._include.join(',');
- }
- if (this._select.length > 0) {
- params.keys = this._select.join(',');
- }
- if (this._includeACL !== undefined) {
- params.returnACL = this._includeACL;
- }
- if (this._limit >= 0) {
- params.limit = this._limit;
- }
- if (this._skip > 0) {
- params.skip = this._skip;
- }
- if (this._order !== undefined) {
- params.order = this._order;
- }
- return params;
- },
- _newObject: function _newObject(response) {
- var obj;
- if (response && response.className) {
- obj = new AV.Object(response.className);
- } else {
- obj = new this.objectClass();
- }
- return obj;
- },
- _createRequest: function _createRequest() {
- var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._getParams();
- var options = arguments.length > 1 ? arguments[1] : undefined;
- var path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "/classes/".concat(this.className);
- if (encodeURIComponent((0, _stringify.default)(params)).length > 2000) {
- var body = {
- requests: [{
- method: 'GET',
- path: "/1.1".concat(path),
- params: params
- }]
- };
- return request({
- path: '/batch',
- method: 'POST',
- data: body,
- authOptions: options
- }).then(function (response) {
- var result = response[0];
- if (result.success) {
- return result.success;
- }
- var error = new AVError(result.error.code, result.error.error || 'Unknown batch error');
- throw error;
- });
- }
- return request({
- method: 'GET',
- path: path,
- query: params,
- authOptions: options
- });
- },
- _parseResponse: function _parseResponse(response) {
- var _this = this;
- return (0, _map.default)(_).call(_, response.results, function (json) {
- var obj = _this._newObject(response);
- if (obj._finishFetch) {
- obj._finishFetch(_this._processResult(json), true);
- }
- return obj;
- });
- },
- /**
- * Retrieves a list of AVObjects that satisfy this query.
- *
- * @param {AuthOptions} options
- * @return {Promise} A promise that is resolved with the results when
- * the query completes.
- */
- find: function find(options) {
- var request = this._createRequest(undefined, options);
- return request.then(this._parseResponse.bind(this));
- },
- /**
- * Retrieves both AVObjects and total count.
- *
- * @since 4.12.0
- * @param {AuthOptions} options
- * @return {Promise} A tuple contains results and count.
- */
- findAndCount: function findAndCount(options) {
- var _this2 = this;
- var params = this._getParams();
- params.count = 1;
- var request = this._createRequest(params, options);
- return request.then(function (response) {
- return [_this2._parseResponse(response), response.count];
- });
- },
- /**
- * scan a Query. masterKey required.
- *
- * @since 2.1.0
- * @param {object} [options]
- * @param {string} [options.orderedBy] specify the key to sort
- * @param {number} [options.batchSize] specify the batch size for each request
- * @param {AuthOptions} [authOptions]
- * @return {AsyncIterator.<AV.Object>}
- * @example const testIterator = {
- * [Symbol.asyncIterator]() {
- * return new Query('Test').scan(undefined, { useMasterKey: true });
- * },
- * };
- * for await (const test of testIterator) {
- * console.log(test.id);
- * }
- */
- scan: function scan() {
- var _this3 = this;
- var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- orderedBy = _ref2.orderedBy,
- batchSize = _ref2.batchSize;
- var authOptions = arguments.length > 1 ? arguments[1] : undefined;
- var condition = this._getParams();
- debug('scan %O', condition);
- if (condition.order) {
- console.warn('The order of the query is ignored for Query#scan. Checkout the orderedBy option of Query#scan.');
- delete condition.order;
- }
- if (condition.skip) {
- console.warn('The skip option of the query is ignored for Query#scan.');
- delete condition.skip;
- }
- if (condition.limit) {
- console.warn('The limit option of the query is ignored for Query#scan.');
- delete condition.limit;
- }
- if (orderedBy) condition.scan_key = orderedBy;
- if (batchSize) condition.limit = batchSize;
- var cursor;
- var remainResults = [];
- return {
- next: function next() {
- if (remainResults.length) {
- return _promise.default.resolve({
- done: false,
- value: remainResults.shift()
- });
- }
- if (cursor === null) {
- return _promise.default.resolve({
- done: true
- });
- }
- return _request('scan/classes', _this3.className, null, 'GET', cursor ? _.extend({}, condition, {
- cursor: cursor
- }) : condition, authOptions).then(function (response) {
- cursor = response.cursor;
- if (response.results.length) {
- var results = _this3._parseResponse(response);
- results.forEach(function (result) {
- return remainResults.push(result);
- });
- }
- if (cursor === null && remainResults.length === 0) {
- return {
- done: true
- };
- }
- return {
- done: false,
- value: remainResults.shift()
- };
- });
- }
- };
- },
- /**
- * Delete objects retrieved by this query.
- * @param {AuthOptions} options
- * @return {Promise} A promise that is fulfilled when the save
- * completes.
- */
- destroyAll: function destroyAll(options) {
- var self = this;
- return (0, _find.default)(self).call(self, options).then(function (objects) {
- return AV.Object.destroyAll(objects, options);
- });
- },
- /**
- * Counts the number of objects that match this query.
- *
- * @param {AuthOptions} options
- * @return {Promise} A promise that is resolved with the count when
- * the query completes.
- */
- count: function count(options) {
- var params = this._getParams();
- params.limit = 0;
- params.count = 1;
- var request = this._createRequest(params, options);
- return request.then(function (response) {
- return response.count;
- });
- },
- /**
- * Retrieves at most one AV.Object that satisfies this query.
- *
- * @param {AuthOptions} options
- * @return {Promise} A promise that is resolved with the object when
- * the query completes.
- */
- first: function first(options) {
- var self = this;
- var params = this._getParams();
- params.limit = 1;
- var request = this._createRequest(params, options);
- return request.then(function (response) {
- return (0, _map.default)(_).call(_, response.results, function (json) {
- var obj = self._newObject();
- if (obj._finishFetch) {
- obj._finishFetch(self._processResult(json), true);
- }
- return obj;
- })[0];
- });
- },
- /**
- * Sets the number of results to skip before returning any results.
- * This is useful for pagination.
- * Default is to skip zero results.
- * @param {Number} n the number of results to skip.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- skip: function skip(n) {
- requires(n, 'undefined is not a valid skip value');
- this._skip = n;
- return this;
- },
- /**
- * Sets the limit of the number of results to return. The default limit is
- * 100, with a maximum of 1000 results being returned at a time.
- * @param {Number} n the number of results to limit to.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- limit: function limit(n) {
- requires(n, 'undefined is not a valid limit value');
- this._limit = n;
- return this;
- },
- /**
- * Add a constraint to the query that requires a particular key's value to
- * be equal to the provided value.
- * @param {String} key The key to check.
- * @param value The value that the AV.Object must contain.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- equalTo: function equalTo(key, value) {
- requires(key, 'undefined is not a valid key');
- requires(value, 'undefined is not a valid value');
- this._where[key] = AV._encode(value);
- return this;
- },
- /**
- * Helper for condition queries
- * @private
- */
- _addCondition: function _addCondition(key, condition, value) {
- requires(key, 'undefined is not a valid condition key');
- requires(condition, 'undefined is not a valid condition');
- requires(value, 'undefined is not a valid condition value'); // Check if we already have a condition
- if (!this._where[key]) {
- this._where[key] = {};
- }
- this._where[key][condition] = AV._encode(value);
- return this;
- },
- /**
- * Add a constraint to the query that requires a particular
- * <strong>array</strong> key's length to be equal to the provided value.
- * @param {String} key The array key to check.
- * @param {number} value The length value.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- sizeEqualTo: function sizeEqualTo(key, value) {
- this._addCondition(key, '$size', value);
- return this;
- },
- /**
- * Add a constraint to the query that requires a particular key's value to
- * be not equal to the provided value.
- * @param {String} key The key to check.
- * @param value The value that must not be equalled.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- notEqualTo: function notEqualTo(key, value) {
- this._addCondition(key, '$ne', value);
- return this;
- },
- /**
- * Add a constraint to the query that requires a particular key's value to
- * be less than the provided value.
- * @param {String} key The key to check.
- * @param value The value that provides an upper bound.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- lessThan: function lessThan(key, value) {
- this._addCondition(key, '$lt', value);
- return this;
- },
- /**
- * Add a constraint to the query that requires a particular key's value to
- * be greater than the provided value.
- * @param {String} key The key to check.
- * @param value The value that provides an lower bound.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- greaterThan: function greaterThan(key, value) {
- this._addCondition(key, '$gt', value);
- return this;
- },
- /**
- * Add a constraint to the query that requires a particular key's value to
- * be less than or equal to the provided value.
- * @param {String} key The key to check.
- * @param value The value that provides an upper bound.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- lessThanOrEqualTo: function lessThanOrEqualTo(key, value) {
- this._addCondition(key, '$lte', value);
- return this;
- },
- /**
- * Add a constraint to the query that requires a particular key's value to
- * be greater than or equal to the provided value.
- * @param {String} key The key to check.
- * @param value The value that provides an lower bound.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- greaterThanOrEqualTo: function greaterThanOrEqualTo(key, value) {
- this._addCondition(key, '$gte', value);
- return this;
- },
- /**
- * Add a constraint to the query that requires a particular key's value to
- * be contained in the provided list of values.
- * @param {String} key The key to check.
- * @param {Array} values The values that will match.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- containedIn: function containedIn(key, values) {
- this._addCondition(key, '$in', values);
- return this;
- },
- /**
- * Add a constraint to the query that requires a particular key's value to
- * not be contained in the provided list of values.
- * @param {String} key The key to check.
- * @param {Array} values The values that will not match.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- notContainedIn: function notContainedIn(key, values) {
- this._addCondition(key, '$nin', values);
- return this;
- },
- /**
- * Add a constraint to the query that requires a particular key's value to
- * contain each one of the provided list of values.
- * @param {String} key The key to check. This key's value must be an array.
- * @param {Array} values The values that will match.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- containsAll: function containsAll(key, values) {
- this._addCondition(key, '$all', values);
- return this;
- },
- /**
- * Add a constraint for finding objects that contain the given key.
- * @param {String} key The key that should exist.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- exists: function exists(key) {
- this._addCondition(key, '$exists', true);
- return this;
- },
- /**
- * Add a constraint for finding objects that do not contain a given key.
- * @param {String} key The key that should not exist
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- doesNotExist: function doesNotExist(key) {
- this._addCondition(key, '$exists', false);
- return this;
- },
- /**
- * Add a regular expression constraint for finding string values that match
- * the provided regular expression.
- * This may be slow for large datasets.
- * @param {String} key The key that the string to match is stored in.
- * @param {RegExp} regex The regular expression pattern to match.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- matches: function matches(key, regex, modifiers) {
- this._addCondition(key, '$regex', regex);
- if (!modifiers) {
- modifiers = '';
- } // Javascript regex options support mig as inline options but store them
- // as properties of the object. We support mi & should migrate them to
- // modifiers
- if (regex.ignoreCase) {
- modifiers += 'i';
- }
- if (regex.multiline) {
- modifiers += 'm';
- }
- if (modifiers && modifiers.length) {
- this._addCondition(key, '$options', modifiers);
- }
- return this;
- },
- /**
- * Add a constraint that requires that a key's value matches a AV.Query
- * constraint.
- * @param {String} key The key that the contains the object to match the
- * query.
- * @param {AV.Query} query The query that should match.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- matchesQuery: function matchesQuery(key, query) {
- var queryJSON = query._getParams();
- queryJSON.className = query.className;
- this._addCondition(key, '$inQuery', queryJSON);
- return this;
- },
- /**
- * Add a constraint that requires that a key's value not matches a
- * AV.Query constraint.
- * @param {String} key The key that the contains the object to match the
- * query.
- * @param {AV.Query} query The query that should not match.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- doesNotMatchQuery: function doesNotMatchQuery(key, query) {
- var queryJSON = query._getParams();
- queryJSON.className = query.className;
- this._addCondition(key, '$notInQuery', queryJSON);
- return this;
- },
- /**
- * Add a constraint that requires that a key's value matches a value in
- * an object returned by a different AV.Query.
- * @param {String} key The key that contains the value that is being
- * matched.
- * @param {String} queryKey The key in the objects returned by the query to
- * match against.
- * @param {AV.Query} query The query to run.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- matchesKeyInQuery: function matchesKeyInQuery(key, queryKey, query) {
- var queryJSON = query._getParams();
- queryJSON.className = query.className;
- this._addCondition(key, '$select', {
- key: queryKey,
- query: queryJSON
- });
- return this;
- },
- /**
- * Add a constraint that requires that a key's value not match a value in
- * an object returned by a different AV.Query.
- * @param {String} key The key that contains the value that is being
- * excluded.
- * @param {String} queryKey The key in the objects returned by the query to
- * match against.
- * @param {AV.Query} query The query to run.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- doesNotMatchKeyInQuery: function doesNotMatchKeyInQuery(key, queryKey, query) {
- var queryJSON = query._getParams();
- queryJSON.className = query.className;
- this._addCondition(key, '$dontSelect', {
- key: queryKey,
- query: queryJSON
- });
- return this;
- },
- /**
- * Add constraint that at least one of the passed in queries matches.
- * @param {Array} queries
- * @return {AV.Query} Returns the query, so you can chain this call.
- * @private
- */
- _orQuery: function _orQuery(queries) {
- var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
- return q._getParams().where;
- });
- this._where.$or = queryJSON;
- return this;
- },
- /**
- * Add constraint that both of the passed in queries matches.
- * @param {Array} queries
- * @return {AV.Query} Returns the query, so you can chain this call.
- * @private
- */
- _andQuery: function _andQuery(queries) {
- var queryJSON = (0, _map.default)(_).call(_, queries, function (q) {
- return q._getParams().where;
- });
- this._where.$and = queryJSON;
- return this;
- },
- /**
- * Converts a string into a regex that matches it.
- * Surrounding with \Q .. \E does this, we just need to escape \E's in
- * the text separately.
- * @private
- */
- _quote: function _quote(s) {
- return '\\Q' + s.replace('\\E', '\\E\\\\E\\Q') + '\\E';
- },
- /**
- * Add a constraint for finding string values that contain a provided
- * string. This may be slow for large datasets.
- * @param {String} key The key that the string to match is stored in.
- * @param {String} substring The substring that the value must contain.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- contains: function contains(key, value) {
- this._addCondition(key, '$regex', this._quote(value));
- return this;
- },
- /**
- * Add a constraint for finding string values that start with a provided
- * string. This query will use the backend index, so it will be fast even
- * for large datasets.
- * @param {String} key The key that the string to match is stored in.
- * @param {String} prefix The substring that the value must start with.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- startsWith: function startsWith(key, value) {
- this._addCondition(key, '$regex', '^' + this._quote(value));
- return this;
- },
- /**
- * Add a constraint for finding string values that end with a provided
- * string. This will be slow for large datasets.
- * @param {String} key The key that the string to match is stored in.
- * @param {String} suffix The substring that the value must end with.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- endsWith: function endsWith(key, value) {
- this._addCondition(key, '$regex', this._quote(value) + '$');
- return this;
- },
- /**
- * Sorts the results in ascending order by the given key.
- *
- * @param {String} key The key to order by.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- ascending: function ascending(key) {
- requires(key, 'undefined is not a valid key');
- this._order = key;
- return this;
- },
- /**
- * Also sorts the results in ascending order by the given key. The previous sort keys have
- * precedence over this key.
- *
- * @param {String} key The key to order by
- * @return {AV.Query} Returns the query so you can chain this call.
- */
- addAscending: function addAscending(key) {
- requires(key, 'undefined is not a valid key');
- if (this._order) this._order += ',' + key;else this._order = key;
- return this;
- },
- /**
- * Sorts the results in descending order by the given key.
- *
- * @param {String} key The key to order by.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- descending: function descending(key) {
- requires(key, 'undefined is not a valid key');
- this._order = '-' + key;
- return this;
- },
- /**
- * Also sorts the results in descending order by the given key. The previous sort keys have
- * precedence over this key.
- *
- * @param {String} key The key to order by
- * @return {AV.Query} Returns the query so you can chain this call.
- */
- addDescending: function addDescending(key) {
- requires(key, 'undefined is not a valid key');
- if (this._order) this._order += ',-' + key;else this._order = '-' + key;
- return this;
- },
- /**
- * Add a proximity based constraint for finding objects with key point
- * values near the point given.
- * @param {String} key The key that the AV.GeoPoint is stored in.
- * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- near: function near(key, point) {
- if (!(point instanceof AV.GeoPoint)) {
- // Try to cast it to a GeoPoint, so that near("loc", [20,30]) works.
- point = new AV.GeoPoint(point);
- }
- this._addCondition(key, '$nearSphere', point);
- return this;
- },
- /**
- * Add a proximity based constraint for finding objects with key point
- * values near the point given and within the maximum distance given.
- * @param {String} key The key that the AV.GeoPoint is stored in.
- * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
- * @param maxDistance Maximum distance (in radians) of results to return.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- withinRadians: function withinRadians(key, point, distance) {
- this.near(key, point);
- this._addCondition(key, '$maxDistance', distance);
- return this;
- },
- /**
- * Add a proximity based constraint for finding objects with key point
- * values near the point given and within the maximum distance given.
- * Radius of earth used is 3958.8 miles.
- * @param {String} key The key that the AV.GeoPoint is stored in.
- * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
- * @param {Number} maxDistance Maximum distance (in miles) of results to
- * return.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- withinMiles: function withinMiles(key, point, distance) {
- return this.withinRadians(key, point, distance / 3958.8);
- },
- /**
- * Add a proximity based constraint for finding objects with key point
- * values near the point given and within the maximum distance given.
- * Radius of earth used is 6371.0 kilometers.
- * @param {String} key The key that the AV.GeoPoint is stored in.
- * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
- * @param {Number} maxDistance Maximum distance (in kilometers) of results
- * to return.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- withinKilometers: function withinKilometers(key, point, distance) {
- return this.withinRadians(key, point, distance / 6371.0);
- },
- /**
- * Add a constraint to the query that requires a particular key's
- * coordinates be contained within a given rectangular geographic bounding
- * box.
- * @param {String} key The key to be constrained.
- * @param {AV.GeoPoint} southwest
- * The lower-left inclusive corner of the box.
- * @param {AV.GeoPoint} northeast
- * The upper-right inclusive corner of the box.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- withinGeoBox: function withinGeoBox(key, southwest, northeast) {
- if (!(southwest instanceof AV.GeoPoint)) {
- southwest = new AV.GeoPoint(southwest);
- }
- if (!(northeast instanceof AV.GeoPoint)) {
- northeast = new AV.GeoPoint(northeast);
- }
- this._addCondition(key, '$within', {
- $box: [southwest, northeast]
- });
- return this;
- },
- /**
- * Include nested AV.Objects for the provided key. You can use dot
- * notation to specify which fields in the included object are also fetch.
- * @param {String[]} keys The name of the key to include.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- include: function include(keys) {
- var _this4 = this;
- requires(keys, 'undefined is not a valid key');
- _.forEach(arguments, function (keys) {
- var _context;
- _this4._include = (0, _concat.default)(_context = _this4._include).call(_context, ensureArray(keys));
- });
- return this;
- },
- /**
- * Include the ACL.
- * @param {Boolean} [value=true] Whether to include the ACL
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- includeACL: function includeACL() {
- var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
- this._includeACL = value;
- return this;
- },
- /**
- * Restrict the fields of the returned AV.Objects to include only the
- * provided keys. If this is called multiple times, then all of the keys
- * specified in each of the calls will be included.
- * @param {String[]} keys The names of the keys to include.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- select: function select(keys) {
- var _this5 = this;
- requires(keys, 'undefined is not a valid key');
- _.forEach(arguments, function (keys) {
- var _context2;
- _this5._select = (0, _concat.default)(_context2 = _this5._select).call(_context2, ensureArray(keys));
- });
- return this;
- },
- /**
- * Iterates over each result of a query, calling a callback for each one. If
- * the callback returns a promise, the iteration will not continue until
- * that promise has been fulfilled. If the callback returns a rejected
- * promise, then iteration will stop with that error. The items are
- * processed in an unspecified order. The query may not have any sort order,
- * and may not use limit or skip.
- * @param callback {Function} Callback that will be called with each result
- * of the query.
- * @return {Promise} A promise that will be fulfilled once the
- * iteration has completed.
- */
- each: function each(callback) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- if (this._order || this._skip || this._limit >= 0) {
- var error = new Error('Cannot iterate on a query with sort, skip, or limit.');
- return _promise.default.reject(error);
- }
- var query = new AV.Query(this.objectClass); // We can override the batch size from the options.
- // This is undocumented, but useful for testing.
- query._limit = options.batchSize || 100;
- query._where = _.clone(this._where);
- query._include = _.clone(this._include);
- query.ascending('objectId');
- var finished = false;
- return continueWhile(function () {
- return !finished;
- }, function () {
- return (0, _find.default)(query).call(query, options).then(function (results) {
- var callbacksDone = _promise.default.resolve();
- _.each(results, function (result) {
- callbacksDone = callbacksDone.then(function () {
- return callback(result);
- });
- });
- return callbacksDone.then(function () {
- if (results.length >= query._limit) {
- query.greaterThan('objectId', results[results.length - 1].id);
- } else {
- finished = true;
- }
- });
- });
- });
- },
- /**
- * Subscribe the changes of this query.
- *
- * LiveQuery is not included in the default bundle: {@link https://url.leanapp.cn/enable-live-query}.
- *
- * @since 3.0.0
- * @return {AV.LiveQuery} An eventemitter which can be used to get LiveQuery updates;
- */
- subscribe: function subscribe(options) {
- return AV.LiveQuery.init(this, options);
- }
- });
- AV.FriendShipQuery = AV.Query._extend({
- _newObject: function _newObject() {
- var UserClass = AV.Object._getSubclass('_User');
- return new UserClass();
- },
- _processResult: function _processResult(json) {
- if (json && json[this._friendshipTag]) {
- var user = json[this._friendshipTag];
- if (user.__type === 'Pointer' && user.className === '_User') {
- delete user.__type;
- delete user.className;
- }
- return user;
- } else {
- return null;
- }
- }
- });
- };
- /***/ }),
- /* 535 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _keys = _interopRequireDefault(__webpack_require__(55));
- var _ = __webpack_require__(2);
- var EventEmitter = __webpack_require__(224);
- var _require = __webpack_require__(29),
- inherits = _require.inherits;
- var _require2 = __webpack_require__(26),
- request = _require2.request;
- var subscribe = function subscribe(queryJSON, subscriptionId) {
- return request({
- method: 'POST',
- path: '/LiveQuery/subscribe',
- data: {
- query: queryJSON,
- id: subscriptionId
- }
- });
- };
- module.exports = function (AV) {
- var requireRealtime = function requireRealtime() {
- if (!AV._config.realtime) {
- throw new Error('LiveQuery not supported. Please use the LiveQuery bundle. https://url.leanapp.cn/enable-live-query');
- }
- };
- /**
- * @class
- * A LiveQuery, created by {@link AV.Query#subscribe} is an EventEmitter notifies changes of the Query.
- * @since 3.0.0
- */
- AV.LiveQuery = inherits(EventEmitter,
- /** @lends AV.LiveQuery.prototype */
- {
- constructor: function constructor(id, client, queryJSON, subscriptionId) {
- var _this = this;
- EventEmitter.apply(this);
- this.id = id;
- this._client = client;
- this._client.register(this);
- this._queryJSON = queryJSON;
- this._subscriptionId = subscriptionId;
- this._onMessage = this._dispatch.bind(this);
- this._onReconnect = function () {
- subscribe(_this._queryJSON, _this._subscriptionId).catch(function (error) {
- return console.error("LiveQuery resubscribe error: ".concat(error.message));
- });
- };
- client.on('message', this._onMessage);
- client.on('reconnect', this._onReconnect);
- },
- _dispatch: function _dispatch(message) {
- var _this2 = this;
- message.forEach(function (_ref) {
- var op = _ref.op,
- object = _ref.object,
- queryId = _ref.query_id,
- updatedKeys = _ref.updatedKeys;
- if (queryId !== _this2.id) return;
- var target = AV.parseJSON(_.extend({
- __type: object.className === '_File' ? 'File' : 'Object'
- }, object));
- if (updatedKeys) {
- /**
- * An existing AV.Object which fulfills the Query you subscribe is updated.
- * @event AV.LiveQuery#update
- * @param {AV.Object|AV.File} target updated object
- * @param {String[]} updatedKeys updated keys
- */
- /**
- * An existing AV.Object which doesn't fulfill the Query is updated and now it fulfills the Query.
- * @event AV.LiveQuery#enter
- * @param {AV.Object|AV.File} target updated object
- * @param {String[]} updatedKeys updated keys
- */
- /**
- * An existing AV.Object which fulfills the Query is updated and now it doesn't fulfill the Query.
- * @event AV.LiveQuery#leave
- * @param {AV.Object|AV.File} target updated object
- * @param {String[]} updatedKeys updated keys
- */
- _this2.emit(op, target, updatedKeys);
- } else {
- /**
- * A new AV.Object which fulfills the Query you subscribe is created.
- * @event AV.LiveQuery#create
- * @param {AV.Object|AV.File} target updated object
- */
- /**
- * An existing AV.Object which fulfills the Query you subscribe is deleted.
- * @event AV.LiveQuery#delete
- * @param {AV.Object|AV.File} target updated object
- */
- _this2.emit(op, target);
- }
- });
- },
- /**
- * unsubscribe the query
- *
- * @return {Promise}
- */
- unsubscribe: function unsubscribe() {
- var client = this._client;
- client.off('message', this._onMessage);
- client.off('reconnect', this._onReconnect);
- client.deregister(this);
- return request({
- method: 'POST',
- path: '/LiveQuery/unsubscribe',
- data: {
- id: client.id,
- query_id: this.id
- }
- });
- }
- },
- /** @lends AV.LiveQuery */
- {
- init: function init(query) {
- var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- _ref2$subscriptionId = _ref2.subscriptionId,
- userDefinedSubscriptionId = _ref2$subscriptionId === void 0 ? AV._getSubscriptionId() : _ref2$subscriptionId;
- requireRealtime();
- if (!(query instanceof AV.Query)) throw new TypeError('LiveQuery must be inited with a Query');
- return _promise.default.resolve(userDefinedSubscriptionId).then(function (subscriptionId) {
- return AV._config.realtime.createLiveQueryClient(subscriptionId).then(function (liveQueryClient) {
- var _query$_getParams = query._getParams(),
- where = _query$_getParams.where,
- keys = (0, _keys.default)(_query$_getParams),
- returnACL = _query$_getParams.returnACL;
- var queryJSON = {
- where: where,
- keys: keys,
- returnACL: returnACL,
- className: query.className
- };
- var promise = subscribe(queryJSON, subscriptionId).then(function (_ref3) {
- var queryId = _ref3.query_id;
- return new AV.LiveQuery(queryId, liveQueryClient, queryJSON, subscriptionId);
- }).finally(function () {
- liveQueryClient.deregister(promise);
- });
- liveQueryClient.register(promise);
- return promise;
- });
- });
- },
- /**
- * Pause the LiveQuery connection. This is useful to deactivate the SDK when the app is swtiched to background.
- * @static
- * @return void
- */
- pause: function pause() {
- requireRealtime();
- return AV._config.realtime.pause();
- },
- /**
- * Resume the LiveQuery connection. All subscriptions will be restored after reconnection.
- * @static
- * @return void
- */
- resume: function resume() {
- requireRealtime();
- return AV._config.realtime.resume();
- }
- });
- };
- /***/ }),
- /* 536 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _ = __webpack_require__(2);
- var _require = __webpack_require__(29),
- tap = _require.tap;
- module.exports = function (AV) {
- /**
- * @class
- * @example
- * AV.Captcha.request().then(captcha => {
- * captcha.bind({
- * textInput: 'code', // the id for textInput
- * image: 'captcha',
- * verifyButton: 'verify',
- * }, {
- * success: (validateCode) => {}, // next step
- * error: (error) => {}, // present error.message to user
- * });
- * });
- */
- AV.Captcha = function Captcha(options, authOptions) {
- this._options = options;
- this._authOptions = authOptions;
- /**
- * The image url of the captcha
- * @type string
- */
- this.url = undefined;
- /**
- * The captchaToken of the captcha.
- * @type string
- */
- this.captchaToken = undefined;
- /**
- * The validateToken of the captcha.
- * @type string
- */
- this.validateToken = undefined;
- };
- /**
- * Refresh the captcha
- * @return {Promise.<string>} a new capcha url
- */
- AV.Captcha.prototype.refresh = function refresh() {
- var _this = this;
- return AV.Cloud._requestCaptcha(this._options, this._authOptions).then(function (_ref) {
- var captchaToken = _ref.captchaToken,
- url = _ref.url;
- _.extend(_this, {
- captchaToken: captchaToken,
- url: url
- });
- return url;
- });
- };
- /**
- * Verify the captcha
- * @param {String} code The code from user input
- * @return {Promise.<string>} validateToken if the code is valid
- */
- AV.Captcha.prototype.verify = function verify(code) {
- var _this2 = this;
- return AV.Cloud.verifyCaptcha(code, this.captchaToken).then(tap(function (validateToken) {
- return _this2.validateToken = validateToken;
- }));
- };
- if (false) {
- /**
- * Bind the captcha to HTMLElements. <b>ONLY AVAILABLE in browsers</b>.
- * @param [elements]
- * @param {String|HTMLInputElement} [elements.textInput] An input element typed text, or the id for the element.
- * @param {String|HTMLImageElement} [elements.image] An image element, or the id for the element.
- * @param {String|HTMLElement} [elements.verifyButton] A button element, or the id for the element.
- * @param [callbacks]
- * @param {Function} [callbacks.success] Success callback will be called if the code is verified. The param `validateCode` can be used for further SMS request.
- * @param {Function} [callbacks.error] Error callback will be called if something goes wrong, detailed in param `error.message`.
- */
- AV.Captcha.prototype.bind = function bind(_ref2, _ref3) {
- var _this3 = this;
- var textInput = _ref2.textInput,
- image = _ref2.image,
- verifyButton = _ref2.verifyButton;
- var success = _ref3.success,
- error = _ref3.error;
- if (typeof textInput === 'string') {
- textInput = document.getElementById(textInput);
- if (!textInput) throw new Error("textInput with id ".concat(textInput, " not found"));
- }
- if (typeof image === 'string') {
- image = document.getElementById(image);
- if (!image) throw new Error("image with id ".concat(image, " not found"));
- }
- if (typeof verifyButton === 'string') {
- verifyButton = document.getElementById(verifyButton);
- if (!verifyButton) throw new Error("verifyButton with id ".concat(verifyButton, " not found"));
- }
- this.__refresh = function () {
- return _this3.refresh().then(function (url) {
- image.src = url;
- if (textInput) {
- textInput.value = '';
- textInput.focus();
- }
- }).catch(function (err) {
- return console.warn("refresh captcha fail: ".concat(err.message));
- });
- };
- if (image) {
- this.__image = image;
- image.src = this.url;
- image.addEventListener('click', this.__refresh);
- }
- this.__verify = function () {
- var code = textInput.value;
- _this3.verify(code).catch(function (err) {
- _this3.__refresh();
- throw err;
- }).then(success, error).catch(function (err) {
- return console.warn("verify captcha fail: ".concat(err.message));
- });
- };
- if (textInput && verifyButton) {
- this.__verifyButton = verifyButton;
- verifyButton.addEventListener('click', this.__verify);
- }
- };
- /**
- * unbind the captcha from HTMLElements. <b>ONLY AVAILABLE in browsers</b>.
- */
- AV.Captcha.prototype.unbind = function unbind() {
- if (this.__image) this.__image.removeEventListener('click', this.__refresh);
- if (this.__verifyButton) this.__verifyButton.removeEventListener('click', this.__verify);
- };
- }
- /**
- * Request a captcha
- * @param [options]
- * @param {Number} [options.width] width(px) of the captcha, ranged 60-200
- * @param {Number} [options.height] height(px) of the captcha, ranged 30-100
- * @param {Number} [options.size=4] length of the captcha, ranged 3-6. MasterKey required.
- * @param {Number} [options.ttl=60] time to live(s), ranged 10-180. MasterKey required.
- * @return {Promise.<AV.Captcha>}
- */
- AV.Captcha.request = function (options, authOptions) {
- var captcha = new AV.Captcha(options, authOptions);
- return captcha.refresh().then(function () {
- return captcha;
- });
- };
- };
- /***/ }),
- /* 537 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _ = __webpack_require__(2);
- var _require = __webpack_require__(26),
- _request = _require._request,
- request = _require.request;
- module.exports = function (AV) {
- /**
- * Contains functions for calling and declaring
- * <p><strong><em>
- * Some functions are only available from Cloud Code.
- * </em></strong></p>
- *
- * @namespace
- * @borrows AV.Captcha.request as requestCaptcha
- */
- AV.Cloud = AV.Cloud || {};
- _.extend(AV.Cloud,
- /** @lends AV.Cloud */
- {
- /**
- * Makes a call to a cloud function.
- * @param {String} name The function name.
- * @param {Object} [data] The parameters to send to the cloud function.
- * @param {AuthOptions} [options]
- * @return {Promise} A promise that will be resolved with the result
- * of the function.
- */
- run: function run(name, data, options) {
- return request({
- service: 'engine',
- method: 'POST',
- path: "/functions/".concat(name),
- data: AV._encode(data, null, true),
- authOptions: options
- }).then(function (resp) {
- return AV._decode(resp).result;
- });
- },
- /**
- * Makes a call to a cloud function, you can send {AV.Object} as param or a field of param; the response
- * from server will also be parsed as an {AV.Object}, array of {AV.Object}, or object includes {AV.Object}
- * @param {String} name The function name.
- * @param {Object} [data] The parameters to send to the cloud function.
- * @param {AuthOptions} [options]
- * @return {Promise} A promise that will be resolved with the result of the function.
- */
- rpc: function rpc(name, data, options) {
- if (_.isArray(data)) {
- return _promise.default.reject(new Error("Can't pass Array as the param of rpc function in JavaScript SDK."));
- }
- return request({
- service: 'engine',
- method: 'POST',
- path: "/call/".concat(name),
- data: AV._encodeObjectOrArray(data),
- authOptions: options
- }).then(function (resp) {
- return AV._decode(resp).result;
- });
- },
- /**
- * Make a call to request server date time.
- * @return {Promise.<Date>} A promise that will be resolved with the result
- * of the function.
- * @since 0.5.9
- */
- getServerDate: function getServerDate() {
- return _request('date', null, null, 'GET').then(function (resp) {
- return AV._decode(resp);
- });
- },
- /**
- * Makes a call to request an sms code for operation verification.
- * @param {String|Object} data The mobile phone number string or a JSON
- * object that contains mobilePhoneNumber,template,sign,op,ttl,name etc.
- * @param {String} data.mobilePhoneNumber
- * @param {String} [data.template] sms template name
- * @param {String} [data.sign] sms signature name
- * @param {String} [data.smsType] sending code by `sms` (default) or `voice` call
- * @param {SMSAuthOptions} [options]
- * @return {Promise} A promise that will be resolved if the request succeed
- */
- requestSmsCode: function requestSmsCode(data) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- if (_.isString(data)) {
- data = {
- mobilePhoneNumber: data
- };
- }
- if (!data.mobilePhoneNumber) {
- throw new Error('Missing mobilePhoneNumber.');
- }
- if (options.validateToken) {
- data = _.extend({}, data, {
- validate_token: options.validateToken
- });
- }
- return _request('requestSmsCode', null, null, 'POST', data, options);
- },
- /**
- * Makes a call to verify sms code that sent by AV.Cloud.requestSmsCode
- * @param {String} code The sms code sent by AV.Cloud.requestSmsCode
- * @param {phone} phone The mobile phoner number.
- * @return {Promise} A promise that will be resolved with the result
- * of the function.
- */
- verifySmsCode: function verifySmsCode(code, phone) {
- if (!code) throw new Error('Missing sms code.');
- var params = {};
- if (_.isString(phone)) {
- params['mobilePhoneNumber'] = phone;
- }
- return _request('verifySmsCode', code, null, 'POST', params);
- },
- _requestCaptcha: function _requestCaptcha(options, authOptions) {
- return _request('requestCaptcha', null, null, 'GET', options, authOptions).then(function (_ref) {
- var url = _ref.captcha_url,
- captchaToken = _ref.captcha_token;
- return {
- captchaToken: captchaToken,
- url: url
- };
- });
- },
- /**
- * Request a captcha.
- */
- requestCaptcha: AV.Captcha.request,
- /**
- * Verify captcha code. This is the low-level API for captcha.
- * Checkout {@link AV.Captcha} for high abstract APIs.
- * @param {String} code the code from user input
- * @param {String} captchaToken captchaToken returned by {@link AV.Cloud.requestCaptcha}
- * @return {Promise.<String>} validateToken if the code is valid
- */
- verifyCaptcha: function verifyCaptcha(code, captchaToken) {
- return _request('verifyCaptcha', null, null, 'POST', {
- captcha_code: code,
- captcha_token: captchaToken
- }).then(function (_ref2) {
- var validateToken = _ref2.validate_token;
- return validateToken;
- });
- }
- });
- };
- /***/ }),
- /* 538 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var request = __webpack_require__(26).request;
- module.exports = function (AV) {
- AV.Installation = AV.Object.extend('_Installation');
- /**
- * @namespace
- */
- AV.Push = AV.Push || {};
- /**
- * Sends a push notification.
- * @param {Object} data The data of the push notification.
- * @param {String[]} [data.channels] An Array of channels to push to.
- * @param {Date} [data.push_time] A Date object for when to send the push.
- * @param {Date} [data.expiration_time] A Date object for when to expire
- * the push.
- * @param {Number} [data.expiration_interval] The seconds from now to expire the push.
- * @param {Number} [data.flow_control] The clients to notify per second
- * @param {AV.Query} [data.where] An AV.Query over AV.Installation that is used to match
- * a set of installations to push to.
- * @param {String} [data.cql] A CQL statement over AV.Installation that is used to match
- * a set of installations to push to.
- * @param {Object} data.data The data to send as part of the push.
- More details: https://url.leanapp.cn/pushData
- * @param {AuthOptions} [options]
- * @return {Promise}
- */
- AV.Push.send = function (data, options) {
- if (data.where) {
- data.where = data.where._getParams().where;
- }
- if (data.where && data.cql) {
- throw new Error("Both where and cql can't be set");
- }
- if (data.push_time) {
- data.push_time = data.push_time.toJSON();
- }
- if (data.expiration_time) {
- data.expiration_time = data.expiration_time.toJSON();
- }
- if (data.expiration_time && data.expiration_interval) {
- throw new Error("Both expiration_time and expiration_interval can't be set");
- }
- return request({
- service: 'push',
- method: 'POST',
- path: '/push',
- data: data,
- authOptions: options
- });
- };
- };
- /***/ }),
- /* 539 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _typeof2 = _interopRequireDefault(__webpack_require__(109));
- var _ = __webpack_require__(2);
- var AVRequest = __webpack_require__(26)._request;
- var _require = __webpack_require__(29),
- getSessionToken = _require.getSessionToken;
- module.exports = function (AV) {
- var getUser = function getUser() {
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var sessionToken = getSessionToken(options);
- if (sessionToken) {
- return AV.User._fetchUserBySessionToken(getSessionToken(options));
- }
- return AV.User.currentAsync();
- };
- var getUserPointer = function getUserPointer(options) {
- return getUser(options).then(function (currUser) {
- return AV.Object.createWithoutData('_User', currUser.id)._toPointer();
- });
- };
- /**
- * Contains functions to deal with Status in LeanCloud.
- * @class
- */
- AV.Status = function (imageUrl, message) {
- this.data = {};
- this.inboxType = 'default';
- this.query = null;
- if (imageUrl && (0, _typeof2.default)(imageUrl) === 'object') {
- this.data = imageUrl;
- } else {
- if (imageUrl) {
- this.data.image = imageUrl;
- }
- if (message) {
- this.data.message = message;
- }
- }
- return this;
- };
- _.extend(AV.Status.prototype,
- /** @lends AV.Status.prototype */
- {
- /**
- * Gets the value of an attribute in status data.
- * @param {String} attr The string name of an attribute.
- */
- get: function get(attr) {
- return this.data[attr];
- },
- /**
- * Sets a hash of model attributes on the status data.
- * @param {String} key The key to set.
- * @param {any} value The value to give it.
- */
- set: function set(key, value) {
- this.data[key] = value;
- return this;
- },
- /**
- * Destroy this status,then it will not be avaiable in other user's inboxes.
- * @param {AuthOptions} options
- * @return {Promise} A promise that is fulfilled when the destroy
- * completes.
- */
- destroy: function destroy(options) {
- if (!this.id) return _promise.default.reject(new Error('The status id is not exists.'));
- var request = AVRequest('statuses', null, this.id, 'DELETE', options);
- return request;
- },
- /**
- * Cast the AV.Status object to an AV.Object pointer.
- * @return {AV.Object} A AV.Object pointer.
- */
- toObject: function toObject() {
- if (!this.id) return null;
- return AV.Object.createWithoutData('_Status', this.id);
- },
- _getDataJSON: function _getDataJSON() {
- var json = _.clone(this.data);
- return AV._encode(json);
- },
- /**
- * Send a status by a AV.Query object.
- * @since 0.3.0
- * @param {AuthOptions} options
- * @return {Promise} A promise that is fulfilled when the send
- * completes.
- * @example
- * // send a status to male users
- * var status = new AVStatus('image url', 'a message');
- * status.query = new AV.Query('_User');
- * status.query.equalTo('gender', 'male');
- * status.send().then(function(){
- * //send status successfully.
- * }, function(err){
- * //an error threw.
- * console.dir(err);
- * });
- */
- send: function send() {
- var _this = this;
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- if (!getSessionToken(options) && !AV.User.current()) {
- throw new Error('Please signin an user.');
- }
- if (!this.query) {
- return AV.Status.sendStatusToFollowers(this, options);
- }
- return getUserPointer(options).then(function (currUser) {
- var query = _this.query._getParams();
- query.className = _this.query.className;
- var data = {};
- data.query = query;
- _this.data = _this.data || {};
- _this.data.source = _this.data.source || currUser;
- data.data = _this._getDataJSON();
- data.inboxType = _this.inboxType || 'default';
- return AVRequest('statuses', null, null, 'POST', data, options);
- }).then(function (response) {
- _this.id = response.objectId;
- _this.createdAt = AV._parseDate(response.createdAt);
- return _this;
- });
- },
- _finishFetch: function _finishFetch(serverData) {
- this.id = serverData.objectId;
- this.createdAt = AV._parseDate(serverData.createdAt);
- this.updatedAt = AV._parseDate(serverData.updatedAt);
- this.messageId = serverData.messageId;
- delete serverData.messageId;
- delete serverData.objectId;
- delete serverData.createdAt;
- delete serverData.updatedAt;
- this.data = AV._decode(serverData);
- }
- });
- /**
- * Send a status to current signined user's followers.
- * @since 0.3.0
- * @param {AV.Status} status A status object to be send to followers.
- * @param {AuthOptions} options
- * @return {Promise} A promise that is fulfilled when the send
- * completes.
- * @example
- * var status = new AVStatus('image url', 'a message');
- * AV.Status.sendStatusToFollowers(status).then(function(){
- * //send status successfully.
- * }, function(err){
- * //an error threw.
- * console.dir(err);
- * });
- */
- AV.Status.sendStatusToFollowers = function (status) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- if (!getSessionToken(options) && !AV.User.current()) {
- throw new Error('Please signin an user.');
- }
- return getUserPointer(options).then(function (currUser) {
- var query = {};
- query.className = '_Follower';
- query.keys = 'follower';
- query.where = {
- user: currUser
- };
- var data = {};
- data.query = query;
- status.data = status.data || {};
- status.data.source = status.data.source || currUser;
- data.data = status._getDataJSON();
- data.inboxType = status.inboxType || 'default';
- var request = AVRequest('statuses', null, null, 'POST', data, options);
- return request.then(function (response) {
- status.id = response.objectId;
- status.createdAt = AV._parseDate(response.createdAt);
- return status;
- });
- });
- };
- /**
- * <p>Send a status from current signined user to other user's private status inbox.</p>
- * @since 0.3.0
- * @param {AV.Status} status A status object to be send to followers.
- * @param {String} target The target user or user's objectId.
- * @param {AuthOptions} options
- * @return {Promise} A promise that is fulfilled when the send
- * completes.
- * @example
- * // send a private status to user '52e84e47e4b0f8de283b079b'
- * var status = new AVStatus('image url', 'a message');
- * AV.Status.sendPrivateStatus(status, '52e84e47e4b0f8de283b079b').then(function(){
- * //send status successfully.
- * }, function(err){
- * //an error threw.
- * console.dir(err);
- * });
- */
- AV.Status.sendPrivateStatus = function (status, target) {
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- if (!getSessionToken(options) && !AV.User.current()) {
- throw new Error('Please signin an user.');
- }
- if (!target) {
- throw new Error('Invalid target user.');
- }
- var userObjectId = _.isString(target) ? target : target.id;
- if (!userObjectId) {
- throw new Error('Invalid target user.');
- }
- return getUserPointer(options).then(function (currUser) {
- var query = {};
- query.className = '_User';
- query.where = {
- objectId: userObjectId
- };
- var data = {};
- data.query = query;
- status.data = status.data || {};
- status.data.source = status.data.source || currUser;
- data.data = status._getDataJSON();
- data.inboxType = 'private';
- status.inboxType = 'private';
- var request = AVRequest('statuses', null, null, 'POST', data, options);
- return request.then(function (response) {
- status.id = response.objectId;
- status.createdAt = AV._parseDate(response.createdAt);
- return status;
- });
- });
- };
- /**
- * Count unread statuses in someone's inbox.
- * @since 0.3.0
- * @param {AV.User} owner The status owner.
- * @param {String} inboxType The inbox type, 'default' by default.
- * @param {AuthOptions} options
- * @return {Promise} A promise that is fulfilled when the count
- * completes.
- * @example
- * AV.Status.countUnreadStatuses(AV.User.current()).then(function(response){
- * console.log(response.unread); //unread statuses number.
- * console.log(response.total); //total statuses number.
- * });
- */
- AV.Status.countUnreadStatuses = function (owner) {
- var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- if (!_.isString(inboxType)) options = inboxType;
- if (!getSessionToken(options) && owner == null && !AV.User.current()) {
- throw new Error('Please signin an user or pass the owner objectId.');
- }
- return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
- var params = {};
- params.inboxType = AV._encode(inboxType);
- params.owner = AV._encode(owner);
- return AVRequest('subscribe/statuses/count', null, null, 'GET', params, options);
- });
- };
- /**
- * reset unread statuses count in someone's inbox.
- * @since 2.1.0
- * @param {AV.User} owner The status owner.
- * @param {String} inboxType The inbox type, 'default' by default.
- * @param {AuthOptions} options
- * @return {Promise} A promise that is fulfilled when the reset
- * completes.
- * @example
- * AV.Status.resetUnreadCount(AV.User.current()).then(function(response){
- * console.log(response.unread); //unread statuses number.
- * console.log(response.total); //total statuses number.
- * });
- */
- AV.Status.resetUnreadCount = function (owner) {
- var inboxType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- if (!_.isString(inboxType)) options = inboxType;
- if (!getSessionToken(options) && owner == null && !AV.User.current()) {
- throw new Error('Please signin an user or pass the owner objectId.');
- }
- return _promise.default.resolve(owner || getUser(options)).then(function (owner) {
- var params = {};
- params.inboxType = AV._encode(inboxType);
- params.owner = AV._encode(owner);
- return AVRequest('subscribe/statuses/resetUnreadCount', null, null, 'POST', params, options);
- });
- };
- /**
- * Create a status query to find someone's published statuses.
- * @since 0.3.0
- * @param {AV.User} source The status source, typically the publisher.
- * @return {AV.Query} The query object for status.
- * @example
- * //Find current user's published statuses.
- * var query = AV.Status.statusQuery(AV.User.current());
- * query.find().then(function(statuses){
- * //process statuses
- * });
- */
- AV.Status.statusQuery = function (source) {
- var query = new AV.Query('_Status');
- if (source) {
- query.equalTo('source', source);
- }
- return query;
- };
- /**
- * <p>AV.InboxQuery defines a query that is used to fetch somebody's inbox statuses.</p>
- * @class
- */
- AV.InboxQuery = AV.Query._extend(
- /** @lends AV.InboxQuery.prototype */
- {
- _objectClass: AV.Status,
- _sinceId: 0,
- _maxId: 0,
- _inboxType: 'default',
- _owner: null,
- _newObject: function _newObject() {
- return new AV.Status();
- },
- _createRequest: function _createRequest(params, options) {
- return AV.InboxQuery.__super__._createRequest.call(this, params, options, '/subscribe/statuses');
- },
- /**
- * Sets the messageId of results to skip before returning any results.
- * This is useful for pagination.
- * Default is zero.
- * @param {Number} n the mesage id.
- * @return {AV.InboxQuery} Returns the query, so you can chain this call.
- */
- sinceId: function sinceId(id) {
- this._sinceId = id;
- return this;
- },
- /**
- * Sets the maximal messageId of results。
- * This is useful for pagination.
- * Default is zero that is no limition.
- * @param {Number} n the mesage id.
- * @return {AV.InboxQuery} Returns the query, so you can chain this call.
- */
- maxId: function maxId(id) {
- this._maxId = id;
- return this;
- },
- /**
- * Sets the owner of the querying inbox.
- * @param {AV.User} owner The inbox owner.
- * @return {AV.InboxQuery} Returns the query, so you can chain this call.
- */
- owner: function owner(_owner) {
- this._owner = _owner;
- return this;
- },
- /**
- * Sets the querying inbox type.default is 'default'.
- * @param {String} type The inbox type.
- * @return {AV.InboxQuery} Returns the query, so you can chain this call.
- */
- inboxType: function inboxType(type) {
- this._inboxType = type;
- return this;
- },
- _getParams: function _getParams() {
- var params = AV.InboxQuery.__super__._getParams.call(this);
- params.owner = AV._encode(this._owner);
- params.inboxType = AV._encode(this._inboxType);
- params.sinceId = AV._encode(this._sinceId);
- params.maxId = AV._encode(this._maxId);
- return params;
- }
- });
- /**
- * Create a inbox status query to find someone's inbox statuses.
- * @since 0.3.0
- * @param {AV.User} owner The inbox's owner
- * @param {String} inboxType The inbox type,'default' by default.
- * @return {AV.InboxQuery} The inbox query object.
- * @see AV.InboxQuery
- * @example
- * //Find current user's default inbox statuses.
- * var query = AV.Status.inboxQuery(AV.User.current());
- * //find the statuses after the last message id
- * query.sinceId(lastMessageId);
- * query.find().then(function(statuses){
- * //process statuses
- * });
- */
- AV.Status.inboxQuery = function (owner, inboxType) {
- var query = new AV.InboxQuery(AV.Status);
- if (owner) {
- query._owner = owner;
- }
- if (inboxType) {
- query._inboxType = inboxType;
- }
- return query;
- };
- };
- /***/ }),
- /* 540 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _stringify = _interopRequireDefault(__webpack_require__(36));
- var _map = _interopRequireDefault(__webpack_require__(42));
- var _ = __webpack_require__(2);
- var AVRequest = __webpack_require__(26)._request;
- module.exports = function (AV) {
- /**
- * A builder to generate sort string for app searching.For example:
- * @class
- * @since 0.5.1
- * @example
- * var builder = new AV.SearchSortBuilder();
- * builder.ascending('key1').descending('key2','max');
- * var query = new AV.SearchQuery('Player');
- * query.sortBy(builder);
- * query.find().then();
- */
- AV.SearchSortBuilder = function () {
- this._sortFields = [];
- };
- _.extend(AV.SearchSortBuilder.prototype,
- /** @lends AV.SearchSortBuilder.prototype */
- {
- _addField: function _addField(key, order, mode, missing) {
- var field = {};
- field[key] = {
- order: order || 'asc',
- mode: mode || 'avg',
- missing: '_' + (missing || 'last')
- };
- this._sortFields.push(field);
- return this;
- },
- /**
- * Sorts the results in ascending order by the given key and options.
- *
- * @param {String} key The key to order by.
- * @param {String} mode The sort mode, default is 'avg', you can choose
- * 'max' or 'min' too.
- * @param {String} missing The missing key behaviour, default is 'last',
- * you can choose 'first' too.
- * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
- */
- ascending: function ascending(key, mode, missing) {
- return this._addField(key, 'asc', mode, missing);
- },
- /**
- * Sorts the results in descending order by the given key and options.
- *
- * @param {String} key The key to order by.
- * @param {String} mode The sort mode, default is 'avg', you can choose
- * 'max' or 'min' too.
- * @param {String} missing The missing key behaviour, default is 'last',
- * you can choose 'first' too.
- * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
- */
- descending: function descending(key, mode, missing) {
- return this._addField(key, 'desc', mode, missing);
- },
- /**
- * Add a proximity based constraint for finding objects with key point
- * values near the point given.
- * @param {String} key The key that the AV.GeoPoint is stored in.
- * @param {AV.GeoPoint} point The reference AV.GeoPoint that is used.
- * @param {Object} options The other options such as mode,order, unit etc.
- * @return {AV.SearchSortBuilder} Returns the builder, so you can chain this call.
- */
- whereNear: function whereNear(key, point, options) {
- options = options || {};
- var field = {};
- var geo = {
- lat: point.latitude,
- lon: point.longitude
- };
- var m = {
- order: options.order || 'asc',
- mode: options.mode || 'avg',
- unit: options.unit || 'km'
- };
- m[key] = geo;
- field['_geo_distance'] = m;
- this._sortFields.push(field);
- return this;
- },
- /**
- * Build a sort string by configuration.
- * @return {String} the sort string.
- */
- build: function build() {
- return (0, _stringify.default)(AV._encode(this._sortFields));
- }
- });
- /**
- * App searching query.Use just like AV.Query:
- *
- * Visit <a href='https://leancloud.cn/docs/app_search_guide.html'>App Searching Guide</a>
- * for more details.
- * @class
- * @since 0.5.1
- * @example
- * var query = new AV.SearchQuery('Player');
- * query.queryString('*');
- * query.find().then(function(results) {
- * console.log('Found %d objects', query.hits());
- * //Process results
- * });
- */
- AV.SearchQuery = AV.Query._extend(
- /** @lends AV.SearchQuery.prototype */
- {
- _sid: null,
- _hits: 0,
- _queryString: null,
- _highlights: null,
- _sortBuilder: null,
- _clazz: null,
- constructor: function constructor(className) {
- if (className) {
- this._clazz = className;
- } else {
- className = '__INVALID_CLASS';
- }
- AV.Query.call(this, className);
- },
- _createRequest: function _createRequest(params, options) {
- return AVRequest('search/select', null, null, 'GET', params || this._getParams(), options);
- },
- /**
- * Sets the sid of app searching query.Default is null.
- * @param {String} sid Scroll id for searching.
- * @return {AV.SearchQuery} Returns the query, so you can chain this call.
- */
- sid: function sid(_sid) {
- this._sid = _sid;
- return this;
- },
- /**
- * Sets the query string of app searching.
- * @param {String} q The query string.
- * @return {AV.SearchQuery} Returns the query, so you can chain this call.
- */
- queryString: function queryString(q) {
- this._queryString = q;
- return this;
- },
- /**
- * Sets the highlight fields. Such as
- * <pre><code>
- * query.highlights('title');
- * //or pass an array.
- * query.highlights(['title', 'content'])
- * </code></pre>
- * @param {String|String[]} highlights a list of fields.
- * @return {AV.SearchQuery} Returns the query, so you can chain this call.
- */
- highlights: function highlights(_highlights) {
- var objects;
- if (_highlights && _.isString(_highlights)) {
- objects = _.toArray(arguments);
- } else {
- objects = _highlights;
- }
- this._highlights = objects;
- return this;
- },
- /**
- * Sets the sort builder for this query.
- * @see AV.SearchSortBuilder
- * @param { AV.SearchSortBuilder} builder The sort builder.
- * @return {AV.SearchQuery} Returns the query, so you can chain this call.
- *
- */
- sortBy: function sortBy(builder) {
- this._sortBuilder = builder;
- return this;
- },
- /**
- * Returns the number of objects that match this query.
- * @return {Number}
- */
- hits: function hits() {
- if (!this._hits) {
- this._hits = 0;
- }
- return this._hits;
- },
- _processResult: function _processResult(json) {
- delete json['className'];
- delete json['_app_url'];
- delete json['_deeplink'];
- return json;
- },
- /**
- * Returns true when there are more documents can be retrieved by this
- * query instance, you can call find function to get more results.
- * @see AV.SearchQuery#find
- * @return {Boolean}
- */
- hasMore: function hasMore() {
- return !this._hitEnd;
- },
- /**
- * Reset current query instance state(such as sid, hits etc) except params
- * for a new searching. After resetting, hasMore() will return true.
- */
- reset: function reset() {
- this._hitEnd = false;
- this._sid = null;
- this._hits = 0;
- },
- /**
- * Retrieves a list of AVObjects that satisfy this query.
- * Either options.success or options.error is called when the find
- * completes.
- *
- * @see AV.Query#find
- * @param {AuthOptions} options
- * @return {Promise} A promise that is resolved with the results when
- * the query completes.
- */
- find: function find(options) {
- var self = this;
- var request = this._createRequest(undefined, options);
- return request.then(function (response) {
- //update sid for next querying.
- if (response.sid) {
- self._oldSid = self._sid;
- self._sid = response.sid;
- } else {
- self._sid = null;
- self._hitEnd = true;
- }
- self._hits = response.hits || 0;
- return (0, _map.default)(_).call(_, response.results, function (json) {
- if (json.className) {
- response.className = json.className;
- }
- var obj = self._newObject(response);
- obj.appURL = json['_app_url'];
- obj._finishFetch(self._processResult(json), true);
- return obj;
- });
- });
- },
- _getParams: function _getParams() {
- var params = AV.SearchQuery.__super__._getParams.call(this);
- delete params.where;
- if (this._clazz) {
- params.clazz = this.className;
- }
- if (this._sid) {
- params.sid = this._sid;
- }
- if (!this._queryString) {
- throw new Error('Please set query string.');
- } else {
- params.q = this._queryString;
- }
- if (this._highlights) {
- params.highlights = this._highlights.join(',');
- }
- if (this._sortBuilder && params.order) {
- throw new Error('sort and order can not be set at same time.');
- }
- if (this._sortBuilder) {
- params.sort = this._sortBuilder.build();
- }
- return params;
- }
- });
- };
- /**
- * Sorts the results in ascending order by the given key.
- *
- * @method AV.SearchQuery#ascending
- * @param {String} key The key to order by.
- * @return {AV.SearchQuery} Returns the query, so you can chain this call.
- */
- /**
- * Also sorts the results in ascending order by the given key. The previous sort keys have
- * precedence over this key.
- *
- * @method AV.SearchQuery#addAscending
- * @param {String} key The key to order by
- * @return {AV.SearchQuery} Returns the query so you can chain this call.
- */
- /**
- * Sorts the results in descending order by the given key.
- *
- * @method AV.SearchQuery#descending
- * @param {String} key The key to order by.
- * @return {AV.SearchQuery} Returns the query, so you can chain this call.
- */
- /**
- * Also sorts the results in descending order by the given key. The previous sort keys have
- * precedence over this key.
- *
- * @method AV.SearchQuery#addDescending
- * @param {String} key The key to order by
- * @return {AV.SearchQuery} Returns the query so you can chain this call.
- */
- /**
- * Include nested AV.Objects for the provided key. You can use dot
- * notation to specify which fields in the included object are also fetch.
- * @method AV.SearchQuery#include
- * @param {String[]} keys The name of the key to include.
- * @return {AV.SearchQuery} Returns the query, so you can chain this call.
- */
- /**
- * Sets the number of results to skip before returning any results.
- * This is useful for pagination.
- * Default is to skip zero results.
- * @method AV.SearchQuery#skip
- * @param {Number} n the number of results to skip.
- * @return {AV.SearchQuery} Returns the query, so you can chain this call.
- */
- /**
- * Sets the limit of the number of results to return. The default limit is
- * 100, with a maximum of 1000 results being returned at a time.
- * @method AV.SearchQuery#limit
- * @param {Number} n the number of results to limit to.
- * @return {AV.SearchQuery} Returns the query, so you can chain this call.
- */
- /***/ }),
- /* 541 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _ = __webpack_require__(2);
- var AVError = __webpack_require__(43);
- var _require = __webpack_require__(26),
- request = _require.request;
- module.exports = function (AV) {
- /**
- * 包含了使用了 LeanCloud
- * <a href='/docs/leaninsight_guide.html'>离线数据分析功能</a>的函数。
- * <p><strong><em>
- * 仅在云引擎运行环境下有效。
- * </em></strong></p>
- * @namespace
- */
- AV.Insight = AV.Insight || {};
- _.extend(AV.Insight,
- /** @lends AV.Insight */
- {
- /**
- * 开始一个 Insight 任务。结果里将返回 Job id,你可以拿得到的 id 使用
- * AV.Insight.JobQuery 查询任务状态和结果。
- * @param {Object} jobConfig 任务配置的 JSON 对象,例如:<code><pre>
- * { "sql" : "select count(*) as c,gender from _User group by gender",
- * "saveAs": {
- * "className" : "UserGender",
- * "limit": 1
- * }
- * }
- * </pre></code>
- * sql 指定任务执行的 SQL 语句, saveAs(可选) 指定将结果保存在哪张表里,limit 最大 1000。
- * @param {AuthOptions} [options]
- * @return {Promise} A promise that will be resolved with the result
- * of the function.
- */
- startJob: function startJob(jobConfig, options) {
- if (!jobConfig || !jobConfig.sql) {
- throw new Error('Please provide the sql to run the job.');
- }
- var data = {
- jobConfig: jobConfig,
- appId: AV.applicationId
- };
- return request({
- path: '/bigquery/jobs',
- method: 'POST',
- data: AV._encode(data, null, true),
- authOptions: options,
- signKey: false
- }).then(function (resp) {
- return AV._decode(resp).id;
- });
- },
- /**
- * 监听 Insight 任务事件(未来推出独立部署的离线分析服务后开放)
- * <p><strong><em>
- * 仅在云引擎运行环境下有效。
- * </em></strong></p>
- * @param {String} event 监听的事件,目前尚不支持。
- * @param {Function} 监听回调函数,接收 (err, id) 两个参数,err 表示错误信息,
- * id 表示任务 id。接下来你可以拿这个 id 使用AV.Insight.JobQuery 查询任务状态和结果。
- *
- */
- on: function on(event, cb) {}
- });
- /**
- * 创建一个对象,用于查询 Insight 任务状态和结果。
- * @class
- * @param {String} id 任务 id
- * @since 0.5.5
- */
- AV.Insight.JobQuery = function (id, className) {
- if (!id) {
- throw new Error('Please provide the job id.');
- }
- this.id = id;
- this.className = className;
- this._skip = 0;
- this._limit = 100;
- };
- _.extend(AV.Insight.JobQuery.prototype,
- /** @lends AV.Insight.JobQuery.prototype */
- {
- /**
- * Sets the number of results to skip before returning any results.
- * This is useful for pagination.
- * Default is to skip zero results.
- * @param {Number} n the number of results to skip.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- skip: function skip(n) {
- this._skip = n;
- return this;
- },
- /**
- * Sets the limit of the number of results to return. The default limit is
- * 100, with a maximum of 1000 results being returned at a time.
- * @param {Number} n the number of results to limit to.
- * @return {AV.Query} Returns the query, so you can chain this call.
- */
- limit: function limit(n) {
- this._limit = n;
- return this;
- },
- /**
- * 查询任务状态和结果,任务结果为一个 JSON 对象,包括 status 表示任务状态, totalCount 表示总数,
- * results 数组表示任务结果数组,previewCount 表示可以返回的结果总数,任务的开始和截止时间
- * startTime、endTime 等信息。
- *
- * @param {AuthOptions} [options]
- * @return {Promise} A promise that will be resolved with the result
- * of the function.
- *
- */
- find: function find(options) {
- var params = {
- skip: this._skip,
- limit: this._limit
- };
- return request({
- path: "/bigquery/jobs/".concat(this.id),
- method: 'GET',
- query: params,
- authOptions: options,
- signKey: false
- }).then(function (response) {
- if (response.error) {
- return _promise.default.reject(new AVError(response.code, response.error));
- }
- return _promise.default.resolve(response);
- });
- }
- });
- };
- /***/ }),
- /* 542 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _ = __webpack_require__(2);
- var _require = __webpack_require__(26),
- LCRequest = _require.request;
- var _require2 = __webpack_require__(29),
- getSessionToken = _require2.getSessionToken;
- module.exports = function (AV) {
- var getUserWithSessionToken = function getUserWithSessionToken(authOptions) {
- if (authOptions.user) {
- if (!authOptions.user._sessionToken) {
- throw new Error('authOptions.user is not signed in.');
- }
- return _promise.default.resolve(authOptions.user);
- }
- if (authOptions.sessionToken) {
- return AV.User._fetchUserBySessionToken(authOptions.sessionToken);
- }
- return AV.User.currentAsync();
- };
- var getSessionTokenAsync = function getSessionTokenAsync(authOptions) {
- var sessionToken = getSessionToken(authOptions);
- if (sessionToken) {
- return _promise.default.resolve(sessionToken);
- }
- return AV.User.currentAsync().then(function (user) {
- if (user) {
- return user.getSessionToken();
- }
- });
- };
- /**
- * Contains functions to deal with Friendship in LeanCloud.
- * @class
- */
- AV.Friendship = {
- /**
- * Request friendship.
- * @since 4.8.0
- * @param {String | AV.User | Object} options if an AV.User or string is given, it will be used as the friend.
- * @param {AV.User | string} options.friend The friend (or friend's objectId) to follow.
- * @param {Object} [options.attributes] key-value attributes dictionary to be used as conditions of followeeQuery.
- * @param {AuthOptions} [authOptions]
- * @return {Promise<void>}
- */
- request: function request(options) {
- var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var friend;
- var attributes;
- if (options.friend) {
- friend = options.friend;
- attributes = options.attributes;
- } else {
- friend = options;
- }
- var friendObj = _.isString(friend) ? AV.Object.createWithoutData('_User', friend) : friend;
- return getUserWithSessionToken(authOptions).then(function (userObj) {
- if (!userObj) {
- throw new Error('Please signin an user.');
- }
- return LCRequest({
- method: 'POST',
- path: '/users/friendshipRequests',
- data: {
- user: userObj._toPointer(),
- friend: friendObj._toPointer(),
- friendship: attributes
- },
- authOptions: authOptions
- });
- });
- },
- /**
- * Accept a friendship request.
- * @since 4.8.0
- * @param {AV.Object | string | Object} options if an AV.Object or string is given, it will be used as the request in _FriendshipRequest.
- * @param {AV.Object} options.request The request (or it's objectId) to be accepted.
- * @param {Object} [options.attributes] key-value attributes dictionary to be used as conditions of {@link AV#followeeQuery}.
- * @param {AuthOptions} [authOptions]
- * @return {Promise<void>}
- */
- acceptRequest: function acceptRequest(options) {
- var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var request;
- var attributes;
- if (options.request) {
- request = options.request;
- attributes = options.attributes;
- } else {
- request = options;
- }
- var requestId = _.isString(request) ? request : request.id;
- return getSessionTokenAsync(authOptions).then(function (sessionToken) {
- if (!sessionToken) {
- throw new Error('Please signin an user.');
- }
- return LCRequest({
- method: 'PUT',
- path: '/users/friendshipRequests/' + requestId + '/accept',
- data: {
- friendship: AV._encode(attributes)
- },
- authOptions: authOptions
- });
- });
- },
- /**
- * Decline a friendship request.
- * @param {AV.Object | string} request The request (or it's objectId) to be declined.
- * @param {AuthOptions} [authOptions]
- * @return {Promise<void>}
- */
- declineRequest: function declineRequest(request) {
- var authOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var requestId = _.isString(request) ? request : request.id;
- return getSessionTokenAsync(authOptions).then(function (sessionToken) {
- if (!sessionToken) {
- throw new Error('Please signin an user.');
- }
- return LCRequest({
- method: 'PUT',
- path: '/users/friendshipRequests/' + requestId + '/decline',
- authOptions: authOptions
- });
- });
- }
- };
- };
- /***/ }),
- /* 543 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _stringify = _interopRequireDefault(__webpack_require__(36));
- var _ = __webpack_require__(2);
- var _require = __webpack_require__(26),
- _request = _require._request;
- var AV = __webpack_require__(65);
- var serializeMessage = function serializeMessage(message) {
- if (typeof message === 'string') {
- return message;
- }
- if (typeof message.getPayload === 'function') {
- return (0, _stringify.default)(message.getPayload());
- }
- return (0, _stringify.default)(message);
- };
- /**
- * <p>An AV.Conversation is a local representation of a LeanCloud realtime's
- * conversation. This class is a subclass of AV.Object, and retains the
- * same functionality of an AV.Object, but also extends it with various
- * conversation specific methods, like get members, creators of this conversation.
- * </p>
- *
- * @class AV.Conversation
- * @param {String} name The name of the Role to create.
- * @param {Object} [options]
- * @param {Boolean} [options.isSystem] Set this conversation as system conversation.
- * @param {Boolean} [options.isTransient] Set this conversation as transient conversation.
- */
- module.exports = AV.Object.extend('_Conversation',
- /** @lends AV.Conversation.prototype */
- {
- constructor: function constructor(name) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- AV.Object.prototype.constructor.call(this, null, null);
- this.set('name', name);
- if (options.isSystem !== undefined) {
- this.set('sys', options.isSystem ? true : false);
- }
- if (options.isTransient !== undefined) {
- this.set('tr', options.isTransient ? true : false);
- }
- },
- /**
- * Get current conversation's creator.
- *
- * @return {String}
- */
- getCreator: function getCreator() {
- return this.get('c');
- },
- /**
- * Get the last message's time.
- *
- * @return {Date}
- */
- getLastMessageAt: function getLastMessageAt() {
- return this.get('lm');
- },
- /**
- * Get this conversation's members
- *
- * @return {String[]}
- */
- getMembers: function getMembers() {
- return this.get('m');
- },
- /**
- * Add a member to this conversation
- *
- * @param {String} member
- */
- addMember: function addMember(member) {
- return this.add('m', member);
- },
- /**
- * Get this conversation's members who set this conversation as muted.
- *
- * @return {String[]}
- */
- getMutedMembers: function getMutedMembers() {
- return this.get('mu');
- },
- /**
- * Get this conversation's name field.
- *
- * @return String
- */
- getName: function getName() {
- return this.get('name');
- },
- /**
- * Returns true if this conversation is transient conversation.
- *
- * @return {Boolean}
- */
- isTransient: function isTransient() {
- return this.get('tr');
- },
- /**
- * Returns true if this conversation is system conversation.
- *
- * @return {Boolean}
- */
- isSystem: function isSystem() {
- return this.get('sys');
- },
- /**
- * Send realtime message to this conversation, using HTTP request.
- *
- * @param {String} fromClient Sender's client id.
- * @param {String|Object} message The message which will send to conversation.
- * It could be a raw string, or an object with a `toJSON` method, like a
- * realtime SDK's Message object. See more: {@link https://leancloud.cn/docs/realtime_guide-js.html#消息}
- * @param {Object} [options]
- * @param {Boolean} [options.transient] Whether send this message as transient message or not.
- * @param {String[]} [options.toClients] Ids of clients to send to. This option can be used only in system conversation.
- * @param {Object} [options.pushData] Push data to this message. See more: {@link https://url.leanapp.cn/pushData 推送消息内容}
- * @param {AuthOptions} [authOptions]
- * @return {Promise}
- */
- send: function send(fromClient, message) {
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
- var data = {
- from_peer: fromClient,
- conv_id: this.id,
- transient: false,
- message: serializeMessage(message)
- };
- if (options.toClients !== undefined) {
- data.to_peers = options.toClients;
- }
- if (options.transient !== undefined) {
- data.transient = options.transient ? true : false;
- }
- if (options.pushData !== undefined) {
- data.push_data = options.pushData;
- }
- return _request('rtm', 'messages', null, 'POST', data, authOptions);
- },
- /**
- * Send realtime broadcast message to all clients, via this conversation, using HTTP request.
- *
- * @param {String} fromClient Sender's client id.
- * @param {String|Object} message The message which will send to conversation.
- * It could be a raw string, or an object with a `toJSON` method, like a
- * realtime SDK's Message object. See more: {@link https://leancloud.cn/docs/realtime_guide-js.html#消息}.
- * @param {Object} [options]
- * @param {Object} [options.pushData] Push data to this message. See more: {@link https://url.leanapp.cn/pushData 推送消息内容}.
- * @param {Object} [options.validTill] The message will valid till this time.
- * @param {AuthOptions} [authOptions]
- * @return {Promise}
- */
- broadcast: function broadcast(fromClient, message) {
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- var authOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
- var data = {
- from_peer: fromClient,
- conv_id: this.id,
- message: serializeMessage(message)
- };
- if (options.pushData !== undefined) {
- data.push = options.pushData;
- }
- if (options.validTill !== undefined) {
- var ts = options.validTill;
- if (_.isDate(ts)) {
- ts = ts.getTime();
- }
- options.valid_till = ts;
- }
- return _request('rtm', 'broadcast', null, 'POST', data, authOptions);
- }
- });
- /***/ }),
- /* 544 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _map = _interopRequireDefault(__webpack_require__(42));
- var _concat = _interopRequireDefault(__webpack_require__(30));
- var _ = __webpack_require__(2);
- var _require = __webpack_require__(26),
- request = _require.request;
- var _require2 = __webpack_require__(29),
- ensureArray = _require2.ensureArray,
- parseDate = _require2.parseDate;
- var AV = __webpack_require__(65);
- /**
- * The version change interval for Leaderboard
- * @enum
- */
- AV.LeaderboardVersionChangeInterval = {
- NEVER: 'never',
- DAY: 'day',
- WEEK: 'week',
- MONTH: 'month'
- };
- /**
- * The order of the leaderboard results
- * @enum
- */
- AV.LeaderboardOrder = {
- ASCENDING: 'ascending',
- DESCENDING: 'descending'
- };
- /**
- * The update strategy for Leaderboard
- * @enum
- */
- AV.LeaderboardUpdateStrategy = {
- /** Only keep the best statistic. If the leaderboard is in descending order, the best statistic is the highest one. */
- BETTER: 'better',
- /** Keep the last updated statistic */
- LAST: 'last',
- /** Keep the sum of all updated statistics */
- SUM: 'sum'
- };
- /**
- * @typedef {Object} Ranking
- * @property {number} rank Starts at 0
- * @property {number} value the statistic value of this ranking
- * @property {AV.User} user The user of this ranking
- * @property {Statistic[]} [includedStatistics] Other statistics of the user, specified by the `includeStatistic` option of `AV.Leaderboard.getResults()`
- */
- /**
- * @typedef {Object} LeaderboardArchive
- * @property {string} statisticName
- * @property {number} version version of the leaderboard
- * @property {string} status
- * @property {string} url URL for the downloadable archive
- * @property {Date} activatedAt time when this version became active
- * @property {Date} deactivatedAt time when this version was deactivated by a version incrementing
- */
- /**
- * @class
- */
- function Statistic(_ref) {
- var name = _ref.name,
- value = _ref.value,
- version = _ref.version;
- /**
- * @type {string}
- */
- this.name = name;
- /**
- * @type {number}
- */
- this.value = value;
- /**
- * @type {number?}
- */
- this.version = version;
- }
- var parseStatisticData = function parseStatisticData(statisticData) {
- var _AV$_decode = AV._decode(statisticData),
- name = _AV$_decode.statisticName,
- value = _AV$_decode.statisticValue,
- version = _AV$_decode.version;
- return new Statistic({
- name: name,
- value: value,
- version: version
- });
- };
- /**
- * @class
- */
- AV.Leaderboard = function Leaderboard(statisticName) {
- /**
- * @type {string}
- */
- this.statisticName = statisticName;
- /**
- * @type {AV.LeaderboardOrder}
- */
- this.order = undefined;
- /**
- * @type {AV.LeaderboardUpdateStrategy}
- */
- this.updateStrategy = undefined;
- /**
- * @type {AV.LeaderboardVersionChangeInterval}
- */
- this.versionChangeInterval = undefined;
- /**
- * @type {number}
- */
- this.version = undefined;
- /**
- * @type {Date?}
- */
- this.nextResetAt = undefined;
- /**
- * @type {Date?}
- */
- this.createdAt = undefined;
- };
- var Leaderboard = AV.Leaderboard;
- /**
- * Create an instance of Leaderboard for the give statistic name.
- * @param {string} statisticName
- * @return {AV.Leaderboard}
- */
- AV.Leaderboard.createWithoutData = function (statisticName) {
- return new Leaderboard(statisticName);
- };
- /**
- * (masterKey required) Create a new Leaderboard.
- * @param {Object} options
- * @param {string} options.statisticName
- * @param {AV.LeaderboardOrder} options.order
- * @param {AV.LeaderboardVersionChangeInterval} [options.versionChangeInterval] default to WEEK
- * @param {AV.LeaderboardUpdateStrategy} [options.updateStrategy] default to BETTER
- * @param {AuthOptions} [authOptions]
- * @return {Promise<AV.Leaderboard>}
- */
- AV.Leaderboard.createLeaderboard = function (_ref2, authOptions) {
- var statisticName = _ref2.statisticName,
- order = _ref2.order,
- versionChangeInterval = _ref2.versionChangeInterval,
- updateStrategy = _ref2.updateStrategy;
- return request({
- method: 'POST',
- path: '/leaderboard/leaderboards',
- data: {
- statisticName: statisticName,
- order: order,
- versionChangeInterval: versionChangeInterval,
- updateStrategy: updateStrategy
- },
- authOptions: authOptions
- }).then(function (data) {
- var leaderboard = new Leaderboard(statisticName);
- return leaderboard._finishFetch(data);
- });
- };
- /**
- * Get the Leaderboard with the specified statistic name.
- * @param {string} statisticName
- * @param {AuthOptions} [authOptions]
- * @return {Promise<AV.Leaderboard>}
- */
- AV.Leaderboard.getLeaderboard = function (statisticName, authOptions) {
- return Leaderboard.createWithoutData(statisticName).fetch(authOptions);
- };
- /**
- * Get Statistics for the specified user.
- * @param {AV.User} user The specified AV.User pointer.
- * @param {Object} [options]
- * @param {string[]} [options.statisticNames] Specify the statisticNames. If not set, all statistics of the user will be fetched.
- * @param {AuthOptions} [authOptions]
- * @return {Promise<Statistic[]>}
- */
- AV.Leaderboard.getStatistics = function (user) {
- var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- statisticNames = _ref3.statisticNames;
- var authOptions = arguments.length > 2 ? arguments[2] : undefined;
- return _promise.default.resolve().then(function () {
- if (!(user && user.id)) throw new Error('user must be an AV.User');
- return request({
- method: 'GET',
- path: "/leaderboard/users/".concat(user.id, "/statistics"),
- query: {
- statistics: statisticNames ? ensureArray(statisticNames).join(',') : undefined
- },
- authOptions: authOptions
- }).then(function (_ref4) {
- var results = _ref4.results;
- return (0, _map.default)(results).call(results, parseStatisticData);
- });
- });
- };
- /**
- * Update Statistics for the specified user.
- * @param {AV.User} user The specified AV.User pointer.
- * @param {Object} statistics A name-value pair representing the statistics to update.
- * @param {AuthOptions} [options] AuthOptions plus:
- * @param {boolean} [options.overwrite] Wethere to overwrite these statistics disregarding the updateStrategy of there leaderboards
- * @return {Promise<Statistic[]>}
- */
- AV.Leaderboard.updateStatistics = function (user, statistics) {
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- return _promise.default.resolve().then(function () {
- if (!(user && user.id)) throw new Error('user must be an AV.User');
- var data = (0, _map.default)(_).call(_, statistics, function (value, key) {
- return {
- statisticName: key,
- statisticValue: value
- };
- });
- var overwrite = options.overwrite;
- return request({
- method: 'POST',
- path: "/leaderboard/users/".concat(user.id, "/statistics"),
- query: {
- overwrite: overwrite ? 1 : undefined
- },
- data: data,
- authOptions: options
- }).then(function (_ref5) {
- var results = _ref5.results;
- return (0, _map.default)(results).call(results, parseStatisticData);
- });
- });
- };
- /**
- * Delete Statistics for the specified user.
- * @param {AV.User} user The specified AV.User pointer.
- * @param {Object} statistics A name-value pair representing the statistics to delete.
- * @param {AuthOptions} [options]
- * @return {Promise<void>}
- */
- AV.Leaderboard.deleteStatistics = function (user, statisticNames, authOptions) {
- return _promise.default.resolve().then(function () {
- if (!(user && user.id)) throw new Error('user must be an AV.User');
- return request({
- method: 'DELETE',
- path: "/leaderboard/users/".concat(user.id, "/statistics"),
- query: {
- statistics: ensureArray(statisticNames).join(',')
- },
- authOptions: authOptions
- }).then(function () {
- return undefined;
- });
- });
- };
- _.extend(Leaderboard.prototype,
- /** @lends AV.Leaderboard.prototype */
- {
- _finishFetch: function _finishFetch(data) {
- var _this = this;
- _.forEach(data, function (value, key) {
- if (key === 'updatedAt' || key === 'objectId') return;
- if (key === 'expiredAt') {
- key = 'nextResetAt';
- }
- if (key === 'createdAt') {
- value = parseDate(value);
- }
- if (value && value.__type === 'Date') {
- value = parseDate(value.iso);
- }
- _this[key] = value;
- });
- return this;
- },
- /**
- * Fetch data from the srever.
- * @param {AuthOptions} [authOptions]
- * @return {Promise<AV.Leaderboard>}
- */
- fetch: function fetch(authOptions) {
- var _this2 = this;
- return request({
- method: 'GET',
- path: "/leaderboard/leaderboards/".concat(this.statisticName),
- authOptions: authOptions
- }).then(function (data) {
- return _this2._finishFetch(data);
- });
- },
- /**
- * Counts the number of users participated in this leaderboard
- * @param {Object} [options]
- * @param {number} [options.version] Specify the version of the leaderboard
- * @param {AuthOptions} [authOptions]
- * @return {Promise<number>}
- */
- count: function count() {
- var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- version = _ref6.version;
- var authOptions = arguments.length > 1 ? arguments[1] : undefined;
- return request({
- method: 'GET',
- path: "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks"),
- query: {
- count: 1,
- limit: 0,
- version: version
- },
- authOptions: authOptions
- }).then(function (_ref7) {
- var count = _ref7.count;
- return count;
- });
- },
- _getResults: function _getResults(_ref8, authOptions, userId) {
- var _context;
- var skip = _ref8.skip,
- limit = _ref8.limit,
- selectUserKeys = _ref8.selectUserKeys,
- includeUserKeys = _ref8.includeUserKeys,
- includeStatistics = _ref8.includeStatistics,
- version = _ref8.version;
- return request({
- method: 'GET',
- path: (0, _concat.default)(_context = "/leaderboard/leaderboards/".concat(this.statisticName, "/ranks")).call(_context, userId ? "/".concat(userId) : ''),
- query: {
- skip: skip,
- limit: limit,
- selectUserKeys: _.union(ensureArray(selectUserKeys), ensureArray(includeUserKeys)).join(',') || undefined,
- includeUser: includeUserKeys ? ensureArray(includeUserKeys).join(',') : undefined,
- includeStatistics: includeStatistics ? ensureArray(includeStatistics).join(',') : undefined,
- version: version
- },
- authOptions: authOptions
- }).then(function (_ref9) {
- var rankings = _ref9.results;
- return (0, _map.default)(rankings).call(rankings, function (rankingData) {
- var _AV$_decode2 = AV._decode(rankingData),
- user = _AV$_decode2.user,
- value = _AV$_decode2.statisticValue,
- rank = _AV$_decode2.rank,
- _AV$_decode2$statisti = _AV$_decode2.statistics,
- statistics = _AV$_decode2$statisti === void 0 ? [] : _AV$_decode2$statisti;
- return {
- user: user,
- value: value,
- rank: rank,
- includedStatistics: (0, _map.default)(statistics).call(statistics, parseStatisticData)
- };
- });
- });
- },
- /**
- * Retrieve a list of ranked users for this Leaderboard.
- * @param {Object} [options]
- * @param {number} [options.skip] The number of results to skip. This is useful for pagination.
- * @param {number} [options.limit] The limit of the number of results.
- * @param {string[]} [options.selectUserKeys] Specify keys of the users to include in the Rankings
- * @param {string[]} [options.includeUserKeys] If the value of a selected user keys is a Pointer, use this options to include its value.
- * @param {string[]} [options.includeStatistics] Specify other statistics to include in the Rankings
- * @param {number} [options.version] Specify the version of the leaderboard
- * @param {AuthOptions} [authOptions]
- * @return {Promise<Ranking[]>}
- */
- getResults: function getResults() {
- var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- skip = _ref10.skip,
- limit = _ref10.limit,
- selectUserKeys = _ref10.selectUserKeys,
- includeUserKeys = _ref10.includeUserKeys,
- includeStatistics = _ref10.includeStatistics,
- version = _ref10.version;
- var authOptions = arguments.length > 1 ? arguments[1] : undefined;
- return this._getResults({
- skip: skip,
- limit: limit,
- selectUserKeys: selectUserKeys,
- includeUserKeys: includeUserKeys,
- includeStatistics: includeStatistics,
- version: version
- }, authOptions);
- },
- /**
- * Retrieve a list of ranked users for this Leaderboard, centered on the specified user.
- * @param {AV.User} user The specified AV.User pointer.
- * @param {Object} [options]
- * @param {number} [options.limit] The limit of the number of results.
- * @param {string[]} [options.selectUserKeys] Specify keys of the users to include in the Rankings
- * @param {string[]} [options.includeUserKeys] If the value of a selected user keys is a Pointer, use this options to include its value.
- * @param {string[]} [options.includeStatistics] Specify other statistics to include in the Rankings
- * @param {number} [options.version] Specify the version of the leaderboard
- * @param {AuthOptions} [authOptions]
- * @return {Promise<Ranking[]>}
- */
- getResultsAroundUser: function getResultsAroundUser(user) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
- var authOptions = arguments.length > 2 ? arguments[2] : undefined;
- // getResultsAroundUser(options, authOptions)
- if (user && typeof user.id !== 'string') {
- return this.getResultsAroundUser(undefined, user, options);
- }
- var limit = options.limit,
- selectUserKeys = options.selectUserKeys,
- includeUserKeys = options.includeUserKeys,
- includeStatistics = options.includeStatistics,
- version = options.version;
- return this._getResults({
- limit: limit,
- selectUserKeys: selectUserKeys,
- includeUserKeys: includeUserKeys,
- includeStatistics: includeStatistics,
- version: version
- }, authOptions, user ? user.id : 'self');
- },
- _update: function _update(data, authOptions) {
- var _this3 = this;
- return request({
- method: 'PUT',
- path: "/leaderboard/leaderboards/".concat(this.statisticName),
- data: data,
- authOptions: authOptions
- }).then(function (result) {
- return _this3._finishFetch(result);
- });
- },
- /**
- * (masterKey required) Update the version change interval of the Leaderboard.
- * @param {AV.LeaderboardVersionChangeInterval} versionChangeInterval
- * @param {AuthOptions} [authOptions]
- * @return {Promise<AV.Leaderboard>}
- */
- updateVersionChangeInterval: function updateVersionChangeInterval(versionChangeInterval, authOptions) {
- return this._update({
- versionChangeInterval: versionChangeInterval
- }, authOptions);
- },
- /**
- * (masterKey required) Update the version change interval of the Leaderboard.
- * @param {AV.LeaderboardUpdateStrategy} updateStrategy
- * @param {AuthOptions} [authOptions]
- * @return {Promise<AV.Leaderboard>}
- */
- updateUpdateStrategy: function updateUpdateStrategy(updateStrategy, authOptions) {
- return this._update({
- updateStrategy: updateStrategy
- }, authOptions);
- },
- /**
- * (masterKey required) Reset the Leaderboard. The version of the Leaderboard will be incremented by 1.
- * @param {AuthOptions} [authOptions]
- * @return {Promise<AV.Leaderboard>}
- */
- reset: function reset(authOptions) {
- var _this4 = this;
- return request({
- method: 'PUT',
- path: "/leaderboard/leaderboards/".concat(this.statisticName, "/incrementVersion"),
- authOptions: authOptions
- }).then(function (data) {
- return _this4._finishFetch(data);
- });
- },
- /**
- * (masterKey required) Delete the Leaderboard and its all archived versions.
- * @param {AuthOptions} [authOptions]
- * @return {void}
- */
- destroy: function destroy(authOptions) {
- return AV.request({
- method: 'DELETE',
- path: "/leaderboard/leaderboards/".concat(this.statisticName),
- authOptions: authOptions
- }).then(function () {
- return undefined;
- });
- },
- /**
- * (masterKey required) Get archived versions.
- * @param {Object} [options]
- * @param {number} [options.skip] The number of results to skip. This is useful for pagination.
- * @param {number} [options.limit] The limit of the number of results.
- * @param {AuthOptions} [authOptions]
- * @return {Promise<LeaderboardArchive[]>}
- */
- getArchives: function getArchives() {
- var _this5 = this;
- var _ref11 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
- skip = _ref11.skip,
- limit = _ref11.limit;
- var authOptions = arguments.length > 1 ? arguments[1] : undefined;
- return request({
- method: 'GET',
- path: "/leaderboard/leaderboards/".concat(this.statisticName, "/archives"),
- query: {
- skip: skip,
- limit: limit
- },
- authOptions: authOptions
- }).then(function (_ref12) {
- var results = _ref12.results;
- return (0, _map.default)(results).call(results, function (_ref13) {
- var version = _ref13.version,
- status = _ref13.status,
- url = _ref13.url,
- activatedAt = _ref13.activatedAt,
- deactivatedAt = _ref13.deactivatedAt;
- return {
- statisticName: _this5.statisticName,
- version: version,
- status: status,
- url: url,
- activatedAt: parseDate(activatedAt.iso),
- deactivatedAt: parseDate(deactivatedAt.iso)
- };
- });
- });
- }
- });
- /***/ }),
- /* 545 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var adapters = __webpack_require__(546);
- module.exports = function (AV) {
- AV.setAdapters(adapters);
- return AV;
- };
- /***/ }),
- /* 546 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var _interopRequireDefault = __webpack_require__(1);
- var _typeof2 = _interopRequireDefault(__webpack_require__(109));
- var _defineProperty = _interopRequireDefault(__webpack_require__(143));
- var _setPrototypeOf = _interopRequireDefault(__webpack_require__(227));
- var _assign2 = _interopRequireDefault(__webpack_require__(547));
- var _indexOf = _interopRequireDefault(__webpack_require__(86));
- var _getOwnPropertySymbols = _interopRequireDefault(__webpack_require__(552));
- var _promise = _interopRequireDefault(__webpack_require__(12));
- var _symbol = _interopRequireDefault(__webpack_require__(240));
- var _iterator = _interopRequireDefault(__webpack_require__(555));
- var _weakMap = _interopRequireDefault(__webpack_require__(556));
- var _keys = _interopRequireDefault(__webpack_require__(141));
- var _getOwnPropertyDescriptor = _interopRequireDefault(__webpack_require__(246));
- var _getPrototypeOf = _interopRequireDefault(__webpack_require__(142));
- var _map = _interopRequireDefault(__webpack_require__(564));
- (0, _defineProperty.default)(exports, '__esModule', {
- value: true
- });
- /******************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */
- /* global Reflect, Promise */
- var _extendStatics$ = function extendStatics$1(d, b) {
- _extendStatics$ = _setPrototypeOf.default || {
- __proto__: []
- } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) {
- if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
- }
- };
- return _extendStatics$(d, b);
- };
- function __extends$1(d, b) {
- if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
- _extendStatics$(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- }
- var _assign = function __assign() {
- _assign = _assign2.default || function __assign(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) {
- if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
- }
- }
- return t;
- };
- return _assign.apply(this, arguments);
- };
- function __rest(s, e) {
- var t = {};
- for (var p in s) {
- if (Object.prototype.hasOwnProperty.call(s, p) && (0, _indexOf.default)(e).call(e, p) < 0) t[p] = s[p];
- }
- if (s != null && typeof _getOwnPropertySymbols.default === "function") for (var i = 0, p = (0, _getOwnPropertySymbols.default)(s); i < p.length; i++) {
- if ((0, _indexOf.default)(e).call(e, p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
- }
- return t;
- }
- function __awaiter(thisArg, _arguments, P, generator) {
- function adopt(value) {
- return value instanceof P ? value : new P(function (resolve) {
- resolve(value);
- });
- }
- return new (P || (P = _promise.default))(function (resolve, reject) {
- function fulfilled(value) {
- try {
- step(generator.next(value));
- } catch (e) {
- reject(e);
- }
- }
- function rejected(value) {
- try {
- step(generator["throw"](value));
- } catch (e) {
- reject(e);
- }
- }
- function step(result) {
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
- }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- }
- function __generator(thisArg, body) {
- var _ = {
- label: 0,
- sent: function sent() {
- if (t[0] & 1) throw t[1];
- return t[1];
- },
- trys: [],
- ops: []
- },
- f,
- y,
- t,
- g;
- return g = {
- next: verb(0),
- "throw": verb(1),
- "return": verb(2)
- }, typeof _symbol.default === "function" && (g[_iterator.default] = function () {
- return this;
- }), g;
- function verb(n) {
- return function (v) {
- return step([n, v]);
- };
- }
- function step(op) {
- if (f) throw new TypeError("Generator is already executing.");
- while (_) {
- try {
- 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;
- if (y = 0, t) op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0:
- case 1:
- t = op;
- break;
- case 4:
- _.label++;
- return {
- value: op[1],
- done: false
- };
- case 5:
- _.label++;
- y = op[1];
- op = [0];
- continue;
- case 7:
- op = _.ops.pop();
- _.trys.pop();
- continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
- _ = 0;
- continue;
- }
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
- _.label = op[1];
- break;
- }
- if (op[0] === 6 && _.label < t[1]) {
- _.label = t[1];
- t = op;
- break;
- }
- if (t && _.label < t[2]) {
- _.label = t[2];
- _.ops.push(op);
- break;
- }
- if (t[2]) _.ops.pop();
- _.trys.pop();
- continue;
- }
- op = body.call(thisArg, _);
- } catch (e) {
- op = [6, e];
- y = 0;
- } finally {
- f = t = 0;
- }
- }
- if (op[0] & 5) throw op[1];
- return {
- value: op[0] ? op[1] : void 0,
- done: true
- };
- }
- }
- var PROVIDER = "lc_weapp";
- var PLATFORM = "weixin";
- function getLoginCode() {
- return new _promise.default(function (resolve, reject) {
- wx.login({
- success: function success(res) {
- return res.code ? resolve(res.code) : reject(new Error(res.errMsg));
- },
- fail: function fail(_a) {
- var errMsg = _a.errMsg;
- return reject(new Error(errMsg));
- }
- });
- });
- }
- var getAuthInfo = function getAuthInfo(_a) {
- var _b = _a === void 0 ? {} : _a,
- _c = _b.platform,
- platform = _c === void 0 ? PLATFORM : _c,
- _d = _b.preferUnionId,
- preferUnionId = _d === void 0 ? false : _d,
- _e = _b.asMainAccount,
- asMainAccount = _e === void 0 ? false : _e;
- return __awaiter(this, void 0, void 0, function () {
- var code, authData;
- return __generator(this, function (_f) {
- switch (_f.label) {
- case 0:
- return [4
- /*yield*/
- , getLoginCode()];
- case 1:
- code = _f.sent();
- authData = {
- code: code
- };
- if (preferUnionId) {
- authData.platform = platform;
- authData.main_account = asMainAccount;
- }
- return [2
- /*return*/
- , {
- authData: authData,
- platform: platform,
- provider: PROVIDER
- }];
- }
- });
- });
- };
- var storage = {
- getItem: function getItem(key) {
- return wx.getStorageSync(key);
- },
- setItem: function setItem(key, value) {
- return wx.setStorageSync(key, value);
- },
- removeItem: function removeItem(key) {
- return wx.removeStorageSync(key);
- },
- clear: function clear() {
- return wx.clearStorageSync();
- }
- };
- /******************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */
- /* global Reflect, Promise */
- var _extendStatics = function extendStatics(d, b) {
- _extendStatics = _setPrototypeOf.default || {
- __proto__: []
- } instanceof Array && function (d, b) {
- d.__proto__ = b;
- } || function (d, b) {
- for (var p in b) {
- if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
- }
- };
- return _extendStatics(d, b);
- };
- function __extends(d, b) {
- if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
- _extendStatics(d, b);
- function __() {
- this.constructor = d;
- }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- }
- var AbortError =
- /** @class */
- function (_super) {
- __extends(AbortError, _super);
- function AbortError() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.name = "AbortError";
- return _this;
- }
- return AbortError;
- }(Error);
- var request = function request(url, options) {
- if (options === void 0) {
- options = {};
- }
- var method = options.method,
- data = options.data,
- headers = options.headers,
- signal = options.signal;
- if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
- return _promise.default.reject(new AbortError("Request aborted"));
- }
- return new _promise.default(function (resolve, reject) {
- var task = wx.request({
- url: url,
- method: method,
- data: data,
- header: headers,
- complete: function complete(res) {
- signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", abortListener);
- if (!res.statusCode) {
- reject(new Error(res.errMsg));
- return;
- }
- resolve({
- ok: !(res.statusCode >= 400),
- status: res.statusCode,
- headers: res.header,
- data: res.data
- });
- }
- });
- var abortListener = function abortListener() {
- reject(new AbortError("Request aborted"));
- task.abort();
- };
- signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", abortListener);
- });
- };
- var upload = function upload(url, file, options) {
- if (options === void 0) {
- options = {};
- }
- var headers = options.headers,
- data = options.data,
- onprogress = options.onprogress,
- signal = options.signal;
- if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
- return _promise.default.reject(new AbortError("Request aborted"));
- }
- if (!(file && file.data && file.data.uri)) {
- return _promise.default.reject(new TypeError("File data must be an object like { uri: localPath }."));
- }
- return new _promise.default(function (resolve, reject) {
- var task = wx.uploadFile({
- url: url,
- header: headers,
- filePath: file.data.uri,
- name: file.field,
- formData: data,
- success: function success(response) {
- var status = response.statusCode,
- data = response.data,
- rest = __rest(response, ["statusCode", "data"]);
- resolve(_assign(_assign({}, rest), {
- data: typeof data === "string" ? JSON.parse(data) : data,
- status: status,
- ok: !(status >= 400)
- }));
- },
- fail: function fail(response) {
- reject(new Error(response.errMsg));
- },
- complete: function complete() {
- signal === null || signal === void 0 ? void 0 : signal.removeEventListener("abort", abortListener);
- }
- });
- var abortListener = function abortListener() {
- reject(new AbortError("Request aborted"));
- task.abort();
- };
- signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", abortListener);
- if (onprogress) {
- task.onProgressUpdate(function (event) {
- return onprogress({
- loaded: event.totalBytesSent,
- total: event.totalBytesExpectedToSend,
- percent: event.progress
- });
- });
- }
- });
- };
- /**
- * @author Toru Nagashima <https://github.com/mysticatea>
- * @copyright 2015 Toru Nagashima. All rights reserved.
- * See LICENSE file in root directory for full license.
- */
- /**
- * @typedef {object} PrivateData
- * @property {EventTarget} eventTarget The event target.
- * @property {{type:string}} event The original event object.
- * @property {number} eventPhase The current event phase.
- * @property {EventTarget|null} currentTarget The current event target.
- * @property {boolean} canceled The flag to prevent default.
- * @property {boolean} stopped The flag to stop propagation.
- * @property {boolean} immediateStopped The flag to stop propagation immediately.
- * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.
- * @property {number} timeStamp The unix time.
- * @private
- */
- /**
- * Private data for event wrappers.
- * @type {WeakMap<Event, PrivateData>}
- * @private
- */
- var privateData = new _weakMap.default();
- /**
- * Cache for wrapper classes.
- * @type {WeakMap<Object, Function>}
- * @private
- */
- var wrappers = new _weakMap.default();
- /**
- * Get private data.
- * @param {Event} event The event object to get private data.
- * @returns {PrivateData} The private data of the event.
- * @private
- */
- function pd(event) {
- var retv = privateData.get(event);
- console.assert(retv != null, "'this' is expected an Event object, but got", event);
- return retv;
- }
- /**
- * https://dom.spec.whatwg.org/#set-the-canceled-flag
- * @param data {PrivateData} private data.
- */
- function setCancelFlag(data) {
- if (data.passiveListener != null) {
- if (typeof console !== "undefined" && typeof console.error === "function") {
- console.error("Unable to preventDefault inside passive event listener invocation.", data.passiveListener);
- }
- return;
- }
- if (!data.event.cancelable) {
- return;
- }
- data.canceled = true;
- if (typeof data.event.preventDefault === "function") {
- data.event.preventDefault();
- }
- }
- /**
- * @see https://dom.spec.whatwg.org/#interface-event
- * @private
- */
- /**
- * The event wrapper.
- * @constructor
- * @param {EventTarget} eventTarget The event target of this dispatching.
- * @param {Event|{type:string}} event The original event to wrap.
- */
- function Event(eventTarget, event) {
- privateData.set(this, {
- eventTarget: eventTarget,
- event: event,
- eventPhase: 2,
- currentTarget: eventTarget,
- canceled: false,
- stopped: false,
- immediateStopped: false,
- passiveListener: null,
- timeStamp: event.timeStamp || Date.now()
- }); // https://heycam.github.io/webidl/#Unforgeable
- (0, _defineProperty.default)(this, "isTrusted", {
- value: false,
- enumerable: true
- }); // Define accessors
- var keys = (0, _keys.default)(event);
- for (var i = 0; i < keys.length; ++i) {
- var key = keys[i];
- if (!(key in this)) {
- (0, _defineProperty.default)(this, key, defineRedirectDescriptor(key));
- }
- }
- } // Should be enumerable, but class methods are not enumerable.
- Event.prototype = {
- /**
- * The type of this event.
- * @type {string}
- */
- get type() {
- return pd(this).event.type;
- },
- /**
- * The target of this event.
- * @type {EventTarget}
- */
- get target() {
- return pd(this).eventTarget;
- },
- /**
- * The target of this event.
- * @type {EventTarget}
- */
- get currentTarget() {
- return pd(this).currentTarget;
- },
- /**
- * @returns {EventTarget[]} The composed path of this event.
- */
- composedPath: function composedPath() {
- var currentTarget = pd(this).currentTarget;
- if (currentTarget == null) {
- return [];
- }
- return [currentTarget];
- },
- /**
- * Constant of NONE.
- * @type {number}
- */
- get NONE() {
- return 0;
- },
- /**
- * Constant of CAPTURING_PHASE.
- * @type {number}
- */
- get CAPTURING_PHASE() {
- return 1;
- },
- /**
- * Constant of AT_TARGET.
- * @type {number}
- */
- get AT_TARGET() {
- return 2;
- },
- /**
- * Constant of BUBBLING_PHASE.
- * @type {number}
- */
- get BUBBLING_PHASE() {
- return 3;
- },
- /**
- * The target of this event.
- * @type {number}
- */
- get eventPhase() {
- return pd(this).eventPhase;
- },
- /**
- * Stop event bubbling.
- * @returns {void}
- */
- stopPropagation: function stopPropagation() {
- var data = pd(this);
- data.stopped = true;
- if (typeof data.event.stopPropagation === "function") {
- data.event.stopPropagation();
- }
- },
- /**
- * Stop event bubbling.
- * @returns {void}
- */
- stopImmediatePropagation: function stopImmediatePropagation() {
- var data = pd(this);
- data.stopped = true;
- data.immediateStopped = true;
- if (typeof data.event.stopImmediatePropagation === "function") {
- data.event.stopImmediatePropagation();
- }
- },
- /**
- * The flag to be bubbling.
- * @type {boolean}
- */
- get bubbles() {
- return Boolean(pd(this).event.bubbles);
- },
- /**
- * The flag to be cancelable.
- * @type {boolean}
- */
- get cancelable() {
- return Boolean(pd(this).event.cancelable);
- },
- /**
- * Cancel this event.
- * @returns {void}
- */
- preventDefault: function preventDefault() {
- setCancelFlag(pd(this));
- },
- /**
- * The flag to indicate cancellation state.
- * @type {boolean}
- */
- get defaultPrevented() {
- return pd(this).canceled;
- },
- /**
- * The flag to be composed.
- * @type {boolean}
- */
- get composed() {
- return Boolean(pd(this).event.composed);
- },
- /**
- * The unix time of this event.
- * @type {number}
- */
- get timeStamp() {
- return pd(this).timeStamp;
- },
- /**
- * The target of this event.
- * @type {EventTarget}
- * @deprecated
- */
- get srcElement() {
- return pd(this).eventTarget;
- },
- /**
- * The flag to stop event bubbling.
- * @type {boolean}
- * @deprecated
- */
- get cancelBubble() {
- return pd(this).stopped;
- },
- set cancelBubble(value) {
- if (!value) {
- return;
- }
- var data = pd(this);
- data.stopped = true;
- if (typeof data.event.cancelBubble === "boolean") {
- data.event.cancelBubble = true;
- }
- },
- /**
- * The flag to indicate cancellation state.
- * @type {boolean}
- * @deprecated
- */
- get returnValue() {
- return !pd(this).canceled;
- },
- set returnValue(value) {
- if (!value) {
- setCancelFlag(pd(this));
- }
- },
- /**
- * Initialize this event object. But do nothing under event dispatching.
- * @param {string} type The event type.
- * @param {boolean} [bubbles=false] The flag to be possible to bubble up.
- * @param {boolean} [cancelable=false] The flag to be possible to cancel.
- * @deprecated
- */
- initEvent: function initEvent() {// Do nothing.
- }
- }; // `constructor` is not enumerable.
- (0, _defineProperty.default)(Event.prototype, "constructor", {
- value: Event,
- configurable: true,
- writable: true
- }); // Ensure `event instanceof window.Event` is `true`.
- if (typeof window !== "undefined" && typeof window.Event !== "undefined") {
- (0, _setPrototypeOf.default)(Event.prototype, window.Event.prototype); // Make association for wrappers.
- wrappers.set(window.Event.prototype, Event);
- }
- /**
- * Get the property descriptor to redirect a given property.
- * @param {string} key Property name to define property descriptor.
- * @returns {PropertyDescriptor} The property descriptor to redirect the property.
- * @private
- */
- function defineRedirectDescriptor(key) {
- return {
- get: function get() {
- return pd(this).event[key];
- },
- set: function set(value) {
- pd(this).event[key] = value;
- },
- configurable: true,
- enumerable: true
- };
- }
- /**
- * Get the property descriptor to call a given method property.
- * @param {string} key Property name to define property descriptor.
- * @returns {PropertyDescriptor} The property descriptor to call the method property.
- * @private
- */
- function defineCallDescriptor(key) {
- return {
- value: function value() {
- var event = pd(this).event;
- return event[key].apply(event, arguments);
- },
- configurable: true,
- enumerable: true
- };
- }
- /**
- * Define new wrapper class.
- * @param {Function} BaseEvent The base wrapper class.
- * @param {Object} proto The prototype of the original event.
- * @returns {Function} The defined wrapper class.
- * @private
- */
- function defineWrapper(BaseEvent, proto) {
- var keys = (0, _keys.default)(proto);
- if (keys.length === 0) {
- return BaseEvent;
- }
- /** CustomEvent */
- function CustomEvent(eventTarget, event) {
- BaseEvent.call(this, eventTarget, event);
- }
- CustomEvent.prototype = Object.create(BaseEvent.prototype, {
- constructor: {
- value: CustomEvent,
- configurable: true,
- writable: true
- }
- }); // Define accessors.
- for (var i = 0; i < keys.length; ++i) {
- var key = keys[i];
- if (!(key in BaseEvent.prototype)) {
- var descriptor = (0, _getOwnPropertyDescriptor.default)(proto, key);
- var isFunc = typeof descriptor.value === "function";
- (0, _defineProperty.default)(CustomEvent.prototype, key, isFunc ? defineCallDescriptor(key) : defineRedirectDescriptor(key));
- }
- }
- return CustomEvent;
- }
- /**
- * Get the wrapper class of a given prototype.
- * @param {Object} proto The prototype of the original event to get its wrapper.
- * @returns {Function} The wrapper class.
- * @private
- */
- function getWrapper(proto) {
- if (proto == null || proto === Object.prototype) {
- return Event;
- }
- var wrapper = wrappers.get(proto);
- if (wrapper == null) {
- wrapper = defineWrapper(getWrapper((0, _getPrototypeOf.default)(proto)), proto);
- wrappers.set(proto, wrapper);
- }
- return wrapper;
- }
- /**
- * Wrap a given event to management a dispatching.
- * @param {EventTarget} eventTarget The event target of this dispatching.
- * @param {Object} event The event to wrap.
- * @returns {Event} The wrapper instance.
- * @private
- */
- function wrapEvent(eventTarget, event) {
- var Wrapper = getWrapper((0, _getPrototypeOf.default)(event));
- return new Wrapper(eventTarget, event);
- }
- /**
- * Get the immediateStopped flag of a given event.
- * @param {Event} event The event to get.
- * @returns {boolean} The flag to stop propagation immediately.
- * @private
- */
- function isStopped(event) {
- return pd(event).immediateStopped;
- }
- /**
- * Set the current event phase of a given event.
- * @param {Event} event The event to set current target.
- * @param {number} eventPhase New event phase.
- * @returns {void}
- * @private
- */
- function setEventPhase(event, eventPhase) {
- pd(event).eventPhase = eventPhase;
- }
- /**
- * Set the current target of a given event.
- * @param {Event} event The event to set current target.
- * @param {EventTarget|null} currentTarget New current target.
- * @returns {void}
- * @private
- */
- function setCurrentTarget(event, currentTarget) {
- pd(event).currentTarget = currentTarget;
- }
- /**
- * Set a passive listener of a given event.
- * @param {Event} event The event to set current target.
- * @param {Function|null} passiveListener New passive listener.
- * @returns {void}
- * @private
- */
- function setPassiveListener(event, passiveListener) {
- pd(event).passiveListener = passiveListener;
- }
- /**
- * @typedef {object} ListenerNode
- * @property {Function} listener
- * @property {1|2|3} listenerType
- * @property {boolean} passive
- * @property {boolean} once
- * @property {ListenerNode|null} next
- * @private
- */
- /**
- * @type {WeakMap<object, Map<string, ListenerNode>>}
- * @private
- */
- var listenersMap = new _weakMap.default(); // Listener types
- var CAPTURE = 1;
- var BUBBLE = 2;
- var ATTRIBUTE = 3;
- /**
- * Check whether a given value is an object or not.
- * @param {any} x The value to check.
- * @returns {boolean} `true` if the value is an object.
- */
- function isObject(x) {
- return x !== null && (0, _typeof2.default)(x) === "object"; //eslint-disable-line no-restricted-syntax
- }
- /**
- * Get listeners.
- * @param {EventTarget} eventTarget The event target to get.
- * @returns {Map<string, ListenerNode>} The listeners.
- * @private
- */
- function getListeners(eventTarget) {
- var listeners = listenersMap.get(eventTarget);
- if (listeners == null) {
- throw new TypeError("'this' is expected an EventTarget object, but got another value.");
- }
- return listeners;
- }
- /**
- * Get the property descriptor for the event attribute of a given event.
- * @param {string} eventName The event name to get property descriptor.
- * @returns {PropertyDescriptor} The property descriptor.
- * @private
- */
- function defineEventAttributeDescriptor(eventName) {
- return {
- get: function get() {
- var listeners = getListeners(this);
- var node = listeners.get(eventName);
- while (node != null) {
- if (node.listenerType === ATTRIBUTE) {
- return node.listener;
- }
- node = node.next;
- }
- return null;
- },
- set: function set(listener) {
- if (typeof listener !== "function" && !isObject(listener)) {
- listener = null; // eslint-disable-line no-param-reassign
- }
- var listeners = getListeners(this); // Traverse to the tail while removing old value.
- var prev = null;
- var node = listeners.get(eventName);
- while (node != null) {
- if (node.listenerType === ATTRIBUTE) {
- // Remove old value.
- if (prev !== null) {
- prev.next = node.next;
- } else if (node.next !== null) {
- listeners.set(eventName, node.next);
- } else {
- listeners.delete(eventName);
- }
- } else {
- prev = node;
- }
- node = node.next;
- } // Add new value.
- if (listener !== null) {
- var newNode = {
- listener: listener,
- listenerType: ATTRIBUTE,
- passive: false,
- once: false,
- next: null
- };
- if (prev === null) {
- listeners.set(eventName, newNode);
- } else {
- prev.next = newNode;
- }
- }
- },
- configurable: true,
- enumerable: true
- };
- }
- /**
- * Define an event attribute (e.g. `eventTarget.onclick`).
- * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.
- * @param {string} eventName The event name to define.
- * @returns {void}
- */
- function defineEventAttribute(eventTargetPrototype, eventName) {
- (0, _defineProperty.default)(eventTargetPrototype, "on".concat(eventName), defineEventAttributeDescriptor(eventName));
- }
- /**
- * Define a custom EventTarget with event attributes.
- * @param {string[]} eventNames Event names for event attributes.
- * @returns {EventTarget} The custom EventTarget.
- * @private
- */
- function defineCustomEventTarget(eventNames) {
- /** CustomEventTarget */
- function CustomEventTarget() {
- EventTarget.call(this);
- }
- CustomEventTarget.prototype = Object.create(EventTarget.prototype, {
- constructor: {
- value: CustomEventTarget,
- configurable: true,
- writable: true
- }
- });
- for (var i = 0; i < eventNames.length; ++i) {
- defineEventAttribute(CustomEventTarget.prototype, eventNames[i]);
- }
- return CustomEventTarget;
- }
- /**
- * EventTarget.
- *
- * - This is constructor if no arguments.
- * - This is a function which returns a CustomEventTarget constructor if there are arguments.
- *
- * For example:
- *
- * class A extends EventTarget {}
- * class B extends EventTarget("message") {}
- * class C extends EventTarget("message", "error") {}
- * class D extends EventTarget(["message", "error"]) {}
- */
- function EventTarget() {
- /*eslint-disable consistent-return */
- if (this instanceof EventTarget) {
- listenersMap.set(this, new _map.default());
- return;
- }
- if (arguments.length === 1 && Array.isArray(arguments[0])) {
- return defineCustomEventTarget(arguments[0]);
- }
- if (arguments.length > 0) {
- var types = new Array(arguments.length);
- for (var i = 0; i < arguments.length; ++i) {
- types[i] = arguments[i];
- }
- return defineCustomEventTarget(types);
- }
- throw new TypeError("Cannot call a class as a function");
- /*eslint-enable consistent-return */
- } // Should be enumerable, but class methods are not enumerable.
- EventTarget.prototype = {
- /**
- * Add a given listener to this event target.
- * @param {string} eventName The event name to add.
- * @param {Function} listener The listener to add.
- * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.
- * @returns {void}
- */
- addEventListener: function addEventListener(eventName, listener, options) {
- if (listener == null) {
- return;
- }
- if (typeof listener !== "function" && !isObject(listener)) {
- throw new TypeError("'listener' should be a function or an object.");
- }
- var listeners = getListeners(this);
- var optionsIsObj = isObject(options);
- var capture = optionsIsObj ? Boolean(options.capture) : Boolean(options);
- var listenerType = capture ? CAPTURE : BUBBLE;
- var newNode = {
- listener: listener,
- listenerType: listenerType,
- passive: optionsIsObj && Boolean(options.passive),
- once: optionsIsObj && Boolean(options.once),
- next: null
- }; // Set it as the first node if the first node is null.
- var node = listeners.get(eventName);
- if (node === undefined) {
- listeners.set(eventName, newNode);
- return;
- } // Traverse to the tail while checking duplication..
- var prev = null;
- while (node != null) {
- if (node.listener === listener && node.listenerType === listenerType) {
- // Should ignore duplication.
- return;
- }
- prev = node;
- node = node.next;
- } // Add it.
- prev.next = newNode;
- },
- /**
- * Remove a given listener from this event target.
- * @param {string} eventName The event name to remove.
- * @param {Function} listener The listener to remove.
- * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.
- * @returns {void}
- */
- removeEventListener: function removeEventListener(eventName, listener, options) {
- if (listener == null) {
- return;
- }
- var listeners = getListeners(this);
- var capture = isObject(options) ? Boolean(options.capture) : Boolean(options);
- var listenerType = capture ? CAPTURE : BUBBLE;
- var prev = null;
- var node = listeners.get(eventName);
- while (node != null) {
- if (node.listener === listener && node.listenerType === listenerType) {
- if (prev !== null) {
- prev.next = node.next;
- } else if (node.next !== null) {
- listeners.set(eventName, node.next);
- } else {
- listeners.delete(eventName);
- }
- return;
- }
- prev = node;
- node = node.next;
- }
- },
- /**
- * Dispatch a given event.
- * @param {Event|{type:string}} event The event to dispatch.
- * @returns {boolean} `false` if canceled.
- */
- dispatchEvent: function dispatchEvent(event) {
- if (event == null || typeof event.type !== "string") {
- throw new TypeError('"event.type" should be a string.');
- } // If listeners aren't registered, terminate.
- var listeners = getListeners(this);
- var eventName = event.type;
- var node = listeners.get(eventName);
- if (node == null) {
- return true;
- } // Since we cannot rewrite several properties, so wrap object.
- var wrappedEvent = wrapEvent(this, event); // This doesn't process capturing phase and bubbling phase.
- // This isn't participating in a tree.
- var prev = null;
- while (node != null) {
- // Remove this listener if it's once
- if (node.once) {
- if (prev !== null) {
- prev.next = node.next;
- } else if (node.next !== null) {
- listeners.set(eventName, node.next);
- } else {
- listeners.delete(eventName);
- }
- } else {
- prev = node;
- } // Call this listener
- setPassiveListener(wrappedEvent, node.passive ? node.listener : null);
- if (typeof node.listener === "function") {
- try {
- node.listener.call(this, wrappedEvent);
- } catch (err) {
- if (typeof console !== "undefined" && typeof console.error === "function") {
- console.error(err);
- }
- }
- } else if (node.listenerType !== ATTRIBUTE && typeof node.listener.handleEvent === "function") {
- node.listener.handleEvent(wrappedEvent);
- } // Break if `event.stopImmediatePropagation` was called.
- if (isStopped(wrappedEvent)) {
- break;
- }
- node = node.next;
- }
- setPassiveListener(wrappedEvent, null);
- setEventPhase(wrappedEvent, 0);
- setCurrentTarget(wrappedEvent, null);
- return !wrappedEvent.defaultPrevented;
- }
- }; // `constructor` is not enumerable.
- (0, _defineProperty.default)(EventTarget.prototype, "constructor", {
- value: EventTarget,
- configurable: true,
- writable: true
- }); // Ensure `eventTarget instanceof window.EventTarget` is `true`.
- if (typeof window !== "undefined" && typeof window.EventTarget !== "undefined") {
- (0, _setPrototypeOf.default)(EventTarget.prototype, window.EventTarget.prototype);
- }
- var WS =
- /** @class */
- function (_super) {
- __extends$1(WS, _super);
- function WS(url, protocol) {
- var _this = _super.call(this) || this;
- _this._readyState = WS.CLOSED;
- if (!url) {
- throw new TypeError("Failed to construct 'WebSocket': url required");
- }
- _this._url = url;
- _this._protocol = protocol;
- return _this;
- }
- (0, _defineProperty.default)(WS.prototype, "url", {
- get: function get() {
- return this._url;
- },
- enumerable: false,
- configurable: true
- });
- (0, _defineProperty.default)(WS.prototype, "protocol", {
- get: function get() {
- return this._protocol;
- },
- enumerable: false,
- configurable: true
- });
- (0, _defineProperty.default)(WS.prototype, "readyState", {
- get: function get() {
- return this._readyState;
- },
- enumerable: false,
- configurable: true
- });
- WS.CONNECTING = 0;
- WS.OPEN = 1;
- WS.CLOSING = 2;
- WS.CLOSED = 3;
- return WS;
- }(EventTarget("open", "error", "message", "close"));
- var WechatWS =
- /** @class */
- function (_super) {
- __extends$1(WechatWS, _super);
- function WechatWS(url, protocol) {
- var _this = _super.call(this, url, protocol) || this;
- if (protocol && !(wx.canIUse && wx.canIUse("connectSocket.object.protocols"))) {
- throw new Error("subprotocol not supported in weapp");
- }
- _this._readyState = WS.CONNECTING;
- var errorHandler = function errorHandler(event) {
- _this._readyState = WS.CLOSED;
- _this.dispatchEvent({
- type: "error",
- message: event.errMsg
- });
- };
- var socketTask = wx.connectSocket({
- url: url,
- protocols: _this._protocol === undefined || Array.isArray(_this._protocol) ? _this._protocol : [_this._protocol],
- fail: function fail(error) {
- return setTimeout(function () {
- return errorHandler(error);
- }, 0);
- }
- });
- _this._socketTask = socketTask;
- socketTask.onOpen(function () {
- _this._readyState = WS.OPEN;
- _this.dispatchEvent({
- type: "open"
- });
- });
- socketTask.onError(errorHandler);
- socketTask.onMessage(function (event) {
- var data = event.data;
- _this.dispatchEvent({
- data: data,
- type: "message"
- });
- });
- socketTask.onClose(function (event) {
- _this._readyState = WS.CLOSED;
- var code = event.code,
- reason = event.reason;
- _this.dispatchEvent({
- code: code,
- reason: reason,
- type: "close"
- });
- });
- return _this;
- }
- WechatWS.prototype.close = function () {
- if (this.readyState === WS.CLOSED) return;
- if (this.readyState === WS.CONNECTING) {
- console.warn("close WebSocket which is connecting might not work");
- }
- this._socketTask.close({});
- };
- WechatWS.prototype.send = function (data) {
- if (this.readyState !== WS.OPEN) {
- throw new Error("INVALID_STATE_ERR");
- }
- if (!(typeof data === "string" || data instanceof ArrayBuffer)) {
- throw new TypeError("only String/ArrayBuffer supported");
- }
- this._socketTask.send({
- data: data
- });
- };
- return WechatWS;
- }(WS);
- var WebSocket = WechatWS;
- var platformInfo = {
- name: "Weapp"
- };
- exports.WebSocket = WebSocket;
- exports.getAuthInfo = getAuthInfo;
- exports.platformInfo = platformInfo;
- exports.request = request;
- exports.storage = storage;
- exports.upload = upload;
- /***/ }),
- /* 547 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(548);
- /***/ }),
- /* 548 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(549);
- module.exports = parent;
- /***/ }),
- /* 549 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(550);
- var path = __webpack_require__(10);
- module.exports = path.Object.assign;
- /***/ }),
- /* 550 */
- /***/ (function(module, exports, __webpack_require__) {
- var $ = __webpack_require__(0);
- var assign = __webpack_require__(551);
- // `Object.assign` method
- // https://tc39.es/ecma262/#sec-object.assign
- // eslint-disable-next-line es-x/no-object-assign -- required for testing
- $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
- assign: assign
- });
- /***/ }),
- /* 551 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var DESCRIPTORS = __webpack_require__(16);
- var uncurryThis = __webpack_require__(4);
- var call = __webpack_require__(13);
- var fails = __webpack_require__(3);
- var objectKeys = __webpack_require__(98);
- var getOwnPropertySymbolsModule = __webpack_require__(97);
- var propertyIsEnumerableModule = __webpack_require__(113);
- var toObject = __webpack_require__(34);
- var IndexedObject = __webpack_require__(114);
- // eslint-disable-next-line es-x/no-object-assign -- safe
- var $assign = Object.assign;
- // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
- var defineProperty = Object.defineProperty;
- var concat = uncurryThis([].concat);
- // `Object.assign` method
- // https://tc39.es/ecma262/#sec-object.assign
- module.exports = !$assign || fails(function () {
- // should have correct order of operations (Edge bug)
- if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
- enumerable: true,
- get: function () {
- defineProperty(this, 'b', {
- value: 3,
- enumerable: false
- });
- }
- }), { b: 2 })).b !== 1) return true;
- // should work with symbols and should have deterministic property order (V8 bug)
- var A = {};
- var B = {};
- // eslint-disable-next-line es-x/no-symbol -- safe
- var symbol = Symbol();
- var alphabet = 'abcdefghijklmnopqrst';
- A[symbol] = 7;
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
- return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
- var T = toObject(target);
- var argumentsLength = arguments.length;
- var index = 1;
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
- while (argumentsLength > index) {
- var S = IndexedObject(arguments[index++]);
- var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
- var length = keys.length;
- var j = 0;
- var key;
- while (length > j) {
- key = keys[j++];
- if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
- }
- } return T;
- } : $assign;
- /***/ }),
- /* 552 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(553);
- /***/ }),
- /* 553 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(554);
- module.exports = parent;
- /***/ }),
- /* 554 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(233);
- var path = __webpack_require__(10);
- module.exports = path.Object.getOwnPropertySymbols;
- /***/ }),
- /* 555 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(238);
- /***/ }),
- /* 556 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(557);
- /***/ }),
- /* 557 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(558);
- __webpack_require__(51);
- module.exports = parent;
- /***/ }),
- /* 558 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(48);
- __webpack_require__(60);
- __webpack_require__(559);
- var path = __webpack_require__(10);
- module.exports = path.WeakMap;
- /***/ }),
- /* 559 */
- /***/ (function(module, exports, __webpack_require__) {
- // TODO: Remove this module from `core-js@4` since it's replaced to module below
- __webpack_require__(560);
- /***/ }),
- /* 560 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var global = __webpack_require__(6);
- var uncurryThis = __webpack_require__(4);
- var defineBuiltIns = __webpack_require__(146);
- var InternalMetadataModule = __webpack_require__(111);
- var collection = __webpack_require__(248);
- var collectionWeak = __webpack_require__(563);
- var isObject = __webpack_require__(11);
- var isExtensible = __webpack_require__(247);
- var enforceInternalState = __webpack_require__(38).enforce;
- var NATIVE_WEAK_MAP = __webpack_require__(160);
- var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
- var InternalWeakMap;
- var wrapper = function (init) {
- return function WeakMap() {
- return init(this, arguments.length ? arguments[0] : undefined);
- };
- };
- // `WeakMap` constructor
- // https://tc39.es/ecma262/#sec-weakmap-constructor
- var $WeakMap = collection('WeakMap', wrapper, collectionWeak);
- // IE11 WeakMap frozen keys fix
- // We can't use feature detection because it crash some old IE builds
- // https://github.com/zloirock/core-js/issues/485
- if (NATIVE_WEAK_MAP && IS_IE11) {
- InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);
- InternalMetadataModule.enable();
- var WeakMapPrototype = $WeakMap.prototype;
- var nativeDelete = uncurryThis(WeakMapPrototype['delete']);
- var nativeHas = uncurryThis(WeakMapPrototype.has);
- var nativeGet = uncurryThis(WeakMapPrototype.get);
- var nativeSet = uncurryThis(WeakMapPrototype.set);
- defineBuiltIns(WeakMapPrototype, {
- 'delete': function (key) {
- if (isObject(key) && !isExtensible(key)) {
- var state = enforceInternalState(this);
- if (!state.frozen) state.frozen = new InternalWeakMap();
- return nativeDelete(this, key) || state.frozen['delete'](key);
- } return nativeDelete(this, key);
- },
- has: function has(key) {
- if (isObject(key) && !isExtensible(key)) {
- var state = enforceInternalState(this);
- if (!state.frozen) state.frozen = new InternalWeakMap();
- return nativeHas(this, key) || state.frozen.has(key);
- } return nativeHas(this, key);
- },
- get: function get(key) {
- if (isObject(key) && !isExtensible(key)) {
- var state = enforceInternalState(this);
- if (!state.frozen) state.frozen = new InternalWeakMap();
- return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);
- } return nativeGet(this, key);
- },
- set: function set(key, value) {
- if (isObject(key) && !isExtensible(key)) {
- var state = enforceInternalState(this);
- if (!state.frozen) state.frozen = new InternalWeakMap();
- nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);
- } else nativeSet(this, key, value);
- return this;
- }
- });
- }
- /***/ }),
- /* 561 */
- /***/ (function(module, exports, __webpack_require__) {
- // FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it
- var fails = __webpack_require__(3);
- module.exports = fails(function () {
- if (typeof ArrayBuffer == 'function') {
- var buffer = new ArrayBuffer(8);
- // eslint-disable-next-line es-x/no-object-isextensible, es-x/no-object-defineproperty -- safe
- if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
- }
- });
- /***/ }),
- /* 562 */
- /***/ (function(module, exports, __webpack_require__) {
- var fails = __webpack_require__(3);
- module.exports = !fails(function () {
- // eslint-disable-next-line es-x/no-object-isextensible, es-x/no-object-preventextensions -- required for testing
- return Object.isExtensible(Object.preventExtensions({}));
- });
- /***/ }),
- /* 563 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var uncurryThis = __webpack_require__(4);
- var defineBuiltIns = __webpack_require__(146);
- var getWeakData = __webpack_require__(111).getWeakData;
- var anObject = __webpack_require__(19);
- var isObject = __webpack_require__(11);
- var anInstance = __webpack_require__(100);
- var iterate = __webpack_require__(37);
- var ArrayIterationModule = __webpack_require__(66);
- var hasOwn = __webpack_require__(14);
- var InternalStateModule = __webpack_require__(38);
- var setInternalState = InternalStateModule.set;
- var internalStateGetterFor = InternalStateModule.getterFor;
- var find = ArrayIterationModule.find;
- var findIndex = ArrayIterationModule.findIndex;
- var splice = uncurryThis([].splice);
- var id = 0;
- // fallback for uncaught frozen keys
- var uncaughtFrozenStore = function (store) {
- return store.frozen || (store.frozen = new UncaughtFrozenStore());
- };
- var UncaughtFrozenStore = function () {
- this.entries = [];
- };
- var findUncaughtFrozen = function (store, key) {
- return find(store.entries, function (it) {
- return it[0] === key;
- });
- };
- UncaughtFrozenStore.prototype = {
- get: function (key) {
- var entry = findUncaughtFrozen(this, key);
- if (entry) return entry[1];
- },
- has: function (key) {
- return !!findUncaughtFrozen(this, key);
- },
- set: function (key, value) {
- var entry = findUncaughtFrozen(this, key);
- if (entry) entry[1] = value;
- else this.entries.push([key, value]);
- },
- 'delete': function (key) {
- var index = findIndex(this.entries, function (it) {
- return it[0] === key;
- });
- if (~index) splice(this.entries, index, 1);
- return !!~index;
- }
- };
- module.exports = {
- getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
- var Constructor = wrapper(function (that, iterable) {
- anInstance(that, Prototype);
- setInternalState(that, {
- type: CONSTRUCTOR_NAME,
- id: id++,
- frozen: undefined
- });
- if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
- });
- var Prototype = Constructor.prototype;
- var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
- var define = function (that, key, value) {
- var state = getInternalState(that);
- var data = getWeakData(anObject(key), true);
- if (data === true) uncaughtFrozenStore(state).set(key, value);
- else data[state.id] = value;
- return that;
- };
- defineBuiltIns(Prototype, {
- // `{ WeakMap, WeakSet }.prototype.delete(key)` methods
- // https://tc39.es/ecma262/#sec-weakmap.prototype.delete
- // https://tc39.es/ecma262/#sec-weakset.prototype.delete
- 'delete': function (key) {
- var state = getInternalState(this);
- if (!isObject(key)) return false;
- var data = getWeakData(key);
- if (data === true) return uncaughtFrozenStore(state)['delete'](key);
- return data && hasOwn(data, state.id) && delete data[state.id];
- },
- // `{ WeakMap, WeakSet }.prototype.has(key)` methods
- // https://tc39.es/ecma262/#sec-weakmap.prototype.has
- // https://tc39.es/ecma262/#sec-weakset.prototype.has
- has: function has(key) {
- var state = getInternalState(this);
- if (!isObject(key)) return false;
- var data = getWeakData(key);
- if (data === true) return uncaughtFrozenStore(state).has(key);
- return data && hasOwn(data, state.id);
- }
- });
- defineBuiltIns(Prototype, IS_MAP ? {
- // `WeakMap.prototype.get(key)` method
- // https://tc39.es/ecma262/#sec-weakmap.prototype.get
- get: function get(key) {
- var state = getInternalState(this);
- if (isObject(key)) {
- var data = getWeakData(key);
- if (data === true) return uncaughtFrozenStore(state).get(key);
- return data ? data[state.id] : undefined;
- }
- },
- // `WeakMap.prototype.set(key, value)` method
- // https://tc39.es/ecma262/#sec-weakmap.prototype.set
- set: function set(key, value) {
- return define(this, key, value);
- }
- } : {
- // `WeakSet.prototype.add(value)` method
- // https://tc39.es/ecma262/#sec-weakset.prototype.add
- add: function add(value) {
- return define(this, value, true);
- }
- });
- return Constructor;
- }
- };
- /***/ }),
- /* 564 */
- /***/ (function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(565);
- /***/ }),
- /* 565 */
- /***/ (function(module, exports, __webpack_require__) {
- var parent = __webpack_require__(566);
- __webpack_require__(51);
- module.exports = parent;
- /***/ }),
- /* 566 */
- /***/ (function(module, exports, __webpack_require__) {
- __webpack_require__(48);
- __webpack_require__(567);
- __webpack_require__(60);
- __webpack_require__(78);
- var path = __webpack_require__(10);
- module.exports = path.Map;
- /***/ }),
- /* 567 */
- /***/ (function(module, exports, __webpack_require__) {
- // TODO: Remove this module from `core-js@4` since it's replaced to module below
- __webpack_require__(568);
- /***/ }),
- /* 568 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var collection = __webpack_require__(248);
- var collectionStrong = __webpack_require__(569);
- // `Map` constructor
- // https://tc39.es/ecma262/#sec-map-objects
- collection('Map', function (init) {
- return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
- }, collectionStrong);
- /***/ }),
- /* 569 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var defineProperty = __webpack_require__(22).f;
- var create = __webpack_require__(47);
- var defineBuiltIns = __webpack_require__(146);
- var bind = __webpack_require__(45);
- var anInstance = __webpack_require__(100);
- var iterate = __webpack_require__(37);
- var defineIterator = __webpack_require__(124);
- var setSpecies = __webpack_require__(162);
- var DESCRIPTORS = __webpack_require__(16);
- var fastKey = __webpack_require__(111).fastKey;
- var InternalStateModule = __webpack_require__(38);
- var setInternalState = InternalStateModule.set;
- var internalStateGetterFor = InternalStateModule.getterFor;
- module.exports = {
- getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
- var Constructor = wrapper(function (that, iterable) {
- anInstance(that, Prototype);
- setInternalState(that, {
- type: CONSTRUCTOR_NAME,
- index: create(null),
- first: undefined,
- last: undefined,
- size: 0
- });
- if (!DESCRIPTORS) that.size = 0;
- if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
- });
- var Prototype = Constructor.prototype;
- var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
- var define = function (that, key, value) {
- var state = getInternalState(that);
- var entry = getEntry(that, key);
- var previous, index;
- // change existing entry
- if (entry) {
- entry.value = value;
- // create new entry
- } else {
- state.last = entry = {
- index: index = fastKey(key, true),
- key: key,
- value: value,
- previous: previous = state.last,
- next: undefined,
- removed: false
- };
- if (!state.first) state.first = entry;
- if (previous) previous.next = entry;
- if (DESCRIPTORS) state.size++;
- else that.size++;
- // add to index
- if (index !== 'F') state.index[index] = entry;
- } return that;
- };
- var getEntry = function (that, key) {
- var state = getInternalState(that);
- // fast case
- var index = fastKey(key);
- var entry;
- if (index !== 'F') return state.index[index];
- // frozen object case
- for (entry = state.first; entry; entry = entry.next) {
- if (entry.key == key) return entry;
- }
- };
- defineBuiltIns(Prototype, {
- // `{ Map, Set }.prototype.clear()` methods
- // https://tc39.es/ecma262/#sec-map.prototype.clear
- // https://tc39.es/ecma262/#sec-set.prototype.clear
- clear: function clear() {
- var that = this;
- var state = getInternalState(that);
- var data = state.index;
- var entry = state.first;
- while (entry) {
- entry.removed = true;
- if (entry.previous) entry.previous = entry.previous.next = undefined;
- delete data[entry.index];
- entry = entry.next;
- }
- state.first = state.last = undefined;
- if (DESCRIPTORS) state.size = 0;
- else that.size = 0;
- },
- // `{ Map, Set }.prototype.delete(key)` methods
- // https://tc39.es/ecma262/#sec-map.prototype.delete
- // https://tc39.es/ecma262/#sec-set.prototype.delete
- 'delete': function (key) {
- var that = this;
- var state = getInternalState(that);
- var entry = getEntry(that, key);
- if (entry) {
- var next = entry.next;
- var prev = entry.previous;
- delete state.index[entry.index];
- entry.removed = true;
- if (prev) prev.next = next;
- if (next) next.previous = prev;
- if (state.first == entry) state.first = next;
- if (state.last == entry) state.last = prev;
- if (DESCRIPTORS) state.size--;
- else that.size--;
- } return !!entry;
- },
- // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods
- // https://tc39.es/ecma262/#sec-map.prototype.foreach
- // https://tc39.es/ecma262/#sec-set.prototype.foreach
- forEach: function forEach(callbackfn /* , that = undefined */) {
- var state = getInternalState(this);
- var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
- var entry;
- while (entry = entry ? entry.next : state.first) {
- boundFunction(entry.value, entry.key, this);
- // revert to the last existing entry
- while (entry && entry.removed) entry = entry.previous;
- }
- },
- // `{ Map, Set}.prototype.has(key)` methods
- // https://tc39.es/ecma262/#sec-map.prototype.has
- // https://tc39.es/ecma262/#sec-set.prototype.has
- has: function has(key) {
- return !!getEntry(this, key);
- }
- });
- defineBuiltIns(Prototype, IS_MAP ? {
- // `Map.prototype.get(key)` method
- // https://tc39.es/ecma262/#sec-map.prototype.get
- get: function get(key) {
- var entry = getEntry(this, key);
- return entry && entry.value;
- },
- // `Map.prototype.set(key, value)` method
- // https://tc39.es/ecma262/#sec-map.prototype.set
- set: function set(key, value) {
- return define(this, key === 0 ? 0 : key, value);
- }
- } : {
- // `Set.prototype.add(value)` method
- // https://tc39.es/ecma262/#sec-set.prototype.add
- add: function add(value) {
- return define(this, value = value === 0 ? 0 : value, value);
- }
- });
- if (DESCRIPTORS) defineProperty(Prototype, 'size', {
- get: function () {
- return getInternalState(this).size;
- }
- });
- return Constructor;
- },
- setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
- var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
- var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
- var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
- // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods
- // https://tc39.es/ecma262/#sec-map.prototype.entries
- // https://tc39.es/ecma262/#sec-map.prototype.keys
- // https://tc39.es/ecma262/#sec-map.prototype.values
- // https://tc39.es/ecma262/#sec-map.prototype-@@iterator
- // https://tc39.es/ecma262/#sec-set.prototype.entries
- // https://tc39.es/ecma262/#sec-set.prototype.keys
- // https://tc39.es/ecma262/#sec-set.prototype.values
- // https://tc39.es/ecma262/#sec-set.prototype-@@iterator
- defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
- setInternalState(this, {
- type: ITERATOR_NAME,
- target: iterated,
- state: getInternalCollectionState(iterated),
- kind: kind,
- last: undefined
- });
- }, function () {
- var state = getInternalIteratorState(this);
- var kind = state.kind;
- var entry = state.last;
- // revert to the last existing entry
- while (entry && entry.removed) entry = entry.previous;
- // get next entry
- if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
- // or finish the iteration
- state.target = undefined;
- return { value: undefined, done: true };
- }
- // return step by kind
- if (kind == 'keys') return { value: entry.key, done: false };
- if (kind == 'values') return { value: entry.value, done: false };
- return { value: [entry.key, entry.value], done: false };
- }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
- // `{ Map, Set }.prototype[@@species]` accessors
- // https://tc39.es/ecma262/#sec-get-map-@@species
- // https://tc39.es/ecma262/#sec-get-set-@@species
- setSpecies(CONSTRUCTOR_NAME);
- }
- };
- /***/ })
- /******/ ]);
- });
- //# sourceMappingURL=av-weapp.js.map
|