1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181 |
- 'use strict';
- (function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
- typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
- (global = global || self, factory(global.ReactDOM = {}, global.React));
- }(this, (function (exports, React) { 'use strict';
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
-
-
- if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
- ReactSharedInternals.ReactCurrentDispatcher = {
- current: null
- };
- }
- if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
- ReactSharedInternals.ReactCurrentBatchConfig = {
- suspense: null
- };
- }
-
-
-
-
- function warn(format) {
- {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
- printWarning('warn', format, args);
- }
- }
- function error(format) {
- {
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- args[_key2 - 1] = arguments[_key2];
- }
- printWarning('error', format, args);
- }
- }
- function printWarning(level, format, args) {
-
-
- {
- var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0;
- if (!hasExistingStack) {
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
- var stack = ReactDebugCurrentFrame.getStackAddendum();
- if (stack !== '') {
- format += '%s';
- args = args.concat([stack]);
- }
- }
- var argsWithFormat = args.map(function (item) {
- return '' + item;
- });
- argsWithFormat.unshift('Warning: ' + format);
-
-
- Function.prototype.apply.call(console[level], console, argsWithFormat);
- try {
-
-
-
- var argIndex = 0;
- var message = 'Warning: ' + format.replace(/%s/g, function () {
- return args[argIndex++];
- });
- throw new Error(message);
- } catch (x) {}
- }
- }
- if (!React) {
- {
- throw Error( "ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM." );
- }
- }
- var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {
- var funcArgs = Array.prototype.slice.call(arguments, 3);
- try {
- func.apply(context, funcArgs);
- } catch (error) {
- this.onError(error);
- }
- };
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
- var fakeNode = document.createElement('react');
- var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {
-
-
-
-
- if (!(typeof document !== 'undefined')) {
- {
- throw Error( "The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous." );
- }
- }
- var evt = document.createEvent('Event');
-
-
-
-
-
- var didError = true;
-
-
- var windowEvent = window.event;
-
- var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event');
-
-
- var funcArgs = Array.prototype.slice.call(arguments, 3);
- function callCallback() {
-
-
-
-
- fakeNode.removeEventListener(evtType, callCallback, false);
-
-
-
- if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {
- window.event = windowEvent;
- }
- func.apply(context, funcArgs);
- didError = false;
- }
-
-
-
-
-
-
-
-
-
-
- var error;
- var didSetError = false;
- var isCrossOriginError = false;
- function handleWindowError(event) {
- error = event.error;
- didSetError = true;
- if (error === null && event.colno === 0 && event.lineno === 0) {
- isCrossOriginError = true;
- }
- if (event.defaultPrevented) {
-
-
-
- if (error != null && typeof error === 'object') {
- try {
- error._suppressLogging = true;
- } catch (inner) {
- }
- }
- }
- }
- var evtType = "react-" + (name ? name : 'invokeguardedcallback');
- window.addEventListener('error', handleWindowError);
- fakeNode.addEventListener(evtType, callCallback, false);
-
- evt.initEvent(evtType, false, false);
- fakeNode.dispatchEvent(evt);
- if (windowEventDescriptor) {
- Object.defineProperty(window, 'event', windowEventDescriptor);
- }
- if (didError) {
- if (!didSetError) {
-
- error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');
- } else if (isCrossOriginError) {
- error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');
- }
- this.onError(error);
- }
- window.removeEventListener('error', handleWindowError);
- };
- invokeGuardedCallbackImpl = invokeGuardedCallbackDev;
- }
- }
- var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
- var hasError = false;
- var caughtError = null;
- var hasRethrowError = false;
- var rethrowError = null;
- var reporter = {
- onError: function (error) {
- hasError = true;
- caughtError = error;
- }
- };
-
- function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
- hasError = false;
- caughtError = null;
- invokeGuardedCallbackImpl$1.apply(reporter, arguments);
- }
-
- function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
- invokeGuardedCallback.apply(this, arguments);
- if (hasError) {
- var error = clearCaughtError();
- if (!hasRethrowError) {
- hasRethrowError = true;
- rethrowError = error;
- }
- }
- }
-
- function rethrowCaughtError() {
- if (hasRethrowError) {
- var error = rethrowError;
- hasRethrowError = false;
- rethrowError = null;
- throw error;
- }
- }
- function hasCaughtError() {
- return hasError;
- }
- function clearCaughtError() {
- if (hasError) {
- var error = caughtError;
- hasError = false;
- caughtError = null;
- return error;
- } else {
- {
- {
- throw Error( "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- }
- }
- var getFiberCurrentPropsFromNode = null;
- var getInstanceFromNode = null;
- var getNodeFromInstance = null;
- function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {
- getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;
- getInstanceFromNode = getInstanceFromNodeImpl;
- getNodeFromInstance = getNodeFromInstanceImpl;
- {
- if (!getNodeFromInstance || !getInstanceFromNode) {
- error('EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.');
- }
- }
- }
- var validateEventDispatches;
- {
- validateEventDispatches = function (event) {
- var dispatchListeners = event._dispatchListeners;
- var dispatchInstances = event._dispatchInstances;
- var listenersIsArr = Array.isArray(dispatchListeners);
- var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
- var instancesIsArr = Array.isArray(dispatchInstances);
- var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
- if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) {
- error('EventPluginUtils: Invalid `event`.');
- }
- };
- }
-
- function executeDispatch(event, listener, inst) {
- var type = event.type || 'unknown-event';
- event.currentTarget = getNodeFromInstance(inst);
- invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
- event.currentTarget = null;
- }
-
- function executeDispatchesInOrder(event) {
- var dispatchListeners = event._dispatchListeners;
- var dispatchInstances = event._dispatchInstances;
- {
- validateEventDispatches(event);
- }
- if (Array.isArray(dispatchListeners)) {
- for (var i = 0; i < dispatchListeners.length; i++) {
- if (event.isPropagationStopped()) {
- break;
- }
- executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);
- }
- } else if (dispatchListeners) {
- executeDispatch(event, dispatchListeners, dispatchInstances);
- }
- event._dispatchListeners = null;
- event._dispatchInstances = null;
- }
- var FunctionComponent = 0;
- var ClassComponent = 1;
- var IndeterminateComponent = 2;
- var HostRoot = 3;
- var HostPortal = 4;
- var HostComponent = 5;
- var HostText = 6;
- var Fragment = 7;
- var Mode = 8;
- var ContextConsumer = 9;
- var ContextProvider = 10;
- var ForwardRef = 11;
- var Profiler = 12;
- var SuspenseComponent = 13;
- var MemoComponent = 14;
- var SimpleMemoComponent = 15;
- var LazyComponent = 16;
- var IncompleteClassComponent = 17;
- var DehydratedFragment = 18;
- var SuspenseListComponent = 19;
- var FundamentalComponent = 20;
- var ScopeComponent = 21;
- var Block = 22;
- var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
- function describeComponentFrame (name, source, ownerName) {
- var sourceInfo = '';
- if (source) {
- var path = source.fileName;
- var fileName = path.replace(BEFORE_SLASH_RE, '');
- {
-
-
- if (/^index\./.test(fileName)) {
- var match = path.match(BEFORE_SLASH_RE);
- if (match) {
- var pathBeforeSlash = match[1];
- if (pathBeforeSlash) {
- var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
- fileName = folderName + '/' + fileName;
- }
- }
- }
- }
- sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
- } else if (ownerName) {
- sourceInfo = ' (created by ' + ownerName + ')';
- }
- return '\n in ' + (name || 'Unknown') + sourceInfo;
- }
-
-
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
- var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
- function getIteratorFn(maybeIterable) {
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
- return null;
- }
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
- if (typeof maybeIterator === 'function') {
- return maybeIterator;
- }
- return null;
- }
- var Uninitialized = -1;
- var Pending = 0;
- var Resolved = 1;
- var Rejected = 2;
- function refineResolvedLazyComponent(lazyComponent) {
- return lazyComponent._status === Resolved ? lazyComponent._result : null;
- }
- function initializeLazyComponentType(lazyComponent) {
- if (lazyComponent._status === Uninitialized) {
- lazyComponent._status = Pending;
- var ctor = lazyComponent._ctor;
- var thenable = ctor();
- lazyComponent._result = thenable;
- thenable.then(function (moduleObject) {
- if (lazyComponent._status === Pending) {
- var defaultExport = moduleObject.default;
- {
- if (defaultExport === undefined) {
- error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
- }
- }
- lazyComponent._status = Resolved;
- lazyComponent._result = defaultExport;
- }
- }, function (error) {
- if (lazyComponent._status === Pending) {
- lazyComponent._status = Rejected;
- lazyComponent._result = error;
- }
- });
- }
- }
- function getWrappedName(outerType, innerType, wrapperName) {
- var functionName = innerType.displayName || innerType.name || '';
- return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
- }
- function getComponentName(type) {
- if (type == null) {
-
- return null;
- }
- {
- if (typeof type.tag === 'number') {
- error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
- }
- }
- if (typeof type === 'function') {
- return type.displayName || type.name || null;
- }
- if (typeof type === 'string') {
- return type;
- }
- switch (type) {
- case REACT_FRAGMENT_TYPE:
- return 'Fragment';
- case REACT_PORTAL_TYPE:
- return 'Portal';
- case REACT_PROFILER_TYPE:
- return "Profiler";
- case REACT_STRICT_MODE_TYPE:
- return 'StrictMode';
- case REACT_SUSPENSE_TYPE:
- return 'Suspense';
- case REACT_SUSPENSE_LIST_TYPE:
- return 'SuspenseList';
- }
- if (typeof type === 'object') {
- switch (type.$$typeof) {
- case REACT_CONTEXT_TYPE:
- return 'Context.Consumer';
- case REACT_PROVIDER_TYPE:
- return 'Context.Provider';
- case REACT_FORWARD_REF_TYPE:
- return getWrappedName(type, type.render, 'ForwardRef');
- case REACT_MEMO_TYPE:
- return getComponentName(type.type);
- case REACT_BLOCK_TYPE:
- return getComponentName(type.render);
- case REACT_LAZY_TYPE:
- {
- var thenable = type;
- var resolvedThenable = refineResolvedLazyComponent(thenable);
- if (resolvedThenable) {
- return getComponentName(resolvedThenable);
- }
- break;
- }
- }
- }
- return null;
- }
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
- function describeFiber(fiber) {
- switch (fiber.tag) {
- case HostRoot:
- case HostPortal:
- case HostText:
- case Fragment:
- case ContextProvider:
- case ContextConsumer:
- return '';
- default:
- var owner = fiber._debugOwner;
- var source = fiber._debugSource;
- var name = getComponentName(fiber.type);
- var ownerName = null;
- if (owner) {
- ownerName = getComponentName(owner.type);
- }
- return describeComponentFrame(name, source, ownerName);
- }
- }
- function getStackByFiberInDevAndProd(workInProgress) {
- var info = '';
- var node = workInProgress;
- do {
- info += describeFiber(node);
- node = node.return;
- } while (node);
- return info;
- }
- var current = null;
- var phase = null;
- function getCurrentFiberOwnerNameInDevOrNull() {
- {
- if (current === null) {
- return null;
- }
- var owner = current._debugOwner;
- if (owner !== null && typeof owner !== 'undefined') {
- return getComponentName(owner.type);
- }
- }
- return null;
- }
- function getCurrentFiberStackInDev() {
- {
- if (current === null) {
- return '';
- }
-
- return getStackByFiberInDevAndProd(current);
- }
- }
- function resetCurrentFiber() {
- {
- ReactDebugCurrentFrame.getCurrentStack = null;
- current = null;
- phase = null;
- }
- }
- function setCurrentFiber(fiber) {
- {
- ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
- current = fiber;
- phase = null;
- }
- }
- function setCurrentPhase(lifeCyclePhase) {
- {
- phase = lifeCyclePhase;
- }
- }
-
- var eventPluginOrder = null;
-
- var namesToPlugins = {};
-
- function recomputePluginOrdering() {
- if (!eventPluginOrder) {
-
- return;
- }
- for (var pluginName in namesToPlugins) {
- var pluginModule = namesToPlugins[pluginName];
- var pluginIndex = eventPluginOrder.indexOf(pluginName);
- if (!(pluginIndex > -1)) {
- {
- throw Error( "EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`." );
- }
- }
- if (plugins[pluginIndex]) {
- continue;
- }
- if (!pluginModule.extractEvents) {
- {
- throw Error( "EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not." );
- }
- }
- plugins[pluginIndex] = pluginModule;
- var publishedEvents = pluginModule.eventTypes;
- for (var eventName in publishedEvents) {
- if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {
- {
- throw Error( "EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`." );
- }
- }
- }
- }
- }
-
- function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
- if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) {
- {
- throw Error( "EventPluginRegistry: More than one plugin attempted to publish the same event name, `" + eventName + "`." );
- }
- }
- eventNameDispatchConfigs[eventName] = dispatchConfig;
- var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
- if (phasedRegistrationNames) {
- for (var phaseName in phasedRegistrationNames) {
- if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
- var phasedRegistrationName = phasedRegistrationNames[phaseName];
- publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
- }
- }
- return true;
- } else if (dispatchConfig.registrationName) {
- publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
- return true;
- }
- return false;
- }
-
- function publishRegistrationName(registrationName, pluginModule, eventName) {
- if (!!registrationNameModules[registrationName]) {
- {
- throw Error( "EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" + registrationName + "`." );
- }
- }
- registrationNameModules[registrationName] = pluginModule;
- registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
- {
- var lowerCasedName = registrationName.toLowerCase();
- possibleRegistrationNames[lowerCasedName] = registrationName;
- if (registrationName === 'onDoubleClick') {
- possibleRegistrationNames.ondblclick = registrationName;
- }
- }
- }
-
-
- var plugins = [];
-
- var eventNameDispatchConfigs = {};
-
- var registrationNameModules = {};
-
- var registrationNameDependencies = {};
-
- var possibleRegistrationNames = {} ;
-
- function injectEventPluginOrder(injectedEventPluginOrder) {
- if (!!eventPluginOrder) {
- {
- throw Error( "EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React." );
- }
- }
- eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
- recomputePluginOrdering();
- }
-
- function injectEventPluginsByName(injectedNamesToPlugins) {
- var isOrderingDirty = false;
- for (var pluginName in injectedNamesToPlugins) {
- if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
- continue;
- }
- var pluginModule = injectedNamesToPlugins[pluginName];
- if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
- if (!!namesToPlugins[pluginName]) {
- {
- throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName + "`." );
- }
- }
- namesToPlugins[pluginName] = pluginModule;
- isOrderingDirty = true;
- }
- }
- if (isOrderingDirty) {
- recomputePluginOrdering();
- }
- }
- var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
- var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
- var _assign = ReactInternals.assign;
- var PLUGIN_EVENT_SYSTEM = 1;
- var IS_REPLAYED = 1 << 5;
- var IS_FIRST_ANCESTOR = 1 << 6;
- var restoreImpl = null;
- var restoreTarget = null;
- var restoreQueue = null;
- function restoreStateOfTarget(target) {
-
-
- var internalInstance = getInstanceFromNode(target);
- if (!internalInstance) {
-
- return;
- }
- if (!(typeof restoreImpl === 'function')) {
- {
- throw Error( "setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- var stateNode = internalInstance.stateNode;
- if (stateNode) {
- var _props = getFiberCurrentPropsFromNode(stateNode);
- restoreImpl(internalInstance.stateNode, internalInstance.type, _props);
- }
- }
- function setRestoreImplementation(impl) {
- restoreImpl = impl;
- }
- function enqueueStateRestore(target) {
- if (restoreTarget) {
- if (restoreQueue) {
- restoreQueue.push(target);
- } else {
- restoreQueue = [target];
- }
- } else {
- restoreTarget = target;
- }
- }
- function needsStateRestore() {
- return restoreTarget !== null || restoreQueue !== null;
- }
- function restoreStateIfNeeded() {
- if (!restoreTarget) {
- return;
- }
- var target = restoreTarget;
- var queuedTargets = restoreQueue;
- restoreTarget = null;
- restoreQueue = null;
- restoreStateOfTarget(target);
- if (queuedTargets) {
- for (var i = 0; i < queuedTargets.length; i++) {
- restoreStateOfTarget(queuedTargets[i]);
- }
- }
- }
- var enableProfilerTimer = true;
- var enableDeprecatedFlareAPI = false;
- var enableFundamentalAPI = false;
- var warnAboutStringRefs = false;
-
-
-
-
-
- var batchedUpdatesImpl = function (fn, bookkeeping) {
- return fn(bookkeeping);
- };
- var discreteUpdatesImpl = function (fn, a, b, c, d) {
- return fn(a, b, c, d);
- };
- var flushDiscreteUpdatesImpl = function () {};
- var batchedEventUpdatesImpl = batchedUpdatesImpl;
- var isInsideEventHandler = false;
- var isBatchingEventUpdates = false;
- function finishEventHandler() {
-
-
-
-
- var controlledComponentsHavePendingUpdates = needsStateRestore();
- if (controlledComponentsHavePendingUpdates) {
-
-
-
- flushDiscreteUpdatesImpl();
- restoreStateIfNeeded();
- }
- }
- function batchedUpdates(fn, bookkeeping) {
- if (isInsideEventHandler) {
-
-
- return fn(bookkeeping);
- }
- isInsideEventHandler = true;
- try {
- return batchedUpdatesImpl(fn, bookkeeping);
- } finally {
- isInsideEventHandler = false;
- finishEventHandler();
- }
- }
- function batchedEventUpdates(fn, a, b) {
- if (isBatchingEventUpdates) {
-
-
- return fn(a, b);
- }
- isBatchingEventUpdates = true;
- try {
- return batchedEventUpdatesImpl(fn, a, b);
- } finally {
- isBatchingEventUpdates = false;
- finishEventHandler();
- }
- }
- function discreteUpdates(fn, a, b, c, d) {
- var prevIsInsideEventHandler = isInsideEventHandler;
- isInsideEventHandler = true;
- try {
- return discreteUpdatesImpl(fn, a, b, c, d);
- } finally {
- isInsideEventHandler = prevIsInsideEventHandler;
- if (!isInsideEventHandler) {
- finishEventHandler();
- }
- }
- }
- function flushDiscreteUpdatesIfNeeded(timeStamp) {
-
-
-
-
-
-
-
-
-
-
-
-
- if (!isInsideEventHandler && (!enableDeprecatedFlareAPI )) {
- flushDiscreteUpdatesImpl();
- }
- }
- function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {
- batchedUpdatesImpl = _batchedUpdatesImpl;
- discreteUpdatesImpl = _discreteUpdatesImpl;
- flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;
- batchedEventUpdatesImpl = _batchedEventUpdatesImpl;
- }
- var DiscreteEvent = 0;
- var UserBlockingEvent = 1;
- var ContinuousEvent = 2;
- var ReactInternals$1 = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
- var _ReactInternals$Sched = ReactInternals$1.Scheduler,
- unstable_cancelCallback = _ReactInternals$Sched.unstable_cancelCallback,
- unstable_now = _ReactInternals$Sched.unstable_now,
- unstable_scheduleCallback = _ReactInternals$Sched.unstable_scheduleCallback,
- unstable_shouldYield = _ReactInternals$Sched.unstable_shouldYield,
- unstable_requestPaint = _ReactInternals$Sched.unstable_requestPaint,
- unstable_getFirstCallbackNode = _ReactInternals$Sched.unstable_getFirstCallbackNode,
- unstable_runWithPriority = _ReactInternals$Sched.unstable_runWithPriority,
- unstable_next = _ReactInternals$Sched.unstable_next,
- unstable_continueExecution = _ReactInternals$Sched.unstable_continueExecution,
- unstable_pauseExecution = _ReactInternals$Sched.unstable_pauseExecution,
- unstable_getCurrentPriorityLevel = _ReactInternals$Sched.unstable_getCurrentPriorityLevel,
- unstable_ImmediatePriority = _ReactInternals$Sched.unstable_ImmediatePriority,
- unstable_UserBlockingPriority = _ReactInternals$Sched.unstable_UserBlockingPriority,
- unstable_NormalPriority = _ReactInternals$Sched.unstable_NormalPriority,
- unstable_LowPriority = _ReactInternals$Sched.unstable_LowPriority,
- unstable_IdlePriority = _ReactInternals$Sched.unstable_IdlePriority,
- unstable_forceFrameRate = _ReactInternals$Sched.unstable_forceFrameRate,
- unstable_flushAllWithoutAsserting = _ReactInternals$Sched.unstable_flushAllWithoutAsserting;
-
-
- var RESERVED = 0;
-
- var STRING = 1;
-
-
-
- var BOOLEANISH_STRING = 2;
-
-
- var BOOLEAN = 3;
-
-
-
- var OVERLOADED_BOOLEAN = 4;
-
- var NUMERIC = 5;
-
- var POSITIVE_NUMERIC = 6;
-
- var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
-
- var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
- var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
- var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var illegalAttributeNameCache = {};
- var validatedAttributeNameCache = {};
- function isAttributeNameSafe(attributeName) {
- if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
- return true;
- }
- if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
- return false;
- }
- if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
- validatedAttributeNameCache[attributeName] = true;
- return true;
- }
- illegalAttributeNameCache[attributeName] = true;
- {
- error('Invalid attribute name: `%s`', attributeName);
- }
- return false;
- }
- function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
- if (propertyInfo !== null) {
- return propertyInfo.type === RESERVED;
- }
- if (isCustomComponentTag) {
- return false;
- }
- if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
- return true;
- }
- return false;
- }
- function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
- if (propertyInfo !== null && propertyInfo.type === RESERVED) {
- return false;
- }
- switch (typeof value) {
- case 'function':
- case 'symbol':
-
- return true;
- case 'boolean':
- {
- if (isCustomComponentTag) {
- return false;
- }
- if (propertyInfo !== null) {
- return !propertyInfo.acceptsBooleans;
- } else {
- var prefix = name.toLowerCase().slice(0, 5);
- return prefix !== 'data-' && prefix !== 'aria-';
- }
- }
- default:
- return false;
- }
- }
- function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
- if (value === null || typeof value === 'undefined') {
- return true;
- }
- if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
- return true;
- }
- if (isCustomComponentTag) {
- return false;
- }
- if (propertyInfo !== null) {
- switch (propertyInfo.type) {
- case BOOLEAN:
- return !value;
- case OVERLOADED_BOOLEAN:
- return value === false;
- case NUMERIC:
- return isNaN(value);
- case POSITIVE_NUMERIC:
- return isNaN(value) || value < 1;
- }
- }
- return false;
- }
- function getPropertyInfo(name) {
- return properties.hasOwnProperty(name) ? properties[name] : null;
- }
- function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) {
- this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
- this.attributeName = attributeName;
- this.attributeNamespace = attributeNamespace;
- this.mustUseProperty = mustUseProperty;
- this.propertyName = name;
- this.type = type;
- this.sanitizeURL = sanitizeURL;
- }
-
-
- var properties = {};
- var reservedProps = ['children', 'dangerouslySetInnerHTML',
-
-
- 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];
- reservedProps.forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, RESERVED, false,
- name,
- null,
- false);
- });
-
- [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
- var name = _ref[0],
- attributeName = _ref[1];
- properties[name] = new PropertyInfoRecord(name, STRING, false,
- attributeName,
- null,
- false);
- });
-
-
- ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false,
- name.toLowerCase(),
- null,
- false);
- });
-
-
-
- ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false,
- name,
- null,
- false);
- });
- ['allowFullScreen', 'async',
-
- 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless',
- 'itemScope'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, BOOLEAN, false,
- name.toLowerCase(),
- null,
- false);
- });
-
- ['checked',
-
- 'multiple', 'muted', 'selected'
-
-
- ].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, BOOLEAN, true,
- name,
- null,
- false);
- });
-
- ['capture', 'download'
-
-
- ].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false,
- name,
- null,
- false);
- });
- ['cols', 'rows', 'size', 'span'
-
-
- ].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false,
- name,
- null,
- false);
- });
- ['rowSpan', 'start'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, NUMERIC, false,
- name.toLowerCase(),
- null,
- false);
- });
- var CAMELIZE = /[\-\:]([a-z])/g;
- var capitalize = function (token) {
- return token[1].toUpperCase();
- };
-
-
-
-
- ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'
-
-
- ].forEach(function (attributeName) {
- var name = attributeName.replace(CAMELIZE, capitalize);
- properties[name] = new PropertyInfoRecord(name, STRING, false,
- attributeName, null,
- false);
- });
- ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'
-
-
- ].forEach(function (attributeName) {
- var name = attributeName.replace(CAMELIZE, capitalize);
- properties[name] = new PropertyInfoRecord(name, STRING, false,
- attributeName, 'http://www.w3.org/1999/xlink', false);
- });
- ['xml:base', 'xml:lang', 'xml:space'
-
-
- ].forEach(function (attributeName) {
- var name = attributeName.replace(CAMELIZE, capitalize);
- properties[name] = new PropertyInfoRecord(name, STRING, false,
- attributeName, 'http://www.w3.org/XML/1998/namespace', false);
- });
-
-
- ['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
- properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false,
- attributeName.toLowerCase(),
- null,
- false);
- });
-
- var xlinkHref = 'xlinkHref';
- properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false,
- 'xlink:href', 'http://www.w3.org/1999/xlink', true);
- ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
- properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false,
- attributeName.toLowerCase(),
- null,
- true);
- });
- var ReactDebugCurrentFrame$1 = null;
- {
- ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
- }
-
-
-
-
-
-
-
-
- var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
- var didWarn = false;
- function sanitizeURL(url) {
- {
- if (!didWarn && isJavaScriptProtocol.test(url)) {
- didWarn = true;
- error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));
- }
- }
- }
-
- function getValueForProperty(node, name, expected, propertyInfo) {
- {
- if (propertyInfo.mustUseProperty) {
- var propertyName = propertyInfo.propertyName;
- return node[propertyName];
- } else {
- if ( propertyInfo.sanitizeURL) {
-
-
-
- sanitizeURL('' + expected);
- }
- var attributeName = propertyInfo.attributeName;
- var stringValue = null;
- if (propertyInfo.type === OVERLOADED_BOOLEAN) {
- if (node.hasAttribute(attributeName)) {
- var value = node.getAttribute(attributeName);
- if (value === '') {
- return true;
- }
- if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
- return value;
- }
- if (value === '' + expected) {
- return expected;
- }
- return value;
- }
- } else if (node.hasAttribute(attributeName)) {
- if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
-
-
- return node.getAttribute(attributeName);
- }
- if (propertyInfo.type === BOOLEAN) {
-
-
- return expected;
- }
-
-
-
- stringValue = node.getAttribute(attributeName);
- }
- if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
- return stringValue === null ? expected : stringValue;
- } else if (stringValue === '' + expected) {
- return expected;
- } else {
- return stringValue;
- }
- }
- }
- }
-
- function getValueForAttribute(node, name, expected) {
- {
- if (!isAttributeNameSafe(name)) {
- return;
- }
- if (!node.hasAttribute(name)) {
- return expected === undefined ? undefined : null;
- }
- var value = node.getAttribute(name);
- if (value === '' + expected) {
- return expected;
- }
- return value;
- }
- }
-
- function setValueForProperty(node, name, value, isCustomComponentTag) {
- var propertyInfo = getPropertyInfo(name);
- if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
- return;
- }
- if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
- value = null;
- }
- if (isCustomComponentTag || propertyInfo === null) {
- if (isAttributeNameSafe(name)) {
- var _attributeName = name;
- if (value === null) {
- node.removeAttribute(_attributeName);
- } else {
- node.setAttribute(_attributeName, '' + value);
- }
- }
- return;
- }
- var mustUseProperty = propertyInfo.mustUseProperty;
- if (mustUseProperty) {
- var propertyName = propertyInfo.propertyName;
- if (value === null) {
- var type = propertyInfo.type;
- node[propertyName] = type === BOOLEAN ? false : '';
- } else {
-
-
- node[propertyName] = value;
- }
- return;
- }
- var attributeName = propertyInfo.attributeName,
- attributeNamespace = propertyInfo.attributeNamespace;
- if (value === null) {
- node.removeAttribute(attributeName);
- } else {
- var _type = propertyInfo.type;
- var attributeValue;
- if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
-
-
- attributeValue = '';
- } else {
-
-
- {
- attributeValue = '' + value;
- }
- if (propertyInfo.sanitizeURL) {
- sanitizeURL(attributeValue.toString());
- }
- }
- if (attributeNamespace) {
- node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
- } else {
- node.setAttribute(attributeName, attributeValue);
- }
- }
- }
-
-
-
- function toString(value) {
- return '' + value;
- }
- function getToStringValue(value) {
- switch (typeof value) {
- case 'boolean':
- case 'number':
- case 'object':
- case 'string':
- case 'undefined':
- return value;
- default:
-
- return '';
- }
- }
-
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
- var ReactPropTypesSecret_1 = ReactPropTypesSecret;
- var printWarning$1 = function() {};
- {
- var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
- var loggedTypeFailures = {};
- var has = Function.call.bind(Object.prototype.hasOwnProperty);
- printWarning$1 = function(text) {
- var message = 'Warning: ' + text;
- if (typeof console !== 'undefined') {
- console.error(message);
- }
- try {
-
-
-
- throw new Error(message);
- } catch (x) {}
- };
- }
-
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
- {
- for (var typeSpecName in typeSpecs) {
- if (has(typeSpecs, typeSpecName)) {
- var error;
-
-
-
- try {
-
-
- if (typeof typeSpecs[typeSpecName] !== 'function') {
- var err = Error(
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
- );
- err.name = 'Invariant Violation';
- throw err;
- }
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
- } catch (ex) {
- error = ex;
- }
- if (error && !(error instanceof Error)) {
- printWarning$1(
- (componentName || 'React class') + ': type specification of ' +
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
- 'You may have forgotten to pass an argument to the type checker ' +
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
- 'shape all require an argument).'
- );
- }
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
-
-
- loggedTypeFailures[error.message] = true;
- var stack = getStack ? getStack() : '';
- printWarning$1(
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
- );
- }
- }
- }
- }
- }
-
- checkPropTypes.resetWarningCache = function() {
- {
- loggedTypeFailures = {};
- }
- };
- var checkPropTypes_1 = checkPropTypes;
- var ReactDebugCurrentFrame$2 = null;
- var ReactControlledValuePropTypes = {
- checkPropTypes: null
- };
- {
- ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
- var hasReadOnlyValue = {
- button: true,
- checkbox: true,
- image: true,
- hidden: true,
- radio: true,
- reset: true,
- submit: true
- };
- var propTypes = {
- value: function (props, propName, componentName) {
- if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {
- return null;
- }
- return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
- },
- checked: function (props, propName, componentName) {
- if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableDeprecatedFlareAPI ) {
- return null;
- }
- return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
- }
- };
-
- ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
- checkPropTypes_1(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);
- };
- }
- function isCheckable(elem) {
- var type = elem.type;
- var nodeName = elem.nodeName;
- return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
- }
- function getTracker(node) {
- return node._valueTracker;
- }
- function detachTracker(node) {
- node._valueTracker = null;
- }
- function getValueFromNode(node) {
- var value = '';
- if (!node) {
- return value;
- }
- if (isCheckable(node)) {
- value = node.checked ? 'true' : 'false';
- } else {
- value = node.value;
- }
- return value;
- }
- function trackValueOnNode(node) {
- var valueField = isCheckable(node) ? 'checked' : 'value';
- var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
- var currentValue = '' + node[valueField];
-
-
-
- if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
- return;
- }
- var get = descriptor.get,
- set = descriptor.set;
- Object.defineProperty(node, valueField, {
- configurable: true,
- get: function () {
- return get.call(this);
- },
- set: function (value) {
- currentValue = '' + value;
- set.call(this, value);
- }
- }); // We could've passed this the first time
- // but it triggers a bug in IE11 and Edge 14/15.
- // Calling defineProperty() again should be equivalent.
- // https://github.com/facebook/react/issues/11768
- Object.defineProperty(node, valueField, {
- enumerable: descriptor.enumerable
- });
- var tracker = {
- getValue: function () {
- return currentValue;
- },
- setValue: function (value) {
- currentValue = '' + value;
- },
- stopTracking: function () {
- detachTracker(node);
- delete node[valueField];
- }
- };
- return tracker;
- }
- function track(node) {
- if (getTracker(node)) {
- return;
- }
- node._valueTracker = trackValueOnNode(node);
- }
- function updateValueIfChanged(node) {
- if (!node) {
- return false;
- }
- var tracker = getTracker(node);
-
- if (!tracker) {
- return true;
- }
- var lastValue = tracker.getValue();
- var nextValue = getValueFromNode(node);
- if (nextValue !== lastValue) {
- tracker.setValue(nextValue);
- return true;
- }
- return false;
- }
- var didWarnValueDefaultValue = false;
- var didWarnCheckedDefaultChecked = false;
- var didWarnControlledToUncontrolled = false;
- var didWarnUncontrolledToControlled = false;
- function isControlled(props) {
- var usesChecked = props.type === 'checkbox' || props.type === 'radio';
- return usesChecked ? props.checked != null : props.value != null;
- }
-
- function getHostProps(element, props) {
- var node = element;
- var checked = props.checked;
- var hostProps = _assign({}, props, {
- defaultChecked: undefined,
- defaultValue: undefined,
- value: undefined,
- checked: checked != null ? checked : node._wrapperState.initialChecked
- });
- return hostProps;
- }
- function initWrapperState(element, props) {
- {
- ReactControlledValuePropTypes.checkPropTypes('input', props);
- if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
- error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
- didWarnCheckedDefaultChecked = true;
- }
- if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
- error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
- didWarnValueDefaultValue = true;
- }
- }
- var node = element;
- var defaultValue = props.defaultValue == null ? '' : props.defaultValue;
- node._wrapperState = {
- initialChecked: props.checked != null ? props.checked : props.defaultChecked,
- initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
- controlled: isControlled(props)
- };
- }
- function updateChecked(element, props) {
- var node = element;
- var checked = props.checked;
- if (checked != null) {
- setValueForProperty(node, 'checked', checked, false);
- }
- }
- function updateWrapper(element, props) {
- var node = element;
- {
- var controlled = isControlled(props);
- if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
- error('A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
- didWarnUncontrolledToControlled = true;
- }
- if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
- error('A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
- didWarnControlledToUncontrolled = true;
- }
- }
- updateChecked(element, props);
- var value = getToStringValue(props.value);
- var type = props.type;
- if (value != null) {
- if (type === 'number') {
- if (value === 0 && node.value === '' ||
-
- node.value != value) {
- node.value = toString(value);
- }
- } else if (node.value !== toString(value)) {
- node.value = toString(value);
- }
- } else if (type === 'submit' || type === 'reset') {
-
-
- node.removeAttribute('value');
- return;
- }
- {
-
-
-
-
-
- if (props.hasOwnProperty('value')) {
- setDefaultValue(node, props.type, value);
- } else if (props.hasOwnProperty('defaultValue')) {
- setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
- }
- }
- {
-
-
- if (props.checked == null && props.defaultChecked != null) {
- node.defaultChecked = !!props.defaultChecked;
- }
- }
- }
- function postMountWrapper(element, props, isHydrating) {
- var node = element;
-
- if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {
- var type = props.type;
- var isButton = type === 'submit' || type === 'reset';
-
- if (isButton && (props.value === undefined || props.value === null)) {
- return;
- }
- var initialValue = toString(node._wrapperState.initialValue);
-
- if (!isHydrating) {
- {
-
-
-
-
-
-
- if (initialValue !== node.value) {
- node.value = initialValue;
- }
- }
- }
- {
-
-
-
- node.defaultValue = initialValue;
- }
- }
-
-
-
-
- var name = node.name;
- if (name !== '') {
- node.name = '';
- }
- {
-
-
-
-
-
-
- node.defaultChecked = !node.defaultChecked;
- node.defaultChecked = !!node._wrapperState.initialChecked;
- }
- if (name !== '') {
- node.name = name;
- }
- }
- function restoreControlledState(element, props) {
- var node = element;
- updateWrapper(node, props);
- updateNamedCousins(node, props);
- }
- function updateNamedCousins(rootNode, props) {
- var name = props.name;
- if (props.type === 'radio' && name != null) {
- var queryRoot = rootNode;
- while (queryRoot.parentNode) {
- queryRoot = queryRoot.parentNode;
- }
-
-
-
-
-
-
- var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
- for (var i = 0; i < group.length; i++) {
- var otherNode = group[i];
- if (otherNode === rootNode || otherNode.form !== rootNode.form) {
- continue;
- }
-
-
-
- var otherProps = getFiberCurrentPropsFromNode$1(otherNode);
- if (!otherProps) {
- {
- throw Error( "ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported." );
- }
- }
-
- updateValueIfChanged(otherNode);
-
-
- updateWrapper(otherNode, otherProps);
- }
- }
- }
-
-
-
-
-
-
-
- function setDefaultValue(node, type, value) {
- if (
- type !== 'number' || node.ownerDocument.activeElement !== node) {
- if (value == null) {
- node.defaultValue = toString(node._wrapperState.initialValue);
- } else if (node.defaultValue !== toString(value)) {
- node.defaultValue = toString(value);
- }
- }
- }
- var didWarnSelectedSetOnOption = false;
- var didWarnInvalidChild = false;
- function flattenChildren(children) {
- var content = '';
-
-
-
-
- React.Children.forEach(children, function (child) {
- if (child == null) {
- return;
- }
- content += child;
-
-
- });
- return content;
- }
-
- function validateProps(element, props) {
- {
-
-
-
-
- if (typeof props.children === 'object' && props.children !== null) {
- React.Children.forEach(props.children, function (child) {
- if (child == null) {
- return;
- }
- if (typeof child === 'string' || typeof child === 'number') {
- return;
- }
- if (typeof child.type !== 'string') {
- return;
- }
- if (!didWarnInvalidChild) {
- didWarnInvalidChild = true;
- error('Only strings and numbers are supported as <option> children.');
- }
- });
- }
- if (props.selected != null && !didWarnSelectedSetOnOption) {
- error('Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');
- didWarnSelectedSetOnOption = true;
- }
- }
- }
- function postMountWrapper$1(element, props) {
-
- if (props.value != null) {
- element.setAttribute('value', toString(getToStringValue(props.value)));
- }
- }
- function getHostProps$1(element, props) {
- var hostProps = _assign({
- children: undefined
- }, props);
- var content = flattenChildren(props.children);
- if (content) {
- hostProps.children = content;
- }
- return hostProps;
- }
- var didWarnValueDefaultValue$1;
- {
- didWarnValueDefaultValue$1 = false;
- }
- function getDeclarationErrorAddendum() {
- var ownerName = getCurrentFiberOwnerNameInDevOrNull();
- if (ownerName) {
- return '\n\nCheck the render method of `' + ownerName + '`.';
- }
- return '';
- }
- var valuePropNames = ['value', 'defaultValue'];
-
- function checkSelectPropTypes(props) {
- {
- ReactControlledValuePropTypes.checkPropTypes('select', props);
- for (var i = 0; i < valuePropNames.length; i++) {
- var propName = valuePropNames[i];
- if (props[propName] == null) {
- continue;
- }
- var isArray = Array.isArray(props[propName]);
- if (props.multiple && !isArray) {
- error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());
- } else if (!props.multiple && isArray) {
- error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());
- }
- }
- }
- }
- function updateOptions(node, multiple, propValue, setDefaultSelected) {
- var options = node.options;
- if (multiple) {
- var selectedValues = propValue;
- var selectedValue = {};
- for (var i = 0; i < selectedValues.length; i++) {
-
- selectedValue['$' + selectedValues[i]] = true;
- }
- for (var _i = 0; _i < options.length; _i++) {
- var selected = selectedValue.hasOwnProperty('$' + options[_i].value);
- if (options[_i].selected !== selected) {
- options[_i].selected = selected;
- }
- if (selected && setDefaultSelected) {
- options[_i].defaultSelected = true;
- }
- }
- } else {
-
-
- var _selectedValue = toString(getToStringValue(propValue));
- var defaultSelected = null;
- for (var _i2 = 0; _i2 < options.length; _i2++) {
- if (options[_i2].value === _selectedValue) {
- options[_i2].selected = true;
- if (setDefaultSelected) {
- options[_i2].defaultSelected = true;
- }
- return;
- }
- if (defaultSelected === null && !options[_i2].disabled) {
- defaultSelected = options[_i2];
- }
- }
- if (defaultSelected !== null) {
- defaultSelected.selected = true;
- }
- }
- }
-
- function getHostProps$2(element, props) {
- return _assign({}, props, {
- value: undefined
- });
- }
- function initWrapperState$1(element, props) {
- var node = element;
- {
- checkSelectPropTypes(props);
- }
- node._wrapperState = {
- wasMultiple: !!props.multiple
- };
- {
- if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {
- error('Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
- didWarnValueDefaultValue$1 = true;
- }
- }
- }
- function postMountWrapper$2(element, props) {
- var node = element;
- node.multiple = !!props.multiple;
- var value = props.value;
- if (value != null) {
- updateOptions(node, !!props.multiple, value, false);
- } else if (props.defaultValue != null) {
- updateOptions(node, !!props.multiple, props.defaultValue, true);
- }
- }
- function postUpdateWrapper(element, props) {
- var node = element;
- var wasMultiple = node._wrapperState.wasMultiple;
- node._wrapperState.wasMultiple = !!props.multiple;
- var value = props.value;
- if (value != null) {
- updateOptions(node, !!props.multiple, value, false);
- } else if (wasMultiple !== !!props.multiple) {
-
- if (props.defaultValue != null) {
- updateOptions(node, !!props.multiple, props.defaultValue, true);
- } else {
-
- updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);
- }
- }
- }
- function restoreControlledState$1(element, props) {
- var node = element;
- var value = props.value;
- if (value != null) {
- updateOptions(node, !!props.multiple, value, false);
- }
- }
- var didWarnValDefaultVal = false;
-
- function getHostProps$3(element, props) {
- var node = element;
- if (!(props.dangerouslySetInnerHTML == null)) {
- {
- throw Error( "`dangerouslySetInnerHTML` does not make sense on <textarea>." );
- }
- }
-
-
-
-
-
- var hostProps = _assign({}, props, {
- value: undefined,
- defaultValue: undefined,
- children: toString(node._wrapperState.initialValue)
- });
- return hostProps;
- }
- function initWrapperState$2(element, props) {
- var node = element;
- {
- ReactControlledValuePropTypes.checkPropTypes('textarea', props);
- if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
- error('%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
- didWarnValDefaultVal = true;
- }
- }
- var initialValue = props.value;
- if (initialValue == null) {
- var children = props.children,
- defaultValue = props.defaultValue;
- if (children != null) {
- {
- error('Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
- }
- {
- if (!(defaultValue == null)) {
- {
- throw Error( "If you supply `defaultValue` on a <textarea>, do not pass children." );
- }
- }
- if (Array.isArray(children)) {
- if (!(children.length <= 1)) {
- {
- throw Error( "<textarea> can only have at most one child." );
- }
- }
- children = children[0];
- }
- defaultValue = children;
- }
- }
- if (defaultValue == null) {
- defaultValue = '';
- }
- initialValue = defaultValue;
- }
- node._wrapperState = {
- initialValue: getToStringValue(initialValue)
- };
- }
- function updateWrapper$1(element, props) {
- var node = element;
- var value = getToStringValue(props.value);
- var defaultValue = getToStringValue(props.defaultValue);
- if (value != null) {
-
-
- var newValue = toString(value);
- if (newValue !== node.value) {
- node.value = newValue;
- }
- if (props.defaultValue == null && node.defaultValue !== newValue) {
- node.defaultValue = newValue;
- }
- }
- if (defaultValue != null) {
- node.defaultValue = toString(defaultValue);
- }
- }
- function postMountWrapper$3(element, props) {
- var node = element;
-
- var textContent = node.textContent;
-
-
-
- if (textContent === node._wrapperState.initialValue) {
- if (textContent !== '' && textContent !== null) {
- node.value = textContent;
- }
- }
- }
- function restoreControlledState$2(element, props) {
-
- updateWrapper$1(element, props);
- }
- var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
- var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
- var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
- var Namespaces = {
- html: HTML_NAMESPACE,
- mathml: MATH_NAMESPACE,
- svg: SVG_NAMESPACE
- };
- function getIntrinsicNamespace(type) {
- switch (type) {
- case 'svg':
- return SVG_NAMESPACE;
- case 'math':
- return MATH_NAMESPACE;
- default:
- return HTML_NAMESPACE;
- }
- }
- function getChildNamespace(parentNamespace, type) {
- if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
-
- return getIntrinsicNamespace(type);
- }
- if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
-
- return HTML_NAMESPACE;
- }
- return parentNamespace;
- }
-
-
- var createMicrosoftUnsafeLocalFunction = function (func) {
- if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
- return function (arg0, arg1, arg2, arg3) {
- MSApp.execUnsafeLocalFunction(function () {
- return func(arg0, arg1, arg2, arg3);
- });
- };
- } else {
- return func;
- }
- };
- var reusableSVGContainer;
-
- var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
- if (node.namespaceURI === Namespaces.svg) {
- if (!('innerHTML' in node)) {
-
-
-
- reusableSVGContainer = reusableSVGContainer || document.createElement('div');
- reusableSVGContainer.innerHTML = '<svg>' + html.valueOf().toString() + '</svg>';
- var svgNode = reusableSVGContainer.firstChild;
- while (node.firstChild) {
- node.removeChild(node.firstChild);
- }
- while (svgNode.firstChild) {
- node.appendChild(svgNode.firstChild);
- }
- return;
- }
- }
- node.innerHTML = html;
- });
-
- var ELEMENT_NODE = 1;
- var TEXT_NODE = 3;
- var COMMENT_NODE = 8;
- var DOCUMENT_NODE = 9;
- var DOCUMENT_FRAGMENT_NODE = 11;
-
- var setTextContent = function (node, text) {
- if (text) {
- var firstChild = node.firstChild;
- if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
- firstChild.nodeValue = text;
- return;
- }
- }
- node.textContent = text;
- };
-
-
-
- function unsafeCastStringToDOMTopLevelType(topLevelType) {
- return topLevelType;
- }
- function unsafeCastDOMTopLevelTypeToString(topLevelType) {
- return topLevelType;
- }
-
- function makePrefixMap(styleProp, eventName) {
- var prefixes = {};
- prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
- prefixes['Webkit' + styleProp] = 'webkit' + eventName;
- prefixes['Moz' + styleProp] = 'moz' + eventName;
- return prefixes;
- }
-
- var vendorPrefixes = {
- animationend: makePrefixMap('Animation', 'AnimationEnd'),
- animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
- animationstart: makePrefixMap('Animation', 'AnimationStart'),
- transitionend: makePrefixMap('Transition', 'TransitionEnd')
- };
-
- var prefixedEventNames = {};
-
- var style = {};
-
- if (canUseDOM) {
- style = document.createElement('div').style;
-
-
-
- if (!('AnimationEvent' in window)) {
- delete vendorPrefixes.animationend.animation;
- delete vendorPrefixes.animationiteration.animation;
- delete vendorPrefixes.animationstart.animation;
- }
- if (!('TransitionEvent' in window)) {
- delete vendorPrefixes.transitionend.transition;
- }
- }
-
- function getVendorPrefixedEventName(eventName) {
- if (prefixedEventNames[eventName]) {
- return prefixedEventNames[eventName];
- } else if (!vendorPrefixes[eventName]) {
- return eventName;
- }
- var prefixMap = vendorPrefixes[eventName];
- for (var styleProp in prefixMap) {
- if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
- return prefixedEventNames[eventName] = prefixMap[styleProp];
- }
- }
- return eventName;
- }
-
- var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');
- var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));
- var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));
- var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));
- var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');
- var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');
- var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');
- var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');
- var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');
- var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');
- var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');
- var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');
- var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');
- var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');
- var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');
- var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');
- var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');
- var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');
- var TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick');
- var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');
- var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');
- var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');
- var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');
- var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');
- var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');
- var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');
- var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');
- var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');
- var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');
- var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');
- var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');
- var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');
- var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');
- var TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture');
- var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');
- var TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid');
- var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');
- var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');
- var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');
- var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');
- var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');
- var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');
- var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');
- var TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture');
- var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');
- var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');
- var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');
- var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');
- var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');
- var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');
- var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');
- var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');
- var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');
- var TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel');
- var TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown');
- var TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove');
- var TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout');
- var TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover');
- var TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup');
- var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');
- var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');
- var TOP_RESET = unsafeCastStringToDOMTopLevelType('reset');
- var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');
- var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');
- var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');
- var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');
- var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');
- var TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit');
- var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');
- var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');
- var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');
- var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');
- var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');
- var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');
- var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');
- var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');
- var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));
- var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');
- var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');
- var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel');
-
-
- var mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];
- function getRawEventName(topLevelType) {
- return unsafeCastDOMTopLevelTypeToString(topLevelType);
- }
- var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
- var elementListenerMap = new PossiblyWeakMap();
- function getListenerMapForElement(element) {
- var listenerMap = elementListenerMap.get(element);
- if (listenerMap === undefined) {
- listenerMap = new Map();
- elementListenerMap.set(element, listenerMap);
- }
- return listenerMap;
- }
-
- function get(key) {
- return key._reactInternalFiber;
- }
- function has$1(key) {
- return key._reactInternalFiber !== undefined;
- }
- function set(key, value) {
- key._reactInternalFiber = value;
- }
-
- var NoEffect =
-
- 0;
- var PerformedWork =
-
- 1;
- var Placement =
-
- 2;
- var Update =
-
- 4;
- var PlacementAndUpdate =
-
- 6;
- var Deletion =
-
- 8;
- var ContentReset =
-
- 16;
- var Callback =
-
- 32;
- var DidCapture =
-
- 64;
- var Ref =
-
- 128;
- var Snapshot =
-
- 256;
- var Passive =
-
- 512;
- var Hydrating =
-
- 1024;
- var HydratingAndUpdate =
-
- 1028;
- var LifecycleEffectMask =
-
- 932;
- var HostEffectMask =
-
- 2047;
- var Incomplete =
-
- 2048;
- var ShouldCapture =
-
- 4096;
- var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
- function getNearestMountedFiber(fiber) {
- var node = fiber;
- var nearestMounted = fiber;
- if (!fiber.alternate) {
-
-
- var nextNode = node;
- do {
- node = nextNode;
- if ((node.effectTag & (Placement | Hydrating)) !== NoEffect) {
-
-
-
- nearestMounted = node.return;
- }
- nextNode = node.return;
- } while (nextNode);
- } else {
- while (node.return) {
- node = node.return;
- }
- }
- if (node.tag === HostRoot) {
-
-
- return nearestMounted;
- }
-
- return null;
- }
- function getSuspenseInstanceFromFiber(fiber) {
- if (fiber.tag === SuspenseComponent) {
- var suspenseState = fiber.memoizedState;
- if (suspenseState === null) {
- var current = fiber.alternate;
- if (current !== null) {
- suspenseState = current.memoizedState;
- }
- }
- if (suspenseState !== null) {
- return suspenseState.dehydrated;
- }
- }
- return null;
- }
- function getContainerFromFiber(fiber) {
- return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;
- }
- function isFiberMounted(fiber) {
- return getNearestMountedFiber(fiber) === fiber;
- }
- function isMounted(component) {
- {
- var owner = ReactCurrentOwner.current;
- if (owner !== null && owner.tag === ClassComponent) {
- var ownerFiber = owner;
- var instance = ownerFiber.stateNode;
- if (!instance._warnedAboutRefsInRender) {
- error('%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component');
- }
- instance._warnedAboutRefsInRender = true;
- }
- }
- var fiber = get(component);
- if (!fiber) {
- return false;
- }
- return getNearestMountedFiber(fiber) === fiber;
- }
- function assertIsMounted(fiber) {
- if (!(getNearestMountedFiber(fiber) === fiber)) {
- {
- throw Error( "Unable to find node on an unmounted component." );
- }
- }
- }
- function findCurrentFiberUsingSlowPath(fiber) {
- var alternate = fiber.alternate;
- if (!alternate) {
-
- var nearestMounted = getNearestMountedFiber(fiber);
- if (!(nearestMounted !== null)) {
- {
- throw Error( "Unable to find node on an unmounted component." );
- }
- }
- if (nearestMounted !== fiber) {
- return null;
- }
- return fiber;
- }
-
-
- var a = fiber;
- var b = alternate;
- while (true) {
- var parentA = a.return;
- if (parentA === null) {
-
- break;
- }
- var parentB = parentA.alternate;
- if (parentB === null) {
-
-
-
-
- var nextParent = parentA.return;
- if (nextParent !== null) {
- a = b = nextParent;
- continue;
- }
- break;
- }
-
-
- if (parentA.child === parentB.child) {
- var child = parentA.child;
- while (child) {
- if (child === a) {
-
- assertIsMounted(parentA);
- return fiber;
- }
- if (child === b) {
-
- assertIsMounted(parentA);
- return alternate;
- }
- child = child.sibling;
- }
-
- {
- {
- throw Error( "Unable to find node on an unmounted component." );
- }
- }
- }
- if (a.return !== b.return) {
-
-
-
-
- a = parentA;
- b = parentB;
- } else {
-
-
-
-
-
- var didFindChild = false;
- var _child = parentA.child;
- while (_child) {
- if (_child === a) {
- didFindChild = true;
- a = parentA;
- b = parentB;
- break;
- }
- if (_child === b) {
- didFindChild = true;
- b = parentA;
- a = parentB;
- break;
- }
- _child = _child.sibling;
- }
- if (!didFindChild) {
-
- _child = parentB.child;
- while (_child) {
- if (_child === a) {
- didFindChild = true;
- a = parentB;
- b = parentA;
- break;
- }
- if (_child === b) {
- didFindChild = true;
- b = parentB;
- a = parentA;
- break;
- }
- _child = _child.sibling;
- }
- if (!didFindChild) {
- {
- throw Error( "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." );
- }
- }
- }
- }
- if (!(a.alternate === b)) {
- {
- throw Error( "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- }
-
- if (!(a.tag === HostRoot)) {
- {
- throw Error( "Unable to find node on an unmounted component." );
- }
- }
- if (a.stateNode.current === a) {
-
- return fiber;
- }
- return alternate;
- }
- function findCurrentHostFiber(parent) {
- var currentParent = findCurrentFiberUsingSlowPath(parent);
- if (!currentParent) {
- return null;
- }
- var node = currentParent;
- while (true) {
- if (node.tag === HostComponent || node.tag === HostText) {
- return node;
- } else if (node.child) {
- node.child.return = node;
- node = node.child;
- continue;
- }
- if (node === currentParent) {
- return null;
- }
- while (!node.sibling) {
- if (!node.return || node.return === currentParent) {
- return null;
- }
- node = node.return;
- }
- node.sibling.return = node.return;
- node = node.sibling;
- }
-
- return null;
- }
- function findCurrentHostFiberWithNoPortals(parent) {
- var currentParent = findCurrentFiberUsingSlowPath(parent);
- if (!currentParent) {
- return null;
- }
- var node = currentParent;
- while (true) {
- if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI ) {
- return node;
- } else if (node.child && node.tag !== HostPortal) {
- node.child.return = node;
- node = node.child;
- continue;
- }
- if (node === currentParent) {
- return null;
- }
- while (!node.sibling) {
- if (!node.return || node.return === currentParent) {
- return null;
- }
- node = node.return;
- }
- node.sibling.return = node.return;
- node = node.sibling;
- }
-
- return null;
- }
-
- function accumulateInto(current, next) {
- if (!(next != null)) {
- {
- throw Error( "accumulateInto(...): Accumulated items must not be null or undefined." );
- }
- }
- if (current == null) {
- return next;
- }
-
- if (Array.isArray(current)) {
- if (Array.isArray(next)) {
- current.push.apply(current, next);
- return current;
- }
- current.push(next);
- return current;
- }
- if (Array.isArray(next)) {
-
- return [current].concat(next);
- }
- return [current, next];
- }
-
- function forEachAccumulated(arr, cb, scope) {
- if (Array.isArray(arr)) {
- arr.forEach(cb, scope);
- } else if (arr) {
- cb.call(scope, arr);
- }
- }
-
- var eventQueue = null;
-
- var executeDispatchesAndRelease = function (event) {
- if (event) {
- executeDispatchesInOrder(event);
- if (!event.isPersistent()) {
- event.constructor.release(event);
- }
- }
- };
- var executeDispatchesAndReleaseTopLevel = function (e) {
- return executeDispatchesAndRelease(e);
- };
- function runEventsInBatch(events) {
- if (events !== null) {
- eventQueue = accumulateInto(eventQueue, events);
- }
-
- var processingEventQueue = eventQueue;
- eventQueue = null;
- if (!processingEventQueue) {
- return;
- }
- forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
- if (!!eventQueue) {
- {
- throw Error( "processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented." );
- }
- }
- rethrowCaughtError();
- }
-
- function getEventTarget(nativeEvent) {
-
-
- var target = nativeEvent.target || nativeEvent.srcElement || window;
- if (target.correspondingUseElement) {
- target = target.correspondingUseElement;
- }
-
- return target.nodeType === TEXT_NODE ? target.parentNode : target;
- }
-
- function isEventSupported(eventNameSuffix) {
- if (!canUseDOM) {
- return false;
- }
- var eventName = 'on' + eventNameSuffix;
- var isSupported = eventName in document;
- if (!isSupported) {
- var element = document.createElement('div');
- element.setAttribute(eventName, 'return;');
- isSupported = typeof element[eventName] === 'function';
- }
- return isSupported;
- }
-
- var CALLBACK_BOOKKEEPING_POOL_SIZE = 10;
- var callbackBookkeepingPool = [];
- function releaseTopLevelCallbackBookKeeping(instance) {
- instance.topLevelType = null;
- instance.nativeEvent = null;
- instance.targetInst = null;
- instance.ancestors.length = 0;
- if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {
- callbackBookkeepingPool.push(instance);
- }
- }
- function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags) {
- if (callbackBookkeepingPool.length) {
- var instance = callbackBookkeepingPool.pop();
- instance.topLevelType = topLevelType;
- instance.eventSystemFlags = eventSystemFlags;
- instance.nativeEvent = nativeEvent;
- instance.targetInst = targetInst;
- return instance;
- }
- return {
- topLevelType: topLevelType,
- eventSystemFlags: eventSystemFlags,
- nativeEvent: nativeEvent,
- targetInst: targetInst,
- ancestors: []
- };
- }
-
- function findRootContainerNode(inst) {
- if (inst.tag === HostRoot) {
- return inst.stateNode.containerInfo;
- }
-
-
- while (inst.return) {
- inst = inst.return;
- }
- if (inst.tag !== HostRoot) {
-
- return null;
- }
- return inst.stateNode.containerInfo;
- }
-
- function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
- var events = null;
- for (var i = 0; i < plugins.length; i++) {
-
- var possiblePlugin = plugins[i];
- if (possiblePlugin) {
- var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
- if (extractedEvents) {
- events = accumulateInto(events, extractedEvents);
- }
- }
- }
- return events;
- }
- function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
- var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
- runEventsInBatch(events);
- }
- function handleTopLevel(bookKeeping) {
- var targetInst = bookKeeping.targetInst;
-
-
-
- var ancestor = targetInst;
- do {
- if (!ancestor) {
- var ancestors = bookKeeping.ancestors;
- ancestors.push(ancestor);
- break;
- }
- var root = findRootContainerNode(ancestor);
- if (!root) {
- break;
- }
- var tag = ancestor.tag;
- if (tag === HostComponent || tag === HostText) {
- bookKeeping.ancestors.push(ancestor);
- }
- ancestor = getClosestInstanceFromNode(root);
- } while (ancestor);
- for (var i = 0; i < bookKeeping.ancestors.length; i++) {
- targetInst = bookKeeping.ancestors[i];
- var eventTarget = getEventTarget(bookKeeping.nativeEvent);
- var topLevelType = bookKeeping.topLevelType;
- var nativeEvent = bookKeeping.nativeEvent;
- var eventSystemFlags = bookKeeping.eventSystemFlags;
- if (i === 0) {
- eventSystemFlags |= IS_FIRST_ANCESTOR;
- }
- runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, eventTarget, eventSystemFlags);
- }
- }
- function dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst) {
- var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags);
- try {
-
-
- batchedEventUpdates(handleTopLevel, bookKeeping);
- } finally {
- releaseTopLevelCallbackBookKeeping(bookKeeping);
- }
- }
-
- function legacyListenToEvent(registrationName, mountAt) {
- var listenerMap = getListenerMapForElement(mountAt);
- var dependencies = registrationNameDependencies[registrationName];
- for (var i = 0; i < dependencies.length; i++) {
- var dependency = dependencies[i];
- legacyListenToTopLevelEvent(dependency, mountAt, listenerMap);
- }
- }
- function legacyListenToTopLevelEvent(topLevelType, mountAt, listenerMap) {
- if (!listenerMap.has(topLevelType)) {
- switch (topLevelType) {
- case TOP_SCROLL:
- trapCapturedEvent(TOP_SCROLL, mountAt);
- break;
- case TOP_FOCUS:
- case TOP_BLUR:
- trapCapturedEvent(TOP_FOCUS, mountAt);
- trapCapturedEvent(TOP_BLUR, mountAt);
-
- listenerMap.set(TOP_BLUR, null);
- listenerMap.set(TOP_FOCUS, null);
- break;
- case TOP_CANCEL:
- case TOP_CLOSE:
- if (isEventSupported(getRawEventName(topLevelType))) {
- trapCapturedEvent(topLevelType, mountAt);
- }
- break;
- case TOP_INVALID:
- case TOP_SUBMIT:
- case TOP_RESET:
-
-
- break;
- default:
-
-
- var isMediaEvent = mediaEventTypes.indexOf(topLevelType) !== -1;
- if (!isMediaEvent) {
- trapBubbledEvent(topLevelType, mountAt);
- }
- break;
- }
- listenerMap.set(topLevelType, null);
- }
- }
- function isListeningToAllDependencies(registrationName, mountAt) {
- var listenerMap = getListenerMapForElement(mountAt);
- var dependencies = registrationNameDependencies[registrationName];
- for (var i = 0; i < dependencies.length; i++) {
- var dependency = dependencies[i];
- if (!listenerMap.has(dependency)) {
- return false;
- }
- }
- return true;
- }
- var attemptUserBlockingHydration;
- function setAttemptUserBlockingHydration(fn) {
- attemptUserBlockingHydration = fn;
- }
- var attemptContinuousHydration;
- function setAttemptContinuousHydration(fn) {
- attemptContinuousHydration = fn;
- }
- var attemptHydrationAtCurrentPriority;
- function setAttemptHydrationAtCurrentPriority(fn) {
- attemptHydrationAtCurrentPriority = fn;
- }
- var hasScheduledReplayAttempt = false;
- var queuedDiscreteEvents = [];
-
- var queuedFocus = null;
- var queuedDrag = null;
- var queuedMouse = null;
- var queuedPointers = new Map();
- var queuedPointerCaptures = new Map();
- var queuedExplicitHydrationTargets = [];
- function hasQueuedDiscreteEvents() {
- return queuedDiscreteEvents.length > 0;
- }
- var discreteReplayableEvents = [TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_TOUCH_CANCEL, TOP_TOUCH_END, TOP_TOUCH_START, TOP_AUX_CLICK, TOP_DOUBLE_CLICK, TOP_POINTER_CANCEL, TOP_POINTER_DOWN, TOP_POINTER_UP, TOP_DRAG_END, TOP_DRAG_START, TOP_DROP, TOP_COMPOSITION_END, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_INPUT, TOP_TEXT_INPUT, TOP_CLOSE, TOP_CANCEL, TOP_COPY, TOP_CUT, TOP_PASTE, TOP_CLICK, TOP_CHANGE, TOP_CONTEXT_MENU, TOP_RESET, TOP_SUBMIT];
- var continuousReplayableEvents = [TOP_FOCUS, TOP_BLUR, TOP_DRAG_ENTER, TOP_DRAG_LEAVE, TOP_MOUSE_OVER, TOP_MOUSE_OUT, TOP_POINTER_OVER, TOP_POINTER_OUT, TOP_GOT_POINTER_CAPTURE, TOP_LOST_POINTER_CAPTURE];
- function isReplayableDiscreteEvent(eventType) {
- return discreteReplayableEvents.indexOf(eventType) > -1;
- }
- function trapReplayableEventForDocument(topLevelType, document, listenerMap) {
- legacyListenToTopLevelEvent(topLevelType, document, listenerMap);
- }
- function eagerlyTrapReplayableEvents(container, document) {
- var listenerMapForDoc = getListenerMapForElement(document);
- discreteReplayableEvents.forEach(function (topLevelType) {
- trapReplayableEventForDocument(topLevelType, document, listenerMapForDoc);
- });
- continuousReplayableEvents.forEach(function (topLevelType) {
- trapReplayableEventForDocument(topLevelType, document, listenerMapForDoc);
- });
- }
- function createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {
- return {
- blockedOn: blockedOn,
- topLevelType: topLevelType,
- eventSystemFlags: eventSystemFlags | IS_REPLAYED,
- nativeEvent: nativeEvent,
- container: container
- };
- }
- function queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {
- var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);
- queuedDiscreteEvents.push(queuedEvent);
- }
- function clearIfContinuousEvent(topLevelType, nativeEvent) {
- switch (topLevelType) {
- case TOP_FOCUS:
- case TOP_BLUR:
- queuedFocus = null;
- break;
- case TOP_DRAG_ENTER:
- case TOP_DRAG_LEAVE:
- queuedDrag = null;
- break;
- case TOP_MOUSE_OVER:
- case TOP_MOUSE_OUT:
- queuedMouse = null;
- break;
- case TOP_POINTER_OVER:
- case TOP_POINTER_OUT:
- {
- var pointerId = nativeEvent.pointerId;
- queuedPointers.delete(pointerId);
- break;
- }
- case TOP_GOT_POINTER_CAPTURE:
- case TOP_LOST_POINTER_CAPTURE:
- {
- var _pointerId = nativeEvent.pointerId;
- queuedPointerCaptures.delete(_pointerId);
- break;
- }
- }
- }
- function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {
- if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
- var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);
- if (blockedOn !== null) {
- var _fiber2 = getInstanceFromNode$1(blockedOn);
- if (_fiber2 !== null) {
-
- attemptContinuousHydration(_fiber2);
- }
- }
- return queuedEvent;
- }
-
-
-
- existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
- return existingQueuedEvent;
- }
- function queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) {
-
-
-
- switch (topLevelType) {
- case TOP_FOCUS:
- {
- var focusEvent = nativeEvent;
- queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, topLevelType, eventSystemFlags, container, focusEvent);
- return true;
- }
- case TOP_DRAG_ENTER:
- {
- var dragEvent = nativeEvent;
- queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, topLevelType, eventSystemFlags, container, dragEvent);
- return true;
- }
- case TOP_MOUSE_OVER:
- {
- var mouseEvent = nativeEvent;
- queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, topLevelType, eventSystemFlags, container, mouseEvent);
- return true;
- }
- case TOP_POINTER_OVER:
- {
- var pointerEvent = nativeEvent;
- var pointerId = pointerEvent.pointerId;
- queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, topLevelType, eventSystemFlags, container, pointerEvent));
- return true;
- }
- case TOP_GOT_POINTER_CAPTURE:
- {
- var _pointerEvent = nativeEvent;
- var _pointerId2 = _pointerEvent.pointerId;
- queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, topLevelType, eventSystemFlags, container, _pointerEvent));
- return true;
- }
- }
- return false;
- }
- function attemptExplicitHydrationTarget(queuedTarget) {
-
-
-
- var targetInst = getClosestInstanceFromNode(queuedTarget.target);
- if (targetInst !== null) {
- var nearestMounted = getNearestMountedFiber(targetInst);
- if (nearestMounted !== null) {
- var tag = nearestMounted.tag;
- if (tag === SuspenseComponent) {
- var instance = getSuspenseInstanceFromFiber(nearestMounted);
- if (instance !== null) {
-
-
- queuedTarget.blockedOn = instance;
- unstable_runWithPriority(queuedTarget.priority, function () {
- attemptHydrationAtCurrentPriority(nearestMounted);
- });
- return;
- }
- } else if (tag === HostRoot) {
- var root = nearestMounted.stateNode;
- if (root.hydrate) {
- queuedTarget.blockedOn = getContainerFromFiber(nearestMounted);
-
- return;
- }
- }
- }
- }
- queuedTarget.blockedOn = null;
- }
- function attemptReplayContinuousQueuedEvent(queuedEvent) {
- if (queuedEvent.blockedOn !== null) {
- return false;
- }
- var nextBlockedOn = attemptToDispatchEvent(queuedEvent.topLevelType, queuedEvent.eventSystemFlags, queuedEvent.container, queuedEvent.nativeEvent);
- if (nextBlockedOn !== null) {
-
- var _fiber3 = getInstanceFromNode$1(nextBlockedOn);
- if (_fiber3 !== null) {
- attemptContinuousHydration(_fiber3);
- }
- queuedEvent.blockedOn = nextBlockedOn;
- return false;
- }
- return true;
- }
- function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
- if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
- map.delete(key);
- }
- }
- function replayUnblockedEvents() {
- hasScheduledReplayAttempt = false;
- while (queuedDiscreteEvents.length > 0) {
- var nextDiscreteEvent = queuedDiscreteEvents[0];
- if (nextDiscreteEvent.blockedOn !== null) {
-
-
-
- var _fiber4 = getInstanceFromNode$1(nextDiscreteEvent.blockedOn);
- if (_fiber4 !== null) {
- attemptUserBlockingHydration(_fiber4);
- }
- break;
- }
- var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.topLevelType, nextDiscreteEvent.eventSystemFlags, nextDiscreteEvent.container, nextDiscreteEvent.nativeEvent);
- if (nextBlockedOn !== null) {
-
- nextDiscreteEvent.blockedOn = nextBlockedOn;
- } else {
-
- queuedDiscreteEvents.shift();
- }
- }
- if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
- queuedFocus = null;
- }
- if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
- queuedDrag = null;
- }
- if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
- queuedMouse = null;
- }
- queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
- queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
- }
- function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
- if (queuedEvent.blockedOn === unblocked) {
- queuedEvent.blockedOn = null;
- if (!hasScheduledReplayAttempt) {
- hasScheduledReplayAttempt = true;
-
-
- unstable_scheduleCallback(unstable_NormalPriority, replayUnblockedEvents);
- }
- }
- }
- function retryIfBlockedOn(unblocked) {
-
-
- if (queuedDiscreteEvents.length > 0) {
- scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked);
-
-
- for (var i = 1; i < queuedDiscreteEvents.length; i++) {
- var queuedEvent = queuedDiscreteEvents[i];
- if (queuedEvent.blockedOn === unblocked) {
- queuedEvent.blockedOn = null;
- }
- }
- }
- if (queuedFocus !== null) {
- scheduleCallbackIfUnblocked(queuedFocus, unblocked);
- }
- if (queuedDrag !== null) {
- scheduleCallbackIfUnblocked(queuedDrag, unblocked);
- }
- if (queuedMouse !== null) {
- scheduleCallbackIfUnblocked(queuedMouse, unblocked);
- }
- var unblock = function (queuedEvent) {
- return scheduleCallbackIfUnblocked(queuedEvent, unblocked);
- };
- queuedPointers.forEach(unblock);
- queuedPointerCaptures.forEach(unblock);
- for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
- var queuedTarget = queuedExplicitHydrationTargets[_i];
- if (queuedTarget.blockedOn === unblocked) {
- queuedTarget.blockedOn = null;
- }
- }
- while (queuedExplicitHydrationTargets.length > 0) {
- var nextExplicitTarget = queuedExplicitHydrationTargets[0];
- if (nextExplicitTarget.blockedOn !== null) {
-
- break;
- } else {
- attemptExplicitHydrationTarget(nextExplicitTarget);
- if (nextExplicitTarget.blockedOn === null) {
-
- queuedExplicitHydrationTargets.shift();
- }
- }
- }
- }
- function addEventBubbleListener(element, eventType, listener) {
- element.addEventListener(eventType, listener, false);
- }
- function addEventCaptureListener(element, eventType, listener) {
- element.addEventListener(eventType, listener, true);
- }
-
-
-
-
-
- var simpleEventPluginEventTypes = {};
- var topLevelEventsToDispatchConfig = new Map();
- var eventPriorities = new Map();
-
-
-
-
-
-
-
- var discreteEventPairsForSimpleEventPlugin = [TOP_BLUR, 'blur', TOP_CANCEL, 'cancel', TOP_CLICK, 'click', TOP_CLOSE, 'close', TOP_CONTEXT_MENU, 'contextMenu', TOP_COPY, 'copy', TOP_CUT, 'cut', TOP_AUX_CLICK, 'auxClick', TOP_DOUBLE_CLICK, 'doubleClick', TOP_DRAG_END, 'dragEnd', TOP_DRAG_START, 'dragStart', TOP_DROP, 'drop', TOP_FOCUS, 'focus', TOP_INPUT, 'input', TOP_INVALID, 'invalid', TOP_KEY_DOWN, 'keyDown', TOP_KEY_PRESS, 'keyPress', TOP_KEY_UP, 'keyUp', TOP_MOUSE_DOWN, 'mouseDown', TOP_MOUSE_UP, 'mouseUp', TOP_PASTE, 'paste', TOP_PAUSE, 'pause', TOP_PLAY, 'play', TOP_POINTER_CANCEL, 'pointerCancel', TOP_POINTER_DOWN, 'pointerDown', TOP_POINTER_UP, 'pointerUp', TOP_RATE_CHANGE, 'rateChange', TOP_RESET, 'reset', TOP_SEEKED, 'seeked', TOP_SUBMIT, 'submit', TOP_TOUCH_CANCEL, 'touchCancel', TOP_TOUCH_END, 'touchEnd', TOP_TOUCH_START, 'touchStart', TOP_VOLUME_CHANGE, 'volumeChange'];
- var otherDiscreteEvents = [TOP_CHANGE, TOP_SELECTION_CHANGE, TOP_TEXT_INPUT, TOP_COMPOSITION_START, TOP_COMPOSITION_END, TOP_COMPOSITION_UPDATE];
- var userBlockingPairsForSimpleEventPlugin = [TOP_DRAG, 'drag', TOP_DRAG_ENTER, 'dragEnter', TOP_DRAG_EXIT, 'dragExit', TOP_DRAG_LEAVE, 'dragLeave', TOP_DRAG_OVER, 'dragOver', TOP_MOUSE_MOVE, 'mouseMove', TOP_MOUSE_OUT, 'mouseOut', TOP_MOUSE_OVER, 'mouseOver', TOP_POINTER_MOVE, 'pointerMove', TOP_POINTER_OUT, 'pointerOut', TOP_POINTER_OVER, 'pointerOver', TOP_SCROLL, 'scroll', TOP_TOGGLE, 'toggle', TOP_TOUCH_MOVE, 'touchMove', TOP_WHEEL, 'wheel'];
- var continuousPairsForSimpleEventPlugin = [TOP_ABORT, 'abort', TOP_ANIMATION_END, 'animationEnd', TOP_ANIMATION_ITERATION, 'animationIteration', TOP_ANIMATION_START, 'animationStart', TOP_CAN_PLAY, 'canPlay', TOP_CAN_PLAY_THROUGH, 'canPlayThrough', TOP_DURATION_CHANGE, 'durationChange', TOP_EMPTIED, 'emptied', TOP_ENCRYPTED, 'encrypted', TOP_ENDED, 'ended', TOP_ERROR, 'error', TOP_GOT_POINTER_CAPTURE, 'gotPointerCapture', TOP_LOAD, 'load', TOP_LOADED_DATA, 'loadedData', TOP_LOADED_METADATA, 'loadedMetadata', TOP_LOAD_START, 'loadStart', TOP_LOST_POINTER_CAPTURE, 'lostPointerCapture', TOP_PLAYING, 'playing', TOP_PROGRESS, 'progress', TOP_SEEKING, 'seeking', TOP_STALLED, 'stalled', TOP_SUSPEND, 'suspend', TOP_TIME_UPDATE, 'timeUpdate', TOP_TRANSITION_END, 'transitionEnd', TOP_WAITING, 'waiting'];
-
- function processSimpleEventPluginPairsByPriority(eventTypes, priority) {
-
-
-
-
-
-
- for (var i = 0; i < eventTypes.length; i += 2) {
- var topEvent = eventTypes[i];
- var event = eventTypes[i + 1];
- var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
- var onEvent = 'on' + capitalizedEvent;
- var config = {
- phasedRegistrationNames: {
- bubbled: onEvent,
- captured: onEvent + 'Capture'
- },
- dependencies: [topEvent],
- eventPriority: priority
- };
- eventPriorities.set(topEvent, priority);
- topLevelEventsToDispatchConfig.set(topEvent, config);
- simpleEventPluginEventTypes[event] = config;
- }
- }
- function processTopEventPairsByPriority(eventTypes, priority) {
- for (var i = 0; i < eventTypes.length; i++) {
- eventPriorities.set(eventTypes[i], priority);
- }
- }
- processSimpleEventPluginPairsByPriority(discreteEventPairsForSimpleEventPlugin, DiscreteEvent);
- processSimpleEventPluginPairsByPriority(userBlockingPairsForSimpleEventPlugin, UserBlockingEvent);
- processSimpleEventPluginPairsByPriority(continuousPairsForSimpleEventPlugin, ContinuousEvent);
- processTopEventPairsByPriority(otherDiscreteEvents, DiscreteEvent);
- function getEventPriorityForPluginSystem(topLevelType) {
- var priority = eventPriorities.get(topLevelType);
-
-
- return priority === undefined ? ContinuousEvent : priority;
- }
-
- var UserBlockingPriority = unstable_UserBlockingPriority,
- runWithPriority = unstable_runWithPriority;
- var _enabled = true;
- function setEnabled(enabled) {
- _enabled = !!enabled;
- }
- function isEnabled() {
- return _enabled;
- }
- function trapBubbledEvent(topLevelType, element) {
- trapEventForPluginEventSystem(element, topLevelType, false);
- }
- function trapCapturedEvent(topLevelType, element) {
- trapEventForPluginEventSystem(element, topLevelType, true);
- }
- function trapEventForPluginEventSystem(container, topLevelType, capture) {
- var listener;
- switch (getEventPriorityForPluginSystem(topLevelType)) {
- case DiscreteEvent:
- listener = dispatchDiscreteEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);
- break;
- case UserBlockingEvent:
- listener = dispatchUserBlockingUpdate.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);
- break;
- case ContinuousEvent:
- default:
- listener = dispatchEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container);
- break;
- }
- var rawEventName = getRawEventName(topLevelType);
- if (capture) {
- addEventCaptureListener(container, rawEventName, listener);
- } else {
- addEventBubbleListener(container, rawEventName, listener);
- }
- }
- function dispatchDiscreteEvent(topLevelType, eventSystemFlags, container, nativeEvent) {
- flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);
- discreteUpdates(dispatchEvent, topLevelType, eventSystemFlags, container, nativeEvent);
- }
- function dispatchUserBlockingUpdate(topLevelType, eventSystemFlags, container, nativeEvent) {
- runWithPriority(UserBlockingPriority, dispatchEvent.bind(null, topLevelType, eventSystemFlags, container, nativeEvent));
- }
- function dispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent) {
- if (!_enabled) {
- return;
- }
- if (hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(topLevelType)) {
-
-
-
- queueDiscreteEvent(null,
- topLevelType, eventSystemFlags, container, nativeEvent);
- return;
- }
- var blockedOn = attemptToDispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent);
- if (blockedOn === null) {
-
- clearIfContinuousEvent(topLevelType, nativeEvent);
- return;
- }
- if (isReplayableDiscreteEvent(topLevelType)) {
-
- queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent);
- return;
- }
- if (queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent)) {
- return;
- }
-
- clearIfContinuousEvent(topLevelType, nativeEvent);
-
- {
- dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, null);
- }
- }
- function attemptToDispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent) {
-
- var nativeEventTarget = getEventTarget(nativeEvent);
- var targetInst = getClosestInstanceFromNode(nativeEventTarget);
- if (targetInst !== null) {
- var nearestMounted = getNearestMountedFiber(targetInst);
- if (nearestMounted === null) {
-
- targetInst = null;
- } else {
- var tag = nearestMounted.tag;
- if (tag === SuspenseComponent) {
- var instance = getSuspenseInstanceFromFiber(nearestMounted);
- if (instance !== null) {
-
-
-
-
- return instance;
- }
-
-
- targetInst = null;
- } else if (tag === HostRoot) {
- var root = nearestMounted.stateNode;
- if (root.hydrate) {
-
-
- return getContainerFromFiber(nearestMounted);
- }
- targetInst = null;
- } else if (nearestMounted !== targetInst) {
-
-
-
-
- targetInst = null;
- }
- }
- }
- {
- dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);
- }
- return null;
- }
-
-
- var shorthandToLonghand = {
- animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],
- background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],
- backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],
- border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],
- borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],
- borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],
- borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],
- borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],
- borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],
- borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],
- borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],
- borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],
- borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],
- borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],
- borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],
- borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],
- borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],
- columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],
- columns: ['columnCount', 'columnWidth'],
- flex: ['flexBasis', 'flexGrow', 'flexShrink'],
- flexFlow: ['flexDirection', 'flexWrap'],
- font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],
- fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],
- gap: ['columnGap', 'rowGap'],
- grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
- gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],
- gridColumn: ['gridColumnEnd', 'gridColumnStart'],
- gridColumnGap: ['columnGap'],
- gridGap: ['columnGap', 'rowGap'],
- gridRow: ['gridRowEnd', 'gridRowStart'],
- gridRowGap: ['rowGap'],
- gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
- listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],
- margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],
- marker: ['markerEnd', 'markerMid', 'markerStart'],
- mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],
- maskPosition: ['maskPositionX', 'maskPositionY'],
- outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],
- overflow: ['overflowX', 'overflowY'],
- padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],
- placeContent: ['alignContent', 'justifyContent'],
- placeItems: ['alignItems', 'justifyItems'],
- placeSelf: ['alignSelf', 'justifySelf'],
- textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],
- textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],
- transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],
- wordWrap: ['overflowWrap']
- };
-
- var isUnitlessNumber = {
- animationIterationCount: true,
- borderImageOutset: true,
- borderImageSlice: true,
- borderImageWidth: true,
- boxFlex: true,
- boxFlexGroup: true,
- boxOrdinalGroup: true,
- columnCount: true,
- columns: true,
- flex: true,
- flexGrow: true,
- flexPositive: true,
- flexShrink: true,
- flexNegative: true,
- flexOrder: true,
- gridArea: true,
- gridRow: true,
- gridRowEnd: true,
- gridRowSpan: true,
- gridRowStart: true,
- gridColumn: true,
- gridColumnEnd: true,
- gridColumnSpan: true,
- gridColumnStart: true,
- fontWeight: true,
- lineClamp: true,
- lineHeight: true,
- opacity: true,
- order: true,
- orphans: true,
- tabSize: true,
- widows: true,
- zIndex: true,
- zoom: true,
-
- fillOpacity: true,
- floodOpacity: true,
- stopOpacity: true,
- strokeDasharray: true,
- strokeDashoffset: true,
- strokeMiterlimit: true,
- strokeOpacity: true,
- strokeWidth: true
- };
-
- function prefixKey(prefix, key) {
- return prefix + key.charAt(0).toUpperCase() + key.substring(1);
- }
-
- var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
-
- Object.keys(isUnitlessNumber).forEach(function (prop) {
- prefixes.forEach(function (prefix) {
- isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
- });
- });
-
- function dangerousStyleValue(name, value, isCustomProperty) {
-
-
-
-
-
-
-
-
-
- var isEmpty = value == null || typeof value === 'boolean' || value === '';
- if (isEmpty) {
- return '';
- }
- if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
- return value + 'px';
- }
- return ('' + value).trim();
- }
- var uppercasePattern = /([A-Z])/g;
- var msPattern = /^ms-/;
-
- function hyphenateStyleName(name) {
- return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
- }
- var warnValidStyle = function () {};
- {
-
- var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
- var msPattern$1 = /^-ms-/;
- var hyphenPattern = /-(.)/g;
- var badStyleValueWithSemicolonPattern = /;\s*$/;
- var warnedStyleNames = {};
- var warnedStyleValues = {};
- var warnedForNaNValue = false;
- var warnedForInfinityValue = false;
- var camelize = function (string) {
- return string.replace(hyphenPattern, function (_, character) {
- return character.toUpperCase();
- });
- };
- var warnHyphenatedStyleName = function (name) {
- if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
- return;
- }
- warnedStyleNames[name] = true;
- error('Unsupported style property %s. Did you mean %s?', name,
-
-
- camelize(name.replace(msPattern$1, 'ms-')));
- };
- var warnBadVendoredStyleName = function (name) {
- if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
- return;
- }
- warnedStyleNames[name] = true;
- error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
- };
- var warnStyleValueWithSemicolon = function (name, value) {
- if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
- return;
- }
- warnedStyleValues[value] = true;
- error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
- };
- var warnStyleValueIsNaN = function (name, value) {
- if (warnedForNaNValue) {
- return;
- }
- warnedForNaNValue = true;
- error('`NaN` is an invalid value for the `%s` css style property.', name);
- };
- var warnStyleValueIsInfinity = function (name, value) {
- if (warnedForInfinityValue) {
- return;
- }
- warnedForInfinityValue = true;
- error('`Infinity` is an invalid value for the `%s` css style property.', name);
- };
- warnValidStyle = function (name, value) {
- if (name.indexOf('-') > -1) {
- warnHyphenatedStyleName(name);
- } else if (badVendoredStyleNamePattern.test(name)) {
- warnBadVendoredStyleName(name);
- } else if (badStyleValueWithSemicolonPattern.test(value)) {
- warnStyleValueWithSemicolon(name, value);
- }
- if (typeof value === 'number') {
- if (isNaN(value)) {
- warnStyleValueIsNaN(name, value);
- } else if (!isFinite(value)) {
- warnStyleValueIsInfinity(name, value);
- }
- }
- };
- }
- var warnValidStyle$1 = warnValidStyle;
-
-
- function createDangerousStringForStyles(styles) {
- {
- var serialized = '';
- var delimiter = '';
- for (var styleName in styles) {
- if (!styles.hasOwnProperty(styleName)) {
- continue;
- }
- var styleValue = styles[styleName];
- if (styleValue != null) {
- var isCustomProperty = styleName.indexOf('--') === 0;
- serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';
- serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
- delimiter = ';';
- }
- }
- return serialized || null;
- }
- }
-
- function setValueForStyles(node, styles) {
- var style = node.style;
- for (var styleName in styles) {
- if (!styles.hasOwnProperty(styleName)) {
- continue;
- }
- var isCustomProperty = styleName.indexOf('--') === 0;
- {
- if (!isCustomProperty) {
- warnValidStyle$1(styleName, styles[styleName]);
- }
- }
- var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
- if (styleName === 'float') {
- styleName = 'cssFloat';
- }
- if (isCustomProperty) {
- style.setProperty(styleName, styleValue);
- } else {
- style[styleName] = styleValue;
- }
- }
- }
- function isValueEmpty(value) {
- return value == null || typeof value === 'boolean' || value === '';
- }
-
- function expandShorthandMap(styles) {
- var expanded = {};
- for (var key in styles) {
- var longhands = shorthandToLonghand[key] || [key];
- for (var i = 0; i < longhands.length; i++) {
- expanded[longhands[i]] = key;
- }
- }
- return expanded;
- }
-
- function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
- {
- if (!nextStyles) {
- return;
- }
- var expandedUpdates = expandShorthandMap(styleUpdates);
- var expandedStyles = expandShorthandMap(nextStyles);
- var warnedAbout = {};
- for (var key in expandedUpdates) {
- var originalKey = expandedUpdates[key];
- var correctOriginalKey = expandedStyles[key];
- if (correctOriginalKey && originalKey !== correctOriginalKey) {
- var warningKey = originalKey + ',' + correctOriginalKey;
- if (warnedAbout[warningKey]) {
- continue;
- }
- warnedAbout[warningKey] = true;
- error('%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);
- }
- }
- }
- }
-
-
- var omittedCloseTags = {
- area: true,
- base: true,
- br: true,
- col: true,
- embed: true,
- hr: true,
- img: true,
- input: true,
- keygen: true,
- link: true,
- meta: true,
- param: true,
- source: true,
- track: true,
- wbr: true
- };
-
- var voidElementTags = _assign({
- menuitem: true
- }, omittedCloseTags);
- var HTML = '__html';
- var ReactDebugCurrentFrame$3 = null;
- {
- ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
- }
- function assertValidProps(tag, props) {
- if (!props) {
- return;
- }
- if (voidElementTags[tag]) {
- if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
- {
- throw Error( tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );
- }
- }
- }
- if (props.dangerouslySetInnerHTML != null) {
- if (!(props.children == null)) {
- {
- throw Error( "Can only set one of `children` or `props.dangerouslySetInnerHTML`." );
- }
- }
- if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {
- {
- throw Error( "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information." );
- }
- }
- }
- {
- if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {
- error('A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.');
- }
- }
- if (!(props.style == null || typeof props.style === 'object')) {
- {
- throw Error( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );
- }
- }
- }
- function isCustomComponent(tagName, props) {
- if (tagName.indexOf('-') === -1) {
- return typeof props.is === 'string';
- }
- switch (tagName) {
-
-
-
-
- case 'annotation-xml':
- case 'color-profile':
- case 'font-face':
- case 'font-face-src':
- case 'font-face-uri':
- case 'font-face-format':
- case 'font-face-name':
- case 'missing-glyph':
- return false;
- default:
- return true;
- }
- }
-
-
-
- var possibleStandardNames = {
-
- accept: 'accept',
- acceptcharset: 'acceptCharset',
- 'accept-charset': 'acceptCharset',
- accesskey: 'accessKey',
- action: 'action',
- allowfullscreen: 'allowFullScreen',
- alt: 'alt',
- as: 'as',
- async: 'async',
- autocapitalize: 'autoCapitalize',
- autocomplete: 'autoComplete',
- autocorrect: 'autoCorrect',
- autofocus: 'autoFocus',
- autoplay: 'autoPlay',
- autosave: 'autoSave',
- capture: 'capture',
- cellpadding: 'cellPadding',
- cellspacing: 'cellSpacing',
- challenge: 'challenge',
- charset: 'charSet',
- checked: 'checked',
- children: 'children',
- cite: 'cite',
- class: 'className',
- classid: 'classID',
- classname: 'className',
- cols: 'cols',
- colspan: 'colSpan',
- content: 'content',
- contenteditable: 'contentEditable',
- contextmenu: 'contextMenu',
- controls: 'controls',
- controlslist: 'controlsList',
- coords: 'coords',
- crossorigin: 'crossOrigin',
- dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
- data: 'data',
- datetime: 'dateTime',
- default: 'default',
- defaultchecked: 'defaultChecked',
- defaultvalue: 'defaultValue',
- defer: 'defer',
- dir: 'dir',
- disabled: 'disabled',
- disablepictureinpicture: 'disablePictureInPicture',
- download: 'download',
- draggable: 'draggable',
- enctype: 'encType',
- for: 'htmlFor',
- form: 'form',
- formmethod: 'formMethod',
- formaction: 'formAction',
- formenctype: 'formEncType',
- formnovalidate: 'formNoValidate',
- formtarget: 'formTarget',
- frameborder: 'frameBorder',
- headers: 'headers',
- height: 'height',
- hidden: 'hidden',
- high: 'high',
- href: 'href',
- hreflang: 'hrefLang',
- htmlfor: 'htmlFor',
- httpequiv: 'httpEquiv',
- 'http-equiv': 'httpEquiv',
- icon: 'icon',
- id: 'id',
- innerhtml: 'innerHTML',
- inputmode: 'inputMode',
- integrity: 'integrity',
- is: 'is',
- itemid: 'itemID',
- itemprop: 'itemProp',
- itemref: 'itemRef',
- itemscope: 'itemScope',
- itemtype: 'itemType',
- keyparams: 'keyParams',
- keytype: 'keyType',
- kind: 'kind',
- label: 'label',
- lang: 'lang',
- list: 'list',
- loop: 'loop',
- low: 'low',
- manifest: 'manifest',
- marginwidth: 'marginWidth',
- marginheight: 'marginHeight',
- max: 'max',
- maxlength: 'maxLength',
- media: 'media',
- mediagroup: 'mediaGroup',
- method: 'method',
- min: 'min',
- minlength: 'minLength',
- multiple: 'multiple',
- muted: 'muted',
- name: 'name',
- nomodule: 'noModule',
- nonce: 'nonce',
- novalidate: 'noValidate',
- open: 'open',
- optimum: 'optimum',
- pattern: 'pattern',
- placeholder: 'placeholder',
- playsinline: 'playsInline',
- poster: 'poster',
- preload: 'preload',
- profile: 'profile',
- radiogroup: 'radioGroup',
- readonly: 'readOnly',
- referrerpolicy: 'referrerPolicy',
- rel: 'rel',
- required: 'required',
- reversed: 'reversed',
- role: 'role',
- rows: 'rows',
- rowspan: 'rowSpan',
- sandbox: 'sandbox',
- scope: 'scope',
- scoped: 'scoped',
- scrolling: 'scrolling',
- seamless: 'seamless',
- selected: 'selected',
- shape: 'shape',
- size: 'size',
- sizes: 'sizes',
- span: 'span',
- spellcheck: 'spellCheck',
- src: 'src',
- srcdoc: 'srcDoc',
- srclang: 'srcLang',
- srcset: 'srcSet',
- start: 'start',
- step: 'step',
- style: 'style',
- summary: 'summary',
- tabindex: 'tabIndex',
- target: 'target',
- title: 'title',
- type: 'type',
- usemap: 'useMap',
- value: 'value',
- width: 'width',
- wmode: 'wmode',
- wrap: 'wrap',
-
- about: 'about',
- accentheight: 'accentHeight',
- 'accent-height': 'accentHeight',
- accumulate: 'accumulate',
- additive: 'additive',
- alignmentbaseline: 'alignmentBaseline',
- 'alignment-baseline': 'alignmentBaseline',
- allowreorder: 'allowReorder',
- alphabetic: 'alphabetic',
- amplitude: 'amplitude',
- arabicform: 'arabicForm',
- 'arabic-form': 'arabicForm',
- ascent: 'ascent',
- attributename: 'attributeName',
- attributetype: 'attributeType',
- autoreverse: 'autoReverse',
- azimuth: 'azimuth',
- basefrequency: 'baseFrequency',
- baselineshift: 'baselineShift',
- 'baseline-shift': 'baselineShift',
- baseprofile: 'baseProfile',
- bbox: 'bbox',
- begin: 'begin',
- bias: 'bias',
- by: 'by',
- calcmode: 'calcMode',
- capheight: 'capHeight',
- 'cap-height': 'capHeight',
- clip: 'clip',
- clippath: 'clipPath',
- 'clip-path': 'clipPath',
- clippathunits: 'clipPathUnits',
- cliprule: 'clipRule',
- 'clip-rule': 'clipRule',
- color: 'color',
- colorinterpolation: 'colorInterpolation',
- 'color-interpolation': 'colorInterpolation',
- colorinterpolationfilters: 'colorInterpolationFilters',
- 'color-interpolation-filters': 'colorInterpolationFilters',
- colorprofile: 'colorProfile',
- 'color-profile': 'colorProfile',
- colorrendering: 'colorRendering',
- 'color-rendering': 'colorRendering',
- contentscripttype: 'contentScriptType',
- contentstyletype: 'contentStyleType',
- cursor: 'cursor',
- cx: 'cx',
- cy: 'cy',
- d: 'd',
- datatype: 'datatype',
- decelerate: 'decelerate',
- descent: 'descent',
- diffuseconstant: 'diffuseConstant',
- direction: 'direction',
- display: 'display',
- divisor: 'divisor',
- dominantbaseline: 'dominantBaseline',
- 'dominant-baseline': 'dominantBaseline',
- dur: 'dur',
- dx: 'dx',
- dy: 'dy',
- edgemode: 'edgeMode',
- elevation: 'elevation',
- enablebackground: 'enableBackground',
- 'enable-background': 'enableBackground',
- end: 'end',
- exponent: 'exponent',
- externalresourcesrequired: 'externalResourcesRequired',
- fill: 'fill',
- fillopacity: 'fillOpacity',
- 'fill-opacity': 'fillOpacity',
- fillrule: 'fillRule',
- 'fill-rule': 'fillRule',
- filter: 'filter',
- filterres: 'filterRes',
- filterunits: 'filterUnits',
- floodopacity: 'floodOpacity',
- 'flood-opacity': 'floodOpacity',
- floodcolor: 'floodColor',
- 'flood-color': 'floodColor',
- focusable: 'focusable',
- fontfamily: 'fontFamily',
- 'font-family': 'fontFamily',
- fontsize: 'fontSize',
- 'font-size': 'fontSize',
- fontsizeadjust: 'fontSizeAdjust',
- 'font-size-adjust': 'fontSizeAdjust',
- fontstretch: 'fontStretch',
- 'font-stretch': 'fontStretch',
- fontstyle: 'fontStyle',
- 'font-style': 'fontStyle',
- fontvariant: 'fontVariant',
- 'font-variant': 'fontVariant',
- fontweight: 'fontWeight',
- 'font-weight': 'fontWeight',
- format: 'format',
- from: 'from',
- fx: 'fx',
- fy: 'fy',
- g1: 'g1',
- g2: 'g2',
- glyphname: 'glyphName',
- 'glyph-name': 'glyphName',
- glyphorientationhorizontal: 'glyphOrientationHorizontal',
- 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
- glyphorientationvertical: 'glyphOrientationVertical',
- 'glyph-orientation-vertical': 'glyphOrientationVertical',
- glyphref: 'glyphRef',
- gradienttransform: 'gradientTransform',
- gradientunits: 'gradientUnits',
- hanging: 'hanging',
- horizadvx: 'horizAdvX',
- 'horiz-adv-x': 'horizAdvX',
- horizoriginx: 'horizOriginX',
- 'horiz-origin-x': 'horizOriginX',
- ideographic: 'ideographic',
- imagerendering: 'imageRendering',
- 'image-rendering': 'imageRendering',
- in2: 'in2',
- in: 'in',
- inlist: 'inlist',
- intercept: 'intercept',
- k1: 'k1',
- k2: 'k2',
- k3: 'k3',
- k4: 'k4',
- k: 'k',
- kernelmatrix: 'kernelMatrix',
- kernelunitlength: 'kernelUnitLength',
- kerning: 'kerning',
- keypoints: 'keyPoints',
- keysplines: 'keySplines',
- keytimes: 'keyTimes',
- lengthadjust: 'lengthAdjust',
- letterspacing: 'letterSpacing',
- 'letter-spacing': 'letterSpacing',
- lightingcolor: 'lightingColor',
- 'lighting-color': 'lightingColor',
- limitingconeangle: 'limitingConeAngle',
- local: 'local',
- markerend: 'markerEnd',
- 'marker-end': 'markerEnd',
- markerheight: 'markerHeight',
- markermid: 'markerMid',
- 'marker-mid': 'markerMid',
- markerstart: 'markerStart',
- 'marker-start': 'markerStart',
- markerunits: 'markerUnits',
- markerwidth: 'markerWidth',
- mask: 'mask',
- maskcontentunits: 'maskContentUnits',
- maskunits: 'maskUnits',
- mathematical: 'mathematical',
- mode: 'mode',
- numoctaves: 'numOctaves',
- offset: 'offset',
- opacity: 'opacity',
- operator: 'operator',
- order: 'order',
- orient: 'orient',
- orientation: 'orientation',
- origin: 'origin',
- overflow: 'overflow',
- overlineposition: 'overlinePosition',
- 'overline-position': 'overlinePosition',
- overlinethickness: 'overlineThickness',
- 'overline-thickness': 'overlineThickness',
- paintorder: 'paintOrder',
- 'paint-order': 'paintOrder',
- panose1: 'panose1',
- 'panose-1': 'panose1',
- pathlength: 'pathLength',
- patterncontentunits: 'patternContentUnits',
- patterntransform: 'patternTransform',
- patternunits: 'patternUnits',
- pointerevents: 'pointerEvents',
- 'pointer-events': 'pointerEvents',
- points: 'points',
- pointsatx: 'pointsAtX',
- pointsaty: 'pointsAtY',
- pointsatz: 'pointsAtZ',
- prefix: 'prefix',
- preservealpha: 'preserveAlpha',
- preserveaspectratio: 'preserveAspectRatio',
- primitiveunits: 'primitiveUnits',
- property: 'property',
- r: 'r',
- radius: 'radius',
- refx: 'refX',
- refy: 'refY',
- renderingintent: 'renderingIntent',
- 'rendering-intent': 'renderingIntent',
- repeatcount: 'repeatCount',
- repeatdur: 'repeatDur',
- requiredextensions: 'requiredExtensions',
- requiredfeatures: 'requiredFeatures',
- resource: 'resource',
- restart: 'restart',
- result: 'result',
- results: 'results',
- rotate: 'rotate',
- rx: 'rx',
- ry: 'ry',
- scale: 'scale',
- security: 'security',
- seed: 'seed',
- shaperendering: 'shapeRendering',
- 'shape-rendering': 'shapeRendering',
- slope: 'slope',
- spacing: 'spacing',
- specularconstant: 'specularConstant',
- specularexponent: 'specularExponent',
- speed: 'speed',
- spreadmethod: 'spreadMethod',
- startoffset: 'startOffset',
- stddeviation: 'stdDeviation',
- stemh: 'stemh',
- stemv: 'stemv',
- stitchtiles: 'stitchTiles',
- stopcolor: 'stopColor',
- 'stop-color': 'stopColor',
- stopopacity: 'stopOpacity',
- 'stop-opacity': 'stopOpacity',
- strikethroughposition: 'strikethroughPosition',
- 'strikethrough-position': 'strikethroughPosition',
- strikethroughthickness: 'strikethroughThickness',
- 'strikethrough-thickness': 'strikethroughThickness',
- string: 'string',
- stroke: 'stroke',
- strokedasharray: 'strokeDasharray',
- 'stroke-dasharray': 'strokeDasharray',
- strokedashoffset: 'strokeDashoffset',
- 'stroke-dashoffset': 'strokeDashoffset',
- strokelinecap: 'strokeLinecap',
- 'stroke-linecap': 'strokeLinecap',
- strokelinejoin: 'strokeLinejoin',
- 'stroke-linejoin': 'strokeLinejoin',
- strokemiterlimit: 'strokeMiterlimit',
- 'stroke-miterlimit': 'strokeMiterlimit',
- strokewidth: 'strokeWidth',
- 'stroke-width': 'strokeWidth',
- strokeopacity: 'strokeOpacity',
- 'stroke-opacity': 'strokeOpacity',
- suppresscontenteditablewarning: 'suppressContentEditableWarning',
- suppresshydrationwarning: 'suppressHydrationWarning',
- surfacescale: 'surfaceScale',
- systemlanguage: 'systemLanguage',
- tablevalues: 'tableValues',
- targetx: 'targetX',
- targety: 'targetY',
- textanchor: 'textAnchor',
- 'text-anchor': 'textAnchor',
- textdecoration: 'textDecoration',
- 'text-decoration': 'textDecoration',
- textlength: 'textLength',
- textrendering: 'textRendering',
- 'text-rendering': 'textRendering',
- to: 'to',
- transform: 'transform',
- typeof: 'typeof',
- u1: 'u1',
- u2: 'u2',
- underlineposition: 'underlinePosition',
- 'underline-position': 'underlinePosition',
- underlinethickness: 'underlineThickness',
- 'underline-thickness': 'underlineThickness',
- unicode: 'unicode',
- unicodebidi: 'unicodeBidi',
- 'unicode-bidi': 'unicodeBidi',
- unicoderange: 'unicodeRange',
- 'unicode-range': 'unicodeRange',
- unitsperem: 'unitsPerEm',
- 'units-per-em': 'unitsPerEm',
- unselectable: 'unselectable',
- valphabetic: 'vAlphabetic',
- 'v-alphabetic': 'vAlphabetic',
- values: 'values',
- vectoreffect: 'vectorEffect',
- 'vector-effect': 'vectorEffect',
- version: 'version',
- vertadvy: 'vertAdvY',
- 'vert-adv-y': 'vertAdvY',
- vertoriginx: 'vertOriginX',
- 'vert-origin-x': 'vertOriginX',
- vertoriginy: 'vertOriginY',
- 'vert-origin-y': 'vertOriginY',
- vhanging: 'vHanging',
- 'v-hanging': 'vHanging',
- videographic: 'vIdeographic',
- 'v-ideographic': 'vIdeographic',
- viewbox: 'viewBox',
- viewtarget: 'viewTarget',
- visibility: 'visibility',
- vmathematical: 'vMathematical',
- 'v-mathematical': 'vMathematical',
- vocab: 'vocab',
- widths: 'widths',
- wordspacing: 'wordSpacing',
- 'word-spacing': 'wordSpacing',
- writingmode: 'writingMode',
- 'writing-mode': 'writingMode',
- x1: 'x1',
- x2: 'x2',
- x: 'x',
- xchannelselector: 'xChannelSelector',
- xheight: 'xHeight',
- 'x-height': 'xHeight',
- xlinkactuate: 'xlinkActuate',
- 'xlink:actuate': 'xlinkActuate',
- xlinkarcrole: 'xlinkArcrole',
- 'xlink:arcrole': 'xlinkArcrole',
- xlinkhref: 'xlinkHref',
- 'xlink:href': 'xlinkHref',
- xlinkrole: 'xlinkRole',
- 'xlink:role': 'xlinkRole',
- xlinkshow: 'xlinkShow',
- 'xlink:show': 'xlinkShow',
- xlinktitle: 'xlinkTitle',
- 'xlink:title': 'xlinkTitle',
- xlinktype: 'xlinkType',
- 'xlink:type': 'xlinkType',
- xmlbase: 'xmlBase',
- 'xml:base': 'xmlBase',
- xmllang: 'xmlLang',
- 'xml:lang': 'xmlLang',
- xmlns: 'xmlns',
- 'xml:space': 'xmlSpace',
- xmlnsxlink: 'xmlnsXlink',
- 'xmlns:xlink': 'xmlnsXlink',
- xmlspace: 'xmlSpace',
- y1: 'y1',
- y2: 'y2',
- y: 'y',
- ychannelselector: 'yChannelSelector',
- z: 'z',
- zoomandpan: 'zoomAndPan'
- };
- var ariaProperties = {
- 'aria-current': 0,
-
- 'aria-details': 0,
- 'aria-disabled': 0,
-
- 'aria-hidden': 0,
-
- 'aria-invalid': 0,
-
- 'aria-keyshortcuts': 0,
- 'aria-label': 0,
- 'aria-roledescription': 0,
-
- 'aria-autocomplete': 0,
- 'aria-checked': 0,
- 'aria-expanded': 0,
- 'aria-haspopup': 0,
- 'aria-level': 0,
- 'aria-modal': 0,
- 'aria-multiline': 0,
- 'aria-multiselectable': 0,
- 'aria-orientation': 0,
- 'aria-placeholder': 0,
- 'aria-pressed': 0,
- 'aria-readonly': 0,
- 'aria-required': 0,
- 'aria-selected': 0,
- 'aria-sort': 0,
- 'aria-valuemax': 0,
- 'aria-valuemin': 0,
- 'aria-valuenow': 0,
- 'aria-valuetext': 0,
-
- 'aria-atomic': 0,
- 'aria-busy': 0,
- 'aria-live': 0,
- 'aria-relevant': 0,
-
- 'aria-dropeffect': 0,
- 'aria-grabbed': 0,
-
- 'aria-activedescendant': 0,
- 'aria-colcount': 0,
- 'aria-colindex': 0,
- 'aria-colspan': 0,
- 'aria-controls': 0,
- 'aria-describedby': 0,
- 'aria-errormessage': 0,
- 'aria-flowto': 0,
- 'aria-labelledby': 0,
- 'aria-owns': 0,
- 'aria-posinset': 0,
- 'aria-rowcount': 0,
- 'aria-rowindex': 0,
- 'aria-rowspan': 0,
- 'aria-setsize': 0
- };
- var warnedProperties = {};
- var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
- var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
- var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
- function validateProperty(tagName, name) {
- {
- if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {
- return true;
- }
- if (rARIACamel.test(name)) {
- var ariaName = 'aria-' + name.slice(4).toLowerCase();
- var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;
-
- if (correctName == null) {
- error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
- warnedProperties[name] = true;
- return true;
- }
- if (name !== correctName) {
- error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
- warnedProperties[name] = true;
- return true;
- }
- }
- if (rARIA.test(name)) {
- var lowerCasedName = name.toLowerCase();
- var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;
-
- if (standardName == null) {
- warnedProperties[name] = true;
- return false;
- }
- if (name !== standardName) {
- error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
- warnedProperties[name] = true;
- return true;
- }
- }
- }
- return true;
- }
- function warnInvalidARIAProps(type, props) {
- {
- var invalidProps = [];
- for (var key in props) {
- var isValid = validateProperty(type, key);
- if (!isValid) {
- invalidProps.push(key);
- }
- }
- var unknownPropString = invalidProps.map(function (prop) {
- return '`' + prop + '`';
- }).join(', ');
- if (invalidProps.length === 1) {
- error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
- } else if (invalidProps.length > 1) {
- error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
- }
- }
- }
- function validateProperties(type, props) {
- if (isCustomComponent(type, props)) {
- return;
- }
- warnInvalidARIAProps(type, props);
- }
- var didWarnValueNull = false;
- function validateProperties$1(type, props) {
- {
- if (type !== 'input' && type !== 'textarea' && type !== 'select') {
- return;
- }
- if (props != null && props.value === null && !didWarnValueNull) {
- didWarnValueNull = true;
- if (type === 'select' && props.multiple) {
- error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);
- } else {
- error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
- }
- }
- }
- }
- var validateProperty$1 = function () {};
- {
- var warnedProperties$1 = {};
- var _hasOwnProperty = Object.prototype.hasOwnProperty;
- var EVENT_NAME_REGEX = /^on./;
- var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
- var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
- var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
- validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
- if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
- return true;
- }
- var lowerCasedName = name.toLowerCase();
- if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
- error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');
- warnedProperties$1[name] = true;
- return true;
- }
- if (canUseEventSystem) {
- if (registrationNameModules.hasOwnProperty(name)) {
- return true;
- }
- var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
- if (registrationName != null) {
- error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
- warnedProperties$1[name] = true;
- return true;
- }
- if (EVENT_NAME_REGEX.test(name)) {
- error('Unknown event handler property `%s`. It will be ignored.', name);
- warnedProperties$1[name] = true;
- return true;
- }
- } else if (EVENT_NAME_REGEX.test(name)) {
-
-
-
- if (INVALID_EVENT_NAME_REGEX.test(name)) {
- error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
- }
- warnedProperties$1[name] = true;
- return true;
- }
- if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
- return true;
- }
- if (lowerCasedName === 'innerhtml') {
- error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
- warnedProperties$1[name] = true;
- return true;
- }
- if (lowerCasedName === 'aria') {
- error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
- warnedProperties$1[name] = true;
- return true;
- }
- if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
- error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
- warnedProperties$1[name] = true;
- return true;
- }
- if (typeof value === 'number' && isNaN(value)) {
- error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
- warnedProperties$1[name] = true;
- return true;
- }
- var propertyInfo = getPropertyInfo(name);
- var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;
- if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
- var standardName = possibleStandardNames[lowerCasedName];
- if (standardName !== name) {
- error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
- warnedProperties$1[name] = true;
- return true;
- }
- } else if (!isReserved && name !== lowerCasedName) {
-
-
- error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);
- warnedProperties$1[name] = true;
- return true;
- }
- if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
- if (value) {
- error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name);
- } else {
- error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
- }
- warnedProperties$1[name] = true;
- return true;
- }
-
- if (isReserved) {
- return true;
- }
- if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
- warnedProperties$1[name] = true;
- return false;
- }
- if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
- error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
- warnedProperties$1[name] = true;
- return true;
- }
- return true;
- };
- }
- var warnUnknownProperties = function (type, props, canUseEventSystem) {
- {
- var unknownProps = [];
- for (var key in props) {
- var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
- if (!isValid) {
- unknownProps.push(key);
- }
- }
- var unknownPropString = unknownProps.map(function (prop) {
- return '`' + prop + '`';
- }).join(', ');
- if (unknownProps.length === 1) {
- error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
- } else if (unknownProps.length > 1) {
- error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
- }
- }
- };
- function validateProperties$2(type, props, canUseEventSystem) {
- if (isCustomComponent(type, props)) {
- return;
- }
- warnUnknownProperties(type, props, canUseEventSystem);
- }
- var didWarnInvalidHydration = false;
- var didWarnShadyDOM = false;
- var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
- var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';
- var SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';
- var AUTOFOCUS = 'autoFocus';
- var CHILDREN = 'children';
- var STYLE = 'style';
- var HTML$1 = '__html';
- var HTML_NAMESPACE$1 = Namespaces.html;
- var warnedUnknownTags;
- var suppressHydrationWarning;
- var validatePropertiesInDevelopment;
- var warnForTextDifference;
- var warnForPropDifference;
- var warnForExtraAttributes;
- var warnForInvalidEventListener;
- var canDiffStyleForHydrationWarning;
- var normalizeMarkupForTextOrAttribute;
- var normalizeHTML;
- {
- warnedUnknownTags = {
-
-
-
-
- time: true,
-
- dialog: true,
-
-
-
-
-
- webview: true
- };
- validatePropertiesInDevelopment = function (type, props) {
- validateProperties(type, props);
- validateProperties$1(type, props);
- validateProperties$2(type, props,
-
- true);
- };
-
-
-
-
-
-
-
- canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode;
-
-
-
-
- var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
- var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
- normalizeMarkupForTextOrAttribute = function (markup) {
- var markupString = typeof markup === 'string' ? markup : '' + markup;
- return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');
- };
- warnForTextDifference = function (serverText, clientText) {
- if (didWarnInvalidHydration) {
- return;
- }
- var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
- var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
- if (normalizedServerText === normalizedClientText) {
- return;
- }
- didWarnInvalidHydration = true;
- error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
- };
- warnForPropDifference = function (propName, serverValue, clientValue) {
- if (didWarnInvalidHydration) {
- return;
- }
- var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
- var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
- if (normalizedServerValue === normalizedClientValue) {
- return;
- }
- didWarnInvalidHydration = true;
- error('Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
- };
- warnForExtraAttributes = function (attributeNames) {
- if (didWarnInvalidHydration) {
- return;
- }
- didWarnInvalidHydration = true;
- var names = [];
- attributeNames.forEach(function (name) {
- names.push(name);
- });
- error('Extra attributes from the server: %s', names);
- };
- warnForInvalidEventListener = function (registrationName, listener) {
- if (listener === false) {
- error('Expected `%s` listener to be a function, instead got `false`.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);
- } else {
- error('Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener);
- }
- };
-
- normalizeHTML = function (parent, html) {
-
-
-
-
- var testElement = parent.namespaceURI === HTML_NAMESPACE$1 ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
- testElement.innerHTML = html;
- return testElement.innerHTML;
- };
- }
- function ensureListeningTo(rootContainerElement, registrationName) {
- var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE;
- var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument;
- legacyListenToEvent(registrationName, doc);
- }
- function getOwnerDocumentFromRootContainer(rootContainerElement) {
- return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
- }
- function noop() {}
- function trapClickOnNonInteractiveElement(node) {
-
-
-
-
-
-
-
-
-
- node.onclick = noop;
- }
- function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
- for (var propKey in nextProps) {
- if (!nextProps.hasOwnProperty(propKey)) {
- continue;
- }
- var nextProp = nextProps[propKey];
- if (propKey === STYLE) {
- {
- if (nextProp) {
-
-
- Object.freeze(nextProp);
- }
- }
- setValueForStyles(domElement, nextProp);
- } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
- var nextHtml = nextProp ? nextProp[HTML$1] : undefined;
- if (nextHtml != null) {
- setInnerHTML(domElement, nextHtml);
- }
- } else if (propKey === CHILDREN) {
- if (typeof nextProp === 'string') {
-
-
-
-
- var canSetTextContent = tag !== 'textarea' || nextProp !== '';
- if (canSetTextContent) {
- setTextContent(domElement, nextProp);
- }
- } else if (typeof nextProp === 'number') {
- setTextContent(domElement, '' + nextProp);
- }
- } else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameModules.hasOwnProperty(propKey)) {
- if (nextProp != null) {
- if ( typeof nextProp !== 'function') {
- warnForInvalidEventListener(propKey, nextProp);
- }
- ensureListeningTo(rootContainerElement, propKey);
- }
- } else if (nextProp != null) {
- setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
- }
- }
- }
- function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
-
- for (var i = 0; i < updatePayload.length; i += 2) {
- var propKey = updatePayload[i];
- var propValue = updatePayload[i + 1];
- if (propKey === STYLE) {
- setValueForStyles(domElement, propValue);
- } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
- setInnerHTML(domElement, propValue);
- } else if (propKey === CHILDREN) {
- setTextContent(domElement, propValue);
- } else {
- setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
- }
- }
- }
- function createElement(type, props, rootContainerElement, parentNamespace) {
- var isCustomComponentTag;
-
- var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
- var domElement;
- var namespaceURI = parentNamespace;
- if (namespaceURI === HTML_NAMESPACE$1) {
- namespaceURI = getIntrinsicNamespace(type);
- }
- if (namespaceURI === HTML_NAMESPACE$1) {
- {
- isCustomComponentTag = isCustomComponent(type, props);
-
- if (!isCustomComponentTag && type !== type.toLowerCase()) {
- error('<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type);
- }
- }
- if (type === 'script') {
-
-
- var div = ownerDocument.createElement('div');
- div.innerHTML = '<script><' + '/script>';
-
- var firstChild = div.firstChild;
- domElement = div.removeChild(firstChild);
- } else if (typeof props.is === 'string') {
-
- domElement = ownerDocument.createElement(type, {
- is: props.is
- });
- } else {
-
-
-
- domElement = ownerDocument.createElement(type);
-
-
-
-
-
-
-
- if (type === 'select') {
- var node = domElement;
- if (props.multiple) {
- node.multiple = true;
- } else if (props.size) {
-
-
-
-
- node.size = props.size;
- }
- }
- }
- } else {
- domElement = ownerDocument.createElementNS(namespaceURI, type);
- }
- {
- if (namespaceURI === HTML_NAMESPACE$1) {
- if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {
- warnedUnknownTags[type] = true;
- error('The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);
- }
- }
- }
- return domElement;
- }
- function createTextNode(text, rootContainerElement) {
- return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
- }
- function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
- var isCustomComponentTag = isCustomComponent(tag, rawProps);
- {
- validatePropertiesInDevelopment(tag, rawProps);
- if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
- error('%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
- didWarnShadyDOM = true;
- }
- }
- var props;
- switch (tag) {
- case 'iframe':
- case 'object':
- case 'embed':
- trapBubbledEvent(TOP_LOAD, domElement);
- props = rawProps;
- break;
- case 'video':
- case 'audio':
-
- for (var i = 0; i < mediaEventTypes.length; i++) {
- trapBubbledEvent(mediaEventTypes[i], domElement);
- }
- props = rawProps;
- break;
- case 'source':
- trapBubbledEvent(TOP_ERROR, domElement);
- props = rawProps;
- break;
- case 'img':
- case 'image':
- case 'link':
- trapBubbledEvent(TOP_ERROR, domElement);
- trapBubbledEvent(TOP_LOAD, domElement);
- props = rawProps;
- break;
- case 'form':
- trapBubbledEvent(TOP_RESET, domElement);
- trapBubbledEvent(TOP_SUBMIT, domElement);
- props = rawProps;
- break;
- case 'details':
- trapBubbledEvent(TOP_TOGGLE, domElement);
- props = rawProps;
- break;
- case 'input':
- initWrapperState(domElement, rawProps);
- props = getHostProps(domElement, rawProps);
- trapBubbledEvent(TOP_INVALID, domElement);
-
- ensureListeningTo(rootContainerElement, 'onChange');
- break;
- case 'option':
- validateProps(domElement, rawProps);
- props = getHostProps$1(domElement, rawProps);
- break;
- case 'select':
- initWrapperState$1(domElement, rawProps);
- props = getHostProps$2(domElement, rawProps);
- trapBubbledEvent(TOP_INVALID, domElement);
-
- ensureListeningTo(rootContainerElement, 'onChange');
- break;
- case 'textarea':
- initWrapperState$2(domElement, rawProps);
- props = getHostProps$3(domElement, rawProps);
- trapBubbledEvent(TOP_INVALID, domElement);
-
- ensureListeningTo(rootContainerElement, 'onChange');
- break;
- default:
- props = rawProps;
- }
- assertValidProps(tag, props);
- setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);
- switch (tag) {
- case 'input':
-
-
- track(domElement);
- postMountWrapper(domElement, rawProps, false);
- break;
- case 'textarea':
-
-
- track(domElement);
- postMountWrapper$3(domElement);
- break;
- case 'option':
- postMountWrapper$1(domElement, rawProps);
- break;
- case 'select':
- postMountWrapper$2(domElement, rawProps);
- break;
- default:
- if (typeof props.onClick === 'function') {
-
- trapClickOnNonInteractiveElement(domElement);
- }
- break;
- }
- }
- function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
- {
- validatePropertiesInDevelopment(tag, nextRawProps);
- }
- var updatePayload = null;
- var lastProps;
- var nextProps;
- switch (tag) {
- case 'input':
- lastProps = getHostProps(domElement, lastRawProps);
- nextProps = getHostProps(domElement, nextRawProps);
- updatePayload = [];
- break;
- case 'option':
- lastProps = getHostProps$1(domElement, lastRawProps);
- nextProps = getHostProps$1(domElement, nextRawProps);
- updatePayload = [];
- break;
- case 'select':
- lastProps = getHostProps$2(domElement, lastRawProps);
- nextProps = getHostProps$2(domElement, nextRawProps);
- updatePayload = [];
- break;
- case 'textarea':
- lastProps = getHostProps$3(domElement, lastRawProps);
- nextProps = getHostProps$3(domElement, nextRawProps);
- updatePayload = [];
- break;
- default:
- lastProps = lastRawProps;
- nextProps = nextRawProps;
- if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {
-
- trapClickOnNonInteractiveElement(domElement);
- }
- break;
- }
- assertValidProps(tag, nextProps);
- var propKey;
- var styleName;
- var styleUpdates = null;
- for (propKey in lastProps) {
- if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
- continue;
- }
- if (propKey === STYLE) {
- var lastStyle = lastProps[propKey];
- for (styleName in lastStyle) {
- if (lastStyle.hasOwnProperty(styleName)) {
- if (!styleUpdates) {
- styleUpdates = {};
- }
- styleUpdates[styleName] = '';
- }
- }
- } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ; else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameModules.hasOwnProperty(propKey)) {
-
-
-
- if (!updatePayload) {
- updatePayload = [];
- }
- } else {
-
-
- (updatePayload = updatePayload || []).push(propKey, null);
- }
- }
- for (propKey in nextProps) {
- var nextProp = nextProps[propKey];
- var lastProp = lastProps != null ? lastProps[propKey] : undefined;
- if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
- continue;
- }
- if (propKey === STYLE) {
- {
- if (nextProp) {
-
-
- Object.freeze(nextProp);
- }
- }
- if (lastProp) {
-
- for (styleName in lastProp) {
- if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
- if (!styleUpdates) {
- styleUpdates = {};
- }
- styleUpdates[styleName] = '';
- }
- }
- for (styleName in nextProp) {
- if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
- if (!styleUpdates) {
- styleUpdates = {};
- }
- styleUpdates[styleName] = nextProp[styleName];
- }
- }
- } else {
-
- if (!styleUpdates) {
- if (!updatePayload) {
- updatePayload = [];
- }
- updatePayload.push(propKey, styleUpdates);
- }
- styleUpdates = nextProp;
- }
- } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
- var nextHtml = nextProp ? nextProp[HTML$1] : undefined;
- var lastHtml = lastProp ? lastProp[HTML$1] : undefined;
- if (nextHtml != null) {
- if (lastHtml !== nextHtml) {
- (updatePayload = updatePayload || []).push(propKey, nextHtml);
- }
- }
- } else if (propKey === CHILDREN) {
- if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) {
- (updatePayload = updatePayload || []).push(propKey, '' + nextProp);
- }
- } else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (registrationNameModules.hasOwnProperty(propKey)) {
- if (nextProp != null) {
-
- if ( typeof nextProp !== 'function') {
- warnForInvalidEventListener(propKey, nextProp);
- }
- ensureListeningTo(rootContainerElement, propKey);
- }
- if (!updatePayload && lastProp !== nextProp) {
-
-
-
- updatePayload = [];
- }
- } else {
-
-
- (updatePayload = updatePayload || []).push(propKey, nextProp);
- }
- }
- if (styleUpdates) {
- {
- validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);
- }
- (updatePayload = updatePayload || []).push(STYLE, styleUpdates);
- }
- return updatePayload;
- }
- function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
-
-
-
- if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {
- updateChecked(domElement, nextRawProps);
- }
- var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
- var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
- updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);
-
- switch (tag) {
- case 'input':
-
-
-
- updateWrapper(domElement, nextRawProps);
- break;
- case 'textarea':
- updateWrapper$1(domElement, nextRawProps);
- break;
- case 'select':
-
-
- postUpdateWrapper(domElement, nextRawProps);
- break;
- }
- }
- function getPossibleStandardName(propName) {
- {
- var lowerCasedName = propName.toLowerCase();
- if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
- return null;
- }
- return possibleStandardNames[lowerCasedName] || null;
- }
- }
- function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {
- var isCustomComponentTag;
- var extraAttributeNames;
- {
- suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING] === true;
- isCustomComponentTag = isCustomComponent(tag, rawProps);
- validatePropertiesInDevelopment(tag, rawProps);
- if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
- error('%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
- didWarnShadyDOM = true;
- }
- }
- switch (tag) {
- case 'iframe':
- case 'object':
- case 'embed':
- trapBubbledEvent(TOP_LOAD, domElement);
- break;
- case 'video':
- case 'audio':
-
- for (var i = 0; i < mediaEventTypes.length; i++) {
- trapBubbledEvent(mediaEventTypes[i], domElement);
- }
- break;
- case 'source':
- trapBubbledEvent(TOP_ERROR, domElement);
- break;
- case 'img':
- case 'image':
- case 'link':
- trapBubbledEvent(TOP_ERROR, domElement);
- trapBubbledEvent(TOP_LOAD, domElement);
- break;
- case 'form':
- trapBubbledEvent(TOP_RESET, domElement);
- trapBubbledEvent(TOP_SUBMIT, domElement);
- break;
- case 'details':
- trapBubbledEvent(TOP_TOGGLE, domElement);
- break;
- case 'input':
- initWrapperState(domElement, rawProps);
- trapBubbledEvent(TOP_INVALID, domElement);
-
- ensureListeningTo(rootContainerElement, 'onChange');
- break;
- case 'option':
- validateProps(domElement, rawProps);
- break;
- case 'select':
- initWrapperState$1(domElement, rawProps);
- trapBubbledEvent(TOP_INVALID, domElement);
-
- ensureListeningTo(rootContainerElement, 'onChange');
- break;
- case 'textarea':
- initWrapperState$2(domElement, rawProps);
- trapBubbledEvent(TOP_INVALID, domElement);
-
- ensureListeningTo(rootContainerElement, 'onChange');
- break;
- }
- assertValidProps(tag, rawProps);
- {
- extraAttributeNames = new Set();
- var attributes = domElement.attributes;
- for (var _i = 0; _i < attributes.length; _i++) {
- var name = attributes[_i].name.toLowerCase();
- switch (name) {
-
- case 'data-reactroot':
- break;
-
-
- case 'value':
- break;
- case 'checked':
- break;
- case 'selected':
- break;
- default:
-
-
- extraAttributeNames.add(attributes[_i].name);
- }
- }
- }
- var updatePayload = null;
- for (var propKey in rawProps) {
- if (!rawProps.hasOwnProperty(propKey)) {
- continue;
- }
- var nextProp = rawProps[propKey];
- if (propKey === CHILDREN) {
-
-
-
-
-
-
-
-
-
- if (typeof nextProp === 'string') {
- if (domElement.textContent !== nextProp) {
- if ( !suppressHydrationWarning) {
- warnForTextDifference(domElement.textContent, nextProp);
- }
- updatePayload = [CHILDREN, nextProp];
- }
- } else if (typeof nextProp === 'number') {
- if (domElement.textContent !== '' + nextProp) {
- if ( !suppressHydrationWarning) {
- warnForTextDifference(domElement.textContent, nextProp);
- }
- updatePayload = [CHILDREN, '' + nextProp];
- }
- }
- } else if (registrationNameModules.hasOwnProperty(propKey)) {
- if (nextProp != null) {
- if ( typeof nextProp !== 'function') {
- warnForInvalidEventListener(propKey, nextProp);
- }
- ensureListeningTo(rootContainerElement, propKey);
- }
- } else if (
- typeof isCustomComponentTag === 'boolean') {
-
- var serverValue = void 0;
- var propertyInfo = getPropertyInfo(propKey);
- if (suppressHydrationWarning) ; else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING ||
-
- propKey === 'value' || propKey === 'checked' || propKey === 'selected') ; else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
- var serverHTML = domElement.innerHTML;
- var nextHtml = nextProp ? nextProp[HTML$1] : undefined;
- var expectedHTML = normalizeHTML(domElement, nextHtml != null ? nextHtml : '');
- if (expectedHTML !== serverHTML) {
- warnForPropDifference(propKey, serverHTML, expectedHTML);
- }
- } else if (propKey === STYLE) {
-
- extraAttributeNames.delete(propKey);
- if (canDiffStyleForHydrationWarning) {
- var expectedStyle = createDangerousStringForStyles(nextProp);
- serverValue = domElement.getAttribute('style');
- if (expectedStyle !== serverValue) {
- warnForPropDifference(propKey, serverValue, expectedStyle);
- }
- }
- } else if (isCustomComponentTag) {
-
- extraAttributeNames.delete(propKey.toLowerCase());
- serverValue = getValueForAttribute(domElement, propKey, nextProp);
- if (nextProp !== serverValue) {
- warnForPropDifference(propKey, serverValue, nextProp);
- }
- } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
- var isMismatchDueToBadCasing = false;
- if (propertyInfo !== null) {
-
- extraAttributeNames.delete(propertyInfo.attributeName);
- serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
- } else {
- var ownNamespace = parentNamespace;
- if (ownNamespace === HTML_NAMESPACE$1) {
- ownNamespace = getIntrinsicNamespace(tag);
- }
- if (ownNamespace === HTML_NAMESPACE$1) {
-
- extraAttributeNames.delete(propKey.toLowerCase());
- } else {
- var standardName = getPossibleStandardName(propKey);
- if (standardName !== null && standardName !== propKey) {
-
-
-
-
-
- isMismatchDueToBadCasing = true;
- extraAttributeNames.delete(standardName);
- }
- extraAttributeNames.delete(propKey);
- }
- serverValue = getValueForAttribute(domElement, propKey, nextProp);
- }
- if (nextProp !== serverValue && !isMismatchDueToBadCasing) {
- warnForPropDifference(propKey, serverValue, nextProp);
- }
- }
- }
- }
- {
-
- if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {
-
- warnForExtraAttributes(extraAttributeNames);
- }
- }
- switch (tag) {
- case 'input':
-
-
- track(domElement);
- postMountWrapper(domElement, rawProps, true);
- break;
- case 'textarea':
-
-
- track(domElement);
- postMountWrapper$3(domElement);
- break;
- case 'select':
- case 'option':
-
-
-
-
-
- break;
- default:
- if (typeof rawProps.onClick === 'function') {
-
- trapClickOnNonInteractiveElement(domElement);
- }
- break;
- }
- return updatePayload;
- }
- function diffHydratedText(textNode, text) {
- var isDifferent = textNode.nodeValue !== text;
- return isDifferent;
- }
- function warnForUnmatchedText(textNode, text) {
- {
- warnForTextDifference(textNode.nodeValue, text);
- }
- }
- function warnForDeletedHydratableElement(parentNode, child) {
- {
- if (didWarnInvalidHydration) {
- return;
- }
- didWarnInvalidHydration = true;
- error('Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
- }
- }
- function warnForDeletedHydratableText(parentNode, child) {
- {
- if (didWarnInvalidHydration) {
- return;
- }
- didWarnInvalidHydration = true;
- error('Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
- }
- }
- function warnForInsertedHydratedElement(parentNode, tag, props) {
- {
- if (didWarnInvalidHydration) {
- return;
- }
- didWarnInvalidHydration = true;
- error('Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());
- }
- }
- function warnForInsertedHydratedText(parentNode, text) {
- {
- if (text === '') {
-
-
-
-
- return;
- }
- if (didWarnInvalidHydration) {
- return;
- }
- didWarnInvalidHydration = true;
- error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
- }
- }
- function restoreControlledState$3(domElement, tag, props) {
- switch (tag) {
- case 'input':
- restoreControlledState(domElement, props);
- return;
- case 'textarea':
- restoreControlledState$2(domElement, props);
- return;
- case 'select':
- restoreControlledState$1(domElement, props);
- return;
- }
- }
- function getActiveElement(doc) {
- doc = doc || (typeof document !== 'undefined' ? document : undefined);
- if (typeof doc === 'undefined') {
- return null;
- }
- try {
- return doc.activeElement || doc.body;
- } catch (e) {
- return doc.body;
- }
- }
-
- function getLeafNode(node) {
- while (node && node.firstChild) {
- node = node.firstChild;
- }
- return node;
- }
-
- function getSiblingNode(node) {
- while (node) {
- if (node.nextSibling) {
- return node.nextSibling;
- }
- node = node.parentNode;
- }
- }
-
- function getNodeForCharacterOffset(root, offset) {
- var node = getLeafNode(root);
- var nodeStart = 0;
- var nodeEnd = 0;
- while (node) {
- if (node.nodeType === TEXT_NODE) {
- nodeEnd = nodeStart + node.textContent.length;
- if (nodeStart <= offset && nodeEnd >= offset) {
- return {
- node: node,
- offset: offset - nodeStart
- };
- }
- nodeStart = nodeEnd;
- }
- node = getLeafNode(getSiblingNode(node));
- }
- }
-
- function getOffsets(outerNode) {
- var ownerDocument = outerNode.ownerDocument;
- var win = ownerDocument && ownerDocument.defaultView || window;
- var selection = win.getSelection && win.getSelection();
- if (!selection || selection.rangeCount === 0) {
- return null;
- }
- var anchorNode = selection.anchorNode,
- anchorOffset = selection.anchorOffset,
- focusNode = selection.focusNode,
- focusOffset = selection.focusOffset;
-
-
-
-
-
-
- try {
-
- anchorNode.nodeType;
- focusNode.nodeType;
-
- } catch (e) {
- return null;
- }
- return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
- }
-
- function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
- var length = 0;
- var start = -1;
- var end = -1;
- var indexWithinAnchor = 0;
- var indexWithinFocus = 0;
- var node = outerNode;
- var parentNode = null;
- outer: while (true) {
- var next = null;
- while (true) {
- if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
- start = length + anchorOffset;
- }
- if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
- end = length + focusOffset;
- }
- if (node.nodeType === TEXT_NODE) {
- length += node.nodeValue.length;
- }
- if ((next = node.firstChild) === null) {
- break;
- }
- parentNode = node;
- node = next;
- }
- while (true) {
- if (node === outerNode) {
-
-
-
-
- break outer;
- }
- if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
- start = length;
- }
- if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
- end = length;
- }
- if ((next = node.nextSibling) !== null) {
- break;
- }
- node = parentNode;
- parentNode = node.parentNode;
- }
- node = next;
- }
- if (start === -1 || end === -1) {
-
-
- return null;
- }
- return {
- start: start,
- end: end
- };
- }
-
- function setOffsets(node, offsets) {
- var doc = node.ownerDocument || document;
- var win = doc && doc.defaultView || window;
-
-
- if (!win.getSelection) {
- return;
- }
- var selection = win.getSelection();
- var length = node.textContent.length;
- var start = Math.min(offsets.start, length);
- var end = offsets.end === undefined ? start : Math.min(offsets.end, length);
-
- if (!selection.extend && start > end) {
- var temp = end;
- end = start;
- start = temp;
- }
- var startMarker = getNodeForCharacterOffset(node, start);
- var endMarker = getNodeForCharacterOffset(node, end);
- if (startMarker && endMarker) {
- if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
- return;
- }
- var range = doc.createRange();
- range.setStart(startMarker.node, startMarker.offset);
- selection.removeAllRanges();
- if (start > end) {
- selection.addRange(range);
- selection.extend(endMarker.node, endMarker.offset);
- } else {
- range.setEnd(endMarker.node, endMarker.offset);
- selection.addRange(range);
- }
- }
- }
- function isTextNode(node) {
- return node && node.nodeType === TEXT_NODE;
- }
- function containsNode(outerNode, innerNode) {
- if (!outerNode || !innerNode) {
- return false;
- } else if (outerNode === innerNode) {
- return true;
- } else if (isTextNode(outerNode)) {
- return false;
- } else if (isTextNode(innerNode)) {
- return containsNode(outerNode, innerNode.parentNode);
- } else if ('contains' in outerNode) {
- return outerNode.contains(innerNode);
- } else if (outerNode.compareDocumentPosition) {
- return !!(outerNode.compareDocumentPosition(innerNode) & 16);
- } else {
- return false;
- }
- }
- function isInDocument(node) {
- return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
- }
- function isSameOriginFrame(iframe) {
- try {
-
-
-
-
-
-
-
- return typeof iframe.contentWindow.location.href === 'string';
- } catch (err) {
- return false;
- }
- }
- function getActiveElementDeep() {
- var win = window;
- var element = getActiveElement();
- while (element instanceof win.HTMLIFrameElement) {
- if (isSameOriginFrame(element)) {
- win = element.contentWindow;
- } else {
- return element;
- }
- element = getActiveElement(win.document);
- }
- return element;
- }
-
-
- function hasSelectionCapabilities(elem) {
- var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
- return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');
- }
- function getSelectionInformation() {
- var focusedElem = getActiveElementDeep();
- return {
-
- activeElementDetached: null,
- focusedElem: focusedElem,
- selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
- };
- }
-
- function restoreSelection(priorSelectionInformation) {
- var curFocusedElem = getActiveElementDeep();
- var priorFocusedElem = priorSelectionInformation.focusedElem;
- var priorSelectionRange = priorSelectionInformation.selectionRange;
- if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
- if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
- setSelection(priorFocusedElem, priorSelectionRange);
- }
- var ancestors = [];
- var ancestor = priorFocusedElem;
- while (ancestor = ancestor.parentNode) {
- if (ancestor.nodeType === ELEMENT_NODE) {
- ancestors.push({
- element: ancestor,
- left: ancestor.scrollLeft,
- top: ancestor.scrollTop
- });
- }
- }
- if (typeof priorFocusedElem.focus === 'function') {
- priorFocusedElem.focus();
- }
- for (var i = 0; i < ancestors.length; i++) {
- var info = ancestors[i];
- info.element.scrollLeft = info.left;
- info.element.scrollTop = info.top;
- }
- }
- }
-
- function getSelection(input) {
- var selection;
- if ('selectionStart' in input) {
-
- selection = {
- start: input.selectionStart,
- end: input.selectionEnd
- };
- } else {
-
- selection = getOffsets(input);
- }
- return selection || {
- start: 0,
- end: 0
- };
- }
-
- function setSelection(input, offsets) {
- var start = offsets.start,
- end = offsets.end;
- if (end === undefined) {
- end = start;
- }
- if ('selectionStart' in input) {
- input.selectionStart = start;
- input.selectionEnd = Math.min(end, input.value.length);
- } else {
- setOffsets(input, offsets);
- }
- }
- var validateDOMNesting = function () {};
- var updatedAncestorInfo = function () {};
- {
-
-
-
-
-
-
-
-
-
-
-
- var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];
- var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',
-
-
- 'foreignObject', 'desc', 'title'];
- var buttonScopeTags = inScopeTags.concat(['button']);
- var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
- var emptyAncestorInfo = {
- current: null,
- formTag: null,
- aTagInScope: null,
- buttonTagInScope: null,
- nobrTagInScope: null,
- pTagInButtonScope: null,
- listItemTagAutoclosing: null,
- dlItemTagAutoclosing: null
- };
- updatedAncestorInfo = function (oldInfo, tag) {
- var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
- var info = {
- tag: tag
- };
- if (inScopeTags.indexOf(tag) !== -1) {
- ancestorInfo.aTagInScope = null;
- ancestorInfo.buttonTagInScope = null;
- ancestorInfo.nobrTagInScope = null;
- }
- if (buttonScopeTags.indexOf(tag) !== -1) {
- ancestorInfo.pTagInButtonScope = null;
- }
-
- if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
- ancestorInfo.listItemTagAutoclosing = null;
- ancestorInfo.dlItemTagAutoclosing = null;
- }
- ancestorInfo.current = info;
- if (tag === 'form') {
- ancestorInfo.formTag = info;
- }
- if (tag === 'a') {
- ancestorInfo.aTagInScope = info;
- }
- if (tag === 'button') {
- ancestorInfo.buttonTagInScope = info;
- }
- if (tag === 'nobr') {
- ancestorInfo.nobrTagInScope = info;
- }
- if (tag === 'p') {
- ancestorInfo.pTagInButtonScope = info;
- }
- if (tag === 'li') {
- ancestorInfo.listItemTagAutoclosing = info;
- }
- if (tag === 'dd' || tag === 'dt') {
- ancestorInfo.dlItemTagAutoclosing = info;
- }
- return ancestorInfo;
- };
-
- var isTagValidWithParent = function (tag, parentTag) {
-
- switch (parentTag) {
-
- case 'select':
- return tag === 'option' || tag === 'optgroup' || tag === '#text';
- case 'optgroup':
- return tag === 'option' || tag === '#text';
-
-
- case 'option':
- return tag === '#text';
-
-
-
-
-
- case 'tr':
- return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
-
- case 'tbody':
- case 'thead':
- case 'tfoot':
- return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
-
- case 'colgroup':
- return tag === 'col' || tag === 'template';
-
- case 'table':
- return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
-
- case 'head':
- return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
-
- case 'html':
- return tag === 'head' || tag === 'body' || tag === 'frameset';
- case 'frameset':
- return tag === 'frame';
- case '#document':
- return tag === 'html';
- }
-
-
- switch (tag) {
- case 'h1':
- case 'h2':
- case 'h3':
- case 'h4':
- case 'h5':
- case 'h6':
- return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
- case 'rp':
- case 'rt':
- return impliedEndTags.indexOf(parentTag) === -1;
- case 'body':
- case 'caption':
- case 'col':
- case 'colgroup':
- case 'frameset':
- case 'frame':
- case 'head':
- case 'html':
- case 'tbody':
- case 'td':
- case 'tfoot':
- case 'th':
- case 'thead':
- case 'tr':
-
-
-
-
- return parentTag == null;
- }
- return true;
- };
-
- var findInvalidAncestorForTag = function (tag, ancestorInfo) {
- switch (tag) {
- case 'address':
- case 'article':
- case 'aside':
- case 'blockquote':
- case 'center':
- case 'details':
- case 'dialog':
- case 'dir':
- case 'div':
- case 'dl':
- case 'fieldset':
- case 'figcaption':
- case 'figure':
- case 'footer':
- case 'header':
- case 'hgroup':
- case 'main':
- case 'menu':
- case 'nav':
- case 'ol':
- case 'p':
- case 'section':
- case 'summary':
- case 'ul':
- case 'pre':
- case 'listing':
- case 'table':
- case 'hr':
- case 'xmp':
- case 'h1':
- case 'h2':
- case 'h3':
- case 'h4':
- case 'h5':
- case 'h6':
- return ancestorInfo.pTagInButtonScope;
- case 'form':
- return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
- case 'li':
- return ancestorInfo.listItemTagAutoclosing;
- case 'dd':
- case 'dt':
- return ancestorInfo.dlItemTagAutoclosing;
- case 'button':
- return ancestorInfo.buttonTagInScope;
- case 'a':
-
-
- return ancestorInfo.aTagInScope;
- case 'nobr':
- return ancestorInfo.nobrTagInScope;
- }
- return null;
- };
- var didWarn$1 = {};
- validateDOMNesting = function (childTag, childText, ancestorInfo) {
- ancestorInfo = ancestorInfo || emptyAncestorInfo;
- var parentInfo = ancestorInfo.current;
- var parentTag = parentInfo && parentInfo.tag;
- if (childText != null) {
- if (childTag != null) {
- error('validateDOMNesting: when childText is passed, childTag should be null');
- }
- childTag = '#text';
- }
- var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
- var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
- var invalidParentOrAncestor = invalidParent || invalidAncestor;
- if (!invalidParentOrAncestor) {
- return;
- }
- var ancestorTag = invalidParentOrAncestor.tag;
- var addendum = getCurrentFiberStackInDev();
- var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum;
- if (didWarn$1[warnKey]) {
- return;
- }
- didWarn$1[warnKey] = true;
- var tagDisplayName = childTag;
- var whitespaceInfo = '';
- if (childTag === '#text') {
- if (/\S/.test(childText)) {
- tagDisplayName = 'Text nodes';
- } else {
- tagDisplayName = 'Whitespace text nodes';
- whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.';
- }
- } else {
- tagDisplayName = '<' + childTag + '>';
- }
- if (invalidParent) {
- var info = '';
- if (ancestorTag === 'table' && childTag === 'tr') {
- info += ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' + 'the browser.';
- }
- error('validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info);
- } else {
- error('validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.', tagDisplayName, ancestorTag);
- }
- };
- }
- var SUPPRESS_HYDRATION_WARNING$1;
- {
- SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';
- }
- var SUSPENSE_START_DATA = '$';
- var SUSPENSE_END_DATA = '/$';
- var SUSPENSE_PENDING_START_DATA = '$?';
- var SUSPENSE_FALLBACK_START_DATA = '$!';
- var STYLE$1 = 'style';
- var eventsEnabled = null;
- var selectionInformation = null;
- function shouldAutoFocusHostComponent(type, props) {
- switch (type) {
- case 'button':
- case 'input':
- case 'select':
- case 'textarea':
- return !!props.autoFocus;
- }
- return false;
- }
- function getRootHostContext(rootContainerInstance) {
- var type;
- var namespace;
- var nodeType = rootContainerInstance.nodeType;
- switch (nodeType) {
- case DOCUMENT_NODE:
- case DOCUMENT_FRAGMENT_NODE:
- {
- type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';
- var root = rootContainerInstance.documentElement;
- namespace = root ? root.namespaceURI : getChildNamespace(null, '');
- break;
- }
- default:
- {
- var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
- var ownNamespace = container.namespaceURI || null;
- type = container.tagName;
- namespace = getChildNamespace(ownNamespace, type);
- break;
- }
- }
- {
- var validatedTag = type.toLowerCase();
- var ancestorInfo = updatedAncestorInfo(null, validatedTag);
- return {
- namespace: namespace,
- ancestorInfo: ancestorInfo
- };
- }
- }
- function getChildHostContext(parentHostContext, type, rootContainerInstance) {
- {
- var parentHostContextDev = parentHostContext;
- var namespace = getChildNamespace(parentHostContextDev.namespace, type);
- var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
- return {
- namespace: namespace,
- ancestorInfo: ancestorInfo
- };
- }
- }
- function getPublicInstance(instance) {
- return instance;
- }
- function prepareForCommit(containerInfo) {
- eventsEnabled = isEnabled();
- selectionInformation = getSelectionInformation();
- setEnabled(false);
- }
- function resetAfterCommit(containerInfo) {
- restoreSelection(selectionInformation);
- setEnabled(eventsEnabled);
- eventsEnabled = null;
- selectionInformation = null;
- }
- function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
- var parentNamespace;
- {
-
- var hostContextDev = hostContext;
- validateDOMNesting(type, null, hostContextDev.ancestorInfo);
- if (typeof props.children === 'string' || typeof props.children === 'number') {
- var string = '' + props.children;
- var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
- validateDOMNesting(null, string, ownAncestorInfo);
- }
- parentNamespace = hostContextDev.namespace;
- }
- var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
- precacheFiberNode(internalInstanceHandle, domElement);
- updateFiberProps(domElement, props);
- return domElement;
- }
- function appendInitialChild(parentInstance, child) {
- parentInstance.appendChild(child);
- }
- function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
- setInitialProperties(domElement, type, props, rootContainerInstance);
- return shouldAutoFocusHostComponent(type, props);
- }
- function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
- {
- var hostContextDev = hostContext;
- if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {
- var string = '' + newProps.children;
- var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
- validateDOMNesting(null, string, ownAncestorInfo);
- }
- }
- return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);
- }
- function shouldSetTextContent(type, props) {
- return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
- }
- function shouldDeprioritizeSubtree(type, props) {
- return !!props.hidden;
- }
- function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
- {
- var hostContextDev = hostContext;
- validateDOMNesting(null, text, hostContextDev.ancestorInfo);
- }
- var textNode = createTextNode(text, rootContainerInstance);
- precacheFiberNode(internalInstanceHandle, textNode);
- return textNode;
- }
-
-
- var scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;
- var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;
- var noTimeout = -1;
- function commitMount(domElement, type, newProps, internalInstanceHandle) {
-
-
-
-
-
-
- if (shouldAutoFocusHostComponent(type, newProps)) {
- domElement.focus();
- }
- }
- function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
-
-
- updateFiberProps(domElement, newProps);
- updateProperties(domElement, updatePayload, type, oldProps, newProps);
- }
- function resetTextContent(domElement) {
- setTextContent(domElement, '');
- }
- function commitTextUpdate(textInstance, oldText, newText) {
- textInstance.nodeValue = newText;
- }
- function appendChild(parentInstance, child) {
- parentInstance.appendChild(child);
- }
- function appendChildToContainer(container, child) {
- var parentNode;
- if (container.nodeType === COMMENT_NODE) {
- parentNode = container.parentNode;
- parentNode.insertBefore(child, container);
- } else {
- parentNode = container;
- parentNode.appendChild(child);
- }
-
-
-
-
-
-
-
- var reactRootContainer = container._reactRootContainer;
- if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {
-
- trapClickOnNonInteractiveElement(parentNode);
- }
- }
- function insertBefore(parentInstance, child, beforeChild) {
- parentInstance.insertBefore(child, beforeChild);
- }
- function insertInContainerBefore(container, child, beforeChild) {
- if (container.nodeType === COMMENT_NODE) {
- container.parentNode.insertBefore(child, beforeChild);
- } else {
- container.insertBefore(child, beforeChild);
- }
- }
- function removeChild(parentInstance, child) {
- parentInstance.removeChild(child);
- }
- function removeChildFromContainer(container, child) {
- if (container.nodeType === COMMENT_NODE) {
- container.parentNode.removeChild(child);
- } else {
- container.removeChild(child);
- }
- }
- function hideInstance(instance) {
-
- instance = instance;
- var style = instance.style;
- if (typeof style.setProperty === 'function') {
- style.setProperty('display', 'none', 'important');
- } else {
- style.display = 'none';
- }
- }
- function hideTextInstance(textInstance) {
- textInstance.nodeValue = '';
- }
- function unhideInstance(instance, props) {
- instance = instance;
- var styleProp = props[STYLE$1];
- var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;
- instance.style.display = dangerousStyleValue('display', display);
- }
- function unhideTextInstance(textInstance, text) {
- textInstance.nodeValue = text;
- }
- function canHydrateInstance(instance, type, props) {
- if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
- return null;
- }
- return instance;
- }
- function canHydrateTextInstance(instance, text) {
- if (text === '' || instance.nodeType !== TEXT_NODE) {
-
- return null;
- }
- return instance;
- }
- function isSuspenseInstancePending(instance) {
- return instance.data === SUSPENSE_PENDING_START_DATA;
- }
- function isSuspenseInstanceFallback(instance) {
- return instance.data === SUSPENSE_FALLBACK_START_DATA;
- }
- function getNextHydratable(node) {
-
- for (; node != null; node = node.nextSibling) {
- var nodeType = node.nodeType;
- if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
- break;
- }
- }
- return node;
- }
- function getNextHydratableSibling(instance) {
- return getNextHydratable(instance.nextSibling);
- }
- function getFirstHydratableChild(parentInstance) {
- return getNextHydratable(parentInstance.firstChild);
- }
- function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
- precacheFiberNode(internalInstanceHandle, instance);
-
- updateFiberProps(instance, props);
- var parentNamespace;
- {
- var hostContextDev = hostContext;
- parentNamespace = hostContextDev.namespace;
- }
- return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance);
- }
- function hydrateTextInstance(textInstance, text, internalInstanceHandle) {
- precacheFiberNode(internalInstanceHandle, textInstance);
- return diffHydratedText(textInstance, text);
- }
- function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
- var node = suspenseInstance.nextSibling;
-
-
- var depth = 0;
- while (node) {
- if (node.nodeType === COMMENT_NODE) {
- var data = node.data;
- if (data === SUSPENSE_END_DATA) {
- if (depth === 0) {
- return getNextHydratableSibling(node);
- } else {
- depth--;
- }
- } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
- depth++;
- }
- }
- node = node.nextSibling;
- }
- return null;
- }
-
-
- function getParentSuspenseInstance(targetInstance) {
- var node = targetInstance.previousSibling;
-
-
- var depth = 0;
- while (node) {
- if (node.nodeType === COMMENT_NODE) {
- var data = node.data;
- if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
- if (depth === 0) {
- return node;
- } else {
- depth--;
- }
- } else if (data === SUSPENSE_END_DATA) {
- depth++;
- }
- }
- node = node.previousSibling;
- }
- return null;
- }
- function commitHydratedContainer(container) {
-
- retryIfBlockedOn(container);
- }
- function commitHydratedSuspenseInstance(suspenseInstance) {
-
- retryIfBlockedOn(suspenseInstance);
- }
- function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {
- {
- warnForUnmatchedText(textInstance, text);
- }
- }
- function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {
- if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
- warnForUnmatchedText(textInstance, text);
- }
- }
- function didNotHydrateContainerInstance(parentContainer, instance) {
- {
- if (instance.nodeType === ELEMENT_NODE) {
- warnForDeletedHydratableElement(parentContainer, instance);
- } else if (instance.nodeType === COMMENT_NODE) ; else {
- warnForDeletedHydratableText(parentContainer, instance);
- }
- }
- }
- function didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {
- if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
- if (instance.nodeType === ELEMENT_NODE) {
- warnForDeletedHydratableElement(parentInstance, instance);
- } else if (instance.nodeType === COMMENT_NODE) ; else {
- warnForDeletedHydratableText(parentInstance, instance);
- }
- }
- }
- function didNotFindHydratableContainerInstance(parentContainer, type, props) {
- {
- warnForInsertedHydratedElement(parentContainer, type);
- }
- }
- function didNotFindHydratableContainerTextInstance(parentContainer, text) {
- {
- warnForInsertedHydratedText(parentContainer, text);
- }
- }
- function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {
- if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
- warnForInsertedHydratedElement(parentInstance, type);
- }
- }
- function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {
- if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {
- warnForInsertedHydratedText(parentInstance, text);
- }
- }
- function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {
- if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) ;
- }
- var randomKey = Math.random().toString(36).slice(2);
- var internalInstanceKey = '__reactInternalInstance$' + randomKey;
- var internalEventHandlersKey = '__reactEventHandlers$' + randomKey;
- var internalContainerInstanceKey = '__reactContainere$' + randomKey;
- function precacheFiberNode(hostInst, node) {
- node[internalInstanceKey] = hostInst;
- }
- function markContainerAsRoot(hostRoot, node) {
- node[internalContainerInstanceKey] = hostRoot;
- }
- function unmarkContainerAsRoot(node) {
- node[internalContainerInstanceKey] = null;
- }
- function isContainerMarkedAsRoot(node) {
- return !!node[internalContainerInstanceKey];
- }
-
-
-
-
-
-
- function getClosestInstanceFromNode(targetNode) {
- var targetInst = targetNode[internalInstanceKey];
- if (targetInst) {
-
- return targetInst;
- }
-
- var parentNode = targetNode.parentNode;
- while (parentNode) {
-
-
-
-
-
-
-
-
- targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];
- if (targetInst) {
-
-
-
-
-
-
-
-
-
-
-
-
-
- var alternate = targetInst.alternate;
- if (targetInst.child !== null || alternate !== null && alternate.child !== null) {
-
-
- var suspenseInstance = getParentSuspenseInstance(targetNode);
- while (suspenseInstance !== null) {
-
-
-
-
-
-
-
-
- var targetSuspenseInst = suspenseInstance[internalInstanceKey];
- if (targetSuspenseInst) {
- return targetSuspenseInst;
- }
-
-
-
- suspenseInstance = getParentSuspenseInstance(suspenseInstance);
-
-
- }
- }
- return targetInst;
- }
- targetNode = parentNode;
- parentNode = targetNode.parentNode;
- }
- return null;
- }
-
- function getInstanceFromNode$1(node) {
- var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];
- if (inst) {
- if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {
- return inst;
- } else {
- return null;
- }
- }
- return null;
- }
-
- function getNodeFromInstance$1(inst) {
- if (inst.tag === HostComponent || inst.tag === HostText) {
-
-
- return inst.stateNode;
- }
-
- {
- {
- throw Error( "getNodeFromInstance: Invalid argument." );
- }
- }
- }
- function getFiberCurrentPropsFromNode$1(node) {
- return node[internalEventHandlersKey] || null;
- }
- function updateFiberProps(node, props) {
- node[internalEventHandlersKey] = props;
- }
- function getParent(inst) {
- do {
- inst = inst.return;
-
-
-
-
- } while (inst && inst.tag !== HostComponent);
- if (inst) {
- return inst;
- }
- return null;
- }
-
- function getLowestCommonAncestor(instA, instB) {
- var depthA = 0;
- for (var tempA = instA; tempA; tempA = getParent(tempA)) {
- depthA++;
- }
- var depthB = 0;
- for (var tempB = instB; tempB; tempB = getParent(tempB)) {
- depthB++;
- }
- while (depthA - depthB > 0) {
- instA = getParent(instA);
- depthA--;
- }
- while (depthB - depthA > 0) {
- instB = getParent(instB);
- depthB--;
- }
- var depth = depthA;
- while (depth--) {
- if (instA === instB || instA === instB.alternate) {
- return instA;
- }
- instA = getParent(instA);
- instB = getParent(instB);
- }
- return null;
- }
-
- function traverseTwoPhase(inst, fn, arg) {
- var path = [];
- while (inst) {
- path.push(inst);
- inst = getParent(inst);
- }
- var i;
- for (i = path.length; i-- > 0;) {
- fn(path[i], 'captured', arg);
- }
- for (i = 0; i < path.length; i++) {
- fn(path[i], 'bubbled', arg);
- }
- }
-
- function traverseEnterLeave(from, to, fn, argFrom, argTo) {
- var common = from && to ? getLowestCommonAncestor(from, to) : null;
- var pathFrom = [];
- while (true) {
- if (!from) {
- break;
- }
- if (from === common) {
- break;
- }
- var alternate = from.alternate;
- if (alternate !== null && alternate === common) {
- break;
- }
- pathFrom.push(from);
- from = getParent(from);
- }
- var pathTo = [];
- while (true) {
- if (!to) {
- break;
- }
- if (to === common) {
- break;
- }
- var _alternate = to.alternate;
- if (_alternate !== null && _alternate === common) {
- break;
- }
- pathTo.push(to);
- to = getParent(to);
- }
- for (var i = 0; i < pathFrom.length; i++) {
- fn(pathFrom[i], 'bubbled', argFrom);
- }
- for (var _i = pathTo.length; _i-- > 0;) {
- fn(pathTo[_i], 'captured', argTo);
- }
- }
- function isInteractive(tag) {
- return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
- }
- function shouldPreventMouseEvent(name, type, props) {
- switch (name) {
- case 'onClick':
- case 'onClickCapture':
- case 'onDoubleClick':
- case 'onDoubleClickCapture':
- case 'onMouseDown':
- case 'onMouseDownCapture':
- case 'onMouseMove':
- case 'onMouseMoveCapture':
- case 'onMouseUp':
- case 'onMouseUpCapture':
- case 'onMouseEnter':
- return !!(props.disabled && isInteractive(type));
- default:
- return false;
- }
- }
-
- function getListener(inst, registrationName) {
- var listener;
-
- var stateNode = inst.stateNode;
- if (!stateNode) {
-
- return null;
- }
- var props = getFiberCurrentPropsFromNode(stateNode);
- if (!props) {
-
- return null;
- }
- listener = props[registrationName];
- if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
- return null;
- }
- if (!(!listener || typeof listener === 'function')) {
- {
- throw Error( "Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type." );
- }
- }
- return listener;
- }
-
- function listenerAtPhase(inst, event, propagationPhase) {
- var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
- return getListener(inst, registrationName);
- }
-
-
- function accumulateDirectionalDispatches(inst, phase, event) {
- {
- if (!inst) {
- error('Dispatching inst must not be null');
- }
- }
- var listener = listenerAtPhase(inst, event, phase);
- if (listener) {
- event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
- event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
- }
- }
-
- function accumulateTwoPhaseDispatchesSingle(event) {
- if (event && event.dispatchConfig.phasedRegistrationNames) {
- traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
- }
- }
-
- function accumulateDispatches(inst, ignoredDirection, event) {
- if (inst && event && event.dispatchConfig.registrationName) {
- var registrationName = event.dispatchConfig.registrationName;
- var listener = getListener(inst, registrationName);
- if (listener) {
- event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
- event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
- }
- }
- }
-
- function accumulateDirectDispatchesSingle(event) {
- if (event && event.dispatchConfig.registrationName) {
- accumulateDispatches(event._targetInst, null, event);
- }
- }
- function accumulateTwoPhaseDispatches(events) {
- forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
- }
- function accumulateEnterLeaveDispatches(leave, enter, from, to) {
- traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
- }
- function accumulateDirectDispatches(events) {
- forEachAccumulated(events, accumulateDirectDispatchesSingle);
- }
-
- var root = null;
- var startText = null;
- var fallbackText = null;
- function initialize(nativeEventTarget) {
- root = nativeEventTarget;
- startText = getText();
- return true;
- }
- function reset() {
- root = null;
- startText = null;
- fallbackText = null;
- }
- function getData() {
- if (fallbackText) {
- return fallbackText;
- }
- var start;
- var startValue = startText;
- var startLength = startValue.length;
- var end;
- var endValue = getText();
- var endLength = endValue.length;
- for (start = 0; start < startLength; start++) {
- if (startValue[start] !== endValue[start]) {
- break;
- }
- }
- var minEnd = startLength - start;
- for (end = 1; end <= minEnd; end++) {
- if (startValue[startLength - end] !== endValue[endLength - end]) {
- break;
- }
- }
- var sliceTail = end > 1 ? 1 - end : undefined;
- fallbackText = endValue.slice(start, sliceTail);
- return fallbackText;
- }
- function getText() {
- if ('value' in root) {
- return root.value;
- }
- return root.textContent;
- }
- var EVENT_POOL_SIZE = 10;
-
- var EventInterface = {
- type: null,
- target: null,
-
- currentTarget: function () {
- return null;
- },
- eventPhase: null,
- bubbles: null,
- cancelable: null,
- timeStamp: function (event) {
- return event.timeStamp || Date.now();
- },
- defaultPrevented: null,
- isTrusted: null
- };
- function functionThatReturnsTrue() {
- return true;
- }
- function functionThatReturnsFalse() {
- return false;
- }
-
- function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
- {
-
- delete this.nativeEvent;
- delete this.preventDefault;
- delete this.stopPropagation;
- delete this.isDefaultPrevented;
- delete this.isPropagationStopped;
- }
- this.dispatchConfig = dispatchConfig;
- this._targetInst = targetInst;
- this.nativeEvent = nativeEvent;
- var Interface = this.constructor.Interface;
- for (var propName in Interface) {
- if (!Interface.hasOwnProperty(propName)) {
- continue;
- }
- {
- delete this[propName];
- }
- var normalize = Interface[propName];
- if (normalize) {
- this[propName] = normalize(nativeEvent);
- } else {
- if (propName === 'target') {
- this.target = nativeEventTarget;
- } else {
- this[propName] = nativeEvent[propName];
- }
- }
- }
- var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
- if (defaultPrevented) {
- this.isDefaultPrevented = functionThatReturnsTrue;
- } else {
- this.isDefaultPrevented = functionThatReturnsFalse;
- }
- this.isPropagationStopped = functionThatReturnsFalse;
- return this;
- }
- _assign(SyntheticEvent.prototype, {
- preventDefault: function () {
- this.defaultPrevented = true;
- var event = this.nativeEvent;
- if (!event) {
- return;
- }
- if (event.preventDefault) {
- event.preventDefault();
- } else if (typeof event.returnValue !== 'unknown') {
- event.returnValue = false;
- }
- this.isDefaultPrevented = functionThatReturnsTrue;
- },
- stopPropagation: function () {
- var event = this.nativeEvent;
- if (!event) {
- return;
- }
- if (event.stopPropagation) {
- event.stopPropagation();
- } else if (typeof event.cancelBubble !== 'unknown') {
-
-
-
-
-
- event.cancelBubble = true;
- }
- this.isPropagationStopped = functionThatReturnsTrue;
- },
-
- persist: function () {
- this.isPersistent = functionThatReturnsTrue;
- },
-
- isPersistent: functionThatReturnsFalse,
-
- destructor: function () {
- var Interface = this.constructor.Interface;
- for (var propName in Interface) {
- {
- Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
- }
- }
- this.dispatchConfig = null;
- this._targetInst = null;
- this.nativeEvent = null;
- this.isDefaultPrevented = functionThatReturnsFalse;
- this.isPropagationStopped = functionThatReturnsFalse;
- this._dispatchListeners = null;
- this._dispatchInstances = null;
- {
- Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
- Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));
- Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));
- Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));
- Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));
- }
- }
- });
- SyntheticEvent.Interface = EventInterface;
-
- SyntheticEvent.extend = function (Interface) {
- var Super = this;
- var E = function () {};
- E.prototype = Super.prototype;
- var prototype = new E();
- function Class() {
- return Super.apply(this, arguments);
- }
- _assign(prototype, Class.prototype);
- Class.prototype = prototype;
- Class.prototype.constructor = Class;
- Class.Interface = _assign({}, Super.Interface, Interface);
- Class.extend = Super.extend;
- addEventPoolingTo(Class);
- return Class;
- };
- addEventPoolingTo(SyntheticEvent);
-
- function getPooledWarningPropertyDefinition(propName, getVal) {
- var isFunction = typeof getVal === 'function';
- return {
- configurable: true,
- set: set,
- get: get
- };
- function set(val) {
- var action = isFunction ? 'setting the method' : 'setting the property';
- warn(action, 'This is effectively a no-op');
- return val;
- }
- function get() {
- var action = isFunction ? 'accessing the method' : 'accessing the property';
- var result = isFunction ? 'This is a no-op function' : 'This is set to null';
- warn(action, result);
- return getVal;
- }
- function warn(action, result) {
- {
- error("This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result);
- }
- }
- }
- function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
- var EventConstructor = this;
- if (EventConstructor.eventPool.length) {
- var instance = EventConstructor.eventPool.pop();
- EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
- return instance;
- }
- return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);
- }
- function releasePooledEvent(event) {
- var EventConstructor = this;
- if (!(event instanceof EventConstructor)) {
- {
- throw Error( "Trying to release an event instance into a pool of a different type." );
- }
- }
- event.destructor();
- if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
- EventConstructor.eventPool.push(event);
- }
- }
- function addEventPoolingTo(EventConstructor) {
- EventConstructor.eventPool = [];
- EventConstructor.getPooled = getPooledEvent;
- EventConstructor.release = releasePooledEvent;
- }
-
- var SyntheticCompositionEvent = SyntheticEvent.extend({
- data: null
- });
-
- var SyntheticInputEvent = SyntheticEvent.extend({
- data: null
- });
- var END_KEYCODES = [9, 13, 27, 32];
- var START_KEYCODE = 229;
- var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;
- var documentMode = null;
- if (canUseDOM && 'documentMode' in document) {
- documentMode = document.documentMode;
- }
-
-
- var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode;
-
-
- var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
- var SPACEBAR_CODE = 32;
- var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);
- var eventTypes = {
- beforeInput: {
- phasedRegistrationNames: {
- bubbled: 'onBeforeInput',
- captured: 'onBeforeInputCapture'
- },
- dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE]
- },
- compositionEnd: {
- phasedRegistrationNames: {
- bubbled: 'onCompositionEnd',
- captured: 'onCompositionEndCapture'
- },
- dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
- },
- compositionStart: {
- phasedRegistrationNames: {
- bubbled: 'onCompositionStart',
- captured: 'onCompositionStartCapture'
- },
- dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
- },
- compositionUpdate: {
- phasedRegistrationNames: {
- bubbled: 'onCompositionUpdate',
- captured: 'onCompositionUpdateCapture'
- },
- dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
- }
- };
- var hasSpaceKeypress = false;
-
- function isKeypressCommand(nativeEvent) {
- return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
- !(nativeEvent.ctrlKey && nativeEvent.altKey);
- }
-
- function getCompositionEventType(topLevelType) {
- switch (topLevelType) {
- case TOP_COMPOSITION_START:
- return eventTypes.compositionStart;
- case TOP_COMPOSITION_END:
- return eventTypes.compositionEnd;
- case TOP_COMPOSITION_UPDATE:
- return eventTypes.compositionUpdate;
- }
- }
-
- function isFallbackCompositionStart(topLevelType, nativeEvent) {
- return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE;
- }
-
- function isFallbackCompositionEnd(topLevelType, nativeEvent) {
- switch (topLevelType) {
- case TOP_KEY_UP:
-
- return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
- case TOP_KEY_DOWN:
-
-
- return nativeEvent.keyCode !== START_KEYCODE;
- case TOP_KEY_PRESS:
- case TOP_MOUSE_DOWN:
- case TOP_BLUR:
-
- return true;
- default:
- return false;
- }
- }
-
- function getDataFromCustomEvent(nativeEvent) {
- var detail = nativeEvent.detail;
- if (typeof detail === 'object' && 'data' in detail) {
- return detail.data;
- }
- return null;
- }
-
- function isUsingKoreanIME(nativeEvent) {
- return nativeEvent.locale === 'ko';
- }
- var isComposing = false;
-
- function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var eventType;
- var fallbackData;
- if (canUseCompositionEvent) {
- eventType = getCompositionEventType(topLevelType);
- } else if (!isComposing) {
- if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
- eventType = eventTypes.compositionStart;
- }
- } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
- eventType = eventTypes.compositionEnd;
- }
- if (!eventType) {
- return null;
- }
- if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
-
-
- if (!isComposing && eventType === eventTypes.compositionStart) {
- isComposing = initialize(nativeEventTarget);
- } else if (eventType === eventTypes.compositionEnd) {
- if (isComposing) {
- fallbackData = getData();
- }
- }
- }
- var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
- if (fallbackData) {
-
-
- event.data = fallbackData;
- } else {
- var customData = getDataFromCustomEvent(nativeEvent);
- if (customData !== null) {
- event.data = customData;
- }
- }
- accumulateTwoPhaseDispatches(event);
- return event;
- }
-
- function getNativeBeforeInputChars(topLevelType, nativeEvent) {
- switch (topLevelType) {
- case TOP_COMPOSITION_END:
- return getDataFromCustomEvent(nativeEvent);
- case TOP_KEY_PRESS:
-
- var which = nativeEvent.which;
- if (which !== SPACEBAR_CODE) {
- return null;
- }
- hasSpaceKeypress = true;
- return SPACEBAR_CHAR;
- case TOP_TEXT_INPUT:
-
- var chars = nativeEvent.data;
-
-
- if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
- return null;
- }
- return chars;
- default:
-
- return null;
- }
- }
-
- function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
-
-
-
-
- if (isComposing) {
- if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
- var chars = getData();
- reset();
- isComposing = false;
- return chars;
- }
- return null;
- }
- switch (topLevelType) {
- case TOP_PASTE:
-
-
- return null;
- case TOP_KEY_PRESS:
-
- if (!isKeypressCommand(nativeEvent)) {
-
-
-
-
-
-
- if (nativeEvent.char && nativeEvent.char.length > 1) {
- return nativeEvent.char;
- } else if (nativeEvent.which) {
- return String.fromCharCode(nativeEvent.which);
- }
- }
- return null;
- case TOP_COMPOSITION_END:
- return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
- default:
- return null;
- }
- }
-
- function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var chars;
- if (canUseTextInputEvent) {
- chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
- } else {
- chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
- }
-
- if (!chars) {
- return null;
- }
- var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);
- event.data = chars;
- accumulateTwoPhaseDispatches(event);
- return event;
- }
-
- var BeforeInputEventPlugin = {
- eventTypes: eventTypes,
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
- var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
- var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
- if (composition === null) {
- return beforeInput;
- }
- if (beforeInput === null) {
- return composition;
- }
- return [composition, beforeInput];
- }
- };
-
- var supportedInputTypes = {
- color: true,
- date: true,
- datetime: true,
- 'datetime-local': true,
- email: true,
- month: true,
- number: true,
- password: true,
- range: true,
- search: true,
- tel: true,
- text: true,
- time: true,
- url: true,
- week: true
- };
- function isTextInputElement(elem) {
- var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
- if (nodeName === 'input') {
- return !!supportedInputTypes[elem.type];
- }
- if (nodeName === 'textarea') {
- return true;
- }
- return false;
- }
- var eventTypes$1 = {
- change: {
- phasedRegistrationNames: {
- bubbled: 'onChange',
- captured: 'onChangeCapture'
- },
- dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE]
- }
- };
- function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
- var event = SyntheticEvent.getPooled(eventTypes$1.change, inst, nativeEvent, target);
- event.type = 'change';
- enqueueStateRestore(target);
- accumulateTwoPhaseDispatches(event);
- return event;
- }
-
- var activeElement = null;
- var activeElementInst = null;
-
- function shouldUseChangeEvent(elem) {
- var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
- return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
- }
- function manualDispatchChangeEvent(nativeEvent) {
- var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent));
-
-
-
-
-
-
-
-
-
-
- batchedUpdates(runEventInBatch, event);
- }
- function runEventInBatch(event) {
- runEventsInBatch(event);
- }
- function getInstIfValueChanged(targetInst) {
- var targetNode = getNodeFromInstance$1(targetInst);
- if (updateValueIfChanged(targetNode)) {
- return targetInst;
- }
- }
- function getTargetInstForChangeEvent(topLevelType, targetInst) {
- if (topLevelType === TOP_CHANGE) {
- return targetInst;
- }
- }
-
- var isInputEventSupported = false;
- if (canUseDOM) {
-
-
- isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);
- }
-
- function startWatchingForValueChange(target, targetInst) {
- activeElement = target;
- activeElementInst = targetInst;
- activeElement.attachEvent('onpropertychange', handlePropertyChange);
- }
-
- function stopWatchingForValueChange() {
- if (!activeElement) {
- return;
- }
- activeElement.detachEvent('onpropertychange', handlePropertyChange);
- activeElement = null;
- activeElementInst = null;
- }
-
- function handlePropertyChange(nativeEvent) {
- if (nativeEvent.propertyName !== 'value') {
- return;
- }
- if (getInstIfValueChanged(activeElementInst)) {
- manualDispatchChangeEvent(nativeEvent);
- }
- }
- function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {
- if (topLevelType === TOP_FOCUS) {
-
-
-
-
-
-
-
-
-
-
- stopWatchingForValueChange();
- startWatchingForValueChange(target, targetInst);
- } else if (topLevelType === TOP_BLUR) {
- stopWatchingForValueChange();
- }
- }
- function getTargetInstForInputEventPolyfill(topLevelType, targetInst) {
- if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) {
-
-
-
-
-
-
-
-
-
-
- return getInstIfValueChanged(activeElementInst);
- }
- }
-
- function shouldUseClickEvent(elem) {
-
-
-
- var nodeName = elem.nodeName;
- return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
- }
- function getTargetInstForClickEvent(topLevelType, targetInst) {
- if (topLevelType === TOP_CLICK) {
- return getInstIfValueChanged(targetInst);
- }
- }
- function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
- if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) {
- return getInstIfValueChanged(targetInst);
- }
- }
- function handleControlledInputBlur(node) {
- var state = node._wrapperState;
- if (!state || !state.controlled || node.type !== 'number') {
- return;
- }
- {
-
- setDefaultValue(node, 'number', node.value);
- }
- }
-
- var ChangeEventPlugin = {
- eventTypes: eventTypes$1,
- _isInputEventSupported: isInputEventSupported,
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
- var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
- var getTargetInstFunc, handleEventFunc;
- if (shouldUseChangeEvent(targetNode)) {
- getTargetInstFunc = getTargetInstForChangeEvent;
- } else if (isTextInputElement(targetNode)) {
- if (isInputEventSupported) {
- getTargetInstFunc = getTargetInstForInputOrChangeEvent;
- } else {
- getTargetInstFunc = getTargetInstForInputEventPolyfill;
- handleEventFunc = handleEventsForInputEventPolyfill;
- }
- } else if (shouldUseClickEvent(targetNode)) {
- getTargetInstFunc = getTargetInstForClickEvent;
- }
- if (getTargetInstFunc) {
- var inst = getTargetInstFunc(topLevelType, targetInst);
- if (inst) {
- var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);
- return event;
- }
- }
- if (handleEventFunc) {
- handleEventFunc(topLevelType, targetNode, targetInst);
- }
- if (topLevelType === TOP_BLUR) {
- handleControlledInputBlur(targetNode);
- }
- }
- };
- var SyntheticUIEvent = SyntheticEvent.extend({
- view: null,
- detail: null
- });
-
- var modifierKeyToProp = {
- Alt: 'altKey',
- Control: 'ctrlKey',
- Meta: 'metaKey',
- Shift: 'shiftKey'
- };
-
-
- function modifierStateGetter(keyArg) {
- var syntheticEvent = this;
- var nativeEvent = syntheticEvent.nativeEvent;
- if (nativeEvent.getModifierState) {
- return nativeEvent.getModifierState(keyArg);
- }
- var keyProp = modifierKeyToProp[keyArg];
- return keyProp ? !!nativeEvent[keyProp] : false;
- }
- function getEventModifierState(nativeEvent) {
- return modifierStateGetter;
- }
- var previousScreenX = 0;
- var previousScreenY = 0;
- var isMovementXSet = false;
- var isMovementYSet = false;
-
- var SyntheticMouseEvent = SyntheticUIEvent.extend({
- screenX: null,
- screenY: null,
- clientX: null,
- clientY: null,
- pageX: null,
- pageY: null,
- ctrlKey: null,
- shiftKey: null,
- altKey: null,
- metaKey: null,
- getModifierState: getEventModifierState,
- button: null,
- buttons: null,
- relatedTarget: function (event) {
- return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
- },
- movementX: function (event) {
- if ('movementX' in event) {
- return event.movementX;
- }
- var screenX = previousScreenX;
- previousScreenX = event.screenX;
- if (!isMovementXSet) {
- isMovementXSet = true;
- return 0;
- }
- return event.type === 'mousemove' ? event.screenX - screenX : 0;
- },
- movementY: function (event) {
- if ('movementY' in event) {
- return event.movementY;
- }
- var screenY = previousScreenY;
- previousScreenY = event.screenY;
- if (!isMovementYSet) {
- isMovementYSet = true;
- return 0;
- }
- return event.type === 'mousemove' ? event.screenY - screenY : 0;
- }
- });
-
- var SyntheticPointerEvent = SyntheticMouseEvent.extend({
- pointerId: null,
- width: null,
- height: null,
- pressure: null,
- tangentialPressure: null,
- tiltX: null,
- tiltY: null,
- twist: null,
- pointerType: null,
- isPrimary: null
- });
- var eventTypes$2 = {
- mouseEnter: {
- registrationName: 'onMouseEnter',
- dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
- },
- mouseLeave: {
- registrationName: 'onMouseLeave',
- dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
- },
- pointerEnter: {
- registrationName: 'onPointerEnter',
- dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
- },
- pointerLeave: {
- registrationName: 'onPointerLeave',
- dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
- }
- };
- var EnterLeaveEventPlugin = {
- eventTypes: eventTypes$2,
-
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
- var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER;
- var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT;
- if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0 && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
-
-
-
-
- return null;
- }
- if (!isOutEvent && !isOverEvent) {
-
- return null;
- }
- var win;
- if (nativeEventTarget.window === nativeEventTarget) {
-
- win = nativeEventTarget;
- } else {
-
- var doc = nativeEventTarget.ownerDocument;
- if (doc) {
- win = doc.defaultView || doc.parentWindow;
- } else {
- win = window;
- }
- }
- var from;
- var to;
- if (isOutEvent) {
- from = targetInst;
- var related = nativeEvent.relatedTarget || nativeEvent.toElement;
- to = related ? getClosestInstanceFromNode(related) : null;
- if (to !== null) {
- var nearestMounted = getNearestMountedFiber(to);
- if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {
- to = null;
- }
- }
- } else {
-
- from = null;
- to = targetInst;
- }
- if (from === to) {
-
- return null;
- }
- var eventInterface, leaveEventType, enterEventType, eventTypePrefix;
- if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) {
- eventInterface = SyntheticMouseEvent;
- leaveEventType = eventTypes$2.mouseLeave;
- enterEventType = eventTypes$2.mouseEnter;
- eventTypePrefix = 'mouse';
- } else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) {
- eventInterface = SyntheticPointerEvent;
- leaveEventType = eventTypes$2.pointerLeave;
- enterEventType = eventTypes$2.pointerEnter;
- eventTypePrefix = 'pointer';
- }
- var fromNode = from == null ? win : getNodeFromInstance$1(from);
- var toNode = to == null ? win : getNodeFromInstance$1(to);
- var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget);
- leave.type = eventTypePrefix + 'leave';
- leave.target = fromNode;
- leave.relatedTarget = toNode;
- var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget);
- enter.type = eventTypePrefix + 'enter';
- enter.target = toNode;
- enter.relatedTarget = fromNode;
- accumulateEnterLeaveDispatches(leave, enter, from, to);
-
-
- if ((eventSystemFlags & IS_FIRST_ANCESTOR) === 0) {
- return [leave];
- }
- return [leave, enter];
- }
- };
-
- function is(x, y) {
- return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y
- ;
- }
- var objectIs = typeof Object.is === 'function' ? Object.is : is;
- var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
-
- function shallowEqual(objA, objB) {
- if (objectIs(objA, objB)) {
- return true;
- }
- if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
- return false;
- }
- var keysA = Object.keys(objA);
- var keysB = Object.keys(objB);
- if (keysA.length !== keysB.length) {
- return false;
- }
- for (var i = 0; i < keysA.length; i++) {
- if (!hasOwnProperty$2.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {
- return false;
- }
- }
- return true;
- }
- var skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;
- var eventTypes$3 = {
- select: {
- phasedRegistrationNames: {
- bubbled: 'onSelect',
- captured: 'onSelectCapture'
- },
- dependencies: [TOP_BLUR, TOP_CONTEXT_MENU, TOP_DRAG_END, TOP_FOCUS, TOP_KEY_DOWN, TOP_KEY_UP, TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_SELECTION_CHANGE]
- }
- };
- var activeElement$1 = null;
- var activeElementInst$1 = null;
- var lastSelection = null;
- var mouseDown = false;
-
- function getSelection$1(node) {
- if ('selectionStart' in node && hasSelectionCapabilities(node)) {
- return {
- start: node.selectionStart,
- end: node.selectionEnd
- };
- } else {
- var win = node.ownerDocument && node.ownerDocument.defaultView || window;
- var selection = win.getSelection();
- return {
- anchorNode: selection.anchorNode,
- anchorOffset: selection.anchorOffset,
- focusNode: selection.focusNode,
- focusOffset: selection.focusOffset
- };
- }
- }
-
- function getEventTargetDocument(eventTarget) {
- return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
- }
-
- function constructSelectEvent(nativeEvent, nativeEventTarget) {
-
-
-
-
- var doc = getEventTargetDocument(nativeEventTarget);
- if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
- return null;
- }
- var currentSelection = getSelection$1(activeElement$1);
- if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
- lastSelection = currentSelection;
- var syntheticEvent = SyntheticEvent.getPooled(eventTypes$3.select, activeElementInst$1, nativeEvent, nativeEventTarget);
- syntheticEvent.type = 'select';
- syntheticEvent.target = activeElement$1;
- accumulateTwoPhaseDispatches(syntheticEvent);
- return syntheticEvent;
- }
- return null;
- }
-
- var SelectEventPlugin = {
- eventTypes: eventTypes$3,
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, container) {
- var containerOrDoc = container || getEventTargetDocument(nativeEventTarget);
-
- if (!containerOrDoc || !isListeningToAllDependencies('onSelect', containerOrDoc)) {
- return null;
- }
- var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
- switch (topLevelType) {
-
- case TOP_FOCUS:
- if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
- activeElement$1 = targetNode;
- activeElementInst$1 = targetInst;
- lastSelection = null;
- }
- break;
- case TOP_BLUR:
- activeElement$1 = null;
- activeElementInst$1 = null;
- lastSelection = null;
- break;
-
-
- case TOP_MOUSE_DOWN:
- mouseDown = true;
- break;
- case TOP_CONTEXT_MENU:
- case TOP_MOUSE_UP:
- case TOP_DRAG_END:
- mouseDown = false;
- return constructSelectEvent(nativeEvent, nativeEventTarget);
-
-
-
-
-
-
-
-
-
- case TOP_SELECTION_CHANGE:
- if (skipSelectionChangeEvent) {
- break;
- }
-
- case TOP_KEY_DOWN:
- case TOP_KEY_UP:
- return constructSelectEvent(nativeEvent, nativeEventTarget);
- }
- return null;
- }
- };
-
- var SyntheticAnimationEvent = SyntheticEvent.extend({
- animationName: null,
- elapsedTime: null,
- pseudoElement: null
- });
-
- var SyntheticClipboardEvent = SyntheticEvent.extend({
- clipboardData: function (event) {
- return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
- }
- });
-
- var SyntheticFocusEvent = SyntheticUIEvent.extend({
- relatedTarget: null
- });
-
- function getEventCharCode(nativeEvent) {
- var charCode;
- var keyCode = nativeEvent.keyCode;
- if ('charCode' in nativeEvent) {
- charCode = nativeEvent.charCode;
- if (charCode === 0 && keyCode === 13) {
- charCode = 13;
- }
- } else {
-
- charCode = keyCode;
- }
-
- if (charCode === 10) {
- charCode = 13;
- }
-
- if (charCode >= 32 || charCode === 13) {
- return charCode;
- }
- return 0;
- }
-
- var normalizeKey = {
- Esc: 'Escape',
- Spacebar: ' ',
- Left: 'ArrowLeft',
- Up: 'ArrowUp',
- Right: 'ArrowRight',
- Down: 'ArrowDown',
- Del: 'Delete',
- Win: 'OS',
- Menu: 'ContextMenu',
- Apps: 'ContextMenu',
- Scroll: 'ScrollLock',
- MozPrintableKey: 'Unidentified'
- };
-
- var translateToKey = {
- '8': 'Backspace',
- '9': 'Tab',
- '12': 'Clear',
- '13': 'Enter',
- '16': 'Shift',
- '17': 'Control',
- '18': 'Alt',
- '19': 'Pause',
- '20': 'CapsLock',
- '27': 'Escape',
- '32': ' ',
- '33': 'PageUp',
- '34': 'PageDown',
- '35': 'End',
- '36': 'Home',
- '37': 'ArrowLeft',
- '38': 'ArrowUp',
- '39': 'ArrowRight',
- '40': 'ArrowDown',
- '45': 'Insert',
- '46': 'Delete',
- '112': 'F1',
- '113': 'F2',
- '114': 'F3',
- '115': 'F4',
- '116': 'F5',
- '117': 'F6',
- '118': 'F7',
- '119': 'F8',
- '120': 'F9',
- '121': 'F10',
- '122': 'F11',
- '123': 'F12',
- '144': 'NumLock',
- '145': 'ScrollLock',
- '224': 'Meta'
- };
-
- function getEventKey(nativeEvent) {
- if (nativeEvent.key) {
-
-
-
-
- var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
- if (key !== 'Unidentified') {
- return key;
- }
- }
- if (nativeEvent.type === 'keypress') {
- var charCode = getEventCharCode(nativeEvent);
-
- return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
- }
- if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
-
-
- return translateToKey[nativeEvent.keyCode] || 'Unidentified';
- }
- return '';
- }
-
- var SyntheticKeyboardEvent = SyntheticUIEvent.extend({
- key: getEventKey,
- location: null,
- ctrlKey: null,
- shiftKey: null,
- altKey: null,
- metaKey: null,
- repeat: null,
- locale: null,
- getModifierState: getEventModifierState,
-
- charCode: function (event) {
-
-
-
-
- if (event.type === 'keypress') {
- return getEventCharCode(event);
- }
- return 0;
- },
- keyCode: function (event) {
-
-
-
-
-
-
- if (event.type === 'keydown' || event.type === 'keyup') {
- return event.keyCode;
- }
- return 0;
- },
- which: function (event) {
-
-
- if (event.type === 'keypress') {
- return getEventCharCode(event);
- }
- if (event.type === 'keydown' || event.type === 'keyup') {
- return event.keyCode;
- }
- return 0;
- }
- });
-
- var SyntheticDragEvent = SyntheticMouseEvent.extend({
- dataTransfer: null
- });
-
- var SyntheticTouchEvent = SyntheticUIEvent.extend({
- touches: null,
- targetTouches: null,
- changedTouches: null,
- altKey: null,
- metaKey: null,
- ctrlKey: null,
- shiftKey: null,
- getModifierState: getEventModifierState
- });
-
- var SyntheticTransitionEvent = SyntheticEvent.extend({
- propertyName: null,
- elapsedTime: null,
- pseudoElement: null
- });
-
- var SyntheticWheelEvent = SyntheticMouseEvent.extend({
- deltaX: function (event) {
- return 'deltaX' in event ? event.deltaX :
- 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
- },
- deltaY: function (event) {
- return 'deltaY' in event ? event.deltaY :
- 'wheelDeltaY' in event ? -event.wheelDeltaY :
- 'wheelDelta' in event ? -event.wheelDelta : 0;
- },
- deltaZ: null,
-
-
-
-
- deltaMode: null
- });
- var knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING];
- var SimpleEventPlugin = {
-
-
- eventTypes: simpleEventPluginEventTypes,
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
- var dispatchConfig = topLevelEventsToDispatchConfig.get(topLevelType);
- if (!dispatchConfig) {
- return null;
- }
- var EventConstructor;
- switch (topLevelType) {
- case TOP_KEY_PRESS:
-
-
-
- if (getEventCharCode(nativeEvent) === 0) {
- return null;
- }
-
- case TOP_KEY_DOWN:
- case TOP_KEY_UP:
- EventConstructor = SyntheticKeyboardEvent;
- break;
- case TOP_BLUR:
- case TOP_FOCUS:
- EventConstructor = SyntheticFocusEvent;
- break;
- case TOP_CLICK:
-
-
- if (nativeEvent.button === 2) {
- return null;
- }
-
- case TOP_AUX_CLICK:
- case TOP_DOUBLE_CLICK:
- case TOP_MOUSE_DOWN:
- case TOP_MOUSE_MOVE:
- case TOP_MOUSE_UP:
-
- case TOP_MOUSE_OUT:
- case TOP_MOUSE_OVER:
- case TOP_CONTEXT_MENU:
- EventConstructor = SyntheticMouseEvent;
- break;
- case TOP_DRAG:
- case TOP_DRAG_END:
- case TOP_DRAG_ENTER:
- case TOP_DRAG_EXIT:
- case TOP_DRAG_LEAVE:
- case TOP_DRAG_OVER:
- case TOP_DRAG_START:
- case TOP_DROP:
- EventConstructor = SyntheticDragEvent;
- break;
- case TOP_TOUCH_CANCEL:
- case TOP_TOUCH_END:
- case TOP_TOUCH_MOVE:
- case TOP_TOUCH_START:
- EventConstructor = SyntheticTouchEvent;
- break;
- case TOP_ANIMATION_END:
- case TOP_ANIMATION_ITERATION:
- case TOP_ANIMATION_START:
- EventConstructor = SyntheticAnimationEvent;
- break;
- case TOP_TRANSITION_END:
- EventConstructor = SyntheticTransitionEvent;
- break;
- case TOP_SCROLL:
- EventConstructor = SyntheticUIEvent;
- break;
- case TOP_WHEEL:
- EventConstructor = SyntheticWheelEvent;
- break;
- case TOP_COPY:
- case TOP_CUT:
- case TOP_PASTE:
- EventConstructor = SyntheticClipboardEvent;
- break;
- case TOP_GOT_POINTER_CAPTURE:
- case TOP_LOST_POINTER_CAPTURE:
- case TOP_POINTER_CANCEL:
- case TOP_POINTER_DOWN:
- case TOP_POINTER_MOVE:
- case TOP_POINTER_OUT:
- case TOP_POINTER_OVER:
- case TOP_POINTER_UP:
- EventConstructor = SyntheticPointerEvent;
- break;
- default:
- {
- if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {
- error('SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType);
- }
- }
-
- EventConstructor = SyntheticEvent;
- break;
- }
- var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
- accumulateTwoPhaseDispatches(event);
- return event;
- }
- };
-
- var DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
-
- injectEventPluginOrder(DOMEventPluginOrder);
- setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1);
-
- injectEventPluginsByName({
- SimpleEventPlugin: SimpleEventPlugin,
- EnterLeaveEventPlugin: EnterLeaveEventPlugin,
- ChangeEventPlugin: ChangeEventPlugin,
- SelectEventPlugin: SelectEventPlugin,
- BeforeInputEventPlugin: BeforeInputEventPlugin
- });
-
-
- var reactEmoji = "\u269B";
- var warningEmoji = "\u26D4";
- var supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function';
-
- var currentFiber = null;
-
-
-
- var currentPhase = null;
- var currentPhaseFiber = null;
-
-
- var isCommitting = false;
- var hasScheduledUpdateInCurrentCommit = false;
- var hasScheduledUpdateInCurrentPhase = false;
- var commitCountInCurrentWorkLoop = 0;
- var effectCountInCurrentCommit = 0;
-
- var labelsInCurrentCommit = new Set();
- var formatMarkName = function (markName) {
- return reactEmoji + " " + markName;
- };
- var formatLabel = function (label, warning) {
- var prefix = warning ? warningEmoji + " " : reactEmoji + " ";
- var suffix = warning ? " Warning: " + warning : '';
- return "" + prefix + label + suffix;
- };
- var beginMark = function (markName) {
- performance.mark(formatMarkName(markName));
- };
- var clearMark = function (markName) {
- performance.clearMarks(formatMarkName(markName));
- };
- var endMark = function (label, markName, warning) {
- var formattedMarkName = formatMarkName(markName);
- var formattedLabel = formatLabel(label, warning);
- try {
- performance.measure(formattedLabel, formattedMarkName);
- } catch (err) {}
-
-
-
- performance.clearMarks(formattedMarkName);
- performance.clearMeasures(formattedLabel);
- };
- var getFiberMarkName = function (label, debugID) {
- return label + " (#" + debugID + ")";
- };
- var getFiberLabel = function (componentName, isMounted, phase) {
- if (phase === null) {
-
- return componentName + " [" + (isMounted ? 'update' : 'mount') + "]";
- } else {
-
- return componentName + "." + phase;
- }
- };
- var beginFiberMark = function (fiber, phase) {
- var componentName = getComponentName(fiber.type) || 'Unknown';
- var debugID = fiber._debugID;
- var isMounted = fiber.alternate !== null;
- var label = getFiberLabel(componentName, isMounted, phase);
- if (isCommitting && labelsInCurrentCommit.has(label)) {
-
-
-
- return false;
- }
- labelsInCurrentCommit.add(label);
- var markName = getFiberMarkName(label, debugID);
- beginMark(markName);
- return true;
- };
- var clearFiberMark = function (fiber, phase) {
- var componentName = getComponentName(fiber.type) || 'Unknown';
- var debugID = fiber._debugID;
- var isMounted = fiber.alternate !== null;
- var label = getFiberLabel(componentName, isMounted, phase);
- var markName = getFiberMarkName(label, debugID);
- clearMark(markName);
- };
- var endFiberMark = function (fiber, phase, warning) {
- var componentName = getComponentName(fiber.type) || 'Unknown';
- var debugID = fiber._debugID;
- var isMounted = fiber.alternate !== null;
- var label = getFiberLabel(componentName, isMounted, phase);
- var markName = getFiberMarkName(label, debugID);
- endMark(label, markName, warning);
- };
- var shouldIgnoreFiber = function (fiber) {
-
-
- switch (fiber.tag) {
- case HostRoot:
- case HostComponent:
- case HostText:
- case HostPortal:
- case Fragment:
- case ContextProvider:
- case ContextConsumer:
- case Mode:
- return true;
- default:
- return false;
- }
- };
- var clearPendingPhaseMeasurement = function () {
- if (currentPhase !== null && currentPhaseFiber !== null) {
- clearFiberMark(currentPhaseFiber, currentPhase);
- }
- currentPhaseFiber = null;
- currentPhase = null;
- hasScheduledUpdateInCurrentPhase = false;
- };
- var pauseTimers = function () {
-
-
- var fiber = currentFiber;
- while (fiber) {
- if (fiber._debugIsCurrentlyTiming) {
- endFiberMark(fiber, null, null);
- }
- fiber = fiber.return;
- }
- };
- var resumeTimersRecursively = function (fiber) {
- if (fiber.return !== null) {
- resumeTimersRecursively(fiber.return);
- }
- if (fiber._debugIsCurrentlyTiming) {
- beginFiberMark(fiber, null);
- }
- };
- var resumeTimers = function () {
-
- if (currentFiber !== null) {
- resumeTimersRecursively(currentFiber);
- }
- };
- function recordEffect() {
- {
- effectCountInCurrentCommit++;
- }
- }
- function recordScheduleUpdate() {
- {
- if (isCommitting) {
- hasScheduledUpdateInCurrentCommit = true;
- }
- if (currentPhase !== null && currentPhase !== 'componentWillMount' && currentPhase !== 'componentWillReceiveProps') {
- hasScheduledUpdateInCurrentPhase = true;
- }
- }
- }
- function startWorkTimer(fiber) {
- {
- if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
- return;
- }
- currentFiber = fiber;
- if (!beginFiberMark(fiber, null)) {
- return;
- }
- fiber._debugIsCurrentlyTiming = true;
- }
- }
- function cancelWorkTimer(fiber) {
- {
- if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
- return;
- }
-
- fiber._debugIsCurrentlyTiming = false;
- clearFiberMark(fiber, null);
- }
- }
- function stopWorkTimer(fiber) {
- {
- if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
- return;
- }
- currentFiber = fiber.return;
- if (!fiber._debugIsCurrentlyTiming) {
- return;
- }
- fiber._debugIsCurrentlyTiming = false;
- endFiberMark(fiber, null, null);
- }
- }
- function stopFailedWorkTimer(fiber) {
- {
- if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
- return;
- }
- currentFiber = fiber.return;
- if (!fiber._debugIsCurrentlyTiming) {
- return;
- }
- fiber._debugIsCurrentlyTiming = false;
- var warning = fiber.tag === SuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary';
- endFiberMark(fiber, null, warning);
- }
- }
- function startPhaseTimer(fiber, phase) {
- {
- if (!supportsUserTiming) {
- return;
- }
- clearPendingPhaseMeasurement();
- if (!beginFiberMark(fiber, phase)) {
- return;
- }
- currentPhaseFiber = fiber;
- currentPhase = phase;
- }
- }
- function stopPhaseTimer() {
- {
- if (!supportsUserTiming) {
- return;
- }
- if (currentPhase !== null && currentPhaseFiber !== null) {
- var warning = hasScheduledUpdateInCurrentPhase ? 'Scheduled a cascading update' : null;
- endFiberMark(currentPhaseFiber, currentPhase, warning);
- }
- currentPhase = null;
- currentPhaseFiber = null;
- }
- }
- function startWorkLoopTimer(nextUnitOfWork) {
- {
- currentFiber = nextUnitOfWork;
- if (!supportsUserTiming) {
- return;
- }
- commitCountInCurrentWorkLoop = 0;
-
- beginMark('(React Tree Reconciliation)');
- resumeTimers();
- }
- }
- function stopWorkLoopTimer(interruptedBy, didCompleteRoot) {
- {
- if (!supportsUserTiming) {
- return;
- }
- var warning = null;
- if (interruptedBy !== null) {
- if (interruptedBy.tag === HostRoot) {
- warning = 'A top-level update interrupted the previous render';
- } else {
- var componentName = getComponentName(interruptedBy.type) || 'Unknown';
- warning = "An update to " + componentName + " interrupted the previous render";
- }
- } else if (commitCountInCurrentWorkLoop > 1) {
- warning = 'There were cascading updates';
- }
- commitCountInCurrentWorkLoop = 0;
- var label = didCompleteRoot ? '(React Tree Reconciliation: Completed Root)' : '(React Tree Reconciliation: Yielded)';
- pauseTimers();
- endMark(label, '(React Tree Reconciliation)', warning);
- }
- }
- function startCommitTimer() {
- {
- if (!supportsUserTiming) {
- return;
- }
- isCommitting = true;
- hasScheduledUpdateInCurrentCommit = false;
- labelsInCurrentCommit.clear();
- beginMark('(Committing Changes)');
- }
- }
- function stopCommitTimer() {
- {
- if (!supportsUserTiming) {
- return;
- }
- var warning = null;
- if (hasScheduledUpdateInCurrentCommit) {
- warning = 'Lifecycle hook scheduled a cascading update';
- } else if (commitCountInCurrentWorkLoop > 0) {
- warning = 'Caused by a cascading update in earlier commit';
- }
- hasScheduledUpdateInCurrentCommit = false;
- commitCountInCurrentWorkLoop++;
- isCommitting = false;
- labelsInCurrentCommit.clear();
- endMark('(Committing Changes)', '(Committing Changes)', warning);
- }
- }
- function startCommitSnapshotEffectsTimer() {
- {
- if (!supportsUserTiming) {
- return;
- }
- effectCountInCurrentCommit = 0;
- beginMark('(Committing Snapshot Effects)');
- }
- }
- function stopCommitSnapshotEffectsTimer() {
- {
- if (!supportsUserTiming) {
- return;
- }
- var count = effectCountInCurrentCommit;
- effectCountInCurrentCommit = 0;
- endMark("(Committing Snapshot Effects: " + count + " Total)", '(Committing Snapshot Effects)', null);
- }
- }
- function startCommitHostEffectsTimer() {
- {
- if (!supportsUserTiming) {
- return;
- }
- effectCountInCurrentCommit = 0;
- beginMark('(Committing Host Effects)');
- }
- }
- function stopCommitHostEffectsTimer() {
- {
- if (!supportsUserTiming) {
- return;
- }
- var count = effectCountInCurrentCommit;
- effectCountInCurrentCommit = 0;
- endMark("(Committing Host Effects: " + count + " Total)", '(Committing Host Effects)', null);
- }
- }
- function startCommitLifeCyclesTimer() {
- {
- if (!supportsUserTiming) {
- return;
- }
- effectCountInCurrentCommit = 0;
- beginMark('(Calling Lifecycle Methods)');
- }
- }
- function stopCommitLifeCyclesTimer() {
- {
- if (!supportsUserTiming) {
- return;
- }
- var count = effectCountInCurrentCommit;
- effectCountInCurrentCommit = 0;
- endMark("(Calling Lifecycle Methods: " + count + " Total)", '(Calling Lifecycle Methods)', null);
- }
- }
- var valueStack = [];
- var fiberStack;
- {
- fiberStack = [];
- }
- var index = -1;
- function createCursor(defaultValue) {
- return {
- current: defaultValue
- };
- }
- function pop(cursor, fiber) {
- if (index < 0) {
- {
- error('Unexpected pop.');
- }
- return;
- }
- {
- if (fiber !== fiberStack[index]) {
- error('Unexpected Fiber popped.');
- }
- }
- cursor.current = valueStack[index];
- valueStack[index] = null;
- {
- fiberStack[index] = null;
- }
- index--;
- }
- function push(cursor, value, fiber) {
- index++;
- valueStack[index] = cursor.current;
- {
- fiberStack[index] = fiber;
- }
- cursor.current = value;
- }
- var warnedAboutMissingGetChildContext;
- {
- warnedAboutMissingGetChildContext = {};
- }
- var emptyContextObject = {};
- {
- Object.freeze(emptyContextObject);
- }
- var contextStackCursor = createCursor(emptyContextObject);
- var didPerformWorkStackCursor = createCursor(false);
-
-
- var previousContext = emptyContextObject;
- function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {
- {
- if (didPushOwnContextIfProvider && isContextProvider(Component)) {
-
-
-
-
- return previousContext;
- }
- return contextStackCursor.current;
- }
- }
- function cacheContext(workInProgress, unmaskedContext, maskedContext) {
- {
- var instance = workInProgress.stateNode;
- instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
- instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
- }
- }
- function getMaskedContext(workInProgress, unmaskedContext) {
- {
- var type = workInProgress.type;
- var contextTypes = type.contextTypes;
- if (!contextTypes) {
- return emptyContextObject;
- }
-
-
- var instance = workInProgress.stateNode;
- if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
- return instance.__reactInternalMemoizedMaskedChildContext;
- }
- var context = {};
- for (var key in contextTypes) {
- context[key] = unmaskedContext[key];
- }
- {
- var name = getComponentName(type) || 'Unknown';
- checkPropTypes_1(contextTypes, context, 'context', name, getCurrentFiberStackInDev);
- }
-
- if (instance) {
- cacheContext(workInProgress, unmaskedContext, context);
- }
- return context;
- }
- }
- function hasContextChanged() {
- {
- return didPerformWorkStackCursor.current;
- }
- }
- function isContextProvider(type) {
- {
- var childContextTypes = type.childContextTypes;
- return childContextTypes !== null && childContextTypes !== undefined;
- }
- }
- function popContext(fiber) {
- {
- pop(didPerformWorkStackCursor, fiber);
- pop(contextStackCursor, fiber);
- }
- }
- function popTopLevelContextObject(fiber) {
- {
- pop(didPerformWorkStackCursor, fiber);
- pop(contextStackCursor, fiber);
- }
- }
- function pushTopLevelContextObject(fiber, context, didChange) {
- {
- if (!(contextStackCursor.current === emptyContextObject)) {
- {
- throw Error( "Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- push(contextStackCursor, context, fiber);
- push(didPerformWorkStackCursor, didChange, fiber);
- }
- }
- function processChildContext(fiber, type, parentContext) {
- {
- var instance = fiber.stateNode;
- var childContextTypes = type.childContextTypes;
-
- if (typeof instance.getChildContext !== 'function') {
- {
- var componentName = getComponentName(type) || 'Unknown';
- if (!warnedAboutMissingGetChildContext[componentName]) {
- warnedAboutMissingGetChildContext[componentName] = true;
- error('%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);
- }
- }
- return parentContext;
- }
- var childContext;
- {
- setCurrentPhase('getChildContext');
- }
- startPhaseTimer(fiber, 'getChildContext');
- childContext = instance.getChildContext();
- stopPhaseTimer();
- {
- setCurrentPhase(null);
- }
- for (var contextKey in childContext) {
- if (!(contextKey in childContextTypes)) {
- {
- throw Error( (getComponentName(type) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes." );
- }
- }
- }
- {
- var name = getComponentName(type) || 'Unknown';
- checkPropTypes_1(childContextTypes, childContext, 'child context', name,
-
-
-
-
- getCurrentFiberStackInDev);
- }
- return _assign({}, parentContext, {}, childContext);
- }
- }
- function pushContextProvider(workInProgress) {
- {
- var instance = workInProgress.stateNode;
-
-
- var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject;
-
- previousContext = contextStackCursor.current;
- push(contextStackCursor, memoizedMergedChildContext, workInProgress);
- push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);
- return true;
- }
- }
- function invalidateContextProvider(workInProgress, type, didChange) {
- {
- var instance = workInProgress.stateNode;
- if (!instance) {
- {
- throw Error( "Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- if (didChange) {
-
-
-
- var mergedContext = processChildContext(workInProgress, type, previousContext);
- instance.__reactInternalMemoizedMergedChildContext = mergedContext;
-
- pop(didPerformWorkStackCursor, workInProgress);
- pop(contextStackCursor, workInProgress);
- push(contextStackCursor, mergedContext, workInProgress);
- push(didPerformWorkStackCursor, didChange, workInProgress);
- } else {
- pop(didPerformWorkStackCursor, workInProgress);
- push(didPerformWorkStackCursor, didChange, workInProgress);
- }
- }
- }
- function findCurrentUnmaskedContext(fiber) {
- {
-
-
- if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {
- {
- throw Error( "Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- var node = fiber;
- do {
- switch (node.tag) {
- case HostRoot:
- return node.stateNode.context;
- case ClassComponent:
- {
- var Component = node.type;
- if (isContextProvider(Component)) {
- return node.stateNode.__reactInternalMemoizedMergedChildContext;
- }
- break;
- }
- }
- node = node.return;
- } while (node !== null);
- {
- {
- throw Error( "Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- }
- }
- var LegacyRoot = 0;
- var BlockingRoot = 1;
- var ConcurrentRoot = 2;
- var ReactInternals$2 = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
- var _ReactInternals$Sched$1 = ReactInternals$2.SchedulerTracing,
- __interactionsRef = _ReactInternals$Sched$1.__interactionsRef,
- __subscriberRef = _ReactInternals$Sched$1.__subscriberRef,
- unstable_clear = _ReactInternals$Sched$1.unstable_clear,
- unstable_getCurrent = _ReactInternals$Sched$1.unstable_getCurrent,
- unstable_getThreadID = _ReactInternals$Sched$1.unstable_getThreadID,
- unstable_subscribe = _ReactInternals$Sched$1.unstable_subscribe,
- unstable_trace = _ReactInternals$Sched$1.unstable_trace,
- unstable_unsubscribe = _ReactInternals$Sched$1.unstable_unsubscribe,
- unstable_wrap = _ReactInternals$Sched$1.unstable_wrap;
- var Scheduler_runWithPriority = unstable_runWithPriority,
- Scheduler_scheduleCallback = unstable_scheduleCallback,
- Scheduler_cancelCallback = unstable_cancelCallback,
- Scheduler_shouldYield = unstable_shouldYield,
- Scheduler_requestPaint = unstable_requestPaint,
- Scheduler_now = unstable_now,
- Scheduler_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel,
- Scheduler_ImmediatePriority = unstable_ImmediatePriority,
- Scheduler_UserBlockingPriority = unstable_UserBlockingPriority,
- Scheduler_NormalPriority = unstable_NormalPriority,
- Scheduler_LowPriority = unstable_LowPriority,
- Scheduler_IdlePriority = unstable_IdlePriority;
- {
-
-
-
- if (!(__interactionsRef != null && __interactionsRef.current != null)) {
- {
- throw Error( "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling" );
- }
- }
- }
- var fakeCallbackNode = {};
-
-
- var ImmediatePriority = 99;
- var UserBlockingPriority$1 = 98;
- var NormalPriority = 97;
- var LowPriority = 96;
- var IdlePriority = 95;
- var NoPriority = 90;
- var shouldYield = Scheduler_shouldYield;
- var requestPaint =
- Scheduler_requestPaint !== undefined ? Scheduler_requestPaint : function () {};
- var syncQueue = null;
- var immediateQueueCallbackNode = null;
- var isFlushingSyncQueue = false;
- var initialTimeMs = Scheduler_now();
-
-
-
-
-
-
- var now = initialTimeMs < 10000 ? Scheduler_now : function () {
- return Scheduler_now() - initialTimeMs;
- };
- function getCurrentPriorityLevel() {
- switch (Scheduler_getCurrentPriorityLevel()) {
- case Scheduler_ImmediatePriority:
- return ImmediatePriority;
- case Scheduler_UserBlockingPriority:
- return UserBlockingPriority$1;
- case Scheduler_NormalPriority:
- return NormalPriority;
- case Scheduler_LowPriority:
- return LowPriority;
- case Scheduler_IdlePriority:
- return IdlePriority;
- default:
- {
- {
- throw Error( "Unknown priority level." );
- }
- }
- }
- }
- function reactPriorityToSchedulerPriority(reactPriorityLevel) {
- switch (reactPriorityLevel) {
- case ImmediatePriority:
- return Scheduler_ImmediatePriority;
- case UserBlockingPriority$1:
- return Scheduler_UserBlockingPriority;
- case NormalPriority:
- return Scheduler_NormalPriority;
- case LowPriority:
- return Scheduler_LowPriority;
- case IdlePriority:
- return Scheduler_IdlePriority;
- default:
- {
- {
- throw Error( "Unknown priority level." );
- }
- }
- }
- }
- function runWithPriority$1(reactPriorityLevel, fn) {
- var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
- return Scheduler_runWithPriority(priorityLevel, fn);
- }
- function scheduleCallback(reactPriorityLevel, callback, options) {
- var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
- return Scheduler_scheduleCallback(priorityLevel, callback, options);
- }
- function scheduleSyncCallback(callback) {
-
-
- if (syncQueue === null) {
- syncQueue = [callback];
- immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);
- } else {
-
-
- syncQueue.push(callback);
- }
- return fakeCallbackNode;
- }
- function cancelCallback(callbackNode) {
- if (callbackNode !== fakeCallbackNode) {
- Scheduler_cancelCallback(callbackNode);
- }
- }
- function flushSyncCallbackQueue() {
- if (immediateQueueCallbackNode !== null) {
- var node = immediateQueueCallbackNode;
- immediateQueueCallbackNode = null;
- Scheduler_cancelCallback(node);
- }
- flushSyncCallbackQueueImpl();
- }
- function flushSyncCallbackQueueImpl() {
- if (!isFlushingSyncQueue && syncQueue !== null) {
-
- isFlushingSyncQueue = true;
- var i = 0;
- try {
- var _isSync = true;
- var queue = syncQueue;
- runWithPriority$1(ImmediatePriority, function () {
- for (; i < queue.length; i++) {
- var callback = queue[i];
- do {
- callback = callback(_isSync);
- } while (callback !== null);
- }
- });
- syncQueue = null;
- } catch (error) {
-
- if (syncQueue !== null) {
- syncQueue = syncQueue.slice(i + 1);
- }
- Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);
- throw error;
- } finally {
- isFlushingSyncQueue = false;
- }
- }
- }
- var NoMode = 0;
- var StrictMode = 1;
-
- var BlockingMode = 2;
- var ConcurrentMode = 4;
- var ProfileMode = 8;
-
-
-
- var MAX_SIGNED_31_BIT_INT = 1073741823;
- var NoWork = 0;
-
-
-
-
-
-
- var Never = 1;
-
- var Idle = 2;
-
- var ContinuousHydration = 3;
- var Sync = MAX_SIGNED_31_BIT_INT;
- var Batched = Sync - 1;
- var UNIT_SIZE = 10;
- var MAGIC_NUMBER_OFFSET = Batched - 1;
- function msToExpirationTime(ms) {
-
- return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);
- }
- function expirationTimeToMs(expirationTime) {
- return (MAGIC_NUMBER_OFFSET - expirationTime) * UNIT_SIZE;
- }
- function ceiling(num, precision) {
- return ((num / precision | 0) + 1) * precision;
- }
- function computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {
- return MAGIC_NUMBER_OFFSET - ceiling(MAGIC_NUMBER_OFFSET - currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE);
- }
-
- var LOW_PRIORITY_EXPIRATION = 5000;
- var LOW_PRIORITY_BATCH_SIZE = 250;
- function computeAsyncExpiration(currentTime) {
- return computeExpirationBucket(currentTime, LOW_PRIORITY_EXPIRATION, LOW_PRIORITY_BATCH_SIZE);
- }
- function computeSuspenseExpiration(currentTime, timeoutMs) {
-
- return computeExpirationBucket(currentTime, timeoutMs, LOW_PRIORITY_BATCH_SIZE);
- }
-
-
-
-
-
-
-
-
-
-
- var HIGH_PRIORITY_EXPIRATION = 500 ;
- var HIGH_PRIORITY_BATCH_SIZE = 100;
- function computeInteractiveExpiration(currentTime) {
- return computeExpirationBucket(currentTime, HIGH_PRIORITY_EXPIRATION, HIGH_PRIORITY_BATCH_SIZE);
- }
- function inferPriorityFromExpirationTime(currentTime, expirationTime) {
- if (expirationTime === Sync) {
- return ImmediatePriority;
- }
- if (expirationTime === Never || expirationTime === Idle) {
- return IdlePriority;
- }
- var msUntil = expirationTimeToMs(expirationTime) - expirationTimeToMs(currentTime);
- if (msUntil <= 0) {
- return ImmediatePriority;
- }
- if (msUntil <= HIGH_PRIORITY_EXPIRATION + HIGH_PRIORITY_BATCH_SIZE) {
- return UserBlockingPriority$1;
- }
- if (msUntil <= LOW_PRIORITY_EXPIRATION + LOW_PRIORITY_BATCH_SIZE) {
- return NormalPriority;
- }
-
- return IdlePriority;
- }
- var ReactStrictModeWarnings = {
- recordUnsafeLifecycleWarnings: function (fiber, instance) {},
- flushPendingUnsafeLifecycleWarnings: function () {},
- recordLegacyContextWarning: function (fiber, instance) {},
- flushLegacyContextWarning: function () {},
- discardPendingWarnings: function () {}
- };
- {
- var findStrictRoot = function (fiber) {
- var maybeStrictRoot = null;
- var node = fiber;
- while (node !== null) {
- if (node.mode & StrictMode) {
- maybeStrictRoot = node;
- }
- node = node.return;
- }
- return maybeStrictRoot;
- };
- var setToSortedString = function (set) {
- var array = [];
- set.forEach(function (value) {
- array.push(value);
- });
- return array.sort().join(', ');
- };
- var pendingComponentWillMountWarnings = [];
- var pendingUNSAFE_ComponentWillMountWarnings = [];
- var pendingComponentWillReceivePropsWarnings = [];
- var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
- var pendingComponentWillUpdateWarnings = [];
- var pendingUNSAFE_ComponentWillUpdateWarnings = [];
- var didWarnAboutUnsafeLifecycles = new Set();
- ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {
-
- if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
- return;
- }
- if (typeof instance.componentWillMount === 'function' &&
- instance.componentWillMount.__suppressDeprecationWarning !== true) {
- pendingComponentWillMountWarnings.push(fiber);
- }
- if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === 'function') {
- pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
- }
- if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
- pendingComponentWillReceivePropsWarnings.push(fiber);
- }
- if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
- pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
- }
- if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
- pendingComponentWillUpdateWarnings.push(fiber);
- }
- if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === 'function') {
- pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
- }
- };
- ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {
-
- var componentWillMountUniqueNames = new Set();
- if (pendingComponentWillMountWarnings.length > 0) {
- pendingComponentWillMountWarnings.forEach(function (fiber) {
- componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
- didWarnAboutUnsafeLifecycles.add(fiber.type);
- });
- pendingComponentWillMountWarnings = [];
- }
- var UNSAFE_componentWillMountUniqueNames = new Set();
- if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
- pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) {
- UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
- didWarnAboutUnsafeLifecycles.add(fiber.type);
- });
- pendingUNSAFE_ComponentWillMountWarnings = [];
- }
- var componentWillReceivePropsUniqueNames = new Set();
- if (pendingComponentWillReceivePropsWarnings.length > 0) {
- pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {
- componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
- didWarnAboutUnsafeLifecycles.add(fiber.type);
- });
- pendingComponentWillReceivePropsWarnings = [];
- }
- var UNSAFE_componentWillReceivePropsUniqueNames = new Set();
- if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
- pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) {
- UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
- didWarnAboutUnsafeLifecycles.add(fiber.type);
- });
- pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
- }
- var componentWillUpdateUniqueNames = new Set();
- if (pendingComponentWillUpdateWarnings.length > 0) {
- pendingComponentWillUpdateWarnings.forEach(function (fiber) {
- componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
- didWarnAboutUnsafeLifecycles.add(fiber.type);
- });
- pendingComponentWillUpdateWarnings = [];
- }
- var UNSAFE_componentWillUpdateUniqueNames = new Set();
- if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
- pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) {
- UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
- didWarnAboutUnsafeLifecycles.add(fiber.type);
- });
- pendingUNSAFE_ComponentWillUpdateWarnings = [];
- }
-
- if (UNSAFE_componentWillMountUniqueNames.size > 0) {
- var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);
- error('Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '\nPlease update the following components: %s', sortedNames);
- }
- if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
- var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);
- error('Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, " + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' + '\nPlease update the following components: %s', _sortedNames);
- }
- if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
- var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);
- error('Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '\nPlease update the following components: %s', _sortedNames2);
- }
- if (componentWillMountUniqueNames.size > 0) {
- var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);
- warn('componentWillMount has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames3);
- }
- if (componentWillReceivePropsUniqueNames.size > 0) {
- var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);
- warn('componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, refactor your " + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames4);
- }
- if (componentWillUpdateUniqueNames.size > 0) {
- var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);
- warn('componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames5);
- }
- };
- var pendingLegacyContextWarning = new Map();
- var didWarnAboutLegacyContext = new Set();
- ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {
- var strictRoot = findStrictRoot(fiber);
- if (strictRoot === null) {
- error('Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');
- return;
- }
- if (didWarnAboutLegacyContext.has(fiber.type)) {
- return;
- }
- var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);
- if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {
- if (warningsForRoot === undefined) {
- warningsForRoot = [];
- pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
- }
- warningsForRoot.push(fiber);
- }
- };
- ReactStrictModeWarnings.flushLegacyContextWarning = function () {
- pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {
- if (fiberArray.length === 0) {
- return;
- }
- var firstFiber = fiberArray[0];
- var uniqueNames = new Set();
- fiberArray.forEach(function (fiber) {
- uniqueNames.add(getComponentName(fiber.type) || 'Component');
- didWarnAboutLegacyContext.add(fiber.type);
- });
- var sortedNames = setToSortedString(uniqueNames);
- var firstComponentStack = getStackByFiberInDevAndProd(firstFiber);
- error('Legacy context API has been detected within a strict-mode tree.' + '\n\nThe old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here: https://fb.me/react-legacy-context' + '%s', sortedNames, firstComponentStack);
- });
- };
- ReactStrictModeWarnings.discardPendingWarnings = function () {
- pendingComponentWillMountWarnings = [];
- pendingUNSAFE_ComponentWillMountWarnings = [];
- pendingComponentWillReceivePropsWarnings = [];
- pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
- pendingComponentWillUpdateWarnings = [];
- pendingUNSAFE_ComponentWillUpdateWarnings = [];
- pendingLegacyContextWarning = new Map();
- };
- }
- var resolveFamily = null;
- var failedBoundaries = null;
- var setRefreshHandler = function (handler) {
- {
- resolveFamily = handler;
- }
- };
- function resolveFunctionForHotReloading(type) {
- {
- if (resolveFamily === null) {
-
- return type;
- }
- var family = resolveFamily(type);
- if (family === undefined) {
- return type;
- }
- return family.current;
- }
- }
- function resolveClassForHotReloading(type) {
-
- return resolveFunctionForHotReloading(type);
- }
- function resolveForwardRefForHotReloading(type) {
- {
- if (resolveFamily === null) {
-
- return type;
- }
- var family = resolveFamily(type);
- if (family === undefined) {
-
- if (type !== null && type !== undefined && typeof type.render === 'function') {
-
-
-
- var currentRender = resolveFunctionForHotReloading(type.render);
- if (type.render !== currentRender) {
- var syntheticType = {
- $$typeof: REACT_FORWARD_REF_TYPE,
- render: currentRender
- };
- if (type.displayName !== undefined) {
- syntheticType.displayName = type.displayName;
- }
- return syntheticType;
- }
- }
- return type;
- }
- return family.current;
- }
- }
- function isCompatibleFamilyForHotReloading(fiber, element) {
- {
- if (resolveFamily === null) {
-
- return false;
- }
- var prevType = fiber.elementType;
- var nextType = element.type;
- var needsCompareFamilies = false;
- var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null;
- switch (fiber.tag) {
- case ClassComponent:
- {
- if (typeof nextType === 'function') {
- needsCompareFamilies = true;
- }
- break;
- }
- case FunctionComponent:
- {
- if (typeof nextType === 'function') {
- needsCompareFamilies = true;
- } else if ($$typeofNextType === REACT_LAZY_TYPE) {
-
-
-
-
- needsCompareFamilies = true;
- }
- break;
- }
- case ForwardRef:
- {
- if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
- needsCompareFamilies = true;
- } else if ($$typeofNextType === REACT_LAZY_TYPE) {
- needsCompareFamilies = true;
- }
- break;
- }
- case MemoComponent:
- case SimpleMemoComponent:
- {
- if ($$typeofNextType === REACT_MEMO_TYPE) {
-
-
- needsCompareFamilies = true;
- } else if ($$typeofNextType === REACT_LAZY_TYPE) {
- needsCompareFamilies = true;
- }
- break;
- }
- default:
- return false;
- }
- if (needsCompareFamilies) {
-
-
-
-
-
- var prevFamily = resolveFamily(prevType);
- if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) {
- return true;
- }
- }
- return false;
- }
- }
- function markFailedErrorBoundaryForHotReloading(fiber) {
- {
- if (resolveFamily === null) {
-
- return;
- }
- if (typeof WeakSet !== 'function') {
- return;
- }
- if (failedBoundaries === null) {
- failedBoundaries = new WeakSet();
- }
- failedBoundaries.add(fiber);
- }
- }
- var scheduleRefresh = function (root, update) {
- {
- if (resolveFamily === null) {
-
- return;
- }
- var staleFamilies = update.staleFamilies,
- updatedFamilies = update.updatedFamilies;
- flushPassiveEffects();
- flushSync(function () {
- scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies);
- });
- }
- };
- var scheduleRoot = function (root, element) {
- {
- if (root.context !== emptyContextObject) {
-
-
-
- return;
- }
- flushPassiveEffects();
- syncUpdates(function () {
- updateContainer(element, root, null, null);
- });
- }
- };
- function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
- {
- var alternate = fiber.alternate,
- child = fiber.child,
- sibling = fiber.sibling,
- tag = fiber.tag,
- type = fiber.type;
- var candidateType = null;
- switch (tag) {
- case FunctionComponent:
- case SimpleMemoComponent:
- case ClassComponent:
- candidateType = type;
- break;
- case ForwardRef:
- candidateType = type.render;
- break;
- }
- if (resolveFamily === null) {
- throw new Error('Expected resolveFamily to be set during hot reload.');
- }
- var needsRender = false;
- var needsRemount = false;
- if (candidateType !== null) {
- var family = resolveFamily(candidateType);
- if (family !== undefined) {
- if (staleFamilies.has(family)) {
- needsRemount = true;
- } else if (updatedFamilies.has(family)) {
- if (tag === ClassComponent) {
- needsRemount = true;
- } else {
- needsRender = true;
- }
- }
- }
- }
- if (failedBoundaries !== null) {
- if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
- needsRemount = true;
- }
- }
- if (needsRemount) {
- fiber._debugNeedsRemount = true;
- }
- if (needsRemount || needsRender) {
- scheduleWork(fiber, Sync);
- }
- if (child !== null && !needsRemount) {
- scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
- }
- if (sibling !== null) {
- scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
- }
- }
- }
- var findHostInstancesForRefresh = function (root, families) {
- {
- var hostInstances = new Set();
- var types = new Set(families.map(function (family) {
- return family.current;
- }));
- findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances);
- return hostInstances;
- }
- };
- function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
- {
- var child = fiber.child,
- sibling = fiber.sibling,
- tag = fiber.tag,
- type = fiber.type;
- var candidateType = null;
- switch (tag) {
- case FunctionComponent:
- case SimpleMemoComponent:
- case ClassComponent:
- candidateType = type;
- break;
- case ForwardRef:
- candidateType = type.render;
- break;
- }
- var didMatch = false;
- if (candidateType !== null) {
- if (types.has(candidateType)) {
- didMatch = true;
- }
- }
- if (didMatch) {
-
-
-
- findHostInstancesForFiberShallowly(fiber, hostInstances);
- } else {
-
- if (child !== null) {
- findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
- }
- }
- if (sibling !== null) {
- findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
- }
- }
- }
- function findHostInstancesForFiberShallowly(fiber, hostInstances) {
- {
- var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
- if (foundHostInstances) {
- return;
- }
- var node = fiber;
- while (true) {
- switch (node.tag) {
- case HostComponent:
- hostInstances.add(node.stateNode);
- return;
- case HostPortal:
- hostInstances.add(node.stateNode.containerInfo);
- return;
- case HostRoot:
- hostInstances.add(node.stateNode.containerInfo);
- return;
- }
- if (node.return === null) {
- throw new Error('Expected to reach root first.');
- }
- node = node.return;
- }
- }
- }
- function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
- {
- var node = fiber;
- var foundHostInstances = false;
- while (true) {
- if (node.tag === HostComponent) {
-
- foundHostInstances = true;
- hostInstances.add(node.stateNode);
- } else if (node.child !== null) {
- node.child.return = node;
- node = node.child;
- continue;
- }
- if (node === fiber) {
- return foundHostInstances;
- }
- while (node.sibling === null) {
- if (node.return === null || node.return === fiber) {
- return foundHostInstances;
- }
- node = node.return;
- }
- node.sibling.return = node.return;
- node = node.sibling;
- }
- }
- return false;
- }
- function resolveDefaultProps(Component, baseProps) {
- if (Component && Component.defaultProps) {
-
- var props = _assign({}, baseProps);
- var defaultProps = Component.defaultProps;
- for (var propName in defaultProps) {
- if (props[propName] === undefined) {
- props[propName] = defaultProps[propName];
- }
- }
- return props;
- }
- return baseProps;
- }
- function readLazyComponentType(lazyComponent) {
- initializeLazyComponentType(lazyComponent);
- if (lazyComponent._status !== Resolved) {
- throw lazyComponent._result;
- }
- return lazyComponent._result;
- }
- var valueCursor = createCursor(null);
- var rendererSigil;
- {
-
- rendererSigil = {};
- }
- var currentlyRenderingFiber = null;
- var lastContextDependency = null;
- var lastContextWithAllBitsObserved = null;
- var isDisallowedContextReadInDEV = false;
- function resetContextDependencies() {
-
-
- currentlyRenderingFiber = null;
- lastContextDependency = null;
- lastContextWithAllBitsObserved = null;
- {
- isDisallowedContextReadInDEV = false;
- }
- }
- function enterDisallowedContextReadInDEV() {
- {
- isDisallowedContextReadInDEV = true;
- }
- }
- function exitDisallowedContextReadInDEV() {
- {
- isDisallowedContextReadInDEV = false;
- }
- }
- function pushProvider(providerFiber, nextValue) {
- var context = providerFiber.type._context;
- {
- push(valueCursor, context._currentValue, providerFiber);
- context._currentValue = nextValue;
- {
- if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {
- error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.');
- }
- context._currentRenderer = rendererSigil;
- }
- }
- }
- function popProvider(providerFiber) {
- var currentValue = valueCursor.current;
- pop(valueCursor, providerFiber);
- var context = providerFiber.type._context;
- {
- context._currentValue = currentValue;
- }
- }
- function calculateChangedBits(context, newValue, oldValue) {
- if (objectIs(oldValue, newValue)) {
-
- return 0;
- } else {
- var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
- {
- if ((changedBits & MAX_SIGNED_31_BIT_INT) !== changedBits) {
- error('calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);
- }
- }
- return changedBits | 0;
- }
- }
- function scheduleWorkOnParentPath(parent, renderExpirationTime) {
-
-
- var node = parent;
- while (node !== null) {
- var alternate = node.alternate;
- if (node.childExpirationTime < renderExpirationTime) {
- node.childExpirationTime = renderExpirationTime;
- if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
- alternate.childExpirationTime = renderExpirationTime;
- }
- } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
- alternate.childExpirationTime = renderExpirationTime;
- } else {
-
-
- break;
- }
- node = node.return;
- }
- }
- function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) {
- var fiber = workInProgress.child;
- if (fiber !== null) {
-
- fiber.return = workInProgress;
- }
- while (fiber !== null) {
- var nextFiber = void 0;
- var list = fiber.dependencies;
- if (list !== null) {
- nextFiber = fiber.child;
- var dependency = list.firstContext;
- while (dependency !== null) {
-
- if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {
-
- if (fiber.tag === ClassComponent) {
-
- var update = createUpdate(renderExpirationTime, null);
- update.tag = ForceUpdate;
-
-
-
- enqueueUpdate(fiber, update);
- }
- if (fiber.expirationTime < renderExpirationTime) {
- fiber.expirationTime = renderExpirationTime;
- }
- var alternate = fiber.alternate;
- if (alternate !== null && alternate.expirationTime < renderExpirationTime) {
- alternate.expirationTime = renderExpirationTime;
- }
- scheduleWorkOnParentPath(fiber.return, renderExpirationTime);
- if (list.expirationTime < renderExpirationTime) {
- list.expirationTime = renderExpirationTime;
- }
-
- break;
- }
- dependency = dependency.next;
- }
- } else if (fiber.tag === ContextProvider) {
-
- nextFiber = fiber.type === workInProgress.type ? null : fiber.child;
- } else {
-
- nextFiber = fiber.child;
- }
- if (nextFiber !== null) {
-
- nextFiber.return = fiber;
- } else {
-
- nextFiber = fiber;
- while (nextFiber !== null) {
- if (nextFiber === workInProgress) {
-
- nextFiber = null;
- break;
- }
- var sibling = nextFiber.sibling;
- if (sibling !== null) {
-
- sibling.return = nextFiber.return;
- nextFiber = sibling;
- break;
- }
- nextFiber = nextFiber.return;
- }
- }
- fiber = nextFiber;
- }
- }
- function prepareToReadContext(workInProgress, renderExpirationTime) {
- currentlyRenderingFiber = workInProgress;
- lastContextDependency = null;
- lastContextWithAllBitsObserved = null;
- var dependencies = workInProgress.dependencies;
- if (dependencies !== null) {
- var firstContext = dependencies.firstContext;
- if (firstContext !== null) {
- if (dependencies.expirationTime >= renderExpirationTime) {
-
- markWorkInProgressReceivedUpdate();
- }
- dependencies.firstContext = null;
- }
- }
- }
- function readContext(context, observedBits) {
- {
-
-
- if (isDisallowedContextReadInDEV) {
- error('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().');
- }
- }
- if (lastContextWithAllBitsObserved === context) ; else if (observedBits === false || observedBits === 0) ; else {
- var resolvedObservedBits;
- if (typeof observedBits !== 'number' || observedBits === MAX_SIGNED_31_BIT_INT) {
-
- lastContextWithAllBitsObserved = context;
- resolvedObservedBits = MAX_SIGNED_31_BIT_INT;
- } else {
- resolvedObservedBits = observedBits;
- }
- var contextItem = {
- context: context,
- observedBits: resolvedObservedBits,
- next: null
- };
- if (lastContextDependency === null) {
- if (!(currentlyRenderingFiber !== null)) {
- {
- throw Error( "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()." );
- }
- }
- lastContextDependency = contextItem;
- currentlyRenderingFiber.dependencies = {
- expirationTime: NoWork,
- firstContext: contextItem,
- responders: null
- };
- } else {
-
- lastContextDependency = lastContextDependency.next = contextItem;
- }
- }
- return context._currentValue ;
- }
- var UpdateState = 0;
- var ReplaceState = 1;
- var ForceUpdate = 2;
- var CaptureUpdate = 3;
-
-
- var hasForceUpdate = false;
- var didWarnUpdateInsideUpdate;
- var currentlyProcessingQueue;
- {
- didWarnUpdateInsideUpdate = false;
- currentlyProcessingQueue = null;
- }
- function initializeUpdateQueue(fiber) {
- var queue = {
- baseState: fiber.memoizedState,
- baseQueue: null,
- shared: {
- pending: null
- },
- effects: null
- };
- fiber.updateQueue = queue;
- }
- function cloneUpdateQueue(current, workInProgress) {
-
- var queue = workInProgress.updateQueue;
- var currentQueue = current.updateQueue;
- if (queue === currentQueue) {
- var clone = {
- baseState: currentQueue.baseState,
- baseQueue: currentQueue.baseQueue,
- shared: currentQueue.shared,
- effects: currentQueue.effects
- };
- workInProgress.updateQueue = clone;
- }
- }
- function createUpdate(expirationTime, suspenseConfig) {
- var update = {
- expirationTime: expirationTime,
- suspenseConfig: suspenseConfig,
- tag: UpdateState,
- payload: null,
- callback: null,
- next: null
- };
- update.next = update;
- {
- update.priority = getCurrentPriorityLevel();
- }
- return update;
- }
- function enqueueUpdate(fiber, update) {
- var updateQueue = fiber.updateQueue;
- if (updateQueue === null) {
-
- return;
- }
- var sharedQueue = updateQueue.shared;
- var pending = sharedQueue.pending;
- if (pending === null) {
-
- update.next = update;
- } else {
- update.next = pending.next;
- pending.next = update;
- }
- sharedQueue.pending = update;
- {
- if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {
- error('An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');
- didWarnUpdateInsideUpdate = true;
- }
- }
- }
- function enqueueCapturedUpdate(workInProgress, update) {
- var current = workInProgress.alternate;
- if (current !== null) {
-
- cloneUpdateQueue(current, workInProgress);
- }
- var queue = workInProgress.updateQueue;
- var last = queue.baseQueue;
- if (last === null) {
- queue.baseQueue = update.next = update;
- update.next = update;
- } else {
- update.next = last.next;
- last.next = update;
- }
- }
- function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {
- switch (update.tag) {
- case ReplaceState:
- {
- var payload = update.payload;
- if (typeof payload === 'function') {
-
- {
- enterDisallowedContextReadInDEV();
- if ( workInProgress.mode & StrictMode) {
- payload.call(instance, prevState, nextProps);
- }
- }
- var nextState = payload.call(instance, prevState, nextProps);
- {
- exitDisallowedContextReadInDEV();
- }
- return nextState;
- }
- return payload;
- }
- case CaptureUpdate:
- {
- workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture;
- }
-
- case UpdateState:
- {
- var _payload = update.payload;
- var partialState;
- if (typeof _payload === 'function') {
-
- {
- enterDisallowedContextReadInDEV();
- if ( workInProgress.mode & StrictMode) {
- _payload.call(instance, prevState, nextProps);
- }
- }
- partialState = _payload.call(instance, prevState, nextProps);
- {
- exitDisallowedContextReadInDEV();
- }
- } else {
-
- partialState = _payload;
- }
- if (partialState === null || partialState === undefined) {
-
- return prevState;
- }
- return _assign({}, prevState, partialState);
- }
- case ForceUpdate:
- {
- hasForceUpdate = true;
- return prevState;
- }
- }
- return prevState;
- }
- function processUpdateQueue(workInProgress, props, instance, renderExpirationTime) {
-
- var queue = workInProgress.updateQueue;
- hasForceUpdate = false;
- {
- currentlyProcessingQueue = queue.shared;
- }
- var baseQueue = queue.baseQueue;
- var pendingQueue = queue.shared.pending;
- if (pendingQueue !== null) {
-
-
- if (baseQueue !== null) {
-
- var baseFirst = baseQueue.next;
- var pendingFirst = pendingQueue.next;
- baseQueue.next = pendingFirst;
- pendingQueue.next = baseFirst;
- }
- baseQueue = pendingQueue;
- queue.shared.pending = null;
- var current = workInProgress.alternate;
- if (current !== null) {
- var currentQueue = current.updateQueue;
- if (currentQueue !== null) {
- currentQueue.baseQueue = pendingQueue;
- }
- }
- }
- if (baseQueue !== null) {
- var first = baseQueue.next;
- var newState = queue.baseState;
- var newExpirationTime = NoWork;
- var newBaseState = null;
- var newBaseQueueFirst = null;
- var newBaseQueueLast = null;
- if (first !== null) {
- var update = first;
- do {
- var updateExpirationTime = update.expirationTime;
- if (updateExpirationTime < renderExpirationTime) {
-
-
-
- var clone = {
- expirationTime: update.expirationTime,
- suspenseConfig: update.suspenseConfig,
- tag: update.tag,
- payload: update.payload,
- callback: update.callback,
- next: null
- };
- if (newBaseQueueLast === null) {
- newBaseQueueFirst = newBaseQueueLast = clone;
- newBaseState = newState;
- } else {
- newBaseQueueLast = newBaseQueueLast.next = clone;
- }
- if (updateExpirationTime > newExpirationTime) {
- newExpirationTime = updateExpirationTime;
- }
- } else {
-
- if (newBaseQueueLast !== null) {
- var _clone = {
- expirationTime: Sync,
-
- suspenseConfig: update.suspenseConfig,
- tag: update.tag,
- payload: update.payload,
- callback: update.callback,
- next: null
- };
- newBaseQueueLast = newBaseQueueLast.next = _clone;
- }
-
-
-
-
-
- markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig);
- newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance);
- var callback = update.callback;
- if (callback !== null) {
- workInProgress.effectTag |= Callback;
- var effects = queue.effects;
- if (effects === null) {
- queue.effects = [update];
- } else {
- effects.push(update);
- }
- }
- }
- update = update.next;
- if (update === null || update === first) {
- pendingQueue = queue.shared.pending;
- if (pendingQueue === null) {
- break;
- } else {
-
-
- update = baseQueue.next = pendingQueue.next;
- pendingQueue.next = first;
- queue.baseQueue = baseQueue = pendingQueue;
- queue.shared.pending = null;
- }
- }
- } while (true);
- }
- if (newBaseQueueLast === null) {
- newBaseState = newState;
- } else {
- newBaseQueueLast.next = newBaseQueueFirst;
- }
- queue.baseState = newBaseState;
- queue.baseQueue = newBaseQueueLast;
-
-
-
-
-
-
- markUnprocessedUpdateTime(newExpirationTime);
- workInProgress.expirationTime = newExpirationTime;
- workInProgress.memoizedState = newState;
- }
- {
- currentlyProcessingQueue = null;
- }
- }
- function callCallback(callback, context) {
- if (!(typeof callback === 'function')) {
- {
- throw Error( "Invalid argument passed as callback. Expected a function. Instead received: " + callback );
- }
- }
- callback.call(context);
- }
- function resetHasForceUpdateBeforeProcessing() {
- hasForceUpdate = false;
- }
- function checkHasForceUpdateAfterProcessing() {
- return hasForceUpdate;
- }
- function commitUpdateQueue(finishedWork, finishedQueue, instance) {
-
- var effects = finishedQueue.effects;
- finishedQueue.effects = null;
- if (effects !== null) {
- for (var i = 0; i < effects.length; i++) {
- var effect = effects[i];
- var callback = effect.callback;
- if (callback !== null) {
- effect.callback = null;
- callCallback(callback, instance);
- }
- }
- }
- }
- var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
- function requestCurrentSuspenseConfig() {
- return ReactCurrentBatchConfig.suspense;
- }
- var fakeInternalInstance = {};
- var isArray = Array.isArray;
-
- var emptyRefsObject = new React.Component().refs;
- var didWarnAboutStateAssignmentForComponent;
- var didWarnAboutUninitializedState;
- var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
- var didWarnAboutLegacyLifecyclesAndDerivedState;
- var didWarnAboutUndefinedDerivedState;
- var warnOnUndefinedDerivedState;
- var warnOnInvalidCallback;
- var didWarnAboutDirectlyAssigningPropsToState;
- var didWarnAboutContextTypeAndContextTypes;
- var didWarnAboutInvalidateContextType;
- {
- didWarnAboutStateAssignmentForComponent = new Set();
- didWarnAboutUninitializedState = new Set();
- didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
- didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
- didWarnAboutDirectlyAssigningPropsToState = new Set();
- didWarnAboutUndefinedDerivedState = new Set();
- didWarnAboutContextTypeAndContextTypes = new Set();
- didWarnAboutInvalidateContextType = new Set();
- var didWarnOnInvalidCallback = new Set();
- warnOnInvalidCallback = function (callback, callerName) {
- if (callback === null || typeof callback === 'function') {
- return;
- }
- var key = callerName + "_" + callback;
- if (!didWarnOnInvalidCallback.has(key)) {
- didWarnOnInvalidCallback.add(key);
- error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);
- }
- };
- warnOnUndefinedDerivedState = function (type, partialState) {
- if (partialState === undefined) {
- var componentName = getComponentName(type) || 'Component';
- if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
- didWarnAboutUndefinedDerivedState.add(componentName);
- error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);
- }
- }
- };
-
-
-
-
- Object.defineProperty(fakeInternalInstance, '_processChildContext', {
- enumerable: false,
- value: function () {
- {
- {
- throw Error( "_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal)." );
- }
- }
- }
- });
- Object.freeze(fakeInternalInstance);
- }
- function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {
- var prevState = workInProgress.memoizedState;
- {
- if ( workInProgress.mode & StrictMode) {
-
- getDerivedStateFromProps(nextProps, prevState);
- }
- }
- var partialState = getDerivedStateFromProps(nextProps, prevState);
- {
- warnOnUndefinedDerivedState(ctor, partialState);
- }
- var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState);
- workInProgress.memoizedState = memoizedState;
-
- if (workInProgress.expirationTime === NoWork) {
-
- var updateQueue = workInProgress.updateQueue;
- updateQueue.baseState = memoizedState;
- }
- }
- var classComponentUpdater = {
- isMounted: isMounted,
- enqueueSetState: function (inst, payload, callback) {
- var fiber = get(inst);
- var currentTime = requestCurrentTimeForUpdate();
- var suspenseConfig = requestCurrentSuspenseConfig();
- var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
- var update = createUpdate(expirationTime, suspenseConfig);
- update.payload = payload;
- if (callback !== undefined && callback !== null) {
- {
- warnOnInvalidCallback(callback, 'setState');
- }
- update.callback = callback;
- }
- enqueueUpdate(fiber, update);
- scheduleWork(fiber, expirationTime);
- },
- enqueueReplaceState: function (inst, payload, callback) {
- var fiber = get(inst);
- var currentTime = requestCurrentTimeForUpdate();
- var suspenseConfig = requestCurrentSuspenseConfig();
- var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
- var update = createUpdate(expirationTime, suspenseConfig);
- update.tag = ReplaceState;
- update.payload = payload;
- if (callback !== undefined && callback !== null) {
- {
- warnOnInvalidCallback(callback, 'replaceState');
- }
- update.callback = callback;
- }
- enqueueUpdate(fiber, update);
- scheduleWork(fiber, expirationTime);
- },
- enqueueForceUpdate: function (inst, callback) {
- var fiber = get(inst);
- var currentTime = requestCurrentTimeForUpdate();
- var suspenseConfig = requestCurrentSuspenseConfig();
- var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
- var update = createUpdate(expirationTime, suspenseConfig);
- update.tag = ForceUpdate;
- if (callback !== undefined && callback !== null) {
- {
- warnOnInvalidCallback(callback, 'forceUpdate');
- }
- update.callback = callback;
- }
- enqueueUpdate(fiber, update);
- scheduleWork(fiber, expirationTime);
- }
- };
- function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {
- var instance = workInProgress.stateNode;
- if (typeof instance.shouldComponentUpdate === 'function') {
- {
- if ( workInProgress.mode & StrictMode) {
-
- instance.shouldComponentUpdate(newProps, newState, nextContext);
- }
- }
- startPhaseTimer(workInProgress, 'shouldComponentUpdate');
- var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
- stopPhaseTimer();
- {
- if (shouldUpdate === undefined) {
- error('%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component');
- }
- }
- return shouldUpdate;
- }
- if (ctor.prototype && ctor.prototype.isPureReactComponent) {
- return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
- }
- return true;
- }
- function checkClassInstance(workInProgress, ctor, newProps) {
- var instance = workInProgress.stateNode;
- {
- var name = getComponentName(ctor) || 'Component';
- var renderPresent = instance.render;
- if (!renderPresent) {
- if (ctor.prototype && typeof ctor.prototype.render === 'function') {
- error('%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);
- } else {
- error('%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);
- }
- }
- if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {
- error('getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name);
- }
- if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {
- error('getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name);
- }
- if (instance.propTypes) {
- error('propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name);
- }
- if (instance.contextType) {
- error('contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name);
- }
- {
- if (instance.contextTypes) {
- error('contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name);
- }
- if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
- didWarnAboutContextTypeAndContextTypes.add(ctor);
- error('%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);
- }
- }
- if (typeof instance.componentShouldUpdate === 'function') {
- error('%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name);
- }
- if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {
- error('%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component');
- }
- if (typeof instance.componentDidUnmount === 'function') {
- error('%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name);
- }
- if (typeof instance.componentDidReceiveProps === 'function') {
- error('%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name);
- }
- if (typeof instance.componentWillRecieveProps === 'function') {
- error('%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name);
- }
- if (typeof instance.UNSAFE_componentWillRecieveProps === 'function') {
- error('%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name);
- }
- var hasMutatedProps = instance.props !== newProps;
- if (instance.props !== undefined && hasMutatedProps) {
- error('%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name);
- }
- if (instance.defaultProps) {
- error('Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name);
- }
- if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
- didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
- error('%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor));
- }
- if (typeof instance.getDerivedStateFromProps === 'function') {
- error('%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);
- }
- if (typeof instance.getDerivedStateFromError === 'function') {
- error('%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);
- }
- if (typeof ctor.getSnapshotBeforeUpdate === 'function') {
- error('%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name);
- }
- var _state = instance.state;
- if (_state && (typeof _state !== 'object' || isArray(_state))) {
- error('%s.state: must be set to an object or null', name);
- }
- if (typeof instance.getChildContext === 'function' && typeof ctor.childContextTypes !== 'object') {
- error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name);
- }
- }
- }
- function adoptClassInstance(workInProgress, instance) {
- instance.updater = classComponentUpdater;
- workInProgress.stateNode = instance;
- set(instance, workInProgress);
- {
- instance._reactInternalInstance = fakeInternalInstance;
- }
- }
- function constructClassInstance(workInProgress, ctor, props) {
- var isLegacyContextConsumer = false;
- var unmaskedContext = emptyContextObject;
- var context = emptyContextObject;
- var contextType = ctor.contextType;
- {
- if ('contextType' in ctor) {
- var isValid =
- contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined;
- if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
- didWarnAboutInvalidateContextType.add(ctor);
- var addendum = '';
- if (contextType === undefined) {
- addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';
- } else if (typeof contextType !== 'object') {
- addendum = ' However, it is set to a ' + typeof contextType + '.';
- } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
- addendum = ' Did you accidentally pass the Context.Provider instead?';
- } else if (contextType._context !== undefined) {
-
- addendum = ' Did you accidentally pass the Context.Consumer instead?';
- } else {
- addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
- }
- error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(ctor) || 'Component', addendum);
- }
- }
- }
- if (typeof contextType === 'object' && contextType !== null) {
- context = readContext(contextType);
- } else {
- unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
- var contextTypes = ctor.contextTypes;
- isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;
- context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;
- }
- {
- if ( workInProgress.mode & StrictMode) {
- new ctor(props, context);
- }
- }
- var instance = new ctor(props, context);
- var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;
- adoptClassInstance(workInProgress, instance);
- {
- if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {
- var componentName = getComponentName(ctor) || 'Component';
- if (!didWarnAboutUninitializedState.has(componentName)) {
- didWarnAboutUninitializedState.add(componentName);
- error('`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName);
- }
- }
-
-
- if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {
- var foundWillMountName = null;
- var foundWillReceivePropsName = null;
- var foundWillUpdateName = null;
- if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {
- foundWillMountName = 'componentWillMount';
- } else if (typeof instance.UNSAFE_componentWillMount === 'function') {
- foundWillMountName = 'UNSAFE_componentWillMount';
- }
- if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
- foundWillReceivePropsName = 'componentWillReceiveProps';
- } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
- foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
- }
- if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
- foundWillUpdateName = 'componentWillUpdate';
- } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
- foundWillUpdateName = 'UNSAFE_componentWillUpdate';
- }
- if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
- var _componentName = getComponentName(ctor) || 'Component';
- var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
- if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
- didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
- error('Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? "\n " + foundWillMountName : '', foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : '', foundWillUpdateName !== null ? "\n " + foundWillUpdateName : '');
- }
- }
- }
- }
-
- if (isLegacyContextConsumer) {
- cacheContext(workInProgress, unmaskedContext, context);
- }
- return instance;
- }
- function callComponentWillMount(workInProgress, instance) {
- startPhaseTimer(workInProgress, 'componentWillMount');
- var oldState = instance.state;
- if (typeof instance.componentWillMount === 'function') {
- instance.componentWillMount();
- }
- if (typeof instance.UNSAFE_componentWillMount === 'function') {
- instance.UNSAFE_componentWillMount();
- }
- stopPhaseTimer();
- if (oldState !== instance.state) {
- {
- error('%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component');
- }
- classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
- }
- }
- function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {
- var oldState = instance.state;
- startPhaseTimer(workInProgress, 'componentWillReceiveProps');
- if (typeof instance.componentWillReceiveProps === 'function') {
- instance.componentWillReceiveProps(newProps, nextContext);
- }
- if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
- instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
- }
- stopPhaseTimer();
- if (instance.state !== oldState) {
- {
- var componentName = getComponentName(workInProgress.type) || 'Component';
- if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
- didWarnAboutStateAssignmentForComponent.add(componentName);
- error('%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName);
- }
- }
- classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
- }
- }
- function mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
- {
- checkClassInstance(workInProgress, ctor, newProps);
- }
- var instance = workInProgress.stateNode;
- instance.props = newProps;
- instance.state = workInProgress.memoizedState;
- instance.refs = emptyRefsObject;
- initializeUpdateQueue(workInProgress);
- var contextType = ctor.contextType;
- if (typeof contextType === 'object' && contextType !== null) {
- instance.context = readContext(contextType);
- } else {
- var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
- instance.context = getMaskedContext(workInProgress, unmaskedContext);
- }
- {
- if (instance.state === newProps) {
- var componentName = getComponentName(ctor) || 'Component';
- if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
- didWarnAboutDirectlyAssigningPropsToState.add(componentName);
- error('%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName);
- }
- }
- if (workInProgress.mode & StrictMode) {
- ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);
- }
- {
- ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);
- }
- }
- processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);
- instance.state = workInProgress.memoizedState;
- var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
- if (typeof getDerivedStateFromProps === 'function') {
- applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
- instance.state = workInProgress.memoizedState;
- }
-
- if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
- callComponentWillMount(workInProgress, instance);
-
- processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);
- instance.state = workInProgress.memoizedState;
- }
- if (typeof instance.componentDidMount === 'function') {
- workInProgress.effectTag |= Update;
- }
- }
- function resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
- var instance = workInProgress.stateNode;
- var oldProps = workInProgress.memoizedProps;
- instance.props = oldProps;
- var oldContext = instance.context;
- var contextType = ctor.contextType;
- var nextContext = emptyContextObject;
- if (typeof contextType === 'object' && contextType !== null) {
- nextContext = readContext(contextType);
- } else {
- var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
- nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);
- }
- var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
- var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function';
-
-
-
-
- if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
- if (oldProps !== newProps || oldContext !== nextContext) {
- callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
- }
- }
- resetHasForceUpdateBeforeProcessing();
- var oldState = workInProgress.memoizedState;
- var newState = instance.state = oldState;
- processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);
- newState = workInProgress.memoizedState;
- if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
-
-
- if (typeof instance.componentDidMount === 'function') {
- workInProgress.effectTag |= Update;
- }
- return false;
- }
- if (typeof getDerivedStateFromProps === 'function') {
- applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
- newState = workInProgress.memoizedState;
- }
- var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);
- if (shouldUpdate) {
-
-
- if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
- startPhaseTimer(workInProgress, 'componentWillMount');
- if (typeof instance.componentWillMount === 'function') {
- instance.componentWillMount();
- }
- if (typeof instance.UNSAFE_componentWillMount === 'function') {
- instance.UNSAFE_componentWillMount();
- }
- stopPhaseTimer();
- }
- if (typeof instance.componentDidMount === 'function') {
- workInProgress.effectTag |= Update;
- }
- } else {
-
-
- if (typeof instance.componentDidMount === 'function') {
- workInProgress.effectTag |= Update;
- }
-
- workInProgress.memoizedProps = newProps;
- workInProgress.memoizedState = newState;
- }
-
- instance.props = newProps;
- instance.state = newState;
- instance.context = nextContext;
- return shouldUpdate;
- }
- function updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) {
- var instance = workInProgress.stateNode;
- cloneUpdateQueue(current, workInProgress);
- var oldProps = workInProgress.memoizedProps;
- instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps);
- var oldContext = instance.context;
- var contextType = ctor.contextType;
- var nextContext = emptyContextObject;
- if (typeof contextType === 'object' && contextType !== null) {
- nextContext = readContext(contextType);
- } else {
- var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
- nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);
- }
- var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
- var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function';
-
-
-
-
- if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
- if (oldProps !== newProps || oldContext !== nextContext) {
- callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
- }
- }
- resetHasForceUpdateBeforeProcessing();
- var oldState = workInProgress.memoizedState;
- var newState = instance.state = oldState;
- processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime);
- newState = workInProgress.memoizedState;
- if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
-
-
- if (typeof instance.componentDidUpdate === 'function') {
- if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
- workInProgress.effectTag |= Update;
- }
- }
- if (typeof instance.getSnapshotBeforeUpdate === 'function') {
- if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
- workInProgress.effectTag |= Snapshot;
- }
- }
- return false;
- }
- if (typeof getDerivedStateFromProps === 'function') {
- applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
- newState = workInProgress.memoizedState;
- }
- var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);
- if (shouldUpdate) {
-
-
- if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {
- startPhaseTimer(workInProgress, 'componentWillUpdate');
- if (typeof instance.componentWillUpdate === 'function') {
- instance.componentWillUpdate(newProps, newState, nextContext);
- }
- if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
- instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
- }
- stopPhaseTimer();
- }
- if (typeof instance.componentDidUpdate === 'function') {
- workInProgress.effectTag |= Update;
- }
- if (typeof instance.getSnapshotBeforeUpdate === 'function') {
- workInProgress.effectTag |= Snapshot;
- }
- } else {
-
-
- if (typeof instance.componentDidUpdate === 'function') {
- if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
- workInProgress.effectTag |= Update;
- }
- }
- if (typeof instance.getSnapshotBeforeUpdate === 'function') {
- if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
- workInProgress.effectTag |= Snapshot;
- }
- }
-
- workInProgress.memoizedProps = newProps;
- workInProgress.memoizedState = newState;
- }
-
- instance.props = newProps;
- instance.state = newState;
- instance.context = nextContext;
- return shouldUpdate;
- }
- var didWarnAboutMaps;
- var didWarnAboutGenerators;
- var didWarnAboutStringRefs;
- var ownerHasKeyUseWarning;
- var ownerHasFunctionTypeWarning;
- var warnForMissingKey = function (child) {};
- {
- didWarnAboutMaps = false;
- didWarnAboutGenerators = false;
- didWarnAboutStringRefs = {};
-
- ownerHasKeyUseWarning = {};
- ownerHasFunctionTypeWarning = {};
- warnForMissingKey = function (child) {
- if (child === null || typeof child !== 'object') {
- return;
- }
- if (!child._store || child._store.validated || child.key != null) {
- return;
- }
- if (!(typeof child._store === 'object')) {
- {
- throw Error( "React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- child._store.validated = true;
- var currentComponentErrorInfo = 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev();
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
- return;
- }
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
- error('Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.');
- };
- }
- var isArray$1 = Array.isArray;
- function coerceRef(returnFiber, current, element) {
- var mixedRef = element.ref;
- if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {
- {
-
-
- if ((returnFiber.mode & StrictMode || warnAboutStringRefs) &&
-
-
- !(element._owner && element._self && element._owner.stateNode !== element._self)) {
- var componentName = getComponentName(returnFiber.type) || 'Component';
- if (!didWarnAboutStringRefs[componentName]) {
- {
- error('A string ref, "%s", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref%s', mixedRef, getStackByFiberInDevAndProd(returnFiber));
- }
- didWarnAboutStringRefs[componentName] = true;
- }
- }
- }
- if (element._owner) {
- var owner = element._owner;
- var inst;
- if (owner) {
- var ownerFiber = owner;
- if (!(ownerFiber.tag === ClassComponent)) {
- {
- throw Error( "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" );
- }
- }
- inst = ownerFiber.stateNode;
- }
- if (!inst) {
- {
- throw Error( "Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- var stringRef = '' + mixedRef;
- if (current !== null && current.ref !== null && typeof current.ref === 'function' && current.ref._stringRef === stringRef) {
- return current.ref;
- }
- var ref = function (value) {
- var refs = inst.refs;
- if (refs === emptyRefsObject) {
-
- refs = inst.refs = {};
- }
- if (value === null) {
- delete refs[stringRef];
- } else {
- refs[stringRef] = value;
- }
- };
- ref._stringRef = stringRef;
- return ref;
- } else {
- if (!(typeof mixedRef === 'string')) {
- {
- throw Error( "Expected ref to be a function, a string, an object returned by React.createRef(), or null." );
- }
- }
- if (!element._owner) {
- {
- throw Error( "Element ref was specified as a string (" + mixedRef + ") 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." );
- }
- }
- }
- }
- return mixedRef;
- }
- function throwOnInvalidObjectType(returnFiber, newChild) {
- if (returnFiber.type !== 'textarea') {
- var addendum = '';
- {
- addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev();
- }
- {
- {
- throw Error( "Objects are not valid as a React child (found: " + (Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild) + ")." + addendum );
- }
- }
- }
- }
- function warnOnFunctionType() {
- {
- var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev();
- if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {
- return;
- }
- ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true;
- error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');
- }
- }
-
-
-
- function ChildReconciler(shouldTrackSideEffects) {
- function deleteChild(returnFiber, childToDelete) {
- if (!shouldTrackSideEffects) {
-
- return;
- }
-
-
-
-
- var last = returnFiber.lastEffect;
- if (last !== null) {
- last.nextEffect = childToDelete;
- returnFiber.lastEffect = childToDelete;
- } else {
- returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
- }
- childToDelete.nextEffect = null;
- childToDelete.effectTag = Deletion;
- }
- function deleteRemainingChildren(returnFiber, currentFirstChild) {
- if (!shouldTrackSideEffects) {
-
- return null;
- }
-
- var childToDelete = currentFirstChild;
- while (childToDelete !== null) {
- deleteChild(returnFiber, childToDelete);
- childToDelete = childToDelete.sibling;
- }
- return null;
- }
- function mapRemainingChildren(returnFiber, currentFirstChild) {
-
-
-
- var existingChildren = new Map();
- var existingChild = currentFirstChild;
- while (existingChild !== null) {
- if (existingChild.key !== null) {
- existingChildren.set(existingChild.key, existingChild);
- } else {
- existingChildren.set(existingChild.index, existingChild);
- }
- existingChild = existingChild.sibling;
- }
- return existingChildren;
- }
- function useFiber(fiber, pendingProps) {
-
-
- var clone = createWorkInProgress(fiber, pendingProps);
- clone.index = 0;
- clone.sibling = null;
- return clone;
- }
- function placeChild(newFiber, lastPlacedIndex, newIndex) {
- newFiber.index = newIndex;
- if (!shouldTrackSideEffects) {
-
- return lastPlacedIndex;
- }
- var current = newFiber.alternate;
- if (current !== null) {
- var oldIndex = current.index;
- if (oldIndex < lastPlacedIndex) {
-
- newFiber.effectTag = Placement;
- return lastPlacedIndex;
- } else {
-
- return oldIndex;
- }
- } else {
-
- newFiber.effectTag = Placement;
- return lastPlacedIndex;
- }
- }
- function placeSingleChild(newFiber) {
-
-
- if (shouldTrackSideEffects && newFiber.alternate === null) {
- newFiber.effectTag = Placement;
- }
- return newFiber;
- }
- function updateTextNode(returnFiber, current, textContent, expirationTime) {
- if (current === null || current.tag !== HostText) {
-
- var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
- created.return = returnFiber;
- return created;
- } else {
-
- var existing = useFiber(current, textContent);
- existing.return = returnFiber;
- return existing;
- }
- }
- function updateElement(returnFiber, current, element, expirationTime) {
- if (current !== null) {
- if (current.elementType === element.type || (
- isCompatibleFamilyForHotReloading(current, element) )) {
-
- var existing = useFiber(current, element.props);
- existing.ref = coerceRef(returnFiber, current, element);
- existing.return = returnFiber;
- {
- existing._debugSource = element._source;
- existing._debugOwner = element._owner;
- }
- return existing;
- }
- }
- var created = createFiberFromElement(element, returnFiber.mode, expirationTime);
- created.ref = coerceRef(returnFiber, current, element);
- created.return = returnFiber;
- return created;
- }
- function updatePortal(returnFiber, current, portal, expirationTime) {
- if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) {
-
- var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
- created.return = returnFiber;
- return created;
- } else {
-
- var existing = useFiber(current, portal.children || []);
- existing.return = returnFiber;
- return existing;
- }
- }
- function updateFragment(returnFiber, current, fragment, expirationTime, key) {
- if (current === null || current.tag !== Fragment) {
-
- var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key);
- created.return = returnFiber;
- return created;
- } else {
-
- var existing = useFiber(current, fragment);
- existing.return = returnFiber;
- return existing;
- }
- }
- function createChild(returnFiber, newChild, expirationTime) {
- if (typeof newChild === 'string' || typeof newChild === 'number') {
-
-
-
- var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime);
- created.return = returnFiber;
- return created;
- }
- if (typeof newChild === 'object' && newChild !== null) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- {
- var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime);
- _created.ref = coerceRef(returnFiber, null, newChild);
- _created.return = returnFiber;
- return _created;
- }
- case REACT_PORTAL_TYPE:
- {
- var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime);
- _created2.return = returnFiber;
- return _created2;
- }
- }
- if (isArray$1(newChild) || getIteratorFn(newChild)) {
- var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null);
- _created3.return = returnFiber;
- return _created3;
- }
- throwOnInvalidObjectType(returnFiber, newChild);
- }
- {
- if (typeof newChild === 'function') {
- warnOnFunctionType();
- }
- }
- return null;
- }
- function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {
-
- var key = oldFiber !== null ? oldFiber.key : null;
- if (typeof newChild === 'string' || typeof newChild === 'number') {
-
-
-
- if (key !== null) {
- return null;
- }
- return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime);
- }
- if (typeof newChild === 'object' && newChild !== null) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- {
- if (newChild.key === key) {
- if (newChild.type === REACT_FRAGMENT_TYPE) {
- return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key);
- }
- return updateElement(returnFiber, oldFiber, newChild, expirationTime);
- } else {
- return null;
- }
- }
- case REACT_PORTAL_TYPE:
- {
- if (newChild.key === key) {
- return updatePortal(returnFiber, oldFiber, newChild, expirationTime);
- } else {
- return null;
- }
- }
- }
- if (isArray$1(newChild) || getIteratorFn(newChild)) {
- if (key !== null) {
- return null;
- }
- return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null);
- }
- throwOnInvalidObjectType(returnFiber, newChild);
- }
- {
- if (typeof newChild === 'function') {
- warnOnFunctionType();
- }
- }
- return null;
- }
- function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {
- if (typeof newChild === 'string' || typeof newChild === 'number') {
-
-
- var matchedFiber = existingChildren.get(newIdx) || null;
- return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime);
- }
- if (typeof newChild === 'object' && newChild !== null) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- {
- var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
- if (newChild.type === REACT_FRAGMENT_TYPE) {
- return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key);
- }
- return updateElement(returnFiber, _matchedFiber, newChild, expirationTime);
- }
- case REACT_PORTAL_TYPE:
- {
- var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
- return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime);
- }
- }
- if (isArray$1(newChild) || getIteratorFn(newChild)) {
- var _matchedFiber3 = existingChildren.get(newIdx) || null;
- return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null);
- }
- throwOnInvalidObjectType(returnFiber, newChild);
- }
- {
- if (typeof newChild === 'function') {
- warnOnFunctionType();
- }
- }
- return null;
- }
-
- function warnOnInvalidKey(child, knownKeys) {
- {
- if (typeof child !== 'object' || child === null) {
- return knownKeys;
- }
- switch (child.$$typeof) {
- case REACT_ELEMENT_TYPE:
- case REACT_PORTAL_TYPE:
- warnForMissingKey(child);
- var key = child.key;
- if (typeof key !== 'string') {
- break;
- }
- if (knownKeys === null) {
- knownKeys = new Set();
- knownKeys.add(key);
- break;
- }
- if (!knownKeys.has(key)) {
- knownKeys.add(key);
- break;
- }
- error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);
- break;
- }
- }
- return knownKeys;
- }
- function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {
-
- var knownKeys = null;
- for (var i = 0; i < newChildren.length; i++) {
- var child = newChildren[i];
- knownKeys = warnOnInvalidKey(child, knownKeys);
- }
- }
- var resultingFirstChild = null;
- var previousNewFiber = null;
- var oldFiber = currentFirstChild;
- var lastPlacedIndex = 0;
- var newIdx = 0;
- var nextOldFiber = null;
- for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
- if (oldFiber.index > newIdx) {
- nextOldFiber = oldFiber;
- oldFiber = null;
- } else {
- nextOldFiber = oldFiber.sibling;
- }
- var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime);
- if (newFiber === null) {
-
-
-
-
- if (oldFiber === null) {
- oldFiber = nextOldFiber;
- }
- break;
- }
- if (shouldTrackSideEffects) {
- if (oldFiber && newFiber.alternate === null) {
-
-
- deleteChild(returnFiber, oldFiber);
- }
- }
- lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
- if (previousNewFiber === null) {
-
- resultingFirstChild = newFiber;
- } else {
-
-
-
-
- previousNewFiber.sibling = newFiber;
- }
- previousNewFiber = newFiber;
- oldFiber = nextOldFiber;
- }
- if (newIdx === newChildren.length) {
-
- deleteRemainingChildren(returnFiber, oldFiber);
- return resultingFirstChild;
- }
- if (oldFiber === null) {
-
-
- for (; newIdx < newChildren.length; newIdx++) {
- var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);
- if (_newFiber === null) {
- continue;
- }
- lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
- if (previousNewFiber === null) {
-
- resultingFirstChild = _newFiber;
- } else {
- previousNewFiber.sibling = _newFiber;
- }
- previousNewFiber = _newFiber;
- }
- return resultingFirstChild;
- }
- var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
- for (; newIdx < newChildren.length; newIdx++) {
- var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);
- if (_newFiber2 !== null) {
- if (shouldTrackSideEffects) {
- if (_newFiber2.alternate !== null) {
-
-
-
-
- existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
- }
- }
- lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
- if (previousNewFiber === null) {
- resultingFirstChild = _newFiber2;
- } else {
- previousNewFiber.sibling = _newFiber2;
- }
- previousNewFiber = _newFiber2;
- }
- }
- if (shouldTrackSideEffects) {
-
-
- existingChildren.forEach(function (child) {
- return deleteChild(returnFiber, child);
- });
- }
- return resultingFirstChild;
- }
- function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {
-
-
- var iteratorFn = getIteratorFn(newChildrenIterable);
- if (!(typeof iteratorFn === 'function')) {
- {
- throw Error( "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- {
-
-
- if (typeof Symbol === 'function' &&
- newChildrenIterable[Symbol.toStringTag] === 'Generator') {
- if (!didWarnAboutGenerators) {
- error('Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.');
- }
- didWarnAboutGenerators = true;
- }
- if (newChildrenIterable.entries === iteratorFn) {
- if (!didWarnAboutMaps) {
- error('Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.');
- }
- didWarnAboutMaps = true;
- }
-
- var _newChildren = iteratorFn.call(newChildrenIterable);
- if (_newChildren) {
- var knownKeys = null;
- var _step = _newChildren.next();
- for (; !_step.done; _step = _newChildren.next()) {
- var child = _step.value;
- knownKeys = warnOnInvalidKey(child, knownKeys);
- }
- }
- }
- var newChildren = iteratorFn.call(newChildrenIterable);
- if (!(newChildren != null)) {
- {
- throw Error( "An iterable object provided no iterator." );
- }
- }
- var resultingFirstChild = null;
- var previousNewFiber = null;
- var oldFiber = currentFirstChild;
- var lastPlacedIndex = 0;
- var newIdx = 0;
- var nextOldFiber = null;
- var step = newChildren.next();
- for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
- if (oldFiber.index > newIdx) {
- nextOldFiber = oldFiber;
- oldFiber = null;
- } else {
- nextOldFiber = oldFiber.sibling;
- }
- var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime);
- if (newFiber === null) {
-
-
-
-
- if (oldFiber === null) {
- oldFiber = nextOldFiber;
- }
- break;
- }
- if (shouldTrackSideEffects) {
- if (oldFiber && newFiber.alternate === null) {
-
-
- deleteChild(returnFiber, oldFiber);
- }
- }
- lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
- if (previousNewFiber === null) {
-
- resultingFirstChild = newFiber;
- } else {
-
-
-
-
- previousNewFiber.sibling = newFiber;
- }
- previousNewFiber = newFiber;
- oldFiber = nextOldFiber;
- }
- if (step.done) {
-
- deleteRemainingChildren(returnFiber, oldFiber);
- return resultingFirstChild;
- }
- if (oldFiber === null) {
-
-
- for (; !step.done; newIdx++, step = newChildren.next()) {
- var _newFiber3 = createChild(returnFiber, step.value, expirationTime);
- if (_newFiber3 === null) {
- continue;
- }
- lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
- if (previousNewFiber === null) {
-
- resultingFirstChild = _newFiber3;
- } else {
- previousNewFiber.sibling = _newFiber3;
- }
- previousNewFiber = _newFiber3;
- }
- return resultingFirstChild;
- }
- var existingChildren = mapRemainingChildren(returnFiber, oldFiber);
- for (; !step.done; newIdx++, step = newChildren.next()) {
- var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);
- if (_newFiber4 !== null) {
- if (shouldTrackSideEffects) {
- if (_newFiber4.alternate !== null) {
-
-
-
-
- existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
- }
- }
- lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
- if (previousNewFiber === null) {
- resultingFirstChild = _newFiber4;
- } else {
- previousNewFiber.sibling = _newFiber4;
- }
- previousNewFiber = _newFiber4;
- }
- }
- if (shouldTrackSideEffects) {
-
-
- existingChildren.forEach(function (child) {
- return deleteChild(returnFiber, child);
- });
- }
- return resultingFirstChild;
- }
- function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {
-
-
- if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
-
-
- deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
- var existing = useFiber(currentFirstChild, textContent);
- existing.return = returnFiber;
- return existing;
- }
-
- deleteRemainingChildren(returnFiber, currentFirstChild);
- var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
- created.return = returnFiber;
- return created;
- }
- function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
- var key = element.key;
- var child = currentFirstChild;
- while (child !== null) {
-
-
- if (child.key === key) {
- switch (child.tag) {
- case Fragment:
- {
- if (element.type === REACT_FRAGMENT_TYPE) {
- deleteRemainingChildren(returnFiber, child.sibling);
- var existing = useFiber(child, element.props.children);
- existing.return = returnFiber;
- {
- existing._debugSource = element._source;
- existing._debugOwner = element._owner;
- }
- return existing;
- }
- break;
- }
- case Block:
-
-
- default:
- {
- if (child.elementType === element.type || (
- isCompatibleFamilyForHotReloading(child, element) )) {
- deleteRemainingChildren(returnFiber, child.sibling);
- var _existing3 = useFiber(child, element.props);
- _existing3.ref = coerceRef(returnFiber, child, element);
- _existing3.return = returnFiber;
- {
- _existing3._debugSource = element._source;
- _existing3._debugOwner = element._owner;
- }
- return _existing3;
- }
- break;
- }
- }
- deleteRemainingChildren(returnFiber, child);
- break;
- } else {
- deleteChild(returnFiber, child);
- }
- child = child.sibling;
- }
- if (element.type === REACT_FRAGMENT_TYPE) {
- var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key);
- created.return = returnFiber;
- return created;
- } else {
- var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);
- _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
- _created4.return = returnFiber;
- return _created4;
- }
- }
- function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {
- var key = portal.key;
- var child = currentFirstChild;
- while (child !== null) {
-
-
- if (child.key === key) {
- if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
- deleteRemainingChildren(returnFiber, child.sibling);
- var existing = useFiber(child, portal.children || []);
- existing.return = returnFiber;
- return existing;
- } else {
- deleteRemainingChildren(returnFiber, child);
- break;
- }
- } else {
- deleteChild(returnFiber, child);
- }
- child = child.sibling;
- }
- var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
- created.return = returnFiber;
- return created;
- }
-
-
- function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {
-
-
-
-
-
-
-
- var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
- if (isUnkeyedTopLevelFragment) {
- newChild = newChild.props.children;
- }
- var isObject = typeof newChild === 'object' && newChild !== null;
- if (isObject) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));
- case REACT_PORTAL_TYPE:
- return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));
- }
- }
- if (typeof newChild === 'string' || typeof newChild === 'number') {
- return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));
- }
- if (isArray$1(newChild)) {
- return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);
- }
- if (getIteratorFn(newChild)) {
- return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);
- }
- if (isObject) {
- throwOnInvalidObjectType(returnFiber, newChild);
- }
- {
- if (typeof newChild === 'function') {
- warnOnFunctionType();
- }
- }
- if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {
-
-
-
- switch (returnFiber.tag) {
- case ClassComponent:
- {
- {
- var instance = returnFiber.stateNode;
- if (instance.render._isMockFunction) {
-
- break;
- }
- }
- }
-
-
-
- case FunctionComponent:
- {
- var Component = returnFiber.type;
- {
- {
- throw Error( (Component.displayName || Component.name || 'Component') + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null." );
- }
- }
- }
- }
- }
- return deleteRemainingChildren(returnFiber, currentFirstChild);
- }
- return reconcileChildFibers;
- }
- var reconcileChildFibers = ChildReconciler(true);
- var mountChildFibers = ChildReconciler(false);
- function cloneChildFibers(current, workInProgress) {
- if (!(current === null || workInProgress.child === current.child)) {
- {
- throw Error( "Resuming work not yet implemented." );
- }
- }
- if (workInProgress.child === null) {
- return;
- }
- var currentChild = workInProgress.child;
- var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);
- workInProgress.child = newChild;
- newChild.return = workInProgress;
- while (currentChild.sibling !== null) {
- currentChild = currentChild.sibling;
- newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);
- newChild.return = workInProgress;
- }
- newChild.sibling = null;
- }
- function resetChildFibers(workInProgress, renderExpirationTime) {
- var child = workInProgress.child;
- while (child !== null) {
- resetWorkInProgress(child, renderExpirationTime);
- child = child.sibling;
- }
- }
- var NO_CONTEXT = {};
- var contextStackCursor$1 = createCursor(NO_CONTEXT);
- var contextFiberStackCursor = createCursor(NO_CONTEXT);
- var rootInstanceStackCursor = createCursor(NO_CONTEXT);
- function requiredContext(c) {
- if (!(c !== NO_CONTEXT)) {
- {
- throw Error( "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- return c;
- }
- function getRootHostContainer() {
- var rootInstance = requiredContext(rootInstanceStackCursor.current);
- return rootInstance;
- }
- function pushHostContainer(fiber, nextRootInstance) {
-
-
- push(rootInstanceStackCursor, nextRootInstance, fiber);
-
- push(contextFiberStackCursor, fiber, fiber);
-
-
-
-
- push(contextStackCursor$1, NO_CONTEXT, fiber);
- var nextRootContext = getRootHostContext(nextRootInstance);
- pop(contextStackCursor$1, fiber);
- push(contextStackCursor$1, nextRootContext, fiber);
- }
- function popHostContainer(fiber) {
- pop(contextStackCursor$1, fiber);
- pop(contextFiberStackCursor, fiber);
- pop(rootInstanceStackCursor, fiber);
- }
- function getHostContext() {
- var context = requiredContext(contextStackCursor$1.current);
- return context;
- }
- function pushHostContext(fiber) {
- var rootInstance = requiredContext(rootInstanceStackCursor.current);
- var context = requiredContext(contextStackCursor$1.current);
- var nextContext = getChildHostContext(context, fiber.type);
- if (context === nextContext) {
- return;
- }
-
- push(contextFiberStackCursor, fiber, fiber);
- push(contextStackCursor$1, nextContext, fiber);
- }
- function popHostContext(fiber) {
-
-
- if (contextFiberStackCursor.current !== fiber) {
- return;
- }
- pop(contextStackCursor$1, fiber);
- pop(contextFiberStackCursor, fiber);
- }
- var DefaultSuspenseContext = 0;
-
-
-
- var SubtreeSuspenseContextMask = 1;
-
-
-
-
-
-
- var InvisibleParentSuspenseContext = 1;
-
-
- var ForceSuspenseFallback = 2;
- var suspenseStackCursor = createCursor(DefaultSuspenseContext);
- function hasSuspenseContext(parentContext, flag) {
- return (parentContext & flag) !== 0;
- }
- function setDefaultShallowSuspenseContext(parentContext) {
- return parentContext & SubtreeSuspenseContextMask;
- }
- function setShallowSuspenseContext(parentContext, shallowContext) {
- return parentContext & SubtreeSuspenseContextMask | shallowContext;
- }
- function addSubtreeSuspenseContext(parentContext, subtreeContext) {
- return parentContext | subtreeContext;
- }
- function pushSuspenseContext(fiber, newContext) {
- push(suspenseStackCursor, newContext, fiber);
- }
- function popSuspenseContext(fiber) {
- pop(suspenseStackCursor, fiber);
- }
- function shouldCaptureSuspense(workInProgress, hasInvisibleParent) {
-
-
- var nextState = workInProgress.memoizedState;
- if (nextState !== null) {
- if (nextState.dehydrated !== null) {
-
- return true;
- }
- return false;
- }
- var props = workInProgress.memoizedProps;
- if (props.fallback === undefined) {
- return false;
- }
- if (props.unstable_avoidThisFallback !== true) {
- return true;
- }
-
- if (hasInvisibleParent) {
- return false;
- }
- return true;
- }
- function findFirstSuspended(row) {
- var node = row;
- while (node !== null) {
- if (node.tag === SuspenseComponent) {
- var state = node.memoizedState;
- if (state !== null) {
- var dehydrated = state.dehydrated;
- if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
- return node;
- }
- }
- } else if (node.tag === SuspenseListComponent &&
-
- node.memoizedProps.revealOrder !== undefined) {
- var didSuspend = (node.effectTag & DidCapture) !== NoEffect;
- if (didSuspend) {
- return node;
- }
- } else if (node.child !== null) {
- node.child.return = node;
- node = node.child;
- continue;
- }
- if (node === row) {
- return null;
- }
- while (node.sibling === null) {
- if (node.return === null || node.return === row) {
- return null;
- }
- node = node.return;
- }
- node.sibling.return = node.return;
- node = node.sibling;
- }
- return null;
- }
- function createDeprecatedResponderListener(responder, props) {
- var eventResponderListener = {
- responder: responder,
- props: props
- };
- {
- Object.freeze(eventResponderListener);
- }
- return eventResponderListener;
- }
- var HasEffect =
-
- 1;
- var Layout =
-
- 2;
- var Passive$1 =
-
- 4;
- var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
- ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
- var didWarnAboutMismatchedHooksForComponent;
- {
- didWarnAboutMismatchedHooksForComponent = new Set();
- }
-
- var renderExpirationTime = NoWork;
-
- var currentlyRenderingFiber$1 = null;
-
-
-
- var currentHook = null;
- var workInProgressHook = null;
-
-
-
- var didScheduleRenderPhaseUpdate = false;
- var RE_RENDER_LIMIT = 25;
- var currentHookNameInDev = null;
-
-
- var hookTypesDev = null;
- var hookTypesUpdateIndexDev = -1;
-
-
- var ignorePreviousDependencies = false;
- function mountHookTypesDev() {
- {
- var hookName = currentHookNameInDev;
- if (hookTypesDev === null) {
- hookTypesDev = [hookName];
- } else {
- hookTypesDev.push(hookName);
- }
- }
- }
- function updateHookTypesDev() {
- {
- var hookName = currentHookNameInDev;
- if (hookTypesDev !== null) {
- hookTypesUpdateIndexDev++;
- if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
- warnOnHookMismatchInDev(hookName);
- }
- }
- }
- }
- function checkDepsAreArrayDev(deps) {
- {
- if (deps !== undefined && deps !== null && !Array.isArray(deps)) {
-
-
- error('%s received a final argument that is not an array (instead, received `%s`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps);
- }
- }
- }
- function warnOnHookMismatchInDev(currentHookName) {
- {
- var componentName = getComponentName(currentlyRenderingFiber$1.type);
- if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
- didWarnAboutMismatchedHooksForComponent.add(componentName);
- if (hookTypesDev !== null) {
- var table = '';
- var secondColumnStart = 30;
- for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
- var oldHookName = hookTypesDev[i];
- var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
- var row = i + 1 + ". " + oldHookName;
-
- while (row.length < secondColumnStart) {
- row += ' ';
- }
- row += newHookName + '\n';
- table += row;
- }
- error('React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://fb.me/rules-of-hooks\n\n' + ' Previous render Next render\n' + ' ------------------------------------------------------\n' + '%s' + ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', componentName, table);
- }
- }
- }
- }
- function throwInvalidHookError() {
- {
- {
- throw Error( "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." );
- }
- }
- }
- function areHookInputsEqual(nextDeps, prevDeps) {
- {
- if (ignorePreviousDependencies) {
-
- return false;
- }
- }
- if (prevDeps === null) {
- {
- error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
- }
- return false;
- }
- {
-
-
- if (nextDeps.length !== prevDeps.length) {
- error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, "[" + prevDeps.join(', ') + "]", "[" + nextDeps.join(', ') + "]");
- }
- }
- for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
- if (objectIs(nextDeps[i], prevDeps[i])) {
- continue;
- }
- return false;
- }
- return true;
- }
- function renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderExpirationTime) {
- renderExpirationTime = nextRenderExpirationTime;
- currentlyRenderingFiber$1 = workInProgress;
- {
- hookTypesDev = current !== null ? current._debugHookTypes : null;
- hookTypesUpdateIndexDev = -1;
- ignorePreviousDependencies = current !== null && current.type !== workInProgress.type;
- }
- workInProgress.memoizedState = null;
- workInProgress.updateQueue = null;
- workInProgress.expirationTime = NoWork;
-
-
-
-
-
-
-
-
-
- {
- if (current !== null && current.memoizedState !== null) {
- ReactCurrentDispatcher.current = HooksDispatcherOnUpdateInDEV;
- } else if (hookTypesDev !== null) {
-
-
-
-
-
- ReactCurrentDispatcher.current = HooksDispatcherOnMountWithHookTypesInDEV;
- } else {
- ReactCurrentDispatcher.current = HooksDispatcherOnMountInDEV;
- }
- }
- var children = Component(props, secondArg);
- if (workInProgress.expirationTime === renderExpirationTime) {
-
-
- var numberOfReRenders = 0;
- do {
- workInProgress.expirationTime = NoWork;
- if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
- {
- throw Error( "Too many re-renders. React limits the number of renders to prevent an infinite loop." );
- }
- }
- numberOfReRenders += 1;
- {
-
-
- ignorePreviousDependencies = false;
- }
- currentHook = null;
- workInProgressHook = null;
- workInProgress.updateQueue = null;
- {
-
- hookTypesUpdateIndexDev = -1;
- }
- ReactCurrentDispatcher.current = HooksDispatcherOnRerenderInDEV ;
- children = Component(props, secondArg);
- } while (workInProgress.expirationTime === renderExpirationTime);
- }
-
- ReactCurrentDispatcher.current = ContextOnlyDispatcher;
- {
- workInProgress._debugHookTypes = hookTypesDev;
- }
-
- var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
- renderExpirationTime = NoWork;
- currentlyRenderingFiber$1 = null;
- currentHook = null;
- workInProgressHook = null;
- {
- currentHookNameInDev = null;
- hookTypesDev = null;
- hookTypesUpdateIndexDev = -1;
- }
- didScheduleRenderPhaseUpdate = false;
- if (!!didRenderTooFewHooks) {
- {
- throw Error( "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." );
- }
- }
- return children;
- }
- function bailoutHooks(current, workInProgress, expirationTime) {
- workInProgress.updateQueue = current.updateQueue;
- workInProgress.effectTag &= ~(Passive | Update);
- if (current.expirationTime <= expirationTime) {
- current.expirationTime = NoWork;
- }
- }
- function resetHooksAfterThrow() {
-
-
- ReactCurrentDispatcher.current = ContextOnlyDispatcher;
- if (didScheduleRenderPhaseUpdate) {
-
-
-
-
-
-
-
-
- var hook = currentlyRenderingFiber$1.memoizedState;
- while (hook !== null) {
- var queue = hook.queue;
- if (queue !== null) {
- queue.pending = null;
- }
- hook = hook.next;
- }
- }
- renderExpirationTime = NoWork;
- currentlyRenderingFiber$1 = null;
- currentHook = null;
- workInProgressHook = null;
- {
- hookTypesDev = null;
- hookTypesUpdateIndexDev = -1;
- currentHookNameInDev = null;
- }
- didScheduleRenderPhaseUpdate = false;
- }
- function mountWorkInProgressHook() {
- var hook = {
- memoizedState: null,
- baseState: null,
- baseQueue: null,
- queue: null,
- next: null
- };
- if (workInProgressHook === null) {
-
- currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;
- } else {
-
- workInProgressHook = workInProgressHook.next = hook;
- }
- return workInProgressHook;
- }
- function updateWorkInProgressHook() {
-
-
-
-
-
- var nextCurrentHook;
- if (currentHook === null) {
- var current = currentlyRenderingFiber$1.alternate;
- if (current !== null) {
- nextCurrentHook = current.memoizedState;
- } else {
- nextCurrentHook = null;
- }
- } else {
- nextCurrentHook = currentHook.next;
- }
- var nextWorkInProgressHook;
- if (workInProgressHook === null) {
- nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;
- } else {
- nextWorkInProgressHook = workInProgressHook.next;
- }
- if (nextWorkInProgressHook !== null) {
-
- workInProgressHook = nextWorkInProgressHook;
- nextWorkInProgressHook = workInProgressHook.next;
- currentHook = nextCurrentHook;
- } else {
-
- if (!(nextCurrentHook !== null)) {
- {
- throw Error( "Rendered more hooks than during the previous render." );
- }
- }
- currentHook = nextCurrentHook;
- var newHook = {
- memoizedState: currentHook.memoizedState,
- baseState: currentHook.baseState,
- baseQueue: currentHook.baseQueue,
- queue: currentHook.queue,
- next: null
- };
- if (workInProgressHook === null) {
-
- currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;
- } else {
-
- workInProgressHook = workInProgressHook.next = newHook;
- }
- }
- return workInProgressHook;
- }
- function createFunctionComponentUpdateQueue() {
- return {
- lastEffect: null
- };
- }
- function basicStateReducer(state, action) {
-
- return typeof action === 'function' ? action(state) : action;
- }
- function mountReducer(reducer, initialArg, init) {
- var hook = mountWorkInProgressHook();
- var initialState;
- if (init !== undefined) {
- initialState = init(initialArg);
- } else {
- initialState = initialArg;
- }
- hook.memoizedState = hook.baseState = initialState;
- var queue = hook.queue = {
- pending: null,
- dispatch: null,
- lastRenderedReducer: reducer,
- lastRenderedState: initialState
- };
- var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
- return [hook.memoizedState, dispatch];
- }
- function updateReducer(reducer, initialArg, init) {
- var hook = updateWorkInProgressHook();
- var queue = hook.queue;
- if (!(queue !== null)) {
- {
- throw Error( "Should have a queue. This is likely a bug in React. Please file an issue." );
- }
- }
- queue.lastRenderedReducer = reducer;
- var current = currentHook;
- var baseQueue = current.baseQueue;
- var pendingQueue = queue.pending;
- if (pendingQueue !== null) {
-
-
- if (baseQueue !== null) {
-
- var baseFirst = baseQueue.next;
- var pendingFirst = pendingQueue.next;
- baseQueue.next = pendingFirst;
- pendingQueue.next = baseFirst;
- }
- current.baseQueue = baseQueue = pendingQueue;
- queue.pending = null;
- }
- if (baseQueue !== null) {
-
- var first = baseQueue.next;
- var newState = current.baseState;
- var newBaseState = null;
- var newBaseQueueFirst = null;
- var newBaseQueueLast = null;
- var update = first;
- do {
- var updateExpirationTime = update.expirationTime;
- if (updateExpirationTime < renderExpirationTime) {
-
-
-
- var clone = {
- expirationTime: update.expirationTime,
- suspenseConfig: update.suspenseConfig,
- action: update.action,
- eagerReducer: update.eagerReducer,
- eagerState: update.eagerState,
- next: null
- };
- if (newBaseQueueLast === null) {
- newBaseQueueFirst = newBaseQueueLast = clone;
- newBaseState = newState;
- } else {
- newBaseQueueLast = newBaseQueueLast.next = clone;
- }
- if (updateExpirationTime > currentlyRenderingFiber$1.expirationTime) {
- currentlyRenderingFiber$1.expirationTime = updateExpirationTime;
- markUnprocessedUpdateTime(updateExpirationTime);
- }
- } else {
-
- if (newBaseQueueLast !== null) {
- var _clone = {
- expirationTime: Sync,
-
- suspenseConfig: update.suspenseConfig,
- action: update.action,
- eagerReducer: update.eagerReducer,
- eagerState: update.eagerState,
- next: null
- };
- newBaseQueueLast = newBaseQueueLast.next = _clone;
- }
-
-
-
-
-
- markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig);
- if (update.eagerReducer === reducer) {
-
-
- newState = update.eagerState;
- } else {
- var action = update.action;
- newState = reducer(newState, action);
- }
- }
- update = update.next;
- } while (update !== null && update !== first);
- if (newBaseQueueLast === null) {
- newBaseState = newState;
- } else {
- newBaseQueueLast.next = newBaseQueueFirst;
- }
-
- if (!objectIs(newState, hook.memoizedState)) {
- markWorkInProgressReceivedUpdate();
- }
- hook.memoizedState = newState;
- hook.baseState = newBaseState;
- hook.baseQueue = newBaseQueueLast;
- queue.lastRenderedState = newState;
- }
- var dispatch = queue.dispatch;
- return [hook.memoizedState, dispatch];
- }
- function rerenderReducer(reducer, initialArg, init) {
- var hook = updateWorkInProgressHook();
- var queue = hook.queue;
- if (!(queue !== null)) {
- {
- throw Error( "Should have a queue. This is likely a bug in React. Please file an issue." );
- }
- }
- queue.lastRenderedReducer = reducer;
-
- var dispatch = queue.dispatch;
- var lastRenderPhaseUpdate = queue.pending;
- var newState = hook.memoizedState;
- if (lastRenderPhaseUpdate !== null) {
-
- queue.pending = null;
- var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;
- var update = firstRenderPhaseUpdate;
- do {
-
-
-
- var action = update.action;
- newState = reducer(newState, action);
- update = update.next;
- } while (update !== firstRenderPhaseUpdate);
-
- if (!objectIs(newState, hook.memoizedState)) {
- markWorkInProgressReceivedUpdate();
- }
- hook.memoizedState = newState;
-
-
-
- if (hook.baseQueue === null) {
- hook.baseState = newState;
- }
- queue.lastRenderedState = newState;
- }
- return [newState, dispatch];
- }
- function mountState(initialState) {
- var hook = mountWorkInProgressHook();
- if (typeof initialState === 'function') {
-
- initialState = initialState();
- }
- hook.memoizedState = hook.baseState = initialState;
- var queue = hook.queue = {
- pending: null,
- dispatch: null,
- lastRenderedReducer: basicStateReducer,
- lastRenderedState: initialState
- };
- var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);
- return [hook.memoizedState, dispatch];
- }
- function updateState(initialState) {
- return updateReducer(basicStateReducer);
- }
- function rerenderState(initialState) {
- return rerenderReducer(basicStateReducer);
- }
- function pushEffect(tag, create, destroy, deps) {
- var effect = {
- tag: tag,
- create: create,
- destroy: destroy,
- deps: deps,
-
- next: null
- };
- var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
- if (componentUpdateQueue === null) {
- componentUpdateQueue = createFunctionComponentUpdateQueue();
- currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;
- componentUpdateQueue.lastEffect = effect.next = effect;
- } else {
- var lastEffect = componentUpdateQueue.lastEffect;
- if (lastEffect === null) {
- componentUpdateQueue.lastEffect = effect.next = effect;
- } else {
- var firstEffect = lastEffect.next;
- lastEffect.next = effect;
- effect.next = firstEffect;
- componentUpdateQueue.lastEffect = effect;
- }
- }
- return effect;
- }
- function mountRef(initialValue) {
- var hook = mountWorkInProgressHook();
- var ref = {
- current: initialValue
- };
- {
- Object.seal(ref);
- }
- hook.memoizedState = ref;
- return ref;
- }
- function updateRef(initialValue) {
- var hook = updateWorkInProgressHook();
- return hook.memoizedState;
- }
- function mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
- var hook = mountWorkInProgressHook();
- var nextDeps = deps === undefined ? null : deps;
- currentlyRenderingFiber$1.effectTag |= fiberEffectTag;
- hook.memoizedState = pushEffect(HasEffect | hookEffectTag, create, undefined, nextDeps);
- }
- function updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
- var hook = updateWorkInProgressHook();
- var nextDeps = deps === undefined ? null : deps;
- var destroy = undefined;
- if (currentHook !== null) {
- var prevEffect = currentHook.memoizedState;
- destroy = prevEffect.destroy;
- if (nextDeps !== null) {
- var prevDeps = prevEffect.deps;
- if (areHookInputsEqual(nextDeps, prevDeps)) {
- pushEffect(hookEffectTag, create, destroy, nextDeps);
- return;
- }
- }
- }
- currentlyRenderingFiber$1.effectTag |= fiberEffectTag;
- hook.memoizedState = pushEffect(HasEffect | hookEffectTag, create, destroy, nextDeps);
- }
- function mountEffect(create, deps) {
- {
-
- if ('undefined' !== typeof jest) {
- warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
- }
- }
- return mountEffectImpl(Update | Passive, Passive$1, create, deps);
- }
- function updateEffect(create, deps) {
- {
-
- if ('undefined' !== typeof jest) {
- warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
- }
- }
- return updateEffectImpl(Update | Passive, Passive$1, create, deps);
- }
- function mountLayoutEffect(create, deps) {
- return mountEffectImpl(Update, Layout, create, deps);
- }
- function updateLayoutEffect(create, deps) {
- return updateEffectImpl(Update, Layout, create, deps);
- }
- function imperativeHandleEffect(create, ref) {
- if (typeof ref === 'function') {
- var refCallback = ref;
- var _inst = create();
- refCallback(_inst);
- return function () {
- refCallback(null);
- };
- } else if (ref !== null && ref !== undefined) {
- var refObject = ref;
- {
- if (!refObject.hasOwnProperty('current')) {
- error('Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}');
- }
- }
- var _inst2 = create();
- refObject.current = _inst2;
- return function () {
- refObject.current = null;
- };
- }
- }
- function mountImperativeHandle(ref, create, deps) {
- {
- if (typeof create !== 'function') {
- error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');
- }
- }
- var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
- return mountEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
- }
- function updateImperativeHandle(ref, create, deps) {
- {
- if (typeof create !== 'function') {
- error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');
- }
- }
- var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
- return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
- }
- function mountDebugValue(value, formatterFn) {
-
-
- }
- var updateDebugValue = mountDebugValue;
- function mountCallback(callback, deps) {
- var hook = mountWorkInProgressHook();
- var nextDeps = deps === undefined ? null : deps;
- hook.memoizedState = [callback, nextDeps];
- return callback;
- }
- function updateCallback(callback, deps) {
- var hook = updateWorkInProgressHook();
- var nextDeps = deps === undefined ? null : deps;
- var prevState = hook.memoizedState;
- if (prevState !== null) {
- if (nextDeps !== null) {
- var prevDeps = prevState[1];
- if (areHookInputsEqual(nextDeps, prevDeps)) {
- return prevState[0];
- }
- }
- }
- hook.memoizedState = [callback, nextDeps];
- return callback;
- }
- function mountMemo(nextCreate, deps) {
- var hook = mountWorkInProgressHook();
- var nextDeps = deps === undefined ? null : deps;
- var nextValue = nextCreate();
- hook.memoizedState = [nextValue, nextDeps];
- return nextValue;
- }
- function updateMemo(nextCreate, deps) {
- var hook = updateWorkInProgressHook();
- var nextDeps = deps === undefined ? null : deps;
- var prevState = hook.memoizedState;
- if (prevState !== null) {
-
- if (nextDeps !== null) {
- var prevDeps = prevState[1];
- if (areHookInputsEqual(nextDeps, prevDeps)) {
- return prevState[0];
- }
- }
- }
- var nextValue = nextCreate();
- hook.memoizedState = [nextValue, nextDeps];
- return nextValue;
- }
- function mountDeferredValue(value, config) {
- var _mountState = mountState(value),
- prevValue = _mountState[0],
- setValue = _mountState[1];
- mountEffect(function () {
- var previousConfig = ReactCurrentBatchConfig$1.suspense;
- ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
- try {
- setValue(value);
- } finally {
- ReactCurrentBatchConfig$1.suspense = previousConfig;
- }
- }, [value, config]);
- return prevValue;
- }
- function updateDeferredValue(value, config) {
- var _updateState = updateState(),
- prevValue = _updateState[0],
- setValue = _updateState[1];
- updateEffect(function () {
- var previousConfig = ReactCurrentBatchConfig$1.suspense;
- ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
- try {
- setValue(value);
- } finally {
- ReactCurrentBatchConfig$1.suspense = previousConfig;
- }
- }, [value, config]);
- return prevValue;
- }
- function rerenderDeferredValue(value, config) {
- var _rerenderState = rerenderState(),
- prevValue = _rerenderState[0],
- setValue = _rerenderState[1];
- updateEffect(function () {
- var previousConfig = ReactCurrentBatchConfig$1.suspense;
- ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
- try {
- setValue(value);
- } finally {
- ReactCurrentBatchConfig$1.suspense = previousConfig;
- }
- }, [value, config]);
- return prevValue;
- }
- function startTransition(setPending, config, callback) {
- var priorityLevel = getCurrentPriorityLevel();
- runWithPriority$1(priorityLevel < UserBlockingPriority$1 ? UserBlockingPriority$1 : priorityLevel, function () {
- setPending(true);
- });
- runWithPriority$1(priorityLevel > NormalPriority ? NormalPriority : priorityLevel, function () {
- var previousConfig = ReactCurrentBatchConfig$1.suspense;
- ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
- try {
- setPending(false);
- callback();
- } finally {
- ReactCurrentBatchConfig$1.suspense = previousConfig;
- }
- });
- }
- function mountTransition(config) {
- var _mountState2 = mountState(false),
- isPending = _mountState2[0],
- setPending = _mountState2[1];
- var start = mountCallback(startTransition.bind(null, setPending, config), [setPending, config]);
- return [start, isPending];
- }
- function updateTransition(config) {
- var _updateState2 = updateState(),
- isPending = _updateState2[0],
- setPending = _updateState2[1];
- var start = updateCallback(startTransition.bind(null, setPending, config), [setPending, config]);
- return [start, isPending];
- }
- function rerenderTransition(config) {
- var _rerenderState2 = rerenderState(),
- isPending = _rerenderState2[0],
- setPending = _rerenderState2[1];
- var start = updateCallback(startTransition.bind(null, setPending, config), [setPending, config]);
- return [start, isPending];
- }
- function dispatchAction(fiber, queue, action) {
- {
- if (typeof arguments[3] === 'function') {
- error("State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().');
- }
- }
- var currentTime = requestCurrentTimeForUpdate();
- var suspenseConfig = requestCurrentSuspenseConfig();
- var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
- var update = {
- expirationTime: expirationTime,
- suspenseConfig: suspenseConfig,
- action: action,
- eagerReducer: null,
- eagerState: null,
- next: null
- };
- {
- update.priority = getCurrentPriorityLevel();
- }
- var pending = queue.pending;
- if (pending === null) {
-
- update.next = update;
- } else {
- update.next = pending.next;
- pending.next = update;
- }
- queue.pending = update;
- var alternate = fiber.alternate;
- if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {
-
-
-
- didScheduleRenderPhaseUpdate = true;
- update.expirationTime = renderExpirationTime;
- currentlyRenderingFiber$1.expirationTime = renderExpirationTime;
- } else {
- if (fiber.expirationTime === NoWork && (alternate === null || alternate.expirationTime === NoWork)) {
-
-
-
- var lastRenderedReducer = queue.lastRenderedReducer;
- if (lastRenderedReducer !== null) {
- var prevDispatcher;
- {
- prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
- }
- try {
- var currentState = queue.lastRenderedState;
- var eagerState = lastRenderedReducer(currentState, action);
-
-
-
- update.eagerReducer = lastRenderedReducer;
- update.eagerState = eagerState;
- if (objectIs(eagerState, currentState)) {
-
-
-
-
- return;
- }
- } catch (error) {
- } finally {
- {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- }
- }
- }
- {
-
- if ('undefined' !== typeof jest) {
- warnIfNotScopedWithMatchingAct(fiber);
- warnIfNotCurrentlyActingUpdatesInDev(fiber);
- }
- }
- scheduleWork(fiber, expirationTime);
- }
- }
- var ContextOnlyDispatcher = {
- readContext: readContext,
- useCallback: throwInvalidHookError,
- useContext: throwInvalidHookError,
- useEffect: throwInvalidHookError,
- useImperativeHandle: throwInvalidHookError,
- useLayoutEffect: throwInvalidHookError,
- useMemo: throwInvalidHookError,
- useReducer: throwInvalidHookError,
- useRef: throwInvalidHookError,
- useState: throwInvalidHookError,
- useDebugValue: throwInvalidHookError,
- useResponder: throwInvalidHookError,
- useDeferredValue: throwInvalidHookError,
- useTransition: throwInvalidHookError
- };
- var HooksDispatcherOnMountInDEV = null;
- var HooksDispatcherOnMountWithHookTypesInDEV = null;
- var HooksDispatcherOnUpdateInDEV = null;
- var HooksDispatcherOnRerenderInDEV = null;
- var InvalidNestedHooksDispatcherOnMountInDEV = null;
- var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
- var InvalidNestedHooksDispatcherOnRerenderInDEV = null;
- {
- var warnInvalidContextAccess = function () {
- error('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().');
- };
- var warnInvalidHookAccess = function () {
- error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks');
- };
- HooksDispatcherOnMountInDEV = {
- readContext: function (context, observedBits) {
- return readContext(context, observedBits);
- },
- useCallback: function (callback, deps) {
- currentHookNameInDev = 'useCallback';
- mountHookTypesDev();
- checkDepsAreArrayDev(deps);
- return mountCallback(callback, deps);
- },
- useContext: function (context, observedBits) {
- currentHookNameInDev = 'useContext';
- mountHookTypesDev();
- return readContext(context, observedBits);
- },
- useEffect: function (create, deps) {
- currentHookNameInDev = 'useEffect';
- mountHookTypesDev();
- checkDepsAreArrayDev(deps);
- return mountEffect(create, deps);
- },
- useImperativeHandle: function (ref, create, deps) {
- currentHookNameInDev = 'useImperativeHandle';
- mountHookTypesDev();
- checkDepsAreArrayDev(deps);
- return mountImperativeHandle(ref, create, deps);
- },
- useLayoutEffect: function (create, deps) {
- currentHookNameInDev = 'useLayoutEffect';
- mountHookTypesDev();
- checkDepsAreArrayDev(deps);
- return mountLayoutEffect(create, deps);
- },
- useMemo: function (create, deps) {
- currentHookNameInDev = 'useMemo';
- mountHookTypesDev();
- checkDepsAreArrayDev(deps);
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
- try {
- return mountMemo(create, deps);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useReducer: function (reducer, initialArg, init) {
- currentHookNameInDev = 'useReducer';
- mountHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
- try {
- return mountReducer(reducer, initialArg, init);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useRef: function (initialValue) {
- currentHookNameInDev = 'useRef';
- mountHookTypesDev();
- return mountRef(initialValue);
- },
- useState: function (initialState) {
- currentHookNameInDev = 'useState';
- mountHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
- try {
- return mountState(initialState);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useDebugValue: function (value, formatterFn) {
- currentHookNameInDev = 'useDebugValue';
- mountHookTypesDev();
- return mountDebugValue();
- },
- useResponder: function (responder, props) {
- currentHookNameInDev = 'useResponder';
- mountHookTypesDev();
- return createDeprecatedResponderListener(responder, props);
- },
- useDeferredValue: function (value, config) {
- currentHookNameInDev = 'useDeferredValue';
- mountHookTypesDev();
- return mountDeferredValue(value, config);
- },
- useTransition: function (config) {
- currentHookNameInDev = 'useTransition';
- mountHookTypesDev();
- return mountTransition(config);
- }
- };
- HooksDispatcherOnMountWithHookTypesInDEV = {
- readContext: function (context, observedBits) {
- return readContext(context, observedBits);
- },
- useCallback: function (callback, deps) {
- currentHookNameInDev = 'useCallback';
- updateHookTypesDev();
- return mountCallback(callback, deps);
- },
- useContext: function (context, observedBits) {
- currentHookNameInDev = 'useContext';
- updateHookTypesDev();
- return readContext(context, observedBits);
- },
- useEffect: function (create, deps) {
- currentHookNameInDev = 'useEffect';
- updateHookTypesDev();
- return mountEffect(create, deps);
- },
- useImperativeHandle: function (ref, create, deps) {
- currentHookNameInDev = 'useImperativeHandle';
- updateHookTypesDev();
- return mountImperativeHandle(ref, create, deps);
- },
- useLayoutEffect: function (create, deps) {
- currentHookNameInDev = 'useLayoutEffect';
- updateHookTypesDev();
- return mountLayoutEffect(create, deps);
- },
- useMemo: function (create, deps) {
- currentHookNameInDev = 'useMemo';
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
- try {
- return mountMemo(create, deps);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useReducer: function (reducer, initialArg, init) {
- currentHookNameInDev = 'useReducer';
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
- try {
- return mountReducer(reducer, initialArg, init);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useRef: function (initialValue) {
- currentHookNameInDev = 'useRef';
- updateHookTypesDev();
- return mountRef(initialValue);
- },
- useState: function (initialState) {
- currentHookNameInDev = 'useState';
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
- try {
- return mountState(initialState);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useDebugValue: function (value, formatterFn) {
- currentHookNameInDev = 'useDebugValue';
- updateHookTypesDev();
- return mountDebugValue();
- },
- useResponder: function (responder, props) {
- currentHookNameInDev = 'useResponder';
- updateHookTypesDev();
- return createDeprecatedResponderListener(responder, props);
- },
- useDeferredValue: function (value, config) {
- currentHookNameInDev = 'useDeferredValue';
- updateHookTypesDev();
- return mountDeferredValue(value, config);
- },
- useTransition: function (config) {
- currentHookNameInDev = 'useTransition';
- updateHookTypesDev();
- return mountTransition(config);
- }
- };
- HooksDispatcherOnUpdateInDEV = {
- readContext: function (context, observedBits) {
- return readContext(context, observedBits);
- },
- useCallback: function (callback, deps) {
- currentHookNameInDev = 'useCallback';
- updateHookTypesDev();
- return updateCallback(callback, deps);
- },
- useContext: function (context, observedBits) {
- currentHookNameInDev = 'useContext';
- updateHookTypesDev();
- return readContext(context, observedBits);
- },
- useEffect: function (create, deps) {
- currentHookNameInDev = 'useEffect';
- updateHookTypesDev();
- return updateEffect(create, deps);
- },
- useImperativeHandle: function (ref, create, deps) {
- currentHookNameInDev = 'useImperativeHandle';
- updateHookTypesDev();
- return updateImperativeHandle(ref, create, deps);
- },
- useLayoutEffect: function (create, deps) {
- currentHookNameInDev = 'useLayoutEffect';
- updateHookTypesDev();
- return updateLayoutEffect(create, deps);
- },
- useMemo: function (create, deps) {
- currentHookNameInDev = 'useMemo';
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
- try {
- return updateMemo(create, deps);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useReducer: function (reducer, initialArg, init) {
- currentHookNameInDev = 'useReducer';
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
- try {
- return updateReducer(reducer, initialArg, init);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useRef: function (initialValue) {
- currentHookNameInDev = 'useRef';
- updateHookTypesDev();
- return updateRef();
- },
- useState: function (initialState) {
- currentHookNameInDev = 'useState';
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
- try {
- return updateState(initialState);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useDebugValue: function (value, formatterFn) {
- currentHookNameInDev = 'useDebugValue';
- updateHookTypesDev();
- return updateDebugValue();
- },
- useResponder: function (responder, props) {
- currentHookNameInDev = 'useResponder';
- updateHookTypesDev();
- return createDeprecatedResponderListener(responder, props);
- },
- useDeferredValue: function (value, config) {
- currentHookNameInDev = 'useDeferredValue';
- updateHookTypesDev();
- return updateDeferredValue(value, config);
- },
- useTransition: function (config) {
- currentHookNameInDev = 'useTransition';
- updateHookTypesDev();
- return updateTransition(config);
- }
- };
- HooksDispatcherOnRerenderInDEV = {
- readContext: function (context, observedBits) {
- return readContext(context, observedBits);
- },
- useCallback: function (callback, deps) {
- currentHookNameInDev = 'useCallback';
- updateHookTypesDev();
- return updateCallback(callback, deps);
- },
- useContext: function (context, observedBits) {
- currentHookNameInDev = 'useContext';
- updateHookTypesDev();
- return readContext(context, observedBits);
- },
- useEffect: function (create, deps) {
- currentHookNameInDev = 'useEffect';
- updateHookTypesDev();
- return updateEffect(create, deps);
- },
- useImperativeHandle: function (ref, create, deps) {
- currentHookNameInDev = 'useImperativeHandle';
- updateHookTypesDev();
- return updateImperativeHandle(ref, create, deps);
- },
- useLayoutEffect: function (create, deps) {
- currentHookNameInDev = 'useLayoutEffect';
- updateHookTypesDev();
- return updateLayoutEffect(create, deps);
- },
- useMemo: function (create, deps) {
- currentHookNameInDev = 'useMemo';
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
- try {
- return updateMemo(create, deps);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useReducer: function (reducer, initialArg, init) {
- currentHookNameInDev = 'useReducer';
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
- try {
- return rerenderReducer(reducer, initialArg, init);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useRef: function (initialValue) {
- currentHookNameInDev = 'useRef';
- updateHookTypesDev();
- return updateRef();
- },
- useState: function (initialState) {
- currentHookNameInDev = 'useState';
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
- try {
- return rerenderState(initialState);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useDebugValue: function (value, formatterFn) {
- currentHookNameInDev = 'useDebugValue';
- updateHookTypesDev();
- return updateDebugValue();
- },
- useResponder: function (responder, props) {
- currentHookNameInDev = 'useResponder';
- updateHookTypesDev();
- return createDeprecatedResponderListener(responder, props);
- },
- useDeferredValue: function (value, config) {
- currentHookNameInDev = 'useDeferredValue';
- updateHookTypesDev();
- return rerenderDeferredValue(value, config);
- },
- useTransition: function (config) {
- currentHookNameInDev = 'useTransition';
- updateHookTypesDev();
- return rerenderTransition(config);
- }
- };
- InvalidNestedHooksDispatcherOnMountInDEV = {
- readContext: function (context, observedBits) {
- warnInvalidContextAccess();
- return readContext(context, observedBits);
- },
- useCallback: function (callback, deps) {
- currentHookNameInDev = 'useCallback';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountCallback(callback, deps);
- },
- useContext: function (context, observedBits) {
- currentHookNameInDev = 'useContext';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return readContext(context, observedBits);
- },
- useEffect: function (create, deps) {
- currentHookNameInDev = 'useEffect';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountEffect(create, deps);
- },
- useImperativeHandle: function (ref, create, deps) {
- currentHookNameInDev = 'useImperativeHandle';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountImperativeHandle(ref, create, deps);
- },
- useLayoutEffect: function (create, deps) {
- currentHookNameInDev = 'useLayoutEffect';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountLayoutEffect(create, deps);
- },
- useMemo: function (create, deps) {
- currentHookNameInDev = 'useMemo';
- warnInvalidHookAccess();
- mountHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
- try {
- return mountMemo(create, deps);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useReducer: function (reducer, initialArg, init) {
- currentHookNameInDev = 'useReducer';
- warnInvalidHookAccess();
- mountHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
- try {
- return mountReducer(reducer, initialArg, init);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useRef: function (initialValue) {
- currentHookNameInDev = 'useRef';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountRef(initialValue);
- },
- useState: function (initialState) {
- currentHookNameInDev = 'useState';
- warnInvalidHookAccess();
- mountHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV;
- try {
- return mountState(initialState);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useDebugValue: function (value, formatterFn) {
- currentHookNameInDev = 'useDebugValue';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountDebugValue();
- },
- useResponder: function (responder, props) {
- currentHookNameInDev = 'useResponder';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return createDeprecatedResponderListener(responder, props);
- },
- useDeferredValue: function (value, config) {
- currentHookNameInDev = 'useDeferredValue';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountDeferredValue(value, config);
- },
- useTransition: function (config) {
- currentHookNameInDev = 'useTransition';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountTransition(config);
- }
- };
- InvalidNestedHooksDispatcherOnUpdateInDEV = {
- readContext: function (context, observedBits) {
- warnInvalidContextAccess();
- return readContext(context, observedBits);
- },
- useCallback: function (callback, deps) {
- currentHookNameInDev = 'useCallback';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateCallback(callback, deps);
- },
- useContext: function (context, observedBits) {
- currentHookNameInDev = 'useContext';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return readContext(context, observedBits);
- },
- useEffect: function (create, deps) {
- currentHookNameInDev = 'useEffect';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateEffect(create, deps);
- },
- useImperativeHandle: function (ref, create, deps) {
- currentHookNameInDev = 'useImperativeHandle';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateImperativeHandle(ref, create, deps);
- },
- useLayoutEffect: function (create, deps) {
- currentHookNameInDev = 'useLayoutEffect';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateLayoutEffect(create, deps);
- },
- useMemo: function (create, deps) {
- currentHookNameInDev = 'useMemo';
- warnInvalidHookAccess();
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
- try {
- return updateMemo(create, deps);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useReducer: function (reducer, initialArg, init) {
- currentHookNameInDev = 'useReducer';
- warnInvalidHookAccess();
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
- try {
- return updateReducer(reducer, initialArg, init);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useRef: function (initialValue) {
- currentHookNameInDev = 'useRef';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateRef();
- },
- useState: function (initialState) {
- currentHookNameInDev = 'useState';
- warnInvalidHookAccess();
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
- try {
- return updateState(initialState);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useDebugValue: function (value, formatterFn) {
- currentHookNameInDev = 'useDebugValue';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateDebugValue();
- },
- useResponder: function (responder, props) {
- currentHookNameInDev = 'useResponder';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return createDeprecatedResponderListener(responder, props);
- },
- useDeferredValue: function (value, config) {
- currentHookNameInDev = 'useDeferredValue';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateDeferredValue(value, config);
- },
- useTransition: function (config) {
- currentHookNameInDev = 'useTransition';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateTransition(config);
- }
- };
- InvalidNestedHooksDispatcherOnRerenderInDEV = {
- readContext: function (context, observedBits) {
- warnInvalidContextAccess();
- return readContext(context, observedBits);
- },
- useCallback: function (callback, deps) {
- currentHookNameInDev = 'useCallback';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateCallback(callback, deps);
- },
- useContext: function (context, observedBits) {
- currentHookNameInDev = 'useContext';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return readContext(context, observedBits);
- },
- useEffect: function (create, deps) {
- currentHookNameInDev = 'useEffect';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateEffect(create, deps);
- },
- useImperativeHandle: function (ref, create, deps) {
- currentHookNameInDev = 'useImperativeHandle';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateImperativeHandle(ref, create, deps);
- },
- useLayoutEffect: function (create, deps) {
- currentHookNameInDev = 'useLayoutEffect';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateLayoutEffect(create, deps);
- },
- useMemo: function (create, deps) {
- currentHookNameInDev = 'useMemo';
- warnInvalidHookAccess();
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
- try {
- return updateMemo(create, deps);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useReducer: function (reducer, initialArg, init) {
- currentHookNameInDev = 'useReducer';
- warnInvalidHookAccess();
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
- try {
- return rerenderReducer(reducer, initialArg, init);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useRef: function (initialValue) {
- currentHookNameInDev = 'useRef';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateRef();
- },
- useState: function (initialState) {
- currentHookNameInDev = 'useState';
- warnInvalidHookAccess();
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
- try {
- return rerenderState(initialState);
- } finally {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
- },
- useDebugValue: function (value, formatterFn) {
- currentHookNameInDev = 'useDebugValue';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateDebugValue();
- },
- useResponder: function (responder, props) {
- currentHookNameInDev = 'useResponder';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return createDeprecatedResponderListener(responder, props);
- },
- useDeferredValue: function (value, config) {
- currentHookNameInDev = 'useDeferredValue';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return rerenderDeferredValue(value, config);
- },
- useTransition: function (config) {
- currentHookNameInDev = 'useTransition';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return rerenderTransition(config);
- }
- };
- }
- var now$1 = unstable_now;
- var commitTime = 0;
- var profilerStartTime = -1;
- function getCommitTime() {
- return commitTime;
- }
- function recordCommitTime() {
- commitTime = now$1();
- }
- function startProfilerTimer(fiber) {
- profilerStartTime = now$1();
- if (fiber.actualStartTime < 0) {
- fiber.actualStartTime = now$1();
- }
- }
- function stopProfilerTimerIfRunning(fiber) {
- profilerStartTime = -1;
- }
- function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
- if (profilerStartTime >= 0) {
- var elapsedTime = now$1() - profilerStartTime;
- fiber.actualDuration += elapsedTime;
- if (overrideBaseTime) {
- fiber.selfBaseDuration = elapsedTime;
- }
- profilerStartTime = -1;
- }
- }
-
- var hydrationParentFiber = null;
- var nextHydratableInstance = null;
- var isHydrating = false;
- function enterHydrationState(fiber) {
- var parentInstance = fiber.stateNode.containerInfo;
- nextHydratableInstance = getFirstHydratableChild(parentInstance);
- hydrationParentFiber = fiber;
- isHydrating = true;
- return true;
- }
- function deleteHydratableInstance(returnFiber, instance) {
- {
- switch (returnFiber.tag) {
- case HostRoot:
- didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);
- break;
- case HostComponent:
- didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
- break;
- }
- }
- var childToDelete = createFiberFromHostInstanceForDeletion();
- childToDelete.stateNode = instance;
- childToDelete.return = returnFiber;
- childToDelete.effectTag = Deletion;
-
-
-
-
- if (returnFiber.lastEffect !== null) {
- returnFiber.lastEffect.nextEffect = childToDelete;
- returnFiber.lastEffect = childToDelete;
- } else {
- returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
- }
- }
- function insertNonHydratedInstance(returnFiber, fiber) {
- fiber.effectTag = fiber.effectTag & ~Hydrating | Placement;
- {
- switch (returnFiber.tag) {
- case HostRoot:
- {
- var parentContainer = returnFiber.stateNode.containerInfo;
- switch (fiber.tag) {
- case HostComponent:
- var type = fiber.type;
- var props = fiber.pendingProps;
- didNotFindHydratableContainerInstance(parentContainer, type);
- break;
- case HostText:
- var text = fiber.pendingProps;
- didNotFindHydratableContainerTextInstance(parentContainer, text);
- break;
- }
- break;
- }
- case HostComponent:
- {
- var parentType = returnFiber.type;
- var parentProps = returnFiber.memoizedProps;
- var parentInstance = returnFiber.stateNode;
- switch (fiber.tag) {
- case HostComponent:
- var _type = fiber.type;
- var _props = fiber.pendingProps;
- didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type);
- break;
- case HostText:
- var _text = fiber.pendingProps;
- didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);
- break;
- case SuspenseComponent:
- didNotFindHydratableSuspenseInstance(parentType, parentProps);
- break;
- }
- break;
- }
- default:
- return;
- }
- }
- }
- function tryHydrate(fiber, nextInstance) {
- switch (fiber.tag) {
- case HostComponent:
- {
- var type = fiber.type;
- var props = fiber.pendingProps;
- var instance = canHydrateInstance(nextInstance, type);
- if (instance !== null) {
- fiber.stateNode = instance;
- return true;
- }
- return false;
- }
- case HostText:
- {
- var text = fiber.pendingProps;
- var textInstance = canHydrateTextInstance(nextInstance, text);
- if (textInstance !== null) {
- fiber.stateNode = textInstance;
- return true;
- }
- return false;
- }
- case SuspenseComponent:
- {
- return false;
- }
- default:
- return false;
- }
- }
- function tryToClaimNextHydratableInstance(fiber) {
- if (!isHydrating) {
- return;
- }
- var nextInstance = nextHydratableInstance;
- if (!nextInstance) {
-
- insertNonHydratedInstance(hydrationParentFiber, fiber);
- isHydrating = false;
- hydrationParentFiber = fiber;
- return;
- }
- var firstAttemptedInstance = nextInstance;
- if (!tryHydrate(fiber, nextInstance)) {
-
-
-
- nextInstance = getNextHydratableSibling(firstAttemptedInstance);
- if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
-
- insertNonHydratedInstance(hydrationParentFiber, fiber);
- isHydrating = false;
- hydrationParentFiber = fiber;
- return;
- }
-
-
-
- deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);
- }
- hydrationParentFiber = fiber;
- nextHydratableInstance = getFirstHydratableChild(nextInstance);
- }
- function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
- var instance = fiber.stateNode;
- var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber);
- fiber.updateQueue = updatePayload;
-
- if (updatePayload !== null) {
- return true;
- }
- return false;
- }
- function prepareToHydrateHostTextInstance(fiber) {
- var textInstance = fiber.stateNode;
- var textContent = fiber.memoizedProps;
- var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
- {
- if (shouldUpdate) {
-
-
- var returnFiber = hydrationParentFiber;
- if (returnFiber !== null) {
- switch (returnFiber.tag) {
- case HostRoot:
- {
- var parentContainer = returnFiber.stateNode.containerInfo;
- didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);
- break;
- }
- case HostComponent:
- {
- var parentType = returnFiber.type;
- var parentProps = returnFiber.memoizedProps;
- var parentInstance = returnFiber.stateNode;
- didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);
- break;
- }
- }
- }
- }
- }
- return shouldUpdate;
- }
- function skipPastDehydratedSuspenseInstance(fiber) {
- var suspenseState = fiber.memoizedState;
- var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
- if (!suspenseInstance) {
- {
- throw Error( "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
- }
- function popToNextHostParent(fiber) {
- var parent = fiber.return;
- while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {
- parent = parent.return;
- }
- hydrationParentFiber = parent;
- }
- function popHydrationState(fiber) {
- if (fiber !== hydrationParentFiber) {
-
-
- return false;
- }
- if (!isHydrating) {
-
-
-
- popToNextHostParent(fiber);
- isHydrating = true;
- return false;
- }
- var type = fiber.type;
-
-
-
-
- if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {
- var nextInstance = nextHydratableInstance;
- while (nextInstance) {
- deleteHydratableInstance(fiber, nextInstance);
- nextInstance = getNextHydratableSibling(nextInstance);
- }
- }
- popToNextHostParent(fiber);
- if (fiber.tag === SuspenseComponent) {
- nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);
- } else {
- nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
- }
- return true;
- }
- function resetHydrationState() {
- hydrationParentFiber = null;
- nextHydratableInstance = null;
- isHydrating = false;
- }
- var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
- var didReceiveUpdate = false;
- var didWarnAboutBadClass;
- var didWarnAboutModulePatternComponent;
- var didWarnAboutContextTypeOnFunctionComponent;
- var didWarnAboutGetDerivedStateOnFunctionComponent;
- var didWarnAboutFunctionRefs;
- var didWarnAboutReassigningProps;
- var didWarnAboutMaxDuration;
- var didWarnAboutRevealOrder;
- var didWarnAboutTailOptions;
- {
- didWarnAboutBadClass = {};
- didWarnAboutModulePatternComponent = {};
- didWarnAboutContextTypeOnFunctionComponent = {};
- didWarnAboutGetDerivedStateOnFunctionComponent = {};
- didWarnAboutFunctionRefs = {};
- didWarnAboutReassigningProps = false;
- didWarnAboutMaxDuration = false;
- didWarnAboutRevealOrder = {};
- didWarnAboutTailOptions = {};
- }
- function reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime) {
- if (current === null) {
-
-
-
-
- workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
- } else {
-
-
-
-
-
- workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderExpirationTime);
- }
- }
- function forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderExpirationTime) {
-
-
-
-
-
-
-
-
- workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderExpirationTime);
-
-
-
- workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
- }
- function updateForwardRef(current, workInProgress, Component, nextProps, renderExpirationTime) {
-
-
-
- {
- if (workInProgress.type !== workInProgress.elementType) {
-
-
- var innerPropTypes = Component.propTypes;
- if (innerPropTypes) {
- checkPropTypes_1(innerPropTypes, nextProps,
- 'prop', getComponentName(Component), getCurrentFiberStackInDev);
- }
- }
- }
- var render = Component.render;
- var ref = workInProgress.ref;
- var nextChildren;
- prepareToReadContext(workInProgress, renderExpirationTime);
- {
- ReactCurrentOwner$1.current = workInProgress;
- setCurrentPhase('render');
- nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime);
- if ( workInProgress.mode & StrictMode) {
-
- if (workInProgress.memoizedState !== null) {
- nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime);
- }
- }
- setCurrentPhase(null);
- }
- if (current !== null && !didReceiveUpdate) {
- bailoutHooks(current, workInProgress, renderExpirationTime);
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
- }
- workInProgress.effectTag |= PerformedWork;
- reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
- return workInProgress.child;
- }
- function updateMemoComponent(current, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
- if (current === null) {
- var type = Component.type;
- if (isSimpleFunctionComponent(type) && Component.compare === null &&
- Component.defaultProps === undefined) {
- var resolvedType = type;
- {
- resolvedType = resolveFunctionForHotReloading(type);
- }
-
-
- workInProgress.tag = SimpleMemoComponent;
- workInProgress.type = resolvedType;
- {
- validateFunctionComponentInDev(workInProgress, type);
- }
- return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, updateExpirationTime, renderExpirationTime);
- }
- {
- var innerPropTypes = type.propTypes;
- if (innerPropTypes) {
-
-
- checkPropTypes_1(innerPropTypes, nextProps,
- 'prop', getComponentName(type), getCurrentFiberStackInDev);
- }
- }
- var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime);
- child.ref = workInProgress.ref;
- child.return = workInProgress;
- workInProgress.child = child;
- return child;
- }
- {
- var _type = Component.type;
- var _innerPropTypes = _type.propTypes;
- if (_innerPropTypes) {
-
-
- checkPropTypes_1(_innerPropTypes, nextProps,
- 'prop', getComponentName(_type), getCurrentFiberStackInDev);
- }
- }
- var currentChild = current.child;
- if (updateExpirationTime < renderExpirationTime) {
-
-
- var prevProps = currentChild.memoizedProps;
- var compare = Component.compare;
- compare = compare !== null ? compare : shallowEqual;
- if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) {
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
- }
- }
- workInProgress.effectTag |= PerformedWork;
- var newChild = createWorkInProgress(currentChild, nextProps);
- newChild.ref = workInProgress.ref;
- newChild.return = workInProgress;
- workInProgress.child = newChild;
- return newChild;
- }
- function updateSimpleMemoComponent(current, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
-
-
-
- {
- if (workInProgress.type !== workInProgress.elementType) {
-
-
- var outerMemoType = workInProgress.elementType;
- if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
-
-
-
- outerMemoType = refineResolvedLazyComponent(outerMemoType);
- }
- var outerPropTypes = outerMemoType && outerMemoType.propTypes;
- if (outerPropTypes) {
- checkPropTypes_1(outerPropTypes, nextProps,
- 'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev);
- }
- }
- }
- if (current !== null) {
- var prevProps = current.memoizedProps;
- if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && (
- workInProgress.type === current.type )) {
- didReceiveUpdate = false;
- if (updateExpirationTime < renderExpirationTime) {
-
-
-
-
-
-
-
-
-
-
-
-
-
- workInProgress.expirationTime = current.expirationTime;
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
- }
- }
- }
- return updateFunctionComponent(current, workInProgress, Component, nextProps, renderExpirationTime);
- }
- function updateFragment(current, workInProgress, renderExpirationTime) {
- var nextChildren = workInProgress.pendingProps;
- reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
- return workInProgress.child;
- }
- function updateMode(current, workInProgress, renderExpirationTime) {
- var nextChildren = workInProgress.pendingProps.children;
- reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
- return workInProgress.child;
- }
- function updateProfiler(current, workInProgress, renderExpirationTime) {
- {
- workInProgress.effectTag |= Update;
- }
- var nextProps = workInProgress.pendingProps;
- var nextChildren = nextProps.children;
- reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
- return workInProgress.child;
- }
- function markRef(current, workInProgress) {
- var ref = workInProgress.ref;
- if (current === null && ref !== null || current !== null && current.ref !== ref) {
-
- workInProgress.effectTag |= Ref;
- }
- }
- function updateFunctionComponent(current, workInProgress, Component, nextProps, renderExpirationTime) {
- {
- if (workInProgress.type !== workInProgress.elementType) {
-
-
- var innerPropTypes = Component.propTypes;
- if (innerPropTypes) {
- checkPropTypes_1(innerPropTypes, nextProps,
- 'prop', getComponentName(Component), getCurrentFiberStackInDev);
- }
- }
- }
- var context;
- {
- var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);
- context = getMaskedContext(workInProgress, unmaskedContext);
- }
- var nextChildren;
- prepareToReadContext(workInProgress, renderExpirationTime);
- {
- ReactCurrentOwner$1.current = workInProgress;
- setCurrentPhase('render');
- nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime);
- if ( workInProgress.mode & StrictMode) {
-
- if (workInProgress.memoizedState !== null) {
- nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime);
- }
- }
- setCurrentPhase(null);
- }
- if (current !== null && !didReceiveUpdate) {
- bailoutHooks(current, workInProgress, renderExpirationTime);
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
- }
- workInProgress.effectTag |= PerformedWork;
- reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
- return workInProgress.child;
- }
- function updateClassComponent(current, workInProgress, Component, nextProps, renderExpirationTime) {
- {
- if (workInProgress.type !== workInProgress.elementType) {
-
-
- var innerPropTypes = Component.propTypes;
- if (innerPropTypes) {
- checkPropTypes_1(innerPropTypes, nextProps,
- 'prop', getComponentName(Component), getCurrentFiberStackInDev);
- }
- }
- }
-
-
- var hasContext;
- if (isContextProvider(Component)) {
- hasContext = true;
- pushContextProvider(workInProgress);
- } else {
- hasContext = false;
- }
- prepareToReadContext(workInProgress, renderExpirationTime);
- var instance = workInProgress.stateNode;
- var shouldUpdate;
- if (instance === null) {
- if (current !== null) {
-
-
-
-
- current.alternate = null;
- workInProgress.alternate = null;
- workInProgress.effectTag |= Placement;
- }
- constructClassInstance(workInProgress, Component, nextProps);
- mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
- shouldUpdate = true;
- } else if (current === null) {
-
- shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
- } else {
- shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderExpirationTime);
- }
- var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime);
- {
- var inst = workInProgress.stateNode;
- if (inst.props !== nextProps) {
- if (!didWarnAboutReassigningProps) {
- error('It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component');
- }
- didWarnAboutReassigningProps = true;
- }
- }
- return nextUnitOfWork;
- }
- function finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime) {
-
- markRef(current, workInProgress);
- var didCaptureError = (workInProgress.effectTag & DidCapture) !== NoEffect;
- if (!shouldUpdate && !didCaptureError) {
-
- if (hasContext) {
- invalidateContextProvider(workInProgress, Component, false);
- }
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
- }
- var instance = workInProgress.stateNode;
- ReactCurrentOwner$1.current = workInProgress;
- var nextChildren;
- if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {
-
-
-
-
-
- nextChildren = null;
- {
- stopProfilerTimerIfRunning();
- }
- } else {
- {
- setCurrentPhase('render');
- nextChildren = instance.render();
- if ( workInProgress.mode & StrictMode) {
- instance.render();
- }
- setCurrentPhase(null);
- }
- }
- workInProgress.effectTag |= PerformedWork;
- if (current !== null && didCaptureError) {
-
-
-
-
- forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderExpirationTime);
- } else {
- reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
- }
-
- workInProgress.memoizedState = instance.state;
- if (hasContext) {
- invalidateContextProvider(workInProgress, Component, true);
- }
- return workInProgress.child;
- }
- function pushHostRootContext(workInProgress) {
- var root = workInProgress.stateNode;
- if (root.pendingContext) {
- pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);
- } else if (root.context) {
-
- pushTopLevelContextObject(workInProgress, root.context, false);
- }
- pushHostContainer(workInProgress, root.containerInfo);
- }
- function updateHostRoot(current, workInProgress, renderExpirationTime) {
- pushHostRootContext(workInProgress);
- var updateQueue = workInProgress.updateQueue;
- if (!(current !== null && updateQueue !== null)) {
- {
- throw Error( "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." );
- }
- }
- var nextProps = workInProgress.pendingProps;
- var prevState = workInProgress.memoizedState;
- var prevChildren = prevState !== null ? prevState.element : null;
- cloneUpdateQueue(current, workInProgress);
- processUpdateQueue(workInProgress, nextProps, null, renderExpirationTime);
- var nextState = workInProgress.memoizedState;
-
- var nextChildren = nextState.element;
- if (nextChildren === prevChildren) {
-
-
- resetHydrationState();
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
- }
- var root = workInProgress.stateNode;
- if (root.hydrate && enterHydrationState(workInProgress)) {
-
-
-
-
- var child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
- workInProgress.child = child;
- var node = child;
- while (node) {
-
-
-
-
-
-
- node.effectTag = node.effectTag & ~Placement | Hydrating;
- node = node.sibling;
- }
- } else {
-
-
- reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
- resetHydrationState();
- }
- return workInProgress.child;
- }
- function updateHostComponent(current, workInProgress, renderExpirationTime) {
- pushHostContext(workInProgress);
- if (current === null) {
- tryToClaimNextHydratableInstance(workInProgress);
- }
- var type = workInProgress.type;
- var nextProps = workInProgress.pendingProps;
- var prevProps = current !== null ? current.memoizedProps : null;
- var nextChildren = nextProps.children;
- var isDirectTextChild = shouldSetTextContent(type, nextProps);
- if (isDirectTextChild) {
-
-
-
-
- nextChildren = null;
- } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
-
-
- workInProgress.effectTag |= ContentReset;
- }
- markRef(current, workInProgress);
- if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(type, nextProps)) {
- {
- markSpawnedWork(Never);
- }
- workInProgress.expirationTime = workInProgress.childExpirationTime = Never;
- return null;
- }
- reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
- return workInProgress.child;
- }
- function updateHostText(current, workInProgress) {
- if (current === null) {
- tryToClaimNextHydratableInstance(workInProgress);
- }
-
- return null;
- }
- function mountLazyComponent(_current, workInProgress, elementType, updateExpirationTime, renderExpirationTime) {
- if (_current !== null) {
-
-
-
-
- _current.alternate = null;
- workInProgress.alternate = null;
- workInProgress.effectTag |= Placement;
- }
- var props = workInProgress.pendingProps;
-
- cancelWorkTimer(workInProgress);
- var Component = readLazyComponentType(elementType);
- workInProgress.type = Component;
- var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);
- startWorkTimer(workInProgress);
- var resolvedProps = resolveDefaultProps(Component, props);
- var child;
- switch (resolvedTag) {
- case FunctionComponent:
- {
- {
- validateFunctionComponentInDev(workInProgress, Component);
- workInProgress.type = Component = resolveFunctionForHotReloading(Component);
- }
- child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);
- return child;
- }
- case ClassComponent:
- {
- {
- workInProgress.type = Component = resolveClassForHotReloading(Component);
- }
- child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);
- return child;
- }
- case ForwardRef:
- {
- {
- workInProgress.type = Component = resolveForwardRefForHotReloading(Component);
- }
- child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderExpirationTime);
- return child;
- }
- case MemoComponent:
- {
- {
- if (workInProgress.type !== workInProgress.elementType) {
- var outerPropTypes = Component.propTypes;
- if (outerPropTypes) {
- checkPropTypes_1(outerPropTypes, resolvedProps,
- 'prop', getComponentName(Component), getCurrentFiberStackInDev);
- }
- }
- }
- child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps),
- updateExpirationTime, renderExpirationTime);
- return child;
- }
- }
- var hint = '';
- {
- if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {
- hint = ' Did you wrap a component in React.lazy() more than once?';
- }
- }
-
-
- {
- {
- throw Error( "Element type is invalid. Received a promise that resolves to: " + Component + ". Lazy element type must resolve to a class or function." + hint );
- }
- }
- }
- function mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderExpirationTime) {
- if (_current !== null) {
-
-
-
-
- _current.alternate = null;
- workInProgress.alternate = null;
- workInProgress.effectTag |= Placement;
- }
- workInProgress.tag = ClassComponent;
-
-
-
- var hasContext;
- if (isContextProvider(Component)) {
- hasContext = true;
- pushContextProvider(workInProgress);
- } else {
- hasContext = false;
- }
- prepareToReadContext(workInProgress, renderExpirationTime);
- constructClassInstance(workInProgress, Component, nextProps);
- mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
- return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);
- }
- function mountIndeterminateComponent(_current, workInProgress, Component, renderExpirationTime) {
- if (_current !== null) {
-
-
-
-
- _current.alternate = null;
- workInProgress.alternate = null;
- workInProgress.effectTag |= Placement;
- }
- var props = workInProgress.pendingProps;
- var context;
- {
- var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);
- context = getMaskedContext(workInProgress, unmaskedContext);
- }
- prepareToReadContext(workInProgress, renderExpirationTime);
- var value;
- {
- if (Component.prototype && typeof Component.prototype.render === 'function') {
- var componentName = getComponentName(Component) || 'Unknown';
- if (!didWarnAboutBadClass[componentName]) {
- error("The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);
- didWarnAboutBadClass[componentName] = true;
- }
- }
- if (workInProgress.mode & StrictMode) {
- ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);
- }
- ReactCurrentOwner$1.current = workInProgress;
- value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
- }
- workInProgress.effectTag |= PerformedWork;
- if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {
- {
- var _componentName = getComponentName(Component) || 'Unknown';
- if (!didWarnAboutModulePatternComponent[_componentName]) {
- error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName, _componentName, _componentName);
- didWarnAboutModulePatternComponent[_componentName] = true;
- }
- }
- workInProgress.tag = ClassComponent;
- workInProgress.memoizedState = null;
- workInProgress.updateQueue = null;
-
-
- var hasContext = false;
- if (isContextProvider(Component)) {
- hasContext = true;
- pushContextProvider(workInProgress);
- } else {
- hasContext = false;
- }
- workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null;
- initializeUpdateQueue(workInProgress);
- var getDerivedStateFromProps = Component.getDerivedStateFromProps;
- if (typeof getDerivedStateFromProps === 'function') {
- applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, props);
- }
- adoptClassInstance(workInProgress, value);
- mountClassInstance(workInProgress, Component, props, renderExpirationTime);
- return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);
- } else {
-
- workInProgress.tag = FunctionComponent;
- {
- if ( workInProgress.mode & StrictMode) {
-
- if (workInProgress.memoizedState !== null) {
- value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
- }
- }
- }
- reconcileChildren(null, workInProgress, value, renderExpirationTime);
- {
- validateFunctionComponentInDev(workInProgress, Component);
- }
- return workInProgress.child;
- }
- }
- function validateFunctionComponentInDev(workInProgress, Component) {
- {
- if (Component) {
- if (Component.childContextTypes) {
- error('%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component');
- }
- }
- if (workInProgress.ref !== null) {
- var info = '';
- var ownerName = getCurrentFiberOwnerNameInDevOrNull();
- if (ownerName) {
- info += '\n\nCheck the render method of `' + ownerName + '`.';
- }
- var warningKey = ownerName || workInProgress._debugID || '';
- var debugSource = workInProgress._debugSource;
- if (debugSource) {
- warningKey = debugSource.fileName + ':' + debugSource.lineNumber;
- }
- if (!didWarnAboutFunctionRefs[warningKey]) {
- didWarnAboutFunctionRefs[warningKey] = true;
- error('Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info);
- }
- }
- if (typeof Component.getDerivedStateFromProps === 'function') {
- var _componentName2 = getComponentName(Component) || 'Unknown';
- if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2]) {
- error('%s: Function components do not support getDerivedStateFromProps.', _componentName2);
- didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true;
- }
- }
- if (typeof Component.contextType === 'object' && Component.contextType !== null) {
- var _componentName3 = getComponentName(Component) || 'Unknown';
- if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) {
- error('%s: Function components do not support contextType.', _componentName3);
- didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true;
- }
- }
- }
- }
- var SUSPENDED_MARKER = {
- dehydrated: null,
- retryTime: NoWork
- };
- function shouldRemainOnFallback(suspenseContext, current, workInProgress) {
-
-
- return hasSuspenseContext(suspenseContext, ForceSuspenseFallback) && (current === null || current.memoizedState !== null);
- }
- function updateSuspenseComponent(current, workInProgress, renderExpirationTime) {
- var mode = workInProgress.mode;
- var nextProps = workInProgress.pendingProps;
- {
- if (shouldSuspend(workInProgress)) {
- workInProgress.effectTag |= DidCapture;
- }
- }
- var suspenseContext = suspenseStackCursor.current;
- var nextDidTimeout = false;
- var didSuspend = (workInProgress.effectTag & DidCapture) !== NoEffect;
- if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) {
-
-
- nextDidTimeout = true;
- workInProgress.effectTag &= ~DidCapture;
- } else {
-
- if (current === null || current.memoizedState !== null) {
-
-
-
-
-
- if (nextProps.fallback !== undefined && nextProps.unstable_avoidThisFallback !== true) {
- suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
- }
- }
- }
- suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
- pushSuspenseContext(workInProgress, suspenseContext);
- {
- if ('maxDuration' in nextProps) {
- if (!didWarnAboutMaxDuration) {
- didWarnAboutMaxDuration = true;
- error('maxDuration has been removed from React. ' + 'Remove the maxDuration prop.');
- }
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- if (current === null) {
-
-
- if (nextProps.fallback !== undefined) {
- tryToClaimNextHydratableInstance(workInProgress);
- }
-
- if (nextDidTimeout) {
-
- var nextFallbackChildren = nextProps.fallback;
- var primaryChildFragment = createFiberFromFragment(null, mode, NoWork, null);
- primaryChildFragment.return = workInProgress;
- if ((workInProgress.mode & BlockingMode) === NoMode) {
-
-
- var progressedState = workInProgress.memoizedState;
- var progressedPrimaryChild = progressedState !== null ? workInProgress.child.child : workInProgress.child;
- primaryChildFragment.child = progressedPrimaryChild;
- var progressedChild = progressedPrimaryChild;
- while (progressedChild !== null) {
- progressedChild.return = primaryChildFragment;
- progressedChild = progressedChild.sibling;
- }
- }
- var fallbackChildFragment = createFiberFromFragment(nextFallbackChildren, mode, renderExpirationTime, null);
- fallbackChildFragment.return = workInProgress;
- primaryChildFragment.sibling = fallbackChildFragment;
-
- workInProgress.memoizedState = SUSPENDED_MARKER;
- workInProgress.child = primaryChildFragment;
- return fallbackChildFragment;
- } else {
-
- var nextPrimaryChildren = nextProps.children;
- workInProgress.memoizedState = null;
- return workInProgress.child = mountChildFibers(workInProgress, null, nextPrimaryChildren, renderExpirationTime);
- }
- } else {
-
-
- var prevState = current.memoizedState;
- if (prevState !== null) {
-
- var currentPrimaryChildFragment = current.child;
- var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
- if (nextDidTimeout) {
-
-
- var _nextFallbackChildren2 = nextProps.fallback;
- var _primaryChildFragment2 = createWorkInProgress(currentPrimaryChildFragment, currentPrimaryChildFragment.pendingProps);
- _primaryChildFragment2.return = workInProgress;
- if ((workInProgress.mode & BlockingMode) === NoMode) {
-
-
- var _progressedState = workInProgress.memoizedState;
- var _progressedPrimaryChild = _progressedState !== null ? workInProgress.child.child : workInProgress.child;
- if (_progressedPrimaryChild !== currentPrimaryChildFragment.child) {
- _primaryChildFragment2.child = _progressedPrimaryChild;
- var _progressedChild2 = _progressedPrimaryChild;
- while (_progressedChild2 !== null) {
- _progressedChild2.return = _primaryChildFragment2;
- _progressedChild2 = _progressedChild2.sibling;
- }
- }
- }
-
- if ( workInProgress.mode & ProfileMode) {
-
- var _treeBaseDuration = 0;
- var _hiddenChild = _primaryChildFragment2.child;
- while (_hiddenChild !== null) {
- _treeBaseDuration += _hiddenChild.treeBaseDuration;
- _hiddenChild = _hiddenChild.sibling;
- }
- _primaryChildFragment2.treeBaseDuration = _treeBaseDuration;
- }
-
- var _fallbackChildFragment2 = createWorkInProgress(currentFallbackChildFragment, _nextFallbackChildren2);
- _fallbackChildFragment2.return = workInProgress;
- _primaryChildFragment2.sibling = _fallbackChildFragment2;
- _primaryChildFragment2.childExpirationTime = NoWork;
-
- workInProgress.memoizedState = SUSPENDED_MARKER;
- workInProgress.child = _primaryChildFragment2;
- return _fallbackChildFragment2;
- } else {
-
-
- var _nextPrimaryChildren = nextProps.children;
- var currentPrimaryChild = currentPrimaryChildFragment.child;
- var primaryChild = reconcileChildFibers(workInProgress, currentPrimaryChild, _nextPrimaryChildren, renderExpirationTime);
-
-
-
-
-
- workInProgress.memoizedState = null;
- return workInProgress.child = primaryChild;
- }
- } else {
-
-
- var _currentPrimaryChild = current.child;
- if (nextDidTimeout) {
-
-
- var _nextFallbackChildren3 = nextProps.fallback;
- var _primaryChildFragment3 = createFiberFromFragment(
-
- null, mode, NoWork, null);
- _primaryChildFragment3.return = workInProgress;
- _primaryChildFragment3.child = _currentPrimaryChild;
- if (_currentPrimaryChild !== null) {
- _currentPrimaryChild.return = _primaryChildFragment3;
- }
-
-
-
- if ((workInProgress.mode & BlockingMode) === NoMode) {
-
-
- var _progressedState2 = workInProgress.memoizedState;
- var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress.child.child : workInProgress.child;
- _primaryChildFragment3.child = _progressedPrimaryChild2;
- var _progressedChild3 = _progressedPrimaryChild2;
- while (_progressedChild3 !== null) {
- _progressedChild3.return = _primaryChildFragment3;
- _progressedChild3 = _progressedChild3.sibling;
- }
- }
-
- if ( workInProgress.mode & ProfileMode) {
-
- var _treeBaseDuration2 = 0;
- var _hiddenChild2 = _primaryChildFragment3.child;
- while (_hiddenChild2 !== null) {
- _treeBaseDuration2 += _hiddenChild2.treeBaseDuration;
- _hiddenChild2 = _hiddenChild2.sibling;
- }
- _primaryChildFragment3.treeBaseDuration = _treeBaseDuration2;
- }
- var _fallbackChildFragment3 = createFiberFromFragment(_nextFallbackChildren3, mode, renderExpirationTime, null);
- _fallbackChildFragment3.return = workInProgress;
- _primaryChildFragment3.sibling = _fallbackChildFragment3;
- _fallbackChildFragment3.effectTag |= Placement;
- _primaryChildFragment3.childExpirationTime = NoWork;
-
- workInProgress.memoizedState = SUSPENDED_MARKER;
- workInProgress.child = _primaryChildFragment3;
- return _fallbackChildFragment3;
- } else {
-
-
- workInProgress.memoizedState = null;
- var _nextPrimaryChildren2 = nextProps.children;
- return workInProgress.child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime);
- }
- }
- }
- }
- function scheduleWorkOnFiber(fiber, renderExpirationTime) {
- if (fiber.expirationTime < renderExpirationTime) {
- fiber.expirationTime = renderExpirationTime;
- }
- var alternate = fiber.alternate;
- if (alternate !== null && alternate.expirationTime < renderExpirationTime) {
- alternate.expirationTime = renderExpirationTime;
- }
- scheduleWorkOnParentPath(fiber.return, renderExpirationTime);
- }
- function propagateSuspenseContextChange(workInProgress, firstChild, renderExpirationTime) {
-
-
-
- var node = firstChild;
- while (node !== null) {
- if (node.tag === SuspenseComponent) {
- var state = node.memoizedState;
- if (state !== null) {
- scheduleWorkOnFiber(node, renderExpirationTime);
- }
- } else if (node.tag === SuspenseListComponent) {
-
-
-
-
-
- scheduleWorkOnFiber(node, renderExpirationTime);
- } else if (node.child !== null) {
- node.child.return = node;
- node = node.child;
- continue;
- }
- if (node === workInProgress) {
- return;
- }
- while (node.sibling === null) {
- if (node.return === null || node.return === workInProgress) {
- return;
- }
- node = node.return;
- }
- node.sibling.return = node.return;
- node = node.sibling;
- }
- }
- function findLastContentRow(firstChild) {
-
-
-
-
-
-
-
- var row = firstChild;
- var lastContentRow = null;
- while (row !== null) {
- var currentRow = row.alternate;
- if (currentRow !== null && findFirstSuspended(currentRow) === null) {
- lastContentRow = row;
- }
- row = row.sibling;
- }
- return lastContentRow;
- }
- function validateRevealOrder(revealOrder) {
- {
- if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) {
- didWarnAboutRevealOrder[revealOrder] = true;
- if (typeof revealOrder === 'string') {
- switch (revealOrder.toLowerCase()) {
- case 'together':
- case 'forwards':
- case 'backwards':
- {
- error('"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase());
- break;
- }
- case 'forward':
- case 'backward':
- {
- error('"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase());
- break;
- }
- default:
- error('"%s" is not a supported revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder);
- break;
- }
- } else {
- error('%s is not a supported value for revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder);
- }
- }
- }
- }
- function validateTailOptions(tailMode, revealOrder) {
- {
- if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) {
- if (tailMode !== 'collapsed' && tailMode !== 'hidden') {
- didWarnAboutTailOptions[tailMode] = true;
- error('"%s" is not a supported value for tail on <SuspenseList />. ' + 'Did you mean "collapsed" or "hidden"?', tailMode);
- } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') {
- didWarnAboutTailOptions[tailMode] = true;
- error('<SuspenseList tail="%s" /> is only valid if revealOrder is ' + '"forwards" or "backwards". ' + 'Did you mean to specify revealOrder="forwards"?', tailMode);
- }
- }
- }
- }
- function validateSuspenseListNestedChild(childSlot, index) {
- {
- var isArray = Array.isArray(childSlot);
- var isIterable = !isArray && typeof getIteratorFn(childSlot) === 'function';
- if (isArray || isIterable) {
- var type = isArray ? 'array' : 'iterable';
- error('A nested %s was passed to row #%s in <SuspenseList />. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '<SuspenseList revealOrder=...> ... ' + '<SuspenseList revealOrder=...>{%s}</SuspenseList> ... ' + '</SuspenseList>', type, index, type);
- return false;
- }
- }
- return true;
- }
- function validateSuspenseListChildren(children, revealOrder) {
- {
- if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) {
- if (Array.isArray(children)) {
- for (var i = 0; i < children.length; i++) {
- if (!validateSuspenseListNestedChild(children[i], i)) {
- return;
- }
- }
- } else {
- var iteratorFn = getIteratorFn(children);
- if (typeof iteratorFn === 'function') {
- var childrenIterator = iteratorFn.call(children);
- if (childrenIterator) {
- var step = childrenIterator.next();
- var _i = 0;
- for (; !step.done; step = childrenIterator.next()) {
- if (!validateSuspenseListNestedChild(step.value, _i)) {
- return;
- }
- _i++;
- }
- }
- } else {
- error('A single row was passed to a <SuspenseList revealOrder="%s" />. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder);
- }
- }
- }
- }
- }
- function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode, lastEffectBeforeRendering) {
- var renderState = workInProgress.memoizedState;
- if (renderState === null) {
- workInProgress.memoizedState = {
- isBackwards: isBackwards,
- rendering: null,
- renderingStartTime: 0,
- last: lastContentRow,
- tail: tail,
- tailExpiration: 0,
- tailMode: tailMode,
- lastEffect: lastEffectBeforeRendering
- };
- } else {
-
- renderState.isBackwards = isBackwards;
- renderState.rendering = null;
- renderState.renderingStartTime = 0;
- renderState.last = lastContentRow;
- renderState.tail = tail;
- renderState.tailExpiration = 0;
- renderState.tailMode = tailMode;
- renderState.lastEffect = lastEffectBeforeRendering;
- }
- }
-
-
-
-
-
-
- function updateSuspenseListComponent(current, workInProgress, renderExpirationTime) {
- var nextProps = workInProgress.pendingProps;
- var revealOrder = nextProps.revealOrder;
- var tailMode = nextProps.tail;
- var newChildren = nextProps.children;
- validateRevealOrder(revealOrder);
- validateTailOptions(tailMode, revealOrder);
- validateSuspenseListChildren(newChildren, revealOrder);
- reconcileChildren(current, workInProgress, newChildren, renderExpirationTime);
- var suspenseContext = suspenseStackCursor.current;
- var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
- if (shouldForceFallback) {
- suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
- workInProgress.effectTag |= DidCapture;
- } else {
- var didSuspendBefore = current !== null && (current.effectTag & DidCapture) !== NoEffect;
- if (didSuspendBefore) {
-
-
-
- propagateSuspenseContextChange(workInProgress, workInProgress.child, renderExpirationTime);
- }
- suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
- }
- pushSuspenseContext(workInProgress, suspenseContext);
- if ((workInProgress.mode & BlockingMode) === NoMode) {
-
-
- workInProgress.memoizedState = null;
- } else {
- switch (revealOrder) {
- case 'forwards':
- {
- var lastContentRow = findLastContentRow(workInProgress.child);
- var tail;
- if (lastContentRow === null) {
-
-
- tail = workInProgress.child;
- workInProgress.child = null;
- } else {
-
-
- tail = lastContentRow.sibling;
- lastContentRow.sibling = null;
- }
- initSuspenseListRenderState(workInProgress, false,
- tail, lastContentRow, tailMode, workInProgress.lastEffect);
- break;
- }
- case 'backwards':
- {
-
-
-
-
- var _tail = null;
- var row = workInProgress.child;
- workInProgress.child = null;
- while (row !== null) {
- var currentRow = row.alternate;
- if (currentRow !== null && findFirstSuspended(currentRow) === null) {
-
- workInProgress.child = row;
- break;
- }
- var nextRow = row.sibling;
- row.sibling = _tail;
- _tail = row;
- row = nextRow;
- }
- initSuspenseListRenderState(workInProgress, true,
- _tail, null,
- tailMode, workInProgress.lastEffect);
- break;
- }
- case 'together':
- {
- initSuspenseListRenderState(workInProgress, false,
- null,
- null,
- undefined, workInProgress.lastEffect);
- break;
- }
- default:
- {
-
-
- workInProgress.memoizedState = null;
- }
- }
- }
- return workInProgress.child;
- }
- function updatePortalComponent(current, workInProgress, renderExpirationTime) {
- pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
- var nextChildren = workInProgress.pendingProps;
- if (current === null) {
-
-
-
-
-
- workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
- } else {
- reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime);
- }
- return workInProgress.child;
- }
- function updateContextProvider(current, workInProgress, renderExpirationTime) {
- var providerType = workInProgress.type;
- var context = providerType._context;
- var newProps = workInProgress.pendingProps;
- var oldProps = workInProgress.memoizedProps;
- var newValue = newProps.value;
- {
- var providerPropTypes = workInProgress.type.propTypes;
- if (providerPropTypes) {
- checkPropTypes_1(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev);
- }
- }
- pushProvider(workInProgress, newValue);
- if (oldProps !== null) {
- var oldValue = oldProps.value;
- var changedBits = calculateChangedBits(context, newValue, oldValue);
- if (changedBits === 0) {
-
- if (oldProps.children === newProps.children && !hasContextChanged()) {
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
- }
- } else {
-
-
- propagateContextChange(workInProgress, context, changedBits, renderExpirationTime);
- }
- }
- var newChildren = newProps.children;
- reconcileChildren(current, workInProgress, newChildren, renderExpirationTime);
- return workInProgress.child;
- }
- var hasWarnedAboutUsingContextAsConsumer = false;
- function updateContextConsumer(current, workInProgress, renderExpirationTime) {
- var context = workInProgress.type;
-
-
-
-
-
-
- {
- if (context._context === undefined) {
-
-
-
- if (context !== context.Consumer) {
- if (!hasWarnedAboutUsingContextAsConsumer) {
- hasWarnedAboutUsingContextAsConsumer = true;
- error('Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
- }
- }
- } else {
- context = context._context;
- }
- }
- var newProps = workInProgress.pendingProps;
- var render = newProps.children;
- {
- if (typeof render !== 'function') {
- error('A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.');
- }
- }
- prepareToReadContext(workInProgress, renderExpirationTime);
- var newValue = readContext(context, newProps.unstable_observedBits);
- var newChildren;
- {
- ReactCurrentOwner$1.current = workInProgress;
- setCurrentPhase('render');
- newChildren = render(newValue);
- setCurrentPhase(null);
- }
- workInProgress.effectTag |= PerformedWork;
- reconcileChildren(current, workInProgress, newChildren, renderExpirationTime);
- return workInProgress.child;
- }
- function markWorkInProgressReceivedUpdate() {
- didReceiveUpdate = true;
- }
- function bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime) {
- cancelWorkTimer(workInProgress);
- if (current !== null) {
-
- workInProgress.dependencies = current.dependencies;
- }
- {
-
- stopProfilerTimerIfRunning();
- }
- var updateExpirationTime = workInProgress.expirationTime;
- if (updateExpirationTime !== NoWork) {
- markUnprocessedUpdateTime(updateExpirationTime);
- }
- var childExpirationTime = workInProgress.childExpirationTime;
- if (childExpirationTime < renderExpirationTime) {
-
-
-
- return null;
- } else {
-
-
- cloneChildFibers(current, workInProgress);
- return workInProgress.child;
- }
- }
- function remountFiber(current, oldWorkInProgress, newWorkInProgress) {
- {
- var returnFiber = oldWorkInProgress.return;
- if (returnFiber === null) {
- throw new Error('Cannot swap the root fiber.');
- }
-
- current.alternate = null;
- oldWorkInProgress.alternate = null;
- newWorkInProgress.index = oldWorkInProgress.index;
- newWorkInProgress.sibling = oldWorkInProgress.sibling;
- newWorkInProgress.return = oldWorkInProgress.return;
- newWorkInProgress.ref = oldWorkInProgress.ref;
- if (oldWorkInProgress === returnFiber.child) {
- returnFiber.child = newWorkInProgress;
- } else {
- var prevSibling = returnFiber.child;
- if (prevSibling === null) {
- throw new Error('Expected parent to have a child.');
- }
- while (prevSibling.sibling !== oldWorkInProgress) {
- prevSibling = prevSibling.sibling;
- if (prevSibling === null) {
- throw new Error('Expected to find the previous sibling.');
- }
- }
- prevSibling.sibling = newWorkInProgress;
- }
-
- var last = returnFiber.lastEffect;
- if (last !== null) {
- last.nextEffect = current;
- returnFiber.lastEffect = current;
- } else {
- returnFiber.firstEffect = returnFiber.lastEffect = current;
- }
- current.nextEffect = null;
- current.effectTag = Deletion;
- newWorkInProgress.effectTag |= Placement;
- return newWorkInProgress;
- }
- }
- function beginWork(current, workInProgress, renderExpirationTime) {
- var updateExpirationTime = workInProgress.expirationTime;
- {
- if (workInProgress._debugNeedsRemount && current !== null) {
-
- return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.expirationTime));
- }
- }
- if (current !== null) {
- var oldProps = current.memoizedProps;
- var newProps = workInProgress.pendingProps;
- if (oldProps !== newProps || hasContextChanged() || (
- workInProgress.type !== current.type )) {
-
-
- didReceiveUpdate = true;
- } else if (updateExpirationTime < renderExpirationTime) {
- didReceiveUpdate = false;
-
-
- switch (workInProgress.tag) {
- case HostRoot:
- pushHostRootContext(workInProgress);
- resetHydrationState();
- break;
- case HostComponent:
- pushHostContext(workInProgress);
- if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(workInProgress.type, newProps)) {
- {
- markSpawnedWork(Never);
- }
- workInProgress.expirationTime = workInProgress.childExpirationTime = Never;
- return null;
- }
- break;
- case ClassComponent:
- {
- var Component = workInProgress.type;
- if (isContextProvider(Component)) {
- pushContextProvider(workInProgress);
- }
- break;
- }
- case HostPortal:
- pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
- break;
- case ContextProvider:
- {
- var newValue = workInProgress.memoizedProps.value;
- pushProvider(workInProgress, newValue);
- break;
- }
- case Profiler:
- {
-
- var hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;
- if (hasChildWork) {
- workInProgress.effectTag |= Update;
- }
- }
- break;
- case SuspenseComponent:
- {
- var state = workInProgress.memoizedState;
- if (state !== null) {
-
-
-
- var primaryChildFragment = workInProgress.child;
- var primaryChildExpirationTime = primaryChildFragment.childExpirationTime;
- if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime) {
-
-
- return updateSuspenseComponent(current, workInProgress, renderExpirationTime);
- } else {
- pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
-
- var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
- if (child !== null) {
-
-
- return child.sibling;
- } else {
- return null;
- }
- }
- } else {
- pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
- }
- break;
- }
- case SuspenseListComponent:
- {
- var didSuspendBefore = (current.effectTag & DidCapture) !== NoEffect;
- var _hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;
- if (didSuspendBefore) {
- if (_hasChildWork) {
-
-
-
-
-
- return updateSuspenseListComponent(current, workInProgress, renderExpirationTime);
- }
-
-
- workInProgress.effectTag |= DidCapture;
- }
-
-
- var renderState = workInProgress.memoizedState;
- if (renderState !== null) {
-
-
- renderState.rendering = null;
- renderState.tail = null;
- }
- pushSuspenseContext(workInProgress, suspenseStackCursor.current);
- if (_hasChildWork) {
- break;
- } else {
-
-
-
- return null;
- }
- }
- }
- return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime);
- } else {
-
-
-
-
- didReceiveUpdate = false;
- }
- } else {
- didReceiveUpdate = false;
- }
-
-
-
-
- workInProgress.expirationTime = NoWork;
- switch (workInProgress.tag) {
- case IndeterminateComponent:
- {
- return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderExpirationTime);
- }
- case LazyComponent:
- {
- var elementType = workInProgress.elementType;
- return mountLazyComponent(current, workInProgress, elementType, updateExpirationTime, renderExpirationTime);
- }
- case FunctionComponent:
- {
- var _Component = workInProgress.type;
- var unresolvedProps = workInProgress.pendingProps;
- var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);
- return updateFunctionComponent(current, workInProgress, _Component, resolvedProps, renderExpirationTime);
- }
- case ClassComponent:
- {
- var _Component2 = workInProgress.type;
- var _unresolvedProps = workInProgress.pendingProps;
- var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);
- return updateClassComponent(current, workInProgress, _Component2, _resolvedProps, renderExpirationTime);
- }
- case HostRoot:
- return updateHostRoot(current, workInProgress, renderExpirationTime);
- case HostComponent:
- return updateHostComponent(current, workInProgress, renderExpirationTime);
- case HostText:
- return updateHostText(current, workInProgress);
- case SuspenseComponent:
- return updateSuspenseComponent(current, workInProgress, renderExpirationTime);
- case HostPortal:
- return updatePortalComponent(current, workInProgress, renderExpirationTime);
- case ForwardRef:
- {
- var type = workInProgress.type;
- var _unresolvedProps2 = workInProgress.pendingProps;
- var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
- return updateForwardRef(current, workInProgress, type, _resolvedProps2, renderExpirationTime);
- }
- case Fragment:
- return updateFragment(current, workInProgress, renderExpirationTime);
- case Mode:
- return updateMode(current, workInProgress, renderExpirationTime);
- case Profiler:
- return updateProfiler(current, workInProgress, renderExpirationTime);
- case ContextProvider:
- return updateContextProvider(current, workInProgress, renderExpirationTime);
- case ContextConsumer:
- return updateContextConsumer(current, workInProgress, renderExpirationTime);
- case MemoComponent:
- {
- var _type2 = workInProgress.type;
- var _unresolvedProps3 = workInProgress.pendingProps;
- var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
- {
- if (workInProgress.type !== workInProgress.elementType) {
- var outerPropTypes = _type2.propTypes;
- if (outerPropTypes) {
- checkPropTypes_1(outerPropTypes, _resolvedProps3,
- 'prop', getComponentName(_type2), getCurrentFiberStackInDev);
- }
- }
- }
- _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
- return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime);
- }
- case SimpleMemoComponent:
- {
- return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, updateExpirationTime, renderExpirationTime);
- }
- case IncompleteClassComponent:
- {
- var _Component3 = workInProgress.type;
- var _unresolvedProps4 = workInProgress.pendingProps;
- var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);
- return mountIncompleteClassComponent(current, workInProgress, _Component3, _resolvedProps4, renderExpirationTime);
- }
- case SuspenseListComponent:
- {
- return updateSuspenseListComponent(current, workInProgress, renderExpirationTime);
- }
- }
- {
- {
- throw Error( "Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- }
- function markUpdate(workInProgress) {
-
-
- workInProgress.effectTag |= Update;
- }
- function markRef$1(workInProgress) {
- workInProgress.effectTag |= Ref;
- }
- var appendAllChildren;
- var updateHostContainer;
- var updateHostComponent$1;
- var updateHostText$1;
- {
-
- appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {
-
-
- var node = workInProgress.child;
- while (node !== null) {
- if (node.tag === HostComponent || node.tag === HostText) {
- appendInitialChild(parent, node.stateNode);
- } else if (node.tag === HostPortal) ; else if (node.child !== null) {
- node.child.return = node;
- node = node.child;
- continue;
- }
- if (node === workInProgress) {
- return;
- }
- while (node.sibling === null) {
- if (node.return === null || node.return === workInProgress) {
- return;
- }
- node = node.return;
- }
- node.sibling.return = node.return;
- node = node.sibling;
- }
- };
- updateHostContainer = function (workInProgress) {
- };
- updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
-
-
- var oldProps = current.memoizedProps;
- if (oldProps === newProps) {
-
-
- return;
- }
-
-
-
- var instance = workInProgress.stateNode;
- var currentHostContext = getHostContext();
-
-
- var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
- workInProgress.updateQueue = updatePayload;
-
- if (updatePayload) {
- markUpdate(workInProgress);
- }
- };
- updateHostText$1 = function (current, workInProgress, oldText, newText) {
-
- if (oldText !== newText) {
- markUpdate(workInProgress);
- }
- };
- }
- function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
- switch (renderState.tailMode) {
- case 'hidden':
- {
-
-
-
-
-
- var tailNode = renderState.tail;
- var lastTailNode = null;
- while (tailNode !== null) {
- if (tailNode.alternate !== null) {
- lastTailNode = tailNode;
- }
- tailNode = tailNode.sibling;
- }
-
- if (lastTailNode === null) {
-
- renderState.tail = null;
- } else {
-
-
- lastTailNode.sibling = null;
- }
- break;
- }
- case 'collapsed':
- {
-
-
-
-
-
- var _tailNode = renderState.tail;
- var _lastTailNode = null;
- while (_tailNode !== null) {
- if (_tailNode.alternate !== null) {
- _lastTailNode = _tailNode;
- }
- _tailNode = _tailNode.sibling;
- }
-
- if (_lastTailNode === null) {
-
- if (!hasRenderedATailFallback && renderState.tail !== null) {
-
-
- renderState.tail.sibling = null;
- } else {
- renderState.tail = null;
- }
- } else {
-
-
- _lastTailNode.sibling = null;
- }
- break;
- }
- }
- }
- function completeWork(current, workInProgress, renderExpirationTime) {
- var newProps = workInProgress.pendingProps;
- switch (workInProgress.tag) {
- case IndeterminateComponent:
- case LazyComponent:
- case SimpleMemoComponent:
- case FunctionComponent:
- case ForwardRef:
- case Fragment:
- case Mode:
- case Profiler:
- case ContextConsumer:
- case MemoComponent:
- return null;
- case ClassComponent:
- {
- var Component = workInProgress.type;
- if (isContextProvider(Component)) {
- popContext(workInProgress);
- }
- return null;
- }
- case HostRoot:
- {
- popHostContainer(workInProgress);
- popTopLevelContextObject(workInProgress);
- var fiberRoot = workInProgress.stateNode;
- if (fiberRoot.pendingContext) {
- fiberRoot.context = fiberRoot.pendingContext;
- fiberRoot.pendingContext = null;
- }
- if (current === null || current.child === null) {
-
-
- var wasHydrated = popHydrationState(workInProgress);
- if (wasHydrated) {
-
-
- markUpdate(workInProgress);
- }
- }
- updateHostContainer(workInProgress);
- return null;
- }
- case HostComponent:
- {
- popHostContext(workInProgress);
- var rootContainerInstance = getRootHostContainer();
- var type = workInProgress.type;
- if (current !== null && workInProgress.stateNode != null) {
- updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);
- if (current.ref !== workInProgress.ref) {
- markRef$1(workInProgress);
- }
- } else {
- if (!newProps) {
- if (!(workInProgress.stateNode !== null)) {
- {
- throw Error( "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- return null;
- }
- var currentHostContext = getHostContext();
-
-
-
- var _wasHydrated = popHydrationState(workInProgress);
- if (_wasHydrated) {
-
-
- if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) {
-
-
- markUpdate(workInProgress);
- }
- } else {
- var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress);
- appendAllChildren(instance, workInProgress, false, false);
- workInProgress.stateNode = instance;
-
-
- if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {
- markUpdate(workInProgress);
- }
- }
- if (workInProgress.ref !== null) {
-
- markRef$1(workInProgress);
- }
- }
- return null;
- }
- case HostText:
- {
- var newText = newProps;
- if (current && workInProgress.stateNode != null) {
- var oldText = current.memoizedProps;
-
- updateHostText$1(current, workInProgress, oldText, newText);
- } else {
- if (typeof newText !== 'string') {
- if (!(workInProgress.stateNode !== null)) {
- {
- throw Error( "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- }
- var _rootContainerInstance = getRootHostContainer();
- var _currentHostContext = getHostContext();
- var _wasHydrated2 = popHydrationState(workInProgress);
- if (_wasHydrated2) {
- if (prepareToHydrateHostTextInstance(workInProgress)) {
- markUpdate(workInProgress);
- }
- } else {
- workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress);
- }
- }
- return null;
- }
- case SuspenseComponent:
- {
- popSuspenseContext(workInProgress);
- var nextState = workInProgress.memoizedState;
- if ((workInProgress.effectTag & DidCapture) !== NoEffect) {
-
- workInProgress.expirationTime = renderExpirationTime;
- return workInProgress;
- }
- var nextDidTimeout = nextState !== null;
- var prevDidTimeout = false;
- if (current === null) {
- if (workInProgress.memoizedProps.fallback !== undefined) {
- popHydrationState(workInProgress);
- }
- } else {
- var prevState = current.memoizedState;
- prevDidTimeout = prevState !== null;
- if (!nextDidTimeout && prevState !== null) {
-
-
-
-
- var currentFallbackChild = current.child.sibling;
- if (currentFallbackChild !== null) {
-
- var first = workInProgress.firstEffect;
- if (first !== null) {
- workInProgress.firstEffect = currentFallbackChild;
- currentFallbackChild.nextEffect = first;
- } else {
- workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChild;
- currentFallbackChild.nextEffect = null;
- }
- currentFallbackChild.effectTag = Deletion;
- }
- }
- }
- if (nextDidTimeout && !prevDidTimeout) {
-
-
-
-
-
- if ((workInProgress.mode & BlockingMode) !== NoMode) {
-
-
-
-
-
-
-
- var hasInvisibleChildContext = current === null && workInProgress.memoizedProps.unstable_avoidThisFallback !== true;
- if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
-
-
- renderDidSuspend();
- } else {
-
-
- renderDidSuspendDelayIfPossible();
- }
- }
- }
- {
-
- if (nextDidTimeout || prevDidTimeout) {
-
-
-
-
-
- workInProgress.effectTag |= Update;
- }
- }
- return null;
- }
- case HostPortal:
- popHostContainer(workInProgress);
- updateHostContainer(workInProgress);
- return null;
- case ContextProvider:
-
- popProvider(workInProgress);
- return null;
- case IncompleteClassComponent:
- {
-
-
- var _Component = workInProgress.type;
- if (isContextProvider(_Component)) {
- popContext(workInProgress);
- }
- return null;
- }
- case SuspenseListComponent:
- {
- popSuspenseContext(workInProgress);
- var renderState = workInProgress.memoizedState;
- if (renderState === null) {
-
-
- return null;
- }
- var didSuspendAlready = (workInProgress.effectTag & DidCapture) !== NoEffect;
- var renderedTail = renderState.rendering;
- if (renderedTail === null) {
-
- if (!didSuspendAlready) {
-
-
-
-
-
-
-
-
-
- var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.effectTag & DidCapture) === NoEffect);
- if (!cannotBeSuspended) {
- var row = workInProgress.child;
- while (row !== null) {
- var suspended = findFirstSuspended(row);
- if (suspended !== null) {
- didSuspendAlready = true;
- workInProgress.effectTag |= DidCapture;
- cutOffTailIfNeeded(renderState, false);
-
-
-
-
-
-
-
-
-
-
-
- var newThennables = suspended.updateQueue;
- if (newThennables !== null) {
- workInProgress.updateQueue = newThennables;
- workInProgress.effectTag |= Update;
- }
-
-
- if (renderState.lastEffect === null) {
- workInProgress.firstEffect = null;
- }
- workInProgress.lastEffect = renderState.lastEffect;
- resetChildFibers(workInProgress, renderExpirationTime);
-
- pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
- return workInProgress.child;
- }
- row = row.sibling;
- }
- }
- } else {
- cutOffTailIfNeeded(renderState, false);
- }
- } else {
-
- if (!didSuspendAlready) {
- var _suspended = findFirstSuspended(renderedTail);
- if (_suspended !== null) {
- workInProgress.effectTag |= DidCapture;
- didSuspendAlready = true;
-
- var _newThennables = _suspended.updateQueue;
- if (_newThennables !== null) {
- workInProgress.updateQueue = _newThennables;
- workInProgress.effectTag |= Update;
- }
- cutOffTailIfNeeded(renderState, true);
- if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate) {
-
-
-
- var lastEffect = workInProgress.lastEffect = renderState.lastEffect;
- if (lastEffect !== null) {
- lastEffect.nextEffect = null;
- }
- return null;
- }
- } else if (
-
- now() * 2 - renderState.renderingStartTime > renderState.tailExpiration && renderExpirationTime > Never) {
-
-
-
- workInProgress.effectTag |= DidCapture;
- didSuspendAlready = true;
- cutOffTailIfNeeded(renderState, false);
-
-
-
-
- var nextPriority = renderExpirationTime - 1;
- workInProgress.expirationTime = workInProgress.childExpirationTime = nextPriority;
- {
- markSpawnedWork(nextPriority);
- }
- }
- }
- if (renderState.isBackwards) {
-
-
-
-
-
- renderedTail.sibling = workInProgress.child;
- workInProgress.child = renderedTail;
- } else {
- var previousSibling = renderState.last;
- if (previousSibling !== null) {
- previousSibling.sibling = renderedTail;
- } else {
- workInProgress.child = renderedTail;
- }
- renderState.last = renderedTail;
- }
- }
- if (renderState.tail !== null) {
-
- if (renderState.tailExpiration === 0) {
-
-
- var TAIL_EXPIRATION_TIMEOUT_MS = 500;
- renderState.tailExpiration = now() + TAIL_EXPIRATION_TIMEOUT_MS;
-
-
-
-
-
- }
- var next = renderState.tail;
- renderState.rendering = next;
- renderState.tail = next.sibling;
- renderState.lastEffect = workInProgress.lastEffect;
- renderState.renderingStartTime = now();
- next.sibling = null;
-
-
- var suspenseContext = suspenseStackCursor.current;
- if (didSuspendAlready) {
- suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
- } else {
- suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
- }
- pushSuspenseContext(workInProgress, suspenseContext);
- return next;
- }
- return null;
- }
- }
- {
- {
- throw Error( "Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- }
- function unwindWork(workInProgress, renderExpirationTime) {
- switch (workInProgress.tag) {
- case ClassComponent:
- {
- var Component = workInProgress.type;
- if (isContextProvider(Component)) {
- popContext(workInProgress);
- }
- var effectTag = workInProgress.effectTag;
- if (effectTag & ShouldCapture) {
- workInProgress.effectTag = effectTag & ~ShouldCapture | DidCapture;
- return workInProgress;
- }
- return null;
- }
- case HostRoot:
- {
- popHostContainer(workInProgress);
- popTopLevelContextObject(workInProgress);
- var _effectTag = workInProgress.effectTag;
- if (!((_effectTag & DidCapture) === NoEffect)) {
- {
- throw Error( "The root failed to unmount after an error. This is likely a bug in React. Please file an issue." );
- }
- }
- workInProgress.effectTag = _effectTag & ~ShouldCapture | DidCapture;
- return workInProgress;
- }
- case HostComponent:
- {
-
- popHostContext(workInProgress);
- return null;
- }
- case SuspenseComponent:
- {
- popSuspenseContext(workInProgress);
- var _effectTag2 = workInProgress.effectTag;
- if (_effectTag2 & ShouldCapture) {
- workInProgress.effectTag = _effectTag2 & ~ShouldCapture | DidCapture;
- return workInProgress;
- }
- return null;
- }
- case SuspenseListComponent:
- {
- popSuspenseContext(workInProgress);
-
- return null;
- }
- case HostPortal:
- popHostContainer(workInProgress);
- return null;
- case ContextProvider:
- popProvider(workInProgress);
- return null;
- default:
- return null;
- }
- }
- function unwindInterruptedWork(interruptedWork) {
- switch (interruptedWork.tag) {
- case ClassComponent:
- {
- var childContextTypes = interruptedWork.type.childContextTypes;
- if (childContextTypes !== null && childContextTypes !== undefined) {
- popContext(interruptedWork);
- }
- break;
- }
- case HostRoot:
- {
- popHostContainer(interruptedWork);
- popTopLevelContextObject(interruptedWork);
- break;
- }
- case HostComponent:
- {
- popHostContext(interruptedWork);
- break;
- }
- case HostPortal:
- popHostContainer(interruptedWork);
- break;
- case SuspenseComponent:
- popSuspenseContext(interruptedWork);
- break;
- case SuspenseListComponent:
- popSuspenseContext(interruptedWork);
- break;
- case ContextProvider:
- popProvider(interruptedWork);
- break;
- }
- }
- function createCapturedValue(value, source) {
-
-
- return {
- value: value,
- source: source,
- stack: getStackByFiberInDevAndProd(source)
- };
- }
- function logCapturedError(capturedError) {
- var error = capturedError.error;
- {
- var componentName = capturedError.componentName,
- componentStack = capturedError.componentStack,
- errorBoundaryName = capturedError.errorBoundaryName,
- errorBoundaryFound = capturedError.errorBoundaryFound,
- willRetry = capturedError.willRetry;
-
-
- if (error != null && error._suppressLogging) {
- if (errorBoundaryFound && willRetry) {
-
-
-
- return;
- }
-
-
-
- console['error'](error);
-
-
- }
- var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : 'The above error occurred in one of your React components:';
- var errorBoundaryMessage;
- if (errorBoundaryFound && errorBoundaryName) {
- if (willRetry) {
- errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
- } else {
- errorBoundaryMessage = "This error was initially handled by the error boundary " + errorBoundaryName + ".\n" + "Recreating the tree from scratch failed so React will unmount the tree.";
- }
- } else {
- errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\n' + 'Visit https://fb.me/react-error-boundaries to learn more about error boundaries.';
- }
- var combinedMessage = "" + componentNameMessage + componentStack + "\n\n" + ("" + errorBoundaryMessage);
-
-
-
- console['error'](combinedMessage);
- }
- }
- var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
- {
- didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
- }
- var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;
- function logError(boundary, errorInfo) {
- var source = errorInfo.source;
- var stack = errorInfo.stack;
- if (stack === null && source !== null) {
- stack = getStackByFiberInDevAndProd(source);
- }
- var capturedError = {
- componentName: source !== null ? getComponentName(source.type) : null,
- componentStack: stack !== null ? stack : '',
- error: errorInfo.value,
- errorBoundary: null,
- errorBoundaryName: null,
- errorBoundaryFound: false,
- willRetry: false
- };
- if (boundary !== null && boundary.tag === ClassComponent) {
- capturedError.errorBoundary = boundary.stateNode;
- capturedError.errorBoundaryName = getComponentName(boundary.type);
- capturedError.errorBoundaryFound = true;
- capturedError.willRetry = true;
- }
- try {
- logCapturedError(capturedError);
- } catch (e) {
-
-
-
-
- setTimeout(function () {
- throw e;
- });
- }
- }
- var callComponentWillUnmountWithTimer = function (current, instance) {
- startPhaseTimer(current, 'componentWillUnmount');
- instance.props = current.memoizedProps;
- instance.state = current.memoizedState;
- instance.componentWillUnmount();
- stopPhaseTimer();
- };
- function safelyCallComponentWillUnmount(current, instance) {
- {
- invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current, instance);
- if (hasCaughtError()) {
- var unmountError = clearCaughtError();
- captureCommitPhaseError(current, unmountError);
- }
- }
- }
- function safelyDetachRef(current) {
- var ref = current.ref;
- if (ref !== null) {
- if (typeof ref === 'function') {
- {
- invokeGuardedCallback(null, ref, null, null);
- if (hasCaughtError()) {
- var refError = clearCaughtError();
- captureCommitPhaseError(current, refError);
- }
- }
- } else {
- ref.current = null;
- }
- }
- }
- function safelyCallDestroy(current, destroy) {
- {
- invokeGuardedCallback(null, destroy, null);
- if (hasCaughtError()) {
- var error = clearCaughtError();
- captureCommitPhaseError(current, error);
- }
- }
- }
- function commitBeforeMutationLifeCycles(current, finishedWork) {
- switch (finishedWork.tag) {
- case FunctionComponent:
- case ForwardRef:
- case SimpleMemoComponent:
- case Block:
- {
- return;
- }
- case ClassComponent:
- {
- if (finishedWork.effectTag & Snapshot) {
- if (current !== null) {
- var prevProps = current.memoizedProps;
- var prevState = current.memoizedState;
- startPhaseTimer(finishedWork, 'getSnapshotBeforeUpdate');
- var instance = finishedWork.stateNode;
-
-
- {
- if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
- if (instance.props !== finishedWork.memoizedProps) {
- error('Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
- }
- if (instance.state !== finishedWork.memoizedState) {
- error('Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
- }
- }
- }
- var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
- {
- var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;
- if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {
- didWarnSet.add(finishedWork.type);
- error('%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork.type));
- }
- }
- instance.__reactInternalSnapshotBeforeUpdate = snapshot;
- stopPhaseTimer();
- }
- }
- return;
- }
- case HostRoot:
- case HostComponent:
- case HostText:
- case HostPortal:
- case IncompleteClassComponent:
-
- return;
- }
- {
- {
- throw Error( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- }
- function commitHookEffectListUnmount(tag, finishedWork) {
- var updateQueue = finishedWork.updateQueue;
- var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
- if (lastEffect !== null) {
- var firstEffect = lastEffect.next;
- var effect = firstEffect;
- do {
- if ((effect.tag & tag) === tag) {
-
- var destroy = effect.destroy;
- effect.destroy = undefined;
- if (destroy !== undefined) {
- destroy();
- }
- }
- effect = effect.next;
- } while (effect !== firstEffect);
- }
- }
- function commitHookEffectListMount(tag, finishedWork) {
- var updateQueue = finishedWork.updateQueue;
- var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
- if (lastEffect !== null) {
- var firstEffect = lastEffect.next;
- var effect = firstEffect;
- do {
- if ((effect.tag & tag) === tag) {
-
- var create = effect.create;
- effect.destroy = create();
- {
- var destroy = effect.destroy;
- if (destroy !== undefined && typeof destroy !== 'function') {
- var addendum = void 0;
- if (destroy === null) {
- addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).';
- } else if (typeof destroy.then === 'function') {
- addendum = '\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\n\n' + 'useEffect(() => {\n' + ' async function fetchData() {\n' + ' // You can await here\n' + ' const response = await MyAPI.getData(someId);\n' + ' // ...\n' + ' }\n' + ' fetchData();\n' + "}, [someId]); // Or [] if effect doesn't need props or state\n\n" + 'Learn more about data fetching with Hooks: https://fb.me/react-hooks-data-fetching';
- } else {
- addendum = ' You returned: ' + destroy;
- }
- error('An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s%s', addendum, getStackByFiberInDevAndProd(finishedWork));
- }
- }
- }
- effect = effect.next;
- } while (effect !== firstEffect);
- }
- }
- function commitPassiveHookEffects(finishedWork) {
- if ((finishedWork.effectTag & Passive) !== NoEffect) {
- switch (finishedWork.tag) {
- case FunctionComponent:
- case ForwardRef:
- case SimpleMemoComponent:
- case Block:
- {
-
-
-
- commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork);
- commitHookEffectListMount(Passive$1 | HasEffect, finishedWork);
- break;
- }
- }
- }
- }
- function commitLifeCycles(finishedRoot, current, finishedWork, committedExpirationTime) {
- switch (finishedWork.tag) {
- case FunctionComponent:
- case ForwardRef:
- case SimpleMemoComponent:
- case Block:
- {
-
-
-
-
- commitHookEffectListMount(Layout | HasEffect, finishedWork);
- return;
- }
- case ClassComponent:
- {
- var instance = finishedWork.stateNode;
- if (finishedWork.effectTag & Update) {
- if (current === null) {
- startPhaseTimer(finishedWork, 'componentDidMount');
-
-
- {
- if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
- if (instance.props !== finishedWork.memoizedProps) {
- error('Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
- }
- if (instance.state !== finishedWork.memoizedState) {
- error('Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
- }
- }
- }
- instance.componentDidMount();
- stopPhaseTimer();
- } else {
- var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps);
- var prevState = current.memoizedState;
- startPhaseTimer(finishedWork, 'componentDidUpdate');
-
-
- {
- if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
- if (instance.props !== finishedWork.memoizedProps) {
- error('Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
- }
- if (instance.state !== finishedWork.memoizedState) {
- error('Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
- }
- }
- }
- instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
- stopPhaseTimer();
- }
- }
- var updateQueue = finishedWork.updateQueue;
- if (updateQueue !== null) {
- {
- if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
- if (instance.props !== finishedWork.memoizedProps) {
- error('Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
- }
- if (instance.state !== finishedWork.memoizedState) {
- error('Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');
- }
- }
- }
-
-
- commitUpdateQueue(finishedWork, updateQueue, instance);
- }
- return;
- }
- case HostRoot:
- {
- var _updateQueue = finishedWork.updateQueue;
- if (_updateQueue !== null) {
- var _instance = null;
- if (finishedWork.child !== null) {
- switch (finishedWork.child.tag) {
- case HostComponent:
- _instance = getPublicInstance(finishedWork.child.stateNode);
- break;
- case ClassComponent:
- _instance = finishedWork.child.stateNode;
- break;
- }
- }
- commitUpdateQueue(finishedWork, _updateQueue, _instance);
- }
- return;
- }
- case HostComponent:
- {
- var _instance2 = finishedWork.stateNode;
-
-
-
- if (current === null && finishedWork.effectTag & Update) {
- var type = finishedWork.type;
- var props = finishedWork.memoizedProps;
- commitMount(_instance2, type, props);
- }
- return;
- }
- case HostText:
- {
-
- return;
- }
- case HostPortal:
- {
-
- return;
- }
- case Profiler:
- {
- {
- var onRender = finishedWork.memoizedProps.onRender;
- if (typeof onRender === 'function') {
- {
- onRender(finishedWork.memoizedProps.id, current === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime(), finishedRoot.memoizedInteractions);
- }
- }
- }
- return;
- }
- case SuspenseComponent:
- {
- commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
- return;
- }
- case SuspenseListComponent:
- case IncompleteClassComponent:
- case FundamentalComponent:
- case ScopeComponent:
- return;
- }
- {
- {
- throw Error( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- }
- function hideOrUnhideAllChildren(finishedWork, isHidden) {
- {
-
-
- var node = finishedWork;
- while (true) {
- if (node.tag === HostComponent) {
- var instance = node.stateNode;
- if (isHidden) {
- hideInstance(instance);
- } else {
- unhideInstance(node.stateNode, node.memoizedProps);
- }
- } else if (node.tag === HostText) {
- var _instance3 = node.stateNode;
- if (isHidden) {
- hideTextInstance(_instance3);
- } else {
- unhideTextInstance(_instance3, node.memoizedProps);
- }
- } else if (node.tag === SuspenseComponent && node.memoizedState !== null && node.memoizedState.dehydrated === null) {
-
-
- var fallbackChildFragment = node.child.sibling;
- fallbackChildFragment.return = node;
- node = fallbackChildFragment;
- continue;
- } else if (node.child !== null) {
- node.child.return = node;
- node = node.child;
- continue;
- }
- if (node === finishedWork) {
- return;
- }
- while (node.sibling === null) {
- if (node.return === null || node.return === finishedWork) {
- return;
- }
- node = node.return;
- }
- node.sibling.return = node.return;
- node = node.sibling;
- }
- }
- }
- function commitAttachRef(finishedWork) {
- var ref = finishedWork.ref;
- if (ref !== null) {
- var instance = finishedWork.stateNode;
- var instanceToUse;
- switch (finishedWork.tag) {
- case HostComponent:
- instanceToUse = getPublicInstance(instance);
- break;
- default:
- instanceToUse = instance;
- }
- if (typeof ref === 'function') {
- ref(instanceToUse);
- } else {
- {
- if (!ref.hasOwnProperty('current')) {
- error('Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().%s', getComponentName(finishedWork.type), getStackByFiberInDevAndProd(finishedWork));
- }
- }
- ref.current = instanceToUse;
- }
- }
- }
- function commitDetachRef(current) {
- var currentRef = current.ref;
- if (currentRef !== null) {
- if (typeof currentRef === 'function') {
- currentRef(null);
- } else {
- currentRef.current = null;
- }
- }
- }
-
-
- function commitUnmount(finishedRoot, current, renderPriorityLevel) {
- onCommitUnmount(current);
- switch (current.tag) {
- case FunctionComponent:
- case ForwardRef:
- case MemoComponent:
- case SimpleMemoComponent:
- case Block:
- {
- var updateQueue = current.updateQueue;
- if (updateQueue !== null) {
- var lastEffect = updateQueue.lastEffect;
- if (lastEffect !== null) {
- var firstEffect = lastEffect.next;
- {
-
-
-
-
-
-
-
-
-
-
-
-
- var priorityLevel = renderPriorityLevel > NormalPriority ? NormalPriority : renderPriorityLevel;
- runWithPriority$1(priorityLevel, function () {
- var effect = firstEffect;
- do {
- var _destroy = effect.destroy;
- if (_destroy !== undefined) {
- safelyCallDestroy(current, _destroy);
- }
- effect = effect.next;
- } while (effect !== firstEffect);
- });
- }
- }
- }
- return;
- }
- case ClassComponent:
- {
- safelyDetachRef(current);
- var instance = current.stateNode;
- if (typeof instance.componentWillUnmount === 'function') {
- safelyCallComponentWillUnmount(current, instance);
- }
- return;
- }
- case HostComponent:
- {
- safelyDetachRef(current);
- return;
- }
- case HostPortal:
- {
-
-
-
- {
- unmountHostComponents(finishedRoot, current, renderPriorityLevel);
- }
- return;
- }
- case FundamentalComponent:
- {
- return;
- }
- case DehydratedFragment:
- {
- return;
- }
- case ScopeComponent:
- {
- return;
- }
- }
- }
- function commitNestedUnmounts(finishedRoot, root, renderPriorityLevel) {
-
-
-
-
-
- var node = root;
- while (true) {
- commitUnmount(finishedRoot, node, renderPriorityLevel);
-
- if (node.child !== null && (
-
- node.tag !== HostPortal)) {
- node.child.return = node;
- node = node.child;
- continue;
- }
- if (node === root) {
- return;
- }
- while (node.sibling === null) {
- if (node.return === null || node.return === root) {
- return;
- }
- node = node.return;
- }
- node.sibling.return = node.return;
- node = node.sibling;
- }
- }
- function detachFiber(current) {
- var alternate = current.alternate;
-
-
-
-
- current.return = null;
- current.child = null;
- current.memoizedState = null;
- current.updateQueue = null;
- current.dependencies = null;
- current.alternate = null;
- current.firstEffect = null;
- current.lastEffect = null;
- current.pendingProps = null;
- current.memoizedProps = null;
- current.stateNode = null;
- if (alternate !== null) {
- detachFiber(alternate);
- }
- }
- function getHostParentFiber(fiber) {
- var parent = fiber.return;
- while (parent !== null) {
- if (isHostParent(parent)) {
- return parent;
- }
- parent = parent.return;
- }
- {
- {
- throw Error( "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- }
- function isHostParent(fiber) {
- return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
- }
- function getHostSibling(fiber) {
-
-
-
-
- var node = fiber;
- siblings: while (true) {
-
- while (node.sibling === null) {
- if (node.return === null || isHostParent(node.return)) {
-
-
- return null;
- }
- node = node.return;
- }
- node.sibling.return = node.return;
- node = node.sibling;
- while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {
-
-
- if (node.effectTag & Placement) {
-
- continue siblings;
- }
-
- if (node.child === null || node.tag === HostPortal) {
- continue siblings;
- } else {
- node.child.return = node;
- node = node.child;
- }
- }
- if (!(node.effectTag & Placement)) {
-
- return node.stateNode;
- }
- }
- }
- function commitPlacement(finishedWork) {
- var parentFiber = getHostParentFiber(finishedWork);
- var parent;
- var isContainer;
- var parentStateNode = parentFiber.stateNode;
- switch (parentFiber.tag) {
- case HostComponent:
- parent = parentStateNode;
- isContainer = false;
- break;
- case HostRoot:
- parent = parentStateNode.containerInfo;
- isContainer = true;
- break;
- case HostPortal:
- parent = parentStateNode.containerInfo;
- isContainer = true;
- break;
- case FundamentalComponent:
-
- default:
- {
- {
- throw Error( "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- }
- if (parentFiber.effectTag & ContentReset) {
-
- resetTextContent(parent);
- parentFiber.effectTag &= ~ContentReset;
- }
- var before = getHostSibling(finishedWork);
-
- if (isContainer) {
- insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent);
- } else {
- insertOrAppendPlacementNode(finishedWork, before, parent);
- }
- }
- function insertOrAppendPlacementNodeIntoContainer(node, before, parent) {
- var tag = node.tag;
- var isHost = tag === HostComponent || tag === HostText;
- if (isHost || enableFundamentalAPI ) {
- var stateNode = isHost ? node.stateNode : node.stateNode.instance;
- if (before) {
- insertInContainerBefore(parent, stateNode, before);
- } else {
- appendChildToContainer(parent, stateNode);
- }
- } else if (tag === HostPortal) ; else {
- var child = node.child;
- if (child !== null) {
- insertOrAppendPlacementNodeIntoContainer(child, before, parent);
- var sibling = child.sibling;
- while (sibling !== null) {
- insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);
- sibling = sibling.sibling;
- }
- }
- }
- }
- function insertOrAppendPlacementNode(node, before, parent) {
- var tag = node.tag;
- var isHost = tag === HostComponent || tag === HostText;
- if (isHost || enableFundamentalAPI ) {
- var stateNode = isHost ? node.stateNode : node.stateNode.instance;
- if (before) {
- insertBefore(parent, stateNode, before);
- } else {
- appendChild(parent, stateNode);
- }
- } else if (tag === HostPortal) ; else {
- var child = node.child;
- if (child !== null) {
- insertOrAppendPlacementNode(child, before, parent);
- var sibling = child.sibling;
- while (sibling !== null) {
- insertOrAppendPlacementNode(sibling, before, parent);
- sibling = sibling.sibling;
- }
- }
- }
- }
- function unmountHostComponents(finishedRoot, current, renderPriorityLevel) {
-
-
- var node = current;
-
- var currentParentIsValid = false;
- var currentParent;
- var currentParentIsContainer;
- while (true) {
- if (!currentParentIsValid) {
- var parent = node.return;
- findParent: while (true) {
- if (!(parent !== null)) {
- {
- throw Error( "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- var parentStateNode = parent.stateNode;
- switch (parent.tag) {
- case HostComponent:
- currentParent = parentStateNode;
- currentParentIsContainer = false;
- break findParent;
- case HostRoot:
- currentParent = parentStateNode.containerInfo;
- currentParentIsContainer = true;
- break findParent;
- case HostPortal:
- currentParent = parentStateNode.containerInfo;
- currentParentIsContainer = true;
- break findParent;
- }
- parent = parent.return;
- }
- currentParentIsValid = true;
- }
- if (node.tag === HostComponent || node.tag === HostText) {
- commitNestedUnmounts(finishedRoot, node, renderPriorityLevel);
-
- if (currentParentIsContainer) {
- removeChildFromContainer(currentParent, node.stateNode);
- } else {
- removeChild(currentParent, node.stateNode);
- }
- } else if (node.tag === HostPortal) {
- if (node.child !== null) {
-
-
- currentParent = node.stateNode.containerInfo;
- currentParentIsContainer = true;
- node.child.return = node;
- node = node.child;
- continue;
- }
- } else {
- commitUnmount(finishedRoot, node, renderPriorityLevel);
- if (node.child !== null) {
- node.child.return = node;
- node = node.child;
- continue;
- }
- }
- if (node === current) {
- return;
- }
- while (node.sibling === null) {
- if (node.return === null || node.return === current) {
- return;
- }
- node = node.return;
- if (node.tag === HostPortal) {
-
-
- currentParentIsValid = false;
- }
- }
- node.sibling.return = node.return;
- node = node.sibling;
- }
- }
- function commitDeletion(finishedRoot, current, renderPriorityLevel) {
- {
-
-
- unmountHostComponents(finishedRoot, current, renderPriorityLevel);
- }
- detachFiber(current);
- }
- function commitWork(current, finishedWork) {
- switch (finishedWork.tag) {
- case FunctionComponent:
- case ForwardRef:
- case MemoComponent:
- case SimpleMemoComponent:
- case Block:
- {
-
-
-
-
-
- commitHookEffectListUnmount(Layout | HasEffect, finishedWork);
- return;
- }
- case ClassComponent:
- {
- return;
- }
- case HostComponent:
- {
- var instance = finishedWork.stateNode;
- if (instance != null) {
-
- var newProps = finishedWork.memoizedProps;
-
-
- var oldProps = current !== null ? current.memoizedProps : newProps;
- var type = finishedWork.type;
- var updatePayload = finishedWork.updateQueue;
- finishedWork.updateQueue = null;
- if (updatePayload !== null) {
- commitUpdate(instance, updatePayload, type, oldProps, newProps);
- }
- }
- return;
- }
- case HostText:
- {
- if (!(finishedWork.stateNode !== null)) {
- {
- throw Error( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- var textInstance = finishedWork.stateNode;
- var newText = finishedWork.memoizedProps;
-
-
- var oldText = current !== null ? current.memoizedProps : newText;
- commitTextUpdate(textInstance, oldText, newText);
- return;
- }
- case HostRoot:
- {
- {
- var _root = finishedWork.stateNode;
- if (_root.hydrate) {
-
- _root.hydrate = false;
- commitHydratedContainer(_root.containerInfo);
- }
- }
- return;
- }
- case Profiler:
- {
- return;
- }
- case SuspenseComponent:
- {
- commitSuspenseComponent(finishedWork);
- attachSuspenseRetryListeners(finishedWork);
- return;
- }
- case SuspenseListComponent:
- {
- attachSuspenseRetryListeners(finishedWork);
- return;
- }
- case IncompleteClassComponent:
- {
- return;
- }
- }
- {
- {
- throw Error( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- }
- function commitSuspenseComponent(finishedWork) {
- var newState = finishedWork.memoizedState;
- var newDidTimeout;
- var primaryChildParent = finishedWork;
- if (newState === null) {
- newDidTimeout = false;
- } else {
- newDidTimeout = true;
- primaryChildParent = finishedWork.child;
- markCommitTimeOfFallback();
- }
- if ( primaryChildParent !== null) {
- hideOrUnhideAllChildren(primaryChildParent, newDidTimeout);
- }
- }
- function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
- var newState = finishedWork.memoizedState;
- if (newState === null) {
- var current = finishedWork.alternate;
- if (current !== null) {
- var prevState = current.memoizedState;
- if (prevState !== null) {
- var suspenseInstance = prevState.dehydrated;
- if (suspenseInstance !== null) {
- commitHydratedSuspenseInstance(suspenseInstance);
- }
- }
- }
- }
- }
- function attachSuspenseRetryListeners(finishedWork) {
-
-
-
- var thenables = finishedWork.updateQueue;
- if (thenables !== null) {
- finishedWork.updateQueue = null;
- var retryCache = finishedWork.stateNode;
- if (retryCache === null) {
- retryCache = finishedWork.stateNode = new PossiblyWeakSet();
- }
- thenables.forEach(function (thenable) {
-
- var retry = resolveRetryThenable.bind(null, finishedWork, thenable);
- if (!retryCache.has(thenable)) {
- {
- if (thenable.__reactDoNotTraceInteractions !== true) {
- retry = unstable_wrap(retry);
- }
- }
- retryCache.add(thenable);
- thenable.then(retry, retry);
- }
- });
- }
- }
- function commitResetTextContent(current) {
- resetTextContent(current.stateNode);
- }
- var PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map;
- function createRootErrorUpdate(fiber, errorInfo, expirationTime) {
- var update = createUpdate(expirationTime, null);
- update.tag = CaptureUpdate;
-
- update.payload = {
- element: null
- };
- var error = errorInfo.value;
- update.callback = function () {
- onUncaughtError(error);
- logError(fiber, errorInfo);
- };
- return update;
- }
- function createClassErrorUpdate(fiber, errorInfo, expirationTime) {
- var update = createUpdate(expirationTime, null);
- update.tag = CaptureUpdate;
- var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
- if (typeof getDerivedStateFromError === 'function') {
- var error$1 = errorInfo.value;
- update.payload = function () {
- logError(fiber, errorInfo);
- return getDerivedStateFromError(error$1);
- };
- }
- var inst = fiber.stateNode;
- if (inst !== null && typeof inst.componentDidCatch === 'function') {
- update.callback = function callback() {
- {
- markFailedErrorBoundaryForHotReloading(fiber);
- }
- if (typeof getDerivedStateFromError !== 'function') {
-
-
-
-
-
- markLegacyErrorBoundaryAsFailed(this);
- logError(fiber, errorInfo);
- }
- var error$1 = errorInfo.value;
- var stack = errorInfo.stack;
- this.componentDidCatch(error$1, {
- componentStack: stack !== null ? stack : ''
- });
- {
- if (typeof getDerivedStateFromError !== 'function') {
-
-
-
- if (fiber.expirationTime !== Sync) {
- error('%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentName(fiber.type) || 'Unknown');
- }
- }
- }
- };
- } else {
- update.callback = function () {
- markFailedErrorBoundaryForHotReloading(fiber);
- };
- }
- return update;
- }
- function attachPingListener(root, renderExpirationTime, thenable) {
-
-
-
- var pingCache = root.pingCache;
- var threadIDs;
- if (pingCache === null) {
- pingCache = root.pingCache = new PossiblyWeakMap$1();
- threadIDs = new Set();
- pingCache.set(thenable, threadIDs);
- } else {
- threadIDs = pingCache.get(thenable);
- if (threadIDs === undefined) {
- threadIDs = new Set();
- pingCache.set(thenable, threadIDs);
- }
- }
- if (!threadIDs.has(renderExpirationTime)) {
-
- threadIDs.add(renderExpirationTime);
- var ping = pingSuspendedRoot.bind(null, root, thenable, renderExpirationTime);
- thenable.then(ping, ping);
- }
- }
- function throwException(root, returnFiber, sourceFiber, value, renderExpirationTime) {
-
- sourceFiber.effectTag |= Incomplete;
- sourceFiber.firstEffect = sourceFiber.lastEffect = null;
- if (value !== null && typeof value === 'object' && typeof value.then === 'function') {
-
- var thenable = value;
- if ((sourceFiber.mode & BlockingMode) === NoMode) {
-
-
- var currentSource = sourceFiber.alternate;
- if (currentSource) {
- sourceFiber.memoizedState = currentSource.memoizedState;
- sourceFiber.expirationTime = currentSource.expirationTime;
- } else {
- sourceFiber.memoizedState = null;
- }
- }
- var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext);
- var _workInProgress = returnFiber;
- do {
- if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {
-
-
-
- var thenables = _workInProgress.updateQueue;
- if (thenables === null) {
- var updateQueue = new Set();
- updateQueue.add(thenable);
- _workInProgress.updateQueue = updateQueue;
- } else {
- thenables.add(thenable);
- }
-
-
-
-
-
-
-
- if ((_workInProgress.mode & BlockingMode) === NoMode) {
- _workInProgress.effectTag |= DidCapture;
-
-
- sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete);
- if (sourceFiber.tag === ClassComponent) {
- var currentSourceFiber = sourceFiber.alternate;
- if (currentSourceFiber === null) {
-
-
-
- sourceFiber.tag = IncompleteClassComponent;
- } else {
-
-
-
- var update = createUpdate(Sync, null);
- update.tag = ForceUpdate;
- enqueueUpdate(sourceFiber, update);
- }
- }
-
- sourceFiber.expirationTime = Sync;
- return;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- attachPingListener(root, renderExpirationTime, thenable);
- _workInProgress.effectTag |= ShouldCapture;
- _workInProgress.expirationTime = renderExpirationTime;
- return;
- }
-
- _workInProgress = _workInProgress.return;
- } while (_workInProgress !== null);
-
- value = new Error((getComponentName(sourceFiber.type) || 'A React component') + ' suspended while rendering, but no fallback UI was specified.\n' + '\n' + 'Add a <Suspense fallback=...> component higher in the tree to ' + 'provide a loading indicator or placeholder to display.' + getStackByFiberInDevAndProd(sourceFiber));
- }
-
-
- renderDidError();
- value = createCapturedValue(value, sourceFiber);
- var workInProgress = returnFiber;
- do {
- switch (workInProgress.tag) {
- case HostRoot:
- {
- var _errorInfo = value;
- workInProgress.effectTag |= ShouldCapture;
- workInProgress.expirationTime = renderExpirationTime;
- var _update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime);
- enqueueCapturedUpdate(workInProgress, _update);
- return;
- }
- case ClassComponent:
-
- var errorInfo = value;
- var ctor = workInProgress.type;
- var instance = workInProgress.stateNode;
- if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {
- workInProgress.effectTag |= ShouldCapture;
- workInProgress.expirationTime = renderExpirationTime;
- var _update2 = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime);
- enqueueCapturedUpdate(workInProgress, _update2);
- return;
- }
- break;
- }
- workInProgress = workInProgress.return;
- } while (workInProgress !== null);
- }
- var ceil = Math.ceil;
- var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
- ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,
- IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;
- var NoContext =
-
- 0;
- var BatchedContext =
-
- 1;
- var EventContext =
-
- 2;
- var DiscreteEventContext =
-
- 4;
- var LegacyUnbatchedContext =
-
- 8;
- var RenderContext =
-
- 16;
- var CommitContext =
-
- 32;
- var RootIncomplete = 0;
- var RootFatalErrored = 1;
- var RootErrored = 2;
- var RootSuspended = 3;
- var RootSuspendedWithDelay = 4;
- var RootCompleted = 5;
-
- var executionContext = NoContext;
- var workInProgressRoot = null;
- var workInProgress = null;
- var renderExpirationTime$1 = NoWork;
- var workInProgressRootExitStatus = RootIncomplete;
- var workInProgressRootFatalError = null;
-
-
-
- var workInProgressRootLatestProcessedExpirationTime = Sync;
- var workInProgressRootLatestSuspenseTimeout = Sync;
- var workInProgressRootCanSuspendUsingConfig = null;
-
- var workInProgressRootNextUnprocessedUpdateTime = NoWork;
-
-
- var workInProgressRootHasPendingPing = false;
-
- var globalMostRecentFallbackTime = 0;
- var FALLBACK_THROTTLE_MS = 500;
- var nextEffect = null;
- var hasUncaughtError = false;
- var firstUncaughtError = null;
- var legacyErrorBoundariesThatAlreadyFailed = null;
- var rootDoesHavePassiveEffects = false;
- var rootWithPendingPassiveEffects = null;
- var pendingPassiveEffectsRenderPriority = NoPriority;
- var pendingPassiveEffectsExpirationTime = NoWork;
- var rootsWithPendingDiscreteUpdates = null;
- var NESTED_UPDATE_LIMIT = 50;
- var nestedUpdateCount = 0;
- var rootWithNestedUpdates = null;
- var NESTED_PASSIVE_UPDATE_LIMIT = 50;
- var nestedPassiveUpdateCount = 0;
- var interruptedBy = null;
-
-
-
- var spawnedWorkDuringRender = null;
-
-
-
-
-
-
- var currentEventTime = NoWork;
- function requestCurrentTimeForUpdate() {
- if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
-
- return msToExpirationTime(now());
- }
- if (currentEventTime !== NoWork) {
-
- return currentEventTime;
- }
- currentEventTime = msToExpirationTime(now());
- return currentEventTime;
- }
- function getCurrentTime() {
- return msToExpirationTime(now());
- }
- function computeExpirationForFiber(currentTime, fiber, suspenseConfig) {
- var mode = fiber.mode;
- if ((mode & BlockingMode) === NoMode) {
- return Sync;
- }
- var priorityLevel = getCurrentPriorityLevel();
- if ((mode & ConcurrentMode) === NoMode) {
- return priorityLevel === ImmediatePriority ? Sync : Batched;
- }
- if ((executionContext & RenderContext) !== NoContext) {
-
-
- return renderExpirationTime$1;
- }
- var expirationTime;
- if (suspenseConfig !== null) {
-
- expirationTime = computeSuspenseExpiration(currentTime, suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);
- } else {
-
- switch (priorityLevel) {
- case ImmediatePriority:
- expirationTime = Sync;
- break;
- case UserBlockingPriority$1:
-
- expirationTime = computeInteractiveExpiration(currentTime);
- break;
- case NormalPriority:
- case LowPriority:
-
-
- expirationTime = computeAsyncExpiration(currentTime);
- break;
- case IdlePriority:
- expirationTime = Idle;
- break;
- default:
- {
- {
- throw Error( "Expected a valid priority level" );
- }
- }
- }
- }
-
-
-
-
- if (workInProgressRoot !== null && expirationTime === renderExpirationTime$1) {
-
- expirationTime -= 1;
- }
- return expirationTime;
- }
- function scheduleUpdateOnFiber(fiber, expirationTime) {
- checkForNestedUpdates();
- warnAboutRenderPhaseUpdatesInDEV(fiber);
- var root = markUpdateTimeFromFiberToRoot(fiber, expirationTime);
- if (root === null) {
- warnAboutUpdateOnUnmountedFiberInDEV(fiber);
- return;
- }
- checkForInterruption(fiber, expirationTime);
- recordScheduleUpdate();
-
- var priorityLevel = getCurrentPriorityLevel();
- if (expirationTime === Sync) {
- if (
- (executionContext & LegacyUnbatchedContext) !== NoContext &&
- (executionContext & (RenderContext | CommitContext)) === NoContext) {
-
- schedulePendingInteractions(root, expirationTime);
-
-
- performSyncWorkOnRoot(root);
- } else {
- ensureRootIsScheduled(root);
- schedulePendingInteractions(root, expirationTime);
- if (executionContext === NoContext) {
-
-
-
-
-
- flushSyncCallbackQueue();
- }
- }
- } else {
- ensureRootIsScheduled(root);
- schedulePendingInteractions(root, expirationTime);
- }
- if ((executionContext & DiscreteEventContext) !== NoContext && (
-
- priorityLevel === UserBlockingPriority$1 || priorityLevel === ImmediatePriority)) {
-
-
- if (rootsWithPendingDiscreteUpdates === null) {
- rootsWithPendingDiscreteUpdates = new Map([[root, expirationTime]]);
- } else {
- var lastDiscreteTime = rootsWithPendingDiscreteUpdates.get(root);
- if (lastDiscreteTime === undefined || lastDiscreteTime > expirationTime) {
- rootsWithPendingDiscreteUpdates.set(root, expirationTime);
- }
- }
- }
- }
- var scheduleWork = scheduleUpdateOnFiber;
-
-
-
- function markUpdateTimeFromFiberToRoot(fiber, expirationTime) {
-
- if (fiber.expirationTime < expirationTime) {
- fiber.expirationTime = expirationTime;
- }
- var alternate = fiber.alternate;
- if (alternate !== null && alternate.expirationTime < expirationTime) {
- alternate.expirationTime = expirationTime;
- }
- var node = fiber.return;
- var root = null;
- if (node === null && fiber.tag === HostRoot) {
- root = fiber.stateNode;
- } else {
- while (node !== null) {
- alternate = node.alternate;
- if (node.childExpirationTime < expirationTime) {
- node.childExpirationTime = expirationTime;
- if (alternate !== null && alternate.childExpirationTime < expirationTime) {
- alternate.childExpirationTime = expirationTime;
- }
- } else if (alternate !== null && alternate.childExpirationTime < expirationTime) {
- alternate.childExpirationTime = expirationTime;
- }
- if (node.return === null && node.tag === HostRoot) {
- root = node.stateNode;
- break;
- }
- node = node.return;
- }
- }
- if (root !== null) {
- if (workInProgressRoot === root) {
-
-
- markUnprocessedUpdateTime(expirationTime);
- if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
-
-
-
-
-
-
-
-
-
-
-
-
-
- markRootSuspendedAtTime(root, renderExpirationTime$1);
- }
- }
- markRootUpdatedAtTime(root, expirationTime);
- }
- return root;
- }
- function getNextRootExpirationTimeToWorkOn(root) {
-
-
-
- var lastExpiredTime = root.lastExpiredTime;
- if (lastExpiredTime !== NoWork) {
- return lastExpiredTime;
- }
-
- var firstPendingTime = root.firstPendingTime;
- if (!isRootSuspendedAtTime(root, firstPendingTime)) {
-
- return firstPendingTime;
- }
-
-
- var lastPingedTime = root.lastPingedTime;
- var nextKnownPendingLevel = root.nextKnownPendingLevel;
- var nextLevel = lastPingedTime > nextKnownPendingLevel ? lastPingedTime : nextKnownPendingLevel;
- if ( nextLevel <= Idle && firstPendingTime !== nextLevel) {
-
- return NoWork;
- }
- return nextLevel;
- }
-
-
-
-
- function ensureRootIsScheduled(root) {
- var lastExpiredTime = root.lastExpiredTime;
- if (lastExpiredTime !== NoWork) {
-
- root.callbackExpirationTime = Sync;
- root.callbackPriority = ImmediatePriority;
- root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));
- return;
- }
- var expirationTime = getNextRootExpirationTimeToWorkOn(root);
- var existingCallbackNode = root.callbackNode;
- if (expirationTime === NoWork) {
-
- if (existingCallbackNode !== null) {
- root.callbackNode = null;
- root.callbackExpirationTime = NoWork;
- root.callbackPriority = NoPriority;
- }
- return;
- }
-
- var currentTime = requestCurrentTimeForUpdate();
- var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime);
-
- if (existingCallbackNode !== null) {
- var existingCallbackPriority = root.callbackPriority;
- var existingCallbackExpirationTime = root.callbackExpirationTime;
- if (
- existingCallbackExpirationTime === expirationTime &&
- existingCallbackPriority >= priorityLevel) {
-
- return;
- }
-
-
- cancelCallback(existingCallbackNode);
- }
- root.callbackExpirationTime = expirationTime;
- root.callbackPriority = priorityLevel;
- var callbackNode;
- if (expirationTime === Sync) {
-
- callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));
- } else {
- callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root),
-
- {
- timeout: expirationTimeToMs(expirationTime) - now()
- });
- }
- root.callbackNode = callbackNode;
- }
-
- function performConcurrentWorkOnRoot(root, didTimeout) {
-
-
- currentEventTime = NoWork;
- if (didTimeout) {
-
-
- var currentTime = requestCurrentTimeForUpdate();
- markRootExpiredAtTime(root, currentTime);
- ensureRootIsScheduled(root);
- return null;
- }
-
- var expirationTime = getNextRootExpirationTimeToWorkOn(root);
- if (expirationTime !== NoWork) {
- var originalCallbackNode = root.callbackNode;
- if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
- {
- throw Error( "Should not already be working." );
- }
- }
- flushPassiveEffects();
-
- if (root !== workInProgressRoot || expirationTime !== renderExpirationTime$1) {
- prepareFreshStack(root, expirationTime);
- startWorkOnPendingInteractions(root, expirationTime);
- }
-
- if (workInProgress !== null) {
- var prevExecutionContext = executionContext;
- executionContext |= RenderContext;
- var prevDispatcher = pushDispatcher();
- var prevInteractions = pushInteractions(root);
- startWorkLoopTimer(workInProgress);
- do {
- try {
- workLoopConcurrent();
- break;
- } catch (thrownValue) {
- handleError(root, thrownValue);
- }
- } while (true);
- resetContextDependencies();
- executionContext = prevExecutionContext;
- popDispatcher(prevDispatcher);
- {
- popInteractions(prevInteractions);
- }
- if (workInProgressRootExitStatus === RootFatalErrored) {
- var fatalError = workInProgressRootFatalError;
- stopInterruptedWorkLoopTimer();
- prepareFreshStack(root, expirationTime);
- markRootSuspendedAtTime(root, expirationTime);
- ensureRootIsScheduled(root);
- throw fatalError;
- }
- if (workInProgress !== null) {
-
- stopInterruptedWorkLoopTimer();
- } else {
-
-
- stopFinishedWorkLoopTimer();
- var finishedWork = root.finishedWork = root.current.alternate;
- root.finishedExpirationTime = expirationTime;
- finishConcurrentRender(root, finishedWork, workInProgressRootExitStatus, expirationTime);
- }
- ensureRootIsScheduled(root);
- if (root.callbackNode === originalCallbackNode) {
-
-
- return performConcurrentWorkOnRoot.bind(null, root);
- }
- }
- }
- return null;
- }
- function finishConcurrentRender(root, finishedWork, exitStatus, expirationTime) {
-
- workInProgressRoot = null;
- switch (exitStatus) {
- case RootIncomplete:
- case RootFatalErrored:
- {
- {
- {
- throw Error( "Root did not complete. This is a bug in React." );
- }
- }
- }
-
-
-
- case RootErrored:
- {
-
-
-
-
-
-
-
- markRootExpiredAtTime(root, expirationTime > Idle ? Idle : expirationTime);
-
- break;
- }
- case RootSuspended:
- {
- markRootSuspendedAtTime(root, expirationTime);
- var lastSuspendedTime = root.lastSuspendedTime;
- if (expirationTime === lastSuspendedTime) {
- root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);
- }
-
-
-
-
- var hasNotProcessedNewUpdates = workInProgressRootLatestProcessedExpirationTime === Sync;
- if (hasNotProcessedNewUpdates &&
- !( IsThisRendererActing.current)) {
-
-
-
-
-
-
- var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now();
- if (msUntilTimeout > 10) {
- if (workInProgressRootHasPendingPing) {
- var lastPingedTime = root.lastPingedTime;
- if (lastPingedTime === NoWork || lastPingedTime >= expirationTime) {
-
-
- root.lastPingedTime = expirationTime;
- prepareFreshStack(root, expirationTime);
- break;
- }
- }
- var nextTime = getNextRootExpirationTimeToWorkOn(root);
- if (nextTime !== NoWork && nextTime !== expirationTime) {
-
- break;
- }
- if (lastSuspendedTime !== NoWork && lastSuspendedTime !== expirationTime) {
-
-
-
- root.lastPingedTime = lastSuspendedTime;
- break;
- }
-
-
- root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), msUntilTimeout);
- break;
- }
- }
- commitRoot(root);
- break;
- }
- case RootSuspendedWithDelay:
- {
- markRootSuspendedAtTime(root, expirationTime);
- var _lastSuspendedTime = root.lastSuspendedTime;
- if (expirationTime === _lastSuspendedTime) {
- root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);
- }
- if (
- !( IsThisRendererActing.current)) {
-
-
- if (workInProgressRootHasPendingPing) {
- var _lastPingedTime = root.lastPingedTime;
- if (_lastPingedTime === NoWork || _lastPingedTime >= expirationTime) {
-
-
- root.lastPingedTime = expirationTime;
- prepareFreshStack(root, expirationTime);
- break;
- }
- }
- var _nextTime = getNextRootExpirationTimeToWorkOn(root);
- if (_nextTime !== NoWork && _nextTime !== expirationTime) {
-
- break;
- }
- if (_lastSuspendedTime !== NoWork && _lastSuspendedTime !== expirationTime) {
-
-
-
- root.lastPingedTime = _lastSuspendedTime;
- break;
- }
- var _msUntilTimeout;
- if (workInProgressRootLatestSuspenseTimeout !== Sync) {
-
-
- _msUntilTimeout = expirationTimeToMs(workInProgressRootLatestSuspenseTimeout) - now();
- } else if (workInProgressRootLatestProcessedExpirationTime === Sync) {
-
-
-
- _msUntilTimeout = 0;
- } else {
-
-
- var eventTimeMs = inferTimeFromExpirationTime(workInProgressRootLatestProcessedExpirationTime);
- var currentTimeMs = now();
- var timeUntilExpirationMs = expirationTimeToMs(expirationTime) - currentTimeMs;
- var timeElapsed = currentTimeMs - eventTimeMs;
- if (timeElapsed < 0) {
-
- timeElapsed = 0;
- }
- _msUntilTimeout = jnd(timeElapsed) - timeElapsed;
-
-
- if (timeUntilExpirationMs < _msUntilTimeout) {
- _msUntilTimeout = timeUntilExpirationMs;
- }
- }
- if (_msUntilTimeout > 10) {
-
-
-
- root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout);
- break;
- }
- }
- commitRoot(root);
- break;
- }
- case RootCompleted:
- {
-
- if (
- !( IsThisRendererActing.current) && workInProgressRootLatestProcessedExpirationTime !== Sync && workInProgressRootCanSuspendUsingConfig !== null) {
-
-
-
-
- var _msUntilTimeout2 = computeMsUntilSuspenseLoadingDelay(workInProgressRootLatestProcessedExpirationTime, expirationTime, workInProgressRootCanSuspendUsingConfig);
- if (_msUntilTimeout2 > 10) {
- markRootSuspendedAtTime(root, expirationTime);
- root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout2);
- break;
- }
- }
- commitRoot(root);
- break;
- }
- default:
- {
- {
- {
- throw Error( "Unknown root exit status." );
- }
- }
- }
- }
- }
-
- function performSyncWorkOnRoot(root) {
-
- var lastExpiredTime = root.lastExpiredTime;
- var expirationTime = lastExpiredTime !== NoWork ? lastExpiredTime : Sync;
- if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
- {
- throw Error( "Should not already be working." );
- }
- }
- flushPassiveEffects();
-
- if (root !== workInProgressRoot || expirationTime !== renderExpirationTime$1) {
- prepareFreshStack(root, expirationTime);
- startWorkOnPendingInteractions(root, expirationTime);
- }
-
- if (workInProgress !== null) {
- var prevExecutionContext = executionContext;
- executionContext |= RenderContext;
- var prevDispatcher = pushDispatcher();
- var prevInteractions = pushInteractions(root);
- startWorkLoopTimer(workInProgress);
- do {
- try {
- workLoopSync();
- break;
- } catch (thrownValue) {
- handleError(root, thrownValue);
- }
- } while (true);
- resetContextDependencies();
- executionContext = prevExecutionContext;
- popDispatcher(prevDispatcher);
- {
- popInteractions(prevInteractions);
- }
- if (workInProgressRootExitStatus === RootFatalErrored) {
- var fatalError = workInProgressRootFatalError;
- stopInterruptedWorkLoopTimer();
- prepareFreshStack(root, expirationTime);
- markRootSuspendedAtTime(root, expirationTime);
- ensureRootIsScheduled(root);
- throw fatalError;
- }
- if (workInProgress !== null) {
-
- {
- {
- throw Error( "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
- } else {
-
-
- stopFinishedWorkLoopTimer();
- root.finishedWork = root.current.alternate;
- root.finishedExpirationTime = expirationTime;
- finishSyncRender(root);
- }
-
- ensureRootIsScheduled(root);
- }
- return null;
- }
- function finishSyncRender(root) {
-
- workInProgressRoot = null;
- commitRoot(root);
- }
- function flushDiscreteUpdates() {
-
-
-
-
- if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {
- {
- if ((executionContext & RenderContext) !== NoContext) {
- error('unstable_flushDiscreteUpdates: Cannot flush updates when React is ' + 'already rendering.');
- }
- }
-
-
- return;
- }
- flushPendingDiscreteUpdates();
-
- flushPassiveEffects();
- }
- function syncUpdates(fn, a, b, c) {
- return runWithPriority$1(ImmediatePriority, fn.bind(null, a, b, c));
- }
- function flushPendingDiscreteUpdates() {
- if (rootsWithPendingDiscreteUpdates !== null) {
-
-
- var roots = rootsWithPendingDiscreteUpdates;
- rootsWithPendingDiscreteUpdates = null;
- roots.forEach(function (expirationTime, root) {
- markRootExpiredAtTime(root, expirationTime);
- ensureRootIsScheduled(root);
- });
- flushSyncCallbackQueue();
- }
- }
- function batchedUpdates$1(fn, a) {
- var prevExecutionContext = executionContext;
- executionContext |= BatchedContext;
- try {
- return fn(a);
- } finally {
- executionContext = prevExecutionContext;
- if (executionContext === NoContext) {
-
- flushSyncCallbackQueue();
- }
- }
- }
- function batchedEventUpdates$1(fn, a) {
- var prevExecutionContext = executionContext;
- executionContext |= EventContext;
- try {
- return fn(a);
- } finally {
- executionContext = prevExecutionContext;
- if (executionContext === NoContext) {
-
- flushSyncCallbackQueue();
- }
- }
- }
- function discreteUpdates$1(fn, a, b, c, d) {
- var prevExecutionContext = executionContext;
- executionContext |= DiscreteEventContext;
- try {
-
- return runWithPriority$1(UserBlockingPriority$1, fn.bind(null, a, b, c, d));
- } finally {
- executionContext = prevExecutionContext;
- if (executionContext === NoContext) {
-
- flushSyncCallbackQueue();
- }
- }
- }
- function unbatchedUpdates(fn, a) {
- var prevExecutionContext = executionContext;
- executionContext &= ~BatchedContext;
- executionContext |= LegacyUnbatchedContext;
- try {
- return fn(a);
- } finally {
- executionContext = prevExecutionContext;
- if (executionContext === NoContext) {
-
- flushSyncCallbackQueue();
- }
- }
- }
- function flushSync(fn, a) {
- if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
- {
- {
- throw Error( "flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering." );
- }
- }
- }
- var prevExecutionContext = executionContext;
- executionContext |= BatchedContext;
- try {
- return runWithPriority$1(ImmediatePriority, fn.bind(null, a));
- } finally {
- executionContext = prevExecutionContext;
-
-
- flushSyncCallbackQueue();
- }
- }
- function prepareFreshStack(root, expirationTime) {
- root.finishedWork = null;
- root.finishedExpirationTime = NoWork;
- var timeoutHandle = root.timeoutHandle;
- if (timeoutHandle !== noTimeout) {
-
-
- root.timeoutHandle = noTimeout;
- cancelTimeout(timeoutHandle);
- }
- if (workInProgress !== null) {
- var interruptedWork = workInProgress.return;
- while (interruptedWork !== null) {
- unwindInterruptedWork(interruptedWork);
- interruptedWork = interruptedWork.return;
- }
- }
- workInProgressRoot = root;
- workInProgress = createWorkInProgress(root.current, null);
- renderExpirationTime$1 = expirationTime;
- workInProgressRootExitStatus = RootIncomplete;
- workInProgressRootFatalError = null;
- workInProgressRootLatestProcessedExpirationTime = Sync;
- workInProgressRootLatestSuspenseTimeout = Sync;
- workInProgressRootCanSuspendUsingConfig = null;
- workInProgressRootNextUnprocessedUpdateTime = NoWork;
- workInProgressRootHasPendingPing = false;
- {
- spawnedWorkDuringRender = null;
- }
- {
- ReactStrictModeWarnings.discardPendingWarnings();
- }
- }
- function handleError(root, thrownValue) {
- do {
- try {
-
- resetContextDependencies();
- resetHooksAfterThrow();
- resetCurrentFiber();
- if (workInProgress === null || workInProgress.return === null) {
-
-
-
-
- workInProgressRootExitStatus = RootFatalErrored;
- workInProgressRootFatalError = thrownValue;
-
-
-
-
-
- workInProgress = null;
- return null;
- }
- if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
-
-
-
- stopProfilerTimerIfRunningAndRecordDelta(workInProgress, true);
- }
- throwException(root, workInProgress.return, workInProgress, thrownValue, renderExpirationTime$1);
- workInProgress = completeUnitOfWork(workInProgress);
- } catch (yetAnotherThrownValue) {
-
- thrownValue = yetAnotherThrownValue;
- continue;
- }
- return;
- } while (true);
- }
- function pushDispatcher(root) {
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
- if (prevDispatcher === null) {
-
-
-
- return ContextOnlyDispatcher;
- } else {
- return prevDispatcher;
- }
- }
- function popDispatcher(prevDispatcher) {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- function pushInteractions(root) {
- {
- var prevInteractions = __interactionsRef.current;
- __interactionsRef.current = root.memoizedInteractions;
- return prevInteractions;
- }
- }
- function popInteractions(prevInteractions) {
- {
- __interactionsRef.current = prevInteractions;
- }
- }
- function markCommitTimeOfFallback() {
- globalMostRecentFallbackTime = now();
- }
- function markRenderEventTimeAndConfig(expirationTime, suspenseConfig) {
- if (expirationTime < workInProgressRootLatestProcessedExpirationTime && expirationTime > Idle) {
- workInProgressRootLatestProcessedExpirationTime = expirationTime;
- }
- if (suspenseConfig !== null) {
- if (expirationTime < workInProgressRootLatestSuspenseTimeout && expirationTime > Idle) {
- workInProgressRootLatestSuspenseTimeout = expirationTime;
- workInProgressRootCanSuspendUsingConfig = suspenseConfig;
- }
- }
- }
- function markUnprocessedUpdateTime(expirationTime) {
- if (expirationTime > workInProgressRootNextUnprocessedUpdateTime) {
- workInProgressRootNextUnprocessedUpdateTime = expirationTime;
- }
- }
- function renderDidSuspend() {
- if (workInProgressRootExitStatus === RootIncomplete) {
- workInProgressRootExitStatus = RootSuspended;
- }
- }
- function renderDidSuspendDelayIfPossible() {
- if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {
- workInProgressRootExitStatus = RootSuspendedWithDelay;
- }
- if (workInProgressRootNextUnprocessedUpdateTime !== NoWork && workInProgressRoot !== null) {
-
-
-
-
- markRootSuspendedAtTime(workInProgressRoot, renderExpirationTime$1);
- markRootUpdatedAtTime(workInProgressRoot, workInProgressRootNextUnprocessedUpdateTime);
- }
- }
- function renderDidError() {
- if (workInProgressRootExitStatus !== RootCompleted) {
- workInProgressRootExitStatus = RootErrored;
- }
- }
-
- function renderHasNotSuspendedYet() {
-
-
- return workInProgressRootExitStatus === RootIncomplete;
- }
- function inferTimeFromExpirationTime(expirationTime) {
-
-
- var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);
- return earliestExpirationTimeMs - LOW_PRIORITY_EXPIRATION;
- }
- function inferTimeFromExpirationTimeWithSuspenseConfig(expirationTime, suspenseConfig) {
-
-
-
- var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);
- return earliestExpirationTimeMs - (suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);
- }
-
- function workLoopSync() {
-
- while (workInProgress !== null) {
- workInProgress = performUnitOfWork(workInProgress);
- }
- }
-
- function workLoopConcurrent() {
-
- while (workInProgress !== null && !shouldYield()) {
- workInProgress = performUnitOfWork(workInProgress);
- }
- }
- function performUnitOfWork(unitOfWork) {
-
-
-
- var current = unitOfWork.alternate;
- startWorkTimer(unitOfWork);
- setCurrentFiber(unitOfWork);
- var next;
- if ( (unitOfWork.mode & ProfileMode) !== NoMode) {
- startProfilerTimer(unitOfWork);
- next = beginWork$1(current, unitOfWork, renderExpirationTime$1);
- stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
- } else {
- next = beginWork$1(current, unitOfWork, renderExpirationTime$1);
- }
- resetCurrentFiber();
- unitOfWork.memoizedProps = unitOfWork.pendingProps;
- if (next === null) {
-
- next = completeUnitOfWork(unitOfWork);
- }
- ReactCurrentOwner$2.current = null;
- return next;
- }
- function completeUnitOfWork(unitOfWork) {
-
-
- workInProgress = unitOfWork;
- do {
-
-
-
- var current = workInProgress.alternate;
- var returnFiber = workInProgress.return;
- if ((workInProgress.effectTag & Incomplete) === NoEffect) {
- setCurrentFiber(workInProgress);
- var next = void 0;
- if ( (workInProgress.mode & ProfileMode) === NoMode) {
- next = completeWork(current, workInProgress, renderExpirationTime$1);
- } else {
- startProfilerTimer(workInProgress);
- next = completeWork(current, workInProgress, renderExpirationTime$1);
- stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);
- }
- stopWorkTimer(workInProgress);
- resetCurrentFiber();
- resetChildExpirationTime(workInProgress);
- if (next !== null) {
-
- return next;
- }
- if (returnFiber !== null &&
- (returnFiber.effectTag & Incomplete) === NoEffect) {
-
-
-
- if (returnFiber.firstEffect === null) {
- returnFiber.firstEffect = workInProgress.firstEffect;
- }
- if (workInProgress.lastEffect !== null) {
- if (returnFiber.lastEffect !== null) {
- returnFiber.lastEffect.nextEffect = workInProgress.firstEffect;
- }
- returnFiber.lastEffect = workInProgress.lastEffect;
- }
-
-
-
-
-
- var effectTag = workInProgress.effectTag;
-
-
- if (effectTag > PerformedWork) {
- if (returnFiber.lastEffect !== null) {
- returnFiber.lastEffect.nextEffect = workInProgress;
- } else {
- returnFiber.firstEffect = workInProgress;
- }
- returnFiber.lastEffect = workInProgress;
- }
- }
- } else {
-
-
-
- var _next = unwindWork(workInProgress);
- if ( (workInProgress.mode & ProfileMode) !== NoMode) {
-
- stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);
- var actualDuration = workInProgress.actualDuration;
- var child = workInProgress.child;
- while (child !== null) {
- actualDuration += child.actualDuration;
- child = child.sibling;
- }
- workInProgress.actualDuration = actualDuration;
- }
- if (_next !== null) {
-
-
-
-
-
-
- stopFailedWorkTimer(workInProgress);
- _next.effectTag &= HostEffectMask;
- return _next;
- }
- stopWorkTimer(workInProgress);
- if (returnFiber !== null) {
-
- returnFiber.firstEffect = returnFiber.lastEffect = null;
- returnFiber.effectTag |= Incomplete;
- }
- }
- var siblingFiber = workInProgress.sibling;
- if (siblingFiber !== null) {
-
- return siblingFiber;
- }
- workInProgress = returnFiber;
- } while (workInProgress !== null);
- if (workInProgressRootExitStatus === RootIncomplete) {
- workInProgressRootExitStatus = RootCompleted;
- }
- return null;
- }
- function getRemainingExpirationTime(fiber) {
- var updateExpirationTime = fiber.expirationTime;
- var childExpirationTime = fiber.childExpirationTime;
- return updateExpirationTime > childExpirationTime ? updateExpirationTime : childExpirationTime;
- }
- function resetChildExpirationTime(completedWork) {
- if (renderExpirationTime$1 !== Never && completedWork.childExpirationTime === Never) {
-
-
- return;
- }
- var newChildExpirationTime = NoWork;
- if ( (completedWork.mode & ProfileMode) !== NoMode) {
-
-
- var actualDuration = completedWork.actualDuration;
- var treeBaseDuration = completedWork.selfBaseDuration;
-
-
-
-
-
-
- var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;
- var child = completedWork.child;
- while (child !== null) {
- var childUpdateExpirationTime = child.expirationTime;
- var childChildExpirationTime = child.childExpirationTime;
- if (childUpdateExpirationTime > newChildExpirationTime) {
- newChildExpirationTime = childUpdateExpirationTime;
- }
- if (childChildExpirationTime > newChildExpirationTime) {
- newChildExpirationTime = childChildExpirationTime;
- }
- if (shouldBubbleActualDurations) {
- actualDuration += child.actualDuration;
- }
- treeBaseDuration += child.treeBaseDuration;
- child = child.sibling;
- }
- completedWork.actualDuration = actualDuration;
- completedWork.treeBaseDuration = treeBaseDuration;
- } else {
- var _child = completedWork.child;
- while (_child !== null) {
- var _childUpdateExpirationTime = _child.expirationTime;
- var _childChildExpirationTime = _child.childExpirationTime;
- if (_childUpdateExpirationTime > newChildExpirationTime) {
- newChildExpirationTime = _childUpdateExpirationTime;
- }
- if (_childChildExpirationTime > newChildExpirationTime) {
- newChildExpirationTime = _childChildExpirationTime;
- }
- _child = _child.sibling;
- }
- }
- completedWork.childExpirationTime = newChildExpirationTime;
- }
- function commitRoot(root) {
- var renderPriorityLevel = getCurrentPriorityLevel();
- runWithPriority$1(ImmediatePriority, commitRootImpl.bind(null, root, renderPriorityLevel));
- return null;
- }
- function commitRootImpl(root, renderPriorityLevel) {
- do {
-
-
-
-
-
-
- flushPassiveEffects();
- } while (rootWithPendingPassiveEffects !== null);
- flushRenderPhaseStrictModeWarningsInDEV();
- if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
- {
- throw Error( "Should not already be working." );
- }
- }
- var finishedWork = root.finishedWork;
- var expirationTime = root.finishedExpirationTime;
- if (finishedWork === null) {
- return null;
- }
- root.finishedWork = null;
- root.finishedExpirationTime = NoWork;
- if (!(finishedWork !== root.current)) {
- {
- throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." );
- }
- }
-
- root.callbackNode = null;
- root.callbackExpirationTime = NoWork;
- root.callbackPriority = NoPriority;
- root.nextKnownPendingLevel = NoWork;
- startCommitTimer();
-
- var remainingExpirationTimeBeforeCommit = getRemainingExpirationTime(finishedWork);
- markRootFinishedAtTime(root, expirationTime, remainingExpirationTimeBeforeCommit);
- if (root === workInProgressRoot) {
-
- workInProgressRoot = null;
- workInProgress = null;
- renderExpirationTime$1 = NoWork;
- }
-
-
-
- var firstEffect;
- if (finishedWork.effectTag > PerformedWork) {
-
-
-
-
- if (finishedWork.lastEffect !== null) {
- finishedWork.lastEffect.nextEffect = finishedWork;
- firstEffect = finishedWork.firstEffect;
- } else {
- firstEffect = finishedWork;
- }
- } else {
-
- firstEffect = finishedWork.firstEffect;
- }
- if (firstEffect !== null) {
- var prevExecutionContext = executionContext;
- executionContext |= CommitContext;
- var prevInteractions = pushInteractions(root);
- ReactCurrentOwner$2.current = null;
-
-
-
-
-
- startCommitSnapshotEffectsTimer();
- prepareForCommit(root.containerInfo);
- nextEffect = firstEffect;
- do {
- {
- invokeGuardedCallback(null, commitBeforeMutationEffects, null);
- if (hasCaughtError()) {
- if (!(nextEffect !== null)) {
- {
- throw Error( "Should be working on an effect." );
- }
- }
- var error = clearCaughtError();
- captureCommitPhaseError(nextEffect, error);
- nextEffect = nextEffect.nextEffect;
- }
- }
- } while (nextEffect !== null);
- stopCommitSnapshotEffectsTimer();
- {
-
-
- recordCommitTime();
- }
- startCommitHostEffectsTimer();
- nextEffect = firstEffect;
- do {
- {
- invokeGuardedCallback(null, commitMutationEffects, null, root, renderPriorityLevel);
- if (hasCaughtError()) {
- if (!(nextEffect !== null)) {
- {
- throw Error( "Should be working on an effect." );
- }
- }
- var _error = clearCaughtError();
- captureCommitPhaseError(nextEffect, _error);
- nextEffect = nextEffect.nextEffect;
- }
- }
- } while (nextEffect !== null);
- stopCommitHostEffectsTimer();
- resetAfterCommit(root.containerInfo);
-
-
-
- root.current = finishedWork;
-
-
- startCommitLifeCyclesTimer();
- nextEffect = firstEffect;
- do {
- {
- invokeGuardedCallback(null, commitLayoutEffects, null, root, expirationTime);
- if (hasCaughtError()) {
- if (!(nextEffect !== null)) {
- {
- throw Error( "Should be working on an effect." );
- }
- }
- var _error2 = clearCaughtError();
- captureCommitPhaseError(nextEffect, _error2);
- nextEffect = nextEffect.nextEffect;
- }
- }
- } while (nextEffect !== null);
- stopCommitLifeCyclesTimer();
- nextEffect = null;
-
- requestPaint();
- {
- popInteractions(prevInteractions);
- }
- executionContext = prevExecutionContext;
- } else {
-
- root.current = finishedWork;
-
-
- startCommitSnapshotEffectsTimer();
- stopCommitSnapshotEffectsTimer();
- {
- recordCommitTime();
- }
- startCommitHostEffectsTimer();
- stopCommitHostEffectsTimer();
- startCommitLifeCyclesTimer();
- stopCommitLifeCyclesTimer();
- }
- stopCommitTimer();
- var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
- if (rootDoesHavePassiveEffects) {
-
-
- rootDoesHavePassiveEffects = false;
- rootWithPendingPassiveEffects = root;
- pendingPassiveEffectsExpirationTime = expirationTime;
- pendingPassiveEffectsRenderPriority = renderPriorityLevel;
- } else {
-
-
-
- nextEffect = firstEffect;
- while (nextEffect !== null) {
- var nextNextEffect = nextEffect.nextEffect;
- nextEffect.nextEffect = null;
- nextEffect = nextNextEffect;
- }
- }
- var remainingExpirationTime = root.firstPendingTime;
- if (remainingExpirationTime !== NoWork) {
- {
- if (spawnedWorkDuringRender !== null) {
- var expirationTimes = spawnedWorkDuringRender;
- spawnedWorkDuringRender = null;
- for (var i = 0; i < expirationTimes.length; i++) {
- scheduleInteractions(root, expirationTimes[i], root.memoizedInteractions);
- }
- }
- schedulePendingInteractions(root, remainingExpirationTime);
- }
- } else {
-
-
- legacyErrorBoundariesThatAlreadyFailed = null;
- }
- {
- if (!rootDidHavePassiveEffects) {
-
-
-
-
- finishPendingInteractions(root, expirationTime);
- }
- }
- if (remainingExpirationTime === Sync) {
-
-
- if (root === rootWithNestedUpdates) {
- nestedUpdateCount++;
- } else {
- nestedUpdateCount = 0;
- rootWithNestedUpdates = root;
- }
- } else {
- nestedUpdateCount = 0;
- }
- onCommitRoot(finishedWork.stateNode, expirationTime);
-
- ensureRootIsScheduled(root);
- if (hasUncaughtError) {
- hasUncaughtError = false;
- var _error3 = firstUncaughtError;
- firstUncaughtError = null;
- throw _error3;
- }
- if ((executionContext & LegacyUnbatchedContext) !== NoContext) {
-
-
-
-
- return null;
- }
- flushSyncCallbackQueue();
- return null;
- }
- function commitBeforeMutationEffects() {
- while (nextEffect !== null) {
- var effectTag = nextEffect.effectTag;
- if ((effectTag & Snapshot) !== NoEffect) {
- setCurrentFiber(nextEffect);
- recordEffect();
- var current = nextEffect.alternate;
- commitBeforeMutationLifeCycles(current, nextEffect);
- resetCurrentFiber();
- }
- if ((effectTag & Passive) !== NoEffect) {
-
-
- if (!rootDoesHavePassiveEffects) {
- rootDoesHavePassiveEffects = true;
- scheduleCallback(NormalPriority, function () {
- flushPassiveEffects();
- return null;
- });
- }
- }
- nextEffect = nextEffect.nextEffect;
- }
- }
- function commitMutationEffects(root, renderPriorityLevel) {
-
- while (nextEffect !== null) {
- setCurrentFiber(nextEffect);
- var effectTag = nextEffect.effectTag;
- if (effectTag & ContentReset) {
- commitResetTextContent(nextEffect);
- }
- if (effectTag & Ref) {
- var current = nextEffect.alternate;
- if (current !== null) {
- commitDetachRef(current);
- }
- }
-
-
-
- var primaryEffectTag = effectTag & (Placement | Update | Deletion | Hydrating);
- switch (primaryEffectTag) {
- case Placement:
- {
- commitPlacement(nextEffect);
-
-
-
- nextEffect.effectTag &= ~Placement;
- break;
- }
- case PlacementAndUpdate:
- {
-
- commitPlacement(nextEffect);
-
- nextEffect.effectTag &= ~Placement;
- var _current = nextEffect.alternate;
- commitWork(_current, nextEffect);
- break;
- }
- case Hydrating:
- {
- nextEffect.effectTag &= ~Hydrating;
- break;
- }
- case HydratingAndUpdate:
- {
- nextEffect.effectTag &= ~Hydrating;
- var _current2 = nextEffect.alternate;
- commitWork(_current2, nextEffect);
- break;
- }
- case Update:
- {
- var _current3 = nextEffect.alternate;
- commitWork(_current3, nextEffect);
- break;
- }
- case Deletion:
- {
- commitDeletion(root, nextEffect, renderPriorityLevel);
- break;
- }
- }
- recordEffect();
- resetCurrentFiber();
- nextEffect = nextEffect.nextEffect;
- }
- }
- function commitLayoutEffects(root, committedExpirationTime) {
-
- while (nextEffect !== null) {
- setCurrentFiber(nextEffect);
- var effectTag = nextEffect.effectTag;
- if (effectTag & (Update | Callback)) {
- recordEffect();
- var current = nextEffect.alternate;
- commitLifeCycles(root, current, nextEffect);
- }
- if (effectTag & Ref) {
- recordEffect();
- commitAttachRef(nextEffect);
- }
- resetCurrentFiber();
- nextEffect = nextEffect.nextEffect;
- }
- }
- function flushPassiveEffects() {
- if (pendingPassiveEffectsRenderPriority !== NoPriority) {
- var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority ? NormalPriority : pendingPassiveEffectsRenderPriority;
- pendingPassiveEffectsRenderPriority = NoPriority;
- return runWithPriority$1(priorityLevel, flushPassiveEffectsImpl);
- }
- }
- function flushPassiveEffectsImpl() {
- if (rootWithPendingPassiveEffects === null) {
- return false;
- }
- var root = rootWithPendingPassiveEffects;
- var expirationTime = pendingPassiveEffectsExpirationTime;
- rootWithPendingPassiveEffects = null;
- pendingPassiveEffectsExpirationTime = NoWork;
- if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
- {
- throw Error( "Cannot flush passive effects while already rendering." );
- }
- }
- var prevExecutionContext = executionContext;
- executionContext |= CommitContext;
- var prevInteractions = pushInteractions(root);
- {
-
-
-
- var _effect2 = root.current.firstEffect;
- while (_effect2 !== null) {
- {
- setCurrentFiber(_effect2);
- invokeGuardedCallback(null, commitPassiveHookEffects, null, _effect2);
- if (hasCaughtError()) {
- if (!(_effect2 !== null)) {
- {
- throw Error( "Should be working on an effect." );
- }
- }
- var _error5 = clearCaughtError();
- captureCommitPhaseError(_effect2, _error5);
- }
- resetCurrentFiber();
- }
- var nextNextEffect = _effect2.nextEffect;
- _effect2.nextEffect = null;
- _effect2 = nextNextEffect;
- }
- }
- {
- popInteractions(prevInteractions);
- finishPendingInteractions(root, expirationTime);
- }
- executionContext = prevExecutionContext;
- flushSyncCallbackQueue();
-
- nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;
- return true;
- }
- function isAlreadyFailedLegacyErrorBoundary(instance) {
- return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
- }
- function markLegacyErrorBoundaryAsFailed(instance) {
- if (legacyErrorBoundariesThatAlreadyFailed === null) {
- legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);
- } else {
- legacyErrorBoundariesThatAlreadyFailed.add(instance);
- }
- }
- function prepareToThrowUncaughtError(error) {
- if (!hasUncaughtError) {
- hasUncaughtError = true;
- firstUncaughtError = error;
- }
- }
- var onUncaughtError = prepareToThrowUncaughtError;
- function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
- var errorInfo = createCapturedValue(error, sourceFiber);
- var update = createRootErrorUpdate(rootFiber, errorInfo, Sync);
- enqueueUpdate(rootFiber, update);
- var root = markUpdateTimeFromFiberToRoot(rootFiber, Sync);
- if (root !== null) {
- ensureRootIsScheduled(root);
- schedulePendingInteractions(root, Sync);
- }
- }
- function captureCommitPhaseError(sourceFiber, error) {
- if (sourceFiber.tag === HostRoot) {
-
-
- captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
- return;
- }
- var fiber = sourceFiber.return;
- while (fiber !== null) {
- if (fiber.tag === HostRoot) {
- captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);
- return;
- } else if (fiber.tag === ClassComponent) {
- var ctor = fiber.type;
- var instance = fiber.stateNode;
- if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {
- var errorInfo = createCapturedValue(error, sourceFiber);
- var update = createClassErrorUpdate(fiber, errorInfo,
- Sync);
- enqueueUpdate(fiber, update);
- var root = markUpdateTimeFromFiberToRoot(fiber, Sync);
- if (root !== null) {
- ensureRootIsScheduled(root);
- schedulePendingInteractions(root, Sync);
- }
- return;
- }
- }
- fiber = fiber.return;
- }
- }
- function pingSuspendedRoot(root, thenable, suspendedTime) {
- var pingCache = root.pingCache;
- if (pingCache !== null) {
-
-
- pingCache.delete(thenable);
- }
- if (workInProgressRoot === root && renderExpirationTime$1 === suspendedTime) {
-
-
-
-
-
-
-
-
-
-
-
- if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && workInProgressRootLatestProcessedExpirationTime === Sync && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
-
-
- prepareFreshStack(root, renderExpirationTime$1);
- } else {
-
-
- workInProgressRootHasPendingPing = true;
- }
- return;
- }
- if (!isRootSuspendedAtTime(root, suspendedTime)) {
-
- return;
- }
- var lastPingedTime = root.lastPingedTime;
- if (lastPingedTime !== NoWork && lastPingedTime < suspendedTime) {
-
- return;
- }
- root.lastPingedTime = suspendedTime;
- ensureRootIsScheduled(root);
- schedulePendingInteractions(root, suspendedTime);
- }
- function retryTimedOutBoundary(boundaryFiber, retryTime) {
-
-
-
-
- if (retryTime === NoWork) {
- var suspenseConfig = null;
- var currentTime = requestCurrentTimeForUpdate();
- retryTime = computeExpirationForFiber(currentTime, boundaryFiber, suspenseConfig);
- }
- var root = markUpdateTimeFromFiberToRoot(boundaryFiber, retryTime);
- if (root !== null) {
- ensureRootIsScheduled(root);
- schedulePendingInteractions(root, retryTime);
- }
- }
- function resolveRetryThenable(boundaryFiber, thenable) {
- var retryTime = NoWork;
- var retryCache;
- {
- retryCache = boundaryFiber.stateNode;
- }
- if (retryCache !== null) {
-
-
- retryCache.delete(thenable);
- }
- retryTimedOutBoundary(boundaryFiber, retryTime);
- }
-
-
-
-
-
-
-
-
- function jnd(timeElapsed) {
- return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
- }
- function computeMsUntilSuspenseLoadingDelay(mostRecentEventTime, committedExpirationTime, suspenseConfig) {
- var busyMinDurationMs = suspenseConfig.busyMinDurationMs | 0;
- if (busyMinDurationMs <= 0) {
- return 0;
- }
- var busyDelayMs = suspenseConfig.busyDelayMs | 0;
- var currentTimeMs = now();
- var eventTimeMs = inferTimeFromExpirationTimeWithSuspenseConfig(mostRecentEventTime, suspenseConfig);
- var timeElapsed = currentTimeMs - eventTimeMs;
- if (timeElapsed <= busyDelayMs) {
-
-
- return 0;
- }
- var msUntilTimeout = busyDelayMs + busyMinDurationMs - timeElapsed;
- return msUntilTimeout;
- }
- function checkForNestedUpdates() {
- if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
- nestedUpdateCount = 0;
- rootWithNestedUpdates = null;
- {
- {
- throw Error( "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." );
- }
- }
- }
- {
- if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
- nestedPassiveUpdateCount = 0;
- error('Maximum update depth exceeded. This can happen when a component ' + "calls setState inside useEffect, but useEffect either doesn't " + 'have a dependency array, or one of the dependencies changes on ' + 'every render.');
- }
- }
- }
- function flushRenderPhaseStrictModeWarningsInDEV() {
- {
- ReactStrictModeWarnings.flushLegacyContextWarning();
- {
- ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
- }
- }
- }
- function stopFinishedWorkLoopTimer() {
- var didCompleteRoot = true;
- stopWorkLoopTimer(interruptedBy, didCompleteRoot);
- interruptedBy = null;
- }
- function stopInterruptedWorkLoopTimer() {
-
- var didCompleteRoot = false;
- stopWorkLoopTimer(interruptedBy, didCompleteRoot);
- interruptedBy = null;
- }
- function checkForInterruption(fiberThatReceivedUpdate, updateExpirationTime) {
- if ( workInProgressRoot !== null && updateExpirationTime > renderExpirationTime$1) {
- interruptedBy = fiberThatReceivedUpdate;
- }
- }
- var didWarnStateUpdateForUnmountedComponent = null;
- function warnAboutUpdateOnUnmountedFiberInDEV(fiber) {
- {
- var tag = fiber.tag;
- if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {
-
- return;
- }
-
- var componentName = getComponentName(fiber.type) || 'ReactComponent';
- if (didWarnStateUpdateForUnmountedComponent !== null) {
- if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {
- return;
- }
- didWarnStateUpdateForUnmountedComponent.add(componentName);
- } else {
- didWarnStateUpdateForUnmountedComponent = new Set([componentName]);
- }
- error("Can't perform a React state update on an unmounted component. This " + 'is a no-op, but it indicates a memory leak in your application. To ' + 'fix, cancel all subscriptions and asynchronous tasks in %s.%s', tag === ClassComponent ? 'the componentWillUnmount method' : 'a useEffect cleanup function', getStackByFiberInDevAndProd(fiber));
- }
- }
- var beginWork$1;
- {
- var dummyFiber = null;
- beginWork$1 = function (current, unitOfWork, expirationTime) {
-
-
-
-
-
- var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);
- try {
- return beginWork(current, unitOfWork, expirationTime);
- } catch (originalError) {
- if (originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') {
-
- throw originalError;
- }
-
- resetContextDependencies();
- resetHooksAfterThrow();
-
-
- unwindInterruptedWork(unitOfWork);
- assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
- if ( unitOfWork.mode & ProfileMode) {
-
- startProfilerTimer(unitOfWork);
- }
- invokeGuardedCallback(null, beginWork, null, current, unitOfWork, expirationTime);
- if (hasCaughtError()) {
- var replayError = clearCaughtError();
-
- throw replayError;
- } else {
-
- throw originalError;
- }
- }
- };
- }
- var didWarnAboutUpdateInRender = false;
- var didWarnAboutUpdateInGetChildContext = false;
- function warnAboutRenderPhaseUpdatesInDEV(fiber) {
- {
- if ((executionContext & RenderContext) !== NoContext) {
- switch (fiber.tag) {
- case FunctionComponent:
- case ForwardRef:
- case SimpleMemoComponent:
- {
- error('Cannot update a component from inside the function body of a ' + 'different component.');
- break;
- }
- case ClassComponent:
- {
- switch (phase) {
- case 'getChildContext':
- if (didWarnAboutUpdateInGetChildContext) {
- return;
- }
- error('setState(...): Cannot call setState() inside getChildContext()');
- didWarnAboutUpdateInGetChildContext = true;
- break;
- case 'render':
- if (didWarnAboutUpdateInRender) {
- return;
- }
- error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.');
- didWarnAboutUpdateInRender = true;
- break;
- }
- break;
- }
- }
- }
- }
- }
- var IsThisRendererActing = {
- current: false
- };
- function warnIfNotScopedWithMatchingAct(fiber) {
- {
- if ( IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {
- error("It looks like you're using the wrong act() around your test interactions.\n" + 'Be sure to use the matching version of act() corresponding to your renderer:\n\n' + '// for react-dom:\n' + "import {act} from 'react-dom/test-utils';\n" + '// ...\n' + 'act(() => ...);\n\n' + '// for react-test-renderer:\n' + "import TestRenderer from 'react-test-renderer';\n" + 'const {act} = TestRenderer;\n' + '// ...\n' + 'act(() => ...);' + '%s', getStackByFiberInDevAndProd(fiber));
- }
- }
- }
- function warnIfNotCurrentlyActingEffectsInDEV(fiber) {
- {
- if ( (fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
- error('An update to %s ran an effect, but was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + ' /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));
- }
- }
- }
- function warnIfNotCurrentlyActingUpdatesInDEV(fiber) {
- {
- if ( executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
- error('An update to %s inside a test was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + ' /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));
- }
- }
- }
- var warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV;
- var didWarnAboutUnmockedScheduler = false;
-
-
-
- function warnIfUnmockedScheduler(fiber) {
- {
- if (didWarnAboutUnmockedScheduler === false && unstable_flushAllWithoutAsserting === undefined) {
- if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {
- didWarnAboutUnmockedScheduler = true;
- error('In Concurrent or Sync modes, the "scheduler" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \n' + "jest.mock('scheduler', () => require('scheduler/unstable_mock'));\n\n" + 'For more info, visit https://fb.me/react-mock-scheduler');
- }
- }
- }
- }
- function computeThreadID(root, expirationTime) {
-
- return expirationTime * 1000 + root.interactionThreadID;
- }
- function markSpawnedWork(expirationTime) {
- if (spawnedWorkDuringRender === null) {
- spawnedWorkDuringRender = [expirationTime];
- } else {
- spawnedWorkDuringRender.push(expirationTime);
- }
- }
- function scheduleInteractions(root, expirationTime, interactions) {
- if (interactions.size > 0) {
- var pendingInteractionMap = root.pendingInteractionMap;
- var pendingInteractions = pendingInteractionMap.get(expirationTime);
- if (pendingInteractions != null) {
- interactions.forEach(function (interaction) {
- if (!pendingInteractions.has(interaction)) {
-
- interaction.__count++;
- }
- pendingInteractions.add(interaction);
- });
- } else {
- pendingInteractionMap.set(expirationTime, new Set(interactions));
- interactions.forEach(function (interaction) {
- interaction.__count++;
- });
- }
- var subscriber = __subscriberRef.current;
- if (subscriber !== null) {
- var threadID = computeThreadID(root, expirationTime);
- subscriber.onWorkScheduled(interactions, threadID);
- }
- }
- }
- function schedulePendingInteractions(root, expirationTime) {
- scheduleInteractions(root, expirationTime, __interactionsRef.current);
- }
- function startWorkOnPendingInteractions(root, expirationTime) {
-
-
- var interactions = new Set();
- root.pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {
- if (scheduledExpirationTime >= expirationTime) {
- scheduledInteractions.forEach(function (interaction) {
- return interactions.add(interaction);
- });
- }
- });
-
-
-
-
- root.memoizedInteractions = interactions;
- if (interactions.size > 0) {
- var subscriber = __subscriberRef.current;
- if (subscriber !== null) {
- var threadID = computeThreadID(root, expirationTime);
- try {
- subscriber.onWorkStarted(interactions, threadID);
- } catch (error) {
-
- scheduleCallback(ImmediatePriority, function () {
- throw error;
- });
- }
- }
- }
- }
- function finishPendingInteractions(root, committedExpirationTime) {
- var earliestRemainingTimeAfterCommit = root.firstPendingTime;
- var subscriber;
- try {
- subscriber = __subscriberRef.current;
- if (subscriber !== null && root.memoizedInteractions.size > 0) {
- var threadID = computeThreadID(root, committedExpirationTime);
- subscriber.onWorkStopped(root.memoizedInteractions, threadID);
- }
- } catch (error) {
-
- scheduleCallback(ImmediatePriority, function () {
- throw error;
- });
- } finally {
-
-
-
- var pendingInteractionMap = root.pendingInteractionMap;
- pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {
-
-
-
- if (scheduledExpirationTime > earliestRemainingTimeAfterCommit) {
- pendingInteractionMap.delete(scheduledExpirationTime);
- scheduledInteractions.forEach(function (interaction) {
- interaction.__count--;
- if (subscriber !== null && interaction.__count === 0) {
- try {
- subscriber.onInteractionScheduledWorkCompleted(interaction);
- } catch (error) {
-
- scheduleCallback(ImmediatePriority, function () {
- throw error;
- });
- }
- }
- });
- }
- });
- }
- }
- var onScheduleFiberRoot = null;
- var onCommitFiberRoot = null;
- var onCommitFiberUnmount = null;
- var hasLoggedError = false;
- var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined';
- function injectInternals(internals) {
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
-
- return false;
- }
- var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
- if (hook.isDisabled) {
-
-
-
- return true;
- }
- if (!hook.supportsFiber) {
- {
- error('The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://fb.me/react-devtools');
- }
- return true;
- }
- try {
- var rendererID = hook.inject(internals);
- if (true) {
-
- if (typeof hook.onScheduleFiberRoot === 'function') {
- onScheduleFiberRoot = function (root, children) {
- try {
- hook.onScheduleFiberRoot(rendererID, root, children);
- } catch (err) {
- if (true && !hasLoggedError) {
- hasLoggedError = true;
- error('React instrumentation encountered an error: %s', err);
- }
- }
- };
- }
- }
- onCommitFiberRoot = function (root, expirationTime) {
- try {
- var didError = (root.current.effectTag & DidCapture) === DidCapture;
- if (enableProfilerTimer) {
- var currentTime = getCurrentTime();
- var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime);
- hook.onCommitFiberRoot(rendererID, root, priorityLevel, didError);
- } else {
- hook.onCommitFiberRoot(rendererID, root, undefined, didError);
- }
- } catch (err) {
- if (true) {
- if (!hasLoggedError) {
- hasLoggedError = true;
- error('React instrumentation encountered an error: %s', err);
- }
- }
- }
- };
- onCommitFiberUnmount = function (fiber) {
- try {
- hook.onCommitFiberUnmount(rendererID, fiber);
- } catch (err) {
- if (true) {
- if (!hasLoggedError) {
- hasLoggedError = true;
- error('React instrumentation encountered an error: %s', err);
- }
- }
- }
- };
- } catch (err) {
-
- {
- error('React instrumentation encountered an error: %s.', err);
- }
- }
- return true;
- }
- function onScheduleRoot(root, children) {
- if (typeof onScheduleFiberRoot === 'function') {
- onScheduleFiberRoot(root, children);
- }
- }
- function onCommitRoot(root, expirationTime) {
- if (typeof onCommitFiberRoot === 'function') {
- onCommitFiberRoot(root, expirationTime);
- }
- }
- function onCommitUnmount(fiber) {
- if (typeof onCommitFiberUnmount === 'function') {
- onCommitFiberUnmount(fiber);
- }
- }
- var hasBadMapPolyfill;
- {
- hasBadMapPolyfill = false;
- try {
- var nonExtensibleObject = Object.preventExtensions({});
- var testMap = new Map([[nonExtensibleObject, null]]);
- var testSet = new Set([nonExtensibleObject]);
-
-
- testMap.set(0, 0);
- testSet.add(0);
- } catch (e) {
-
- hasBadMapPolyfill = true;
- }
- }
- var debugCounter = 1;
- function FiberNode(tag, pendingProps, key, mode) {
-
- this.tag = tag;
- this.key = key;
- this.elementType = null;
- this.type = null;
- this.stateNode = null;
- this.return = null;
- this.child = null;
- this.sibling = null;
- this.index = 0;
- this.ref = null;
- this.pendingProps = pendingProps;
- this.memoizedProps = null;
- this.updateQueue = null;
- this.memoizedState = null;
- this.dependencies = null;
- this.mode = mode;
- this.effectTag = NoEffect;
- this.nextEffect = null;
- this.firstEffect = null;
- this.lastEffect = null;
- this.expirationTime = NoWork;
- this.childExpirationTime = NoWork;
- this.alternate = null;
- {
-
-
-
-
-
-
-
-
-
-
-
-
- this.actualDuration = Number.NaN;
- this.actualStartTime = Number.NaN;
- this.selfBaseDuration = Number.NaN;
- this.treeBaseDuration = Number.NaN;
-
-
- this.actualDuration = 0;
- this.actualStartTime = -1;
- this.selfBaseDuration = 0;
- this.treeBaseDuration = 0;
- }
-
- {
- this._debugID = debugCounter++;
- this._debugIsCurrentlyTiming = false;
- }
- {
- this._debugSource = null;
- this._debugOwner = null;
- this._debugNeedsRemount = false;
- this._debugHookTypes = null;
- if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
- Object.preventExtensions(this);
- }
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
- var createFiber = function (tag, pendingProps, key, mode) {
-
- return new FiberNode(tag, pendingProps, key, mode);
- };
- function shouldConstruct(Component) {
- var prototype = Component.prototype;
- return !!(prototype && prototype.isReactComponent);
- }
- function isSimpleFunctionComponent(type) {
- return typeof type === 'function' && !shouldConstruct(type) && type.defaultProps === undefined;
- }
- function resolveLazyComponentTag(Component) {
- if (typeof Component === 'function') {
- return shouldConstruct(Component) ? ClassComponent : FunctionComponent;
- } else if (Component !== undefined && Component !== null) {
- var $$typeof = Component.$$typeof;
- if ($$typeof === REACT_FORWARD_REF_TYPE) {
- return ForwardRef;
- }
- if ($$typeof === REACT_MEMO_TYPE) {
- return MemoComponent;
- }
- }
- return IndeterminateComponent;
- }
- function createWorkInProgress(current, pendingProps) {
- var workInProgress = current.alternate;
- if (workInProgress === null) {
-
-
-
-
-
- workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode);
- workInProgress.elementType = current.elementType;
- workInProgress.type = current.type;
- workInProgress.stateNode = current.stateNode;
- {
-
- {
- workInProgress._debugID = current._debugID;
- }
- workInProgress._debugSource = current._debugSource;
- workInProgress._debugOwner = current._debugOwner;
- workInProgress._debugHookTypes = current._debugHookTypes;
- }
- workInProgress.alternate = current;
- current.alternate = workInProgress;
- } else {
- workInProgress.pendingProps = pendingProps;
-
- workInProgress.effectTag = NoEffect;
- workInProgress.nextEffect = null;
- workInProgress.firstEffect = null;
- workInProgress.lastEffect = null;
- {
-
-
-
-
- workInProgress.actualDuration = 0;
- workInProgress.actualStartTime = -1;
- }
- }
- workInProgress.childExpirationTime = current.childExpirationTime;
- workInProgress.expirationTime = current.expirationTime;
- workInProgress.child = current.child;
- workInProgress.memoizedProps = current.memoizedProps;
- workInProgress.memoizedState = current.memoizedState;
- workInProgress.updateQueue = current.updateQueue;
-
- var currentDependencies = current.dependencies;
- workInProgress.dependencies = currentDependencies === null ? null : {
- expirationTime: currentDependencies.expirationTime,
- firstContext: currentDependencies.firstContext,
- responders: currentDependencies.responders
- };
- workInProgress.sibling = current.sibling;
- workInProgress.index = current.index;
- workInProgress.ref = current.ref;
- {
- workInProgress.selfBaseDuration = current.selfBaseDuration;
- workInProgress.treeBaseDuration = current.treeBaseDuration;
- }
- {
- workInProgress._debugNeedsRemount = current._debugNeedsRemount;
- switch (workInProgress.tag) {
- case IndeterminateComponent:
- case FunctionComponent:
- case SimpleMemoComponent:
- workInProgress.type = resolveFunctionForHotReloading(current.type);
- break;
- case ClassComponent:
- workInProgress.type = resolveClassForHotReloading(current.type);
- break;
- case ForwardRef:
- workInProgress.type = resolveForwardRefForHotReloading(current.type);
- break;
- }
- }
- return workInProgress;
- }
- function resetWorkInProgress(workInProgress, renderExpirationTime) {
-
-
-
-
-
-
-
-
- workInProgress.effectTag &= Placement;
- workInProgress.nextEffect = null;
- workInProgress.firstEffect = null;
- workInProgress.lastEffect = null;
- var current = workInProgress.alternate;
- if (current === null) {
-
- workInProgress.childExpirationTime = NoWork;
- workInProgress.expirationTime = renderExpirationTime;
- workInProgress.child = null;
- workInProgress.memoizedProps = null;
- workInProgress.memoizedState = null;
- workInProgress.updateQueue = null;
- workInProgress.dependencies = null;
- {
-
-
- workInProgress.selfBaseDuration = 0;
- workInProgress.treeBaseDuration = 0;
- }
- } else {
-
- workInProgress.childExpirationTime = current.childExpirationTime;
- workInProgress.expirationTime = current.expirationTime;
- workInProgress.child = current.child;
- workInProgress.memoizedProps = current.memoizedProps;
- workInProgress.memoizedState = current.memoizedState;
- workInProgress.updateQueue = current.updateQueue;
-
- var currentDependencies = current.dependencies;
- workInProgress.dependencies = currentDependencies === null ? null : {
- expirationTime: currentDependencies.expirationTime,
- firstContext: currentDependencies.firstContext,
- responders: currentDependencies.responders
- };
- {
-
-
- workInProgress.selfBaseDuration = current.selfBaseDuration;
- workInProgress.treeBaseDuration = current.treeBaseDuration;
- }
- }
- return workInProgress;
- }
- function createHostRootFiber(tag) {
- var mode;
- if (tag === ConcurrentRoot) {
- mode = ConcurrentMode | BlockingMode | StrictMode;
- } else if (tag === BlockingRoot) {
- mode = BlockingMode | StrictMode;
- } else {
- mode = NoMode;
- }
- if ( isDevToolsPresent) {
-
-
-
- mode |= ProfileMode;
- }
- return createFiber(HostRoot, null, null, mode);
- }
- function createFiberFromTypeAndProps(type, // React$ElementType
- key, pendingProps, owner, mode, expirationTime) {
- var fiber;
- var fiberTag = IndeterminateComponent;
- var resolvedType = type;
- if (typeof type === 'function') {
- if (shouldConstruct(type)) {
- fiberTag = ClassComponent;
- {
- resolvedType = resolveClassForHotReloading(resolvedType);
- }
- } else {
- {
- resolvedType = resolveFunctionForHotReloading(resolvedType);
- }
- }
- } else if (typeof type === 'string') {
- fiberTag = HostComponent;
- } else {
- getTag: switch (type) {
- case REACT_FRAGMENT_TYPE:
- return createFiberFromFragment(pendingProps.children, mode, expirationTime, key);
- case REACT_CONCURRENT_MODE_TYPE:
- fiberTag = Mode;
- mode |= ConcurrentMode | BlockingMode | StrictMode;
- break;
- case REACT_STRICT_MODE_TYPE:
- fiberTag = Mode;
- mode |= StrictMode;
- break;
- case REACT_PROFILER_TYPE:
- return createFiberFromProfiler(pendingProps, mode, expirationTime, key);
- case REACT_SUSPENSE_TYPE:
- return createFiberFromSuspense(pendingProps, mode, expirationTime, key);
- case REACT_SUSPENSE_LIST_TYPE:
- return createFiberFromSuspenseList(pendingProps, mode, expirationTime, key);
- default:
- {
- if (typeof type === 'object' && type !== null) {
- switch (type.$$typeof) {
- case REACT_PROVIDER_TYPE:
- fiberTag = ContextProvider;
- break getTag;
- case REACT_CONTEXT_TYPE:
-
- fiberTag = ContextConsumer;
- break getTag;
- case REACT_FORWARD_REF_TYPE:
- fiberTag = ForwardRef;
- {
- resolvedType = resolveForwardRefForHotReloading(resolvedType);
- }
- break getTag;
- case REACT_MEMO_TYPE:
- fiberTag = MemoComponent;
- break getTag;
- case REACT_LAZY_TYPE:
- fiberTag = LazyComponent;
- resolvedType = null;
- break getTag;
- case REACT_BLOCK_TYPE:
- fiberTag = Block;
- break getTag;
- }
- }
- var info = '';
- {
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
- info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and " + 'named imports.';
- }
- var ownerName = owner ? getComponentName(owner.type) : null;
- if (ownerName) {
- info += '\n\nCheck the render method of `' + ownerName + '`.';
- }
- }
- {
- {
- throw Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (type == null ? type : typeof type) + "." + info );
- }
- }
- }
- }
- }
- fiber = createFiber(fiberTag, pendingProps, key, mode);
- fiber.elementType = type;
- fiber.type = resolvedType;
- fiber.expirationTime = expirationTime;
- return fiber;
- }
- function createFiberFromElement(element, mode, expirationTime) {
- var owner = null;
- {
- owner = element._owner;
- }
- var type = element.type;
- var key = element.key;
- var pendingProps = element.props;
- var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, expirationTime);
- {
- fiber._debugSource = element._source;
- fiber._debugOwner = element._owner;
- }
- return fiber;
- }
- function createFiberFromFragment(elements, mode, expirationTime, key) {
- var fiber = createFiber(Fragment, elements, key, mode);
- fiber.expirationTime = expirationTime;
- return fiber;
- }
- function createFiberFromProfiler(pendingProps, mode, expirationTime, key) {
- {
- if (typeof pendingProps.id !== 'string' || typeof pendingProps.onRender !== 'function') {
- error('Profiler must specify an "id" string and "onRender" function as props');
- }
- }
- var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode);
- fiber.elementType = REACT_PROFILER_TYPE;
- fiber.type = REACT_PROFILER_TYPE;
- fiber.expirationTime = expirationTime;
- return fiber;
- }
- function createFiberFromSuspense(pendingProps, mode, expirationTime, key) {
- var fiber = createFiber(SuspenseComponent, pendingProps, key, mode);
-
-
- fiber.type = REACT_SUSPENSE_TYPE;
- fiber.elementType = REACT_SUSPENSE_TYPE;
- fiber.expirationTime = expirationTime;
- return fiber;
- }
- function createFiberFromSuspenseList(pendingProps, mode, expirationTime, key) {
- var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);
- {
-
-
-
- fiber.type = REACT_SUSPENSE_LIST_TYPE;
- }
- fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
- fiber.expirationTime = expirationTime;
- return fiber;
- }
- function createFiberFromText(content, mode, expirationTime) {
- var fiber = createFiber(HostText, content, null, mode);
- fiber.expirationTime = expirationTime;
- return fiber;
- }
- function createFiberFromHostInstanceForDeletion() {
- var fiber = createFiber(HostComponent, null, null, NoMode);
- fiber.elementType = 'DELETED';
- fiber.type = 'DELETED';
- return fiber;
- }
- function createFiberFromPortal(portal, mode, expirationTime) {
- var pendingProps = portal.children !== null ? portal.children : [];
- var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
- fiber.expirationTime = expirationTime;
- fiber.stateNode = {
- containerInfo: portal.containerInfo,
- pendingChildren: null,
-
- implementation: portal.implementation
- };
- return fiber;
- }
- function assignFiberPropertiesInDEV(target, source) {
- if (target === null) {
-
-
- target = createFiber(IndeterminateComponent, null, null, NoMode);
- }
-
-
-
-
- target.tag = source.tag;
- target.key = source.key;
- target.elementType = source.elementType;
- target.type = source.type;
- target.stateNode = source.stateNode;
- target.return = source.return;
- target.child = source.child;
- target.sibling = source.sibling;
- target.index = source.index;
- target.ref = source.ref;
- target.pendingProps = source.pendingProps;
- target.memoizedProps = source.memoizedProps;
- target.updateQueue = source.updateQueue;
- target.memoizedState = source.memoizedState;
- target.dependencies = source.dependencies;
- target.mode = source.mode;
- target.effectTag = source.effectTag;
- target.nextEffect = source.nextEffect;
- target.firstEffect = source.firstEffect;
- target.lastEffect = source.lastEffect;
- target.expirationTime = source.expirationTime;
- target.childExpirationTime = source.childExpirationTime;
- target.alternate = source.alternate;
- {
- target.actualDuration = source.actualDuration;
- target.actualStartTime = source.actualStartTime;
- target.selfBaseDuration = source.selfBaseDuration;
- target.treeBaseDuration = source.treeBaseDuration;
- }
- {
- target._debugID = source._debugID;
- }
- target._debugSource = source._debugSource;
- target._debugOwner = source._debugOwner;
- target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;
- target._debugNeedsRemount = source._debugNeedsRemount;
- target._debugHookTypes = source._debugHookTypes;
- return target;
- }
- function FiberRootNode(containerInfo, tag, hydrate) {
- this.tag = tag;
- this.current = null;
- this.containerInfo = containerInfo;
- this.pendingChildren = null;
- this.pingCache = null;
- this.finishedExpirationTime = NoWork;
- this.finishedWork = null;
- this.timeoutHandle = noTimeout;
- this.context = null;
- this.pendingContext = null;
- this.hydrate = hydrate;
- this.callbackNode = null;
- this.callbackPriority = NoPriority;
- this.firstPendingTime = NoWork;
- this.firstSuspendedTime = NoWork;
- this.lastSuspendedTime = NoWork;
- this.nextKnownPendingLevel = NoWork;
- this.lastPingedTime = NoWork;
- this.lastExpiredTime = NoWork;
- {
- this.interactionThreadID = unstable_getThreadID();
- this.memoizedInteractions = new Set();
- this.pendingInteractionMap = new Map();
- }
- }
- function createFiberRoot(containerInfo, tag, hydrate, hydrationCallbacks) {
- var root = new FiberRootNode(containerInfo, tag, hydrate);
-
- var uninitializedFiber = createHostRootFiber(tag);
- root.current = uninitializedFiber;
- uninitializedFiber.stateNode = root;
- initializeUpdateQueue(uninitializedFiber);
- return root;
- }
- function isRootSuspendedAtTime(root, expirationTime) {
- var firstSuspendedTime = root.firstSuspendedTime;
- var lastSuspendedTime = root.lastSuspendedTime;
- return firstSuspendedTime !== NoWork && firstSuspendedTime >= expirationTime && lastSuspendedTime <= expirationTime;
- }
- function markRootSuspendedAtTime(root, expirationTime) {
- var firstSuspendedTime = root.firstSuspendedTime;
- var lastSuspendedTime = root.lastSuspendedTime;
- if (firstSuspendedTime < expirationTime) {
- root.firstSuspendedTime = expirationTime;
- }
- if (lastSuspendedTime > expirationTime || firstSuspendedTime === NoWork) {
- root.lastSuspendedTime = expirationTime;
- }
- if (expirationTime <= root.lastPingedTime) {
- root.lastPingedTime = NoWork;
- }
- if (expirationTime <= root.lastExpiredTime) {
- root.lastExpiredTime = NoWork;
- }
- }
- function markRootUpdatedAtTime(root, expirationTime) {
-
- var firstPendingTime = root.firstPendingTime;
- if (expirationTime > firstPendingTime) {
- root.firstPendingTime = expirationTime;
- }
-
- var firstSuspendedTime = root.firstSuspendedTime;
- if (firstSuspendedTime !== NoWork) {
- if (expirationTime >= firstSuspendedTime) {
-
- root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork;
- } else if (expirationTime >= root.lastSuspendedTime) {
- root.lastSuspendedTime = expirationTime + 1;
- }
-
- if (expirationTime > root.nextKnownPendingLevel) {
- root.nextKnownPendingLevel = expirationTime;
- }
- }
- }
- function markRootFinishedAtTime(root, finishedExpirationTime, remainingExpirationTime) {
-
- root.firstPendingTime = remainingExpirationTime;
-
- if (finishedExpirationTime <= root.lastSuspendedTime) {
-
- root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork;
- } else if (finishedExpirationTime <= root.firstSuspendedTime) {
-
-
-
- root.firstSuspendedTime = finishedExpirationTime - 1;
- }
- if (finishedExpirationTime <= root.lastPingedTime) {
-
- root.lastPingedTime = NoWork;
- }
- if (finishedExpirationTime <= root.lastExpiredTime) {
-
- root.lastExpiredTime = NoWork;
- }
- }
- function markRootExpiredAtTime(root, expirationTime) {
- var lastExpiredTime = root.lastExpiredTime;
- if (lastExpiredTime === NoWork || lastExpiredTime > expirationTime) {
- root.lastExpiredTime = expirationTime;
- }
- }
- var didWarnAboutNestedUpdates;
- var didWarnAboutFindNodeInStrictMode;
- {
- didWarnAboutNestedUpdates = false;
- didWarnAboutFindNodeInStrictMode = {};
- }
- function getContextForSubtree(parentComponent) {
- if (!parentComponent) {
- return emptyContextObject;
- }
- var fiber = get(parentComponent);
- var parentContext = findCurrentUnmaskedContext(fiber);
- if (fiber.tag === ClassComponent) {
- var Component = fiber.type;
- if (isContextProvider(Component)) {
- return processChildContext(fiber, Component, parentContext);
- }
- }
- return parentContext;
- }
- function findHostInstanceWithWarning(component, methodName) {
- {
- var fiber = get(component);
- if (fiber === undefined) {
- if (typeof component.render === 'function') {
- {
- {
- throw Error( "Unable to find node on an unmounted component." );
- }
- }
- } else {
- {
- {
- throw Error( "Argument appears to not be a ReactComponent. Keys: " + Object.keys(component) );
- }
- }
- }
- }
- var hostFiber = findCurrentHostFiber(fiber);
- if (hostFiber === null) {
- return null;
- }
- if (hostFiber.mode & StrictMode) {
- var componentName = getComponentName(fiber.type) || 'Component';
- if (!didWarnAboutFindNodeInStrictMode[componentName]) {
- didWarnAboutFindNodeInStrictMode[componentName] = true;
- if (fiber.mode & StrictMode) {
- error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
- } else {
- error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
- }
- }
- }
- return hostFiber.stateNode;
- }
- }
- function createContainer(containerInfo, tag, hydrate, hydrationCallbacks) {
- return createFiberRoot(containerInfo, tag, hydrate);
- }
- function updateContainer(element, container, parentComponent, callback) {
- {
- onScheduleRoot(container, element);
- }
- var current$1 = container.current;
- var currentTime = requestCurrentTimeForUpdate();
- {
-
- if ('undefined' !== typeof jest) {
- warnIfUnmockedScheduler(current$1);
- warnIfNotScopedWithMatchingAct(current$1);
- }
- }
- var suspenseConfig = requestCurrentSuspenseConfig();
- var expirationTime = computeExpirationForFiber(currentTime, current$1, suspenseConfig);
- var context = getContextForSubtree(parentComponent);
- if (container.context === null) {
- container.context = context;
- } else {
- container.pendingContext = context;
- }
- {
- if (phase === 'render' && current !== null && !didWarnAboutNestedUpdates) {
- didWarnAboutNestedUpdates = true;
- error('Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');
- }
- }
- var update = createUpdate(expirationTime, suspenseConfig);
-
- update.payload = {
- element: element
- };
- callback = callback === undefined ? null : callback;
- if (callback !== null) {
- {
- if (typeof callback !== 'function') {
- error('render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);
- }
- }
- update.callback = callback;
- }
- enqueueUpdate(current$1, update);
- scheduleWork(current$1, expirationTime);
- return expirationTime;
- }
- function getPublicRootInstance(container) {
- var containerFiber = container.current;
- if (!containerFiber.child) {
- return null;
- }
- switch (containerFiber.child.tag) {
- case HostComponent:
- return getPublicInstance(containerFiber.child.stateNode);
- default:
- return containerFiber.child.stateNode;
- }
- }
- function markRetryTimeImpl(fiber, retryTime) {
- var suspenseState = fiber.memoizedState;
- if (suspenseState !== null && suspenseState.dehydrated !== null) {
- if (suspenseState.retryTime < retryTime) {
- suspenseState.retryTime = retryTime;
- }
- }
- }
- function markRetryTimeIfNotHydrated(fiber, retryTime) {
- markRetryTimeImpl(fiber, retryTime);
- var alternate = fiber.alternate;
- if (alternate) {
- markRetryTimeImpl(alternate, retryTime);
- }
- }
- function attemptUserBlockingHydration$1(fiber) {
- if (fiber.tag !== SuspenseComponent) {
-
-
-
-
- return;
- }
- var expTime = computeInteractiveExpiration(requestCurrentTimeForUpdate());
- scheduleWork(fiber, expTime);
- markRetryTimeIfNotHydrated(fiber, expTime);
- }
- function attemptContinuousHydration$1(fiber) {
- if (fiber.tag !== SuspenseComponent) {
-
-
-
-
- return;
- }
- scheduleWork(fiber, ContinuousHydration);
- markRetryTimeIfNotHydrated(fiber, ContinuousHydration);
- }
- function attemptHydrationAtCurrentPriority$1(fiber) {
- if (fiber.tag !== SuspenseComponent) {
-
-
- return;
- }
- var currentTime = requestCurrentTimeForUpdate();
- var expTime = computeExpirationForFiber(currentTime, fiber, null);
- scheduleWork(fiber, expTime);
- markRetryTimeIfNotHydrated(fiber, expTime);
- }
- function findHostInstanceWithNoPortals(fiber) {
- var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
- if (hostFiber === null) {
- return null;
- }
- if (hostFiber.tag === FundamentalComponent) {
- return hostFiber.stateNode.instance;
- }
- return hostFiber.stateNode;
- }
- var shouldSuspendImpl = function (fiber) {
- return false;
- };
- function shouldSuspend(fiber) {
- return shouldSuspendImpl(fiber);
- }
- var overrideHookState = null;
- var overrideProps = null;
- var scheduleUpdate = null;
- var setSuspenseHandler = null;
- {
- var copyWithSetImpl = function (obj, path, idx, value) {
- if (idx >= path.length) {
- return value;
- }
- var key = path[idx];
- var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);
- updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value);
- return updated;
- };
- var copyWithSet = function (obj, path, value) {
- return copyWithSetImpl(obj, path, 0, value);
- };
- overrideHookState = function (fiber, id, path, value) {
-
-
- var currentHook = fiber.memoizedState;
- while (currentHook !== null && id > 0) {
- currentHook = currentHook.next;
- id--;
- }
- if (currentHook !== null) {
- var newState = copyWithSet(currentHook.memoizedState, path, value);
- currentHook.memoizedState = newState;
- currentHook.baseState = newState;
-
-
-
-
- fiber.memoizedProps = _assign({}, fiber.memoizedProps);
- scheduleWork(fiber, Sync);
- }
- };
- overrideProps = function (fiber, path, value) {
- fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
- if (fiber.alternate) {
- fiber.alternate.pendingProps = fiber.pendingProps;
- }
- scheduleWork(fiber, Sync);
- };
- scheduleUpdate = function (fiber) {
- scheduleWork(fiber, Sync);
- };
- setSuspenseHandler = function (newShouldSuspendImpl) {
- shouldSuspendImpl = newShouldSuspendImpl;
- };
- }
- function injectIntoDevTools(devToolsConfig) {
- var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
- var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
- return injectInternals(_assign({}, devToolsConfig, {
- overrideHookState: overrideHookState,
- overrideProps: overrideProps,
- setSuspenseHandler: setSuspenseHandler,
- scheduleUpdate: scheduleUpdate,
- currentDispatcherRef: ReactCurrentDispatcher,
- findHostInstanceByFiber: function (fiber) {
- var hostFiber = findCurrentHostFiber(fiber);
- if (hostFiber === null) {
- return null;
- }
- return hostFiber.stateNode;
- },
- findFiberByHostInstance: function (instance) {
- if (!findFiberByHostInstance) {
-
- return null;
- }
- return findFiberByHostInstance(instance);
- },
-
- findHostInstancesForRefresh: findHostInstancesForRefresh ,
- scheduleRefresh: scheduleRefresh ,
- scheduleRoot: scheduleRoot ,
- setRefreshHandler: setRefreshHandler ,
-
- getCurrentFiber: function () {
- return current;
- }
- }));
- }
- var IsSomeRendererActing$1 = ReactSharedInternals.IsSomeRendererActing;
- function ReactDOMRoot(container, options) {
- this._internalRoot = createRootImpl(container, ConcurrentRoot, options);
- }
- function ReactDOMBlockingRoot(container, tag, options) {
- this._internalRoot = createRootImpl(container, tag, options);
- }
- ReactDOMRoot.prototype.render = ReactDOMBlockingRoot.prototype.render = function (children) {
- var root = this._internalRoot;
- {
- if (typeof arguments[1] === 'function') {
- error('render(...): does not support the second callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');
- }
- var container = root.containerInfo;
- if (container.nodeType !== COMMENT_NODE) {
- var hostInstance = findHostInstanceWithNoPortals(root.current);
- if (hostInstance) {
- if (hostInstance.parentNode !== container) {
- error('render(...): It looks like the React-rendered content of the ' + 'root container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + "root.unmount() to empty a root's container.");
- }
- }
- }
- }
- updateContainer(children, root, null, null);
- };
- ReactDOMRoot.prototype.unmount = ReactDOMBlockingRoot.prototype.unmount = function () {
- {
- if (typeof arguments[0] === 'function') {
- error('unmount(...): does not support a callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');
- }
- }
- var root = this._internalRoot;
- var container = root.containerInfo;
- updateContainer(null, root, null, function () {
- unmarkContainerAsRoot(container);
- });
- };
- function createRootImpl(container, tag, options) {
-
- var hydrate = options != null && options.hydrate === true;
- var hydrationCallbacks = options != null && options.hydrationOptions || null;
- var root = createContainer(container, tag, hydrate);
- markContainerAsRoot(root.current, container);
- if (hydrate && tag !== LegacyRoot) {
- var doc = container.nodeType === DOCUMENT_NODE ? container : container.ownerDocument;
- eagerlyTrapReplayableEvents(container, doc);
- }
- return root;
- }
- function createLegacyRoot(container, options) {
- return new ReactDOMBlockingRoot(container, LegacyRoot, options);
- }
- function isValidContainer(node) {
- return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));
- }
- var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
- var topLevelUpdateWarnings;
- var warnedAboutHydrateAPI = false;
- {
- topLevelUpdateWarnings = function (container) {
- if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
- var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);
- if (hostInstance) {
- if (hostInstance.parentNode !== container) {
- error('render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.');
- }
- }
- }
- var isRootRenderedBySomeReact = !!container._reactRootContainer;
- var rootEl = getReactRootElementInContainer(container);
- var hasNonRootReactChild = !!(rootEl && getInstanceFromNode$1(rootEl));
- if (hasNonRootReactChild && !isRootRenderedBySomeReact) {
- error('render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.');
- }
- if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') {
- error('render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.');
- }
- };
- }
- function getReactRootElementInContainer(container) {
- if (!container) {
- return null;
- }
- if (container.nodeType === DOCUMENT_NODE) {
- return container.documentElement;
- } else {
- return container.firstChild;
- }
- }
- function shouldHydrateDueToLegacyHeuristic(container) {
- var rootElement = getReactRootElementInContainer(container);
- return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));
- }
- function legacyCreateRootFromDOMContainer(container, forceHydrate) {
- var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container);
- if (!shouldHydrate) {
- var warned = false;
- var rootSibling;
- while (rootSibling = container.lastChild) {
- {
- if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {
- warned = true;
- error('render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');
- }
- }
- container.removeChild(rootSibling);
- }
- }
- {
- if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {
- warnedAboutHydrateAPI = true;
- warn('render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v17. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');
- }
- }
- return createLegacyRoot(container, shouldHydrate ? {
- hydrate: true
- } : undefined);
- }
- function warnOnInvalidCallback$1(callback, callerName) {
- {
- if (callback !== null && typeof callback !== 'function') {
- error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);
- }
- }
- }
- function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
- {
- topLevelUpdateWarnings(container);
- warnOnInvalidCallback$1(callback === undefined ? null : callback, 'render');
- }
-
- var root = container._reactRootContainer;
- var fiberRoot;
- if (!root) {
-
- root = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);
- fiberRoot = root._internalRoot;
- if (typeof callback === 'function') {
- var originalCallback = callback;
- callback = function () {
- var instance = getPublicRootInstance(fiberRoot);
- originalCallback.call(instance);
- };
- }
- unbatchedUpdates(function () {
- updateContainer(children, fiberRoot, parentComponent, callback);
- });
- } else {
- fiberRoot = root._internalRoot;
- if (typeof callback === 'function') {
- var _originalCallback = callback;
- callback = function () {
- var instance = getPublicRootInstance(fiberRoot);
- _originalCallback.call(instance);
- };
- }
- updateContainer(children, fiberRoot, parentComponent, callback);
- }
- return getPublicRootInstance(fiberRoot);
- }
- function findDOMNode(componentOrElement) {
- {
- var owner = ReactCurrentOwner$3.current;
- if (owner !== null && owner.stateNode !== null) {
- var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
- if (!warnedAboutRefsInRender) {
- error('%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner.type) || 'A component');
- }
- owner.stateNode._warnedAboutRefsInRender = true;
- }
- }
- if (componentOrElement == null) {
- return null;
- }
- if (componentOrElement.nodeType === ELEMENT_NODE) {
- return componentOrElement;
- }
- {
- return findHostInstanceWithWarning(componentOrElement, 'findDOMNode');
- }
- }
- function hydrate(element, container, callback) {
- if (!isValidContainer(container)) {
- {
- throw Error( "Target container is not a DOM element." );
- }
- }
- {
- var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;
- if (isModernRoot) {
- error('You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?');
- }
- }
- return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
- }
- function render(element, container, callback) {
- if (!isValidContainer(container)) {
- {
- throw Error( "Target container is not a DOM element." );
- }
- }
- {
- var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;
- if (isModernRoot) {
- error('You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call root.render(element)?');
- }
- }
- return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
- }
- function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
- if (!isValidContainer(containerNode)) {
- {
- throw Error( "Target container is not a DOM element." );
- }
- }
- if (!(parentComponent != null && has$1(parentComponent))) {
- {
- throw Error( "parentComponent must be a valid React Component" );
- }
- }
- return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
- }
- function unmountComponentAtNode(container) {
- if (!isValidContainer(container)) {
- {
- throw Error( "unmountComponentAtNode(...): Target container is not a DOM element." );
- }
- }
- {
- var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;
- if (isModernRoot) {
- error('You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?');
- }
- }
- if (container._reactRootContainer) {
- {
- var rootEl = getReactRootElementInContainer(container);
- var renderedByDifferentReact = rootEl && !getInstanceFromNode$1(rootEl);
- if (renderedByDifferentReact) {
- error("unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.');
- }
- }
- unbatchedUpdates(function () {
- legacyRenderSubtreeIntoContainer(null, null, container, false, function () {
-
- container._reactRootContainer = null;
- unmarkContainerAsRoot(container);
- });
- });
-
- return true;
- } else {
- {
- var _rootEl = getReactRootElementInContainer(container);
- var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode$1(_rootEl));
- var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;
- if (hasNonRootReactChild) {
- error("unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.');
- }
- }
- return false;
- }
- }
- function createPortal(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
- implementation) {
- var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
- return {
-
- $$typeof: REACT_PORTAL_TYPE,
- key: key == null ? null : '' + key,
- children: children,
- containerInfo: containerInfo,
- implementation: implementation
- };
- }
- var ReactVersion = '16.13.0';
- setAttemptUserBlockingHydration(attemptUserBlockingHydration$1);
- setAttemptContinuousHydration(attemptContinuousHydration$1);
- setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
- var didWarnAboutUnstableCreatePortal = false;
- {
- if (typeof Map !== 'function' ||
- Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' ||
- Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {
- error('React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
- }
- }
- setRestoreImplementation(restoreControlledState$3);
- setBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);
- function createPortal$1(children, container) {
- var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
- if (!isValidContainer(container)) {
- {
- throw Error( "Target container is not a DOM element." );
- }
- }
-
- return createPortal(children, container, null, key);
- }
- function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
- return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);
- }
- function unstable_createPortal(children, container) {
- var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
- {
- if (!didWarnAboutUnstableCreatePortal) {
- didWarnAboutUnstableCreatePortal = true;
- warn('The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the "unstable_" prefix.');
- }
- }
- return createPortal$1(children, container, key);
- }
- var Internals = {
-
-
- Events: [getInstanceFromNode$1, getNodeFromInstance$1, getFiberCurrentPropsFromNode$1, injectEventPluginsByName, eventNameDispatchConfigs, accumulateTwoPhaseDispatches, accumulateDirectDispatches, enqueueStateRestore, restoreStateIfNeeded, dispatchEvent, runEventsInBatch, flushPassiveEffects, IsThisRendererActing]
- };
- var foundDevTools = injectIntoDevTools({
- findFiberByHostInstance: getClosestInstanceFromNode,
- bundleType: 1 ,
- version: ReactVersion,
- rendererPackageName: 'react-dom'
- });
- {
- if (!foundDevTools && canUseDOM && window.top === window.self) {
-
- if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
- var protocol = window.location.protocol;
- if (/^(https?|file):$/.test(protocol)) {
-
- console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://fb.me/react-devtools' + (protocol === 'file:' ? '\nYou might need to use a local HTTP server (instead of file://): ' + 'https://fb.me/react-devtools-faq' : ''), 'font-weight:bold');
- }
- }
- }
- }
- exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
- exports.createPortal = createPortal$1;
- exports.findDOMNode = findDOMNode;
- exports.flushSync = flushSync;
- exports.hydrate = hydrate;
- exports.render = render;
- exports.unmountComponentAtNode = unmountComponentAtNode;
- exports.unstable_batchedUpdates = batchedUpdates$1;
- exports.unstable_createPortal = unstable_createPortal;
- exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;
- exports.version = ReactVersion;
- })));
|