diff --git a/lib/nutalk.hoon b/lib/nutalk.hoon index 8bedea7c7b..67a446aadf 100644 --- a/lib/nutalk.hoon +++ b/lib/nutalk.hoon @@ -11,19 +11,16 @@ ;div.container.header-container ;div.row ;div.col-sm-1 - ;a/"menu" + ;a/"/~~/pages/nutalk/menu" ;div.panini; == == ;div.col-sm-1 - ;div.liang; - == - ;div.col-sm-1 - ;h3.underline.text-gray - ;a/"/~~/pages/nutalk": Inbox + ;a/"/~~/pages/nutalk" + ;div.liang; == == - ;div(urb-component-header ""); + ;div.col-sm-10(urb-component-header ""); == == ;div.container diff --git a/ren/urb.hoon b/ren/urb.hoon index 3f61b3059d..8dac319c33 100644 --- a/ren/urb.hoon +++ b/ren/urb.hoon @@ -5,7 +5,14 @@ nutalk ::FIXME write ren/urb/nutalk /% /^ {hed/{@uvH marl} bod/{@uvH marl}} /, /web/pages/nutalk - /; urb-split /# /; nutalk /!htm/ + ::/; urb-split /# /; nutalk /!htm/ + /; |= {dep/@uvH urb/manx} ^- {hed/{@uvh marl} bod/{@uvH marl}} + ~| [%malformed-urb urb] :: XX types + ?> ?=({{$html $~} {{$head $~} *} {{$body $~} *} $~} urb) + =+ `{{$html $~} {{$head $~} hed/marl} {{$body $~} bod/marl} $~}`urb + :- [0v0 hed] + [0v0 bod] + /# /; nutalk /|(/!htm/ /htm/) ::a lot of stuff in here isn't .hoon files /web/pages /; urb-split /# /!hymn/ /web/collections diff --git a/web/pages/nutalk/css/index.css b/web/pages/nutalk/css/index.css index 1c3bf4fed6..2ccda5aa8c 100644 --- a/web/pages/nutalk/css/index.css +++ b/web/pages/nutalk/css/index.css @@ -1,2 +1,2 @@ @charset "UTF-8"; -/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}[class*=col-]{width:100%;margin-bottom:1rem}.container{margin:0 auto;padding:0 2rem;max-width:960px}.row{display:flex;margin-right:-.5rem;margin-left:-.5rem}.flex,.row{flex-wrap:wrap}.align-vertical{align-items:center}.justify-center{justify-content:center}@media only screen and (min-width:0){.col-sm,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12{box-sizing:border-box;flex:0 0 auto;padding-right:.5rem;padding-left:.5rem}.col-sm{flex-grow:1;flex-basis:0;max-width:100%}.col-sm-1{flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{flex-basis:25%;max-width:25%}.col-sm-4{flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{flex-basis:50%;max-width:50%}.col-sm-7{flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{flex-basis:75%;max-width:75%}.col-sm-10{flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}}@media only screen and (min-width:480px){.col-md,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-md-offset-0,.col-md-offset-1,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12{box-sizing:border-box;flex:0 0 auto;padding-right:.5rem;padding-left:.5rem}.col-md{flex-grow:1;flex-basis:0;max-width:100%}.col-md-1{flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{flex-basis:25%;max-width:25%}.col-md-4{flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{flex-basis:50%;max-width:50%}.col-md-7{flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{flex-basis:75%;max-width:75%}.col-md-10{flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}}@media only screen and (min-width:960px){.col-lg,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12{box-sizing:border-box;flex:0 0 auto;padding-right:.5rem;padding-left:.5rem}.col-lg{flex-grow:1;flex-basis:0;max-width:100%}.col-lg-1{flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{flex-basis:25%;max-width:25%}.col-lg-4{flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{flex-basis:50%;max-width:50%}.col-lg-7{flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{flex-basis:75%;max-width:75%}.col-lg-10{flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-Thin.ttf) format("truetype");font-weight:100}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-ExtraLight.ttf) format("truetype");font-weight:200}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-Light.ttf) format("truetype");font-weight:300}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-Regular.ttf) format("truetype");font-weight:400}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-Medium.ttf) format("truetype");font-weight:500}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-SemiBold.ttf) format("truetype");font-weight:600}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-Bold.ttf) format("truetype");font-weight:700}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-ExtraBold.ttf) format("truetype");font-weight:800}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-Black.ttf) format("truetype");font-weight:900}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-extralight.woff);font-weight:200}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-light.woff);font-weight:300}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-regular.woff);font-weight:400}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-medium.woff);font-weight:500}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-bold.woff);font-weight:600}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-black.woff);font-weight:700}*{font-smoothing:antialiased;-webkit-font-smoothing:antialiased}body{font-family:-apple-system,BlinkMacSystemFont,Roboto,Helvetica,Arial,sans-serif;font-size:4rem;line-height:6rem;color:#373a3c}a{color:#000}p{margin:0 0 2rem}.text-heading,h1,h2,h3,h4,h5{margin:0;font-family:Work Sans;color:#373a3c}.h1,h1{font-size:12rem;line-height:16rem;margin:4rem 0}.h1,.h2,h1,h2{font-weight:600}.h2,h2{font-size:9rem;line-height:13rem;margin:3rem 0}.h3,h3{font-size:6rem;font-weight:600;line-height:8rem;margin:2rem 0}.h4,h4{font-weight:600}.h4,.h5,h4,h5{font-size:5rem;line-height:7rem;margin:1rem 0}.h5,h5{font-weight:500}.text-sm,caption{font-size:3rem;line-height:5rem}.text-md{font-size:4rem;line-height:6rem}.text-lg{font-size:5rem;line-height:7rem}code,pre{background-color:#f1f1f1;padding:1rem}.text-code,.text-mono,code,pre{font-family:Source Code Pro,Roboto mono,Courier New,monospace}.text-code{color:#000}.code-block,.text-code{background-color:#f1f1f1}.code-block{padding:5rem;white-space:pre-wrap}.code-block .text-code{font-weight:200}.underline,u{text-decoration:underline}.strikethrough,s{text-decoration:line-through}.italic,em{font-style:italic}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.text-300{font-weight:300}.text-400{font-weight:400}.text-500{font-weight:500}.text-600{font-weight:600}.text-700,b{font-weight:700}.text-800{font-weight:800}.h-font{font-family:Work Sans}.blue{color:#4330fc}.green{color:#6fdc74}.red{color:#ee3124}.gray-lighter{color:#f1f1f1}.gray-light{color:#d4d4d4}.gray{color:#5b5b5b}.gray-dark{color:#373a3c}.blue-hl{background-color:#4330fc;color:#fff}.green-hl{background-color:#6fdc74;color:#fff}.red-hl{background-color:#ee3124;color:#fff}.gray-lighter-hl{background-color:#f1f1f1;color:#fff}.gray-light-hl{background-color:#d4d4d4;color:#fff}.gray-hl{background-color:#5b5b5b;color:#fff}.gray-dark-hl{background-color:#373a3c;color:#fff}.black-hl{background-color:#000;color:#fff}.center{text-align:center}.right{text-align:right}.justify{text-align:justify}button{border:none;outline:none}.btn,button{font-family:Work Sans,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:500;font-size:4rem;line-height:4rem;padding:3rem 6rem;color:#000;background-color:#d4d4d4;margin:0 0 6px}.btn-sm{font-size:3rem;line-height:3rem;padding:2rem 4rem}.btn-primary{background-color:#4330fc;color:#fff}.btn-secondary{background-color:#6fdc74}.btn-tetiary{background-color:#5b5b5b;color:#fff}.btn-warning{background-color:#ee3124;color:#fff}.btn-group .btn{display:inline-block}.btn-group .btn:not(.active){background-color:#d4d4d4;color:#000}label{display:block;font-weight:700}input[type=text],textarea{border:2px solid #000;padding:12px;width:100%}.error-label{display:none;color:#f44;font-size:2.33rem;line-height:3rem;margin-top:1rem}.input-group{margin:0 0 2rem}.input-group.error input[type=text],.input-group.error textarea{border:.5rem solid #f44}.input-group.error .error-label{display:block}.checkbox-group input,.checkbox-group label,.radio-group input,.radio-group label{font-weight:400;display:inline-block}.select-dropdown{display:flex;border:2px solid #000;overflow:hidden}.select-dropdown select{padding:5px 8px;width:130%;border:none;box-shadow:none;background:transparent;background-image:none;-webkit-appearance:none}.select-dropdown select:focus{outline:none}.select-dropdown .triangle-down{border-width:2rem 1rem 0;position:relative;top:14px;right:8px}.icon-arrow-right:before{content:"→"}.icon-arrow-left:before{content:"←"}.icon-arrow-up:before{content:"↑"}.icon-arrow-down:before{content:"↓"}.icon-cross:before{content:"×"}.icon-ellipsis:before{content:"...";position:relative;bottom:6px}.selected:before{content:"∙"}.icon{margin-right:.6rem}.icon.prev{width:1px;height:1px;border:12.0006px solid transparent;border-right:18px solid #000;border-left:0 solid transparent}.icon.next{border:12.0006px solid transparent;border-left:18px solid #000;border-right:0 solid transparent;margin-right:0}.icon.next,.icon.up{width:1px;height:1px}.icon.up{border:12.0006px solid transparent;border-bottom:18px solid #000;border-top:0 solid transparent}.circle{display:inline-block;padding:2rem;border-radius:50%;border:2px solid #000;text-align:center}.circle-sm{padding:1rem}.circle-lg{padding:4rem}.circle-fill{background-color:#000}.circle-red{background-color:#ee3124;border-color:#ee3124}.circle-blue{background-color:#4330fc;border-color:#4330fc}.circle-blue-light{background-color:#a4d8e8;border-color:#a4d8e8}.circle-yellow{background-color:#ffc440;border-color:#ffc440}.circle-green{background-color:#6fdc74;border-color:#6fdc74}.circle-gray{background-color:#5b5b5b;border-color:#5b5b5b}.circle-gray-light{background-color:#d4d4d4;border-color:#d4d4d4}.circle-gray-lighter{background-color:#f1f1f1;border-color:#f1f1f1}.circle-gray-dark{background-color:#373a3c;border-color:#373a3c}.circle-pill{border-radius:9999px;width:10rem}.circle-pill.circle-lg{width:20rem}.square{display:inline-block;padding:2rem;border:2px solid #000;text-align:center}.square-sm{padding:1rem}.square-lg{padding:4rem}.square-fill{background-color:#000}.square-red{background-color:red;border-color:red}.square-rect{width:10rem}.square-rect.square-lg{width:20rem}.triangle-base{display:inline-block;width:0;height:0}.triangle-up{border-bottom:4rem solid #000}.triangle-down,.triangle-up{border-left:2rem solid transparent;border-right:2rem solid transparent}.triangle-down{border-top:4rem solid #000}.triangle-right{border-left:4rem solid #000}.triangle-left,.triangle-right{border-top:2rem solid transparent;border-bottom:2rem solid transparent}.triangle-left{border-right:4rem solid #000}.urbit-logo{width:72px;height:72px;border-radius:50%;border:5px solid #fff;background-color:transparent}.urbit-logo,.urbit-logo:before{display:inline-block;vertical-align:middle}.urbit-logo:before{content:"~";color:#fff;font-size:72px;line-height:54px;text-align:center;width:2rem;font-family:Work Sans;font-weight:600;margin-right:30px;margin-top:3px}.urbit-logo-solid{border-color:#000}.urbit-logo-solid:before{color:#000}section{margin:0 0 2rem;border:none}blockquote{border-left:6px solid #000;margin:24px 0;padding-left:18px}hr{margin:4rem 0;width:100%;height:1rem;border:0;background-color:#373a3c}ul{padding-left:4rem;list-style:disc outside}ul li{margin-bottom:2rem;padding-left:2rem}ol ul,ul ol,ul ul{margin:2rem}ol ul li,ul ol li,ul ul li{margin-bottom:1rem}ul.list-reset{list-style:none}ol,ul.list-reset,ul.list-reset li{padding-left:0}ol{list-style:none}ol>li{counter-increment:a;margin-left:0;margin-bottom:1rem}ol>li:before{content:counter(a);font-weight:700;vertical-align:center;display:inline-block;width:6rem;text-align:left}.w-0{width:0!important}.h-0{height:0!important}.m-0{margin:0!important}.mt-0{margin-top:0!important}.mb-0{margin-bottom:0!important}.ml-0{margin-left:0!important}.mr-0{margin-right:0!important}.p-0{padding:0!important}.pt-0{padding-top:0!important}.pb-0{padding-bottom:0!important}.pl-0{padding-left:0!important}.pr-0{padding-right:0!important}.w-1{width:1rem!important}.h-1{height:1rem!important}.m-1{margin:1rem!important}.mt-1{margin-top:1rem!important}.mb-1{margin-bottom:1rem!important}.ml-1{margin-left:1rem!important}.mr-1{margin-right:1rem!important}.p-1{padding:1rem!important}.pt-1{padding-top:1rem!important}.pb-1{padding-bottom:1rem!important}.pl-1{padding-left:1rem!important}.pr-1{padding-right:1rem!important}.w-2{width:2rem!important}.h-2{height:2rem!important}.m-2{margin:2rem!important}.mt-2{margin-top:2rem!important}.mb-2{margin-bottom:2rem!important}.ml-2{margin-left:2rem!important}.mr-2{margin-right:2rem!important}.p-2{padding:2rem!important}.pt-2{padding-top:2rem!important}.pb-2{padding-bottom:2rem!important}.pl-2{padding-left:2rem!important}.pr-2{padding-right:2rem!important}.w-3{width:3rem!important}.h-3{height:3rem!important}.m-3{margin:3rem!important}.mt-3{margin-top:3rem!important}.mb-3{margin-bottom:3rem!important}.ml-3{margin-left:3rem!important}.mr-3{margin-right:3rem!important}.p-3{padding:3rem!important}.pt-3{padding-top:3rem!important}.pb-3{padding-bottom:3rem!important}.pl-3{padding-left:3rem!important}.pr-3{padding-right:3rem!important}.w-4{width:4rem!important}.h-4{height:4rem!important}.m-4{margin:4rem!important}.mt-4{margin-top:4rem!important}.mb-4{margin-bottom:4rem!important}.ml-4{margin-left:4rem!important}.mr-4{margin-right:4rem!important}.p-4{padding:4rem!important}.pt-4{padding-top:4rem!important}.pb-4{padding-bottom:4rem!important}.pl-4{padding-left:4rem!important}.pr-4{padding-right:4rem!important}.w-5{width:5rem!important}.h-5{height:5rem!important}.m-5{margin:5rem!important}.mt-5{margin-top:5rem!important}.mb-5{margin-bottom:5rem!important}.ml-5{margin-left:5rem!important}.mr-5{margin-right:5rem!important}.p-5{padding:5rem!important}.pt-5{padding-top:5rem!important}.pb-5{padding-bottom:5rem!important}.pl-5{padding-left:5rem!important}.pr-5{padding-right:5rem!important}.w-6{width:6rem!important}.h-6{height:6rem!important}.m-6{margin:6rem!important}.mt-6{margin-top:6rem!important}.mb-6{margin-bottom:6rem!important}.ml-6{margin-left:6rem!important}.mr-6{margin-right:6rem!important}.p-6{padding:6rem!important}.pt-6{padding-top:6rem!important}.pb-6{padding-bottom:6rem!important}.pl-6{padding-left:6rem!important}.pr-6{padding-right:6rem!important}.w-7{width:7rem!important}.h-7{height:7rem!important}.m-7{margin:7rem!important}.mt-7{margin-top:7rem!important}.mb-7{margin-bottom:7rem!important}.ml-7{margin-left:7rem!important}.mr-7{margin-right:7rem!important}.p-7{padding:7rem!important}.pt-7{padding-top:7rem!important}.pb-7{padding-bottom:7rem!important}.pl-7{padding-left:7rem!important}.pr-7{padding-right:7rem!important}.w-8{width:8rem!important}.h-8{height:8rem!important}.m-8{margin:8rem!important}.mt-8{margin-top:8rem!important}.mb-8{margin-bottom:8rem!important}.ml-8{margin-left:8rem!important}.mr-8{margin-right:8rem!important}.p-8{padding:8rem!important}.pt-8{padding-top:8rem!important}.pb-8{padding-bottom:8rem!important}.pl-8{padding-left:8rem!important}.pr-8{padding-right:8rem!important}.w-9{width:9rem!important}.h-9{height:9rem!important}.m-9{margin:9rem!important}.mt-9{margin-top:9rem!important}.mb-9{margin-bottom:9rem!important}.ml-9{margin-left:9rem!important}.mr-9{margin-right:9rem!important}.p-9{padding:9rem!important}.pt-9{padding-top:9rem!important}.pb-9{padding-bottom:9rem!important}.pl-9{padding-left:9rem!important}.pr-9{padding-right:9rem!important}.w-10{width:10rem!important}.h-10{height:10rem!important}.m-10{margin:10rem!important}.mt-10{margin-top:10rem!important}.mb-10{margin-bottom:10rem!important}.ml-10{margin-left:10rem!important}.mr-10{margin-right:10rem!important}.p-10{padding:10rem!important}.pt-10{padding-top:10rem!important}.pb-10{padding-bottom:10rem!important}.pl-10{padding-left:10rem!important}.pr-10{padding-right:10rem!important}.w-11{width:11rem!important}.h-11{height:11rem!important}.m-11{margin:11rem!important}.mt-11{margin-top:11rem!important}.mb-11{margin-bottom:11rem!important}.ml-11{margin-left:11rem!important}.mr-11{margin-right:11rem!important}.p-11{padding:11rem!important}.pt-11{padding-top:11rem!important}.pb-11{padding-bottom:11rem!important}.pl-11{padding-left:11rem!important}.pr-11{padding-right:11rem!important}.w-12{width:12rem!important}.h-12{height:12rem!important}.m-12{margin:12rem!important}.mt-12{margin-top:12rem!important}.mb-12{margin-bottom:12rem!important}.ml-12{margin-left:12rem!important}.mr-12{margin-right:12rem!important}.p-12{padding:12rem!important}.pt-12{padding-top:12rem!important}.pb-12{padding-bottom:12rem!important}.pl-12{padding-left:12rem!important}.pr-12{padding-right:12rem!important}.w-13{width:13rem!important}.h-13{height:13rem!important}.m-13{margin:13rem!important}.mt-13{margin-top:13rem!important}.mb-13{margin-bottom:13rem!important}.ml-13{margin-left:13rem!important}.mr-13{margin-right:13rem!important}.p-13{padding:13rem!important}.pt-13{padding-top:13rem!important}.pb-13{padding-bottom:13rem!important}.pl-13{padding-left:13rem!important}.pr-13{padding-right:13rem!important}.w-14{width:14rem!important}.h-14{height:14rem!important}.m-14{margin:14rem!important}.mt-14{margin-top:14rem!important}.mb-14{margin-bottom:14rem!important}.ml-14{margin-left:14rem!important}.mr-14{margin-right:14rem!important}.p-14{padding:14rem!important}.pt-14{padding-top:14rem!important}.pb-14{padding-bottom:14rem!important}.pl-14{padding-left:14rem!important}.pr-14{padding-right:14rem!important}.w-15{width:15rem!important}.h-15{height:15rem!important}.m-15{margin:15rem!important}.mt-15{margin-top:15rem!important}.mb-15{margin-bottom:15rem!important}.ml-15{margin-left:15rem!important}.mr-15{margin-right:15rem!important}.p-15{padding:15rem!important}.pt-15{padding-top:15rem!important}.pb-15{padding-bottom:15rem!important}.pl-15{padding-left:15rem!important}.pr-15{padding-right:15rem!important}.w-16{width:16rem!important}.h-16{height:16rem!important}.m-16{margin:16rem!important}.mt-16{margin-top:16rem!important}.mb-16{margin-bottom:16rem!important}.ml-16{margin-left:16rem!important}.mr-16{margin-right:16rem!important}.p-16{padding:16rem!important}.pt-16{padding-top:16rem!important}.pb-16{padding-bottom:16rem!important}.pl-16{padding-left:16rem!important}.pr-16{padding-right:16rem!important}.w-17{width:17rem!important}.h-17{height:17rem!important}.m-17{margin:17rem!important}.mt-17{margin-top:17rem!important}.mb-17{margin-bottom:17rem!important}.ml-17{margin-left:17rem!important}.mr-17{margin-right:17rem!important}.p-17{padding:17rem!important}.pt-17{padding-top:17rem!important}.pb-17{padding-bottom:17rem!important}.pl-17{padding-left:17rem!important}.pr-17{padding-right:17rem!important}.w-18{width:18rem!important}.h-18{height:18rem!important}.m-18{margin:18rem!important}.mt-18{margin-top:18rem!important}.mb-18{margin-bottom:18rem!important}.ml-18{margin-left:18rem!important}.mr-18{margin-right:18rem!important}.p-18{padding:18rem!important}.pt-18{padding-top:18rem!important}.pb-18{padding-bottom:18rem!important}.pl-18{padding-left:18rem!important}.pr-18{padding-right:18rem!important}.w-19{width:19rem!important}.h-19{height:19rem!important}.m-19{margin:19rem!important}.mt-19{margin-top:19rem!important}.mb-19{margin-bottom:19rem!important}.ml-19{margin-left:19rem!important}.mr-19{margin-right:19rem!important}.p-19{padding:19rem!important}.pt-19{padding-top:19rem!important}.pb-19{padding-bottom:19rem!important}.pl-19{padding-left:19rem!important}.pr-19{padding-right:19rem!important}.w-20{width:20rem!important}.h-20{height:20rem!important}.m-20{margin:20rem!important}.mt-20{margin-top:20rem!important}.mb-20{margin-bottom:20rem!important}.ml-20{margin-left:20rem!important}.mr-20{margin-right:20rem!important}.p-20{padding:20rem!important}.pt-20{padding-top:20rem!important}.pb-20{padding-bottom:20rem!important}.pl-20{padding-left:20rem!important}.pr-20{padding-right:20rem!important}.w-21{width:21rem!important}.h-21{height:21rem!important}.m-21{margin:21rem!important}.mt-21{margin-top:21rem!important}.mb-21{margin-bottom:21rem!important}.ml-21{margin-left:21rem!important}.mr-21{margin-right:21rem!important}.p-21{padding:21rem!important}.pt-21{padding-top:21rem!important}.pb-21{padding-bottom:21rem!important}.pl-21{padding-left:21rem!important}.pr-21{padding-right:21rem!important}.w-22{width:22rem!important}.h-22{height:22rem!important}.m-22{margin:22rem!important}.mt-22{margin-top:22rem!important}.mb-22{margin-bottom:22rem!important}.ml-22{margin-left:22rem!important}.mr-22{margin-right:22rem!important}.p-22{padding:22rem!important}.pt-22{padding-top:22rem!important}.pb-22{padding-bottom:22rem!important}.pl-22{padding-left:22rem!important}.pr-22{padding-right:22rem!important}.w-23{width:23rem!important}.h-23{height:23rem!important}.m-23{margin:23rem!important}.mt-23{margin-top:23rem!important}.mb-23{margin-bottom:23rem!important}.ml-23{margin-left:23rem!important}.mr-23{margin-right:23rem!important}.p-23{padding:23rem!important}.pt-23{padding-top:23rem!important}.pb-23{padding-bottom:23rem!important}.pl-23{padding-left:23rem!important}.pr-23{padding-right:23rem!important}.w-24{width:24rem!important}.h-24{height:24rem!important}.m-24{margin:24rem!important}.mt-24{margin-top:24rem!important}.mb-24{margin-bottom:24rem!important}.ml-24{margin-left:24rem!important}.mr-24{margin-right:24rem!important}.p-24{padding:24rem!important}.pt-24{padding-top:24rem!important}.pb-24{padding-bottom:24rem!important}.pl-24{padding-left:24rem!important}.pr-24{padding-right:24rem!important}.w-25{width:25rem!important}.h-25{height:25rem!important}.m-25{margin:25rem!important}.mt-25{margin-top:25rem!important}.mb-25{margin-bottom:25rem!important}.ml-25{margin-left:25rem!important}.mr-25{margin-right:25rem!important}.p-25{padding:25rem!important}.pt-25{padding-top:25rem!important}.pb-25{padding-bottom:25rem!important}.pl-25{padding-left:25rem!important}.pr-25{padding-right:25rem!important}.w-26{width:26rem!important}.h-26{height:26rem!important}.m-26{margin:26rem!important}.mt-26{margin-top:26rem!important}.mb-26{margin-bottom:26rem!important}.ml-26{margin-left:26rem!important}.mr-26{margin-right:26rem!important}.p-26{padding:26rem!important}.pt-26{padding-top:26rem!important}.pb-26{padding-bottom:26rem!important}.pl-26{padding-left:26rem!important}.pr-26{padding-right:26rem!important}.w-27{width:27rem!important}.h-27{height:27rem!important}.m-27{margin:27rem!important}.mt-27{margin-top:27rem!important}.mb-27{margin-bottom:27rem!important}.ml-27{margin-left:27rem!important}.mr-27{margin-right:27rem!important}.p-27{padding:27rem!important}.pt-27{padding-top:27rem!important}.pb-27{padding-bottom:27rem!important}.pl-27{padding-left:27rem!important}.pr-27{padding-right:27rem!important}.w-28{width:28rem!important}.h-28{height:28rem!important}.m-28{margin:28rem!important}.mt-28{margin-top:28rem!important}.mb-28{margin-bottom:28rem!important}.ml-28{margin-left:28rem!important}.mr-28{margin-right:28rem!important}.p-28{padding:28rem!important}.pt-28{padding-top:28rem!important}.pb-28{padding-bottom:28rem!important}.pl-28{padding-left:28rem!important}.pr-28{padding-right:28rem!important}.w-29{width:29rem!important}.h-29{height:29rem!important}.m-29{margin:29rem!important}.mt-29{margin-top:29rem!important}.mb-29{margin-bottom:29rem!important}.ml-29{margin-left:29rem!important}.mr-29{margin-right:29rem!important}.p-29{padding:29rem!important}.pt-29{padding-top:29rem!important}.pb-29{padding-bottom:29rem!important}.pl-29{padding-left:29rem!important}.pr-29{padding-right:29rem!important}.w-30{width:30rem!important}.h-30{height:30rem!important}.m-30{margin:30rem!important}.mt-30{margin-top:30rem!important}.mb-30{margin-bottom:30rem!important}.ml-30{margin-left:30rem!important}.mr-30{margin-right:30rem!important}.p-30{padding:30rem!important}.pt-30{padding-top:30rem!important}.pb-30{padding-bottom:30rem!important}.pl-30{padding-left:30rem!important}.pr-30{padding-right:30rem!important}.w-31{width:31rem!important}.h-31{height:31rem!important}.m-31{margin:31rem!important}.mt-31{margin-top:31rem!important}.mb-31{margin-bottom:31rem!important}.ml-31{margin-left:31rem!important}.mr-31{margin-right:31rem!important}.p-31{padding:31rem!important}.pt-31{padding-top:31rem!important}.pb-31{padding-bottom:31rem!important}.pl-31{padding-left:31rem!important}.pr-31{padding-right:31rem!important}.w-32{width:32rem!important}.h-32{height:32rem!important}.m-32{margin:32rem!important}.mt-32{margin-top:32rem!important}.mb-32{margin-bottom:32rem!important}.ml-32{margin-left:32rem!important}.mr-32{margin-right:32rem!important}.p-32{padding:32rem!important}.pt-32{padding-top:32rem!important}.pb-32{padding-bottom:32rem!important}.pl-32{padding-left:32rem!important}.pr-32{padding-right:32rem!important}.w-33{width:33rem!important}.h-33{height:33rem!important}.m-33{margin:33rem!important}.mt-33{margin-top:33rem!important}.mb-33{margin-bottom:33rem!important}.ml-33{margin-left:33rem!important}.mr-33{margin-right:33rem!important}.p-33{padding:33rem!important}.pt-33{padding-top:33rem!important}.pb-33{padding-bottom:33rem!important}.pl-33{padding-left:33rem!important}.pr-33{padding-right:33rem!important}.w-34{width:34rem!important}.h-34{height:34rem!important}.m-34{margin:34rem!important}.mt-34{margin-top:34rem!important}.mb-34{margin-bottom:34rem!important}.ml-34{margin-left:34rem!important}.mr-34{margin-right:34rem!important}.p-34{padding:34rem!important}.pt-34{padding-top:34rem!important}.pb-34{padding-bottom:34rem!important}.pl-34{padding-left:34rem!important}.pr-34{padding-right:34rem!important}.w-35{width:35rem!important}.h-35{height:35rem!important}.m-35{margin:35rem!important}.mt-35{margin-top:35rem!important}.mb-35{margin-bottom:35rem!important}.ml-35{margin-left:35rem!important}.mr-35{margin-right:35rem!important}.p-35{padding:35rem!important}.pt-35{padding-top:35rem!important}.pb-35{padding-bottom:35rem!important}.pl-35{padding-left:35rem!important}.pr-35{padding-right:35rem!important}.w-36{width:36rem!important}.h-36{height:36rem!important}.m-36{margin:36rem!important}.mt-36{margin-top:36rem!important}.mb-36{margin-bottom:36rem!important}.ml-36{margin-left:36rem!important}.mr-36{margin-right:36rem!important}.p-36{padding:36rem!important}.pt-36{padding-top:36rem!important}.pb-36{padding-bottom:36rem!important}.pl-36{padding-left:36rem!important}.pr-36{padding-right:36rem!important}.w-37{width:37rem!important}.h-37{height:37rem!important}.m-37{margin:37rem!important}.mt-37{margin-top:37rem!important}.mb-37{margin-bottom:37rem!important}.ml-37{margin-left:37rem!important}.mr-37{margin-right:37rem!important}.p-37{padding:37rem!important}.pt-37{padding-top:37rem!important}.pb-37{padding-bottom:37rem!important}.pl-37{padding-left:37rem!important}.pr-37{padding-right:37rem!important}.w-38{width:38rem!important}.h-38{height:38rem!important}.m-38{margin:38rem!important}.mt-38{margin-top:38rem!important}.mb-38{margin-bottom:38rem!important}.ml-38{margin-left:38rem!important}.mr-38{margin-right:38rem!important}.p-38{padding:38rem!important}.pt-38{padding-top:38rem!important}.pb-38{padding-bottom:38rem!important}.pl-38{padding-left:38rem!important}.pr-38{padding-right:38rem!important}.w-39{width:39rem!important}.h-39{height:39rem!important}.m-39{margin:39rem!important}.mt-39{margin-top:39rem!important}.mb-39{margin-bottom:39rem!important}.ml-39{margin-left:39rem!important}.mr-39{margin-right:39rem!important}.p-39{padding:39rem!important}.pt-39{padding-top:39rem!important}.pb-39{padding-bottom:39rem!important}.pl-39{padding-left:39rem!important}.pr-39{padding-right:39rem!important}.w-40{width:40rem!important}.h-40{height:40rem!important}.m-40{margin:40rem!important}.mt-40{margin-top:40rem!important}.mb-40{margin-bottom:40rem!important}.ml-40{margin-left:40rem!important}.mr-40{margin-right:40rem!important}.p-40{padding:40rem!important}.pt-40{padding-top:40rem!important}.pb-40{padding-bottom:40rem!important}.pl-40{padding-left:40rem!important}.pr-40{padding-right:40rem!important}.w-41{width:41rem!important}.h-41{height:41rem!important}.m-41{margin:41rem!important}.mt-41{margin-top:41rem!important}.mb-41{margin-bottom:41rem!important}.ml-41{margin-left:41rem!important}.mr-41{margin-right:41rem!important}.p-41{padding:41rem!important}.pt-41{padding-top:41rem!important}.pb-41{padding-bottom:41rem!important}.pl-41{padding-left:41rem!important}.pr-41{padding-right:41rem!important}.w-42{width:42rem!important}.h-42{height:42rem!important}.m-42{margin:42rem!important}.mt-42{margin-top:42rem!important}.mb-42{margin-bottom:42rem!important}.ml-42{margin-left:42rem!important}.mr-42{margin-right:42rem!important}.p-42{padding:42rem!important}.pt-42{padding-top:42rem!important}.pb-42{padding-bottom:42rem!important}.pl-42{padding-left:42rem!important}.pr-42{padding-right:42rem!important}.w-43{width:43rem!important}.h-43{height:43rem!important}.m-43{margin:43rem!important}.mt-43{margin-top:43rem!important}.mb-43{margin-bottom:43rem!important}.ml-43{margin-left:43rem!important}.mr-43{margin-right:43rem!important}.p-43{padding:43rem!important}.pt-43{padding-top:43rem!important}.pb-43{padding-bottom:43rem!important}.pl-43{padding-left:43rem!important}.pr-43{padding-right:43rem!important}.w-44{width:44rem!important}.h-44{height:44rem!important}.m-44{margin:44rem!important}.mt-44{margin-top:44rem!important}.mb-44{margin-bottom:44rem!important}.ml-44{margin-left:44rem!important}.mr-44{margin-right:44rem!important}.p-44{padding:44rem!important}.pt-44{padding-top:44rem!important}.pb-44{padding-bottom:44rem!important}.pl-44{padding-left:44rem!important}.pr-44{padding-right:44rem!important}.w-45{width:45rem!important}.h-45{height:45rem!important}.m-45{margin:45rem!important}.mt-45{margin-top:45rem!important}.mb-45{margin-bottom:45rem!important}.ml-45{margin-left:45rem!important}.mr-45{margin-right:45rem!important}.p-45{padding:45rem!important}.pt-45{padding-top:45rem!important}.pb-45{padding-bottom:45rem!important}.pl-45{padding-left:45rem!important}.pr-45{padding-right:45rem!important}.w-46{width:46rem!important}.h-46{height:46rem!important}.m-46{margin:46rem!important}.mt-46{margin-top:46rem!important}.mb-46{margin-bottom:46rem!important}.ml-46{margin-left:46rem!important}.mr-46{margin-right:46rem!important}.p-46{padding:46rem!important}.pt-46{padding-top:46rem!important}.pb-46{padding-bottom:46rem!important}.pl-46{padding-left:46rem!important}.pr-46{padding-right:46rem!important}.w-47{width:47rem!important}.h-47{height:47rem!important}.m-47{margin:47rem!important}.mt-47{margin-top:47rem!important}.mb-47{margin-bottom:47rem!important}.ml-47{margin-left:47rem!important}.mr-47{margin-right:47rem!important}.p-47{padding:47rem!important}.pt-47{padding-top:47rem!important}.pb-47{padding-bottom:47rem!important}.pl-47{padding-left:47rem!important}.pr-47{padding-right:47rem!important}.w-48{width:48rem!important}.h-48{height:48rem!important}.m-48{margin:48rem!important}.mt-48{margin-top:48rem!important}.mb-48{margin-bottom:48rem!important}.ml-48{margin-left:48rem!important}.mr-48{margin-right:48rem!important}.p-48{padding:48rem!important}.pt-48{padding-top:48rem!important}.pb-48{padding-bottom:48rem!important}.pl-48{padding-left:48rem!important}.pr-48{padding-right:48rem!important}.w-49{width:49rem!important}.h-49{height:49rem!important}.m-49{margin:49rem!important}.mt-49{margin-top:49rem!important}.mb-49{margin-bottom:49rem!important}.ml-49{margin-left:49rem!important}.mr-49{margin-right:49rem!important}.p-49{padding:49rem!important}.pt-49{padding-top:49rem!important}.pb-49{padding-bottom:49rem!important}.pl-49{padding-left:49rem!important}.pr-49{padding-right:49rem!important}.w-50{width:50rem!important}.h-50{height:50rem!important}.m-50{margin:50rem!important}.mt-50{margin-top:50rem!important}.mb-50{margin-bottom:50rem!important}.ml-50{margin-left:50rem!important}.mr-50{margin-right:50rem!important}.p-50{padding:50rem!important}.pt-50{padding-top:50rem!important}.pb-50{padding-bottom:50rem!important}.pl-50{padding-left:50rem!important}.pr-50{padding-right:50rem!important}.w-51{width:51rem!important}.h-51{height:51rem!important}.m-51{margin:51rem!important}.mt-51{margin-top:51rem!important}.mb-51{margin-bottom:51rem!important}.ml-51{margin-left:51rem!important}.mr-51{margin-right:51rem!important}.p-51{padding:51rem!important}.pt-51{padding-top:51rem!important}.pb-51{padding-bottom:51rem!important}.pl-51{padding-left:51rem!important}.pr-51{padding-right:51rem!important}.w-52{width:52rem!important}.h-52{height:52rem!important}.m-52{margin:52rem!important}.mt-52{margin-top:52rem!important}.mb-52{margin-bottom:52rem!important}.ml-52{margin-left:52rem!important}.mr-52{margin-right:52rem!important}.p-52{padding:52rem!important}.pt-52{padding-top:52rem!important}.pb-52{padding-bottom:52rem!important}.pl-52{padding-left:52rem!important}.pr-52{padding-right:52rem!important}.w-53{width:53rem!important}.h-53{height:53rem!important}.m-53{margin:53rem!important}.mt-53{margin-top:53rem!important}.mb-53{margin-bottom:53rem!important}.ml-53{margin-left:53rem!important}.mr-53{margin-right:53rem!important}.p-53{padding:53rem!important}.pt-53{padding-top:53rem!important}.pb-53{padding-bottom:53rem!important}.pl-53{padding-left:53rem!important}.pr-53{padding-right:53rem!important}.w-54{width:54rem!important}.h-54{height:54rem!important}.m-54{margin:54rem!important}.mt-54{margin-top:54rem!important}.mb-54{margin-bottom:54rem!important}.ml-54{margin-left:54rem!important}.mr-54{margin-right:54rem!important}.p-54{padding:54rem!important}.pt-54{padding-top:54rem!important}.pb-54{padding-bottom:54rem!important}.pl-54{padding-left:54rem!important}.pr-54{padding-right:54rem!important}.w-55{width:55rem!important}.h-55{height:55rem!important}.m-55{margin:55rem!important}.mt-55{margin-top:55rem!important}.mb-55{margin-bottom:55rem!important}.ml-55{margin-left:55rem!important}.mr-55{margin-right:55rem!important}.p-55{padding:55rem!important}.pt-55{padding-top:55rem!important}.pb-55{padding-bottom:55rem!important}.pl-55{padding-left:55rem!important}.pr-55{padding-right:55rem!important}.w-56{width:56rem!important}.h-56{height:56rem!important}.m-56{margin:56rem!important}.mt-56{margin-top:56rem!important}.mb-56{margin-bottom:56rem!important}.ml-56{margin-left:56rem!important}.mr-56{margin-right:56rem!important}.p-56{padding:56rem!important}.pt-56{padding-top:56rem!important}.pb-56{padding-bottom:56rem!important}.pl-56{padding-left:56rem!important}.pr-56{padding-right:56rem!important}.w-57{width:57rem!important}.h-57{height:57rem!important}.m-57{margin:57rem!important}.mt-57{margin-top:57rem!important}.mb-57{margin-bottom:57rem!important}.ml-57{margin-left:57rem!important}.mr-57{margin-right:57rem!important}.p-57{padding:57rem!important}.pt-57{padding-top:57rem!important}.pb-57{padding-bottom:57rem!important}.pl-57{padding-left:57rem!important}.pr-57{padding-right:57rem!important}.w-58{width:58rem!important}.h-58{height:58rem!important}.m-58{margin:58rem!important}.mt-58{margin-top:58rem!important}.mb-58{margin-bottom:58rem!important}.ml-58{margin-left:58rem!important}.mr-58{margin-right:58rem!important}.p-58{padding:58rem!important}.pt-58{padding-top:58rem!important}.pb-58{padding-bottom:58rem!important}.pl-58{padding-left:58rem!important}.pr-58{padding-right:58rem!important}.w-59{width:59rem!important}.h-59{height:59rem!important}.m-59{margin:59rem!important}.mt-59{margin-top:59rem!important}.mb-59{margin-bottom:59rem!important}.ml-59{margin-left:59rem!important}.mr-59{margin-right:59rem!important}.p-59{padding:59rem!important}.pt-59{padding-top:59rem!important}.pb-59{padding-bottom:59rem!important}.pl-59{padding-left:59rem!important}.pr-59{padding-right:59rem!important}.w-60{width:60rem!important}.h-60{height:60rem!important}.m-60{margin:60rem!important}.mt-60{margin-top:60rem!important}.mb-60{margin-bottom:60rem!important}.ml-60{margin-left:60rem!important}.mr-60{margin-right:60rem!important}.p-60{padding:60rem!important}.pt-60{padding-top:60rem!important}.pb-60{padding-bottom:60rem!important}.pl-60{padding-left:60rem!important}.pr-60{padding-right:60rem!important}.w-61{width:61rem!important}.h-61{height:61rem!important}.m-61{margin:61rem!important}.mt-61{margin-top:61rem!important}.mb-61{margin-bottom:61rem!important}.ml-61{margin-left:61rem!important}.mr-61{margin-right:61rem!important}.p-61{padding:61rem!important}.pt-61{padding-top:61rem!important}.pb-61{padding-bottom:61rem!important}.pl-61{padding-left:61rem!important}.pr-61{padding-right:61rem!important}.w-62{width:62rem!important}.h-62{height:62rem!important}.m-62{margin:62rem!important}.mt-62{margin-top:62rem!important}.mb-62{margin-bottom:62rem!important}.ml-62{margin-left:62rem!important}.mr-62{margin-right:62rem!important}.p-62{padding:62rem!important}.pt-62{padding-top:62rem!important}.pb-62{padding-bottom:62rem!important}.pl-62{padding-left:62rem!important}.pr-62{padding-right:62rem!important}.w-63{width:63rem!important}.h-63{height:63rem!important}.m-63{margin:63rem!important}.mt-63{margin-top:63rem!important}.mb-63{margin-bottom:63rem!important}.ml-63{margin-left:63rem!important}.mr-63{margin-right:63rem!important}.p-63{padding:63rem!important}.pt-63{padding-top:63rem!important}.pb-63{padding-bottom:63rem!important}.pl-63{padding-left:63rem!important}.pr-63{padding-right:63rem!important}.w-64{width:64rem!important}.h-64{height:64rem!important}.m-64{margin:64rem!important}.mt-64{margin-top:64rem!important}.mb-64{margin-bottom:64rem!important}.ml-64{margin-left:64rem!important}.mr-64{margin-right:64rem!important}.p-64{padding:64rem!important}.pt-64{padding-top:64rem!important}.pb-64{padding-bottom:64rem!important}.pl-64{padding-left:64rem!important}.pr-64{padding-right:64rem!important}.w-65{width:65rem!important}.h-65{height:65rem!important}.m-65{margin:65rem!important}.mt-65{margin-top:65rem!important}.mb-65{margin-bottom:65rem!important}.ml-65{margin-left:65rem!important}.mr-65{margin-right:65rem!important}.p-65{padding:65rem!important}.pt-65{padding-top:65rem!important}.pb-65{padding-bottom:65rem!important}.pl-65{padding-left:65rem!important}.pr-65{padding-right:65rem!important}.w-66{width:66rem!important}.h-66{height:66rem!important}.m-66{margin:66rem!important}.mt-66{margin-top:66rem!important}.mb-66{margin-bottom:66rem!important}.ml-66{margin-left:66rem!important}.mr-66{margin-right:66rem!important}.p-66{padding:66rem!important}.pt-66{padding-top:66rem!important}.pb-66{padding-bottom:66rem!important}.pl-66{padding-left:66rem!important}.pr-66{padding-right:66rem!important}.w-67{width:67rem!important}.h-67{height:67rem!important}.m-67{margin:67rem!important}.mt-67{margin-top:67rem!important}.mb-67{margin-bottom:67rem!important}.ml-67{margin-left:67rem!important}.mr-67{margin-right:67rem!important}.p-67{padding:67rem!important}.pt-67{padding-top:67rem!important}.pb-67{padding-bottom:67rem!important}.pl-67{padding-left:67rem!important}.pr-67{padding-right:67rem!important}.w-68{width:68rem!important}.h-68{height:68rem!important}.m-68{margin:68rem!important}.mt-68{margin-top:68rem!important}.mb-68{margin-bottom:68rem!important}.ml-68{margin-left:68rem!important}.mr-68{margin-right:68rem!important}.p-68{padding:68rem!important}.pt-68{padding-top:68rem!important}.pb-68{padding-bottom:68rem!important}.pl-68{padding-left:68rem!important}.pr-68{padding-right:68rem!important}.w-69{width:69rem!important}.h-69{height:69rem!important}.m-69{margin:69rem!important}.mt-69{margin-top:69rem!important}.mb-69{margin-bottom:69rem!important}.ml-69{margin-left:69rem!important}.mr-69{margin-right:69rem!important}.p-69{padding:69rem!important}.pt-69{padding-top:69rem!important}.pb-69{padding-bottom:69rem!important}.pl-69{padding-left:69rem!important}.pr-69{padding-right:69rem!important}.w-70{width:70rem!important}.h-70{height:70rem!important}.m-70{margin:70rem!important}.mt-70{margin-top:70rem!important}.mb-70{margin-bottom:70rem!important}.ml-70{margin-left:70rem!important}.mr-70{margin-right:70rem!important}.p-70{padding:70rem!important}.pt-70{padding-top:70rem!important}.pb-70{padding-bottom:70rem!important}.pl-70{padding-left:70rem!important}.pr-70{padding-right:70rem!important}.w-71{width:71rem!important}.h-71{height:71rem!important}.m-71{margin:71rem!important}.mt-71{margin-top:71rem!important}.mb-71{margin-bottom:71rem!important}.ml-71{margin-left:71rem!important}.mr-71{margin-right:71rem!important}.p-71{padding:71rem!important}.pt-71{padding-top:71rem!important}.pb-71{padding-bottom:71rem!important}.pl-71{padding-left:71rem!important}.pr-71{padding-right:71rem!important}.w-72{width:72rem!important}.h-72{height:72rem!important}.m-72{margin:72rem!important}.mt-72{margin-top:72rem!important}.mb-72{margin-bottom:72rem!important}.ml-72{margin-left:72rem!important}.mr-72{margin-right:72rem!important}.p-72{padding:72rem!important}.pt-72{padding-top:72rem!important}.pb-72{padding-bottom:72rem!important}.pl-72{padding-left:72rem!important}.pr-72{padding-right:72rem!important}.w-73{width:73rem!important}.h-73{height:73rem!important}.m-73{margin:73rem!important}.mt-73{margin-top:73rem!important}.mb-73{margin-bottom:73rem!important}.ml-73{margin-left:73rem!important}.mr-73{margin-right:73rem!important}.p-73{padding:73rem!important}.pt-73{padding-top:73rem!important}.pb-73{padding-bottom:73rem!important}.pl-73{padding-left:73rem!important}.pr-73{padding-right:73rem!important}.w-74{width:74rem!important}.h-74{height:74rem!important}.m-74{margin:74rem!important}.mt-74{margin-top:74rem!important}.mb-74{margin-bottom:74rem!important}.ml-74{margin-left:74rem!important}.mr-74{margin-right:74rem!important}.p-74{padding:74rem!important}.pt-74{padding-top:74rem!important}.pb-74{padding-bottom:74rem!important}.pl-74{padding-left:74rem!important}.pr-74{padding-right:74rem!important}.w-75{width:75rem!important}.h-75{height:75rem!important}.m-75{margin:75rem!important}.mt-75{margin-top:75rem!important}.mb-75{margin-bottom:75rem!important}.ml-75{margin-left:75rem!important}.mr-75{margin-right:75rem!important}.p-75{padding:75rem!important}.pt-75{padding-top:75rem!important}.pb-75{padding-bottom:75rem!important}.pl-75{padding-left:75rem!important}.pr-75{padding-right:75rem!important}.w-76{width:76rem!important}.h-76{height:76rem!important}.m-76{margin:76rem!important}.mt-76{margin-top:76rem!important}.mb-76{margin-bottom:76rem!important}.ml-76{margin-left:76rem!important}.mr-76{margin-right:76rem!important}.p-76{padding:76rem!important}.pt-76{padding-top:76rem!important}.pb-76{padding-bottom:76rem!important}.pl-76{padding-left:76rem!important}.pr-76{padding-right:76rem!important}.w-77{width:77rem!important}.h-77{height:77rem!important}.m-77{margin:77rem!important}.mt-77{margin-top:77rem!important}.mb-77{margin-bottom:77rem!important}.ml-77{margin-left:77rem!important}.mr-77{margin-right:77rem!important}.p-77{padding:77rem!important}.pt-77{padding-top:77rem!important}.pb-77{padding-bottom:77rem!important}.pl-77{padding-left:77rem!important}.pr-77{padding-right:77rem!important}.w-78{width:78rem!important}.h-78{height:78rem!important}.m-78{margin:78rem!important}.mt-78{margin-top:78rem!important}.mb-78{margin-bottom:78rem!important}.ml-78{margin-left:78rem!important}.mr-78{margin-right:78rem!important}.p-78{padding:78rem!important}.pt-78{padding-top:78rem!important}.pb-78{padding-bottom:78rem!important}.pl-78{padding-left:78rem!important}.pr-78{padding-right:78rem!important}.w-79{width:79rem!important}.h-79{height:79rem!important}.m-79{margin:79rem!important}.mt-79{margin-top:79rem!important}.mb-79{margin-bottom:79rem!important}.ml-79{margin-left:79rem!important}.mr-79{margin-right:79rem!important}.p-79{padding:79rem!important}.pt-79{padding-top:79rem!important}.pb-79{padding-bottom:79rem!important}.pl-79{padding-left:79rem!important}.pr-79{padding-right:79rem!important}.w-80{width:80rem!important}.h-80{height:80rem!important}.m-80{margin:80rem!important}.mt-80{margin-top:80rem!important}.mb-80{margin-bottom:80rem!important}.ml-80{margin-left:80rem!important}.mr-80{margin-right:80rem!important}.p-80{padding:80rem!important}.pt-80{padding-top:80rem!important}.pb-80{padding-bottom:80rem!important}.pl-80{padding-left:80rem!important}.pr-80{padding-right:80rem!important}.w-81{width:81rem!important}.h-81{height:81rem!important}.m-81{margin:81rem!important}.mt-81{margin-top:81rem!important}.mb-81{margin-bottom:81rem!important}.ml-81{margin-left:81rem!important}.mr-81{margin-right:81rem!important}.p-81{padding:81rem!important}.pt-81{padding-top:81rem!important}.pb-81{padding-bottom:81rem!important}.pl-81{padding-left:81rem!important}.pr-81{padding-right:81rem!important}.w-82{width:82rem!important}.h-82{height:82rem!important}.m-82{margin:82rem!important}.mt-82{margin-top:82rem!important}.mb-82{margin-bottom:82rem!important}.ml-82{margin-left:82rem!important}.mr-82{margin-right:82rem!important}.p-82{padding:82rem!important}.pt-82{padding-top:82rem!important}.pb-82{padding-bottom:82rem!important}.pl-82{padding-left:82rem!important}.pr-82{padding-right:82rem!important}.w-83{width:83rem!important}.h-83{height:83rem!important}.m-83{margin:83rem!important}.mt-83{margin-top:83rem!important}.mb-83{margin-bottom:83rem!important}.ml-83{margin-left:83rem!important}.mr-83{margin-right:83rem!important}.p-83{padding:83rem!important}.pt-83{padding-top:83rem!important}.pb-83{padding-bottom:83rem!important}.pl-83{padding-left:83rem!important}.pr-83{padding-right:83rem!important}.w-84{width:84rem!important}.h-84{height:84rem!important}.m-84{margin:84rem!important}.mt-84{margin-top:84rem!important}.mb-84{margin-bottom:84rem!important}.ml-84{margin-left:84rem!important}.mr-84{margin-right:84rem!important}.p-84{padding:84rem!important}.pt-84{padding-top:84rem!important}.pb-84{padding-bottom:84rem!important}.pl-84{padding-left:84rem!important}.pr-84{padding-right:84rem!important}.w-85{width:85rem!important}.h-85{height:85rem!important}.m-85{margin:85rem!important}.mt-85{margin-top:85rem!important}.mb-85{margin-bottom:85rem!important}.ml-85{margin-left:85rem!important}.mr-85{margin-right:85rem!important}.p-85{padding:85rem!important}.pt-85{padding-top:85rem!important}.pb-85{padding-bottom:85rem!important}.pl-85{padding-left:85rem!important}.pr-85{padding-right:85rem!important}.w-86{width:86rem!important}.h-86{height:86rem!important}.m-86{margin:86rem!important}.mt-86{margin-top:86rem!important}.mb-86{margin-bottom:86rem!important}.ml-86{margin-left:86rem!important}.mr-86{margin-right:86rem!important}.p-86{padding:86rem!important}.pt-86{padding-top:86rem!important}.pb-86{padding-bottom:86rem!important}.pl-86{padding-left:86rem!important}.pr-86{padding-right:86rem!important}.w-87{width:87rem!important}.h-87{height:87rem!important}.m-87{margin:87rem!important}.mt-87{margin-top:87rem!important}.mb-87{margin-bottom:87rem!important}.ml-87{margin-left:87rem!important}.mr-87{margin-right:87rem!important}.p-87{padding:87rem!important}.pt-87{padding-top:87rem!important}.pb-87{padding-bottom:87rem!important}.pl-87{padding-left:87rem!important}.pr-87{padding-right:87rem!important}.w-88{width:88rem!important}.h-88{height:88rem!important}.m-88{margin:88rem!important}.mt-88{margin-top:88rem!important}.mb-88{margin-bottom:88rem!important}.ml-88{margin-left:88rem!important}.mr-88{margin-right:88rem!important}.p-88{padding:88rem!important}.pt-88{padding-top:88rem!important}.pb-88{padding-bottom:88rem!important}.pl-88{padding-left:88rem!important}.pr-88{padding-right:88rem!important}.w-89{width:89rem!important}.h-89{height:89rem!important}.m-89{margin:89rem!important}.mt-89{margin-top:89rem!important}.mb-89{margin-bottom:89rem!important}.ml-89{margin-left:89rem!important}.mr-89{margin-right:89rem!important}.p-89{padding:89rem!important}.pt-89{padding-top:89rem!important}.pb-89{padding-bottom:89rem!important}.pl-89{padding-left:89rem!important}.pr-89{padding-right:89rem!important}.w-90{width:90rem!important}.h-90{height:90rem!important}.m-90{margin:90rem!important}.mt-90{margin-top:90rem!important}.mb-90{margin-bottom:90rem!important}.ml-90{margin-left:90rem!important}.mr-90{margin-right:90rem!important}.p-90{padding:90rem!important}.pt-90{padding-top:90rem!important}.pb-90{padding-bottom:90rem!important}.pl-90{padding-left:90rem!important}.pr-90{padding-right:90rem!important}.w-91{width:91rem!important}.h-91{height:91rem!important}.m-91{margin:91rem!important}.mt-91{margin-top:91rem!important}.mb-91{margin-bottom:91rem!important}.ml-91{margin-left:91rem!important}.mr-91{margin-right:91rem!important}.p-91{padding:91rem!important}.pt-91{padding-top:91rem!important}.pb-91{padding-bottom:91rem!important}.pl-91{padding-left:91rem!important}.pr-91{padding-right:91rem!important}.w-92{width:92rem!important}.h-92{height:92rem!important}.m-92{margin:92rem!important}.mt-92{margin-top:92rem!important}.mb-92{margin-bottom:92rem!important}.ml-92{margin-left:92rem!important}.mr-92{margin-right:92rem!important}.p-92{padding:92rem!important}.pt-92{padding-top:92rem!important}.pb-92{padding-bottom:92rem!important}.pl-92{padding-left:92rem!important}.pr-92{padding-right:92rem!important}.w-93{width:93rem!important}.h-93{height:93rem!important}.m-93{margin:93rem!important}.mt-93{margin-top:93rem!important}.mb-93{margin-bottom:93rem!important}.ml-93{margin-left:93rem!important}.mr-93{margin-right:93rem!important}.p-93{padding:93rem!important}.pt-93{padding-top:93rem!important}.pb-93{padding-bottom:93rem!important}.pl-93{padding-left:93rem!important}.pr-93{padding-right:93rem!important}.w-94{width:94rem!important}.h-94{height:94rem!important}.m-94{margin:94rem!important}.mt-94{margin-top:94rem!important}.mb-94{margin-bottom:94rem!important}.ml-94{margin-left:94rem!important}.mr-94{margin-right:94rem!important}.p-94{padding:94rem!important}.pt-94{padding-top:94rem!important}.pb-94{padding-bottom:94rem!important}.pl-94{padding-left:94rem!important}.pr-94{padding-right:94rem!important}.w-95{width:95rem!important}.h-95{height:95rem!important}.m-95{margin:95rem!important}.mt-95{margin-top:95rem!important}.mb-95{margin-bottom:95rem!important}.ml-95{margin-left:95rem!important}.mr-95{margin-right:95rem!important}.p-95{padding:95rem!important}.pt-95{padding-top:95rem!important}.pb-95{padding-bottom:95rem!important}.pl-95{padding-left:95rem!important}.pr-95{padding-right:95rem!important}.w-96{width:96rem!important}.h-96{height:96rem!important}.m-96{margin:96rem!important}.mt-96{margin-top:96rem!important}.mb-96{margin-bottom:96rem!important}.ml-96{margin-left:96rem!important}.mr-96{margin-right:96rem!important}.p-96{padding:96rem!important}.pt-96{padding-top:96rem!important}.pb-96{padding-bottom:96rem!important}.pl-96{padding-left:96rem!important}.pr-96{padding-right:96rem!important}.w-97{width:97rem!important}.h-97{height:97rem!important}.m-97{margin:97rem!important}.mt-97{margin-top:97rem!important}.mb-97{margin-bottom:97rem!important}.ml-97{margin-left:97rem!important}.mr-97{margin-right:97rem!important}.p-97{padding:97rem!important}.pt-97{padding-top:97rem!important}.pb-97{padding-bottom:97rem!important}.pl-97{padding-left:97rem!important}.pr-97{padding-right:97rem!important}.w-98{width:98rem!important}.h-98{height:98rem!important}.m-98{margin:98rem!important}.mt-98{margin-top:98rem!important}.mb-98{margin-bottom:98rem!important}.ml-98{margin-left:98rem!important}.mr-98{margin-right:98rem!important}.p-98{padding:98rem!important}.pt-98{padding-top:98rem!important}.pb-98{padding-bottom:98rem!important}.pl-98{padding-left:98rem!important}.pr-98{padding-right:98rem!important}.w-99{width:99rem!important}.h-99{height:99rem!important}.m-99{margin:99rem!important}.mt-99{margin-top:99rem!important}.mb-99{margin-bottom:99rem!important}.ml-99{margin-left:99rem!important}.mr-99{margin-right:99rem!important}.p-99{padding:99rem!important}.pt-99{padding-top:99rem!important}.pb-99{padding-bottom:99rem!important}.pl-99{padding-left:99rem!important}.pr-99{padding-right:99rem!important}*{box-sizing:border-box}html{font-size:4px}ul{list-style-type:none}ul,ul li{padding:0}.select-dropdown[disabled],input[disabled],label[disabled],select[disabled],textarea[disabled]{opacity:.4;border-color:#aaa}input.input-sm{font-size:3rem;padding:6px;border-width:1px}.input-group-radio input[type=radio]{position:relative;top:-9999px}.input-group-radio label{display:inline-block;padding-top:2rem;background-color:#ececec;color:#b0b0b0;font-weight:700}.input-group-radio label.radio-active{color:#fff;background-color:#000}.panini{border-top:12px solid #d8d8d8;border-bottom:12px solid #d8d8d8;height:36px;width:36px}.liang{border-radius:100%;width:9rem;height:9rem;border:3rem solid #9b9b9b}.cross{position:relative;display:inline-block;width:35px;height:35px;border-color:red}.cross:before{left:-12px;transform:rotate(45deg)}.cross:after,.cross:before{position:absolute;top:7px;width:35px;height:35px;border-top:10px solid #000;border-color:inherit;content:""}.cross:after{left:13px;transform:rotate(-45deg)}.text-gray{color:#9b9b9b}.relative{position:relative}.inline{display:inline}.block{display:block}input,textarea{outline:none}.select-dropdown{border:6px solid #000;background-color:#fff;text-align:center}.select-dropdown select{padding:0;height:18rem;color:#fff;background-color:#000;border-radius:0;text-align-last:center}.select-dropdown select,.select-icon{line-height:18rem;font-size:9rem;font-weight:700}.select-icon{padding:0 5rem}button.disabled{color:#fff;cursor:inherit}.flex{display:flex}.inline-block{display:inline-block}.space-between{justify-content:space-between}.pointer{cursor:pointer}.sidebar{position:absolute;right:24rem;top:48rem}.menu-main{display:flex}.menu-main .panini{margin-right:11rem}.menu-main .panini .menu-main .liang{cursor:pointer}.nav-main{position:fixed;display:flex;bottom:4rem;width:960px;justify-content:center;list-style-type:none}.nav-main li{margin:0 2rem}.header-container{padding:12rem 2rem 9rem}.header-main{display:flex;align-items:center}.header-page{text-decoration:underline;color:#9b9b9b;display:inline}.header-subpage{display:flex;align-items:center}.header-sep{margin:0 12rem;display:inline}.header-settings{margin-left:30rem}.inbox-feed{height:10rem;position:relative;top:1px}.page-notes-edit textarea{border:none;height:800px}.page-notes-index h1{margin-top:0}.notes-actions .btn-secondary{margin-right:10rem}.note-timestamp{position:absolute;left:-16rem;top:3rem}.notes-blurbs{margin-top:8rem}.notes-blurbs li{display:flex;position:relative;margin:4rem 0}.menu-canvas{position:absolute;left:0;right:0;top:0;bottom:0;background-color:#fff},.menu-canvas .cross,.menu-canvas .cross:after,.menu-canvas .cross:before{border-color:red!important}.create-stream-page .minus,.create-stream-page .plus{font-size:28px;font-weight:700;cursor:pointer}.create-stream-page .plus{line-height:41px}.create-stream-page .input-group i{padding-top:2rem}.create-stream-page textarea{border:6px solid #000}.create-stream-page input[type=text]{border:3px solid #000}.create-stream-page input[type=text].input-text-lg{border:6px solid #000;font-size:9rem;line-height:18rem;padding:0 4rem}.create-stream-page label{font-size:6rem;line-height:9rem;font-weight:500}.create-stream-page .input-group-radio label{padding-top:0;height:18rem;width:38rem;font-size:9rem;line-height:18rem;text-align:center}.chat-container .col-sm-2{flex-basis:43rem;max-width:43rem}.chat-input-field[type=text]{border:none;padding:0;line-height:6rem}.chat-input-field:placeholder{color:#b0b0b0}.chat-sep{text-align:center;font-weight:600;margin:4rem}.chat-msg-app,.chat-msg-app *{color:#9b9b9b}.cir-status{width:2rem;height:2rem;border-radius:100%;display:inline-block;position:relative;bottom:1px}.cir-green{background-color:#8eee9c}.cir-black,.cir-grey{background-color:#b0b0b0}.cir-red{background-color:#f44}textarea.post-edit{height:80%;border:none;resize:none;padding:8rem 12rem}textarea.comment-edit{border:none;resize:none;padding:0}.coms ol{counter-reset:a -1}.coms ol>li:before{font-weight:400;position:absolute;font-family:Source Code Pro,Roboto mono,Courier New,monospace;color:#9b9b9b}.coms ol>li>div.da{color:#9b9b9b}.create-comment button.disabled{display:none}.create-comment .usership{color:#000}div.coll-title,div.mod{font-size:6rem}.collection-index li.forum:before{content:"•";position:absolute;font-size:10rem;margin-left:-12rem;margin-top:9rem}.collection-index li.forum .meta-cont>div{float:left}.collection-index li.blog:before{content:"•";position:absolute;font-size:10rem;margin-left:-12rem;margin-top:11rem}.collection-index li.notes .da{position:absolute;margin-left:-12rem;margin-top:1rem}.collection-index .note-uuid{font-weight:inherit}.collection-index img,.post img{width:100%}.post #edit{display:none}.profile li.profile:before{content:"•";position:absolute;font-size:10rem;margin-left:-12rem;margin-top:4rem} \ No newline at end of file +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}[class*=col-]{width:100%;margin-bottom:1rem}.container{margin:0 auto;padding:0 2rem;max-width:960px}.row{display:flex;margin-right:-.5rem;margin-left:-.5rem}.flex,.row{flex-wrap:wrap}.align-vertical{align-items:center}.justify-center{justify-content:center}@media only screen and (min-width:0){.col-sm,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-offset-0,.col-sm-offset-1,.col-sm-offset-2,.col-sm-offset-3,.col-sm-offset-4,.col-sm-offset-5,.col-sm-offset-6,.col-sm-offset-7,.col-sm-offset-8,.col-sm-offset-9,.col-sm-offset-10,.col-sm-offset-11,.col-sm-offset-12{box-sizing:border-box;flex:0 0 auto;padding-right:.5rem;padding-left:.5rem}.col-sm{flex-grow:1;flex-basis:0;max-width:100%}.col-sm-1{flex-basis:8.33333333%;max-width:8.33333333%}.col-sm-2{flex-basis:16.66666667%;max-width:16.66666667%}.col-sm-3{flex-basis:25%;max-width:25%}.col-sm-4{flex-basis:33.33333333%;max-width:33.33333333%}.col-sm-5{flex-basis:41.66666667%;max-width:41.66666667%}.col-sm-6{flex-basis:50%;max-width:50%}.col-sm-7{flex-basis:58.33333333%;max-width:58.33333333%}.col-sm-8{flex-basis:66.66666667%;max-width:66.66666667%}.col-sm-9{flex-basis:75%;max-width:75%}.col-sm-10{flex-basis:83.33333333%;max-width:83.33333333%}.col-sm-11{flex-basis:91.66666667%;max-width:91.66666667%}.col-sm-12{flex-basis:100%;max-width:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-11{margin-left:91.66666667%}}@media only screen and (min-width:480px){.col-md,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-md-offset-0,.col-md-offset-1,.col-md-offset-2,.col-md-offset-3,.col-md-offset-4,.col-md-offset-5,.col-md-offset-6,.col-md-offset-7,.col-md-offset-8,.col-md-offset-9,.col-md-offset-10,.col-md-offset-11,.col-md-offset-12{box-sizing:border-box;flex:0 0 auto;padding-right:.5rem;padding-left:.5rem}.col-md{flex-grow:1;flex-basis:0;max-width:100%}.col-md-1{flex-basis:8.33333333%;max-width:8.33333333%}.col-md-2{flex-basis:16.66666667%;max-width:16.66666667%}.col-md-3{flex-basis:25%;max-width:25%}.col-md-4{flex-basis:33.33333333%;max-width:33.33333333%}.col-md-5{flex-basis:41.66666667%;max-width:41.66666667%}.col-md-6{flex-basis:50%;max-width:50%}.col-md-7{flex-basis:58.33333333%;max-width:58.33333333%}.col-md-8{flex-basis:66.66666667%;max-width:66.66666667%}.col-md-9{flex-basis:75%;max-width:75%}.col-md-10{flex-basis:83.33333333%;max-width:83.33333333%}.col-md-11{flex-basis:91.66666667%;max-width:91.66666667%}.col-md-12{flex-basis:100%;max-width:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-11{margin-left:91.66666667%}}@media only screen and (min-width:960px){.col-lg,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-offset-0,.col-lg-offset-1,.col-lg-offset-2,.col-lg-offset-3,.col-lg-offset-4,.col-lg-offset-5,.col-lg-offset-6,.col-lg-offset-7,.col-lg-offset-8,.col-lg-offset-9,.col-lg-offset-10,.col-lg-offset-11,.col-lg-offset-12{box-sizing:border-box;flex:0 0 auto;padding-right:.5rem;padding-left:.5rem}.col-lg{flex-grow:1;flex-basis:0;max-width:100%}.col-lg-1{flex-basis:8.33333333%;max-width:8.33333333%}.col-lg-2{flex-basis:16.66666667%;max-width:16.66666667%}.col-lg-3{flex-basis:25%;max-width:25%}.col-lg-4{flex-basis:33.33333333%;max-width:33.33333333%}.col-lg-5{flex-basis:41.66666667%;max-width:41.66666667%}.col-lg-6{flex-basis:50%;max-width:50%}.col-lg-7{flex-basis:58.33333333%;max-width:58.33333333%}.col-lg-8{flex-basis:66.66666667%;max-width:66.66666667%}.col-lg-9{flex-basis:75%;max-width:75%}.col-lg-10{flex-basis:83.33333333%;max-width:83.33333333%}.col-lg-11{flex-basis:91.66666667%;max-width:91.66666667%}.col-lg-12{flex-basis:100%;max-width:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-11{margin-left:91.66666667%}}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-Thin.ttf) format("truetype");font-weight:100}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-ExtraLight.ttf) format("truetype");font-weight:200}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-Light.ttf) format("truetype");font-weight:300}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-Regular.ttf) format("truetype");font-weight:400}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-Medium.ttf) format("truetype");font-weight:500}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-SemiBold.ttf) format("truetype");font-weight:600}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-Bold.ttf) format("truetype");font-weight:700}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-ExtraBold.ttf) format("truetype");font-weight:800}@font-face{font-family:Work Sans;src:url(https://storage.googleapis.com/media.urbit.org/fonts/WorkSans-Black.ttf) format("truetype");font-weight:900}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-extralight.woff);font-weight:200}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-light.woff);font-weight:300}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-regular.woff);font-weight:400}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-medium.woff);font-weight:500}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-bold.woff);font-weight:600}@font-face{font-family:Source Code Pro;src:url(https://storage.googleapis.com/media.urbit.org/fonts/scp-black.woff);font-weight:700}*{font-smoothing:antialiased;-webkit-font-smoothing:antialiased}body{font-family:-apple-system,BlinkMacSystemFont,Roboto,Helvetica,Arial,sans-serif;font-size:4rem;line-height:6rem;color:#373a3c}a{color:#000}p{margin:0 0 2rem}.text-heading,h1,h2,h3,h4,h5{margin:0;font-family:Work Sans;color:#373a3c}.h1,h1{font-size:12rem;line-height:16rem;margin:4rem 0}.h1,.h2,h1,h2{font-weight:600}.h2,h2{font-size:9rem;line-height:13rem;margin:3rem 0}.h3,h3{font-size:6rem;font-weight:600;line-height:8rem;margin:2rem 0}.h4,h4{font-weight:600}.h4,.h5,h4,h5{font-size:5rem;line-height:7rem;margin:1rem 0}.h5,h5{font-weight:500}.text-sm,caption{font-size:3rem;line-height:5rem}.text-md{font-size:4rem;line-height:6rem}.text-lg{font-size:5rem;line-height:7rem}code,pre{background-color:#f1f1f1;padding:1rem}.text-code,.text-mono,code,pre{font-family:Source Code Pro,Roboto mono,Courier New,monospace}.text-code{color:#000}.code-block,.text-code{background-color:#f1f1f1}.code-block{padding:5rem;white-space:pre-wrap}.code-block .text-code{font-weight:200}.underline,u{text-decoration:underline}.strikethrough,s{text-decoration:line-through}.italic,em{font-style:italic}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.text-300{font-weight:300}.text-400{font-weight:400}.text-500{font-weight:500}.text-600{font-weight:600}.text-700,b{font-weight:700}.text-800{font-weight:800}.h-font{font-family:Work Sans}.blue{color:#4330fc}.green{color:#6fdc74}.red{color:#ee3124}.gray-lighter{color:#f1f1f1}.gray-light{color:#d4d4d4}.gray{color:#5b5b5b}.gray-dark{color:#373a3c}.blue-hl{background-color:#4330fc;color:#fff}.green-hl{background-color:#6fdc74;color:#fff}.red-hl{background-color:#ee3124;color:#fff}.gray-lighter-hl{background-color:#f1f1f1;color:#fff}.gray-light-hl{background-color:#d4d4d4;color:#fff}.gray-hl{background-color:#5b5b5b;color:#fff}.gray-dark-hl{background-color:#373a3c;color:#fff}.black-hl{background-color:#000;color:#fff}.center{text-align:center}.right{text-align:right}.justify{text-align:justify}button{border:none;outline:none}.btn,button{font-family:Work Sans,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:500;font-size:4rem;line-height:4rem;padding:3rem 6rem;color:#000;background-color:#d4d4d4;margin:0 0 6px}.btn-sm{font-size:3rem;line-height:3rem;padding:2rem 4rem}.btn-primary{background-color:#4330fc;color:#fff}.btn-secondary{background-color:#6fdc74}.btn-tetiary{background-color:#5b5b5b;color:#fff}.btn-warning{background-color:#ee3124;color:#fff}.btn-group .btn{display:inline-block}.btn-group .btn:not(.active){background-color:#d4d4d4;color:#000}label{display:block;font-weight:700}input[type=text],textarea{border:2px solid #000;padding:12px;width:100%}.error-label{display:none;color:#f44;font-size:2.33rem;line-height:3rem;margin-top:1rem}.input-group{margin:0 0 2rem}.input-group.error input[type=text],.input-group.error textarea{border:.5rem solid #f44}.input-group.error .error-label{display:block}.checkbox-group input,.checkbox-group label,.radio-group input,.radio-group label{font-weight:400;display:inline-block}.select-dropdown{display:flex;border:2px solid #000;overflow:hidden}.select-dropdown select{padding:5px 8px;width:130%;border:none;box-shadow:none;background:transparent;background-image:none;-webkit-appearance:none}.select-dropdown select:focus{outline:none}.select-dropdown .triangle-down{border-width:2rem 1rem 0;position:relative;top:14px;right:8px}.icon-arrow-right:before{content:"→"}.icon-arrow-left:before{content:"←"}.icon-arrow-up:before{content:"↑"}.icon-arrow-down:before{content:"↓"}.icon-cross:before{content:"×"}.icon-ellipsis:before{content:"...";position:relative;bottom:6px}.selected:before{content:"∙"}.icon{margin-right:.6rem}.icon.prev{width:1px;height:1px;border:12.0006px solid transparent;border-right:18px solid #000;border-left:0 solid transparent}.icon.next{border:12.0006px solid transparent;border-left:18px solid #000;border-right:0 solid transparent;margin-right:0}.icon.next,.icon.up{width:1px;height:1px}.icon.up{border:12.0006px solid transparent;border-bottom:18px solid #000;border-top:0 solid transparent}.circle{display:inline-block;padding:2rem;border-radius:50%;border:2px solid #000;text-align:center}.circle-sm{padding:1rem}.circle-lg{padding:4rem}.circle-fill{background-color:#000}.circle-red{background-color:#ee3124;border-color:#ee3124}.circle-blue{background-color:#4330fc;border-color:#4330fc}.circle-blue-light{background-color:#a4d8e8;border-color:#a4d8e8}.circle-yellow{background-color:#ffc440;border-color:#ffc440}.circle-green{background-color:#6fdc74;border-color:#6fdc74}.circle-gray{background-color:#5b5b5b;border-color:#5b5b5b}.circle-gray-light{background-color:#d4d4d4;border-color:#d4d4d4}.circle-gray-lighter{background-color:#f1f1f1;border-color:#f1f1f1}.circle-gray-dark{background-color:#373a3c;border-color:#373a3c}.circle-pill{border-radius:9999px;width:10rem}.circle-pill.circle-lg{width:20rem}.square{display:inline-block;padding:2rem;border:2px solid #000;text-align:center}.square-sm{padding:1rem}.square-lg{padding:4rem}.square-fill{background-color:#000}.square-red{background-color:red;border-color:red}.square-rect{width:10rem}.square-rect.square-lg{width:20rem}.triangle-base{display:inline-block;width:0;height:0}.triangle-up{border-bottom:4rem solid #000}.triangle-down,.triangle-up{border-left:2rem solid transparent;border-right:2rem solid transparent}.triangle-down{border-top:4rem solid #000}.triangle-right{border-left:4rem solid #000}.triangle-left,.triangle-right{border-top:2rem solid transparent;border-bottom:2rem solid transparent}.triangle-left{border-right:4rem solid #000}.urbit-logo{width:72px;height:72px;border-radius:50%;border:5px solid #fff;background-color:transparent}.urbit-logo,.urbit-logo:before{display:inline-block;vertical-align:middle}.urbit-logo:before{content:"~";color:#fff;font-size:72px;line-height:54px;text-align:center;width:2rem;font-family:Work Sans;font-weight:600;margin-right:30px;margin-top:3px}.urbit-logo-solid{border-color:#000}.urbit-logo-solid:before{color:#000}section{margin:0 0 2rem;border:none}blockquote{border-left:6px solid #000;margin:24px 0;padding-left:18px}hr{margin:4rem 0;width:100%;height:1rem;border:0;background-color:#373a3c}ul{padding-left:4rem;list-style:disc outside}ul li{margin-bottom:2rem;padding-left:2rem}ol ul,ul ol,ul ul{margin:2rem}ol ul li,ul ol li,ul ul li{margin-bottom:1rem}ul.list-reset{list-style:none}ol,ul.list-reset,ul.list-reset li{padding-left:0}ol{list-style:none}ol>li{counter-increment:a;margin-left:0;margin-bottom:1rem}ol>li:before{content:counter(a);font-weight:700;vertical-align:center;display:inline-block;width:6rem;text-align:left}.w-0{width:0!important}.h-0{height:0!important}.m-0{margin:0!important}.mt-0{margin-top:0!important}.mb-0{margin-bottom:0!important}.ml-0{margin-left:0!important}.mr-0{margin-right:0!important}.p-0{padding:0!important}.pt-0{padding-top:0!important}.pb-0{padding-bottom:0!important}.pl-0{padding-left:0!important}.pr-0{padding-right:0!important}.w-1{width:1rem!important}.h-1{height:1rem!important}.m-1{margin:1rem!important}.mt-1{margin-top:1rem!important}.mb-1{margin-bottom:1rem!important}.ml-1{margin-left:1rem!important}.mr-1{margin-right:1rem!important}.p-1{padding:1rem!important}.pt-1{padding-top:1rem!important}.pb-1{padding-bottom:1rem!important}.pl-1{padding-left:1rem!important}.pr-1{padding-right:1rem!important}.w-2{width:2rem!important}.h-2{height:2rem!important}.m-2{margin:2rem!important}.mt-2{margin-top:2rem!important}.mb-2{margin-bottom:2rem!important}.ml-2{margin-left:2rem!important}.mr-2{margin-right:2rem!important}.p-2{padding:2rem!important}.pt-2{padding-top:2rem!important}.pb-2{padding-bottom:2rem!important}.pl-2{padding-left:2rem!important}.pr-2{padding-right:2rem!important}.w-3{width:3rem!important}.h-3{height:3rem!important}.m-3{margin:3rem!important}.mt-3{margin-top:3rem!important}.mb-3{margin-bottom:3rem!important}.ml-3{margin-left:3rem!important}.mr-3{margin-right:3rem!important}.p-3{padding:3rem!important}.pt-3{padding-top:3rem!important}.pb-3{padding-bottom:3rem!important}.pl-3{padding-left:3rem!important}.pr-3{padding-right:3rem!important}.w-4{width:4rem!important}.h-4{height:4rem!important}.m-4{margin:4rem!important}.mt-4{margin-top:4rem!important}.mb-4{margin-bottom:4rem!important}.ml-4{margin-left:4rem!important}.mr-4{margin-right:4rem!important}.p-4{padding:4rem!important}.pt-4{padding-top:4rem!important}.pb-4{padding-bottom:4rem!important}.pl-4{padding-left:4rem!important}.pr-4{padding-right:4rem!important}.w-5{width:5rem!important}.h-5{height:5rem!important}.m-5{margin:5rem!important}.mt-5{margin-top:5rem!important}.mb-5{margin-bottom:5rem!important}.ml-5{margin-left:5rem!important}.mr-5{margin-right:5rem!important}.p-5{padding:5rem!important}.pt-5{padding-top:5rem!important}.pb-5{padding-bottom:5rem!important}.pl-5{padding-left:5rem!important}.pr-5{padding-right:5rem!important}.w-6{width:6rem!important}.h-6{height:6rem!important}.m-6{margin:6rem!important}.mt-6{margin-top:6rem!important}.mb-6{margin-bottom:6rem!important}.ml-6{margin-left:6rem!important}.mr-6{margin-right:6rem!important}.p-6{padding:6rem!important}.pt-6{padding-top:6rem!important}.pb-6{padding-bottom:6rem!important}.pl-6{padding-left:6rem!important}.pr-6{padding-right:6rem!important}.w-7{width:7rem!important}.h-7{height:7rem!important}.m-7{margin:7rem!important}.mt-7{margin-top:7rem!important}.mb-7{margin-bottom:7rem!important}.ml-7{margin-left:7rem!important}.mr-7{margin-right:7rem!important}.p-7{padding:7rem!important}.pt-7{padding-top:7rem!important}.pb-7{padding-bottom:7rem!important}.pl-7{padding-left:7rem!important}.pr-7{padding-right:7rem!important}.w-8{width:8rem!important}.h-8{height:8rem!important}.m-8{margin:8rem!important}.mt-8{margin-top:8rem!important}.mb-8{margin-bottom:8rem!important}.ml-8{margin-left:8rem!important}.mr-8{margin-right:8rem!important}.p-8{padding:8rem!important}.pt-8{padding-top:8rem!important}.pb-8{padding-bottom:8rem!important}.pl-8{padding-left:8rem!important}.pr-8{padding-right:8rem!important}.w-9{width:9rem!important}.h-9{height:9rem!important}.m-9{margin:9rem!important}.mt-9{margin-top:9rem!important}.mb-9{margin-bottom:9rem!important}.ml-9{margin-left:9rem!important}.mr-9{margin-right:9rem!important}.p-9{padding:9rem!important}.pt-9{padding-top:9rem!important}.pb-9{padding-bottom:9rem!important}.pl-9{padding-left:9rem!important}.pr-9{padding-right:9rem!important}.w-10{width:10rem!important}.h-10{height:10rem!important}.m-10{margin:10rem!important}.mt-10{margin-top:10rem!important}.mb-10{margin-bottom:10rem!important}.ml-10{margin-left:10rem!important}.mr-10{margin-right:10rem!important}.p-10{padding:10rem!important}.pt-10{padding-top:10rem!important}.pb-10{padding-bottom:10rem!important}.pl-10{padding-left:10rem!important}.pr-10{padding-right:10rem!important}.w-11{width:11rem!important}.h-11{height:11rem!important}.m-11{margin:11rem!important}.mt-11{margin-top:11rem!important}.mb-11{margin-bottom:11rem!important}.ml-11{margin-left:11rem!important}.mr-11{margin-right:11rem!important}.p-11{padding:11rem!important}.pt-11{padding-top:11rem!important}.pb-11{padding-bottom:11rem!important}.pl-11{padding-left:11rem!important}.pr-11{padding-right:11rem!important}.w-12{width:12rem!important}.h-12{height:12rem!important}.m-12{margin:12rem!important}.mt-12{margin-top:12rem!important}.mb-12{margin-bottom:12rem!important}.ml-12{margin-left:12rem!important}.mr-12{margin-right:12rem!important}.p-12{padding:12rem!important}.pt-12{padding-top:12rem!important}.pb-12{padding-bottom:12rem!important}.pl-12{padding-left:12rem!important}.pr-12{padding-right:12rem!important}.w-13{width:13rem!important}.h-13{height:13rem!important}.m-13{margin:13rem!important}.mt-13{margin-top:13rem!important}.mb-13{margin-bottom:13rem!important}.ml-13{margin-left:13rem!important}.mr-13{margin-right:13rem!important}.p-13{padding:13rem!important}.pt-13{padding-top:13rem!important}.pb-13{padding-bottom:13rem!important}.pl-13{padding-left:13rem!important}.pr-13{padding-right:13rem!important}.w-14{width:14rem!important}.h-14{height:14rem!important}.m-14{margin:14rem!important}.mt-14{margin-top:14rem!important}.mb-14{margin-bottom:14rem!important}.ml-14{margin-left:14rem!important}.mr-14{margin-right:14rem!important}.p-14{padding:14rem!important}.pt-14{padding-top:14rem!important}.pb-14{padding-bottom:14rem!important}.pl-14{padding-left:14rem!important}.pr-14{padding-right:14rem!important}.w-15{width:15rem!important}.h-15{height:15rem!important}.m-15{margin:15rem!important}.mt-15{margin-top:15rem!important}.mb-15{margin-bottom:15rem!important}.ml-15{margin-left:15rem!important}.mr-15{margin-right:15rem!important}.p-15{padding:15rem!important}.pt-15{padding-top:15rem!important}.pb-15{padding-bottom:15rem!important}.pl-15{padding-left:15rem!important}.pr-15{padding-right:15rem!important}.w-16{width:16rem!important}.h-16{height:16rem!important}.m-16{margin:16rem!important}.mt-16{margin-top:16rem!important}.mb-16{margin-bottom:16rem!important}.ml-16{margin-left:16rem!important}.mr-16{margin-right:16rem!important}.p-16{padding:16rem!important}.pt-16{padding-top:16rem!important}.pb-16{padding-bottom:16rem!important}.pl-16{padding-left:16rem!important}.pr-16{padding-right:16rem!important}.w-17{width:17rem!important}.h-17{height:17rem!important}.m-17{margin:17rem!important}.mt-17{margin-top:17rem!important}.mb-17{margin-bottom:17rem!important}.ml-17{margin-left:17rem!important}.mr-17{margin-right:17rem!important}.p-17{padding:17rem!important}.pt-17{padding-top:17rem!important}.pb-17{padding-bottom:17rem!important}.pl-17{padding-left:17rem!important}.pr-17{padding-right:17rem!important}.w-18{width:18rem!important}.h-18{height:18rem!important}.m-18{margin:18rem!important}.mt-18{margin-top:18rem!important}.mb-18{margin-bottom:18rem!important}.ml-18{margin-left:18rem!important}.mr-18{margin-right:18rem!important}.p-18{padding:18rem!important}.pt-18{padding-top:18rem!important}.pb-18{padding-bottom:18rem!important}.pl-18{padding-left:18rem!important}.pr-18{padding-right:18rem!important}.w-19{width:19rem!important}.h-19{height:19rem!important}.m-19{margin:19rem!important}.mt-19{margin-top:19rem!important}.mb-19{margin-bottom:19rem!important}.ml-19{margin-left:19rem!important}.mr-19{margin-right:19rem!important}.p-19{padding:19rem!important}.pt-19{padding-top:19rem!important}.pb-19{padding-bottom:19rem!important}.pl-19{padding-left:19rem!important}.pr-19{padding-right:19rem!important}.w-20{width:20rem!important}.h-20{height:20rem!important}.m-20{margin:20rem!important}.mt-20{margin-top:20rem!important}.mb-20{margin-bottom:20rem!important}.ml-20{margin-left:20rem!important}.mr-20{margin-right:20rem!important}.p-20{padding:20rem!important}.pt-20{padding-top:20rem!important}.pb-20{padding-bottom:20rem!important}.pl-20{padding-left:20rem!important}.pr-20{padding-right:20rem!important}.w-21{width:21rem!important}.h-21{height:21rem!important}.m-21{margin:21rem!important}.mt-21{margin-top:21rem!important}.mb-21{margin-bottom:21rem!important}.ml-21{margin-left:21rem!important}.mr-21{margin-right:21rem!important}.p-21{padding:21rem!important}.pt-21{padding-top:21rem!important}.pb-21{padding-bottom:21rem!important}.pl-21{padding-left:21rem!important}.pr-21{padding-right:21rem!important}.w-22{width:22rem!important}.h-22{height:22rem!important}.m-22{margin:22rem!important}.mt-22{margin-top:22rem!important}.mb-22{margin-bottom:22rem!important}.ml-22{margin-left:22rem!important}.mr-22{margin-right:22rem!important}.p-22{padding:22rem!important}.pt-22{padding-top:22rem!important}.pb-22{padding-bottom:22rem!important}.pl-22{padding-left:22rem!important}.pr-22{padding-right:22rem!important}.w-23{width:23rem!important}.h-23{height:23rem!important}.m-23{margin:23rem!important}.mt-23{margin-top:23rem!important}.mb-23{margin-bottom:23rem!important}.ml-23{margin-left:23rem!important}.mr-23{margin-right:23rem!important}.p-23{padding:23rem!important}.pt-23{padding-top:23rem!important}.pb-23{padding-bottom:23rem!important}.pl-23{padding-left:23rem!important}.pr-23{padding-right:23rem!important}.w-24{width:24rem!important}.h-24{height:24rem!important}.m-24{margin:24rem!important}.mt-24{margin-top:24rem!important}.mb-24{margin-bottom:24rem!important}.ml-24{margin-left:24rem!important}.mr-24{margin-right:24rem!important}.p-24{padding:24rem!important}.pt-24{padding-top:24rem!important}.pb-24{padding-bottom:24rem!important}.pl-24{padding-left:24rem!important}.pr-24{padding-right:24rem!important}.w-25{width:25rem!important}.h-25{height:25rem!important}.m-25{margin:25rem!important}.mt-25{margin-top:25rem!important}.mb-25{margin-bottom:25rem!important}.ml-25{margin-left:25rem!important}.mr-25{margin-right:25rem!important}.p-25{padding:25rem!important}.pt-25{padding-top:25rem!important}.pb-25{padding-bottom:25rem!important}.pl-25{padding-left:25rem!important}.pr-25{padding-right:25rem!important}.w-26{width:26rem!important}.h-26{height:26rem!important}.m-26{margin:26rem!important}.mt-26{margin-top:26rem!important}.mb-26{margin-bottom:26rem!important}.ml-26{margin-left:26rem!important}.mr-26{margin-right:26rem!important}.p-26{padding:26rem!important}.pt-26{padding-top:26rem!important}.pb-26{padding-bottom:26rem!important}.pl-26{padding-left:26rem!important}.pr-26{padding-right:26rem!important}.w-27{width:27rem!important}.h-27{height:27rem!important}.m-27{margin:27rem!important}.mt-27{margin-top:27rem!important}.mb-27{margin-bottom:27rem!important}.ml-27{margin-left:27rem!important}.mr-27{margin-right:27rem!important}.p-27{padding:27rem!important}.pt-27{padding-top:27rem!important}.pb-27{padding-bottom:27rem!important}.pl-27{padding-left:27rem!important}.pr-27{padding-right:27rem!important}.w-28{width:28rem!important}.h-28{height:28rem!important}.m-28{margin:28rem!important}.mt-28{margin-top:28rem!important}.mb-28{margin-bottom:28rem!important}.ml-28{margin-left:28rem!important}.mr-28{margin-right:28rem!important}.p-28{padding:28rem!important}.pt-28{padding-top:28rem!important}.pb-28{padding-bottom:28rem!important}.pl-28{padding-left:28rem!important}.pr-28{padding-right:28rem!important}.w-29{width:29rem!important}.h-29{height:29rem!important}.m-29{margin:29rem!important}.mt-29{margin-top:29rem!important}.mb-29{margin-bottom:29rem!important}.ml-29{margin-left:29rem!important}.mr-29{margin-right:29rem!important}.p-29{padding:29rem!important}.pt-29{padding-top:29rem!important}.pb-29{padding-bottom:29rem!important}.pl-29{padding-left:29rem!important}.pr-29{padding-right:29rem!important}.w-30{width:30rem!important}.h-30{height:30rem!important}.m-30{margin:30rem!important}.mt-30{margin-top:30rem!important}.mb-30{margin-bottom:30rem!important}.ml-30{margin-left:30rem!important}.mr-30{margin-right:30rem!important}.p-30{padding:30rem!important}.pt-30{padding-top:30rem!important}.pb-30{padding-bottom:30rem!important}.pl-30{padding-left:30rem!important}.pr-30{padding-right:30rem!important}.w-31{width:31rem!important}.h-31{height:31rem!important}.m-31{margin:31rem!important}.mt-31{margin-top:31rem!important}.mb-31{margin-bottom:31rem!important}.ml-31{margin-left:31rem!important}.mr-31{margin-right:31rem!important}.p-31{padding:31rem!important}.pt-31{padding-top:31rem!important}.pb-31{padding-bottom:31rem!important}.pl-31{padding-left:31rem!important}.pr-31{padding-right:31rem!important}.w-32{width:32rem!important}.h-32{height:32rem!important}.m-32{margin:32rem!important}.mt-32{margin-top:32rem!important}.mb-32{margin-bottom:32rem!important}.ml-32{margin-left:32rem!important}.mr-32{margin-right:32rem!important}.p-32{padding:32rem!important}.pt-32{padding-top:32rem!important}.pb-32{padding-bottom:32rem!important}.pl-32{padding-left:32rem!important}.pr-32{padding-right:32rem!important}.w-33{width:33rem!important}.h-33{height:33rem!important}.m-33{margin:33rem!important}.mt-33{margin-top:33rem!important}.mb-33{margin-bottom:33rem!important}.ml-33{margin-left:33rem!important}.mr-33{margin-right:33rem!important}.p-33{padding:33rem!important}.pt-33{padding-top:33rem!important}.pb-33{padding-bottom:33rem!important}.pl-33{padding-left:33rem!important}.pr-33{padding-right:33rem!important}.w-34{width:34rem!important}.h-34{height:34rem!important}.m-34{margin:34rem!important}.mt-34{margin-top:34rem!important}.mb-34{margin-bottom:34rem!important}.ml-34{margin-left:34rem!important}.mr-34{margin-right:34rem!important}.p-34{padding:34rem!important}.pt-34{padding-top:34rem!important}.pb-34{padding-bottom:34rem!important}.pl-34{padding-left:34rem!important}.pr-34{padding-right:34rem!important}.w-35{width:35rem!important}.h-35{height:35rem!important}.m-35{margin:35rem!important}.mt-35{margin-top:35rem!important}.mb-35{margin-bottom:35rem!important}.ml-35{margin-left:35rem!important}.mr-35{margin-right:35rem!important}.p-35{padding:35rem!important}.pt-35{padding-top:35rem!important}.pb-35{padding-bottom:35rem!important}.pl-35{padding-left:35rem!important}.pr-35{padding-right:35rem!important}.w-36{width:36rem!important}.h-36{height:36rem!important}.m-36{margin:36rem!important}.mt-36{margin-top:36rem!important}.mb-36{margin-bottom:36rem!important}.ml-36{margin-left:36rem!important}.mr-36{margin-right:36rem!important}.p-36{padding:36rem!important}.pt-36{padding-top:36rem!important}.pb-36{padding-bottom:36rem!important}.pl-36{padding-left:36rem!important}.pr-36{padding-right:36rem!important}.w-37{width:37rem!important}.h-37{height:37rem!important}.m-37{margin:37rem!important}.mt-37{margin-top:37rem!important}.mb-37{margin-bottom:37rem!important}.ml-37{margin-left:37rem!important}.mr-37{margin-right:37rem!important}.p-37{padding:37rem!important}.pt-37{padding-top:37rem!important}.pb-37{padding-bottom:37rem!important}.pl-37{padding-left:37rem!important}.pr-37{padding-right:37rem!important}.w-38{width:38rem!important}.h-38{height:38rem!important}.m-38{margin:38rem!important}.mt-38{margin-top:38rem!important}.mb-38{margin-bottom:38rem!important}.ml-38{margin-left:38rem!important}.mr-38{margin-right:38rem!important}.p-38{padding:38rem!important}.pt-38{padding-top:38rem!important}.pb-38{padding-bottom:38rem!important}.pl-38{padding-left:38rem!important}.pr-38{padding-right:38rem!important}.w-39{width:39rem!important}.h-39{height:39rem!important}.m-39{margin:39rem!important}.mt-39{margin-top:39rem!important}.mb-39{margin-bottom:39rem!important}.ml-39{margin-left:39rem!important}.mr-39{margin-right:39rem!important}.p-39{padding:39rem!important}.pt-39{padding-top:39rem!important}.pb-39{padding-bottom:39rem!important}.pl-39{padding-left:39rem!important}.pr-39{padding-right:39rem!important}.w-40{width:40rem!important}.h-40{height:40rem!important}.m-40{margin:40rem!important}.mt-40{margin-top:40rem!important}.mb-40{margin-bottom:40rem!important}.ml-40{margin-left:40rem!important}.mr-40{margin-right:40rem!important}.p-40{padding:40rem!important}.pt-40{padding-top:40rem!important}.pb-40{padding-bottom:40rem!important}.pl-40{padding-left:40rem!important}.pr-40{padding-right:40rem!important}.w-41{width:41rem!important}.h-41{height:41rem!important}.m-41{margin:41rem!important}.mt-41{margin-top:41rem!important}.mb-41{margin-bottom:41rem!important}.ml-41{margin-left:41rem!important}.mr-41{margin-right:41rem!important}.p-41{padding:41rem!important}.pt-41{padding-top:41rem!important}.pb-41{padding-bottom:41rem!important}.pl-41{padding-left:41rem!important}.pr-41{padding-right:41rem!important}.w-42{width:42rem!important}.h-42{height:42rem!important}.m-42{margin:42rem!important}.mt-42{margin-top:42rem!important}.mb-42{margin-bottom:42rem!important}.ml-42{margin-left:42rem!important}.mr-42{margin-right:42rem!important}.p-42{padding:42rem!important}.pt-42{padding-top:42rem!important}.pb-42{padding-bottom:42rem!important}.pl-42{padding-left:42rem!important}.pr-42{padding-right:42rem!important}.w-43{width:43rem!important}.h-43{height:43rem!important}.m-43{margin:43rem!important}.mt-43{margin-top:43rem!important}.mb-43{margin-bottom:43rem!important}.ml-43{margin-left:43rem!important}.mr-43{margin-right:43rem!important}.p-43{padding:43rem!important}.pt-43{padding-top:43rem!important}.pb-43{padding-bottom:43rem!important}.pl-43{padding-left:43rem!important}.pr-43{padding-right:43rem!important}.w-44{width:44rem!important}.h-44{height:44rem!important}.m-44{margin:44rem!important}.mt-44{margin-top:44rem!important}.mb-44{margin-bottom:44rem!important}.ml-44{margin-left:44rem!important}.mr-44{margin-right:44rem!important}.p-44{padding:44rem!important}.pt-44{padding-top:44rem!important}.pb-44{padding-bottom:44rem!important}.pl-44{padding-left:44rem!important}.pr-44{padding-right:44rem!important}.w-45{width:45rem!important}.h-45{height:45rem!important}.m-45{margin:45rem!important}.mt-45{margin-top:45rem!important}.mb-45{margin-bottom:45rem!important}.ml-45{margin-left:45rem!important}.mr-45{margin-right:45rem!important}.p-45{padding:45rem!important}.pt-45{padding-top:45rem!important}.pb-45{padding-bottom:45rem!important}.pl-45{padding-left:45rem!important}.pr-45{padding-right:45rem!important}.w-46{width:46rem!important}.h-46{height:46rem!important}.m-46{margin:46rem!important}.mt-46{margin-top:46rem!important}.mb-46{margin-bottom:46rem!important}.ml-46{margin-left:46rem!important}.mr-46{margin-right:46rem!important}.p-46{padding:46rem!important}.pt-46{padding-top:46rem!important}.pb-46{padding-bottom:46rem!important}.pl-46{padding-left:46rem!important}.pr-46{padding-right:46rem!important}.w-47{width:47rem!important}.h-47{height:47rem!important}.m-47{margin:47rem!important}.mt-47{margin-top:47rem!important}.mb-47{margin-bottom:47rem!important}.ml-47{margin-left:47rem!important}.mr-47{margin-right:47rem!important}.p-47{padding:47rem!important}.pt-47{padding-top:47rem!important}.pb-47{padding-bottom:47rem!important}.pl-47{padding-left:47rem!important}.pr-47{padding-right:47rem!important}.w-48{width:48rem!important}.h-48{height:48rem!important}.m-48{margin:48rem!important}.mt-48{margin-top:48rem!important}.mb-48{margin-bottom:48rem!important}.ml-48{margin-left:48rem!important}.mr-48{margin-right:48rem!important}.p-48{padding:48rem!important}.pt-48{padding-top:48rem!important}.pb-48{padding-bottom:48rem!important}.pl-48{padding-left:48rem!important}.pr-48{padding-right:48rem!important}.w-49{width:49rem!important}.h-49{height:49rem!important}.m-49{margin:49rem!important}.mt-49{margin-top:49rem!important}.mb-49{margin-bottom:49rem!important}.ml-49{margin-left:49rem!important}.mr-49{margin-right:49rem!important}.p-49{padding:49rem!important}.pt-49{padding-top:49rem!important}.pb-49{padding-bottom:49rem!important}.pl-49{padding-left:49rem!important}.pr-49{padding-right:49rem!important}.w-50{width:50rem!important}.h-50{height:50rem!important}.m-50{margin:50rem!important}.mt-50{margin-top:50rem!important}.mb-50{margin-bottom:50rem!important}.ml-50{margin-left:50rem!important}.mr-50{margin-right:50rem!important}.p-50{padding:50rem!important}.pt-50{padding-top:50rem!important}.pb-50{padding-bottom:50rem!important}.pl-50{padding-left:50rem!important}.pr-50{padding-right:50rem!important}.w-51{width:51rem!important}.h-51{height:51rem!important}.m-51{margin:51rem!important}.mt-51{margin-top:51rem!important}.mb-51{margin-bottom:51rem!important}.ml-51{margin-left:51rem!important}.mr-51{margin-right:51rem!important}.p-51{padding:51rem!important}.pt-51{padding-top:51rem!important}.pb-51{padding-bottom:51rem!important}.pl-51{padding-left:51rem!important}.pr-51{padding-right:51rem!important}.w-52{width:52rem!important}.h-52{height:52rem!important}.m-52{margin:52rem!important}.mt-52{margin-top:52rem!important}.mb-52{margin-bottom:52rem!important}.ml-52{margin-left:52rem!important}.mr-52{margin-right:52rem!important}.p-52{padding:52rem!important}.pt-52{padding-top:52rem!important}.pb-52{padding-bottom:52rem!important}.pl-52{padding-left:52rem!important}.pr-52{padding-right:52rem!important}.w-53{width:53rem!important}.h-53{height:53rem!important}.m-53{margin:53rem!important}.mt-53{margin-top:53rem!important}.mb-53{margin-bottom:53rem!important}.ml-53{margin-left:53rem!important}.mr-53{margin-right:53rem!important}.p-53{padding:53rem!important}.pt-53{padding-top:53rem!important}.pb-53{padding-bottom:53rem!important}.pl-53{padding-left:53rem!important}.pr-53{padding-right:53rem!important}.w-54{width:54rem!important}.h-54{height:54rem!important}.m-54{margin:54rem!important}.mt-54{margin-top:54rem!important}.mb-54{margin-bottom:54rem!important}.ml-54{margin-left:54rem!important}.mr-54{margin-right:54rem!important}.p-54{padding:54rem!important}.pt-54{padding-top:54rem!important}.pb-54{padding-bottom:54rem!important}.pl-54{padding-left:54rem!important}.pr-54{padding-right:54rem!important}.w-55{width:55rem!important}.h-55{height:55rem!important}.m-55{margin:55rem!important}.mt-55{margin-top:55rem!important}.mb-55{margin-bottom:55rem!important}.ml-55{margin-left:55rem!important}.mr-55{margin-right:55rem!important}.p-55{padding:55rem!important}.pt-55{padding-top:55rem!important}.pb-55{padding-bottom:55rem!important}.pl-55{padding-left:55rem!important}.pr-55{padding-right:55rem!important}.w-56{width:56rem!important}.h-56{height:56rem!important}.m-56{margin:56rem!important}.mt-56{margin-top:56rem!important}.mb-56{margin-bottom:56rem!important}.ml-56{margin-left:56rem!important}.mr-56{margin-right:56rem!important}.p-56{padding:56rem!important}.pt-56{padding-top:56rem!important}.pb-56{padding-bottom:56rem!important}.pl-56{padding-left:56rem!important}.pr-56{padding-right:56rem!important}.w-57{width:57rem!important}.h-57{height:57rem!important}.m-57{margin:57rem!important}.mt-57{margin-top:57rem!important}.mb-57{margin-bottom:57rem!important}.ml-57{margin-left:57rem!important}.mr-57{margin-right:57rem!important}.p-57{padding:57rem!important}.pt-57{padding-top:57rem!important}.pb-57{padding-bottom:57rem!important}.pl-57{padding-left:57rem!important}.pr-57{padding-right:57rem!important}.w-58{width:58rem!important}.h-58{height:58rem!important}.m-58{margin:58rem!important}.mt-58{margin-top:58rem!important}.mb-58{margin-bottom:58rem!important}.ml-58{margin-left:58rem!important}.mr-58{margin-right:58rem!important}.p-58{padding:58rem!important}.pt-58{padding-top:58rem!important}.pb-58{padding-bottom:58rem!important}.pl-58{padding-left:58rem!important}.pr-58{padding-right:58rem!important}.w-59{width:59rem!important}.h-59{height:59rem!important}.m-59{margin:59rem!important}.mt-59{margin-top:59rem!important}.mb-59{margin-bottom:59rem!important}.ml-59{margin-left:59rem!important}.mr-59{margin-right:59rem!important}.p-59{padding:59rem!important}.pt-59{padding-top:59rem!important}.pb-59{padding-bottom:59rem!important}.pl-59{padding-left:59rem!important}.pr-59{padding-right:59rem!important}.w-60{width:60rem!important}.h-60{height:60rem!important}.m-60{margin:60rem!important}.mt-60{margin-top:60rem!important}.mb-60{margin-bottom:60rem!important}.ml-60{margin-left:60rem!important}.mr-60{margin-right:60rem!important}.p-60{padding:60rem!important}.pt-60{padding-top:60rem!important}.pb-60{padding-bottom:60rem!important}.pl-60{padding-left:60rem!important}.pr-60{padding-right:60rem!important}.w-61{width:61rem!important}.h-61{height:61rem!important}.m-61{margin:61rem!important}.mt-61{margin-top:61rem!important}.mb-61{margin-bottom:61rem!important}.ml-61{margin-left:61rem!important}.mr-61{margin-right:61rem!important}.p-61{padding:61rem!important}.pt-61{padding-top:61rem!important}.pb-61{padding-bottom:61rem!important}.pl-61{padding-left:61rem!important}.pr-61{padding-right:61rem!important}.w-62{width:62rem!important}.h-62{height:62rem!important}.m-62{margin:62rem!important}.mt-62{margin-top:62rem!important}.mb-62{margin-bottom:62rem!important}.ml-62{margin-left:62rem!important}.mr-62{margin-right:62rem!important}.p-62{padding:62rem!important}.pt-62{padding-top:62rem!important}.pb-62{padding-bottom:62rem!important}.pl-62{padding-left:62rem!important}.pr-62{padding-right:62rem!important}.w-63{width:63rem!important}.h-63{height:63rem!important}.m-63{margin:63rem!important}.mt-63{margin-top:63rem!important}.mb-63{margin-bottom:63rem!important}.ml-63{margin-left:63rem!important}.mr-63{margin-right:63rem!important}.p-63{padding:63rem!important}.pt-63{padding-top:63rem!important}.pb-63{padding-bottom:63rem!important}.pl-63{padding-left:63rem!important}.pr-63{padding-right:63rem!important}.w-64{width:64rem!important}.h-64{height:64rem!important}.m-64{margin:64rem!important}.mt-64{margin-top:64rem!important}.mb-64{margin-bottom:64rem!important}.ml-64{margin-left:64rem!important}.mr-64{margin-right:64rem!important}.p-64{padding:64rem!important}.pt-64{padding-top:64rem!important}.pb-64{padding-bottom:64rem!important}.pl-64{padding-left:64rem!important}.pr-64{padding-right:64rem!important}.w-65{width:65rem!important}.h-65{height:65rem!important}.m-65{margin:65rem!important}.mt-65{margin-top:65rem!important}.mb-65{margin-bottom:65rem!important}.ml-65{margin-left:65rem!important}.mr-65{margin-right:65rem!important}.p-65{padding:65rem!important}.pt-65{padding-top:65rem!important}.pb-65{padding-bottom:65rem!important}.pl-65{padding-left:65rem!important}.pr-65{padding-right:65rem!important}.w-66{width:66rem!important}.h-66{height:66rem!important}.m-66{margin:66rem!important}.mt-66{margin-top:66rem!important}.mb-66{margin-bottom:66rem!important}.ml-66{margin-left:66rem!important}.mr-66{margin-right:66rem!important}.p-66{padding:66rem!important}.pt-66{padding-top:66rem!important}.pb-66{padding-bottom:66rem!important}.pl-66{padding-left:66rem!important}.pr-66{padding-right:66rem!important}.w-67{width:67rem!important}.h-67{height:67rem!important}.m-67{margin:67rem!important}.mt-67{margin-top:67rem!important}.mb-67{margin-bottom:67rem!important}.ml-67{margin-left:67rem!important}.mr-67{margin-right:67rem!important}.p-67{padding:67rem!important}.pt-67{padding-top:67rem!important}.pb-67{padding-bottom:67rem!important}.pl-67{padding-left:67rem!important}.pr-67{padding-right:67rem!important}.w-68{width:68rem!important}.h-68{height:68rem!important}.m-68{margin:68rem!important}.mt-68{margin-top:68rem!important}.mb-68{margin-bottom:68rem!important}.ml-68{margin-left:68rem!important}.mr-68{margin-right:68rem!important}.p-68{padding:68rem!important}.pt-68{padding-top:68rem!important}.pb-68{padding-bottom:68rem!important}.pl-68{padding-left:68rem!important}.pr-68{padding-right:68rem!important}.w-69{width:69rem!important}.h-69{height:69rem!important}.m-69{margin:69rem!important}.mt-69{margin-top:69rem!important}.mb-69{margin-bottom:69rem!important}.ml-69{margin-left:69rem!important}.mr-69{margin-right:69rem!important}.p-69{padding:69rem!important}.pt-69{padding-top:69rem!important}.pb-69{padding-bottom:69rem!important}.pl-69{padding-left:69rem!important}.pr-69{padding-right:69rem!important}.w-70{width:70rem!important}.h-70{height:70rem!important}.m-70{margin:70rem!important}.mt-70{margin-top:70rem!important}.mb-70{margin-bottom:70rem!important}.ml-70{margin-left:70rem!important}.mr-70{margin-right:70rem!important}.p-70{padding:70rem!important}.pt-70{padding-top:70rem!important}.pb-70{padding-bottom:70rem!important}.pl-70{padding-left:70rem!important}.pr-70{padding-right:70rem!important}.w-71{width:71rem!important}.h-71{height:71rem!important}.m-71{margin:71rem!important}.mt-71{margin-top:71rem!important}.mb-71{margin-bottom:71rem!important}.ml-71{margin-left:71rem!important}.mr-71{margin-right:71rem!important}.p-71{padding:71rem!important}.pt-71{padding-top:71rem!important}.pb-71{padding-bottom:71rem!important}.pl-71{padding-left:71rem!important}.pr-71{padding-right:71rem!important}.w-72{width:72rem!important}.h-72{height:72rem!important}.m-72{margin:72rem!important}.mt-72{margin-top:72rem!important}.mb-72{margin-bottom:72rem!important}.ml-72{margin-left:72rem!important}.mr-72{margin-right:72rem!important}.p-72{padding:72rem!important}.pt-72{padding-top:72rem!important}.pb-72{padding-bottom:72rem!important}.pl-72{padding-left:72rem!important}.pr-72{padding-right:72rem!important}.w-73{width:73rem!important}.h-73{height:73rem!important}.m-73{margin:73rem!important}.mt-73{margin-top:73rem!important}.mb-73{margin-bottom:73rem!important}.ml-73{margin-left:73rem!important}.mr-73{margin-right:73rem!important}.p-73{padding:73rem!important}.pt-73{padding-top:73rem!important}.pb-73{padding-bottom:73rem!important}.pl-73{padding-left:73rem!important}.pr-73{padding-right:73rem!important}.w-74{width:74rem!important}.h-74{height:74rem!important}.m-74{margin:74rem!important}.mt-74{margin-top:74rem!important}.mb-74{margin-bottom:74rem!important}.ml-74{margin-left:74rem!important}.mr-74{margin-right:74rem!important}.p-74{padding:74rem!important}.pt-74{padding-top:74rem!important}.pb-74{padding-bottom:74rem!important}.pl-74{padding-left:74rem!important}.pr-74{padding-right:74rem!important}.w-75{width:75rem!important}.h-75{height:75rem!important}.m-75{margin:75rem!important}.mt-75{margin-top:75rem!important}.mb-75{margin-bottom:75rem!important}.ml-75{margin-left:75rem!important}.mr-75{margin-right:75rem!important}.p-75{padding:75rem!important}.pt-75{padding-top:75rem!important}.pb-75{padding-bottom:75rem!important}.pl-75{padding-left:75rem!important}.pr-75{padding-right:75rem!important}.w-76{width:76rem!important}.h-76{height:76rem!important}.m-76{margin:76rem!important}.mt-76{margin-top:76rem!important}.mb-76{margin-bottom:76rem!important}.ml-76{margin-left:76rem!important}.mr-76{margin-right:76rem!important}.p-76{padding:76rem!important}.pt-76{padding-top:76rem!important}.pb-76{padding-bottom:76rem!important}.pl-76{padding-left:76rem!important}.pr-76{padding-right:76rem!important}.w-77{width:77rem!important}.h-77{height:77rem!important}.m-77{margin:77rem!important}.mt-77{margin-top:77rem!important}.mb-77{margin-bottom:77rem!important}.ml-77{margin-left:77rem!important}.mr-77{margin-right:77rem!important}.p-77{padding:77rem!important}.pt-77{padding-top:77rem!important}.pb-77{padding-bottom:77rem!important}.pl-77{padding-left:77rem!important}.pr-77{padding-right:77rem!important}.w-78{width:78rem!important}.h-78{height:78rem!important}.m-78{margin:78rem!important}.mt-78{margin-top:78rem!important}.mb-78{margin-bottom:78rem!important}.ml-78{margin-left:78rem!important}.mr-78{margin-right:78rem!important}.p-78{padding:78rem!important}.pt-78{padding-top:78rem!important}.pb-78{padding-bottom:78rem!important}.pl-78{padding-left:78rem!important}.pr-78{padding-right:78rem!important}.w-79{width:79rem!important}.h-79{height:79rem!important}.m-79{margin:79rem!important}.mt-79{margin-top:79rem!important}.mb-79{margin-bottom:79rem!important}.ml-79{margin-left:79rem!important}.mr-79{margin-right:79rem!important}.p-79{padding:79rem!important}.pt-79{padding-top:79rem!important}.pb-79{padding-bottom:79rem!important}.pl-79{padding-left:79rem!important}.pr-79{padding-right:79rem!important}.w-80{width:80rem!important}.h-80{height:80rem!important}.m-80{margin:80rem!important}.mt-80{margin-top:80rem!important}.mb-80{margin-bottom:80rem!important}.ml-80{margin-left:80rem!important}.mr-80{margin-right:80rem!important}.p-80{padding:80rem!important}.pt-80{padding-top:80rem!important}.pb-80{padding-bottom:80rem!important}.pl-80{padding-left:80rem!important}.pr-80{padding-right:80rem!important}.w-81{width:81rem!important}.h-81{height:81rem!important}.m-81{margin:81rem!important}.mt-81{margin-top:81rem!important}.mb-81{margin-bottom:81rem!important}.ml-81{margin-left:81rem!important}.mr-81{margin-right:81rem!important}.p-81{padding:81rem!important}.pt-81{padding-top:81rem!important}.pb-81{padding-bottom:81rem!important}.pl-81{padding-left:81rem!important}.pr-81{padding-right:81rem!important}.w-82{width:82rem!important}.h-82{height:82rem!important}.m-82{margin:82rem!important}.mt-82{margin-top:82rem!important}.mb-82{margin-bottom:82rem!important}.ml-82{margin-left:82rem!important}.mr-82{margin-right:82rem!important}.p-82{padding:82rem!important}.pt-82{padding-top:82rem!important}.pb-82{padding-bottom:82rem!important}.pl-82{padding-left:82rem!important}.pr-82{padding-right:82rem!important}.w-83{width:83rem!important}.h-83{height:83rem!important}.m-83{margin:83rem!important}.mt-83{margin-top:83rem!important}.mb-83{margin-bottom:83rem!important}.ml-83{margin-left:83rem!important}.mr-83{margin-right:83rem!important}.p-83{padding:83rem!important}.pt-83{padding-top:83rem!important}.pb-83{padding-bottom:83rem!important}.pl-83{padding-left:83rem!important}.pr-83{padding-right:83rem!important}.w-84{width:84rem!important}.h-84{height:84rem!important}.m-84{margin:84rem!important}.mt-84{margin-top:84rem!important}.mb-84{margin-bottom:84rem!important}.ml-84{margin-left:84rem!important}.mr-84{margin-right:84rem!important}.p-84{padding:84rem!important}.pt-84{padding-top:84rem!important}.pb-84{padding-bottom:84rem!important}.pl-84{padding-left:84rem!important}.pr-84{padding-right:84rem!important}.w-85{width:85rem!important}.h-85{height:85rem!important}.m-85{margin:85rem!important}.mt-85{margin-top:85rem!important}.mb-85{margin-bottom:85rem!important}.ml-85{margin-left:85rem!important}.mr-85{margin-right:85rem!important}.p-85{padding:85rem!important}.pt-85{padding-top:85rem!important}.pb-85{padding-bottom:85rem!important}.pl-85{padding-left:85rem!important}.pr-85{padding-right:85rem!important}.w-86{width:86rem!important}.h-86{height:86rem!important}.m-86{margin:86rem!important}.mt-86{margin-top:86rem!important}.mb-86{margin-bottom:86rem!important}.ml-86{margin-left:86rem!important}.mr-86{margin-right:86rem!important}.p-86{padding:86rem!important}.pt-86{padding-top:86rem!important}.pb-86{padding-bottom:86rem!important}.pl-86{padding-left:86rem!important}.pr-86{padding-right:86rem!important}.w-87{width:87rem!important}.h-87{height:87rem!important}.m-87{margin:87rem!important}.mt-87{margin-top:87rem!important}.mb-87{margin-bottom:87rem!important}.ml-87{margin-left:87rem!important}.mr-87{margin-right:87rem!important}.p-87{padding:87rem!important}.pt-87{padding-top:87rem!important}.pb-87{padding-bottom:87rem!important}.pl-87{padding-left:87rem!important}.pr-87{padding-right:87rem!important}.w-88{width:88rem!important}.h-88{height:88rem!important}.m-88{margin:88rem!important}.mt-88{margin-top:88rem!important}.mb-88{margin-bottom:88rem!important}.ml-88{margin-left:88rem!important}.mr-88{margin-right:88rem!important}.p-88{padding:88rem!important}.pt-88{padding-top:88rem!important}.pb-88{padding-bottom:88rem!important}.pl-88{padding-left:88rem!important}.pr-88{padding-right:88rem!important}.w-89{width:89rem!important}.h-89{height:89rem!important}.m-89{margin:89rem!important}.mt-89{margin-top:89rem!important}.mb-89{margin-bottom:89rem!important}.ml-89{margin-left:89rem!important}.mr-89{margin-right:89rem!important}.p-89{padding:89rem!important}.pt-89{padding-top:89rem!important}.pb-89{padding-bottom:89rem!important}.pl-89{padding-left:89rem!important}.pr-89{padding-right:89rem!important}.w-90{width:90rem!important}.h-90{height:90rem!important}.m-90{margin:90rem!important}.mt-90{margin-top:90rem!important}.mb-90{margin-bottom:90rem!important}.ml-90{margin-left:90rem!important}.mr-90{margin-right:90rem!important}.p-90{padding:90rem!important}.pt-90{padding-top:90rem!important}.pb-90{padding-bottom:90rem!important}.pl-90{padding-left:90rem!important}.pr-90{padding-right:90rem!important}.w-91{width:91rem!important}.h-91{height:91rem!important}.m-91{margin:91rem!important}.mt-91{margin-top:91rem!important}.mb-91{margin-bottom:91rem!important}.ml-91{margin-left:91rem!important}.mr-91{margin-right:91rem!important}.p-91{padding:91rem!important}.pt-91{padding-top:91rem!important}.pb-91{padding-bottom:91rem!important}.pl-91{padding-left:91rem!important}.pr-91{padding-right:91rem!important}.w-92{width:92rem!important}.h-92{height:92rem!important}.m-92{margin:92rem!important}.mt-92{margin-top:92rem!important}.mb-92{margin-bottom:92rem!important}.ml-92{margin-left:92rem!important}.mr-92{margin-right:92rem!important}.p-92{padding:92rem!important}.pt-92{padding-top:92rem!important}.pb-92{padding-bottom:92rem!important}.pl-92{padding-left:92rem!important}.pr-92{padding-right:92rem!important}.w-93{width:93rem!important}.h-93{height:93rem!important}.m-93{margin:93rem!important}.mt-93{margin-top:93rem!important}.mb-93{margin-bottom:93rem!important}.ml-93{margin-left:93rem!important}.mr-93{margin-right:93rem!important}.p-93{padding:93rem!important}.pt-93{padding-top:93rem!important}.pb-93{padding-bottom:93rem!important}.pl-93{padding-left:93rem!important}.pr-93{padding-right:93rem!important}.w-94{width:94rem!important}.h-94{height:94rem!important}.m-94{margin:94rem!important}.mt-94{margin-top:94rem!important}.mb-94{margin-bottom:94rem!important}.ml-94{margin-left:94rem!important}.mr-94{margin-right:94rem!important}.p-94{padding:94rem!important}.pt-94{padding-top:94rem!important}.pb-94{padding-bottom:94rem!important}.pl-94{padding-left:94rem!important}.pr-94{padding-right:94rem!important}.w-95{width:95rem!important}.h-95{height:95rem!important}.m-95{margin:95rem!important}.mt-95{margin-top:95rem!important}.mb-95{margin-bottom:95rem!important}.ml-95{margin-left:95rem!important}.mr-95{margin-right:95rem!important}.p-95{padding:95rem!important}.pt-95{padding-top:95rem!important}.pb-95{padding-bottom:95rem!important}.pl-95{padding-left:95rem!important}.pr-95{padding-right:95rem!important}.w-96{width:96rem!important}.h-96{height:96rem!important}.m-96{margin:96rem!important}.mt-96{margin-top:96rem!important}.mb-96{margin-bottom:96rem!important}.ml-96{margin-left:96rem!important}.mr-96{margin-right:96rem!important}.p-96{padding:96rem!important}.pt-96{padding-top:96rem!important}.pb-96{padding-bottom:96rem!important}.pl-96{padding-left:96rem!important}.pr-96{padding-right:96rem!important}.w-97{width:97rem!important}.h-97{height:97rem!important}.m-97{margin:97rem!important}.mt-97{margin-top:97rem!important}.mb-97{margin-bottom:97rem!important}.ml-97{margin-left:97rem!important}.mr-97{margin-right:97rem!important}.p-97{padding:97rem!important}.pt-97{padding-top:97rem!important}.pb-97{padding-bottom:97rem!important}.pl-97{padding-left:97rem!important}.pr-97{padding-right:97rem!important}.w-98{width:98rem!important}.h-98{height:98rem!important}.m-98{margin:98rem!important}.mt-98{margin-top:98rem!important}.mb-98{margin-bottom:98rem!important}.ml-98{margin-left:98rem!important}.mr-98{margin-right:98rem!important}.p-98{padding:98rem!important}.pt-98{padding-top:98rem!important}.pb-98{padding-bottom:98rem!important}.pl-98{padding-left:98rem!important}.pr-98{padding-right:98rem!important}.w-99{width:99rem!important}.h-99{height:99rem!important}.m-99{margin:99rem!important}.mt-99{margin-top:99rem!important}.mb-99{margin-bottom:99rem!important}.ml-99{margin-left:99rem!important}.mr-99{margin-right:99rem!important}.p-99{padding:99rem!important}.pt-99{padding-top:99rem!important}.pb-99{padding-bottom:99rem!important}.pl-99{padding-left:99rem!important}.pr-99{padding-right:99rem!important}*{box-sizing:border-box}html{font-size:4px}ul{list-style-type:none}ul,ul li{padding:0}.select-dropdown[disabled],input[disabled],label[disabled],select[disabled],textarea[disabled]{opacity:.4;border-color:#aaa}input.input-sm{font-size:3rem;padding:6px;border-width:1px}.input-group-radio input[type=radio]{position:relative;top:-9999px}.input-group-radio label{display:inline-block;padding-top:2rem;background-color:#ececec;color:#b0b0b0;font-weight:700}.input-group-radio label.radio-active{color:#fff;background-color:#000}.panini{border-top:12px solid #d8d8d8;border-bottom:12px solid #d8d8d8;height:36px;width:36px}.liang{border-radius:100%;width:9rem;height:9rem;border:3rem solid #9b9b9b}.cross{position:relative;display:inline-block;width:35px;height:35px}.cross:before{left:-12px;transform:rotate(45deg)}.cross:after,.cross:before{position:absolute;top:7px;width:35px;height:35px;border-top:10px solid #000;border-color:inherit;content:""}.cross:after{left:13px;transform:rotate(-45deg)}.text-gray{color:#9b9b9b}.relative{position:relative}.inline{display:inline}.block{display:block}input,textarea{outline:none}.select-dropdown{border:6px solid #000;background-color:#fff;text-align:center}.select-dropdown select{padding:0;height:18rem;color:#fff;background-color:#000;border-radius:0;text-align-last:center}.select-dropdown select,.select-icon{line-height:18rem;font-size:9rem;font-weight:700}.select-icon{padding:0 5rem}button.disabled{color:#fff;cursor:inherit}.flex{display:flex}.inline-block{display:inline-block}.space-between{justify-content:space-between}.pointer{cursor:pointer}.hide{display:none}[urb-component-header]{line-height:40px}.sidebar{position:absolute;right:24rem;top:48rem}.menu-main{display:flex}.menu-main .panini{margin-right:11rem}.menu-main .panini .menu-main .liang{cursor:pointer}.nav-main{position:fixed;display:flex;bottom:4rem;width:960px;justify-content:center;list-style-type:none}.nav-main li{margin:0 2rem}.header-container{padding:12rem 2rem 9rem}.header-main{display:flex;align-items:center}.header-page{text-decoration:underline;color:#9b9b9b;display:inline}.header-subpage{display:flex;align-items:center}.header-sep{margin:0 12rem;display:inline}.header-settings{margin-left:30rem}.inbox-feed{height:10rem;position:relative;top:1px}.page-notes-edit textarea{border:none;height:800px}.page-notes-index h1{margin-top:0}.notes-actions .btn-secondary{margin-right:10rem}.note-timestamp{position:absolute;left:-16rem;top:3rem}.notes-blurbs{margin-top:8rem}.notes-blurbs li{display:flex;position:relative;margin:4rem 0}.create-stream-page .minus,.create-stream-page .plus{font-size:28px;font-weight:700;cursor:pointer}.create-stream-page .plus{line-height:41px}.create-stream-page .input-group i{padding-top:2rem}.create-stream-page textarea{border:6px solid #000}.create-stream-page input[type=text]{border:3px solid #000}.create-stream-page input[type=text].input-text-lg{border:6px solid #000;font-size:9rem;line-height:18rem;padding:0 4rem}.create-stream-page label{font-size:6rem;line-height:9rem;font-weight:500}.create-stream-page .input-group-radio label{padding-top:0;height:18rem;width:38rem;font-size:9rem;line-height:18rem;text-align:center}.chat-container .col-sm-2{flex-basis:43rem;max-width:43rem}.chat-input-field[type=text]{border:none;padding:0;line-height:6rem}.chat-input-field:placeholder{color:#b0b0b0}.chat-sep{text-align:center;font-weight:600;margin:4rem}.chat-msg-app,.chat-msg-app *{color:#9b9b9b}.cir-status{width:2rem;height:2rem;border-radius:100%;display:inline-block;position:relative;bottom:1px}.cir-green{background-color:#8eee9c}.cir-black,.cir-grey{background-color:#b0b0b0}.cir-red{background-color:#f44}.chat-scrollpane-view{display:flex;flex-direction:column}.chat-scrollpane-view>*{flex-shrink:0}.chat-scrollpane-view>:first-child{margin-top:auto!important}.scrollpane{height:600px;overflow-y:scroll;overflow-x:hidden;display:flex;flex-direction:column}.scrollpane>*{flex-shrink:0}.scrollpane>:first-child{margin-top:auto!important}textarea.post-edit{height:80%;border:none;resize:none;padding:8rem 12rem}textarea.comment-edit{border:none;resize:none;padding:0}.coms ol{counter-reset:a -1}.coms ol>li:before{font-weight:400;position:absolute;font-family:Source Code Pro,Roboto mono,Courier New,monospace;color:#9b9b9b}.coms ol>li>div.da{color:#9b9b9b}.create-comment button.disabled{display:none}.create-comment .usership{color:#000}div.coll-title,div.mod{font-size:6rem}.collection-index li.forum:before{content:"•";position:absolute;font-size:10rem;margin-left:-12rem;margin-top:9rem}.collection-index li.forum .meta-cont>div{float:left}.collection-index li.blog:before{content:"•";position:absolute;font-size:10rem;margin-left:-12rem;margin-top:11rem}.collection-index li.notes .da{position:absolute;margin-left:-12rem;margin-top:1rem}.collection-index .note-uuid{font-weight:inherit}.collection-index img,.post img{width:100%}.post #edit{display:none}.profile li.profile:before{content:"•";position:absolute;font-size:10rem;margin-left:-12rem;margin-top:4rem}.menu-page{margin-top:48px;margin-left:-166px}.menu-page .circle{padding:0;border-width:8px;height:30px;width:30px}.menu-anchor{display:flex;align-items:center;text-decoration:none}.menu-canvas{position:absolute;left:0;right:0;top:0;bottom:0;background-color:#fff},.menu-canvas .cross,.menu-canvas .cross:after,.menu-canvas .cross:before{border-color:red!important} \ No newline at end of file diff --git a/web/pages/nutalk/js/index.js b/web/pages/nutalk/js/index.js index 037bf4bc15..949b6d95bb 100644 --- a/web/pages/nutalk/js/index.js +++ b/web/pages/nutalk/js/index.js @@ -7732,6 +7732,17 @@ define(String.prototype, "padRight", "".padEnd); [][key] && define(Array, key, Function.call.bind([][key])); }); +Object.arrayify = function (obj) { + var ret = []; + Object.keys(obj).forEach(function (key) { + ret.push({ + key: key, + value: obj[key] + }); + }); + return ret; +}; + function _AwaitValue(value) { this.wrapped = value; } @@ -7870,6 +7881,24 @@ function _defineProperty(obj, key, value) { return obj; } +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); @@ -7898,16 +7927,6 @@ function _possibleConstructorReturn(self, call) { return self; } -function _toConsumableArray(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } else { - return Array.from(arr); - } -} - /* object-assign (c) Sindre Sorhus @@ -8077,23 +8096,23 @@ var emptyFunction$1 = Object.freeze({ var require$$0$30 = ( objectAssign$2 && objectAssign ) || objectAssign$2; -var require$$11 = ( emptyObject$1 && emptyObject_1 ) || emptyObject$1; +var require$$10 = ( emptyObject$1 && emptyObject_1 ) || emptyObject$1; var emptyFunction$2 = ( emptyFunction$1 && emptyFunction_1 ) || emptyFunction$1; -'use strict';var q="function"===typeof Symbol&&Symbol["for"]; var r=q?Symbol["for"]("react.element"):60103; var t=q?Symbol["for"]("react.call"):60104; var u=q?Symbol["for"]("react.return"):60105; var v=q?Symbol["for"]("react.portal"):60106; var w=q?Symbol["for"]("react.fragment"):60107; var x="function"===typeof Symbol&&Symbol.iterator; -function y(a){for(var b=arguments.length-1,e="Minified React error #"+a+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d"+a,c=0;cM.length&&M.push(a);} -function P(a,b,e,c){var d=typeof a;if("undefined"===d||"boolean"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case r:case t:case u:case v:g=!0;}}if(g)return e(c,a,""===b?"."+Q(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var k=0;kN.length&&N.push(a);} +function Q(a,b,e,c){var d=typeof a;if("undefined"===d||"boolean"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case r:case t:g=!0;}}if(g)return e(c,a,""===b?"."+R(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var h=0;h=g.hasBooleanValue+g.hasNumericValue+g.hasOverloadedBooleanValue?void 0:E$1("50",f);e.hasOwnProperty(f)&&(g.attributeName=e[f]);d.hasOwnProperty(f)&&(g.attributeNamespace=d[f]);a.hasOwnProperty(f)&&(g.mutationMethod=a[f]);ua[f]=g;}}}; -var ua={}; -function va(a,b){if(oa.hasOwnProperty(a)||2this.eventPool.length&&this.eventPool.push(a);}function Jb(a){a.eventPool=[];a.getPooled=Kb;a.release=Lb;}function Mb(a,b,c,d){return T$1.call(this,a,b,c,d)}T$1.augmentClass(Mb,{data:null});function Nb(a,b,c,d){return T$1.call(this,a,b,c,d)}T$1.augmentClass(Nb,{data:null});var Pb=[9,13,27,32]; var Vb=require$$3.canUseDOM&&"CompositionEvent"in window; var Wb=null;require$$3.canUseDOM&&"documentMode"in document&&(Wb=document.documentMode);var Xb; -if(Xb=require$$3.canUseDOM&&"TextEvent"in window&&!Wb){var Yb=window.opera;Xb=!("object"===typeof Yb&&"function"===typeof Yb.version&&12>=parseInt(Yb.version(),10));} -var Zb=Xb; -var $b=require$$3.canUseDOM&&(!Vb||Wb&&8=Wb); -var ac=String.fromCharCode(32); -var bc={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"topBlur topCompositionEnd topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart", +function D$1(a){for(var b=arguments.length-1,c="Minified React error #"+a+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d"+a,d=0;dthis.eventPool.length&&this.eventPool.push(a);}function qb(a){a.eventPool=[];a.getPooled=rb;a.release=sb;}var tb=N$1.extend({data:null}); var ub=N$1.extend({data:null}); var vb=[9,13,27,32]; var wb=require$$3.canUseDOM&&"CompositionEvent"in window; var xb=null;require$$3.canUseDOM&&"documentMode"in document&&(xb=document.documentMode); +var yb=require$$3.canUseDOM&&"TextEvent"in window&&!xb; +var zb=require$$3.canUseDOM&&(!wb||xb&&8=xb); +var Ab=String.fromCharCode(32); +var Bb={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"topBlur topCompositionEnd topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart", captured:"onCompositionStartCapture"},dependencies:"topBlur topCompositionStart topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"topBlur topCompositionUpdate topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")}}; -var cc=!1; -function dc(a,b){switch(a){case "topKeyUp":return-1!==Pb.indexOf(b.keyCode);case "topKeyDown":return 229!==b.keyCode;case "topKeyPress":case "topMouseDown":case "topBlur":return!0;default:return!1}}function ec(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var fc=!1;function gc(a,b){switch(a){case "topCompositionEnd":return ec(b);case "topKeyPress":if(32!==b.which)return null;cc=!0;return ac;case "topTextInput":return a=b.data,a===ac&&cc?null:a;default:return null}} -function hc(a,b){if(fc)return"topCompositionEnd"===a||!Vb&&dc(a,b)?(a=Fb(),S$1._root=null,S$1._startText=null,S$1._fallbackText=null,fc=!1,a):null;switch(a){case "topPaste":return null;case "topKeyPress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1qd.length&&qd.push(a);}}} -var xd=Object.freeze({get _enabled(){return td},get _handleTopLevel(){return sd},setHandleTopLevel:function(a){sd=a;},setEnabled:ud,isEnabled:function(){return td},trapBubbledEvent:U$1,trapCapturedEvent:wd,dispatchEvent:vd});function yd(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;c["ms"+a]="MS"+b;c["O"+a]="o"+b.toLowerCase();return c} -var zd={animationend:yd("Animation","AnimationEnd"),animationiteration:yd("Animation","AnimationIteration"),animationstart:yd("Animation","AnimationStart"),transitionend:yd("Transition","TransitionEnd")}; -var Ad={}; -var Bd={};require$$3.canUseDOM&&(Bd=document.createElement("div").style,"AnimationEvent"in window||(delete zd.animationend.animation,delete zd.animationiteration.animation,delete zd.animationstart.animation),"TransitionEvent"in window||delete zd.transitionend.transition); -function Cd(a){if(Ad[a])return Ad[a];if(!zd[a])return a;var b=zd[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Bd)return Ad[a]=b[c];return""} -var Dd={topAbort:"abort",topAnimationEnd:Cd("animationend")||"animationend",topAnimationIteration:Cd("animationiteration")||"animationiteration",topAnimationStart:Cd("animationstart")||"animationstart",topBlur:"blur",topCancel:"cancel",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topClose:"close",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy", -topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoad:"load",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart", -topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topToggle:"toggle",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove", -topTouchStart:"touchstart",topTransitionEnd:Cd("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"}; -var Ed={}; -var Fd=0; -var Gd="_reactListenersID"+(""+Math.random()).slice(2);function Hd(a){Object.prototype.hasOwnProperty.call(a,Gd)||(a[Gd]=Fd++,Ed[a[Gd]]={});return Ed[a[Gd]]}function Id(a){for(;a&&a.firstChild;)a=a.firstChild;return a} -function Jd(a,b){var c=Id(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d;}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode;}c=void 0;}c=Id(c);}}function Kd(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&"text"===a.type||"textarea"===b||"true"===a.contentEditable)} -var Ld=require$$3.canUseDOM&&"documentMode"in document&&11>=document.documentMode; -var Md={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"topBlur topContextMenu topFocus topKeyDown topKeyUp topMouseDown topMouseUp topSelectionChange".split(" ")}}; -var Nd=null; -var Od=null; -var Pd=null; -var Qd=!1; -function Rd(a,b){if(Qd||null==Nd||Nd!==require$$7())return null;var c=Nd;"selectionStart"in c&&Kd(c)?c={start:c.selectionStart,end:c.selectionEnd}:window.getSelection?(c=window.getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}):c=void 0;return Pd&&require$$8(Pd,c)?null:(Pd=c,a=T$1.getPooled(Md.select,Od,a,b),a.type="select",a.target=Nd,Ab(a),a)} -var Sd={eventTypes:Md,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Hd(e);f=Sa.onSelect;for(var g=0;ghe||(a.current=ge[he],ge[he]=null,he--);}function W$1(a,b){he++;ge[he]=a.current;a.current=b;}new Set;var ie={current:require$$11}; var X={current:!1}; var je=require$$11;function ke(a){return le(a)?je:ie.current} -function me(a,b){var c=a.type.contextTypes;if(!c)return require$$11;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function le(a){return 2===a.tag&&null!=a.type.childContextTypes}function ne(a){le(a)&&(V$1(X,a),V$1(ie,a));} -function oe(a,b,c){null!=ie.cursor?E$1("168"):void 0;W$1(ie,b,a);W$1(X,c,a);}function pe(a,b){var c=a.stateNode,d=a.type.childContextTypes;if("function"!==typeof c.getChildContext)return b;c=c.getChildContext();for(var e in c)e in d?void 0:E$1("108",jd(a)||"Unknown",e);return require$$4({},b,c)}function qe(a){if(!le(a))return!1;var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||require$$11;je=ie.current;W$1(ie,b,a);W$1(X,X.current,a);return!0} -function re(a,b){var c=a.stateNode;c?void 0:E$1("169");if(b){var d=pe(a,je);c.__reactInternalMemoizedMergedChildContext=d;V$1(X,a);V$1(ie,a);W$1(ie,d,a);}else V$1(X,a);W$1(X,b,a);} -function Y(a,b,c){this.tag=a;this.key=b;this.stateNode=this.type=null;this.sibling=this.child=this["return"]=null;this.index=0;this.memoizedState=this.updateQueue=this.memoizedProps=this.pendingProps=this.ref=null;this.internalContextTag=c;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.expirationTime=0;this.alternate=null;} -function se(a,b,c){var d=a.alternate;null===d?(d=new Y(a.tag,a.key,a.internalContextTag),d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.effectTag=0,d.nextEffect=null,d.firstEffect=null,d.lastEffect=null);d.expirationTime=c;d.pendingProps=b;d.child=a.child;d.memoizedProps=a.memoizedProps;d.memoizedState=a.memoizedState;d.updateQueue=a.updateQueue;d.sibling=a.sibling;d.index=a.index;d.ref=a.ref;return d} -function te(a,b,c){var d=void 0,e=a.type,f=a.key;"function"===typeof e?(d=e.prototype&&e.prototype.isReactComponent?new Y(2,f,b):new Y(0,f,b),d.type=e,d.pendingProps=a.props):"string"===typeof e?(d=new Y(5,f,b),d.type=e,d.pendingProps=a.props):"object"===typeof e&&null!==e&&"number"===typeof e.tag?(d=e,d.pendingProps=a.props):E$1("130",null==e?e:typeof e,"");d.expirationTime=c;return d}function ue(a,b,c,d){b=new Y(10,d,b);b.pendingProps=a;b.expirationTime=c;return b} -function ve(a,b,c){b=new Y(6,null,b);b.pendingProps=a;b.expirationTime=c;return b}function we(a,b,c){b=new Y(7,a.key,b);b.type=a.handler;b.pendingProps=a;b.expirationTime=c;return b}function xe(a,b,c){a=new Y(9,null,b);a.expirationTime=c;return a}function ye(a,b,c){b=new Y(4,a.key,b);b.pendingProps=a.children||[];b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}var ze=null; var Ae=null; -function Be(a){return function(b){try{return a(b)}catch(c){}}}function Ce(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);ze=Be(function(a){return b.onCommitFiberRoot(c,a)});Ae=Be(function(a){return b.onCommitFiberUnmount(c,a)});}catch(d){}return!0}function De(a){"function"===typeof ze&&ze(a);}function Ee(a){"function"===typeof Ae&&Ae(a);} -function Fe(a){return{baseState:a,expirationTime:0,first:null,last:null,callbackList:null,hasForceUpdate:!1,isInitialized:!1}}function Ge(a,b){null===a.last?a.first=a.last=b:(a.last.next=b,a.last=b);if(0===a.expirationTime||a.expirationTime>b.expirationTime)a.expirationTime=b.expirationTime;} -function He(a,b){var c=a.alternate,d=a.updateQueue;null===d&&(d=a.updateQueue=Fe(null));null!==c?(a=c.updateQueue,null===a&&(a=c.updateQueue=Fe(null))):a=null;a=a!==d?a:null;null===a?Ge(d,b):null===d.last||null===a.last?(Ge(d,b),Ge(a,b)):(Ge(d,b),a.last=b);}function Ie(a,b,c,d){a=a.partialState;return"function"===typeof a?a.call(b,c,d):a} -function Je(a,b,c,d,e,f){null!==a&&a.updateQueue===c&&(c=b.updateQueue={baseState:c.baseState,expirationTime:c.expirationTime,first:c.first,last:c.last,isInitialized:c.isInitialized,callbackList:null,hasForceUpdate:!1});c.expirationTime=0;c.isInitialized?a=c.baseState:(a=c.baseState=b.memoizedState,c.isInitialized=!0);for(var g=!0,h=c.first,k=!1;null!==h;){var q=h.expirationTime;if(q>f){var v=c.expirationTime;if(0===v||v>q)c.expirationTime=q;k||(k=!0,c.baseState=a);}else{k||(c.first=h.next,null=== -c.first&&(c.last=null));if(h.isReplace)a=Ie(h,d,a,e),g=!0;else if(q=Ie(h,d,a,e))a=g?require$$4({},a,q):require$$4(a,q),g=!1;h.isForced&&(c.hasForceUpdate=!0);null!==h.callback&&(q=c.callbackList,null===q&&(q=c.callbackList=[]),q.push(h));}h=h.next;}null!==c.callbackList?b.effectTag|=32:null!==c.first||c.hasForceUpdate||(b.updateQueue=null);k||(c.baseState=a);return a} -function Ke(a,b){var c=a.callbackList;if(null!==c)for(a.callbackList=null,a=0;aw?(k=n,n=null):k=n.sibling;var x=G(e,n,m[w],A);if(null===x){null===n&&(n=k);break}a&&n&&null===x.alternate&&b(e,n);g=f(x,g,w);null===r?h=x:r.sibling=x;r=x;n=k;}if(w===m.length)return c(e,n),h;if(null===n){for(;ww?(k=n,n=null):k=n.sibling;var J=G(e,n,x.value,A);if(null===J){n||(n=k);break}a&&n&&null===J.alternate&&b(e,n);g=f(J, -g,w);null===r?h=J:r.sibling=J;r=J;n=k;}if(x.done)return c(e,n),h;if(null===n){for(;!x.done;w++,x=m.next())x=z(e,x.value,A),null!==x&&(g=f(x,g,w),null===r?h=x:r.sibling=x,r=x);return h}for(n=d(e,n);!x.done;w++,x=m.next())if(x=I(n,e,w,x.value,A),null!==x){if(a&&null!==x.alternate)n["delete"](null===x.key?w:x.key);g=f(x,g,w);null===r?h=x:r.sibling=x;r=x;}a&&n.forEach(function(a){return b(e,a)});return h}return function(a,d,f,h){"object"===typeof f&&null!==f&&f.type===Ve&&null===f.key&&(f=f.props.children); -var m="object"===typeof f&&null!==f;if(m)switch(f.$$typeof){case Re:a:{var r=f.key;for(m=d;null!==m;){if(m.key===r)if(10===m.tag?f.type===Ve:m.type===f.type){c(a,m.sibling);d=e(m,f.type===Ve?f.props.children:f.props,h);d.ref=Ze(m,f);d["return"]=a;a=d;break a}else{c(a,m);break}else b(a,m);m=m.sibling;}f.type===Ve?(d=ue(f.props.children,a.internalContextTag,h,f.key),d["return"]=a,a=d):(h=te(f,a.internalContextTag,h),h.ref=Ze(d,f),h["return"]=a,a=h);}return g(a);case Se:a:{for(m=f.key;null!==d;){if(d.key=== -m)if(7===d.tag){c(a,d.sibling);d=e(d,f,h);d["return"]=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling;}d=we(f,a.internalContextTag,h);d["return"]=a;a=d;}return g(a);case Te:a:{if(null!==d)if(9===d.tag){c(a,d.sibling);d=e(d,null,h);d.type=f.value;d["return"]=a;a=d;break a}else c(a,d);d=xe(f,a.internalContextTag,h);d.type=f.value;d["return"]=a;a=d;}return g(a);case Ue:a:{for(m=f.key;null!==d;){if(d.key===m)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation=== -f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d["return"]=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling;}d=ye(f,a.internalContextTag,h);d["return"]=a;a=d;}return g(a)}if("string"===typeof f||"number"===typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h)):(c(a,d),d=ve(f,a.internalContextTag,h)),d["return"]=a,a=d,g(a);if(Ye(f))return L(a,d,f,h);if(Xe(f))return N(a,d,f,h);m&&$e(a,f);if("undefined"===typeof f)switch(a.tag){case 2:case 1:h=a.type,E$1("152",h.displayName|| -h.name||"Component");}return c(a,d)}}var bf=af(!0); -var cf=af(!1); -function df(a,b,c,d,e){function f(a,b,c){var d=b.expirationTime;b.child=null===a?cf(b,null,c,d):bf(b,a.child,c,d);}function g(a,b){var c=b.ref;null===c||a&&a.ref===c||(b.effectTag|=128);}function h(a,b,c,d){g(a,b);if(!c)return d&&re(b,!1),q(a,b);c=b.stateNode;id$2.current=b;var e=c.render();b.effectTag|=1;f(a,b,e);b.memoizedState=c.state;b.memoizedProps=c.props;d&&re(b,!0);return b.child}function k(a){var b=a.stateNode;b.pendingContext?oe(a,b.pendingContext,b.pendingContext!==b.context):b.context&&oe(a, -b.context,!1);I(a,b.containerInfo);}function q(a,b){null!==a&&b.child!==a.child?E$1("153"):void 0;if(null!==b.child){a=b.child;var c=se(a,a.pendingProps,a.expirationTime);b.child=c;for(c["return"]=b;null!==a.sibling;)a=a.sibling,c=c.sibling=se(a,a.pendingProps,a.expirationTime),c["return"]=b;c.sibling=null;}return b.child}function v(a,b){switch(b.tag){case 3:k(b);break;case 2:qe(b);break;case 4:I(b,b.stateNode.containerInfo);}return null}var y=a.shouldSetTextContent,u=a.useSyncScheduling,z=a.shouldDeprioritizeSubtree, -G=b.pushHostContext,I=b.pushHostContainer,L=c.enterHydrationState,N=c.resetHydrationState,J=c.tryToClaimNextHydratableInstance;a=Le(d,e,function(a,b){a.memoizedProps=b;},function(a,b){a.memoizedState=b;});var w=a.adoptClassInstance,m=a.constructClassInstance,A=a.mountClassInstance,Ob=a.updateClassInstance;return{beginWork:function(a,b,c){if(0===b.expirationTime||b.expirationTime>c)return v(a,b);switch(b.tag){case 0:null!==a?E$1("155"):void 0;var d=b.type,e=b.pendingProps,r=ke(b);r=me(b,r);d=d(e,r);b.effectTag|= -1;"object"===typeof d&&null!==d&&"function"===typeof d.render?(b.tag=2,e=qe(b),w(b,d),A(b,c),b=h(a,b,!0,e)):(b.tag=1,f(a,b,d),b.memoizedProps=e,b=b.child);return b;case 1:a:{e=b.type;c=b.pendingProps;d=b.memoizedProps;if(X.current)null===c&&(c=d);else if(null===c||d===c){b=q(a,b);break a}d=ke(b);d=me(b,d);e=e(c,d);b.effectTag|=1;f(a,b,e);b.memoizedProps=c;b=b.child;}return b;case 2:return e=qe(b),d=void 0,null===a?b.stateNode?E$1("153"):(m(b,b.pendingProps),A(b,c),d=!0):d=Ob(a,b,c),h(a,b,d,e);case 3:return k(b), -e=b.updateQueue,null!==e?(d=b.memoizedState,e=Je(a,b,e,null,null,c),d===e?(N(),b=q(a,b)):(d=e.element,r=b.stateNode,(null===a||null===a.child)&&r.hydrate&&L(b)?(b.effectTag|=2,b.child=cf(b,null,d,c)):(N(),f(a,b,d)),b.memoizedState=e,b=b.child)):(N(),b=q(a,b)),b;case 5:G(b);null===a&&J(b);e=b.type;var n=b.memoizedProps;d=b.pendingProps;null===d&&(d=n,null===d?E$1("154"):void 0);r=null!==a?a.memoizedProps:null;X.current||null!==d&&n!==d?(n=d.children,y(e,d)?n=null:r&&y(e,r)&&(b.effectTag|=16),g(a,b), -2147483647!==c&&!u&&z(e,d)?(b.expirationTime=2147483647,b=null):(f(a,b,n),b.memoizedProps=d,b=b.child)):b=q(a,b);return b;case 6:return null===a&&J(b),a=b.pendingProps,null===a&&(a=b.memoizedProps),b.memoizedProps=a,null;case 8:b.tag=7;case 7:e=b.pendingProps;if(X.current)null===e&&(e=a&&a.memoizedProps,null===e?E$1("154"):void 0);else if(null===e||b.memoizedProps===e)e=b.memoizedProps;d=e.children;b.stateNode=null===a?cf(b,b.stateNode,d,c):bf(b,b.stateNode,d,c);b.memoizedProps=e;return b.stateNode; -case 9:return null;case 4:a:{I(b,b.stateNode.containerInfo);e=b.pendingProps;if(X.current)null===e&&(e=a&&a.memoizedProps,null==e?E$1("154"):void 0);else if(null===e||b.memoizedProps===e){b=q(a,b);break a}null===a?b.child=bf(b,null,e,c):f(a,b,e);b.memoizedProps=e;b=b.child;}return b;case 10:a:{c=b.pendingProps;if(X.current)null===c&&(c=b.memoizedProps);else if(null===c||b.memoizedProps===c){b=q(a,b);break a}f(a,b,c);b.memoizedProps=c;b=b.child;}return b;default:E$1("156");}},beginFailedWork:function(a,b, -c){switch(b.tag){case 2:qe(b);break;case 3:k(b);break;default:E$1("157");}b.effectTag|=64;null===a?b.child=null:b.child!==a.child&&(b.child=a.child);if(0===b.expirationTime||b.expirationTime>c)return v(a,b);b.firstEffect=null;b.lastEffect=null;b.child=null===a?cf(b,null,null,c):bf(b,a.child,null,c);2===b.tag&&(a=b.stateNode,b.memoizedProps=a.props,b.memoizedState=a.state);return b.child}}} -function ef(a,b,c){function d(a){a.effectTag|=4;}var e=a.createInstance,f=a.createTextInstance,g=a.appendInitialChild,h=a.finalizeInitialChildren,k=a.prepareUpdate,q=a.persistence,v=b.getRootHostContainer,y=b.popHostContext,u=b.getHostContext,z=b.popHostContainer,G=c.prepareToHydrateHostInstance,I=c.prepareToHydrateHostTextInstance,L=c.popHydrationState,N=void 0,J=void 0,w=void 0;a.mutation?(N=function(){},J=function(a,b,c){(b.updateQueue=c)&&d(b);},w=function(a,b,c,e){c!==e&&d(b);}):q?E$1("235"):E$1("236"); -return{completeWork:function(a,b,c){var m=b.pendingProps;if(null===m)m=b.memoizedProps;else if(2147483647!==b.expirationTime||2147483647===c)b.pendingProps=null;switch(b.tag){case 1:return null;case 2:return ne(b),null;case 3:z(b);V$1(X,b);V$1(ie,b);m=b.stateNode;m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null);if(null===a||null===a.child)L(b),b.effectTag&=-3;N(b);return null;case 5:y(b);c=v();var A=b.type;if(null!==a&&null!=b.stateNode){var p=a.memoizedProps,q=b.stateNode,x=u();q= -k(q,A,p,m,c,x);J(a,b,q,A,p,m,c);a.ref!==b.ref&&(b.effectTag|=128);}else{if(!m)return null===b.stateNode?E$1("166"):void 0,null;a=u();if(L(b))G(b,c,a)&&d(b);else{a=e(A,m,c,a,b);a:for(p=b.child;null!==p;){if(5===p.tag||6===p.tag)g(a,p.stateNode);else if(4!==p.tag&&null!==p.child){p.child["return"]=p;p=p.child;continue}if(p===b)break;for(;null===p.sibling;){if(null===p["return"]||p["return"]===b)break a;p=p["return"];}p.sibling["return"]=p["return"];p=p.sibling;}h(a,A,m,c)&&d(b);b.stateNode=a;}null!==b.ref&& -(b.effectTag|=128);}return null;case 6:if(a&&null!=b.stateNode)w(a,b,a.memoizedProps,m);else{if("string"!==typeof m)return null===b.stateNode?E$1("166"):void 0,null;a=v();c=u();L(b)?I(b)&&d(b):b.stateNode=f(m,a,c,b);}return null;case 7:(m=b.memoizedProps)?void 0:E$1("165");b.tag=8;A=[];a:for((p=b.stateNode)&&(p["return"]=b);null!==p;){if(5===p.tag||6===p.tag||4===p.tag)E$1("247");else if(9===p.tag)A.push(p.type);else if(null!==p.child){p.child["return"]=p;p=p.child;continue}for(;null===p.sibling;){if(null=== -p["return"]||p["return"]===b)break a;p=p["return"];}p.sibling["return"]=p["return"];p=p.sibling;}p=m.handler;m=p(m.props,A);b.child=bf(b,null!==a?a.child:null,m,c);return b.child;case 8:return b.tag=7,null;case 9:return null;case 10:return null;case 4:return z(b),N(b),null;case 0:E$1("167");default:E$1("156");}}}} -function ff(a,b){function c(a){var c=a.ref;if(null!==c)try{c(null);}catch(A){b(a,A);}}function d(a){"function"===typeof Ee&&Ee(a);switch(a.tag){case 2:c(a);var d=a.stateNode;if("function"===typeof d.componentWillUnmount)try{d.props=a.memoizedProps,d.state=a.memoizedState,d.componentWillUnmount();}catch(A){b(a,A);}break;case 5:c(a);break;case 7:e(a.stateNode);break;case 4:k&&g(a);}}function e(a){for(var b=a;;)if(d(b),null===b.child||k&&4===b.tag){if(b===a)break;for(;null===b.sibling;){if(null===b["return"]|| -b["return"]===a)return;b=b["return"];}b.sibling["return"]=b["return"];b=b.sibling;}else b.child["return"]=b,b=b.child;}function f(a){return 5===a.tag||3===a.tag||4===a.tag}function g(a){for(var b=a,c=!1,f=void 0,g=void 0;;){if(!c){c=b["return"];a:for(;;){null===c?E$1("160"):void 0;switch(c.tag){case 5:f=c.stateNode;g=!1;break a;case 3:f=c.stateNode.containerInfo;g=!0;break a;case 4:f=c.stateNode.containerInfo;g=!0;break a}c=c["return"];}c=!0;}if(5===b.tag||6===b.tag)e(b),g?J(f,b.stateNode):N(f,b.stateNode); -else if(4===b.tag?f=b.stateNode.containerInfo:d(b),null!==b.child){b.child["return"]=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b["return"]||b["return"]===a)return;b=b["return"];4===b.tag&&(c=!1);}b.sibling["return"]=b["return"];b=b.sibling;}}var h=a.getPublicInstance,k=a.mutation;a=a.persistence;k||(a?E$1("235"):E$1("236"));var q=k.commitMount,v=k.commitUpdate,y=k.resetTextContent,u=k.commitTextUpdate,z=k.appendChild,G=k.appendChildToContainer,I=k.insertBefore,L=k.insertInContainerBefore, -N=k.removeChild,J=k.removeChildFromContainer;return{commitResetTextContent:function(a){y(a.stateNode);},commitPlacement:function(a){a:{for(var b=a["return"];null!==b;){if(f(b)){var c=b;break a}b=b["return"];}E$1("160");c=void 0;}var d=b=void 0;switch(c.tag){case 5:b=c.stateNode;d=!1;break;case 3:b=c.stateNode.containerInfo;d=!0;break;case 4:b=c.stateNode.containerInfo;d=!0;break;default:E$1("161");}c.effectTag&16&&(y(b),c.effectTag&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c["return"]||f(c["return"])){c= -null;break a}c=c["return"];}c.sibling["return"]=c["return"];for(c=c.sibling;5!==c.tag&&6!==c.tag;){if(c.effectTag&2)continue b;if(null===c.child||4===c.tag)continue b;else c.child["return"]=c,c=c.child;}if(!(c.effectTag&2)){c=c.stateNode;break a}}for(var e=a;;){if(5===e.tag||6===e.tag)c?d?L(b,e.stateNode,c):I(b,e.stateNode,c):d?G(b,e.stateNode):z(b,e.stateNode);else if(4!==e.tag&&null!==e.child){e.child["return"]=e;e=e.child;continue}if(e===a)break;for(;null===e.sibling;){if(null===e["return"]||e["return"]=== -a)return;e=e["return"];}e.sibling["return"]=e["return"];e=e.sibling;}},commitDeletion:function(a){g(a);a["return"]=null;a.child=null;a.alternate&&(a.alternate.child=null,a.alternate["return"]=null);},commitWork:function(a,b){switch(b.tag){case 2:break;case 5:var c=b.stateNode;if(null!=c){var d=b.memoizedProps;a=null!==a?a.memoizedProps:d;var e=b.type,f=b.updateQueue;b.updateQueue=null;null!==f&&v(c,f,e,a,d,b);}break;case 6:null===b.stateNode?E$1("162"):void 0;c=b.memoizedProps;u(b.stateNode,null!==a?a.memoizedProps: -c,c);break;case 3:break;default:E$1("163");}},commitLifeCycles:function(a,b){switch(b.tag){case 2:var c=b.stateNode;if(b.effectTag&4)if(null===a)c.props=b.memoizedProps,c.state=b.memoizedState,c.componentDidMount();else{var d=a.memoizedProps;a=a.memoizedState;c.props=b.memoizedProps;c.state=b.memoizedState;c.componentDidUpdate(d,a);}b=b.updateQueue;null!==b&&Ke(b,c);break;case 3:c=b.updateQueue;null!==c&&Ke(c,null!==b.child?b.child.stateNode:null);break;case 5:c=b.stateNode;null===a&&b.effectTag&4&&q(c, -b.type,b.memoizedProps,b);break;case 6:break;case 4:break;default:E$1("163");}},commitAttachRef:function(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:b(h(c));break;default:b(c);}}},commitDetachRef:function(a){a=a.ref;null!==a&&a(null);}}}var gf={}; -function hf(a){function b(a){a===gf?E$1("174"):void 0;return a}var c=a.getChildHostContext,d=a.getRootHostContext,e={current:gf},f={current:gf},g={current:gf};return{getHostContext:function(){return b(e.current)},getRootHostContainer:function(){return b(g.current)},popHostContainer:function(a){V$1(e,a);V$1(f,a);V$1(g,a);},popHostContext:function(a){f.current===a&&(V$1(e,a),V$1(f,a));},pushHostContainer:function(a,b){W$1(g,b,a);b=d(b);W$1(f,a,a);W$1(e,b,a);},pushHostContext:function(a){var d=b(g.current),h=b(e.current); -d=c(h,a.type,d);h!==d&&(W$1(f,a,a),W$1(e,d,a));},resetHostContainer:function(){e.current=gf;g.current=gf;}}} -function jf(a){function b(a,b){var c=new Y(5,null,0);c.type="DELETED";c.stateNode=b;c["return"]=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c;}function c(a,b){switch(a.tag){case 5:return b=f(b,a.type,a.pendingProps),null!==b?(a.stateNode=b,!0):!1;case 6:return b=g(b,a.pendingProps),null!==b?(a.stateNode=b,!0):!1;default:return!1}}function d(a){for(a=a["return"];null!==a&&5!==a.tag&&3!==a.tag;)a=a["return"];y=a;}var e=a.shouldSetTextContent; -a=a.hydration;if(!a)return{enterHydrationState:function(){return!1},resetHydrationState:function(){},tryToClaimNextHydratableInstance:function(){},prepareToHydrateHostInstance:function(){E$1("175");},prepareToHydrateHostTextInstance:function(){E$1("176");},popHydrationState:function(){return!1}};var f=a.canHydrateInstance,g=a.canHydrateTextInstance,h=a.getNextHydratableSibling,k=a.getFirstHydratableChild,q=a.hydrateInstance,v=a.hydrateTextInstance,y=null,u=null,z=!1;return{enterHydrationState:function(a){u= -k(a.stateNode.containerInfo);y=a;return z=!0},resetHydrationState:function(){u=y=null;z=!1;},tryToClaimNextHydratableInstance:function(a){if(z){var d=u;if(d){if(!c(a,d)){d=h(d);if(!d||!c(a,d)){a.effectTag|=2;z=!1;y=a;return}b(y,u);}y=a;u=k(d);}else a.effectTag|=2,z=!1,y=a;}},prepareToHydrateHostInstance:function(a,b,c){b=q(a.stateNode,a.type,a.memoizedProps,b,c,a);a.updateQueue=b;return null!==b?!0:!1},prepareToHydrateHostTextInstance:function(a){return v(a.stateNode,a.memoizedProps,a)},popHydrationState:function(a){if(a!== -y)return!1;if(!z)return d(a),z=!0,!1;var c=a.type;if(5!==a.tag||"head"!==c&&"body"!==c&&!e(c,a.memoizedProps))for(c=u;c;)b(a,c),c=h(c);d(a);u=y?h(a.stateNode):null;return!0}}} -function kf(a){function b(a){Qb=ja=!0;var b=a.stateNode;b.current===a?E$1("177"):void 0;b.isReadyForCommit=!1;id$2.current=null;if(1g.expirationTime)&&(f=g.expirationTime),g=g.sibling;e.expirationTime=f;}if(null!==b)return b;null!==c&&(null===c.firstEffect&&(c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect=a.firstEffect),c.lastEffect=a.lastEffect),1a))if(H<=Uc)for(;null!==F;)F=k(F)?e(F):d(F);else for(;null!==F&&!A();)F=k(F)?e(F):d(F);}else if(!(0===H||H>a))if(H<=Uc)for(;null!==F;)F=d(F);else for(;null!==F&&!A();)F=d(F);}function g(a,b){ja?E$1("243"):void 0;ja=!0;a.isReadyForCommit= -!1;if(a!==ra||b!==H||null===F){for(;-1b)a.expirationTime=b;null!==a.alternate&&(0===a.alternate.expirationTime||a.alternate.expirationTime>b)&&(a.alternate.expirationTime=b);if(null===a["return"])if(3===a.tag){var c=a.stateNode;!ja&&c===ra&&bIg&&E$1("185");if(null===d.nextScheduledRoot)d.remainingExpirationTime=e,null===O?(sa=O=d,d.nextScheduledRoot=d):(O=O.nextScheduledRoot=d,O.nextScheduledRoot=sa);else{var f=d.remainingExpirationTime;if(0===f||eTb)return;Jg(Xc);}var b=Wc()-Pe;Tb=a;Xc=Kg(J,{timeout:10*(a-2)-b});}function N(){var a=0,b=null;if(null!==O)for(var c=O,d=sa;null!==d;){var e=d.remainingExpirationTime;if(0===e){null===c||null===O?E$1("244"):void 0;if(d===d.nextScheduledRoot){sa=O=d.nextScheduledRoot=null;break}else if(d===sa)sa=e=d.nextScheduledRoot, -O.nextScheduledRoot=e,d.nextScheduledRoot=null;else if(d===O){O=c;O.nextScheduledRoot=sa;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot=null;d=c.nextScheduledRoot;}else{if(0===a||eLg?!1:Yc=!0}function Ob(a){null===ma?E$1("246"): -void 0;ma.remainingExpirationTime=0;Ub||(Ub=!0,Zc=a);}var r=hf(a),n=jf(a),p=r.popHostContainer,qg=r.popHostContext,x=r.resetHostContainer,Me=df(a,r,n,u,y),rg=Me.beginWork,Gg=Me.beginFailedWork,Fg=ef(a,r,n).completeWork;r=ff(a,h);var zg=r.commitResetTextContent,Ne=r.commitPlacement,Bg=r.commitDeletion,Oe=r.commitWork,Dg=r.commitLifeCycles,Eg=r.commitAttachRef,Ag=r.commitDetachRef,Wc=a.now,Kg=a.scheduleDeferredCallback,Jg=a.cancelDeferredCallback,Hg=a.useSyncScheduling,yg=a.prepareForCommit,Cg=a.resetAfterCommit, -Pe=Wc(),Uc=2,ka=0,ja=!1,F=null,ra=null,H=0,t=null,R=null,qa=null,ha=null,ca=null,eb=!1,Qb=!1,Sc=!1,sa=null,O=null,Tb=0,Xc=-1,Fa=!1,ma=null,na=0,Yc=!1,Ub=!1,Zc=null,fb=null,la=!1,Sb=!1,Ig=1E3,Rb=0,Lg=1;return{computeAsyncExpiration:v,computeExpirationForFiber:y,scheduleWork:u,batchedUpdates:function(a,b){var c=la;la=!0;try{return a(b)}finally{(la=c)||Fa||w(1,null);}},unbatchedUpdates:function(a){if(la&&!Sb){Sb=!0;try{return a()}finally{Sb=!1;}}return a()},flushSync:function(a){var b=la;la=!0;try{a:{var c= -ka;ka=1;try{var d=a();break a}finally{ka=c;}d=void 0;}return d}finally{la=b,Fa?E$1("187"):void 0,w(1,null);}},deferredUpdates:function(a){var b=ka;ka=v();try{return a()}finally{ka=b;}}}} -function lf(a){function b(a){a=od(a);return null===a?null:a.stateNode}var c=a.getPublicInstance;a=kf(a);var d=a.computeAsyncExpiration,e=a.computeExpirationForFiber,f=a.scheduleWork;return{createContainer:function(a,b){var c=new Y(3,null,0);a={current:c,containerInfo:a,pendingChildren:null,remainingExpirationTime:0,isReadyForCommit:!1,finishedWork:null,context:null,pendingContext:null,hydrate:b,nextScheduledRoot:null};return c.stateNode=a},updateContainer:function(a,b,c,q){var g=b.current;if(c){c= -c._reactInternalFiber;var h;b:{2===kd(c)&&2===c.tag?void 0:E$1("170");for(h=c;3!==h.tag;){if(le(h)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break b}(h=h["return"])?void 0:E$1("171");}h=h.stateNode.context;}c=le(c)?pe(c,h):h;}else c=require$$11;null===b.context?b.context=c:b.pendingContext=c;b=q;b=void 0===b?null:b;q=null!=a&&null!=a.type&&null!=a.type.prototype&&!0===a.type.prototype.unstable_isAsyncReactComponent?d():e(g);He(g,{expirationTime:q,partialState:{element:a},callback:b,isReplace:!1,isForced:!1, -nextCallback:null,next:null});f(g,q);},batchedUpdates:a.batchedUpdates,unbatchedUpdates:a.unbatchedUpdates,deferredUpdates:a.deferredUpdates,flushSync:a.flushSync,getPublicRootInstance:function(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return c(a.child.stateNode);default:return a.child.stateNode}},findHostInstance:b,findHostInstanceWithNoPortals:function(a){a=pd(a);return null===a?null:a.stateNode},injectIntoDevTools:function(a){var c=a.findFiberByHostInstance;return Ce(require$$4({}, -a,{findHostInstanceByFiber:function(a){return b(a)},findFiberByHostInstance:function(a){return c?c(a):null}}))}}}var mf=Object.freeze({default:lf}); var nf=mf&&lf||mf; var of=nf["default"]?nf["default"]:nf;function pf(a,b,c){var d=3=yf-a)if(-1!==wf&&wf<= -a)Bf.didTimeout=!0;else{xf||(xf=!0,requestAnimationFrame(Df));return}else Bf.didTimeout=!1;wf=-1;a=uf;uf=null;null!==a&&a(Bf);}},!1);var Df=function(a){xf=!1;var b=a-yf+Af;bb&&(b=8),Af=bc||d.hasOverloadedBooleanValue&&!1===c?Jf(a,b):d.mustUseProperty?a[d.propertyName]=c:(b=d.attributeName,(e=d.attributeNamespace)?a.setAttributeNS(e,b,""+c):d.hasBooleanValue||d.hasOverloadedBooleanValue&&!0===c?a.setAttribute(b,""):a.setAttribute(b,""+c));}else Kf(a,b,va(b,c)?c:null);} -function Kf(a,b,c){Hf(b)&&(null==c?a.removeAttribute(b):a.setAttribute(b,""+c));}function Jf(a,b){var c=wa(b);c?(b=c.mutationMethod)?b(a,void 0):c.mustUseProperty?a[c.propertyName]=c.hasBooleanValue?!1:"":a.removeAttribute(c.attributeName):a.removeAttribute(b);} -function Lf(a,b){var c=b.value,d=b.checked;return require$$4({type:void 0,step:void 0,min:void 0,max:void 0},b,{defaultChecked:void 0,defaultValue:void 0,value:null!=c?c:a._wrapperState.initialValue,checked:null!=d?d:a._wrapperState.initialChecked})}function Mf(a,b){var c=b.defaultValue;a._wrapperState={initialChecked:null!=b.checked?b.checked:b.defaultChecked,initialValue:null!=b.value?b.value:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value};} -function Nf(a,b){b=b.checked;null!=b&&If(a,"checked",b);}function Of(a,b){Nf(a,b);var c=b.value;if(null!=c)if(0===c&&""===a.value)a.value="0";else if("number"===b.type){if(b=parseFloat(a.value)||0,c!=b||c==b&&a.value!=c)a.value=""+c;}else a.value!==""+c&&(a.value=""+c);else null==b.value&&null!=b.defaultValue&&a.defaultValue!==""+b.defaultValue&&(a.defaultValue=""+b.defaultValue),null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked);} -function Pf(a,b){switch(b.type){case "submit":case "reset":break;case "color":case "date":case "datetime":case "datetime-local":case "month":case "time":case "week":a.value="";a.value=a.defaultValue;break;default:a.value=a.value;}b=a.name;""!==b&&(a.name="");a.defaultChecked=!a.defaultChecked;a.defaultChecked=!a.defaultChecked;""!==b&&(a.name=b);}function Qf(a){var b="";React$1.Children.forEach(a,function(a){null==a||"string"!==typeof a&&"number"!==typeof a||(b+=a);});return b} -function Rf(a,b){a=require$$4({children:void 0},b);if(b=Qf(b.children))a.children=b;return a}function Sf(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e=b.length?void 0:E$1("93"),b=b[0]),c=""+b),null==c&&(c=""));a._wrapperState={initialValue:""+c};} -function Wf(a,b){var c=b.value;null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&(a.defaultValue=c));null!=b.defaultValue&&(a.defaultValue=b.defaultValue);}function Xf(a){var b=a.textContent;b===a._wrapperState.initialValue&&(a.value=b);}var Yf={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}; -function Zf(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function $f(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?Zf(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a} -var ag=void 0; -var bg=function(a){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)});}:a}(function(a,b){if(a.namespaceURI!==Yf.svg||"innerHTML"in a)a.innerHTML=b;else{ag=ag||document.createElement("div");ag.innerHTML="\x3csvg\x3e"+b+"\x3c/svg\x3e";for(b=ag.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild);}}); -function cg(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b;} -var dg={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0, +var Kb=!1; +function Lb(a,b){switch(a){case "topKeyUp":return-1!==vb.indexOf(b.keyCode);case "topKeyDown":return 229!==b.keyCode;case "topKeyPress":case "topMouseDown":case "topBlur":return!0;default:return!1}}function Mb(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var Nb=!1;function Ob(a,b){switch(a){case "topCompositionEnd":return Mb(b);case "topKeyPress":if(32!==b.which)return null;Kb=!0;return Ab;case "topTextInput":return a=b.data,a===Ab&&Kb?null:a;default:return null}} +function Pb(a,b){if(Nb)return"topCompositionEnd"===a||!wb&&Lb(a,b)?(a=mb(),M$1._root=null,M$1._startText=null,M$1._fallbackText=null,Nb=!1,a):null;switch(a){case "topPaste":return null;case "topKeyPress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1b}return!1} +function U$1(a,b,c,d,e){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;}var V$1={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){V$1[a]=new U$1(a,0,!1,a,null);}); +[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];V$1[b]=new U$1(b,1,!1,a[1],null);});["contentEditable","draggable","spellCheck","value"].forEach(function(a){V$1[a]=new U$1(a,2,!1,a.toLowerCase(),null);});["autoReverse","externalResourcesRequired","preserveAlpha"].forEach(function(a){V$1[a]=new U$1(a,2,!1,a,null);}); +"allowFullScreen async autoFocus autoPlay controls default defer disabled formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){V$1[a]=new U$1(a,3,!1,a.toLowerCase(),null);});["checked","multiple","muted","selected"].forEach(function(a){V$1[a]=new U$1(a,3,!0,a.toLowerCase(),null);});["capture","download"].forEach(function(a){V$1[a]=new U$1(a,4,!1,a.toLowerCase(),null);}); +["cols","rows","size","span"].forEach(function(a){V$1[a]=new U$1(a,6,!1,a.toLowerCase(),null);});["rowSpan","start"].forEach(function(a){V$1[a]=new U$1(a,5,!1,a.toLowerCase(),null);});var Hc=/[\-\:]([a-z])/g;function Sc(a){return a[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".split(" ").forEach(function(a){var b=a.replace(Hc, +Sc);V$1[b]=new U$1(b,1,!1,a,null);});"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(Hc,Sc);V$1[b]=new U$1(b,1,!1,a,"http://www.w3.org/1999/xlink");});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(Hc,Sc);V$1[b]=new U$1(b,1,!1,a,"http://www.w3.org/XML/1998/namespace");});V$1.tabIndex=new U$1("tabIndex",1,!1,"tabindex",null); +function Tc(a,b,c,d){var e=V$1.hasOwnProperty(b)?V$1[b]:null;var f=null!==e?0===e.type:d?!1:!(2Sd.length&&Sd.push(a);}}} +var Zd=Object.freeze({get _enabled(){return Ud},setEnabled:Vd,isEnabled:function(){return Ud},trapBubbledEvent:W$1,trapCapturedEvent:Yd,dispatchEvent:Xd});function $d(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;c["ms"+a]="MS"+b;c["O"+a]="o"+b.toLowerCase();return c} +var ae={animationend:$d("Animation","AnimationEnd"),animationiteration:$d("Animation","AnimationIteration"),animationstart:$d("Animation","AnimationStart"),transitionend:$d("Transition","TransitionEnd")}; +var be={}; +var ce={};require$$3.canUseDOM&&(ce=document.createElement("div").style,"AnimationEvent"in window||(delete ae.animationend.animation,delete ae.animationiteration.animation,delete ae.animationstart.animation),"TransitionEvent"in window||delete ae.transitionend.transition); +function de(a){if(be[a])return be[a];if(!ae[a])return a;var b=ae[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in ce)return be[a]=b[c];return a} +var ee={topAnimationEnd:de("animationend"),topAnimationIteration:de("animationiteration"),topAnimationStart:de("animationstart"),topBlur:"blur",topCancel:"cancel",topChange:"change",topClick:"click",topClose:"close",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave", +topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoad:"load",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topScroll:"scroll",topSelectionChange:"selectionchange",topTextInput:"textInput",topToggle:"toggle",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove", +topTouchStart:"touchstart",topTransitionEnd:de("transitionend"),topWheel:"wheel"}; +var fe={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking", +topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"}; +var ge={}; +var he=0; +var ie="_reactListenersID"+(""+Math.random()).slice(2);function je(a){Object.prototype.hasOwnProperty.call(a,ie)||(a[ie]=he++,ge[a[ie]]={});return ge[a[ie]]}function ke(a){for(;a&&a.firstChild;)a=a.firstChild;return a} +function le(a,b){var c=ke(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d;}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode;}c=void 0;}c=ke(c);}}function me(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&"text"===a.type||"textarea"===b||"true"===a.contentEditable)} +var ne=require$$3.canUseDOM&&"documentMode"in document&&11>=document.documentMode; +var oe={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"topBlur topContextMenu topFocus topKeyDown topKeyUp topMouseDown topMouseUp topSelectionChange".split(" ")}}; +var pe=null; +var qe=null; +var re=null; +var se=!1; +function ue(a,b){if(se||null==pe||pe!==require$$7())return null;var c=pe;"selectionStart"in c&&me(c)?c={start:c.selectionStart,end:c.selectionEnd}:window.getSelection?(c=window.getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}):c=void 0;return re&&require$$8(re,c)?null:(re=c,a=N$1.getPooled(oe.select,qe,a,b),a.type="select",a.target=pe,hb(a),a)} +var we={eventTypes:oe,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=je(e);f=ua.onSelect;for(var h=0;hb.expirationTime)a.expirationTime=b.expirationTime;}var Le=void 0; var Me=void 0; +function Ne(a){Le=Me=null;var b=a.alternate,c=a.updateQueue;null===c&&(c=a.updateQueue=Je(null));null!==b?(a=b.updateQueue,null===a&&(a=b.updateQueue=Je(null))):a=null;Le=c;Me=a!==c?a:null;}function Oe(a,b){Ne(a);a=Le;var c=Me;null===c?Ke(a,b):null===a.last||null===c.last?(Ke(a,b),Ke(c,b)):(Ke(a,b),c.last=b);}function Pe(a,b,c,d){a=a.partialState;return"function"===typeof a?a.call(b,c,d):a} +function Qe(a,b,c,d,e,f){null!==a&&a.updateQueue===c&&(c=b.updateQueue={baseState:c.baseState,expirationTime:c.expirationTime,first:c.first,last:c.last,isInitialized:c.isInitialized,capturedValues:c.capturedValues,callbackList:null,hasForceUpdate:!1});c.expirationTime=0;c.isInitialized?a=c.baseState:(a=c.baseState=b.memoizedState,c.isInitialized=!0);for(var h=!0,g=c.first,k=!1;null!==g;){var v=g.expirationTime;if(v>f){var l=c.expirationTime;if(0===l||l>v)c.expirationTime=v;k||(k=!0,c.baseState=a);}else{k|| +(c.first=g.next,null===c.first&&(c.last=null));if(g.isReplace)a=Pe(g,d,a,e),h=!0;else if(v=Pe(g,d,a,e))a=h?require$$4({},a,v):require$$4(a,v),h=!1;g.isForced&&(c.hasForceUpdate=!0);null!==g.callback&&(v=c.callbackList,null===v&&(v=c.callbackList=[]),v.push(g));null!==g.capturedValue&&(v=c.capturedValues,null===v?c.capturedValues=[g.capturedValue]:v.push(g.capturedValue));}g=g.next;}null!==c.callbackList?b.effectTag|=32:null!==c.first||c.hasForceUpdate||null!==c.capturedValues||(b.updateQueue=null);k||(c.baseState=a); +return a}function Re(a,b){var c=a.callbackList;if(null!==c)for(a.callbackList=null,a=0;au?(t=q,q=null):t=q.sibling;var n=z(e,q,l[u],h);if(null===n){null===q&&(q=t);break}a&&q&&null=== +n.alternate&&b(e,q);g=f(n,g,u);null===k?r=n:k.sibling=n;k=n;q=t;}if(u===l.length)return c(e,q),r;if(null===q){for(;uu?(t=q,q=null):t=q.sibling;var H=z(e,q,n.value,h);if(null===H){q||(q=t);break}a&&q&&null===H.alternate&&b(e,q);g=f(H,g,u);null===k?r=H:k.sibling=H;k=H;q=t;}if(n.done)return c(e,q),r;if(null===q){for(;!n.done;u++,n=l.next())n=p(e,n.value,h),null!==n&&(g=f(n,g,u),null===k?r=n:k.sibling=n,k=n);return r}for(q=d(e,q);!n.done;u++,n=l.next())if(n=B(q,e,u,n.value,h),null!==n){if(a&&null!==n.alternate)q["delete"](null===n.key?u:n.key); +g=f(n,g,u);null===k?r=n:k.sibling=n;k=n;}a&&q.forEach(function(a){return b(e,a)});return r}return function(a,d,f,g){"object"===typeof f&&null!==f&&f.type===rc&&null===f.key&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case nc:a:{var k=f.key;for(l=d;null!==l;){if(l.key===k)if(10===l.tag?f.type===rc:l.type===f.type){c(a,l.sibling);d=e(l,f.type===rc?f.props.children:f.props,g);d.ref=Ue(a,l,f);d["return"]=a;a=d;break a}else{c(a,l);break}else b(a,l);l=l.sibling;}f.type=== +rc?(d=Ae(f.props.children,a.mode,g,f.key),d["return"]=a,a=d):(g=ze(f,a.mode,g),g.ref=Ue(a,d,f),g["return"]=a,a=g);}return h(a);case qc:a:{for(l=f.key;null!==d;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[],g);d["return"]=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling;}d=Ce(f,a.mode,g);d["return"]=a;a=d;}return h(a)}if("string"===typeof f||"number"===typeof f)return f=""+f,null!==d&& +6===d.tag?(c(a,d.sibling),d=e(d,f,g)):(c(a,d),d=Be(f,a.mode,g)),d["return"]=a,a=d,h(a);if(Te(f))return r(a,d,f,g);if(yc(f))return Q(a,d,f,g);l&&Ve(a,f);if("undefined"===typeof f)switch(a.tag){case 2:case 1:g=a.type,D$1("152",g.displayName||g.name||"Component");}return c(a,d)}}var Xe=We(!0); var Ye=We(!1); +function Ze(a,b,c,d,e,f,h){function g(a,b,c){k(a,b,c,b.expirationTime);}function k(a,b,c,d){b.child=null===a?Ye(b,null,c,d):Xe(b,a.child,c,d);}function v(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.effectTag|=128;}function l(a,b,c,d,e,f){v(a,b);if(!c&&!e)return d&&y(b,!1),r(a,b);c=b.stateNode;mc.current=b;var g=e?null:c.render();b.effectTag|=1;e&&(k(a,b,null,f),b.child=null);k(a,b,g,f);b.memoizedState=c.state;b.memoizedProps=c.props;d&&y(b,!0);return b.child}function p(a){var b=a.stateNode; +b.pendingContext?t(a,b.pendingContext,b.pendingContext!==b.context):b.context&&t(a,b.context,!1);Y(a,b.containerInfo);}function z(a,b,c,d){var e=a.child;for(null!==e&&(e["return"]=a);null!==e;){switch(e.tag){case 12:var f=e.stateNode|0;if(e.type===b&&0!==(f&c)){for(f=e;null!==f;){var g=f.alternate;if(0===f.expirationTime||f.expirationTime>d)f.expirationTime=d,null!==g&&(0===g.expirationTime||g.expirationTime>d)&&(g.expirationTime=d);else if(null!==g&&(0===g.expirationTime||g.expirationTime>d))g.expirationTime= +d;else break;f=f["return"];}f=null;}else f=e.child;break;case 13:f=e.type===a.type?null:e.child;break;default:f=e.child;}if(null!==f)f["return"]=e;else for(f=e;null!==f;){if(f===a){f=null;break}e=f.sibling;if(null!==e){f=e;break}f=f["return"];}e=f;}}function B(a,b,c){var d=b.type._context,e=b.pendingProps,f=b.memoizedProps;if(!q()&&f===e)return b.stateNode=0,G(b),r(a,b);var l=e.value;b.memoizedProps=e;if(null===f)l=1073741823;else if(f.value===e.value){if(f.children===e.children)return b.stateNode=0,G(b), +r(a,b);l=0;}else{var u=f.value;if(u===l&&(0!==u||1/u===1/l)||u!==u&&l!==l){if(f.children===e.children)return b.stateNode=0,G(b),r(a,b);l=0;}else if(l="function"===typeof d._calculateChangedBits?d._calculateChangedBits(u,l):1073741823,l|=0,0===l){if(f.children===e.children)return b.stateNode=0,G(b),r(a,b)}else z(b,d,l,c);}b.stateNode=l;G(b);g(a,b,e.children);return b.child}function r(a,b){null!==a&&b.child!==a.child?D$1("153"):void 0;if(null!==b.child){a=b.child;var c=ye(a,a.pendingProps,a.expirationTime); +b.child=c;for(c["return"]=b;null!==a.sibling;)a=a.sibling,c=c.sibling=ye(a,a.pendingProps,a.expirationTime),c["return"]=b;c.sibling=null;}return b.child}var Q=a.shouldSetTextContent,n=a.shouldDeprioritizeSubtree,x=b.pushHostContext,Y=b.pushHostContainer,G=d.pushProvider,R=c.getMaskedContext,S=c.getUnmaskedContext,q=c.hasContextChanged,u=c.pushContextProvider,t=c.pushTopLevelContextObject,y=c.invalidateContextProvider,H=e.enterHydrationState,Wa=e.resetHydrationState,Cb=e.tryToClaimNextHydratableInstance; +a=Se(c,f,h,function(a,b){a.memoizedProps=b;},function(a,b){a.memoizedState=b;});var Jc=a.adoptClassInstance,Kc=a.callGetDerivedStateFromProps,Lc=a.constructClassInstance,Db=a.mountClassInstance,Mc=a.resumeMountClassInstance,Eb=a.updateClassInstance;return{beginWork:function(a,b,c){if(0===b.expirationTime||b.expirationTime>c){switch(b.tag){case 3:p(b);break;case 2:u(b);break;case 4:Y(b,b.stateNode.containerInfo);break;case 13:G(b);}return null}switch(b.tag){case 0:null!==a?D$1("155"):void 0;var d=b.type, +e=b.pendingProps,f=S(b);f=R(b,f);d=d(e,f);b.effectTag|=1;"object"===typeof d&&null!==d&&"function"===typeof d.render&&void 0===d.$$typeof?(f=b.type,b.tag=2,b.memoizedState=null!==d.state&&void 0!==d.state?d.state:null,"function"===typeof f.getDerivedStateFromProps&&(e=Kc(b,d,e,b.memoizedState),null!==e&&void 0!==e&&(b.memoizedState=require$$4({},b.memoizedState,e))),e=u(b),Jc(b,d),Db(b,c),a=l(a,b,!0,e,!1,c)):(b.tag=1,g(a,b,d),b.memoizedProps=e,a=b.child);return a;case 1:return e=b.type,c=b.pendingProps,q()|| +b.memoizedProps!==c?(d=S(b),d=R(b,d),e=e(c,d),b.effectTag|=1,g(a,b,e),b.memoizedProps=c,a=b.child):a=r(a,b),a;case 2:e=u(b);null===a?null===b.stateNode?(Lc(b,b.pendingProps),Db(b,c),d=!0):d=Mc(b,c):d=Eb(a,b,c);f=!1;var h=b.updateQueue;null!==h&&null!==h.capturedValues&&(f=d=!0);return l(a,b,d,e,f,c);case 3:a:if(p(b),d=b.updateQueue,null!==d){f=b.memoizedState;e=Qe(a,b,d,null,null,c);b.memoizedState=e;d=b.updateQueue;if(null!==d&&null!==d.capturedValues)d=null;else if(f===e){Wa();a=r(a,b);break a}else d= +e.element;f=b.stateNode;(null===a||null===a.child)&&f.hydrate&&H(b)?(b.effectTag|=2,b.child=Ye(b,null,d,c)):(Wa(),g(a,b,d));b.memoizedState=e;a=b.child;}else Wa(),a=r(a,b);return a;case 5:a:{x(b);null===a&&Cb(b);e=b.type;h=b.memoizedProps;d=b.pendingProps;f=null!==a?a.memoizedProps:null;if(!q()&&h===d){if(h=b.mode&1&&n(e,d))b.expirationTime=1073741823;if(!h||1073741823!==c){a=r(a,b);break a}}h=d.children;Q(e,d)?h=null:f&&Q(e,f)&&(b.effectTag|=16);v(a,b);1073741823!==c&&b.mode&1&&n(e,d)?(b.expirationTime= +1073741823,b.memoizedProps=d,a=null):(g(a,b,h),b.memoizedProps=d,a=b.child);}return a;case 6:return null===a&&Cb(b),b.memoizedProps=b.pendingProps,null;case 8:b.tag=7;case 7:return e=b.pendingProps,q()||b.memoizedProps!==e||(e=b.memoizedProps),d=e.children,b.stateNode=null===a?Ye(b,b.stateNode,d,c):Xe(b,a.stateNode,d,c),b.memoizedProps=e,b.stateNode;case 9:return null;case 4:return Y(b,b.stateNode.containerInfo),e=b.pendingProps,q()||b.memoizedProps!==e?(null===a?b.child=Xe(b,null,e,c):g(a,b,e),b.memoizedProps= +e,a=b.child):a=r(a,b),a;case 14:return c=b.type.render,c=c(b.pendingProps,b.ref),g(a,b,c),b.memoizedProps=c,b.child;case 10:return c=b.pendingProps,q()||b.memoizedProps!==c?(g(a,b,c),b.memoizedProps=c,a=b.child):a=r(a,b),a;case 11:return c=b.pendingProps.children,q()||null!==c&&b.memoizedProps!==c?(g(a,b,c),b.memoizedProps=c,a=b.child):a=r(a,b),a;case 13:return B(a,b,c);case 12:d=b.type;f=b.pendingProps;var t=b.memoizedProps;e=d._currentValue;h=d._changedBits;if(q()||0!==h||t!==f){b.memoizedProps= +f;t=f.unstable_observedBits;if(void 0===t||null===t)t=1073741823;b.stateNode=t;0!==(h&t)&&z(b,d,h,c);c=f.children;c=c(e);g(a,b,c);a=b.child;}else a=r(a,b);return a;default:D$1("156");}}}} +function $e(a,b,c,d,e){function f(a){a.effectTag|=4;}var h=a.createInstance,g=a.createTextInstance,k=a.appendInitialChild,v=a.finalizeInitialChildren,l=a.prepareUpdate,p=a.persistence,z=b.getRootHostContainer,B=b.popHostContext,r=b.getHostContext,Q=b.popHostContainer,n=c.popContextProvider,x=c.popTopLevelContextObject,Y=d.popProvider,G=e.prepareToHydrateHostInstance,R=e.prepareToHydrateHostTextInstance,S=e.popHydrationState,q=void 0,u=void 0,t=void 0;a.mutation?(q=function(){},u=function(a,b,c){(b.updateQueue= +c)&&f(b);},t=function(a,b,c,d){c!==d&&f(b);}):p?D$1("235"):D$1("236");return{completeWork:function(a,b,c){var d=b.pendingProps;switch(b.tag){case 1:return null;case 2:return n(b),a=b.stateNode,d=b.updateQueue,null!==d&&null!==d.capturedValues&&(b.effectTag&=-65,"function"===typeof a.componentDidCatch?b.effectTag|=256:d.capturedValues=null),null;case 3:Q(b);x(b);d=b.stateNode;d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null);if(null===a||null===a.child)S(b),b.effectTag&=-3;q(b);a=b.updateQueue; +null!==a&&null!==a.capturedValues&&(b.effectTag|=256);return null;case 5:B(b);c=z();var e=b.type;if(null!==a&&null!=b.stateNode){var p=a.memoizedProps,H=b.stateNode,y=r();H=l(H,e,p,d,c,y);u(a,b,H,e,p,d,c,y);a.ref!==b.ref&&(b.effectTag|=128);}else{if(!d)return null===b.stateNode?D$1("166"):void 0,null;a=r();if(S(b))G(b,c,a)&&f(b);else{p=h(e,d,c,a,b);a:for(y=b.child;null!==y;){if(5===y.tag||6===y.tag)k(p,y.stateNode);else if(4!==y.tag&&null!==y.child){y.child["return"]=y;y=y.child;continue}if(y===b)break; +for(;null===y.sibling;){if(null===y["return"]||y["return"]===b)break a;y=y["return"];}y.sibling["return"]=y["return"];y=y.sibling;}v(p,e,d,c,a)&&f(b);b.stateNode=p;}null!==b.ref&&(b.effectTag|=128);}return null;case 6:if(a&&null!=b.stateNode)t(a,b,a.memoizedProps,d);else{if("string"!==typeof d)return null===b.stateNode?D$1("166"):void 0,null;a=z();c=r();S(b)?R(b)&&f(b):b.stateNode=g(d,a,c,b);}return null;case 7:(d=b.memoizedProps)?void 0:D$1("165");b.tag=8;e=[];a:for((p=b.stateNode)&&(p["return"]=b);null!== +p;){if(5===p.tag||6===p.tag||4===p.tag)D$1("247");else if(9===p.tag)e.push(p.pendingProps.value);else if(null!==p.child){p.child["return"]=p;p=p.child;continue}for(;null===p.sibling;){if(null===p["return"]||p["return"]===b)break a;p=p["return"];}p.sibling["return"]=p["return"];p=p.sibling;}p=d.handler;d=p(d.props,e);b.child=Xe(b,null!==a?a.child:null,d,c);return b.child;case 8:return b.tag=7,null;case 9:return null;case 14:return null;case 10:return null;case 11:return null;case 4:return Q(b),q(b),null; +case 13:return Y(b),null;case 12:return null;case 0:D$1("167");default:D$1("156");}}}} +function af(a,b,c,d,e){var f=a.popHostContainer,h=a.popHostContext,g=b.popContextProvider,k=b.popTopLevelContextObject,v=c.popProvider;return{throwException:function(a,b,c){b.effectTag|=512;b.firstEffect=b.lastEffect=null;b={value:c,source:b,stack:Ac(b)};do{switch(a.tag){case 3:Ne(a);a.updateQueue.capturedValues=[b];a.effectTag|=1024;return;case 2:if(c=a.stateNode,0===(a.effectTag&64)&&null!==c&&"function"===typeof c.componentDidCatch&&!e(c)){Ne(a);c=a.updateQueue;var d=c.capturedValues;null===d? +c.capturedValues=[b]:d.push(b);a.effectTag|=1024;return}}a=a["return"];}while(null!==a)},unwindWork:function(a){switch(a.tag){case 2:g(a);var b=a.effectTag;return b&1024?(a.effectTag=b&-1025|64,a):null;case 3:return f(a),k(a),b=a.effectTag,b&1024?(a.effectTag=b&-1025|64,a):null;case 5:return h(a),null;case 4:return f(a),null;case 13:return v(a),null;default:return null}},unwindInterruptedWork:function(a){switch(a.tag){case 2:g(a);break;case 3:f(a);k(a);break;case 5:h(a);break;case 4:f(a);break;case 13:v(a);}}}} +function bf(a,b){var c=b.source;null===b.stack&&Ac(c);null!==c&&zc(c);b=b.value;null!==a&&2===a.tag&&zc(a);try{b&&b.suppressReactErrorLogging||console.error(b);}catch(d){d&&d.suppressReactErrorLogging||console.error(d);}} +function cf(a,b,c,d,e){function f(a){var c=a.ref;if(null!==c)if("function"===typeof c)try{c(null);}catch(t){b(a,t);}else c.current=null;}function h(a){"function"===typeof Ie&&Ie(a);switch(a.tag){case 2:f(a);var c=a.stateNode;if("function"===typeof c.componentWillUnmount)try{c.props=a.memoizedProps,c.state=a.memoizedState,c.componentWillUnmount();}catch(t){b(a,t);}break;case 5:f(a);break;case 7:g(a.stateNode);break;case 4:p&&v(a);}}function g(a){for(var b=a;;)if(h(b),null===b.child||p&&4===b.tag){if(b=== +a)break;for(;null===b.sibling;){if(null===b["return"]||b["return"]===a)return;b=b["return"];}b.sibling["return"]=b["return"];b=b.sibling;}else b.child["return"]=b,b=b.child;}function k(a){return 5===a.tag||3===a.tag||4===a.tag}function v(a){for(var b=a,c=!1,d=void 0,e=void 0;;){if(!c){c=b["return"];a:for(;;){null===c?D$1("160"):void 0;switch(c.tag){case 5:d=c.stateNode;e=!1;break a;case 3:d=c.stateNode.containerInfo;e=!0;break a;case 4:d=c.stateNode.containerInfo;e=!0;break a}c=c["return"];}c=!0;}if(5=== +b.tag||6===b.tag)g(b),e?S(d,b.stateNode):R(d,b.stateNode);else if(4===b.tag?d=b.stateNode.containerInfo:h(b),null!==b.child){b.child["return"]=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b["return"]||b["return"]===a)return;b=b["return"];4===b.tag&&(c=!1);}b.sibling["return"]=b["return"];b=b.sibling;}}var l=a.getPublicInstance,p=a.mutation;a=a.persistence;p||(a?D$1("235"):D$1("236"));var z=p.commitMount,B=p.commitUpdate,r=p.resetTextContent,Q=p.commitTextUpdate,n=p.appendChild, +x=p.appendChildToContainer,Y=p.insertBefore,G=p.insertInContainerBefore,R=p.removeChild,S=p.removeChildFromContainer;return{commitBeforeMutationLifeCycles:function(a,b){switch(b.tag){case 2:if(b.effectTag&2048&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;a.props=b.memoizedProps;a.state=b.memoizedState;b=a.getSnapshotBeforeUpdate(c,d);a.__reactInternalSnapshotBeforeUpdate=b;}break;case 3:case 5:case 6:case 4:break;default:D$1("163");}},commitResetTextContent:function(a){r(a.stateNode);}, +commitPlacement:function(a){a:{for(var b=a["return"];null!==b;){if(k(b)){var c=b;break a}b=b["return"];}D$1("160");c=void 0;}var d=b=void 0;switch(c.tag){case 5:b=c.stateNode;d=!1;break;case 3:b=c.stateNode.containerInfo;d=!0;break;case 4:b=c.stateNode.containerInfo;d=!0;break;default:D$1("161");}c.effectTag&16&&(r(b),c.effectTag&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c["return"]||k(c["return"])){c=null;break a}c=c["return"];}c.sibling["return"]=c["return"];for(c=c.sibling;5!==c.tag&&6!== +c.tag;){if(c.effectTag&2)continue b;if(null===c.child||4===c.tag)continue b;else c.child["return"]=c,c=c.child;}if(!(c.effectTag&2)){c=c.stateNode;break a}}for(var e=a;;){if(5===e.tag||6===e.tag)c?d?G(b,e.stateNode,c):Y(b,e.stateNode,c):d?x(b,e.stateNode):n(b,e.stateNode);else if(4!==e.tag&&null!==e.child){e.child["return"]=e;e=e.child;continue}if(e===a)break;for(;null===e.sibling;){if(null===e["return"]||e["return"]===a)return;e=e["return"];}e.sibling["return"]=e["return"];e=e.sibling;}},commitDeletion:function(a){v(a); +a["return"]=null;a.child=null;a.alternate&&(a.alternate.child=null,a.alternate["return"]=null);},commitWork:function(a,b){switch(b.tag){case 2:break;case 5:var c=b.stateNode;if(null!=c){var d=b.memoizedProps;a=null!==a?a.memoizedProps:d;var e=b.type,f=b.updateQueue;b.updateQueue=null;null!==f&&B(c,f,e,a,d,b);}break;case 6:null===b.stateNode?D$1("162"):void 0;c=b.memoizedProps;Q(b.stateNode,null!==a?a.memoizedProps:c,c);break;case 3:break;default:D$1("163");}},commitLifeCycles:function(a,b,c){switch(c.tag){case 2:a= +c.stateNode;if(c.effectTag&4)if(null===b)a.props=c.memoizedProps,a.state=c.memoizedState,a.componentDidMount();else{var d=b.memoizedProps;b=b.memoizedState;a.props=c.memoizedProps;a.state=c.memoizedState;a.componentDidUpdate(d,b,a.__reactInternalSnapshotBeforeUpdate);}c=c.updateQueue;null!==c&&Re(c,a);break;case 3:b=c.updateQueue;if(null!==b){a=null;if(null!==c.child)switch(c.child.tag){case 5:a=l(c.child.stateNode);break;case 2:a=c.child.stateNode;}Re(b,a);}break;case 5:a=c.stateNode;null===b&&c.effectTag& +4&&z(a,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;default:D$1("163");}},commitErrorLogging:function(a,b){switch(a.tag){case 2:var c=a.type;b=a.stateNode;var d=a.updateQueue;null===d||null===d.capturedValues?D$1("264"):void 0;var f=d.capturedValues;d.capturedValues=null;"function"!==typeof c.getDerivedStateFromCatch&&e(b);b.props=a.memoizedProps;b.state=a.memoizedState;for(c=0;cb||(c.current=a[b],a[b]=null,b--);},push:function(c,d){b++;a[b]=c.current;c.current=d;},checkThatStackIsEmpty:function(){},resetStackAfterFatalErrorInDev:function(){}}} +function kf(a){function b(){if(null!==I)for(var a=I["return"];null!==a;)Lc(a),a=a["return"];Ya=null;Z=0;I=null;Nc=!1;}function c(a){return null!==ya&&ya.has(a)}function d(a){for(;;){var b=a.alternate,c=a["return"],d=a.sibling;if(0===(a.effectTag&512)){b=Cb(b,a,Z);var e=a;if(1073741823===Z||1073741823!==e.expirationTime){b:switch(e.tag){case 3:case 2:var f=e.updateQueue;f=null===f?0:f.expirationTime;break b;default:f=0;}for(var g=e.child;null!==g;)0!==g.expirationTime&&(0===f||f>g.expirationTime)&&(f= +g.expirationTime),g=g.sibling;e.expirationTime=f;}if(null!==b)return b;null!==c&&0===(c.effectTag&512)&&(null===c.firstEffect&&(c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect=a.firstEffect),c.lastEffect=a.lastEffect),1da)&&(da=a);return a}function v(a,c){a:{for(;null!==a;){if(0===a.expirationTime||a.expirationTime>c)a.expirationTime=c;null!==a.alternate&&(0===a.alternate.expirationTime||a.alternate.expirationTime>c)&&(a.alternate.expirationTime=c);if(null===a["return"])if(3===a.tag){var d= +a.stateNode;!ca&&0!==Z&&cwg&&D$1("185");}else{c=void 0;break a}a=a["return"];}c=void 0;}return c}function l(){ve=Ic()-Pc;return xg=(ve/10|0)+2}function p(a,b,c,d,e){var f=ia;ia=1;try{return a(b,c,d,e)}finally{ia=f;}}function z(a){if(0!==Gb){if(a>Gb)return;yg(Qc);}var b=Ic()-Pc;Gb=a;Qc=lg(Q,{timeout:10*(a-2)-b});}function B(a,b){if(null===a.nextScheduledRoot)a.remainingExpirationTime=b,null===K?(la=K=a,a.nextScheduledRoot=a):(K=K.nextScheduledRoot=a,K.nextScheduledRoot=la); +else{var c=a.remainingExpirationTime;if(0===c||b=P)&&(!Ib||l()>=P);)G(aa,P,!Ib),r();else for(;null!==aa&&0!==P&&(0===a||a>=P);)G(aa,P,!1),r();null!==$a&&(Gb=0,Qc=-1);0!==P&&z(P);$a=null;Ib=!1;Y();}function Y(){Fb=0;if(null!==Aa){var a=Aa;Aa=null;for(var b= +0;bBg?!1:Ib=!0}function q(a){null===aa?D$1("246"):void 0;aa.remainingExpirationTime=0;Ba||(Ba=!0,Jb=a);}var u=jf(),t=ef(a,u),y=gf(u);u=hf(u);var H=ff(a), +Wa=Ze(a,t,y,u,H,v,k).beginWork,Cb=$e(a,t,y,u,H).completeWork;t=af(t,y,u,v,c);var Jc=t.throwException,Kc=t.unwindWork,Lc=t.unwindInterruptedWork;t=cf(a,g,v,k,function(a){null===ya?ya=new Set([a]):ya.add(a);},l);var Db=t.commitBeforeMutationLifeCycles,Mc=t.commitResetTextContent,Eb=t.commitPlacement,gg=t.commitDeletion,te=t.commitWork,hg=t.commitLifeCycles,ig=t.commitErrorLogging,jg=t.commitAttachRef,kg=t.commitDetachRef,Ic=a.now,lg=a.scheduleDeferredCallback,yg=a.cancelDeferredCallback,zg=a.prepareForCommit, +Ag=a.resetAfterCommit,Pc=Ic(),xg=2,ve=Pc,Rc=0,ia=0,ca=!1,I=null,Ya=null,Z=0,w=null,Za=!1,Nc=!1,ya=null,la=null,K=null,Gb=0,Qc=-1,T=!1,aa=null,P=0,da=0,Ib=!1,Ba=!1,Jb=null,$a=null,J=!1,Hb=!1,za=!1,Aa=null,wg=1E3,Fb=0,Bg=1;return{recalculateCurrentTime:l,computeExpirationForFiber:k,scheduleWork:v,requestWork:B,flushRoot:function(a,b){T?D$1("253"):void 0;aa=a;P=b;G(a,b,!1);n();Y();},batchedUpdates:function(a,b){var c=J;J=!0;try{return a(b)}finally{(J=c)||T||n();}},unbatchedUpdates:function(a,b){if(J&&!Hb){Hb= +!0;try{return a(b)}finally{Hb=!1;}}return a(b)},flushSync:function(a,b){T?D$1("187"):void 0;var c=J;J=!0;try{return p(a,b)}finally{J=c,n();}},flushControlled:function(a){var b=J;J=!0;try{p(a);}finally{(J=b)||T||x(1,!1,null);}},deferredUpdates:function(a){var b=ia;ia=25*(((l()+500)/25|0)+1);try{return a()}finally{ia=b;}},syncUpdates:p,interactiveUpdates:function(a,b,c){if(za)return a(b,c);J||T||0===da||(x(da,!1,null),da=0);var d=za,e=J;J=za=!0;try{return a(b,c)}finally{za=d,(J=e)||T||n();}},flushInteractiveUpdates:function(){T|| +0===da||(x(da,!1,null),da=0);},computeUniqueAsyncExpiration:function(){var a=25*(((l()+500)/25|0)+1);a<=Rc&&(a=Rc+1);return Rc=a},legacyContext:y}} +function lf(a){function b(a,b,c,d,e,f){d=b.current;if(c){c=c._reactInternalFiber;var g=k(c);c=v(c)?l(c,g):g;}else c=require$$10;null===b.context?b.context=c:b.pendingContext=c;b=f;Oe(d,{expirationTime:e,partialState:{element:a},callback:void 0===b?null:b,isReplace:!1,isForced:!1,capturedValue:null,next:null});h(d,e);return e}function c(a){a=Ad(a);return null===a?null:a.stateNode}var d=a.getPublicInstance;a=kf(a);var e=a.recalculateCurrentTime,f=a.computeExpirationForFiber,h=a.scheduleWork,g=a.legacyContext, +k=g.findCurrentUnmaskedContext,v=g.isContextProvider,l=g.processChildContext;return{createContainer:function(a,b,c){b=new xe(3,null,null,b?3:0);a={current:b,containerInfo:a,pendingChildren:null,pendingCommitExpirationTime:0,finishedWork:null,context:null,pendingContext:null,hydrate:c,remainingExpirationTime:0,firstBatch:null,nextScheduledRoot:null};return b.stateNode=a},updateContainer:function(a,c,d,g){var h=c.current,k=e();h=f(h);return b(a,c,d,k,h,g)},updateContainerAtExpirationTime:function(a, +c,d,f,g){var h=e();return b(a,c,d,h,f,g)},flushRoot:a.flushRoot,requestWork:a.requestWork,computeUniqueAsyncExpiration:a.computeUniqueAsyncExpiration,batchedUpdates:a.batchedUpdates,unbatchedUpdates:a.unbatchedUpdates,deferredUpdates:a.deferredUpdates,syncUpdates:a.syncUpdates,interactiveUpdates:a.interactiveUpdates,flushInteractiveUpdates:a.flushInteractiveUpdates,flushControlled:a.flushControlled,flushSync:a.flushSync,getPublicRootInstance:function(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return d(a.child.stateNode); +default:return a.child.stateNode}},findHostInstance:c,findHostInstanceWithNoPortals:function(a){a=Bd(a);return null===a?null:a.stateNode},injectIntoDevTools:function(a){var b=a.findFiberByHostInstance;return Ge(require$$4({},a,{findHostInstanceByFiber:function(a){return c(a)},findFiberByHostInstance:function(a){return b?b(a):null}}))}}}var mf=Object.freeze({default:lf}); var nf=mf&&lf||mf; var of=nf["default"]?nf["default"]:nf; +function pf(a,b,c){var d=3=yf-a)if(-1!== +wf&&wf<=a)Bf.didTimeout=!0;else{xf||(xf=!0,requestAnimationFrame(Df));return}else Bf.didTimeout=!1;wf=-1;a=uf;uf=null;null!==a&&a(Bf);}},!1);var Df=function(a){xf=!1;var b=a-yf+Af;bb&&(b=8),Af=b=b.length?void 0:D$1("93"),b=b[0]),c=""+b),null==c&&(c=""));a._wrapperState={initialValue:""+c};} +function Kf(a,b){var c=b.value;null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&(a.defaultValue=c));null!=b.defaultValue&&(a.defaultValue=b.defaultValue);}function Lf(a){var b=a.textContent;b===a._wrapperState.initialValue&&(a.value=b);}var Mf={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"}; +function Nf(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Of(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?Nf(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a} +var Pf=void 0; +var Qf=function(a){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)});}:a}(function(a,b){if(a.namespaceURI!==Mf.svg||"innerHTML"in a)a.innerHTML=b;else{Pf=Pf||document.createElement("div");Pf.innerHTML="\x3csvg\x3e"+b+"\x3c/svg\x3e";for(b=Pf.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild);}}); +function Rf(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b;} +var Sf={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0, stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0}; -var eg=["Webkit","ms","Moz","O"];Object.keys(dg).forEach(function(a){eg.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);dg[b]=dg[a];});}); -function fg(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--");var e=c;var f=b[c];e=null==f||"boolean"===typeof f||""===f?"":d||"number"!==typeof f||0===f||dg.hasOwnProperty(e)&&dg[e]?(""+f).trim():f+"px";"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e;}}var gg=require$$4({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}); -function hg(a,b,c){b&&(gg[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML?E$1("137",a,c()):void 0),null!=b.dangerouslySetInnerHTML&&(null!=b.children?E$1("60"):void 0,"object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML?void 0:E$1("61")),null!=b.style&&"object"!==typeof b.style?E$1("62",c()):void 0);} -function ig(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){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!1;default:return!0}}var jg=Yf.html; var kg=emptyFunction$2.thatReturns(""); -function lg(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=Hd(a);b=Sa[b];for(var d=0;d -d&&(e=d,d=a,a=e);e=Jd(c,a);var f=Jd(c,d);if(e&&f&&(1!==b.rangeCount||b.anchorNode!==e.node||b.anchorOffset!==e.offset||b.focusNode!==f.node||b.focusOffset!==f.offset)){var g=document.createRange();g.setStart(e.node,e.offset);b.removeAllRanges();a>d?(b.addRange(g),b.extend(f.node,f.offset)):(g.setEnd(f.node,f.offset),b.addRange(g));}}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});require$$10(c);for(c=0;c +d&&(e=d,d=a,a=e);e=le(c,a);var f=le(c,d);if(e&&f&&(1!==b.rangeCount||b.anchorNode!==e.node||b.anchorOffset!==e.offset||b.focusNode!==f.node||b.focusOffset!==f.offset)){var h=document.createRange();h.setStart(e.node,e.offset);b.removeAllRanges();a>d?(b.addRange(h),b.extend(f.node,f.offset)):(h.setEnd(f.node,f.offset),b.addRange(h));}}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});c.focus();for(c=0;c 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { - return false; - } - if (value === null) { - return true; - } - switch (typeof value) { - case 'boolean': - return shouldAttributeAcceptBooleanValue(name); - case 'undefined': - case 'number': - case 'string': - case 'object': - return true; - default: - // function, symbol - return false; - } -} - -function getPropertyInfo(name) { - return properties.hasOwnProperty(name) ? properties[name] : null; -} - -function shouldAttributeAcceptBooleanValue(name) { - if (isReservedProp(name)) { - return true; - } - var propertyInfo = getPropertyInfo(name); - if (propertyInfo) { - return propertyInfo.hasBooleanValue || propertyInfo.hasStringBooleanValue || propertyInfo.hasOverloadedBooleanValue; - } - var prefix = name.toLowerCase().slice(0, 5); - return prefix === 'data-' || prefix === 'aria-'; -} - -/** - * Checks to see if a property name is within the list of properties - * reserved for internal React operations. These properties should - * not be set on an HTML element. - * - * @private - * @param {string} name - * @return {boolean} If the name is within reserved props - */ -function isReservedProp(name) { - return RESERVED_PROPS.hasOwnProperty(name); -} - -var injection = DOMPropertyInjection; - -var MUST_USE_PROPERTY = injection.MUST_USE_PROPERTY; -var HAS_BOOLEAN_VALUE = injection.HAS_BOOLEAN_VALUE; -var HAS_NUMERIC_VALUE = injection.HAS_NUMERIC_VALUE; -var HAS_POSITIVE_NUMERIC_VALUE = injection.HAS_POSITIVE_NUMERIC_VALUE; -var HAS_OVERLOADED_BOOLEAN_VALUE = injection.HAS_OVERLOADED_BOOLEAN_VALUE; -var HAS_STRING_BOOLEAN_VALUE = injection.HAS_STRING_BOOLEAN_VALUE; - -var HTMLDOMPropertyConfig = { - // When adding attributes to this list, be sure to also add them to - // the `possibleStandardNames` module to ensure casing and incorrect - // name warnings. - Properties: { - allowFullScreen: HAS_BOOLEAN_VALUE, - // specifies target context for links with `preload` type - async: HAS_BOOLEAN_VALUE, - // Note: there is a special case that prevents it from being written to the DOM - // on the client side because the browsers are inconsistent. Instead we call focus(). - autoFocus: HAS_BOOLEAN_VALUE, - autoPlay: HAS_BOOLEAN_VALUE, - capture: HAS_OVERLOADED_BOOLEAN_VALUE, - checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, - cols: HAS_POSITIVE_NUMERIC_VALUE, - contentEditable: HAS_STRING_BOOLEAN_VALUE, - controls: HAS_BOOLEAN_VALUE, - 'default': HAS_BOOLEAN_VALUE, - defer: HAS_BOOLEAN_VALUE, - disabled: HAS_BOOLEAN_VALUE, - download: HAS_OVERLOADED_BOOLEAN_VALUE, - draggable: HAS_STRING_BOOLEAN_VALUE, - formNoValidate: HAS_BOOLEAN_VALUE, - hidden: HAS_BOOLEAN_VALUE, - loop: HAS_BOOLEAN_VALUE, - // Caution; `option.selected` is not updated if `select.multiple` is - // disabled with `removeAttribute`. - multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, - muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, - noValidate: HAS_BOOLEAN_VALUE, - open: HAS_BOOLEAN_VALUE, - playsInline: HAS_BOOLEAN_VALUE, - readOnly: HAS_BOOLEAN_VALUE, - required: HAS_BOOLEAN_VALUE, - reversed: HAS_BOOLEAN_VALUE, - rows: HAS_POSITIVE_NUMERIC_VALUE, - rowSpan: HAS_NUMERIC_VALUE, - scoped: HAS_BOOLEAN_VALUE, - seamless: HAS_BOOLEAN_VALUE, - selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, - size: HAS_POSITIVE_NUMERIC_VALUE, - start: HAS_NUMERIC_VALUE, - // support for projecting regular DOM Elements via V1 named slots ( shadow dom ) - span: HAS_POSITIVE_NUMERIC_VALUE, - spellCheck: HAS_STRING_BOOLEAN_VALUE, - // Style must be explicitly set in the attribute list. React components - // expect a style object - style: 0, - // Keep it in the whitelist because it is case-sensitive for SVG. - tabIndex: 0, - // itemScope is for for Microdata support. - // See http://schema.org/docs/gs.html - itemScope: HAS_BOOLEAN_VALUE, - // These attributes must stay in the white-list because they have - // different attribute names (see DOMAttributeNames below) - acceptCharset: 0, - className: 0, - htmlFor: 0, - httpEquiv: 0, - // Attributes with mutation methods must be specified in the whitelist - // Set the string boolean flag to allow the behavior - value: HAS_STRING_BOOLEAN_VALUE - }, - DOMAttributeNames: { - acceptCharset: 'accept-charset', - className: 'class', - htmlFor: 'for', - httpEquiv: 'http-equiv' - }, - DOMMutationMethods: { - value: function (node, value) { - if (value == null) { - return node.removeAttribute('value'); - } - - // Number inputs get special treatment due to some edge cases in - // Chrome. Let everything else assign the value attribute as normal. - // https://github.com/facebook/react/issues/7253#issuecomment-236074326 - if (node.type !== 'number' || node.hasAttribute('value') === false) { - node.setAttribute('value', '' + value); - } else if (node.validity && !node.validity.badInput && node.ownerDocument.activeElement !== node) { - // Don't assign an attribute if validation reports bad - // input. Chrome will clear the value. Additionally, don't - // operate on inputs that have focus, otherwise Chrome might - // strip off trailing decimal places and cause the user's - // cursor position to jump to the beginning of the input. - // - // In ReactDOMInput, we have an onBlur event that will trigger - // this function again when focus is lost. - node.setAttribute('value', '' + value); - } - } - } -}; - -var HAS_STRING_BOOLEAN_VALUE$1 = injection.HAS_STRING_BOOLEAN_VALUE; - - -var NS = { - xlink: 'http://www.w3.org/1999/xlink', - xml: 'http://www.w3.org/XML/1998/namespace' -}; - -/** - * This is a list of all SVG attributes that need special casing, - * namespacing, or boolean value assignment. - * - * When adding attributes to this list, be sure to also add them to - * the `possibleStandardNames` module to ensure casing and incorrect - * name warnings. - * - * SVG Attributes List: - * https://www.w3.org/TR/SVG/attindex.html - * SMIL Spec: - * https://www.w3.org/TR/smil - */ -var ATTRS = ['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', 'x-height', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xmlns:xlink', 'xml:lang', 'xml:space']; - -var SVGDOMPropertyConfig = { - Properties: { - autoReverse: HAS_STRING_BOOLEAN_VALUE$1, - externalResourcesRequired: HAS_STRING_BOOLEAN_VALUE$1, - preserveAlpha: HAS_STRING_BOOLEAN_VALUE$1 - }, - DOMAttributeNames: { - autoReverse: 'autoReverse', - externalResourcesRequired: 'externalResourcesRequired', - preserveAlpha: 'preserveAlpha' - }, - DOMAttributeNamespaces: { - xlinkActuate: NS.xlink, - xlinkArcrole: NS.xlink, - xlinkHref: NS.xlink, - xlinkRole: NS.xlink, - xlinkShow: NS.xlink, - xlinkTitle: NS.xlink, - xlinkType: NS.xlink, - xmlBase: NS.xml, - xmlLang: NS.xml, - xmlSpace: NS.xml - } -}; - -var CAMELIZE = /[\-\:]([a-z])/g; -var capitalize = function (token) { - return token[1].toUpperCase(); -}; - -ATTRS.forEach(function (original) { - var reactName = original.replace(CAMELIZE, capitalize); - - SVGDOMPropertyConfig.Properties[reactName] = 0; - SVGDOMPropertyConfig.DOMAttributeNames[reactName] = original; -}); - -injection.injectDOMPropertyConfig(HTMLDOMPropertyConfig); -injection.injectDOMPropertyConfig(SVGDOMPropertyConfig); - -var ReactErrorUtils = { - // Used by Fiber to simulate a try-catch. - _caughtError: null, - _hasCaughtError: false, - - // Used by event system to capture/rethrow the first error. - _rethrowError: null, - _hasRethrowError: false, - - injection: { - injectErrorUtils: function (injectedErrorUtils) { - !(typeof injectedErrorUtils.invokeGuardedCallback === 'function') ? invariant(false, 'Injected invokeGuardedCallback() must be a function.') : void 0; - invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback; - } - }, - - /** - * Call a function while guarding against errors that happens within it. - * Returns an error if it throws, otherwise null. - * - * In production, this is implemented using a try-catch. The reason we don't - * use a try-catch directly is so that we can swap out a different - * implementation in DEV mode. - * - * @param {String} name of the guard to use for logging or debugging - * @param {Function} func The function to invoke - * @param {*} context The context to use when calling the function - * @param {...*} args Arguments for function - */ - invokeGuardedCallback: function (name, func, context, a, b, c, d, e, f) { - invokeGuardedCallback.apply(ReactErrorUtils, arguments); - }, - - /** - * Same as invokeGuardedCallback, but instead of returning an error, it stores - * it in a global so it can be rethrown by `rethrowCaughtError` later. - * TODO: See if _caughtError and _rethrowError can be unified. - * - * @param {String} name of the guard to use for logging or debugging - * @param {Function} func The function to invoke - * @param {*} context The context to use when calling the function - * @param {...*} args Arguments for function - */ - invokeGuardedCallbackAndCatchFirstError: function (name, func, context, a, b, c, d, e, f) { - ReactErrorUtils.invokeGuardedCallback.apply(this, arguments); - if (ReactErrorUtils.hasCaughtError()) { - var error = ReactErrorUtils.clearCaughtError(); - if (!ReactErrorUtils._hasRethrowError) { - ReactErrorUtils._hasRethrowError = true; - ReactErrorUtils._rethrowError = error; - } - } - }, - - /** - * During execution of guarded functions we will capture the first error which - * we will rethrow to be handled by the top level error handler. - */ - rethrowCaughtError: function () { - return rethrowCaughtError.apply(ReactErrorUtils, arguments); - }, - - hasCaughtError: function () { - return ReactErrorUtils._hasCaughtError; - }, - - clearCaughtError: function () { - if (ReactErrorUtils._hasCaughtError) { - var error = ReactErrorUtils._caughtError; - ReactErrorUtils._caughtError = null; - ReactErrorUtils._hasCaughtError = false; - return error; - } else { - invariant(false, 'clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.'); - } - } -}; - var invokeGuardedCallback = function (name, func, context, a, b, c, d, e, f) { - ReactErrorUtils._hasCaughtError = false; - ReactErrorUtils._caughtError = null; + this._hasCaughtError = false; + this._caughtError = null; var funcArgs = Array.prototype.slice.call(arguments, 3); try { func.apply(context, funcArgs); } catch (error) { - ReactErrorUtils._caughtError = error; - ReactErrorUtils._hasCaughtError = true; + this._caughtError = error; + this._hasCaughtError = true; } }; @@ -11124,6 +10660,13 @@ var invokeGuardedCallback = function (name, func, context, a, b, c, d, e, f) { var fakeNode = document.createElement('react'); var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) { + // If document doesn't exist we know for sure we will crash in this method + // when we call document.createEvent(). However this can cause confusing + // errors: https://github.com/facebookincubator/create-react-app/issues/3482 + // So we preemptively throw with a better message instead. + !(typeof document !== 'undefined') ? invariant(false, '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.') : void 0; + var evt = document.createEvent('Event'); + // Keeps track of whether the user-provided callback threw an error. We // set this to true at the beginning, then set it to false right after // calling the function. If the function errors, `didError` will never be @@ -11179,7 +10722,6 @@ var invokeGuardedCallback = function (name, func, context, a, b, c, d, e, f) { // Synchronously dispatch our fake event. If the user-provided function // errors, it will trigger our global error handler. - var evt = document.createEvent('Event'); evt.initEvent(evtType, false, false); fakeNode.dispatchEvent(evt); @@ -11190,11 +10732,11 @@ var invokeGuardedCallback = function (name, func, context, a, b, c, d, e, f) { } 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.'); } - ReactErrorUtils._hasCaughtError = true; - ReactErrorUtils._caughtError = error; + this._hasCaughtError = true; + this._caughtError = error; } else { - ReactErrorUtils._hasCaughtError = false; - ReactErrorUtils._caughtError = null; + this._hasCaughtError = false; + this._caughtError = null; } // Remove our event listeners @@ -11205,6 +10747,79 @@ var invokeGuardedCallback = function (name, func, context, a, b, c, d, e, f) { } } +var invokeGuardedCallback$1 = invokeGuardedCallback; + +var ReactErrorUtils = { + // Used by Fiber to simulate a try-catch. + _caughtError: null, + _hasCaughtError: false, + + // Used by event system to capture/rethrow the first error. + _rethrowError: null, + _hasRethrowError: false, + + /** + * Call a function while guarding against errors that happens within it. + * Returns an error if it throws, otherwise null. + * + * In production, this is implemented using a try-catch. The reason we don't + * use a try-catch directly is so that we can swap out a different + * implementation in DEV mode. + * + * @param {String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} context The context to use when calling the function + * @param {...*} args Arguments for function + */ + invokeGuardedCallback: function (name, func, context, a, b, c, d, e, f) { + invokeGuardedCallback$1.apply(ReactErrorUtils, arguments); + }, + + /** + * Same as invokeGuardedCallback, but instead of returning an error, it stores + * it in a global so it can be rethrown by `rethrowCaughtError` later. + * TODO: See if _caughtError and _rethrowError can be unified. + * + * @param {String} name of the guard to use for logging or debugging + * @param {Function} func The function to invoke + * @param {*} context The context to use when calling the function + * @param {...*} args Arguments for function + */ + invokeGuardedCallbackAndCatchFirstError: function (name, func, context, a, b, c, d, e, f) { + ReactErrorUtils.invokeGuardedCallback.apply(this, arguments); + if (ReactErrorUtils.hasCaughtError()) { + var error = ReactErrorUtils.clearCaughtError(); + if (!ReactErrorUtils._hasRethrowError) { + ReactErrorUtils._hasRethrowError = true; + ReactErrorUtils._rethrowError = error; + } + } + }, + + /** + * During execution of guarded functions we will capture the first error which + * we will rethrow to be handled by the top level error handler. + */ + rethrowCaughtError: function () { + return rethrowCaughtError.apply(ReactErrorUtils, arguments); + }, + + hasCaughtError: function () { + return ReactErrorUtils._hasCaughtError; + }, + + clearCaughtError: function () { + if (ReactErrorUtils._hasCaughtError) { + var error = ReactErrorUtils._caughtError; + ReactErrorUtils._caughtError = null; + ReactErrorUtils._hasCaughtError = false; + return error; + } else { + invariant(false, 'clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.'); + } + } +}; + var rethrowCaughtError = function () { if (ReactErrorUtils._hasRethrowError) { var error = ReactErrorUtils._rethrowError; @@ -11393,7 +11008,7 @@ var getFiberCurrentPropsFromNode = null; var getInstanceFromNode = null; var getNodeFromInstance = null; -var injection$2 = { +var injection$1 = { injectComponentTree: function (Injected) { getFiberCurrentPropsFromNode = Injected.getFiberCurrentPropsFromNode; getInstanceFromNode = Injected.getInstanceFromNode; @@ -11410,7 +11025,7 @@ var injection$2 = { -var validateEventDispatches; +var validateEventDispatches = void 0; { validateEventDispatches = function (event) { var dispatchListeners = event._dispatchListeners; @@ -11618,7 +11233,7 @@ function shouldPreventMouseEvent(name, type, props) { /** * Methods for injecting dependencies. */ -var injection$1 = { +var injection = { /** * @param {array} InjectedEventPluginOrder * @public @@ -11637,7 +11252,7 @@ var injection$1 = { * @return {?function} The stored callback. */ function getListener(inst, registrationName) { - var listener; + var listener = void 0; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not // live here; needs to be moved to a better place soon @@ -11667,7 +11282,7 @@ function getListener(inst, registrationName) { * @internal */ function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var events; + var events = null; for (var i = 0; i < plugins.length; i++) { // Not every plugin in the ordering may be loaded at runtime. var possiblePlugin = plugins[i]; @@ -11681,25 +11296,11 @@ function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) return events; } -/** - * Enqueues a synthetic event that should be dispatched when - * `processEventQueue` is invoked. - * - * @param {*} events An accumulation of synthetic events. - * @internal - */ -function enqueueEvents(events) { - if (events) { +function runEventsInBatch(events, simulated) { + if (events !== null) { eventQueue = accumulateInto(eventQueue, events); } -} -/** - * Dispatches all synthetic events on the event queue. - * - * @internal - */ -function processEventQueue(simulated) { // Set `eventQueue` to null before processing it so that we can tell if more // events get enqueued while processing. var processingEventQueue = eventQueue; @@ -11719,12 +11320,16 @@ function processEventQueue(simulated) { ReactErrorUtils.rethrowCaughtError(); } +function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + runEventsInBatch(events, false); +} + var EventPluginHub = Object.freeze({ - injection: injection$1, + injection: injection, getListener: getListener, - extractEvents: extractEvents, - enqueueEvents: enqueueEvents, - processEventQueue: processEventQueue + runEventsInBatch: runEventsInBatch, + runExtractedEventsInBatch: runExtractedEventsInBatch }); var IndeterminateComponent = 0; // Before we know whether it is functional or class @@ -11738,6 +11343,10 @@ var CallComponent = 7; var CallHandlerPhase = 8; var ReturnComponent = 9; var Fragment = 10; +var Mode = 11; +var ContextConsumer = 12; +var ContextProvider = 13; +var ForwardRef = 14; var randomKey = Math.random().toString(36).slice(2); var internalInstanceKey = '__reactInternalInstance$' + randomKey; @@ -11756,10 +11365,7 @@ function getClosestInstanceFromNode(node) { return node[internalInstanceKey]; } - // Walk up the tree until we find an ancestor whose instance we have cached. - var parents = []; while (!node[internalInstanceKey]) { - parents.push(node); if (node.parentNode) { node = node.parentNode; } else { @@ -11769,17 +11375,13 @@ function getClosestInstanceFromNode(node) { } } - var closest = void 0; var inst = node[internalInstanceKey]; if (inst.tag === HostComponent || inst.tag === HostText) { // In Fiber, this will always be the deepest root. return inst; } - for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) { - closest = inst; - } - return closest; + return null; } /** @@ -11905,7 +11507,7 @@ function traverseTwoPhase(inst, fn, arg) { path.push(inst); inst = getParent(inst); } - var i; + var i = void 0; for (i = path.length; i-- > 0;) { fn(path[i], 'captured', arg); } @@ -12122,10 +11724,10 @@ function getData() { return compositionState._fallbackText; } - var start; + var start = void 0; var startValue = compositionState._startText; var startLength = startValue.length; - var end; + var end = void 0; var endValue = getText(); var endLength = endValue.length; @@ -12157,7 +11759,6 @@ function getText() { /* eslint valid-typeof: 0 */ var didWarnForAddedNewProperty = false; -var isProxySupported = typeof Proxy === 'function'; var EVENT_POOL_SIZE = 10; var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances']; @@ -12318,24 +11919,26 @@ SyntheticEvent.Interface = EventInterface; /** * Helper to reduce boilerplate when creating subclasses. - * - * @param {function} Class - * @param {?object} Interface */ -SyntheticEvent.augmentClass = function (Class, Interface) { +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.augmentClass = Super.augmentClass; + Class.extend = Super.extend; addEventPoolingTo(Class); + + return Class; }; /** Proxying after everything set on SyntheticEvent @@ -12343,6 +11946,10 @@ SyntheticEvent.augmentClass = function (Class, Interface) { * in which some Event properties are set to undefined (GH#10010) */ { + var isProxySupported = typeof Proxy === 'function' && + // https://github.com/facebook/react/issues/12011 + !Object.isSealed(new Proxy({}, {})); + if (isProxySupported) { /*eslint-disable no-func-assign */ SyntheticEvent = new Proxy(SyntheticEvent, { @@ -12433,42 +12040,18 @@ var SyntheticEvent$1 = SyntheticEvent; * @interface Event * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents */ -var CompositionEventInterface = { +var SyntheticCompositionEvent = SyntheticEvent$1.extend({ data: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticEvent} - */ -function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent$1.augmentClass(SyntheticCompositionEvent, CompositionEventInterface); +}); /** * @interface Event * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105 * /#events-inputevents */ -var InputEventInterface = { +var SyntheticInputEvent = SyntheticEvent$1.extend({ data: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticEvent} - */ -function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent$1.augmentClass(SyntheticInputEvent, InputEventInterface); +}); var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space var START_KEYCODE = 229; @@ -12483,22 +12066,13 @@ if (ExecutionEnvironment.canUseDOM && 'documentMode' in document) { // Webkit offers a very useful `textInput` event that can be used to // directly represent `beforeInput`. The IE `textinput` event is not as // useful, so we don't use it. -var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto(); +var canUseTextInputEvent = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode; // In IE9+, we have access to composition events, but the data supplied // by the native compositionend event may be incorrect. Japanese ideographic // spaces, for instance (\u3000) are not recorded correctly. var useFallbackCompositionData = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11); -/** - * Opera <= 12 includes TextEvent in window, but does not fire - * text input events. Rely on keypress instead. - */ -function isPresto() { - var opera = window.opera; - return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12; -} - var SPACEBAR_CODE = 32; var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); @@ -12627,8 +12201,8 @@ var isComposing = false; * @return {?object} A SyntheticCompositionEvent. */ function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var eventType; - var fallbackData; + var eventType = void 0; + var fallbackData = void 0; if (canUseCompositionEvent) { eventType = getCompositionEventType(topLevelType); @@ -12797,7 +12371,7 @@ function getFallbackBeforeInputChars(topLevelType, nativeEvent) { * @return {?object} A SyntheticInputEvent. */ function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var chars; + var chars = void 0; if (canUseTextInputEvent) { chars = getNativeBeforeInputChars(topLevelType, nativeEvent); @@ -12840,7 +12414,19 @@ var BeforeInputEventPlugin = { eventTypes: eventTypes, extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { - return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)]; + 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]; } }; @@ -12872,7 +12458,7 @@ function restoreStateOfTarget(target) { fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props); } -var injection$3 = ReactControlledComponentInjection; +var injection$2 = ReactControlledComponentInjection; function enqueueStateRestore(target) { if (restoreTarget) { @@ -12886,6 +12472,10 @@ function enqueueStateRestore(target) { } } +function needsStateRestore() { + return restoreTarget !== null || restoreQueue !== null; +} + function restoreStateIfNeeded() { if (!restoreTarget) { return; @@ -12904,8 +12494,9 @@ function restoreStateIfNeeded() { } var ReactControlledComponent = Object.freeze({ - injection: injection$3, + injection: injection$2, enqueueStateRestore: enqueueStateRestore, + needsStateRestore: needsStateRestore, restoreStateIfNeeded: restoreStateIfNeeded }); @@ -12916,39 +12507,55 @@ var ReactControlledComponent = Object.freeze({ // scheduled work and instead do synchronous work. // Defaults -var fiberBatchedUpdates = function (fn, bookkeeping) { +var _batchedUpdates = function (fn, bookkeeping) { return fn(bookkeeping); }; +var _interactiveUpdates = function (fn, a, b) { + return fn(a, b); +}; +var _flushInteractiveUpdates = function () {}; -var isNestingBatched = false; +var isBatching = false; function batchedUpdates(fn, bookkeeping) { - if (isNestingBatched) { + if (isBatching) { // If we are currently inside another batch, we need to wait until it - // fully completes before restoring state. Therefore, we add the target to - // a queue of work. - return fiberBatchedUpdates(fn, bookkeeping); + // fully completes before restoring state. + return fn(bookkeeping); } - isNestingBatched = true; + isBatching = true; try { - return fiberBatchedUpdates(fn, bookkeeping); + return _batchedUpdates(fn, bookkeeping); } finally { // Here we wait until all updates have propagated, which is important // when using controlled components within layers: // https://github.com/facebook/react/issues/1698 // Then we restore state of any controlled component. - isNestingBatched = false; - restoreStateIfNeeded(); + isBatching = false; + var controlledComponentsHavePendingUpdates = needsStateRestore(); + if (controlledComponentsHavePendingUpdates) { + // If a controlled event was fired, we may need to restore the state of + // the DOM node back to the controlled value. This is necessary when React + // bails out of the update without touching the DOM. + _flushInteractiveUpdates(); + restoreStateIfNeeded(); + } } } -var ReactGenericBatchingInjection = { - injectFiberBatchedUpdates: function (_batchedUpdates) { - fiberBatchedUpdates = _batchedUpdates; +function interactiveUpdates(fn, a, b) { + return _interactiveUpdates(fn, a, b); +} + + + +var injection$3 = { + injectRenderer: function (renderer) { + _batchedUpdates = renderer.batchedUpdates; + _interactiveUpdates = renderer.interactiveUpdates; + _flushInteractiveUpdates = renderer.flushInteractiveUpdates; } }; -var injection$4 = ReactGenericBatchingInjection; - /** * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary */ @@ -13002,7 +12609,7 @@ var DOCUMENT_FRAGMENT_NODE = 11; * @return {DOMEventTarget} Target node. */ function getEventTarget(nativeEvent) { - var target = nativeEvent.target || nativeEvent.srcElement || window; + var target = nativeEvent.target || window; // Normalize SVG element events #4963 if (target.correspondingUseElement) { @@ -13014,14 +12621,6 @@ function getEventTarget(nativeEvent) { return target.nodeType === TEXT_NODE ? target.parentNode : target; } -var useHasFeature; -if (ExecutionEnvironment.canUseDOM) { - useHasFeature = document.implementation && document.implementation.hasFeature && - // always returns true in newer browsers as per the standard. - // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature - document.implementation.hasFeature('', '') !== true; -} - /** * Checks if an event is supported in the current execution environment. * @@ -13050,11 +12649,6 @@ function isEventSupported(eventNameSuffix, capture) { isSupported = typeof element[eventName] === 'function'; } - if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { - // This is the only way to test support for the `wheel` event in IE9+. - isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); - } - return isSupported; } @@ -13102,7 +12696,6 @@ function trackValueOnNode(node) { } Object.defineProperty(node, valueField, { - enumerable: descriptor.enumerable, configurable: true, get: function () { return descriptor.get.call(this); @@ -13112,6 +12705,13 @@ function trackValueOnNode(node) { descriptor.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 () { @@ -13158,6 +12758,838 @@ function updateValueIfChanged(node) { return false; } +var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + +var ReactCurrentOwner = ReactInternals.ReactCurrentOwner; +var ReactDebugCurrentFrame = ReactInternals.ReactDebugCurrentFrame; + +var describeComponentFrame = function (name, source, ownerName) { + return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : ''); +}; + +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var hasSymbol = typeof Symbol === 'function' && Symbol['for']; + +var REACT_ELEMENT_TYPE = hasSymbol ? Symbol['for']('react.element') : 0xeac7; +var REACT_CALL_TYPE = hasSymbol ? Symbol['for']('react.call') : 0xeac8; +var REACT_RETURN_TYPE = hasSymbol ? Symbol['for']('react.return') : 0xeac9; +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_PROVIDER_TYPE = hasSymbol ? Symbol['for']('react.provider') : 0xeacd; +var REACT_CONTEXT_TYPE = hasSymbol ? Symbol['for']('react.context') : 0xeace; +var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol['for']('react.async_mode') : 0xeacf; +var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol['for']('react.forward_ref') : 0xead0; + +var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; + +function getIteratorFn(maybeIterable) { + if (maybeIterable === null || typeof maybeIterable === 'undefined') { + return null; + } + var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + if (typeof maybeIterator === 'function') { + return maybeIterator; + } + return null; +} + +function getComponentName(fiber) { + var type = fiber.type; + + if (typeof type === 'function') { + return type.displayName || type.name; + } + if (typeof type === 'string') { + return type; + } + switch (type) { + case REACT_FRAGMENT_TYPE: + return 'ReactFragment'; + case REACT_PORTAL_TYPE: + return 'ReactPortal'; + case REACT_CALL_TYPE: + return 'ReactCall'; + case REACT_RETURN_TYPE: + return 'ReactReturn'; + } + return null; +} + +function describeFiber(fiber) { + switch (fiber.tag) { + case IndeterminateComponent: + case FunctionalComponent: + case ClassComponent: + case HostComponent: + var owner = fiber._debugOwner; + var source = fiber._debugSource; + var name = getComponentName(fiber); + var ownerName = null; + if (owner) { + ownerName = getComponentName(owner); + } + return describeComponentFrame(name, source, ownerName); + default: + return ''; + } +} + +// This function can only be called with a work-in-progress fiber and +// only during begin or complete phase. Do not call it under any other +// circumstances. +function getStackAddendumByWorkInProgressFiber(workInProgress) { + var info = ''; + var node = workInProgress; + do { + info += describeFiber(node); + // Otherwise this return pointer might point to the wrong tree: + node = node['return']; + } while (node); + return info; +} + +function getCurrentFiberOwnerName$1() { + { + var fiber = ReactDebugCurrentFiber.current; + if (fiber === null) { + return null; + } + var owner = fiber._debugOwner; + if (owner !== null && typeof owner !== 'undefined') { + return getComponentName(owner); + } + } + return null; +} + +function getCurrentFiberStackAddendum$1() { + { + var fiber = ReactDebugCurrentFiber.current; + if (fiber === null) { + return null; + } + // Safe because if current fiber exists, we are reconciling, + // and it is guaranteed to be the work-in-progress version. + return getStackAddendumByWorkInProgressFiber(fiber); + } + return null; +} + +function resetCurrentFiber() { + ReactDebugCurrentFrame.getCurrentStack = null; + ReactDebugCurrentFiber.current = null; + ReactDebugCurrentFiber.phase = null; +} + +function setCurrentFiber(fiber) { + ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackAddendum$1; + ReactDebugCurrentFiber.current = fiber; + ReactDebugCurrentFiber.phase = null; +} + +function setCurrentPhase(phase) { + ReactDebugCurrentFiber.phase = phase; +} + +var ReactDebugCurrentFiber = { + current: null, + phase: null, + resetCurrentFiber: resetCurrentFiber, + setCurrentFiber: setCurrentFiber, + setCurrentPhase: setCurrentPhase, + getCurrentFiberOwnerName: getCurrentFiberOwnerName$1, + getCurrentFiberStackAddendum: getCurrentFiberStackAddendum$1 +}; + +// A reserved attribute. +// It is handled by React separately and shouldn't be written to the DOM. +var RESERVED = 0; + +// A simple string attribute. +// Attributes that aren't in the whitelist are presumed to have this type. +var STRING = 1; + +// A string attribute that accepts booleans in React. In HTML, these are called +// "enumerated" attributes with "true" and "false" as possible values. +// When true, it should be set to a "true" string. +// When false, it should be set to a "false" string. +var BOOLEANISH_STRING = 2; + +// A real boolean attribute. +// When true, it should be present (set either to an empty string or its name). +// When false, it should be omitted. +var BOOLEAN = 3; + +// An attribute that can be used as a flag as well as with a value. +// When true, it should be present (set either to an empty string or its name). +// When false, it should be omitted. +// For any other value, should be present with that value. +var OVERLOADED_BOOLEAN = 4; + +// An attribute that must be numeric or parse as a numeric. +// When falsy, it should be removed. +var NUMERIC = 5; + +// An attribute that must be positive numeric or parse as a positive numeric. +// When falsy, it should be removed. +var POSITIVE_NUMERIC = 6; + +/* eslint-disable max-len */ +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'; +/* eslint-enable max-len */ +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 illegalAttributeNameCache = {}; +var validatedAttributeNameCache = {}; + +function isAttributeNameSafe(attributeName) { + if (validatedAttributeNameCache.hasOwnProperty(attributeName)) { + return true; + } + if (illegalAttributeNameCache.hasOwnProperty(attributeName)) { + return false; + } + if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { + validatedAttributeNameCache[attributeName] = true; + return true; + } + illegalAttributeNameCache[attributeName] = true; + { + warning(false, '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': + // $FlowIssue symbol is perfectly valid here + case 'symbol': + // eslint-disable-line + 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 (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) { + 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; +} + +// When adding attributes to this list, be sure to also add them to +// the `possibleStandardNames` module to ensure casing and incorrect +// name warnings. +var properties = {}; + +// These props are reserved by React. They shouldn't be written to the DOM. +['children', 'dangerouslySetInnerHTML', +// TODO: This prevents the assignment of defaultValue to regular +// elements (not just inputs). Now that ReactDOMInput assigns to the +// defaultValue property -- do we need this? +'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty + name, // attributeName + null); +}); + +// A few React string attributes have a different name. +// This is a mapping from React prop names to the attribute names. +[['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, // mustUseProperty + attributeName, // attributeName + null); +}); + +// These are "enumerated" HTML attributes that accept "true" and "false". +// In React, we let users pass `true` and `false` even though technically +// these aren't boolean attributes (they are coerced to strings). +['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty + name.toLowerCase(), // attributeName + null); +}); + +// These are "enumerated" SVG attributes that accept "true" and "false". +// In React, we let users pass `true` and `false` even though technically +// these aren't boolean attributes (they are coerced to strings). +// Since these are SVG attributes, their attribute names are case-sensitive. +['autoReverse', 'externalResourcesRequired', 'preserveAlpha'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty + name, // attributeName + null); +}); + +// These are HTML boolean attributes. +['allowFullScreen', 'async', +// Note: there is a special case that prevents it from being written to the DOM +// on the client side because the browsers are inconsistent. Instead we call focus(). +'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', +// Microdata +'itemScope'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty + name.toLowerCase(), // attributeName + null); +}); + +// These are the few React props that we set as DOM properties +// rather than attributes. These are all booleans. +['checked', +// Note: `option.selected` is not updated if `select.multiple` is +// disabled with `removeAttribute`. We have special logic for handling this. +'multiple', 'muted', 'selected'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty + name.toLowerCase(), // attributeName + null); +}); + +// These are HTML attributes that are "overloaded booleans": they behave like +// booleans, but can also accept a string value. +['capture', 'download'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty + name.toLowerCase(), // attributeName + null); +}); + +// These are HTML attributes that must be positive numbers. +['cols', 'rows', 'size', 'span'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty + name.toLowerCase(), // attributeName + null); +}); + +// These are HTML attributes that must be numbers. +['rowSpan', 'start'].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty + name.toLowerCase(), // attributeName + null); +}); + +var CAMELIZE = /[\-\:]([a-z])/g; +var capitalize = function (token) { + return token[1].toUpperCase(); +}; + +// This is a list of all SVG attributes that need special casing, namespacing, +// or boolean value assignment. Regular attributes that just accept strings +// and have the same names are omitted, just like in the HTML whitelist. +// Some of these attributes can be hard to find. This list was created by +// scrapping the MDN documentation. +['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, // mustUseProperty + attributeName, null); +}); + +// String SVG attributes with the xlink namespace. +['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, 'http://www.w3.org/1999/xlink'); +}); + +// String SVG attributes with the xml namespace. +['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, 'http://www.w3.org/XML/1998/namespace'); +}); + +// Special case: this attribute exists both in HTML and SVG. +// Its "tabindex" attribute name is case-sensitive in SVG so we can't just use +// its React `tabIndex` name, like we do for attributes that exist only in HTML. +properties.tabIndex = new PropertyInfoRecord('tabIndex', STRING, false, // mustUseProperty +'tabindex', // attributeName +null); + +/** + * Get the value for a property on a node. Only used in DEV for SSR validation. + * The "expected" argument is used as a hint of what the expected value is. + * Some properties have multiple equivalent values. + */ +function getValueForProperty(node, name, expected, propertyInfo) { + { + if (propertyInfo.mustUseProperty) { + var propertyName = propertyInfo.propertyName; + + return node[propertyName]; + } else { + 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)) { + // We had an attribute but shouldn't have had one, so read it + // for the error message. + return node.getAttribute(attributeName); + } + if (propertyInfo.type === BOOLEAN) { + // If this was a boolean, it doesn't matter what the value is + // the fact that we have it is the same as the expected. + return expected; + } + // Even if this property uses a namespace we use getAttribute + // because we assume its namespaced name is the same as our config. + // To use getAttributeNS we need the local name which we don't have + // in our config atm. + stringValue = node.getAttribute(attributeName); + } + + if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { + return stringValue === null ? expected : stringValue; + } else if (stringValue === '' + expected) { + return expected; + } else { + return stringValue; + } + } + } +} + +/** + * Get the value for a attribute on a node. Only used in DEV for SSR validation. + * The third argument is used as a hint of what the expected value is. Some + * attributes have multiple equivalent values. + */ +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; + } +} + +/** + * Sets the value for a property on a node. + * + * @param {DOMElement} node + * @param {string} name + * @param {*} 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 the prop isn't in the special list, treat it as a simple attribute. + 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 { + // Contrary to `setAttribute`, object properties are properly + // `toString`ed by IE8/9. + node[propertyName] = value; + } + return; + } + // The rest are treated as attributes with special cases. + var attributeName = propertyInfo.attributeName, + attributeNamespace = propertyInfo.attributeNamespace; + + if (value === null) { + node.removeAttribute(attributeName); + } else { + var _type = propertyInfo.type; + + var attributeValue = void 0; + if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) { + attributeValue = ''; + } else { + // `setAttribute` with objects becomes only `[object]` in IE8/9, + // ('' + value) makes it output the correct toString()-value. + attributeValue = '' + value; + } + if (attributeNamespace) { + node.setAttributeNS(attributeNamespace, attributeName, attributeValue); + } else { + node.setAttribute(attributeName, attributeValue); + } + } +} + +var ReactControlledValuePropTypes = { + checkPropTypes: null +}; + +{ + var hasReadOnlyValue = { + button: true, + checkbox: true, + image: true, + hidden: true, + radio: true, + reset: true, + submit: true + }; + + var propTypes = { + value: function (props, propName, componentName) { + if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) { + 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[propName] || props.onChange || props.readOnly || props.disabled) { + 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`.'); + } + }; + + /** + * Provide a linked `value` attribute for controlled forms. You should not use + * this outside of the ReactDOM controlled form components. + */ + ReactControlledValuePropTypes.checkPropTypes = function (tagName, props, getStack) { + checkPropTypes(propTypes, props, 'prop', tagName, getStack); + }; +} + +// TODO: direct imports like some-package/src/* are bad. Fix me. +var getCurrentFiberOwnerName = ReactDebugCurrentFiber.getCurrentFiberOwnerName; +var getCurrentFiberStackAddendum = ReactDebugCurrentFiber.getCurrentFiberStackAddendum; + +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; +} + +/** + * Implements an host component that allows setting these optional + * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. + * + * If `checked` or `value` are not supplied (or null/undefined), user actions + * that affect the checked state or value will trigger updates to the element. + * + * If they are supplied (and not null/undefined), the rendered element will not + * trigger updates to the element. Instead, the props must change in order for + * the rendered element to be updated. + * + * The rendered element will be initialized as unchecked (or `defaultChecked`) + * with an empty value (or `defaultValue`). + * + * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html + */ + +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, getCurrentFiberStackAddendum); + + if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { + warning(false, '%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', getCurrentFiberOwnerName() || 'A component', props.type); + didWarnCheckedDefaultChecked = true; + } + if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { + warning(false, '%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', getCurrentFiberOwnerName() || '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: getSafeValue(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) { + warning(false, '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%s', props.type, getCurrentFiberStackAddendum()); + didWarnUncontrolledToControlled = true; + } + if (node._wrapperState.controlled && !_controlled && !didWarnControlledToUncontrolled) { + warning(false, '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%s', props.type, getCurrentFiberStackAddendum()); + didWarnControlledToUncontrolled = true; + } + } + + updateChecked(element, props); + + var value = getSafeValue(props.value); + + if (value != null) { + if (props.type === 'number') { + if (value === 0 && node.value === '' || + // eslint-disable-next-line + node.value != value) { + node.value = '' + value; + } + } else if (node.value !== '' + value) { + node.value = '' + value; + } + } + + if (props.hasOwnProperty('value')) { + setDefaultValue(node, props.type, value); + } else if (props.hasOwnProperty('defaultValue')) { + setDefaultValue(node, props.type, getSafeValue(props.defaultValue)); + } + + if (props.checked == null && props.defaultChecked != null) { + node.defaultChecked = !!props.defaultChecked; + } +} + +function postMountWrapper(element, props) { + var node = element; + + if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) { + // Do not assign value if it is already set. This prevents user text input + // from being lost during SSR hydration. + if (node.value === '') { + node.value = '' + node._wrapperState.initialValue; + } + + // value must be assigned before defaultValue. This fixes an issue where the + // visually displayed value of date inputs disappears on mobile Safari and Chrome: + // https://github.com/facebook/react/issues/7233 + node.defaultValue = '' + node._wrapperState.initialValue; + } + + // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug + // this is needed to work around a chrome bug where setting defaultChecked + // will sometimes influence the value of checked (even after detachment). + // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 + // We need to temporarily unset name to avoid disrupting radio button groups. + var name = node.name; + if (name !== '') { + node.name = ''; + } + node.defaultChecked = !node.defaultChecked; + node.defaultChecked = !node.defaultChecked; + 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; + } + + // If `rootNode.form` was non-null, then we could try `form.elements`, + // but that sometimes behaves strangely in IE8. We could also try using + // `form.getElementsByName`, but that will only return direct children + // and won't include inputs that use the HTML5 `form=` attribute. Since + // the input might not even be in a form. It might not even be in the + // document. Let's just use the local `querySelectorAll` to ensure we don't + // miss anything. + 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; + } + // This will throw if radio buttons rendered by different copies of React + // and the same name are rendered into the same form (same as #1939). + // That's probably okay; we don't support it just as we don't support + // mixing React radio buttons with non-React ones. + var otherProps = getFiberCurrentPropsFromNode$1(otherNode); + !otherProps ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : void 0; + + // We need update the tracked value on the named cousin since the value + // was changed but the input saw no event or value set + updateValueIfChanged(otherNode); + + // If this is a controlled radio button group, forcing the input that + // was previously checked to update will cause it to be come re-checked + // as appropriate. + updateWrapper(otherNode, otherProps); + } + } +} + +// In Chrome, assigning defaultValue to certain input types triggers input validation. +// For number inputs, the display value loses trailing decimal points. For email inputs, +// Chrome raises "The specified value is not a valid email address". +// +// Here we check to see if the defaultValue has actually changed, avoiding these problems +// when the user is inputting text +// +// https://github.com/facebook/react/issues/7253 +function setDefaultValue(node, type, value) { + if ( + // Focused number inputs synchronize on blur. See ChangeEventPlugin.js + type !== 'number' || node.ownerDocument.activeElement !== node) { + if (value == null) { + node.defaultValue = '' + node._wrapperState.initialValue; + } else if (node.defaultValue !== '' + value) { + node.defaultValue = '' + value; + } + } +} + +function getSafeValue(value) { + switch (typeof value) { + case 'boolean': + case 'number': + case 'object': + case 'string': + case 'undefined': + return value; + default: + // function, symbol are assigned as empty strings + return ''; + } +} + var eventTypes$1 = { change: { phasedRegistrationNames: { @@ -13208,8 +13640,7 @@ function manualDispatchChangeEvent(nativeEvent) { } function runEventInBatch(event) { - enqueueEvents(event); - processEventQueue(false); + runEventsInBatch(event, false); } function getInstIfValueChanged(targetInst) { @@ -13345,10 +13776,7 @@ function handleControlledInputBlur(inst, node) { } // If controlled, assign the value attribute to the current value on blur - var value = '' + node.value; - if (node.getAttribute('value') !== value) { - node.setAttribute('value', value); - } + setDefaultValue(node, 'number', node.value); } /** @@ -13369,7 +13797,8 @@ var ChangeEventPlugin = { extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window; - var getTargetInstFunc, handleEventFunc; + var getTargetInstFunc = void 0, + handleEventFunc = void 0; if (shouldUseChangeEvent(targetNode)) { getTargetInstFunc = getTargetInstForChangeEvent; } else if (isTextInputElement(targetNode)) { @@ -13413,26 +13842,10 @@ var ChangeEventPlugin = { */ var DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin']; -/** - * @interface UIEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var UIEventInterface = { +var SyntheticUIEvent = SyntheticEvent$1.extend({ view: null, detail: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticEvent} - */ -function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent$1.augmentClass(SyntheticUIEvent, UIEventInterface); +}); /** * Translation from modifier key to the associated property in the event. @@ -13467,7 +13880,7 @@ function getEventModifierState(nativeEvent) { * @interface MouseEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ -var MouseEventInterface = { +var SyntheticMouseEvent = SyntheticUIEvent.extend({ screenX: null, screenY: null, clientX: null, @@ -13484,19 +13897,7 @@ var MouseEventInterface = { relatedTarget: function (event) { return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement); } -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); +}); var eventTypes$2 = { mouseEnter: { @@ -13528,7 +13929,7 @@ var EnterLeaveEventPlugin = { return null; } - var win; + var win = void 0; if (nativeEventTarget.window === nativeEventTarget) { // `nativeEventTarget` is probably a window object. win = nativeEventTarget; @@ -13542,8 +13943,8 @@ var EnterLeaveEventPlugin = { } } - var from; - var to; + var from = void 0; + var to = void 0; if (topLevelType === 'topMouseOut') { from = targetInst; var related = nativeEvent.relatedTarget || nativeEvent.toElement; @@ -13607,36 +14008,27 @@ function set(key, value) { key._reactInternalFiber = value; } -var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - -var ReactCurrentOwner = ReactInternals.ReactCurrentOwner; -var ReactDebugCurrentFrame = ReactInternals.ReactDebugCurrentFrame; - -function getComponentName(fiber) { - var type = fiber.type; - - if (typeof type === 'string') { - return type; - } - if (typeof type === 'function') { - return type.displayName || type.name; - } - return null; -} - -// Don't change these two values: -var NoEffect = 0; // 0b00000000 -var PerformedWork = 1; // 0b00000001 +// Don't change these two values. They're used by React Dev Tools. +var NoEffect = /* */0; +var PerformedWork = /* */1; // You can change the rest (and add more). -var Placement = 2; // 0b00000010 -var Update = 4; // 0b00000100 -var PlacementAndUpdate = 6; // 0b00000110 -var Deletion = 8; // 0b00001000 -var ContentReset = 16; // 0b00010000 -var Callback = 32; // 0b00100000 -var Err = 64; // 0b01000000 -var Ref = 128; // 0b10000000 +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 ErrLog = /* */256; +var Snapshot = /* */2048; + +// Union of all host effects +var HostEffectMask = /* */2559; + +var Incomplete = /* */512; +var ShouldCapture = /* */1024; var MOUNTING = 1; var MOUNTED = 2; @@ -13875,6 +14267,446 @@ function findCurrentHostFiberWithNoPortals(parent) { return null; } +function addEventBubbleListener(element, eventType, listener) { + element.addEventListener(eventType, listener, false); +} + +function addEventCaptureListener(element, eventType, listener) { + element.addEventListener(eventType, listener, true); +} + +/** + * @interface Event + * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface + * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent + */ +var SyntheticAnimationEvent = SyntheticEvent$1.extend({ + animationName: null, + elapsedTime: null, + pseudoElement: null +}); + +/** + * @interface Event + * @see http://www.w3.org/TR/clipboard-apis/ + */ +var SyntheticClipboardEvent = SyntheticEvent$1.extend({ + clipboardData: function (event) { + return 'clipboardData' in event ? event.clipboardData : window.clipboardData; + } +}); + +/** + * @interface FocusEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ +var SyntheticFocusEvent = SyntheticUIEvent.extend({ + relatedTarget: null +}); + +/** + * `charCode` represents the actual "character code" and is safe to use with + * `String.fromCharCode`. As such, only keys that correspond to printable + * characters produce a valid `charCode`, the only exception to this is Enter. + * The Tab-key is considered non-printable and does not have a `charCode`, + * presumably because it does not produce a tab-character in browsers. + * + * @param {object} nativeEvent Native browser event. + * @return {number} Normalized `charCode` property. + */ +function getEventCharCode(nativeEvent) { + var charCode = void 0; + var keyCode = nativeEvent.keyCode; + + if ('charCode' in nativeEvent) { + charCode = nativeEvent.charCode; + + // FF does not set `charCode` for the Enter-key, check against `keyCode`. + if (charCode === 0 && keyCode === 13) { + charCode = 13; + } + } else { + // IE8 does not implement `charCode`, but `keyCode` has the correct value. + charCode = keyCode; + } + + // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux) + // report Enter as charCode 10 when ctrl is pressed. + if (charCode === 10) { + charCode = 13; + } + + // Some non-printable keys are reported in `charCode`/`keyCode`, discard them. + // Must not discard the (non-)printable Enter-key. + if (charCode >= 32 || charCode === 13) { + return charCode; + } + + return 0; +} + +/** + * Normalization of deprecated HTML5 `key` values + * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names + */ +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' +}; + +/** + * Translation from legacy `keyCode` to HTML5 `key` + * Only special keys supported, all others depend on keyboard layout or browser + * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names + */ +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' +}; + +/** + * @param {object} nativeEvent Native browser event. + * @return {string} Normalized `key` property. + */ +function getEventKey(nativeEvent) { + if (nativeEvent.key) { + // Normalize inconsistent values reported by browsers due to + // implementations of a working draft specification. + + // FireFox implements `key` but returns `MozPrintableKey` for all + // printable characters (normalized to `Unidentified`), ignore it. + var key = normalizeKey[nativeEvent.key] || nativeEvent.key; + if (key !== 'Unidentified') { + return key; + } + } + + // Browser does not implement `key`, polyfill as much of it as we can. + if (nativeEvent.type === 'keypress') { + var charCode = getEventCharCode(nativeEvent); + + // The enter-key is technically both printable and non-printable and can + // thus be captured by `keypress`, no other non-printable key should. + return charCode === 13 ? 'Enter' : String.fromCharCode(charCode); + } + if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') { + // While user keyboard layout determines the actual meaning of each + // `keyCode` value, almost all function keys have a universal value. + return translateToKey[nativeEvent.keyCode] || 'Unidentified'; + } + return ''; +} + +/** + * @interface KeyboardEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ +var SyntheticKeyboardEvent = SyntheticUIEvent.extend({ + key: getEventKey, + location: null, + ctrlKey: null, + shiftKey: null, + altKey: null, + metaKey: null, + repeat: null, + locale: null, + getModifierState: getEventModifierState, + // Legacy Interface + charCode: function (event) { + // `charCode` is the result of a KeyPress event and represents the value of + // the actual printable character. + + // KeyPress is deprecated, but its replacement is not yet final and not + // implemented in any major browser. Only KeyPress has charCode. + if (event.type === 'keypress') { + return getEventCharCode(event); + } + return 0; + }, + keyCode: function (event) { + // `keyCode` is the result of a KeyDown/Up event and represents the value of + // physical keyboard key. + + // The actual meaning of the value depends on the users' keyboard layout + // which cannot be detected. Assuming that it is a US keyboard layout + // provides a surprisingly accurate mapping for US and European users. + // Due to this, it is left to the user to implement at this time. + if (event.type === 'keydown' || event.type === 'keyup') { + return event.keyCode; + } + return 0; + }, + which: function (event) { + // `which` is an alias for either `keyCode` or `charCode` depending on the + // type of the event. + if (event.type === 'keypress') { + return getEventCharCode(event); + } + if (event.type === 'keydown' || event.type === 'keyup') { + return event.keyCode; + } + return 0; + } +}); + +/** + * @interface DragEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ +var SyntheticDragEvent = SyntheticMouseEvent.extend({ + dataTransfer: null +}); + +/** + * @interface TouchEvent + * @see http://www.w3.org/TR/touch-events/ + */ +var SyntheticTouchEvent = SyntheticUIEvent.extend({ + touches: null, + targetTouches: null, + changedTouches: null, + altKey: null, + metaKey: null, + ctrlKey: null, + shiftKey: null, + getModifierState: getEventModifierState +}); + +/** + * @interface Event + * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events- + * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent + */ +var SyntheticTransitionEvent = SyntheticEvent$1.extend({ + propertyName: null, + elapsedTime: null, + pseudoElement: null +}); + +/** + * @interface WheelEvent + * @see http://www.w3.org/TR/DOM-Level-3-Events/ + */ +var SyntheticWheelEvent = SyntheticMouseEvent.extend({ + deltaX: function (event) { + return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive). + 'wheelDeltaX' in event ? -event.wheelDeltaX : 0; + }, + deltaY: function (event) { + return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive). + 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). + 'wheelDelta' in event ? -event.wheelDelta : 0; + }, + + deltaZ: null, + + // Browsers without "deltaMode" is reporting in raw wheel delta where one + // notch on the scroll is always +/- 120, roughly equivalent to pixels. + // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or + // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size. + deltaMode: null +}); + +/** + * Turns + * ['abort', ...] + * into + * eventTypes = { + * 'abort': { + * phasedRegistrationNames: { + * bubbled: 'onAbort', + * captured: 'onAbortCapture', + * }, + * dependencies: ['topAbort'], + * }, + * ... + * }; + * topLevelEventsToDispatchConfig = { + * 'topAbort': { sameConfig } + * }; + */ +var interactiveEventTypeNames = ['blur', 'cancel', 'click', 'close', 'contextMenu', 'copy', 'cut', 'doubleClick', 'dragEnd', 'dragStart', 'drop', 'focus', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'mouseDown', 'mouseUp', 'paste', 'pause', 'play', 'rateChange', 'reset', 'seeked', 'submit', 'touchCancel', 'touchEnd', 'touchStart', 'volumeChange']; +var nonInteractiveEventTypeNames = ['abort', 'animationEnd', 'animationIteration', 'animationStart', 'canPlay', 'canPlayThrough', 'drag', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'mouseMove', 'mouseOut', 'mouseOver', 'playing', 'progress', 'scroll', 'seeking', 'stalled', 'suspend', 'timeUpdate', 'toggle', 'touchMove', 'transitionEnd', 'waiting', 'wheel']; + +var eventTypes$4 = {}; +var topLevelEventsToDispatchConfig = {}; + +function addEventTypeNameToConfig(event, isInteractive) { + var capitalizedEvent = event[0].toUpperCase() + event.slice(1); + var onEvent = 'on' + capitalizedEvent; + var topEvent = 'top' + capitalizedEvent; + + var type = { + phasedRegistrationNames: { + bubbled: onEvent, + captured: onEvent + 'Capture' + }, + dependencies: [topEvent], + isInteractive: isInteractive + }; + eventTypes$4[event] = type; + topLevelEventsToDispatchConfig[topEvent] = type; +} + +interactiveEventTypeNames.forEach(function (eventTypeName) { + addEventTypeNameToConfig(eventTypeName, true); +}); +nonInteractiveEventTypeNames.forEach(function (eventTypeName) { + addEventTypeNameToConfig(eventTypeName, false); +}); + +// Only used in DEV for exhaustiveness validation. +var knownHTMLTopLevelTypes = ['topAbort', 'topCancel', 'topCanPlay', 'topCanPlayThrough', 'topClose', 'topDurationChange', 'topEmptied', 'topEncrypted', 'topEnded', 'topError', 'topInput', 'topInvalid', 'topLoad', 'topLoadedData', 'topLoadedMetadata', 'topLoadStart', 'topPause', 'topPlay', 'topPlaying', 'topProgress', 'topRateChange', 'topReset', 'topSeeked', 'topSeeking', 'topStalled', 'topSubmit', 'topSuspend', 'topTimeUpdate', 'topToggle', 'topVolumeChange', 'topWaiting']; + +var SimpleEventPlugin = { + eventTypes: eventTypes$4, + + isInteractiveTopLevelEventType: function (topLevelType) { + var config = topLevelEventsToDispatchConfig[topLevelType]; + return config !== undefined && config.isInteractive === true; + }, + + + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType]; + if (!dispatchConfig) { + return null; + } + var EventConstructor = void 0; + switch (topLevelType) { + case 'topKeyPress': + // Firefox creates a keypress event for function keys too. This removes + // the unwanted keypress events. Enter is however both printable and + // non-printable. One would expect Tab to be as well (but it isn't). + if (getEventCharCode(nativeEvent) === 0) { + return null; + } + /* falls through */ + case 'topKeyDown': + case 'topKeyUp': + EventConstructor = SyntheticKeyboardEvent; + break; + case 'topBlur': + case 'topFocus': + EventConstructor = SyntheticFocusEvent; + break; + case 'topClick': + // Firefox creates a click event on right mouse clicks. This removes the + // unwanted click events. + if (nativeEvent.button === 2) { + return null; + } + /* falls through */ + case 'topDoubleClick': + case 'topMouseDown': + case 'topMouseMove': + case 'topMouseUp': + // TODO: Disabled elements should not respond to mouse events + /* falls through */ + case 'topMouseOut': + case 'topMouseOver': + case 'topContextMenu': + EventConstructor = SyntheticMouseEvent; + break; + case 'topDrag': + case 'topDragEnd': + case 'topDragEnter': + case 'topDragExit': + case 'topDragLeave': + case 'topDragOver': + case 'topDragStart': + case 'topDrop': + EventConstructor = SyntheticDragEvent; + break; + case 'topTouchCancel': + case 'topTouchEnd': + case 'topTouchMove': + case 'topTouchStart': + EventConstructor = SyntheticTouchEvent; + break; + case 'topAnimationEnd': + case 'topAnimationIteration': + case 'topAnimationStart': + EventConstructor = SyntheticAnimationEvent; + break; + case 'topTransitionEnd': + EventConstructor = SyntheticTransitionEvent; + break; + case 'topScroll': + EventConstructor = SyntheticUIEvent; + break; + case 'topWheel': + EventConstructor = SyntheticWheelEvent; + break; + case 'topCopy': + case 'topCut': + case 'topPaste': + EventConstructor = SyntheticClipboardEvent; + break; + default: + { + if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) { + warning(false, 'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType); + } + } + // HTML Events + // @see http://www.w3.org/TR/html5/index.html#events-0 + EventConstructor = SyntheticEvent$1; + break; + } + var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget); + accumulateTwoPhaseDispatches(event); + return event; + } +}; + +var isInteractiveTopLevelEventType = SimpleEventPlugin.isInteractiveTopLevelEventType; + + var CALLBACK_BOOKKEEPING_POOL_SIZE = 10; var callbackBookkeepingPool = []; @@ -13924,7 +14756,7 @@ function releaseTopLevelCallbackBookKeeping(instance) { } } -function handleTopLevelImpl(bookKeeping) { +function handleTopLevel(bookKeeping) { var targetInst = bookKeeping.targetInst; // Loop through the hierarchy, in case there's any nested components. @@ -13947,17 +14779,12 @@ function handleTopLevelImpl(bookKeeping) { for (var i = 0; i < bookKeeping.ancestors.length; i++) { targetInst = bookKeeping.ancestors[i]; - _handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent)); + runExtractedEventsInBatch(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent)); } } // TODO: can we stop exporting these? var _enabled = true; -var _handleTopLevel = void 0; - -function setHandleTopLevel(handleTopLevel) { - _handleTopLevel = handleTopLevel; -} function setEnabled(enabled) { _enabled = !!enabled; @@ -13981,7 +14808,11 @@ function trapBubbledEvent(topLevelType, handlerBaseName, element) { if (!element) { return null; } - return EventListener.listen(element, handlerBaseName, dispatchEvent.bind(null, topLevelType)); + var dispatch = isInteractiveTopLevelEventType(topLevelType) ? dispatchInteractiveEvent : dispatchEvent; + + addEventBubbleListener(element, handlerBaseName, + // Check if interactive and wrap in interactiveUpdates + dispatch.bind(null, topLevelType)); } /** @@ -13998,7 +14829,15 @@ function trapCapturedEvent(topLevelType, handlerBaseName, element) { if (!element) { return null; } - return EventListener.capture(element, handlerBaseName, dispatchEvent.bind(null, topLevelType)); + var dispatch = isInteractiveTopLevelEventType(topLevelType) ? dispatchInteractiveEvent : dispatchEvent; + + addEventCaptureListener(element, handlerBaseName, + // Check if interactive and wrap in interactiveUpdates + dispatch.bind(null, topLevelType)); +} + +function dispatchInteractiveEvent(topLevelType, nativeEvent) { + interactiveUpdates(dispatchEvent, topLevelType, nativeEvent); } function dispatchEvent(topLevelType, nativeEvent) { @@ -14021,7 +14860,7 @@ function dispatchEvent(topLevelType, nativeEvent) { try { // Event queue being processed in the same cycle allows // `preventDefault`. - batchedUpdates(handleTopLevelImpl, bookKeeping); + batchedUpdates(handleTopLevel, bookKeeping); } finally { releaseTopLevelCallbackBookKeeping(bookKeeping); } @@ -14029,8 +14868,6 @@ function dispatchEvent(topLevelType, nativeEvent) { var ReactDOMEventListener = Object.freeze({ get _enabled () { return _enabled; }, - get _handleTopLevel () { return _handleTopLevel; }, - setHandleTopLevel: setHandleTopLevel, setEnabled: setEnabled, isEnabled: isEnabled, trapBubbledEvent: trapBubbledEvent, @@ -14120,25 +14957,22 @@ function getVendorPrefixedEventName(eventName) { } } - return ''; + return eventName; } /** * Types of raw signals from the browser caught at the top level. * - * For events like 'submit' which don't consistently bubble (which we - * trap at a lower node than `document`), binding at `document` would - * cause duplicate events so we don't include them here. + * For events like 'submit' or audio/video events which don't consistently + * bubble (which we trap at a lower node than `document`), binding + * at `document` would cause duplicate events so we don't include them here. */ -var topLevelTypes$1 = { - topAbort: 'abort', - topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend', - topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration', - topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart', +var topLevelTypes = { + topAnimationEnd: getVendorPrefixedEventName('animationend'), + topAnimationIteration: getVendorPrefixedEventName('animationiteration'), + topAnimationStart: getVendorPrefixedEventName('animationstart'), topBlur: 'blur', topCancel: 'cancel', - topCanPlay: 'canplay', - topCanPlayThrough: 'canplaythrough', topChange: 'change', topClick: 'click', topClose: 'close', @@ -14157,19 +14991,12 @@ var topLevelTypes$1 = { topDragOver: 'dragover', topDragStart: 'dragstart', topDrop: 'drop', - topDurationChange: 'durationchange', - topEmptied: 'emptied', - topEncrypted: 'encrypted', - topEnded: 'ended', - topError: 'error', topFocus: 'focus', topInput: 'input', topKeyDown: 'keydown', topKeyPress: 'keypress', topKeyUp: 'keyup', - topLoadedData: 'loadeddata', topLoad: 'load', - topLoadedMetadata: 'loadedmetadata', topLoadStart: 'loadstart', topMouseDown: 'mousedown', topMouseMove: 'mousemove', @@ -14177,50 +15004,49 @@ var topLevelTypes$1 = { topMouseOver: 'mouseover', topMouseUp: 'mouseup', topPaste: 'paste', - topPause: 'pause', - topPlay: 'play', - topPlaying: 'playing', - topProgress: 'progress', - topRateChange: 'ratechange', topScroll: 'scroll', - topSeeked: 'seeked', - topSeeking: 'seeking', topSelectionChange: 'selectionchange', - topStalled: 'stalled', - topSuspend: 'suspend', topTextInput: 'textInput', - topTimeUpdate: 'timeupdate', topToggle: 'toggle', topTouchCancel: 'touchcancel', topTouchEnd: 'touchend', topTouchMove: 'touchmove', topTouchStart: 'touchstart', - topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend', - topVolumeChange: 'volumechange', - topWaiting: 'waiting', + topTransitionEnd: getVendorPrefixedEventName('transitionend'), topWheel: 'wheel' }; -var BrowserEventConstants = { - topLevelTypes: topLevelTypes$1 +// There are so many media events, it makes sense to just +// maintain a list of them. Note these aren't technically +// "top-level" since they don't bubble. We should come up +// with a better naming convention if we come to refactoring +// the event system. +var mediaEventTypes = { + topAbort: 'abort', + topCanPlay: 'canplay', + topCanPlayThrough: 'canplaythrough', + topDurationChange: 'durationchange', + topEmptied: 'emptied', + topEncrypted: 'encrypted', + topEnded: 'ended', + topError: 'error', + topLoadedData: 'loadeddata', + topLoadedMetadata: 'loadedmetadata', + topLoadStart: 'loadstart', + topPause: 'pause', + topPlay: 'play', + topPlaying: 'playing', + topProgress: 'progress', + topRateChange: 'ratechange', + topSeeked: 'seeked', + topSeeking: 'seeking', + topStalled: 'stalled', + topSuspend: 'suspend', + topTimeUpdate: 'timeupdate', + topVolumeChange: 'volumechange', + topWaiting: 'waiting' }; -function runEventQueueInBatch(events) { - enqueueEvents(events); - processEventQueue(false); -} - -/** - * Streams a fired top-level event to `EventPluginHub` where plugins have the - * opportunity to create `ReactEvent`s to be dispatched. - */ -function handleTopLevel(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); - runEventQueueInBatch(events); -} - -var topLevelTypes = BrowserEventConstants.topLevelTypes; - /** * Summary of `ReactBrowserEventEmitter` event handling: * @@ -14436,7 +15262,7 @@ function getOffsets(outerNode) { var anchorNode = selection.anchorNode, anchorOffset = selection.anchorOffset, - focusNode$$1 = selection.focusNode, + focusNode = selection.focusNode, focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the @@ -14450,13 +15276,13 @@ function getOffsets(outerNode) { try { /* eslint-disable no-unused-expressions */ anchorNode.nodeType; - focusNode$$1.nodeType; + focusNode.nodeType; /* eslint-enable no-unused-expressions */ } catch (e) { return null; } - return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode$$1, focusOffset); + return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset); } /** @@ -14468,7 +15294,7 @@ function getOffsets(outerNode) { * * Exported only for testing. */ -function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode$$1, focusOffset) { +function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) { var length = 0; var start = -1; var end = -1; @@ -14484,7 +15310,7 @@ function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNo if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) { start = length + anchorOffset; } - if (node === focusNode$$1 && (focusOffset === 0 || node.nodeType === TEXT_NODE)) { + if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) { end = length + focusOffset; } @@ -14511,7 +15337,7 @@ function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNo if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) { start = length; } - if (parentNode === focusNode$$1 && ++indexWithinFocus === focusOffset) { + if (parentNode === focusNode && ++indexWithinFocus === focusOffset) { end = length; } if ((next = node.nextSibling) !== null) { @@ -14639,7 +15465,7 @@ function restoreSelection(priorSelectionInformation) { } } - focusNode(priorFocusedElem); + priorFocusedElem.focus(); for (var i = 0; i < ancestors.length; i++) { var info = ancestors[i]; @@ -14843,519 +15669,17 @@ var SelectEventPlugin = { } }; -/** - * @interface Event - * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface - * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent - */ -var AnimationEventInterface = { - animationName: null, - elapsedTime: null, - pseudoElement: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticEvent} - */ -function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent$1.augmentClass(SyntheticAnimationEvent, AnimationEventInterface); - -/** - * @interface Event - * @see http://www.w3.org/TR/clipboard-apis/ - */ -var ClipboardEventInterface = { - clipboardData: function (event) { - return 'clipboardData' in event ? event.clipboardData : window.clipboardData; - } -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticEvent} - */ -function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent$1.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface); - -/** - * @interface FocusEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var FocusEventInterface = { - relatedTarget: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface); - -/** - * `charCode` represents the actual "character code" and is safe to use with - * `String.fromCharCode`. As such, only keys that correspond to printable - * characters produce a valid `charCode`, the only exception to this is Enter. - * The Tab-key is considered non-printable and does not have a `charCode`, - * presumably because it does not produce a tab-character in browsers. - * - * @param {object} nativeEvent Native browser event. - * @return {number} Normalized `charCode` property. - */ -function getEventCharCode(nativeEvent) { - var charCode; - var keyCode = nativeEvent.keyCode; - - if ('charCode' in nativeEvent) { - charCode = nativeEvent.charCode; - - // FF does not set `charCode` for the Enter-key, check against `keyCode`. - if (charCode === 0 && keyCode === 13) { - charCode = 13; - } - } else { - // IE8 does not implement `charCode`, but `keyCode` has the correct value. - charCode = keyCode; - } - - // Some non-printable keys are reported in `charCode`/`keyCode`, discard them. - // Must not discard the (non-)printable Enter-key. - if (charCode >= 32 || charCode === 13) { - return charCode; - } - - return 0; -} - -/** - * Normalization of deprecated HTML5 `key` values - * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names - */ -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' -}; - -/** - * Translation from legacy `keyCode` to HTML5 `key` - * Only special keys supported, all others depend on keyboard layout or browser - * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names - */ -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' -}; - -/** - * @param {object} nativeEvent Native browser event. - * @return {string} Normalized `key` property. - */ -function getEventKey(nativeEvent) { - if (nativeEvent.key) { - // Normalize inconsistent values reported by browsers due to - // implementations of a working draft specification. - - // FireFox implements `key` but returns `MozPrintableKey` for all - // printable characters (normalized to `Unidentified`), ignore it. - var key = normalizeKey[nativeEvent.key] || nativeEvent.key; - if (key !== 'Unidentified') { - return key; - } - } - - // Browser does not implement `key`, polyfill as much of it as we can. - if (nativeEvent.type === 'keypress') { - var charCode = getEventCharCode(nativeEvent); - - // The enter-key is technically both printable and non-printable and can - // thus be captured by `keypress`, no other non-printable key should. - return charCode === 13 ? 'Enter' : String.fromCharCode(charCode); - } - if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') { - // While user keyboard layout determines the actual meaning of each - // `keyCode` value, almost all function keys have a universal value. - return translateToKey[nativeEvent.keyCode] || 'Unidentified'; - } - return ''; -} - -/** - * @interface KeyboardEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var KeyboardEventInterface = { - key: getEventKey, - location: null, - ctrlKey: null, - shiftKey: null, - altKey: null, - metaKey: null, - repeat: null, - locale: null, - getModifierState: getEventModifierState, - // Legacy Interface - charCode: function (event) { - // `charCode` is the result of a KeyPress event and represents the value of - // the actual printable character. - - // KeyPress is deprecated, but its replacement is not yet final and not - // implemented in any major browser. Only KeyPress has charCode. - if (event.type === 'keypress') { - return getEventCharCode(event); - } - return 0; - }, - keyCode: function (event) { - // `keyCode` is the result of a KeyDown/Up event and represents the value of - // physical keyboard key. - - // The actual meaning of the value depends on the users' keyboard layout - // which cannot be detected. Assuming that it is a US keyboard layout - // provides a surprisingly accurate mapping for US and European users. - // Due to this, it is left to the user to implement at this time. - if (event.type === 'keydown' || event.type === 'keyup') { - return event.keyCode; - } - return 0; - }, - which: function (event) { - // `which` is an alias for either `keyCode` or `charCode` depending on the - // type of the event. - if (event.type === 'keypress') { - return getEventCharCode(event); - } - if (event.type === 'keydown' || event.type === 'keyup') { - return event.keyCode; - } - return 0; - } -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface); - -/** - * @interface DragEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var DragEventInterface = { - dataTransfer: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticMouseEvent} - */ -function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface); - -/** - * @interface TouchEvent - * @see http://www.w3.org/TR/touch-events/ - */ -var TouchEventInterface = { - touches: null, - targetTouches: null, - changedTouches: null, - altKey: null, - metaKey: null, - ctrlKey: null, - shiftKey: null, - getModifierState: getEventModifierState -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface); - -/** - * @interface Event - * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events- - * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent - */ -var TransitionEventInterface = { - propertyName: null, - elapsedTime: null, - pseudoElement: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticEvent} - */ -function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent$1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent$1.augmentClass(SyntheticTransitionEvent, TransitionEventInterface); - -/** - * @interface WheelEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var WheelEventInterface = { - deltaX: function (event) { - return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive). - 'wheelDeltaX' in event ? -event.wheelDeltaX : 0; - }, - deltaY: function (event) { - return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive). - 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). - 'wheelDelta' in event ? -event.wheelDelta : 0; - }, - deltaZ: null, - - // Browsers without "deltaMode" is reporting in raw wheel delta where one - // notch on the scroll is always +/- 120, roughly equivalent to pixels. - // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or - // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size. - deltaMode: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticMouseEvent} - */ -function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface); - -/** - * Turns - * ['abort', ...] - * into - * eventTypes = { - * 'abort': { - * phasedRegistrationNames: { - * bubbled: 'onAbort', - * captured: 'onAbortCapture', - * }, - * dependencies: ['topAbort'], - * }, - * ... - * }; - * topLevelEventsToDispatchConfig = { - * 'topAbort': { sameConfig } - * }; - */ -var eventTypes$4 = {}; -var topLevelEventsToDispatchConfig = {}; -['abort', 'animationEnd', 'animationIteration', 'animationStart', 'blur', 'cancel', 'canPlay', 'canPlayThrough', 'click', 'close', 'contextMenu', 'copy', 'cut', 'doubleClick', 'drag', 'dragEnd', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'focus', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'mouseDown', 'mouseMove', 'mouseOut', 'mouseOver', 'mouseUp', 'paste', 'pause', 'play', 'playing', 'progress', 'rateChange', 'reset', 'scroll', 'seeked', 'seeking', 'stalled', 'submit', 'suspend', 'timeUpdate', 'toggle', 'touchCancel', 'touchEnd', 'touchMove', 'touchStart', 'transitionEnd', 'volumeChange', 'waiting', 'wheel'].forEach(function (event) { - var capitalizedEvent = event[0].toUpperCase() + event.slice(1); - var onEvent = 'on' + capitalizedEvent; - var topEvent = 'top' + capitalizedEvent; - - var type = { - phasedRegistrationNames: { - bubbled: onEvent, - captured: onEvent + 'Capture' - }, - dependencies: [topEvent] - }; - eventTypes$4[event] = type; - topLevelEventsToDispatchConfig[topEvent] = type; -}); - -// Only used in DEV for exhaustiveness validation. -var knownHTMLTopLevelTypes = ['topAbort', 'topCancel', 'topCanPlay', 'topCanPlayThrough', 'topClose', 'topDurationChange', 'topEmptied', 'topEncrypted', 'topEnded', 'topError', 'topInput', 'topInvalid', 'topLoad', 'topLoadedData', 'topLoadedMetadata', 'topLoadStart', 'topPause', 'topPlay', 'topPlaying', 'topProgress', 'topRateChange', 'topReset', 'topSeeked', 'topSeeking', 'topStalled', 'topSubmit', 'topSuspend', 'topTimeUpdate', 'topToggle', 'topVolumeChange', 'topWaiting']; - -var SimpleEventPlugin = { - eventTypes: eventTypes$4, - - extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType]; - if (!dispatchConfig) { - return null; - } - var EventConstructor; - switch (topLevelType) { - case 'topKeyPress': - // Firefox creates a keypress event for function keys too. This removes - // the unwanted keypress events. Enter is however both printable and - // non-printable. One would expect Tab to be as well (but it isn't). - if (getEventCharCode(nativeEvent) === 0) { - return null; - } - /* falls through */ - case 'topKeyDown': - case 'topKeyUp': - EventConstructor = SyntheticKeyboardEvent; - break; - case 'topBlur': - case 'topFocus': - EventConstructor = SyntheticFocusEvent; - break; - case 'topClick': - // Firefox creates a click event on right mouse clicks. This removes the - // unwanted click events. - if (nativeEvent.button === 2) { - return null; - } - /* falls through */ - case 'topDoubleClick': - case 'topMouseDown': - case 'topMouseMove': - case 'topMouseUp': - // TODO: Disabled elements should not respond to mouse events - /* falls through */ - case 'topMouseOut': - case 'topMouseOver': - case 'topContextMenu': - EventConstructor = SyntheticMouseEvent; - break; - case 'topDrag': - case 'topDragEnd': - case 'topDragEnter': - case 'topDragExit': - case 'topDragLeave': - case 'topDragOver': - case 'topDragStart': - case 'topDrop': - EventConstructor = SyntheticDragEvent; - break; - case 'topTouchCancel': - case 'topTouchEnd': - case 'topTouchMove': - case 'topTouchStart': - EventConstructor = SyntheticTouchEvent; - break; - case 'topAnimationEnd': - case 'topAnimationIteration': - case 'topAnimationStart': - EventConstructor = SyntheticAnimationEvent; - break; - case 'topTransitionEnd': - EventConstructor = SyntheticTransitionEvent; - break; - case 'topScroll': - EventConstructor = SyntheticUIEvent; - break; - case 'topWheel': - EventConstructor = SyntheticWheelEvent; - break; - case 'topCopy': - case 'topCut': - case 'topPaste': - EventConstructor = SyntheticClipboardEvent; - break; - default: - { - if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) { - warning(false, 'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType); - } - } - // HTML Events - // @see http://www.w3.org/TR/html5/index.html#events-0 - EventConstructor = SyntheticEvent$1; - break; - } - var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget); - accumulateTwoPhaseDispatches(event); - return event; - } -}; - -setHandleTopLevel(handleTopLevel); - /** * Inject modules for resolving DOM hierarchy and plugin ordering. */ -injection$1.injectEventPluginOrder(DOMEventPluginOrder); -injection$2.injectComponentTree(ReactDOMComponentTree); +injection.injectEventPluginOrder(DOMEventPluginOrder); +injection$1.injectComponentTree(ReactDOMComponentTree); /** * Some important event plugins included by default (without having to require * them). */ -injection$1.injectEventPluginsByName({ +injection.injectEventPluginsByName({ SimpleEventPlugin: SimpleEventPlugin, EnterLeaveEventPlugin: EnterLeaveEventPlugin, ChangeEventPlugin: ChangeEventPlugin, @@ -15363,179 +15687,729 @@ injection$1.injectEventPluginsByName({ BeforeInputEventPlugin: BeforeInputEventPlugin }); -var enableAsyncSubtreeAPI = true; -var enableAsyncSchedulingByDefaultInReactDOM = false; +// Max 31 bit integer. The max integer size in V8 for 32-bit systems. +// Math.pow(2, 30) - 1 +// 0b111111111111111111111111111111 +var MAX_SIGNED_31_BIT_INT = 1073741823; + +// TODO: Use an opaque type once ESLint et al support the syntax + + +var NoWork = 0; +var Sync = 1; +var Never = MAX_SIGNED_31_BIT_INT; + +var UNIT_SIZE = 10; +var MAGIC_NUMBER_OFFSET = 2; + +// 1 unit of expiration time represents 10ms. +function msToExpirationTime(ms) { + // Always add an offset so that we don't clash with the magic number for NoWork. + return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET; +} + +function expirationTimeToMs(expirationTime) { + return (expirationTime - MAGIC_NUMBER_OFFSET) * UNIT_SIZE; +} + +function ceiling(num, precision) { + return ((num / precision | 0) + 1) * precision; +} + +function computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) { + return ceiling(currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE); +} + +var NoContext = 0; +var AsyncMode = 1; +var StrictMode = 2; + +var hasBadMapPolyfill = void 0; + +{ + hasBadMapPolyfill = false; + try { + var nonExtensibleObject = Object.preventExtensions({}); + var testMap = new Map([[nonExtensibleObject, null]]); + var testSet = new Set([nonExtensibleObject]); + // This is necessary for Rollup to not consider these unused. + // https://github.com/rollup/rollup/issues/1771 + // TODO: we can remove these if Rollup fixes the bug. + testMap.set(0, 0); + testSet.add(0); + } catch (e) { + // TODO: Consider warning about bad polyfills + hasBadMapPolyfill = true; + } +} + +// A Fiber is work on a Component that needs to be done or was done. There can +// be more than one per component. + + +var debugCounter = void 0; + +{ + debugCounter = 1; +} + +function FiberNode(tag, pendingProps, key, mode) { + // Instance + this.tag = tag; + this.key = key; + this.type = null; + this.stateNode = null; + + // Fiber + 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.mode = mode; + + // Effects + this.effectTag = NoEffect; + this.nextEffect = null; + + this.firstEffect = null; + this.lastEffect = null; + + this.expirationTime = NoWork; + + this.alternate = null; + + { + this._debugID = debugCounter++; + this._debugSource = null; + this._debugOwner = null; + this._debugIsCurrentlyTiming = false; + if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') { + Object.preventExtensions(this); + } + } +} + +// This is a constructor function, rather than a POJO constructor, still +// please ensure we do the following: +// 1) Nobody should add any instance methods on this. Instance methods can be +// more difficult to predict when they get optimized and they are almost +// never inlined properly in static compilers. +// 2) Nobody should rely on `instanceof Fiber` for type testing. We should +// always know when it is a fiber. +// 3) We might want to experiment with using numeric keys since they are easier +// to optimize in a non-JIT environment. +// 4) We can easily go from a constructor to a createFiber object literal if that +// is faster. +// 5) It should be easy to port this to a C struct and keep a C implementation +// compatible. +var createFiber = function (tag, pendingProps, key, mode) { + // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors + return new FiberNode(tag, pendingProps, key, mode); +}; + +function shouldConstruct(Component) { + return !!(Component.prototype && Component.prototype.isReactComponent); +} + +// This is used to create an alternate fiber to do work on. +function createWorkInProgress(current, pendingProps, expirationTime) { + var workInProgress = current.alternate; + if (workInProgress === null) { + // We use a double buffering pooling technique because we know that we'll + // only ever need at most two versions of a tree. We pool the "other" unused + // node that we're free to reuse. This is lazily created to avoid allocating + // extra objects for things that are never updated. It also allow us to + // reclaim the extra memory if needed. + workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode); + workInProgress.type = current.type; + workInProgress.stateNode = current.stateNode; + + { + // DEV-only fields + workInProgress._debugID = current._debugID; + workInProgress._debugSource = current._debugSource; + workInProgress._debugOwner = current._debugOwner; + } + + workInProgress.alternate = current; + current.alternate = workInProgress; + } else { + workInProgress.pendingProps = pendingProps; + + // We already have an alternate. + // Reset the effect tag. + workInProgress.effectTag = NoEffect; + + // The effect list is no longer valid. + workInProgress.nextEffect = null; + workInProgress.firstEffect = null; + workInProgress.lastEffect = null; + } + + workInProgress.expirationTime = expirationTime; + + workInProgress.child = current.child; + workInProgress.memoizedProps = current.memoizedProps; + workInProgress.memoizedState = current.memoizedState; + workInProgress.updateQueue = current.updateQueue; + + // These will be overridden during the parent's reconciliation + workInProgress.sibling = current.sibling; + workInProgress.index = current.index; + workInProgress.ref = current.ref; + + return workInProgress; +} + +function createHostRootFiber(isAsync) { + var mode = isAsync ? AsyncMode | StrictMode : NoContext; + return createFiber(HostRoot, null, null, mode); +} + +function createFiberFromElement(element, mode, expirationTime) { + var owner = null; + { + owner = element._owner; + } + + var fiber = void 0; + var type = element.type; + var key = element.key; + var pendingProps = element.props; + + var fiberTag = void 0; + if (typeof type === 'function') { + fiberTag = shouldConstruct(type) ? ClassComponent : IndeterminateComponent; + } else if (typeof type === 'string') { + fiberTag = HostComponent; + } else { + switch (type) { + case REACT_FRAGMENT_TYPE: + return createFiberFromFragment(pendingProps.children, mode, expirationTime, key); + case REACT_ASYNC_MODE_TYPE: + fiberTag = Mode; + mode |= AsyncMode | StrictMode; + break; + case REACT_STRICT_MODE_TYPE: + fiberTag = Mode; + mode |= StrictMode; + break; + case REACT_CALL_TYPE: + fiberTag = CallComponent; + break; + case REACT_RETURN_TYPE: + fiberTag = ReturnComponent; + break; + default: + { + if (typeof type === 'object' && type !== null) { + switch (type.$$typeof) { + case REACT_PROVIDER_TYPE: + fiberTag = ContextProvider; + break; + case REACT_CONTEXT_TYPE: + // This is a consumer + fiberTag = ContextConsumer; + break; + case REACT_FORWARD_REF_TYPE: + fiberTag = ForwardRef; + break; + default: + if (typeof type.tag === 'number') { + // Currently assumed to be a continuation and therefore is a + // fiber already. + // TODO: The yield system is currently broken for updates in + // some cases. The reified yield stores a fiber, but we don't + // know which fiber that is; the current or a workInProgress? + // When the continuation gets rendered here we don't know if we + // can reuse that fiber or if we need to clone it. There is + // probably a clever way to restructure this. + fiber = type; + fiber.pendingProps = pendingProps; + fiber.expirationTime = expirationTime; + return fiber; + } else { + throwOnInvalidElementType(type, owner); + } + break; + } + } else { + throwOnInvalidElementType(type, owner); + } + } + } + } + + fiber = createFiber(fiberTag, pendingProps, key, mode); + fiber.type = type; + fiber.expirationTime = expirationTime; + + { + fiber._debugSource = element._source; + fiber._debugOwner = element._owner; + } + + return fiber; +} + +function throwOnInvalidElementType(type, owner) { + 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) : null; + if (ownerName) { + info += '\n\nCheck the render method of `' + ownerName + '`.'; + } + } + invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info); +} + +function createFiberFromFragment(elements, mode, expirationTime, key) { + var fiber = createFiber(Fragment, elements, key, mode); + 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, NoContext); + 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, // Used by persistent updates + implementation: portal.implementation + }; + return fiber; +} + +// Used for stashing WIP properties to replay failed work in DEV. +function assignFiberPropertiesInDEV(target, source) { + if (target === null) { + // This Fiber's initial properties will always be overwritten. + // We only use a Fiber to ensure the same hidden class so DEV isn't slow. + target = createFiber(IndeterminateComponent, null, null, NoContext); + } + + // This is intentionally written as a list of all properties. + // We tried to use Object.assign() instead but this is called in + // the hottest path, and Object.assign() was too slow: + // https://github.com/facebook/react/issues/12502 + // This code is DEV-only so size is not a concern. + + target.tag = source.tag; + target.key = source.key; + 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.mode = source.mode; + target.effectTag = source.effectTag; + target.nextEffect = source.nextEffect; + target.firstEffect = source.firstEffect; + target.lastEffect = source.lastEffect; + target.expirationTime = source.expirationTime; + target.alternate = source.alternate; + target._debugID = source._debugID; + target._debugSource = source._debugSource; + target._debugOwner = source._debugOwner; + target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming; + return target; +} + +// TODO: This should be lifted into the renderer. + + +function createFiberRoot(containerInfo, isAsync, hydrate) { + // Cyclic construction. This cheats the type system right now because + // stateNode is any. + var uninitializedFiber = createHostRootFiber(isAsync); + var root = { + current: uninitializedFiber, + containerInfo: containerInfo, + pendingChildren: null, + pendingCommitExpirationTime: NoWork, + finishedWork: null, + context: null, + pendingContext: null, + hydrate: hydrate, + remainingExpirationTime: NoWork, + firstBatch: null, + nextScheduledRoot: null + }; + uninitializedFiber.stateNode = root; + return root; +} + +var onCommitFiberRoot = null; +var onCommitFiberUnmount = null; +var hasLoggedError = false; + +function catchErrors(fn) { + return function (arg) { + try { + return fn(arg); + } catch (err) { + if (true && !hasLoggedError) { + hasLoggedError = true; + warning(false, 'React DevTools encountered an error: %s', err); + } + } + }; +} + +function injectInternals(internals) { + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { + // No DevTools + return false; + } + var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; + if (hook.isDisabled) { + // This isn't a real property on the hook, but it can be set to opt out + // of DevTools integration and associated warnings and logs. + // https://github.com/facebook/react/issues/3877 + return true; + } + if (!hook.supportsFiber) { + { + warning(false, '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'); + } + // DevTools exists, even though it doesn't support Fiber. + return true; + } + try { + var rendererID = hook.inject(internals); + // We have successfully injected, so now it is safe to set up hooks. + onCommitFiberRoot = catchErrors(function (root) { + return hook.onCommitFiberRoot(rendererID, root); + }); + onCommitFiberUnmount = catchErrors(function (fiber) { + return hook.onCommitFiberUnmount(rendererID, fiber); + }); + } catch (err) { + // Catch all errors because it is unsafe to throw during initialization. + { + warning(false, 'React DevTools encountered an error: %s.', err); + } + } + // DevTools exists + return true; +} + +function onCommitRoot(root) { + if (typeof onCommitFiberRoot === 'function') { + onCommitFiberRoot(root); + } +} + +function onCommitUnmount(fiber) { + if (typeof onCommitFiberUnmount === 'function') { + onCommitFiberUnmount(fiber); + } +} + +/** + * Forked from fbjs/warning: + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js + * + * Only change is we use console.warn instead of console.error, + * and do nothing when 'console' is not supported. + * This really simplifies the code. + * --- + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var lowPriorityWarning = function () {}; + +{ + var printWarning = function (format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.warn(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + lowPriorityWarning = function (condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +var lowPriorityWarning$1 = lowPriorityWarning; + +var ReactStrictModeWarnings = { + discardPendingWarnings: function () {}, + flushPendingDeprecationWarnings: function () {}, + flushPendingUnsafeLifecycleWarnings: function () {}, + recordDeprecationWarnings: function (fiber, instance) {}, + recordUnsafeLifecycleWarnings: function (fiber, instance) {} +}; + +{ + var LIFECYCLE_SUGGESTIONS = { + UNSAFE_componentWillMount: 'componentDidMount', + UNSAFE_componentWillReceiveProps: 'static getDerivedStateFromProps', + UNSAFE_componentWillUpdate: 'componentDidUpdate' + }; + + var pendingComponentWillMountWarnings = []; + var pendingComponentWillReceivePropsWarnings = []; + var pendingComponentWillUpdateWarnings = []; + var pendingUnsafeLifecycleWarnings = new Map(); + + // Tracks components we have already warned about. + var didWarnAboutDeprecatedLifecycles = new Set(); + var didWarnAboutUnsafeLifecycles = new Set(); + + ReactStrictModeWarnings.discardPendingWarnings = function () { + pendingComponentWillMountWarnings = []; + pendingComponentWillReceivePropsWarnings = []; + pendingComponentWillUpdateWarnings = []; + pendingUnsafeLifecycleWarnings = new Map(); + }; + + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () { + pendingUnsafeLifecycleWarnings.forEach(function (lifecycleWarningsMap, strictRoot) { + var lifecyclesWarningMesages = []; + + Object.keys(lifecycleWarningsMap).forEach(function (lifecycle) { + var lifecycleWarnings = lifecycleWarningsMap[lifecycle]; + if (lifecycleWarnings.length > 0) { + var componentNames = new Set(); + lifecycleWarnings.forEach(function (fiber) { + componentNames.add(getComponentName(fiber) || 'Component'); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + + var formatted = lifecycle.replace('UNSAFE_', ''); + var suggestion = LIFECYCLE_SUGGESTIONS[lifecycle]; + var sortedComponentNames = Array.from(componentNames).sort().join(', '); + + lifecyclesWarningMesages.push(formatted + ': Please update the following components to use ' + (suggestion + ' instead: ' + sortedComponentNames)); + } + }); + + if (lifecyclesWarningMesages.length > 0) { + var strictRootComponentStack = getStackAddendumByWorkInProgressFiber(strictRoot); + + warning(false, 'Unsafe lifecycle methods were found within a strict-mode tree:%s' + '\n\n%s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-strict-mode-warnings', strictRootComponentStack, lifecyclesWarningMesages.join('\n\n')); + } + }); + + pendingUnsafeLifecycleWarnings = new Map(); + }; + + var getStrictRoot = function (fiber) { + var maybeStrictRoot = null; + + while (fiber !== null) { + if (fiber.mode & StrictMode) { + maybeStrictRoot = fiber; + } + + fiber = fiber['return']; + } + + return maybeStrictRoot; + }; + + ReactStrictModeWarnings.flushPendingDeprecationWarnings = function () { + if (pendingComponentWillMountWarnings.length > 0) { + var uniqueNames = new Set(); + pendingComponentWillMountWarnings.forEach(function (fiber) { + uniqueNames.add(getComponentName(fiber) || 'Component'); + didWarnAboutDeprecatedLifecycles.add(fiber.type); + }); + + var sortedNames = Array.from(uniqueNames).sort().join(', '); + + lowPriorityWarning$1(false, 'componentWillMount is deprecated and will be removed in the next major version. ' + 'Use componentDidMount instead. As a temporary workaround, ' + 'you can rename to UNSAFE_componentWillMount.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-async-component-lifecycle-hooks', sortedNames); + + pendingComponentWillMountWarnings = []; + } + + if (pendingComponentWillReceivePropsWarnings.length > 0) { + var _uniqueNames = new Set(); + pendingComponentWillReceivePropsWarnings.forEach(function (fiber) { + _uniqueNames.add(getComponentName(fiber) || 'Component'); + didWarnAboutDeprecatedLifecycles.add(fiber.type); + }); + + var _sortedNames = Array.from(_uniqueNames).sort().join(', '); + + lowPriorityWarning$1(false, 'componentWillReceiveProps is deprecated and will be removed in the next major version. ' + 'Use static getDerivedStateFromProps instead.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-async-component-lifecycle-hooks', _sortedNames); + + pendingComponentWillReceivePropsWarnings = []; + } + + if (pendingComponentWillUpdateWarnings.length > 0) { + var _uniqueNames2 = new Set(); + pendingComponentWillUpdateWarnings.forEach(function (fiber) { + _uniqueNames2.add(getComponentName(fiber) || 'Component'); + didWarnAboutDeprecatedLifecycles.add(fiber.type); + }); + + var _sortedNames2 = Array.from(_uniqueNames2).sort().join(', '); + + lowPriorityWarning$1(false, 'componentWillUpdate is deprecated and will be removed in the next major version. ' + 'Use componentDidUpdate instead. As a temporary workaround, ' + 'you can rename to UNSAFE_componentWillUpdate.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-async-component-lifecycle-hooks', _sortedNames2); + + pendingComponentWillUpdateWarnings = []; + } + }; + + ReactStrictModeWarnings.recordDeprecationWarnings = function (fiber, instance) { + // Dedup strategy: Warn once per component. + if (didWarnAboutDeprecatedLifecycles.has(fiber.type)) { + return; + } + + // Don't warn about react-lifecycles-compat polyfilled components. + if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) { + pendingComponentWillMountWarnings.push(fiber); + } + if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { + pendingComponentWillReceivePropsWarnings.push(fiber); + } + if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { + pendingComponentWillUpdateWarnings.push(fiber); + } + }; + + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) { + var strictRoot = getStrictRoot(fiber); + + // Dedup strategy: Warn once per component. + // This is difficult to track any other way since component names + // are often vague and are likely to collide between 3rd party libraries. + // An expand property is probably okay to use here since it's DEV-only, + // and will only be set in the event of serious warnings. + if (didWarnAboutUnsafeLifecycles.has(fiber.type)) { + return; + } + + // Don't warn about react-lifecycles-compat polyfilled components. + // Note that it is sufficient to check for the presence of a + // single lifecycle, componentWillMount, with the polyfill flag. + if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning === true) { + return; + } + + var warningsForRoot = void 0; + if (!pendingUnsafeLifecycleWarnings.has(strictRoot)) { + warningsForRoot = { + UNSAFE_componentWillMount: [], + UNSAFE_componentWillReceiveProps: [], + UNSAFE_componentWillUpdate: [] + }; + + pendingUnsafeLifecycleWarnings.set(strictRoot, warningsForRoot); + } else { + warningsForRoot = pendingUnsafeLifecycleWarnings.get(strictRoot); + } + + var unsafeLifecycles = []; + if (typeof instance.componentWillMount === 'function' || typeof instance.UNSAFE_componentWillMount === 'function') { + unsafeLifecycles.push('UNSAFE_componentWillMount'); + } + if (typeof instance.componentWillReceiveProps === 'function' || typeof instance.UNSAFE_componentWillReceiveProps === 'function') { + unsafeLifecycles.push('UNSAFE_componentWillReceiveProps'); + } + if (typeof instance.componentWillUpdate === 'function' || typeof instance.UNSAFE_componentWillUpdate === 'function') { + unsafeLifecycles.push('UNSAFE_componentWillUpdate'); + } + + if (unsafeLifecycles.length > 0) { + unsafeLifecycles.forEach(function (lifecycle) { + warningsForRoot[lifecycle].push(fiber); + }); + } + }; +} + // Exports ReactDOM.createRoot -var enableCreateRoot = false; var enableUserTimingAPI = true; // Mutating mode (React DOM, React ART, React Native): var enableMutatingReconciler = true; // Experimental noop mode (currently unused): var enableNoopReconciler = false; -// Experimental persistent mode (CS): +// Experimental persistent mode (Fabric): var enablePersistentReconciler = false; - +// Experimental error-boundary API that can recover from errors within a single +// render phase +var enableGetDerivedStateFromCatch = false; // Helps identify side effects in begin-phase lifecycle hooks and setState reducers: var debugRenderPhaseSideEffects = false; +// In some cases, StrictMode should also double-render lifecycles. +// This can be confusing for tests though, +// And it can be bad for performance in production. +// This feature flag can be used to control the behavior: +var debugRenderPhaseSideEffectsForStrictMode = true; + +// To preserve the "Pause on caught exceptions" behavior of the debugger, we +// replay the begin phase of a failed component inside invokeGuardedCallback. +var replayFailedUnitOfWorkWithInvokeGuardedCallback = true; + +// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6: +var warnAboutDeprecatedLifecycles = false; + +var alwaysUseRequestIdleCallbackPolyfill = false; + // Only used in www builds. -var valueStack = []; - -{ - var fiberStack = []; -} - -var index = -1; - -function createCursor(defaultValue) { - return { - current: defaultValue - }; -} - - - -function pop(cursor, fiber) { - if (index < 0) { - { - warning(false, 'Unexpected pop.'); - } - return; - } - - { - if (fiber !== fiberStack[index]) { - warning(false, '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; -} - -function reset$1() { - while (index > -1) { - valueStack[index] = null; - - { - fiberStack[index] = null; - } - - index--; - } -} - -var describeComponentFrame = function (name, source, ownerName) { - return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : ''); -}; - -function describeFiber(fiber) { - switch (fiber.tag) { - case IndeterminateComponent: - case FunctionalComponent: - case ClassComponent: - case HostComponent: - var owner = fiber._debugOwner; - var source = fiber._debugSource; - var name = getComponentName(fiber); - var ownerName = null; - if (owner) { - ownerName = getComponentName(owner); - } - return describeComponentFrame(name, source, ownerName); - default: - return ''; - } -} - -// This function can only be called with a work-in-progress fiber and -// only during begin or complete phase. Do not call it under any other -// circumstances. -function getStackAddendumByWorkInProgressFiber(workInProgress) { - var info = ''; - var node = workInProgress; - do { - info += describeFiber(node); - // Otherwise this return pointer might point to the wrong tree: - node = node['return']; - } while (node); - return info; -} - -function getCurrentFiberOwnerName() { - { - var fiber = ReactDebugCurrentFiber.current; - if (fiber === null) { - return null; - } - var owner = fiber._debugOwner; - if (owner !== null && typeof owner !== 'undefined') { - return getComponentName(owner); - } - } - return null; -} - -function getCurrentFiberStackAddendum() { - { - var fiber = ReactDebugCurrentFiber.current; - if (fiber === null) { - return null; - } - // Safe because if current fiber exists, we are reconciling, - // and it is guaranteed to be the work-in-progress version. - return getStackAddendumByWorkInProgressFiber(fiber); - } - return null; -} - -function resetCurrentFiber() { - ReactDebugCurrentFrame.getCurrentStack = null; - ReactDebugCurrentFiber.current = null; - ReactDebugCurrentFiber.phase = null; -} - -function setCurrentFiber(fiber) { - ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackAddendum; - ReactDebugCurrentFiber.current = fiber; - ReactDebugCurrentFiber.phase = null; -} - -function setCurrentPhase(phase) { - ReactDebugCurrentFiber.phase = phase; -} - -var ReactDebugCurrentFiber = { - current: null, - phase: null, - resetCurrentFiber: resetCurrentFiber, - setCurrentFiber: setCurrentFiber, - setCurrentPhase: setCurrentPhase, - getCurrentFiberOwnerName: getCurrentFiberOwnerName, - getCurrentFiberStackAddendum: getCurrentFiberStackAddendum -}; - // Prefix measurements so that it's possible to filter them. // Longer prefixes are hard to read in DevTools. var reactEmoji = '\u269B'; @@ -15656,8 +16530,11 @@ var shouldIgnoreFiber = function (fiber) { case HostComponent: case HostText: case HostPortal: + case CallComponent: case ReturnComponent: case Fragment: + case ContextProvider: + case ContextConsumer: return true; default: return false; @@ -15727,12 +16604,12 @@ function startRequestCallbackTimer() { } } -function stopRequestCallbackTimer(didExpire) { +function stopRequestCallbackTimer(didExpire, expirationTime) { if (enableUserTimingAPI) { if (supportsUserTiming) { isWaitingForCallback = false; var warning$$1 = didExpire ? 'React was blocked by main thread' : null; - endMark('(Waiting for async callback...)', '(Waiting for async callback...)', warning$$1); + endMark('(Waiting for async callback... will force flush in ' + expirationTime + ' ms)', '(Waiting for async callback...)', warning$$1); } } } @@ -15837,7 +16714,7 @@ function startWorkLoopTimer(nextUnitOfWork) { } } -function stopWorkLoopTimer(interruptedBy) { +function stopWorkLoopTimer(interruptedBy, didCompleteRoot) { if (enableUserTimingAPI) { if (!supportsUserTiming) { return; @@ -15854,9 +16731,10 @@ function stopWorkLoopTimer(interruptedBy) { warning$$1 = 'There were cascading updates'; } commitCountInCurrentWorkLoop = 0; + var label = didCompleteRoot ? '(React Tree Reconciliation: Completed Root)' : '(React Tree Reconciliation: Yielded)'; // Pause any measurements until the next loop. pauseTimers(); - endMark('(React Tree Reconciliation)', '(React Tree Reconciliation)', warning$$1); + endMark(label, '(React Tree Reconciliation)', warning$$1); } } @@ -15893,6 +16771,27 @@ function stopCommitTimer() { } } +function startCommitSnapshotEffectsTimer() { + if (enableUserTimingAPI) { + if (!supportsUserTiming) { + return; + } + effectCountInCurrentCommit = 0; + beginMark('(Committing Snapshot Effects)'); + } +} + +function stopCommitSnapshotEffectsTimer() { + if (enableUserTimingAPI) { + if (!supportsUserTiming) { + return; + } + var count = effectCountInCurrentCommit; + effectCountInCurrentCommit = 0; + endMark('(Committing Snapshot Effects: ' + count + ' Total)', '(Committing Snapshot Effects)', null); + } +} + function startCommitHostEffectsTimer() { if (enableUserTimingAPI) { if (!supportsUserTiming) { @@ -15935,572 +16834,10 @@ function stopCommitLifeCyclesTimer() { } } -{ - var warnedAboutMissingGetChildContext = {}; -} - -// A cursor to the current merged context object on the stack. -var contextStackCursor = createCursor(emptyObject); -// A cursor to a boolean indicating whether the context has changed. -var didPerformWorkStackCursor = createCursor(false); -// Keep track of the previous context object that was on the stack. -// We use this to get access to the parent context after we have already -// pushed the next context provider, and now need to merge their contexts. -var previousContext = emptyObject; - -function getUnmaskedContext(workInProgress) { - var hasOwnContext = isContextProvider(workInProgress); - if (hasOwnContext) { - // If the fiber is a context provider itself, when we read its context - // we have already pushed its own child context on the stack. A context - // provider should not "see" its own child context. Therefore we read the - // previous (parent) context instead for a context provider. - 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 emptyObject; - } - - // Avoid recreating masked context unless unmasked context has changed. - // Failing to do this will result in unnecessary calls to componentWillReceiveProps. - // This may trigger infinite loops if componentWillReceiveProps calls setState. - 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(workInProgress) || 'Unknown'; - checkPropTypes(contextTypes, context, 'context', name, ReactDebugCurrentFiber.getCurrentFiberStackAddendum); - } - - // Cache unmasked context so we can avoid recreating masked context unless necessary. - // Context is created before the class component is instantiated so check for instance. - if (instance) { - cacheContext(workInProgress, unmaskedContext, context); - } - - return context; -} - -function hasContextChanged() { - return didPerformWorkStackCursor.current; -} - -function isContextConsumer(fiber) { - return fiber.tag === ClassComponent && fiber.type.contextTypes != null; -} - -function isContextProvider(fiber) { - return fiber.tag === ClassComponent && fiber.type.childContextTypes != null; -} - -function popContextProvider(fiber) { - if (!isContextProvider(fiber)) { - return; - } - - pop(didPerformWorkStackCursor, fiber); - pop(contextStackCursor, fiber); -} - -function popTopLevelContextObject(fiber) { - pop(didPerformWorkStackCursor, fiber); - pop(contextStackCursor, fiber); -} - -function pushTopLevelContextObject(fiber, context, didChange) { - !(contextStackCursor.cursor == null) ? invariant(false, 'Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.') : void 0; - - push(contextStackCursor, context, fiber); - push(didPerformWorkStackCursor, didChange, fiber); -} - -function processChildContext(fiber, parentContext) { - var instance = fiber.stateNode; - var childContextTypes = fiber.type.childContextTypes; - - // TODO (bvaughn) Replace this behavior with an invariant() in the future. - // It has only been added in Fiber to match the (unintentional) behavior in Stack. - if (typeof instance.getChildContext !== 'function') { - { - var componentName = getComponentName(fiber) || 'Unknown'; - - if (!warnedAboutMissingGetChildContext[componentName]) { - warnedAboutMissingGetChildContext[componentName] = true; - warning(false, '%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 = void 0; - { - ReactDebugCurrentFiber.setCurrentPhase('getChildContext'); - } - startPhaseTimer(fiber, 'getChildContext'); - childContext = instance.getChildContext(); - stopPhaseTimer(); - { - ReactDebugCurrentFiber.setCurrentPhase(null); - } - for (var contextKey in childContext) { - !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(fiber) || 'Unknown', contextKey) : void 0; - } - { - var name = getComponentName(fiber) || 'Unknown'; - checkPropTypes(childContextTypes, childContext, 'child context', name, - // In practice, there is one case in which we won't get a stack. It's when - // somebody calls unstable_renderSubtreeIntoContainer() and we process - // context from the parent component instance. The stack will be missing - // because it's outside of the reconciliation, and so the pointer has not - // been set. This is rare and doesn't matter. We'll also remove that API. - ReactDebugCurrentFiber.getCurrentFiberStackAddendum); - } - - return _assign({}, parentContext, childContext); -} - -function pushContextProvider(workInProgress) { - if (!isContextProvider(workInProgress)) { - return false; - } - - var instance = workInProgress.stateNode; - // We push the context as early as possible to ensure stack integrity. - // If the instance does not exist yet, we will push null at first, - // and replace it on the stack later when invalidating the context. - var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject; - - // Remember the parent context so we can merge with it later. - // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates. - previousContext = contextStackCursor.current; - push(contextStackCursor, memoizedMergedChildContext, workInProgress); - push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress); - - return true; -} - -function invalidateContextProvider(workInProgress, didChange) { - var instance = workInProgress.stateNode; - !instance ? invariant(false, 'Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.') : void 0; - - if (didChange) { - // Merge parent and own context. - // Skip this if we're not updating due to sCU. - // This avoids unnecessarily recomputing memoized values. - var mergedContext = processChildContext(workInProgress, previousContext); - instance.__reactInternalMemoizedMergedChildContext = mergedContext; - - // Replace the old (or empty) context with the new one. - // It is important to unwind the context in the reverse order. - pop(didPerformWorkStackCursor, workInProgress); - pop(contextStackCursor, workInProgress); - // Now push the new context and mark that it has changed. - push(contextStackCursor, mergedContext, workInProgress); - push(didPerformWorkStackCursor, didChange, workInProgress); - } else { - pop(didPerformWorkStackCursor, workInProgress); - push(didPerformWorkStackCursor, didChange, workInProgress); - } -} - -function resetContext() { - previousContext = emptyObject; - contextStackCursor.current = emptyObject; - didPerformWorkStackCursor.current = false; -} - -function findCurrentUnmaskedContext(fiber) { - // Currently this is only used with renderSubtreeIntoContainer; not sure if it - // makes sense elsewhere - !(isFiberMounted(fiber) && fiber.tag === ClassComponent) ? invariant(false, 'Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.') : void 0; - - var node = fiber; - while (node.tag !== HostRoot) { - if (isContextProvider(node)) { - return node.stateNode.__reactInternalMemoizedMergedChildContext; - } - var parent = node['return']; - !parent ? invariant(false, 'Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.') : void 0; - node = parent; - } - return node.stateNode.context; -} - -var NoWork = 0; // TODO: Use an opaque type once ESLint et al support the syntax - -var Sync = 1; -var Never = 2147483647; // Max int32: Math.pow(2, 31) - 1 - -var UNIT_SIZE = 10; -var MAGIC_NUMBER_OFFSET = 2; - -// 1 unit of expiration time represents 10ms. -function msToExpirationTime(ms) { - // Always add an offset so that we don't clash with the magic number for NoWork. - return (ms / UNIT_SIZE | 0) + MAGIC_NUMBER_OFFSET; -} - -function expirationTimeToMs(expirationTime) { - return (expirationTime - MAGIC_NUMBER_OFFSET) * UNIT_SIZE; -} - -function ceiling(num, precision) { - return ((num / precision | 0) + 1) * precision; -} - -function computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) { - return ceiling(currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE); -} - -var NoContext = 0; -var AsyncUpdates = 1; +var didWarnUpdateInsideUpdate = void 0; { - var hasBadMapPolyfill = false; - try { - var nonExtensibleObject = Object.preventExtensions({}); - /* eslint-disable no-new */ - - /* eslint-enable no-new */ - } catch (e) { - // TODO: Consider warning about bad polyfills - hasBadMapPolyfill = true; - } -} - -// A Fiber is work on a Component that needs to be done or was done. There can -// be more than one per component. - - -{ - var debugCounter = 1; -} - -function FiberNode(tag, key, internalContextTag) { - // Instance - this.tag = tag; - this.key = key; - this.type = null; - this.stateNode = null; - - // Fiber - this['return'] = null; - this.child = null; - this.sibling = null; - this.index = 0; - - this.ref = null; - - this.pendingProps = null; - this.memoizedProps = null; - this.updateQueue = null; - this.memoizedState = null; - - this.internalContextTag = internalContextTag; - - // Effects - this.effectTag = NoEffect; - this.nextEffect = null; - - this.firstEffect = null; - this.lastEffect = null; - - this.expirationTime = NoWork; - - this.alternate = null; - - { - this._debugID = debugCounter++; - this._debugSource = null; - this._debugOwner = null; - this._debugIsCurrentlyTiming = false; - if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') { - Object.preventExtensions(this); - } - } -} - -// This is a constructor function, rather than a POJO constructor, still -// please ensure we do the following: -// 1) Nobody should add any instance methods on this. Instance methods can be -// more difficult to predict when they get optimized and they are almost -// never inlined properly in static compilers. -// 2) Nobody should rely on `instanceof Fiber` for type testing. We should -// always know when it is a fiber. -// 3) We might want to experiment with using numeric keys since they are easier -// to optimize in a non-JIT environment. -// 4) We can easily go from a constructor to a createFiber object literal if that -// is faster. -// 5) It should be easy to port this to a C struct and keep a C implementation -// compatible. -var createFiber = function (tag, key, internalContextTag) { - // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors - return new FiberNode(tag, key, internalContextTag); -}; - -function shouldConstruct(Component) { - return !!(Component.prototype && Component.prototype.isReactComponent); -} - -// This is used to create an alternate fiber to do work on. -function createWorkInProgress(current, pendingProps, expirationTime) { - var workInProgress = current.alternate; - if (workInProgress === null) { - // We use a double buffering pooling technique because we know that we'll - // only ever need at most two versions of a tree. We pool the "other" unused - // node that we're free to reuse. This is lazily created to avoid allocating - // extra objects for things that are never updated. It also allow us to - // reclaim the extra memory if needed. - workInProgress = createFiber(current.tag, current.key, current.internalContextTag); - workInProgress.type = current.type; - workInProgress.stateNode = current.stateNode; - - { - // DEV-only fields - workInProgress._debugID = current._debugID; - workInProgress._debugSource = current._debugSource; - workInProgress._debugOwner = current._debugOwner; - } - - workInProgress.alternate = current; - current.alternate = workInProgress; - } else { - // We already have an alternate. - // Reset the effect tag. - workInProgress.effectTag = NoEffect; - - // The effect list is no longer valid. - workInProgress.nextEffect = null; - workInProgress.firstEffect = null; - workInProgress.lastEffect = null; - } - - workInProgress.expirationTime = expirationTime; - workInProgress.pendingProps = pendingProps; - - workInProgress.child = current.child; - workInProgress.memoizedProps = current.memoizedProps; - workInProgress.memoizedState = current.memoizedState; - workInProgress.updateQueue = current.updateQueue; - - // These will be overridden during the parent's reconciliation - workInProgress.sibling = current.sibling; - workInProgress.index = current.index; - workInProgress.ref = current.ref; - - return workInProgress; -} - -function createHostRootFiber() { - var fiber = createFiber(HostRoot, null, NoContext); - return fiber; -} - -function createFiberFromElement(element, internalContextTag, expirationTime) { - var owner = null; - { - owner = element._owner; - } - - var fiber = void 0; - var type = element.type, - key = element.key; - - if (typeof type === 'function') { - fiber = shouldConstruct(type) ? createFiber(ClassComponent, key, internalContextTag) : createFiber(IndeterminateComponent, key, internalContextTag); - fiber.type = type; - fiber.pendingProps = element.props; - } else if (typeof type === 'string') { - fiber = createFiber(HostComponent, key, internalContextTag); - fiber.type = type; - fiber.pendingProps = element.props; - } else if (typeof type === 'object' && type !== null && typeof type.tag === 'number') { - // Currently assumed to be a continuation and therefore is a fiber already. - // TODO: The yield system is currently broken for updates in some cases. - // The reified yield stores a fiber, but we don't know which fiber that is; - // the current or a workInProgress? When the continuation gets rendered here - // we don't know if we can reuse that fiber or if we need to clone it. - // There is probably a clever way to restructure this. - fiber = type; - fiber.pendingProps = element.props; - } else { - 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) : null; - if (ownerName) { - info += '\n\nCheck the render method of `' + ownerName + '`.'; - } - } - invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info); - } - - { - fiber._debugSource = element._source; - fiber._debugOwner = element._owner; - } - - fiber.expirationTime = expirationTime; - - return fiber; -} - -function createFiberFromFragment(elements, internalContextTag, expirationTime, key) { - var fiber = createFiber(Fragment, key, internalContextTag); - fiber.pendingProps = elements; - fiber.expirationTime = expirationTime; - return fiber; -} - -function createFiberFromText(content, internalContextTag, expirationTime) { - var fiber = createFiber(HostText, null, internalContextTag); - fiber.pendingProps = content; - fiber.expirationTime = expirationTime; - return fiber; -} - -function createFiberFromHostInstanceForDeletion() { - var fiber = createFiber(HostComponent, null, NoContext); - fiber.type = 'DELETED'; - return fiber; -} - -function createFiberFromCall(call, internalContextTag, expirationTime) { - var fiber = createFiber(CallComponent, call.key, internalContextTag); - fiber.type = call.handler; - fiber.pendingProps = call; - fiber.expirationTime = expirationTime; - return fiber; -} - -function createFiberFromReturn(returnNode, internalContextTag, expirationTime) { - var fiber = createFiber(ReturnComponent, null, internalContextTag); - fiber.expirationTime = expirationTime; - return fiber; -} - -function createFiberFromPortal(portal, internalContextTag, expirationTime) { - var fiber = createFiber(HostPortal, portal.key, internalContextTag); - fiber.pendingProps = portal.children || []; - fiber.expirationTime = expirationTime; - fiber.stateNode = { - containerInfo: portal.containerInfo, - pendingChildren: null, // Used by persistent updates - implementation: portal.implementation - }; - return fiber; -} - -function createFiberRoot(containerInfo, hydrate) { - // Cyclic construction. This cheats the type system right now because - // stateNode is any. - var uninitializedFiber = createHostRootFiber(); - var root = { - current: uninitializedFiber, - containerInfo: containerInfo, - pendingChildren: null, - remainingExpirationTime: NoWork, - isReadyForCommit: false, - finishedWork: null, - context: null, - pendingContext: null, - hydrate: hydrate, - nextScheduledRoot: null - }; - uninitializedFiber.stateNode = root; - return root; -} - -var onCommitFiberRoot = null; -var onCommitFiberUnmount = null; -var hasLoggedError = false; - -function catchErrors(fn) { - return function (arg) { - try { - return fn(arg); - } catch (err) { - if (true && !hasLoggedError) { - hasLoggedError = true; - warning(false, 'React DevTools encountered an error: %s', err); - } - } - }; -} - -function injectInternals(internals) { - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { - // No DevTools - return false; - } - var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; - if (hook.isDisabled) { - // This isn't a real property on the hook, but it can be set to opt out - // of DevTools integration and associated warnings and logs. - // https://github.com/facebook/react/issues/3877 - return true; - } - if (!hook.supportsFiber) { - { - warning(false, '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'); - } - // DevTools exists, even though it doesn't support Fiber. - return true; - } - try { - var rendererID = hook.inject(internals); - // We have successfully injected, so now it is safe to set up hooks. - onCommitFiberRoot = catchErrors(function (root) { - return hook.onCommitFiberRoot(rendererID, root); - }); - onCommitFiberUnmount = catchErrors(function (fiber) { - return hook.onCommitFiberUnmount(rendererID, fiber); - }); - } catch (err) { - // Catch all errors because it is unsafe to throw during initialization. - { - warning(false, 'React DevTools encountered an error: %s.', err); - } - } - // DevTools exists - return true; -} - -function onCommitRoot(root) { - if (typeof onCommitFiberRoot === 'function') { - onCommitFiberRoot(root); - } -} - -function onCommitUnmount(fiber) { - if (typeof onCommitFiberUnmount === 'function') { - onCommitFiberUnmount(fiber); - } -} - -{ - var didWarnUpdateInsideUpdate = false; + didWarnUpdateInsideUpdate = false; } // Callbacks are not validated until invocation @@ -16527,7 +16864,8 @@ function createUpdateQueue(baseState) { last: null, callbackList: null, hasForceUpdate: false, - isInitialized: false + isInitialized: false, + capturedValues: null }; { queue.isProcessing = false; @@ -16549,7 +16887,10 @@ function insertUpdateIntoQueue(queue, update) { } } -function insertUpdateIntoFiber(fiber, update) { +var q1 = void 0; +var q2 = void 0; +function ensureUpdateQueues(fiber) { + q1 = q2 = null; // We'll have at least one and at most two distinct update queues. var alternateFiber = fiber.alternate; var queue1 = fiber.updateQueue; @@ -16572,6 +16913,16 @@ function insertUpdateIntoFiber(fiber, update) { } queue2 = queue2 !== queue1 ? queue2 : null; + // Use module variables instead of returning a tuple + q1 = queue1; + q2 = queue2; +} + +function insertUpdateIntoFiber(fiber, update) { + ensureUpdateQueues(fiber); + var queue1 = q1; + var queue2 = q2; + // Warn if an update is scheduled from inside an updater function. { if ((queue1.isProcessing || queue2 !== null && queue2.isProcessing) && !didWarnUpdateInsideUpdate) { @@ -16602,27 +16953,23 @@ function insertUpdateIntoFiber(fiber, update) { } function getUpdateExpirationTime(fiber) { - if (fiber.tag !== ClassComponent && fiber.tag !== HostRoot) { - return NoWork; + switch (fiber.tag) { + case HostRoot: + case ClassComponent: + var updateQueue = fiber.updateQueue; + if (updateQueue === null) { + return NoWork; + } + return updateQueue.expirationTime; + default: + return NoWork; } - var updateQueue = fiber.updateQueue; - if (updateQueue === null) { - return NoWork; - } - return updateQueue.expirationTime; } function getStateFromUpdate(update, instance, prevState, props) { var partialState = update.partialState; if (typeof partialState === 'function') { - var updateFn = partialState; - - // Invoke setState callback an extra time to help detect side-effects. - if (debugRenderPhaseSideEffects) { - updateFn.call(instance, prevState, props); - } - - return updateFn.call(instance, prevState, props); + return partialState.call(instance, prevState, props); } else { return partialState; } @@ -16638,6 +16985,7 @@ function processUpdateQueue(current, workInProgress, queue, instance, props, ren first: currentQueue.first, last: currentQueue.last, isInitialized: currentQueue.isInitialized, + capturedValues: currentQueue.capturedValues, // These fields are no longer valid because they were already committed. // Reset them. callbackList: null, @@ -16698,6 +17046,12 @@ function processUpdateQueue(current, workInProgress, queue, instance, props, ren } } + // Invoke setState callback an extra time to help detect side-effects. + // Ignore the return value in this case. + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + getStateFromUpdate(update, instance, state, props); + } + // Process the update var _partialState = void 0; if (update.isReplace) { @@ -16726,12 +17080,20 @@ function processUpdateQueue(current, workInProgress, queue, instance, props, ren } _callbackList.push(update); } + if (update.capturedValue !== null) { + var _capturedValues = queue.capturedValues; + if (_capturedValues === null) { + queue.capturedValues = [update.capturedValue]; + } else { + _capturedValues.push(update.capturedValue); + } + } update = update.next; } if (queue.callbackList !== null) { workInProgress.effectTag |= Callback; - } else if (queue.first === null && !queue.hasForceUpdate) { + } else if (queue.first === null && !queue.hasForceUpdate && queue.capturedValues === null) { // The queue is empty. We can reset it. workInProgress.updateQueue = null; } @@ -16770,11 +17132,31 @@ function commitCallbacks(queue, context) { var fakeInternalInstance = {}; var isArray = Array.isArray; -{ - var didWarnAboutStateAssignmentForComponent = {}; +var didWarnAboutStateAssignmentForComponent = void 0; +var didWarnAboutUndefinedDerivedState = void 0; +var didWarnAboutUninitializedState = void 0; +var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = void 0; +var didWarnAboutLegacyLifecyclesAndDerivedState = void 0; +var warnOnInvalidCallback$1 = void 0; - var warnOnInvalidCallback = function (callback, callerName) { - warning(callback === null || typeof callback === 'function', '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback); +{ + didWarnAboutStateAssignmentForComponent = new Set(); + didWarnAboutUndefinedDerivedState = new Set(); + didWarnAboutUninitializedState = new Set(); + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); + didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); + + var didWarnOnInvalidCallback = new Set(); + + warnOnInvalidCallback$1 = function (callback, callerName) { + if (callback === null || typeof callback === 'function') { + return; + } + var key = callerName + '_' + callback; + if (!didWarnOnInvalidCallback.has(key)) { + didWarnOnInvalidCallback.add(key); + warning(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback); + } }; // This is so gross but it's at least non-critical and can be removed if @@ -16790,16 +17172,35 @@ var isArray = Array.isArray; }); Object.freeze(fakeInternalInstance); } +function callGetDerivedStateFromCatch(ctor, capturedValues) { + var resultState = {}; + for (var i = 0; i < capturedValues.length; i++) { + var capturedValue = capturedValues[i]; + var error = capturedValue.value; + var partialState = ctor.getDerivedStateFromCatch.call(null, error); + if (partialState !== null && partialState !== undefined) { + _assign(resultState, partialState); + } + } + return resultState; +} + +var ReactFiberClassComponent = function (legacyContext, scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState) { + var cacheContext = legacyContext.cacheContext, + getMaskedContext = legacyContext.getMaskedContext, + getUnmaskedContext = legacyContext.getUnmaskedContext, + isContextConsumer = legacyContext.isContextConsumer, + hasContextChanged = legacyContext.hasContextChanged; -var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState) { // Class component state updater + var updater = { isMounted: isMounted, enqueueSetState: function (instance, partialState, callback) { var fiber = get(instance); callback = callback === undefined ? null : callback; { - warnOnInvalidCallback(callback, 'setState'); + warnOnInvalidCallback$1(callback, 'setState'); } var expirationTime = computeExpirationForFiber(fiber); var update = { @@ -16808,7 +17209,7 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber callback: callback, isReplace: false, isForced: false, - nextCallback: null, + capturedValue: null, next: null }; insertUpdateIntoFiber(fiber, update); @@ -16818,7 +17219,7 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber var fiber = get(instance); callback = callback === undefined ? null : callback; { - warnOnInvalidCallback(callback, 'replaceState'); + warnOnInvalidCallback$1(callback, 'replaceState'); } var expirationTime = computeExpirationForFiber(fiber); var update = { @@ -16827,7 +17228,7 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber callback: callback, isReplace: true, isForced: false, - nextCallback: null, + capturedValue: null, next: null }; insertUpdateIntoFiber(fiber, update); @@ -16837,7 +17238,7 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber var fiber = get(instance); callback = callback === undefined ? null : callback; { - warnOnInvalidCallback(callback, 'forceUpdate'); + warnOnInvalidCallback$1(callback, 'forceUpdate'); } var expirationTime = computeExpirationForFiber(fiber); var update = { @@ -16846,7 +17247,7 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber callback: callback, isReplace: false, isForced: true, - nextCallback: null, + capturedValue: null, next: null }; insertUpdateIntoFiber(fiber, update); @@ -16861,25 +17262,20 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber } var instance = workInProgress.stateNode; - var type = workInProgress.type; + var ctor = workInProgress.type; if (typeof instance.shouldComponentUpdate === 'function') { startPhaseTimer(workInProgress, 'shouldComponentUpdate'); var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext); stopPhaseTimer(); - // Simulate an async bailout/interruption by invoking lifecycle twice. - if (debugRenderPhaseSideEffects) { - instance.shouldComponentUpdate(newProps, newState, newContext); - } - { - warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress) || 'Unknown'); + warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(workInProgress) || 'Component'); } return shouldUpdate; } - if (type.prototype && type.prototype.isPureReactComponent) { + if (ctor.prototype && ctor.prototype.isPureReactComponent) { return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); } @@ -16890,7 +17286,7 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber var instance = workInProgress.stateNode; var type = workInProgress.type; { - var name = getComponentName(workInProgress); + var name = getComponentName(workInProgress) || 'Component'; var renderPresent = instance.render; if (!renderPresent) { @@ -16920,18 +17316,31 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber warning(noComponentDidReceiveProps, '%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); var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function'; warning(noComponentWillRecieveProps, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name); + var noUnsafeComponentWillRecieveProps = typeof instance.UNSAFE_componentWillRecieveProps !== 'function'; + warning(noUnsafeComponentWillRecieveProps, '%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name); var hasMutatedProps = instance.props !== workInProgress.pendingProps; warning(instance.props === undefined || !hasMutatedProps, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name); var noInstanceDefaultProps = !instance.defaultProps; warning(noInstanceDefaultProps, '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); - } - var state = instance.state; - if (state && (typeof state !== 'object' || isArray(state))) { - warning(false, '%s.state: must be set to an object or null', getComponentName(workInProgress)); - } - if (typeof instance.getChildContext === 'function') { - warning(typeof workInProgress.type.childContextTypes === 'object', '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(workInProgress)); + if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(type)) { + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(type); + warning(false, '%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(workInProgress)); + } + + var noInstanceGetDerivedStateFromProps = typeof instance.getDerivedStateFromProps !== 'function'; + warning(noInstanceGetDerivedStateFromProps, '%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name); + var noInstanceGetDerivedStateFromCatch = typeof instance.getDerivedStateFromCatch !== 'function'; + warning(noInstanceGetDerivedStateFromCatch, '%s: getDerivedStateFromCatch() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name); + var noStaticGetSnapshotBeforeUpdate = typeof type.getSnapshotBeforeUpdate !== 'function'; + warning(noStaticGetSnapshotBeforeUpdate, '%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))) { + warning(false, '%s.state: must be set to an object or null', name); + } + if (typeof instance.getChildContext === 'function') { + warning(typeof type.childContextTypes === 'object', '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name); + } } } @@ -16955,9 +17364,69 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber var unmaskedContext = getUnmaskedContext(workInProgress); var needsContext = isContextConsumer(workInProgress); var context = needsContext ? getMaskedContext(workInProgress, unmaskedContext) : emptyObject; + + // Instantiate twice to help detect side-effects. + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + new ctor(props, context); // eslint-disable-line no-new + } + var instance = new ctor(props, context); + var state = instance.state !== null && instance.state !== undefined ? instance.state : null; adoptClassInstance(workInProgress, instance); + { + if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) { + var componentName = getComponentName(workInProgress) || 'Component'; + if (!didWarnAboutUninitializedState.has(componentName)) { + didWarnAboutUninitializedState.add(componentName); + warning(false, '%s: Did not properly initialize state during construction. ' + 'Expected state to be an object, but it was %s.', componentName, instance.state === null ? 'null' : 'undefined'); + } + } + + // If new component APIs are defined, "unsafe" lifecycles won't be called. + // Warn about these lifecycles if they are present. + // Don't warn about react-lifecycles-compat polyfilled methods though. + 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(workInProgress) || 'Component'; + var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()'; + if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) { + didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName); + warning(false, '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-async-component-lifecycle-hooks', _componentName, newApiName, foundWillMountName !== null ? '\n ' + foundWillMountName : '', foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '', foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : ''); + } + } + } + } + + workInProgress.memoizedState = state; + + var partialState = callGetDerivedStateFromProps(workInProgress, instance, props, state); + + if (partialState !== null && partialState !== undefined) { + // Render-phase updates (like this) should not be added to the update queue, + // So that multiple render passes do not enqueue multiple updates. + // Instead, just synchronously merge the returned state into the instance. + workInProgress.memoizedState = _assign({}, workInProgress.memoizedState, partialState); + } + // Cache unmasked context so we can avoid recreating masked context unless necessary. // ReactFiberContext usually updates this cache but can't for newly-created instances. if (needsContext) { @@ -16970,47 +17439,76 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber function callComponentWillMount(workInProgress, instance) { startPhaseTimer(workInProgress, 'componentWillMount'); var oldState = instance.state; - instance.componentWillMount(); - stopPhaseTimer(); - // Simulate an async bailout/interruption by invoking lifecycle twice. - if (debugRenderPhaseSideEffects) { + if (typeof instance.componentWillMount === 'function') { instance.componentWillMount(); } + if (typeof instance.UNSAFE_componentWillMount === 'function') { + instance.UNSAFE_componentWillMount(); + } + + stopPhaseTimer(); if (oldState !== instance.state) { { - warning(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress)); + warning(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress) || 'Component'); } updater.enqueueReplaceState(instance, instance.state, null); } } function callComponentWillReceiveProps(workInProgress, instance, newProps, newContext) { - startPhaseTimer(workInProgress, 'componentWillReceiveProps'); var oldState = instance.state; - instance.componentWillReceiveProps(newProps, newContext); - stopPhaseTimer(); - - // Simulate an async bailout/interruption by invoking lifecycle twice. - if (debugRenderPhaseSideEffects) { + startPhaseTimer(workInProgress, 'componentWillReceiveProps'); + if (typeof instance.componentWillReceiveProps === 'function') { instance.componentWillReceiveProps(newProps, newContext); } + if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { + instance.UNSAFE_componentWillReceiveProps(newProps, newContext); + } + stopPhaseTimer(); if (instance.state !== oldState) { { var componentName = getComponentName(workInProgress) || 'Component'; - if (!didWarnAboutStateAssignmentForComponent[componentName]) { + if (!didWarnAboutStateAssignmentForComponent.has(componentName)) { + didWarnAboutStateAssignmentForComponent.add(componentName); warning(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName); - didWarnAboutStateAssignmentForComponent[componentName] = true; } } updater.enqueueReplaceState(instance, instance.state, null); } } + function callGetDerivedStateFromProps(workInProgress, instance, nextProps, prevState) { + var type = workInProgress.type; + + + if (typeof type.getDerivedStateFromProps === 'function') { + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + // Invoke method an extra time to help detect side-effects. + type.getDerivedStateFromProps.call(null, nextProps, prevState); + } + + var partialState = type.getDerivedStateFromProps.call(null, nextProps, prevState); + + { + if (partialState === undefined) { + var componentName = getComponentName(workInProgress) || 'Component'; + if (!didWarnAboutUndefinedDerivedState.has(componentName)) { + didWarnAboutUndefinedDerivedState.add(componentName); + warning(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName); + } + } + } + + return partialState; + } + } + // Invokes the mount life-cycles on a previously never rendered instance. function mountClassInstance(workInProgress, renderExpirationTime) { + var ctor = workInProgress.type; var current = workInProgress.alternate; { @@ -17018,23 +17516,27 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber } var instance = workInProgress.stateNode; - var state = instance.state || null; - var props = workInProgress.pendingProps; - !props ? invariant(false, 'There must be pending props for an initial mount. This error is likely caused by a bug in React. Please file an issue.') : void 0; - var unmaskedContext = getUnmaskedContext(workInProgress); instance.props = props; - instance.state = workInProgress.memoizedState = state; + instance.state = workInProgress.memoizedState; instance.refs = emptyObject; instance.context = getMaskedContext(workInProgress, unmaskedContext); - if (enableAsyncSubtreeAPI && workInProgress.type != null && workInProgress.type.prototype != null && workInProgress.type.prototype.unstable_isAsyncReactComponent === true) { - workInProgress.internalContextTag |= AsyncUpdates; + { + if (workInProgress.mode & StrictMode) { + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance); + } + + if (warnAboutDeprecatedLifecycles) { + ReactStrictModeWarnings.recordDeprecationWarnings(workInProgress, instance); + } } - if (typeof instance.componentWillMount === 'function') { + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) { callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's // process them now. @@ -17048,146 +17550,217 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber } } - // Called on a preexisting class instance. Returns false if a resumed render - // could be reused. - // function resumeMountClassInstance( - // workInProgress: Fiber, - // priorityLevel: PriorityLevel, - // ): boolean { - // const instance = workInProgress.stateNode; - // resetInputPointers(workInProgress, instance); - - // let newState = workInProgress.memoizedState; - // let newProps = workInProgress.pendingProps; - // if (!newProps) { - // // If there isn't any new props, then we'll reuse the memoized props. - // // This could be from already completed work. - // newProps = workInProgress.memoizedProps; - // invariant( - // newProps != null, - // 'There should always be pending or memoized props. This error is ' + - // 'likely caused by a bug in React. Please file an issue.', - // ); - // } - // const newUnmaskedContext = getUnmaskedContext(workInProgress); - // const newContext = getMaskedContext(workInProgress, newUnmaskedContext); - - // const oldContext = instance.context; - // const oldProps = workInProgress.memoizedProps; - - // if ( - // typeof instance.componentWillReceiveProps === 'function' && - // (oldProps !== newProps || oldContext !== newContext) - // ) { - // callComponentWillReceiveProps( - // workInProgress, - // instance, - // newProps, - // newContext, - // ); - // } - - // // Process the update queue before calling shouldComponentUpdate - // const updateQueue = workInProgress.updateQueue; - // if (updateQueue !== null) { - // newState = processUpdateQueue( - // workInProgress, - // updateQueue, - // instance, - // newState, - // newProps, - // priorityLevel, - // ); - // } - - // // TODO: Should we deal with a setState that happened after the last - // // componentWillMount and before this componentWillMount? Probably - // // unsupported anyway. - - // if ( - // !checkShouldComponentUpdate( - // workInProgress, - // workInProgress.memoizedProps, - // newProps, - // workInProgress.memoizedState, - // newState, - // newContext, - // ) - // ) { - // // Update the existing instance's state, props, and context pointers even - // // though we're bailing out. - // instance.props = newProps; - // instance.state = newState; - // instance.context = newContext; - // return false; - // } - - // // Update the input pointers now so that they are correct when we call - // // componentWillMount - // instance.props = newProps; - // instance.state = newState; - // instance.context = newContext; - - // if (typeof instance.componentWillMount === 'function') { - // callComponentWillMount(workInProgress, instance); - // // componentWillMount may have called setState. Process the update queue. - // const newUpdateQueue = workInProgress.updateQueue; - // if (newUpdateQueue !== null) { - // newState = processUpdateQueue( - // workInProgress, - // newUpdateQueue, - // instance, - // newState, - // newProps, - // priorityLevel, - // ); - // } - // } - - // if (typeof instance.componentDidMount === 'function') { - // workInProgress.effectTag |= Update; - // } - - // instance.state = newState; - - // return true; - // } - - // Invokes the update life-cycles and returns false if it shouldn't rerender. - function updateClassInstance(current, workInProgress, renderExpirationTime) { + function resumeMountClassInstance(workInProgress, renderExpirationTime) { + var ctor = workInProgress.type; var instance = workInProgress.stateNode; resetInputPointers(workInProgress, instance); var oldProps = workInProgress.memoizedProps; var newProps = workInProgress.pendingProps; - if (!newProps) { - // If there aren't any new props, then we'll reuse the memoized props. - // This could be from already completed work. - newProps = oldProps; - !(newProps != null) ? invariant(false, 'There should always be pending or memoized props. This error is likely caused by a bug in React. Please file an issue.') : void 0; - } var oldContext = instance.context; var newUnmaskedContext = getUnmaskedContext(workInProgress); var newContext = getMaskedContext(workInProgress, newUnmaskedContext); + var hasNewLifecycles = typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; + // Note: During these life-cycles, instance.props/instance.state are what // ever the previously attempted to render - not the "current". However, // during componentDidUpdate we pass the "current" props. - if (typeof instance.componentWillReceiveProps === 'function' && (oldProps !== newProps || oldContext !== newContext)) { - callComponentWillReceiveProps(workInProgress, instance, newProps, newContext); + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { + if (oldProps !== newProps || oldContext !== newContext) { + callComponentWillReceiveProps(workInProgress, instance, newProps, newContext); + } } // Compute the next state using the memoized state and the update queue. var oldState = workInProgress.memoizedState; // TODO: Previous state can be null. var newState = void 0; + var derivedStateFromCatch = void 0; if (workInProgress.updateQueue !== null) { - newState = processUpdateQueue(current, workInProgress, workInProgress.updateQueue, instance, newProps, renderExpirationTime); + newState = processUpdateQueue(null, workInProgress, workInProgress.updateQueue, instance, newProps, renderExpirationTime); + + var updateQueue = workInProgress.updateQueue; + if (updateQueue !== null && updateQueue.capturedValues !== null && enableGetDerivedStateFromCatch && typeof ctor.getDerivedStateFromCatch === 'function') { + var capturedValues = updateQueue.capturedValues; + // Don't remove these from the update queue yet. We need them in + // finishClassComponent. Do the reset there. + // TODO: This is awkward. Refactor class components. + // updateQueue.capturedValues = null; + derivedStateFromCatch = callGetDerivedStateFromCatch(ctor, capturedValues); + } } else { newState = oldState; } + var derivedStateFromProps = void 0; + if (oldProps !== newProps) { + // The prevState parameter should be the partially updated state. + // Otherwise, spreading state in return values could override updates. + derivedStateFromProps = callGetDerivedStateFromProps(workInProgress, instance, newProps, newState); + } + + if (derivedStateFromProps !== null && derivedStateFromProps !== undefined) { + // Render-phase updates (like this) should not be added to the update queue, + // So that multiple render passes do not enqueue multiple updates. + // Instead, just synchronously merge the returned state into the instance. + newState = newState === null || newState === undefined ? derivedStateFromProps : _assign({}, newState, derivedStateFromProps); + + // Update the base state of the update queue. + // FIXME: This is getting ridiculous. Refactor plz! + var _updateQueue = workInProgress.updateQueue; + if (_updateQueue !== null) { + _updateQueue.baseState = _assign({}, _updateQueue.baseState, derivedStateFromProps); + } + } + if (derivedStateFromCatch !== null && derivedStateFromCatch !== undefined) { + // Render-phase updates (like this) should not be added to the update queue, + // So that multiple render passes do not enqueue multiple updates. + // Instead, just synchronously merge the returned state into the instance. + newState = newState === null || newState === undefined ? derivedStateFromCatch : _assign({}, newState, derivedStateFromCatch); + + // Update the base state of the update queue. + // FIXME: This is getting ridiculous. Refactor plz! + var _updateQueue2 = workInProgress.updateQueue; + if (_updateQueue2 !== null) { + _updateQueue2.baseState = _assign({}, _updateQueue2.baseState, derivedStateFromCatch); + } + } + + if (oldProps === newProps && oldState === newState && !hasContextChanged() && !(workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate)) { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidMount === 'function') { + workInProgress.effectTag |= Update; + } + return false; + } + + var shouldUpdate = checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext); + + if (shouldUpdate) { + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + 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 an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidMount === 'function') { + workInProgress.effectTag |= Update; + } + + // If shouldComponentUpdate returned false, we should still update the + // memoized props/state to indicate that this work can be reused. + memoizeProps(workInProgress, newProps); + memoizeState(workInProgress, newState); + } + + // Update the existing instance's state, props, and context pointers even + // if shouldComponentUpdate returns false. + instance.props = newProps; + instance.state = newState; + instance.context = newContext; + + return shouldUpdate; + } + + // Invokes the update life-cycles and returns false if it shouldn't rerender. + function updateClassInstance(current, workInProgress, renderExpirationTime) { + var ctor = workInProgress.type; + var instance = workInProgress.stateNode; + resetInputPointers(workInProgress, instance); + + var oldProps = workInProgress.memoizedProps; + var newProps = workInProgress.pendingProps; + var oldContext = instance.context; + var newUnmaskedContext = getUnmaskedContext(workInProgress); + var newContext = getMaskedContext(workInProgress, newUnmaskedContext); + + var hasNewLifecycles = typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; + + // Note: During these life-cycles, instance.props/instance.state are what + // ever the previously attempted to render - not the "current". However, + // during componentDidUpdate we pass the "current" props. + + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { + if (oldProps !== newProps || oldContext !== newContext) { + callComponentWillReceiveProps(workInProgress, instance, newProps, newContext); + } + } + + // Compute the next state using the memoized state and the update queue. + var oldState = workInProgress.memoizedState; + // TODO: Previous state can be null. + var newState = void 0; + var derivedStateFromCatch = void 0; + + if (workInProgress.updateQueue !== null) { + newState = processUpdateQueue(current, workInProgress, workInProgress.updateQueue, instance, newProps, renderExpirationTime); + + var updateQueue = workInProgress.updateQueue; + if (updateQueue !== null && updateQueue.capturedValues !== null && enableGetDerivedStateFromCatch && typeof ctor.getDerivedStateFromCatch === 'function') { + var capturedValues = updateQueue.capturedValues; + // Don't remove these from the update queue yet. We need them in + // finishClassComponent. Do the reset there. + // TODO: This is awkward. Refactor class components. + // updateQueue.capturedValues = null; + derivedStateFromCatch = callGetDerivedStateFromCatch(ctor, capturedValues); + } + } else { + newState = oldState; + } + + var derivedStateFromProps = void 0; + if (oldProps !== newProps) { + // The prevState parameter should be the partially updated state. + // Otherwise, spreading state in return values could override updates. + derivedStateFromProps = callGetDerivedStateFromProps(workInProgress, instance, newProps, newState); + } + + if (derivedStateFromProps !== null && derivedStateFromProps !== undefined) { + // Render-phase updates (like this) should not be added to the update queue, + // So that multiple render passes do not enqueue multiple updates. + // Instead, just synchronously merge the returned state into the instance. + newState = newState === null || newState === undefined ? derivedStateFromProps : _assign({}, newState, derivedStateFromProps); + + // Update the base state of the update queue. + // FIXME: This is getting ridiculous. Refactor plz! + var _updateQueue3 = workInProgress.updateQueue; + if (_updateQueue3 !== null) { + _updateQueue3.baseState = _assign({}, _updateQueue3.baseState, derivedStateFromProps); + } + } + if (derivedStateFromCatch !== null && derivedStateFromCatch !== undefined) { + // Render-phase updates (like this) should not be added to the update queue, + // So that multiple render passes do not enqueue multiple updates. + // Instead, just synchronously merge the returned state into the instance. + newState = newState === null || newState === undefined ? derivedStateFromCatch : _assign({}, newState, derivedStateFromCatch); + + // Update the base state of the update queue. + // FIXME: This is getting ridiculous. Refactor plz! + var _updateQueue4 = workInProgress.updateQueue; + if (_updateQueue4 !== null) { + _updateQueue4.baseState = _assign({}, _updateQueue4.baseState, derivedStateFromCatch); + } + } + if (oldProps === newProps && oldState === newState && !hasContextChanged() && !(workInProgress.updateQueue !== null && workInProgress.updateQueue.hasForceUpdate)) { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. @@ -17196,25 +17769,35 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber workInProgress.effectTag |= Update; } } + if (typeof instance.getSnapshotBeforeUpdate === 'function') { + if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.effectTag |= Snapshot; + } + } return false; } var shouldUpdate = checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext); if (shouldUpdate) { - if (typeof instance.componentWillUpdate === 'function') { + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) { startPhaseTimer(workInProgress, 'componentWillUpdate'); - instance.componentWillUpdate(newProps, newState, newContext); - stopPhaseTimer(); - - // Simulate an async bailout/interruption by invoking lifecycle twice. - if (debugRenderPhaseSideEffects) { + if (typeof instance.componentWillUpdate === 'function') { instance.componentWillUpdate(newProps, newState, newContext); } + if (typeof instance.UNSAFE_componentWillUpdate === 'function') { + instance.UNSAFE_componentWillUpdate(newProps, newState, newContext); + } + stopPhaseTimer(); } if (typeof instance.componentDidUpdate === 'function') { workInProgress.effectTag |= Update; } + if (typeof instance.getSnapshotBeforeUpdate === 'function') { + workInProgress.effectTag |= Snapshot; + } } else { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. @@ -17223,6 +17806,11 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber workInProgress.effectTag |= Update; } } + if (typeof instance.getSnapshotBeforeUpdate === 'function') { + if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.effectTag |= Snapshot; + } + } // If shouldComponentUpdate returned false, we should still update the // memoized props/state to indicate that this work can be reused. @@ -17241,51 +17829,36 @@ var ReactFiberClassComponent = function (scheduleWork, computeExpirationForFiber return { adoptClassInstance: adoptClassInstance, + callGetDerivedStateFromProps: callGetDerivedStateFromProps, constructClassInstance: constructClassInstance, mountClassInstance: mountClassInstance, - // resumeMountClassInstance, + resumeMountClassInstance: resumeMountClassInstance, updateClassInstance: updateClassInstance }; }; -// The Symbol used to tag the ReactElement-like types. If there is no native Symbol -// nor polyfill, then a plain number is used for performance. -var hasSymbol = typeof Symbol === 'function' && Symbol['for']; +var getCurrentFiberStackAddendum$2 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum; -var REACT_ELEMENT_TYPE = hasSymbol ? Symbol['for']('react.element') : 0xeac7; -var REACT_CALL_TYPE = hasSymbol ? Symbol['for']('react.call') : 0xeac8; -var REACT_RETURN_TYPE = hasSymbol ? Symbol['for']('react.return') : 0xeac9; -var REACT_PORTAL_TYPE = hasSymbol ? Symbol['for']('react.portal') : 0xeaca; -var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol['for']('react.fragment') : 0xeacb; - -var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; -var FAUX_ITERATOR_SYMBOL = '@@iterator'; - -function getIteratorFn(maybeIterable) { - if (maybeIterable === null || typeof maybeIterable === 'undefined') { - return null; - } - var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - if (typeof maybeIterator === 'function') { - return maybeIterator; - } - return null; -} - -var getCurrentFiberStackAddendum$1 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum; +var didWarnAboutMaps = void 0; +var didWarnAboutStringRefInStrictMode = void 0; +var ownerHasKeyUseWarning = void 0; +var ownerHasFunctionTypeWarning = void 0; +var warnForMissingKey = function (child) {}; { - var didWarnAboutMaps = false; + didWarnAboutMaps = false; + didWarnAboutStringRefInStrictMode = {}; + /** * Warn if there's no key explicitly set on dynamic arrays of children or * object keys are not valid. This allows us to keep track of children between * updates. */ - var ownerHasKeyUseWarning = {}; - var ownerHasFunctionTypeWarning = {}; + ownerHasKeyUseWarning = {}; + ownerHasFunctionTypeWarning = {}; - var warnForMissingKey = function (child) { + warnForMissingKey = function (child) { if (child === null || typeof child !== 'object') { return; } @@ -17295,21 +17868,31 @@ var getCurrentFiberStackAddendum$1 = ReactDebugCurrentFiber.getCurrentFiberStack !(typeof child._store === 'object') ? invariant(false, 'React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.') : void 0; child._store.validated = true; - var currentComponentErrorInfo = 'Each child in an array or iterator should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + (getCurrentFiberStackAddendum$1() || ''); + var currentComponentErrorInfo = 'Each child in an array or iterator should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + (getCurrentFiberStackAddendum$2() || ''); if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { return; } ownerHasKeyUseWarning[currentComponentErrorInfo] = true; - warning(false, 'Each child in an array or iterator should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.%s', getCurrentFiberStackAddendum$1()); + warning(false, 'Each child in an array or iterator should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.%s', getCurrentFiberStackAddendum$2()); }; } var isArray$1 = Array.isArray; -function coerceRef(current, element) { +function coerceRef(returnFiber, current, element) { var mixedRef = element.ref; - if (mixedRef !== null && typeof mixedRef !== 'function') { + if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') { + { + if (returnFiber.mode & StrictMode) { + var componentName = getComponentName(returnFiber) || 'Component'; + if (!didWarnAboutStringRefInStrictMode[componentName]) { + warning(false, '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 createRef() instead.' + '\n%s' + '\n\nLearn more about using refs safely here:' + '\nhttps://fb.me/react-strict-mode-string-ref', mixedRef, getStackAddendumByWorkInProgressFiber(returnFiber)); + didWarnAboutStringRefInStrictMode[componentName] = true; + } + } + } + if (element._owner) { var owner = element._owner; var inst = void 0; @@ -17336,7 +17919,7 @@ function coerceRef(current, element) { return ref; } else { !(typeof mixedRef === 'string') ? invariant(false, 'Expected ref to be a function or a string.') : void 0; - !element._owner ? invariant(false, 'Element ref was specified as a string (%s) but no owner was set. You may have multiple copies of React loaded. (details: https://fb.me/react-refs-must-have-owner).', mixedRef) : void 0; + !element._owner ? invariant(false, 'Element ref was specified as a string (%s) but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a functional 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.', mixedRef) : void 0; } } return mixedRef; @@ -17346,21 +17929,21 @@ function throwOnInvalidObjectType(returnFiber, newChild) { if (returnFiber.type !== 'textarea') { var addendum = ''; { - addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + (getCurrentFiberStackAddendum$1() || ''); + addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + (getCurrentFiberStackAddendum$2() || ''); } invariant(false, 'Objects are not valid as a React child (found: %s).%s', 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 from render. ' + 'Or maybe you meant to call this function rather than return it.' + (getCurrentFiberStackAddendum$1() || ''); + var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of from render. ' + 'Or maybe you meant to call this function rather than return it.' + (getCurrentFiberStackAddendum$2() || ''); if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) { return; } ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true; - warning(false, 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of from render. ' + 'Or maybe you meant to call this function rather than return it.%s', getCurrentFiberStackAddendum$1() || ''); + warning(false, 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of from render. ' + 'Or maybe you meant to call this function rather than return it.%s', getCurrentFiberStackAddendum$2() || ''); } // This wrapper function exists because I expect to clone the code in each path @@ -17467,7 +18050,7 @@ function ChildReconciler(shouldTrackSideEffects) { function updateTextNode(returnFiber, current, textContent, expirationTime) { if (current === null || current.tag !== HostText) { // Insert - var created = createFiberFromText(textContent, returnFiber.internalContextTag, expirationTime); + var created = createFiberFromText(textContent, returnFiber.mode, expirationTime); created['return'] = returnFiber; return created; } else { @@ -17482,7 +18065,7 @@ function ChildReconciler(shouldTrackSideEffects) { if (current !== null && current.type === element.type) { // Move based on index var existing = useFiber(current, element.props, expirationTime); - existing.ref = coerceRef(current, element); + existing.ref = coerceRef(returnFiber, current, element); existing['return'] = returnFiber; { existing._debugSource = element._source; @@ -17491,48 +18074,17 @@ function ChildReconciler(shouldTrackSideEffects) { return existing; } else { // Insert - var created = createFiberFromElement(element, returnFiber.internalContextTag, expirationTime); - created.ref = coerceRef(current, element); + var created = createFiberFromElement(element, returnFiber.mode, expirationTime); + created.ref = coerceRef(returnFiber, current, element); created['return'] = returnFiber; return created; } } - function updateCall(returnFiber, current, call, expirationTime) { - // TODO: Should this also compare handler to determine whether to reuse? - if (current === null || current.tag !== CallComponent) { - // Insert - var created = createFiberFromCall(call, returnFiber.internalContextTag, expirationTime); - created['return'] = returnFiber; - return created; - } else { - // Move based on index - var existing = useFiber(current, call, expirationTime); - existing['return'] = returnFiber; - return existing; - } - } - - function updateReturn(returnFiber, current, returnNode, expirationTime) { - if (current === null || current.tag !== ReturnComponent) { - // Insert - var created = createFiberFromReturn(returnNode, returnFiber.internalContextTag, expirationTime); - created.type = returnNode.value; - created['return'] = returnFiber; - return created; - } else { - // Move based on index - var existing = useFiber(current, null, expirationTime); - existing.type = returnNode.value; - existing['return'] = returnFiber; - return existing; - } - } - function updatePortal(returnFiber, current, portal, expirationTime) { if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) { // Insert - var created = createFiberFromPortal(portal, returnFiber.internalContextTag, expirationTime); + var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime); created['return'] = returnFiber; return created; } else { @@ -17546,7 +18098,7 @@ function ChildReconciler(shouldTrackSideEffects) { function updateFragment(returnFiber, current, fragment, expirationTime, key) { if (current === null || current.tag !== Fragment) { // Insert - var created = createFiberFromFragment(fragment, returnFiber.internalContextTag, expirationTime, key); + var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key); created['return'] = returnFiber; return created; } else { @@ -17562,7 +18114,7 @@ function ChildReconciler(shouldTrackSideEffects) { // Text nodes don't have keys. If the previous node is implicitly keyed // we can continue to replace it without aborting even if it is not a text // node. - var created = createFiberFromText('' + newChild, returnFiber.internalContextTag, expirationTime); + var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime); created['return'] = returnFiber; return created; } @@ -17571,45 +18123,23 @@ function ChildReconciler(shouldTrackSideEffects) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: { - if (newChild.type === REACT_FRAGMENT_TYPE) { - var _created = createFiberFromFragment(newChild.props.children, returnFiber.internalContextTag, expirationTime, newChild.key); - _created['return'] = returnFiber; - return _created; - } else { - var _created2 = createFiberFromElement(newChild, returnFiber.internalContextTag, expirationTime); - _created2.ref = coerceRef(null, newChild); - _created2['return'] = returnFiber; - return _created2; - } + var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime); + _created.ref = coerceRef(returnFiber, null, newChild); + _created['return'] = returnFiber; + return _created; } - - case REACT_CALL_TYPE: - { - var _created3 = createFiberFromCall(newChild, returnFiber.internalContextTag, expirationTime); - _created3['return'] = returnFiber; - return _created3; - } - - case REACT_RETURN_TYPE: - { - var _created4 = createFiberFromReturn(newChild, returnFiber.internalContextTag, expirationTime); - _created4.type = newChild.value; - _created4['return'] = returnFiber; - return _created4; - } - case REACT_PORTAL_TYPE: { - var _created5 = createFiberFromPortal(newChild, returnFiber.internalContextTag, expirationTime); - _created5['return'] = returnFiber; - return _created5; + var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime); + _created2['return'] = returnFiber; + return _created2; } } if (isArray$1(newChild) || getIteratorFn(newChild)) { - var _created6 = createFiberFromFragment(newChild, returnFiber.internalContextTag, expirationTime, null); - _created6['return'] = returnFiber; - return _created6; + var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null); + _created3['return'] = returnFiber; + return _created3; } throwOnInvalidObjectType(returnFiber, newChild); @@ -17652,28 +18182,6 @@ function ChildReconciler(shouldTrackSideEffects) { return null; } } - - case REACT_CALL_TYPE: - { - if (newChild.key === key) { - return updateCall(returnFiber, oldFiber, newChild, expirationTime); - } else { - return null; - } - } - - case REACT_RETURN_TYPE: - { - // Returns don't have keys. If the previous node is implicitly keyed - // we can continue to replace it without aborting even if it is not a - // yield. - if (key === null) { - return updateReturn(returnFiber, oldFiber, newChild, expirationTime); - } else { - return null; - } - } - case REACT_PORTAL_TYPE: { if (newChild.key === key) { @@ -17722,31 +18230,16 @@ function ChildReconciler(shouldTrackSideEffects) { } return updateElement(returnFiber, _matchedFiber, newChild, expirationTime); } - - case REACT_CALL_TYPE: - { - var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; - return updateCall(returnFiber, _matchedFiber2, newChild, expirationTime); - } - - case REACT_RETURN_TYPE: - { - // Returns don't have keys, so we neither have to check the old nor - // new node for the key. If both are returns, they match. - var _matchedFiber3 = existingChildren.get(newIdx) || null; - return updateReturn(returnFiber, _matchedFiber3, newChild, expirationTime); - } - case REACT_PORTAL_TYPE: { - var _matchedFiber4 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; - return updatePortal(returnFiber, _matchedFiber4, newChild, expirationTime); + var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; + return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime); } } if (isArray$1(newChild) || getIteratorFn(newChild)) { - var _matchedFiber5 = existingChildren.get(newIdx) || null; - return updateFragment(returnFiber, _matchedFiber5, newChild, expirationTime, null); + var _matchedFiber3 = existingChildren.get(newIdx) || null; + return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null); } throwOnInvalidObjectType(returnFiber, newChild); @@ -17771,7 +18264,6 @@ function ChildReconciler(shouldTrackSideEffects) { } switch (child.$$typeof) { case REACT_ELEMENT_TYPE: - case REACT_CALL_TYPE: case REACT_PORTAL_TYPE: warnForMissingKey(child); var key = child.key; @@ -17787,7 +18279,7 @@ function ChildReconciler(shouldTrackSideEffects) { knownKeys.add(key); break; } - warning(false, '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.%s', key, getCurrentFiberStackAddendum$1()); + warning(false, '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.%s', key, getCurrentFiberStackAddendum$2()); break; default: break; @@ -17947,7 +18439,7 @@ function ChildReconciler(shouldTrackSideEffects) { if (typeof newChildrenIterable.entries === 'function') { var possibleMap = newChildrenIterable; if (possibleMap.entries === iteratorFn) { - warning(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', getCurrentFiberStackAddendum$1()); + warning(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', getCurrentFiberStackAddendum$2()); didWarnAboutMaps = true; } } @@ -18094,7 +18586,7 @@ function ChildReconciler(shouldTrackSideEffects) { // The existing first child is not a text node so we need to create one // and delete the existing ones. deleteRemainingChildren(returnFiber, currentFirstChild); - var created = createFiberFromText(textContent, returnFiber.internalContextTag, expirationTime); + var created = createFiberFromText(textContent, returnFiber.mode, expirationTime); created['return'] = returnFiber; return created; } @@ -18109,7 +18601,7 @@ function ChildReconciler(shouldTrackSideEffects) { if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.type === element.type) { deleteRemainingChildren(returnFiber, child.sibling); var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime); - existing.ref = coerceRef(child, element); + existing.ref = coerceRef(returnFiber, child, element); existing['return'] = returnFiber; { existing._debugSource = element._source; @@ -18127,65 +18619,17 @@ function ChildReconciler(shouldTrackSideEffects) { } if (element.type === REACT_FRAGMENT_TYPE) { - var created = createFiberFromFragment(element.props.children, returnFiber.internalContextTag, expirationTime, element.key); + var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key); created['return'] = returnFiber; return created; } else { - var _created7 = createFiberFromElement(element, returnFiber.internalContextTag, expirationTime); - _created7.ref = coerceRef(currentFirstChild, element); - _created7['return'] = returnFiber; - return _created7; + var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime); + _created4.ref = coerceRef(returnFiber, currentFirstChild, element); + _created4['return'] = returnFiber; + return _created4; } } - function reconcileSingleCall(returnFiber, currentFirstChild, call, expirationTime) { - var key = call.key; - var child = currentFirstChild; - while (child !== null) { - // TODO: If key === null and child.key === null, then this only applies to - // the first item in the list. - if (child.key === key) { - if (child.tag === CallComponent) { - deleteRemainingChildren(returnFiber, child.sibling); - var existing = useFiber(child, call, expirationTime); - existing['return'] = returnFiber; - return existing; - } else { - deleteRemainingChildren(returnFiber, child); - break; - } - } else { - deleteChild(returnFiber, child); - } - child = child.sibling; - } - - var created = createFiberFromCall(call, returnFiber.internalContextTag, expirationTime); - created['return'] = returnFiber; - return created; - } - - function reconcileSingleReturn(returnFiber, currentFirstChild, returnNode, expirationTime) { - // There's no need to check for keys on yields since they're stateless. - var child = currentFirstChild; - if (child !== null) { - if (child.tag === ReturnComponent) { - deleteRemainingChildren(returnFiber, child.sibling); - var existing = useFiber(child, null, expirationTime); - existing.type = returnNode.value; - existing['return'] = returnFiber; - return existing; - } else { - deleteRemainingChildren(returnFiber, child); - } - } - - var created = createFiberFromReturn(returnNode, returnFiber.internalContextTag, expirationTime); - created.type = returnNode.value; - created['return'] = returnFiber; - return created; - } - function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) { var key = portal.key; var child = currentFirstChild; @@ -18208,7 +18652,7 @@ function ChildReconciler(shouldTrackSideEffects) { child = child.sibling; } - var created = createFiberFromPortal(portal, returnFiber.internalContextTag, expirationTime); + var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime); created['return'] = returnFiber; return created; } @@ -18236,11 +18680,6 @@ function ChildReconciler(shouldTrackSideEffects) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime)); - - case REACT_CALL_TYPE: - return placeSingleChild(reconcileSingleCall(returnFiber, currentFirstChild, newChild, expirationTime)); - case REACT_RETURN_TYPE: - return placeSingleChild(reconcileSingleReturn(returnFiber, currentFirstChild, newChild, expirationTime)); case REACT_PORTAL_TYPE: return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime)); } @@ -18323,24 +18762,38 @@ function cloneChildFibers(current, workInProgress) { newChild.sibling = null; } +var didWarnAboutBadClass = void 0; +var didWarnAboutGetDerivedStateOnFunctionalComponent = void 0; +var didWarnAboutStatelessRefs = void 0; + { - var warnedAboutStatelessRefs = {}; + didWarnAboutBadClass = {}; + didWarnAboutGetDerivedStateOnFunctionalComponent = {}; + didWarnAboutStatelessRefs = {}; } -var ReactFiberBeginWork = function (config, hostContext, hydrationContext, scheduleWork, computeExpirationForFiber) { +var ReactFiberBeginWork = function (config, hostContext, legacyContext, newContext, hydrationContext, scheduleWork, computeExpirationForFiber) { var shouldSetTextContent = config.shouldSetTextContent, - useSyncScheduling = config.useSyncScheduling, shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree; var pushHostContext = hostContext.pushHostContext, pushHostContainer = hostContext.pushHostContainer; + var pushProvider = newContext.pushProvider; + var getMaskedContext = legacyContext.getMaskedContext, + getUnmaskedContext = legacyContext.getUnmaskedContext, + hasLegacyContextChanged = legacyContext.hasContextChanged, + pushLegacyContextProvider = legacyContext.pushContextProvider, + pushTopLevelContextObject = legacyContext.pushTopLevelContextObject, + invalidateContextProvider = legacyContext.invalidateContextProvider; var enterHydrationState = hydrationContext.enterHydrationState, resetHydrationState = hydrationContext.resetHydrationState, tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance; - var _ReactFiberClassCompo = ReactFiberClassComponent(scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState), + var _ReactFiberClassCompo = ReactFiberClassComponent(legacyContext, scheduleWork, computeExpirationForFiber, memoizeProps, memoizeState), adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance, + callGetDerivedStateFromProps = _ReactFiberClassCompo.callGetDerivedStateFromProps, constructClassInstance = _ReactFiberClassCompo.constructClassInstance, mountClassInstance = _ReactFiberClassCompo.mountClassInstance, + resumeMountClassInstance = _ReactFiberClassCompo.resumeMountClassInstance, updateClassInstance = _ReactFiberClassCompo.updateClassInstance; // TODO: Remove this and use reconcileChildrenAtExpirationTime directly. @@ -18368,14 +18821,32 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched } } + function updateForwardRef(current, workInProgress) { + var render = workInProgress.type.render; + var nextChildren = render(workInProgress.pendingProps, workInProgress.ref); + reconcileChildren(current, workInProgress, nextChildren); + memoizeProps(workInProgress, nextChildren); + return workInProgress.child; + } + function updateFragment(current, workInProgress) { var nextChildren = workInProgress.pendingProps; - if (hasContextChanged()) { + if (hasLegacyContextChanged()) { + // Normally we can bail out on props equality but if context has changed + // we don't do the bailout and we have to reuse existing props instead. + } else if (workInProgress.memoizedProps === nextChildren) { + return bailoutOnAlreadyFinishedWork(current, workInProgress); + } + reconcileChildren(current, workInProgress, nextChildren); + memoizeProps(workInProgress, nextChildren); + return workInProgress.child; + } + + function updateMode(current, workInProgress) { + var nextChildren = workInProgress.pendingProps.children; + if (hasLegacyContextChanged()) { // Normally we can bail out on props equality but if context has changed // we don't do the bailout and we have to reuse existing props instead. - if (nextChildren === null) { - nextChildren = workInProgress.memoizedProps; - } } else if (nextChildren === null || workInProgress.memoizedProps === nextChildren) { return bailoutOnAlreadyFinishedWork(current, workInProgress); } @@ -18386,7 +18857,7 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched function markRef(current, workInProgress) { var ref = workInProgress.ref; - if (ref !== null && (!current || current.ref !== ref)) { + if (current === null && ref !== null || current !== null && current.ref !== ref) { // Schedule a Ref effect workInProgress.effectTag |= Ref; } @@ -18396,15 +18867,11 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched var fn = workInProgress.type; var nextProps = workInProgress.pendingProps; - var memoizedProps = workInProgress.memoizedProps; - if (hasContextChanged()) { + if (hasLegacyContextChanged()) { // Normally we can bail out on props equality but if context has changed // we don't do the bailout and we have to reuse existing props instead. - if (nextProps === null) { - nextProps = memoizedProps; - } } else { - if (nextProps === null || memoizedProps === nextProps) { + if (workInProgress.memoizedProps === nextProps) { return bailoutOnAlreadyFinishedWork(current, workInProgress); } // TODO: consider bringing fn.shouldComponentUpdate() back. @@ -18414,7 +18881,7 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched var unmaskedContext = getUnmaskedContext(workInProgress); var context = getMaskedContext(workInProgress, unmaskedContext); - var nextChildren; + var nextChildren = void 0; { ReactCurrentOwner.current = workInProgress; @@ -18433,31 +18900,40 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched // Push context providers early to prevent context stack mismatches. // During mounting we don't know the child context yet as the instance doesn't exist. // We will invalidate the child context in finishClassComponent() right after rendering. - var hasContext = pushContextProvider(workInProgress); - + var hasContext = pushLegacyContextProvider(workInProgress); var shouldUpdate = void 0; if (current === null) { - if (!workInProgress.stateNode) { + if (workInProgress.stateNode === null) { // In the initial pass we might need to construct the instance. constructClassInstance(workInProgress, workInProgress.pendingProps); mountClassInstance(workInProgress, renderExpirationTime); + shouldUpdate = true; } else { - invariant(false, 'Resuming work not yet implemented.'); // In a resume, we'll already have an instance we can reuse. - // shouldUpdate = resumeMountClassInstance(workInProgress, renderExpirationTime); + shouldUpdate = resumeMountClassInstance(workInProgress, renderExpirationTime); } } else { shouldUpdate = updateClassInstance(current, workInProgress, renderExpirationTime); } - return finishClassComponent(current, workInProgress, shouldUpdate, hasContext); + + // We processed the update queue inside updateClassInstance. It may have + // included some errors that were dispatched during the commit phase. + // TODO: Refactor class components so this is less awkward. + var didCaptureError = false; + var updateQueue = workInProgress.updateQueue; + if (updateQueue !== null && updateQueue.capturedValues !== null) { + shouldUpdate = true; + didCaptureError = true; + } + return finishClassComponent(current, workInProgress, shouldUpdate, hasContext, didCaptureError, renderExpirationTime); } - function finishClassComponent(current, workInProgress, shouldUpdate, hasContext) { + function finishClassComponent(current, workInProgress, shouldUpdate, hasContext, didCaptureError, renderExpirationTime) { // Refs should update even if shouldComponentUpdate returns false markRef(current, workInProgress); - if (!shouldUpdate) { + if (!shouldUpdate && !didCaptureError) { // Context providers should defer to sCU for rendering if (hasContext) { invalidateContextProvider(workInProgress, false); @@ -18466,22 +18942,42 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched return bailoutOnAlreadyFinishedWork(current, workInProgress); } + var ctor = workInProgress.type; var instance = workInProgress.stateNode; // Rerender ReactCurrentOwner.current = workInProgress; var nextChildren = void 0; - { - ReactDebugCurrentFiber.setCurrentPhase('render'); - nextChildren = instance.render(); - if (debugRenderPhaseSideEffects) { - instance.render(); + if (didCaptureError && (!enableGetDerivedStateFromCatch || typeof ctor.getDerivedStateFromCatch !== 'function')) { + // If we captured an error, but getDerivedStateFrom catch is not defined, + // unmount all the children. componentDidCatch will schedule an update to + // re-render a fallback. This is temporary until we migrate everyone to + // the new API. + // TODO: Warn in a future release. + nextChildren = null; + } else { + { + ReactDebugCurrentFiber.setCurrentPhase('render'); + nextChildren = instance.render(); + if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) { + instance.render(); + } + ReactDebugCurrentFiber.setCurrentPhase(null); } - ReactDebugCurrentFiber.setCurrentPhase(null); } + // React DevTools reads this flag. workInProgress.effectTag |= PerformedWork; - reconcileChildren(current, workInProgress, nextChildren); + if (didCaptureError) { + // If we're recovering from an error, reconcile twice: first to delete + // all the existing children. + reconcileChildrenAtExpirationTime(current, workInProgress, null, renderExpirationTime); + workInProgress.child = null; + // Now we can continue reconciling like normal. This has the effect of + // remounting all children regardless of whether their their + // identity matches. + } + reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, renderExpirationTime); // Memoize props and state using the values we just used to render. // TODO: Restructure so we never read values from the instance. memoizeState(workInProgress, instance.state); @@ -18512,13 +19008,21 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched if (updateQueue !== null) { var prevState = workInProgress.memoizedState; var state = processUpdateQueue(current, workInProgress, updateQueue, null, null, renderExpirationTime); - if (prevState === state) { + memoizeState(workInProgress, state); + updateQueue = workInProgress.updateQueue; + + var element = void 0; + if (updateQueue !== null && updateQueue.capturedValues !== null) { + // There's an uncaught error. Unmount the whole root. + element = null; + } else if (prevState === state) { // If the state is the same as before, that's a bailout because we had // no work that expires at this time. resetHydrationState(); return bailoutOnAlreadyFinishedWork(current, workInProgress); + } else { + element = state.element; } - var element = state.element; var root = workInProgress.stateNode; if ((current === null || current.child === null) && root.hydrate && enterHydrationState(workInProgress)) { // If we don't have any current children this might be the first pass. @@ -18560,17 +19064,22 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched var type = workInProgress.type; var memoizedProps = workInProgress.memoizedProps; var nextProps = workInProgress.pendingProps; - if (nextProps === null) { - nextProps = memoizedProps; - !(nextProps !== null) ? invariant(false, 'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.') : void 0; - } var prevProps = current !== null ? current.memoizedProps : null; - if (hasContextChanged()) { + if (hasLegacyContextChanged()) { // Normally we can bail out on props equality but if context has changed // we don't do the bailout and we have to reuse existing props instead. - } else if (nextProps === null || memoizedProps === nextProps) { - return bailoutOnAlreadyFinishedWork(current, workInProgress); + } else if (memoizedProps === nextProps) { + var isHidden = workInProgress.mode & AsyncMode && shouldDeprioritizeSubtree(type, nextProps); + if (isHidden) { + // Before bailing out, make sure we've deprioritized a hidden component. + workInProgress.expirationTime = Never; + } + if (!isHidden || renderExpirationTime !== Never) { + return bailoutOnAlreadyFinishedWork(current, workInProgress); + } + // If we're rendering a hidden node at hidden priority, don't bailout. The + // parent is complete, but the children may not be. } var nextChildren = nextProps.children; @@ -18591,10 +19100,11 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched markRef(current, workInProgress); // Check the host config to see if the children are offscreen/hidden. - if (renderExpirationTime !== Never && !useSyncScheduling && shouldDeprioritizeSubtree(type, nextProps)) { + if (renderExpirationTime !== Never && workInProgress.mode & AsyncMode && shouldDeprioritizeSubtree(type, nextProps)) { // Down-prioritize the children. workInProgress.expirationTime = Never; // Bailout and come back to this fiber later. + workInProgress.memoizedProps = nextProps; return null; } @@ -18608,9 +19118,6 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched tryToClaimNextHydratableInstance(workInProgress); } var nextProps = workInProgress.pendingProps; - if (nextProps === null) { - nextProps = workInProgress.memoizedProps; - } memoizeProps(workInProgress, nextProps); // Nothing to do here. This is terminal. We'll do the completion step // immediately after. @@ -18624,12 +19131,16 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched var unmaskedContext = getUnmaskedContext(workInProgress); var context = getMaskedContext(workInProgress, unmaskedContext); - var value; + var value = void 0; { if (fn.prototype && typeof fn.prototype.render === 'function') { - var componentName = getComponentName(workInProgress); - warning(false, "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); + var componentName = getComponentName(workInProgress) || 'Unknown'; + + if (!didWarnAboutBadClass[componentName]) { + warning(false, "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; + } } ReactCurrentOwner.current = workInProgress; value = fn(props, context); @@ -18637,25 +19148,37 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched // React DevTools reads this flag. workInProgress.effectTag |= PerformedWork; - if (typeof value === 'object' && value !== null && typeof value.render === 'function') { + if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) { + var Component = workInProgress.type; + // Proceed under the assumption that this is a class instance workInProgress.tag = ClassComponent; + workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null; + + if (typeof Component.getDerivedStateFromProps === 'function') { + var partialState = callGetDerivedStateFromProps(workInProgress, value, props, workInProgress.memoizedState); + + if (partialState !== null && partialState !== undefined) { + workInProgress.memoizedState = _assign({}, workInProgress.memoizedState, partialState); + } + } + // Push context providers early to prevent context stack mismatches. // During mounting we don't know the child context yet as the instance doesn't exist. // We will invalidate the child context in finishClassComponent() right after rendering. - var hasContext = pushContextProvider(workInProgress); + var hasContext = pushLegacyContextProvider(workInProgress); adoptClassInstance(workInProgress, value); mountClassInstance(workInProgress, renderExpirationTime); - return finishClassComponent(current, workInProgress, true, hasContext); + return finishClassComponent(current, workInProgress, true, hasContext, false, renderExpirationTime); } else { // Proceed under the assumption that this is a functional component workInProgress.tag = FunctionalComponent; { - var Component = workInProgress.type; + var _Component = workInProgress.type; - if (Component) { - warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component'); + if (_Component) { + warning(!_Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', _Component.displayName || _Component.name || 'Component'); } if (workInProgress.ref !== null) { var info = ''; @@ -18669,11 +19192,20 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched if (debugSource) { warningKey = debugSource.fileName + ':' + debugSource.lineNumber; } - if (!warnedAboutStatelessRefs[warningKey]) { - warnedAboutStatelessRefs[warningKey] = true; + if (!didWarnAboutStatelessRefs[warningKey]) { + didWarnAboutStatelessRefs[warningKey] = true; warning(false, 'Stateless function components cannot be given refs. ' + 'Attempts to access this ref will fail.%s%s', info, ReactDebugCurrentFiber.getCurrentFiberStackAddendum()); } } + + if (typeof fn.getDerivedStateFromProps === 'function') { + var _componentName = getComponentName(workInProgress) || 'Unknown'; + + if (!didWarnAboutGetDerivedStateOnFunctionalComponent[_componentName]) { + warning(false, '%s: Stateless functional components do not support getDerivedStateFromProps.', _componentName); + didWarnAboutGetDerivedStateOnFunctionalComponent[_componentName] = true; + } + } } reconcileChildren(current, workInProgress, value); memoizeProps(workInProgress, props); @@ -18682,32 +19214,28 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched } function updateCallComponent(current, workInProgress, renderExpirationTime) { - var nextCall = workInProgress.pendingProps; - if (hasContextChanged()) { + var nextProps = workInProgress.pendingProps; + if (hasLegacyContextChanged()) { // Normally we can bail out on props equality but if context has changed // we don't do the bailout and we have to reuse existing props instead. - if (nextCall === null) { - nextCall = current && current.memoizedProps; - !(nextCall !== null) ? invariant(false, 'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.') : void 0; - } - } else if (nextCall === null || workInProgress.memoizedProps === nextCall) { - nextCall = workInProgress.memoizedProps; + } else if (workInProgress.memoizedProps === nextProps) { + nextProps = workInProgress.memoizedProps; // TODO: When bailing out, we might need to return the stateNode instead // of the child. To check it for work. // return bailoutOnAlreadyFinishedWork(current, workInProgress); } - var nextChildren = nextCall.children; + var nextChildren = nextProps.children; // The following is a fork of reconcileChildrenAtExpirationTime but using // stateNode to store the child. if (current === null) { workInProgress.stateNode = mountChildFibers(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime); } else { - workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, renderExpirationTime); + workInProgress.stateNode = reconcileChildFibers(workInProgress, current.stateNode, nextChildren, renderExpirationTime); } - memoizeProps(workInProgress, nextCall); + memoizeProps(workInProgress, nextProps); // This doesn't take arbitrary time so we could synchronously just begin // eagerly do the work of workInProgress.child as an optimization. return workInProgress.stateNode; @@ -18716,14 +19244,10 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched function updatePortalComponent(current, workInProgress, renderExpirationTime) { pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); var nextChildren = workInProgress.pendingProps; - if (hasContextChanged()) { + if (hasLegacyContextChanged()) { // Normally we can bail out on props equality but if context has changed // we don't do the bailout and we have to reuse existing props instead. - if (nextChildren === null) { - nextChildren = current && current.memoizedProps; - !(nextChildren != null) ? invariant(false, 'We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.') : void 0; - } - } else if (nextChildren === null || workInProgress.memoizedProps === nextChildren) { + } else if (workInProgress.memoizedProps === nextChildren) { return bailoutOnAlreadyFinishedWork(current, workInProgress); } @@ -18742,6 +19266,201 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched return workInProgress.child; } + function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) { + var fiber = workInProgress.child; + if (fiber !== null) { + // Set the return pointer of the child to the work-in-progress fiber. + fiber['return'] = workInProgress; + } + while (fiber !== null) { + var nextFiber = void 0; + // Visit this fiber. + switch (fiber.tag) { + case ContextConsumer: + // Check if the context matches. + var observedBits = fiber.stateNode | 0; + if (fiber.type === context && (observedBits & changedBits) !== 0) { + // Update the expiration time of all the ancestors, including + // the alternates. + var node = fiber; + while (node !== null) { + var alternate = node.alternate; + if (node.expirationTime === NoWork || node.expirationTime > renderExpirationTime) { + node.expirationTime = renderExpirationTime; + if (alternate !== null && (alternate.expirationTime === NoWork || alternate.expirationTime > renderExpirationTime)) { + alternate.expirationTime = renderExpirationTime; + } + } else if (alternate !== null && (alternate.expirationTime === NoWork || alternate.expirationTime > renderExpirationTime)) { + alternate.expirationTime = renderExpirationTime; + } else { + // Neither alternate was updated, which means the rest of the + // ancestor path already has sufficient priority. + break; + } + node = node['return']; + } + // Don't scan deeper than a matching consumer. When we render the + // consumer, we'll continue scanning from that point. This way the + // scanning work is time-sliced. + nextFiber = null; + } else { + // Traverse down. + nextFiber = fiber.child; + } + break; + case ContextProvider: + // Don't scan deeper if this is a matching provider + nextFiber = fiber.type === workInProgress.type ? null : fiber.child; + break; + default: + // Traverse down. + nextFiber = fiber.child; + break; + } + if (nextFiber !== null) { + // Set the return pointer of the child to the work-in-progress fiber. + nextFiber['return'] = fiber; + } else { + // No child. Traverse to next sibling. + nextFiber = fiber; + while (nextFiber !== null) { + if (nextFiber === workInProgress) { + // We're back to the root of this subtree. Exit. + nextFiber = null; + break; + } + var sibling = nextFiber.sibling; + if (sibling !== null) { + nextFiber = sibling; + break; + } + // No more siblings. Traverse up. + nextFiber = nextFiber['return']; + } + } + fiber = nextFiber; + } + } + + function updateContextProvider(current, workInProgress, renderExpirationTime) { + var providerType = workInProgress.type; + var context = providerType._context; + + var newProps = workInProgress.pendingProps; + var oldProps = workInProgress.memoizedProps; + + if (hasLegacyContextChanged()) { + // Normally we can bail out on props equality but if context has changed + // we don't do the bailout and we have to reuse existing props instead. + } else if (oldProps === newProps) { + workInProgress.stateNode = 0; + pushProvider(workInProgress); + return bailoutOnAlreadyFinishedWork(current, workInProgress); + } + + var newValue = newProps.value; + workInProgress.memoizedProps = newProps; + + var changedBits = void 0; + if (oldProps === null) { + // Initial render + changedBits = MAX_SIGNED_31_BIT_INT; + } else { + if (oldProps.value === newProps.value) { + // No change. Bailout early if children are the same. + if (oldProps.children === newProps.children) { + workInProgress.stateNode = 0; + pushProvider(workInProgress); + return bailoutOnAlreadyFinishedWork(current, workInProgress); + } + changedBits = 0; + } else { + var oldValue = oldProps.value; + // Use Object.is to compare the new context value to the old value. + // Inlined Object.is polyfill. + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + if (oldValue === newValue && (oldValue !== 0 || 1 / oldValue === 1 / newValue) || oldValue !== oldValue && newValue !== newValue // eslint-disable-line no-self-compare + ) { + // No change. Bailout early if children are the same. + if (oldProps.children === newProps.children) { + workInProgress.stateNode = 0; + pushProvider(workInProgress); + return bailoutOnAlreadyFinishedWork(current, workInProgress); + } + changedBits = 0; + } else { + changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT; + { + warning((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits); + } + changedBits |= 0; + + if (changedBits === 0) { + // No change. Bailout early if children are the same. + if (oldProps.children === newProps.children) { + workInProgress.stateNode = 0; + pushProvider(workInProgress); + return bailoutOnAlreadyFinishedWork(current, workInProgress); + } + } else { + propagateContextChange(workInProgress, context, changedBits, renderExpirationTime); + } + } + } + } + + workInProgress.stateNode = changedBits; + pushProvider(workInProgress); + + var newChildren = newProps.children; + reconcileChildren(current, workInProgress, newChildren); + return workInProgress.child; + } + + function updateContextConsumer(current, workInProgress, renderExpirationTime) { + var context = workInProgress.type; + var newProps = workInProgress.pendingProps; + var oldProps = workInProgress.memoizedProps; + + var newValue = context._currentValue; + var changedBits = context._changedBits; + + if (hasLegacyContextChanged()) { + // Normally we can bail out on props equality but if context has changed + // we don't do the bailout and we have to reuse existing props instead. + } else if (changedBits === 0 && oldProps === newProps) { + return bailoutOnAlreadyFinishedWork(current, workInProgress); + } + workInProgress.memoizedProps = newProps; + + var observedBits = newProps.unstable_observedBits; + if (observedBits === undefined || observedBits === null) { + // Subscribe to all changes by default + observedBits = MAX_SIGNED_31_BIT_INT; + } + // Store the observedBits on the fiber's stateNode for quick access. + workInProgress.stateNode = observedBits; + + if ((changedBits & observedBits) !== 0) { + // Context change propagation stops at matching consumers, for time- + // slicing. Continue the propagation here. + propagateContextChange(workInProgress, context, changedBits, renderExpirationTime); + } + // There is no bailout on `children` equality because we expect people + // to often pass a bound method as a child, but it may reference + // `this.state` or `this.props` (and thus needs to re-render on `setState`). + + var render = newProps.children; + + { + warning(typeof render === 'function', '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.'); + } + + var newChildren = render(newValue); + reconcileChildren(current, workInProgress, newChildren); + return workInProgress.child; + } + /* function reuseChildrenEffects(returnFiber : Fiber, firstChild : Fiber) { let child = firstChild; @@ -18792,11 +19511,14 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched pushHostRootContext(workInProgress); break; case ClassComponent: - pushContextProvider(workInProgress); + pushLegacyContextProvider(workInProgress); break; case HostPortal: pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); break; + case ContextProvider: + pushProvider(workInProgress); + break; } // TODO: What if this is currently in progress? // How can that happen? How is this not being cloned? @@ -18844,69 +19566,27 @@ var ReactFiberBeginWork = function (config, hostContext, hydrationContext, sched return null; case HostPortal: return updatePortalComponent(current, workInProgress, renderExpirationTime); + case ForwardRef: + return updateForwardRef(current, workInProgress); case Fragment: return updateFragment(current, workInProgress); + case Mode: + return updateMode(current, workInProgress); + case ContextProvider: + return updateContextProvider(current, workInProgress, renderExpirationTime); + case ContextConsumer: + return updateContextConsumer(current, workInProgress, renderExpirationTime); default: invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.'); } } - function beginFailedWork(current, workInProgress, renderExpirationTime) { - // Push context providers here to avoid a push/pop context mismatch. - switch (workInProgress.tag) { - case ClassComponent: - pushContextProvider(workInProgress); - break; - case HostRoot: - pushHostRootContext(workInProgress); - break; - default: - invariant(false, 'Invalid type of work. This error is likely caused by a bug in React. Please file an issue.'); - } - - // Add an error effect so we can handle the error during the commit phase - workInProgress.effectTag |= Err; - - // This is a weird case where we do "resume" work — work that failed on - // our first attempt. Because we no longer have a notion of "progressed - // deletions," reset the child to the current child to make sure we delete - // it again. TODO: Find a better way to handle this, perhaps during a more - // general overhaul of error handling. - if (current === null) { - workInProgress.child = null; - } else if (workInProgress.child !== current.child) { - workInProgress.child = current.child; - } - - if (workInProgress.expirationTime === NoWork || workInProgress.expirationTime > renderExpirationTime) { - return bailoutOnLowPriority(current, workInProgress); - } - - // If we don't bail out, we're going be recomputing our children so we need - // to drop our effect list. - workInProgress.firstEffect = null; - workInProgress.lastEffect = null; - - // Unmount the current children as if the component rendered null - var nextChildren = null; - reconcileChildrenAtExpirationTime(current, workInProgress, nextChildren, renderExpirationTime); - - if (workInProgress.tag === ClassComponent) { - var instance = workInProgress.stateNode; - workInProgress.memoizedProps = instance.props; - workInProgress.memoizedState = instance.state; - } - - return workInProgress.child; - } - return { - beginWork: beginWork, - beginFailedWork: beginFailedWork + beginWork: beginWork }; }; -var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { +var ReactFiberCompleteWork = function (config, hostContext, legacyContext, newContext, hydrationContext) { var createInstance = config.createInstance, createTextInstance = config.createTextInstance, appendInitialChild = config.appendInitialChild, @@ -18918,6 +19598,9 @@ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { popHostContext = hostContext.popHostContext, getHostContext = hostContext.getHostContext, popHostContainer = hostContext.popHostContainer; + var popLegacyContextProvider = legacyContext.popContextProvider, + popTopLevelLegacyContextObject = legacyContext.popTopLevelContextObject; + var popProvider = newContext.popProvider; var prepareToHydrateHostInstance = hydrationContext.prepareToHydrateHostInstance, prepareToHydrateHostTextInstance = hydrationContext.prepareToHydrateHostTextInstance, popHydrationState = hydrationContext.popHydrationState; @@ -18942,7 +19625,7 @@ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { if (node.tag === HostComponent || node.tag === HostText || node.tag === HostPortal) { invariant(false, 'A call cannot have host component children.'); } else if (node.tag === ReturnComponent) { - returns.push(node.type); + returns.push(node.pendingProps.value); } else if (node.child !== null) { node.child['return'] = node; node = node.child; @@ -18960,8 +19643,8 @@ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { } function moveCallToHandlerPhase(current, workInProgress, renderExpirationTime) { - var call = workInProgress.memoizedProps; - !call ? invariant(false, 'Should be resolved by now. This error is likely caused by a bug in React. Please file an issue.') : void 0; + var props = workInProgress.memoizedProps; + !props ? invariant(false, 'Should be resolved by now. This error is likely caused by a bug in React. Please file an issue.') : void 0; // First step of the call has completed. Now we need to do the second. // TODO: It would be nice to have a multi stage call represented by a @@ -18976,9 +19659,9 @@ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { // TODO: Compare this to a generator or opaque helpers like Children. var returns = []; appendAllReturns(returns, workInProgress); - var fn = call.handler; - var props = call.props; - var nextChildren = fn(props, returns); + var fn = props.handler; + var childProps = props.props; + var nextChildren = fn(childProps, returns); var currentFirstChild = current !== null ? current.child : null; workInProgress.child = reconcileChildFibers(workInProgress, currentFirstChild, nextChildren, renderExpirationTime); @@ -19024,7 +19707,7 @@ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { updateHostContainer = function (workInProgress) { // Noop }; - updateHostComponent = function (current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance) { + updateHostComponent = function (current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance, currentHostContext) { // TODO: Type this specific to this type of component. workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there @@ -19089,17 +19772,15 @@ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { } else { var container = portalOrRoot.containerInfo; var newChildSet = createContainerChildSet(container); - if (finalizeContainerChildren(container, newChildSet)) { - markUpdate(workInProgress); - } - portalOrRoot.pendingChildren = newChildSet; // If children might have changed, we have to add them all to the set. appendAllChildrenToContainer(newChildSet, workInProgress); + portalOrRoot.pendingChildren = newChildSet; // Schedule an update on the container to swap out the container. markUpdate(workInProgress); + finalizeContainerChildren(container, newChildSet); } }; - updateHostComponent = function (current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance) { + updateHostComponent = function (current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance, currentHostContext) { // If there are no effects associated with this node, then none of our children had any updates. // This guarantees that we can reuse all of them. var childrenUnchanged = workInProgress.firstEffect === null; @@ -19111,7 +19792,7 @@ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { } else { var recyclableInstance = workInProgress.stateNode; var newInstance = cloneInstance(currentInstance, updatePayload, type, oldProps, newProps, workInProgress, childrenUnchanged, recyclableInstance); - if (finalizeInitialChildren(newInstance, type, newProps, rootContainerInstance)) { + if (finalizeInitialChildren(newInstance, type, newProps, rootContainerInstance, currentHostContext)) { markUpdate(workInProgress); } workInProgress.stateNode = newInstance; @@ -19146,7 +19827,7 @@ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { updateHostContainer = function (workInProgress) { // Noop }; - updateHostComponent = function (current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance) { + updateHostComponent = function (current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance, currentHostContext) { // Noop }; updateHostText = function (current, workInProgress, oldText, newText) { @@ -19158,34 +19839,39 @@ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { } function completeWork(current, workInProgress, renderExpirationTime) { - // Get the latest props. var newProps = workInProgress.pendingProps; - if (newProps === null) { - newProps = workInProgress.memoizedProps; - } else if (workInProgress.expirationTime !== Never || renderExpirationTime === Never) { - // Reset the pending props, unless this was a down-prioritization. - workInProgress.pendingProps = null; - } - switch (workInProgress.tag) { case FunctionalComponent: return null; case ClassComponent: { // We are leaving this subtree, so pop context if any. - popContextProvider(workInProgress); + popLegacyContextProvider(workInProgress); + + // If this component caught an error, schedule an error log effect. + var instance = workInProgress.stateNode; + var updateQueue = workInProgress.updateQueue; + if (updateQueue !== null && updateQueue.capturedValues !== null) { + workInProgress.effectTag &= ~DidCapture; + if (typeof instance.componentDidCatch === 'function') { + workInProgress.effectTag |= ErrLog; + } else { + // Normally we clear this in the commit phase, but since we did not + // schedule an effect, we need to reset it here. + updateQueue.capturedValues = null; + } + } return null; } case HostRoot: { popHostContainer(workInProgress); - popTopLevelContextObject(workInProgress); + popTopLevelLegacyContextObject(workInProgress); var fiberRoot = workInProgress.stateNode; if (fiberRoot.pendingContext) { fiberRoot.context = fiberRoot.pendingContext; fiberRoot.pendingContext = null; } - if (current === null || current.child === null) { // If we hydrated, pop so that we can delete any remaining children // that weren't hydrated. @@ -19195,6 +19881,11 @@ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { workInProgress.effectTag &= ~Placement; } updateHostContainer(workInProgress); + + var _updateQueue = workInProgress.updateQueue; + if (_updateQueue !== null && _updateQueue.capturedValues !== null) { + workInProgress.effectTag |= ErrLog; + } return null; } case HostComponent: @@ -19210,11 +19901,14 @@ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { // have newProps so we'll have to reuse them. // TODO: Split the update API as separate for the props vs. children. // Even better would be if children weren't special cased at all tho. - var instance = workInProgress.stateNode; + var _instance = workInProgress.stateNode; var currentHostContext = getHostContext(); - var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); + // TODO: Experiencing an error where oldProps is null. Suggests a host + // component is hitting the resume path. Figure out why. Possibly + // related to `hidden`. + var updatePayload = prepareUpdate(_instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); - updateHostComponent(current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance); + updateHostComponent(current, workInProgress, updatePayload, type, oldProps, newProps, rootContainerInstance, currentHostContext); if (current.ref !== workInProgress.ref) { markRef(workInProgress); @@ -19241,17 +19935,17 @@ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { markUpdate(workInProgress); } } else { - var _instance = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress); + var _instance2 = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress); - appendAllChildren(_instance, workInProgress); + appendAllChildren(_instance2, workInProgress); // Certain renderers require commit-time effects for initial mount. // (eg DOM renderer supports auto-focus for certain elements). // Make sure such renderers get scheduled for later work. - if (finalizeInitialChildren(_instance, type, newProps, rootContainerInstance)) { + if (finalizeInitialChildren(_instance2, type, newProps, rootContainerInstance, _currentHostContext)) { markUpdate(workInProgress); } - workInProgress.stateNode = _instance; + workInProgress.stateNode = _instance2; } if (workInProgress.ref !== null) { @@ -19297,12 +19991,22 @@ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { case ReturnComponent: // Does nothing. return null; + case ForwardRef: + return null; case Fragment: return null; + case Mode: + return null; case HostPortal: popHostContainer(workInProgress); updateHostContainer(workInProgress); return null; + case ContextProvider: + // Pop provider fiber + popProvider(workInProgress); + return null; + case ContextConsumer: + return null; // Error cases case IndeterminateComponent: invariant(false, 'An indeterminate component should have become determinate before completing. This error is likely caused by a bug in React. Please file an issue.'); @@ -19317,12 +20021,244 @@ var ReactFiberCompleteWork = function (config, hostContext, hydrationContext) { }; }; -var invokeGuardedCallback$2 = ReactErrorUtils.invokeGuardedCallback; +function createCapturedValue(value, source) { + // If the value is an error, call this function immediately after it is thrown + // so the stack is accurate. + return { + value: value, + source: source, + stack: getStackAddendumByWorkInProgressFiber(source) + }; +} + +var ReactFiberUnwindWork = function (hostContext, legacyContext, newContext, scheduleWork, isAlreadyFailedLegacyErrorBoundary) { + var popHostContainer = hostContext.popHostContainer, + popHostContext = hostContext.popHostContext; + var popLegacyContextProvider = legacyContext.popContextProvider, + popTopLevelLegacyContextObject = legacyContext.popTopLevelContextObject; + var popProvider = newContext.popProvider; + + + function throwException(returnFiber, sourceFiber, rawValue) { + // The source fiber did not complete. + sourceFiber.effectTag |= Incomplete; + // Its effect list is no longer valid. + sourceFiber.firstEffect = sourceFiber.lastEffect = null; + + var value = createCapturedValue(rawValue, sourceFiber); + + var workInProgress = returnFiber; + do { + switch (workInProgress.tag) { + case HostRoot: + { + // Uncaught error + var errorInfo = value; + ensureUpdateQueues(workInProgress); + var updateQueue = workInProgress.updateQueue; + updateQueue.capturedValues = [errorInfo]; + workInProgress.effectTag |= ShouldCapture; + return; + } + case ClassComponent: + // Capture and retry + var ctor = workInProgress.type; + var _instance = workInProgress.stateNode; + if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromCatch === 'function' && enableGetDerivedStateFromCatch || _instance !== null && typeof _instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(_instance))) { + ensureUpdateQueues(workInProgress); + var _updateQueue = workInProgress.updateQueue; + var capturedValues = _updateQueue.capturedValues; + if (capturedValues === null) { + _updateQueue.capturedValues = [value]; + } else { + capturedValues.push(value); + } + workInProgress.effectTag |= ShouldCapture; + return; + } + break; + default: + break; + } + workInProgress = workInProgress['return']; + } while (workInProgress !== null); + } + + function unwindWork(workInProgress) { + switch (workInProgress.tag) { + case ClassComponent: + { + popLegacyContextProvider(workInProgress); + var effectTag = workInProgress.effectTag; + if (effectTag & ShouldCapture) { + workInProgress.effectTag = effectTag & ~ShouldCapture | DidCapture; + return workInProgress; + } + return null; + } + case HostRoot: + { + popHostContainer(workInProgress); + popTopLevelLegacyContextObject(workInProgress); + var _effectTag = workInProgress.effectTag; + if (_effectTag & ShouldCapture) { + workInProgress.effectTag = _effectTag & ~ShouldCapture | DidCapture; + return workInProgress; + } + return null; + } + case HostComponent: + { + popHostContext(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: + { + popLegacyContextProvider(interruptedWork); + break; + } + case HostRoot: + { + popHostContainer(interruptedWork); + popTopLevelLegacyContextObject(interruptedWork); + break; + } + case HostComponent: + { + popHostContext(interruptedWork); + break; + } + case HostPortal: + popHostContainer(interruptedWork); + break; + case ContextProvider: + popProvider(interruptedWork); + break; + default: + break; + } + } + + return { + throwException: throwException, + unwindWork: unwindWork, + unwindInterruptedWork: unwindInterruptedWork + }; +}; + +// This module is forked in different environments. +// By default, return `true` to log errors to the console. +// Forks can return `false` if this isn't desirable. +function showErrorDialog(capturedError) { + return true; +} + +function logCapturedError(capturedError) { + var logError = showErrorDialog(capturedError); + + // Allow injected showErrorDialog() to prevent default console.error logging. + // This enables renderers like ReactNative to better manage redbox behavior. + if (logError === false) { + return; + } + + var error = capturedError.error; + var suppressLogging = error && error.suppressReactErrorLogging; + if (suppressLogging) { + return; + } + + { + var componentName = capturedError.componentName, + componentStack = capturedError.componentStack, + errorBoundaryName = capturedError.errorBoundaryName, + errorBoundaryFound = capturedError.errorBoundaryFound, + willRetry = capturedError.willRetry; + + + var componentNameMessage = componentName ? 'The above error occurred in the <' + componentName + '> component:' : 'The above error occurred in one of your React components:'; + + var errorBoundaryMessage = void 0; + // errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow. + 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); + + // In development, we provide our own message with just the component stack. + // We don't include the original error message and JS stack because the browser + // has already printed it. Even if the application swallows the error, it is still + // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils. + console.error(combinedMessage); + } +} + +var invokeGuardedCallback$3 = ReactErrorUtils.invokeGuardedCallback; var hasCaughtError$1 = ReactErrorUtils.hasCaughtError; var clearCaughtError$1 = ReactErrorUtils.clearCaughtError; -var ReactFiberCommitWork = function (config, captureError) { +var didWarnAboutUndefinedSnapshotBeforeUpdate = null; +{ + didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); +} + +function logError(boundary, errorInfo) { + var source = errorInfo.source; + var stack = errorInfo.stack; + if (stack === null) { + stack = getStackAddendumByWorkInProgressFiber(source); + } + + var capturedError = { + componentName: source !== null ? getComponentName(source) : 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); + capturedError.errorBoundaryFound = true; + capturedError.willRetry = true; + } + + try { + logCapturedError(capturedError); + } catch (e) { + // Prevent cycle if logCapturedError() throws. + // A cycle may still occur if logCapturedError renders a component that throws. + var suppressLogging = e && e.suppressReactErrorLogging; + if (!suppressLogging) { + console.error(e); + } + } +} + +var ReactFiberCommitWork = function (config, captureError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime) { var getPublicInstance = config.getPublicInstance, mutation = config.mutation, persistence = config.persistence; @@ -19339,7 +20275,7 @@ var ReactFiberCommitWork = function (config, captureError) { // Capture errors so they don't interrupt unmounting. function safelyCallComponentWillUnmount(current, instance) { { - invokeGuardedCallback$2(null, callComponentWillUnmountWithTimer, null, current, instance); + invokeGuardedCallback$3(null, callComponentWillUnmountWithTimer, null, current, instance); if (hasCaughtError$1()) { var unmountError = clearCaughtError$1(); captureError(current, unmountError); @@ -19350,41 +20286,84 @@ var ReactFiberCommitWork = function (config, captureError) { function safelyDetachRef(current) { var ref = current.ref; if (ref !== null) { - { - invokeGuardedCallback$2(null, ref, null, null); - if (hasCaughtError$1()) { - var refError = clearCaughtError$1(); - captureError(current, refError); + if (typeof ref === 'function') { + { + invokeGuardedCallback$3(null, ref, null, null); + if (hasCaughtError$1()) { + var refError = clearCaughtError$1(); + captureError(current, refError); + } } + } else { + ref.current = null; } } } - function commitLifeCycles(current, finishedWork) { + function commitBeforeMutationLifeCycles(current, finishedWork) { switch (finishedWork.tag) { case ClassComponent: { - var instance = finishedWork.stateNode; + if (finishedWork.effectTag & Snapshot) { + if (current !== null) { + var prevProps = current.memoizedProps; + var prevState = current.memoizedState; + startPhaseTimer(finishedWork, 'getSnapshotBeforeUpdate'); + var _instance = finishedWork.stateNode; + _instance.props = finishedWork.memoizedProps; + _instance.state = finishedWork.memoizedState; + var snapshot = _instance.getSnapshotBeforeUpdate(prevProps, prevState); + { + var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate; + if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) { + didWarnSet.add(finishedWork.type); + warning(false, '%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork)); + } + } + _instance.__reactInternalSnapshotBeforeUpdate = snapshot; + stopPhaseTimer(); + } + } + return; + } + case HostRoot: + case HostComponent: + case HostText: + case HostPortal: + // Nothing to do for these component types + return; + default: + { + invariant(false, '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 commitLifeCycles(finishedRoot, current, finishedWork, currentTime, committedExpirationTime) { + switch (finishedWork.tag) { + case ClassComponent: + { + var _instance2 = finishedWork.stateNode; if (finishedWork.effectTag & Update) { if (current === null) { startPhaseTimer(finishedWork, 'componentDidMount'); - instance.props = finishedWork.memoizedProps; - instance.state = finishedWork.memoizedState; - instance.componentDidMount(); + _instance2.props = finishedWork.memoizedProps; + _instance2.state = finishedWork.memoizedState; + _instance2.componentDidMount(); stopPhaseTimer(); } else { var prevProps = current.memoizedProps; var prevState = current.memoizedState; startPhaseTimer(finishedWork, 'componentDidUpdate'); - instance.props = finishedWork.memoizedProps; - instance.state = finishedWork.memoizedState; - instance.componentDidUpdate(prevProps, prevState); + _instance2.props = finishedWork.memoizedProps; + _instance2.state = finishedWork.memoizedState; + _instance2.componentDidUpdate(prevProps, prevState, _instance2.__reactInternalSnapshotBeforeUpdate); stopPhaseTimer(); } } var updateQueue = finishedWork.updateQueue; if (updateQueue !== null) { - commitCallbacks(updateQueue, instance); + commitCallbacks(updateQueue, _instance2); } return; } @@ -19392,14 +20371,24 @@ var ReactFiberCommitWork = function (config, captureError) { { var _updateQueue = finishedWork.updateQueue; if (_updateQueue !== null) { - var _instance = finishedWork.child !== null ? finishedWork.child.stateNode : null; - commitCallbacks(_updateQueue, _instance); + var _instance3 = null; + if (finishedWork.child !== null) { + switch (finishedWork.child.tag) { + case HostComponent: + _instance3 = getPublicInstance(finishedWork.child.stateNode); + break; + case ClassComponent: + _instance3 = finishedWork.child.stateNode; + break; + } + } + commitCallbacks(_updateQueue, _instance3); } return; } case HostComponent: { - var _instance2 = finishedWork.stateNode; + var _instance4 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted // (eg DOM renderer may schedule auto-focus for inputs and form controls). @@ -19408,7 +20397,7 @@ var ReactFiberCommitWork = function (config, captureError) { if (current === null && finishedWork.effectTag & Update) { var type = finishedWork.type; var props = finishedWork.memoizedProps; - commitMount(_instance2, type, props, finishedWork); + commitMount(_instance4, type, props, finishedWork); } return; @@ -19430,16 +20419,79 @@ var ReactFiberCommitWork = function (config, captureError) { } } + function commitErrorLogging(finishedWork, onUncaughtError) { + switch (finishedWork.tag) { + case ClassComponent: + { + var ctor = finishedWork.type; + var _instance5 = finishedWork.stateNode; + var updateQueue = finishedWork.updateQueue; + !(updateQueue !== null && updateQueue.capturedValues !== null) ? invariant(false, 'An error logging effect should not have been scheduled if no errors were captured. This error is likely caused by a bug in React. Please file an issue.') : void 0; + var capturedErrors = updateQueue.capturedValues; + updateQueue.capturedValues = null; + + if (typeof ctor.getDerivedStateFromCatch !== 'function') { + // To preserve the preexisting retry behavior of error boundaries, + // we keep track of which ones already failed during this batch. + // This gets reset before we yield back to the browser. + // TODO: Warn in strict mode if getDerivedStateFromCatch is + // not defined. + markLegacyErrorBoundaryAsFailed(_instance5); + } + + _instance5.props = finishedWork.memoizedProps; + _instance5.state = finishedWork.memoizedState; + for (var i = 0; i < capturedErrors.length; i++) { + var errorInfo = capturedErrors[i]; + var _error = errorInfo.value; + var stack = errorInfo.stack; + logError(finishedWork, errorInfo); + _instance5.componentDidCatch(_error, { + componentStack: stack !== null ? stack : '' + }); + } + } + break; + case HostRoot: + { + var _updateQueue2 = finishedWork.updateQueue; + !(_updateQueue2 !== null && _updateQueue2.capturedValues !== null) ? invariant(false, 'An error logging effect should not have been scheduled if no errors were captured. This error is likely caused by a bug in React. Please file an issue.') : void 0; + var _capturedErrors = _updateQueue2.capturedValues; + _updateQueue2.capturedValues = null; + for (var _i = 0; _i < _capturedErrors.length; _i++) { + var _errorInfo = _capturedErrors[_i]; + logError(finishedWork, _errorInfo); + onUncaughtError(_errorInfo.value); + } + break; + } + default: + invariant(false, 'This unit of work tag cannot capture errors. This error is likely caused by a bug in React. Please file an issue.'); + } + } + function commitAttachRef(finishedWork) { var ref = finishedWork.ref; if (ref !== null) { - var instance = finishedWork.stateNode; + var _instance6 = finishedWork.stateNode; + var instanceToUse = void 0; switch (finishedWork.tag) { case HostComponent: - ref(getPublicInstance(instance)); + instanceToUse = getPublicInstance(_instance6); break; default: - ref(instance); + instanceToUse = _instance6; + } + if (typeof ref === 'function') { + ref(instanceToUse); + } else { + { + if (!ref.hasOwnProperty('current')) { + warning(false, 'Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().%s', getComponentName(finishedWork), getStackAddendumByWorkInProgressFiber(finishedWork)); + } + } + + ref.current = instanceToUse; } } } @@ -19447,7 +20499,11 @@ var ReactFiberCommitWork = function (config, captureError) { function commitDetachRef(current) { var currentRef = current.ref; if (currentRef !== null) { - currentRef(null); + if (typeof currentRef === 'function') { + currentRef(null); + } else { + currentRef.current = null; + } } } @@ -19463,9 +20519,9 @@ var ReactFiberCommitWork = function (config, captureError) { case ClassComponent: { safelyDetachRef(current); - var instance = current.stateNode; - if (typeof instance.componentWillUnmount === 'function') { - safelyCallComponentWillUnmount(current, instance); + var _instance7 = current.stateNode; + if (typeof _instance7.componentWillUnmount === 'function') { + safelyCallComponentWillUnmount(current, _instance7); } return; } @@ -19540,13 +20596,15 @@ var ReactFiberCommitWork = function (config, captureError) { } } + var emptyPortalContainer = void 0; + if (!mutation) { var commitContainer = void 0; if (persistence) { var replaceContainerChildren = persistence.replaceContainerChildren, createContainerChildSet = persistence.createContainerChildSet; - var emptyPortalContainer = function (current) { + emptyPortalContainer = function (current) { var portal = current.stateNode; var containerInfo = portal.containerInfo; @@ -19602,6 +20660,8 @@ var ReactFiberCommitWork = function (config, captureError) { }, commitLifeCycles: commitLifeCycles, + commitBeforeMutationLifeCycles: commitBeforeMutationLifeCycles, + commitErrorLogging: commitErrorLogging, commitAttachRef: commitAttachRef, commitDetachRef: commitDetachRef }; @@ -19846,8 +20906,8 @@ var ReactFiberCommitWork = function (config, captureError) { } case HostComponent: { - var instance = finishedWork.stateNode; - if (instance != null) { + var _instance8 = finishedWork.stateNode; + if (_instance8 != null) { // Commit the work prepared earlier. var newProps = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps @@ -19859,7 +20919,7 @@ var ReactFiberCommitWork = function (config, captureError) { var updatePayload = finishedWork.updateQueue; finishedWork.updateQueue = null; if (updatePayload !== null) { - commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork); + commitUpdate(_instance8, updatePayload, type, oldProps, newProps, finishedWork); } } return; @@ -19893,11 +20953,13 @@ var ReactFiberCommitWork = function (config, captureError) { if (enableMutatingReconciler) { return { + commitBeforeMutationLifeCycles: commitBeforeMutationLifeCycles, commitResetTextContent: commitResetTextContent, commitPlacement: commitPlacement, commitDeletion: commitDeletion, commitWork: commitWork, commitLifeCycles: commitLifeCycles, + commitErrorLogging: commitErrorLogging, commitAttachRef: commitAttachRef, commitDetachRef: commitDetachRef }; @@ -19908,9 +20970,12 @@ var ReactFiberCommitWork = function (config, captureError) { var NO_CONTEXT = {}; -var ReactFiberHostContext = function (config) { +var ReactFiberHostContext = function (config, stack) { var getChildHostContext = config.getChildHostContext, getRootHostContext = config.getRootHostContext; + var createCursor = stack.createCursor, + push = stack.push, + pop = stack.pop; var contextStackCursor = createCursor(NO_CONTEXT); @@ -19931,12 +20996,19 @@ var ReactFiberHostContext = function (config) { // Push current root instance onto the stack; // This allows us to reset root when portals are popped. push(rootInstanceStackCursor, nextRootInstance, fiber); - - var nextRootContext = getRootHostContext(nextRootInstance); - // Track the context and the Fiber that provided it. // This enables us to pop only Fibers that provide unique contexts. push(contextFiberStackCursor, fiber, fiber); + + // Finally, we need to push the host context to the stack. + // However, we can't just call getRootHostContext() and push it because + // we'd have a different number of entries on the stack depending on + // whether getRootHostContext() throws somewhere in renderer code or not. + // So we push an empty value first. This lets us safely unwind on errors. + push(contextStackCursor, NO_CONTEXT, fiber); + var nextRootContext = getRootHostContext(nextRootInstance); + // Now that we know this function doesn't throw, replace it. + pop(contextStackCursor, fiber); push(contextStackCursor, nextRootContext, fiber); } @@ -19978,19 +21050,13 @@ var ReactFiberHostContext = function (config) { pop(contextFiberStackCursor, fiber); } - function resetHostContainer() { - contextStackCursor.current = NO_CONTEXT; - rootInstanceStackCursor.current = NO_CONTEXT; - } - return { getHostContext: getHostContext, getRootHostContainer: getRootHostContainer, popHostContainer: popHostContainer, popHostContext: popHostContext, pushHostContainer: pushHostContainer, - pushHostContext: pushHostContext, - resetHostContainer: resetHostContainer + pushHostContext: pushHostContext }; }; @@ -20299,78 +21365,397 @@ var ReactFiberInstrumentation = { var ReactFiberInstrumentation_1 = ReactFiberInstrumentation; -var defaultShowDialog = function (capturedError) { - return true; -}; +var warnedAboutMissingGetChildContext = void 0; -var showDialog = defaultShowDialog; - -function logCapturedError(capturedError) { - var logError = showDialog(capturedError); - - // Allow injected showDialog() to prevent default console.error logging. - // This enables renderers like ReactNative to better manage redbox behavior. - if (logError === false) { - return; - } - - var error = capturedError.error; - var suppressLogging = error && error.suppressReactErrorLogging; - if (suppressLogging) { - return; - } - - { - var componentName = capturedError.componentName, - componentStack = capturedError.componentStack, - errorBoundaryName = capturedError.errorBoundaryName, - errorBoundaryFound = capturedError.errorBoundaryFound, - willRetry = capturedError.willRetry; - - - var componentNameMessage = componentName ? 'The above error occurred in the <' + componentName + '> component:' : 'The above error occurred in one of your React components:'; - - var errorBoundaryMessage = void 0; - // errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow. - 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); - - // In development, we provide our own message with just the component stack. - // We don't include the original error message and JS stack because the browser - // has already printed it. Even if the application swallows the error, it is still - // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils. - console.error(combinedMessage); - } +{ + warnedAboutMissingGetChildContext = {}; } -var invokeGuardedCallback$1 = ReactErrorUtils.invokeGuardedCallback; +var ReactFiberLegacyContext = function (stack) { + var createCursor = stack.createCursor, + push = stack.push, + pop = stack.pop; + + // A cursor to the current merged context object on the stack. + + var contextStackCursor = createCursor(emptyObject); + // A cursor to a boolean indicating whether the context has changed. + var didPerformWorkStackCursor = createCursor(false); + // Keep track of the previous context object that was on the stack. + // We use this to get access to the parent context after we have already + // pushed the next context provider, and now need to merge their contexts. + var previousContext = emptyObject; + + function getUnmaskedContext(workInProgress) { + var hasOwnContext = isContextProvider(workInProgress); + if (hasOwnContext) { + // If the fiber is a context provider itself, when we read its context + // we have already pushed its own child context on the stack. A context + // provider should not "see" its own child context. Therefore we read the + // previous (parent) context instead for a context provider. + 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 emptyObject; + } + + // Avoid recreating masked context unless unmasked context has changed. + // Failing to do this will result in unnecessary calls to componentWillReceiveProps. + // This may trigger infinite loops if componentWillReceiveProps calls setState. + 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(workInProgress) || 'Unknown'; + checkPropTypes(contextTypes, context, 'context', name, ReactDebugCurrentFiber.getCurrentFiberStackAddendum); + } + + // Cache unmasked context so we can avoid recreating masked context unless necessary. + // Context is created before the class component is instantiated so check for instance. + if (instance) { + cacheContext(workInProgress, unmaskedContext, context); + } + + return context; + } + + function hasContextChanged() { + return didPerformWorkStackCursor.current; + } + + function isContextConsumer(fiber) { + return fiber.tag === ClassComponent && fiber.type.contextTypes != null; + } + + function isContextProvider(fiber) { + return fiber.tag === ClassComponent && fiber.type.childContextTypes != null; + } + + function popContextProvider(fiber) { + if (!isContextProvider(fiber)) { + return; + } + + pop(didPerformWorkStackCursor, fiber); + pop(contextStackCursor, fiber); + } + + function popTopLevelContextObject(fiber) { + pop(didPerformWorkStackCursor, fiber); + pop(contextStackCursor, fiber); + } + + function pushTopLevelContextObject(fiber, context, didChange) { + !(contextStackCursor.cursor == null) ? invariant(false, 'Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.') : void 0; + + push(contextStackCursor, context, fiber); + push(didPerformWorkStackCursor, didChange, fiber); + } + + function processChildContext(fiber, parentContext) { + var instance = fiber.stateNode; + var childContextTypes = fiber.type.childContextTypes; + + // TODO (bvaughn) Replace this behavior with an invariant() in the future. + // It has only been added in Fiber to match the (unintentional) behavior in Stack. + if (typeof instance.getChildContext !== 'function') { + { + var componentName = getComponentName(fiber) || 'Unknown'; + + if (!warnedAboutMissingGetChildContext[componentName]) { + warnedAboutMissingGetChildContext[componentName] = true; + warning(false, '%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 = void 0; + { + ReactDebugCurrentFiber.setCurrentPhase('getChildContext'); + } + startPhaseTimer(fiber, 'getChildContext'); + childContext = instance.getChildContext(); + stopPhaseTimer(); + { + ReactDebugCurrentFiber.setCurrentPhase(null); + } + for (var contextKey in childContext) { + !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(fiber) || 'Unknown', contextKey) : void 0; + } + { + var name = getComponentName(fiber) || 'Unknown'; + checkPropTypes(childContextTypes, childContext, 'child context', name, + // In practice, there is one case in which we won't get a stack. It's when + // somebody calls unstable_renderSubtreeIntoContainer() and we process + // context from the parent component instance. The stack will be missing + // because it's outside of the reconciliation, and so the pointer has not + // been set. This is rare and doesn't matter. We'll also remove that API. + ReactDebugCurrentFiber.getCurrentFiberStackAddendum); + } + + return _assign({}, parentContext, childContext); + } + + function pushContextProvider(workInProgress) { + if (!isContextProvider(workInProgress)) { + return false; + } + + var instance = workInProgress.stateNode; + // We push the context as early as possible to ensure stack integrity. + // If the instance does not exist yet, we will push null at first, + // and replace it on the stack later when invalidating the context. + var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject; + + // Remember the parent context so we can merge with it later. + // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates. + previousContext = contextStackCursor.current; + push(contextStackCursor, memoizedMergedChildContext, workInProgress); + push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress); + + return true; + } + + function invalidateContextProvider(workInProgress, didChange) { + var instance = workInProgress.stateNode; + !instance ? invariant(false, 'Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.') : void 0; + + if (didChange) { + // Merge parent and own context. + // Skip this if we're not updating due to sCU. + // This avoids unnecessarily recomputing memoized values. + var mergedContext = processChildContext(workInProgress, previousContext); + instance.__reactInternalMemoizedMergedChildContext = mergedContext; + + // Replace the old (or empty) context with the new one. + // It is important to unwind the context in the reverse order. + pop(didPerformWorkStackCursor, workInProgress); + pop(contextStackCursor, workInProgress); + // Now push the new context and mark that it has changed. + push(contextStackCursor, mergedContext, workInProgress); + push(didPerformWorkStackCursor, didChange, workInProgress); + } else { + pop(didPerformWorkStackCursor, workInProgress); + push(didPerformWorkStackCursor, didChange, workInProgress); + } + } + + function findCurrentUnmaskedContext(fiber) { + // Currently this is only used with renderSubtreeIntoContainer; not sure if it + // makes sense elsewhere + !(isFiberMounted(fiber) && fiber.tag === ClassComponent) ? invariant(false, 'Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.') : void 0; + + var node = fiber; + while (node.tag !== HostRoot) { + if (isContextProvider(node)) { + return node.stateNode.__reactInternalMemoizedMergedChildContext; + } + var parent = node['return']; + !parent ? invariant(false, 'Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.') : void 0; + node = parent; + } + return node.stateNode.context; + } + + return { + getUnmaskedContext: getUnmaskedContext, + cacheContext: cacheContext, + getMaskedContext: getMaskedContext, + hasContextChanged: hasContextChanged, + isContextConsumer: isContextConsumer, + isContextProvider: isContextProvider, + popContextProvider: popContextProvider, + popTopLevelContextObject: popTopLevelContextObject, + pushTopLevelContextObject: pushTopLevelContextObject, + processChildContext: processChildContext, + pushContextProvider: pushContextProvider, + invalidateContextProvider: invalidateContextProvider, + findCurrentUnmaskedContext: findCurrentUnmaskedContext + }; +}; + +var ReactFiberNewContext = function (stack) { + var createCursor = stack.createCursor, + push = stack.push, + pop = stack.pop; + + + var providerCursor = createCursor(null); + var valueCursor = createCursor(null); + var changedBitsCursor = createCursor(0); + + var rendererSigil = void 0; + { + // Use this to detect multiple renderers using the same context + rendererSigil = {}; + } + + function pushProvider(providerFiber) { + var context = providerFiber.type._context; + + push(changedBitsCursor, context._changedBits, providerFiber); + push(valueCursor, context._currentValue, providerFiber); + push(providerCursor, providerFiber, providerFiber); + + context._currentValue = providerFiber.pendingProps.value; + context._changedBits = providerFiber.stateNode; + + { + warning(context._currentRenderer === null || context._currentRenderer === rendererSigil, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.'); + context._currentRenderer = rendererSigil; + } + } + + function popProvider(providerFiber) { + var changedBits = changedBitsCursor.current; + var currentValue = valueCursor.current; + + pop(providerCursor, providerFiber); + pop(valueCursor, providerFiber); + pop(changedBitsCursor, providerFiber); + + var context = providerFiber.type._context; + context._currentValue = currentValue; + context._changedBits = changedBits; + } + + return { + pushProvider: pushProvider, + popProvider: popProvider + }; +}; + +var ReactFiberStack = function () { + var valueStack = []; + + var fiberStack = void 0; + + { + fiberStack = []; + } + + var index = -1; + + function createCursor(defaultValue) { + return { + current: defaultValue + }; + } + + function isEmpty() { + return index === -1; + } + + function pop(cursor, fiber) { + if (index < 0) { + { + warning(false, 'Unexpected pop.'); + } + return; + } + + { + if (fiber !== fiberStack[index]) { + warning(false, '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; + } + + function checkThatStackIsEmpty() { + { + if (index !== -1) { + warning(false, 'Expected an empty stack. Something was not reset properly.'); + } + } + } + + function resetStackAfterFatalErrorInDev() { + { + index = -1; + valueStack.length = 0; + fiberStack.length = 0; + } + } + + return { + createCursor: createCursor, + isEmpty: isEmpty, + pop: pop, + push: push, + checkThatStackIsEmpty: checkThatStackIsEmpty, + resetStackAfterFatalErrorInDev: resetStackAfterFatalErrorInDev + }; +}; + +var invokeGuardedCallback$2 = ReactErrorUtils.invokeGuardedCallback; var hasCaughtError = ReactErrorUtils.hasCaughtError; var clearCaughtError = ReactErrorUtils.clearCaughtError; +var didWarnAboutStateTransition = void 0; +var didWarnSetStateChildContext = void 0; +var warnAboutUpdateOnUnmounted = void 0; +var warnAboutInvalidUpdates = void 0; + { - var didWarnAboutStateTransition = false; - var didWarnSetStateChildContext = false; + didWarnAboutStateTransition = false; + didWarnSetStateChildContext = false; var didWarnStateUpdateForUnmountedComponent = {}; - var warnAboutUpdateOnUnmounted = function (fiber) { + warnAboutUpdateOnUnmounted = function (fiber) { + // We show the whole stack but dedupe on the top component's name because + // the problematic code almost always lies inside that component. var componentName = getComponentName(fiber) || 'ReactClass'; if (didWarnStateUpdateForUnmountedComponent[componentName]) { return; } - warning(false, 'Can only update a mounted or mounting ' + 'component. This usually means you called setState, replaceState, ' + 'or forceUpdate on an unmounted component. This is a no-op.\n\nPlease ' + 'check the code for the %s component.', componentName); + warning(false, "Can't call setState (or forceUpdate) 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 the ' + 'componentWillUnmount method.%s', getStackAddendumByWorkInProgressFiber(fiber)); didWarnStateUpdateForUnmountedComponent[componentName] = true; }; - var warnAboutInvalidUpdates = function (instance) { + warnAboutInvalidUpdates = function (instance) { switch (ReactDebugCurrentFiber.phase) { case 'getChildContext': if (didWarnSetStateChildContext) { @@ -20391,39 +21776,54 @@ var clearCaughtError = ReactErrorUtils.clearCaughtError; } var ReactFiberScheduler = function (config) { - var hostContext = ReactFiberHostContext(config); + var stack = ReactFiberStack(); + var hostContext = ReactFiberHostContext(config, stack); + var legacyContext = ReactFiberLegacyContext(stack); + var newContext = ReactFiberNewContext(stack); + var popHostContext = hostContext.popHostContext, + popHostContainer = hostContext.popHostContainer; + var popTopLevelLegacyContextObject = legacyContext.popTopLevelContextObject, + popLegacyContextProvider = legacyContext.popContextProvider; + var popProvider = newContext.popProvider; + var hydrationContext = ReactFiberHydrationContext(config); - var popHostContainer = hostContext.popHostContainer, - popHostContext = hostContext.popHostContext, - resetHostContainer = hostContext.resetHostContainer; - var _ReactFiberBeginWork = ReactFiberBeginWork(config, hostContext, hydrationContext, scheduleWork, computeExpirationForFiber), - beginWork = _ReactFiberBeginWork.beginWork, - beginFailedWork = _ReactFiberBeginWork.beginFailedWork; + var _ReactFiberBeginWork = ReactFiberBeginWork(config, hostContext, legacyContext, newContext, hydrationContext, scheduleWork, computeExpirationForFiber), + beginWork = _ReactFiberBeginWork.beginWork; - var _ReactFiberCompleteWo = ReactFiberCompleteWork(config, hostContext, hydrationContext), + var _ReactFiberCompleteWo = ReactFiberCompleteWork(config, hostContext, legacyContext, newContext, hydrationContext), completeWork = _ReactFiberCompleteWo.completeWork; - var _ReactFiberCommitWork = ReactFiberCommitWork(config, captureError), + var _ReactFiberUnwindWork = ReactFiberUnwindWork(hostContext, legacyContext, newContext, scheduleWork, isAlreadyFailedLegacyErrorBoundary), + throwException = _ReactFiberUnwindWork.throwException, + unwindWork = _ReactFiberUnwindWork.unwindWork, + unwindInterruptedWork = _ReactFiberUnwindWork.unwindInterruptedWork; + + var _ReactFiberCommitWork = ReactFiberCommitWork(config, onCommitPhaseError, scheduleWork, computeExpirationForFiber, markLegacyErrorBoundaryAsFailed, recalculateCurrentTime), + commitBeforeMutationLifeCycles = _ReactFiberCommitWork.commitBeforeMutationLifeCycles, commitResetTextContent = _ReactFiberCommitWork.commitResetTextContent, commitPlacement = _ReactFiberCommitWork.commitPlacement, commitDeletion = _ReactFiberCommitWork.commitDeletion, commitWork = _ReactFiberCommitWork.commitWork, commitLifeCycles = _ReactFiberCommitWork.commitLifeCycles, + commitErrorLogging = _ReactFiberCommitWork.commitErrorLogging, commitAttachRef = _ReactFiberCommitWork.commitAttachRef, commitDetachRef = _ReactFiberCommitWork.commitDetachRef; var now = config.now, scheduleDeferredCallback = config.scheduleDeferredCallback, cancelDeferredCallback = config.cancelDeferredCallback, - useSyncScheduling = config.useSyncScheduling, prepareForCommit = config.prepareForCommit, resetAfterCommit = config.resetAfterCommit; // Represents the current time in ms. - var startTime = now(); + var originalStartTimeMs = now(); var mostRecentCurrentTime = msToExpirationTime(0); + var mostRecentCurrentTimeMs = originalStartTimeMs; + + // Used to ensure computeUniqueAsyncExpiration is monotonically increases. + var lastUniqueAsyncExpiration = 0; // Represents the expiration time that incoming updates should use. (If this // is NoWork, use the default strategy: async updates in async mode, sync @@ -20441,31 +21841,83 @@ var ReactFiberScheduler = function (config) { // The next fiber with an effect that we're currently committing. var nextEffect = null; - // Keep track of which fibers have captured an error that need to be handled. - // Work is removed from this collection after componentDidCatch is called. - var capturedErrors = null; - // Keep track of which fibers have failed during the current batch of work. - // This is a different set than capturedErrors, because it is not reset until - // the end of the batch. This is needed to propagate errors correctly if a - // subtree fails more than once. - var failedBoundaries = null; - // Error boundaries that captured an error during the current commit. - var commitPhaseBoundaries = null; - var firstUncaughtError = null; - var didFatal = false; - var isCommitting = false; - var isUnmounting = false; + + var isRootReadyForCommit = false; + + var legacyErrorBoundariesThatAlreadyFailed = null; // Used for performance tracking. var interruptedBy = null; - function resetContextStack() { - // Reset the stack - reset$1(); - // Reset the cursors - resetContext(); - resetHostContainer(); + var stashedWorkInProgressProperties = void 0; + var replayUnitOfWork = void 0; + var isReplayingFailedUnitOfWork = void 0; + var originalReplayError = void 0; + var rethrowOriginalError = void 0; + if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) { + stashedWorkInProgressProperties = null; + isReplayingFailedUnitOfWork = false; + originalReplayError = null; + replayUnitOfWork = function (failedUnitOfWork, error, isAsync) { + // Restore the original state of the work-in-progress + assignFiberPropertiesInDEV(failedUnitOfWork, stashedWorkInProgressProperties); + switch (failedUnitOfWork.tag) { + case HostRoot: + popHostContainer(failedUnitOfWork); + popTopLevelLegacyContextObject(failedUnitOfWork); + break; + case HostComponent: + popHostContext(failedUnitOfWork); + break; + case ClassComponent: + popLegacyContextProvider(failedUnitOfWork); + break; + case HostPortal: + popHostContainer(failedUnitOfWork); + break; + case ContextProvider: + popProvider(failedUnitOfWork); + break; + } + // Replay the begin phase. + isReplayingFailedUnitOfWork = true; + originalReplayError = error; + invokeGuardedCallback$2(null, workLoop, null, isAsync); + isReplayingFailedUnitOfWork = false; + originalReplayError = null; + if (hasCaughtError()) { + clearCaughtError(); + } else { + // If the begin phase did not fail the second time, set this pointer + // back to the original value. + nextUnitOfWork = failedUnitOfWork; + } + }; + rethrowOriginalError = function () { + throw originalReplayError; + }; + } + + function resetStack() { + if (nextUnitOfWork !== null) { + var interruptedWork = nextUnitOfWork['return']; + while (interruptedWork !== null) { + unwindInterruptedWork(interruptedWork); + interruptedWork = interruptedWork['return']; + } + } + + { + ReactStrictModeWarnings.discardPendingWarnings(); + stack.checkThatStackIsEmpty(); + } + + nextRoot = null; + nextRenderExpirationTime = NoWork; + nextUnitOfWork = null; + + isRootReadyForCommit = false; } function commitAllHostEffects() { @@ -20476,6 +21928,7 @@ var ReactFiberScheduler = function (config) { recordEffect(); var effectTag = nextEffect.effectTag; + if (effectTag & ContentReset) { commitResetTextContent(nextEffect); } @@ -20491,7 +21944,7 @@ var ReactFiberScheduler = function (config) { // updates, and deletions. To avoid needing to add a case for every // possible bitmap value, we remove the secondary effects from the // effect tag and switch on that value. - var primaryEffectTag = effectTag & ~(Callback | Err | ContentReset | Ref | PerformedWork); + var primaryEffectTag = effectTag & (Placement | Update | Deletion); switch (primaryEffectTag) { case Placement: { @@ -20525,9 +21978,7 @@ var ReactFiberScheduler = function (config) { } case Deletion: { - isUnmounting = true; commitDeletion(nextEffect); - isUnmounting = false; break; } } @@ -20539,14 +21990,41 @@ var ReactFiberScheduler = function (config) { } } - function commitAllLifeCycles() { + function commitBeforeMutationLifecycles() { + while (nextEffect !== null) { + var effectTag = nextEffect.effectTag; + + if (effectTag & Snapshot) { + recordEffect(); + var current = nextEffect.alternate; + commitBeforeMutationLifeCycles(current, nextEffect); + } + + // Don't cleanup effects yet; + // This will be done by commitAllLifeCycles() + nextEffect = nextEffect.nextEffect; + } + } + + function commitAllLifeCycles(finishedRoot, currentTime, committedExpirationTime) { + { + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); + + if (warnAboutDeprecatedLifecycles) { + ReactStrictModeWarnings.flushPendingDeprecationWarnings(); + } + } while (nextEffect !== null) { var effectTag = nextEffect.effectTag; if (effectTag & (Update | Callback)) { recordEffect(); var current = nextEffect.alternate; - commitLifeCycles(current, nextEffect); + commitLifeCycles(finishedRoot, current, nextEffect, currentTime, committedExpirationTime); + } + + if (effectTag & ErrLog) { + commitErrorLogging(nextEffect, onUncaughtError); } if (effectTag & Ref) { @@ -20554,11 +22032,6 @@ var ReactFiberScheduler = function (config) { commitAttachRef(nextEffect); } - if (effectTag & Err) { - recordEffect(); - commitErrorHandling(nextEffect); - } - var next = nextEffect.nextEffect; // Ensure that we clean these up so that we don't accidentally keep them. // I'm not actually sure this matters because we can't reset firstEffect @@ -20571,18 +22044,30 @@ var ReactFiberScheduler = function (config) { } } + function isAlreadyFailedLegacyErrorBoundary(instance) { + return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance); + } + + function markLegacyErrorBoundaryAsFailed(instance) { + if (legacyErrorBoundariesThatAlreadyFailed === null) { + legacyErrorBoundariesThatAlreadyFailed = new Set([instance]); + } else { + legacyErrorBoundariesThatAlreadyFailed.add(instance); + } + } + function commitRoot(finishedWork) { - // We keep track of this so that captureError can collect any boundaries - // that capture an error during the commit phase. The reason these aren't - // local to this function is because errors that occur during cWU are - // captured elsewhere, to prevent the unmount from being interrupted. isWorking = true; isCommitting = true; startCommitTimer(); var root = finishedWork.stateNode; !(root.current !== finishedWork) ? invariant(false, 'Cannot commit the same tree as before. This is probably a bug related to the return field. This error is likely caused by a bug in React. Please file an issue.') : void 0; - root.isReadyForCommit = false; + var committedExpirationTime = root.pendingCommitExpirationTime; + !(committedExpirationTime !== NoWork) ? invariant(false, 'Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.') : void 0; + root.pendingCommitExpirationTime = NoWork; + + var currentTime = recalculateCurrentTime(); // Reset this to null before calling lifecycles ReactCurrentOwner.current = null; @@ -20604,7 +22089,31 @@ var ReactFiberScheduler = function (config) { firstEffect = finishedWork.firstEffect; } - prepareForCommit(); + prepareForCommit(root.containerInfo); + + // Invoke instances of getSnapshotBeforeUpdate before mutation. + nextEffect = firstEffect; + startCommitSnapshotEffectsTimer(); + while (nextEffect !== null) { + var didError = false; + var error = void 0; + { + invokeGuardedCallback$2(null, commitBeforeMutationLifecycles, null); + if (hasCaughtError()) { + didError = true; + error = clearCaughtError(); + } + } + if (didError) { + !(nextEffect !== null) ? invariant(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : void 0; + onCommitPhaseError(nextEffect, error); + // Clean-up + if (nextEffect !== null) { + nextEffect = nextEffect.nextEffect; + } + } + } + stopCommitSnapshotEffectsTimer(); // Commit all the side-effects within a tree. We'll do this in two passes. // The first pass performs all the host insertions, updates, deletions and @@ -20612,18 +22121,18 @@ var ReactFiberScheduler = function (config) { nextEffect = firstEffect; startCommitHostEffectsTimer(); while (nextEffect !== null) { - var didError = false; + var _didError = false; var _error = void 0; { - invokeGuardedCallback$1(null, commitAllHostEffects, null); + invokeGuardedCallback$2(null, commitAllHostEffects, null); if (hasCaughtError()) { - didError = true; + _didError = true; _error = clearCaughtError(); } } - if (didError) { + if (_didError) { !(nextEffect !== null) ? invariant(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : void 0; - captureError(nextEffect, _error); + onCommitPhaseError(nextEffect, _error); // Clean-up if (nextEffect !== null) { nextEffect = nextEffect.nextEffect; @@ -20632,7 +22141,7 @@ var ReactFiberScheduler = function (config) { } stopCommitHostEffectsTimer(); - resetAfterCommit(); + resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after // the first pass of the commit phase, so that the previous tree is still @@ -20647,18 +22156,18 @@ var ReactFiberScheduler = function (config) { nextEffect = firstEffect; startCommitLifeCyclesTimer(); while (nextEffect !== null) { - var _didError = false; + var _didError2 = false; var _error2 = void 0; { - invokeGuardedCallback$1(null, commitAllLifeCycles, null); + invokeGuardedCallback$2(null, commitAllLifeCycles, null, root, currentTime, committedExpirationTime); if (hasCaughtError()) { - _didError = true; + _didError2 = true; _error2 = clearCaughtError(); } } - if (_didError) { + if (_didError2) { !(nextEffect !== null) ? invariant(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : void 0; - captureError(nextEffect, _error2); + onCommitPhaseError(nextEffect, _error2); if (nextEffect !== null) { nextEffect = nextEffect.nextEffect; } @@ -20676,26 +22185,12 @@ var ReactFiberScheduler = function (config) { ReactFiberInstrumentation_1.debugTool.onCommitWork(finishedWork); } - // If we caught any errors during this commit, schedule their boundaries - // to update. - if (commitPhaseBoundaries) { - commitPhaseBoundaries.forEach(scheduleErrorRecovery); - commitPhaseBoundaries = null; - } - - if (firstUncaughtError !== null) { - var _error3 = firstUncaughtError; - firstUncaughtError = null; - onUncaughtError(_error3); - } - var remainingTime = root.current.expirationTime; - if (remainingTime === NoWork) { - capturedErrors = null; - failedBoundaries = null; + // If there's no remaining work, we can clear the set of already failed + // error boundaries. + legacyErrorBoundariesThatAlreadyFailed = null; } - return remainingTime; } @@ -20723,6 +22218,9 @@ var ReactFiberScheduler = function (config) { } function completeUnitOfWork(workInProgress) { + // Attempt to complete the current unit of work, then move to the + // next sibling. If there are no more siblings, return to the + // parent fiber. while (true) { // The current, flushed, state of this fiber is the alternate. // Ideally nothing should rely on this, but relying on it here @@ -20732,76 +22230,130 @@ var ReactFiberScheduler = function (config) { { ReactDebugCurrentFiber.setCurrentFiber(workInProgress); } - var next = completeWork(current, workInProgress, nextRenderExpirationTime); - { - ReactDebugCurrentFiber.resetCurrentFiber(); - } var returnFiber = workInProgress['return']; var siblingFiber = workInProgress.sibling; - resetExpirationTime(workInProgress, nextRenderExpirationTime); - - if (next !== null) { + if ((workInProgress.effectTag & Incomplete) === NoEffect) { + // This fiber completed. + var next = completeWork(current, workInProgress, nextRenderExpirationTime); stopWorkTimer(workInProgress); + resetExpirationTime(workInProgress, nextRenderExpirationTime); + { + ReactDebugCurrentFiber.resetCurrentFiber(); + } + + if (next !== null) { + stopWorkTimer(workInProgress); + if (true && ReactFiberInstrumentation_1.debugTool) { + ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress); + } + // If completing this work spawned new work, do that next. We'll come + // back here again. + return next; + } + + if (returnFiber !== null && + // Do not append effects to parents if a sibling failed to complete + (returnFiber.effectTag & Incomplete) === NoEffect) { + // Append all the effects of the subtree and this fiber onto the effect + // list of the parent. The completion order of the children affects the + // side-effect order. + 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; + } + + // If this fiber had side-effects, we append it AFTER the children's + // side-effects. We can perform certain side-effects earlier if + // needed, by doing multiple passes over the effect list. We don't want + // to schedule our own side-effect on our own list because if end up + // reusing children we'll schedule this effect onto itself since we're + // at the end. + var effectTag = workInProgress.effectTag; + // Skip both NoWork and PerformedWork tags when creating the effect list. + // PerformedWork effect is read by React DevTools but shouldn't be committed. + if (effectTag > PerformedWork) { + if (returnFiber.lastEffect !== null) { + returnFiber.lastEffect.nextEffect = workInProgress; + } else { + returnFiber.firstEffect = workInProgress; + } + returnFiber.lastEffect = workInProgress; + } + } + if (true && ReactFiberInstrumentation_1.debugTool) { ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress); } - // If completing this work spawned new work, do that next. We'll come - // back here again. - return next; - } - if (returnFiber !== null) { - // Append all the effects of the subtree and this fiber onto the effect - // list of the parent. The completion order of the children affects the - // side-effect order. - if (returnFiber.firstEffect === null) { - returnFiber.firstEffect = workInProgress.firstEffect; + if (siblingFiber !== null) { + // If there is more work to do in this returnFiber, do that next. + return siblingFiber; + } else if (returnFiber !== null) { + // If there's no more work in this returnFiber. Complete the returnFiber. + workInProgress = returnFiber; + continue; + } else { + // We've reached the root. + isRootReadyForCommit = true; + return null; } - if (workInProgress.lastEffect !== null) { - if (returnFiber.lastEffect !== null) { - returnFiber.lastEffect.nextEffect = workInProgress.firstEffect; - } - returnFiber.lastEffect = workInProgress.lastEffect; - } - - // If this fiber had side-effects, we append it AFTER the children's - // side-effects. We can perform certain side-effects earlier if - // needed, by doing multiple passes over the effect list. We don't want - // to schedule our own side-effect on our own list because if end up - // reusing children we'll schedule this effect onto itself since we're - // at the end. - var effectTag = workInProgress.effectTag; - // Skip both NoWork and PerformedWork tags when creating the effect list. - // PerformedWork effect is read by React DevTools but shouldn't be committed. - if (effectTag > PerformedWork) { - if (returnFiber.lastEffect !== null) { - returnFiber.lastEffect.nextEffect = workInProgress; - } else { - returnFiber.firstEffect = workInProgress; - } - returnFiber.lastEffect = workInProgress; - } - } - - stopWorkTimer(workInProgress); - if (true && ReactFiberInstrumentation_1.debugTool) { - ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress); - } - - if (siblingFiber !== null) { - // If there is more work to do in this returnFiber, do that next. - return siblingFiber; - } else if (returnFiber !== null) { - // If there's no more work in this returnFiber. Complete the returnFiber. - workInProgress = returnFiber; - continue; } else { - // We've reached the root. - var root = workInProgress.stateNode; - root.isReadyForCommit = true; - return null; + // This fiber did not complete because something threw. Pop values off + // the stack without entering the complete phase. If this is a boundary, + // capture values if possible. + var _next = unwindWork(workInProgress); + // Because this fiber did not complete, don't reset its expiration time. + if (workInProgress.effectTag & DidCapture) { + // Restarting an error boundary + stopFailedWorkTimer(workInProgress); + } else { + stopWorkTimer(workInProgress); + } + + { + ReactDebugCurrentFiber.resetCurrentFiber(); + } + + if (_next !== null) { + stopWorkTimer(workInProgress); + if (true && ReactFiberInstrumentation_1.debugTool) { + ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress); + } + // If completing this work spawned new work, do that next. We'll come + // back here again. + // Since we're restarting, remove anything that is not a host effect + // from the effect tag. + _next.effectTag &= HostEffectMask; + return _next; + } + + if (returnFiber !== null) { + // Mark the parent fiber as incomplete and clear its effect list. + returnFiber.firstEffect = returnFiber.lastEffect = null; + returnFiber.effectTag |= Incomplete; + } + + if (true && ReactFiberInstrumentation_1.debugTool) { + ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress); + } + + if (siblingFiber !== null) { + // If there is more work to do in this returnFiber, do that next. + return siblingFiber; + } else if (returnFiber !== null) { + // If there's no more work in this returnFiber. Complete the returnFiber. + workInProgress = returnFiber; + continue; + } else { + return null; + } } } @@ -20824,9 +22376,19 @@ var ReactFiberScheduler = function (config) { ReactDebugCurrentFiber.setCurrentFiber(workInProgress); } + if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) { + stashedWorkInProgressProperties = assignFiberPropertiesInDEV(stashedWorkInProgressProperties, workInProgress); + } var next = beginWork(current, workInProgress, nextRenderExpirationTime); { ReactDebugCurrentFiber.resetCurrentFiber(); + if (isReplayingFailedUnitOfWork) { + // Currently replaying a failed unit of work. This should be unreachable, + // because the render phase is meant to be idempotent, and it should + // have thrown again. Since it didn't, rethrow the original error, so + // React's internal stack is not misaligned. + rethrowOriginalError(); + } } if (true && ReactFiberInstrumentation_1.debugTool) { ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress); @@ -20842,50 +22404,8 @@ var ReactFiberScheduler = function (config) { return next; } - function performFailedUnitOfWork(workInProgress) { - // The current, flushed, state of this fiber is the alternate. - // Ideally nothing should rely on this, but relying on it here - // means that we don't need an additional field on the work in - // progress. - var current = workInProgress.alternate; - - // See if beginning this work spawns more work. - startWorkTimer(workInProgress); - { - ReactDebugCurrentFiber.setCurrentFiber(workInProgress); - } - var next = beginFailedWork(current, workInProgress, nextRenderExpirationTime); - { - ReactDebugCurrentFiber.resetCurrentFiber(); - } - if (true && ReactFiberInstrumentation_1.debugTool) { - ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress); - } - - if (next === null) { - // If this doesn't spawn new work, complete the current work. - next = completeUnitOfWork(workInProgress); - } - - ReactCurrentOwner.current = null; - - return next; - } - - function workLoop(expirationTime) { - if (capturedErrors !== null) { - // If there are unhandled errors, switch to the slow work loop. - // TODO: How to avoid this check in the fast path? Maybe the renderer - // could keep track of which roots have unhandled errors and call a - // forked version of renderRoot. - slowWorkLoopThatChecksForFailedWork(expirationTime); - return; - } - if (nextRenderExpirationTime === NoWork || nextRenderExpirationTime > expirationTime) { - return; - } - - if (nextRenderExpirationTime <= mostRecentCurrentTime) { + function workLoop(isAsync) { + if (!isAsync) { // Flush all expired work. while (nextUnitOfWork !== null) { nextUnitOfWork = performUnitOfWork(nextUnitOfWork); @@ -20898,367 +22418,179 @@ var ReactFiberScheduler = function (config) { } } - function slowWorkLoopThatChecksForFailedWork(expirationTime) { - if (nextRenderExpirationTime === NoWork || nextRenderExpirationTime > expirationTime) { - return; - } - - if (nextRenderExpirationTime <= mostRecentCurrentTime) { - // Flush all expired work. - while (nextUnitOfWork !== null) { - if (hasCapturedError(nextUnitOfWork)) { - // Use a forked version of performUnitOfWork - nextUnitOfWork = performFailedUnitOfWork(nextUnitOfWork); - } else { - nextUnitOfWork = performUnitOfWork(nextUnitOfWork); - } - } - } else { - // Flush asynchronous work until the deadline runs out of time. - while (nextUnitOfWork !== null && !shouldYield()) { - if (hasCapturedError(nextUnitOfWork)) { - // Use a forked version of performUnitOfWork - nextUnitOfWork = performFailedUnitOfWork(nextUnitOfWork); - } else { - nextUnitOfWork = performUnitOfWork(nextUnitOfWork); - } - } - } - } - - function renderRootCatchBlock(root, failedWork, boundary, expirationTime) { - // We're going to restart the error boundary that captured the error. - // Conceptually, we're unwinding the stack. We need to unwind the - // context stack, too. - unwindContexts(failedWork, boundary); - - // Restart the error boundary using a forked version of - // performUnitOfWork that deletes the boundary's children. The entire - // failed subree will be unmounted. During the commit phase, a special - // lifecycle method is called on the error boundary, which triggers - // a re-render. - nextUnitOfWork = performFailedUnitOfWork(boundary); - - // Continue working. - workLoop(expirationTime); - } - - function renderRoot(root, expirationTime) { + function renderRoot(root, expirationTime, isAsync) { !!isWorking ? invariant(false, 'renderRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0; isWorking = true; - // We're about to mutate the work-in-progress tree. If the root was pending - // commit, it no longer is: we'll need to complete it again. - root.isReadyForCommit = false; - // Check if we're starting from a fresh stack, or if we're resuming from // previously yielded work. - if (root !== nextRoot || expirationTime !== nextRenderExpirationTime || nextUnitOfWork === null) { + if (expirationTime !== nextRenderExpirationTime || root !== nextRoot || nextUnitOfWork === null) { // Reset the stack and start working from the root. - resetContextStack(); + resetStack(); nextRoot = root; nextRenderExpirationTime = expirationTime; - nextUnitOfWork = createWorkInProgress(nextRoot.current, null, expirationTime); + nextUnitOfWork = createWorkInProgress(nextRoot.current, null, nextRenderExpirationTime); + root.pendingCommitExpirationTime = NoWork; } + var didFatal = false; + startWorkLoopTimer(nextUnitOfWork); - var didError = false; - var error = null; - { - invokeGuardedCallback$1(null, workLoop, null, expirationTime); - if (hasCaughtError()) { - didError = true; - error = clearCaughtError(); - } - } - - // An error was thrown during the render phase. - while (didError) { - if (didFatal) { - // This was a fatal error. Don't attempt to recover from it. - firstUncaughtError = error; - break; - } - - var failedWork = nextUnitOfWork; - if (failedWork === null) { - // An error was thrown but there's no current unit of work. This can - // happen during the commit phase if there's a bug in the renderer. - didFatal = true; - continue; - } - - // "Capture" the error by finding the nearest boundary. If there is no - // error boundary, we use the root. - var boundary = captureError(failedWork, error); - !(boundary !== null) ? invariant(false, 'Should have found an error boundary. This error is likely caused by a bug in React. Please file an issue.') : void 0; - - if (didFatal) { - // The error we just captured was a fatal error. This happens - // when the error propagates to the root more than once. - continue; - } - - didError = false; - error = null; - { - invokeGuardedCallback$1(null, renderRootCatchBlock, null, root, failedWork, boundary, expirationTime); - if (hasCaughtError()) { - didError = true; - error = clearCaughtError(); - continue; + do { + try { + workLoop(isAsync); + } catch (thrownValue) { + if (nextUnitOfWork === null) { + // This is a fatal error. + didFatal = true; + onUncaughtError(thrownValue); + break; } - } - // We're finished working. Exit the error loop. - break; - } - var uncaughtError = firstUncaughtError; + if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) { + var failedUnitOfWork = nextUnitOfWork; + replayUnitOfWork(failedUnitOfWork, thrownValue, isAsync); + } + + var sourceFiber = nextUnitOfWork; + var returnFiber = sourceFiber['return']; + if (returnFiber === null) { + // This is the root. The root could capture its own errors. However, + // we don't know if it errors before or after we pushed the host + // context. This information is needed to avoid a stack mismatch. + // Because we're not sure, treat this as a fatal error. We could track + // which phase it fails in, but doesn't seem worth it. At least + // for now. + didFatal = true; + onUncaughtError(thrownValue); + break; + } + throwException(returnFiber, sourceFiber, thrownValue); + nextUnitOfWork = completeUnitOfWork(sourceFiber); + } + break; + } while (true); // We're done performing work. Time to clean up. - stopWorkLoopTimer(interruptedBy); - interruptedBy = null; + var didCompleteRoot = false; isWorking = false; - didFatal = false; - firstUncaughtError = null; - if (uncaughtError !== null) { - onUncaughtError(uncaughtError); - } - - return root.isReadyForCommit ? root.current.alternate : null; - } - - // Returns the boundary that captured the error, or null if the error is ignored - function captureError(failedWork, error) { - // It is no longer valid because we exited the user code. - ReactCurrentOwner.current = null; - { - ReactDebugCurrentFiber.resetCurrentFiber(); - } - - // Search for the nearest error boundary. - var boundary = null; - - // Passed to logCapturedError() - var errorBoundaryFound = false; - var willRetry = false; - var errorBoundaryName = null; - - // Host containers are a special case. If the failed work itself is a host - // container, then it acts as its own boundary. In all other cases, we - // ignore the work itself and only search through the parents. - if (failedWork.tag === HostRoot) { - boundary = failedWork; - - if (isFailedBoundary(failedWork)) { - // If this root already failed, there must have been an error when - // attempting to unmount it. This is a worst-case scenario and - // should only be possible if there's a bug in the renderer. - didFatal = true; + // Yield back to main thread. + if (didFatal) { + stopWorkLoopTimer(interruptedBy, didCompleteRoot); + interruptedBy = null; + // There was a fatal error. + { + stack.resetStackAfterFatalErrorInDev(); + } + return null; + } else if (nextUnitOfWork === null) { + // We reached the root. + if (isRootReadyForCommit) { + didCompleteRoot = true; + stopWorkLoopTimer(interruptedBy, didCompleteRoot); + interruptedBy = null; + // The root successfully completed. It's ready for commit. + root.pendingCommitExpirationTime = expirationTime; + var finishedWork = root.current.alternate; + return finishedWork; + } else { + // The root did not complete. + stopWorkLoopTimer(interruptedBy, didCompleteRoot); + interruptedBy = null; + invariant(false, 'Expired work should have completed. This error is likely caused by a bug in React. Please file an issue.'); } } else { - var node = failedWork['return']; - while (node !== null && boundary === null) { - if (node.tag === ClassComponent) { - var instance = node.stateNode; - if (typeof instance.componentDidCatch === 'function') { - errorBoundaryFound = true; - errorBoundaryName = getComponentName(node); - - // Found an error boundary! - boundary = node; - willRetry = true; - } - } else if (node.tag === HostRoot) { - // Treat the root like a no-op error boundary - boundary = node; - } - - if (isFailedBoundary(node)) { - // This boundary is already in a failed state. - - // If we're currently unmounting, that means this error was - // thrown while unmounting a failed subtree. We should ignore - // the error. - if (isUnmounting) { - return null; - } - - // If we're in the commit phase, we should check to see if - // this boundary already captured an error during this commit. - // This case exists because multiple errors can be thrown during - // a single commit without interruption. - if (commitPhaseBoundaries !== null && (commitPhaseBoundaries.has(node) || node.alternate !== null && commitPhaseBoundaries.has(node.alternate))) { - // If so, we should ignore this error. - return null; - } - - // The error should propagate to the next boundary -— we keep looking. - boundary = null; - willRetry = false; - } - - node = node['return']; - } - } - - if (boundary !== null) { - // Add to the collection of failed boundaries. This lets us know that - // subsequent errors in this subtree should propagate to the next boundary. - if (failedBoundaries === null) { - failedBoundaries = new Set(); - } - failedBoundaries.add(boundary); - - // This method is unsafe outside of the begin and complete phases. - // We might be in the commit phase when an error is captured. - // The risk is that the return path from this Fiber may not be accurate. - // That risk is acceptable given the benefit of providing users more context. - var _componentStack = getStackAddendumByWorkInProgressFiber(failedWork); - var _componentName = getComponentName(failedWork); - - // Add to the collection of captured errors. This is stored as a global - // map of errors and their component stack location keyed by the boundaries - // that capture them. We mostly use this Map as a Set; it's a Map only to - // avoid adding a field to Fiber to store the error. - if (capturedErrors === null) { - capturedErrors = new Map(); - } - - var capturedError = { - componentName: _componentName, - componentStack: _componentStack, - error: error, - errorBoundary: errorBoundaryFound ? boundary.stateNode : null, - errorBoundaryFound: errorBoundaryFound, - errorBoundaryName: errorBoundaryName, - willRetry: willRetry - }; - - capturedErrors.set(boundary, capturedError); - - try { - logCapturedError(capturedError); - } catch (e) { - // Prevent cycle if logCapturedError() throws. - // A cycle may still occur if logCapturedError renders a component that throws. - var suppressLogging = e && e.suppressReactErrorLogging; - if (!suppressLogging) { - console.error(e); - } - } - - // If we're in the commit phase, defer scheduling an update on the - // boundary until after the commit is complete - if (isCommitting) { - if (commitPhaseBoundaries === null) { - commitPhaseBoundaries = new Set(); - } - commitPhaseBoundaries.add(boundary); - } else { - // Otherwise, schedule an update now. - // TODO: Is this actually necessary during the render phase? Is it - // possible to unwind and continue rendering at the same priority, - // without corrupting internal state? - scheduleErrorRecovery(boundary); - } - return boundary; - } else if (firstUncaughtError === null) { - // If no boundary is found, we'll need to throw the error - firstUncaughtError = error; - } - return null; - } - - function hasCapturedError(fiber) { - // TODO: capturedErrors should store the boundary instance, to avoid needing - // to check the alternate. - return capturedErrors !== null && (capturedErrors.has(fiber) || fiber.alternate !== null && capturedErrors.has(fiber.alternate)); - } - - function isFailedBoundary(fiber) { - // TODO: failedBoundaries should store the boundary instance, to avoid - // needing to check the alternate. - return failedBoundaries !== null && (failedBoundaries.has(fiber) || fiber.alternate !== null && failedBoundaries.has(fiber.alternate)); - } - - function commitErrorHandling(effectfulFiber) { - var capturedError = void 0; - if (capturedErrors !== null) { - capturedError = capturedErrors.get(effectfulFiber); - capturedErrors['delete'](effectfulFiber); - if (capturedError == null) { - if (effectfulFiber.alternate !== null) { - effectfulFiber = effectfulFiber.alternate; - capturedError = capturedErrors.get(effectfulFiber); - capturedErrors['delete'](effectfulFiber); - } - } - } - - !(capturedError != null) ? invariant(false, 'No error for given unit of work. This error is likely caused by a bug in React. Please file an issue.') : void 0; - - switch (effectfulFiber.tag) { - case ClassComponent: - var instance = effectfulFiber.stateNode; - - var info = { - componentStack: capturedError.componentStack - }; - - // Allow the boundary to handle the error, usually by scheduling - // an update to itself - instance.componentDidCatch(capturedError.error, info); - return; - case HostRoot: - if (firstUncaughtError === null) { - firstUncaughtError = capturedError.error; - } - return; - default: - invariant(false, 'Invalid type of work. This error is likely caused by a bug in React. Please file an issue.'); + stopWorkLoopTimer(interruptedBy, didCompleteRoot); + interruptedBy = null; + // There's more work to do, but we ran out of time. Yield back to + // the renderer. + return null; } } - function unwindContexts(from, to) { - var node = from; - while (node !== null) { - switch (node.tag) { + function scheduleCapture(sourceFiber, boundaryFiber, value, expirationTime) { + // TODO: We only support dispatching errors. + var capturedValue = createCapturedValue(value, sourceFiber); + var update = { + expirationTime: expirationTime, + partialState: null, + callback: null, + isReplace: false, + isForced: false, + capturedValue: capturedValue, + next: null + }; + insertUpdateIntoFiber(boundaryFiber, update); + scheduleWork(boundaryFiber, expirationTime); + } + + function dispatch(sourceFiber, value, expirationTime) { + !(!isWorking || isCommitting) ? invariant(false, 'dispatch: Cannot dispatch during the render phase.') : void 0; + + // TODO: Handle arrays + + var fiber = sourceFiber['return']; + while (fiber !== null) { + switch (fiber.tag) { case ClassComponent: - popContextProvider(node); - break; - case HostComponent: - popHostContext(node); + var ctor = fiber.type; + var instance = fiber.stateNode; + if (typeof ctor.getDerivedStateFromCatch === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) { + scheduleCapture(sourceFiber, fiber, value, expirationTime); + return; + } break; + // TODO: Handle async boundaries case HostRoot: - popHostContainer(node); - break; - case HostPortal: - popHostContainer(node); - break; + scheduleCapture(sourceFiber, fiber, value, expirationTime); + return; } - if (node === to || node.alternate === to) { - stopFailedWorkTimer(node); - break; - } else { - stopWorkTimer(node); - } - node = node['return']; + fiber = fiber['return']; + } + + if (sourceFiber.tag === HostRoot) { + // Error was thrown at the root. There is no parent, so the root + // itself should capture it. + scheduleCapture(sourceFiber, sourceFiber, value, expirationTime); } } - function computeAsyncExpiration() { + function onCommitPhaseError(fiber, error) { + return dispatch(fiber, error, Sync); + } + + function computeAsyncExpiration(currentTime) { // Given the current clock time, returns an expiration time. We use rounding // to batch like updates together. // Should complete within ~1000ms. 1200ms max. - var currentTime = recalculateCurrentTime(); - var expirationMs = 1000; - var bucketSizeMs = 200; + var expirationMs = 5000; + var bucketSizeMs = 250; return computeExpirationBucket(currentTime, expirationMs, bucketSizeMs); } + function computeInteractiveExpiration(currentTime) { + // Should complete within ~500ms. 600ms max. + var expirationMs = 500; + var bucketSizeMs = 100; + return computeExpirationBucket(currentTime, expirationMs, bucketSizeMs); + } + + // Creates a unique async expiration time. + function computeUniqueAsyncExpiration() { + var currentTime = recalculateCurrentTime(); + var result = computeAsyncExpiration(currentTime); + if (result <= lastUniqueAsyncExpiration) { + // Since we assume the current time monotonically increases, we only hit + // this branch when computeUniqueAsyncExpiration is fired multiple times + // within a 200ms window (or whatever the async bucket size is). + result = lastUniqueAsyncExpiration + 1; + } + lastUniqueAsyncExpiration = result; + return lastUniqueAsyncExpiration; + } + function computeExpirationForFiber(fiber) { var expirationTime = void 0; if (expirationContext !== NoWork) { @@ -21277,12 +22609,27 @@ var ReactFiberScheduler = function (config) { } else { // No explicit expiration context was set, and we're not currently // performing work. Calculate a new expiration time. - if (useSyncScheduling && !(fiber.internalContextTag & AsyncUpdates)) { + if (fiber.mode & AsyncMode) { + if (isBatchingInteractiveUpdates) { + // This is an interactive update + var currentTime = recalculateCurrentTime(); + expirationTime = computeInteractiveExpiration(currentTime); + } else { + // This is an async update + var _currentTime = recalculateCurrentTime(); + expirationTime = computeAsyncExpiration(_currentTime); + } + } else { // This is a sync update expirationTime = Sync; - } else { - // This is an async update - expirationTime = computeAsyncExpiration(); + } + } + if (isBatchingInteractiveUpdates) { + // This is an interactive update. Keep track of the lowest pending + // interactive expiration time. This allows us to synchronously flush + // all interactive updates when needed. + if (lowestPendingInteractiveExpirationTime === NoWork || expirationTime > lowestPendingInteractiveExpirationTime) { + lowestPendingInteractiveExpirationTime = expirationTime; } } return expirationTime; @@ -21292,19 +22639,6 @@ var ReactFiberScheduler = function (config) { return scheduleWorkImpl(fiber, expirationTime, false); } - function checkRootNeedsClearing(root, fiber, expirationTime) { - if (!isWorking && root === nextRoot && expirationTime < nextRenderExpirationTime) { - // Restart the root from the top. - if (nextUnitOfWork !== null) { - // This is an interruption. (Used for performance tracking.) - interruptedBy = fiber; - } - nextRoot = null; - nextUnitOfWork = null; - nextRenderExpirationTime = NoWork; - } - } - function scheduleWorkImpl(fiber, expirationTime, isErrorRecovery) { recordScheduleUpdate(); @@ -21330,10 +22664,23 @@ var ReactFiberScheduler = function (config) { if (node['return'] === null) { if (node.tag === HostRoot) { var root = node.stateNode; - - checkRootNeedsClearing(root, fiber, expirationTime); - requestWork(root, expirationTime); - checkRootNeedsClearing(root, fiber, expirationTime); + if (!isWorking && nextRenderExpirationTime !== NoWork && expirationTime < nextRenderExpirationTime) { + // This is an interruption. (Used for performance tracking.) + interruptedBy = fiber; + resetStack(); + } + if ( + // If we're in the render phase, we don't need to schedule this root + // for an update, because we'll do it before we exit... + !isWorking || isCommitting || + // ...unless this is a different root than the one we're rendering. + nextRoot !== root) { + // Add this root to the root schedule. + requestWork(root, expirationTime); + } + if (nestedUpdateCount > NESTED_UPDATE_LIMIT) { + invariant(false, '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.'); + } } else { { if (!isErrorRecovery && fiber.tag === ClassComponent) { @@ -21347,32 +22694,28 @@ var ReactFiberScheduler = function (config) { } } - function scheduleErrorRecovery(fiber) { - scheduleWorkImpl(fiber, Sync, true); - } - function recalculateCurrentTime() { // Subtract initial time so it fits inside 32bits - var ms = now() - startTime; - mostRecentCurrentTime = msToExpirationTime(ms); + mostRecentCurrentTimeMs = now() - originalStartTimeMs; + mostRecentCurrentTime = msToExpirationTime(mostRecentCurrentTimeMs); return mostRecentCurrentTime; } function deferredUpdates(fn) { var previousExpirationContext = expirationContext; - expirationContext = computeAsyncExpiration(); + var currentTime = recalculateCurrentTime(); + expirationContext = computeAsyncExpiration(currentTime); try { return fn(); } finally { expirationContext = previousExpirationContext; } } - - function syncUpdates(fn) { + function syncUpdates(fn, a, b, c, d) { var previousExpirationContext = expirationContext; expirationContext = Sync; try { - return fn(); + return fn(a, b, c, d); } finally { expirationContext = previousExpirationContext; } @@ -21390,6 +22733,7 @@ var ReactFiberScheduler = function (config) { var isRendering = false; var nextFlushedRoot = null; var nextFlushedExpirationTime = NoWork; + var lowestPendingInteractiveExpirationTime = NoWork; var deadlineDidExpire = false; var hasUnhandledError = false; var unhandledError = null; @@ -21397,6 +22741,9 @@ var ReactFiberScheduler = function (config) { var isBatchingUpdates = false; var isUnbatchingUpdates = false; + var isBatchingInteractiveUpdates = false; + + var completedBatches = null; // Use these to prevent an infinite loop of nested updates var NESTED_UPDATE_LIMIT = 1000; @@ -21421,7 +22768,7 @@ var ReactFiberScheduler = function (config) { } // Compute a timeout for the given expiration time. - var currentMs = now() - startTime; + var currentMs = now() - originalStartTimeMs; var expirationMs = expirationTimeToMs(expirationTime); var timeout = expirationMs - currentMs; @@ -21432,10 +22779,35 @@ var ReactFiberScheduler = function (config) { // requestWork is called by the scheduler whenever a root receives an update. // It's up to the renderer to call renderRoot at some point in the future. function requestWork(root, expirationTime) { - if (nestedUpdateCount > NESTED_UPDATE_LIMIT) { - invariant(false, '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.'); + addRootToSchedule(root, expirationTime); + + if (isRendering) { + // Prevent reentrancy. Remaining work will be scheduled at the end of + // the currently rendering batch. + return; } + if (isBatchingUpdates) { + // Flush work at the end of the batch. + if (isUnbatchingUpdates) { + // ...unless we're inside unbatchedUpdates, in which case we should + // flush it now. + nextFlushedRoot = root; + nextFlushedExpirationTime = Sync; + performWorkOnRoot(root, Sync, false); + } + return; + } + + // TODO: Get rid of Sync and use current time? + if (expirationTime === Sync) { + performSyncWork(); + } else { + scheduleCallbackWithExpiration(expirationTime); + } + } + + function addRootToSchedule(root, expirationTime) { // Add the root to the schedule. // Check if this root is already part of the schedule. if (root.nextScheduledRoot === null) { @@ -21457,37 +22829,11 @@ var ReactFiberScheduler = function (config) { root.remainingExpirationTime = expirationTime; } } - - if (isRendering) { - // Prevent reentrancy. Remaining work will be scheduled at the end of - // the currently rendering batch. - return; - } - - if (isBatchingUpdates) { - // Flush work at the end of the batch. - if (isUnbatchingUpdates) { - // ...unless we're inside unbatchedUpdates, in which case we should - // flush it now. - nextFlushedRoot = root; - nextFlushedExpirationTime = Sync; - performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime); - } - return; - } - - // TODO: Get rid of Sync and use current time? - if (expirationTime === Sync) { - performWork(Sync, null); - } else { - scheduleCallbackWithExpiration(expirationTime); - } } function findHighestPriorityRoot() { var highestPriorityWork = NoWork; var highestPriorityRoot = null; - if (lastScheduledRoot !== null) { var previousScheduledRoot = lastScheduledRoot; var root = firstScheduledRoot; @@ -21540,7 +22886,7 @@ var ReactFiberScheduler = function (config) { // If the next root is the same as the previous root, this is a nested // update. To prevent an infinite loop, increment the nested update count. var previousFlushedRoot = nextFlushedRoot; - if (previousFlushedRoot !== null && previousFlushedRoot === highestPriorityRoot) { + if (previousFlushedRoot !== null && previousFlushedRoot === highestPriorityRoot && highestPriorityWork === Sync) { nestedUpdateCount++; } else { // Reset whenever we switch roots. @@ -21551,10 +22897,14 @@ var ReactFiberScheduler = function (config) { } function performAsyncWork(dl) { - performWork(NoWork, dl); + performWork(NoWork, true, dl); } - function performWork(minExpirationTime, dl) { + function performSyncWork() { + performWork(Sync, false, null); + } + + function performWork(minExpirationTime, isAsync, dl) { deadline = dl; // Keep working on roots until there's no more work, or until the we reach @@ -21563,13 +22913,20 @@ var ReactFiberScheduler = function (config) { if (enableUserTimingAPI && deadline !== null) { var didExpire = nextFlushedExpirationTime < recalculateCurrentTime(); - stopRequestCallbackTimer(didExpire); + var timeout = expirationTimeToMs(nextFlushedExpirationTime); + stopRequestCallbackTimer(didExpire, timeout); } - while (nextFlushedRoot !== null && nextFlushedExpirationTime !== NoWork && (minExpirationTime === NoWork || nextFlushedExpirationTime <= minExpirationTime) && !deadlineDidExpire) { - performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime); - // Find the next highest priority work. - findHighestPriorityRoot(); + if (isAsync) { + while (nextFlushedRoot !== null && nextFlushedExpirationTime !== NoWork && (minExpirationTime === NoWork || minExpirationTime >= nextFlushedExpirationTime) && (!deadlineDidExpire || recalculateCurrentTime() >= nextFlushedExpirationTime)) { + performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime, !deadlineDidExpire); + findHighestPriorityRoot(); + } + } else { + while (nextFlushedRoot !== null && nextFlushedExpirationTime !== NoWork && (minExpirationTime === NoWork || minExpirationTime >= nextFlushedExpirationTime)) { + performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime, false); + findHighestPriorityRoot(); + } } // We're done flushing work. Either we ran out of time in this callback, @@ -21588,36 +22945,68 @@ var ReactFiberScheduler = function (config) { // Clean-up. deadline = null; deadlineDidExpire = false; + + finishRendering(); + } + + function flushRoot(root, expirationTime) { + !!isRendering ? invariant(false, 'work.commit(): Cannot commit while already rendering. This likely means you attempted to commit from inside a lifecycle method.') : void 0; + // Perform work on root as if the given expiration time is the current time. + // This has the effect of synchronously flushing all work up to and + // including the given time. + nextFlushedRoot = root; + nextFlushedExpirationTime = expirationTime; + performWorkOnRoot(root, expirationTime, false); + // Flush any sync work that was scheduled by lifecycles + performSyncWork(); + finishRendering(); + } + + function finishRendering() { nestedUpdateCount = 0; + if (completedBatches !== null) { + var batches = completedBatches; + completedBatches = null; + for (var i = 0; i < batches.length; i++) { + var batch = batches[i]; + try { + batch._onComplete(); + } catch (error) { + if (!hasUnhandledError) { + hasUnhandledError = true; + unhandledError = error; + } + } + } + } + if (hasUnhandledError) { - var _error4 = unhandledError; + var error = unhandledError; unhandledError = null; hasUnhandledError = false; - throw _error4; + throw error; } } - function performWorkOnRoot(root, expirationTime) { + function performWorkOnRoot(root, expirationTime, isAsync) { !!isRendering ? invariant(false, 'performWorkOnRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0; isRendering = true; // Check if this is async work or sync/expired work. - // TODO: Pass current time as argument to renderRoot, commitRoot - if (expirationTime <= recalculateCurrentTime()) { + if (!isAsync) { // Flush sync work. var finishedWork = root.finishedWork; if (finishedWork !== null) { // This root is already complete. We can commit it. - root.finishedWork = null; - root.remainingExpirationTime = commitRoot(finishedWork); + completeRoot(root, finishedWork, expirationTime); } else { root.finishedWork = null; - finishedWork = renderRoot(root, expirationTime); + finishedWork = renderRoot(root, expirationTime, false); if (finishedWork !== null) { // We've completed the root. Commit it. - root.remainingExpirationTime = commitRoot(finishedWork); + completeRoot(root, finishedWork, expirationTime); } } } else { @@ -21625,17 +23014,16 @@ var ReactFiberScheduler = function (config) { var _finishedWork = root.finishedWork; if (_finishedWork !== null) { // This root is already complete. We can commit it. - root.finishedWork = null; - root.remainingExpirationTime = commitRoot(_finishedWork); + completeRoot(root, _finishedWork, expirationTime); } else { root.finishedWork = null; - _finishedWork = renderRoot(root, expirationTime); + _finishedWork = renderRoot(root, expirationTime, true); if (_finishedWork !== null) { // We've completed the root. Check the deadline one more time // before committing. if (!shouldYield()) { // Still time left. Commit the root. - root.remainingExpirationTime = commitRoot(_finishedWork); + completeRoot(root, _finishedWork, expirationTime); } else { // There's no time left. Mark this root as complete. We'll come // back and commit it later. @@ -21648,6 +23036,29 @@ var ReactFiberScheduler = function (config) { isRendering = false; } + function completeRoot(root, finishedWork, expirationTime) { + // Check if there's a batch that matches this expiration time. + var firstBatch = root.firstBatch; + if (firstBatch !== null && firstBatch._expirationTime <= expirationTime) { + if (completedBatches === null) { + completedBatches = [firstBatch]; + } else { + completedBatches.push(firstBatch); + } + if (firstBatch._defer) { + // This root is blocked from committing by a batch. Unschedule it until + // we receive another update. + root.finishedWork = finishedWork; + root.remainingExpirationTime = NoWork; + return; + } + } + + // Commit the root. + root.finishedWork = null; + root.remainingExpirationTime = commitRoot(finishedWork); + } + // When working on async work, the reconciler asks the renderer if it should // yield execution. For DOM, we implement this with requestIdleCallback. function shouldYield() { @@ -21663,8 +23074,6 @@ var ReactFiberScheduler = function (config) { return true; } - // TODO: Not happy about this hook. Conceptually, renderRoot should return a - // tuple of (isReadyForCommit, didError, error) function onUncaughtError(error) { !(nextFlushedRoot !== null) ? invariant(false, 'Should be working on a root. This error is likely caused by a bug in React. Please file an issue.') : void 0; // Unschedule this root so we don't work on it again until there's @@ -21686,81 +23095,153 @@ var ReactFiberScheduler = function (config) { } finally { isBatchingUpdates = previousIsBatchingUpdates; if (!isBatchingUpdates && !isRendering) { - performWork(Sync, null); + performSyncWork(); } } } // TODO: Batching should be implemented at the renderer level, not inside // the reconciler. - function unbatchedUpdates(fn) { + function unbatchedUpdates(fn, a) { if (isBatchingUpdates && !isUnbatchingUpdates) { isUnbatchingUpdates = true; try { - return fn(); + return fn(a); } finally { isUnbatchingUpdates = false; } } - return fn(); + return fn(a); } // TODO: Batching should be implemented at the renderer level, not within // the reconciler. - function flushSync(fn) { + function flushSync(fn, a) { + !!isRendering ? invariant(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0; var previousIsBatchingUpdates = isBatchingUpdates; isBatchingUpdates = true; try { - return syncUpdates(fn); + return syncUpdates(fn, a); } finally { isBatchingUpdates = previousIsBatchingUpdates; - !!isRendering ? invariant(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0; - performWork(Sync, null); + performSyncWork(); + } + } + + function interactiveUpdates(fn, a, b) { + if (isBatchingInteractiveUpdates) { + return fn(a, b); + } + // If there are any pending interactive updates, synchronously flush them. + // This needs to happen before we read any handlers, because the effect of + // the previous event may influence which handlers are called during + // this event. + if (!isBatchingUpdates && !isRendering && lowestPendingInteractiveExpirationTime !== NoWork) { + // Synchronously flush pending interactive updates. + performWork(lowestPendingInteractiveExpirationTime, false, null); + lowestPendingInteractiveExpirationTime = NoWork; + } + var previousIsBatchingInteractiveUpdates = isBatchingInteractiveUpdates; + var previousIsBatchingUpdates = isBatchingUpdates; + isBatchingInteractiveUpdates = true; + isBatchingUpdates = true; + try { + return fn(a, b); + } finally { + isBatchingInteractiveUpdates = previousIsBatchingInteractiveUpdates; + isBatchingUpdates = previousIsBatchingUpdates; + if (!isBatchingUpdates && !isRendering) { + performSyncWork(); + } + } + } + + function flushInteractiveUpdates() { + if (!isRendering && lowestPendingInteractiveExpirationTime !== NoWork) { + // Synchronously flush pending interactive updates. + performWork(lowestPendingInteractiveExpirationTime, false, null); + lowestPendingInteractiveExpirationTime = NoWork; + } + } + + function flushControlled(fn) { + var previousIsBatchingUpdates = isBatchingUpdates; + isBatchingUpdates = true; + try { + syncUpdates(fn); + } finally { + isBatchingUpdates = previousIsBatchingUpdates; + if (!isBatchingUpdates && !isRendering) { + performWork(Sync, false, null); + } } } return { - computeAsyncExpiration: computeAsyncExpiration, + recalculateCurrentTime: recalculateCurrentTime, computeExpirationForFiber: computeExpirationForFiber, scheduleWork: scheduleWork, + requestWork: requestWork, + flushRoot: flushRoot, batchedUpdates: batchedUpdates, unbatchedUpdates: unbatchedUpdates, flushSync: flushSync, - deferredUpdates: deferredUpdates + flushControlled: flushControlled, + deferredUpdates: deferredUpdates, + syncUpdates: syncUpdates, + interactiveUpdates: interactiveUpdates, + flushInteractiveUpdates: flushInteractiveUpdates, + computeUniqueAsyncExpiration: computeUniqueAsyncExpiration, + legacyContext: legacyContext }; }; +var didWarnAboutNestedUpdates = void 0; + { - var didWarnAboutNestedUpdates = false; + didWarnAboutNestedUpdates = false; } // 0 is PROD, 1 is DEV. // Might add PROFILE later. -function getContextForSubtree(parentComponent) { - if (!parentComponent) { - return emptyObject; - } - - var fiber = get(parentComponent); - var parentContext = findCurrentUnmaskedContext(fiber); - return isContextProvider(fiber) ? processChildContext(fiber, parentContext) : parentContext; -} - var ReactFiberReconciler$1 = function (config) { var getPublicInstance = config.getPublicInstance; var _ReactFiberScheduler = ReactFiberScheduler(config), - computeAsyncExpiration = _ReactFiberScheduler.computeAsyncExpiration, + computeUniqueAsyncExpiration = _ReactFiberScheduler.computeUniqueAsyncExpiration, + recalculateCurrentTime = _ReactFiberScheduler.recalculateCurrentTime, computeExpirationForFiber = _ReactFiberScheduler.computeExpirationForFiber, scheduleWork = _ReactFiberScheduler.scheduleWork, + requestWork = _ReactFiberScheduler.requestWork, + flushRoot = _ReactFiberScheduler.flushRoot, batchedUpdates = _ReactFiberScheduler.batchedUpdates, unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates, flushSync = _ReactFiberScheduler.flushSync, - deferredUpdates = _ReactFiberScheduler.deferredUpdates; + flushControlled = _ReactFiberScheduler.flushControlled, + deferredUpdates = _ReactFiberScheduler.deferredUpdates, + syncUpdates = _ReactFiberScheduler.syncUpdates, + interactiveUpdates = _ReactFiberScheduler.interactiveUpdates, + flushInteractiveUpdates = _ReactFiberScheduler.flushInteractiveUpdates, + legacyContext = _ReactFiberScheduler.legacyContext; - function scheduleTopLevelUpdate(current, element, callback) { + var findCurrentUnmaskedContext = legacyContext.findCurrentUnmaskedContext, + isContextProvider = legacyContext.isContextProvider, + processChildContext = legacyContext.processChildContext; + + + function getContextForSubtree(parentComponent) { + if (!parentComponent) { + return emptyObject; + } + + var fiber = get(parentComponent); + var parentContext = findCurrentUnmaskedContext(fiber); + return isContextProvider(fiber) ? processChildContext(fiber, parentContext) : parentContext; + } + + function scheduleRootUpdate(current, element, currentTime, expirationTime, callback) { { if (ReactDebugCurrentFiber.phase === 'render' && ReactDebugCurrentFiber.current !== null && !didWarnAboutNestedUpdates) { didWarnAboutNestedUpdates = true; @@ -21773,27 +23254,45 @@ var ReactFiberReconciler$1 = function (config) { warning(callback === null || typeof callback === 'function', 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback); } - var expirationTime = void 0; - // Check if the top-level element is an async wrapper component. If so, - // treat updates to the root as async. This is a bit weird but lets us - // avoid a separate `renderAsync` API. - if (enableAsyncSubtreeAPI && element != null && element.type != null && element.type.prototype != null && element.type.prototype.unstable_isAsyncReactComponent === true) { - expirationTime = computeAsyncExpiration(); - } else { - expirationTime = computeExpirationForFiber(current); - } - var update = { expirationTime: expirationTime, partialState: { element: element }, callback: callback, isReplace: false, isForced: false, - nextCallback: null, + capturedValue: null, next: null }; insertUpdateIntoFiber(current, update); scheduleWork(current, expirationTime); + + return expirationTime; + } + + function updateContainerAtExpirationTime(element, container, parentComponent, currentTime, expirationTime, callback) { + // TODO: If this is a nested container, this won't be the root. + var current = container.current; + + { + if (ReactFiberInstrumentation_1.debugTool) { + if (current.alternate === null) { + ReactFiberInstrumentation_1.debugTool.onMountContainer(container); + } else if (element === null) { + ReactFiberInstrumentation_1.debugTool.onUnmountContainer(container); + } else { + ReactFiberInstrumentation_1.debugTool.onUpdateContainer(container); + } + } + } + + var context = getContextForSubtree(parentComponent); + if (container.context === null) { + container.context = context; + } else { + container.pendingContext = context; + } + + return scheduleRootUpdate(current, element, currentTime, expirationTime, callback); } function findHostInstance(fiber) { @@ -21805,42 +23304,41 @@ var ReactFiberReconciler$1 = function (config) { } return { - createContainer: function (containerInfo, hydrate) { - return createFiberRoot(containerInfo, hydrate); + createContainer: function (containerInfo, isAsync, hydrate) { + return createFiberRoot(containerInfo, isAsync, hydrate); }, updateContainer: function (element, container, parentComponent, callback) { - // TODO: If this is a nested container, this won't be the root. var current = container.current; - - { - if (ReactFiberInstrumentation_1.debugTool) { - if (current.alternate === null) { - ReactFiberInstrumentation_1.debugTool.onMountContainer(container); - } else if (element === null) { - ReactFiberInstrumentation_1.debugTool.onUnmountContainer(container); - } else { - ReactFiberInstrumentation_1.debugTool.onUpdateContainer(container); - } - } - } - - var context = getContextForSubtree(parentComponent); - if (container.context === null) { - container.context = context; - } else { - container.pendingContext = context; - } - - scheduleTopLevelUpdate(current, element, callback); + var currentTime = recalculateCurrentTime(); + var expirationTime = computeExpirationForFiber(current); + return updateContainerAtExpirationTime(element, container, parentComponent, currentTime, expirationTime, callback); + }, + updateContainerAtExpirationTime: function (element, container, parentComponent, expirationTime, callback) { + var currentTime = recalculateCurrentTime(); + return updateContainerAtExpirationTime(element, container, parentComponent, currentTime, expirationTime, callback); }, + flushRoot: flushRoot, + + requestWork: requestWork, + + computeUniqueAsyncExpiration: computeUniqueAsyncExpiration, + batchedUpdates: batchedUpdates, unbatchedUpdates: unbatchedUpdates, deferredUpdates: deferredUpdates, + syncUpdates: syncUpdates, + + interactiveUpdates: interactiveUpdates, + + flushInteractiveUpdates: flushInteractiveUpdates, + + flushControlled: flushControlled, + flushSync: flushSync, getPublicRootInstance: function (container) { @@ -21916,7 +23414,7 @@ implementation) { // TODO: this is special because it gets imported during build. -var ReactVersion = '16.2.0'; +var ReactVersion = '16.3.1'; // a requestAnimationFrame, storing the time for the start of the frame, then // scheduling a postMessage which gets scheduled after paint. Within the @@ -21927,7 +23425,7 @@ var ReactVersion = '16.2.0'; { if (ExecutionEnvironment.canUseDOM && typeof requestAnimationFrame !== 'function') { - warning(false, 'React depends on requestAnimationFrame. Make sure that you load a ' + 'polyfill in older browsers. http://fb.me/react-polyfills'); + warning(false, 'React depends on requestAnimationFrame. Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills'); } } @@ -21954,14 +23452,16 @@ if (!ExecutionEnvironment.canUseDOM) { frameCallback({ timeRemaining: function () { return Infinity; - } + }, + + didTimeout: false }); }); }; cIC = function (timeoutID) { clearTimeout(timeoutID); }; -} else if (typeof requestIdleCallback !== 'function' || typeof cancelIdleCallback !== 'function') { +} else if (alwaysUseRequestIdleCallbackPolyfill || typeof requestIdleCallback !== 'function' || typeof cancelIdleCallback !== 'function') { // Polyfill requestIdleCallback and cancelIdleCallback var scheduledRICCallback = null; @@ -21977,7 +23477,7 @@ if (!ExecutionEnvironment.canUseDOM) { var previousFrameTime = 33; var activeFrameTime = 33; - var frameDeadlineObject; + var frameDeadlineObject = void 0; if (hasNativePerformanceNow) { frameDeadlineObject = { didTimeout: false, @@ -22097,550 +23597,7 @@ if (!ExecutionEnvironment.canUseDOM) { cIC = window.cancelIdleCallback; } -/** - * Forked from fbjs/warning: - * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js - * - * Only change is we use console.warn instead of console.error, - * and do nothing when 'console' is not supported. - * This really simplifies the code. - * --- - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - -var lowPriorityWarning = function () {}; - -{ - var printWarning = function (format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.warn(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; - - lowPriorityWarning = function (condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - - printWarning.apply(undefined, [format].concat(args)); - } - }; -} - -var lowPriorityWarning$1 = lowPriorityWarning; - -// isAttributeNameSafe() is currently duplicated in DOMMarkupOperations. -// TODO: Find a better place for this. -var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); -var illegalAttributeNameCache = {}; -var validatedAttributeNameCache = {}; -function isAttributeNameSafe(attributeName) { - if (validatedAttributeNameCache.hasOwnProperty(attributeName)) { - return true; - } - if (illegalAttributeNameCache.hasOwnProperty(attributeName)) { - return false; - } - if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { - validatedAttributeNameCache[attributeName] = true; - return true; - } - illegalAttributeNameCache[attributeName] = true; - { - warning(false, 'Invalid attribute name: `%s`', attributeName); - } - return false; -} - -// shouldIgnoreValue() is currently duplicated in DOMMarkupOperations. -// TODO: Find a better place for this. -function shouldIgnoreValue(propertyInfo, value) { - return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false; -} - -/** - * Operations for dealing with DOM properties. - */ - - - - - -/** - * Get the value for a property on a node. Only used in DEV for SSR validation. - * The "expected" argument is used as a hint of what the expected value is. - * Some properties have multiple equivalent values. - */ -function getValueForProperty(node, name, expected) { - { - var propertyInfo = getPropertyInfo(name); - if (propertyInfo) { - var mutationMethod = propertyInfo.mutationMethod; - if (mutationMethod || propertyInfo.mustUseProperty) { - return node[propertyInfo.propertyName]; - } else { - var attributeName = propertyInfo.attributeName; - - var stringValue = null; - - if (propertyInfo.hasOverloadedBooleanValue) { - if (node.hasAttribute(attributeName)) { - var value = node.getAttribute(attributeName); - if (value === '') { - return true; - } - if (shouldIgnoreValue(propertyInfo, expected)) { - return value; - } - if (value === '' + expected) { - return expected; - } - return value; - } - } else if (node.hasAttribute(attributeName)) { - if (shouldIgnoreValue(propertyInfo, expected)) { - // We had an attribute but shouldn't have had one, so read it - // for the error message. - return node.getAttribute(attributeName); - } - if (propertyInfo.hasBooleanValue) { - // If this was a boolean, it doesn't matter what the value is - // the fact that we have it is the same as the expected. - return expected; - } - // Even if this property uses a namespace we use getAttribute - // because we assume its namespaced name is the same as our config. - // To use getAttributeNS we need the local name which we don't have - // in our config atm. - stringValue = node.getAttribute(attributeName); - } - - if (shouldIgnoreValue(propertyInfo, expected)) { - return stringValue === null ? expected : stringValue; - } else if (stringValue === '' + expected) { - return expected; - } else { - return stringValue; - } - } - } - } -} - -/** - * Get the value for a attribute on a node. Only used in DEV for SSR validation. - * The third argument is used as a hint of what the expected value is. Some - * attributes have multiple equivalent values. - */ -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; - } -} - -/** - * Sets the value for a property on a node. - * - * @param {DOMElement} node - * @param {string} name - * @param {*} value - */ -function setValueForProperty(node, name, value) { - var propertyInfo = getPropertyInfo(name); - - if (propertyInfo && shouldSetAttribute(name, value)) { - var mutationMethod = propertyInfo.mutationMethod; - if (mutationMethod) { - mutationMethod(node, value); - } else if (shouldIgnoreValue(propertyInfo, value)) { - deleteValueForProperty(node, name); - return; - } else if (propertyInfo.mustUseProperty) { - // Contrary to `setAttribute`, object properties are properly - // `toString`ed by IE8/9. - node[propertyInfo.propertyName] = value; - } else { - var attributeName = propertyInfo.attributeName; - var namespace = propertyInfo.attributeNamespace; - // `setAttribute` with objects becomes only `[object]` in IE8/9, - // ('' + value) makes it output the correct toString()-value. - if (namespace) { - node.setAttributeNS(namespace, attributeName, '' + value); - } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) { - node.setAttribute(attributeName, ''); - } else { - node.setAttribute(attributeName, '' + value); - } - } - } else { - setValueForAttribute(node, name, shouldSetAttribute(name, value) ? value : null); - return; - } - - -} - -function setValueForAttribute(node, name, value) { - if (!isAttributeNameSafe(name)) { - return; - } - if (value == null) { - node.removeAttribute(name); - } else { - node.setAttribute(name, '' + value); - } - - -} - -/** - * Deletes an attributes from a node. - * - * @param {DOMElement} node - * @param {string} name - */ -function deleteValueForAttribute(node, name) { - node.removeAttribute(name); -} - -/** - * Deletes the value for a property on a node. - * - * @param {DOMElement} node - * @param {string} name - */ -function deleteValueForProperty(node, name) { - var propertyInfo = getPropertyInfo(name); - if (propertyInfo) { - var mutationMethod = propertyInfo.mutationMethod; - if (mutationMethod) { - mutationMethod(node, undefined); - } else if (propertyInfo.mustUseProperty) { - var propName = propertyInfo.propertyName; - if (propertyInfo.hasBooleanValue) { - node[propName] = false; - } else { - node[propName] = ''; - } - } else { - node.removeAttribute(propertyInfo.attributeName); - } - } else { - node.removeAttribute(name); - } -} - -var ReactControlledValuePropTypes = { - checkPropTypes: null -}; - -{ - var hasReadOnlyValue = { - button: true, - checkbox: true, - image: true, - hidden: true, - radio: true, - reset: true, - submit: true - }; - - var propTypes = { - value: function (props, propName, componentName) { - if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) { - 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[propName] || props.onChange || props.readOnly || props.disabled) { - 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`.'); - } - }; - - /** - * Provide a linked `value` attribute for controlled forms. You should not use - * this outside of the ReactDOM controlled form components. - */ - ReactControlledValuePropTypes.checkPropTypes = function (tagName, props, getStack) { - checkPropTypes(propTypes, props, 'prop', tagName, getStack); - }; -} - -// TODO: direct imports like some-package/src/* are bad. Fix me. -var getCurrentFiberOwnerName$2 = ReactDebugCurrentFiber.getCurrentFiberOwnerName; -var getCurrentFiberStackAddendum$3 = ReactDebugCurrentFiber.getCurrentFiberStackAddendum; - -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; -} - -/** - * Implements an host component that allows setting these optional - * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. - * - * If `checked` or `value` are not supplied (or null/undefined), user actions - * that affect the checked state or value will trigger updates to the element. - * - * If they are supplied (and not null/undefined), the rendered element will not - * trigger updates to the element. Instead, the props must change in order for - * the rendered element to be updated. - * - * The rendered element will be initialized as unchecked (or `defaultChecked`) - * with an empty value (or `defaultValue`). - * - * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html - */ - -function getHostProps(element, props) { - var node = element; - var value = props.value; - var checked = props.checked; - - var hostProps = _assign({ - // Make sure we set .type before any other properties (setting .value - // before .type means .value is lost in IE11 and below) - type: undefined, - // Make sure we set .step before .value (setting .value before .step - // means .value is rounded on mount, based upon step precision) - step: undefined, - // Make sure we set .min & .max before .value (to ensure proper order - // in corner cases such as min or max deriving from value, e.g. Issue #7170) - min: undefined, - max: undefined - }, props, { - defaultChecked: undefined, - defaultValue: undefined, - value: value != null ? value : node._wrapperState.initialValue, - checked: checked != null ? checked : node._wrapperState.initialChecked - }); - - return hostProps; -} - -function initWrapperState(element, props) { - { - ReactControlledValuePropTypes.checkPropTypes('input', props, getCurrentFiberStackAddendum$3); - - if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { - warning(false, '%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', getCurrentFiberOwnerName$2() || 'A component', props.type); - didWarnCheckedDefaultChecked = true; - } - if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { - warning(false, '%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', getCurrentFiberOwnerName$2() || 'A component', props.type); - didWarnValueDefaultValue = true; - } - } - - var defaultValue = props.defaultValue; - var node = element; - node._wrapperState = { - initialChecked: props.checked != null ? props.checked : props.defaultChecked, - initialValue: 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); - } -} - -function updateWrapper(element, props) { - var node = element; - { - var controlled = isControlled(props); - - if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { - warning(false, '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%s', props.type, getCurrentFiberStackAddendum$3()); - didWarnUncontrolledToControlled = true; - } - if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { - warning(false, '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%s', props.type, getCurrentFiberStackAddendum$3()); - didWarnControlledToUncontrolled = true; - } - } - - updateChecked(element, props); - - var value = props.value; - if (value != null) { - if (value === 0 && node.value === '') { - node.value = '0'; - // Note: IE9 reports a number inputs as 'text', so check props instead. - } else if (props.type === 'number') { - // Simulate `input.valueAsNumber`. IE9 does not support it - var valueAsNumber = parseFloat(node.value) || 0; - - if ( - // eslint-disable-next-line - value != valueAsNumber || - // eslint-disable-next-line - value == valueAsNumber && node.value != value) { - // Cast `value` to a string to ensure the value is set correctly. While - // browsers typically do this as necessary, jsdom doesn't. - node.value = '' + value; - } - } else if (node.value !== '' + value) { - // Cast `value` to a string to ensure the value is set correctly. While - // browsers typically do this as necessary, jsdom doesn't. - node.value = '' + value; - } - } else { - if (props.value == null && props.defaultValue != null) { - // In Chrome, assigning defaultValue to certain input types triggers input validation. - // For number inputs, the display value loses trailing decimal points. For email inputs, - // Chrome raises "The specified value is not a valid email address". - // - // Here we check to see if the defaultValue has actually changed, avoiding these problems - // when the user is inputting text - // - // https://github.com/facebook/react/issues/7253 - if (node.defaultValue !== '' + props.defaultValue) { - node.defaultValue = '' + props.defaultValue; - } - } - if (props.checked == null && props.defaultChecked != null) { - node.defaultChecked = !!props.defaultChecked; - } - } -} - -function postMountWrapper(element, props) { - var node = element; - - // Detach value from defaultValue. We won't do anything if we're working on - // submit or reset inputs as those values & defaultValues are linked. They - // are not resetable nodes so this operation doesn't matter and actually - // removes browser-default values (eg "Submit Query") when no value is - // provided. - - switch (props.type) { - case 'submit': - case 'reset': - break; - case 'color': - case 'date': - case 'datetime': - case 'datetime-local': - case 'month': - case 'time': - case 'week': - // This fixes the no-show issue on iOS Safari and Android Chrome: - // https://github.com/facebook/react/issues/7233 - node.value = ''; - node.value = node.defaultValue; - break; - default: - node.value = node.value; - break; - } - - // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug - // this is needed to work around a chrome bug where setting defaultChecked - // will sometimes influence the value of checked (even after detachment). - // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 - // We need to temporarily unset name to avoid disrupting radio button groups. - var name = node.name; - if (name !== '') { - node.name = ''; - } - node.defaultChecked = !node.defaultChecked; - node.defaultChecked = !node.defaultChecked; - if (name !== '') { - node.name = name; - } -} - -function restoreControlledState$1(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; - } - - // If `rootNode.form` was non-null, then we could try `form.elements`, - // but that sometimes behaves strangely in IE8. We could also try using - // `form.getElementsByName`, but that will only return direct children - // and won't include inputs that use the HTML5 `form=` attribute. Since - // the input might not even be in a form. It might not even be in the - // document. Let's just use the local `querySelectorAll` to ensure we don't - // miss anything. - 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; - } - // This will throw if radio buttons rendered by different copies of React - // and the same name are rendered into the same form (same as #1939). - // That's probably okay; we don't support it just as we don't support - // mixing React radio buttons with non-React ones. - var otherProps = getFiberCurrentPropsFromNode$1(otherNode); - !otherProps ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : void 0; - - // We need update the tracked value on the named cousin since the value - // was changed but the input saw no event or value set - updateValueIfChanged(otherNode); - - // If this is a controlled radio button group, forcing the input that - // was previously checked to update will cause it to be come re-checked - // as appropriate. - updateWrapper(otherNode, otherProps); - } - } -} +var didWarnSelectedSetOnOption = false; function flattenChildren(children) { var content = ''; @@ -22668,7 +23625,10 @@ function flattenChildren(children) { function validateProps(element, props) { // TODO (yungsters): Remove support for `selected` in