ReactNativeRenderer-prod.js 260 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @noflow
  8. * @nolint
  9. * @providesModule ReactNativeRenderer-prod
  10. * @preventMunge
  11. * @generated
  12. */
  13. "use strict";
  14. require("react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore");
  15. var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/ReactNativePrivateInterface"),
  16. React = require("react"),
  17. Scheduler = require("scheduler");
  18. function getParent(inst) {
  19. do inst = inst.return;
  20. while (inst && 5 !== inst.tag);
  21. return inst ? inst : null;
  22. }
  23. function traverseTwoPhase(inst, fn, arg) {
  24. for (var path = []; inst; ) path.push(inst), (inst = getParent(inst));
  25. for (inst = path.length; 0 < inst--; ) fn(path[inst], "captured", arg);
  26. for (inst = 0; inst < path.length; inst++) fn(path[inst], "bubbled", arg);
  27. }
  28. function invokeGuardedCallbackImpl(name, func, context, a, b, c, d, e, f) {
  29. var funcArgs = Array.prototype.slice.call(arguments, 3);
  30. try {
  31. func.apply(context, funcArgs);
  32. } catch (error) {
  33. this.onError(error);
  34. }
  35. }
  36. var hasError = !1,
  37. caughtError = null,
  38. hasRethrowError = !1,
  39. rethrowError = null,
  40. reporter = {
  41. onError: function(error) {
  42. hasError = !0;
  43. caughtError = error;
  44. }
  45. };
  46. function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
  47. hasError = !1;
  48. caughtError = null;
  49. invokeGuardedCallbackImpl.apply(reporter, arguments);
  50. }
  51. function invokeGuardedCallbackAndCatchFirstError(
  52. name,
  53. func,
  54. context,
  55. a,
  56. b,
  57. c,
  58. d,
  59. e,
  60. f
  61. ) {
  62. invokeGuardedCallback.apply(this, arguments);
  63. if (hasError) {
  64. if (hasError) {
  65. var error = caughtError;
  66. hasError = !1;
  67. caughtError = null;
  68. } else
  69. throw Error(
  70. "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue."
  71. );
  72. hasRethrowError || ((hasRethrowError = !0), (rethrowError = error));
  73. }
  74. }
  75. var getFiberCurrentPropsFromNode = null,
  76. getInstanceFromNode = null,
  77. getNodeFromInstance = null;
  78. function executeDispatch(event, listener, inst) {
  79. var type = event.type || "unknown-event";
  80. event.currentTarget = getNodeFromInstance(inst);
  81. invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event);
  82. event.currentTarget = null;
  83. }
  84. function executeDirectDispatch(event) {
  85. var dispatchListener = event._dispatchListeners,
  86. dispatchInstance = event._dispatchInstances;
  87. if (Array.isArray(dispatchListener))
  88. throw Error("executeDirectDispatch(...): Invalid `event`.");
  89. event.currentTarget = dispatchListener
  90. ? getNodeFromInstance(dispatchInstance)
  91. : null;
  92. dispatchListener = dispatchListener ? dispatchListener(event) : null;
  93. event.currentTarget = null;
  94. event._dispatchListeners = null;
  95. event._dispatchInstances = null;
  96. return dispatchListener;
  97. }
  98. function getListener(inst, registrationName) {
  99. var listener = inst.stateNode;
  100. if (!listener) return null;
  101. var props = getFiberCurrentPropsFromNode(listener);
  102. if (!props) return null;
  103. listener = props[registrationName];
  104. a: switch (registrationName) {
  105. case "onClick":
  106. case "onClickCapture":
  107. case "onDoubleClick":
  108. case "onDoubleClickCapture":
  109. case "onMouseDown":
  110. case "onMouseDownCapture":
  111. case "onMouseMove":
  112. case "onMouseMoveCapture":
  113. case "onMouseUp":
  114. case "onMouseUpCapture":
  115. case "onMouseEnter":
  116. (props = !props.disabled) ||
  117. ((inst = inst.type),
  118. (props = !(
  119. "button" === inst ||
  120. "input" === inst ||
  121. "select" === inst ||
  122. "textarea" === inst
  123. )));
  124. inst = !props;
  125. break a;
  126. default:
  127. inst = !1;
  128. }
  129. if (inst) return null;
  130. if (listener && "function" !== typeof listener)
  131. throw Error(
  132. "Expected `" +
  133. registrationName +
  134. "` listener to be a function, instead got a value of `" +
  135. typeof listener +
  136. "` type."
  137. );
  138. return listener;
  139. }
  140. function accumulateInto(current, next) {
  141. if (null == next)
  142. throw Error(
  143. "accumulateInto(...): Accumulated items must not be null or undefined."
  144. );
  145. if (null == current) return next;
  146. if (Array.isArray(current)) {
  147. if (Array.isArray(next)) return current.push.apply(current, next), current;
  148. current.push(next);
  149. return current;
  150. }
  151. return Array.isArray(next) ? [current].concat(next) : [current, next];
  152. }
  153. function forEachAccumulated(arr, cb, scope) {
  154. Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr);
  155. }
  156. function accumulateDirectionalDispatches(inst, phase, event) {
  157. if (
  158. (phase = getListener(
  159. inst,
  160. event.dispatchConfig.phasedRegistrationNames[phase]
  161. ))
  162. )
  163. (event._dispatchListeners = accumulateInto(
  164. event._dispatchListeners,
  165. phase
  166. )),
  167. (event._dispatchInstances = accumulateInto(
  168. event._dispatchInstances,
  169. inst
  170. ));
  171. }
  172. function accumulateTwoPhaseDispatchesSingle(event) {
  173. event &&
  174. event.dispatchConfig.phasedRegistrationNames &&
  175. traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
  176. }
  177. function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
  178. if (event && event.dispatchConfig.phasedRegistrationNames) {
  179. var targetInst = event._targetInst;
  180. targetInst = targetInst ? getParent(targetInst) : null;
  181. traverseTwoPhase(targetInst, accumulateDirectionalDispatches, event);
  182. }
  183. }
  184. function accumulateDirectDispatchesSingle(event) {
  185. if (event && event.dispatchConfig.registrationName) {
  186. var inst = event._targetInst;
  187. if (inst && event && event.dispatchConfig.registrationName) {
  188. var listener = getListener(inst, event.dispatchConfig.registrationName);
  189. listener &&
  190. ((event._dispatchListeners = accumulateInto(
  191. event._dispatchListeners,
  192. listener
  193. )),
  194. (event._dispatchInstances = accumulateInto(
  195. event._dispatchInstances,
  196. inst
  197. )));
  198. }
  199. }
  200. }
  201. function functionThatReturnsTrue() {
  202. return !0;
  203. }
  204. function functionThatReturnsFalse() {
  205. return !1;
  206. }
  207. function SyntheticEvent(
  208. dispatchConfig,
  209. targetInst,
  210. nativeEvent,
  211. nativeEventTarget
  212. ) {
  213. this.dispatchConfig = dispatchConfig;
  214. this._targetInst = targetInst;
  215. this.nativeEvent = nativeEvent;
  216. dispatchConfig = this.constructor.Interface;
  217. for (var propName in dispatchConfig)
  218. dispatchConfig.hasOwnProperty(propName) &&
  219. ((targetInst = dispatchConfig[propName])
  220. ? (this[propName] = targetInst(nativeEvent))
  221. : "target" === propName
  222. ? (this.target = nativeEventTarget)
  223. : (this[propName] = nativeEvent[propName]));
  224. this.isDefaultPrevented = (null != nativeEvent.defaultPrevented
  225. ? nativeEvent.defaultPrevented
  226. : !1 === nativeEvent.returnValue)
  227. ? functionThatReturnsTrue
  228. : functionThatReturnsFalse;
  229. this.isPropagationStopped = functionThatReturnsFalse;
  230. return this;
  231. }
  232. Object.assign(SyntheticEvent.prototype, {
  233. preventDefault: function() {
  234. this.defaultPrevented = !0;
  235. var event = this.nativeEvent;
  236. event &&
  237. (event.preventDefault
  238. ? event.preventDefault()
  239. : "unknown" !== typeof event.returnValue && (event.returnValue = !1),
  240. (this.isDefaultPrevented = functionThatReturnsTrue));
  241. },
  242. stopPropagation: function() {
  243. var event = this.nativeEvent;
  244. event &&
  245. (event.stopPropagation
  246. ? event.stopPropagation()
  247. : "unknown" !== typeof event.cancelBubble && (event.cancelBubble = !0),
  248. (this.isPropagationStopped = functionThatReturnsTrue));
  249. },
  250. persist: function() {
  251. this.isPersistent = functionThatReturnsTrue;
  252. },
  253. isPersistent: functionThatReturnsFalse,
  254. destructor: function() {
  255. var Interface = this.constructor.Interface,
  256. propName;
  257. for (propName in Interface) this[propName] = null;
  258. this.nativeEvent = this._targetInst = this.dispatchConfig = null;
  259. this.isPropagationStopped = this.isDefaultPrevented = functionThatReturnsFalse;
  260. this._dispatchInstances = this._dispatchListeners = null;
  261. }
  262. });
  263. SyntheticEvent.Interface = {
  264. type: null,
  265. target: null,
  266. currentTarget: function() {
  267. return null;
  268. },
  269. eventPhase: null,
  270. bubbles: null,
  271. cancelable: null,
  272. timeStamp: function(event) {
  273. return event.timeStamp || Date.now();
  274. },
  275. defaultPrevented: null,
  276. isTrusted: null
  277. };
  278. SyntheticEvent.extend = function(Interface) {
  279. function E() {}
  280. function Class() {
  281. return Super.apply(this, arguments);
  282. }
  283. var Super = this;
  284. E.prototype = Super.prototype;
  285. var prototype = new E();
  286. Object.assign(prototype, Class.prototype);
  287. Class.prototype = prototype;
  288. Class.prototype.constructor = Class;
  289. Class.Interface = Object.assign({}, Super.Interface, Interface);
  290. Class.extend = Super.extend;
  291. addEventPoolingTo(Class);
  292. return Class;
  293. };
  294. addEventPoolingTo(SyntheticEvent);
  295. function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
  296. if (this.eventPool.length) {
  297. var instance = this.eventPool.pop();
  298. this.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
  299. return instance;
  300. }
  301. return new this(dispatchConfig, targetInst, nativeEvent, nativeInst);
  302. }
  303. function releasePooledEvent(event) {
  304. if (!(event instanceof this))
  305. throw Error(
  306. "Trying to release an event instance into a pool of a different type."
  307. );
  308. event.destructor();
  309. 10 > this.eventPool.length && this.eventPool.push(event);
  310. }
  311. function addEventPoolingTo(EventConstructor) {
  312. EventConstructor.eventPool = [];
  313. EventConstructor.getPooled = getPooledEvent;
  314. EventConstructor.release = releasePooledEvent;
  315. }
  316. var ResponderSyntheticEvent = SyntheticEvent.extend({
  317. touchHistory: function() {
  318. return null;
  319. }
  320. });
  321. function isStartish(topLevelType) {
  322. return "topTouchStart" === topLevelType;
  323. }
  324. function isMoveish(topLevelType) {
  325. return "topTouchMove" === topLevelType;
  326. }
  327. var startDependencies = ["topTouchStart"],
  328. moveDependencies = ["topTouchMove"],
  329. endDependencies = ["topTouchCancel", "topTouchEnd"],
  330. touchBank = [],
  331. touchHistory = {
  332. touchBank: touchBank,
  333. numberActiveTouches: 0,
  334. indexOfSingleActiveTouch: -1,
  335. mostRecentTimeStamp: 0
  336. };
  337. function timestampForTouch(touch) {
  338. return touch.timeStamp || touch.timestamp;
  339. }
  340. function getTouchIdentifier(_ref) {
  341. _ref = _ref.identifier;
  342. if (null == _ref) throw Error("Touch object is missing identifier.");
  343. return _ref;
  344. }
  345. function recordTouchStart(touch) {
  346. var identifier = getTouchIdentifier(touch),
  347. touchRecord = touchBank[identifier];
  348. touchRecord
  349. ? ((touchRecord.touchActive = !0),
  350. (touchRecord.startPageX = touch.pageX),
  351. (touchRecord.startPageY = touch.pageY),
  352. (touchRecord.startTimeStamp = timestampForTouch(touch)),
  353. (touchRecord.currentPageX = touch.pageX),
  354. (touchRecord.currentPageY = touch.pageY),
  355. (touchRecord.currentTimeStamp = timestampForTouch(touch)),
  356. (touchRecord.previousPageX = touch.pageX),
  357. (touchRecord.previousPageY = touch.pageY),
  358. (touchRecord.previousTimeStamp = timestampForTouch(touch)))
  359. : ((touchRecord = {
  360. touchActive: !0,
  361. startPageX: touch.pageX,
  362. startPageY: touch.pageY,
  363. startTimeStamp: timestampForTouch(touch),
  364. currentPageX: touch.pageX,
  365. currentPageY: touch.pageY,
  366. currentTimeStamp: timestampForTouch(touch),
  367. previousPageX: touch.pageX,
  368. previousPageY: touch.pageY,
  369. previousTimeStamp: timestampForTouch(touch)
  370. }),
  371. (touchBank[identifier] = touchRecord));
  372. touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
  373. }
  374. function recordTouchMove(touch) {
  375. var touchRecord = touchBank[getTouchIdentifier(touch)];
  376. touchRecord &&
  377. ((touchRecord.touchActive = !0),
  378. (touchRecord.previousPageX = touchRecord.currentPageX),
  379. (touchRecord.previousPageY = touchRecord.currentPageY),
  380. (touchRecord.previousTimeStamp = touchRecord.currentTimeStamp),
  381. (touchRecord.currentPageX = touch.pageX),
  382. (touchRecord.currentPageY = touch.pageY),
  383. (touchRecord.currentTimeStamp = timestampForTouch(touch)),
  384. (touchHistory.mostRecentTimeStamp = timestampForTouch(touch)));
  385. }
  386. function recordTouchEnd(touch) {
  387. var touchRecord = touchBank[getTouchIdentifier(touch)];
  388. touchRecord &&
  389. ((touchRecord.touchActive = !1),
  390. (touchRecord.previousPageX = touchRecord.currentPageX),
  391. (touchRecord.previousPageY = touchRecord.currentPageY),
  392. (touchRecord.previousTimeStamp = touchRecord.currentTimeStamp),
  393. (touchRecord.currentPageX = touch.pageX),
  394. (touchRecord.currentPageY = touch.pageY),
  395. (touchRecord.currentTimeStamp = timestampForTouch(touch)),
  396. (touchHistory.mostRecentTimeStamp = timestampForTouch(touch)));
  397. }
  398. var ResponderTouchHistoryStore = {
  399. recordTouchTrack: function(topLevelType, nativeEvent) {
  400. if (isMoveish(topLevelType))
  401. nativeEvent.changedTouches.forEach(recordTouchMove);
  402. else if (isStartish(topLevelType))
  403. nativeEvent.changedTouches.forEach(recordTouchStart),
  404. (touchHistory.numberActiveTouches = nativeEvent.touches.length),
  405. 1 === touchHistory.numberActiveTouches &&
  406. (touchHistory.indexOfSingleActiveTouch =
  407. nativeEvent.touches[0].identifier);
  408. else if (
  409. "topTouchEnd" === topLevelType ||
  410. "topTouchCancel" === topLevelType
  411. )
  412. if (
  413. (nativeEvent.changedTouches.forEach(recordTouchEnd),
  414. (touchHistory.numberActiveTouches = nativeEvent.touches.length),
  415. 1 === touchHistory.numberActiveTouches)
  416. )
  417. for (topLevelType = 0; topLevelType < touchBank.length; topLevelType++)
  418. if (
  419. ((nativeEvent = touchBank[topLevelType]),
  420. null != nativeEvent && nativeEvent.touchActive)
  421. ) {
  422. touchHistory.indexOfSingleActiveTouch = topLevelType;
  423. break;
  424. }
  425. },
  426. touchHistory: touchHistory
  427. };
  428. function accumulate(current, next) {
  429. if (null == next)
  430. throw Error(
  431. "accumulate(...): Accumulated items must not be null or undefined."
  432. );
  433. return null == current
  434. ? next
  435. : Array.isArray(current)
  436. ? current.concat(next)
  437. : Array.isArray(next)
  438. ? [current].concat(next)
  439. : [current, next];
  440. }
  441. var responderInst = null,
  442. trackedTouchCount = 0;
  443. function changeResponder(nextResponderInst, blockHostResponder) {
  444. var oldResponderInst = responderInst;
  445. responderInst = nextResponderInst;
  446. if (null !== ResponderEventPlugin.GlobalResponderHandler)
  447. ResponderEventPlugin.GlobalResponderHandler.onChange(
  448. oldResponderInst,
  449. nextResponderInst,
  450. blockHostResponder
  451. );
  452. }
  453. var eventTypes = {
  454. startShouldSetResponder: {
  455. phasedRegistrationNames: {
  456. bubbled: "onStartShouldSetResponder",
  457. captured: "onStartShouldSetResponderCapture"
  458. },
  459. dependencies: startDependencies
  460. },
  461. scrollShouldSetResponder: {
  462. phasedRegistrationNames: {
  463. bubbled: "onScrollShouldSetResponder",
  464. captured: "onScrollShouldSetResponderCapture"
  465. },
  466. dependencies: ["topScroll"]
  467. },
  468. selectionChangeShouldSetResponder: {
  469. phasedRegistrationNames: {
  470. bubbled: "onSelectionChangeShouldSetResponder",
  471. captured: "onSelectionChangeShouldSetResponderCapture"
  472. },
  473. dependencies: ["topSelectionChange"]
  474. },
  475. moveShouldSetResponder: {
  476. phasedRegistrationNames: {
  477. bubbled: "onMoveShouldSetResponder",
  478. captured: "onMoveShouldSetResponderCapture"
  479. },
  480. dependencies: moveDependencies
  481. },
  482. responderStart: {
  483. registrationName: "onResponderStart",
  484. dependencies: startDependencies
  485. },
  486. responderMove: {
  487. registrationName: "onResponderMove",
  488. dependencies: moveDependencies
  489. },
  490. responderEnd: {
  491. registrationName: "onResponderEnd",
  492. dependencies: endDependencies
  493. },
  494. responderRelease: {
  495. registrationName: "onResponderRelease",
  496. dependencies: endDependencies
  497. },
  498. responderTerminationRequest: {
  499. registrationName: "onResponderTerminationRequest",
  500. dependencies: []
  501. },
  502. responderGrant: { registrationName: "onResponderGrant", dependencies: [] },
  503. responderReject: {
  504. registrationName: "onResponderReject",
  505. dependencies: []
  506. },
  507. responderTerminate: {
  508. registrationName: "onResponderTerminate",
  509. dependencies: []
  510. }
  511. },
  512. ResponderEventPlugin = {
  513. _getResponder: function() {
  514. return responderInst;
  515. },
  516. eventTypes: eventTypes,
  517. extractEvents: function(
  518. topLevelType,
  519. targetInst,
  520. nativeEvent,
  521. nativeEventTarget
  522. ) {
  523. if (isStartish(topLevelType)) trackedTouchCount += 1;
  524. else if (
  525. "topTouchEnd" === topLevelType ||
  526. "topTouchCancel" === topLevelType
  527. )
  528. if (0 <= trackedTouchCount) --trackedTouchCount;
  529. else return null;
  530. ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent);
  531. if (
  532. targetInst &&
  533. (("topScroll" === topLevelType && !nativeEvent.responderIgnoreScroll) ||
  534. (0 < trackedTouchCount && "topSelectionChange" === topLevelType) ||
  535. isStartish(topLevelType) ||
  536. isMoveish(topLevelType))
  537. ) {
  538. var shouldSetEventType = isStartish(topLevelType)
  539. ? eventTypes.startShouldSetResponder
  540. : isMoveish(topLevelType)
  541. ? eventTypes.moveShouldSetResponder
  542. : "topSelectionChange" === topLevelType
  543. ? eventTypes.selectionChangeShouldSetResponder
  544. : eventTypes.scrollShouldSetResponder;
  545. if (responderInst)
  546. b: {
  547. var JSCompiler_temp = responderInst;
  548. for (
  549. var depthA = 0, tempA = JSCompiler_temp;
  550. tempA;
  551. tempA = getParent(tempA)
  552. )
  553. depthA++;
  554. tempA = 0;
  555. for (var tempB = targetInst; tempB; tempB = getParent(tempB))
  556. tempA++;
  557. for (; 0 < depthA - tempA; )
  558. (JSCompiler_temp = getParent(JSCompiler_temp)), depthA--;
  559. for (; 0 < tempA - depthA; )
  560. (targetInst = getParent(targetInst)), tempA--;
  561. for (; depthA--; ) {
  562. if (
  563. JSCompiler_temp === targetInst ||
  564. JSCompiler_temp === targetInst.alternate
  565. )
  566. break b;
  567. JSCompiler_temp = getParent(JSCompiler_temp);
  568. targetInst = getParent(targetInst);
  569. }
  570. JSCompiler_temp = null;
  571. }
  572. else JSCompiler_temp = targetInst;
  573. targetInst = JSCompiler_temp === responderInst;
  574. JSCompiler_temp = ResponderSyntheticEvent.getPooled(
  575. shouldSetEventType,
  576. JSCompiler_temp,
  577. nativeEvent,
  578. nativeEventTarget
  579. );
  580. JSCompiler_temp.touchHistory = ResponderTouchHistoryStore.touchHistory;
  581. targetInst
  582. ? forEachAccumulated(
  583. JSCompiler_temp,
  584. accumulateTwoPhaseDispatchesSingleSkipTarget
  585. )
  586. : forEachAccumulated(
  587. JSCompiler_temp,
  588. accumulateTwoPhaseDispatchesSingle
  589. );
  590. b: {
  591. shouldSetEventType = JSCompiler_temp._dispatchListeners;
  592. targetInst = JSCompiler_temp._dispatchInstances;
  593. if (Array.isArray(shouldSetEventType))
  594. for (
  595. depthA = 0;
  596. depthA < shouldSetEventType.length &&
  597. !JSCompiler_temp.isPropagationStopped();
  598. depthA++
  599. ) {
  600. if (
  601. shouldSetEventType[depthA](JSCompiler_temp, targetInst[depthA])
  602. ) {
  603. shouldSetEventType = targetInst[depthA];
  604. break b;
  605. }
  606. }
  607. else if (
  608. shouldSetEventType &&
  609. shouldSetEventType(JSCompiler_temp, targetInst)
  610. ) {
  611. shouldSetEventType = targetInst;
  612. break b;
  613. }
  614. shouldSetEventType = null;
  615. }
  616. JSCompiler_temp._dispatchInstances = null;
  617. JSCompiler_temp._dispatchListeners = null;
  618. JSCompiler_temp.isPersistent() ||
  619. JSCompiler_temp.constructor.release(JSCompiler_temp);
  620. if (shouldSetEventType && shouldSetEventType !== responderInst)
  621. if (
  622. ((JSCompiler_temp = ResponderSyntheticEvent.getPooled(
  623. eventTypes.responderGrant,
  624. shouldSetEventType,
  625. nativeEvent,
  626. nativeEventTarget
  627. )),
  628. (JSCompiler_temp.touchHistory =
  629. ResponderTouchHistoryStore.touchHistory),
  630. forEachAccumulated(
  631. JSCompiler_temp,
  632. accumulateDirectDispatchesSingle
  633. ),
  634. (targetInst = !0 === executeDirectDispatch(JSCompiler_temp)),
  635. responderInst)
  636. )
  637. if (
  638. ((depthA = ResponderSyntheticEvent.getPooled(
  639. eventTypes.responderTerminationRequest,
  640. responderInst,
  641. nativeEvent,
  642. nativeEventTarget
  643. )),
  644. (depthA.touchHistory = ResponderTouchHistoryStore.touchHistory),
  645. forEachAccumulated(depthA, accumulateDirectDispatchesSingle),
  646. (tempA =
  647. !depthA._dispatchListeners || executeDirectDispatch(depthA)),
  648. depthA.isPersistent() || depthA.constructor.release(depthA),
  649. tempA)
  650. ) {
  651. depthA = ResponderSyntheticEvent.getPooled(
  652. eventTypes.responderTerminate,
  653. responderInst,
  654. nativeEvent,
  655. nativeEventTarget
  656. );
  657. depthA.touchHistory = ResponderTouchHistoryStore.touchHistory;
  658. forEachAccumulated(depthA, accumulateDirectDispatchesSingle);
  659. var JSCompiler_temp$jscomp$0 = accumulate(
  660. JSCompiler_temp$jscomp$0,
  661. [JSCompiler_temp, depthA]
  662. );
  663. changeResponder(shouldSetEventType, targetInst);
  664. } else
  665. (shouldSetEventType = ResponderSyntheticEvent.getPooled(
  666. eventTypes.responderReject,
  667. shouldSetEventType,
  668. nativeEvent,
  669. nativeEventTarget
  670. )),
  671. (shouldSetEventType.touchHistory =
  672. ResponderTouchHistoryStore.touchHistory),
  673. forEachAccumulated(
  674. shouldSetEventType,
  675. accumulateDirectDispatchesSingle
  676. ),
  677. (JSCompiler_temp$jscomp$0 = accumulate(
  678. JSCompiler_temp$jscomp$0,
  679. shouldSetEventType
  680. ));
  681. else
  682. (JSCompiler_temp$jscomp$0 = accumulate(
  683. JSCompiler_temp$jscomp$0,
  684. JSCompiler_temp
  685. )),
  686. changeResponder(shouldSetEventType, targetInst);
  687. else JSCompiler_temp$jscomp$0 = null;
  688. } else JSCompiler_temp$jscomp$0 = null;
  689. shouldSetEventType = responderInst && isStartish(topLevelType);
  690. JSCompiler_temp = responderInst && isMoveish(topLevelType);
  691. targetInst =
  692. responderInst &&
  693. ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType);
  694. if (
  695. (shouldSetEventType = shouldSetEventType
  696. ? eventTypes.responderStart
  697. : JSCompiler_temp
  698. ? eventTypes.responderMove
  699. : targetInst
  700. ? eventTypes.responderEnd
  701. : null)
  702. )
  703. (shouldSetEventType = ResponderSyntheticEvent.getPooled(
  704. shouldSetEventType,
  705. responderInst,
  706. nativeEvent,
  707. nativeEventTarget
  708. )),
  709. (shouldSetEventType.touchHistory =
  710. ResponderTouchHistoryStore.touchHistory),
  711. forEachAccumulated(
  712. shouldSetEventType,
  713. accumulateDirectDispatchesSingle
  714. ),
  715. (JSCompiler_temp$jscomp$0 = accumulate(
  716. JSCompiler_temp$jscomp$0,
  717. shouldSetEventType
  718. ));
  719. shouldSetEventType = responderInst && "topTouchCancel" === topLevelType;
  720. if (
  721. (topLevelType =
  722. responderInst &&
  723. !shouldSetEventType &&
  724. ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType))
  725. )
  726. a: {
  727. if ((topLevelType = nativeEvent.touches) && 0 !== topLevelType.length)
  728. for (
  729. JSCompiler_temp = 0;
  730. JSCompiler_temp < topLevelType.length;
  731. JSCompiler_temp++
  732. )
  733. if (
  734. ((targetInst = topLevelType[JSCompiler_temp].target),
  735. null !== targetInst &&
  736. void 0 !== targetInst &&
  737. 0 !== targetInst)
  738. ) {
  739. depthA = getInstanceFromNode(targetInst);
  740. b: {
  741. for (targetInst = responderInst; depthA; ) {
  742. if (
  743. targetInst === depthA ||
  744. targetInst === depthA.alternate
  745. ) {
  746. targetInst = !0;
  747. break b;
  748. }
  749. depthA = getParent(depthA);
  750. }
  751. targetInst = !1;
  752. }
  753. if (targetInst) {
  754. topLevelType = !1;
  755. break a;
  756. }
  757. }
  758. topLevelType = !0;
  759. }
  760. if (
  761. (topLevelType = shouldSetEventType
  762. ? eventTypes.responderTerminate
  763. : topLevelType
  764. ? eventTypes.responderRelease
  765. : null)
  766. )
  767. (nativeEvent = ResponderSyntheticEvent.getPooled(
  768. topLevelType,
  769. responderInst,
  770. nativeEvent,
  771. nativeEventTarget
  772. )),
  773. (nativeEvent.touchHistory = ResponderTouchHistoryStore.touchHistory),
  774. forEachAccumulated(nativeEvent, accumulateDirectDispatchesSingle),
  775. (JSCompiler_temp$jscomp$0 = accumulate(
  776. JSCompiler_temp$jscomp$0,
  777. nativeEvent
  778. )),
  779. changeResponder(null);
  780. return JSCompiler_temp$jscomp$0;
  781. },
  782. GlobalResponderHandler: null,
  783. injection: {
  784. injectGlobalResponderHandler: function(GlobalResponderHandler) {
  785. ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler;
  786. }
  787. }
  788. },
  789. eventPluginOrder = null,
  790. namesToPlugins = {};
  791. function recomputePluginOrdering() {
  792. if (eventPluginOrder)
  793. for (var pluginName in namesToPlugins) {
  794. var pluginModule = namesToPlugins[pluginName],
  795. pluginIndex = eventPluginOrder.indexOf(pluginName);
  796. if (!(-1 < pluginIndex))
  797. throw Error(
  798. "EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" +
  799. pluginName +
  800. "`."
  801. );
  802. if (!plugins[pluginIndex]) {
  803. if (!pluginModule.extractEvents)
  804. throw Error(
  805. "EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" +
  806. pluginName +
  807. "` does not."
  808. );
  809. plugins[pluginIndex] = pluginModule;
  810. pluginIndex = pluginModule.eventTypes;
  811. for (var eventName in pluginIndex) {
  812. var JSCompiler_inline_result = void 0;
  813. var dispatchConfig = pluginIndex[eventName],
  814. pluginModule$jscomp$0 = pluginModule,
  815. eventName$jscomp$0 = eventName;
  816. if (eventNameDispatchConfigs.hasOwnProperty(eventName$jscomp$0))
  817. throw Error(
  818. "EventPluginRegistry: More than one plugin attempted to publish the same event name, `" +
  819. eventName$jscomp$0 +
  820. "`."
  821. );
  822. eventNameDispatchConfigs[eventName$jscomp$0] = dispatchConfig;
  823. var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
  824. if (phasedRegistrationNames) {
  825. for (JSCompiler_inline_result in phasedRegistrationNames)
  826. phasedRegistrationNames.hasOwnProperty(
  827. JSCompiler_inline_result
  828. ) &&
  829. publishRegistrationName(
  830. phasedRegistrationNames[JSCompiler_inline_result],
  831. pluginModule$jscomp$0,
  832. eventName$jscomp$0
  833. );
  834. JSCompiler_inline_result = !0;
  835. } else
  836. dispatchConfig.registrationName
  837. ? (publishRegistrationName(
  838. dispatchConfig.registrationName,
  839. pluginModule$jscomp$0,
  840. eventName$jscomp$0
  841. ),
  842. (JSCompiler_inline_result = !0))
  843. : (JSCompiler_inline_result = !1);
  844. if (!JSCompiler_inline_result)
  845. throw Error(
  846. "EventPluginRegistry: Failed to publish event `" +
  847. eventName +
  848. "` for plugin `" +
  849. pluginName +
  850. "`."
  851. );
  852. }
  853. }
  854. }
  855. }
  856. function publishRegistrationName(registrationName, pluginModule) {
  857. if (registrationNameModules[registrationName])
  858. throw Error(
  859. "EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" +
  860. registrationName +
  861. "`."
  862. );
  863. registrationNameModules[registrationName] = pluginModule;
  864. }
  865. var plugins = [],
  866. eventNameDispatchConfigs = {},
  867. registrationNameModules = {},
  868. customBubblingEventTypes =
  869. ReactNativePrivateInterface.ReactNativeViewConfigRegistry
  870. .customBubblingEventTypes,
  871. customDirectEventTypes =
  872. ReactNativePrivateInterface.ReactNativeViewConfigRegistry
  873. .customDirectEventTypes;
  874. if (eventPluginOrder)
  875. throw Error(
  876. "EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."
  877. );
  878. eventPluginOrder = Array.prototype.slice.call([
  879. "ResponderEventPlugin",
  880. "ReactNativeBridgeEventPlugin"
  881. ]);
  882. recomputePluginOrdering();
  883. var injectedNamesToPlugins$jscomp$inline_94 = {
  884. ResponderEventPlugin: ResponderEventPlugin,
  885. ReactNativeBridgeEventPlugin: {
  886. eventTypes: {},
  887. extractEvents: function(
  888. topLevelType,
  889. targetInst,
  890. nativeEvent,
  891. nativeEventTarget
  892. ) {
  893. if (null == targetInst) return null;
  894. var bubbleDispatchConfig = customBubblingEventTypes[topLevelType],
  895. directDispatchConfig = customDirectEventTypes[topLevelType];
  896. if (!bubbleDispatchConfig && !directDispatchConfig)
  897. throw Error(
  898. 'Unsupported top level event type "' + topLevelType + '" dispatched'
  899. );
  900. topLevelType = SyntheticEvent.getPooled(
  901. bubbleDispatchConfig || directDispatchConfig,
  902. targetInst,
  903. nativeEvent,
  904. nativeEventTarget
  905. );
  906. if (bubbleDispatchConfig)
  907. forEachAccumulated(topLevelType, accumulateTwoPhaseDispatchesSingle);
  908. else if (directDispatchConfig)
  909. forEachAccumulated(topLevelType, accumulateDirectDispatchesSingle);
  910. else return null;
  911. return topLevelType;
  912. }
  913. }
  914. },
  915. isOrderingDirty$jscomp$inline_95 = !1,
  916. pluginName$jscomp$inline_96;
  917. for (pluginName$jscomp$inline_96 in injectedNamesToPlugins$jscomp$inline_94)
  918. if (
  919. injectedNamesToPlugins$jscomp$inline_94.hasOwnProperty(
  920. pluginName$jscomp$inline_96
  921. )
  922. ) {
  923. var pluginModule$jscomp$inline_97 =
  924. injectedNamesToPlugins$jscomp$inline_94[pluginName$jscomp$inline_96];
  925. if (
  926. !namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_96) ||
  927. namesToPlugins[pluginName$jscomp$inline_96] !==
  928. pluginModule$jscomp$inline_97
  929. ) {
  930. if (namesToPlugins[pluginName$jscomp$inline_96])
  931. throw Error(
  932. "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" +
  933. pluginName$jscomp$inline_96 +
  934. "`."
  935. );
  936. namesToPlugins[
  937. pluginName$jscomp$inline_96
  938. ] = pluginModule$jscomp$inline_97;
  939. isOrderingDirty$jscomp$inline_95 = !0;
  940. }
  941. }
  942. isOrderingDirty$jscomp$inline_95 && recomputePluginOrdering();
  943. var instanceCache = new Map(),
  944. instanceProps = new Map();
  945. function getInstanceFromTag(tag) {
  946. return instanceCache.get(tag) || null;
  947. }
  948. function batchedUpdatesImpl(fn, bookkeeping) {
  949. return fn(bookkeeping);
  950. }
  951. var isInsideEventHandler = !1;
  952. function batchedUpdates(fn, bookkeeping) {
  953. if (isInsideEventHandler) return fn(bookkeeping);
  954. isInsideEventHandler = !0;
  955. try {
  956. return batchedUpdatesImpl(fn, bookkeeping);
  957. } finally {
  958. isInsideEventHandler = !1;
  959. }
  960. }
  961. var eventQueue = null;
  962. function executeDispatchesAndReleaseTopLevel(e) {
  963. if (e) {
  964. var dispatchListeners = e._dispatchListeners,
  965. dispatchInstances = e._dispatchInstances;
  966. if (Array.isArray(dispatchListeners))
  967. for (
  968. var i = 0;
  969. i < dispatchListeners.length && !e.isPropagationStopped();
  970. i++
  971. )
  972. executeDispatch(e, dispatchListeners[i], dispatchInstances[i]);
  973. else
  974. dispatchListeners &&
  975. executeDispatch(e, dispatchListeners, dispatchInstances);
  976. e._dispatchListeners = null;
  977. e._dispatchInstances = null;
  978. e.isPersistent() || e.constructor.release(e);
  979. }
  980. }
  981. var EMPTY_NATIVE_EVENT = {};
  982. function _receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam) {
  983. var nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT,
  984. inst = getInstanceFromTag(rootNodeID),
  985. target = null;
  986. null != inst && (target = inst.stateNode);
  987. batchedUpdates(function() {
  988. var events = target;
  989. for (var events$jscomp$0 = null, i = 0; i < plugins.length; i++) {
  990. var possiblePlugin = plugins[i];
  991. possiblePlugin &&
  992. (possiblePlugin = possiblePlugin.extractEvents(
  993. topLevelType,
  994. inst,
  995. nativeEvent,
  996. events,
  997. 1
  998. )) &&
  999. (events$jscomp$0 = accumulateInto(events$jscomp$0, possiblePlugin));
  1000. }
  1001. events = events$jscomp$0;
  1002. null !== events && (eventQueue = accumulateInto(eventQueue, events));
  1003. events = eventQueue;
  1004. eventQueue = null;
  1005. if (events) {
  1006. forEachAccumulated(events, executeDispatchesAndReleaseTopLevel);
  1007. if (eventQueue)
  1008. throw Error(
  1009. "processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented."
  1010. );
  1011. if (hasRethrowError)
  1012. throw ((events = rethrowError),
  1013. (hasRethrowError = !1),
  1014. (rethrowError = null),
  1015. events);
  1016. }
  1017. });
  1018. }
  1019. ReactNativePrivateInterface.RCTEventEmitter.register({
  1020. receiveEvent: function(rootNodeID, topLevelType, nativeEventParam) {
  1021. _receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam);
  1022. },
  1023. receiveTouches: function(eventTopLevelType, touches, changedIndices) {
  1024. if (
  1025. "topTouchEnd" === eventTopLevelType ||
  1026. "topTouchCancel" === eventTopLevelType
  1027. ) {
  1028. var JSCompiler_temp = [];
  1029. for (var i = 0; i < changedIndices.length; i++) {
  1030. var index = changedIndices[i];
  1031. JSCompiler_temp.push(touches[index]);
  1032. touches[index] = null;
  1033. }
  1034. for (i = changedIndices = 0; i < touches.length; i++)
  1035. (index = touches[i]),
  1036. null !== index && (touches[changedIndices++] = index);
  1037. touches.length = changedIndices;
  1038. } else
  1039. for (JSCompiler_temp = [], i = 0; i < changedIndices.length; i++)
  1040. JSCompiler_temp.push(touches[changedIndices[i]]);
  1041. for (
  1042. changedIndices = 0;
  1043. changedIndices < JSCompiler_temp.length;
  1044. changedIndices++
  1045. ) {
  1046. i = JSCompiler_temp[changedIndices];
  1047. i.changedTouches = JSCompiler_temp;
  1048. i.touches = touches;
  1049. index = null;
  1050. var target = i.target;
  1051. null === target || void 0 === target || 1 > target || (index = target);
  1052. _receiveRootNodeIDEvent(index, eventTopLevelType, i);
  1053. }
  1054. }
  1055. });
  1056. getFiberCurrentPropsFromNode = function(stateNode) {
  1057. return instanceProps.get(stateNode._nativeTag) || null;
  1058. };
  1059. getInstanceFromNode = getInstanceFromTag;
  1060. getNodeFromInstance = function(inst) {
  1061. inst = inst.stateNode;
  1062. var tag = inst._nativeTag;
  1063. void 0 === tag && ((inst = inst.canonical), (tag = inst._nativeTag));
  1064. if (!tag) throw Error("All native instances should have a tag.");
  1065. return inst;
  1066. };
  1067. ResponderEventPlugin.injection.injectGlobalResponderHandler({
  1068. onChange: function(from, to, blockNativeResponder) {
  1069. null !== to
  1070. ? ReactNativePrivateInterface.UIManager.setJSResponder(
  1071. to.stateNode._nativeTag,
  1072. blockNativeResponder
  1073. )
  1074. : ReactNativePrivateInterface.UIManager.clearJSResponder();
  1075. }
  1076. });
  1077. var ReactSharedInternals =
  1078. React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
  1079. ReactSharedInternals.hasOwnProperty("ReactCurrentDispatcher") ||
  1080. (ReactSharedInternals.ReactCurrentDispatcher = { current: null });
  1081. ReactSharedInternals.hasOwnProperty("ReactCurrentBatchConfig") ||
  1082. (ReactSharedInternals.ReactCurrentBatchConfig = { suspense: null });
  1083. var hasSymbol = "function" === typeof Symbol && Symbol.for,
  1084. REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103,
  1085. REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106,
  1086. REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107,
  1087. REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108,
  1088. REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114,
  1089. REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109,
  1090. REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110,
  1091. REACT_CONCURRENT_MODE_TYPE = hasSymbol
  1092. ? Symbol.for("react.concurrent_mode")
  1093. : 60111,
  1094. REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112,
  1095. REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113,
  1096. REACT_SUSPENSE_LIST_TYPE = hasSymbol
  1097. ? Symbol.for("react.suspense_list")
  1098. : 60120,
  1099. REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115,
  1100. REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116,
  1101. REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121,
  1102. MAYBE_ITERATOR_SYMBOL = "function" === typeof Symbol && Symbol.iterator;
  1103. function getIteratorFn(maybeIterable) {
  1104. if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
  1105. maybeIterable =
  1106. (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
  1107. maybeIterable["@@iterator"];
  1108. return "function" === typeof maybeIterable ? maybeIterable : null;
  1109. }
  1110. function initializeLazyComponentType(lazyComponent) {
  1111. if (-1 === lazyComponent._status) {
  1112. var ctor = lazyComponent._result;
  1113. ctor || (ctor = lazyComponent._ctor);
  1114. ctor = ctor();
  1115. lazyComponent._status = 0;
  1116. lazyComponent._result = ctor;
  1117. ctor.then(
  1118. function(moduleObject) {
  1119. 0 === lazyComponent._status &&
  1120. ((moduleObject = moduleObject.default),
  1121. (lazyComponent._status = 1),
  1122. (lazyComponent._result = moduleObject));
  1123. },
  1124. function(error) {
  1125. 0 === lazyComponent._status &&
  1126. ((lazyComponent._status = 2), (lazyComponent._result = error));
  1127. }
  1128. );
  1129. }
  1130. }
  1131. function getComponentName(type) {
  1132. if (null == type) return null;
  1133. if ("function" === typeof type) return type.displayName || type.name || null;
  1134. if ("string" === typeof type) return type;
  1135. switch (type) {
  1136. case REACT_FRAGMENT_TYPE:
  1137. return "Fragment";
  1138. case REACT_PORTAL_TYPE:
  1139. return "Portal";
  1140. case REACT_PROFILER_TYPE:
  1141. return "Profiler";
  1142. case REACT_STRICT_MODE_TYPE:
  1143. return "StrictMode";
  1144. case REACT_SUSPENSE_TYPE:
  1145. return "Suspense";
  1146. case REACT_SUSPENSE_LIST_TYPE:
  1147. return "SuspenseList";
  1148. }
  1149. if ("object" === typeof type)
  1150. switch (type.$$typeof) {
  1151. case REACT_CONTEXT_TYPE:
  1152. return (type.displayName || "Context") + ".Consumer";
  1153. case REACT_PROVIDER_TYPE:
  1154. return (type._context.displayName || "Context") + ".Provider";
  1155. case REACT_FORWARD_REF_TYPE:
  1156. var innerType = type.render;
  1157. innerType = innerType.displayName || innerType.name || "";
  1158. return (
  1159. type.displayName ||
  1160. ("" !== innerType ? "ForwardRef(" + innerType + ")" : "ForwardRef")
  1161. );
  1162. case REACT_MEMO_TYPE:
  1163. return getComponentName(type.type);
  1164. case REACT_BLOCK_TYPE:
  1165. return getComponentName(type.render);
  1166. case REACT_LAZY_TYPE:
  1167. if ((type = 1 === type._status ? type._result : null))
  1168. return getComponentName(type);
  1169. }
  1170. return null;
  1171. }
  1172. function getNearestMountedFiber(fiber) {
  1173. var node = fiber,
  1174. nearestMounted = fiber;
  1175. if (fiber.alternate) for (; node.return; ) node = node.return;
  1176. else {
  1177. fiber = node;
  1178. do
  1179. (node = fiber),
  1180. 0 !== (node.effectTag & 1026) && (nearestMounted = node.return),
  1181. (fiber = node.return);
  1182. while (fiber);
  1183. }
  1184. return 3 === node.tag ? nearestMounted : null;
  1185. }
  1186. function assertIsMounted(fiber) {
  1187. if (getNearestMountedFiber(fiber) !== fiber)
  1188. throw Error("Unable to find node on an unmounted component.");
  1189. }
  1190. function findCurrentFiberUsingSlowPath(fiber) {
  1191. var alternate = fiber.alternate;
  1192. if (!alternate) {
  1193. alternate = getNearestMountedFiber(fiber);
  1194. if (null === alternate)
  1195. throw Error("Unable to find node on an unmounted component.");
  1196. return alternate !== fiber ? null : fiber;
  1197. }
  1198. for (var a = fiber, b = alternate; ; ) {
  1199. var parentA = a.return;
  1200. if (null === parentA) break;
  1201. var parentB = parentA.alternate;
  1202. if (null === parentB) {
  1203. b = parentA.return;
  1204. if (null !== b) {
  1205. a = b;
  1206. continue;
  1207. }
  1208. break;
  1209. }
  1210. if (parentA.child === parentB.child) {
  1211. for (parentB = parentA.child; parentB; ) {
  1212. if (parentB === a) return assertIsMounted(parentA), fiber;
  1213. if (parentB === b) return assertIsMounted(parentA), alternate;
  1214. parentB = parentB.sibling;
  1215. }
  1216. throw Error("Unable to find node on an unmounted component.");
  1217. }
  1218. if (a.return !== b.return) (a = parentA), (b = parentB);
  1219. else {
  1220. for (var didFindChild = !1, _child = parentA.child; _child; ) {
  1221. if (_child === a) {
  1222. didFindChild = !0;
  1223. a = parentA;
  1224. b = parentB;
  1225. break;
  1226. }
  1227. if (_child === b) {
  1228. didFindChild = !0;
  1229. b = parentA;
  1230. a = parentB;
  1231. break;
  1232. }
  1233. _child = _child.sibling;
  1234. }
  1235. if (!didFindChild) {
  1236. for (_child = parentB.child; _child; ) {
  1237. if (_child === a) {
  1238. didFindChild = !0;
  1239. a = parentB;
  1240. b = parentA;
  1241. break;
  1242. }
  1243. if (_child === b) {
  1244. didFindChild = !0;
  1245. b = parentB;
  1246. a = parentA;
  1247. break;
  1248. }
  1249. _child = _child.sibling;
  1250. }
  1251. if (!didFindChild)
  1252. throw Error(
  1253. "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue."
  1254. );
  1255. }
  1256. }
  1257. if (a.alternate !== b)
  1258. throw Error(
  1259. "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue."
  1260. );
  1261. }
  1262. if (3 !== a.tag)
  1263. throw Error("Unable to find node on an unmounted component.");
  1264. return a.stateNode.current === a ? fiber : alternate;
  1265. }
  1266. function findCurrentHostFiber(parent) {
  1267. parent = findCurrentFiberUsingSlowPath(parent);
  1268. if (!parent) return null;
  1269. for (var node = parent; ; ) {
  1270. if (5 === node.tag || 6 === node.tag) return node;
  1271. if (node.child) (node.child.return = node), (node = node.child);
  1272. else {
  1273. if (node === parent) break;
  1274. for (; !node.sibling; ) {
  1275. if (!node.return || node.return === parent) return null;
  1276. node = node.return;
  1277. }
  1278. node.sibling.return = node.return;
  1279. node = node.sibling;
  1280. }
  1281. }
  1282. return null;
  1283. }
  1284. var emptyObject = {},
  1285. removedKeys = null,
  1286. removedKeyCount = 0,
  1287. deepDifferOptions = { unsafelyIgnoreFunctions: !0 };
  1288. function defaultDiffer(prevProp, nextProp) {
  1289. return "object" !== typeof nextProp || null === nextProp
  1290. ? !0
  1291. : ReactNativePrivateInterface.deepDiffer(
  1292. prevProp,
  1293. nextProp,
  1294. deepDifferOptions
  1295. );
  1296. }
  1297. function restoreDeletedValuesInNestedArray(
  1298. updatePayload,
  1299. node,
  1300. validAttributes
  1301. ) {
  1302. if (Array.isArray(node))
  1303. for (var i = node.length; i-- && 0 < removedKeyCount; )
  1304. restoreDeletedValuesInNestedArray(
  1305. updatePayload,
  1306. node[i],
  1307. validAttributes
  1308. );
  1309. else if (node && 0 < removedKeyCount)
  1310. for (i in removedKeys)
  1311. if (removedKeys[i]) {
  1312. var nextProp = node[i];
  1313. if (void 0 !== nextProp) {
  1314. var attributeConfig = validAttributes[i];
  1315. if (attributeConfig) {
  1316. "function" === typeof nextProp && (nextProp = !0);
  1317. "undefined" === typeof nextProp && (nextProp = null);
  1318. if ("object" !== typeof attributeConfig)
  1319. updatePayload[i] = nextProp;
  1320. else if (
  1321. "function" === typeof attributeConfig.diff ||
  1322. "function" === typeof attributeConfig.process
  1323. )
  1324. (nextProp =
  1325. "function" === typeof attributeConfig.process
  1326. ? attributeConfig.process(nextProp)
  1327. : nextProp),
  1328. (updatePayload[i] = nextProp);
  1329. removedKeys[i] = !1;
  1330. removedKeyCount--;
  1331. }
  1332. }
  1333. }
  1334. }
  1335. function diffNestedProperty(
  1336. updatePayload,
  1337. prevProp,
  1338. nextProp,
  1339. validAttributes
  1340. ) {
  1341. if (!updatePayload && prevProp === nextProp) return updatePayload;
  1342. if (!prevProp || !nextProp)
  1343. return nextProp
  1344. ? addNestedProperty(updatePayload, nextProp, validAttributes)
  1345. : prevProp
  1346. ? clearNestedProperty(updatePayload, prevProp, validAttributes)
  1347. : updatePayload;
  1348. if (!Array.isArray(prevProp) && !Array.isArray(nextProp))
  1349. return diffProperties(updatePayload, prevProp, nextProp, validAttributes);
  1350. if (Array.isArray(prevProp) && Array.isArray(nextProp)) {
  1351. var minLength =
  1352. prevProp.length < nextProp.length ? prevProp.length : nextProp.length,
  1353. i;
  1354. for (i = 0; i < minLength; i++)
  1355. updatePayload = diffNestedProperty(
  1356. updatePayload,
  1357. prevProp[i],
  1358. nextProp[i],
  1359. validAttributes
  1360. );
  1361. for (; i < prevProp.length; i++)
  1362. updatePayload = clearNestedProperty(
  1363. updatePayload,
  1364. prevProp[i],
  1365. validAttributes
  1366. );
  1367. for (; i < nextProp.length; i++)
  1368. updatePayload = addNestedProperty(
  1369. updatePayload,
  1370. nextProp[i],
  1371. validAttributes
  1372. );
  1373. return updatePayload;
  1374. }
  1375. return Array.isArray(prevProp)
  1376. ? diffProperties(
  1377. updatePayload,
  1378. ReactNativePrivateInterface.flattenStyle(prevProp),
  1379. nextProp,
  1380. validAttributes
  1381. )
  1382. : diffProperties(
  1383. updatePayload,
  1384. prevProp,
  1385. ReactNativePrivateInterface.flattenStyle(nextProp),
  1386. validAttributes
  1387. );
  1388. }
  1389. function addNestedProperty(updatePayload, nextProp, validAttributes) {
  1390. if (!nextProp) return updatePayload;
  1391. if (!Array.isArray(nextProp))
  1392. return diffProperties(
  1393. updatePayload,
  1394. emptyObject,
  1395. nextProp,
  1396. validAttributes
  1397. );
  1398. for (var i = 0; i < nextProp.length; i++)
  1399. updatePayload = addNestedProperty(
  1400. updatePayload,
  1401. nextProp[i],
  1402. validAttributes
  1403. );
  1404. return updatePayload;
  1405. }
  1406. function clearNestedProperty(updatePayload, prevProp, validAttributes) {
  1407. if (!prevProp) return updatePayload;
  1408. if (!Array.isArray(prevProp))
  1409. return diffProperties(
  1410. updatePayload,
  1411. prevProp,
  1412. emptyObject,
  1413. validAttributes
  1414. );
  1415. for (var i = 0; i < prevProp.length; i++)
  1416. updatePayload = clearNestedProperty(
  1417. updatePayload,
  1418. prevProp[i],
  1419. validAttributes
  1420. );
  1421. return updatePayload;
  1422. }
  1423. function diffProperties(updatePayload, prevProps, nextProps, validAttributes) {
  1424. var attributeConfig, propKey;
  1425. for (propKey in nextProps)
  1426. if ((attributeConfig = validAttributes[propKey])) {
  1427. var prevProp = prevProps[propKey];
  1428. var nextProp = nextProps[propKey];
  1429. "function" === typeof nextProp &&
  1430. ((nextProp = !0), "function" === typeof prevProp && (prevProp = !0));
  1431. "undefined" === typeof nextProp &&
  1432. ((nextProp = null),
  1433. "undefined" === typeof prevProp && (prevProp = null));
  1434. removedKeys && (removedKeys[propKey] = !1);
  1435. if (updatePayload && void 0 !== updatePayload[propKey])
  1436. if ("object" !== typeof attributeConfig)
  1437. updatePayload[propKey] = nextProp;
  1438. else {
  1439. if (
  1440. "function" === typeof attributeConfig.diff ||
  1441. "function" === typeof attributeConfig.process
  1442. )
  1443. (attributeConfig =
  1444. "function" === typeof attributeConfig.process
  1445. ? attributeConfig.process(nextProp)
  1446. : nextProp),
  1447. (updatePayload[propKey] = attributeConfig);
  1448. }
  1449. else if (prevProp !== nextProp)
  1450. if ("object" !== typeof attributeConfig)
  1451. defaultDiffer(prevProp, nextProp) &&
  1452. ((updatePayload || (updatePayload = {}))[propKey] = nextProp);
  1453. else if (
  1454. "function" === typeof attributeConfig.diff ||
  1455. "function" === typeof attributeConfig.process
  1456. ) {
  1457. if (
  1458. void 0 === prevProp ||
  1459. ("function" === typeof attributeConfig.diff
  1460. ? attributeConfig.diff(prevProp, nextProp)
  1461. : defaultDiffer(prevProp, nextProp))
  1462. )
  1463. (attributeConfig =
  1464. "function" === typeof attributeConfig.process
  1465. ? attributeConfig.process(nextProp)
  1466. : nextProp),
  1467. ((updatePayload || (updatePayload = {}))[
  1468. propKey
  1469. ] = attributeConfig);
  1470. } else
  1471. (removedKeys = null),
  1472. (removedKeyCount = 0),
  1473. (updatePayload = diffNestedProperty(
  1474. updatePayload,
  1475. prevProp,
  1476. nextProp,
  1477. attributeConfig
  1478. )),
  1479. 0 < removedKeyCount &&
  1480. updatePayload &&
  1481. (restoreDeletedValuesInNestedArray(
  1482. updatePayload,
  1483. nextProp,
  1484. attributeConfig
  1485. ),
  1486. (removedKeys = null));
  1487. }
  1488. for (var _propKey in prevProps)
  1489. void 0 === nextProps[_propKey] &&
  1490. (!(attributeConfig = validAttributes[_propKey]) ||
  1491. (updatePayload && void 0 !== updatePayload[_propKey]) ||
  1492. ((prevProp = prevProps[_propKey]),
  1493. void 0 !== prevProp &&
  1494. ("object" !== typeof attributeConfig ||
  1495. "function" === typeof attributeConfig.diff ||
  1496. "function" === typeof attributeConfig.process
  1497. ? (((updatePayload || (updatePayload = {}))[_propKey] = null),
  1498. removedKeys || (removedKeys = {}),
  1499. removedKeys[_propKey] ||
  1500. ((removedKeys[_propKey] = !0), removedKeyCount++))
  1501. : (updatePayload = clearNestedProperty(
  1502. updatePayload,
  1503. prevProp,
  1504. attributeConfig
  1505. )))));
  1506. return updatePayload;
  1507. }
  1508. function mountSafeCallback_NOT_REALLY_SAFE(context, callback) {
  1509. return function() {
  1510. if (
  1511. callback &&
  1512. ("boolean" !== typeof context.__isMounted || context.__isMounted)
  1513. )
  1514. return callback.apply(context, arguments);
  1515. };
  1516. }
  1517. var ReactNativeFiberHostComponent = (function() {
  1518. function ReactNativeFiberHostComponent(tag, viewConfig) {
  1519. this._nativeTag = tag;
  1520. this._children = [];
  1521. this.viewConfig = viewConfig;
  1522. }
  1523. var _proto = ReactNativeFiberHostComponent.prototype;
  1524. _proto.blur = function() {
  1525. ReactNativePrivateInterface.TextInputState.blurTextInput(this);
  1526. };
  1527. _proto.focus = function() {
  1528. ReactNativePrivateInterface.TextInputState.focusTextInput(this);
  1529. };
  1530. _proto.measure = function(callback) {
  1531. ReactNativePrivateInterface.UIManager.measure(
  1532. this._nativeTag,
  1533. mountSafeCallback_NOT_REALLY_SAFE(this, callback)
  1534. );
  1535. };
  1536. _proto.measureInWindow = function(callback) {
  1537. ReactNativePrivateInterface.UIManager.measureInWindow(
  1538. this._nativeTag,
  1539. mountSafeCallback_NOT_REALLY_SAFE(this, callback)
  1540. );
  1541. };
  1542. _proto.measureLayout = function(relativeToNativeNode, onSuccess, onFail) {
  1543. if ("number" === typeof relativeToNativeNode)
  1544. var relativeNode = relativeToNativeNode;
  1545. else
  1546. relativeToNativeNode._nativeTag &&
  1547. (relativeNode = relativeToNativeNode._nativeTag);
  1548. null != relativeNode &&
  1549. ReactNativePrivateInterface.UIManager.measureLayout(
  1550. this._nativeTag,
  1551. relativeNode,
  1552. mountSafeCallback_NOT_REALLY_SAFE(this, onFail),
  1553. mountSafeCallback_NOT_REALLY_SAFE(this, onSuccess)
  1554. );
  1555. };
  1556. _proto.setNativeProps = function(nativeProps) {
  1557. nativeProps = diffProperties(
  1558. null,
  1559. emptyObject,
  1560. nativeProps,
  1561. this.viewConfig.validAttributes
  1562. );
  1563. null != nativeProps &&
  1564. ReactNativePrivateInterface.UIManager.updateView(
  1565. this._nativeTag,
  1566. this.viewConfig.uiViewClassName,
  1567. nativeProps
  1568. );
  1569. };
  1570. return ReactNativeFiberHostComponent;
  1571. })();
  1572. function shim() {
  1573. throw Error(
  1574. "The current renderer does not support hydration. This error is likely caused by a bug in React. Please file an issue."
  1575. );
  1576. }
  1577. var getViewConfigForType =
  1578. ReactNativePrivateInterface.ReactNativeViewConfigRegistry.get,
  1579. UPDATE_SIGNAL = {},
  1580. nextReactTag = 3;
  1581. function allocateTag() {
  1582. var tag = nextReactTag;
  1583. 1 === tag % 10 && (tag += 2);
  1584. nextReactTag = tag + 2;
  1585. return tag;
  1586. }
  1587. function recursivelyUncacheFiberNode(node) {
  1588. if ("number" === typeof node)
  1589. instanceCache.delete(node), instanceProps.delete(node);
  1590. else {
  1591. var tag = node._nativeTag;
  1592. instanceCache.delete(tag);
  1593. instanceProps.delete(tag);
  1594. node._children.forEach(recursivelyUncacheFiberNode);
  1595. }
  1596. }
  1597. function finalizeInitialChildren(parentInstance) {
  1598. if (0 === parentInstance._children.length) return !1;
  1599. var nativeTags = parentInstance._children.map(function(child) {
  1600. return "number" === typeof child ? child : child._nativeTag;
  1601. });
  1602. ReactNativePrivateInterface.UIManager.setChildren(
  1603. parentInstance._nativeTag,
  1604. nativeTags
  1605. );
  1606. return !1;
  1607. }
  1608. var scheduleTimeout = setTimeout,
  1609. cancelTimeout = clearTimeout,
  1610. valueStack = [],
  1611. index = -1;
  1612. function pop(cursor) {
  1613. 0 > index ||
  1614. ((cursor.current = valueStack[index]), (valueStack[index] = null), index--);
  1615. }
  1616. function push(cursor, value) {
  1617. index++;
  1618. valueStack[index] = cursor.current;
  1619. cursor.current = value;
  1620. }
  1621. var emptyContextObject = {},
  1622. contextStackCursor = { current: emptyContextObject },
  1623. didPerformWorkStackCursor = { current: !1 },
  1624. previousContext = emptyContextObject;
  1625. function getMaskedContext(workInProgress, unmaskedContext) {
  1626. var contextTypes = workInProgress.type.contextTypes;
  1627. if (!contextTypes) return emptyContextObject;
  1628. var instance = workInProgress.stateNode;
  1629. if (
  1630. instance &&
  1631. instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext
  1632. )
  1633. return instance.__reactInternalMemoizedMaskedChildContext;
  1634. var context = {},
  1635. key;
  1636. for (key in contextTypes) context[key] = unmaskedContext[key];
  1637. instance &&
  1638. ((workInProgress = workInProgress.stateNode),
  1639. (workInProgress.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext),
  1640. (workInProgress.__reactInternalMemoizedMaskedChildContext = context));
  1641. return context;
  1642. }
  1643. function isContextProvider(type) {
  1644. type = type.childContextTypes;
  1645. return null !== type && void 0 !== type;
  1646. }
  1647. function popContext() {
  1648. pop(didPerformWorkStackCursor);
  1649. pop(contextStackCursor);
  1650. }
  1651. function pushTopLevelContextObject(fiber, context, didChange) {
  1652. if (contextStackCursor.current !== emptyContextObject)
  1653. throw Error(
  1654. "Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue."
  1655. );
  1656. push(contextStackCursor, context);
  1657. push(didPerformWorkStackCursor, didChange);
  1658. }
  1659. function processChildContext(fiber, type, parentContext) {
  1660. var instance = fiber.stateNode;
  1661. fiber = type.childContextTypes;
  1662. if ("function" !== typeof instance.getChildContext) return parentContext;
  1663. instance = instance.getChildContext();
  1664. for (var contextKey in instance)
  1665. if (!(contextKey in fiber))
  1666. throw Error(
  1667. (getComponentName(type) || "Unknown") +
  1668. '.getChildContext(): key "' +
  1669. contextKey +
  1670. '" is not defined in childContextTypes.'
  1671. );
  1672. return Object.assign({}, parentContext, {}, instance);
  1673. }
  1674. function pushContextProvider(workInProgress) {
  1675. workInProgress =
  1676. ((workInProgress = workInProgress.stateNode) &&
  1677. workInProgress.__reactInternalMemoizedMergedChildContext) ||
  1678. emptyContextObject;
  1679. previousContext = contextStackCursor.current;
  1680. push(contextStackCursor, workInProgress);
  1681. push(didPerformWorkStackCursor, didPerformWorkStackCursor.current);
  1682. return !0;
  1683. }
  1684. function invalidateContextProvider(workInProgress, type, didChange) {
  1685. var instance = workInProgress.stateNode;
  1686. if (!instance)
  1687. throw Error(
  1688. "Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue."
  1689. );
  1690. didChange
  1691. ? ((workInProgress = processChildContext(
  1692. workInProgress,
  1693. type,
  1694. previousContext
  1695. )),
  1696. (instance.__reactInternalMemoizedMergedChildContext = workInProgress),
  1697. pop(didPerformWorkStackCursor),
  1698. pop(contextStackCursor),
  1699. push(contextStackCursor, workInProgress))
  1700. : pop(didPerformWorkStackCursor);
  1701. push(didPerformWorkStackCursor, didChange);
  1702. }
  1703. var Scheduler_runWithPriority = Scheduler.unstable_runWithPriority,
  1704. Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback,
  1705. Scheduler_cancelCallback = Scheduler.unstable_cancelCallback,
  1706. Scheduler_requestPaint = Scheduler.unstable_requestPaint,
  1707. Scheduler_now = Scheduler.unstable_now,
  1708. Scheduler_getCurrentPriorityLevel =
  1709. Scheduler.unstable_getCurrentPriorityLevel,
  1710. Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority,
  1711. Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,
  1712. Scheduler_NormalPriority = Scheduler.unstable_NormalPriority,
  1713. Scheduler_LowPriority = Scheduler.unstable_LowPriority,
  1714. Scheduler_IdlePriority = Scheduler.unstable_IdlePriority,
  1715. fakeCallbackNode = {},
  1716. shouldYield = Scheduler.unstable_shouldYield,
  1717. requestPaint =
  1718. void 0 !== Scheduler_requestPaint ? Scheduler_requestPaint : function() {},
  1719. syncQueue = null,
  1720. immediateQueueCallbackNode = null,
  1721. isFlushingSyncQueue = !1,
  1722. initialTimeMs = Scheduler_now(),
  1723. now =
  1724. 1e4 > initialTimeMs
  1725. ? Scheduler_now
  1726. : function() {
  1727. return Scheduler_now() - initialTimeMs;
  1728. };
  1729. function getCurrentPriorityLevel() {
  1730. switch (Scheduler_getCurrentPriorityLevel()) {
  1731. case Scheduler_ImmediatePriority:
  1732. return 99;
  1733. case Scheduler_UserBlockingPriority:
  1734. return 98;
  1735. case Scheduler_NormalPriority:
  1736. return 97;
  1737. case Scheduler_LowPriority:
  1738. return 96;
  1739. case Scheduler_IdlePriority:
  1740. return 95;
  1741. default:
  1742. throw Error("Unknown priority level.");
  1743. }
  1744. }
  1745. function reactPriorityToSchedulerPriority(reactPriorityLevel) {
  1746. switch (reactPriorityLevel) {
  1747. case 99:
  1748. return Scheduler_ImmediatePriority;
  1749. case 98:
  1750. return Scheduler_UserBlockingPriority;
  1751. case 97:
  1752. return Scheduler_NormalPriority;
  1753. case 96:
  1754. return Scheduler_LowPriority;
  1755. case 95:
  1756. return Scheduler_IdlePriority;
  1757. default:
  1758. throw Error("Unknown priority level.");
  1759. }
  1760. }
  1761. function runWithPriority(reactPriorityLevel, fn) {
  1762. reactPriorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
  1763. return Scheduler_runWithPriority(reactPriorityLevel, fn);
  1764. }
  1765. function scheduleCallback(reactPriorityLevel, callback, options) {
  1766. reactPriorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
  1767. return Scheduler_scheduleCallback(reactPriorityLevel, callback, options);
  1768. }
  1769. function scheduleSyncCallback(callback) {
  1770. null === syncQueue
  1771. ? ((syncQueue = [callback]),
  1772. (immediateQueueCallbackNode = Scheduler_scheduleCallback(
  1773. Scheduler_ImmediatePriority,
  1774. flushSyncCallbackQueueImpl
  1775. )))
  1776. : syncQueue.push(callback);
  1777. return fakeCallbackNode;
  1778. }
  1779. function flushSyncCallbackQueue() {
  1780. if (null !== immediateQueueCallbackNode) {
  1781. var node = immediateQueueCallbackNode;
  1782. immediateQueueCallbackNode = null;
  1783. Scheduler_cancelCallback(node);
  1784. }
  1785. flushSyncCallbackQueueImpl();
  1786. }
  1787. function flushSyncCallbackQueueImpl() {
  1788. if (!isFlushingSyncQueue && null !== syncQueue) {
  1789. isFlushingSyncQueue = !0;
  1790. var i = 0;
  1791. try {
  1792. var queue = syncQueue;
  1793. runWithPriority(99, function() {
  1794. for (; i < queue.length; i++) {
  1795. var callback = queue[i];
  1796. do callback = callback(!0);
  1797. while (null !== callback);
  1798. }
  1799. });
  1800. syncQueue = null;
  1801. } catch (error) {
  1802. throw (null !== syncQueue && (syncQueue = syncQueue.slice(i + 1)),
  1803. Scheduler_scheduleCallback(
  1804. Scheduler_ImmediatePriority,
  1805. flushSyncCallbackQueue
  1806. ),
  1807. error);
  1808. } finally {
  1809. isFlushingSyncQueue = !1;
  1810. }
  1811. }
  1812. }
  1813. function is(x, y) {
  1814. return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
  1815. }
  1816. var objectIs = "function" === typeof Object.is ? Object.is : is,
  1817. hasOwnProperty = Object.prototype.hasOwnProperty;
  1818. function shallowEqual(objA, objB) {
  1819. if (objectIs(objA, objB)) return !0;
  1820. if (
  1821. "object" !== typeof objA ||
  1822. null === objA ||
  1823. "object" !== typeof objB ||
  1824. null === objB
  1825. )
  1826. return !1;
  1827. var keysA = Object.keys(objA),
  1828. keysB = Object.keys(objB);
  1829. if (keysA.length !== keysB.length) return !1;
  1830. for (keysB = 0; keysB < keysA.length; keysB++)
  1831. if (
  1832. !hasOwnProperty.call(objB, keysA[keysB]) ||
  1833. !objectIs(objA[keysA[keysB]], objB[keysA[keysB]])
  1834. )
  1835. return !1;
  1836. return !0;
  1837. }
  1838. var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
  1839. function getStackByFiberInDevAndProd(workInProgress) {
  1840. var info = "";
  1841. do {
  1842. a: switch (workInProgress.tag) {
  1843. case 3:
  1844. case 4:
  1845. case 6:
  1846. case 7:
  1847. case 10:
  1848. case 9:
  1849. var JSCompiler_inline_result = "";
  1850. break a;
  1851. default:
  1852. var owner = workInProgress._debugOwner,
  1853. source = workInProgress._debugSource,
  1854. name = getComponentName(workInProgress.type);
  1855. JSCompiler_inline_result = null;
  1856. owner && (JSCompiler_inline_result = getComponentName(owner.type));
  1857. owner = name;
  1858. name = "";
  1859. source
  1860. ? (name =
  1861. " (at " +
  1862. source.fileName.replace(BEFORE_SLASH_RE, "") +
  1863. ":" +
  1864. source.lineNumber +
  1865. ")")
  1866. : JSCompiler_inline_result &&
  1867. (name = " (created by " + JSCompiler_inline_result + ")");
  1868. JSCompiler_inline_result = "\n in " + (owner || "Unknown") + name;
  1869. }
  1870. info += JSCompiler_inline_result;
  1871. workInProgress = workInProgress.return;
  1872. } while (workInProgress);
  1873. return info;
  1874. }
  1875. function resolveDefaultProps(Component, baseProps) {
  1876. if (Component && Component.defaultProps) {
  1877. baseProps = Object.assign({}, baseProps);
  1878. Component = Component.defaultProps;
  1879. for (var propName in Component)
  1880. void 0 === baseProps[propName] &&
  1881. (baseProps[propName] = Component[propName]);
  1882. }
  1883. return baseProps;
  1884. }
  1885. var valueCursor = { current: null },
  1886. currentlyRenderingFiber = null,
  1887. lastContextDependency = null,
  1888. lastContextWithAllBitsObserved = null;
  1889. function resetContextDependencies() {
  1890. lastContextWithAllBitsObserved = lastContextDependency = currentlyRenderingFiber = null;
  1891. }
  1892. function popProvider(providerFiber) {
  1893. var currentValue = valueCursor.current;
  1894. pop(valueCursor);
  1895. providerFiber.type._context._currentValue = currentValue;
  1896. }
  1897. function scheduleWorkOnParentPath(parent, renderExpirationTime) {
  1898. for (; null !== parent; ) {
  1899. var alternate = parent.alternate;
  1900. if (parent.childExpirationTime < renderExpirationTime)
  1901. (parent.childExpirationTime = renderExpirationTime),
  1902. null !== alternate &&
  1903. alternate.childExpirationTime < renderExpirationTime &&
  1904. (alternate.childExpirationTime = renderExpirationTime);
  1905. else if (
  1906. null !== alternate &&
  1907. alternate.childExpirationTime < renderExpirationTime
  1908. )
  1909. alternate.childExpirationTime = renderExpirationTime;
  1910. else break;
  1911. parent = parent.return;
  1912. }
  1913. }
  1914. function prepareToReadContext(workInProgress, renderExpirationTime) {
  1915. currentlyRenderingFiber = workInProgress;
  1916. lastContextWithAllBitsObserved = lastContextDependency = null;
  1917. workInProgress = workInProgress.dependencies;
  1918. null !== workInProgress &&
  1919. null !== workInProgress.firstContext &&
  1920. (workInProgress.expirationTime >= renderExpirationTime &&
  1921. (didReceiveUpdate = !0),
  1922. (workInProgress.firstContext = null));
  1923. }
  1924. function readContext(context, observedBits) {
  1925. if (
  1926. lastContextWithAllBitsObserved !== context &&
  1927. !1 !== observedBits &&
  1928. 0 !== observedBits
  1929. ) {
  1930. if ("number" !== typeof observedBits || 1073741823 === observedBits)
  1931. (lastContextWithAllBitsObserved = context), (observedBits = 1073741823);
  1932. observedBits = { context: context, observedBits: observedBits, next: null };
  1933. if (null === lastContextDependency) {
  1934. if (null === currentlyRenderingFiber)
  1935. throw Error(
  1936. "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
  1937. );
  1938. lastContextDependency = observedBits;
  1939. currentlyRenderingFiber.dependencies = {
  1940. expirationTime: 0,
  1941. firstContext: observedBits,
  1942. responders: null
  1943. };
  1944. } else lastContextDependency = lastContextDependency.next = observedBits;
  1945. }
  1946. return context._currentValue;
  1947. }
  1948. var hasForceUpdate = !1;
  1949. function initializeUpdateQueue(fiber) {
  1950. fiber.updateQueue = {
  1951. baseState: fiber.memoizedState,
  1952. baseQueue: null,
  1953. shared: { pending: null },
  1954. effects: null
  1955. };
  1956. }
  1957. function cloneUpdateQueue(current, workInProgress) {
  1958. current = current.updateQueue;
  1959. workInProgress.updateQueue === current &&
  1960. (workInProgress.updateQueue = {
  1961. baseState: current.baseState,
  1962. baseQueue: current.baseQueue,
  1963. shared: current.shared,
  1964. effects: current.effects
  1965. });
  1966. }
  1967. function createUpdate(expirationTime, suspenseConfig) {
  1968. expirationTime = {
  1969. expirationTime: expirationTime,
  1970. suspenseConfig: suspenseConfig,
  1971. tag: 0,
  1972. payload: null,
  1973. callback: null,
  1974. next: null
  1975. };
  1976. return (expirationTime.next = expirationTime);
  1977. }
  1978. function enqueueUpdate(fiber, update) {
  1979. fiber = fiber.updateQueue;
  1980. if (null !== fiber) {
  1981. fiber = fiber.shared;
  1982. var pending = fiber.pending;
  1983. null === pending
  1984. ? (update.next = update)
  1985. : ((update.next = pending.next), (pending.next = update));
  1986. fiber.pending = update;
  1987. }
  1988. }
  1989. function enqueueCapturedUpdate(workInProgress, update) {
  1990. var current = workInProgress.alternate;
  1991. null !== current && cloneUpdateQueue(current, workInProgress);
  1992. workInProgress = workInProgress.updateQueue;
  1993. current = workInProgress.baseQueue;
  1994. null === current
  1995. ? ((workInProgress.baseQueue = update.next = update),
  1996. (update.next = update))
  1997. : ((update.next = current.next), (current.next = update));
  1998. }
  1999. function processUpdateQueue(
  2000. workInProgress$jscomp$0,
  2001. props,
  2002. instance,
  2003. renderExpirationTime
  2004. ) {
  2005. var queue = workInProgress$jscomp$0.updateQueue;
  2006. hasForceUpdate = !1;
  2007. var baseQueue = queue.baseQueue,
  2008. pendingQueue = queue.shared.pending;
  2009. if (null !== pendingQueue) {
  2010. if (null !== baseQueue) {
  2011. var baseFirst = baseQueue.next;
  2012. baseQueue.next = pendingQueue.next;
  2013. pendingQueue.next = baseFirst;
  2014. }
  2015. baseQueue = pendingQueue;
  2016. queue.shared.pending = null;
  2017. baseFirst = workInProgress$jscomp$0.alternate;
  2018. null !== baseFirst &&
  2019. ((baseFirst = baseFirst.updateQueue),
  2020. null !== baseFirst && (baseFirst.baseQueue = pendingQueue));
  2021. }
  2022. if (null !== baseQueue) {
  2023. baseFirst = baseQueue.next;
  2024. var newState = queue.baseState,
  2025. newExpirationTime = 0,
  2026. newBaseState = null,
  2027. newBaseQueueFirst = null,
  2028. newBaseQueueLast = null;
  2029. if (null !== baseFirst) {
  2030. var update = baseFirst;
  2031. do {
  2032. pendingQueue = update.expirationTime;
  2033. if (pendingQueue < renderExpirationTime) {
  2034. var clone = {
  2035. expirationTime: update.expirationTime,
  2036. suspenseConfig: update.suspenseConfig,
  2037. tag: update.tag,
  2038. payload: update.payload,
  2039. callback: update.callback,
  2040. next: null
  2041. };
  2042. null === newBaseQueueLast
  2043. ? ((newBaseQueueFirst = newBaseQueueLast = clone),
  2044. (newBaseState = newState))
  2045. : (newBaseQueueLast = newBaseQueueLast.next = clone);
  2046. pendingQueue > newExpirationTime &&
  2047. (newExpirationTime = pendingQueue);
  2048. } else {
  2049. null !== newBaseQueueLast &&
  2050. (newBaseQueueLast = newBaseQueueLast.next = {
  2051. expirationTime: 1073741823,
  2052. suspenseConfig: update.suspenseConfig,
  2053. tag: update.tag,
  2054. payload: update.payload,
  2055. callback: update.callback,
  2056. next: null
  2057. });
  2058. markRenderEventTimeAndConfig(pendingQueue, update.suspenseConfig);
  2059. a: {
  2060. var workInProgress = workInProgress$jscomp$0,
  2061. update$jscomp$0 = update;
  2062. pendingQueue = props;
  2063. clone = instance;
  2064. switch (update$jscomp$0.tag) {
  2065. case 1:
  2066. workInProgress = update$jscomp$0.payload;
  2067. if ("function" === typeof workInProgress) {
  2068. newState = workInProgress.call(clone, newState, pendingQueue);
  2069. break a;
  2070. }
  2071. newState = workInProgress;
  2072. break a;
  2073. case 3:
  2074. workInProgress.effectTag =
  2075. (workInProgress.effectTag & -4097) | 64;
  2076. case 0:
  2077. workInProgress = update$jscomp$0.payload;
  2078. pendingQueue =
  2079. "function" === typeof workInProgress
  2080. ? workInProgress.call(clone, newState, pendingQueue)
  2081. : workInProgress;
  2082. if (null === pendingQueue || void 0 === pendingQueue) break a;
  2083. newState = Object.assign({}, newState, pendingQueue);
  2084. break a;
  2085. case 2:
  2086. hasForceUpdate = !0;
  2087. }
  2088. }
  2089. null !== update.callback &&
  2090. ((workInProgress$jscomp$0.effectTag |= 32),
  2091. (pendingQueue = queue.effects),
  2092. null === pendingQueue
  2093. ? (queue.effects = [update])
  2094. : pendingQueue.push(update));
  2095. }
  2096. update = update.next;
  2097. if (null === update || update === baseFirst)
  2098. if (((pendingQueue = queue.shared.pending), null === pendingQueue))
  2099. break;
  2100. else
  2101. (update = baseQueue.next = pendingQueue.next),
  2102. (pendingQueue.next = baseFirst),
  2103. (queue.baseQueue = baseQueue = pendingQueue),
  2104. (queue.shared.pending = null);
  2105. } while (1);
  2106. }
  2107. null === newBaseQueueLast
  2108. ? (newBaseState = newState)
  2109. : (newBaseQueueLast.next = newBaseQueueFirst);
  2110. queue.baseState = newBaseState;
  2111. queue.baseQueue = newBaseQueueLast;
  2112. markUnprocessedUpdateTime(newExpirationTime);
  2113. workInProgress$jscomp$0.expirationTime = newExpirationTime;
  2114. workInProgress$jscomp$0.memoizedState = newState;
  2115. }
  2116. }
  2117. function commitUpdateQueue(finishedWork, finishedQueue, instance) {
  2118. finishedWork = finishedQueue.effects;
  2119. finishedQueue.effects = null;
  2120. if (null !== finishedWork)
  2121. for (
  2122. finishedQueue = 0;
  2123. finishedQueue < finishedWork.length;
  2124. finishedQueue++
  2125. ) {
  2126. var effect = finishedWork[finishedQueue],
  2127. callback = effect.callback;
  2128. if (null !== callback) {
  2129. effect.callback = null;
  2130. if ("function" !== typeof callback)
  2131. throw Error(
  2132. "Invalid argument passed as callback. Expected a function. Instead received: " +
  2133. callback
  2134. );
  2135. callback.call(instance);
  2136. }
  2137. }
  2138. }
  2139. var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig,
  2140. emptyRefsObject = new React.Component().refs;
  2141. function applyDerivedStateFromProps(
  2142. workInProgress,
  2143. ctor,
  2144. getDerivedStateFromProps,
  2145. nextProps
  2146. ) {
  2147. ctor = workInProgress.memoizedState;
  2148. getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor);
  2149. getDerivedStateFromProps =
  2150. null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps
  2151. ? ctor
  2152. : Object.assign({}, ctor, getDerivedStateFromProps);
  2153. workInProgress.memoizedState = getDerivedStateFromProps;
  2154. 0 === workInProgress.expirationTime &&
  2155. (workInProgress.updateQueue.baseState = getDerivedStateFromProps);
  2156. }
  2157. var classComponentUpdater = {
  2158. isMounted: function(component) {
  2159. return (component = component._reactInternalFiber)
  2160. ? getNearestMountedFiber(component) === component
  2161. : !1;
  2162. },
  2163. enqueueSetState: function(inst, payload, callback) {
  2164. inst = inst._reactInternalFiber;
  2165. var currentTime = requestCurrentTimeForUpdate(),
  2166. suspenseConfig = ReactCurrentBatchConfig.suspense;
  2167. currentTime = computeExpirationForFiber(currentTime, inst, suspenseConfig);
  2168. suspenseConfig = createUpdate(currentTime, suspenseConfig);
  2169. suspenseConfig.payload = payload;
  2170. void 0 !== callback &&
  2171. null !== callback &&
  2172. (suspenseConfig.callback = callback);
  2173. enqueueUpdate(inst, suspenseConfig);
  2174. scheduleWork(inst, currentTime);
  2175. },
  2176. enqueueReplaceState: function(inst, payload, callback) {
  2177. inst = inst._reactInternalFiber;
  2178. var currentTime = requestCurrentTimeForUpdate(),
  2179. suspenseConfig = ReactCurrentBatchConfig.suspense;
  2180. currentTime = computeExpirationForFiber(currentTime, inst, suspenseConfig);
  2181. suspenseConfig = createUpdate(currentTime, suspenseConfig);
  2182. suspenseConfig.tag = 1;
  2183. suspenseConfig.payload = payload;
  2184. void 0 !== callback &&
  2185. null !== callback &&
  2186. (suspenseConfig.callback = callback);
  2187. enqueueUpdate(inst, suspenseConfig);
  2188. scheduleWork(inst, currentTime);
  2189. },
  2190. enqueueForceUpdate: function(inst, callback) {
  2191. inst = inst._reactInternalFiber;
  2192. var currentTime = requestCurrentTimeForUpdate(),
  2193. suspenseConfig = ReactCurrentBatchConfig.suspense;
  2194. currentTime = computeExpirationForFiber(currentTime, inst, suspenseConfig);
  2195. suspenseConfig = createUpdate(currentTime, suspenseConfig);
  2196. suspenseConfig.tag = 2;
  2197. void 0 !== callback &&
  2198. null !== callback &&
  2199. (suspenseConfig.callback = callback);
  2200. enqueueUpdate(inst, suspenseConfig);
  2201. scheduleWork(inst, currentTime);
  2202. }
  2203. };
  2204. function checkShouldComponentUpdate(
  2205. workInProgress,
  2206. ctor,
  2207. oldProps,
  2208. newProps,
  2209. oldState,
  2210. newState,
  2211. nextContext
  2212. ) {
  2213. workInProgress = workInProgress.stateNode;
  2214. return "function" === typeof workInProgress.shouldComponentUpdate
  2215. ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext)
  2216. : ctor.prototype && ctor.prototype.isPureReactComponent
  2217. ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)
  2218. : !0;
  2219. }
  2220. function constructClassInstance(workInProgress, ctor, props) {
  2221. var isLegacyContextConsumer = !1,
  2222. unmaskedContext = emptyContextObject;
  2223. var context = ctor.contextType;
  2224. "object" === typeof context && null !== context
  2225. ? (context = readContext(context))
  2226. : ((unmaskedContext = isContextProvider(ctor)
  2227. ? previousContext
  2228. : contextStackCursor.current),
  2229. (isLegacyContextConsumer = ctor.contextTypes),
  2230. (context = (isLegacyContextConsumer =
  2231. null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer)
  2232. ? getMaskedContext(workInProgress, unmaskedContext)
  2233. : emptyContextObject));
  2234. ctor = new ctor(props, context);
  2235. workInProgress.memoizedState =
  2236. null !== ctor.state && void 0 !== ctor.state ? ctor.state : null;
  2237. ctor.updater = classComponentUpdater;
  2238. workInProgress.stateNode = ctor;
  2239. ctor._reactInternalFiber = workInProgress;
  2240. isLegacyContextConsumer &&
  2241. ((workInProgress = workInProgress.stateNode),
  2242. (workInProgress.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext),
  2243. (workInProgress.__reactInternalMemoizedMaskedChildContext = context));
  2244. return ctor;
  2245. }
  2246. function callComponentWillReceiveProps(
  2247. workInProgress,
  2248. instance,
  2249. newProps,
  2250. nextContext
  2251. ) {
  2252. workInProgress = instance.state;
  2253. "function" === typeof instance.componentWillReceiveProps &&
  2254. instance.componentWillReceiveProps(newProps, nextContext);
  2255. "function" === typeof instance.UNSAFE_componentWillReceiveProps &&
  2256. instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
  2257. instance.state !== workInProgress &&
  2258. classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  2259. }
  2260. function mountClassInstance(
  2261. workInProgress,
  2262. ctor,
  2263. newProps,
  2264. renderExpirationTime
  2265. ) {
  2266. var instance = workInProgress.stateNode;
  2267. instance.props = newProps;
  2268. instance.state = workInProgress.memoizedState;
  2269. instance.refs = emptyRefsObject;
  2270. initializeUpdateQueue(workInProgress);
  2271. var contextType = ctor.contextType;
  2272. "object" === typeof contextType && null !== contextType
  2273. ? (instance.context = readContext(contextType))
  2274. : ((contextType = isContextProvider(ctor)
  2275. ? previousContext
  2276. : contextStackCursor.current),
  2277. (instance.context = getMaskedContext(workInProgress, contextType)));
  2278. processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);
  2279. instance.state = workInProgress.memoizedState;
  2280. contextType = ctor.getDerivedStateFromProps;
  2281. "function" === typeof contextType &&
  2282. (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps),
  2283. (instance.state = workInProgress.memoizedState));
  2284. "function" === typeof ctor.getDerivedStateFromProps ||
  2285. "function" === typeof instance.getSnapshotBeforeUpdate ||
  2286. ("function" !== typeof instance.UNSAFE_componentWillMount &&
  2287. "function" !== typeof instance.componentWillMount) ||
  2288. ((ctor = instance.state),
  2289. "function" === typeof instance.componentWillMount &&
  2290. instance.componentWillMount(),
  2291. "function" === typeof instance.UNSAFE_componentWillMount &&
  2292. instance.UNSAFE_componentWillMount(),
  2293. ctor !== instance.state &&
  2294. classComponentUpdater.enqueueReplaceState(instance, instance.state, null),
  2295. processUpdateQueue(
  2296. workInProgress,
  2297. newProps,
  2298. instance,
  2299. renderExpirationTime
  2300. ),
  2301. (instance.state = workInProgress.memoizedState));
  2302. "function" === typeof instance.componentDidMount &&
  2303. (workInProgress.effectTag |= 4);
  2304. }
  2305. var isArray = Array.isArray;
  2306. function coerceRef(returnFiber, current, element) {
  2307. returnFiber = element.ref;
  2308. if (
  2309. null !== returnFiber &&
  2310. "function" !== typeof returnFiber &&
  2311. "object" !== typeof returnFiber
  2312. ) {
  2313. if (element._owner) {
  2314. element = element._owner;
  2315. if (element) {
  2316. if (1 !== element.tag)
  2317. throw Error(
  2318. "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref"
  2319. );
  2320. var inst = element.stateNode;
  2321. }
  2322. if (!inst)
  2323. throw Error(
  2324. "Missing owner for string ref " +
  2325. returnFiber +
  2326. ". This error is likely caused by a bug in React. Please file an issue."
  2327. );
  2328. var stringRef = "" + returnFiber;
  2329. if (
  2330. null !== current &&
  2331. null !== current.ref &&
  2332. "function" === typeof current.ref &&
  2333. current.ref._stringRef === stringRef
  2334. )
  2335. return current.ref;
  2336. current = function(value) {
  2337. var refs = inst.refs;
  2338. refs === emptyRefsObject && (refs = inst.refs = {});
  2339. null === value ? delete refs[stringRef] : (refs[stringRef] = value);
  2340. };
  2341. current._stringRef = stringRef;
  2342. return current;
  2343. }
  2344. if ("string" !== typeof returnFiber)
  2345. throw Error(
  2346. "Expected ref to be a function, a string, an object returned by React.createRef(), or null."
  2347. );
  2348. if (!element._owner)
  2349. throw Error(
  2350. "Element ref was specified as a string (" +
  2351. returnFiber +
  2352. ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://fb.me/react-refs-must-have-owner for more information."
  2353. );
  2354. }
  2355. return returnFiber;
  2356. }
  2357. function throwOnInvalidObjectType(returnFiber, newChild) {
  2358. if ("textarea" !== returnFiber.type)
  2359. throw Error(
  2360. "Objects are not valid as a React child (found: " +
  2361. ("[object Object]" === Object.prototype.toString.call(newChild)
  2362. ? "object with keys {" + Object.keys(newChild).join(", ") + "}"
  2363. : newChild) +
  2364. ")."
  2365. );
  2366. }
  2367. function ChildReconciler(shouldTrackSideEffects) {
  2368. function deleteChild(returnFiber, childToDelete) {
  2369. if (shouldTrackSideEffects) {
  2370. var last = returnFiber.lastEffect;
  2371. null !== last
  2372. ? ((last.nextEffect = childToDelete),
  2373. (returnFiber.lastEffect = childToDelete))
  2374. : (returnFiber.firstEffect = returnFiber.lastEffect = childToDelete);
  2375. childToDelete.nextEffect = null;
  2376. childToDelete.effectTag = 8;
  2377. }
  2378. }
  2379. function deleteRemainingChildren(returnFiber, currentFirstChild) {
  2380. if (!shouldTrackSideEffects) return null;
  2381. for (; null !== currentFirstChild; )
  2382. deleteChild(returnFiber, currentFirstChild),
  2383. (currentFirstChild = currentFirstChild.sibling);
  2384. return null;
  2385. }
  2386. function mapRemainingChildren(returnFiber, currentFirstChild) {
  2387. for (returnFiber = new Map(); null !== currentFirstChild; )
  2388. null !== currentFirstChild.key
  2389. ? returnFiber.set(currentFirstChild.key, currentFirstChild)
  2390. : returnFiber.set(currentFirstChild.index, currentFirstChild),
  2391. (currentFirstChild = currentFirstChild.sibling);
  2392. return returnFiber;
  2393. }
  2394. function useFiber(fiber, pendingProps) {
  2395. fiber = createWorkInProgress(fiber, pendingProps);
  2396. fiber.index = 0;
  2397. fiber.sibling = null;
  2398. return fiber;
  2399. }
  2400. function placeChild(newFiber, lastPlacedIndex, newIndex) {
  2401. newFiber.index = newIndex;
  2402. if (!shouldTrackSideEffects) return lastPlacedIndex;
  2403. newIndex = newFiber.alternate;
  2404. if (null !== newIndex)
  2405. return (
  2406. (newIndex = newIndex.index),
  2407. newIndex < lastPlacedIndex
  2408. ? ((newFiber.effectTag = 2), lastPlacedIndex)
  2409. : newIndex
  2410. );
  2411. newFiber.effectTag = 2;
  2412. return lastPlacedIndex;
  2413. }
  2414. function placeSingleChild(newFiber) {
  2415. shouldTrackSideEffects &&
  2416. null === newFiber.alternate &&
  2417. (newFiber.effectTag = 2);
  2418. return newFiber;
  2419. }
  2420. function updateTextNode(returnFiber, current, textContent, expirationTime) {
  2421. if (null === current || 6 !== current.tag)
  2422. return (
  2423. (current = createFiberFromText(
  2424. textContent,
  2425. returnFiber.mode,
  2426. expirationTime
  2427. )),
  2428. (current.return = returnFiber),
  2429. current
  2430. );
  2431. current = useFiber(current, textContent);
  2432. current.return = returnFiber;
  2433. return current;
  2434. }
  2435. function updateElement(returnFiber, current, element, expirationTime) {
  2436. if (null !== current && current.elementType === element.type)
  2437. return (
  2438. (expirationTime = useFiber(current, element.props)),
  2439. (expirationTime.ref = coerceRef(returnFiber, current, element)),
  2440. (expirationTime.return = returnFiber),
  2441. expirationTime
  2442. );
  2443. expirationTime = createFiberFromTypeAndProps(
  2444. element.type,
  2445. element.key,
  2446. element.props,
  2447. null,
  2448. returnFiber.mode,
  2449. expirationTime
  2450. );
  2451. expirationTime.ref = coerceRef(returnFiber, current, element);
  2452. expirationTime.return = returnFiber;
  2453. return expirationTime;
  2454. }
  2455. function updatePortal(returnFiber, current, portal, expirationTime) {
  2456. if (
  2457. null === current ||
  2458. 4 !== current.tag ||
  2459. current.stateNode.containerInfo !== portal.containerInfo ||
  2460. current.stateNode.implementation !== portal.implementation
  2461. )
  2462. return (
  2463. (current = createFiberFromPortal(
  2464. portal,
  2465. returnFiber.mode,
  2466. expirationTime
  2467. )),
  2468. (current.return = returnFiber),
  2469. current
  2470. );
  2471. current = useFiber(current, portal.children || []);
  2472. current.return = returnFiber;
  2473. return current;
  2474. }
  2475. function updateFragment(returnFiber, current, fragment, expirationTime, key) {
  2476. if (null === current || 7 !== current.tag)
  2477. return (
  2478. (current = createFiberFromFragment(
  2479. fragment,
  2480. returnFiber.mode,
  2481. expirationTime,
  2482. key
  2483. )),
  2484. (current.return = returnFiber),
  2485. current
  2486. );
  2487. current = useFiber(current, fragment);
  2488. current.return = returnFiber;
  2489. return current;
  2490. }
  2491. function createChild(returnFiber, newChild, expirationTime) {
  2492. if ("string" === typeof newChild || "number" === typeof newChild)
  2493. return (
  2494. (newChild = createFiberFromText(
  2495. "" + newChild,
  2496. returnFiber.mode,
  2497. expirationTime
  2498. )),
  2499. (newChild.return = returnFiber),
  2500. newChild
  2501. );
  2502. if ("object" === typeof newChild && null !== newChild) {
  2503. switch (newChild.$$typeof) {
  2504. case REACT_ELEMENT_TYPE:
  2505. return (
  2506. (expirationTime = createFiberFromTypeAndProps(
  2507. newChild.type,
  2508. newChild.key,
  2509. newChild.props,
  2510. null,
  2511. returnFiber.mode,
  2512. expirationTime
  2513. )),
  2514. (expirationTime.ref = coerceRef(returnFiber, null, newChild)),
  2515. (expirationTime.return = returnFiber),
  2516. expirationTime
  2517. );
  2518. case REACT_PORTAL_TYPE:
  2519. return (
  2520. (newChild = createFiberFromPortal(
  2521. newChild,
  2522. returnFiber.mode,
  2523. expirationTime
  2524. )),
  2525. (newChild.return = returnFiber),
  2526. newChild
  2527. );
  2528. }
  2529. if (isArray(newChild) || getIteratorFn(newChild))
  2530. return (
  2531. (newChild = createFiberFromFragment(
  2532. newChild,
  2533. returnFiber.mode,
  2534. expirationTime,
  2535. null
  2536. )),
  2537. (newChild.return = returnFiber),
  2538. newChild
  2539. );
  2540. throwOnInvalidObjectType(returnFiber, newChild);
  2541. }
  2542. return null;
  2543. }
  2544. function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {
  2545. var key = null !== oldFiber ? oldFiber.key : null;
  2546. if ("string" === typeof newChild || "number" === typeof newChild)
  2547. return null !== key
  2548. ? null
  2549. : updateTextNode(returnFiber, oldFiber, "" + newChild, expirationTime);
  2550. if ("object" === typeof newChild && null !== newChild) {
  2551. switch (newChild.$$typeof) {
  2552. case REACT_ELEMENT_TYPE:
  2553. return newChild.key === key
  2554. ? newChild.type === REACT_FRAGMENT_TYPE
  2555. ? updateFragment(
  2556. returnFiber,
  2557. oldFiber,
  2558. newChild.props.children,
  2559. expirationTime,
  2560. key
  2561. )
  2562. : updateElement(returnFiber, oldFiber, newChild, expirationTime)
  2563. : null;
  2564. case REACT_PORTAL_TYPE:
  2565. return newChild.key === key
  2566. ? updatePortal(returnFiber, oldFiber, newChild, expirationTime)
  2567. : null;
  2568. }
  2569. if (isArray(newChild) || getIteratorFn(newChild))
  2570. return null !== key
  2571. ? null
  2572. : updateFragment(
  2573. returnFiber,
  2574. oldFiber,
  2575. newChild,
  2576. expirationTime,
  2577. null
  2578. );
  2579. throwOnInvalidObjectType(returnFiber, newChild);
  2580. }
  2581. return null;
  2582. }
  2583. function updateFromMap(
  2584. existingChildren,
  2585. returnFiber,
  2586. newIdx,
  2587. newChild,
  2588. expirationTime
  2589. ) {
  2590. if ("string" === typeof newChild || "number" === typeof newChild)
  2591. return (
  2592. (existingChildren = existingChildren.get(newIdx) || null),
  2593. updateTextNode(
  2594. returnFiber,
  2595. existingChildren,
  2596. "" + newChild,
  2597. expirationTime
  2598. )
  2599. );
  2600. if ("object" === typeof newChild && null !== newChild) {
  2601. switch (newChild.$$typeof) {
  2602. case REACT_ELEMENT_TYPE:
  2603. return (
  2604. (existingChildren =
  2605. existingChildren.get(
  2606. null === newChild.key ? newIdx : newChild.key
  2607. ) || null),
  2608. newChild.type === REACT_FRAGMENT_TYPE
  2609. ? updateFragment(
  2610. returnFiber,
  2611. existingChildren,
  2612. newChild.props.children,
  2613. expirationTime,
  2614. newChild.key
  2615. )
  2616. : updateElement(
  2617. returnFiber,
  2618. existingChildren,
  2619. newChild,
  2620. expirationTime
  2621. )
  2622. );
  2623. case REACT_PORTAL_TYPE:
  2624. return (
  2625. (existingChildren =
  2626. existingChildren.get(
  2627. null === newChild.key ? newIdx : newChild.key
  2628. ) || null),
  2629. updatePortal(
  2630. returnFiber,
  2631. existingChildren,
  2632. newChild,
  2633. expirationTime
  2634. )
  2635. );
  2636. }
  2637. if (isArray(newChild) || getIteratorFn(newChild))
  2638. return (
  2639. (existingChildren = existingChildren.get(newIdx) || null),
  2640. updateFragment(
  2641. returnFiber,
  2642. existingChildren,
  2643. newChild,
  2644. expirationTime,
  2645. null
  2646. )
  2647. );
  2648. throwOnInvalidObjectType(returnFiber, newChild);
  2649. }
  2650. return null;
  2651. }
  2652. function reconcileChildrenArray(
  2653. returnFiber,
  2654. currentFirstChild,
  2655. newChildren,
  2656. expirationTime
  2657. ) {
  2658. for (
  2659. var resultingFirstChild = null,
  2660. previousNewFiber = null,
  2661. oldFiber = currentFirstChild,
  2662. newIdx = (currentFirstChild = 0),
  2663. nextOldFiber = null;
  2664. null !== oldFiber && newIdx < newChildren.length;
  2665. newIdx++
  2666. ) {
  2667. oldFiber.index > newIdx
  2668. ? ((nextOldFiber = oldFiber), (oldFiber = null))
  2669. : (nextOldFiber = oldFiber.sibling);
  2670. var newFiber = updateSlot(
  2671. returnFiber,
  2672. oldFiber,
  2673. newChildren[newIdx],
  2674. expirationTime
  2675. );
  2676. if (null === newFiber) {
  2677. null === oldFiber && (oldFiber = nextOldFiber);
  2678. break;
  2679. }
  2680. shouldTrackSideEffects &&
  2681. oldFiber &&
  2682. null === newFiber.alternate &&
  2683. deleteChild(returnFiber, oldFiber);
  2684. currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
  2685. null === previousNewFiber
  2686. ? (resultingFirstChild = newFiber)
  2687. : (previousNewFiber.sibling = newFiber);
  2688. previousNewFiber = newFiber;
  2689. oldFiber = nextOldFiber;
  2690. }
  2691. if (newIdx === newChildren.length)
  2692. return (
  2693. deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild
  2694. );
  2695. if (null === oldFiber) {
  2696. for (; newIdx < newChildren.length; newIdx++)
  2697. (oldFiber = createChild(
  2698. returnFiber,
  2699. newChildren[newIdx],
  2700. expirationTime
  2701. )),
  2702. null !== oldFiber &&
  2703. ((currentFirstChild = placeChild(
  2704. oldFiber,
  2705. currentFirstChild,
  2706. newIdx
  2707. )),
  2708. null === previousNewFiber
  2709. ? (resultingFirstChild = oldFiber)
  2710. : (previousNewFiber.sibling = oldFiber),
  2711. (previousNewFiber = oldFiber));
  2712. return resultingFirstChild;
  2713. }
  2714. for (
  2715. oldFiber = mapRemainingChildren(returnFiber, oldFiber);
  2716. newIdx < newChildren.length;
  2717. newIdx++
  2718. )
  2719. (nextOldFiber = updateFromMap(
  2720. oldFiber,
  2721. returnFiber,
  2722. newIdx,
  2723. newChildren[newIdx],
  2724. expirationTime
  2725. )),
  2726. null !== nextOldFiber &&
  2727. (shouldTrackSideEffects &&
  2728. null !== nextOldFiber.alternate &&
  2729. oldFiber.delete(
  2730. null === nextOldFiber.key ? newIdx : nextOldFiber.key
  2731. ),
  2732. (currentFirstChild = placeChild(
  2733. nextOldFiber,
  2734. currentFirstChild,
  2735. newIdx
  2736. )),
  2737. null === previousNewFiber
  2738. ? (resultingFirstChild = nextOldFiber)
  2739. : (previousNewFiber.sibling = nextOldFiber),
  2740. (previousNewFiber = nextOldFiber));
  2741. shouldTrackSideEffects &&
  2742. oldFiber.forEach(function(child) {
  2743. return deleteChild(returnFiber, child);
  2744. });
  2745. return resultingFirstChild;
  2746. }
  2747. function reconcileChildrenIterator(
  2748. returnFiber,
  2749. currentFirstChild,
  2750. newChildrenIterable,
  2751. expirationTime
  2752. ) {
  2753. var iteratorFn = getIteratorFn(newChildrenIterable);
  2754. if ("function" !== typeof iteratorFn)
  2755. throw Error(
  2756. "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue."
  2757. );
  2758. newChildrenIterable = iteratorFn.call(newChildrenIterable);
  2759. if (null == newChildrenIterable)
  2760. throw Error("An iterable object provided no iterator.");
  2761. for (
  2762. var previousNewFiber = (iteratorFn = null),
  2763. oldFiber = currentFirstChild,
  2764. newIdx = (currentFirstChild = 0),
  2765. nextOldFiber = null,
  2766. step = newChildrenIterable.next();
  2767. null !== oldFiber && !step.done;
  2768. newIdx++, step = newChildrenIterable.next()
  2769. ) {
  2770. oldFiber.index > newIdx
  2771. ? ((nextOldFiber = oldFiber), (oldFiber = null))
  2772. : (nextOldFiber = oldFiber.sibling);
  2773. var newFiber = updateSlot(
  2774. returnFiber,
  2775. oldFiber,
  2776. step.value,
  2777. expirationTime
  2778. );
  2779. if (null === newFiber) {
  2780. null === oldFiber && (oldFiber = nextOldFiber);
  2781. break;
  2782. }
  2783. shouldTrackSideEffects &&
  2784. oldFiber &&
  2785. null === newFiber.alternate &&
  2786. deleteChild(returnFiber, oldFiber);
  2787. currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
  2788. null === previousNewFiber
  2789. ? (iteratorFn = newFiber)
  2790. : (previousNewFiber.sibling = newFiber);
  2791. previousNewFiber = newFiber;
  2792. oldFiber = nextOldFiber;
  2793. }
  2794. if (step.done)
  2795. return deleteRemainingChildren(returnFiber, oldFiber), iteratorFn;
  2796. if (null === oldFiber) {
  2797. for (; !step.done; newIdx++, step = newChildrenIterable.next())
  2798. (step = createChild(returnFiber, step.value, expirationTime)),
  2799. null !== step &&
  2800. ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
  2801. null === previousNewFiber
  2802. ? (iteratorFn = step)
  2803. : (previousNewFiber.sibling = step),
  2804. (previousNewFiber = step));
  2805. return iteratorFn;
  2806. }
  2807. for (
  2808. oldFiber = mapRemainingChildren(returnFiber, oldFiber);
  2809. !step.done;
  2810. newIdx++, step = newChildrenIterable.next()
  2811. )
  2812. (step = updateFromMap(
  2813. oldFiber,
  2814. returnFiber,
  2815. newIdx,
  2816. step.value,
  2817. expirationTime
  2818. )),
  2819. null !== step &&
  2820. (shouldTrackSideEffects &&
  2821. null !== step.alternate &&
  2822. oldFiber.delete(null === step.key ? newIdx : step.key),
  2823. (currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
  2824. null === previousNewFiber
  2825. ? (iteratorFn = step)
  2826. : (previousNewFiber.sibling = step),
  2827. (previousNewFiber = step));
  2828. shouldTrackSideEffects &&
  2829. oldFiber.forEach(function(child) {
  2830. return deleteChild(returnFiber, child);
  2831. });
  2832. return iteratorFn;
  2833. }
  2834. return function(returnFiber, currentFirstChild, newChild, expirationTime) {
  2835. var isUnkeyedTopLevelFragment =
  2836. "object" === typeof newChild &&
  2837. null !== newChild &&
  2838. newChild.type === REACT_FRAGMENT_TYPE &&
  2839. null === newChild.key;
  2840. isUnkeyedTopLevelFragment && (newChild = newChild.props.children);
  2841. var isObject = "object" === typeof newChild && null !== newChild;
  2842. if (isObject)
  2843. switch (newChild.$$typeof) {
  2844. case REACT_ELEMENT_TYPE:
  2845. a: {
  2846. isObject = newChild.key;
  2847. for (
  2848. isUnkeyedTopLevelFragment = currentFirstChild;
  2849. null !== isUnkeyedTopLevelFragment;
  2850. ) {
  2851. if (isUnkeyedTopLevelFragment.key === isObject) {
  2852. switch (isUnkeyedTopLevelFragment.tag) {
  2853. case 7:
  2854. if (newChild.type === REACT_FRAGMENT_TYPE) {
  2855. deleteRemainingChildren(
  2856. returnFiber,
  2857. isUnkeyedTopLevelFragment.sibling
  2858. );
  2859. currentFirstChild = useFiber(
  2860. isUnkeyedTopLevelFragment,
  2861. newChild.props.children
  2862. );
  2863. currentFirstChild.return = returnFiber;
  2864. returnFiber = currentFirstChild;
  2865. break a;
  2866. }
  2867. break;
  2868. default:
  2869. if (
  2870. isUnkeyedTopLevelFragment.elementType === newChild.type
  2871. ) {
  2872. deleteRemainingChildren(
  2873. returnFiber,
  2874. isUnkeyedTopLevelFragment.sibling
  2875. );
  2876. currentFirstChild = useFiber(
  2877. isUnkeyedTopLevelFragment,
  2878. newChild.props
  2879. );
  2880. currentFirstChild.ref = coerceRef(
  2881. returnFiber,
  2882. isUnkeyedTopLevelFragment,
  2883. newChild
  2884. );
  2885. currentFirstChild.return = returnFiber;
  2886. returnFiber = currentFirstChild;
  2887. break a;
  2888. }
  2889. }
  2890. deleteRemainingChildren(returnFiber, isUnkeyedTopLevelFragment);
  2891. break;
  2892. } else deleteChild(returnFiber, isUnkeyedTopLevelFragment);
  2893. isUnkeyedTopLevelFragment = isUnkeyedTopLevelFragment.sibling;
  2894. }
  2895. newChild.type === REACT_FRAGMENT_TYPE
  2896. ? ((currentFirstChild = createFiberFromFragment(
  2897. newChild.props.children,
  2898. returnFiber.mode,
  2899. expirationTime,
  2900. newChild.key
  2901. )),
  2902. (currentFirstChild.return = returnFiber),
  2903. (returnFiber = currentFirstChild))
  2904. : ((expirationTime = createFiberFromTypeAndProps(
  2905. newChild.type,
  2906. newChild.key,
  2907. newChild.props,
  2908. null,
  2909. returnFiber.mode,
  2910. expirationTime
  2911. )),
  2912. (expirationTime.ref = coerceRef(
  2913. returnFiber,
  2914. currentFirstChild,
  2915. newChild
  2916. )),
  2917. (expirationTime.return = returnFiber),
  2918. (returnFiber = expirationTime));
  2919. }
  2920. return placeSingleChild(returnFiber);
  2921. case REACT_PORTAL_TYPE:
  2922. a: {
  2923. for (
  2924. isUnkeyedTopLevelFragment = newChild.key;
  2925. null !== currentFirstChild;
  2926. ) {
  2927. if (currentFirstChild.key === isUnkeyedTopLevelFragment)
  2928. if (
  2929. 4 === currentFirstChild.tag &&
  2930. currentFirstChild.stateNode.containerInfo ===
  2931. newChild.containerInfo &&
  2932. currentFirstChild.stateNode.implementation ===
  2933. newChild.implementation
  2934. ) {
  2935. deleteRemainingChildren(
  2936. returnFiber,
  2937. currentFirstChild.sibling
  2938. );
  2939. currentFirstChild = useFiber(
  2940. currentFirstChild,
  2941. newChild.children || []
  2942. );
  2943. currentFirstChild.return = returnFiber;
  2944. returnFiber = currentFirstChild;
  2945. break a;
  2946. } else {
  2947. deleteRemainingChildren(returnFiber, currentFirstChild);
  2948. break;
  2949. }
  2950. else deleteChild(returnFiber, currentFirstChild);
  2951. currentFirstChild = currentFirstChild.sibling;
  2952. }
  2953. currentFirstChild = createFiberFromPortal(
  2954. newChild,
  2955. returnFiber.mode,
  2956. expirationTime
  2957. );
  2958. currentFirstChild.return = returnFiber;
  2959. returnFiber = currentFirstChild;
  2960. }
  2961. return placeSingleChild(returnFiber);
  2962. }
  2963. if ("string" === typeof newChild || "number" === typeof newChild)
  2964. return (
  2965. (newChild = "" + newChild),
  2966. null !== currentFirstChild && 6 === currentFirstChild.tag
  2967. ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),
  2968. (currentFirstChild = useFiber(currentFirstChild, newChild)),
  2969. (currentFirstChild.return = returnFiber),
  2970. (returnFiber = currentFirstChild))
  2971. : (deleteRemainingChildren(returnFiber, currentFirstChild),
  2972. (currentFirstChild = createFiberFromText(
  2973. newChild,
  2974. returnFiber.mode,
  2975. expirationTime
  2976. )),
  2977. (currentFirstChild.return = returnFiber),
  2978. (returnFiber = currentFirstChild)),
  2979. placeSingleChild(returnFiber)
  2980. );
  2981. if (isArray(newChild))
  2982. return reconcileChildrenArray(
  2983. returnFiber,
  2984. currentFirstChild,
  2985. newChild,
  2986. expirationTime
  2987. );
  2988. if (getIteratorFn(newChild))
  2989. return reconcileChildrenIterator(
  2990. returnFiber,
  2991. currentFirstChild,
  2992. newChild,
  2993. expirationTime
  2994. );
  2995. isObject && throwOnInvalidObjectType(returnFiber, newChild);
  2996. if ("undefined" === typeof newChild && !isUnkeyedTopLevelFragment)
  2997. switch (returnFiber.tag) {
  2998. case 1:
  2999. case 0:
  3000. throw ((returnFiber = returnFiber.type),
  3001. Error(
  3002. (returnFiber.displayName || returnFiber.name || "Component") +
  3003. "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null."
  3004. ));
  3005. }
  3006. return deleteRemainingChildren(returnFiber, currentFirstChild);
  3007. };
  3008. }
  3009. var reconcileChildFibers = ChildReconciler(!0),
  3010. mountChildFibers = ChildReconciler(!1),
  3011. NO_CONTEXT = {},
  3012. contextStackCursor$1 = { current: NO_CONTEXT },
  3013. contextFiberStackCursor = { current: NO_CONTEXT },
  3014. rootInstanceStackCursor = { current: NO_CONTEXT };
  3015. function requiredContext(c) {
  3016. if (c === NO_CONTEXT)
  3017. throw Error(
  3018. "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."
  3019. );
  3020. return c;
  3021. }
  3022. function pushHostContainer(fiber, nextRootInstance) {
  3023. push(rootInstanceStackCursor, nextRootInstance);
  3024. push(contextFiberStackCursor, fiber);
  3025. push(contextStackCursor$1, NO_CONTEXT);
  3026. pop(contextStackCursor$1);
  3027. push(contextStackCursor$1, { isInAParentText: !1 });
  3028. }
  3029. function popHostContainer() {
  3030. pop(contextStackCursor$1);
  3031. pop(contextFiberStackCursor);
  3032. pop(rootInstanceStackCursor);
  3033. }
  3034. function pushHostContext(fiber) {
  3035. requiredContext(rootInstanceStackCursor.current);
  3036. var context = requiredContext(contextStackCursor$1.current);
  3037. var nextContext = fiber.type;
  3038. nextContext =
  3039. "AndroidTextInput" === nextContext ||
  3040. "RCTMultilineTextInputView" === nextContext ||
  3041. "RCTSinglelineTextInputView" === nextContext ||
  3042. "RCTText" === nextContext ||
  3043. "RCTVirtualText" === nextContext;
  3044. nextContext =
  3045. context.isInAParentText !== nextContext
  3046. ? { isInAParentText: nextContext }
  3047. : context;
  3048. context !== nextContext &&
  3049. (push(contextFiberStackCursor, fiber),
  3050. push(contextStackCursor$1, nextContext));
  3051. }
  3052. function popHostContext(fiber) {
  3053. contextFiberStackCursor.current === fiber &&
  3054. (pop(contextStackCursor$1), pop(contextFiberStackCursor));
  3055. }
  3056. var suspenseStackCursor = { current: 0 };
  3057. function findFirstSuspended(row) {
  3058. for (var node = row; null !== node; ) {
  3059. if (13 === node.tag) {
  3060. var state = node.memoizedState;
  3061. if (null !== state && (null === state.dehydrated || shim() || shim()))
  3062. return node;
  3063. } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) {
  3064. if (0 !== (node.effectTag & 64)) return node;
  3065. } else if (null !== node.child) {
  3066. node.child.return = node;
  3067. node = node.child;
  3068. continue;
  3069. }
  3070. if (node === row) break;
  3071. for (; null === node.sibling; ) {
  3072. if (null === node.return || node.return === row) return null;
  3073. node = node.return;
  3074. }
  3075. node.sibling.return = node.return;
  3076. node = node.sibling;
  3077. }
  3078. return null;
  3079. }
  3080. function createDeprecatedResponderListener(responder, props) {
  3081. return { responder: responder, props: props };
  3082. }
  3083. var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
  3084. ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig,
  3085. renderExpirationTime = 0,
  3086. currentlyRenderingFiber$1 = null,
  3087. currentHook = null,
  3088. workInProgressHook = null,
  3089. didScheduleRenderPhaseUpdate = !1;
  3090. function throwInvalidHookError() {
  3091. throw Error(
  3092. "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem."
  3093. );
  3094. }
  3095. function areHookInputsEqual(nextDeps, prevDeps) {
  3096. if (null === prevDeps) return !1;
  3097. for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)
  3098. if (!objectIs(nextDeps[i], prevDeps[i])) return !1;
  3099. return !0;
  3100. }
  3101. function renderWithHooks(
  3102. current,
  3103. workInProgress,
  3104. Component,
  3105. props,
  3106. secondArg,
  3107. nextRenderExpirationTime
  3108. ) {
  3109. renderExpirationTime = nextRenderExpirationTime;
  3110. currentlyRenderingFiber$1 = workInProgress;
  3111. workInProgress.memoizedState = null;
  3112. workInProgress.updateQueue = null;
  3113. workInProgress.expirationTime = 0;
  3114. ReactCurrentDispatcher.current =
  3115. null === current || null === current.memoizedState
  3116. ? HooksDispatcherOnMount
  3117. : HooksDispatcherOnUpdate;
  3118. current = Component(props, secondArg);
  3119. if (workInProgress.expirationTime === renderExpirationTime) {
  3120. nextRenderExpirationTime = 0;
  3121. do {
  3122. workInProgress.expirationTime = 0;
  3123. if (!(25 > nextRenderExpirationTime))
  3124. throw Error(
  3125. "Too many re-renders. React limits the number of renders to prevent an infinite loop."
  3126. );
  3127. nextRenderExpirationTime += 1;
  3128. workInProgressHook = currentHook = null;
  3129. workInProgress.updateQueue = null;
  3130. ReactCurrentDispatcher.current = HooksDispatcherOnRerender;
  3131. current = Component(props, secondArg);
  3132. } while (workInProgress.expirationTime === renderExpirationTime);
  3133. }
  3134. ReactCurrentDispatcher.current = ContextOnlyDispatcher;
  3135. workInProgress = null !== currentHook && null !== currentHook.next;
  3136. renderExpirationTime = 0;
  3137. workInProgressHook = currentHook = currentlyRenderingFiber$1 = null;
  3138. didScheduleRenderPhaseUpdate = !1;
  3139. if (workInProgress)
  3140. throw Error(
  3141. "Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
  3142. );
  3143. return current;
  3144. }
  3145. function mountWorkInProgressHook() {
  3146. var hook = {
  3147. memoizedState: null,
  3148. baseState: null,
  3149. baseQueue: null,
  3150. queue: null,
  3151. next: null
  3152. };
  3153. null === workInProgressHook
  3154. ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook)
  3155. : (workInProgressHook = workInProgressHook.next = hook);
  3156. return workInProgressHook;
  3157. }
  3158. function updateWorkInProgressHook() {
  3159. if (null === currentHook) {
  3160. var nextCurrentHook = currentlyRenderingFiber$1.alternate;
  3161. nextCurrentHook =
  3162. null !== nextCurrentHook ? nextCurrentHook.memoizedState : null;
  3163. } else nextCurrentHook = currentHook.next;
  3164. var nextWorkInProgressHook =
  3165. null === workInProgressHook
  3166. ? currentlyRenderingFiber$1.memoizedState
  3167. : workInProgressHook.next;
  3168. if (null !== nextWorkInProgressHook)
  3169. (workInProgressHook = nextWorkInProgressHook),
  3170. (currentHook = nextCurrentHook);
  3171. else {
  3172. if (null === nextCurrentHook)
  3173. throw Error("Rendered more hooks than during the previous render.");
  3174. currentHook = nextCurrentHook;
  3175. nextCurrentHook = {
  3176. memoizedState: currentHook.memoizedState,
  3177. baseState: currentHook.baseState,
  3178. baseQueue: currentHook.baseQueue,
  3179. queue: currentHook.queue,
  3180. next: null
  3181. };
  3182. null === workInProgressHook
  3183. ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = nextCurrentHook)
  3184. : (workInProgressHook = workInProgressHook.next = nextCurrentHook);
  3185. }
  3186. return workInProgressHook;
  3187. }
  3188. function basicStateReducer(state, action) {
  3189. return "function" === typeof action ? action(state) : action;
  3190. }
  3191. function updateReducer(reducer) {
  3192. var hook = updateWorkInProgressHook(),
  3193. queue = hook.queue;
  3194. if (null === queue)
  3195. throw Error(
  3196. "Should have a queue. This is likely a bug in React. Please file an issue."
  3197. );
  3198. queue.lastRenderedReducer = reducer;
  3199. var current = currentHook,
  3200. baseQueue = current.baseQueue,
  3201. pendingQueue = queue.pending;
  3202. if (null !== pendingQueue) {
  3203. if (null !== baseQueue) {
  3204. var baseFirst = baseQueue.next;
  3205. baseQueue.next = pendingQueue.next;
  3206. pendingQueue.next = baseFirst;
  3207. }
  3208. current.baseQueue = baseQueue = pendingQueue;
  3209. queue.pending = null;
  3210. }
  3211. if (null !== baseQueue) {
  3212. baseQueue = baseQueue.next;
  3213. current = current.baseState;
  3214. var newBaseQueueLast = (baseFirst = pendingQueue = null),
  3215. update = baseQueue;
  3216. do {
  3217. var updateExpirationTime = update.expirationTime;
  3218. if (updateExpirationTime < renderExpirationTime) {
  3219. var clone = {
  3220. expirationTime: update.expirationTime,
  3221. suspenseConfig: update.suspenseConfig,
  3222. action: update.action,
  3223. eagerReducer: update.eagerReducer,
  3224. eagerState: update.eagerState,
  3225. next: null
  3226. };
  3227. null === newBaseQueueLast
  3228. ? ((baseFirst = newBaseQueueLast = clone), (pendingQueue = current))
  3229. : (newBaseQueueLast = newBaseQueueLast.next = clone);
  3230. updateExpirationTime > currentlyRenderingFiber$1.expirationTime &&
  3231. ((currentlyRenderingFiber$1.expirationTime = updateExpirationTime),
  3232. markUnprocessedUpdateTime(updateExpirationTime));
  3233. } else
  3234. null !== newBaseQueueLast &&
  3235. (newBaseQueueLast = newBaseQueueLast.next = {
  3236. expirationTime: 1073741823,
  3237. suspenseConfig: update.suspenseConfig,
  3238. action: update.action,
  3239. eagerReducer: update.eagerReducer,
  3240. eagerState: update.eagerState,
  3241. next: null
  3242. }),
  3243. markRenderEventTimeAndConfig(
  3244. updateExpirationTime,
  3245. update.suspenseConfig
  3246. ),
  3247. (current =
  3248. update.eagerReducer === reducer
  3249. ? update.eagerState
  3250. : reducer(current, update.action));
  3251. update = update.next;
  3252. } while (null !== update && update !== baseQueue);
  3253. null === newBaseQueueLast
  3254. ? (pendingQueue = current)
  3255. : (newBaseQueueLast.next = baseFirst);
  3256. objectIs(current, hook.memoizedState) || (didReceiveUpdate = !0);
  3257. hook.memoizedState = current;
  3258. hook.baseState = pendingQueue;
  3259. hook.baseQueue = newBaseQueueLast;
  3260. queue.lastRenderedState = current;
  3261. }
  3262. return [hook.memoizedState, queue.dispatch];
  3263. }
  3264. function rerenderReducer(reducer) {
  3265. var hook = updateWorkInProgressHook(),
  3266. queue = hook.queue;
  3267. if (null === queue)
  3268. throw Error(
  3269. "Should have a queue. This is likely a bug in React. Please file an issue."
  3270. );
  3271. queue.lastRenderedReducer = reducer;
  3272. var dispatch = queue.dispatch,
  3273. lastRenderPhaseUpdate = queue.pending,
  3274. newState = hook.memoizedState;
  3275. if (null !== lastRenderPhaseUpdate) {
  3276. queue.pending = null;
  3277. var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next);
  3278. do (newState = reducer(newState, update.action)), (update = update.next);
  3279. while (update !== lastRenderPhaseUpdate);
  3280. objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0);
  3281. hook.memoizedState = newState;
  3282. null === hook.baseQueue && (hook.baseState = newState);
  3283. queue.lastRenderedState = newState;
  3284. }
  3285. return [newState, dispatch];
  3286. }
  3287. function mountState(initialState) {
  3288. var hook = mountWorkInProgressHook();
  3289. "function" === typeof initialState && (initialState = initialState());
  3290. hook.memoizedState = hook.baseState = initialState;
  3291. initialState = hook.queue = {
  3292. pending: null,
  3293. dispatch: null,
  3294. lastRenderedReducer: basicStateReducer,
  3295. lastRenderedState: initialState
  3296. };
  3297. initialState = initialState.dispatch = dispatchAction.bind(
  3298. null,
  3299. currentlyRenderingFiber$1,
  3300. initialState
  3301. );
  3302. return [hook.memoizedState, initialState];
  3303. }
  3304. function pushEffect(tag, create, destroy, deps) {
  3305. tag = { tag: tag, create: create, destroy: destroy, deps: deps, next: null };
  3306. create = currentlyRenderingFiber$1.updateQueue;
  3307. null === create
  3308. ? ((create = { lastEffect: null }),
  3309. (currentlyRenderingFiber$1.updateQueue = create),
  3310. (create.lastEffect = tag.next = tag))
  3311. : ((destroy = create.lastEffect),
  3312. null === destroy
  3313. ? (create.lastEffect = tag.next = tag)
  3314. : ((deps = destroy.next),
  3315. (destroy.next = tag),
  3316. (tag.next = deps),
  3317. (create.lastEffect = tag)));
  3318. return tag;
  3319. }
  3320. function updateRef() {
  3321. return updateWorkInProgressHook().memoizedState;
  3322. }
  3323. function mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
  3324. var hook = mountWorkInProgressHook();
  3325. currentlyRenderingFiber$1.effectTag |= fiberEffectTag;
  3326. hook.memoizedState = pushEffect(
  3327. 1 | hookEffectTag,
  3328. create,
  3329. void 0,
  3330. void 0 === deps ? null : deps
  3331. );
  3332. }
  3333. function updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
  3334. var hook = updateWorkInProgressHook();
  3335. deps = void 0 === deps ? null : deps;
  3336. var destroy = void 0;
  3337. if (null !== currentHook) {
  3338. var prevEffect = currentHook.memoizedState;
  3339. destroy = prevEffect.destroy;
  3340. if (null !== deps && areHookInputsEqual(deps, prevEffect.deps)) {
  3341. pushEffect(hookEffectTag, create, destroy, deps);
  3342. return;
  3343. }
  3344. }
  3345. currentlyRenderingFiber$1.effectTag |= fiberEffectTag;
  3346. hook.memoizedState = pushEffect(1 | hookEffectTag, create, destroy, deps);
  3347. }
  3348. function mountEffect(create, deps) {
  3349. return mountEffectImpl(516, 4, create, deps);
  3350. }
  3351. function updateEffect(create, deps) {
  3352. return updateEffectImpl(516, 4, create, deps);
  3353. }
  3354. function updateLayoutEffect(create, deps) {
  3355. return updateEffectImpl(4, 2, create, deps);
  3356. }
  3357. function imperativeHandleEffect(create, ref) {
  3358. if ("function" === typeof ref)
  3359. return (
  3360. (create = create()),
  3361. ref(create),
  3362. function() {
  3363. ref(null);
  3364. }
  3365. );
  3366. if (null !== ref && void 0 !== ref)
  3367. return (
  3368. (create = create()),
  3369. (ref.current = create),
  3370. function() {
  3371. ref.current = null;
  3372. }
  3373. );
  3374. }
  3375. function updateImperativeHandle(ref, create, deps) {
  3376. deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
  3377. return updateEffectImpl(
  3378. 4,
  3379. 2,
  3380. imperativeHandleEffect.bind(null, create, ref),
  3381. deps
  3382. );
  3383. }
  3384. function mountDebugValue() {}
  3385. function mountCallback(callback, deps) {
  3386. mountWorkInProgressHook().memoizedState = [
  3387. callback,
  3388. void 0 === deps ? null : deps
  3389. ];
  3390. return callback;
  3391. }
  3392. function updateCallback(callback, deps) {
  3393. var hook = updateWorkInProgressHook();
  3394. deps = void 0 === deps ? null : deps;
  3395. var prevState = hook.memoizedState;
  3396. if (
  3397. null !== prevState &&
  3398. null !== deps &&
  3399. areHookInputsEqual(deps, prevState[1])
  3400. )
  3401. return prevState[0];
  3402. hook.memoizedState = [callback, deps];
  3403. return callback;
  3404. }
  3405. function updateMemo(nextCreate, deps) {
  3406. var hook = updateWorkInProgressHook();
  3407. deps = void 0 === deps ? null : deps;
  3408. var prevState = hook.memoizedState;
  3409. if (
  3410. null !== prevState &&
  3411. null !== deps &&
  3412. areHookInputsEqual(deps, prevState[1])
  3413. )
  3414. return prevState[0];
  3415. nextCreate = nextCreate();
  3416. hook.memoizedState = [nextCreate, deps];
  3417. return nextCreate;
  3418. }
  3419. function startTransition(setPending, config, callback) {
  3420. var priorityLevel = getCurrentPriorityLevel();
  3421. runWithPriority(98 > priorityLevel ? 98 : priorityLevel, function() {
  3422. setPending(!0);
  3423. });
  3424. runWithPriority(97 < priorityLevel ? 97 : priorityLevel, function() {
  3425. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  3426. ReactCurrentBatchConfig$1.suspense = void 0 === config ? null : config;
  3427. try {
  3428. setPending(!1), callback();
  3429. } finally {
  3430. ReactCurrentBatchConfig$1.suspense = previousConfig;
  3431. }
  3432. });
  3433. }
  3434. function dispatchAction(fiber, queue, action) {
  3435. var currentTime = requestCurrentTimeForUpdate(),
  3436. suspenseConfig = ReactCurrentBatchConfig.suspense;
  3437. currentTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
  3438. suspenseConfig = {
  3439. expirationTime: currentTime,
  3440. suspenseConfig: suspenseConfig,
  3441. action: action,
  3442. eagerReducer: null,
  3443. eagerState: null,
  3444. next: null
  3445. };
  3446. var pending = queue.pending;
  3447. null === pending
  3448. ? (suspenseConfig.next = suspenseConfig)
  3449. : ((suspenseConfig.next = pending.next), (pending.next = suspenseConfig));
  3450. queue.pending = suspenseConfig;
  3451. pending = fiber.alternate;
  3452. if (
  3453. fiber === currentlyRenderingFiber$1 ||
  3454. (null !== pending && pending === currentlyRenderingFiber$1)
  3455. )
  3456. (didScheduleRenderPhaseUpdate = !0),
  3457. (suspenseConfig.expirationTime = renderExpirationTime),
  3458. (currentlyRenderingFiber$1.expirationTime = renderExpirationTime);
  3459. else {
  3460. if (
  3461. 0 === fiber.expirationTime &&
  3462. (null === pending || 0 === pending.expirationTime) &&
  3463. ((pending = queue.lastRenderedReducer), null !== pending)
  3464. )
  3465. try {
  3466. var currentState = queue.lastRenderedState,
  3467. eagerState = pending(currentState, action);
  3468. suspenseConfig.eagerReducer = pending;
  3469. suspenseConfig.eagerState = eagerState;
  3470. if (objectIs(eagerState, currentState)) return;
  3471. } catch (error) {
  3472. } finally {
  3473. }
  3474. scheduleWork(fiber, currentTime);
  3475. }
  3476. }
  3477. function updateEventListener() {}
  3478. var ContextOnlyDispatcher = {
  3479. readContext: readContext,
  3480. useCallback: throwInvalidHookError,
  3481. useContext: throwInvalidHookError,
  3482. useEffect: throwInvalidHookError,
  3483. useImperativeHandle: throwInvalidHookError,
  3484. useLayoutEffect: throwInvalidHookError,
  3485. useMemo: throwInvalidHookError,
  3486. useReducer: throwInvalidHookError,
  3487. useRef: throwInvalidHookError,
  3488. useState: throwInvalidHookError,
  3489. useDebugValue: throwInvalidHookError,
  3490. useResponder: throwInvalidHookError,
  3491. useDeferredValue: throwInvalidHookError,
  3492. useTransition: throwInvalidHookError,
  3493. useEvent: throwInvalidHookError
  3494. },
  3495. HooksDispatcherOnMount = {
  3496. readContext: readContext,
  3497. useCallback: mountCallback,
  3498. useContext: readContext,
  3499. useEffect: mountEffect,
  3500. useImperativeHandle: function(ref, create, deps) {
  3501. deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
  3502. return mountEffectImpl(
  3503. 4,
  3504. 2,
  3505. imperativeHandleEffect.bind(null, create, ref),
  3506. deps
  3507. );
  3508. },
  3509. useLayoutEffect: function(create, deps) {
  3510. return mountEffectImpl(4, 2, create, deps);
  3511. },
  3512. useMemo: function(nextCreate, deps) {
  3513. var hook = mountWorkInProgressHook();
  3514. deps = void 0 === deps ? null : deps;
  3515. nextCreate = nextCreate();
  3516. hook.memoizedState = [nextCreate, deps];
  3517. return nextCreate;
  3518. },
  3519. useReducer: function(reducer, initialArg, init) {
  3520. var hook = mountWorkInProgressHook();
  3521. initialArg = void 0 !== init ? init(initialArg) : initialArg;
  3522. hook.memoizedState = hook.baseState = initialArg;
  3523. reducer = hook.queue = {
  3524. pending: null,
  3525. dispatch: null,
  3526. lastRenderedReducer: reducer,
  3527. lastRenderedState: initialArg
  3528. };
  3529. reducer = reducer.dispatch = dispatchAction.bind(
  3530. null,
  3531. currentlyRenderingFiber$1,
  3532. reducer
  3533. );
  3534. return [hook.memoizedState, reducer];
  3535. },
  3536. useRef: function(initialValue) {
  3537. var hook = mountWorkInProgressHook();
  3538. initialValue = { current: initialValue };
  3539. return (hook.memoizedState = initialValue);
  3540. },
  3541. useState: mountState,
  3542. useDebugValue: mountDebugValue,
  3543. useResponder: createDeprecatedResponderListener,
  3544. useDeferredValue: function(value, config) {
  3545. var _mountState = mountState(value),
  3546. prevValue = _mountState[0],
  3547. setValue = _mountState[1];
  3548. mountEffect(
  3549. function() {
  3550. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  3551. ReactCurrentBatchConfig$1.suspense =
  3552. void 0 === config ? null : config;
  3553. try {
  3554. setValue(value);
  3555. } finally {
  3556. ReactCurrentBatchConfig$1.suspense = previousConfig;
  3557. }
  3558. },
  3559. [value, config]
  3560. );
  3561. return prevValue;
  3562. },
  3563. useTransition: function(config) {
  3564. var _mountState2 = mountState(!1),
  3565. isPending = _mountState2[0];
  3566. _mountState2 = _mountState2[1];
  3567. return [
  3568. mountCallback(startTransition.bind(null, _mountState2, config), [
  3569. _mountState2,
  3570. config
  3571. ]),
  3572. isPending
  3573. ];
  3574. },
  3575. useEvent: function() {}
  3576. },
  3577. HooksDispatcherOnUpdate = {
  3578. readContext: readContext,
  3579. useCallback: updateCallback,
  3580. useContext: readContext,
  3581. useEffect: updateEffect,
  3582. useImperativeHandle: updateImperativeHandle,
  3583. useLayoutEffect: updateLayoutEffect,
  3584. useMemo: updateMemo,
  3585. useReducer: updateReducer,
  3586. useRef: updateRef,
  3587. useState: function() {
  3588. return updateReducer(basicStateReducer);
  3589. },
  3590. useDebugValue: mountDebugValue,
  3591. useResponder: createDeprecatedResponderListener,
  3592. useDeferredValue: function(value, config) {
  3593. var _updateState = updateReducer(basicStateReducer),
  3594. prevValue = _updateState[0],
  3595. setValue = _updateState[1];
  3596. updateEffect(
  3597. function() {
  3598. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  3599. ReactCurrentBatchConfig$1.suspense =
  3600. void 0 === config ? null : config;
  3601. try {
  3602. setValue(value);
  3603. } finally {
  3604. ReactCurrentBatchConfig$1.suspense = previousConfig;
  3605. }
  3606. },
  3607. [value, config]
  3608. );
  3609. return prevValue;
  3610. },
  3611. useTransition: function(config) {
  3612. var _updateState2 = updateReducer(basicStateReducer),
  3613. isPending = _updateState2[0];
  3614. _updateState2 = _updateState2[1];
  3615. return [
  3616. updateCallback(startTransition.bind(null, _updateState2, config), [
  3617. _updateState2,
  3618. config
  3619. ]),
  3620. isPending
  3621. ];
  3622. },
  3623. useEvent: updateEventListener
  3624. },
  3625. HooksDispatcherOnRerender = {
  3626. readContext: readContext,
  3627. useCallback: updateCallback,
  3628. useContext: readContext,
  3629. useEffect: updateEffect,
  3630. useImperativeHandle: updateImperativeHandle,
  3631. useLayoutEffect: updateLayoutEffect,
  3632. useMemo: updateMemo,
  3633. useReducer: rerenderReducer,
  3634. useRef: updateRef,
  3635. useState: function() {
  3636. return rerenderReducer(basicStateReducer);
  3637. },
  3638. useDebugValue: mountDebugValue,
  3639. useResponder: createDeprecatedResponderListener,
  3640. useDeferredValue: function(value, config) {
  3641. var _rerenderState = rerenderReducer(basicStateReducer),
  3642. prevValue = _rerenderState[0],
  3643. setValue = _rerenderState[1];
  3644. updateEffect(
  3645. function() {
  3646. var previousConfig = ReactCurrentBatchConfig$1.suspense;
  3647. ReactCurrentBatchConfig$1.suspense =
  3648. void 0 === config ? null : config;
  3649. try {
  3650. setValue(value);
  3651. } finally {
  3652. ReactCurrentBatchConfig$1.suspense = previousConfig;
  3653. }
  3654. },
  3655. [value, config]
  3656. );
  3657. return prevValue;
  3658. },
  3659. useTransition: function(config) {
  3660. var _rerenderState2 = rerenderReducer(basicStateReducer),
  3661. isPending = _rerenderState2[0];
  3662. _rerenderState2 = _rerenderState2[1];
  3663. return [
  3664. updateCallback(startTransition.bind(null, _rerenderState2, config), [
  3665. _rerenderState2,
  3666. config
  3667. ]),
  3668. isPending
  3669. ];
  3670. },
  3671. useEvent: updateEventListener
  3672. },
  3673. ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner,
  3674. didReceiveUpdate = !1;
  3675. function reconcileChildren(
  3676. current,
  3677. workInProgress,
  3678. nextChildren,
  3679. renderExpirationTime
  3680. ) {
  3681. workInProgress.child =
  3682. null === current
  3683. ? mountChildFibers(
  3684. workInProgress,
  3685. null,
  3686. nextChildren,
  3687. renderExpirationTime
  3688. )
  3689. : reconcileChildFibers(
  3690. workInProgress,
  3691. current.child,
  3692. nextChildren,
  3693. renderExpirationTime
  3694. );
  3695. }
  3696. function updateForwardRef(
  3697. current,
  3698. workInProgress,
  3699. Component,
  3700. nextProps,
  3701. renderExpirationTime
  3702. ) {
  3703. Component = Component.render;
  3704. var ref = workInProgress.ref;
  3705. prepareToReadContext(workInProgress, renderExpirationTime);
  3706. nextProps = renderWithHooks(
  3707. current,
  3708. workInProgress,
  3709. Component,
  3710. nextProps,
  3711. ref,
  3712. renderExpirationTime
  3713. );
  3714. if (null !== current && !didReceiveUpdate)
  3715. return (
  3716. (workInProgress.updateQueue = current.updateQueue),
  3717. (workInProgress.effectTag &= -517),
  3718. current.expirationTime <= renderExpirationTime &&
  3719. (current.expirationTime = 0),
  3720. bailoutOnAlreadyFinishedWork(
  3721. current,
  3722. workInProgress,
  3723. renderExpirationTime
  3724. )
  3725. );
  3726. workInProgress.effectTag |= 1;
  3727. reconcileChildren(current, workInProgress, nextProps, renderExpirationTime);
  3728. return workInProgress.child;
  3729. }
  3730. function updateMemoComponent(
  3731. current,
  3732. workInProgress,
  3733. Component,
  3734. nextProps,
  3735. updateExpirationTime,
  3736. renderExpirationTime
  3737. ) {
  3738. if (null === current) {
  3739. var type = Component.type;
  3740. if (
  3741. "function" === typeof type &&
  3742. !shouldConstruct(type) &&
  3743. void 0 === type.defaultProps &&
  3744. null === Component.compare &&
  3745. void 0 === Component.defaultProps
  3746. )
  3747. return (
  3748. (workInProgress.tag = 15),
  3749. (workInProgress.type = type),
  3750. updateSimpleMemoComponent(
  3751. current,
  3752. workInProgress,
  3753. type,
  3754. nextProps,
  3755. updateExpirationTime,
  3756. renderExpirationTime
  3757. )
  3758. );
  3759. current = createFiberFromTypeAndProps(
  3760. Component.type,
  3761. null,
  3762. nextProps,
  3763. null,
  3764. workInProgress.mode,
  3765. renderExpirationTime
  3766. );
  3767. current.ref = workInProgress.ref;
  3768. current.return = workInProgress;
  3769. return (workInProgress.child = current);
  3770. }
  3771. type = current.child;
  3772. if (
  3773. updateExpirationTime < renderExpirationTime &&
  3774. ((updateExpirationTime = type.memoizedProps),
  3775. (Component = Component.compare),
  3776. (Component = null !== Component ? Component : shallowEqual),
  3777. Component(updateExpirationTime, nextProps) &&
  3778. current.ref === workInProgress.ref)
  3779. )
  3780. return bailoutOnAlreadyFinishedWork(
  3781. current,
  3782. workInProgress,
  3783. renderExpirationTime
  3784. );
  3785. workInProgress.effectTag |= 1;
  3786. current = createWorkInProgress(type, nextProps);
  3787. current.ref = workInProgress.ref;
  3788. current.return = workInProgress;
  3789. return (workInProgress.child = current);
  3790. }
  3791. function updateSimpleMemoComponent(
  3792. current,
  3793. workInProgress,
  3794. Component,
  3795. nextProps,
  3796. updateExpirationTime,
  3797. renderExpirationTime
  3798. ) {
  3799. return null !== current &&
  3800. shallowEqual(current.memoizedProps, nextProps) &&
  3801. current.ref === workInProgress.ref &&
  3802. ((didReceiveUpdate = !1), updateExpirationTime < renderExpirationTime)
  3803. ? ((workInProgress.expirationTime = current.expirationTime),
  3804. bailoutOnAlreadyFinishedWork(
  3805. current,
  3806. workInProgress,
  3807. renderExpirationTime
  3808. ))
  3809. : updateFunctionComponent(
  3810. current,
  3811. workInProgress,
  3812. Component,
  3813. nextProps,
  3814. renderExpirationTime
  3815. );
  3816. }
  3817. function markRef(current, workInProgress) {
  3818. var ref = workInProgress.ref;
  3819. if (
  3820. (null === current && null !== ref) ||
  3821. (null !== current && current.ref !== ref)
  3822. )
  3823. workInProgress.effectTag |= 128;
  3824. }
  3825. function updateFunctionComponent(
  3826. current,
  3827. workInProgress,
  3828. Component,
  3829. nextProps,
  3830. renderExpirationTime
  3831. ) {
  3832. var context = isContextProvider(Component)
  3833. ? previousContext
  3834. : contextStackCursor.current;
  3835. context = getMaskedContext(workInProgress, context);
  3836. prepareToReadContext(workInProgress, renderExpirationTime);
  3837. Component = renderWithHooks(
  3838. current,
  3839. workInProgress,
  3840. Component,
  3841. nextProps,
  3842. context,
  3843. renderExpirationTime
  3844. );
  3845. if (null !== current && !didReceiveUpdate)
  3846. return (
  3847. (workInProgress.updateQueue = current.updateQueue),
  3848. (workInProgress.effectTag &= -517),
  3849. current.expirationTime <= renderExpirationTime &&
  3850. (current.expirationTime = 0),
  3851. bailoutOnAlreadyFinishedWork(
  3852. current,
  3853. workInProgress,
  3854. renderExpirationTime
  3855. )
  3856. );
  3857. workInProgress.effectTag |= 1;
  3858. reconcileChildren(current, workInProgress, Component, renderExpirationTime);
  3859. return workInProgress.child;
  3860. }
  3861. function updateClassComponent(
  3862. current,
  3863. workInProgress,
  3864. Component,
  3865. nextProps,
  3866. renderExpirationTime
  3867. ) {
  3868. if (isContextProvider(Component)) {
  3869. var hasContext = !0;
  3870. pushContextProvider(workInProgress);
  3871. } else hasContext = !1;
  3872. prepareToReadContext(workInProgress, renderExpirationTime);
  3873. if (null === workInProgress.stateNode)
  3874. null !== current &&
  3875. ((current.alternate = null),
  3876. (workInProgress.alternate = null),
  3877. (workInProgress.effectTag |= 2)),
  3878. constructClassInstance(workInProgress, Component, nextProps),
  3879. mountClassInstance(
  3880. workInProgress,
  3881. Component,
  3882. nextProps,
  3883. renderExpirationTime
  3884. ),
  3885. (nextProps = !0);
  3886. else if (null === current) {
  3887. var instance = workInProgress.stateNode,
  3888. oldProps = workInProgress.memoizedProps;
  3889. instance.props = oldProps;
  3890. var oldContext = instance.context,
  3891. contextType = Component.contextType;
  3892. "object" === typeof contextType && null !== contextType
  3893. ? (contextType = readContext(contextType))
  3894. : ((contextType = isContextProvider(Component)
  3895. ? previousContext
  3896. : contextStackCursor.current),
  3897. (contextType = getMaskedContext(workInProgress, contextType)));
  3898. var getDerivedStateFromProps = Component.getDerivedStateFromProps,
  3899. hasNewLifecycles =
  3900. "function" === typeof getDerivedStateFromProps ||
  3901. "function" === typeof instance.getSnapshotBeforeUpdate;
  3902. hasNewLifecycles ||
  3903. ("function" !== typeof instance.UNSAFE_componentWillReceiveProps &&
  3904. "function" !== typeof instance.componentWillReceiveProps) ||
  3905. ((oldProps !== nextProps || oldContext !== contextType) &&
  3906. callComponentWillReceiveProps(
  3907. workInProgress,
  3908. instance,
  3909. nextProps,
  3910. contextType
  3911. ));
  3912. hasForceUpdate = !1;
  3913. var oldState = workInProgress.memoizedState;
  3914. instance.state = oldState;
  3915. processUpdateQueue(
  3916. workInProgress,
  3917. nextProps,
  3918. instance,
  3919. renderExpirationTime
  3920. );
  3921. oldContext = workInProgress.memoizedState;
  3922. oldProps !== nextProps ||
  3923. oldState !== oldContext ||
  3924. didPerformWorkStackCursor.current ||
  3925. hasForceUpdate
  3926. ? ("function" === typeof getDerivedStateFromProps &&
  3927. (applyDerivedStateFromProps(
  3928. workInProgress,
  3929. Component,
  3930. getDerivedStateFromProps,
  3931. nextProps
  3932. ),
  3933. (oldContext = workInProgress.memoizedState)),
  3934. (oldProps =
  3935. hasForceUpdate ||
  3936. checkShouldComponentUpdate(
  3937. workInProgress,
  3938. Component,
  3939. oldProps,
  3940. nextProps,
  3941. oldState,
  3942. oldContext,
  3943. contextType
  3944. ))
  3945. ? (hasNewLifecycles ||
  3946. ("function" !== typeof instance.UNSAFE_componentWillMount &&
  3947. "function" !== typeof instance.componentWillMount) ||
  3948. ("function" === typeof instance.componentWillMount &&
  3949. instance.componentWillMount(),
  3950. "function" === typeof instance.UNSAFE_componentWillMount &&
  3951. instance.UNSAFE_componentWillMount()),
  3952. "function" === typeof instance.componentDidMount &&
  3953. (workInProgress.effectTag |= 4))
  3954. : ("function" === typeof instance.componentDidMount &&
  3955. (workInProgress.effectTag |= 4),
  3956. (workInProgress.memoizedProps = nextProps),
  3957. (workInProgress.memoizedState = oldContext)),
  3958. (instance.props = nextProps),
  3959. (instance.state = oldContext),
  3960. (instance.context = contextType),
  3961. (nextProps = oldProps))
  3962. : ("function" === typeof instance.componentDidMount &&
  3963. (workInProgress.effectTag |= 4),
  3964. (nextProps = !1));
  3965. } else
  3966. (instance = workInProgress.stateNode),
  3967. cloneUpdateQueue(current, workInProgress),
  3968. (oldProps = workInProgress.memoizedProps),
  3969. (instance.props =
  3970. workInProgress.type === workInProgress.elementType
  3971. ? oldProps
  3972. : resolveDefaultProps(workInProgress.type, oldProps)),
  3973. (oldContext = instance.context),
  3974. (contextType = Component.contextType),
  3975. "object" === typeof contextType && null !== contextType
  3976. ? (contextType = readContext(contextType))
  3977. : ((contextType = isContextProvider(Component)
  3978. ? previousContext
  3979. : contextStackCursor.current),
  3980. (contextType = getMaskedContext(workInProgress, contextType))),
  3981. (getDerivedStateFromProps = Component.getDerivedStateFromProps),
  3982. (hasNewLifecycles =
  3983. "function" === typeof getDerivedStateFromProps ||
  3984. "function" === typeof instance.getSnapshotBeforeUpdate) ||
  3985. ("function" !== typeof instance.UNSAFE_componentWillReceiveProps &&
  3986. "function" !== typeof instance.componentWillReceiveProps) ||
  3987. ((oldProps !== nextProps || oldContext !== contextType) &&
  3988. callComponentWillReceiveProps(
  3989. workInProgress,
  3990. instance,
  3991. nextProps,
  3992. contextType
  3993. )),
  3994. (hasForceUpdate = !1),
  3995. (oldContext = workInProgress.memoizedState),
  3996. (instance.state = oldContext),
  3997. processUpdateQueue(
  3998. workInProgress,
  3999. nextProps,
  4000. instance,
  4001. renderExpirationTime
  4002. ),
  4003. (oldState = workInProgress.memoizedState),
  4004. oldProps !== nextProps ||
  4005. oldContext !== oldState ||
  4006. didPerformWorkStackCursor.current ||
  4007. hasForceUpdate
  4008. ? ("function" === typeof getDerivedStateFromProps &&
  4009. (applyDerivedStateFromProps(
  4010. workInProgress,
  4011. Component,
  4012. getDerivedStateFromProps,
  4013. nextProps
  4014. ),
  4015. (oldState = workInProgress.memoizedState)),
  4016. (getDerivedStateFromProps =
  4017. hasForceUpdate ||
  4018. checkShouldComponentUpdate(
  4019. workInProgress,
  4020. Component,
  4021. oldProps,
  4022. nextProps,
  4023. oldContext,
  4024. oldState,
  4025. contextType
  4026. ))
  4027. ? (hasNewLifecycles ||
  4028. ("function" !== typeof instance.UNSAFE_componentWillUpdate &&
  4029. "function" !== typeof instance.componentWillUpdate) ||
  4030. ("function" === typeof instance.componentWillUpdate &&
  4031. instance.componentWillUpdate(
  4032. nextProps,
  4033. oldState,
  4034. contextType
  4035. ),
  4036. "function" === typeof instance.UNSAFE_componentWillUpdate &&
  4037. instance.UNSAFE_componentWillUpdate(
  4038. nextProps,
  4039. oldState,
  4040. contextType
  4041. )),
  4042. "function" === typeof instance.componentDidUpdate &&
  4043. (workInProgress.effectTag |= 4),
  4044. "function" === typeof instance.getSnapshotBeforeUpdate &&
  4045. (workInProgress.effectTag |= 256))
  4046. : ("function" !== typeof instance.componentDidUpdate ||
  4047. (oldProps === current.memoizedProps &&
  4048. oldContext === current.memoizedState) ||
  4049. (workInProgress.effectTag |= 4),
  4050. "function" !== typeof instance.getSnapshotBeforeUpdate ||
  4051. (oldProps === current.memoizedProps &&
  4052. oldContext === current.memoizedState) ||
  4053. (workInProgress.effectTag |= 256),
  4054. (workInProgress.memoizedProps = nextProps),
  4055. (workInProgress.memoizedState = oldState)),
  4056. (instance.props = nextProps),
  4057. (instance.state = oldState),
  4058. (instance.context = contextType),
  4059. (nextProps = getDerivedStateFromProps))
  4060. : ("function" !== typeof instance.componentDidUpdate ||
  4061. (oldProps === current.memoizedProps &&
  4062. oldContext === current.memoizedState) ||
  4063. (workInProgress.effectTag |= 4),
  4064. "function" !== typeof instance.getSnapshotBeforeUpdate ||
  4065. (oldProps === current.memoizedProps &&
  4066. oldContext === current.memoizedState) ||
  4067. (workInProgress.effectTag |= 256),
  4068. (nextProps = !1));
  4069. return finishClassComponent(
  4070. current,
  4071. workInProgress,
  4072. Component,
  4073. nextProps,
  4074. hasContext,
  4075. renderExpirationTime
  4076. );
  4077. }
  4078. function finishClassComponent(
  4079. current,
  4080. workInProgress,
  4081. Component,
  4082. shouldUpdate,
  4083. hasContext,
  4084. renderExpirationTime
  4085. ) {
  4086. markRef(current, workInProgress);
  4087. var didCaptureError = 0 !== (workInProgress.effectTag & 64);
  4088. if (!shouldUpdate && !didCaptureError)
  4089. return (
  4090. hasContext && invalidateContextProvider(workInProgress, Component, !1),
  4091. bailoutOnAlreadyFinishedWork(
  4092. current,
  4093. workInProgress,
  4094. renderExpirationTime
  4095. )
  4096. );
  4097. shouldUpdate = workInProgress.stateNode;
  4098. ReactCurrentOwner$1.current = workInProgress;
  4099. var nextChildren =
  4100. didCaptureError && "function" !== typeof Component.getDerivedStateFromError
  4101. ? null
  4102. : shouldUpdate.render();
  4103. workInProgress.effectTag |= 1;
  4104. null !== current && didCaptureError
  4105. ? ((workInProgress.child = reconcileChildFibers(
  4106. workInProgress,
  4107. current.child,
  4108. null,
  4109. renderExpirationTime
  4110. )),
  4111. (workInProgress.child = reconcileChildFibers(
  4112. workInProgress,
  4113. null,
  4114. nextChildren,
  4115. renderExpirationTime
  4116. )))
  4117. : reconcileChildren(
  4118. current,
  4119. workInProgress,
  4120. nextChildren,
  4121. renderExpirationTime
  4122. );
  4123. workInProgress.memoizedState = shouldUpdate.state;
  4124. hasContext && invalidateContextProvider(workInProgress, Component, !0);
  4125. return workInProgress.child;
  4126. }
  4127. function pushHostRootContext(workInProgress) {
  4128. var root = workInProgress.stateNode;
  4129. root.pendingContext
  4130. ? pushTopLevelContextObject(
  4131. workInProgress,
  4132. root.pendingContext,
  4133. root.pendingContext !== root.context
  4134. )
  4135. : root.context &&
  4136. pushTopLevelContextObject(workInProgress, root.context, !1);
  4137. pushHostContainer(workInProgress, root.containerInfo);
  4138. }
  4139. var SUSPENDED_MARKER = { dehydrated: null, retryTime: 0 };
  4140. function updateSuspenseComponent(
  4141. current,
  4142. workInProgress,
  4143. renderExpirationTime
  4144. ) {
  4145. var mode = workInProgress.mode,
  4146. nextProps = workInProgress.pendingProps,
  4147. suspenseContext = suspenseStackCursor.current,
  4148. nextDidTimeout = !1,
  4149. JSCompiler_temp;
  4150. (JSCompiler_temp = 0 !== (workInProgress.effectTag & 64)) ||
  4151. (JSCompiler_temp =
  4152. 0 !== (suspenseContext & 2) &&
  4153. (null === current || null !== current.memoizedState));
  4154. JSCompiler_temp
  4155. ? ((nextDidTimeout = !0), (workInProgress.effectTag &= -65))
  4156. : (null !== current && null === current.memoizedState) ||
  4157. void 0 === nextProps.fallback ||
  4158. !0 === nextProps.unstable_avoidThisFallback ||
  4159. (suspenseContext |= 1);
  4160. push(suspenseStackCursor, suspenseContext & 1);
  4161. if (null === current) {
  4162. if (nextDidTimeout) {
  4163. nextDidTimeout = nextProps.fallback;
  4164. nextProps = createFiberFromFragment(null, mode, 0, null);
  4165. nextProps.return = workInProgress;
  4166. if (0 === (workInProgress.mode & 2))
  4167. for (
  4168. current =
  4169. null !== workInProgress.memoizedState
  4170. ? workInProgress.child.child
  4171. : workInProgress.child,
  4172. nextProps.child = current;
  4173. null !== current;
  4174. )
  4175. (current.return = nextProps), (current = current.sibling);
  4176. renderExpirationTime = createFiberFromFragment(
  4177. nextDidTimeout,
  4178. mode,
  4179. renderExpirationTime,
  4180. null
  4181. );
  4182. renderExpirationTime.return = workInProgress;
  4183. nextProps.sibling = renderExpirationTime;
  4184. workInProgress.memoizedState = SUSPENDED_MARKER;
  4185. workInProgress.child = nextProps;
  4186. return renderExpirationTime;
  4187. }
  4188. mode = nextProps.children;
  4189. workInProgress.memoizedState = null;
  4190. return (workInProgress.child = mountChildFibers(
  4191. workInProgress,
  4192. null,
  4193. mode,
  4194. renderExpirationTime
  4195. ));
  4196. }
  4197. if (null !== current.memoizedState) {
  4198. current = current.child;
  4199. mode = current.sibling;
  4200. if (nextDidTimeout) {
  4201. nextProps = nextProps.fallback;
  4202. renderExpirationTime = createWorkInProgress(
  4203. current,
  4204. current.pendingProps
  4205. );
  4206. renderExpirationTime.return = workInProgress;
  4207. if (
  4208. 0 === (workInProgress.mode & 2) &&
  4209. ((nextDidTimeout =
  4210. null !== workInProgress.memoizedState
  4211. ? workInProgress.child.child
  4212. : workInProgress.child),
  4213. nextDidTimeout !== current.child)
  4214. )
  4215. for (
  4216. renderExpirationTime.child = nextDidTimeout;
  4217. null !== nextDidTimeout;
  4218. )
  4219. (nextDidTimeout.return = renderExpirationTime),
  4220. (nextDidTimeout = nextDidTimeout.sibling);
  4221. mode = createWorkInProgress(mode, nextProps);
  4222. mode.return = workInProgress;
  4223. renderExpirationTime.sibling = mode;
  4224. renderExpirationTime.childExpirationTime = 0;
  4225. workInProgress.memoizedState = SUSPENDED_MARKER;
  4226. workInProgress.child = renderExpirationTime;
  4227. return mode;
  4228. }
  4229. renderExpirationTime = reconcileChildFibers(
  4230. workInProgress,
  4231. current.child,
  4232. nextProps.children,
  4233. renderExpirationTime
  4234. );
  4235. workInProgress.memoizedState = null;
  4236. return (workInProgress.child = renderExpirationTime);
  4237. }
  4238. current = current.child;
  4239. if (nextDidTimeout) {
  4240. nextDidTimeout = nextProps.fallback;
  4241. nextProps = createFiberFromFragment(null, mode, 0, null);
  4242. nextProps.return = workInProgress;
  4243. nextProps.child = current;
  4244. null !== current && (current.return = nextProps);
  4245. if (0 === (workInProgress.mode & 2))
  4246. for (
  4247. current =
  4248. null !== workInProgress.memoizedState
  4249. ? workInProgress.child.child
  4250. : workInProgress.child,
  4251. nextProps.child = current;
  4252. null !== current;
  4253. )
  4254. (current.return = nextProps), (current = current.sibling);
  4255. renderExpirationTime = createFiberFromFragment(
  4256. nextDidTimeout,
  4257. mode,
  4258. renderExpirationTime,
  4259. null
  4260. );
  4261. renderExpirationTime.return = workInProgress;
  4262. nextProps.sibling = renderExpirationTime;
  4263. renderExpirationTime.effectTag |= 2;
  4264. nextProps.childExpirationTime = 0;
  4265. workInProgress.memoizedState = SUSPENDED_MARKER;
  4266. workInProgress.child = nextProps;
  4267. return renderExpirationTime;
  4268. }
  4269. workInProgress.memoizedState = null;
  4270. return (workInProgress.child = reconcileChildFibers(
  4271. workInProgress,
  4272. current,
  4273. nextProps.children,
  4274. renderExpirationTime
  4275. ));
  4276. }
  4277. function scheduleWorkOnFiber(fiber, renderExpirationTime) {
  4278. fiber.expirationTime < renderExpirationTime &&
  4279. (fiber.expirationTime = renderExpirationTime);
  4280. var alternate = fiber.alternate;
  4281. null !== alternate &&
  4282. alternate.expirationTime < renderExpirationTime &&
  4283. (alternate.expirationTime = renderExpirationTime);
  4284. scheduleWorkOnParentPath(fiber.return, renderExpirationTime);
  4285. }
  4286. function initSuspenseListRenderState(
  4287. workInProgress,
  4288. isBackwards,
  4289. tail,
  4290. lastContentRow,
  4291. tailMode,
  4292. lastEffectBeforeRendering
  4293. ) {
  4294. var renderState = workInProgress.memoizedState;
  4295. null === renderState
  4296. ? (workInProgress.memoizedState = {
  4297. isBackwards: isBackwards,
  4298. rendering: null,
  4299. renderingStartTime: 0,
  4300. last: lastContentRow,
  4301. tail: tail,
  4302. tailExpiration: 0,
  4303. tailMode: tailMode,
  4304. lastEffect: lastEffectBeforeRendering
  4305. })
  4306. : ((renderState.isBackwards = isBackwards),
  4307. (renderState.rendering = null),
  4308. (renderState.renderingStartTime = 0),
  4309. (renderState.last = lastContentRow),
  4310. (renderState.tail = tail),
  4311. (renderState.tailExpiration = 0),
  4312. (renderState.tailMode = tailMode),
  4313. (renderState.lastEffect = lastEffectBeforeRendering));
  4314. }
  4315. function updateSuspenseListComponent(
  4316. current,
  4317. workInProgress,
  4318. renderExpirationTime
  4319. ) {
  4320. var nextProps = workInProgress.pendingProps,
  4321. revealOrder = nextProps.revealOrder,
  4322. tailMode = nextProps.tail;
  4323. reconcileChildren(
  4324. current,
  4325. workInProgress,
  4326. nextProps.children,
  4327. renderExpirationTime
  4328. );
  4329. nextProps = suspenseStackCursor.current;
  4330. if (0 !== (nextProps & 2))
  4331. (nextProps = (nextProps & 1) | 2), (workInProgress.effectTag |= 64);
  4332. else {
  4333. if (null !== current && 0 !== (current.effectTag & 64))
  4334. a: for (current = workInProgress.child; null !== current; ) {
  4335. if (13 === current.tag)
  4336. null !== current.memoizedState &&
  4337. scheduleWorkOnFiber(current, renderExpirationTime);
  4338. else if (19 === current.tag)
  4339. scheduleWorkOnFiber(current, renderExpirationTime);
  4340. else if (null !== current.child) {
  4341. current.child.return = current;
  4342. current = current.child;
  4343. continue;
  4344. }
  4345. if (current === workInProgress) break a;
  4346. for (; null === current.sibling; ) {
  4347. if (null === current.return || current.return === workInProgress)
  4348. break a;
  4349. current = current.return;
  4350. }
  4351. current.sibling.return = current.return;
  4352. current = current.sibling;
  4353. }
  4354. nextProps &= 1;
  4355. }
  4356. push(suspenseStackCursor, nextProps);
  4357. if (0 === (workInProgress.mode & 2)) workInProgress.memoizedState = null;
  4358. else
  4359. switch (revealOrder) {
  4360. case "forwards":
  4361. renderExpirationTime = workInProgress.child;
  4362. for (revealOrder = null; null !== renderExpirationTime; )
  4363. (current = renderExpirationTime.alternate),
  4364. null !== current &&
  4365. null === findFirstSuspended(current) &&
  4366. (revealOrder = renderExpirationTime),
  4367. (renderExpirationTime = renderExpirationTime.sibling);
  4368. renderExpirationTime = revealOrder;
  4369. null === renderExpirationTime
  4370. ? ((revealOrder = workInProgress.child),
  4371. (workInProgress.child = null))
  4372. : ((revealOrder = renderExpirationTime.sibling),
  4373. (renderExpirationTime.sibling = null));
  4374. initSuspenseListRenderState(
  4375. workInProgress,
  4376. !1,
  4377. revealOrder,
  4378. renderExpirationTime,
  4379. tailMode,
  4380. workInProgress.lastEffect
  4381. );
  4382. break;
  4383. case "backwards":
  4384. renderExpirationTime = null;
  4385. revealOrder = workInProgress.child;
  4386. for (workInProgress.child = null; null !== revealOrder; ) {
  4387. current = revealOrder.alternate;
  4388. if (null !== current && null === findFirstSuspended(current)) {
  4389. workInProgress.child = revealOrder;
  4390. break;
  4391. }
  4392. current = revealOrder.sibling;
  4393. revealOrder.sibling = renderExpirationTime;
  4394. renderExpirationTime = revealOrder;
  4395. revealOrder = current;
  4396. }
  4397. initSuspenseListRenderState(
  4398. workInProgress,
  4399. !0,
  4400. renderExpirationTime,
  4401. null,
  4402. tailMode,
  4403. workInProgress.lastEffect
  4404. );
  4405. break;
  4406. case "together":
  4407. initSuspenseListRenderState(
  4408. workInProgress,
  4409. !1,
  4410. null,
  4411. null,
  4412. void 0,
  4413. workInProgress.lastEffect
  4414. );
  4415. break;
  4416. default:
  4417. workInProgress.memoizedState = null;
  4418. }
  4419. return workInProgress.child;
  4420. }
  4421. function bailoutOnAlreadyFinishedWork(
  4422. current,
  4423. workInProgress,
  4424. renderExpirationTime
  4425. ) {
  4426. null !== current && (workInProgress.dependencies = current.dependencies);
  4427. var updateExpirationTime = workInProgress.expirationTime;
  4428. 0 !== updateExpirationTime && markUnprocessedUpdateTime(updateExpirationTime);
  4429. if (workInProgress.childExpirationTime < renderExpirationTime) return null;
  4430. if (null !== current && workInProgress.child !== current.child)
  4431. throw Error("Resuming work not yet implemented.");
  4432. if (null !== workInProgress.child) {
  4433. current = workInProgress.child;
  4434. renderExpirationTime = createWorkInProgress(current, current.pendingProps);
  4435. workInProgress.child = renderExpirationTime;
  4436. for (
  4437. renderExpirationTime.return = workInProgress;
  4438. null !== current.sibling;
  4439. )
  4440. (current = current.sibling),
  4441. (renderExpirationTime = renderExpirationTime.sibling = createWorkInProgress(
  4442. current,
  4443. current.pendingProps
  4444. )),
  4445. (renderExpirationTime.return = workInProgress);
  4446. renderExpirationTime.sibling = null;
  4447. }
  4448. return workInProgress.child;
  4449. }
  4450. var appendAllChildren,
  4451. updateHostContainer,
  4452. updateHostComponent$1,
  4453. updateHostText$1;
  4454. appendAllChildren = function(parent, workInProgress) {
  4455. for (var node = workInProgress.child; null !== node; ) {
  4456. if (5 === node.tag || 6 === node.tag) parent._children.push(node.stateNode);
  4457. else if (4 !== node.tag && null !== node.child) {
  4458. node.child.return = node;
  4459. node = node.child;
  4460. continue;
  4461. }
  4462. if (node === workInProgress) break;
  4463. for (; null === node.sibling; ) {
  4464. if (null === node.return || node.return === workInProgress) return;
  4465. node = node.return;
  4466. }
  4467. node.sibling.return = node.return;
  4468. node = node.sibling;
  4469. }
  4470. };
  4471. updateHostContainer = function() {};
  4472. updateHostComponent$1 = function(current, workInProgress, type, newProps) {
  4473. current.memoizedProps !== newProps &&
  4474. (requiredContext(contextStackCursor$1.current),
  4475. (workInProgress.updateQueue = UPDATE_SIGNAL)) &&
  4476. (workInProgress.effectTag |= 4);
  4477. };
  4478. updateHostText$1 = function(current, workInProgress, oldText, newText) {
  4479. oldText !== newText && (workInProgress.effectTag |= 4);
  4480. };
  4481. function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
  4482. switch (renderState.tailMode) {
  4483. case "hidden":
  4484. hasRenderedATailFallback = renderState.tail;
  4485. for (var lastTailNode = null; null !== hasRenderedATailFallback; )
  4486. null !== hasRenderedATailFallback.alternate &&
  4487. (lastTailNode = hasRenderedATailFallback),
  4488. (hasRenderedATailFallback = hasRenderedATailFallback.sibling);
  4489. null === lastTailNode
  4490. ? (renderState.tail = null)
  4491. : (lastTailNode.sibling = null);
  4492. break;
  4493. case "collapsed":
  4494. lastTailNode = renderState.tail;
  4495. for (var _lastTailNode = null; null !== lastTailNode; )
  4496. null !== lastTailNode.alternate && (_lastTailNode = lastTailNode),
  4497. (lastTailNode = lastTailNode.sibling);
  4498. null === _lastTailNode
  4499. ? hasRenderedATailFallback || null === renderState.tail
  4500. ? (renderState.tail = null)
  4501. : (renderState.tail.sibling = null)
  4502. : (_lastTailNode.sibling = null);
  4503. }
  4504. }
  4505. function completeWork(current, workInProgress, renderExpirationTime) {
  4506. var newProps = workInProgress.pendingProps;
  4507. switch (workInProgress.tag) {
  4508. case 2:
  4509. case 16:
  4510. case 15:
  4511. case 0:
  4512. case 11:
  4513. case 7:
  4514. case 8:
  4515. case 12:
  4516. case 9:
  4517. case 14:
  4518. return null;
  4519. case 1:
  4520. return isContextProvider(workInProgress.type) && popContext(), null;
  4521. case 3:
  4522. return (
  4523. popHostContainer(),
  4524. pop(didPerformWorkStackCursor),
  4525. pop(contextStackCursor),
  4526. (current = workInProgress.stateNode),
  4527. current.pendingContext &&
  4528. ((current.context = current.pendingContext),
  4529. (current.pendingContext = null)),
  4530. updateHostContainer(workInProgress),
  4531. null
  4532. );
  4533. case 5:
  4534. popHostContext(workInProgress);
  4535. var rootContainerInstance = requiredContext(
  4536. rootInstanceStackCursor.current
  4537. );
  4538. renderExpirationTime = workInProgress.type;
  4539. if (null !== current && null != workInProgress.stateNode)
  4540. updateHostComponent$1(
  4541. current,
  4542. workInProgress,
  4543. renderExpirationTime,
  4544. newProps,
  4545. rootContainerInstance
  4546. ),
  4547. current.ref !== workInProgress.ref &&
  4548. (workInProgress.effectTag |= 128);
  4549. else {
  4550. if (!newProps) {
  4551. if (null === workInProgress.stateNode)
  4552. throw Error(
  4553. "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
  4554. );
  4555. return null;
  4556. }
  4557. requiredContext(contextStackCursor$1.current);
  4558. current = allocateTag();
  4559. renderExpirationTime = getViewConfigForType(renderExpirationTime);
  4560. var updatePayload = diffProperties(
  4561. null,
  4562. emptyObject,
  4563. newProps,
  4564. renderExpirationTime.validAttributes
  4565. );
  4566. ReactNativePrivateInterface.UIManager.createView(
  4567. current,
  4568. renderExpirationTime.uiViewClassName,
  4569. rootContainerInstance,
  4570. updatePayload
  4571. );
  4572. rootContainerInstance = new ReactNativeFiberHostComponent(
  4573. current,
  4574. renderExpirationTime,
  4575. workInProgress
  4576. );
  4577. instanceCache.set(current, workInProgress);
  4578. instanceProps.set(current, newProps);
  4579. appendAllChildren(rootContainerInstance, workInProgress, !1, !1);
  4580. workInProgress.stateNode = rootContainerInstance;
  4581. finalizeInitialChildren(rootContainerInstance) &&
  4582. (workInProgress.effectTag |= 4);
  4583. null !== workInProgress.ref && (workInProgress.effectTag |= 128);
  4584. }
  4585. return null;
  4586. case 6:
  4587. if (current && null != workInProgress.stateNode)
  4588. updateHostText$1(
  4589. current,
  4590. workInProgress,
  4591. current.memoizedProps,
  4592. newProps
  4593. );
  4594. else {
  4595. if ("string" !== typeof newProps && null === workInProgress.stateNode)
  4596. throw Error(
  4597. "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
  4598. );
  4599. current = requiredContext(rootInstanceStackCursor.current);
  4600. if (!requiredContext(contextStackCursor$1.current).isInAParentText)
  4601. throw Error(
  4602. "Text strings must be rendered within a <Text> component."
  4603. );
  4604. rootContainerInstance = allocateTag();
  4605. ReactNativePrivateInterface.UIManager.createView(
  4606. rootContainerInstance,
  4607. "RCTRawText",
  4608. current,
  4609. { text: newProps }
  4610. );
  4611. instanceCache.set(rootContainerInstance, workInProgress);
  4612. workInProgress.stateNode = rootContainerInstance;
  4613. }
  4614. return null;
  4615. case 13:
  4616. pop(suspenseStackCursor);
  4617. newProps = workInProgress.memoizedState;
  4618. if (0 !== (workInProgress.effectTag & 64))
  4619. return (
  4620. (workInProgress.expirationTime = renderExpirationTime), workInProgress
  4621. );
  4622. newProps = null !== newProps;
  4623. rootContainerInstance = !1;
  4624. null !== current &&
  4625. ((renderExpirationTime = current.memoizedState),
  4626. (rootContainerInstance = null !== renderExpirationTime),
  4627. newProps ||
  4628. null === renderExpirationTime ||
  4629. ((renderExpirationTime = current.child.sibling),
  4630. null !== renderExpirationTime &&
  4631. ((updatePayload = workInProgress.firstEffect),
  4632. null !== updatePayload
  4633. ? ((workInProgress.firstEffect = renderExpirationTime),
  4634. (renderExpirationTime.nextEffect = updatePayload))
  4635. : ((workInProgress.firstEffect = workInProgress.lastEffect = renderExpirationTime),
  4636. (renderExpirationTime.nextEffect = null)),
  4637. (renderExpirationTime.effectTag = 8))));
  4638. if (newProps && !rootContainerInstance && 0 !== (workInProgress.mode & 2))
  4639. if (
  4640. (null === current &&
  4641. !0 !== workInProgress.memoizedProps.unstable_avoidThisFallback) ||
  4642. 0 !== (suspenseStackCursor.current & 1)
  4643. )
  4644. workInProgressRootExitStatus === RootIncomplete &&
  4645. (workInProgressRootExitStatus = RootSuspended);
  4646. else {
  4647. if (
  4648. workInProgressRootExitStatus === RootIncomplete ||
  4649. workInProgressRootExitStatus === RootSuspended
  4650. )
  4651. workInProgressRootExitStatus = RootSuspendedWithDelay;
  4652. 0 !== workInProgressRootNextUnprocessedUpdateTime &&
  4653. null !== workInProgressRoot &&
  4654. (markRootSuspendedAtTime(
  4655. workInProgressRoot,
  4656. renderExpirationTime$1
  4657. ),
  4658. markRootUpdatedAtTime(
  4659. workInProgressRoot,
  4660. workInProgressRootNextUnprocessedUpdateTime
  4661. ));
  4662. }
  4663. if (newProps || rootContainerInstance) workInProgress.effectTag |= 4;
  4664. return null;
  4665. case 4:
  4666. return popHostContainer(), updateHostContainer(workInProgress), null;
  4667. case 10:
  4668. return popProvider(workInProgress), null;
  4669. case 17:
  4670. return isContextProvider(workInProgress.type) && popContext(), null;
  4671. case 19:
  4672. pop(suspenseStackCursor);
  4673. newProps = workInProgress.memoizedState;
  4674. if (null === newProps) return null;
  4675. rootContainerInstance = 0 !== (workInProgress.effectTag & 64);
  4676. updatePayload = newProps.rendering;
  4677. if (null === updatePayload)
  4678. if (rootContainerInstance) cutOffTailIfNeeded(newProps, !1);
  4679. else {
  4680. if (
  4681. workInProgressRootExitStatus !== RootIncomplete ||
  4682. (null !== current && 0 !== (current.effectTag & 64))
  4683. )
  4684. for (current = workInProgress.child; null !== current; ) {
  4685. updatePayload = findFirstSuspended(current);
  4686. if (null !== updatePayload) {
  4687. workInProgress.effectTag |= 64;
  4688. cutOffTailIfNeeded(newProps, !1);
  4689. current = updatePayload.updateQueue;
  4690. null !== current &&
  4691. ((workInProgress.updateQueue = current),
  4692. (workInProgress.effectTag |= 4));
  4693. null === newProps.lastEffect &&
  4694. (workInProgress.firstEffect = null);
  4695. workInProgress.lastEffect = newProps.lastEffect;
  4696. current = renderExpirationTime;
  4697. for (newProps = workInProgress.child; null !== newProps; )
  4698. (rootContainerInstance = newProps),
  4699. (renderExpirationTime = current),
  4700. (rootContainerInstance.effectTag &= 2),
  4701. (rootContainerInstance.nextEffect = null),
  4702. (rootContainerInstance.firstEffect = null),
  4703. (rootContainerInstance.lastEffect = null),
  4704. (updatePayload = rootContainerInstance.alternate),
  4705. null === updatePayload
  4706. ? ((rootContainerInstance.childExpirationTime = 0),
  4707. (rootContainerInstance.expirationTime = renderExpirationTime),
  4708. (rootContainerInstance.child = null),
  4709. (rootContainerInstance.memoizedProps = null),
  4710. (rootContainerInstance.memoizedState = null),
  4711. (rootContainerInstance.updateQueue = null),
  4712. (rootContainerInstance.dependencies = null))
  4713. : ((rootContainerInstance.childExpirationTime =
  4714. updatePayload.childExpirationTime),
  4715. (rootContainerInstance.expirationTime =
  4716. updatePayload.expirationTime),
  4717. (rootContainerInstance.child = updatePayload.child),
  4718. (rootContainerInstance.memoizedProps =
  4719. updatePayload.memoizedProps),
  4720. (rootContainerInstance.memoizedState =
  4721. updatePayload.memoizedState),
  4722. (rootContainerInstance.updateQueue =
  4723. updatePayload.updateQueue),
  4724. (renderExpirationTime = updatePayload.dependencies),
  4725. (rootContainerInstance.dependencies =
  4726. null === renderExpirationTime
  4727. ? null
  4728. : {
  4729. expirationTime:
  4730. renderExpirationTime.expirationTime,
  4731. firstContext: renderExpirationTime.firstContext,
  4732. responders: renderExpirationTime.responders
  4733. })),
  4734. (newProps = newProps.sibling);
  4735. push(
  4736. suspenseStackCursor,
  4737. (suspenseStackCursor.current & 1) | 2
  4738. );
  4739. return workInProgress.child;
  4740. }
  4741. current = current.sibling;
  4742. }
  4743. }
  4744. else {
  4745. if (!rootContainerInstance)
  4746. if (
  4747. ((current = findFirstSuspended(updatePayload)), null !== current)
  4748. ) {
  4749. if (
  4750. ((workInProgress.effectTag |= 64),
  4751. (rootContainerInstance = !0),
  4752. (current = current.updateQueue),
  4753. null !== current &&
  4754. ((workInProgress.updateQueue = current),
  4755. (workInProgress.effectTag |= 4)),
  4756. cutOffTailIfNeeded(newProps, !0),
  4757. null === newProps.tail &&
  4758. "hidden" === newProps.tailMode &&
  4759. !updatePayload.alternate)
  4760. )
  4761. return (
  4762. (workInProgress = workInProgress.lastEffect =
  4763. newProps.lastEffect),
  4764. null !== workInProgress && (workInProgress.nextEffect = null),
  4765. null
  4766. );
  4767. } else
  4768. 2 * now() - newProps.renderingStartTime > newProps.tailExpiration &&
  4769. 1 < renderExpirationTime &&
  4770. ((workInProgress.effectTag |= 64),
  4771. (rootContainerInstance = !0),
  4772. cutOffTailIfNeeded(newProps, !1),
  4773. (workInProgress.expirationTime = workInProgress.childExpirationTime =
  4774. renderExpirationTime - 1));
  4775. newProps.isBackwards
  4776. ? ((updatePayload.sibling = workInProgress.child),
  4777. (workInProgress.child = updatePayload))
  4778. : ((current = newProps.last),
  4779. null !== current
  4780. ? (current.sibling = updatePayload)
  4781. : (workInProgress.child = updatePayload),
  4782. (newProps.last = updatePayload));
  4783. }
  4784. return null !== newProps.tail
  4785. ? (0 === newProps.tailExpiration &&
  4786. (newProps.tailExpiration = now() + 500),
  4787. (current = newProps.tail),
  4788. (newProps.rendering = current),
  4789. (newProps.tail = current.sibling),
  4790. (newProps.lastEffect = workInProgress.lastEffect),
  4791. (newProps.renderingStartTime = now()),
  4792. (current.sibling = null),
  4793. (workInProgress = suspenseStackCursor.current),
  4794. push(
  4795. suspenseStackCursor,
  4796. rootContainerInstance
  4797. ? (workInProgress & 1) | 2
  4798. : workInProgress & 1
  4799. ),
  4800. current)
  4801. : null;
  4802. }
  4803. throw Error(
  4804. "Unknown unit of work tag (" +
  4805. workInProgress.tag +
  4806. "). This error is likely caused by a bug in React. Please file an issue."
  4807. );
  4808. }
  4809. function unwindWork(workInProgress) {
  4810. switch (workInProgress.tag) {
  4811. case 1:
  4812. isContextProvider(workInProgress.type) && popContext();
  4813. var effectTag = workInProgress.effectTag;
  4814. return effectTag & 4096
  4815. ? ((workInProgress.effectTag = (effectTag & -4097) | 64),
  4816. workInProgress)
  4817. : null;
  4818. case 3:
  4819. popHostContainer();
  4820. pop(didPerformWorkStackCursor);
  4821. pop(contextStackCursor);
  4822. effectTag = workInProgress.effectTag;
  4823. if (0 !== (effectTag & 64))
  4824. throw Error(
  4825. "The root failed to unmount after an error. This is likely a bug in React. Please file an issue."
  4826. );
  4827. workInProgress.effectTag = (effectTag & -4097) | 64;
  4828. return workInProgress;
  4829. case 5:
  4830. return popHostContext(workInProgress), null;
  4831. case 13:
  4832. return (
  4833. pop(suspenseStackCursor),
  4834. (effectTag = workInProgress.effectTag),
  4835. effectTag & 4096
  4836. ? ((workInProgress.effectTag = (effectTag & -4097) | 64),
  4837. workInProgress)
  4838. : null
  4839. );
  4840. case 19:
  4841. return pop(suspenseStackCursor), null;
  4842. case 4:
  4843. return popHostContainer(), null;
  4844. case 10:
  4845. return popProvider(workInProgress), null;
  4846. default:
  4847. return null;
  4848. }
  4849. }
  4850. function createCapturedValue(value, source) {
  4851. return {
  4852. value: value,
  4853. source: source,
  4854. stack: getStackByFiberInDevAndProd(source)
  4855. };
  4856. }
  4857. if (
  4858. "function" !==
  4859. typeof ReactNativePrivateInterface.ReactFiberErrorDialog.showErrorDialog
  4860. )
  4861. throw Error(
  4862. "Expected ReactFiberErrorDialog.showErrorDialog to be a function."
  4863. );
  4864. function logCapturedError(capturedError) {
  4865. !1 !==
  4866. ReactNativePrivateInterface.ReactFiberErrorDialog.showErrorDialog(
  4867. capturedError
  4868. ) && console.error(capturedError.error);
  4869. }
  4870. var PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set;
  4871. function logError(boundary, errorInfo) {
  4872. var source = errorInfo.source,
  4873. stack = errorInfo.stack;
  4874. null === stack &&
  4875. null !== source &&
  4876. (stack = getStackByFiberInDevAndProd(source));
  4877. errorInfo = {
  4878. componentName: null !== source ? getComponentName(source.type) : null,
  4879. componentStack: null !== stack ? stack : "",
  4880. error: errorInfo.value,
  4881. errorBoundary: null,
  4882. errorBoundaryName: null,
  4883. errorBoundaryFound: !1,
  4884. willRetry: !1
  4885. };
  4886. null !== boundary &&
  4887. 1 === boundary.tag &&
  4888. ((errorInfo.errorBoundary = boundary.stateNode),
  4889. (errorInfo.errorBoundaryName = getComponentName(boundary.type)),
  4890. (errorInfo.errorBoundaryFound = !0),
  4891. (errorInfo.willRetry = !0));
  4892. try {
  4893. logCapturedError(errorInfo);
  4894. } catch (e) {
  4895. setTimeout(function() {
  4896. throw e;
  4897. });
  4898. }
  4899. }
  4900. function safelyCallComponentWillUnmount(current, instance) {
  4901. try {
  4902. (instance.props = current.memoizedProps),
  4903. (instance.state = current.memoizedState),
  4904. instance.componentWillUnmount();
  4905. } catch (unmountError) {
  4906. captureCommitPhaseError(current, unmountError);
  4907. }
  4908. }
  4909. function safelyDetachRef(current) {
  4910. var ref = current.ref;
  4911. if (null !== ref)
  4912. if ("function" === typeof ref)
  4913. try {
  4914. ref(null);
  4915. } catch (refError) {
  4916. captureCommitPhaseError(current, refError);
  4917. }
  4918. else ref.current = null;
  4919. }
  4920. function commitBeforeMutationLifeCycles(current, finishedWork) {
  4921. switch (finishedWork.tag) {
  4922. case 0:
  4923. case 11:
  4924. case 15:
  4925. case 22:
  4926. return;
  4927. case 1:
  4928. if (finishedWork.effectTag & 256 && null !== current) {
  4929. var prevProps = current.memoizedProps,
  4930. prevState = current.memoizedState;
  4931. current = finishedWork.stateNode;
  4932. finishedWork = current.getSnapshotBeforeUpdate(
  4933. finishedWork.elementType === finishedWork.type
  4934. ? prevProps
  4935. : resolveDefaultProps(finishedWork.type, prevProps),
  4936. prevState
  4937. );
  4938. current.__reactInternalSnapshotBeforeUpdate = finishedWork;
  4939. }
  4940. return;
  4941. case 3:
  4942. case 5:
  4943. case 6:
  4944. case 4:
  4945. case 17:
  4946. return;
  4947. }
  4948. throw Error(
  4949. "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."
  4950. );
  4951. }
  4952. function commitHookEffectListUnmount(tag, finishedWork) {
  4953. finishedWork = finishedWork.updateQueue;
  4954. finishedWork = null !== finishedWork ? finishedWork.lastEffect : null;
  4955. if (null !== finishedWork) {
  4956. var effect = (finishedWork = finishedWork.next);
  4957. do {
  4958. if ((effect.tag & tag) === tag) {
  4959. var destroy = effect.destroy;
  4960. effect.destroy = void 0;
  4961. void 0 !== destroy && destroy();
  4962. }
  4963. effect = effect.next;
  4964. } while (effect !== finishedWork);
  4965. }
  4966. }
  4967. function commitHookEffectListMount(tag, finishedWork) {
  4968. finishedWork = finishedWork.updateQueue;
  4969. finishedWork = null !== finishedWork ? finishedWork.lastEffect : null;
  4970. if (null !== finishedWork) {
  4971. var effect = (finishedWork = finishedWork.next);
  4972. do {
  4973. if ((effect.tag & tag) === tag) {
  4974. var create = effect.create;
  4975. effect.destroy = create();
  4976. }
  4977. effect = effect.next;
  4978. } while (effect !== finishedWork);
  4979. }
  4980. }
  4981. function commitLifeCycles(finishedRoot, current, finishedWork) {
  4982. switch (finishedWork.tag) {
  4983. case 0:
  4984. case 11:
  4985. case 15:
  4986. case 22:
  4987. commitHookEffectListMount(3, finishedWork);
  4988. return;
  4989. case 1:
  4990. finishedRoot = finishedWork.stateNode;
  4991. if (finishedWork.effectTag & 4)
  4992. if (null === current) finishedRoot.componentDidMount();
  4993. else {
  4994. var prevProps =
  4995. finishedWork.elementType === finishedWork.type
  4996. ? current.memoizedProps
  4997. : resolveDefaultProps(finishedWork.type, current.memoizedProps);
  4998. finishedRoot.componentDidUpdate(
  4999. prevProps,
  5000. current.memoizedState,
  5001. finishedRoot.__reactInternalSnapshotBeforeUpdate
  5002. );
  5003. }
  5004. current = finishedWork.updateQueue;
  5005. null !== current &&
  5006. commitUpdateQueue(finishedWork, current, finishedRoot);
  5007. return;
  5008. case 3:
  5009. current = finishedWork.updateQueue;
  5010. if (null !== current) {
  5011. finishedRoot = null;
  5012. if (null !== finishedWork.child)
  5013. switch (finishedWork.child.tag) {
  5014. case 5:
  5015. finishedRoot = finishedWork.child.stateNode;
  5016. break;
  5017. case 1:
  5018. finishedRoot = finishedWork.child.stateNode;
  5019. }
  5020. commitUpdateQueue(finishedWork, current, finishedRoot);
  5021. }
  5022. return;
  5023. case 5:
  5024. return;
  5025. case 6:
  5026. return;
  5027. case 4:
  5028. return;
  5029. case 12:
  5030. return;
  5031. case 13:
  5032. return;
  5033. case 19:
  5034. case 17:
  5035. case 20:
  5036. case 21:
  5037. return;
  5038. }
  5039. throw Error(
  5040. "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."
  5041. );
  5042. }
  5043. function commitUnmount(finishedRoot, current$jscomp$0, renderPriorityLevel) {
  5044. "function" === typeof onCommitFiberUnmount &&
  5045. onCommitFiberUnmount(current$jscomp$0);
  5046. switch (current$jscomp$0.tag) {
  5047. case 0:
  5048. case 11:
  5049. case 14:
  5050. case 15:
  5051. case 22:
  5052. finishedRoot = current$jscomp$0.updateQueue;
  5053. if (
  5054. null !== finishedRoot &&
  5055. ((finishedRoot = finishedRoot.lastEffect), null !== finishedRoot)
  5056. ) {
  5057. var firstEffect = finishedRoot.next;
  5058. runWithPriority(
  5059. 97 < renderPriorityLevel ? 97 : renderPriorityLevel,
  5060. function() {
  5061. var effect = firstEffect;
  5062. do {
  5063. var _destroy = effect.destroy;
  5064. if (void 0 !== _destroy) {
  5065. var current = current$jscomp$0;
  5066. try {
  5067. _destroy();
  5068. } catch (error) {
  5069. captureCommitPhaseError(current, error);
  5070. }
  5071. }
  5072. effect = effect.next;
  5073. } while (effect !== firstEffect);
  5074. }
  5075. );
  5076. }
  5077. break;
  5078. case 1:
  5079. safelyDetachRef(current$jscomp$0);
  5080. renderPriorityLevel = current$jscomp$0.stateNode;
  5081. "function" === typeof renderPriorityLevel.componentWillUnmount &&
  5082. safelyCallComponentWillUnmount(current$jscomp$0, renderPriorityLevel);
  5083. break;
  5084. case 5:
  5085. safelyDetachRef(current$jscomp$0);
  5086. break;
  5087. case 4:
  5088. unmountHostComponents(
  5089. finishedRoot,
  5090. current$jscomp$0,
  5091. renderPriorityLevel
  5092. );
  5093. }
  5094. }
  5095. function detachFiber(current) {
  5096. var alternate = current.alternate;
  5097. current.return = null;
  5098. current.child = null;
  5099. current.memoizedState = null;
  5100. current.updateQueue = null;
  5101. current.dependencies = null;
  5102. current.alternate = null;
  5103. current.firstEffect = null;
  5104. current.lastEffect = null;
  5105. current.pendingProps = null;
  5106. current.memoizedProps = null;
  5107. current.stateNode = null;
  5108. null !== alternate && detachFiber(alternate);
  5109. }
  5110. function isHostParent(fiber) {
  5111. return 5 === fiber.tag || 3 === fiber.tag || 4 === fiber.tag;
  5112. }
  5113. function commitPlacement(finishedWork) {
  5114. a: {
  5115. for (var parent = finishedWork.return; null !== parent; ) {
  5116. if (isHostParent(parent)) {
  5117. var parentFiber = parent;
  5118. break a;
  5119. }
  5120. parent = parent.return;
  5121. }
  5122. throw Error(
  5123. "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."
  5124. );
  5125. }
  5126. parent = parentFiber.stateNode;
  5127. switch (parentFiber.tag) {
  5128. case 5:
  5129. var isContainer = !1;
  5130. break;
  5131. case 3:
  5132. parent = parent.containerInfo;
  5133. isContainer = !0;
  5134. break;
  5135. case 4:
  5136. parent = parent.containerInfo;
  5137. isContainer = !0;
  5138. break;
  5139. default:
  5140. throw Error(
  5141. "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue."
  5142. );
  5143. }
  5144. parentFiber.effectTag & 16 && (parentFiber.effectTag &= -17);
  5145. a: b: for (parentFiber = finishedWork; ; ) {
  5146. for (; null === parentFiber.sibling; ) {
  5147. if (null === parentFiber.return || isHostParent(parentFiber.return)) {
  5148. parentFiber = null;
  5149. break a;
  5150. }
  5151. parentFiber = parentFiber.return;
  5152. }
  5153. parentFiber.sibling.return = parentFiber.return;
  5154. for (
  5155. parentFiber = parentFiber.sibling;
  5156. 5 !== parentFiber.tag && 6 !== parentFiber.tag && 18 !== parentFiber.tag;
  5157. ) {
  5158. if (parentFiber.effectTag & 2) continue b;
  5159. if (null === parentFiber.child || 4 === parentFiber.tag) continue b;
  5160. else
  5161. (parentFiber.child.return = parentFiber),
  5162. (parentFiber = parentFiber.child);
  5163. }
  5164. if (!(parentFiber.effectTag & 2)) {
  5165. parentFiber = parentFiber.stateNode;
  5166. break a;
  5167. }
  5168. }
  5169. isContainer
  5170. ? insertOrAppendPlacementNodeIntoContainer(
  5171. finishedWork,
  5172. parentFiber,
  5173. parent
  5174. )
  5175. : insertOrAppendPlacementNode(finishedWork, parentFiber, parent);
  5176. }
  5177. function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
  5178. var tag = node.tag,
  5179. isHost = 5 === tag || 6 === tag;
  5180. if (isHost)
  5181. if (((node = isHost ? node.stateNode : node.stateNode.instance), before)) {
  5182. if ("number" === typeof parent)
  5183. throw Error("Container does not support insertBefore operation");
  5184. } else
  5185. ReactNativePrivateInterface.UIManager.setChildren(parent, [
  5186. "number" === typeof node ? node : node._nativeTag
  5187. ]);
  5188. else if (4 !== tag && ((node = node.child), null !== node))
  5189. for (
  5190. insertOrAppendPlacementNodeIntoContainer(node, before, parent),
  5191. node = node.sibling;
  5192. null !== node;
  5193. )
  5194. insertOrAppendPlacementNodeIntoContainer(node, before, parent),
  5195. (node = node.sibling);
  5196. }
  5197. function insertOrAppendPlacementNode(node, before, parent) {
  5198. var tag = node.tag,
  5199. isHost = 5 === tag || 6 === tag;
  5200. if (isHost)
  5201. (node = isHost ? node.stateNode : node.stateNode.instance),
  5202. before
  5203. ? ((tag = parent._children),
  5204. (isHost = tag.indexOf(node)),
  5205. 0 <= isHost
  5206. ? (tag.splice(isHost, 1),
  5207. (before = tag.indexOf(before)),
  5208. tag.splice(before, 0, node),
  5209. ReactNativePrivateInterface.UIManager.manageChildren(
  5210. parent._nativeTag,
  5211. [isHost],
  5212. [before],
  5213. [],
  5214. [],
  5215. []
  5216. ))
  5217. : ((before = tag.indexOf(before)),
  5218. tag.splice(before, 0, node),
  5219. ReactNativePrivateInterface.UIManager.manageChildren(
  5220. parent._nativeTag,
  5221. [],
  5222. [],
  5223. ["number" === typeof node ? node : node._nativeTag],
  5224. [before],
  5225. []
  5226. )))
  5227. : ((before = "number" === typeof node ? node : node._nativeTag),
  5228. (tag = parent._children),
  5229. (isHost = tag.indexOf(node)),
  5230. 0 <= isHost
  5231. ? (tag.splice(isHost, 1),
  5232. tag.push(node),
  5233. ReactNativePrivateInterface.UIManager.manageChildren(
  5234. parent._nativeTag,
  5235. [isHost],
  5236. [tag.length - 1],
  5237. [],
  5238. [],
  5239. []
  5240. ))
  5241. : (tag.push(node),
  5242. ReactNativePrivateInterface.UIManager.manageChildren(
  5243. parent._nativeTag,
  5244. [],
  5245. [],
  5246. [before],
  5247. [tag.length - 1],
  5248. []
  5249. )));
  5250. else if (4 !== tag && ((node = node.child), null !== node))
  5251. for (
  5252. insertOrAppendPlacementNode(node, before, parent), node = node.sibling;
  5253. null !== node;
  5254. )
  5255. insertOrAppendPlacementNode(node, before, parent), (node = node.sibling);
  5256. }
  5257. function unmountHostComponents(
  5258. finishedRoot$jscomp$0,
  5259. current,
  5260. renderPriorityLevel$jscomp$0
  5261. ) {
  5262. for (
  5263. var node = current,
  5264. currentParentIsValid = !1,
  5265. currentParent,
  5266. currentParentIsContainer;
  5267. ;
  5268. ) {
  5269. if (!currentParentIsValid) {
  5270. currentParentIsValid = node.return;
  5271. a: for (;;) {
  5272. if (null === currentParentIsValid)
  5273. throw Error(
  5274. "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."
  5275. );
  5276. currentParent = currentParentIsValid.stateNode;
  5277. switch (currentParentIsValid.tag) {
  5278. case 5:
  5279. currentParentIsContainer = !1;
  5280. break a;
  5281. case 3:
  5282. currentParent = currentParent.containerInfo;
  5283. currentParentIsContainer = !0;
  5284. break a;
  5285. case 4:
  5286. currentParent = currentParent.containerInfo;
  5287. currentParentIsContainer = !0;
  5288. break a;
  5289. }
  5290. currentParentIsValid = currentParentIsValid.return;
  5291. }
  5292. currentParentIsValid = !0;
  5293. }
  5294. if (5 === node.tag || 6 === node.tag) {
  5295. a: for (
  5296. var finishedRoot = finishedRoot$jscomp$0,
  5297. root = node,
  5298. renderPriorityLevel = renderPriorityLevel$jscomp$0,
  5299. node$jscomp$0 = root;
  5300. ;
  5301. )
  5302. if (
  5303. (commitUnmount(finishedRoot, node$jscomp$0, renderPriorityLevel),
  5304. null !== node$jscomp$0.child && 4 !== node$jscomp$0.tag)
  5305. )
  5306. (node$jscomp$0.child.return = node$jscomp$0),
  5307. (node$jscomp$0 = node$jscomp$0.child);
  5308. else {
  5309. if (node$jscomp$0 === root) break a;
  5310. for (; null === node$jscomp$0.sibling; ) {
  5311. if (null === node$jscomp$0.return || node$jscomp$0.return === root)
  5312. break a;
  5313. node$jscomp$0 = node$jscomp$0.return;
  5314. }
  5315. node$jscomp$0.sibling.return = node$jscomp$0.return;
  5316. node$jscomp$0 = node$jscomp$0.sibling;
  5317. }
  5318. currentParentIsContainer
  5319. ? ((finishedRoot = currentParent),
  5320. recursivelyUncacheFiberNode(node.stateNode),
  5321. ReactNativePrivateInterface.UIManager.manageChildren(
  5322. finishedRoot,
  5323. [],
  5324. [],
  5325. [],
  5326. [],
  5327. [0]
  5328. ))
  5329. : ((finishedRoot = currentParent),
  5330. (renderPriorityLevel = node.stateNode),
  5331. recursivelyUncacheFiberNode(renderPriorityLevel),
  5332. (root = finishedRoot._children),
  5333. (renderPriorityLevel = root.indexOf(renderPriorityLevel)),
  5334. root.splice(renderPriorityLevel, 1),
  5335. ReactNativePrivateInterface.UIManager.manageChildren(
  5336. finishedRoot._nativeTag,
  5337. [],
  5338. [],
  5339. [],
  5340. [],
  5341. [renderPriorityLevel]
  5342. ));
  5343. } else if (4 === node.tag) {
  5344. if (null !== node.child) {
  5345. currentParent = node.stateNode.containerInfo;
  5346. currentParentIsContainer = !0;
  5347. node.child.return = node;
  5348. node = node.child;
  5349. continue;
  5350. }
  5351. } else if (
  5352. (commitUnmount(finishedRoot$jscomp$0, node, renderPriorityLevel$jscomp$0),
  5353. null !== node.child)
  5354. ) {
  5355. node.child.return = node;
  5356. node = node.child;
  5357. continue;
  5358. }
  5359. if (node === current) break;
  5360. for (; null === node.sibling; ) {
  5361. if (null === node.return || node.return === current) return;
  5362. node = node.return;
  5363. 4 === node.tag && (currentParentIsValid = !1);
  5364. }
  5365. node.sibling.return = node.return;
  5366. node = node.sibling;
  5367. }
  5368. }
  5369. function commitWork(current, finishedWork) {
  5370. switch (finishedWork.tag) {
  5371. case 0:
  5372. case 11:
  5373. case 14:
  5374. case 15:
  5375. case 22:
  5376. commitHookEffectListUnmount(3, finishedWork);
  5377. return;
  5378. case 1:
  5379. return;
  5380. case 5:
  5381. var instance = finishedWork.stateNode;
  5382. if (null != instance) {
  5383. var newProps = finishedWork.memoizedProps;
  5384. current = null !== current ? current.memoizedProps : newProps;
  5385. var updatePayload = finishedWork.updateQueue;
  5386. finishedWork.updateQueue = null;
  5387. null !== updatePayload &&
  5388. ((finishedWork = instance.viewConfig),
  5389. instanceProps.set(instance._nativeTag, newProps),
  5390. (newProps = diffProperties(
  5391. null,
  5392. current,
  5393. newProps,
  5394. finishedWork.validAttributes
  5395. )),
  5396. null != newProps &&
  5397. ReactNativePrivateInterface.UIManager.updateView(
  5398. instance._nativeTag,
  5399. finishedWork.uiViewClassName,
  5400. newProps
  5401. ));
  5402. }
  5403. return;
  5404. case 6:
  5405. if (null === finishedWork.stateNode)
  5406. throw Error(
  5407. "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue."
  5408. );
  5409. ReactNativePrivateInterface.UIManager.updateView(
  5410. finishedWork.stateNode,
  5411. "RCTRawText",
  5412. { text: finishedWork.memoizedProps }
  5413. );
  5414. return;
  5415. case 3:
  5416. return;
  5417. case 12:
  5418. return;
  5419. case 13:
  5420. instance = finishedWork;
  5421. null === finishedWork.memoizedState
  5422. ? (newProps = !1)
  5423. : ((newProps = !0),
  5424. (instance = finishedWork.child),
  5425. (globalMostRecentFallbackTime = now()));
  5426. if (null !== instance)
  5427. a: for (current = instance; ; ) {
  5428. if (5 === current.tag)
  5429. if (((updatePayload = current.stateNode), newProps)) {
  5430. var viewConfig = updatePayload.viewConfig;
  5431. var updatePayload$jscomp$0 = diffProperties(
  5432. null,
  5433. emptyObject,
  5434. { style: { display: "none" } },
  5435. viewConfig.validAttributes
  5436. );
  5437. ReactNativePrivateInterface.UIManager.updateView(
  5438. updatePayload._nativeTag,
  5439. viewConfig.uiViewClassName,
  5440. updatePayload$jscomp$0
  5441. );
  5442. } else {
  5443. updatePayload = current.stateNode;
  5444. updatePayload$jscomp$0 = current.memoizedProps;
  5445. viewConfig = updatePayload.viewConfig;
  5446. var prevProps = Object.assign({}, updatePayload$jscomp$0, {
  5447. style: [updatePayload$jscomp$0.style, { display: "none" }]
  5448. });
  5449. updatePayload$jscomp$0 = diffProperties(
  5450. null,
  5451. prevProps,
  5452. updatePayload$jscomp$0,
  5453. viewConfig.validAttributes
  5454. );
  5455. ReactNativePrivateInterface.UIManager.updateView(
  5456. updatePayload._nativeTag,
  5457. viewConfig.uiViewClassName,
  5458. updatePayload$jscomp$0
  5459. );
  5460. }
  5461. else {
  5462. if (6 === current.tag) throw Error("Not yet implemented.");
  5463. if (
  5464. 13 === current.tag &&
  5465. null !== current.memoizedState &&
  5466. null === current.memoizedState.dehydrated
  5467. ) {
  5468. updatePayload = current.child.sibling;
  5469. updatePayload.return = current;
  5470. current = updatePayload;
  5471. continue;
  5472. } else if (null !== current.child) {
  5473. current.child.return = current;
  5474. current = current.child;
  5475. continue;
  5476. }
  5477. }
  5478. if (current === instance) break;
  5479. for (; null === current.sibling; ) {
  5480. if (null === current.return || current.return === instance) break a;
  5481. current = current.return;
  5482. }
  5483. current.sibling.return = current.return;
  5484. current = current.sibling;
  5485. }
  5486. attachSuspenseRetryListeners(finishedWork);
  5487. return;
  5488. case 19:
  5489. attachSuspenseRetryListeners(finishedWork);
  5490. return;
  5491. case 17:
  5492. return;
  5493. }
  5494. throw Error(
  5495. "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."
  5496. );
  5497. }
  5498. function attachSuspenseRetryListeners(finishedWork) {
  5499. var thenables = finishedWork.updateQueue;
  5500. if (null !== thenables) {
  5501. finishedWork.updateQueue = null;
  5502. var retryCache = finishedWork.stateNode;
  5503. null === retryCache &&
  5504. (retryCache = finishedWork.stateNode = new PossiblyWeakSet());
  5505. thenables.forEach(function(thenable) {
  5506. var retry = resolveRetryThenable.bind(null, finishedWork, thenable);
  5507. retryCache.has(thenable) ||
  5508. (retryCache.add(thenable), thenable.then(retry, retry));
  5509. });
  5510. }
  5511. }
  5512. var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map;
  5513. function createRootErrorUpdate(fiber, errorInfo, expirationTime) {
  5514. expirationTime = createUpdate(expirationTime, null);
  5515. expirationTime.tag = 3;
  5516. expirationTime.payload = { element: null };
  5517. var error = errorInfo.value;
  5518. expirationTime.callback = function() {
  5519. hasUncaughtError || ((hasUncaughtError = !0), (firstUncaughtError = error));
  5520. logError(fiber, errorInfo);
  5521. };
  5522. return expirationTime;
  5523. }
  5524. function createClassErrorUpdate(fiber, errorInfo, expirationTime) {
  5525. expirationTime = createUpdate(expirationTime, null);
  5526. expirationTime.tag = 3;
  5527. var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
  5528. if ("function" === typeof getDerivedStateFromError) {
  5529. var error = errorInfo.value;
  5530. expirationTime.payload = function() {
  5531. logError(fiber, errorInfo);
  5532. return getDerivedStateFromError(error);
  5533. };
  5534. }
  5535. var inst = fiber.stateNode;
  5536. null !== inst &&
  5537. "function" === typeof inst.componentDidCatch &&
  5538. (expirationTime.callback = function() {
  5539. "function" !== typeof getDerivedStateFromError &&
  5540. (null === legacyErrorBoundariesThatAlreadyFailed
  5541. ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this]))
  5542. : legacyErrorBoundariesThatAlreadyFailed.add(this),
  5543. logError(fiber, errorInfo));
  5544. var stack = errorInfo.stack;
  5545. this.componentDidCatch(errorInfo.value, {
  5546. componentStack: null !== stack ? stack : ""
  5547. });
  5548. });
  5549. return expirationTime;
  5550. }
  5551. var ceil = Math.ceil,
  5552. ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
  5553. ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,
  5554. NoContext = 0,
  5555. LegacyUnbatchedContext = 8,
  5556. RenderContext = 16,
  5557. CommitContext = 32,
  5558. RootIncomplete = 0,
  5559. RootFatalErrored = 1,
  5560. RootErrored = 2,
  5561. RootSuspended = 3,
  5562. RootSuspendedWithDelay = 4,
  5563. RootCompleted = 5,
  5564. executionContext = NoContext,
  5565. workInProgressRoot = null,
  5566. workInProgress = null,
  5567. renderExpirationTime$1 = 0,
  5568. workInProgressRootExitStatus = RootIncomplete,
  5569. workInProgressRootFatalError = null,
  5570. workInProgressRootLatestProcessedExpirationTime = 1073741823,
  5571. workInProgressRootLatestSuspenseTimeout = 1073741823,
  5572. workInProgressRootCanSuspendUsingConfig = null,
  5573. workInProgressRootNextUnprocessedUpdateTime = 0,
  5574. workInProgressRootHasPendingPing = !1,
  5575. globalMostRecentFallbackTime = 0,
  5576. FALLBACK_THROTTLE_MS = 500,
  5577. nextEffect = null,
  5578. hasUncaughtError = !1,
  5579. firstUncaughtError = null,
  5580. legacyErrorBoundariesThatAlreadyFailed = null,
  5581. rootDoesHavePassiveEffects = !1,
  5582. rootWithPendingPassiveEffects = null,
  5583. pendingPassiveEffectsRenderPriority = 90,
  5584. rootsWithPendingDiscreteUpdates = null,
  5585. nestedUpdateCount = 0,
  5586. rootWithNestedUpdates = null,
  5587. currentEventTime = 0;
  5588. function requestCurrentTimeForUpdate() {
  5589. return (executionContext & (RenderContext | CommitContext)) !== NoContext
  5590. ? 1073741821 - ((now() / 10) | 0)
  5591. : 0 !== currentEventTime
  5592. ? currentEventTime
  5593. : (currentEventTime = 1073741821 - ((now() / 10) | 0));
  5594. }
  5595. function computeExpirationForFiber(currentTime, fiber, suspenseConfig) {
  5596. fiber = fiber.mode;
  5597. if (0 === (fiber & 2)) return 1073741823;
  5598. var priorityLevel = getCurrentPriorityLevel();
  5599. if (0 === (fiber & 4)) return 99 === priorityLevel ? 1073741823 : 1073741822;
  5600. if ((executionContext & RenderContext) !== NoContext)
  5601. return renderExpirationTime$1;
  5602. if (null !== suspenseConfig)
  5603. currentTime =
  5604. 1073741821 -
  5605. 25 *
  5606. ((((1073741821 -
  5607. currentTime +
  5608. (suspenseConfig.timeoutMs | 0 || 5e3) / 10) /
  5609. 25) |
  5610. 0) +
  5611. 1);
  5612. else
  5613. switch (priorityLevel) {
  5614. case 99:
  5615. currentTime = 1073741823;
  5616. break;
  5617. case 98:
  5618. currentTime =
  5619. 1073741821 - 10 * ((((1073741821 - currentTime + 15) / 10) | 0) + 1);
  5620. break;
  5621. case 97:
  5622. case 96:
  5623. currentTime =
  5624. 1073741821 - 25 * ((((1073741821 - currentTime + 500) / 25) | 0) + 1);
  5625. break;
  5626. case 95:
  5627. currentTime = 2;
  5628. break;
  5629. default:
  5630. throw Error("Expected a valid priority level");
  5631. }
  5632. null !== workInProgressRoot &&
  5633. currentTime === renderExpirationTime$1 &&
  5634. --currentTime;
  5635. return currentTime;
  5636. }
  5637. function scheduleWork(fiber, expirationTime) {
  5638. if (50 < nestedUpdateCount)
  5639. throw ((nestedUpdateCount = 0),
  5640. (rootWithNestedUpdates = null),
  5641. Error(
  5642. "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops."
  5643. ));
  5644. fiber = markUpdateTimeFromFiberToRoot(fiber, expirationTime);
  5645. if (null !== fiber) {
  5646. var priorityLevel = getCurrentPriorityLevel();
  5647. 1073741823 === expirationTime
  5648. ? (executionContext & LegacyUnbatchedContext) !== NoContext &&
  5649. (executionContext & (RenderContext | CommitContext)) === NoContext
  5650. ? performSyncWorkOnRoot(fiber)
  5651. : (ensureRootIsScheduled(fiber),
  5652. executionContext === NoContext && flushSyncCallbackQueue())
  5653. : ensureRootIsScheduled(fiber);
  5654. (executionContext & 4) === NoContext ||
  5655. (98 !== priorityLevel && 99 !== priorityLevel) ||
  5656. (null === rootsWithPendingDiscreteUpdates
  5657. ? (rootsWithPendingDiscreteUpdates = new Map([[fiber, expirationTime]]))
  5658. : ((priorityLevel = rootsWithPendingDiscreteUpdates.get(fiber)),
  5659. (void 0 === priorityLevel || priorityLevel > expirationTime) &&
  5660. rootsWithPendingDiscreteUpdates.set(fiber, expirationTime)));
  5661. }
  5662. }
  5663. function markUpdateTimeFromFiberToRoot(fiber, expirationTime) {
  5664. fiber.expirationTime < expirationTime &&
  5665. (fiber.expirationTime = expirationTime);
  5666. var alternate = fiber.alternate;
  5667. null !== alternate &&
  5668. alternate.expirationTime < expirationTime &&
  5669. (alternate.expirationTime = expirationTime);
  5670. var node = fiber.return,
  5671. root = null;
  5672. if (null === node && 3 === fiber.tag) root = fiber.stateNode;
  5673. else
  5674. for (; null !== node; ) {
  5675. alternate = node.alternate;
  5676. node.childExpirationTime < expirationTime &&
  5677. (node.childExpirationTime = expirationTime);
  5678. null !== alternate &&
  5679. alternate.childExpirationTime < expirationTime &&
  5680. (alternate.childExpirationTime = expirationTime);
  5681. if (null === node.return && 3 === node.tag) {
  5682. root = node.stateNode;
  5683. break;
  5684. }
  5685. node = node.return;
  5686. }
  5687. null !== root &&
  5688. (workInProgressRoot === root &&
  5689. (markUnprocessedUpdateTime(expirationTime),
  5690. workInProgressRootExitStatus === RootSuspendedWithDelay &&
  5691. markRootSuspendedAtTime(root, renderExpirationTime$1)),
  5692. markRootUpdatedAtTime(root, expirationTime));
  5693. return root;
  5694. }
  5695. function getNextRootExpirationTimeToWorkOn(root) {
  5696. var lastExpiredTime = root.lastExpiredTime;
  5697. if (0 !== lastExpiredTime) return lastExpiredTime;
  5698. lastExpiredTime = root.firstPendingTime;
  5699. if (!isRootSuspendedAtTime(root, lastExpiredTime)) return lastExpiredTime;
  5700. var lastPingedTime = root.lastPingedTime;
  5701. root = root.nextKnownPendingLevel;
  5702. root = lastPingedTime > root ? lastPingedTime : root;
  5703. return 2 >= root && lastExpiredTime !== root ? 0 : root;
  5704. }
  5705. function ensureRootIsScheduled(root) {
  5706. if (0 !== root.lastExpiredTime)
  5707. (root.callbackExpirationTime = 1073741823),
  5708. (root.callbackPriority = 99),
  5709. (root.callbackNode = scheduleSyncCallback(
  5710. performSyncWorkOnRoot.bind(null, root)
  5711. ));
  5712. else {
  5713. var expirationTime = getNextRootExpirationTimeToWorkOn(root),
  5714. existingCallbackNode = root.callbackNode;
  5715. if (0 === expirationTime)
  5716. null !== existingCallbackNode &&
  5717. ((root.callbackNode = null),
  5718. (root.callbackExpirationTime = 0),
  5719. (root.callbackPriority = 90));
  5720. else {
  5721. var priorityLevel = requestCurrentTimeForUpdate();
  5722. 1073741823 === expirationTime
  5723. ? (priorityLevel = 99)
  5724. : 1 === expirationTime || 2 === expirationTime
  5725. ? (priorityLevel = 95)
  5726. : ((priorityLevel =
  5727. 10 * (1073741821 - expirationTime) -
  5728. 10 * (1073741821 - priorityLevel)),
  5729. (priorityLevel =
  5730. 0 >= priorityLevel
  5731. ? 99
  5732. : 250 >= priorityLevel
  5733. ? 98
  5734. : 5250 >= priorityLevel
  5735. ? 97
  5736. : 95));
  5737. if (null !== existingCallbackNode) {
  5738. var existingCallbackPriority = root.callbackPriority;
  5739. if (
  5740. root.callbackExpirationTime === expirationTime &&
  5741. existingCallbackPriority >= priorityLevel
  5742. )
  5743. return;
  5744. existingCallbackNode !== fakeCallbackNode &&
  5745. Scheduler_cancelCallback(existingCallbackNode);
  5746. }
  5747. root.callbackExpirationTime = expirationTime;
  5748. root.callbackPriority = priorityLevel;
  5749. expirationTime =
  5750. 1073741823 === expirationTime
  5751. ? scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root))
  5752. : scheduleCallback(
  5753. priorityLevel,
  5754. performConcurrentWorkOnRoot.bind(null, root),
  5755. { timeout: 10 * (1073741821 - expirationTime) - now() }
  5756. );
  5757. root.callbackNode = expirationTime;
  5758. }
  5759. }
  5760. }
  5761. function performConcurrentWorkOnRoot(root, didTimeout) {
  5762. currentEventTime = 0;
  5763. if (didTimeout) {
  5764. didTimeout = requestCurrentTimeForUpdate();
  5765. var lastExpiredTime = root.lastExpiredTime;
  5766. if (0 === lastExpiredTime || lastExpiredTime > didTimeout)
  5767. root.lastExpiredTime = didTimeout;
  5768. ensureRootIsScheduled(root);
  5769. return null;
  5770. }
  5771. lastExpiredTime = getNextRootExpirationTimeToWorkOn(root);
  5772. if (0 === lastExpiredTime) return null;
  5773. didTimeout = root.callbackNode;
  5774. if ((executionContext & (RenderContext | CommitContext)) !== NoContext)
  5775. throw Error("Should not already be working.");
  5776. flushPassiveEffects();
  5777. var expirationTime = lastExpiredTime;
  5778. var exitStatus = executionContext;
  5779. executionContext |= RenderContext;
  5780. var prevDispatcher = pushDispatcher();
  5781. (root === workInProgressRoot && expirationTime === renderExpirationTime$1) ||
  5782. prepareFreshStack(root, expirationTime);
  5783. do
  5784. try {
  5785. workLoopConcurrent();
  5786. break;
  5787. } catch (thrownValue) {
  5788. handleError(root, thrownValue);
  5789. }
  5790. while (1);
  5791. resetContextDependencies();
  5792. ReactCurrentDispatcher$1.current = prevDispatcher;
  5793. executionContext = exitStatus;
  5794. null !== workInProgress
  5795. ? (exitStatus = RootIncomplete)
  5796. : ((workInProgressRoot = null),
  5797. (exitStatus = workInProgressRootExitStatus));
  5798. if (exitStatus !== RootIncomplete) {
  5799. exitStatus === RootErrored &&
  5800. ((lastExpiredTime = 2 < lastExpiredTime ? 2 : lastExpiredTime),
  5801. (exitStatus = renderRootSync(root, lastExpiredTime)));
  5802. if (exitStatus === RootFatalErrored)
  5803. throw ((didTimeout = workInProgressRootFatalError),
  5804. prepareFreshStack(root, lastExpiredTime),
  5805. markRootSuspendedAtTime(root, lastExpiredTime),
  5806. ensureRootIsScheduled(root),
  5807. didTimeout);
  5808. expirationTime = root.finishedWork = root.current.alternate;
  5809. root.finishedExpirationTime = lastExpiredTime;
  5810. switch (exitStatus) {
  5811. case RootIncomplete:
  5812. case RootFatalErrored:
  5813. throw Error("Root did not complete. This is a bug in React.");
  5814. case RootErrored:
  5815. commitRoot(root);
  5816. break;
  5817. case RootSuspended:
  5818. markRootSuspendedAtTime(root, lastExpiredTime);
  5819. exitStatus = root.lastSuspendedTime;
  5820. lastExpiredTime === exitStatus &&
  5821. (root.nextKnownPendingLevel = getRemainingExpirationTime(
  5822. expirationTime
  5823. ));
  5824. if (
  5825. 1073741823 === workInProgressRootLatestProcessedExpirationTime &&
  5826. ((expirationTime =
  5827. globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now()),
  5828. 10 < expirationTime)
  5829. ) {
  5830. if (
  5831. workInProgressRootHasPendingPing &&
  5832. ((prevDispatcher = root.lastPingedTime),
  5833. 0 === prevDispatcher || prevDispatcher >= lastExpiredTime)
  5834. ) {
  5835. root.lastPingedTime = lastExpiredTime;
  5836. prepareFreshStack(root, lastExpiredTime);
  5837. break;
  5838. }
  5839. prevDispatcher = getNextRootExpirationTimeToWorkOn(root);
  5840. if (0 !== prevDispatcher && prevDispatcher !== lastExpiredTime) break;
  5841. if (0 !== exitStatus && exitStatus !== lastExpiredTime) {
  5842. root.lastPingedTime = exitStatus;
  5843. break;
  5844. }
  5845. root.timeoutHandle = scheduleTimeout(
  5846. commitRoot.bind(null, root),
  5847. expirationTime
  5848. );
  5849. break;
  5850. }
  5851. commitRoot(root);
  5852. break;
  5853. case RootSuspendedWithDelay:
  5854. markRootSuspendedAtTime(root, lastExpiredTime);
  5855. exitStatus = root.lastSuspendedTime;
  5856. lastExpiredTime === exitStatus &&
  5857. (root.nextKnownPendingLevel = getRemainingExpirationTime(
  5858. expirationTime
  5859. ));
  5860. if (
  5861. workInProgressRootHasPendingPing &&
  5862. ((expirationTime = root.lastPingedTime),
  5863. 0 === expirationTime || expirationTime >= lastExpiredTime)
  5864. ) {
  5865. root.lastPingedTime = lastExpiredTime;
  5866. prepareFreshStack(root, lastExpiredTime);
  5867. break;
  5868. }
  5869. expirationTime = getNextRootExpirationTimeToWorkOn(root);
  5870. if (0 !== expirationTime && expirationTime !== lastExpiredTime) break;
  5871. if (0 !== exitStatus && exitStatus !== lastExpiredTime) {
  5872. root.lastPingedTime = exitStatus;
  5873. break;
  5874. }
  5875. 1073741823 !== workInProgressRootLatestSuspenseTimeout
  5876. ? (expirationTime =
  5877. 10 * (1073741821 - workInProgressRootLatestSuspenseTimeout) -
  5878. now())
  5879. : 1073741823 === workInProgressRootLatestProcessedExpirationTime
  5880. ? (expirationTime = 0)
  5881. : ((expirationTime =
  5882. 10 *
  5883. (1073741821 - workInProgressRootLatestProcessedExpirationTime) -
  5884. 5e3),
  5885. (exitStatus = now()),
  5886. (lastExpiredTime =
  5887. 10 * (1073741821 - lastExpiredTime) - exitStatus),
  5888. (expirationTime = exitStatus - expirationTime),
  5889. 0 > expirationTime && (expirationTime = 0),
  5890. (expirationTime =
  5891. (120 > expirationTime
  5892. ? 120
  5893. : 480 > expirationTime
  5894. ? 480
  5895. : 1080 > expirationTime
  5896. ? 1080
  5897. : 1920 > expirationTime
  5898. ? 1920
  5899. : 3e3 > expirationTime
  5900. ? 3e3
  5901. : 4320 > expirationTime
  5902. ? 4320
  5903. : 1960 * ceil(expirationTime / 1960)) - expirationTime),
  5904. lastExpiredTime < expirationTime &&
  5905. (expirationTime = lastExpiredTime));
  5906. if (10 < expirationTime) {
  5907. root.timeoutHandle = scheduleTimeout(
  5908. commitRoot.bind(null, root),
  5909. expirationTime
  5910. );
  5911. break;
  5912. }
  5913. commitRoot(root);
  5914. break;
  5915. case RootCompleted:
  5916. if (
  5917. 1073741823 !== workInProgressRootLatestProcessedExpirationTime &&
  5918. null !== workInProgressRootCanSuspendUsingConfig
  5919. ) {
  5920. prevDispatcher = workInProgressRootLatestProcessedExpirationTime;
  5921. var suspenseConfig = workInProgressRootCanSuspendUsingConfig;
  5922. expirationTime = suspenseConfig.busyMinDurationMs | 0;
  5923. 0 >= expirationTime
  5924. ? (expirationTime = 0)
  5925. : ((exitStatus = suspenseConfig.busyDelayMs | 0),
  5926. (prevDispatcher =
  5927. now() -
  5928. (10 * (1073741821 - prevDispatcher) -
  5929. (suspenseConfig.timeoutMs | 0 || 5e3))),
  5930. (expirationTime =
  5931. prevDispatcher <= exitStatus
  5932. ? 0
  5933. : exitStatus + expirationTime - prevDispatcher));
  5934. if (10 < expirationTime) {
  5935. markRootSuspendedAtTime(root, lastExpiredTime);
  5936. root.timeoutHandle = scheduleTimeout(
  5937. commitRoot.bind(null, root),
  5938. expirationTime
  5939. );
  5940. break;
  5941. }
  5942. }
  5943. commitRoot(root);
  5944. break;
  5945. default:
  5946. throw Error("Unknown root exit status.");
  5947. }
  5948. }
  5949. ensureRootIsScheduled(root);
  5950. return root.callbackNode === didTimeout
  5951. ? performConcurrentWorkOnRoot.bind(null, root)
  5952. : null;
  5953. }
  5954. function performSyncWorkOnRoot(root) {
  5955. if ((executionContext & (RenderContext | CommitContext)) !== NoContext)
  5956. throw Error("Should not already be working.");
  5957. flushPassiveEffects();
  5958. var lastExpiredTime = root.lastExpiredTime;
  5959. lastExpiredTime =
  5960. 0 !== lastExpiredTime
  5961. ? root === workInProgressRoot && renderExpirationTime$1 >= lastExpiredTime
  5962. ? renderExpirationTime$1
  5963. : lastExpiredTime
  5964. : 1073741823;
  5965. var exitStatus = renderRootSync(root, lastExpiredTime);
  5966. 0 !== root.tag &&
  5967. exitStatus === RootErrored &&
  5968. ((lastExpiredTime = 2 < lastExpiredTime ? 2 : lastExpiredTime),
  5969. (exitStatus = renderRootSync(root, lastExpiredTime)));
  5970. if (exitStatus === RootFatalErrored)
  5971. throw ((exitStatus = workInProgressRootFatalError),
  5972. prepareFreshStack(root, lastExpiredTime),
  5973. markRootSuspendedAtTime(root, lastExpiredTime),
  5974. ensureRootIsScheduled(root),
  5975. exitStatus);
  5976. root.finishedWork = root.current.alternate;
  5977. root.finishedExpirationTime = lastExpiredTime;
  5978. commitRoot(root);
  5979. ensureRootIsScheduled(root);
  5980. return null;
  5981. }
  5982. function prepareFreshStack(root, expirationTime) {
  5983. root.finishedWork = null;
  5984. root.finishedExpirationTime = 0;
  5985. var timeoutHandle = root.timeoutHandle;
  5986. -1 !== timeoutHandle &&
  5987. ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle));
  5988. if (null !== workInProgress)
  5989. for (timeoutHandle = workInProgress.return; null !== timeoutHandle; ) {
  5990. var interruptedWork = timeoutHandle;
  5991. switch (interruptedWork.tag) {
  5992. case 1:
  5993. interruptedWork = interruptedWork.type.childContextTypes;
  5994. null !== interruptedWork &&
  5995. void 0 !== interruptedWork &&
  5996. popContext();
  5997. break;
  5998. case 3:
  5999. popHostContainer();
  6000. pop(didPerformWorkStackCursor);
  6001. pop(contextStackCursor);
  6002. break;
  6003. case 5:
  6004. popHostContext(interruptedWork);
  6005. break;
  6006. case 4:
  6007. popHostContainer();
  6008. break;
  6009. case 13:
  6010. pop(suspenseStackCursor);
  6011. break;
  6012. case 19:
  6013. pop(suspenseStackCursor);
  6014. break;
  6015. case 10:
  6016. popProvider(interruptedWork);
  6017. }
  6018. timeoutHandle = timeoutHandle.return;
  6019. }
  6020. workInProgressRoot = root;
  6021. workInProgress = createWorkInProgress(root.current, null);
  6022. renderExpirationTime$1 = expirationTime;
  6023. workInProgressRootExitStatus = RootIncomplete;
  6024. workInProgressRootFatalError = null;
  6025. workInProgressRootLatestSuspenseTimeout = workInProgressRootLatestProcessedExpirationTime = 1073741823;
  6026. workInProgressRootCanSuspendUsingConfig = null;
  6027. workInProgressRootNextUnprocessedUpdateTime = 0;
  6028. workInProgressRootHasPendingPing = !1;
  6029. }
  6030. function handleError(root$jscomp$0, thrownValue) {
  6031. do {
  6032. try {
  6033. resetContextDependencies();
  6034. ReactCurrentDispatcher.current = ContextOnlyDispatcher;
  6035. if (didScheduleRenderPhaseUpdate)
  6036. for (
  6037. var hook = currentlyRenderingFiber$1.memoizedState;
  6038. null !== hook;
  6039. ) {
  6040. var queue = hook.queue;
  6041. null !== queue && (queue.pending = null);
  6042. hook = hook.next;
  6043. }
  6044. renderExpirationTime = 0;
  6045. workInProgressHook = currentHook = currentlyRenderingFiber$1 = null;
  6046. didScheduleRenderPhaseUpdate = !1;
  6047. if (null === workInProgress || null === workInProgress.return)
  6048. return (
  6049. (workInProgressRootExitStatus = RootFatalErrored),
  6050. (workInProgressRootFatalError = thrownValue),
  6051. (workInProgress = null)
  6052. );
  6053. a: {
  6054. var root = root$jscomp$0,
  6055. returnFiber = workInProgress.return,
  6056. sourceFiber = workInProgress,
  6057. value = thrownValue;
  6058. thrownValue = renderExpirationTime$1;
  6059. sourceFiber.effectTag |= 2048;
  6060. sourceFiber.firstEffect = sourceFiber.lastEffect = null;
  6061. if (
  6062. null !== value &&
  6063. "object" === typeof value &&
  6064. "function" === typeof value.then
  6065. ) {
  6066. var thenable = value;
  6067. if (0 === (sourceFiber.mode & 2)) {
  6068. var currentSource = sourceFiber.alternate;
  6069. currentSource
  6070. ? ((sourceFiber.updateQueue = currentSource.updateQueue),
  6071. (sourceFiber.memoizedState = currentSource.memoizedState),
  6072. (sourceFiber.expirationTime = currentSource.expirationTime))
  6073. : ((sourceFiber.updateQueue = null),
  6074. (sourceFiber.memoizedState = null));
  6075. }
  6076. var hasInvisibleParentBoundary =
  6077. 0 !== (suspenseStackCursor.current & 1),
  6078. _workInProgress = returnFiber;
  6079. do {
  6080. var JSCompiler_temp;
  6081. if ((JSCompiler_temp = 13 === _workInProgress.tag)) {
  6082. var nextState = _workInProgress.memoizedState;
  6083. if (null !== nextState)
  6084. JSCompiler_temp = null !== nextState.dehydrated ? !0 : !1;
  6085. else {
  6086. var props = _workInProgress.memoizedProps;
  6087. JSCompiler_temp =
  6088. void 0 === props.fallback
  6089. ? !1
  6090. : !0 !== props.unstable_avoidThisFallback
  6091. ? !0
  6092. : hasInvisibleParentBoundary
  6093. ? !1
  6094. : !0;
  6095. }
  6096. }
  6097. if (JSCompiler_temp) {
  6098. var thenables = _workInProgress.updateQueue;
  6099. if (null === thenables) {
  6100. var updateQueue = new Set();
  6101. updateQueue.add(thenable);
  6102. _workInProgress.updateQueue = updateQueue;
  6103. } else thenables.add(thenable);
  6104. if (0 === (_workInProgress.mode & 2)) {
  6105. _workInProgress.effectTag |= 64;
  6106. sourceFiber.effectTag &= -2981;
  6107. if (1 === sourceFiber.tag)
  6108. if (null === sourceFiber.alternate) sourceFiber.tag = 17;
  6109. else {
  6110. var update = createUpdate(1073741823, null);
  6111. update.tag = 2;
  6112. enqueueUpdate(sourceFiber, update);
  6113. }
  6114. sourceFiber.expirationTime = 1073741823;
  6115. break a;
  6116. }
  6117. value = void 0;
  6118. sourceFiber = thrownValue;
  6119. var pingCache = root.pingCache;
  6120. null === pingCache
  6121. ? ((pingCache = root.pingCache = new PossiblyWeakMap()),
  6122. (value = new Set()),
  6123. pingCache.set(thenable, value))
  6124. : ((value = pingCache.get(thenable)),
  6125. void 0 === value &&
  6126. ((value = new Set()), pingCache.set(thenable, value)));
  6127. if (!value.has(sourceFiber)) {
  6128. value.add(sourceFiber);
  6129. var ping = pingSuspendedRoot.bind(
  6130. null,
  6131. root,
  6132. thenable,
  6133. sourceFiber
  6134. );
  6135. thenable.then(ping, ping);
  6136. }
  6137. _workInProgress.effectTag |= 4096;
  6138. _workInProgress.expirationTime = thrownValue;
  6139. break a;
  6140. }
  6141. _workInProgress = _workInProgress.return;
  6142. } while (null !== _workInProgress);
  6143. value = Error(
  6144. (getComponentName(sourceFiber.type) || "A React component") +
  6145. " suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display." +
  6146. getStackByFiberInDevAndProd(sourceFiber)
  6147. );
  6148. }
  6149. workInProgressRootExitStatus !== RootCompleted &&
  6150. (workInProgressRootExitStatus = RootErrored);
  6151. value = createCapturedValue(value, sourceFiber);
  6152. _workInProgress = returnFiber;
  6153. do {
  6154. switch (_workInProgress.tag) {
  6155. case 3:
  6156. thenable = value;
  6157. _workInProgress.effectTag |= 4096;
  6158. _workInProgress.expirationTime = thrownValue;
  6159. var _update = createRootErrorUpdate(
  6160. _workInProgress,
  6161. thenable,
  6162. thrownValue
  6163. );
  6164. enqueueCapturedUpdate(_workInProgress, _update);
  6165. break a;
  6166. case 1:
  6167. thenable = value;
  6168. var ctor = _workInProgress.type,
  6169. instance = _workInProgress.stateNode;
  6170. if (
  6171. 0 === (_workInProgress.effectTag & 64) &&
  6172. ("function" === typeof ctor.getDerivedStateFromError ||
  6173. (null !== instance &&
  6174. "function" === typeof instance.componentDidCatch &&
  6175. (null === legacyErrorBoundariesThatAlreadyFailed ||
  6176. !legacyErrorBoundariesThatAlreadyFailed.has(instance))))
  6177. ) {
  6178. _workInProgress.effectTag |= 4096;
  6179. _workInProgress.expirationTime = thrownValue;
  6180. var _update2 = createClassErrorUpdate(
  6181. _workInProgress,
  6182. thenable,
  6183. thrownValue
  6184. );
  6185. enqueueCapturedUpdate(_workInProgress, _update2);
  6186. break a;
  6187. }
  6188. }
  6189. _workInProgress = _workInProgress.return;
  6190. } while (null !== _workInProgress);
  6191. }
  6192. workInProgress = completeUnitOfWork(workInProgress);
  6193. } catch (yetAnotherThrownValue) {
  6194. thrownValue = yetAnotherThrownValue;
  6195. continue;
  6196. }
  6197. break;
  6198. } while (1);
  6199. }
  6200. function pushDispatcher() {
  6201. var prevDispatcher = ReactCurrentDispatcher$1.current;
  6202. ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
  6203. return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher;
  6204. }
  6205. function markRenderEventTimeAndConfig(expirationTime, suspenseConfig) {
  6206. expirationTime < workInProgressRootLatestProcessedExpirationTime &&
  6207. 2 < expirationTime &&
  6208. (workInProgressRootLatestProcessedExpirationTime = expirationTime);
  6209. null !== suspenseConfig &&
  6210. expirationTime < workInProgressRootLatestSuspenseTimeout &&
  6211. 2 < expirationTime &&
  6212. ((workInProgressRootLatestSuspenseTimeout = expirationTime),
  6213. (workInProgressRootCanSuspendUsingConfig = suspenseConfig));
  6214. }
  6215. function markUnprocessedUpdateTime(expirationTime) {
  6216. expirationTime > workInProgressRootNextUnprocessedUpdateTime &&
  6217. (workInProgressRootNextUnprocessedUpdateTime = expirationTime);
  6218. }
  6219. function renderRootSync(root, expirationTime) {
  6220. var prevExecutionContext = executionContext;
  6221. executionContext |= RenderContext;
  6222. var prevDispatcher = pushDispatcher();
  6223. (root === workInProgressRoot && expirationTime === renderExpirationTime$1) ||
  6224. prepareFreshStack(root, expirationTime);
  6225. do
  6226. try {
  6227. workLoopSync();
  6228. break;
  6229. } catch (thrownValue) {
  6230. handleError(root, thrownValue);
  6231. }
  6232. while (1);
  6233. resetContextDependencies();
  6234. executionContext = prevExecutionContext;
  6235. ReactCurrentDispatcher$1.current = prevDispatcher;
  6236. if (null !== workInProgress)
  6237. throw Error(
  6238. "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue."
  6239. );
  6240. workInProgressRoot = null;
  6241. return workInProgressRootExitStatus;
  6242. }
  6243. function workLoopSync() {
  6244. for (; null !== workInProgress; )
  6245. workInProgress = performUnitOfWork(workInProgress);
  6246. }
  6247. function workLoopConcurrent() {
  6248. for (; null !== workInProgress && !shouldYield(); )
  6249. workInProgress = performUnitOfWork(workInProgress);
  6250. }
  6251. function performUnitOfWork(unitOfWork) {
  6252. var next = beginWork$1(
  6253. unitOfWork.alternate,
  6254. unitOfWork,
  6255. renderExpirationTime$1
  6256. );
  6257. unitOfWork.memoizedProps = unitOfWork.pendingProps;
  6258. null === next && (next = completeUnitOfWork(unitOfWork));
  6259. ReactCurrentOwner$2.current = null;
  6260. return next;
  6261. }
  6262. function completeUnitOfWork(unitOfWork) {
  6263. workInProgress = unitOfWork;
  6264. do {
  6265. var current = workInProgress.alternate;
  6266. unitOfWork = workInProgress.return;
  6267. if (0 === (workInProgress.effectTag & 2048)) {
  6268. current = completeWork(current, workInProgress, renderExpirationTime$1);
  6269. if (
  6270. 1 === renderExpirationTime$1 ||
  6271. 1 !== workInProgress.childExpirationTime
  6272. ) {
  6273. for (
  6274. var newChildExpirationTime = 0, _child = workInProgress.child;
  6275. null !== _child;
  6276. ) {
  6277. var _childUpdateExpirationTime = _child.expirationTime,
  6278. _childChildExpirationTime = _child.childExpirationTime;
  6279. _childUpdateExpirationTime > newChildExpirationTime &&
  6280. (newChildExpirationTime = _childUpdateExpirationTime);
  6281. _childChildExpirationTime > newChildExpirationTime &&
  6282. (newChildExpirationTime = _childChildExpirationTime);
  6283. _child = _child.sibling;
  6284. }
  6285. workInProgress.childExpirationTime = newChildExpirationTime;
  6286. }
  6287. if (null !== current) return current;
  6288. null !== unitOfWork &&
  6289. 0 === (unitOfWork.effectTag & 2048) &&
  6290. (null === unitOfWork.firstEffect &&
  6291. (unitOfWork.firstEffect = workInProgress.firstEffect),
  6292. null !== workInProgress.lastEffect &&
  6293. (null !== unitOfWork.lastEffect &&
  6294. (unitOfWork.lastEffect.nextEffect = workInProgress.firstEffect),
  6295. (unitOfWork.lastEffect = workInProgress.lastEffect)),
  6296. 1 < workInProgress.effectTag &&
  6297. (null !== unitOfWork.lastEffect
  6298. ? (unitOfWork.lastEffect.nextEffect = workInProgress)
  6299. : (unitOfWork.firstEffect = workInProgress),
  6300. (unitOfWork.lastEffect = workInProgress)));
  6301. } else {
  6302. current = unwindWork(workInProgress);
  6303. if (null !== current) return (current.effectTag &= 2047), current;
  6304. null !== unitOfWork &&
  6305. ((unitOfWork.firstEffect = unitOfWork.lastEffect = null),
  6306. (unitOfWork.effectTag |= 2048));
  6307. }
  6308. current = workInProgress.sibling;
  6309. if (null !== current) return current;
  6310. workInProgress = unitOfWork;
  6311. } while (null !== workInProgress);
  6312. workInProgressRootExitStatus === RootIncomplete &&
  6313. (workInProgressRootExitStatus = RootCompleted);
  6314. return null;
  6315. }
  6316. function getRemainingExpirationTime(fiber) {
  6317. var updateExpirationTime = fiber.expirationTime;
  6318. fiber = fiber.childExpirationTime;
  6319. return updateExpirationTime > fiber ? updateExpirationTime : fiber;
  6320. }
  6321. function commitRoot(root) {
  6322. var renderPriorityLevel = getCurrentPriorityLevel();
  6323. runWithPriority(99, commitRootImpl.bind(null, root, renderPriorityLevel));
  6324. return null;
  6325. }
  6326. function commitRootImpl(root$jscomp$0, renderPriorityLevel$jscomp$0) {
  6327. do flushPassiveEffects();
  6328. while (null !== rootWithPendingPassiveEffects);
  6329. if ((executionContext & (RenderContext | CommitContext)) !== NoContext)
  6330. throw Error("Should not already be working.");
  6331. var finishedWork = root$jscomp$0.finishedWork,
  6332. expirationTime = root$jscomp$0.finishedExpirationTime;
  6333. if (null === finishedWork) return null;
  6334. root$jscomp$0.finishedWork = null;
  6335. root$jscomp$0.finishedExpirationTime = 0;
  6336. if (finishedWork === root$jscomp$0.current)
  6337. throw Error(
  6338. "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue."
  6339. );
  6340. root$jscomp$0.callbackNode = null;
  6341. root$jscomp$0.callbackExpirationTime = 0;
  6342. root$jscomp$0.callbackPriority = 90;
  6343. root$jscomp$0.nextKnownPendingLevel = 0;
  6344. var remainingExpirationTimeBeforeCommit = getRemainingExpirationTime(
  6345. finishedWork
  6346. );
  6347. root$jscomp$0.firstPendingTime = remainingExpirationTimeBeforeCommit;
  6348. expirationTime <= root$jscomp$0.lastSuspendedTime
  6349. ? (root$jscomp$0.firstSuspendedTime = root$jscomp$0.lastSuspendedTime = root$jscomp$0.nextKnownPendingLevel = 0)
  6350. : expirationTime <= root$jscomp$0.firstSuspendedTime &&
  6351. (root$jscomp$0.firstSuspendedTime = expirationTime - 1);
  6352. expirationTime <= root$jscomp$0.lastPingedTime &&
  6353. (root$jscomp$0.lastPingedTime = 0);
  6354. expirationTime <= root$jscomp$0.lastExpiredTime &&
  6355. (root$jscomp$0.lastExpiredTime = 0);
  6356. root$jscomp$0 === workInProgressRoot &&
  6357. ((workInProgress = workInProgressRoot = null),
  6358. (renderExpirationTime$1 = 0));
  6359. 1 < finishedWork.effectTag
  6360. ? null !== finishedWork.lastEffect
  6361. ? ((finishedWork.lastEffect.nextEffect = finishedWork),
  6362. (remainingExpirationTimeBeforeCommit = finishedWork.firstEffect))
  6363. : (remainingExpirationTimeBeforeCommit = finishedWork)
  6364. : (remainingExpirationTimeBeforeCommit = finishedWork.firstEffect);
  6365. if (null !== remainingExpirationTimeBeforeCommit) {
  6366. var prevExecutionContext = executionContext;
  6367. executionContext |= CommitContext;
  6368. ReactCurrentOwner$2.current = null;
  6369. nextEffect = remainingExpirationTimeBeforeCommit;
  6370. do
  6371. try {
  6372. commitBeforeMutationEffects();
  6373. } catch (error) {
  6374. if (null === nextEffect) throw Error("Should be working on an effect.");
  6375. captureCommitPhaseError(nextEffect, error);
  6376. nextEffect = nextEffect.nextEffect;
  6377. }
  6378. while (null !== nextEffect);
  6379. nextEffect = remainingExpirationTimeBeforeCommit;
  6380. do
  6381. try {
  6382. for (
  6383. var root = root$jscomp$0,
  6384. renderPriorityLevel = renderPriorityLevel$jscomp$0;
  6385. null !== nextEffect;
  6386. ) {
  6387. var effectTag = nextEffect.effectTag;
  6388. if (effectTag & 128) {
  6389. var current = nextEffect.alternate;
  6390. if (null !== current) {
  6391. var currentRef = current.ref;
  6392. null !== currentRef &&
  6393. ("function" === typeof currentRef
  6394. ? currentRef(null)
  6395. : (currentRef.current = null));
  6396. }
  6397. }
  6398. switch (effectTag & 1038) {
  6399. case 2:
  6400. commitPlacement(nextEffect);
  6401. nextEffect.effectTag &= -3;
  6402. break;
  6403. case 6:
  6404. commitPlacement(nextEffect);
  6405. nextEffect.effectTag &= -3;
  6406. commitWork(nextEffect.alternate, nextEffect);
  6407. break;
  6408. case 1024:
  6409. nextEffect.effectTag &= -1025;
  6410. break;
  6411. case 1028:
  6412. nextEffect.effectTag &= -1025;
  6413. commitWork(nextEffect.alternate, nextEffect);
  6414. break;
  6415. case 4:
  6416. commitWork(nextEffect.alternate, nextEffect);
  6417. break;
  6418. case 8:
  6419. var current$jscomp$0 = nextEffect;
  6420. unmountHostComponents(
  6421. root,
  6422. current$jscomp$0,
  6423. renderPriorityLevel
  6424. );
  6425. detachFiber(current$jscomp$0);
  6426. }
  6427. nextEffect = nextEffect.nextEffect;
  6428. }
  6429. } catch (error) {
  6430. if (null === nextEffect) throw Error("Should be working on an effect.");
  6431. captureCommitPhaseError(nextEffect, error);
  6432. nextEffect = nextEffect.nextEffect;
  6433. }
  6434. while (null !== nextEffect);
  6435. root$jscomp$0.current = finishedWork;
  6436. nextEffect = remainingExpirationTimeBeforeCommit;
  6437. do
  6438. try {
  6439. for (effectTag = root$jscomp$0; null !== nextEffect; ) {
  6440. var effectTag$jscomp$0 = nextEffect.effectTag;
  6441. effectTag$jscomp$0 & 36 &&
  6442. commitLifeCycles(effectTag, nextEffect.alternate, nextEffect);
  6443. if (effectTag$jscomp$0 & 128) {
  6444. current = void 0;
  6445. var ref = nextEffect.ref;
  6446. if (null !== ref) {
  6447. var instance = nextEffect.stateNode;
  6448. switch (nextEffect.tag) {
  6449. case 5:
  6450. current = instance;
  6451. break;
  6452. default:
  6453. current = instance;
  6454. }
  6455. "function" === typeof ref
  6456. ? ref(current)
  6457. : (ref.current = current);
  6458. }
  6459. }
  6460. nextEffect = nextEffect.nextEffect;
  6461. }
  6462. } catch (error) {
  6463. if (null === nextEffect) throw Error("Should be working on an effect.");
  6464. captureCommitPhaseError(nextEffect, error);
  6465. nextEffect = nextEffect.nextEffect;
  6466. }
  6467. while (null !== nextEffect);
  6468. nextEffect = null;
  6469. requestPaint();
  6470. executionContext = prevExecutionContext;
  6471. } else root$jscomp$0.current = finishedWork;
  6472. if (rootDoesHavePassiveEffects)
  6473. (rootDoesHavePassiveEffects = !1),
  6474. (rootWithPendingPassiveEffects = root$jscomp$0),
  6475. (pendingPassiveEffectsRenderPriority = renderPriorityLevel$jscomp$0);
  6476. else
  6477. for (
  6478. nextEffect = remainingExpirationTimeBeforeCommit;
  6479. null !== nextEffect;
  6480. )
  6481. (renderPriorityLevel$jscomp$0 = nextEffect.nextEffect),
  6482. (nextEffect.nextEffect = null),
  6483. (nextEffect = renderPriorityLevel$jscomp$0);
  6484. renderPriorityLevel$jscomp$0 = root$jscomp$0.firstPendingTime;
  6485. 0 === renderPriorityLevel$jscomp$0 &&
  6486. (legacyErrorBoundariesThatAlreadyFailed = null);
  6487. 1073741823 === renderPriorityLevel$jscomp$0
  6488. ? root$jscomp$0 === rootWithNestedUpdates
  6489. ? nestedUpdateCount++
  6490. : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root$jscomp$0))
  6491. : (nestedUpdateCount = 0);
  6492. "function" === typeof onCommitFiberRoot &&
  6493. onCommitFiberRoot(finishedWork.stateNode, expirationTime);
  6494. ensureRootIsScheduled(root$jscomp$0);
  6495. if (hasUncaughtError)
  6496. throw ((hasUncaughtError = !1),
  6497. (root$jscomp$0 = firstUncaughtError),
  6498. (firstUncaughtError = null),
  6499. root$jscomp$0);
  6500. if ((executionContext & LegacyUnbatchedContext) !== NoContext) return null;
  6501. flushSyncCallbackQueue();
  6502. return null;
  6503. }
  6504. function commitBeforeMutationEffects() {
  6505. for (; null !== nextEffect; ) {
  6506. var effectTag = nextEffect.effectTag;
  6507. 0 !== (effectTag & 256) &&
  6508. commitBeforeMutationLifeCycles(nextEffect.alternate, nextEffect);
  6509. 0 === (effectTag & 512) ||
  6510. rootDoesHavePassiveEffects ||
  6511. ((rootDoesHavePassiveEffects = !0),
  6512. scheduleCallback(97, function() {
  6513. flushPassiveEffects();
  6514. return null;
  6515. }));
  6516. nextEffect = nextEffect.nextEffect;
  6517. }
  6518. }
  6519. function flushPassiveEffects() {
  6520. if (90 !== pendingPassiveEffectsRenderPriority) {
  6521. var priorityLevel =
  6522. 97 < pendingPassiveEffectsRenderPriority
  6523. ? 97
  6524. : pendingPassiveEffectsRenderPriority;
  6525. pendingPassiveEffectsRenderPriority = 90;
  6526. return runWithPriority(priorityLevel, flushPassiveEffectsImpl);
  6527. }
  6528. }
  6529. function flushPassiveEffectsImpl() {
  6530. if (null === rootWithPendingPassiveEffects) return !1;
  6531. var root = rootWithPendingPassiveEffects;
  6532. rootWithPendingPassiveEffects = null;
  6533. if ((executionContext & (RenderContext | CommitContext)) !== NoContext)
  6534. throw Error("Cannot flush passive effects while already rendering.");
  6535. var prevExecutionContext = executionContext;
  6536. executionContext |= CommitContext;
  6537. for (root = root.current.firstEffect; null !== root; ) {
  6538. try {
  6539. var finishedWork = root;
  6540. if (0 !== (finishedWork.effectTag & 512))
  6541. switch (finishedWork.tag) {
  6542. case 0:
  6543. case 11:
  6544. case 15:
  6545. case 22:
  6546. commitHookEffectListUnmount(5, finishedWork),
  6547. commitHookEffectListMount(5, finishedWork);
  6548. }
  6549. } catch (error) {
  6550. if (null === root) throw Error("Should be working on an effect.");
  6551. captureCommitPhaseError(root, error);
  6552. }
  6553. finishedWork = root.nextEffect;
  6554. root.nextEffect = null;
  6555. root = finishedWork;
  6556. }
  6557. executionContext = prevExecutionContext;
  6558. flushSyncCallbackQueue();
  6559. return !0;
  6560. }
  6561. function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
  6562. sourceFiber = createCapturedValue(error, sourceFiber);
  6563. sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 1073741823);
  6564. enqueueUpdate(rootFiber, sourceFiber);
  6565. rootFiber = markUpdateTimeFromFiberToRoot(rootFiber, 1073741823);
  6566. null !== rootFiber && ensureRootIsScheduled(rootFiber);
  6567. }
  6568. function captureCommitPhaseError(sourceFiber, error) {
  6569. if (3 === sourceFiber.tag)
  6570. captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
  6571. else
  6572. for (var fiber = sourceFiber.return; null !== fiber; ) {
  6573. if (3 === fiber.tag) {
  6574. captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);
  6575. break;
  6576. } else if (1 === fiber.tag) {
  6577. var instance = fiber.stateNode;
  6578. if (
  6579. "function" === typeof fiber.type.getDerivedStateFromError ||
  6580. ("function" === typeof instance.componentDidCatch &&
  6581. (null === legacyErrorBoundariesThatAlreadyFailed ||
  6582. !legacyErrorBoundariesThatAlreadyFailed.has(instance)))
  6583. ) {
  6584. sourceFiber = createCapturedValue(error, sourceFiber);
  6585. sourceFiber = createClassErrorUpdate(fiber, sourceFiber, 1073741823);
  6586. enqueueUpdate(fiber, sourceFiber);
  6587. fiber = markUpdateTimeFromFiberToRoot(fiber, 1073741823);
  6588. null !== fiber && ensureRootIsScheduled(fiber);
  6589. break;
  6590. }
  6591. }
  6592. fiber = fiber.return;
  6593. }
  6594. }
  6595. function pingSuspendedRoot(root, thenable, suspendedTime) {
  6596. var pingCache = root.pingCache;
  6597. null !== pingCache && pingCache.delete(thenable);
  6598. workInProgressRoot === root && renderExpirationTime$1 === suspendedTime
  6599. ? workInProgressRootExitStatus === RootSuspendedWithDelay ||
  6600. (workInProgressRootExitStatus === RootSuspended &&
  6601. 1073741823 === workInProgressRootLatestProcessedExpirationTime &&
  6602. now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS)
  6603. ? prepareFreshStack(root, renderExpirationTime$1)
  6604. : (workInProgressRootHasPendingPing = !0)
  6605. : isRootSuspendedAtTime(root, suspendedTime) &&
  6606. ((thenable = root.lastPingedTime),
  6607. (0 !== thenable && thenable < suspendedTime) ||
  6608. ((root.lastPingedTime = suspendedTime), ensureRootIsScheduled(root)));
  6609. }
  6610. function resolveRetryThenable(boundaryFiber, thenable) {
  6611. var retryCache = boundaryFiber.stateNode;
  6612. null !== retryCache && retryCache.delete(thenable);
  6613. thenable = 0;
  6614. 0 === thenable &&
  6615. ((thenable = requestCurrentTimeForUpdate()),
  6616. (thenable = computeExpirationForFiber(thenable, boundaryFiber, null)));
  6617. boundaryFiber = markUpdateTimeFromFiberToRoot(boundaryFiber, thenable);
  6618. null !== boundaryFiber && ensureRootIsScheduled(boundaryFiber);
  6619. }
  6620. var beginWork$1;
  6621. beginWork$1 = function(current, workInProgress, renderExpirationTime) {
  6622. var updateExpirationTime = workInProgress.expirationTime;
  6623. if (null !== current)
  6624. if (
  6625. current.memoizedProps !== workInProgress.pendingProps ||
  6626. didPerformWorkStackCursor.current
  6627. )
  6628. didReceiveUpdate = !0;
  6629. else {
  6630. if (updateExpirationTime < renderExpirationTime) {
  6631. didReceiveUpdate = !1;
  6632. switch (workInProgress.tag) {
  6633. case 3:
  6634. pushHostRootContext(workInProgress);
  6635. break;
  6636. case 5:
  6637. pushHostContext(workInProgress);
  6638. break;
  6639. case 1:
  6640. isContextProvider(workInProgress.type) &&
  6641. pushContextProvider(workInProgress);
  6642. break;
  6643. case 4:
  6644. pushHostContainer(
  6645. workInProgress,
  6646. workInProgress.stateNode.containerInfo
  6647. );
  6648. break;
  6649. case 10:
  6650. updateExpirationTime = workInProgress.memoizedProps.value;
  6651. var context = workInProgress.type._context;
  6652. push(valueCursor, context._currentValue);
  6653. context._currentValue = updateExpirationTime;
  6654. break;
  6655. case 13:
  6656. if (null !== workInProgress.memoizedState) {
  6657. updateExpirationTime = workInProgress.child.childExpirationTime;
  6658. if (
  6659. 0 !== updateExpirationTime &&
  6660. updateExpirationTime >= renderExpirationTime
  6661. )
  6662. return updateSuspenseComponent(
  6663. current,
  6664. workInProgress,
  6665. renderExpirationTime
  6666. );
  6667. push(suspenseStackCursor, suspenseStackCursor.current & 1);
  6668. workInProgress = bailoutOnAlreadyFinishedWork(
  6669. current,
  6670. workInProgress,
  6671. renderExpirationTime
  6672. );
  6673. return null !== workInProgress ? workInProgress.sibling : null;
  6674. }
  6675. push(suspenseStackCursor, suspenseStackCursor.current & 1);
  6676. break;
  6677. case 19:
  6678. updateExpirationTime =
  6679. workInProgress.childExpirationTime >= renderExpirationTime;
  6680. if (0 !== (current.effectTag & 64)) {
  6681. if (updateExpirationTime)
  6682. return updateSuspenseListComponent(
  6683. current,
  6684. workInProgress,
  6685. renderExpirationTime
  6686. );
  6687. workInProgress.effectTag |= 64;
  6688. }
  6689. context = workInProgress.memoizedState;
  6690. null !== context &&
  6691. ((context.rendering = null), (context.tail = null));
  6692. push(suspenseStackCursor, suspenseStackCursor.current);
  6693. if (!updateExpirationTime) return null;
  6694. }
  6695. return bailoutOnAlreadyFinishedWork(
  6696. current,
  6697. workInProgress,
  6698. renderExpirationTime
  6699. );
  6700. }
  6701. didReceiveUpdate = !1;
  6702. }
  6703. else didReceiveUpdate = !1;
  6704. workInProgress.expirationTime = 0;
  6705. switch (workInProgress.tag) {
  6706. case 2:
  6707. updateExpirationTime = workInProgress.type;
  6708. null !== current &&
  6709. ((current.alternate = null),
  6710. (workInProgress.alternate = null),
  6711. (workInProgress.effectTag |= 2));
  6712. current = workInProgress.pendingProps;
  6713. context = getMaskedContext(workInProgress, contextStackCursor.current);
  6714. prepareToReadContext(workInProgress, renderExpirationTime);
  6715. context = renderWithHooks(
  6716. null,
  6717. workInProgress,
  6718. updateExpirationTime,
  6719. current,
  6720. context,
  6721. renderExpirationTime
  6722. );
  6723. workInProgress.effectTag |= 1;
  6724. if (
  6725. "object" === typeof context &&
  6726. null !== context &&
  6727. "function" === typeof context.render &&
  6728. void 0 === context.$$typeof
  6729. ) {
  6730. workInProgress.tag = 1;
  6731. workInProgress.memoizedState = null;
  6732. workInProgress.updateQueue = null;
  6733. if (isContextProvider(updateExpirationTime)) {
  6734. var hasContext = !0;
  6735. pushContextProvider(workInProgress);
  6736. } else hasContext = !1;
  6737. workInProgress.memoizedState =
  6738. null !== context.state && void 0 !== context.state
  6739. ? context.state
  6740. : null;
  6741. initializeUpdateQueue(workInProgress);
  6742. var getDerivedStateFromProps =
  6743. updateExpirationTime.getDerivedStateFromProps;
  6744. "function" === typeof getDerivedStateFromProps &&
  6745. applyDerivedStateFromProps(
  6746. workInProgress,
  6747. updateExpirationTime,
  6748. getDerivedStateFromProps,
  6749. current
  6750. );
  6751. context.updater = classComponentUpdater;
  6752. workInProgress.stateNode = context;
  6753. context._reactInternalFiber = workInProgress;
  6754. mountClassInstance(
  6755. workInProgress,
  6756. updateExpirationTime,
  6757. current,
  6758. renderExpirationTime
  6759. );
  6760. workInProgress = finishClassComponent(
  6761. null,
  6762. workInProgress,
  6763. updateExpirationTime,
  6764. !0,
  6765. hasContext,
  6766. renderExpirationTime
  6767. );
  6768. } else
  6769. (workInProgress.tag = 0),
  6770. reconcileChildren(
  6771. null,
  6772. workInProgress,
  6773. context,
  6774. renderExpirationTime
  6775. ),
  6776. (workInProgress = workInProgress.child);
  6777. return workInProgress;
  6778. case 16:
  6779. a: {
  6780. context = workInProgress.elementType;
  6781. null !== current &&
  6782. ((current.alternate = null),
  6783. (workInProgress.alternate = null),
  6784. (workInProgress.effectTag |= 2));
  6785. current = workInProgress.pendingProps;
  6786. initializeLazyComponentType(context);
  6787. if (1 !== context._status) throw context._result;
  6788. context = context._result;
  6789. workInProgress.type = context;
  6790. hasContext = workInProgress.tag = resolveLazyComponentTag(context);
  6791. current = resolveDefaultProps(context, current);
  6792. switch (hasContext) {
  6793. case 0:
  6794. workInProgress = updateFunctionComponent(
  6795. null,
  6796. workInProgress,
  6797. context,
  6798. current,
  6799. renderExpirationTime
  6800. );
  6801. break a;
  6802. case 1:
  6803. workInProgress = updateClassComponent(
  6804. null,
  6805. workInProgress,
  6806. context,
  6807. current,
  6808. renderExpirationTime
  6809. );
  6810. break a;
  6811. case 11:
  6812. workInProgress = updateForwardRef(
  6813. null,
  6814. workInProgress,
  6815. context,
  6816. current,
  6817. renderExpirationTime
  6818. );
  6819. break a;
  6820. case 14:
  6821. workInProgress = updateMemoComponent(
  6822. null,
  6823. workInProgress,
  6824. context,
  6825. resolveDefaultProps(context.type, current),
  6826. updateExpirationTime,
  6827. renderExpirationTime
  6828. );
  6829. break a;
  6830. }
  6831. throw Error(
  6832. "Element type is invalid. Received a promise that resolves to: " +
  6833. context +
  6834. ". Lazy element type must resolve to a class or function."
  6835. );
  6836. }
  6837. return workInProgress;
  6838. case 0:
  6839. return (
  6840. (updateExpirationTime = workInProgress.type),
  6841. (context = workInProgress.pendingProps),
  6842. (context =
  6843. workInProgress.elementType === updateExpirationTime
  6844. ? context
  6845. : resolveDefaultProps(updateExpirationTime, context)),
  6846. updateFunctionComponent(
  6847. current,
  6848. workInProgress,
  6849. updateExpirationTime,
  6850. context,
  6851. renderExpirationTime
  6852. )
  6853. );
  6854. case 1:
  6855. return (
  6856. (updateExpirationTime = workInProgress.type),
  6857. (context = workInProgress.pendingProps),
  6858. (context =
  6859. workInProgress.elementType === updateExpirationTime
  6860. ? context
  6861. : resolveDefaultProps(updateExpirationTime, context)),
  6862. updateClassComponent(
  6863. current,
  6864. workInProgress,
  6865. updateExpirationTime,
  6866. context,
  6867. renderExpirationTime
  6868. )
  6869. );
  6870. case 3:
  6871. pushHostRootContext(workInProgress);
  6872. updateExpirationTime = workInProgress.updateQueue;
  6873. if (null === current || null === updateExpirationTime)
  6874. throw Error(
  6875. "If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue."
  6876. );
  6877. updateExpirationTime = workInProgress.pendingProps;
  6878. context = workInProgress.memoizedState;
  6879. context = null !== context ? context.element : null;
  6880. cloneUpdateQueue(current, workInProgress);
  6881. processUpdateQueue(
  6882. workInProgress,
  6883. updateExpirationTime,
  6884. null,
  6885. renderExpirationTime
  6886. );
  6887. updateExpirationTime = workInProgress.memoizedState.element;
  6888. updateExpirationTime === context
  6889. ? (workInProgress = bailoutOnAlreadyFinishedWork(
  6890. current,
  6891. workInProgress,
  6892. renderExpirationTime
  6893. ))
  6894. : (reconcileChildren(
  6895. current,
  6896. workInProgress,
  6897. updateExpirationTime,
  6898. renderExpirationTime
  6899. ),
  6900. (workInProgress = workInProgress.child));
  6901. return workInProgress;
  6902. case 5:
  6903. return (
  6904. pushHostContext(workInProgress),
  6905. (updateExpirationTime = workInProgress.pendingProps.children),
  6906. markRef(current, workInProgress),
  6907. reconcileChildren(
  6908. current,
  6909. workInProgress,
  6910. updateExpirationTime,
  6911. renderExpirationTime
  6912. ),
  6913. (workInProgress = workInProgress.child),
  6914. workInProgress
  6915. );
  6916. case 6:
  6917. return null;
  6918. case 13:
  6919. return updateSuspenseComponent(
  6920. current,
  6921. workInProgress,
  6922. renderExpirationTime
  6923. );
  6924. case 4:
  6925. return (
  6926. pushHostContainer(
  6927. workInProgress,
  6928. workInProgress.stateNode.containerInfo
  6929. ),
  6930. (updateExpirationTime = workInProgress.pendingProps),
  6931. null === current
  6932. ? (workInProgress.child = reconcileChildFibers(
  6933. workInProgress,
  6934. null,
  6935. updateExpirationTime,
  6936. renderExpirationTime
  6937. ))
  6938. : reconcileChildren(
  6939. current,
  6940. workInProgress,
  6941. updateExpirationTime,
  6942. renderExpirationTime
  6943. ),
  6944. workInProgress.child
  6945. );
  6946. case 11:
  6947. return (
  6948. (updateExpirationTime = workInProgress.type),
  6949. (context = workInProgress.pendingProps),
  6950. (context =
  6951. workInProgress.elementType === updateExpirationTime
  6952. ? context
  6953. : resolveDefaultProps(updateExpirationTime, context)),
  6954. updateForwardRef(
  6955. current,
  6956. workInProgress,
  6957. updateExpirationTime,
  6958. context,
  6959. renderExpirationTime
  6960. )
  6961. );
  6962. case 7:
  6963. return (
  6964. reconcileChildren(
  6965. current,
  6966. workInProgress,
  6967. workInProgress.pendingProps,
  6968. renderExpirationTime
  6969. ),
  6970. workInProgress.child
  6971. );
  6972. case 8:
  6973. return (
  6974. reconcileChildren(
  6975. current,
  6976. workInProgress,
  6977. workInProgress.pendingProps.children,
  6978. renderExpirationTime
  6979. ),
  6980. workInProgress.child
  6981. );
  6982. case 12:
  6983. return (
  6984. reconcileChildren(
  6985. current,
  6986. workInProgress,
  6987. workInProgress.pendingProps.children,
  6988. renderExpirationTime
  6989. ),
  6990. workInProgress.child
  6991. );
  6992. case 10:
  6993. a: {
  6994. updateExpirationTime = workInProgress.type._context;
  6995. context = workInProgress.pendingProps;
  6996. getDerivedStateFromProps = workInProgress.memoizedProps;
  6997. hasContext = context.value;
  6998. var context$jscomp$0 = workInProgress.type._context;
  6999. push(valueCursor, context$jscomp$0._currentValue);
  7000. context$jscomp$0._currentValue = hasContext;
  7001. if (null !== getDerivedStateFromProps)
  7002. if (
  7003. ((context$jscomp$0 = getDerivedStateFromProps.value),
  7004. (hasContext = objectIs(context$jscomp$0, hasContext)
  7005. ? 0
  7006. : ("function" ===
  7007. typeof updateExpirationTime._calculateChangedBits
  7008. ? updateExpirationTime._calculateChangedBits(
  7009. context$jscomp$0,
  7010. hasContext
  7011. )
  7012. : 1073741823) | 0),
  7013. 0 === hasContext)
  7014. ) {
  7015. if (
  7016. getDerivedStateFromProps.children === context.children &&
  7017. !didPerformWorkStackCursor.current
  7018. ) {
  7019. workInProgress = bailoutOnAlreadyFinishedWork(
  7020. current,
  7021. workInProgress,
  7022. renderExpirationTime
  7023. );
  7024. break a;
  7025. }
  7026. } else
  7027. for (
  7028. context$jscomp$0 = workInProgress.child,
  7029. null !== context$jscomp$0 &&
  7030. (context$jscomp$0.return = workInProgress);
  7031. null !== context$jscomp$0;
  7032. ) {
  7033. var list = context$jscomp$0.dependencies;
  7034. if (null !== list) {
  7035. getDerivedStateFromProps = context$jscomp$0.child;
  7036. for (
  7037. var dependency = list.firstContext;
  7038. null !== dependency;
  7039. ) {
  7040. if (
  7041. dependency.context === updateExpirationTime &&
  7042. 0 !== (dependency.observedBits & hasContext)
  7043. ) {
  7044. 1 === context$jscomp$0.tag &&
  7045. ((dependency = createUpdate(renderExpirationTime, null)),
  7046. (dependency.tag = 2),
  7047. enqueueUpdate(context$jscomp$0, dependency));
  7048. context$jscomp$0.expirationTime < renderExpirationTime &&
  7049. (context$jscomp$0.expirationTime = renderExpirationTime);
  7050. dependency = context$jscomp$0.alternate;
  7051. null !== dependency &&
  7052. dependency.expirationTime < renderExpirationTime &&
  7053. (dependency.expirationTime = renderExpirationTime);
  7054. scheduleWorkOnParentPath(
  7055. context$jscomp$0.return,
  7056. renderExpirationTime
  7057. );
  7058. list.expirationTime < renderExpirationTime &&
  7059. (list.expirationTime = renderExpirationTime);
  7060. break;
  7061. }
  7062. dependency = dependency.next;
  7063. }
  7064. } else
  7065. getDerivedStateFromProps =
  7066. 10 === context$jscomp$0.tag
  7067. ? context$jscomp$0.type === workInProgress.type
  7068. ? null
  7069. : context$jscomp$0.child
  7070. : context$jscomp$0.child;
  7071. if (null !== getDerivedStateFromProps)
  7072. getDerivedStateFromProps.return = context$jscomp$0;
  7073. else
  7074. for (
  7075. getDerivedStateFromProps = context$jscomp$0;
  7076. null !== getDerivedStateFromProps;
  7077. ) {
  7078. if (getDerivedStateFromProps === workInProgress) {
  7079. getDerivedStateFromProps = null;
  7080. break;
  7081. }
  7082. context$jscomp$0 = getDerivedStateFromProps.sibling;
  7083. if (null !== context$jscomp$0) {
  7084. context$jscomp$0.return = getDerivedStateFromProps.return;
  7085. getDerivedStateFromProps = context$jscomp$0;
  7086. break;
  7087. }
  7088. getDerivedStateFromProps = getDerivedStateFromProps.return;
  7089. }
  7090. context$jscomp$0 = getDerivedStateFromProps;
  7091. }
  7092. reconcileChildren(
  7093. current,
  7094. workInProgress,
  7095. context.children,
  7096. renderExpirationTime
  7097. );
  7098. workInProgress = workInProgress.child;
  7099. }
  7100. return workInProgress;
  7101. case 9:
  7102. return (
  7103. (context = workInProgress.type),
  7104. (hasContext = workInProgress.pendingProps),
  7105. (updateExpirationTime = hasContext.children),
  7106. prepareToReadContext(workInProgress, renderExpirationTime),
  7107. (context = readContext(context, hasContext.unstable_observedBits)),
  7108. (updateExpirationTime = updateExpirationTime(context)),
  7109. (workInProgress.effectTag |= 1),
  7110. reconcileChildren(
  7111. current,
  7112. workInProgress,
  7113. updateExpirationTime,
  7114. renderExpirationTime
  7115. ),
  7116. workInProgress.child
  7117. );
  7118. case 14:
  7119. return (
  7120. (context = workInProgress.type),
  7121. (hasContext = resolveDefaultProps(
  7122. context,
  7123. workInProgress.pendingProps
  7124. )),
  7125. (hasContext = resolveDefaultProps(context.type, hasContext)),
  7126. updateMemoComponent(
  7127. current,
  7128. workInProgress,
  7129. context,
  7130. hasContext,
  7131. updateExpirationTime,
  7132. renderExpirationTime
  7133. )
  7134. );
  7135. case 15:
  7136. return updateSimpleMemoComponent(
  7137. current,
  7138. workInProgress,
  7139. workInProgress.type,
  7140. workInProgress.pendingProps,
  7141. updateExpirationTime,
  7142. renderExpirationTime
  7143. );
  7144. case 17:
  7145. return (
  7146. (updateExpirationTime = workInProgress.type),
  7147. (context = workInProgress.pendingProps),
  7148. (context =
  7149. workInProgress.elementType === updateExpirationTime
  7150. ? context
  7151. : resolveDefaultProps(updateExpirationTime, context)),
  7152. null !== current &&
  7153. ((current.alternate = null),
  7154. (workInProgress.alternate = null),
  7155. (workInProgress.effectTag |= 2)),
  7156. (workInProgress.tag = 1),
  7157. isContextProvider(updateExpirationTime)
  7158. ? ((current = !0), pushContextProvider(workInProgress))
  7159. : (current = !1),
  7160. prepareToReadContext(workInProgress, renderExpirationTime),
  7161. constructClassInstance(workInProgress, updateExpirationTime, context),
  7162. mountClassInstance(
  7163. workInProgress,
  7164. updateExpirationTime,
  7165. context,
  7166. renderExpirationTime
  7167. ),
  7168. finishClassComponent(
  7169. null,
  7170. workInProgress,
  7171. updateExpirationTime,
  7172. !0,
  7173. current,
  7174. renderExpirationTime
  7175. )
  7176. );
  7177. case 19:
  7178. return updateSuspenseListComponent(
  7179. current,
  7180. workInProgress,
  7181. renderExpirationTime
  7182. );
  7183. }
  7184. throw Error(
  7185. "Unknown unit of work tag (" +
  7186. workInProgress.tag +
  7187. "). This error is likely caused by a bug in React. Please file an issue."
  7188. );
  7189. };
  7190. var onCommitFiberRoot = null,
  7191. onCommitFiberUnmount = null;
  7192. function injectInternals(internals) {
  7193. if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1;
  7194. var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
  7195. if (hook.isDisabled || !hook.supportsFiber) return !0;
  7196. try {
  7197. var rendererID = hook.inject(internals);
  7198. onCommitFiberRoot = function(root) {
  7199. try {
  7200. hook.onCommitFiberRoot(
  7201. rendererID,
  7202. root,
  7203. void 0,
  7204. 64 === (root.current.effectTag & 64)
  7205. );
  7206. } catch (err) {}
  7207. };
  7208. onCommitFiberUnmount = function(fiber) {
  7209. try {
  7210. hook.onCommitFiberUnmount(rendererID, fiber);
  7211. } catch (err) {}
  7212. };
  7213. } catch (err) {}
  7214. return !0;
  7215. }
  7216. function FiberNode(tag, pendingProps, key, mode) {
  7217. this.tag = tag;
  7218. this.key = key;
  7219. this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null;
  7220. this.index = 0;
  7221. this.ref = null;
  7222. this.pendingProps = pendingProps;
  7223. this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null;
  7224. this.mode = mode;
  7225. this.effectTag = 0;
  7226. this.lastEffect = this.firstEffect = this.nextEffect = null;
  7227. this.childExpirationTime = this.expirationTime = 0;
  7228. this.alternate = null;
  7229. }
  7230. function shouldConstruct(Component) {
  7231. Component = Component.prototype;
  7232. return !(!Component || !Component.isReactComponent);
  7233. }
  7234. function resolveLazyComponentTag(Component) {
  7235. if ("function" === typeof Component)
  7236. return shouldConstruct(Component) ? 1 : 0;
  7237. if (void 0 !== Component && null !== Component) {
  7238. Component = Component.$$typeof;
  7239. if (Component === REACT_FORWARD_REF_TYPE) return 11;
  7240. if (Component === REACT_MEMO_TYPE) return 14;
  7241. }
  7242. return 2;
  7243. }
  7244. function createWorkInProgress(current, pendingProps) {
  7245. var workInProgress = current.alternate;
  7246. null === workInProgress
  7247. ? ((workInProgress = new FiberNode(
  7248. current.tag,
  7249. pendingProps,
  7250. current.key,
  7251. current.mode
  7252. )),
  7253. (workInProgress.elementType = current.elementType),
  7254. (workInProgress.type = current.type),
  7255. (workInProgress.stateNode = current.stateNode),
  7256. (workInProgress.alternate = current),
  7257. (current.alternate = workInProgress))
  7258. : ((workInProgress.pendingProps = pendingProps),
  7259. (workInProgress.effectTag = 0),
  7260. (workInProgress.nextEffect = null),
  7261. (workInProgress.firstEffect = null),
  7262. (workInProgress.lastEffect = null));
  7263. workInProgress.childExpirationTime = current.childExpirationTime;
  7264. workInProgress.expirationTime = current.expirationTime;
  7265. workInProgress.child = current.child;
  7266. workInProgress.memoizedProps = current.memoizedProps;
  7267. workInProgress.memoizedState = current.memoizedState;
  7268. workInProgress.updateQueue = current.updateQueue;
  7269. pendingProps = current.dependencies;
  7270. workInProgress.dependencies =
  7271. null === pendingProps
  7272. ? null
  7273. : {
  7274. expirationTime: pendingProps.expirationTime,
  7275. firstContext: pendingProps.firstContext,
  7276. responders: pendingProps.responders
  7277. };
  7278. workInProgress.sibling = current.sibling;
  7279. workInProgress.index = current.index;
  7280. workInProgress.ref = current.ref;
  7281. return workInProgress;
  7282. }
  7283. function createFiberFromTypeAndProps(
  7284. type,
  7285. key,
  7286. pendingProps,
  7287. owner,
  7288. mode,
  7289. expirationTime
  7290. ) {
  7291. var fiberTag = 2;
  7292. owner = type;
  7293. if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1);
  7294. else if ("string" === typeof type) fiberTag = 5;
  7295. else
  7296. a: switch (type) {
  7297. case REACT_FRAGMENT_TYPE:
  7298. return createFiberFromFragment(
  7299. pendingProps.children,
  7300. mode,
  7301. expirationTime,
  7302. key
  7303. );
  7304. case REACT_CONCURRENT_MODE_TYPE:
  7305. fiberTag = 8;
  7306. mode |= 7;
  7307. break;
  7308. case REACT_STRICT_MODE_TYPE:
  7309. fiberTag = 8;
  7310. mode |= 1;
  7311. break;
  7312. case REACT_PROFILER_TYPE:
  7313. return (
  7314. (type = new FiberNode(12, pendingProps, key, mode | 8)),
  7315. (type.elementType = REACT_PROFILER_TYPE),
  7316. (type.type = REACT_PROFILER_TYPE),
  7317. (type.expirationTime = expirationTime),
  7318. type
  7319. );
  7320. case REACT_SUSPENSE_TYPE:
  7321. return (
  7322. (type = new FiberNode(13, pendingProps, key, mode)),
  7323. (type.type = REACT_SUSPENSE_TYPE),
  7324. (type.elementType = REACT_SUSPENSE_TYPE),
  7325. (type.expirationTime = expirationTime),
  7326. type
  7327. );
  7328. case REACT_SUSPENSE_LIST_TYPE:
  7329. return (
  7330. (type = new FiberNode(19, pendingProps, key, mode)),
  7331. (type.elementType = REACT_SUSPENSE_LIST_TYPE),
  7332. (type.expirationTime = expirationTime),
  7333. type
  7334. );
  7335. default:
  7336. if ("object" === typeof type && null !== type)
  7337. switch (type.$$typeof) {
  7338. case REACT_PROVIDER_TYPE:
  7339. fiberTag = 10;
  7340. break a;
  7341. case REACT_CONTEXT_TYPE:
  7342. fiberTag = 9;
  7343. break a;
  7344. case REACT_FORWARD_REF_TYPE:
  7345. fiberTag = 11;
  7346. break a;
  7347. case REACT_MEMO_TYPE:
  7348. fiberTag = 14;
  7349. break a;
  7350. case REACT_LAZY_TYPE:
  7351. fiberTag = 16;
  7352. owner = null;
  7353. break a;
  7354. case REACT_BLOCK_TYPE:
  7355. fiberTag = 22;
  7356. break a;
  7357. }
  7358. throw Error(
  7359. "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " +
  7360. (null == type ? type : typeof type) +
  7361. "."
  7362. );
  7363. }
  7364. key = new FiberNode(fiberTag, pendingProps, key, mode);
  7365. key.elementType = type;
  7366. key.type = owner;
  7367. key.expirationTime = expirationTime;
  7368. return key;
  7369. }
  7370. function createFiberFromFragment(elements, mode, expirationTime, key) {
  7371. elements = new FiberNode(7, elements, key, mode);
  7372. elements.expirationTime = expirationTime;
  7373. return elements;
  7374. }
  7375. function createFiberFromText(content, mode, expirationTime) {
  7376. content = new FiberNode(6, content, null, mode);
  7377. content.expirationTime = expirationTime;
  7378. return content;
  7379. }
  7380. function createFiberFromPortal(portal, mode, expirationTime) {
  7381. mode = new FiberNode(
  7382. 4,
  7383. null !== portal.children ? portal.children : [],
  7384. portal.key,
  7385. mode
  7386. );
  7387. mode.expirationTime = expirationTime;
  7388. mode.stateNode = {
  7389. containerInfo: portal.containerInfo,
  7390. pendingChildren: null,
  7391. implementation: portal.implementation
  7392. };
  7393. return mode;
  7394. }
  7395. function FiberRootNode(containerInfo, tag, hydrate) {
  7396. this.tag = tag;
  7397. this.current = null;
  7398. this.containerInfo = containerInfo;
  7399. this.pingCache = this.pendingChildren = null;
  7400. this.finishedExpirationTime = 0;
  7401. this.finishedWork = null;
  7402. this.timeoutHandle = -1;
  7403. this.pendingContext = this.context = null;
  7404. this.hydrate = hydrate;
  7405. this.callbackNode = null;
  7406. this.callbackPriority = 90;
  7407. this.lastExpiredTime = this.lastPingedTime = this.nextKnownPendingLevel = this.lastSuspendedTime = this.firstSuspendedTime = this.firstPendingTime = 0;
  7408. }
  7409. function isRootSuspendedAtTime(root, expirationTime) {
  7410. var firstSuspendedTime = root.firstSuspendedTime;
  7411. root = root.lastSuspendedTime;
  7412. return (
  7413. 0 !== firstSuspendedTime &&
  7414. firstSuspendedTime >= expirationTime &&
  7415. root <= expirationTime
  7416. );
  7417. }
  7418. function markRootSuspendedAtTime(root, expirationTime) {
  7419. var firstSuspendedTime = root.firstSuspendedTime,
  7420. lastSuspendedTime = root.lastSuspendedTime;
  7421. firstSuspendedTime < expirationTime &&
  7422. (root.firstSuspendedTime = expirationTime);
  7423. if (lastSuspendedTime > expirationTime || 0 === firstSuspendedTime)
  7424. root.lastSuspendedTime = expirationTime;
  7425. expirationTime <= root.lastPingedTime && (root.lastPingedTime = 0);
  7426. expirationTime <= root.lastExpiredTime && (root.lastExpiredTime = 0);
  7427. }
  7428. function markRootUpdatedAtTime(root, expirationTime) {
  7429. expirationTime > root.firstPendingTime &&
  7430. (root.firstPendingTime = expirationTime);
  7431. var firstSuspendedTime = root.firstSuspendedTime;
  7432. 0 !== firstSuspendedTime &&
  7433. (expirationTime >= firstSuspendedTime
  7434. ? (root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = 0)
  7435. : expirationTime >= root.lastSuspendedTime &&
  7436. (root.lastSuspendedTime = expirationTime + 1),
  7437. expirationTime > root.nextKnownPendingLevel &&
  7438. (root.nextKnownPendingLevel = expirationTime));
  7439. }
  7440. function findHostInstance(component) {
  7441. var fiber = component._reactInternalFiber;
  7442. if (void 0 === fiber) {
  7443. if ("function" === typeof component.render)
  7444. throw Error("Unable to find node on an unmounted component.");
  7445. throw Error(
  7446. "Argument appears to not be a ReactComponent. Keys: " +
  7447. Object.keys(component)
  7448. );
  7449. }
  7450. component = findCurrentHostFiber(fiber);
  7451. return null === component ? null : component.stateNode;
  7452. }
  7453. function updateContainer(element, container, parentComponent, callback) {
  7454. var current = container.current,
  7455. currentTime = requestCurrentTimeForUpdate(),
  7456. suspenseConfig = ReactCurrentBatchConfig.suspense;
  7457. currentTime = computeExpirationForFiber(currentTime, current, suspenseConfig);
  7458. a: if (parentComponent) {
  7459. parentComponent = parentComponent._reactInternalFiber;
  7460. b: {
  7461. if (
  7462. getNearestMountedFiber(parentComponent) !== parentComponent ||
  7463. 1 !== parentComponent.tag
  7464. )
  7465. throw Error(
  7466. "Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue."
  7467. );
  7468. var parentContext = parentComponent;
  7469. do {
  7470. switch (parentContext.tag) {
  7471. case 3:
  7472. parentContext = parentContext.stateNode.context;
  7473. break b;
  7474. case 1:
  7475. if (isContextProvider(parentContext.type)) {
  7476. parentContext =
  7477. parentContext.stateNode
  7478. .__reactInternalMemoizedMergedChildContext;
  7479. break b;
  7480. }
  7481. }
  7482. parentContext = parentContext.return;
  7483. } while (null !== parentContext);
  7484. throw Error(
  7485. "Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue."
  7486. );
  7487. }
  7488. if (1 === parentComponent.tag) {
  7489. var Component = parentComponent.type;
  7490. if (isContextProvider(Component)) {
  7491. parentComponent = processChildContext(
  7492. parentComponent,
  7493. Component,
  7494. parentContext
  7495. );
  7496. break a;
  7497. }
  7498. }
  7499. parentComponent = parentContext;
  7500. } else parentComponent = emptyContextObject;
  7501. null === container.context
  7502. ? (container.context = parentComponent)
  7503. : (container.pendingContext = parentComponent);
  7504. container = createUpdate(currentTime, suspenseConfig);
  7505. container.payload = { element: element };
  7506. callback = void 0 === callback ? null : callback;
  7507. null !== callback && (container.callback = callback);
  7508. enqueueUpdate(current, container);
  7509. scheduleWork(current, currentTime);
  7510. return currentTime;
  7511. }
  7512. function createPortal(children, containerInfo, implementation) {
  7513. var key =
  7514. 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
  7515. return {
  7516. $$typeof: REACT_PORTAL_TYPE,
  7517. key: null == key ? null : "" + key,
  7518. children: children,
  7519. containerInfo: containerInfo,
  7520. implementation: implementation
  7521. };
  7522. }
  7523. function findNodeHandle(componentOrHandle) {
  7524. if (null == componentOrHandle) return null;
  7525. if ("number" === typeof componentOrHandle) return componentOrHandle;
  7526. if (componentOrHandle._nativeTag) return componentOrHandle._nativeTag;
  7527. if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag)
  7528. return componentOrHandle.canonical._nativeTag;
  7529. componentOrHandle = findHostInstance(componentOrHandle);
  7530. return null == componentOrHandle
  7531. ? componentOrHandle
  7532. : componentOrHandle.canonical
  7533. ? componentOrHandle.canonical._nativeTag
  7534. : componentOrHandle._nativeTag;
  7535. }
  7536. function unmountComponentAtNode(containerTag) {
  7537. var root = roots.get(containerTag);
  7538. root &&
  7539. updateContainer(null, root, null, function() {
  7540. roots.delete(containerTag);
  7541. });
  7542. }
  7543. batchedUpdatesImpl = function(fn, a) {
  7544. var prevExecutionContext = executionContext;
  7545. executionContext |= 1;
  7546. try {
  7547. return fn(a);
  7548. } finally {
  7549. (executionContext = prevExecutionContext),
  7550. executionContext === NoContext && flushSyncCallbackQueue();
  7551. }
  7552. };
  7553. var roots = new Map();
  7554. (function(devToolsConfig) {
  7555. var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
  7556. return injectInternals({
  7557. bundleType: devToolsConfig.bundleType,
  7558. version: devToolsConfig.version,
  7559. rendererPackageName: devToolsConfig.rendererPackageName,
  7560. rendererConfig: devToolsConfig.rendererConfig,
  7561. overrideHookState: null,
  7562. overrideProps: null,
  7563. setSuspenseHandler: null,
  7564. scheduleUpdate: null,
  7565. currentDispatcherRef: ReactSharedInternals.ReactCurrentDispatcher,
  7566. findHostInstanceByFiber: function(fiber) {
  7567. fiber = findCurrentHostFiber(fiber);
  7568. return null === fiber ? null : fiber.stateNode;
  7569. },
  7570. findFiberByHostInstance: function(instance) {
  7571. return findFiberByHostInstance ? findFiberByHostInstance(instance) : null;
  7572. },
  7573. findHostInstancesForRefresh: null,
  7574. scheduleRefresh: null,
  7575. scheduleRoot: null,
  7576. setRefreshHandler: null,
  7577. getCurrentFiber: null
  7578. });
  7579. })({
  7580. findFiberByHostInstance: getInstanceFromTag,
  7581. bundleType: 0,
  7582. version: "16.13.0",
  7583. rendererPackageName: "react-native-renderer",
  7584. rendererConfig: {
  7585. getInspectorDataForViewTag: function() {
  7586. throw Error(
  7587. "getInspectorDataForViewTag() is not available in production"
  7588. );
  7589. },
  7590. getInspectorDataForViewAtPoint: function() {
  7591. throw Error(
  7592. "getInspectorDataForViewAtPoint() is not available in production."
  7593. );
  7594. }.bind(null, findNodeHandle)
  7595. }
  7596. });
  7597. exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
  7598. computeComponentStackForErrorReporting: function(reactTag) {
  7599. return (reactTag = getInstanceFromTag(reactTag))
  7600. ? getStackByFiberInDevAndProd(reactTag)
  7601. : "";
  7602. }
  7603. };
  7604. exports.createPortal = function(children, containerTag) {
  7605. return createPortal(
  7606. children,
  7607. containerTag,
  7608. null,
  7609. 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null
  7610. );
  7611. };
  7612. exports.dispatchCommand = function(handle, command, args) {
  7613. null != handle._nativeTag &&
  7614. (handle._internalInstanceHandle
  7615. ? nativeFabricUIManager.dispatchCommand(
  7616. handle._internalInstanceHandle.stateNode.node,
  7617. command,
  7618. args
  7619. )
  7620. : ReactNativePrivateInterface.UIManager.dispatchViewManagerCommand(
  7621. handle._nativeTag,
  7622. command,
  7623. args
  7624. ));
  7625. };
  7626. exports.findHostInstance_DEPRECATED = function(componentOrHandle) {
  7627. if (null == componentOrHandle) return null;
  7628. if (componentOrHandle._nativeTag) return componentOrHandle;
  7629. if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag)
  7630. return componentOrHandle.canonical;
  7631. componentOrHandle = findHostInstance(componentOrHandle);
  7632. return null == componentOrHandle
  7633. ? componentOrHandle
  7634. : componentOrHandle.canonical
  7635. ? componentOrHandle.canonical
  7636. : componentOrHandle;
  7637. };
  7638. exports.findNodeHandle = findNodeHandle;
  7639. exports.render = function(element, containerTag, callback) {
  7640. var root = roots.get(containerTag);
  7641. if (!root) {
  7642. root = new FiberRootNode(containerTag, 0, !1);
  7643. var uninitializedFiber = new FiberNode(3, null, null, 0);
  7644. root.current = uninitializedFiber;
  7645. uninitializedFiber.stateNode = root;
  7646. initializeUpdateQueue(uninitializedFiber);
  7647. roots.set(containerTag, root);
  7648. }
  7649. updateContainer(element, root, null, callback);
  7650. a: if (((element = root.current), element.child))
  7651. switch (element.child.tag) {
  7652. case 5:
  7653. element = element.child.stateNode;
  7654. break a;
  7655. default:
  7656. element = element.child.stateNode;
  7657. }
  7658. else element = null;
  7659. return element;
  7660. };
  7661. exports.unmountComponentAtNode = unmountComponentAtNode;
  7662. exports.unmountComponentAtNodeAndRemoveContainer = function(containerTag) {
  7663. unmountComponentAtNode(containerTag);
  7664. ReactNativePrivateInterface.UIManager.removeRootView(containerTag);
  7665. };
  7666. exports.unstable_batchedUpdates = batchedUpdates;