text: (window.webpackJsonpapp=window.webpackJsonpapp||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(18)},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function r(e){return(r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"===typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return r(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":r(e)})(e)}var o=n(1);function a(e,t){return!t||"object"!==i(t)&&"function"!==typeof t?Object(o.a)(e):t}n.d(t,"a",function(){return a})},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}n.d(t,"a",function(){return i})},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(19)},function(e,t,n){var r;r=function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){e.exports=n(5)()},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=function(e,t,n){var r=e.direction,i=e.value;switch(r){case"top":return n.top+i<t.top&&n.bottom>t.bottom&&n.left<t.left&&n.right>t.right;case"left":return n.left+i<t.left&&n.bottom>t.bottom&&n.top<t.top&&n.right>t.right;case"bottom":return n.bottom-i>t.bottom&&n.left<t.left&&n.right>t.right&&n.top<t.top;case"right":return n.right-i>t.right&&n.left<t.left&&n.top<t.top&&n.bottom>t.bottom}}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return m});var r=n(1),i=n.n(r),o=n(2),a=n.n(o),s=n(0),l=n.n(s),u=n(3),c=n.n(u);function p(e){return(p="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=function(e,t){return!t||"object"!==p(t)&&"function"!==typeof t?f(e):t}(this,d(t).call(this,e)),v(f(n),"getContainer",function(){return n.props.containment||window}),v(f(n),"addEventListener",function(e,t,r,i){var o;n.debounceCheck||(n.debounceCheck={});var a=function(){o=null,n.check()},s={target:e,fn:i>-1?function(){o||(o=setTimeout(a,i||0))}:function(){clearTimeout(o),o=setTimeout(a,r||0)},getLastTimeout:function(){return o}};e.addEventListener(t,s.fn),n.debounceCheck[t]=s}),v(f(n),"startWatching",function(){n.debounceCheck||n.interval||(n.props.intervalCheck&&(n.interval=setInterval(n.check,n.props.intervalDelay)),n.props.scrollCheck&&n.addEventListener(n.getContainer(),"scroll",n.props.scrollDelay,n.props.scrollThrottle),n.props.resizeCheck&&n.addEventListener(window,"resize",n.props.resizeDelay,n.props.resizeThrottle),!n.props.delayedCall&&n.check())}),v(f(n),"stopWatching",function(){if(n.debounceCheck)for(var e in n.debounceCheck)if(n.debounceCheck.hasOwnProperty(e)){var t=n.debounceCheck[e];clearTimeout(t.getLastTimeout()),t.target.removeEventListener(e,t.fn),n.debounceCheck[e]=null}n.debounceCheck=null,n.interval&&(n.interval=clearInterval(n.interval))}),v(f(n),"check",function(){var e,t,r=n.node;if(!r)return n.state;if(e=function(e){return void 0===e.width&&(e.width=e.right-e.left),void 0===e.height&&(e.height=e.bottom-e.top),e}(n.roundRectDown(r.getBoundingClientRect())),n.props.containment){var i=n.props.containment.getBoundingClientRect();t={top:i.top,left:i.left,bottom:i.bottom,right:i.right}}else t={top:0,left:0,bottom:window.innerHeight||document.documentElement.clientHeight,right:window.innerWidth||document.documentElement.clientWidth};var o=n.props.offset||{};"object"===p(o)&&(t.top+=o.top||0,t.left+=o.left||0,t.bottom-=o.bottom||0,t.right-=o.right||0);var a={top:e.top>=t.top,left:e.left>=t.left,bottom:e.bottom<=t.bottom,right:e.right<=t.right},s=e.height>0&&e.width>0,l=s&&a.top&&a.left&&a.bottom&&a.right;if(s&&n.props.partialVisibility){var u=e.top<=t.bottom&&e.bottom>=t.top&&e.left<=t.right&&e.right>=t.left;"string"===typeof n.props.partialVisibility&&(u=a[n.props.partialVisibility]),l=n.props.minTopValue?u&&e.top<=t.bottom-n.props.minTopValue:u}"string"===typeof o.direction&&"number"===typeof o.value&&(console.warn("[notice] offset.direction and offset.value have been deprecated. They still work for now, but will be removed in next major version. Please upgrade to the new syntax: { %s: %d }",o.direction,o.value),l=c()(o,e,t));var h=n.state;return n.state.isVisible!==l&&(h={isVisible:l,visibilityRect:a},n.setState(h),n.props.onChange&&n.props.onChange(l)),h}),n.state={isVisible:null,visibilityRect:{}},n}var n,r,o;return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(t,i.a.Component),n=t,(r=[{key:"componentDidMount",value:function(){this.node=a.a.findDOMNode(this),this.props.active&&this.startWatching()}},{key:"componentWillUnmount",value:function(){this.stopWatching()}},{key:"componentDidUpdate",value:function(e){this.node=a.a.findDOMNode(this),this.props.active&&!e.active?(this.setState({isVisible:null,visibilityRect:{}}),this.startWatching()):this.props.active||this.stopWatching()}},{key:"roundRectDown",value:function(e){return{top:Math.floor(e.top),left:Math.floor(e.left),bottom:Math.floor(e.bottom),right:Math.floor(e.right)}}},{key:"render",value:function(){return this.props.children instanceof Function?this.props.children({isVisible:this.state.isVisible,visibilityRect:this.state.visibilityRect}):i.a.Children.only(this.props.children)}}])&&h(n.prototype,r),o&&h(n,o),t}();v(m,"defaultProps",{active:!0,partialVisibility:!1,minTopValue:0,scrollCheck:!1,scrollDelay:250,scrollThrottle:-1,resizeCheck:!1,resizeDelay:250,resizeThrottle:-1,intervalCheck:!0,intervalDelay:100,delayedCall:!1,offset:{},containment:null,children:i.a.createElement("span",null)}),v(m,"propTypes",{onChange:l.a.func,active:l.a.bool,partialVisibility:l.a.oneOfType([l.a.bool,l.a.oneOf(["top","right","bottom","left"])]),delayedCall:l.a.bool,offset:l.a.oneOfType([l.a.shape({top:l.a.number,left:l.a.number,bottom:l.a.number,right:l.a.number}),l.a.shape({direction:l.a.oneOf(["top","right","bottom","left"]),value:l.a.number})]),scrollCheck:l.a.bool,scrollDelay:l.a.number,scrollThrottle:l.a.number,resizeCheck:l.a.bool,resizeDelay:l.a.number,resizeThrottle:l.a.number,intervalCheck:l.a.bool,intervalDelay:l.a.number,containment:"undefined"!==typeof window?l.a.instanceOf(window.Element):l.a.any,children:l.a.oneOfType([l.a.element,l.a.func]),minTopValue:l.a.number})},function(e,t,n){"use strict";var r=n(6);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}])},e.exports=r(n(0),n(7))},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",function(){return i}),n.d(t,"__assign",function(){return o}),n.d(t,"__rest",function(){return a}),n.d(t,"__decorate",function(){return s}),n.d(t,"__param",function(){return l}),n.d(t,"__metadata",function(){return u}),n.d(t,"__awaiter",function(){return c}),n.d(t,"__generator",function(){return p}),n.d(t,"__exportStar",function(){return h}),n.d(t,"__values",function(){return d}),n.d(t,"__read",function(){return f}),n.d(t,"__spread",function(){return y}),n.d(t,"__spreadArrays",function(){return v}),n.d(t,"__await",function(){return m}),n.d(t,"__asyncGenerator",function(){return g}),n.d(t,"__asyncDelegator",function(){return _}),n.d(t,"__asyncValues",function(){return b}),n.d(t,"__makeTemplateObject",function(){return w}),n.d(t,"__importStar",function(){return E}),n.d(t,"__importDefault",function(){return C});var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function s(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function l(e,t){return function(n,r){t(n,r,e)}}function u(e,t){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(t){o(t)}}function s(e){try{l(r.throw(e))}catch(t){o(t)}}function l(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}l((r=r.apply(e,t||[])).next())})}function p(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function h(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function d(e){var t="function"===typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function f(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(f(arguments[t]));return e}function v(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function m(e){return this instanceof m?(this.v=e,this):new m(e)}function g(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){i[e]&&(r[e]=function(t){return new Promise(function(n,r){o.push([e,t,n,r])>1||s(e,t)})})}function s(e,t){try{(n=i[e](t)).value instanceof m?Promise.resolve(n.value.v).then(l,u):c(o[0][2],n)}catch(r){c(o[0][3],r)}var n}function l(e){s("next",e)}function u(e){s("throw",e)}function c(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function _(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:m(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function b(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=d(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,i,(t=e[n](t)).done,t.value)})}}}function w(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function E(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function C(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";var r,i=(r=n(12))&&"object"===typeof r&&"default"in r?r.default:r;e.exports=i},function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,t){for(var n,s,l=a(e),u=1;u<arguments.length;u++){for(var c in n=Object(arguments[u]))i.call(n,c)&&(l[c]=n[c]);if(r){s=r(n);for(var p=0;p<s.length;p++)o.call(n,s[p])&&(l[s[p]]=n[s[p]])}}return l}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(9),o=n(13),a=n(14),s=((r={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",r["bad-app-name"]="Illegal App name: '{$appName}",r["duplicate-app"]="Firebase App named '{$appName}' already exists",r["app-deleted"]="Firebase App named '{$appName}' already deleted",r["duplicate-service"]="Firebase service named '{$appName}' already registered",r["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",r),l=new o.ErrorFactory("app","Firebase",s),u="[DEFAULT]",c=[],p=function(){function e(e,t,n){this.firebase_=n,this.isDeleted_=!1,this.services_={},this.name_=t.name,this.automaticDataCollectionEnabled_=t.automaticDataCollectionEnabled||!1,this.options_=o.deepCopy(e),this.INTERNAL={getUid:function(){return null},getToken:function(){return Promise.resolve(null)},addAuthTokenListener:function(e){c.push(e),setTimeout(function(){return e(null)},0)},removeAuthTokenListener:function(e){c=c.filter(function(t){return t!==e})}}}return Object.defineProperty(e.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(e){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!0,configurable:!0}),e.prototype.delete=function(){var e=this;return new Promise(function(t){e.checkDestroyed_(),t()}).then(function(){e.firebase_.INTERNAL.removeApp(e.name_);for(var t=[],n=0,r=Object.keys(e.services_);n<r.length;n++)for(var i=r[n],o=0,a=Object.keys(e.services_[i]);o<a.length;o++){var s=a[o];t.push(e.services_[i][s])}return Promise.all(t.filter(function(e){return"INTERNAL"in e}).map(function(e){return e.INTERNAL.delete()}))}).then(function(){e.isDeleted_=!0,e.services_={}})},e.prototype._getService=function(e,t){if(void 0===t&&(t=u),this.checkDestroyed_(),this.services_[e]||(this.services_[e]={}),!this.services_[e][t]){var n=t!==u?t:void 0,r=this.firebase_.INTERNAL.factories[e](this,this.extendApp.bind(this),n);this.services_[e][t]=r}return this.services_[e][t]},e.prototype._removeServiceInstance=function(e,t){void 0===t&&(t=u),this.services_[e]&&this.services_[e][t]&&delete this.services_[e][t]},e.prototype.extendApp=function(e){var t=this;o.deepExtend(this,e),e.INTERNAL&&e.INTERNAL.addAuthTokenListener&&(c.forEach(function(e){t.INTERNAL.addAuthTokenListener(e)}),c=[])},e.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw l.create("app-deleted",{appName:this.name_})},e}();p.prototype.name&&p.prototype.options||p.prototype.delete||console.log("dc");var h="6.3.5";var d=new a.Logger("@firebase/app");if(o.isBrowser()&&void 0!==self.firebase){d.warn("\n    Warning: Firebase is already defined in the global scope. Please make sure\n    Firebase library is only loaded once.\n  ");var f=self.firebase.SDK_VERSION;f&&f.indexOf("LITE")>=0&&d.warn("\n    Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n    You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n    ")}var y=function e(){var t=function(e){var t={},n={},r={},i={__esModule:!0,initializeApp:function(n,r){void 0===r&&(r={}),"object"===typeof r&&null!==r||(r={name:r});var a=r;void 0===a.name&&(a.name=u);var s=a.name;if("string"!==typeof s||!s)throw l.create("bad-app-name",{appName:String(s)});if(o.contains(t,s))throw l.create("duplicate-app",{appName:s});var p=new e(n,a,i);return t[s]=p,c(p,"create"),p},app:a,apps:null,SDK_VERSION:h,INTERNAL:{registerService:function(t,u,c,p,h){if(void 0===h&&(h=!1),n[t])throw l.create("duplicate-service",{appName:t});function d(e){if(void 0===e&&(e=a()),"function"!==typeof e[t])throw l.create("invalid-app-argument",{appName:t});return e[t]()}return n[t]=u,p&&(r[t]=p,s().forEach(function(e){p("create",e)})),void 0!==c&&o.deepExtend(d,c),i[t]=d,e.prototype[t]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this._getService.bind(this,t);return r.apply(this,h?e:[])},d},removeApp:function(e){c(t[e],"delete"),delete t[e]},factories:n,useAsService:p}};function a(e){if(e=e||u,!o.contains(t,e))throw l.create("no-app",{appName:e});return t[e]}function s(){return Object.keys(t).map(function(e){return t[e]})}function c(e,t){for(var i=0,o=Object.keys(n);i<o.length;i++){var a=p(0,o[i]);if(null===a)return;r[a]&&r[a](t,e)}}function p(e,t){return"serverAuth"===t?null:t}return i.default=i,Object.defineProperty(i,"apps",{get:s}),a.App=e,i}(p);return t.INTERNAL=i.__assign({},t.INTERNAL,{createFirebaseNamespace:e,extendNamespace:function(e){o.deepExtend(t,e)},createSubscribe:o.createSubscribe,ErrorFactory:o.ErrorFactory,deepExtend:o.deepExtend}),t}(),v=y.initializeApp;y.initializeApp=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.isNode()&&d.warn('\n      Warning: This is a browser-targeted Firebase bundle but it appears it is being\n      run in a Node environment.  If running in a Node environment, make sure you\n      are using the bundle specified by the "main" field in package.json.\n      \n      If you are using Webpack, you can specify "main" as the first item in\n      "resolve.mainFields":\n      https://webpack.js.org/configuration/resolve/#resolvemainfields\n      \n      If using Rollup, use the rollup-plugin-node-resolve plugin and specify "main"\n      as the first item in "mainFields", e.g. [\'main\', \'module\'].\n      https://github.com/rollup/rollup-plugin-node-resolve\n      '),v.apply(void 0,e)};var m=y;t.default=m,t.firebase=m},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},o=function(e,t){if(!e)throw a(t)},a=function(e){return new Error("Firebase Database ("+i.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)},s=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296===(64512&i)&&r+1<e.length&&56320===(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},l={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"===typeof atob,encodeByteArray:function(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i<e.length;i+=3){var o=e[i],a=i+1<e.length,s=a?e[i+1]:0,l=i+2<e.length,u=l?e[i+2]:0,c=o>>2,p=(3&o)<<4|s>>4,h=(15&s)<<2|u>>6,d=63&u;l||(d=64,a||(h=64)),r.push(n[c],n[p],n[h],n[d])}return r.join("")},encodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(s(e),t)},decodeString:function(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){for(var t=[],n=0,r=0;n<e.length;){var i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){var o=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var a=((7&i)<<18|(63&(o=e[n++]))<<12|(63&(s=e[n++]))<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(a>>10)),t[r++]=String.fromCharCode(56320+(1023&a))}else{o=e[n++];var s=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray:function(e,t){this.init_();for(var n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i<e.length;){var o=n[e.charAt(i++)],a=i<e.length?n[e.charAt(i)]:0,s=++i<e.length?n[e.charAt(i)]:64,l=++i<e.length?n[e.charAt(i)]:64;if(++i,null==o||null==a||null==s||null==l)throw Error();var u=o<<2|a>>4;if(r.push(u),64!==s){var c=a<<4&240|s>>2;if(r.push(c),64!==l){var p=s<<6&192|l;r.push(p)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},u=function(e){try{return l.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};function c(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(var n in t)t.hasOwnProperty(n)&&(e[n]=c(e[n],t[n]));return e}var p=function(){function e(){var e=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n})}return e.prototype.wrapCallback=function(e){var t=this;return function(n,r){n?t.reject(n):t.resolve(r),"function"===typeof e&&(t.promise.catch(function(){}),1===e.length?e(n):e(n,r))}},e}();function h(){return"undefined"!==typeof navigator&&"string"===typeof navigator.userAgent?navigator.userAgent:""}var d="FirebaseError",f=function(e){function t(n,r){var i=e.call(this,r)||this;return i.code=n,i.name=d,Object.setPrototypeOf(i,t.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,y.prototype.create),i}return r.__extends(t,e),t}(Error),y=function(){function e(e,t,n){this.service=e,this.serviceName=t,this.errors=n}return e.prototype.create=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=t[0]||{},i=this.service+"/"+e,o=this.errors[e],a=o?v(o,r):"Error",s=this.serviceName+": "+a+" ("+i+").",l=new f(i,s),u=0,c=Object.keys(r);u<c.length;u++){var p=c[u];"_"!==p.slice(-1)&&(p in l&&console.warn('Overwriting FirebaseError base field "'+p+'" can cause unexpected behavior.'),l[p]=r[p])}return l},e}();function v(e,t){return e.replace(m,function(e,n){var r=t[n];return null!=r?r.toString():"<"+n+"?>"})}var m=/\{\$([^}]+)}/g;function g(e){return JSON.parse(e)}var _=function(e){var t={},n={},r={},i="";try{var o=e.split(".");t=g(u(o[0])||""),n=g(u(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(a){}return{header:t,claims:n,data:r,signature:i}};var b=function(){function e(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}return e.prototype.reset=function(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0},e.prototype.compress_=function(e,t){t||(t=0);var n=this.W_;if("string"===typeof e)for(var r=0;r<16;r++)n[r]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(r=0;r<16;r++)n[r]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(r=16;r<80;r++){var i=n[r-3]^n[r-8]^n[r-14]^n[r-16];n[r]=4294967295&(i<<1|i>>>31)}var o,a,s=this.chain_[0],l=this.chain_[1],u=this.chain_[2],c=this.chain_[3],p=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(o=c^l&(u^c),a=1518500249):(o=l^u^c,a=1859775393):r<60?(o=l&u|c&(l|u),a=2400959708):(o=l^u^c,a=3395469782);i=(s<<5|s>>>27)+o+p+a+n[r]&4294967295;p=c,c=u,u=4294967295&(l<<30|l>>>2),l=s,s=i}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+l&4294967295,this.chain_[2]=this.chain_[2]+u&4294967295,this.chain_[3]=this.chain_[3]+c&4294967295,this.chain_[4]=this.chain_[4]+p&4294967295},e.prototype.update=function(e,t){if(null!=e){void 0===t&&(t=e.length);for(var n=t-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r<t;){if(0===o)for(;r<=n;)this.compress_(e,r),r+=this.blockSize;if("string"===typeof e){for(;r<t;)if(i[o]=e.charCodeAt(r),++r,++o===this.blockSize){this.compress_(i),o=0;break}}else for(;r<t;)if(i[o]=e[r],++r,++o===this.blockSize){this.compress_(i),o=0;break}}this.inbuf_=o,this.total_+=t}},e.prototype.digest=function(){var e=[],t=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(var n=this.blockSize-1;n>=56;n--)this.buf_[n]=255&t,t/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)e[r]=this.chain_[n]>>i&255,++r;return e},e}();var w=function(){function e(e,t){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(function(){e(n)}).catch(function(e){n.error(e)})}return e.prototype.next=function(e){this.forEachObserver(function(t){t.next(e)})},e.prototype.error=function(e){this.forEachObserver(function(t){t.error(e)}),this.close(e)},e.prototype.complete=function(){this.forEachObserver(function(e){e.complete()}),this.close()},e.prototype.subscribe=function(e,t,n){var r,i=this;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(e,t){if("object"!==typeof e||null===e)return!1;for(var n=0,r=t;n<r.length;n++){var i=r[n];if(i in e&&"function"===typeof e[i])return!0}return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n}).next&&(r.next=E),void 0===r.error&&(r.error=E),void 0===r.complete&&(r.complete=E);var o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(function(){try{i.finalError?r.error(i.finalError):r.complete()}catch(e){}}),this.observers.push(r),o},e.prototype.unsubscribeOne=function(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},e.prototype.forEachObserver=function(e){if(!this.finalized)for(var t=0;t<this.observers.length;t++)this.sendOne(t,e)},e.prototype.sendOne=function(e,t){var n=this;this.task.then(function(){if(void 0!==n.observers&&void 0!==n.observers[e])try{t(n.observers[e])}catch(r){"undefined"!==typeof console&&console.error&&console.error(r)}})},e.prototype.close=function(e){var t=this;this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(function(){t.observers=void 0,t.onNoObservers=void 0}))},e}();function E(){}function C(e,t,n){var r="";switch(t){case 1:r=n?"first":"First";break;case 2:r=n?"second":"Second";break;case 3:r=n?"third":"Third";break;case 4:r=n?"fourth":"Fourth";break;default:throw new Error("errorPrefix called with argumentNumber > 4.  Need to update it?")}var i=e+" failed: ";return i+=r+" argument "}t.CONSTANTS=i,t.Deferred=p,t.ErrorFactory=y,t.FirebaseError=f,t.Sha1=b,t.assert=o,t.assertionError=a,t.async=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Promise.resolve(!0).then(function(){e.apply(void 0,n)}).catch(function(e){t&&t(e)})}},t.base64=l,t.base64Decode=u,t.base64Encode=function(e){var t=s(e);return l.encodeByteArray(t,!0)},t.contains=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.createSubscribe=function(e,t){var n=new w(e,t);return n.subscribe.bind(n)},t.decode=_,t.deepCopy=function(e){return c(void 0,e)},t.deepExtend=c,t.errorPrefix=C,t.getUA=h,t.isAdmin=function(e){var t=_(e).claims;return"object"===typeof t&&!0===t.admin},t.isBrowser=function(){return"object"===typeof self&&self.self===self},t.isEmpty=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},t.isMobileCordova=function(){return"undefined"!==typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(h())},t.isNode=function(){try{return"[object process]"===Object.prototype.toString.call(e.process)}catch(t){return!1}},t.isNodeSdk=function(){return!0===i.NODE_CLIENT||!0===i.NODE_ADMIN},t.isReactNative=function(){return"object"===typeof navigator&&"ReactNative"===navigator.product},t.isValidFormat=function(e){var t=_(e).claims;return!!t&&"object"===typeof t&&t.hasOwnProperty("iat")},t.isValidTimestamp=function(e){var t=_(e).claims,n=Math.floor((new Date).getTime()/1e3),r=0,i=0;return"object"===typeof t&&(t.hasOwnProperty("nbf")?r=t.nbf:t.hasOwnProperty("iat")&&(r=t.iat),i=t.hasOwnProperty("exp")?t.exp:r+86400),!!n&&!!r&&!!i&&n>=r&&n<=i},t.issuedAtTime=function(e){var t=_(e).claims;return"object"===typeof t&&t.hasOwnProperty("iat")?t.iat:null},t.jsonEval=g,t.map=function(e,t,n){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=t.call(n,e[i],i,e));return r},t.querystring=function(e){for(var t=[],n=function(e,n){Array.isArray(n)?n.forEach(function(n){t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))}):t.push(encodeURIComponent(e)+"="+encodeURIComponent(n))},r=0,i=Object.entries(e);r<i.length;r++){var o=i[r];n(o[0],o[1])}return t.length?"&"+t.join("&"):""},t.querystringDecode=function(e){var t={};return e.replace(/^\?/,"").split("&").forEach(function(e){if(e){var n=e.split("=");t[n[0]]=n[1]}}),t},t.safeGet=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},t.stringLength=function(e){for(var t=0,n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t++:r<2048?t+=2:r>=55296&&r<=56319?(t+=4,n++):t+=3}return t},t.stringToByteArray=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);if(i>=55296&&i<=56319){var a=i-55296;o(++r<e.length,"Surrogate pair missing trail surrogate."),i=65536+(a<<10)+(e.charCodeAt(r)-56320)}i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):i<65536?(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},t.stringify=function(e){return JSON.stringify(e)},t.validateArgCount=function(e,t,n,r){var i;if(r<t?i="at least "+t:r>n&&(i=0===n?"none":"no more than "+n),i)throw new Error(e+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")},t.validateCallback=function(e,t,n,r){if((!r||n)&&"function"!==typeof n)throw new Error(C(e,t,r)+"must be a valid function.")},t.validateContextObject=function(e,t,n,r){if((!r||n)&&("object"!==typeof n||null===n))throw new Error(C(e,t,r)+"must be a valid context object.")},t.validateNamespace=function(e,t,n,r){if((!r||n)&&"string"!==typeof n)throw new Error(C(e,t,r)+"must be a valid firebase namespace.")}}).call(this,n(29))},function(e,t,n){"use strict";n.r(t),n.d(t,"LogLevel",function(){return r}),n.d(t,"Logger",function(){return s}),n.d(t,"setLogLevel",function(){return l});var r,i=[];!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(r||(r={}));var o=r.INFO,a=function(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(!(t<e.logLevel)){var o=(new Date).toISOString();switch(t){case r.DEBUG:case r.VERBOSE:console.log.apply(console,["["+o+"]  "+e.name+":"].concat(n));break;case r.INFO:console.info.apply(console,["["+o+"]  "+e.name+":"].concat(n));break;case r.WARN:console.warn.apply(console,["["+o+"]  "+e.name+":"].concat(n));break;case r.ERROR:console.error.apply(console,["["+o+"]  "+e.name+":"].concat(n));break;default:throw new Error("Attempted to log a message with an invalid logType (value: "+t+")")}}},s=function(){function e(e){this.name=e,this._logLevel=o,this._logHandler=a,i.push(this)}return Object.defineProperty(e.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){if(!(e in r))throw new TypeError("Invalid value assigned to `logLevel`");this._logLevel=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"logHandler",{get:function(){return this._logHandler},set:function(e){if("function"!==typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e},enumerable:!0,configurable:!0}),e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logHandler.apply(this,[this,r.DEBUG].concat(e))},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logHandler.apply(this,[this,r.VERBOSE].concat(e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logHandler.apply(this,[this,r.INFO].concat(e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logHandler.apply(this,[this,r.WARN].concat(e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._logHandler.apply(this,[this,r.ERROR].concat(e))},e}();function l(e){i.forEach(function(t){t.logLevel=e})}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),i=t.UA=new r;t.browser=i.getBrowser(),t.cpu=i.getCPU(),t.device=i.getDevice(),t.engine=i.getEngine(),t.os=i.getOS(),t.ua=i.getUA(),t.setUA=function(e){return i.setUA(e)},t.mockUserAgent=function(e){window.navigator.__defineGetter__("userAgent",function(){return e})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deviceType=t.isYandex=t.isEdge=t.getUA=t.engineVersion=t.engineName=t.mobileModel=t.mobileVendor=t.browserName=t.browserVersion=t.fullBrowserVersion=t.osName=t.osVersion=t.isIE=t.isOpera=t.isSafari=t.isFirefox=t.isChrome=t.isIOS=t.isWinPhone=t.isAndroid=t.isBrowser=t.isTablet=t.isMobileOnly=t.isMobile=t.isChromium=t.isMobileSafari=t.isWearable=t.isConsole=t.isSmartTV=void 0;var r=n(0),i=n(2),o=i.BROWSER_TYPES.CHROME,a=i.BROWSER_TYPES.CHROMIUM,s=i.BROWSER_TYPES.IE,l=i.BROWSER_TYPES.INTERNET_EXPLORER,u=i.BROWSER_TYPES.OPERA,c=i.BROWSER_TYPES.FIREFOX,p=i.BROWSER_TYPES.SAFARI,h=i.BROWSER_TYPES.MOBILE_SAFARI,d=i.BROWSER_TYPES.EDGE,f=i.BROWSER_TYPES.YANDEX,y=i.DEVICE_TYPES.MOBILE,v=i.DEVICE_TYPES.TABLET,m=i.DEVICE_TYPES.SMART_TV,g=i.DEVICE_TYPES.BROWSER,_=i.DEVICE_TYPES.WEARABLE,b=i.DEVICE_TYPES.CONSOLE,w=i.OS_TYPES.ANDROID,E=i.OS_TYPES.WINDOWS_PHONE,C=i.OS_TYPES.IOS;t.isSmartTV=r.device.type===m,t.isConsole=r.device.type===b,t.isWearable=r.device.type===_,t.isMobileSafari=r.browser.name===h,t.isChromium=r.browser.name===a,t.isMobile=function(){switch(r.device.type){case y:case v:return!0;default:return!1}}(),t.isMobileOnly=r.device.type===y,t.isTablet=r.device.type===v,t.isBrowser=r.device.type===g,t.isAndroid=r.os.name===w,t.isWinPhone=r.os.name===E,t.isIOS=r.os.name===C,t.isChrome=r.browser.name===o,t.isFirefox=r.browser.name===c,t.isSafari=r.browser.name===p||r.browser.name===h,t.isOpera=r.browser.name===u,t.isIE=r.browser.name===l||r.browser.name===s,t.osVersion=r.os.version?r.os.version:"none",t.osName=r.os.name?r.os.name:"none",t.fullBrowserVersion=r.browser.version,t.browserVersion=r.browser.major,t.browserName=r.browser.name,t.mobileVendor=r.device.vendor?r.device.vendor:"none",t.mobileModel=r.device.model?r.device.model:"none",t.engineName=r.engine.name,t.engineVersion=r.engine.version,t.getUA=r.ua,t.isEdge=r.browser.name===d,t.isYandex=r.browser.name===f,t.deviceType=r.device.type},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wearPayload=t.consolePayload=t.stvPayload=t.mobilePayload=t.broPayload=t.getCurrentBrowser=t.checkType=t.OS_TYPES=t.BROWSER_TYPES=t.DEVICE_TYPES=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=(n(0),t.DEVICE_TYPES={MOBILE:"mobile",TABLET:"tablet",SMART_TV:"smarttv",CONSOLE:"console",WEARABLE:"wearable",BROWSER:void 0}),o=t.BROWSER_TYPES={CHROME:"Chrome",FIREFOX:"Firefox",OPERA:"Opera",YANDEX:"Yandex",SAFARI:"Safari",INTERNET_EXPLORER:"Internet Explorer",EDGE:"Edge",CHROMIUM:"Chromium",IE:"IE",MOBILE_SAFARI:"Mobile Safari"},a=(t.OS_TYPES={IOS:"iOS",ANDROID:"Android",WINDOWS_PHONE:"Windows Phone"},{isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1});t.checkType=function(e){switch(e){case i.MOBILE:return{isMobile:!0};case i.TABLET:return{isTablet:!0};case i.SMART_TV:return{isSmartTV:!0};case i.CONSOLE:return{isConsole:!0};case i.WEARABLE:return{isWearable:!0};case i.BROWSER:return{isBrowser:!0};default:return a}},t.getCurrentBrowser=function(e){switch(e){case o.CHROME:case o.FIREFOX:case o.OPERA:case o.YANDEX:case o.SAFARI:case o.IE:case o.EDGE:case o.CHROMIUM:return!0;default:return!1}},t.broPayload=function(e,t,n,r,i){return{isBrowser:e,browserMajorVersion:t.major,browserFullVersion:t.version,browserName:t.name,engineName:n.name||!1,engineVersion:n.version,osName:r.name,osVersion:r.version,userAgent:i}},t.mobilePayload=function(e,t,n,i){return r({},e,{vendor:t.vendor||"none",model:t.model||"none",os:n.name||"none",osVersion:n.version||"none",ua:i||"none"})},t.stvPayload=function(e,t,n,r){return{isSmartTV:e,engineName:t.name||!1,engineVersion:t.version,osName:n.name,osVersion:n.version,userAgent:r}},t.consolePayload=function(e,t,n,r){return{isConsole:e,engineName:t.name||!1,engineVersion:t.version,osName:n.name,osVersion:n.version,userAgent:r}},t.wearPayload=function(e,t,n,r){return{isWearable:e,engineName:t.name||!1,engineVersion:t.version,osName:n.name,osVersion:n.version,userAgent:r}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deviceDetect=void 0;var r=n(4);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var i=n(1);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var o,a=n(7),s=(o=a)&&o.__esModule?o:{default:o};t.deviceDetect=s.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CustomView=t.WearableView=t.ConsoleView=t.SmartTVView=t.MobileOnlyView=t.WinPhoneView=t.TabletView=t.MobileView=t.IOSView=t.IEView=t.BrowserView=t.AndroidView=void 0;var r,i=n(5),o=(r=i)&&r.__esModule?r:{default:r},a=n(1);t.AndroidView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,s=e.style;return a.isAndroid?t?o.default.createElement(i.Fragment,null,n):o.default.createElement("div",{className:r,style:s},n):null},t.BrowserView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,s=e.style;return a.isBrowser?t?o.default.createElement(i.Fragment,null,n):o.default.createElement("div",{className:r,style:s},n):null},t.IEView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,s=e.style;return a.isIE?t?o.default.createElement(i.Fragment,null,n):o.default.createElement("div",{className:r,style:s},n):null},t.IOSView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,s=e.style;return a.isIOS?t?o.default.createElement(i.Fragment,null,n):o.default.createElement("div",{className:r,style:s},n):null},t.MobileView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,s=e.style;return a.isMobile?t?o.default.createElement(i.Fragment,null,n):o.default.createElement("div",{className:r,style:s},n):null},t.TabletView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,s=e.style;return a.isTablet?t?o.default.createElement(i.Fragment,null,n):o.default.createElement("div",{className:r,style:s},n):null},t.WinPhoneView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,s=e.style;return a.isWinPhone?t?o.default.createElement(i.Fragment,null,n):o.default.createElement("div",{className:r,style:s},n):null},t.MobileOnlyView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,s=e.style;return a.isMobileOnly?t?o.default.createElement(i.Fragment,null,n):o.default.createElement("div",{className:r,style:s},n):null},t.SmartTVView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,s=e.style;return a.isSmartTV?t?o.default.createElement(i.Fragment,null,n):o.default.createElement("div",{className:r,style:s},n):null},t.ConsoleView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,s=e.style;return a.isConsole?t?o.default.createElement(i.Fragment,null,n):o.default.createElement("div",{className:r,style:s},n):null},t.WearableView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,s=e.style;return a.isWearable?t?o.default.createElement(i.Fragment,null,n):o.default.createElement("div",{className:r,style:s},n):null},t.CustomView=function(e){var t=e.renderWithFragment,n=e.children,r=e.viewClassName,a=e.style;return e.condition?t?o.default.createElement(i.Fragment,null,n):o.default.createElement("div",{className:r,style:a},n):null}},function(e,t){e.exports=n(0)},function(e,t,n){var r;!function(i,o){"use strict";var a="model",s="name",l="type",u="vendor",c="version",p="mobile",h="tablet",d={extend:function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2===0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},has:function(e,t){return"string"===typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"===typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},f={rgx:function(e,t){for(var n,r,i,o,a,s,l=0;l<t.length&&!a;){var u=t[l],c=t[l+1];for(n=r=0;n<u.length&&!a;)if(a=u[n++].exec(e))for(i=0;i<c.length;i++)s=a[++r],"object"===typeof(o=c[i])&&o.length>0?2==o.length?"function"==typeof o[1]?this[o[0]]=o[1].call(this,s):this[o[0]]=o[1]:3==o.length?"function"!==typeof o[1]||o[1].exec&&o[1].test?this[o[0]]=s?s.replace(o[1],o[2]):void 0:this[o[0]]=s?o[1].call(this,s,o[2]):void 0:4==o.length&&(this[o[0]]=s?o[3].call(this,s.replace(o[1],o[2])):void 0):this[o]=s||void 0;l+=2}},str:function(e,t){for(var n in t)if("object"===typeof t[n]&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(d.has(t[n][r],e))return"?"===n?void 0:n}else if(d.has(t[n],e))return"?"===n?void 0:n;return e}},y={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},v={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[s,c],[/(opios)[\/\s]+([\w\.]+)/i],[[s,"Opera Mini"],c],[/\s(opr)\/([\w\.]+)/i],[[s,"Opera"],c],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[s,c],[/(konqueror)\/([\w\.]+)/i],[[s,"Konqueror"],c],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[s,"IE"],c],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[s,"Edge"],c],[/(yabrowser)\/([\w\.]+)/i],[[s,"Yandex"],c],[/(puffin)\/([\w\.]+)/i],[[s,"Puffin"],c],[/(focus)\/([\w\.]+)/i],[[s,"Firefox Focus"],c],[/(opt)\/([\w\.]+)/i],[[s,"Opera Touch"],c],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[s,"UCBrowser"],c],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],c],[/(windowswechat qbcore)\/([\w\.]+)/i],[[s,"WeChat(Win) Desktop"],c],[/(micromessenger)\/([\w\.]+)/i],[[s,"WeChat"],c],[/(brave)\/([\w\.]+)/i],[[s,"Brave"],c],[/(qqbrowserlite)\/([\w\.]+)/i],[s,c],[/(QQ)\/([\d\.]+)/i],[s,c],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[s,c],[/(BIDUBrowser)[\/\s]?([\w\.]+)/i],[s,c],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[s,c],[/(MetaSr)[\/\s]?([\w\.]+)/i],[s],[/(LBBROWSER)/i],[s],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[c,[s,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[c,[s,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[s,c],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[c,[s,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[s,/(.+)/,"$1 WebView"],c],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[s,/(.+(?:g|us))(.+)/,"$1 $2"],c],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[c,[s,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[s,"Sailfish Browser"],c],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[s,c],[/(dolfin)\/([\w\.]+)/i],[[s,"Dolphin"],c],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[s,"Chrome"],c],[/(coast)\/([\w\.]+)/i],[[s,"Opera Coast"],c],[/fxios\/([\w\.-]+)/i],[c,[s,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[c,[s,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[c,s],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[s,"GSA"],c],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[s,[c,f.str,y.browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[s,c],[/(navigator|netscape)\/([\w\.-]+)/i],[[s,"Netscape"],c],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[s,c]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",d.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/windows\s(ce|mobile);\sppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[["architecture",/ower/,"",d.lowerize]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[["architecture",d.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[a,u,[l,h]],[/applecoremedia\/[\w\.]+ \((ipad)/],[a,[u,"Apple"],[l,h]],[/(apple\s{0,1}tv)/i],[[a,"Apple TV"],[u,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[u,a,[l,h]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[a,[u,"Amazon"],[l,h]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[a,f.str,y.device.amazon.model],[u,"Amazon"],[l,p]],[/android.+aft([bms])\sbuild/i],[a,[u,"Amazon"],[l,"smarttv"]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[a,u,[l,p]],[/\((ip[honed|\s\w*]+);/i],[a,[u,"Apple"],[l,p]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[u,a,[l,p]],[/\(bb10;\s(\w+)/i],[a,[u,"BlackBerry"],[l,p]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[a,[u,"Asus"],[l,h]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[u,"Sony"],[a,"Xperia Tablet"],[l,h]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[a,[u,"Sony"],[l,p]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[u,a,[l,"console"]],[/android.+;\s(shield)\sbuild/i],[a,[u,"Nvidia"],[l,"console"]],[/(playstation\s[34portablevi]+)/i],[a,[u,"Sony"],[l,"console"]],[/(sprint\s(\w+))/i],[[u,f.str,y.device.sprint.vendor],[a,f.str,y.device.sprint.model],[l,p]],[/(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[u,[a,/_/g," "],[l,p]],[/(nexus\s9)/i],[a,[u,"HTC"],[l,h]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p)/i],[a,[u,"Huawei"],[l,p]],[/(microsoft);\s(lumia[\s\w]+)/i],[u,a,[l,p]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[a,[u,"Microsoft"],[l,"console"]],[/(kin\.[onetw]{3})/i],[[a,/\./g," "],[u,"Microsoft"],[l,p]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[a,[u,"Motorola"],[l,p]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[a,[u,"Motorola"],[l,h]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[u,d.trim],[a,d.trim],[l,"smarttv"]],[/hbbtv.+maple;(\d+)/i],[[a,/^/,"SmartTV"],[u,"Samsung"],[l,"smarttv"]],[/\(dtv[\);].+(aquos)/i],[a,[u,"Sharp"],[l,"smarttv"]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[u,"Samsung"],a,[l,h]],[/smart-tv.+(samsung)/i],[u,[l,"smarttv"],a],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[u,"Samsung"],a,[l,p]],[/sie-(\w*)/i],[a,[u,"Siemens"],[l,p]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[u,"Nokia"],a,[l,p]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[a,[u,"Acer"],[l,h]],[/android.+([vl]k\-?\d{3})\s+build/i],[a,[u,"LG"],[l,h]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[u,"LG"],a,[l,h]],[/(lg) netcast\.tv/i],[u,a,[l,"smarttv"]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[a,[u,"LG"],[l,p]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[u,a,[l,h]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[a,[u,"Lenovo"],[l,h]],[/(lenovo)[_\s-]?([\w-]+)/i],[u,a,[l,p]],[/linux;.+((jolla));/i],[u,a,[l,p]],[/((pebble))app\/[\d\.]+\s/i],[u,a,[l,"wearable"]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[u,a,[l,p]],[/crkey/i],[[a,"Chromecast"],[u,"Google"]],[/android.+;\s(glass)\s\d/i],[a,[u,"Google"],[l,"wearable"]],[/android.+;\s(pixel c)[\s)]/i],[a,[u,"Google"],[l,h]],[/android.+;\s(pixel( [23])?( xl)?)[\s)]/i],[a,[u,"Google"],[l,p]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:a\d|one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[a,/_/g," "],[u,"Xiaomi"],[l,p]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[a,/_/g," "],[u,"Xiaomi"],[l,h]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[a,[u,"Meizu"],[l,p]],[/(mz)-([\w-]{2,})/i],[[u,"Meizu"],a,[l,p]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})\s+build/i],[a,[u,"OnePlus"],[l,p]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[a,[u,"RCA"],[l,h]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[a,[u,"Dell"],[l,h]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[a,[u,"Verizon"],[l,h]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[u,"Barnes & Noble"],a,[l,h]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[a,[u,"NuVision"],[l,h]],[/android.+;\s(k88)\sbuild/i],[a,[u,"ZTE"],[l,h]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[a,[u,"Swiss"],[l,p]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[a,[u,"Swiss"],[l,h]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[a,[u,"Zeki"],[l,h]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[u,"Dragon Touch"],a,[l,h]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[a,[u,"Insignia"],[l,h]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[a,[u,"NextBook"],[l,h]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[u,"Voice"],a,[l,p]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[u,"LvTel"],a,[l,p]],[/android.+;\s(PH-1)\s/i],[a,[u,"Essential"],[l,p]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[a,[u,"Envizen"],[l,h]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[u,a,[l,h]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[a,[u,"MachSpeed"],[l,h]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[u,a,[l,h]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[a,[u,"Rotor"],[l,h]],[/android.+(KS(.+))\s+build/i],[a,[u,"Amazon"],[l,h]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[u,a,[l,h]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[l,d.lowerize],u,a],[/[\s\/\(](smart-?tv)[;\)]/i],[[l,"smarttv"]],[/(android[\w\.\s\-]{0,9});.+build/i],[a,[u,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[c,[s,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)/i],[[s,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[s,c],[/rv\:([\w\.]{1,9}).+(gecko)/i],[c,s]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[s,c],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[s,[c,f.str,y.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[s,"Windows"],[c,f.str,y.os.windows.version]],[/\((bb)(10);/i],[[s,"BlackBerry"],c],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[s,c],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[s,"Symbian"],c],[/\((series40);/i],[s],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[s,"Firefox OS"],c],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[s,c],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[s,"Chromium OS"],c],[/(sunos)\s?([\w\.\d]*)/i],[[s,"Solaris"],c],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[s,c],[/(haiku)\s(\w+)/i],[s,c],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[c,/_/g,"."],[s,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[s,"Mac OS"],[c,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[s,c]]},m=function e(t,n){if("object"===typeof t&&(n=t,t=void 0),!(this instanceof e))return new e(t,n).getResult();var r=t||(i&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),o=n?d.extend(v,n):v;return this.getBrowser=function(){var e={name:void 0,version:void 0};return f.rgx.call(e,r,o.browser),e.major=d.major(e.version),e},this.getCPU=function(){var e={architecture:void 0};return f.rgx.call(e,r,o.cpu),e},this.getDevice=function(){var e={vendor:void 0,model:void 0,type:void 0};return f.rgx.call(e,r,o.device),e},this.getEngine=function(){var e={name:void 0,version:void 0};return f.rgx.call(e,r,o.engine),e},this.getOS=function(){var e={name:void 0,version:void 0};return f.rgx.call(e,r,o.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=e,this},this};m.VERSION="0.7.20",m.BROWSER={NAME:s,MAJOR:"major",VERSION:c},m.CPU={ARCHITECTURE:"architecture"},m.DEVICE={MODEL:a,VENDOR:u,TYPE:l,CONSOLE:"console",MOBILE:p,SMARTTV:"smarttv",TABLET:h,WEARABLE:"wearable",EMBEDDED:"embedded"},m.ENGINE={NAME:s,VERSION:c},m.OS={NAME:s,VERSION:c},"undefined"!==typeof t?("undefined"!==typeof e&&e.exports&&(t=e.exports=m),t.UAParser=m):void 0===(r=function(){return m}.call(t,n,t,e))||(e.exports=r);var g=i&&(i.jQuery||i.Zepto);if("undefined"!==typeof g&&!g.ua){var _=new m;g.ua=_.getResult(),g.ua.get=function(){return _.getUA()},g.ua.set=function(e){_.setUA(e);var t=_.getResult();for(var n in t)g.ua[n]=t[n]}}}("object"===typeof window?window:this)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(2));var o=i.checkType(r.device.type);t.default=function(){var e=o.isBrowser,t=o.isMobile,n=o.isTablet,a=o.isSmartTV,s=o.isConsole,l=o.isWearable;return e?i.broPayload(e,r.browser,r.engine,r.os,r.ua):a?i.stvPayload(a,r.engine,r.os,r.ua):s?i.consolePayload(s,r.engine,r.os,r.ua):t?i.mobilePayload(o,r.device,r.os,r.ua):n?i.mobilePayload(o,r.device,r.os,r.ua):l?i.wearPayload(l,r.engine,r.os,r.ua):void 0}}])},function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}n.d(t,"a",function(){return r})},,function(e,t,n){"use strict";var r=n(11),i="function"===typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,a=i?Symbol.for("react.portal"):60106,s=i?Symbol.for("react.fragment"):60107,l=i?Symbol.for("react.strict_mode"):60108,u=i?Symbol.for("react.profiler"):60114,c=i?Symbol.for("react.provider"):60109,p=i?Symbol.for("react.context"):60110,h=i?Symbol.for("react.forward_ref"):60112,d=i?Symbol.for("react.suspense"):60113,f=i?Symbol.for("react.suspense_list"):60120,y=i?Symbol.for("react.memo"):60115,v=i?Symbol.for("react.lazy"):60116;i&&Symbol.for("react.fundamental"),i&&Symbol.for("react.responder");var m="function"===typeof Symbol&&Symbol.iterator;function g(e){for(var t=e.message,n="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r]);return e.message="Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",e}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b={};function w(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||_}function E(){}function C(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||_}w.prototype.isReactComponent={},w.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw g(Error(85));this.updater.enqueueSetState(this,e,t,"setState")},w.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},E.prototype=w.prototype;var T=C.prototype=new E;T.constructor=C,r(T,w.prototype),T.isPureReactComponent=!0;var S={current:null},k={suspense:null},x={current:null},N=Object.prototype.hasOwnProperty,P={key:!0,ref:!0,__self:!0,__source:!0};function R(e,t,n){var r=void 0,i={},a=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)N.call(t,r)&&!P.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(1===l)i.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===i[r]&&(i[r]=l[r]);return{$$typeof:o,type:e,key:a,ref:s,props:i,_owner:x.current}}function O(e){return"object"===typeof e&&null!==e&&e.$$typeof===o}var I=/\/+/g,D=[];function A(e,t,n,r){if(D.length){var i=D.pop();return i.result=e,i.keyPrefix=t,i.func=n,i.context=r,i.count=0,i}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function F(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>D.length&&D.push(e)}function M(e,t,n){return null==e?0:function e(t,n,r,i){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var l=!1;if(null===t)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case o:case a:l=!0}}if(l)return r(i,t,""===n?"."+L(t,0):n),1;if(l=0,n=""===n?".":n+":",Array.isArray(t))for(var u=0;u<t.length;u++){var c=n+L(s=t[u],u);l+=e(s,c,r,i)}else if(c=null===t||"object"!==typeof t?null:"function"===typeof(c=m&&t[m]||t["@@iterator"])?c:null,"function"===typeof c)for(t=c.call(t),u=0;!(s=t.next()).done;)l+=e(s=s.value,c=n+L(s,u++),r,i);else if("object"===s)throw r=""+t,g(Error(31),"[object Object]"===r?"object with keys {"+Object.keys(t).join(", ")+"}":r,"");return l}(e,"",t,n)}function L(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}(e.key):t.toString(36)}function W(e,t){e.func.call(e.context,t,e.count++)}function U(e,t,n){var r=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?V(e,r,n,function(e){return e}):null!=e&&(O(e)&&(e=function(e,t){return{$$typeof:o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,i+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(I,"$&/")+"/")+n)),r.push(e))}function V(e,t,n,r,i){var o="";null!=n&&(o=(""+n).replace(I,"$&/")+"/"),M(e,U,t=A(t,o,r,i)),F(t)}function j(){var e=S.current;if(null===e)throw g(Error(321));return e}var z={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return V(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;M(e,W,t=A(null,null,t,n)),F(t)},count:function(e){return M(e,function(){return null},null)},toArray:function(e){var t=[];return V(e,t,null,function(e){return e}),t},only:function(e){if(!O(e))throw g(Error(143));return e}},createRef:function(){return{current:null}},Component:w,PureComponent:C,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:p,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:c,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:h,render:e}},lazy:function(e){return{$$typeof:v,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:y,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return j().useCallback(e,t)},useContext:function(e,t){return j().useContext(e,t)},useEffect:function(e,t){return j().useEffect(e,t)},useImperativeHandle:function(e,t,n){return j().useImperativeHandle(e,t,n)},useDebugValue:function(){},useLayoutEffect:function(e,t){return j().useLayoutEffect(e,t)},useMemo:function(e,t){return j().useMemo(e,t)},useReducer:function(e,t,n){return j().useReducer(e,t,n)},useRef:function(e){return j().useRef(e)},useState:function(e){return j().useState(e)},Fragment:s,Profiler:u,StrictMode:l,Suspense:d,unstable_SuspenseList:f,createElement:R,cloneElement:function(e,t,n){if(null===e||void 0===e)throw g(Error(267),e);var i=void 0,a=r({},e.props),s=e.key,l=e.ref,u=e._owner;if(null!=t){void 0!==t.ref&&(l=t.ref,u=x.current),void 0!==t.key&&(s=""+t.key);var c=void 0;for(i in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)N.call(t,i)&&!P.hasOwnProperty(i)&&(a[i]=void 0===t[i]&&void 0!==c?c[i]:t[i])}if(1===(i=arguments.length-2))a.children=n;else if(1<i){c=Array(i);for(var p=0;p<i;p++)c[p]=arguments[p+2];a.children=c}return{$$typeof:o,type:e.type,key:s,ref:l,props:a,_owner:u}},createFactory:function(e){var t=R.bind(null,e);return t.type=e,t},isValidElement:O,version:"16.9.0",unstable_withSuspenseConfig:function(e,t){var n=k.suspense;k.suspense=void 0===t?null:t;try{e()}finally{k.suspense=n}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:S,ReactCurrentBatchConfig:k,ReactCurrentOwner:x,IsSomeRendererActing:{current:!1},assign:r}},B={default:z},Q=B&&z||B;e.exports=Q.default||Q},function(e,t,n){"use strict";var r=n(0),i=n(11),o=n(20);function a(e){for(var t=e.message,n="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r]);return e.message="Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",e}if(!r)throw a(Error(227));var s=null,l={};function u(){if(s)for(var e in l){var t=l[e],n=s.indexOf(e);if(!(-1<n))throw a(Error(96),e);if(!p[n]){if(!t.extractEvents)throw a(Error(97),e);for(var r in p[n]=t,n=t.eventTypes){var i=void 0,o=n[r],u=t,d=r;if(h.hasOwnProperty(d))throw a(Error(99),d);h[d]=o;var f=o.phasedRegistrationNames;if(f){for(i in f)f.hasOwnProperty(i)&&c(f[i],u,d);i=!0}else o.registrationName?(c(o.registrationName,u,d),i=!0):i=!1;if(!i)throw a(Error(98),r,e)}}}}function c(e,t,n){if(d[e])throw a(Error(100),e);d[e]=t,f[e]=t.eventTypes[n].dependencies}var p=[],h={},d={},f={};var y=!1,v=null,m=!1,g=null,_={onError:function(e){y=!0,v=e}};function b(e,t,n,r,i,o,a,s,l){y=!1,v=null,function(e,t,n,r,i,o,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}.apply(_,arguments)}var w=null,E=null,C=null;function T(e,t,n){var r=e.type||"unknown-event";e.currentTarget=C(n),function(e,t,n,r,i,o,s,l,u){if(b.apply(this,arguments),y){if(!y)throw a(Error(198));var c=v;y=!1,v=null,m||(m=!0,g=c)}}(r,t,void 0,e),e.currentTarget=null}function S(e,t){if(null==t)throw a(Error(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function k(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var x=null;function N(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;r<t.length&&!e.isPropagationStopped();r++)T(e,t[r],n[r]);else t&&T(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function P(e){if(null!==e&&(x=S(x,e)),e=x,x=null,e){if(k(e,N),x)throw a(Error(95));if(m)throw e=g,m=!1,g=null,e}}var R={injectEventPluginOrder:function(e){if(s)throw a(Error(101));s=Array.prototype.slice.call(e),u()},injectEventPluginsByName:function(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];if(!l.hasOwnProperty(t)||l[t]!==r){if(l[t])throw a(Error(102),t);l[t]=r,n=!0}}n&&u()}};function O(e,t){var n=e.stateNode;if(!n)return null;var r=w(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw a(Error(231),t,typeof n);return n}var I=Math.random().toString(36).slice(2),D="__reactInternalInstance$"+I,A="__reactEventHandlers$"+I;function F(e){if(e[D])return e[D];for(;!e[D];){if(!e.parentNode)return null;e=e.parentNode}return 5===(e=e[D]).tag||6===e.tag?e:null}function M(e){return!(e=e[D])||5!==e.tag&&6!==e.tag?null:e}function L(e){if(5===e.tag||6===e.tag)return e.stateNode;throw a(Error(33))}function W(e){return e[A]||null}function U(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function V(e,t,n){(t=O(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=S(n._dispatchListeners,t),n._dispatchInstances=S(n._dispatchInstances,e))}function j(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=U(t);for(t=n.length;0<t--;)V(n[t],"captured",e);for(t=0;t<n.length;t++)V(n[t],"bubbled",e)}}function z(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=O(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=S(n._dispatchListeners,t),n._dispatchInstances=S(n._dispatchInstances,e))}function B(e){e&&e.dispatchConfig.registrationName&&z(e._targetInst,null,e)}function Q(e){k(e,j)}var q=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement);function H(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Y={animationend:H("Animation","AnimationEnd"),animationiteration:H("Animation","AnimationIteration"),animationstart:H("Animation","AnimationStart"),transitionend:H("Transition","TransitionEnd")},K={},G={};function $(e){if(K[e])return K[e];if(!Y[e])return e;var t,n=Y[e];for(t in n)if(n.hasOwnProperty(t)&&t in G)return K[e]=n[t];return e}q&&(G=document.createElement("div").style,"AnimationEvent"in window||(delete Y.animationend.animation,delete Y.animationiteration.animation,delete Y.animationstart.animation),"TransitionEvent"in window||delete Y.transitionend.transition);var X=$("animationend"),J=$("animationiteration"),Z=$("animationstart"),ee=$("transitionend"),te="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ne=null,re=null,ie=null;function oe(){if(ie)return ie;var e,t,n=re,r=n.length,i="value"in ne?ne.value:ne.textContent,o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===i[o-t];t++);return ie=i.slice(e,1<t?1-t:void 0)}function ae(){return!0}function se(){return!1}function le(e,t,n,r){for(var i in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(i)&&((t=e[i])?this[i]=t(n):"target"===i?this.target=r:this[i]=n[i]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?ae:se,this.isPropagationStopped=se,this}function ue(e,t,n,r){if(this.eventPool.length){var i=this.eventPool.pop();return this.call(i,e,t,n,r),i}return new this(e,t,n,r)}function ce(e){if(!(e instanceof this))throw a(Error(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function pe(e){e.eventPool=[],e.getPooled=ue,e.release=ce}i(le.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=ae)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=ae)},persist:function(){this.isPersistent=ae},isPersistent:se,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=se,this._dispatchInstances=this._dispatchListeners=null}}),le.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},le.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var o=new t;return i(o,n.prototype),n.prototype=o,n.prototype.constructor=n,n.Interface=i({},r.Interface,e),n.extend=r.extend,pe(n),n},pe(le);var he=le.extend({data:null}),de=le.extend({data:null}),fe=[9,13,27,32],ye=q&&"CompositionEvent"in window,ve=null;q&&"documentMode"in document&&(ve=document.documentMode);var me=q&&"TextEvent"in window&&!ve,ge=q&&(!ye||ve&&8<ve&&11>=ve),_e=String.fromCharCode(32),be={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},we=!1;function Ee(e,t){switch(e){case"keyup":return-1!==fe.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Ce(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Te=!1;var Se={eventTypes:be,extractEvents:function(e,t,n,r){var i=void 0,o=void 0;if(ye)e:{switch(e){case"compositionstart":i=be.compositionStart;break e;case"compositionend":i=be.compositionEnd;break e;case"compositionupdate":i=be.compositionUpdate;break e}i=void 0}else Te?Ee(e,n)&&(i=be.compositionEnd):"keydown"===e&&229===n.keyCode&&(i=be.compositionStart);return i?(ge&&"ko"!==n.locale&&(Te||i!==be.compositionStart?i===be.compositionEnd&&Te&&(o=oe()):(re="value"in(ne=r)?ne.value:ne.textContent,Te=!0)),i=he.getPooled(i,t,n,r),o?i.data=o:null!==(o=Ce(n))&&(i.data=o),Q(i),o=i):o=null,(e=me?function(e,t){switch(e){case"compositionend":return Ce(t);case"keypress":return 32!==t.which?null:(we=!0,_e);case"textInput":return(e=t.data)===_e&&we?null:e;default:return null}}(e,n):function(e,t){if(Te)return"compositionend"===e||!ye&&Ee(e,t)?(e=oe(),ie=re=ne=null,Te=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return ge&&"ko"!==t.locale?null:t.data;default:return null}}(e,n))?((t=de.getPooled(be.beforeInput,t,n,r)).data=e,Q(t)):t=null,null===o?t:null===t?o:[o,t]}},ke=null,xe=null,Ne=null;function Pe(e){if(e=E(e)){if("function"!==typeof ke)throw a(Error(280));var t=w(e.stateNode);ke(e.stateNode,e.type,t)}}function Re(e){xe?Ne?Ne.push(e):Ne=[e]:xe=e}function Oe(){if(xe){var e=xe,t=Ne;if(Ne=xe=null,Pe(e),t)for(e=0;e<t.length;e++)Pe(t[e])}}function Ie(e,t){return e(t)}function De(e,t,n,r){return e(t,n,r)}function Ae(){}var Fe=Ie,Me=!1;function Le(){null===xe&&null===Ne||(Ae(),Oe())}var We={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ue(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!We[e.type]:"textarea"===t}function Ve(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function je(e){if(!q)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"===typeof t[e]),t}function ze(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Be(e){e._valueTracker||(e._valueTracker=function(e){var t=ze(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Qe(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ze(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}var qe=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;qe.hasOwnProperty("ReactCurrentDispatcher")||(qe.ReactCurrentDispatcher={current:null}),qe.hasOwnProperty("ReactCurrentBatchConfig")||(qe.ReactCurrentBatchConfig={suspense:null});var He=/^(.*)[\\\/]/,Ye="function"===typeof Symbol&&Symbol.for,Ke=Ye?Symbol.for("react.element"):60103,Ge=Ye?Symbol.for("react.portal"):60106,$e=Ye?Symbol.for("react.fragment"):60107,Xe=Ye?Symbol.for("react.strict_mode"):60108,Je=Ye?Symbol.for("react.profiler"):60114,Ze=Ye?Symbol.for("react.provider"):60109,et=Ye?Symbol.for("react.context"):60110,tt=Ye?Symbol.for("react.concurrent_mode"):60111,nt=Ye?Symbol.for("react.forward_ref"):60112,rt=Ye?Symbol.for("react.suspense"):60113,it=Ye?Symbol.for("react.suspense_list"):60120,ot=Ye?Symbol.for("react.memo"):60115,at=Ye?Symbol.for("react.lazy"):60116;Ye&&Symbol.for("react.fundamental"),Ye&&Symbol.for("react.responder");var st="function"===typeof Symbol&&Symbol.iterator;function lt(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=st&&e[st]||e["@@iterator"])?e:null}function ut(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case $e:return"Fragment";case Ge:return"Portal";case Je:return"Profiler";case Xe:return"StrictMode";case rt:return"Suspense";case it:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case et:return"Context.Consumer";case Ze:return"Context.Provider";case nt:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case ot:return ut(e.type);case at:if(e=1===e._status?e._result:null)return ut(e)}return null}function ct(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var r=e._debugOwner,i=e._debugSource,o=ut(e.type);n=null,r&&(n=ut(r.type)),r=o,o="",i?o=" (at "+i.fileName.replace(He,"")+":"+i.lineNumber+")":n&&(o=" (created by "+n+")"),n="\n    in "+(r||"Unknown")+o}t+=n,e=e.return}while(e);return t}var pt=/^[: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][: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\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ht=Object.prototype.hasOwnProperty,dt={},ft={};function yt(e,t,n,r,i,o){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o}var vt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){vt[e]=new yt(e,0,!1,e,null,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];vt[t]=new yt(t,1,!1,e[1],null,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){vt[e]=new yt(e,2,!1,e.toLowerCase(),null,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){vt[e]=new yt(e,2,!1,e,null,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){vt[e]=new yt(e,3,!1,e.toLowerCase(),null,!1)}),["checked","multiple","muted","selected"].forEach(function(e){vt[e]=new yt(e,3,!0,e,null,!1)}),["capture","download"].forEach(function(e){vt[e]=new yt(e,4,!1,e,null,!1)}),["cols","rows","size","span"].forEach(function(e){vt[e]=new yt(e,6,!1,e,null,!1)}),["rowSpan","start"].forEach(function(e){vt[e]=new yt(e,5,!1,e.toLowerCase(),null,!1)});var mt=/[\-:]([a-z])/g;function gt(e){return e[1].toUpperCase()}function _t(e,t,n,r){var i=vt.hasOwnProperty(t)?vt[t]:null;(null!==i?0===i.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!ht.call(ft,e)||!ht.call(dt,e)&&(pt.test(e)?ft[e]=!0:(dt[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}function bt(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function wt(e,t){var n=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Et(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=bt(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Ct(e,t){null!=(t=t.checked)&&_t(e,"checked",t,!1)}function Tt(e,t){Ct(e,t);var n=bt(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?kt(e,t.type,n):t.hasOwnProperty("defaultValue")&&kt(e,t.type,bt(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function St(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function kt(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}"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(e){var t=e.replace(mt,gt);vt[t]=new yt(t,1,!1,e,null,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(mt,gt);vt[t]=new yt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(mt,gt);vt[t]=new yt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)}),["tabIndex","crossOrigin"].forEach(function(e){vt[e]=new yt(e,1,!1,e.toLowerCase(),null,!1)}),vt.xlinkHref=new yt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach(function(e){vt[e]=new yt(e,1,!1,e.toLowerCase(),null,!0)});var xt={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function Nt(e,t,n){return(e=le.getPooled(xt.change,e,t,n)).type="change",Re(n),Q(e),e}var Pt=null,Rt=null;function Ot(e){P(e)}function It(e){if(Qe(L(e)))return e}function Dt(e,t){if("change"===e)return t}var At=!1;function Ft(){Pt&&(Pt.detachEvent("onpropertychange",Mt),Rt=Pt=null)}function Mt(e){if("value"===e.propertyName&&It(Rt))if(e=Nt(Rt,e,Ve(e)),Me)P(e);else{Me=!0;try{Ie(Ot,e)}finally{Me=!1,Le()}}}function Lt(e,t,n){"focus"===e?(Ft(),Rt=n,(Pt=t).attachEvent("onpropertychange",Mt)):"blur"===e&&Ft()}function Wt(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return It(Rt)}function Ut(e,t){if("click"===e)return It(t)}function Vt(e,t){if("input"===e||"change"===e)return It(t)}q&&(At=je("input")&&(!document.documentMode||9<document.documentMode));var jt={eventTypes:xt,_isInputEventSupported:At,extractEvents:function(e,t,n,r){var i=t?L(t):window,o=void 0,a=void 0,s=i.nodeName&&i.nodeName.toLowerCase();if("select"===s||"input"===s&&"file"===i.type?o=Dt:Ue(i)?At?o=Vt:(o=Wt,a=Lt):(s=i.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===i.type||"radio"===i.type)&&(o=Ut),o&&(o=o(e,t)))return Nt(o,n,r);a&&a(e,i,t),"blur"===e&&(e=i._wrapperState)&&e.controlled&&"number"===i.type&&kt(i,"number",i.value)}},zt=le.extend({view:null,detail:null}),Bt={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qt(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Bt[e])&&!!t[e]}function qt(){return Qt}var Ht=0,Yt=0,Kt=!1,Gt=!1,$t=zt.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:qt,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=Ht;return Ht=e.screenX,Kt?"mousemove"===e.type?e.screenX-t:0:(Kt=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=Yt;return Yt=e.screenY,Gt?"mousemove"===e.type?e.screenY-t:0:(Gt=!0,0)}}),Xt=$t.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Jt={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},Zt={eventTypes:Jt,extractEvents:function(e,t,n,r){var i="mouseover"===e||"pointerover"===e,o="mouseout"===e||"pointerout"===e;if(i&&(n.relatedTarget||n.fromElement)||!o&&!i)return null;if(i=r.window===r?r:(i=r.ownerDocument)?i.defaultView||i.parentWindow:window,o?(o=t,t=(t=n.relatedTarget||n.toElement)?F(t):null):o=null,o===t)return null;var a=void 0,s=void 0,l=void 0,u=void 0;"mouseout"===e||"mouseover"===e?(a=$t,s=Jt.mouseLeave,l=Jt.mouseEnter,u="mouse"):"pointerout"!==e&&"pointerover"!==e||(a=Xt,s=Jt.pointerLeave,l=Jt.pointerEnter,u="pointer");var c=null==o?i:L(o);if(i=null==t?i:L(t),(e=a.getPooled(s,o,n,r)).type=u+"leave",e.target=c,e.relatedTarget=i,(n=a.getPooled(l,t,n,r)).type=u+"enter",n.target=i,n.relatedTarget=c,r=t,o&&r)e:{for(i=r,u=0,a=t=o;a;a=U(a))u++;for(a=0,l=i;l;l=U(l))a++;for(;0<u-a;)t=U(t),u--;for(;0<a-u;)i=U(i),a--;for(;u--;){if(t===i||t===i.alternate)break e;t=U(t),i=U(i)}t=null}else t=null;for(i=t,t=[];o&&o!==i&&(null===(u=o.alternate)||u!==i);)t.push(o),o=U(o);for(o=[];r&&r!==i&&(null===(u=r.alternate)||u!==i);)o.push(r),r=U(r);for(r=0;r<t.length;r++)z(t[r],"bubbled",e);for(r=o.length;0<r--;)z(o[r],"captured",n);return[e,n]}};function en(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t}var tn=Object.prototype.hasOwnProperty;function nn(e,t){if(en(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!tn.call(t,n[r])||!en(e[n[r]],t[n[r]]))return!1;return!0}function rn(e,t){return{responder:e,props:t}}function on(e){var t=e;if(e.alternate)for(;t.return;)t=t.return;else{if(0!==(2&t.effectTag))return 1;for(;t.return;)if(0!==(2&(t=t.return).effectTag))return 1}return 3===t.tag?2:3}function an(e){if(2!==on(e))throw a(Error(188))}function sn(e){if(!(e=function(e){var t=e.alternate;if(!t){if(3===(t=on(e)))throw a(Error(188));return 1===t?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return an(i),e;if(o===r)return an(i),t;o=o.sibling}throw a(Error(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw a(Error(189))}}if(n.alternate!==r)throw a(Error(190))}if(3!==n.tag)throw a(Error(188));return n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}new Map,new Map,new Set,new Map;var ln=le.extend({animationName:null,elapsedTime:null,pseudoElement:null}),un=le.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cn=zt.extend({relatedTarget:null});function pn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}for(var hn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dn={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"},fn=zt.extend({key:function(e){if(e.key){var t=hn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=pn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?dn[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:qt,charCode:function(e){return"keypress"===e.type?pn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?pn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),yn=$t.extend({dataTransfer:null}),vn=zt.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:qt}),mn=le.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),gn=$t.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),_n=[["blur","blur",0],["cancel","cancel",0],["click","click",0],["close","close",0],["contextmenu","contextMenu",0],["copy","copy",0],["cut","cut",0],["auxclick","auxClick",0],["dblclick","doubleClick",0],["dragend","dragEnd",0],["dragstart","dragStart",0],["drop","drop",0],["focus","focus",0],["input","input",0],["invalid","invalid",0],["keydown","keyDown",0],["keypress","keyPress",0],["keyup","keyUp",0],["mousedown","mouseDown",0],["mouseup","mouseUp",0],["paste","paste",0],["pause","pause",0],["play","play",0],["pointercancel","pointerCancel",0],["pointerdown","pointerDown",0],["pointerup","pointerUp",0],["ratechange","rateChange",0],["reset","reset",0],["seeked","seeked",0],["submit","submit",0],["touchcancel","touchCancel",0],["touchend","touchEnd",0],["touchstart","touchStart",0],["volumechange","volumeChange",0],["drag","drag",1],["dragenter","dragEnter",1],["dragexit","dragExit",1],["dragleave","dragLeave",1],["dragover","dragOver",1],["mousemove","mouseMove",1],["mouseout","mouseOut",1],["mouseover","mouseOver",1],["pointermove","pointerMove",1],["pointerout","pointerOut",1],["pointerover","pointerOver",1],["scroll","scroll",1],["toggle","toggle",1],["touchmove","touchMove",1],["wheel","wheel",1],["abort","abort",2],[X,"animationEnd",2],[J,"animationIteration",2],[Z,"animationStart",2],["canplay","canPlay",2],["canplaythrough","canPlayThrough",2],["durationchange","durationChange",2],["emptied","emptied",2],["encrypted","encrypted",2],["ended","ended",2],["error","error",2],["gotpointercapture","gotPointerCapture",2],["load","load",2],["loadeddata","loadedData",2],["loadedmetadata","loadedMetadata",2],["loadstart","loadStart",2],["lostpointercapture","lostPointerCapture",2],["playing","playing",2],["progress","progress",2],["seeking","seeking",2],["stalled","stalled",2],["suspend","suspend",2],["timeupdate","timeUpdate",2],[ee,"transitionEnd",2],["waiting","waiting",2]],bn={},wn={},En=0;En<_n.length;En++){var Cn=_n[En],Tn=Cn[0],Sn=Cn[1],kn=Cn[2],xn="on"+(Sn[0].toUpperCase()+Sn.slice(1)),Nn={phasedRegistrationNames:{bubbled:xn,captured:xn+"Capture"},dependencies:[Tn],eventPriority:kn};bn[Sn]=Nn,wn[Tn]=Nn}var Pn={eventTypes:bn,getEventPriority:function(e){return void 0!==(e=wn[e])?e.eventPriority:2},extractEvents:function(e,t,n,r){var i=wn[e];if(!i)return null;switch(e){case"keypress":if(0===pn(n))return null;case"keydown":case"keyup":e=fn;break;case"blur":case"focus":e=cn;break;case"click":if(2===n.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=$t;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=yn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=vn;break;case X:case J:case Z:e=ln;break;case ee:e=mn;break;case"scroll":e=zt;break;case"wheel":e=gn;break;case"copy":case"cut":case"paste":e=un;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Xt;break;default:e=le}return Q(t=e.getPooled(i,t,n,r)),t}},Rn=Pn.getEventPriority,On=[];function In(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r;for(r=n;r.return;)r=r.return;if(!(r=3!==r.tag?null:r.stateNode.containerInfo))break;e.ancestors.push(n),n=F(r)}while(n);for(n=0;n<e.ancestors.length;n++){t=e.ancestors[n];var i=Ve(e.nativeEvent);r=e.topLevelType;for(var o=e.nativeEvent,a=null,s=0;s<p.length;s++){var l=p[s];l&&(l=l.extractEvents(r,t,o,i))&&(a=S(a,l))}P(a)}}var Dn=!0;function An(e,t){Fn(t,e,!1)}function Fn(e,t,n){switch(Rn(t)){case 0:var r=function(e,t,n){Me||Ae();var r=Mn,i=Me;Me=!0;try{De(r,e,t,n)}finally{(Me=i)||Le()}}.bind(null,t,1);break;case 1:r=function(e,t,n){Mn(e,t,n)}.bind(null,t,1);break;default:r=Mn.bind(null,t,1)}n?e.addEventListener(t,r,!0):e.addEventListener(t,r,!1)}function Mn(e,t,n){if(Dn){if(null===(t=F(t=Ve(n)))||"number"!==typeof t.tag||2===on(t)||(t=null),On.length){var r=On.pop();r.topLevelType=e,r.nativeEvent=n,r.targetInst=t,e=r}else e={topLevelType:e,nativeEvent:n,targetInst:t,ancestors:[]};try{if(n=e,Me)In(n);else{Me=!0;try{Fe(In,n,void 0)}finally{Me=!1,Le()}}}finally{e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>On.length&&On.push(e)}}}var Ln=new("function"===typeof WeakMap?WeakMap:Map);function Wn(e){var t=Ln.get(e);return void 0===t&&(t=new Set,Ln.set(e,t)),t}function Un(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Vn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jn(e,t){var n,r=Vn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Vn(r)}}function zn(){for(var e=window,t=Un();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=Un((e=t.contentWindow).document)}return t}function Bn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var Qn=q&&"documentMode"in document&&11>=document.documentMode,qn={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Hn=null,Yn=null,Kn=null,Gn=!1;function $n(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Gn||null==Hn||Hn!==Un(n)?null:("selectionStart"in(n=Hn)&&Bn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},Kn&&nn(Kn,n)?null:(Kn=n,(e=le.getPooled(qn.select,Yn,e,t)).type="select",e.target=Hn,Q(e),e))}var Xn={eventTypes:qn,extractEvents:function(e,t,n,r){var i,o=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(i=!o)){e:{o=Wn(o),i=f.onSelect;for(var a=0;a<i.length;a++)if(!o.has(i[a])){o=!1;break e}o=!0}i=!o}if(i)return null;switch(o=t?L(t):window,e){case"focus":(Ue(o)||"true"===o.contentEditable)&&(Hn=o,Yn=t,Kn=null);break;case"blur":Kn=Yn=Hn=null;break;case"mousedown":Gn=!0;break;case"contextmenu":case"mouseup":case"dragend":return Gn=!1,$n(n,r);case"selectionchange":if(Qn)break;case"keydown":case"keyup":return $n(n,r)}return null}};function Jn(e,t){return e=i({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,function(e){null!=e&&(t+=e)}),t}(t.children))&&(e.children=t),e}function Zn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+bt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function er(e,t){if(null!=t.dangerouslySetInnerHTML)throw a(Error(91));return i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function tr(e,t){var n=t.value;if(null==n){if(n=t.defaultValue,null!=(t=t.children)){if(null!=n)throw a(Error(92));if(Array.isArray(t)){if(!(1>=t.length))throw a(Error(93));t=t[0]}n=t}null==n&&(n="")}e._wrapperState={initialValue:bt(n)}}function nr(e,t){var n=bt(t.value),r=bt(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function rr(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)}R.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),w=W,E=M,C=L,R.injectEventPluginsByName({SimpleEventPlugin:Pn,EnterLeaveEventPlugin:Zt,ChangeEventPlugin:jt,SelectEventPlugin:Xn,BeforeInputEventPlugin:Se});var ir={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function or(e){switch(e){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 ar(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?or(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var sr=void 0,lr=function(e){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n)})}:e}(function(e,t){if(e.namespaceURI!==ir.svg||"innerHTML"in e)e.innerHTML=t;else{for((sr=sr||document.createElement("div")).innerHTML="<svg>"+t+"</svg>",t=sr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ur(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var cr={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,gridArea:!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},pr=["Webkit","ms","Moz","O"];function hr(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||cr.hasOwnProperty(e)&&cr[e]?(""+t).trim():t+"px"}function dr(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=hr(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(cr).forEach(function(e){pr.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),cr[t]=cr[e]})});var fr=i({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 yr(e,t){if(t){if(fr[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw a(Error(137),e,"");if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw a(Error(60));if(!("object"===typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML))throw a(Error(61))}if(null!=t.style&&"object"!==typeof t.style)throw a(Error(62),"")}}function vr(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){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}}function mr(e,t){var n=Wn(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=f[t];for(var r=0;r<t.length;r++){var i=t[r];if(!n.has(i)){switch(i){case"scroll":Fn(e,"scroll",!0);break;case"focus":case"blur":Fn(e,"focus",!0),Fn(e,"blur",!0),n.add("blur"),n.add("focus");break;case"cancel":case"close":je(i)&&Fn(e,i,!0);break;case"invalid":case"submit":case"reset":break;default:-1===te.indexOf(i)&&An(i,e)}n.add(i)}}}function gr(){}var _r=null,br=null;function wr(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Er(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Cr="function"===typeof setTimeout?setTimeout:void 0,Tr="function"===typeof clearTimeout?clearTimeout:void 0;function Sr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}new Set;var kr=[],xr=-1;function Nr(e){0>xr||(e.current=kr[xr],kr[xr]=null,xr--)}function Pr(e,t){kr[++xr]=e.current,e.current=t}var Rr={},Or={current:Rr},Ir={current:!1},Dr=Rr;function Ar(e,t){var n=e.type.contextTypes;if(!n)return Rr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Fr(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Mr(e){Nr(Ir),Nr(Or)}function Lr(e){Nr(Ir),Nr(Or)}function Wr(e,t,n){if(Or.current!==Rr)throw a(Error(168));Pr(Or,t),Pr(Ir,n)}function Ur(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in e))throw a(Error(108),ut(t)||"Unknown",o);return i({},n,r)}function Vr(e){var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||Rr,Dr=Or.current,Pr(Or,t),Pr(Ir,Ir.current),!0}function jr(e,t,n){var r=e.stateNode;if(!r)throw a(Error(169));n?(t=Ur(e,t,Dr),r.__reactInternalMemoizedMergedChildContext=t,Nr(Ir),Nr(Or),Pr(Or,t)):Nr(Ir),Pr(Ir,n)}var zr=o.unstable_runWithPriority,Br=o.unstable_scheduleCallback,Qr=o.unstable_cancelCallback,qr=o.unstable_shouldYield,Hr=o.unstable_requestPaint,Yr=o.unstable_now,Kr=o.unstable_getCurrentPriorityLevel,Gr=o.unstable_ImmediatePriority,$r=o.unstable_UserBlockingPriority,Xr=o.unstable_NormalPriority,Jr=o.unstable_LowPriority,Zr=o.unstable_IdlePriority,ei={},ti=void 0!==Hr?Hr:function(){},ni=null,ri=null,ii=!1,oi=Yr(),ai=1e4>oi?Yr:function(){return Yr()-oi};function si(){switch(Kr()){case Gr:return 99;case $r:return 98;case Xr:return 97;case Jr:return 96;case Zr:return 95;default:throw a(Error(332))}}function li(e){switch(e){case 99:return Gr;case 98:return $r;case 97:return Xr;case 96:return Jr;case 95:return Zr;default:throw a(Error(332))}}function ui(e,t){return e=li(e),zr(e,t)}function ci(e,t,n){return e=li(e),Br(e,t,n)}function pi(e){return null===ni?(ni=[e],ri=Br(Gr,di)):ni.push(e),ei}function hi(){null!==ri&&Qr(ri),di()}function di(){if(!ii&&null!==ni){ii=!0;var e=0;try{var t=ni;ui(99,function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}}),ni=null}catch(n){throw null!==ni&&(ni=ni.slice(e+1)),Br(Gr,hi),n}finally{ii=!1}}}function fi(e,t){return 1073741823===t?99:1===t?95:0>=(e=10*(1073741821-t)-10*(1073741821-e))?99:250>=e?98:5250>=e?97:95}function yi(e,t){if(e&&e.defaultProps)for(var n in t=i({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}var vi={current:null},mi=null,gi=null,_i=null;function bi(){_i=gi=mi=null}function wi(e,t){var n=e.type._context;Pr(vi,n._currentValue),n._currentValue=t}function Ei(e){var t=vi.current;Nr(vi),e.type._context._currentValue=t}function Ci(e,t){for(;null!==e;){var n=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t);else{if(!(null!==n&&n.childExpirationTime<t))break;n.childExpirationTime=t}e=e.return}}function Ti(e,t){mi=e,_i=gi=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(e.expirationTime>=t&&(la=!0),e.firstContext=null)}function Si(e,t){if(_i!==e&&!1!==t&&0!==t)if("number"===typeof t&&1073741823!==t||(_i=e,t=1073741823),t={context:e,observedBits:t,next:null},null===gi){if(null===mi)throw a(Error(308));gi=t,mi.dependencies={expirationTime:0,firstContext:t,responders:null}}else gi=gi.next=t;return e._currentValue}var ki=!1;function xi(e){return{baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Ni(e){return{baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Pi(e,t){return{expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function Ri(e,t){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t)}function Oi(e,t){var n=e.alternate;if(null===n){var r=e.updateQueue,i=null;null===r&&(r=e.updateQueue=xi(e.memoizedState))}else r=e.updateQueue,i=n.updateQueue,null===r?null===i?(r=e.updateQueue=xi(e.memoizedState),i=n.updateQueue=xi(n.memoizedState)):r=e.updateQueue=Ni(i):null===i&&(i=n.updateQueue=Ni(r));null===i||r===i?Ri(r,t):null===r.lastUpdate||null===i.lastUpdate?(Ri(r,t),Ri(i,t)):(Ri(r,t),i.lastUpdate=t)}function Ii(e,t){var n=e.updateQueue;null===(n=null===n?e.updateQueue=xi(e.memoizedState):Di(e,n)).lastCapturedUpdate?n.firstCapturedUpdate=n.lastCapturedUpdate=t:(n.lastCapturedUpdate.next=t,n.lastCapturedUpdate=t)}function Di(e,t){var n=e.alternate;return null!==n&&t===n.updateQueue&&(t=e.updateQueue=Ni(t)),t}function Ai(e,t,n,r,o,a){switch(n.tag){case 1:return"function"===typeof(e=n.payload)?e.call(a,r,o):e;case 3:e.effectTag=-2049&e.effectTag|64;case 0:if(null===(o="function"===typeof(e=n.payload)?e.call(a,r,o):e)||void 0===o)break;return i({},r,o);case 2:ki=!0}return r}function Fi(e,t,n,r,i){ki=!1;for(var o=(t=Di(e,t)).baseState,a=null,s=0,l=t.firstUpdate,u=o;null!==l;){var c=l.expirationTime;c<i?(null===a&&(a=l,o=u),s<c&&(s=c)):(Us(c,l.suspenseConfig),u=Ai(e,0,l,u,n,r),null!==l.callback&&(e.effectTag|=32,l.nextEffect=null,null===t.lastEffect?t.firstEffect=t.lastEffect=l:(t.lastEffect.nextEffect=l,t.lastEffect=l))),l=l.next}for(c=null,l=t.firstCapturedUpdate;null!==l;){var p=l.expirationTime;p<i?(null===c&&(c=l,null===a&&(o=u)),s<p&&(s=p)):(u=Ai(e,0,l,u,n,r),null!==l.callback&&(e.effectTag|=32,l.nextEffect=null,null===t.lastCapturedEffect?t.firstCapturedEffect=t.lastCapturedEffect=l:(t.lastCapturedEffect.nextEffect=l,t.lastCapturedEffect=l))),l=l.next}null===a&&(t.lastUpdate=null),null===c?t.lastCapturedUpdate=null:e.effectTag|=32,null===a&&null===c&&(o=u),t.baseState=o,t.firstUpdate=a,t.firstCapturedUpdate=c,e.expirationTime=s,e.memoizedState=u}function Mi(e,t,n){null!==t.firstCapturedUpdate&&(null!==t.lastUpdate&&(t.lastUpdate.next=t.firstCapturedUpdate,t.lastUpdate=t.lastCapturedUpdate),t.firstCapturedUpdate=t.lastCapturedUpdate=null),Li(t.firstEffect,n),t.firstEffect=t.lastEffect=null,Li(t.firstCapturedEffect,n),t.firstCapturedEffect=t.lastCapturedEffect=null}function Li(e,t){for(;null!==e;){var n=e.callback;if(null!==n){e.callback=null;var r=t;if("function"!==typeof n)throw a(Error(191),n);n.call(r)}e=e.nextEffect}}var Wi=qe.ReactCurrentBatchConfig,Ui=(new r.Component).refs;function Vi(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:i({},t,n),e.memoizedState=n,null!==(r=e.updateQueue)&&0===e.expirationTime&&(r.baseState=n)}var ji={isMounted:function(e){return!!(e=e._reactInternalFiber)&&2===on(e)},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var r=ks(),i=Wi.suspense;(i=Pi(r=xs(r,e,i),i)).payload=t,void 0!==n&&null!==n&&(i.callback=n),Oi(e,i),Ps(e,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var r=ks(),i=Wi.suspense;(i=Pi(r=xs(r,e,i),i)).tag=1,i.payload=t,void 0!==n&&null!==n&&(i.callback=n),Oi(e,i),Ps(e,r)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=ks(),r=Wi.suspense;(r=Pi(n=xs(n,e,r),r)).tag=2,void 0!==t&&null!==t&&(r.callback=t),Oi(e,r),Ps(e,n)}};function zi(e,t,n,r,i,o,a){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,a):!t.prototype||!t.prototype.isPureReactComponent||(!nn(n,r)||!nn(i,o))}function Bi(e,t,n){var r=!1,i=Rr,o=t.contextType;return"object"===typeof o&&null!==o?o=Si(o):(i=Fr(t)?Dr:Or.current,o=(r=null!==(r=t.contextTypes)&&void 0!==r)?Ar(e,i):Rr),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ji,e.stateNode=t,t._reactInternalFiber=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function Qi(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ji.enqueueReplaceState(t,t.state,null)}function qi(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=Ui;var o=t.contextType;"object"===typeof o&&null!==o?i.context=Si(o):(o=Fr(t)?Dr:Or.current,i.context=Ar(e,o)),null!==(o=e.updateQueue)&&(Fi(e,o,n,i,r),i.state=e.memoizedState),"function"===typeof(o=t.getDerivedStateFromProps)&&(Vi(e,t,o,n),i.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(t=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&ji.enqueueReplaceState(i,i.state,null),null!==(o=e.updateQueue)&&(Fi(e,o,n,i,r),i.state=e.memoizedState)),"function"===typeof i.componentDidMount&&(e.effectTag|=4)}var Hi=Array.isArray;function Yi(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){n=n._owner;var r=void 0;if(n){if(1!==n.tag)throw a(Error(309));r=n.stateNode}if(!r)throw a(Error(147),e);var i=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===i?t.ref:((t=function(e){var t=r.refs;t===Ui&&(t=r.refs={}),null===e?delete t[i]:t[i]=e})._stringRef=i,t)}if("string"!==typeof e)throw a(Error(284));if(!n._owner)throw a(Error(290),e)}return e}function Ki(e,t){if("textarea"!==e.type)throw a(Error(31),"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,"")}function Gi(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t,n){return(e=Zs(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.effectTag=2,n):r:(t.effectTag=2,n):n}function s(t){return e&&null===t.alternate&&(t.effectTag=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=nl(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function u(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=Yi(e,t,n),r.return=e,r):((r=el(n.type,n.key,n.props,null,e.mode,r)).ref=Yi(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=rl(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function p(e,t,n,r,o){return null===t||7!==t.tag?((t=tl(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n){if("string"===typeof t||"number"===typeof t)return(t=nl(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case Ke:return(n=el(t.type,t.key,t.props,null,e.mode,n)).ref=Yi(e,null,t),n.return=e,n;case Ge:return(t=rl(t,e.mode,n)).return=e,t}if(Hi(t)||lt(t))return(t=tl(t,e.mode,n,null)).return=e,t;Ki(e,t)}return null}function d(e,t,n,r){var i=null!==t?t.key:null;if("string"===typeof n||"number"===typeof n)return null!==i?null:l(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case Ke:return n.key===i?n.type===$e?p(e,t,n.props.children,r,i):u(e,t,n,r):null;case Ge:return n.key===i?c(e,t,n,r):null}if(Hi(n)||lt(n))return null!==i?null:p(e,t,n,r,null);Ki(e,n)}return null}function f(e,t,n,r,i){if("string"===typeof r||"number"===typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"===typeof r&&null!==r){switch(r.$$typeof){case Ke:return e=e.get(null===r.key?n:r.key)||null,r.type===$e?p(t,e,r.props.children,i,r.key):u(t,e,r,i);case Ge:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(Hi(r)||lt(r))return p(t,e=e.get(n)||null,r,i,null);Ki(t,r)}return null}function y(i,a,s,l){for(var u=null,c=null,p=a,y=a=0,v=null;null!==p&&y<s.length;y++){p.index>y?(v=p,p=null):v=p.sibling;var m=d(i,p,s[y],l);if(null===m){null===p&&(p=v);break}e&&p&&null===m.alternate&&t(i,p),a=o(m,a,y),null===c?u=m:c.sibling=m,c=m,p=v}if(y===s.length)return n(i,p),u;if(null===p){for(;y<s.length;y++)null!==(p=h(i,s[y],l))&&(a=o(p,a,y),null===c?u=p:c.sibling=p,c=p);return u}for(p=r(i,p);y<s.length;y++)null!==(v=f(p,i,y,s[y],l))&&(e&&null!==v.alternate&&p.delete(null===v.key?y:v.key),a=o(v,a,y),null===c?u=v:c.sibling=v,c=v);return e&&p.forEach(function(e){return t(i,e)}),u}function v(i,s,l,u){var c=lt(l);if("function"!==typeof c)throw a(Error(150));if(null==(l=c.call(l)))throw a(Error(151));for(var p=c=null,y=s,v=s=0,m=null,g=l.next();null!==y&&!g.done;v++,g=l.next()){y.index>v?(m=y,y=null):m=y.sibling;var _=d(i,y,g.value,u);if(null===_){null===y&&(y=m);break}e&&y&&null===_.alternate&&t(i,y),s=o(_,s,v),null===p?c=_:p.sibling=_,p=_,y=m}if(g.done)return n(i,y),c;if(null===y){for(;!g.done;v++,g=l.next())null!==(g=h(i,g.value,u))&&(s=o(g,s,v),null===p?c=g:p.sibling=g,p=g);return c}for(y=r(i,y);!g.done;v++,g=l.next())null!==(g=f(y,i,v,g.value,u))&&(e&&null!==g.alternate&&y.delete(null===g.key?v:g.key),s=o(g,s,v),null===p?c=g:p.sibling=g,p=g);return e&&y.forEach(function(e){return t(i,e)}),c}return function(e,r,o,l){var u="object"===typeof o&&null!==o&&o.type===$e&&null===o.key;u&&(o=o.props.children);var c="object"===typeof o&&null!==o;if(c)switch(o.$$typeof){case Ke:e:{for(c=o.key,u=r;null!==u;){if(u.key===c){if(7===u.tag?o.type===$e:u.elementType===o.type){n(e,u.sibling),(r=i(u,o.type===$e?o.props.children:o.props)).ref=Yi(e,u,o),r.return=e,e=r;break e}n(e,u);break}t(e,u),u=u.sibling}o.type===$e?((r=tl(o.props.children,e.mode,l,o.key)).return=e,e=r):((l=el(o.type,o.key,o.props,null,e.mode,l)).ref=Yi(e,r,o),l.return=e,e=l)}return s(e);case Ge:e:{for(u=o.key;null!==r;){if(r.key===u){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=i(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=rl(o,e.mode,l)).return=e,e=r}return s(e)}if("string"===typeof o||"number"===typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,o)).return=e,e=r):(n(e,r),(r=nl(o,e.mode,l)).return=e,e=r),s(e);if(Hi(o))return y(e,r,o,l);if(lt(o))return v(e,r,o,l);if(c&&Ki(e,o),"undefined"===typeof o&&!u)switch(e.tag){case 1:case 0:throw e=e.type,a(Error(152),e.displayName||e.name||"Component")}return n(e,r)}}var $i=Gi(!0),Xi=Gi(!1),Ji={},Zi={current:Ji},eo={current:Ji},to={current:Ji};function no(e){if(e===Ji)throw a(Error(174));return e}function ro(e,t){Pr(to,t),Pr(eo,e),Pr(Zi,Ji);var n=t.nodeType;switch(n){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ar(null,"");break;default:t=ar(t=(n=8===n?t.parentNode:t).namespaceURI||null,n=n.tagName)}Nr(Zi),Pr(Zi,t)}function io(e){Nr(Zi),Nr(eo),Nr(to)}function oo(e){no(to.current);var t=no(Zi.current),n=ar(t,e.type);t!==n&&(Pr(eo,e),Pr(Zi,n))}function ao(e){eo.current===e&&(Nr(Zi),Nr(eo))}var so=1,lo=1,uo=2,co={current:0};function po(e){for(var t=e;null!==t;){if(13===t.tag){if(null!==t.memoizedState)return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ho=0,fo=2,yo=4,vo=8,mo=16,go=32,_o=64,bo=128,wo=qe.ReactCurrentDispatcher,Eo=0,Co=null,To=null,So=null,ko=null,xo=null,No=null,Po=0,Ro=null,Oo=0,Io=!1,Do=null,Ao=0;function Fo(){throw a(Error(321))}function Mo(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!en(e[n],t[n]))return!1;return!0}function Lo(e,t,n,r,i,o){if(Eo=o,Co=t,So=null!==e?e.memoizedState:null,wo.current=null===So?$o:Xo,t=n(r,i),Io){do{Io=!1,Ao+=1,So=null!==e?e.memoizedState:null,No=ko,Ro=xo=To=null,wo.current=Xo,t=n(r,i)}while(Io);Do=null,Ao=0}if(wo.current=Go,(e=Co).memoizedState=ko,e.expirationTime=Po,e.updateQueue=Ro,e.effectTag|=Oo,e=null!==To&&null!==To.next,Eo=0,No=xo=ko=So=To=Co=null,Po=0,Ro=null,Oo=0,e)throw a(Error(300));return t}function Wo(){wo.current=Go,Eo=0,No=xo=ko=So=To=Co=null,Po=0,Ro=null,Oo=0,Io=!1,Do=null,Ao=0}function Uo(){var e={memoizedState:null,baseState:null,queue:null,baseUpdate:null,next:null};return null===xo?ko=xo=e:xo=xo.next=e,xo}function Vo(){if(null!==No)No=(xo=No).next,So=null!==(To=So)?To.next:null;else{if(null===So)throw a(Error(310));var e={memoizedState:(To=So).memoizedState,baseState:To.baseState,queue:To.queue,baseUpdate:To.baseUpdate,next:null};xo=null===xo?ko=e:xo.next=e,So=To.next}return xo}function jo(e,t){return"function"===typeof t?t(e):t}function zo(e){var t=Vo(),n=t.queue;if(null===n)throw a(Error(311));if(n.lastRenderedReducer=e,0<Ao){var r=n.dispatch;if(null!==Do){var i=Do.get(n);if(void 0!==i){Do.delete(n);var o=t.memoizedState;do{o=e(o,i.action),i=i.next}while(null!==i);return en(o,t.memoizedState)||(la=!0),t.memoizedState=o,t.baseUpdate===n.last&&(t.baseState=o),n.lastRenderedState=o,[o,r]}}return[t.memoizedState,r]}r=n.last;var s=t.baseUpdate;if(o=t.baseState,null!==s?(null!==r&&(r.next=null),r=s.next):r=null!==r?r.next:null,null!==r){var l=i=null,u=r,c=!1;do{var p=u.expirationTime;p<Eo?(c||(c=!0,l=s,i=o),p>Po&&(Po=p)):(Us(p,u.suspenseConfig),o=u.eagerReducer===e?u.eagerState:e(o,u.action)),s=u,u=u.next}while(null!==u&&u!==r);c||(l=s,i=o),en(o,t.memoizedState)||(la=!0),t.memoizedState=o,t.baseUpdate=l,t.baseState=i,n.lastRenderedState=o}return[t.memoizedState,n.dispatch]}function Bo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===Ro?(Ro={lastEffect:null}).lastEffect=e.next=e:null===(t=Ro.lastEffect)?Ro.lastEffect=e.next=e:(n=t.next,t.next=e,e.next=n,Ro.lastEffect=e),e}function Qo(e,t,n,r){var i=Uo();Oo|=e,i.memoizedState=Bo(t,n,void 0,void 0===r?null:r)}function qo(e,t,n,r){var i=Vo();r=void 0===r?null:r;var o=void 0;if(null!==To){var a=To.memoizedState;if(o=a.destroy,null!==r&&Mo(r,a.deps))return void Bo(ho,n,o,r)}Oo|=e,i.memoizedState=Bo(t,n,o,r)}function Ho(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Yo(){}function Ko(e,t,n){if(!(25>Ao))throw a(Error(301));var r=e.alternate;if(e===Co||null!==r&&r===Co)if(Io=!0,e={expirationTime:Eo,suspenseConfig:null,action:n,eagerReducer:null,eagerState:null,next:null},null===Do&&(Do=new Map),void 0===(n=Do.get(t)))Do.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}else{var i=ks(),o=Wi.suspense;o={expirationTime:i=xs(i,e,o),suspenseConfig:o,action:n,eagerReducer:null,eagerState:null,next:null};var s=t.last;if(null===s)o.next=o;else{var l=s.next;null!==l&&(o.next=l),s.next=o}if(t.last=o,0===e.expirationTime&&(null===r||0===r.expirationTime)&&null!==(r=t.lastRenderedReducer))try{var u=t.lastRenderedState,c=r(u,n);if(o.eagerReducer=r,o.eagerState=c,en(c,u))return}catch(p){}Ps(e,i)}}var Go={readContext:Si,useCallback:Fo,useContext:Fo,useEffect:Fo,useImperativeHandle:Fo,useLayoutEffect:Fo,useMemo:Fo,useReducer:Fo,useRef:Fo,useState:Fo,useDebugValue:Fo,useResponder:Fo},$o={readContext:Si,useCallback:function(e,t){return Uo().memoizedState=[e,void 0===t?null:t],e},useContext:Si,useEffect:function(e,t){return Qo(516,bo|_o,e,t)},useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,Qo(4,yo|go,Ho.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qo(4,yo|go,e,t)},useMemo:function(e,t){var n=Uo();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Uo();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={last:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Ko.bind(null,Co,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Uo().memoizedState=e},useState:function(e){var t=Uo();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={last:null,dispatch:null,lastRenderedReducer:jo,lastRenderedState:e}).dispatch=Ko.bind(null,Co,e),[t.memoizedState,e]},useDebugValue:Yo,useResponder:rn},Xo={readContext:Si,useCallback:function(e,t){var n=Vo();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Mo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)},useContext:Si,useEffect:function(e,t){return qo(516,bo|_o,e,t)},useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,qo(4,yo|go,Ho.bind(null,t,e),n)},useLayoutEffect:function(e,t){return qo(4,yo|go,e,t)},useMemo:function(e,t){var n=Vo();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Mo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)},useReducer:zo,useRef:function(){return Vo().memoizedState},useState:function(e){return zo(jo)},useDebugValue:Yo,useResponder:rn},Jo=null,Zo=null,ea=!1;function ta(e,t){var n=Xs(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function na(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function ra(e){if(ea){var t=Zo;if(t){var n=t;if(!na(e,t)){if(!(t=Sr(n.nextSibling))||!na(e,t))return e.effectTag|=2,ea=!1,void(Jo=e);ta(Jo,n)}Jo=e,Zo=Sr(t.firstChild)}else e.effectTag|=2,ea=!1,Jo=e}}function ia(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&18!==e.tag;)e=e.return;Jo=e}function oa(e){if(e!==Jo)return!1;if(!ea)return ia(e),ea=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Er(t,e.memoizedProps))for(t=Zo;t;)ta(e,t),t=Sr(t.nextSibling);return ia(e),Zo=Jo?Sr(e.stateNode.nextSibling):null,!0}function aa(){Zo=Jo=null,ea=!1}var sa=qe.ReactCurrentOwner,la=!1;function ua(e,t,n,r){t.child=null===e?Xi(t,null,n,r):$i(t,e.child,n,r)}function ca(e,t,n,r,i){n=n.render;var o=t.ref;return Ti(t,i),r=Lo(e,t,n,r,o,i),null===e||la?(t.effectTag|=1,ua(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),Ea(e,t,i))}function pa(e,t,n,r,i,o){if(null===e){var a=n.type;return"function"!==typeof a||Js(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=el(n.type,null,r,null,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,ha(e,t,a,r,i,o))}return a=e.child,i<o&&(i=a.memoizedProps,(n=null!==(n=n.compare)?n:nn)(i,r)&&e.ref===t.ref)?Ea(e,t,o):(t.effectTag|=1,(e=Zs(a,r)).ref=t.ref,e.return=t,t.child=e)}function ha(e,t,n,r,i,o){return null!==e&&nn(e.memoizedProps,r)&&e.ref===t.ref&&(la=!1,i<o)?Ea(e,t,o):fa(e,t,n,r,o)}function da(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function fa(e,t,n,r,i){var o=Fr(n)?Dr:Or.current;return o=Ar(t,o),Ti(t,i),n=Lo(e,t,n,r,o,i),null===e||la?(t.effectTag|=1,ua(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),Ea(e,t,i))}function ya(e,t,n,r,i){if(Fr(n)){var o=!0;Vr(t)}else o=!1;if(Ti(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),Bi(t,n,r),qi(t,n,r,i),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;"object"===typeof u&&null!==u?u=Si(u):u=Ar(t,u=Fr(n)?Dr:Or.current);var c=n.getDerivedStateFromProps,p="function"===typeof c||"function"===typeof a.getSnapshotBeforeUpdate;p||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==r||l!==u)&&Qi(t,a,r,u),ki=!1;var h=t.memoizedState;l=a.state=h;var d=t.updateQueue;null!==d&&(Fi(t,d,r,a,i),l=t.memoizedState),s!==r||h!==l||Ir.current||ki?("function"===typeof c&&(Vi(t,n,c,r),l=t.memoizedState),(s=ki||zi(t,n,s,r,h,l,u))?(p||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.effectTag|=4)):("function"===typeof a.componentDidMount&&(t.effectTag|=4),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):("function"===typeof a.componentDidMount&&(t.effectTag|=4),r=!1)}else a=t.stateNode,s=t.memoizedProps,a.props=t.type===t.elementType?s:yi(t.type,s),l=a.context,"object"===typeof(u=n.contextType)&&null!==u?u=Si(u):u=Ar(t,u=Fr(n)?Dr:Or.current),(p="function"===typeof(c=n.getDerivedStateFromProps)||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==r||l!==u)&&Qi(t,a,r,u),ki=!1,l=t.memoizedState,h=a.state=l,null!==(d=t.updateQueue)&&(Fi(t,d,r,a,i),h=t.memoizedState),s!==r||l!==h||Ir.current||ki?("function"===typeof c&&(Vi(t,n,c,r),h=t.memoizedState),(c=ki||zi(t,n,s,r,l,h,u))?(p||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(r,h,u),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,h,u)),"function"===typeof a.componentDidUpdate&&(t.effectTag|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=u,r=c):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),r=!1);return va(e,t,n,r,o,i)}function va(e,t,n,r,i,o){da(e,t);var a=0!==(64&t.effectTag);if(!r&&!a)return i&&jr(t,n,!1),Ea(e,t,o);r=t.stateNode,sa.current=t;var s=a&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.effectTag|=1,null!==e&&a?(t.child=$i(t,e.child,null,o),t.child=$i(t,null,s,o)):ua(e,t,s,o),t.memoizedState=r.state,i&&jr(t,n,!0),t.child}function ma(e){var t=e.stateNode;t.pendingContext?Wr(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Wr(0,t.context,!1),ro(e,t.containerInfo)}var ga={};function _a(e,t,n){var r,i=t.mode,o=t.pendingProps,a=co.current,s=null,l=!1;if((r=0!==(64&t.effectTag))||(r=0!==(a&uo)&&(null===e||null!==e.memoizedState)),r?(s=ga,l=!0,t.effectTag&=-65):null!==e&&null===e.memoizedState||void 0===o.fallback||!0===o.unstable_avoidThisFallback||(a|=lo),Pr(co,a&=so),null===e)if(l){if(o=o.fallback,(e=tl(null,i,0,null)).return=t,0===(2&t.mode))for(l=null!==t.memoizedState?t.child.child:t.child,e.child=l;null!==l;)l.return=e,l=l.sibling;(n=tl(o,i,n,null)).return=t,e.sibling=n,i=e}else i=n=Xi(t,null,o.children,n);else{if(null!==e.memoizedState)if(i=(a=e.child).sibling,l){if(o=o.fallback,(n=Zs(a,a.pendingProps)).return=t,0===(2&t.mode)&&(l=null!==t.memoizedState?t.child.child:t.child)!==a.child)for(n.child=l;null!==l;)l.return=n,l=l.sibling;(o=Zs(i,o,i.expirationTime)).return=t,n.sibling=o,i=n,n.childExpirationTime=0,n=o}else i=n=$i(t,a.child,o.children,n);else if(a=e.child,l){if(l=o.fallback,(o=tl(null,i,0,null)).return=t,o.child=a,null!==a&&(a.return=o),0===(2&t.mode))for(a=null!==t.memoizedState?t.child.child:t.child,o.child=a;null!==a;)a.return=o,a=a.sibling;(n=tl(l,i,n,null)).return=t,o.sibling=n,n.effectTag|=2,i=o,o.childExpirationTime=0}else n=i=$i(t,a,o.children,n);t.stateNode=e.stateNode}return t.memoizedState=s,t.child=i,n}function ba(e,t,n,r,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,last:r,tail:n,tailExpiration:0,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.last=r,o.tail=n,o.tailExpiration=0,o.tailMode=i)}function wa(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(ua(e,t,r.children,n),0!==((r=co.current)&uo))r=r&so|uo,t.effectTag|=64;else{if(null!==e&&0!==(64&e.effectTag))e:for(e=t.child;null!==e;){if(13===e.tag){if(null!==e.memoizedState){e.expirationTime<n&&(e.expirationTime=n);var a=e.alternate;null!==a&&a.expirationTime<n&&(a.expirationTime=n),Ci(e.return,n)}}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=so}if(Pr(co,r),0===(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(r=n.alternate)&&null===po(r)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ba(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(r=i.alternate)&&null===po(r)){t.child=i;break}r=i.sibling,i.sibling=n,n=i,i=r}ba(t,!0,n,null,o);break;case"together":ba(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ea(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),t.childExpirationTime<n)return null;if(null!==e&&t.child!==e.child)throw a(Error(153));if(null!==t.child){for(n=Zs(e=t.child,e.pendingProps,e.expirationTime),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Zs(e,e.pendingProps,e.expirationTime)).return=t;n.sibling=null}return t.child}function Ca(e){e.effectTag|=4}var Ta=void 0,Sa=void 0,ka=void 0,xa=void 0;function Na(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pa(e){switch(e.tag){case 1:Fr(e.type)&&Mr();var t=e.effectTag;return 2048&t?(e.effectTag=-2049&t|64,e):null;case 3:if(io(),Lr(),0!==(64&(t=e.effectTag)))throw a(Error(285));return e.effectTag=-2049&t|64,e;case 5:return ao(e),null;case 13:return Nr(co),2048&(t=e.effectTag)?(e.effectTag=-2049&t|64,e):null;case 18:return null;case 19:return Nr(co),null;case 4:return io(),null;case 10:return Ei(e),null;default:return null}}function Ra(e,t){return{value:e,source:t,stack:ct(t)}}Ta=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(20===n.tag)e.appendChild(n.stateNode.instance);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Sa=function(){},ka=function(e,t,n,r,o){var a=e.memoizedProps;if(a!==r){var s=t.stateNode;switch(no(Zi.current),e=null,n){case"input":a=wt(s,a),r=wt(s,r),e=[];break;case"option":a=Jn(s,a),r=Jn(s,r),e=[];break;case"select":a=i({},a,{value:void 0}),r=i({},r,{value:void 0}),e=[];break;case"textarea":a=er(s,a),r=er(s,r),e=[];break;default:"function"!==typeof a.onClick&&"function"===typeof r.onClick&&(s.onclick=gr)}yr(n,r),s=n=void 0;var l=null;for(n in a)if(!r.hasOwnProperty(n)&&a.hasOwnProperty(n)&&null!=a[n])if("style"===n){var u=a[n];for(s in u)u.hasOwnProperty(s)&&(l||(l={}),l[s]="")}else"dangerouslySetInnerHTML"!==n&&"children"!==n&&"suppressContentEditableWarning"!==n&&"suppressHydrationWarning"!==n&&"autoFocus"!==n&&(d.hasOwnProperty(n)?e||(e=[]):(e=e||[]).push(n,null));for(n in r){var c=r[n];if(u=null!=a?a[n]:void 0,r.hasOwnProperty(n)&&c!==u&&(null!=c||null!=u))if("style"===n)if(u){for(s in u)!u.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(l||(l={}),l[s]="");for(s in c)c.hasOwnProperty(s)&&u[s]!==c[s]&&(l||(l={}),l[s]=c[s])}else l||(e||(e=[]),e.push(n,l)),l=c;else"dangerouslySetInnerHTML"===n?(c=c?c.__html:void 0,u=u?u.__html:void 0,null!=c&&u!==c&&(e=e||[]).push(n,""+c)):"children"===n?u===c||"string"!==typeof c&&"number"!==typeof c||(e=e||[]).push(n,""+c):"suppressContentEditableWarning"!==n&&"suppressHydrationWarning"!==n&&(d.hasOwnProperty(n)?(null!=c&&mr(o,n),e||u===c||(e=[])):(e=e||[]).push(n,c))}l&&(e=e||[]).push("style",l),o=e,(t.updateQueue=o)&&Ca(t)}},xa=function(e,t,n,r){n!==r&&Ca(t)};var Oa="function"===typeof WeakSet?WeakSet:Set;function Ia(e,t){var n=t.source,r=t.stack;null===r&&null!==n&&(r=ct(n)),null!==n&&ut(n.type),t=t.value,null!==e&&1===e.tag&&ut(e.type);try{console.error(t)}catch(i){setTimeout(function(){throw i})}}function Da(e){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(n){qs(e,n)}else t.current=null}function Aa(e,t,n){if(null!==(n=null!==(n=n.updateQueue)?n.lastEffect:null)){var r=n=n.next;do{if((r.tag&e)!==ho){var i=r.destroy;r.destroy=void 0,void 0!==i&&i()}(r.tag&t)!==ho&&(i=r.create,r.destroy=i()),r=r.next}while(r!==n)}}function Fa(e,t){switch("function"===typeof Gs&&Gs(e),e.tag){case 0:case 11:case 14:case 15:var n=e.updateQueue;if(null!==n&&null!==(n=n.lastEffect)){var r=n.next;ui(97<t?97:t,function(){var t=r;do{var n=t.destroy;if(void 0!==n){var i=e;try{n()}catch(o){qs(i,o)}}t=t.next}while(t!==r)})}break;case 1:Da(e),"function"===typeof(t=e.stateNode).componentWillUnmount&&function(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(n){qs(e,n)}}(e,t);break;case 5:Da(e);break;case 4:Ua(e,t)}}function Ma(e,t){for(var n=e;;)if(Fa(n,t),null!==n.child&&4!==n.tag)n.child.return=n,n=n.child;else{if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function La(e){return 5===e.tag||3===e.tag||4===e.tag}function Wa(e){e:{for(var t=e.return;null!==t;){if(La(t)){var n=t;break e}t=t.return}throw a(Error(160))}switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw a(Error(161))}16&n.effectTag&&(ur(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||La(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}for(var i=e;;){var o=5===i.tag||6===i.tag;if(o||20===i.tag){var s=o?i.stateNode:i.stateNode.instance;if(n)if(r){var l=s;s=n,8===(o=t).nodeType?o.parentNode.insertBefore(l,s):o.insertBefore(l,s)}else t.insertBefore(s,n);else r?(8===(l=t).nodeType?(o=l.parentNode).insertBefore(s,l):(o=l).appendChild(s),null!==(l=l._reactRootContainer)&&void 0!==l||null!==o.onclick||(o.onclick=gr)):t.appendChild(s)}else if(4!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===e)break;for(;null===i.sibling;){if(null===i.return||i.return===e)return;i=i.return}i.sibling.return=i.return,i=i.sibling}}function Ua(e,t){for(var n=e,r=!1,i=void 0,o=void 0;;){if(!r){r=n.return;e:for(;;){if(null===r)throw a(Error(160));switch(i=r.stateNode,r.tag){case 5:o=!1;break e;case 3:case 4:i=i.containerInfo,o=!0;break e}r=r.return}r=!0}if(5===n.tag||6===n.tag)if(Ma(n,t),o){var s=i,l=n.stateNode;8===s.nodeType?s.parentNode.removeChild(l):s.removeChild(l)}else i.removeChild(n.stateNode);else if(20===n.tag)l=n.stateNode.instance,Ma(n,t),o?8===(s=i).nodeType?s.parentNode.removeChild(l):s.removeChild(l):i.removeChild(l);else if(4===n.tag){if(null!==n.child){i=n.stateNode.containerInfo,o=!0,n.child.return=n,n=n.child;continue}}else if(Fa(n,t),null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;4===(n=n.return).tag&&(r=!1)}n.sibling.return=n.return,n=n.sibling}}function Va(e,t){switch(t.tag){case 0:case 11:case 14:case 15:Aa(yo,vo,t);break;case 1:break;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps,i=null!==e?e.memoizedProps:r;e=t.type;var o=t.updateQueue;if(t.updateQueue=null,null!==o){for(n[A]=r,"input"===e&&"radio"===r.type&&null!=r.name&&Ct(n,r),vr(e,i),t=vr(e,r),i=0;i<o.length;i+=2){var s=o[i],l=o[i+1];"style"===s?dr(n,l):"dangerouslySetInnerHTML"===s?lr(n,l):"children"===s?ur(n,l):_t(n,s,l,t)}switch(e){case"input":Tt(n,r);break;case"textarea":nr(n,r);break;case"select":t=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(e=r.value)?Zn(n,!!r.multiple,e,!1):t!==!!r.multiple&&(null!=r.defaultValue?Zn(n,!!r.multiple,r.defaultValue,!0):Zn(n,!!r.multiple,r.multiple?[]:"",!1))}}}break;case 6:if(null===t.stateNode)throw a(Error(162));t.stateNode.nodeValue=t.memoizedProps;break;case 3:case 12:break;case 13:if(n=t,null===t.memoizedState?r=!1:(r=!0,n=t.child,hs=ai()),null!==n)e:for(e=n;;){if(5===e.tag)o=e.stateNode,r?"function"===typeof(o=o.style).setProperty?o.setProperty("display","none","important"):o.display="none":(o=e.stateNode,i=void 0!==(i=e.memoizedProps.style)&&null!==i&&i.hasOwnProperty("display")?i.display:null,o.style.display=hr("display",i));else if(6===e.tag)e.stateNode.nodeValue=r?"":e.memoizedProps;else{if(13===e.tag&&null!==e.memoizedState){(o=e.child.sibling).return=e,e=o;continue}if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===n)break e;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}ja(t);break;case 19:ja(t);break;case 17:case 20:break;default:throw a(Error(163))}}function ja(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Oa),t.forEach(function(t){var r=function(e,t){var n=e.stateNode;null!==n&&n.delete(t),n=ks(),t=xs(n,e,null),n=fi(n,t),null!==(e=Rs(e,t))&&Os(e,n,t)}.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}var za="function"===typeof WeakMap?WeakMap:Map;function Ba(e,t,n){(n=Pi(n,null)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ys||(ys=!0,vs=r),Ia(e,t)},n}function Qa(e,t,n){(n=Pi(n,null)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var i=t.value;n.payload=function(){return Ia(e,t),r(i)}}var o=e.stateNode;return null!==o&&"function"===typeof o.componentDidCatch&&(n.callback=function(){"function"!==typeof r&&(null===ms?ms=new Set([this]):ms.add(this),Ia(e,t));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}var qa=Math.ceil,Ha=qe.ReactCurrentDispatcher,Ya=qe.ReactCurrentOwner,Ka=0,Ga=8,$a=16,Xa=32,Ja=0,Za=1,es=2,ts=3,ns=4,rs=Ka,is=null,os=null,as=0,ss=Ja,ls=1073741823,us=1073741823,cs=null,ps=!1,hs=0,ds=500,fs=null,ys=!1,vs=null,ms=null,gs=!1,_s=null,bs=90,ws=0,Es=null,Cs=0,Ts=null,Ss=0;function ks(){return(rs&($a|Xa))!==Ka?1073741821-(ai()/10|0):0!==Ss?Ss:Ss=1073741821-(ai()/10|0)}function xs(e,t,n){if(0===(2&(t=t.mode)))return 1073741823;var r=si();if(0===(4&t))return 99===r?1073741823:1073741822;if((rs&$a)!==Ka)return as;if(null!==n)e=1073741821-25*(1+((1073741821-e+(0|n.timeoutMs||5e3)/10)/25|0));else switch(r){case 99:e=1073741823;break;case 98:e=1073741821-10*(1+((1073741821-e+15)/10|0));break;case 97:case 96:e=1073741821-25*(1+((1073741821-e+500)/25|0));break;case 95:e=1;break;default:throw a(Error(326))}return null!==is&&e===as&&--e,e}var Ns=0;function Ps(e,t){if(50<Cs)throw Cs=0,Ts=null,a(Error(185));if(null!==(e=Rs(e,t))){e.pingTime=0;var n=si();if(1073741823===t)if((rs&Ga)!==Ka&&(rs&($a|Xa))===Ka)for(var r=Ws(e,1073741823,!0);null!==r;)r=r(!0);else Os(e,99,1073741823),rs===Ka&&hi();else Os(e,n,t);(4&rs)===Ka||98!==n&&99!==n||(null===Es?Es=new Map([[e,t]]):(void 0===(n=Es.get(e))||n>t)&&Es.set(e,t))}}function Rs(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t);var r=e.return,i=null;if(null===r&&3===e.tag)i=e.stateNode;else for(;null!==r;){if(n=r.alternate,r.childExpirationTime<t&&(r.childExpirationTime=t),null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t),null===r.return&&3===r.tag){i=r.stateNode;break}r=r.return}return null!==i&&(t>i.firstPendingTime&&(i.firstPendingTime=t),0===(e=i.lastPendingTime)||t<e)&&(i.lastPendingTime=t),i}function Os(e,t,n){if(e.callbackExpirationTime<n){var r=e.callbackNode;null!==r&&r!==ei&&Qr(r),e.callbackExpirationTime=n,1073741823===n?e.callbackNode=pi(Is.bind(null,e,Ws.bind(null,e,n))):(r=null,1!==n&&(r={timeout:10*(1073741821-n)-ai()}),e.callbackNode=ci(t,Is.bind(null,e,Ws.bind(null,e,n)),r))}}function Is(e,t,n){var r=e.callbackNode,i=null;try{return null!==(i=t(n))?Is.bind(null,e,i):null}finally{null===i&&r===e.callbackNode&&(e.callbackNode=null,e.callbackExpirationTime=0)}}function Ds(){(rs&(1|$a|Xa))===Ka&&(function(){if(null!==Es){var e=Es;Es=null,e.forEach(function(e,t){pi(Ws.bind(null,t,e))}),hi()}}(),Bs())}function As(e,t){var n=rs;rs|=1;try{return e(t)}finally{(rs=n)===Ka&&hi()}}function Fs(e,t,n,r){var i=rs;rs|=4;try{return ui(98,e.bind(null,t,n,r))}finally{(rs=i)===Ka&&hi()}}function Ms(e,t){var n=rs;rs&=-2,rs|=Ga;try{return e(t)}finally{(rs=n)===Ka&&hi()}}function Ls(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Tr(n)),null!==os)for(n=os.return;null!==n;){var r=n;switch(r.tag){case 1:var i=r.type.childContextTypes;null!==i&&void 0!==i&&Mr();break;case 3:io(),Lr();break;case 5:ao(r);break;case 4:io();break;case 13:case 19:Nr(co);break;case 10:Ei(r)}n=n.return}is=e,os=Zs(e.current,null),as=t,ss=Ja,us=ls=1073741823,cs=null,ps=!1}function Ws(e,t,n){if((rs&($a|Xa))!==Ka)throw a(Error(327));if(e.firstPendingTime<t)return null;if(n&&e.finishedExpirationTime===t)return zs.bind(null,e);if(Bs(),e!==is||t!==as)Ls(e,t);else if(ss===ts)if(ps)Ls(e,t);else{var r=e.lastPendingTime;if(r<t)return Ws.bind(null,e,r)}if(null!==os){r=rs,rs|=$a;var i=Ha.current;if(null===i&&(i=Go),Ha.current=Go,n){if(1073741823!==t){var o=ks();if(o<t)return rs=r,bi(),Ha.current=i,Ws.bind(null,e,o)}}else Ss=0;for(;;)try{if(n)for(;null!==os;)os=Vs(os);else for(;null!==os&&!qr();)os=Vs(os);break}catch(y){if(bi(),Wo(),null===(o=os)||null===o.return)throw Ls(e,t),rs=r,y;e:{var s=e,l=o.return,u=o,c=y,p=as;if(u.effectTag|=1024,u.firstEffect=u.lastEffect=null,null!==c&&"object"===typeof c&&"function"===typeof c.then){var h=c,d=0!==(co.current&lo);c=l;do{var f;if((f=13===c.tag)&&(null!==c.memoizedState?f=!1:f=void 0!==(f=c.memoizedProps).fallback&&(!0!==f.unstable_avoidThisFallback||!d)),f){if(null===(l=c.updateQueue)?((l=new Set).add(h),c.updateQueue=l):l.add(h),0===(2&c.mode)){c.effectTag|=64,u.effectTag&=-1957,1===u.tag&&(null===u.alternate?u.tag=17:((p=Pi(1073741823,null)).tag=2,Oi(u,p))),u.expirationTime=1073741823;break e}u=s,s=p,null===(d=u.pingCache)?(d=u.pingCache=new za,l=new Set,d.set(h,l)):void 0===(l=d.get(h))&&(l=new Set,d.set(h,l)),l.has(s)||(l.add(s),u=Hs.bind(null,u,h,s),h.then(u,u)),c.effectTag|=2048,c.expirationTime=p;break e}c=c.return}while(null!==c);c=Error((ut(u.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+ct(u))}ss!==ns&&(ss=Za),c=Ra(c,u),u=l;do{switch(u.tag){case 3:u.effectTag|=2048,u.expirationTime=p,Ii(u,p=Ba(u,c,p));break e;case 1:if(h=c,s=u.type,l=u.stateNode,0===(64&u.effectTag)&&("function"===typeof s.getDerivedStateFromError||null!==l&&"function"===typeof l.componentDidCatch&&(null===ms||!ms.has(l)))){u.effectTag|=2048,u.expirationTime=p,Ii(u,p=Qa(u,h,p));break e}}u=u.return}while(null!==u)}os=js(o)}if(rs=r,bi(),Ha.current=i,null!==os)return Ws.bind(null,e,t)}if(e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,function(e,t){var n=e.firstBatch;return!!(null!==n&&n._defer&&n._expirationTime>=t)&&(ci(97,function(){return n._onComplete(),null}),!0)}(e,t))return null;switch(is=null,ss){case Ja:throw a(Error(328));case Za:return(r=e.lastPendingTime)<t?Ws.bind(null,e,r):n?zs.bind(null,e):(Ls(e,t),pi(Ws.bind(null,e,t)),null);case es:return 1073741823===ls&&!n&&10<(n=hs+ds-ai())?ps?(Ls(e,t),Ws.bind(null,e,t)):(r=e.lastPendingTime)<t?Ws.bind(null,e,r):(e.timeoutHandle=Cr(zs.bind(null,e),n),null):zs.bind(null,e);case ts:if(!n){if(ps)return Ls(e,t),Ws.bind(null,e,t);if((n=e.lastPendingTime)<t)return Ws.bind(null,e,n);if(1073741823!==us?n=10*(1073741821-us)-ai():1073741823===ls?n=0:(n=10*(1073741821-ls)-5e3,0>(n=(r=ai())-n)&&(n=0),(t=10*(1073741821-t)-r)<(n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*qa(n/1960))-n)&&(n=t)),10<n)return e.timeoutHandle=Cr(zs.bind(null,e),n),null}return zs.bind(null,e);case ns:return!n&&1073741823!==ls&&null!==cs&&(r=ls,0>=(t=0|(i=cs).busyMinDurationMs)?t=0:(n=0|i.busyDelayMs,t=(r=ai()-(10*(1073741821-r)-(0|i.timeoutMs||5e3)))<=n?0:n+t-r),10<t)?(e.timeoutHandle=Cr(zs.bind(null,e),t),null):zs.bind(null,e);default:throw a(Error(329))}}function Us(e,t){e<ls&&1<e&&(ls=e),null!==t&&e<us&&1<e&&(us=e,cs=t)}function Vs(e){var t=Ys(e.alternate,e,as);return e.memoizedProps=e.pendingProps,null===t&&(t=js(e)),Ya.current=null,t}function js(e){os=e;do{var t=os.alternate;if(e=os.return,0===(1024&os.effectTag)){e:{var n=t,r=as,o=(t=os).pendingProps;switch(t.tag){case 2:case 16:break;case 15:case 0:break;case 1:Fr(t.type)&&Mr();break;case 3:io(),Lr(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==n&&null!==n.child||(oa(t),t.effectTag&=-3),Sa(t);break;case 5:ao(t),r=no(to.current);var s=t.type;if(null!==n&&null!=t.stateNode)ka(n,t,s,o,r),n.ref!==t.ref&&(t.effectTag|=128);else if(o){var l=no(Zi.current);if(oa(t)){o=void 0,s=(n=t).stateNode;var u=n.type,c=n.memoizedProps;switch(s[D]=n,s[A]=c,u){case"iframe":case"object":case"embed":An("load",s);break;case"video":case"audio":for(var p=0;p<te.length;p++)An(te[p],s);break;case"source":An("error",s);break;case"img":case"image":case"link":An("error",s),An("load",s);break;case"form":An("reset",s),An("submit",s);break;case"details":An("toggle",s);break;case"input":Et(s,c),An("invalid",s),mr(r,"onChange");break;case"select":s._wrapperState={wasMultiple:!!c.multiple},An("invalid",s),mr(r,"onChange");break;case"textarea":tr(s,c),An("invalid",s),mr(r,"onChange")}for(o in yr(u,c),p=null,c)c.hasOwnProperty(o)&&(l=c[o],"children"===o?"string"===typeof l?s.textContent!==l&&(p=["children",l]):"number"===typeof l&&s.textContent!==""+l&&(p=["children",""+l]):d.hasOwnProperty(o)&&null!=l&&mr(r,o));switch(u){case"input":Be(s),St(s,c,!0);break;case"textarea":Be(s),rr(s);break;case"select":case"option":break;default:"function"===typeof c.onClick&&(s.onclick=gr)}r=p,n.updateQueue=r,null!==r&&Ca(t)}else{c=s,n=o,u=t,p=9===r.nodeType?r:r.ownerDocument,l===ir.html&&(l=or(c)),l===ir.html?"script"===c?((c=p.createElement("div")).innerHTML="<script><\/script>",p=c.removeChild(c.firstChild)):"string"===typeof n.is?p=p.createElement(c,{is:n.is}):(p=p.createElement(c),"select"===c&&(c=p,n.multiple?c.multiple=!0:n.size&&(c.size=n.size))):p=p.createElementNS(l,c),(c=p)[D]=u,c[A]=n,Ta(n=c,t,!1,!1),u=n;var h=r,f=vr(s,o);switch(s){case"iframe":case"object":case"embed":An("load",u),r=o;break;case"video":case"audio":for(r=0;r<te.length;r++)An(te[r],u);r=o;break;case"source":An("error",u),r=o;break;case"img":case"image":case"link":An("error",u),An("load",u),r=o;break;case"form":An("reset",u),An("submit",u),r=o;break;case"details":An("toggle",u),r=o;break;case"input":Et(u,o),r=wt(u,o),An("invalid",u),mr(h,"onChange");break;case"option":r=Jn(u,o);break;case"select":u._wrapperState={wasMultiple:!!o.multiple},r=i({},o,{value:void 0}),An("invalid",u),mr(h,"onChange");break;case"textarea":tr(u,o),r=er(u,o),An("invalid",u),mr(h,"onChange");break;default:r=o}yr(s,r),c=void 0,p=s,l=u;var y=r;for(c in y)if(y.hasOwnProperty(c)){var v=y[c];"style"===c?dr(l,v):"dangerouslySetInnerHTML"===c?null!=(v=v?v.__html:void 0)&&lr(l,v):"children"===c?"string"===typeof v?("textarea"!==p||""!==v)&&ur(l,v):"number"===typeof v&&ur(l,""+v):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(d.hasOwnProperty(c)?null!=v&&mr(h,c):null!=v&&_t(l,c,v,f))}switch(s){case"input":Be(u),St(u,o,!1);break;case"textarea":Be(u),rr(u);break;case"option":null!=o.value&&u.setAttribute("value",""+bt(o.value));break;case"select":r=u,u=o,r.multiple=!!u.multiple,null!=(c=u.value)?Zn(r,!!u.multiple,c,!1):null!=u.defaultValue&&Zn(r,!!u.multiple,u.defaultValue,!0);break;default:"function"===typeof r.onClick&&(u.onclick=gr)}wr(s,o)&&Ca(t),t.stateNode=n}null!==t.ref&&(t.effectTag|=128)}else if(null===t.stateNode)throw a(Error(166));break;case 6:if(n&&null!=t.stateNode)xa(n,t,n.memoizedProps,o);else{if("string"!==typeof o&&null===t.stateNode)throw a(Error(166));n=no(to.current),no(Zi.current),oa(t)?(r=t.stateNode,n=t.memoizedProps,r[D]=t,r.nodeValue!==n&&Ca(t)):(r=t,(n=(9===n.nodeType?n:n.ownerDocument).createTextNode(o))[D]=t,r.stateNode=n)}break;case 11:break;case 13:if(Nr(co),o=t.memoizedState,0!==(64&t.effectTag)){t.expirationTime=r;break e}r=null!==o,o=!1,null===n?oa(t):(o=null!==(s=n.memoizedState),r||null===s||null!==(s=n.child.sibling)&&(null!==(u=t.firstEffect)?(t.firstEffect=s,s.nextEffect=u):(t.firstEffect=t.lastEffect=s,s.nextEffect=null),s.effectTag=8)),r&&!o&&0!==(2&t.mode)&&(null===n&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!==(co.current&lo)?ss===Ja&&(ss=es):ss!==Ja&&ss!==es||(ss=ts)),(r||o)&&(t.effectTag|=4);break;case 7:case 8:case 12:break;case 4:io(),Sa(t);break;case 10:Ei(t);break;case 9:case 14:break;case 17:Fr(t.type)&&Mr();break;case 18:break;case 19:if(Nr(co),null===(o=t.memoizedState))break;if(s=0!==(64&t.effectTag),null===(u=o.rendering)){if(s)Na(o,!1);else if(ss!==Ja||null!==n&&0!==(64&n.effectTag))for(n=t.child;null!==n;){if(null!==(u=po(n))){for(t.effectTag|=64,Na(o,!1),null!==(n=u.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),t.firstEffect=t.lastEffect=null,n=t.child;null!==n;)s=r,(o=n).effectTag&=2,o.nextEffect=null,o.firstEffect=null,o.lastEffect=null,null===(u=o.alternate)?(o.childExpirationTime=0,o.expirationTime=s,o.child=null,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null):(o.childExpirationTime=u.childExpirationTime,o.expirationTime=u.expirationTime,o.child=u.child,o.memoizedProps=u.memoizedProps,o.memoizedState=u.memoizedState,o.updateQueue=u.updateQueue,s=u.dependencies,o.dependencies=null===s?null:{expirationTime:s.expirationTime,firstContext:s.firstContext,responders:s.responders}),n=n.sibling;Pr(co,co.current&so|uo),t=t.child;break e}n=n.sibling}}else{if(!s)if(null!==(n=po(u))){if(t.effectTag|=64,s=!0,Na(o,!0),null===o.tail&&"hidden"===o.tailMode){null!==(r=n.updateQueue)&&(t.updateQueue=r,t.effectTag|=4),null!==(t=t.lastEffect=o.lastEffect)&&(t.nextEffect=null);break}}else ai()>o.tailExpiration&&1<r&&(t.effectTag|=64,s=!0,Na(o,!1),t.expirationTime=t.childExpirationTime=r-1);o.isBackwards?(u.sibling=t.child,t.child=u):(null!==(r=o.last)?r.sibling=u:t.child=u,o.last=u)}if(null!==o.tail){0===o.tailExpiration&&(o.tailExpiration=ai()+500),r=o.tail,o.rendering=r,o.tail=r.sibling,o.lastEffect=t.lastEffect,r.sibling=null,n=co.current,Pr(co,n=s?n&so|uo:n&so),t=r;break e}break;case 20:break;default:throw a(Error(156))}t=null}if(r=os,1===as||1!==r.childExpirationTime){for(n=0,o=r.child;null!==o;)(s=o.expirationTime)>n&&(n=s),(u=o.childExpirationTime)>n&&(n=u),o=o.sibling;r.childExpirationTime=n}if(null!==t)return t;null!==e&&0===(1024&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=os.firstEffect),null!==os.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=os.firstEffect),e.lastEffect=os.lastEffect),1<os.effectTag&&(null!==e.lastEffect?e.lastEffect.nextEffect=os:e.firstEffect=os,e.lastEffect=os))}else{if(null!==(t=Pa(os)))return t.effectTag&=1023,t;null!==e&&(e.firstEffect=e.lastEffect=null,e.effectTag|=1024)}if(null!==(t=os.sibling))return t;os=e}while(null!==os);return ss===Ja&&(ss=ns),null}function zs(e){var t=si();return ui(99,function(e,t){if(Bs(),(rs&($a|Xa))!==Ka)throw a(Error(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw a(Error(177));e.callbackNode=null,e.callbackExpirationTime=0;var i=n.expirationTime,o=n.childExpirationTime;if(i=o>i?o:i,e.firstPendingTime=i,i<e.lastPendingTime&&(e.lastPendingTime=i),e===is&&(os=is=null,as=0),1<n.effectTag?null!==n.lastEffect?(n.lastEffect.nextEffect=n,i=n.firstEffect):i=n:i=n.firstEffect,null!==i){o=rs,rs|=Xa,Ya.current=null,_r=Dn;var s=zn();if(Bn(s)){if("selectionStart"in s)var l={start:s.selectionStart,end:s.selectionEnd};else e:{var u=(l=(l=s.ownerDocument)&&l.defaultView||window).getSelection&&l.getSelection();if(u&&0!==u.rangeCount){l=u.anchorNode;var c=u.anchorOffset,p=u.focusNode;u=u.focusOffset;try{l.nodeType,p.nodeType}catch(U){l=null;break e}var h=0,d=-1,f=-1,y=0,v=0,m=s,g=null;t:for(;;){for(var _;m!==l||0!==c&&3!==m.nodeType||(d=h+c),m!==p||0!==u&&3!==m.nodeType||(f=h+u),3===m.nodeType&&(h+=m.nodeValue.length),null!==(_=m.firstChild);)g=m,m=_;for(;;){if(m===s)break t;if(g===l&&++y===c&&(d=h),g===p&&++v===u&&(f=h),null!==(_=m.nextSibling))break;g=(m=g).parentNode}m=_}l=-1===d||-1===f?null:{start:d,end:f}}else l=null}l=l||{start:0,end:0}}else l=null;br={focusedElem:s,selectionRange:l},Dn=!1,fs=i;do{try{for(;null!==fs;){if(0!==(256&fs.effectTag)){var b=fs.alternate;switch((s=fs).tag){case 0:case 11:case 15:Aa(fo,ho,s);break;case 1:if(256&s.effectTag&&null!==b){var w=b.memoizedProps,E=b.memoizedState,C=s.stateNode,T=C.getSnapshotBeforeUpdate(s.elementType===s.type?w:yi(s.type,w),E);C.__reactInternalSnapshotBeforeUpdate=T}break;case 3:case 5:case 6:case 4:case 17:break;default:throw a(Error(163))}}fs=fs.nextEffect}}catch(U){if(null===fs)throw a(Error(330));qs(fs,U),fs=fs.nextEffect}}while(null!==fs);fs=i;do{try{for(b=t;null!==fs;){var S=fs.effectTag;if(16&S&&ur(fs.stateNode,""),128&S){var k=fs.alternate;if(null!==k){var x=k.ref;null!==x&&("function"===typeof x?x(null):x.current=null)}}switch(14&S){case 2:Wa(fs),fs.effectTag&=-3;break;case 6:Wa(fs),fs.effectTag&=-3,Va(fs.alternate,fs);break;case 4:Va(fs.alternate,fs);break;case 8:Ua(w=fs,b),w.return=null,w.child=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null;var N=w.alternate;null!==N&&(N.return=null,N.child=null,N.memoizedState=null,N.updateQueue=null,N.dependencies=null)}fs=fs.nextEffect}}catch(U){if(null===fs)throw a(Error(330));qs(fs,U),fs=fs.nextEffect}}while(null!==fs);if(x=br,k=zn(),S=x.focusedElem,b=x.selectionRange,k!==S&&S&&S.ownerDocument&&function e(t,n){return!(!t||!n)&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(S.ownerDocument.documentElement,S)){null!==b&&Bn(S)&&(k=b.start,void 0===(x=b.end)&&(x=k),"selectionStart"in S?(S.selectionStart=k,S.selectionEnd=Math.min(x,S.value.length)):(x=(k=S.ownerDocument||document)&&k.defaultView||window).getSelection&&(x=x.getSelection(),w=S.textContent.length,N=Math.min(b.start,w),b=void 0===b.end?N:Math.min(b.end,w),!x.extend&&N>b&&(w=b,b=N,N=w),w=jn(S,N),E=jn(S,b),w&&E&&(1!==x.rangeCount||x.anchorNode!==w.node||x.anchorOffset!==w.offset||x.focusNode!==E.node||x.focusOffset!==E.offset)&&((k=k.createRange()).setStart(w.node,w.offset),x.removeAllRanges(),N>b?(x.addRange(k),x.extend(E.node,E.offset)):(k.setEnd(E.node,E.offset),x.addRange(k))))),k=[];for(x=S;x=x.parentNode;)1===x.nodeType&&k.push({element:x,left:x.scrollLeft,top:x.scrollTop});for("function"===typeof S.focus&&S.focus(),S=0;S<k.length;S++)(x=k[S]).element.scrollLeft=x.left,x.element.scrollTop=x.top}br=null,Dn=!!_r,_r=null,e.current=n,fs=i;do{try{for(S=r;null!==fs;){var P=fs.effectTag;if(36&P){var R=fs.alternate;switch(x=S,(k=fs).tag){case 0:case 11:case 15:Aa(mo,go,k);break;case 1:var O=k.stateNode;if(4&k.effectTag)if(null===R)O.componentDidMount();else{var I=k.elementType===k.type?R.memoizedProps:yi(k.type,R.memoizedProps);O.componentDidUpdate(I,R.memoizedState,O.__reactInternalSnapshotBeforeUpdate)}var D=k.updateQueue;null!==D&&Mi(0,D,O);break;case 3:var A=k.updateQueue;if(null!==A){if(N=null,null!==k.child)switch(k.child.tag){case 5:N=k.child.stateNode;break;case 1:N=k.child.stateNode}Mi(0,A,N)}break;case 5:var F=k.stateNode;null===R&&4&k.effectTag&&(x=F,wr(k.type,k.memoizedProps)&&x.focus());break;case 6:case 4:case 12:break;case 13:case 19:case 17:case 20:break;default:throw a(Error(163))}}if(128&P){var M=fs.ref;if(null!==M){var L=fs.stateNode;switch(fs.tag){case 5:var W=L;break;default:W=L}"function"===typeof M?M(W):M.current=W}}512&P&&(gs=!0),fs=fs.nextEffect}}catch(U){if(null===fs)throw a(Error(330));qs(fs,U),fs=fs.nextEffect}}while(null!==fs);fs=null,ti(),rs=o}else e.current=n;if(gs)gs=!1,_s=e,ws=r,bs=t;else for(fs=i;null!==fs;)t=fs.nextEffect,fs.nextEffect=null,fs=t;if(0!==(t=e.firstPendingTime)?(P=fi(P=ks(),t),Os(e,P,t)):ms=null,"function"===typeof Ks&&Ks(n.stateNode,r),1073741823===t?e===Ts?Cs++:(Cs=0,Ts=e):Cs=0,ys)throw ys=!1,e=vs,vs=null,e;return(rs&Ga)!==Ka?null:(hi(),null)}.bind(null,e,t)),null!==_s&&ci(97,function(){return Bs(),null}),null}function Bs(){if(null===_s)return!1;var e=_s,t=ws,n=bs;return _s=null,ws=0,bs=90,ui(97<n?97:n,function(e){if((rs&($a|Xa))!==Ka)throw a(Error(331));var t=rs;for(rs|=Xa,e=e.current.firstEffect;null!==e;){try{var n=e;if(0!==(512&n.effectTag))switch(n.tag){case 0:case 11:case 15:Aa(bo,ho,n),Aa(ho,_o,n)}}catch(r){if(null===e)throw a(Error(330));qs(e,r)}n=e.nextEffect,e.nextEffect=null,e=n}return rs=t,hi(),!0}.bind(null,e,t))}function Qs(e,t,n){Oi(e,t=Ba(e,t=Ra(n,t),1073741823)),null!==(e=Rs(e,1073741823))&&Os(e,99,1073741823)}function qs(e,t){if(3===e.tag)Qs(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){Qs(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"===typeof n.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===ms||!ms.has(r))){Oi(n,e=Qa(n,e=Ra(t,e),1073741823)),null!==(n=Rs(n,1073741823))&&Os(n,99,1073741823);break}}n=n.return}}function Hs(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),is===e&&as===n?ss===ts||ss===es&&1073741823===ls&&ai()-hs<ds?Ls(e,as):ps=!0:e.lastPendingTime<n||(0!==(t=e.pingTime)&&t<n||(e.pingTime=n,e.finishedExpirationTime===n&&(e.finishedExpirationTime=0,e.finishedWork=null),Os(e,t=fi(t=ks(),n),n)))}var Ys=void 0;Ys=function(e,t,n){var r=t.expirationTime;if(null!==e){var i=t.pendingProps;if(e.memoizedProps!==i||Ir.current)la=!0;else if(r<n){switch(la=!1,t.tag){case 3:ma(t),aa();break;case 5:if(oo(t),4&t.mode&&1!==n&&i.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:Fr(t.type)&&Vr(t);break;case 4:ro(t,t.stateNode.containerInfo);break;case 10:wi(t,t.memoizedProps.value);break;case 13:if(null!==t.memoizedState)return 0!==(r=t.child.childExpirationTime)&&r>=n?_a(e,t,n):(Pr(co,co.current&so),null!==(t=Ea(e,t,n))?t.sibling:null);Pr(co,co.current&so);break;case 19:if(r=t.childExpirationTime>=n,0!==(64&e.effectTag)){if(r)return wa(e,t,n);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),Pr(co,co.current),!r)return null}return Ea(e,t,n)}}else la=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=Ar(t,Or.current),Ti(t,n),i=Lo(null,t,r,e,i,n),t.effectTag|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof){if(t.tag=1,Wo(),Fr(r)){var o=!0;Vr(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null;var s=r.getDerivedStateFromProps;"function"===typeof s&&Vi(t,r,s,e),i.updater=ji,t.stateNode=i,i._reactInternalFiber=t,qi(t,r,e,n),t=va(null,t,r,!0,o,n)}else t.tag=0,ua(null,t,i,n),t=t.child;return t;case 16:switch(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=function(e){var t=e._result;switch(e._status){case 1:return t;case 2:case 0:throw t;default:switch(e._status=0,(t=(t=e._ctor)()).then(function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)},function(t){0===e._status&&(e._status=2,e._result=t)}),e._status){case 1:return e._result;case 2:throw e._result}throw e._result=t,t}}(i),t.type=i,o=t.tag=function(e){if("function"===typeof e)return Js(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===nt)return 11;if(e===ot)return 14}return 2}(i),e=yi(i,e),o){case 0:t=fa(null,t,i,e,n);break;case 1:t=ya(null,t,i,e,n);break;case 11:t=ca(null,t,i,e,n);break;case 14:t=pa(null,t,i,yi(i.type,e),r,n);break;default:throw a(Error(306),i,"")}return t;case 0:return r=t.type,i=t.pendingProps,fa(e,t,r,i=t.elementType===r?i:yi(r,i),n);case 1:return r=t.type,i=t.pendingProps,ya(e,t,r,i=t.elementType===r?i:yi(r,i),n);case 3:if(ma(t),null===(r=t.updateQueue))throw a(Error(282));return i=null!==(i=t.memoizedState)?i.element:null,Fi(t,r,t.pendingProps,null,n),(r=t.memoizedState.element)===i?(aa(),t=Ea(e,t,n)):(i=t.stateNode,(i=(null===e||null===e.child)&&i.hydrate)&&(Zo=Sr(t.stateNode.containerInfo.firstChild),Jo=t,i=ea=!0),i?(t.effectTag|=2,t.child=Xi(t,null,r,n)):(ua(e,t,r,n),aa()),t=t.child),t;case 5:return oo(t),null===e&&ra(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,s=i.children,Er(r,i)?s=null:null!==o&&Er(r,o)&&(t.effectTag|=16),da(e,t),4&t.mode&&1!==n&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(ua(e,t,s,n),t=t.child),t;case 6:return null===e&&ra(t),null;case 13:return _a(e,t,n);case 4:return ro(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=$i(t,null,r,n):ua(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,ca(e,t,r,i=t.elementType===r?i:yi(r,i),n);case 7:return ua(e,t,t.pendingProps,n),t.child;case 8:case 12:return ua(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,wi(t,o=i.value),null!==s){var l=s.value;if(0===(o=en(l,o)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(l,o):1073741823))){if(s.children===i.children&&!Ir.current){t=Ea(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var u=l.dependencies;if(null!==u){s=l.child;for(var c=u.firstContext;null!==c;){if(c.context===r&&0!==(c.observedBits&o)){1===l.tag&&((c=Pi(n,null)).tag=2,Oi(l,c)),l.expirationTime<n&&(l.expirationTime=n),null!==(c=l.alternate)&&c.expirationTime<n&&(c.expirationTime=n),Ci(l.return,n),u.expirationTime<n&&(u.expirationTime=n);break}c=c.next}}else s=10===l.tag&&l.type===t.type?null:l.child;if(null!==s)s.return=l;else for(s=l;null!==s;){if(s===t){s=null;break}if(null!==(l=s.sibling)){l.return=s.return,s=l;break}s=s.return}l=s}}ua(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(o=t.pendingProps).children,Ti(t,n),r=r(i=Si(i,o.unstable_observedBits)),t.effectTag|=1,ua(e,t,r,n),t.child;case 14:return o=yi(i=t.type,t.pendingProps),pa(e,t,i,o=yi(i.type,o),r,n);case 15:return ha(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yi(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,Fr(r)?(e=!0,Vr(t)):e=!1,Ti(t,n),Bi(t,r,i),qi(t,r,i,n),va(null,t,r,!0,e,n);case 19:return wa(e,t,n)}throw a(Error(156))};var Ks=null,Gs=null;function $s(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function Xs(e,t,n,r){return new $s(e,t,n,r)}function Js(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Zs(e,t){var n=e.alternate;return null===n?((n=Xs(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function el(e,t,n,r,i,o){var s=2;if(r=e,"function"===typeof e)Js(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case $e:return tl(n.children,i,o,t);case tt:s=8,i|=7;break;case Xe:s=8,i|=1;break;case Je:return(e=Xs(12,n,t,8|i)).elementType=Je,e.type=Je,e.expirationTime=o,e;case rt:return(e=Xs(13,n,t,i)).type=rt,e.elementType=rt,e.expirationTime=o,e;case it:return(e=Xs(19,n,t,i)).elementType=it,e.expirationTime=o,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case Ze:s=10;break e;case et:s=9;break e;case nt:s=11;break e;case ot:s=14;break e;case at:s=16,r=null;break e}throw a(Error(130),null==e?e:typeof e,"")}return(t=Xs(s,n,t,i)).elementType=e,t.type=r,t.expirationTime=o,t}function tl(e,t,n,r){return(e=Xs(7,e,r,t)).expirationTime=n,e}function nl(e,t,n){return(e=Xs(6,e,null,t)).expirationTime=n,e}function rl(e,t,n){return(t=Xs(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function il(e,t,n){this.tag=t,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=this.firstBatch=null,this.pingTime=this.lastPendingTime=this.firstPendingTime=this.callbackExpirationTime=0}function ol(e,t,n){return e=new il(e,t,n),t=Xs(3,null,null,2===t?7:1===t?3:0),e.current=t,t.stateNode=e}function al(e,t,n,r,i,o){var s=t.current;e:if(n){t:{if(2!==on(n=n._reactInternalFiber)||1!==n.tag)throw a(Error(170));var l=n;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(Fr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(null!==l);throw a(Error(171))}if(1===n.tag){var u=n.type;if(Fr(u)){n=Ur(n,u,l);break e}}n=l}else n=Rr;return null===t.context?t.context=n:t.pendingContext=n,t=o,(i=Pi(r,i)).payload={element:e},null!==(t=void 0===t?null:t)&&(i.callback=t),Oi(s,i),Ps(s,r),r}function sl(e,t,n,r){var i=t.current,o=ks(),a=Wi.suspense;return al(e,t,n,i=xs(o,i,a),a,r)}function ll(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function ul(e){var t=1073741821-25*(1+((1073741821-ks()+500)/25|0));t<=Ns&&--t,this._expirationTime=Ns=t,this._root=e,this._callbacks=this._next=null,this._hasChildren=this._didComplete=!1,this._children=null,this._defer=!0}function cl(){this._callbacks=null,this._didCommit=!1,this._onCommit=this._onCommit.bind(this)}function pl(e,t,n){this._internalRoot=ol(e,t,n)}function hl(e,t){this._internalRoot=ol(e,2,t)}function dl(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function fl(e,t,n,r,i){var o=n._reactRootContainer,a=void 0;if(o){if(a=o._internalRoot,"function"===typeof i){var s=i;i=function(){var e=ll(a);s.call(e)}}sl(t,a,e,i)}else{if(o=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new pl(e,0,t)}(n,r),a=o._internalRoot,"function"===typeof i){var l=i;i=function(){var e=ll(a);l.call(e)}}Ms(function(){sl(t,a,e,i)})}return ll(a)}function yl(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!dl(t))throw a(Error(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Ge,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)}ke=function(e,t,n){switch(t){case"input":if(Tt(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=W(r);if(!i)throw a(Error(90));Qe(r),Tt(r,i)}}}break;case"textarea":nr(e,n);break;case"select":null!=(t=n.value)&&Zn(e,!!n.multiple,t,!1)}},ul.prototype.render=function(e){if(!this._defer)throw a(Error(250));this._hasChildren=!0,this._children=e;var t=this._root._internalRoot,n=this._expirationTime,r=new cl;return al(e,t,null,n,null,r._onCommit),r},ul.prototype.then=function(e){if(this._didComplete)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},ul.prototype.commit=function(){var e=this._root._internalRoot,t=e.firstBatch;if(!this._defer||null===t)throw a(Error(251));if(this._hasChildren){var n=this._expirationTime;if(t!==this){this._hasChildren&&(n=this._expirationTime=t._expirationTime,this.render(this._children));for(var r=null,i=t;i!==this;)r=i,i=i._next;if(null===r)throw a(Error(251));r._next=i._next,this._next=t,e.firstBatch=this}if(this._defer=!1,t=n,(rs&($a|Xa))!==Ka)throw a(Error(253));pi(Ws.bind(null,e,t)),hi(),t=this._next,this._next=null,null!==(t=e.firstBatch=t)&&t._hasChildren&&t.render(t._children)}else this._next=null,this._defer=!1},ul.prototype._onComplete=function(){if(!this._didComplete){this._didComplete=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++)(0,e[t])()}},cl.prototype.then=function(e){if(this._didCommit)e();else{var t=this._callbacks;null===t&&(t=this._callbacks=[]),t.push(e)}},cl.prototype._onCommit=function(){if(!this._didCommit){this._didCommit=!0;var e=this._callbacks;if(null!==e)for(var t=0;t<e.length;t++){var n=e[t];if("function"!==typeof n)throw a(Error(191),n);n()}}},hl.prototype.render=pl.prototype.render=function(e,t){var n=this._internalRoot,r=new cl;return null!==(t=void 0===t?null:t)&&r.then(t),sl(e,n,null,r._onCommit),r},hl.prototype.unmount=pl.prototype.unmount=function(e){var t=this._internalRoot,n=new cl;return null!==(e=void 0===e?null:e)&&n.then(e),sl(null,t,null,n._onCommit),n},hl.prototype.createBatch=function(){var e=new ul(this),t=e._expirationTime,n=this._internalRoot,r=n.firstBatch;if(null===r)n.firstBatch=e,e._next=null;else{for(n=null;null!==r&&r._expirationTime>=t;)n=r,r=r._next;e._next=r,null!==n&&(n._next=e)}return e},Ie=As,De=Fs,Ae=Ds,Fe=function(e,t){var n=rs;rs|=2;try{return e(t)}finally{(rs=n)===Ka&&hi()}};var vl={createPortal:yl,findDOMNode:function(e){if(null==e)e=null;else if(1!==e.nodeType){var t=e._reactInternalFiber;if(void 0===t){if("function"===typeof e.render)throw a(Error(188));throw a(Error(268),Object.keys(e))}e=null===(e=sn(t))?null:e.stateNode}return e},hydrate:function(e,t,n){if(!dl(t))throw a(Error(200));return fl(null,e,t,!0,n)},render:function(e,t,n){if(!dl(t))throw a(Error(200));return fl(null,e,t,!1,n)},unstable_renderSubtreeIntoContainer:function(e,t,n,r){if(!dl(n))throw a(Error(200));if(null==e||void 0===e._reactInternalFiber)throw a(Error(38));return fl(e,t,n,!1,r)},unmountComponentAtNode:function(e){if(!dl(e))throw a(Error(40));return!!e._reactRootContainer&&(Ms(function(){fl(null,null,e,!1,function(){e._reactRootContainer=null})}),!0)},unstable_createPortal:function(){return yl.apply(void 0,arguments)},unstable_batchedUpdates:As,unstable_interactiveUpdates:function(e,t,n,r){return Ds(),Fs(e,t,n,r)},unstable_discreteUpdates:Fs,unstable_flushDiscreteUpdates:Ds,flushSync:function(e,t){if((rs&($a|Xa))!==Ka)throw a(Error(187));var n=rs;rs|=1;try{return ui(99,e.bind(null,t))}finally{rs=n,hi()}},unstable_createRoot:function(e,t){if(!dl(e))throw a(Error(299),"unstable_createRoot");return new hl(e,null!=t&&!0===t.hydrate)},unstable_createSyncRoot:function(e,t){if(!dl(e))throw a(Error(299),"unstable_createRoot");return new pl(e,1,null!=t&&!0===t.hydrate)},unstable_flushControlled:function(e){var t=rs;rs|=1;try{ui(99,e)}finally{(rs=t)===Ka&&hi()}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[M,L,W,R.injectEventPluginsByName,h,Q,function(e){k(e,B)},Re,Oe,Mn,P,Bs,{current:!1}]}};!function(e){var t=e.findFiberByHostInstance;(function(e){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);Ks=function(e){try{t.onCommitFiberRoot(n,e,void 0,64===(64&e.current.effectTag))}catch(r){}},Gs=function(e){try{t.onCommitFiberUnmount(n,e)}catch(r){}}}catch(r){}})(i({},e,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qe.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=sn(e))?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))}({findFiberByHostInstance:F,bundleType:0,version:"16.9.0",rendererPackageName:"react-dom"});var ml={default:vl},gl=ml&&vl||ml;e.exports=gl.default||gl},function(e,t,n){"use strict";e.exports=n(21)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=void 0,i=void 0,o=void 0,a=void 0,s=void 0;if(t.unstable_now=void 0,t.unstable_forceFrameRate=void 0,"undefined"===typeof window||"function"!==typeof MessageChannel){var l=null,u=null,c=function e(){if(null!==l)try{var n=t.unstable_now();l(!0,n),l=null}catch(r){throw setTimeout(e,0),r}};t.unstable_now=function(){return Date.now()},r=function(e){null!==l?setTimeout(r,0,e):(l=e,setTimeout(c,0))},i=function(e,t){u=setTimeout(e,t)},o=function(){clearTimeout(u)},a=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var p=window.performance,h=window.Date,d=window.setTimeout,f=window.clearTimeout,y=window.requestAnimationFrame,v=window.cancelAnimationFrame;"undefined"!==typeof console&&("function"!==typeof y&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!==typeof v&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")),t.unstable_now="object"===typeof p&&"function"===typeof p.now?function(){return p.now()}:function(){return h.now()};var m=!1,g=null,_=-1,b=-1,w=33.33,E=-1,C=-1,T=0,S=!1;a=function(){return t.unstable_now()>=T},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):0<e?(w=Math.floor(1e3/e),S=!0):(w=33.33,S=!1)};var k=function(){if(null!==g){var e=t.unstable_now(),n=0<T-e;try{g(n,e)||(g=null)}catch(r){throw N.postMessage(null),r}}},x=new MessageChannel,N=x.port2;x.port1.onmessage=k;r=function(e){g=e,m||(m=!0,y(function(e){!function e(n){if(null===g)C=E=-1,m=!1;else{m=!0,y(function(t){f(_),e(t)});if(_=d(function e(){T=t.unstable_now()+w/2,k(),_=d(e,3*w)},3*w),-1!==E&&.1<n-E){var r=n-E;!S&&-1!==C&&r<w&&C<w&&(8.33>(w=r<C?C:r)&&(w=8.33)),C=r}E=n,T=n+w,N.postMessage(null)}}(e)}))},i=function(e,n){b=d(function(){e(t.unstable_now())},n)},o=function(){f(b),b=-1}}var P=null,R=null,O=null,I=3,D=!1,A=!1,F=!1;function M(e,t){var n=e.next;if(n===e)P=null;else{e===P&&(P=n);var r=e.previous;r.next=n,n.previous=r}e.next=e.previous=null,n=e.callback,r=I;var i=O;I=e.priorityLevel,O=e;try{var o=e.expirationTime<=t;switch(I){case 1:var a=n(o);break;case 2:case 3:case 4:a=n(o);break;case 5:a=n(o)}}catch(s){throw s}finally{I=r,O=i}if("function"===typeof a)if(t=e.expirationTime,e.callback=a,null===P)P=e.next=e.previous=e;else{a=null,o=P;do{if(t<=o.expirationTime){a=o;break}o=o.next}while(o!==P);null===a?a=P:a===P&&(P=e),(t=a.previous).next=a.previous=e,e.next=a,e.previous=t}}function L(e){if(null!==R&&R.startTime<=e)do{var t=R,n=t.next;if(t===n)R=null;else{R=n;var r=t.previous;r.next=n,n.previous=r}t.next=t.previous=null,j(t,t.expirationTime)}while(null!==R&&R.startTime<=e)}function W(e){F=!1,L(e),A||(null!==P?(A=!0,r(U)):null!==R&&i(W,R.startTime-e))}function U(e,n){A=!1,F&&(F=!1,o()),L(n),D=!0;try{if(e){if(null!==P)do{M(P,n),L(n=t.unstable_now())}while(null!==P&&!a())}else for(;null!==P&&P.expirationTime<=n;)M(P,n),L(n=t.unstable_now());return null!==P||(null!==R&&i(W,R.startTime-n),!1)}finally{D=!1}}function V(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}function j(e,t){if(null===P)P=e.next=e.previous=e;else{var n=null,r=P;do{if(t<r.expirationTime){n=r;break}r=r.next}while(r!==P);null===n?n=P:n===P&&(P=e),(t=n.previous).next=n.previous=e,e.next=n,e.previous=t}}var z=s;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=I;I=e;try{return t()}finally{I=n}},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var n=I;I=t;try{return e()}finally{I=n}},t.unstable_scheduleCallback=function(e,n,a){var s=t.unstable_now();if("object"===typeof a&&null!==a){var l=a.delay;l="number"===typeof l&&0<l?s+l:s,a="number"===typeof a.timeout?a.timeout:V(e)}else a=V(e),l=s;if(e={callback:n,priorityLevel:e,startTime:l,expirationTime:a=l+a,next:null,previous:null},l>s){if(a=l,null===R)R=e.next=e.previous=e;else{n=null;var u=R;do{if(a<u.startTime){n=u;break}u=u.next}while(u!==R);null===n?n=R:n===R&&(R=e),(a=n.previous).next=n.previous=e,e.next=n,e.previous=a}null===P&&R===e&&(F?o():F=!0,i(W,l-s))}else j(e,a),A||D||(A=!0,r(U));return e},t.unstable_cancelCallback=function(e){var t=e.next;if(null!==t){if(e===t)e===P?P=null:e===R&&(R=null);else{e===P?P=t:e===R&&(R=t);var n=e.previous;n.next=t,t.previous=n}e.next=e.previous=null}},t.unstable_wrapCallback=function(e){var t=I;return function(){var n=I;I=t;try{return e.apply(this,arguments)}finally{I=n}}},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_shouldYield=function(){var e=t.unstable_now();return L(e),null!==O&&null!==P&&P.startTime<=e&&P.expirationTime<O.expirationTime||a()},t.unstable_requestPaint=z,t.unstable_continueExecution=function(){A||D||(A=!0,r(U))},t.unstable_pauseExecution=function(){},t.unstable_getFirstCallbackNode=function(){return P}},,,,,,,,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n(31)},function(e,t,n){"use strict";(function(r){Object.defineProperty(t,"__esModule",{value:!0});var i,o=(i=n(12))&&"object"===typeof i&&"default"in i?i.default:i,a=n(9),s=n(13),l=n(14),u=function(){function e(e){this.domStorage_=e,this.prefix_="firebase:"}return e.prototype.set=function(e,t){null==t?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),s.stringify(t))},e.prototype.get=function(e){var t=this.domStorage_.getItem(this.prefixedName_(e));return null==t?null:s.jsonEval(t)},e.prototype.remove=function(e){this.domStorage_.removeItem(this.prefixedName_(e))},e.prototype.prefixedName_=function(e){return this.prefix_+e},e.prototype.toString=function(){return this.domStorage_.toString()},e}(),c=function(){function e(){this.cache_={},this.isInMemoryStorage=!0}return e.prototype.set=function(e,t){null==t?delete this.cache_[e]:this.cache_[e]=t},e.prototype.get=function(e){return s.contains(this.cache_,e)?this.cache_[e]:null},e.prototype.remove=function(e){delete this.cache_[e]},e}(),p=function(e){try{if("undefined"!==typeof window&&"undefined"!==typeof window[e]){var t=window[e];return t.setItem("firebase:sentinel","cache"),t.removeItem("firebase:sentinel"),new u(t)}}catch(n){}return new c},h=p("localStorage"),d=p("sessionStorage"),f=new l.Logger("@firebase/database"),y=function(){var e=1;return function(){return e++}}(),v=function(e){var t=s.stringToByteArray(e),n=new s.Sha1;n.update(t);var r=n.digest();return s.base64.encodeByteArray(r)},m=function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r="",i=0;i<t.length;i++)Array.isArray(t[i])||t[i]&&"object"===typeof t[i]&&"number"===typeof t[i].length?r+=e.apply(null,t[i]):"object"===typeof t[i]?r+=s.stringify(t[i]):r+=t[i],r+=" ";return r},g=null,_=!0,b=function(e,t){s.assert(!t||!0===e||!1===e,"Can't turn on custom loggers persistently."),!0===e?(f.logLevel=l.LogLevel.VERBOSE,g=f.log.bind(f),t&&d.set("logging_enabled",!0)):"function"===typeof e?g=e:(g=null,d.remove("logging_enabled"))},w=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!0===_&&(_=!1,null===g&&!0===d.get("logging_enabled")&&b(!0)),g){var n=m.apply(null,e);g(n)}},E=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];w.apply(void 0,a.__spread([e],t))}},C=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="FIREBASE INTERNAL ERROR: "+m.apply(void 0,a.__spread(e));f.error(n)},T=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="FIREBASE FATAL ERROR: "+m.apply(void 0,a.__spread(e));throw f.error(n),new Error(n)},S=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="FIREBASE WARNING: "+m.apply(void 0,a.__spread(e));f.warn(n)},k=function(e){return"number"===typeof e&&(e!=e||e==Number.POSITIVE_INFINITY||e==Number.NEGATIVE_INFINITY)},x="[MIN_NAME]",N="[MAX_NAME]",P=function(e,t){if(e===t)return 0;if(e===x||t===N)return-1;if(t===x||e===N)return 1;var n=L(e),r=L(t);return null!==n?null!==r?n-r==0?e.length-t.length:n-r:-1:null!==r?1:e<t?-1:1},R=function(e,t){return e===t?0:e<t?-1:1},O=function(e,t){if(t&&e in t)return t[e];throw new Error("Missing required key ("+e+") in object: "+s.stringify(t))},I=function e(t){if("object"!==typeof t||null===t)return s.stringify(t);var n=[];for(var r in t)n.push(r);n.sort();for(var i="{",o=0;o<n.length;o++)0!==o&&(i+=","),i+=s.stringify(n[o]),i+=":",i+=e(t[n[o]]);return i+="}"},D=function(e,t){var n=e.length;if(n<=t)return[e];for(var r=[],i=0;i<n;i+=t)i+t>n?r.push(e.substring(i,n)):r.push(e.substring(i,i+t));return r};function A(e,t){for(var n in e)e.hasOwnProperty(n)&&t(n,e[n])}var F=function(e){s.assert(!k(e),"Invalid JSON number");var t,n,r,i,o,a,l;for(0===e?(n=0,r=0,t=1/e===-1/0?1:0):(t=e<0,(e=Math.abs(e))>=Math.pow(2,-1022)?(n=(i=Math.min(Math.floor(Math.log(e)/Math.LN2),1023))+1023,r=Math.round(e*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,r=Math.round(e/Math.pow(2,-1074)))),a=[],o=52;o;o-=1)a.push(r%2?1:0),r=Math.floor(r/2);for(o=11;o;o-=1)a.push(n%2?1:0),n=Math.floor(n/2);a.push(t?1:0),a.reverse(),l=a.join("");var u="";for(o=0;o<64;o+=8){var c=parseInt(l.substr(o,8),2).toString(16);1===c.length&&(c="0"+c),u+=c}return u.toLowerCase()},M=new RegExp("^-?\\d{1,10}$"),L=function(e){if(M.test(e)){var t=Number(e);if(t>=-2147483648&&t<=2147483647)return t}return null},W=function(e){try{e()}catch(t){setTimeout(function(){var e=t.stack||"";throw S("Exception was thrown by user callback.",e),t},Math.floor(0))}},U=function(){return("object"===typeof window&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},V=function(e,t){var n=setTimeout(e,t);return"object"===typeof n&&n.unref&&n.unref(),n},j=function(){function e(e,t){if(void 0===t){this.pieces_=e.split("/");for(var n=0,r=0;r<this.pieces_.length;r++)this.pieces_[r].length>0&&(this.pieces_[n]=this.pieces_[r],n++);this.pieces_.length=n,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=t}return Object.defineProperty(e,"Empty",{get:function(){return new e("")},enumerable:!0,configurable:!0}),e.prototype.getFront=function(){return this.pieceNum_>=this.pieces_.length?null:this.pieces_[this.pieceNum_]},e.prototype.getLength=function(){return this.pieces_.length-this.pieceNum_},e.prototype.popFront=function(){var t=this.pieceNum_;return t<this.pieces_.length&&t++,new e(this.pieces_,t)},e.prototype.getBack=function(){return this.pieceNum_<this.pieces_.length?this.pieces_[this.pieces_.length-1]:null},e.prototype.toString=function(){for(var e="",t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+this.pieces_[t]);return e||"/"},e.prototype.toUrlEncodedString=function(){for(var e="",t=this.pieceNum_;t<this.pieces_.length;t++)""!==this.pieces_[t]&&(e+="/"+encodeURIComponent(String(this.pieces_[t])));return e||"/"},e.prototype.slice=function(e){return void 0===e&&(e=0),this.pieces_.slice(this.pieceNum_+e)},e.prototype.parent=function(){if(this.pieceNum_>=this.pieces_.length)return null;for(var t=[],n=this.pieceNum_;n<this.pieces_.length-1;n++)t.push(this.pieces_[n]);return new e(t,0)},e.prototype.child=function(t){for(var n=[],r=this.pieceNum_;r<this.pieces_.length;r++)n.push(this.pieces_[r]);if(t instanceof e)for(r=t.pieceNum_;r<t.pieces_.length;r++)n.push(t.pieces_[r]);else{var i=t.split("/");for(r=0;r<i.length;r++)i[r].length>0&&n.push(i[r])}return new e(n,0)},e.prototype.isEmpty=function(){return this.pieceNum_>=this.pieces_.length},e.relativePath=function(t,n){var r=t.getFront(),i=n.getFront();if(null===r)return n;if(r===i)return e.relativePath(t.popFront(),n.popFront());throw new Error("INTERNAL ERROR: innerPath ("+n+") is not within outerPath ("+t+")")},e.comparePaths=function(e,t){for(var n=e.slice(),r=t.slice(),i=0;i<n.length&&i<r.length;i++){var o=P(n[i],r[i]);if(0!==o)return o}return n.length===r.length?0:n.length<r.length?-1:1},e.prototype.equals=function(e){if(this.getLength()!==e.getLength())return!1;for(var t=this.pieceNum_,n=e.pieceNum_;t<=this.pieces_.length;t++,n++)if(this.pieces_[t]!==e.pieces_[n])return!1;return!0},e.prototype.contains=function(e){var t=this.pieceNum_,n=e.pieceNum_;if(this.getLength()>e.getLength())return!1;for(;t<this.pieces_.length;){if(this.pieces_[t]!==e.pieces_[n])return!1;++t,++n}return!0},e}(),z=function(){function e(e,t){this.errorPrefix_=t,this.parts_=e.slice(),this.byteLength_=Math.max(1,this.parts_.length);for(var n=0;n<this.parts_.length;n++)this.byteLength_+=s.stringLength(this.parts_[n]);this.checkValid_()}return Object.defineProperty(e,"MAX_PATH_DEPTH",{get:function(){return 32},enumerable:!0,configurable:!0}),Object.defineProperty(e,"MAX_PATH_LENGTH_BYTES",{get:function(){return 768},enumerable:!0,configurable:!0}),e.prototype.push=function(e){this.parts_.length>0&&(this.byteLength_+=1),this.parts_.push(e),this.byteLength_+=s.stringLength(e),this.checkValid_()},e.prototype.pop=function(){var e=this.parts_.pop();this.byteLength_-=s.stringLength(e),this.parts_.length>0&&(this.byteLength_-=1)},e.prototype.checkValid_=function(){if(this.byteLength_>e.MAX_PATH_LENGTH_BYTES)throw new Error(this.errorPrefix_+"has a key path longer than "+e.MAX_PATH_LENGTH_BYTES+" bytes ("+this.byteLength_+").");if(this.parts_.length>e.MAX_PATH_DEPTH)throw new Error(this.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+e.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},e.prototype.toErrorString=function(){return 0==this.parts_.length?"":"in property '"+this.parts_.join(".")+"'"},e}(),B="long_polling",Q=function(){function e(e,t,n,r,i){void 0===i&&(i=""),this.secure=t,this.namespace=n,this.webSocketOnly=r,this.persistenceKey=i,this.host=e.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=h.get("host:"+e)||this.host}return e.prototype.needsQueryParam=function(){return this.host!==this.internalHost||this.isCustomHost()},e.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},e.prototype.isDemoHost=function(){return"firebaseio-demo.com"===this.domain},e.prototype.isCustomHost=function(){return"firebaseio.com"!==this.domain&&"firebaseio-demo.com"!==this.domain},e.prototype.updateHost=function(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&h.set("host:"+this.host,this.internalHost))},e.prototype.connectionURL=function(e,t){var n;if(s.assert("string"===typeof e,"typeof type must == string"),s.assert("object"===typeof t,"typeof params must == object"),"websocket"===e)n=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if(e!==B)throw new Error("Unknown connection type: "+e);n=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(t.ns=this.namespace);var r=[];return A(t,function(e,t){r.push(e+"="+t)}),n+r.join("&")},e.prototype.toString=function(){var e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e},e.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},e}();var q,H,Y=function(e){var t=K(e),n=t.subdomain;"firebase"===t.domain&&T(t.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),n&&"undefined"!=n||"localhost"===t.domain||T("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),t.secure||"undefined"!==typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&S("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");var r="ws"===t.scheme||"wss"===t.scheme;return{repoInfo:new Q(t.host,t.secure,n,r),path:new j(t.pathString)}},K=function(e){var t="",n="",r="",i="",o=!0,s="https",l=443;if("string"===typeof e){var u=e.indexOf("//");u>=0&&(s=e.substring(0,u-1),e=e.substring(u+2));var c=e.indexOf("/");-1===c&&(c=e.length);var p=e.indexOf("?");-1===p&&(p=e.length),t=e.substring(0,Math.min(c,p)),c<p&&(i=function(e){for(var t="",n=e.split("/"),r=0;r<n.length;r++)if(n[r].length>0){var i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(o){}t+="/"+i}return t}(e.substring(c,p)));var h=function(e){var t,n,r={};"?"===e.charAt(0)&&(e=e.substring(1));try{for(var i=a.__values(e.split("&")),o=i.next();!o.done;o=i.next()){var s=o.value;if(0!==s.length){var l=s.split("=");2===l.length?r[decodeURIComponent(l[0])]=decodeURIComponent(l[1]):S("Invalid query segment '"+s+"' in query '"+e+"'")}}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(e.substring(Math.min(e.length,p)));(u=t.indexOf(":"))>=0?(o="https"===s||"wss"===s,l=parseInt(t.substring(u+1),10)):u=e.length;var d=t.split(".");3===d.length?(n=d[1],r=d[0].toLowerCase()):2===d.length?n=d[0]:"localhost"===d[0].slice(0,u).toLowerCase()&&(n="localhost"),""===r&&"ns"in h&&(r=h.ns)}return{host:t,port:l,domain:n,subdomain:r,secure:o,scheme:s,pathString:i}},G=/[\[\].#$\/\u0000-\u001F\u007F]/,$=/[\[\].#$\u0000-\u001F\u007F]/,X=function(e){return"string"===typeof e&&0!==e.length&&!G.test(e)},J=function(e){return"string"===typeof e&&0!==e.length&&!$.test(e)},Z=function(e){return null===e||"string"===typeof e||"number"===typeof e&&!k(e)||e&&"object"===typeof e&&s.contains(e,".sv")},ee=function(e,t,n,r,i){i&&void 0===n||te(s.errorPrefix(e,t,i),n,r)},te=function e(t,n,r){var i=r instanceof j?new z(r,t):r;if(void 0===n)throw new Error(t+"contains undefined "+i.toErrorString());if("function"===typeof n)throw new Error(t+"contains a function "+i.toErrorString()+" with contents = "+n.toString());if(k(n))throw new Error(t+"contains "+n.toString()+" "+i.toErrorString());if("string"===typeof n&&n.length>10485760/3&&s.stringLength(n)>10485760)throw new Error(t+"contains a string greater than 10485760 utf8 bytes "+i.toErrorString()+" ('"+n.substring(0,50)+"...')");if(n&&"object"===typeof n){var o=!1,a=!1;if(A(n,function(n,r){if(".value"===n)o=!0;else if(".priority"!==n&&".sv"!==n&&(a=!0,!X(n)))throw new Error(t+" contains an invalid key ("+n+") "+i.toErrorString()+'.  Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');i.push(n),e(t,r,i),i.pop()}),o&&a)throw new Error(t+' contains ".value" child '+i.toErrorString()+" in addition to actual children.")}},ne=function(e,t,n,r,i){if(!i||void 0!==n){var o=s.errorPrefix(e,t,i);if(!n||"object"!==typeof n||Array.isArray(n))throw new Error(o+" must be an object containing the children to replace.");var a=[];A(n,function(e,t){var n=new j(e);if(te(o,t,r.child(n)),".priority"===n.getBack()&&!Z(t))throw new Error(o+"contains an invalid value for '"+n.toString()+"', which must be a valid Firebase priority (a string, finite number, server value, or null).");a.push(n)}),function(e,t){var n,r;for(n=0;n<t.length;n++)for(var i=(r=t[n]).slice(),o=0;o<i.length;o++)if(".priority"===i[o]&&o===i.length-1);else if(!X(i[o]))throw new Error(e+"contains an invalid key ("+i[o]+") in path "+r.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');t.sort(j.comparePaths);var a=null;for(n=0;n<t.length;n++){if(r=t[n],null!==a&&a.contains(r))throw new Error(e+"contains a path "+a.toString()+" that is ancestor of another path "+r.toString());a=r}}(o,a)}},re=function(e,t,n,r){if(!r||void 0!==n){if(k(n))throw new Error(s.errorPrefix(e,t,r)+"is "+n.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!Z(n))throw new Error(s.errorPrefix(e,t,r)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},ie=function(e,t,n,r){if(!r||void 0!==n)switch(n){case"value":case"child_added":case"child_removed":case"child_changed":case"child_moved":break;default:throw new Error(s.errorPrefix(e,t,r)+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},oe=function(e,t,n,r){if((!r||void 0!==n)&&!X(n))throw new Error(s.errorPrefix(e,t,r)+'was an invalid key = "'+n+'".  Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},ae=function(e,t,n,r){if((!r||void 0!==n)&&!J(n))throw new Error(s.errorPrefix(e,t,r)+'was an invalid path = "'+n+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},se=function(e,t,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),ae(e,t,n,r)},le=function(e,t){if(".info"===t.getFront())throw new Error(e+" failed = Can't modify data under /.info/")},ue=function(e,t,n){var r=n.path.toString();if("string"!==typeof n.repoInfo.host||0===n.repoInfo.host.length||!X(n.repoInfo.namespace)&&"localhost"!==n.repoInfo.host.split(":")[0]||0!==r.length&&!function(e){return e&&(e=e.replace(/^\/*\.info(\/|$)/,"/")),J(e)}(r))throw new Error(s.errorPrefix(e,t,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},ce=function(e,t,n,r){if((!r||void 0!==n)&&"boolean"!==typeof n)throw new Error(s.errorPrefix(e,t,r)+"must be a boolean.")},pe=function(){function e(e,t){this.repo_=e,this.path_=t}return e.prototype.cancel=function(e){s.validateArgCount("OnDisconnect.cancel",0,1,arguments.length),s.validateCallback("OnDisconnect.cancel",1,e,!0);var t=new s.Deferred;return this.repo_.onDisconnectCancel(this.path_,t.wrapCallback(e)),t.promise},e.prototype.remove=function(e){s.validateArgCount("OnDisconnect.remove",0,1,arguments.length),le("OnDisconnect.remove",this.path_),s.validateCallback("OnDisconnect.remove",1,e,!0);var t=new s.Deferred;return this.repo_.onDisconnectSet(this.path_,null,t.wrapCallback(e)),t.promise},e.prototype.set=function(e,t){s.validateArgCount("OnDisconnect.set",1,2,arguments.length),le("OnDisconnect.set",this.path_),ee("OnDisconnect.set",1,e,this.path_,!1),s.validateCallback("OnDisconnect.set",2,t,!0);var n=new s.Deferred;return this.repo_.onDisconnectSet(this.path_,e,n.wrapCallback(t)),n.promise},e.prototype.setWithPriority=function(e,t,n){s.validateArgCount("OnDisconnect.setWithPriority",2,3,arguments.length),le("OnDisconnect.setWithPriority",this.path_),ee("OnDisconnect.setWithPriority",1,e,this.path_,!1),re("OnDisconnect.setWithPriority",2,t,!1),s.validateCallback("OnDisconnect.setWithPriority",3,n,!0);var r=new s.Deferred;return this.repo_.onDisconnectSetWithPriority(this.path_,e,t,r.wrapCallback(n)),r.promise},e.prototype.update=function(e,t){if(s.validateArgCount("OnDisconnect.update",1,2,arguments.length),le("OnDisconnect.update",this.path_),Array.isArray(e)){for(var n={},r=0;r<e.length;++r)n[""+r]=e[r];e=n,S("Passing an Array to firebase.database.onDisconnect().update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}ne("OnDisconnect.update",1,e,this.path_,!1),s.validateCallback("OnDisconnect.update",2,t,!0);var i=new s.Deferred;return this.repo_.onDisconnectUpdate(this.path_,e,i.wrapCallback(t)),i.promise},e}(),he=function(){function e(e,t){this.committed=e,this.snapshot=t}return e.prototype.toJSON=function(){return s.validateArgCount("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},e}(),de=function(){var e="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",t=0,n=[];return function(r){var i,o=r===t;t=r;var a=new Array(8);for(i=7;i>=0;i--)a[i]=e.charAt(r%64),r=Math.floor(r/64);s.assert(0===r,"Cannot push at time == 0");var l=a.join("");if(o){for(i=11;i>=0&&63===n[i];i--)n[i]=0;n[i]++}else for(i=0;i<12;i++)n[i]=Math.floor(64*Math.random());for(i=0;i<12;i++)l+=e.charAt(n[i]);return s.assert(20===l.length,"nextPushId: Length should be 20."),l}}(),fe=function(){function e(e,t){this.name=e,this.node=t}return e.Wrap=function(t,n){return new e(t,n)},e}(),ye=function(){function e(){}return e.prototype.getCompare=function(){return this.compare.bind(this)},e.prototype.indexedValueChanged=function(e,t){var n=new fe(x,e),r=new fe(x,t);return 0!==this.compare(n,r)},e.prototype.minPost=function(){return fe.MIN},e}(),ve=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a.__extends(t,e),Object.defineProperty(t,"__EMPTY_NODE",{get:function(){return q},set:function(e){q=e},enumerable:!0,configurable:!0}),t.prototype.compare=function(e,t){return P(e.name,t.name)},t.prototype.isDefinedOn=function(e){throw s.assertionError("KeyIndex.isDefinedOn not expected to be called.")},t.prototype.indexedValueChanged=function(e,t){return!1},t.prototype.minPost=function(){return fe.MIN},t.prototype.maxPost=function(){return new fe(N,q)},t.prototype.makePost=function(e,t){return s.assert("string"===typeof e,"KeyIndex indexValue must always be a string."),new fe(e,q)},t.prototype.toString=function(){return".key"},t}(ye),me=new ve;var ge,_e,be,we=function(e){return"number"===typeof e?"number:"+F(e):"string:"+e},Ee=function(e){if(e.isLeafNode()){var t=e.val();s.assert("string"===typeof t||"number"===typeof t||"object"===typeof t&&s.contains(t,".sv"),"Priority must be a string or number.")}else s.assert(e===H||e.isEmpty(),"priority of unexpected type.");s.assert(e===H||e.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},Ce=function(){function e(t,n){void 0===n&&(n=e.__childrenNodeConstructor.EMPTY_NODE),this.value_=t,this.priorityNode_=n,this.lazyHash_=null,s.assert(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),Ee(this.priorityNode_)}return Object.defineProperty(e,"__childrenNodeConstructor",{get:function(){return ge},set:function(e){ge=e},enumerable:!0,configurable:!0}),e.prototype.isLeafNode=function(){return!0},e.prototype.getPriority=function(){return this.priorityNode_},e.prototype.updatePriority=function(t){return new e(this.value_,t)},e.prototype.getImmediateChild=function(t){return".priority"===t?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.getChild=function(t){return t.isEmpty()?this:".priority"===t.getFront()?this.priorityNode_:e.__childrenNodeConstructor.EMPTY_NODE},e.prototype.hasChild=function(){return!1},e.prototype.getPredecessorChildName=function(e,t){return null},e.prototype.updateImmediateChild=function(t,n){return".priority"===t?this.updatePriority(n):n.isEmpty()&&".priority"!==t?this:e.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t,n).updatePriority(this.priorityNode_)},e.prototype.updateChild=function(t,n){var r=t.getFront();return null===r?n:n.isEmpty()&&".priority"!==r?this:(s.assert(".priority"!==r||1===t.getLength(),".priority must be the last token in a path"),this.updateImmediateChild(r,e.__childrenNodeConstructor.EMPTY_NODE.updateChild(t.popFront(),n)))},e.prototype.isEmpty=function(){return!1},e.prototype.numChildren=function(){return 0},e.prototype.forEachChild=function(e,t){return!1},e.prototype.val=function(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},e.prototype.hash=function(){if(null===this.lazyHash_){var e="";this.priorityNode_.isEmpty()||(e+="priority:"+we(this.priorityNode_.val())+":");var t=typeof this.value_;e+=t+":",e+="number"===t?F(this.value_):this.value_,this.lazyHash_=v(e)}return this.lazyHash_},e.prototype.getValue=function(){return this.value_},e.prototype.compareTo=function(t){return t===e.__childrenNodeConstructor.EMPTY_NODE?1:t instanceof e.__childrenNodeConstructor?-1:(s.assert(t.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(t))},e.prototype.compareToLeafNode_=function(t){var n=typeof t.value_,r=typeof this.value_,i=e.VALUE_TYPE_ORDER.indexOf(n),o=e.VALUE_TYPE_ORDER.indexOf(r);return s.assert(i>=0,"Unknown leaf type: "+n),s.assert(o>=0,"Unknown leaf type: "+r),i===o?"object"===r?0:this.value_<t.value_?-1:this.value_===t.value_?0:1:o-i},e.prototype.withIndex=function(){return this},e.prototype.isIndexed=function(){return!0},e.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode()){var t=e;return this.value_===t.value_&&this.priorityNode_.equals(t.priorityNode_)}return!1},e.VALUE_TYPE_ORDER=["object","boolean","number","string"],e}();var Te,Se,ke=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a.__extends(t,e),t.prototype.compare=function(e,t){var n=e.node.getPriority(),r=t.node.getPriority(),i=n.compareTo(r);return 0===i?P(e.name,t.name):i},t.prototype.isDefinedOn=function(e){return!e.getPriority().isEmpty()},t.prototype.indexedValueChanged=function(e,t){return!e.getPriority().equals(t.getPriority())},t.prototype.minPost=function(){return fe.MIN},t.prototype.maxPost=function(){return new fe(N,new Ce("[PRIORITY-POST]",be))},t.prototype.makePost=function(e,t){var n=_e(e);return new fe(t,new Ce("[PRIORITY-POST]",n))},t.prototype.toString=function(){return".priority"},t}(ye)),xe=function(){function e(e,t,n,r,i){void 0===i&&(i=null),this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];for(var o=1;!e.isEmpty();)if(e=e,o=t?n(e.key,t):1,r&&(o*=-1),o<0)e=this.isReverse_?e.left:e.right;else{if(0===o){this.nodeStack_.push(e);break}this.nodeStack_.push(e),e=this.isReverse_?e.right:e.left}}return e.prototype.getNext=function(){if(0===this.nodeStack_.length)return null;var e,t=this.nodeStack_.pop();if(e=this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value},this.isReverse_)for(t=t.left;!t.isEmpty();)this.nodeStack_.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack_.push(t),t=t.left;return e},e.prototype.hasNext=function(){return this.nodeStack_.length>0},e.prototype.peek=function(){if(0===this.nodeStack_.length)return null;var e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}},e}(),Ne=function(){function e(t,n,r,i,o){this.key=t,this.value=n,this.color=null!=r?r:e.RED,this.left=null!=i?i:Re.EMPTY_NODE,this.right=null!=o?o:Re.EMPTY_NODE}return e.prototype.copy=function(t,n,r,i,o){return new e(null!=t?t:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},e.prototype.count=function(){return this.left.count()+1+this.right.count()},e.prototype.isEmpty=function(){return!1},e.prototype.inorderTraversal=function(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)},e.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},e.prototype.minKey=function(){return this.min_().key},e.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},e.prototype.insert=function(e,t,n){var r,i;return(i=(r=n(e,(i=this).key))<0?i.copy(null,null,null,i.left.insert(e,t,n),null):0===r?i.copy(null,t,null,null,null):i.copy(null,null,null,null,i.right.insert(e,t,n))).fixUp_()},e.prototype.removeMin_=function(){if(this.left.isEmpty())return Re.EMPTY_NODE;var e=this;return e.left.isRed_()||e.left.left.isRed_()||(e=e.moveRedLeft_()),(e=e.copy(null,null,null,e.left.removeMin_(),null)).fixUp_()},e.prototype.remove=function(e,t){var n,r;if(t(e,(n=this).key)<0)n.left.isEmpty()||n.left.isRed_()||n.left.left.isRed_()||(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(e,t),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===t(e,n.key)){if(n.right.isEmpty())return Re.EMPTY_NODE;r=n.right.min_(),n=n.copy(r.key,r.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(e,t))}return n.fixUp_()},e.prototype.isRed_=function(){return this.color},e.prototype.fixUp_=function(){var e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e},e.prototype.moveRedLeft_=function(){var e=this.colorFlip_();return e.right.left.isRed_()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight_())).rotateLeft_()).colorFlip_()),e},e.prototype.moveRedRight_=function(){var e=this.colorFlip_();return e.left.left.isRed_()&&(e=(e=e.rotateRight_()).colorFlip_()),e},e.prototype.rotateLeft_=function(){var t=this.copy(null,null,e.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)},e.prototype.rotateRight_=function(){var t=this.copy(null,null,e.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)},e.prototype.colorFlip_=function(){var e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)},e.prototype.checkMaxDepth_=function(){var e=this.check_();return Math.pow(2,e)<=this.count()+1},e.prototype.check_=function(){var e;if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");if((e=this.left.check_())!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)},e.RED=!0,e.BLACK=!1,e}(),Pe=function(){function e(){}return e.prototype.copy=function(e,t,n,r,i){return this},e.prototype.insert=function(e,t,n){return new Ne(e,t,null)},e.prototype.remove=function(e,t){return this},e.prototype.count=function(){return 0},e.prototype.isEmpty=function(){return!0},e.prototype.inorderTraversal=function(e){return!1},e.prototype.reverseTraversal=function(e){return!1},e.prototype.minKey=function(){return null},e.prototype.maxKey=function(){return null},e.prototype.check_=function(){return 0},e.prototype.isRed_=function(){return!1},e}(),Re=function(){function e(t,n){void 0===n&&(n=e.EMPTY_NODE),this.comparator_=t,this.root_=n}return e.prototype.insert=function(t,n){return new e(this.comparator_,this.root_.insert(t,n,this.comparator_).copy(null,null,Ne.BLACK,null,null))},e.prototype.remove=function(t){return new e(this.comparator_,this.root_.remove(t,this.comparator_).copy(null,null,Ne.BLACK,null,null))},e.prototype.get=function(e){for(var t,n=this.root_;!n.isEmpty();){if(0===(t=this.comparator_(e,n.key)))return n.value;t<0?n=n.left:t>0&&(n=n.right)}return null},e.prototype.getPredecessorKey=function(e){for(var t,n=this.root_,r=null;!n.isEmpty();){if(0===(t=this.comparator_(e,n.key))){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}t<0?n=n.left:t>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key.  What gives?")},e.prototype.isEmpty=function(){return this.root_.isEmpty()},e.prototype.count=function(){return this.root_.count()},e.prototype.minKey=function(){return this.root_.minKey()},e.prototype.maxKey=function(){return this.root_.maxKey()},e.prototype.inorderTraversal=function(e){return this.root_.inorderTraversal(e)},e.prototype.reverseTraversal=function(e){return this.root_.reverseTraversal(e)},e.prototype.getIterator=function(e){return new xe(this.root_,null,this.comparator_,!1,e)},e.prototype.getIteratorFrom=function(e,t){return new xe(this.root_,e,this.comparator_,!1,t)},e.prototype.getReverseIteratorFrom=function(e,t){return new xe(this.root_,e,this.comparator_,!0,t)},e.prototype.getReverseIterator=function(e){return new xe(this.root_,null,this.comparator_,!0,e)},e.EMPTY_NODE=new Pe,e}(),Oe=Math.log(2),Ie=function(){function e(e){var t;this.count=(t=e+1,parseInt(Math.log(t)/Oe,10)),this.current_=this.count-1;var n,r=(n=this.count,parseInt(Array(n+1).join("1"),2));this.bits_=e+1&r}return e.prototype.nextBitIsOne=function(){var e=!(this.bits_&1<<this.current_);return this.current_--,e},e}(),De=function(e,t,n,r){e.sort(t);var i=function(t){for(var r=null,i=null,o=e.length,a=function(t,r){var i=o-t,a=o;o-=t;var l=function t(r,i){var o,a,s=i-r;if(0==s)return null;if(1==s)return o=e[r],a=n?n(o):o,new Ne(a,o.node,Ne.BLACK,null,null);var l=parseInt(s/2,10)+r,u=t(r,l),c=t(l+1,i);return o=e[l],a=n?n(o):o,new Ne(a,o.node,Ne.BLACK,u,c)}(i+1,a),u=e[i],c=n?n(u):u;s(new Ne(c,u.node,r,null,l))},s=function(e){r?(r.left=e,r=e):(i=e,r=e)},l=0;l<t.count;++l){var u=t.nextBitIsOne(),c=Math.pow(2,t.count-(l+1));u?a(c,Ne.BLACK):(a(c,Ne.BLACK),a(c,Ne.RED))}return i}(new Ie(e.length));return new Re(r||t,i)},Ae={},Fe=function(){function e(e,t){this.indexes_=e,this.indexSet_=t}return Object.defineProperty(e,"Default",{get:function(){return s.assert(Ae&&ke,"ChildrenNode.ts has not been loaded"),Te=Te||new e({".priority":Ae},{".priority":ke})},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var t=s.safeGet(this.indexes_,e);if(!t)throw new Error("No index defined for "+e);return t instanceof Re?t:null},e.prototype.hasIndex=function(e){return s.contains(this.indexSet_,e.toString())},e.prototype.addIndex=function(t,n){s.assert(t!==me,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var r,i=[],o=!1,l=n.getIterator(fe.Wrap),u=l.getNext();u;)o=o||t.isDefinedOn(u.node),i.push(u),u=l.getNext();r=o?De(i,t.getCompare()):Ae;var c=t.toString(),p=a.__assign({},this.indexSet_);p[c]=t;var h=a.__assign({},this.indexes_);return h[c]=r,new e(h,p)},e.prototype.addToIndexes=function(t,n){var r=this;return new e(s.map(this.indexes_,function(e,i){var o=s.safeGet(r.indexSet_,i);if(s.assert(o,"Missing index implementation for "+i),e===Ae){if(o.isDefinedOn(t.node)){for(var a=[],l=n.getIterator(fe.Wrap),u=l.getNext();u;)u.name!=t.name&&a.push(u),u=l.getNext();return a.push(t),De(a,o.getCompare())}return Ae}var c=n.get(t.name),p=e;return c&&(p=p.remove(new fe(t.name,c))),p.insert(t,t.node)}),this.indexSet_)},e.prototype.removeFromIndexes=function(t,n){return new e(s.map(this.indexes_,function(e){if(e===Ae)return e;var r=n.get(t.name);return r?e.remove(new fe(t.name,r)):e}),this.indexSet_)},e}();function Me(e,t){return P(e.name,t.name)}function Le(e,t){return P(e,t)}var We=function(){function e(e,t,n){this.children_=e,this.priorityNode_=t,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&Ee(this.priorityNode_),this.children_.isEmpty()&&s.assert(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(e,"EMPTY_NODE",{get:function(){return Se||(Se=new e(new Re(Le),null,Fe.Default))},enumerable:!0,configurable:!0}),e.prototype.isLeafNode=function(){return!1},e.prototype.getPriority=function(){return this.priorityNode_||Se},e.prototype.updatePriority=function(t){return this.children_.isEmpty()?this:new e(this.children_,t,this.indexMap_)},e.prototype.getImmediateChild=function(e){if(".priority"===e)return this.getPriority();var t=this.children_.get(e);return null===t?Se:t},e.prototype.getChild=function(e){var t=e.getFront();return null===t?this:this.getImmediateChild(t).getChild(e.popFront())},e.prototype.hasChild=function(e){return null!==this.children_.get(e)},e.prototype.updateImmediateChild=function(t,n){if(s.assert(n,"We should always be passing snapshot nodes"),".priority"===t)return this.updatePriority(n);var r,i=new fe(t,n),o=void 0,a=void 0;return n.isEmpty()?(o=this.children_.remove(t),a=this.indexMap_.removeFromIndexes(i,this.children_)):(o=this.children_.insert(t,n),a=this.indexMap_.addToIndexes(i,this.children_)),r=o.isEmpty()?Se:this.priorityNode_,new e(o,r,a)},e.prototype.updateChild=function(e,t){var n=e.getFront();if(null===n)return t;s.assert(".priority"!==e.getFront()||1===e.getLength(),".priority must be the last token in a path");var r=this.getImmediateChild(n).updateChild(e.popFront(),t);return this.updateImmediateChild(n,r)},e.prototype.isEmpty=function(){return this.children_.isEmpty()},e.prototype.numChildren=function(){return this.children_.count()},e.prototype.val=function(t){if(this.isEmpty())return null;var n={},r=0,i=0,o=!0;if(this.forEachChild(ke,function(a,s){n[a]=s.val(t),r++,o&&e.INTEGER_REGEXP_.test(a)?i=Math.max(i,Number(a)):o=!1}),!t&&o&&i<2*r){var a=[];for(var s in n)a[s]=n[s];return a}return t&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n},e.prototype.hash=function(){if(null===this.lazyHash_){var e="";this.getPriority().isEmpty()||(e+="priority:"+we(this.getPriority().val())+":"),this.forEachChild(ke,function(t,n){var r=n.hash();""!==r&&(e+=":"+t+":"+r)}),this.lazyHash_=""===e?"":v(e)}return this.lazyHash_},e.prototype.getPredecessorChildName=function(e,t,n){var r=this.resolveIndex_(n);if(r){var i=r.getPredecessorKey(new fe(e,t));return i?i.name:null}return this.children_.getPredecessorKey(e)},e.prototype.getFirstChildName=function(e){var t=this.resolveIndex_(e);if(t){var n=t.minKey();return n&&n.name}return this.children_.minKey()},e.prototype.getFirstChild=function(e){var t=this.getFirstChildName(e);return t?new fe(t,this.children_.get(t)):null},e.prototype.getLastChildName=function(e){var t=this.resolveIndex_(e);if(t){var n=t.maxKey();return n&&n.name}return this.children_.maxKey()},e.prototype.getLastChild=function(e){var t=this.getLastChildName(e);return t?new fe(t,this.children_.get(t)):null},e.prototype.forEachChild=function(e,t){var n=this.resolveIndex_(e);return n?n.inorderTraversal(function(e){return t(e.name,e.node)}):this.children_.inorderTraversal(t)},e.prototype.getIterator=function(e){return this.getIteratorFrom(e.minPost(),e)},e.prototype.getIteratorFrom=function(e,t){var n=this.resolveIndex_(t);if(n)return n.getIteratorFrom(e,function(e){return e});for(var r=this.children_.getIteratorFrom(e.name,fe.Wrap),i=r.peek();null!=i&&t.compare(i,e)<0;)r.getNext(),i=r.peek();return r},e.prototype.getReverseIterator=function(e){return this.getReverseIteratorFrom(e.maxPost(),e)},e.prototype.getReverseIteratorFrom=function(e,t){var n=this.resolveIndex_(t);if(n)return n.getReverseIteratorFrom(e,function(e){return e});for(var r=this.children_.getReverseIteratorFrom(e.name,fe.Wrap),i=r.peek();null!=i&&t.compare(i,e)>0;)r.getNext(),i=r.peek();return r},e.prototype.compareTo=function(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===Ue?-1:0},e.prototype.withIndex=function(t){if(t===me||this.indexMap_.hasIndex(t))return this;var n=this.indexMap_.addIndex(t,this.children_);return new e(this.children_,this.priorityNode_,n)},e.prototype.isIndexed=function(e){return e===me||this.indexMap_.hasIndex(e)},e.prototype.equals=function(e){if(e===this)return!0;if(e.isLeafNode())return!1;var t=e;if(this.getPriority().equals(t.getPriority())){if(this.children_.count()===t.children_.count()){for(var n=this.getIterator(ke),r=t.getIterator(ke),i=n.getNext(),o=r.getNext();i&&o;){if(i.name!==o.name||!i.node.equals(o.node))return!1;i=n.getNext(),o=r.getNext()}return null===i&&null===o}return!1}return!1},e.prototype.resolveIndex_=function(e){return e===me?null:this.indexMap_.get(e.toString())},e.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,e}(),Ue=new(function(e){function t(){return e.call(this,new Re(Le),We.EMPTY_NODE,Fe.Default)||this}return a.__extends(t,e),t.prototype.compareTo=function(e){return e===this?0:1},t.prototype.equals=function(e){return e===this},t.prototype.getPriority=function(){return this},t.prototype.getImmediateChild=function(e){return We.EMPTY_NODE},t.prototype.isEmpty=function(){return!1},t}(We));Object.defineProperties(fe,{MIN:{value:new fe(x,We.EMPTY_NODE)},MAX:{value:new fe(N,Ue)}}),ve.__EMPTY_NODE=We.EMPTY_NODE,Ce.__childrenNodeConstructor=We,H=Ue,function(e){be=e}(Ue);var Ve=!0;function je(e,t){if(void 0===t&&(t=null),null===e)return We.EMPTY_NODE;if("object"===typeof e&&".priority"in e&&(t=e[".priority"]),s.assert(null===t||"string"===typeof t||"number"===typeof t||"object"===typeof t&&".sv"in t,"Invalid priority type found: "+typeof t),"object"===typeof e&&".value"in e&&null!==e[".value"]&&(e=e[".value"]),"object"!==typeof e||".sv"in e)return new Ce(e,je(t));if(e instanceof Array||!Ve){var n=We.EMPTY_NODE;return A(e,function(t,r){if(s.contains(e,t)&&"."!==t.substring(0,1)){var i=je(r);!i.isLeafNode()&&i.isEmpty()||(n=n.updateImmediateChild(t,i))}}),n.updatePriority(je(t))}var r=[],i=!1;if(A(e,function(e,t){if("."!==e.substring(0,1)){var n=je(t);n.isEmpty()||(i=i||!n.getPriority().isEmpty(),r.push(new fe(e,n)))}}),0==r.length)return We.EMPTY_NODE;var o=De(r,Me,function(e){return e.name},Le);if(i){var a=De(r,ke.getCompare());return new We(o,je(t),new Fe({".priority":a},{".priority":ke}))}return new We(o,je(t),Fe.Default)}!function(e){_e=e}(je);var ze,Be,Qe=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a.__extends(t,e),t.prototype.compare=function(e,t){var n=e.node.compareTo(t.node);return 0===n?P(e.name,t.name):n},t.prototype.isDefinedOn=function(e){return!0},t.prototype.indexedValueChanged=function(e,t){return!e.equals(t)},t.prototype.minPost=function(){return fe.MIN},t.prototype.maxPost=function(){return fe.MAX},t.prototype.makePost=function(e,t){var n=je(e);return new fe(t,n)},t.prototype.toString=function(){return".value"},t}(ye)),qe=function(e){function t(t){var n=e.call(this)||this;return n.indexPath_=t,s.assert(!t.isEmpty()&&".priority"!==t.getFront(),"Can't create PathIndex with empty path or .priority key"),n}return a.__extends(t,e),t.prototype.extractChild=function(e){return e.getChild(this.indexPath_)},t.prototype.isDefinedOn=function(e){return!e.getChild(this.indexPath_).isEmpty()},t.prototype.compare=function(e,t){var n=this.extractChild(e.node),r=this.extractChild(t.node),i=n.compareTo(r);return 0===i?P(e.name,t.name):i},t.prototype.makePost=function(e,t){var n=je(e),r=We.EMPTY_NODE.updateChild(this.indexPath_,n);return new fe(t,r)},t.prototype.maxPost=function(){var e=We.EMPTY_NODE.updateChild(this.indexPath_,Ue);return new fe(N,e)},t.prototype.toString=function(){return this.indexPath_.slice().join("/")},t}(ye),He=function(){function e(e,t,n){this.node_=e,this.ref_=t,this.index_=n}return e.prototype.val=function(){return s.validateArgCount("DataSnapshot.val",0,0,arguments.length),this.node_.val()},e.prototype.exportVal=function(){return s.validateArgCount("DataSnapshot.exportVal",0,0,arguments.length),this.node_.val(!0)},e.prototype.toJSON=function(){return s.validateArgCount("DataSnapshot.toJSON",0,1,arguments.length),this.exportVal()},e.prototype.exists=function(){return s.validateArgCount("DataSnapshot.exists",0,0,arguments.length),!this.node_.isEmpty()},e.prototype.child=function(t){s.validateArgCount("DataSnapshot.child",0,1,arguments.length),t=String(t),ae("DataSnapshot.child",1,t,!1);var n=new j(t),r=this.ref_.child(n);return new e(this.node_.getChild(n),r,ke)},e.prototype.hasChild=function(e){s.validateArgCount("DataSnapshot.hasChild",1,1,arguments.length),ae("DataSnapshot.hasChild",1,e,!1);var t=new j(e);return!this.node_.getChild(t).isEmpty()},e.prototype.getPriority=function(){return s.validateArgCount("DataSnapshot.getPriority",0,0,arguments.length),this.node_.getPriority().val()},e.prototype.forEach=function(t){var n=this;if(s.validateArgCount("DataSnapshot.forEach",1,1,arguments.length),s.validateCallback("DataSnapshot.forEach",1,t,!1),this.node_.isLeafNode())return!1;var r=this.node_;return!!r.forEachChild(this.index_,function(r,i){return t(new e(i,n.ref_.child(r),ke))})},e.prototype.hasChildren=function(){return s.validateArgCount("DataSnapshot.hasChildren",0,0,arguments.length),!this.node_.isLeafNode()&&!this.node_.isEmpty()},Object.defineProperty(e.prototype,"key",{get:function(){return this.ref_.getKey()},enumerable:!0,configurable:!0}),e.prototype.numChildren=function(){return s.validateArgCount("DataSnapshot.numChildren",0,0,arguments.length),this.node_.numChildren()},e.prototype.getRef=function(){return s.validateArgCount("DataSnapshot.ref",0,0,arguments.length),this.ref_},Object.defineProperty(e.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),e}(),Ye=function(){function e(e,t,n,r){this.eventType=e,this.eventRegistration=t,this.snapshot=n,this.prevName=r}return e.prototype.getPath=function(){var e=this.snapshot.getRef();return"value"===this.eventType?e.path:e.getParent().path},e.prototype.getEventType=function(){return this.eventType},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+s.stringify(this.snapshot.exportVal())},e}(),Ke=function(){function e(e,t,n){this.eventRegistration=e,this.error=t,this.path=n}return e.prototype.getPath=function(){return this.path},e.prototype.getEventType=function(){return"cancel"},e.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},e.prototype.toString=function(){return this.path.toString()+":cancel"},e}(),Ge=function(){function e(e,t,n){this.callback_=e,this.cancelCallback_=t,this.context_=n}return e.prototype.respondsTo=function(e){return"value"===e},e.prototype.createEvent=function(e,t){var n=t.getQueryParams().getIndex();return new Ye("value",this,new He(e.snapshotNode,t.getRef(),n))},e.prototype.getEventRunner=function(e){var t=this.context_;if("cancel"===e.getEventType()){s.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(t,e.error)}}var r=this.callback_;return function(){r.call(t,e.snapshot)}},e.prototype.createCancelEvent=function(e,t){return this.cancelCallback_?new Ke(this,e,t):null},e.prototype.matches=function(t){return t instanceof e&&(!t.callback_||!this.callback_||t.callback_===this.callback_&&t.context_===this.context_)},e.prototype.hasAnyCallback=function(){return null!==this.callback_},e}(),$e=function(){function e(e,t,n){this.callbacks_=e,this.cancelCallback_=t,this.context_=n}return e.prototype.respondsTo=function(e){var t="children_added"===e?"child_added":e;return t="children_removed"===t?"child_removed":t,s.contains(this.callbacks_,t)},e.prototype.createCancelEvent=function(e,t){return this.cancelCallback_?new Ke(this,e,t):null},e.prototype.createEvent=function(e,t){s.assert(null!=e.childName,"Child events should have a childName.");var n=t.getRef().child(e.childName),r=t.getQueryParams().getIndex();return new Ye(e.type,this,new He(e.snapshotNode,n,r),e.prevName)},e.prototype.getEventRunner=function(e){var t=this.context_;if("cancel"===e.getEventType()){s.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(t,e.error)}}var r=this.callbacks_[e.eventType];return function(){r.call(t,e.snapshot,e.prevName)}},e.prototype.matches=function(t){var n=this;if(t instanceof e){if(!this.callbacks_||!t.callbacks_)return!0;if(this.context_===t.context_){var r=Object.keys(t.callbacks_),i=Object.keys(this.callbacks_),o=r.length;if(o===i.length){if(1===o){var a=r[0],s=i[0];return s===a&&(!t.callbacks_[a]||!this.callbacks_[s]||t.callbacks_[a]===this.callbacks_[s])}return i.every(function(e){return t.callbacks_[e]===n.callbacks_[e]})}}}return!1},e.prototype.hasAnyCallback=function(){return null!==this.callbacks_},e}(),Xe=function(){function e(e,t,n,r){this.repo=e,this.path=t,this.queryParams_=n,this.orderByCalled_=r}return Object.defineProperty(e,"__referenceConstructor",{get:function(){return s.assert(ze,"Reference.ts has not been loaded"),ze},set:function(e){ze=e},enumerable:!0,configurable:!0}),e.validateQueryEndpoints_=function(e){var t=null,n=null;if(e.hasStart()&&(t=e.getIndexStartValue()),e.hasEnd()&&(n=e.getIndexEndValue()),e.getIndex()===me){var r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",i="Query: When ordering by key, the argument passed to startAt(), endAt(),or equalTo() must be a string.";if(e.hasStart()){if(e.getIndexStartName()!=x)throw new Error(r);if("string"!==typeof t)throw new Error(i)}if(e.hasEnd()){if(e.getIndexEndName()!=N)throw new Error(r);if("string"!==typeof n)throw new Error(i)}}else if(e.getIndex()===ke){if(null!=t&&!Z(t)||null!=n&&!Z(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), endAt(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(s.assert(e.getIndex()instanceof qe||e.getIndex()===Qe,"unknown index type."),null!=t&&"object"===typeof t||null!=n&&"object"===typeof n)throw new Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.")},e.validateLimit_=function(e){if(e.hasStart()&&e.hasEnd()&&e.hasLimit()&&!e.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.")},e.prototype.validateNoPreviousOrderByCall_=function(e){if(!0===this.orderByCalled_)throw new Error(e+": You can't combine multiple orderBy calls.")},e.prototype.getQueryParams=function(){return this.queryParams_},e.prototype.getRef=function(){return s.validateArgCount("Query.ref",0,0,arguments.length),new e.__referenceConstructor(this.repo,this.path)},e.prototype.on=function(t,n,r,i){s.validateArgCount("Query.on",2,4,arguments.length),ie("Query.on",1,t,!1),s.validateCallback("Query.on",2,n,!1);var o=e.getCancelAndContextArgs_("Query.on",r,i);if("value"===t)this.onValueEvent(n,o.cancel,o.context);else{var a={};a[t]=n,this.onChildEvent(a,o.cancel,o.context)}return n},e.prototype.onValueEvent=function(e,t,n){var r=new Ge(e,t||null,n||null);this.repo.addEventCallbackForQuery(this,r)},e.prototype.onChildEvent=function(e,t,n){var r=new $e(e,t,n);this.repo.addEventCallbackForQuery(this,r)},e.prototype.off=function(e,t,n){s.validateArgCount("Query.off",0,3,arguments.length),ie("Query.off",1,e,!0),s.validateCallback("Query.off",2,t,!0),s.validateContextObject("Query.off",3,n,!0);var r=null,i=null;if("value"===e){var o=t||null;r=new Ge(o,null,n||null)}else e&&(t&&((i={})[e]=t),r=new $e(i,null,n||null));this.repo.removeEventCallbackForQuery(this,r)},e.prototype.once=function(t,n,r,i){var o=this;s.validateArgCount("Query.once",1,4,arguments.length),ie("Query.once",1,t,!1),s.validateCallback("Query.once",2,n,!0);var a=e.getCancelAndContextArgs_("Query.once",r,i),l=!0,u=new s.Deferred;u.promise.catch(function(){});var c=function e(r){l&&(l=!1,o.off(t,e),n&&n.bind(a.context)(r),u.resolve(r))};return this.on(t,c,function(e){o.off(t,c),a.cancel&&a.cancel.bind(a.context)(e),u.reject(e)}),u.promise},e.prototype.limitToFirst=function(t){if(s.validateArgCount("Query.limitToFirst",1,1,arguments.length),"number"!==typeof t||Math.floor(t)!==t||t<=0)throw new Error("Query.limitToFirst: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new e(this.repo,this.path,this.queryParams_.limitToFirst(t),this.orderByCalled_)},e.prototype.limitToLast=function(t){if(s.validateArgCount("Query.limitToLast",1,1,arguments.length),"number"!==typeof t||Math.floor(t)!==t||t<=0)throw new Error("Query.limitToLast: First argument must be a positive integer.");if(this.queryParams_.hasLimit())throw new Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new e(this.repo,this.path,this.queryParams_.limitToLast(t),this.orderByCalled_)},e.prototype.orderByChild=function(t){if(s.validateArgCount("Query.orderByChild",1,1,arguments.length),"$key"===t)throw new Error('Query.orderByChild: "$key" is invalid.  Use Query.orderByKey() instead.');if("$priority"===t)throw new Error('Query.orderByChild: "$priority" is invalid.  Use Query.orderByPriority() instead.');if("$value"===t)throw new Error('Query.orderByChild: "$value" is invalid.  Use Query.orderByValue() instead.');ae("Query.orderByChild",1,t,!1),this.validateNoPreviousOrderByCall_("Query.orderByChild");var n=new j(t);if(n.isEmpty())throw new Error("Query.orderByChild: cannot pass in empty path.  Use Query.orderByValue() instead.");var r=new qe(n),i=this.queryParams_.orderBy(r);return e.validateQueryEndpoints_(i),new e(this.repo,this.path,i,!0)},e.prototype.orderByKey=function(){s.validateArgCount("Query.orderByKey",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByKey");var t=this.queryParams_.orderBy(me);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.orderByPriority=function(){s.validateArgCount("Query.orderByPriority",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByPriority");var t=this.queryParams_.orderBy(ke);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.orderByValue=function(){s.validateArgCount("Query.orderByValue",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByValue");var t=this.queryParams_.orderBy(Qe);return e.validateQueryEndpoints_(t),new e(this.repo,this.path,t,!0)},e.prototype.startAt=function(t,n){void 0===t&&(t=null),s.validateArgCount("Query.startAt",0,2,arguments.length),ee("Query.startAt",1,t,this.path,!0),oe("Query.startAt",2,n,!0);var r=this.queryParams_.startAt(t,n);if(e.validateLimit_(r),e.validateQueryEndpoints_(r),this.queryParams_.hasStart())throw new Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return void 0===t&&(t=null,n=null),new e(this.repo,this.path,r,this.orderByCalled_)},e.prototype.endAt=function(t,n){void 0===t&&(t=null),s.validateArgCount("Query.endAt",0,2,arguments.length),ee("Query.endAt",1,t,this.path,!0),oe("Query.endAt",2,n,!0);var r=this.queryParams_.endAt(t,n);if(e.validateLimit_(r),e.validateQueryEndpoints_(r),this.queryParams_.hasEnd())throw new Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new e(this.repo,this.path,r,this.orderByCalled_)},e.prototype.equalTo=function(e,t){if(s.validateArgCount("Query.equalTo",1,2,arguments.length),ee("Query.equalTo",1,e,this.path,!1),oe("Query.equalTo",2,t,!0),this.queryParams_.hasStart())throw new Error("Query.equalTo: Starting point was already set (by another call to startAt or equalTo).");if(this.queryParams_.hasEnd())throw new Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.startAt(e,t).endAt(e,t)},e.prototype.toString=function(){return s.validateArgCount("Query.toString",0,0,arguments.length),this.repo.toString()+this.path.toUrlEncodedString()},e.prototype.toJSON=function(){return s.validateArgCount("Query.toJSON",0,1,arguments.length),this.toString()},e.prototype.queryObject=function(){return this.queryParams_.getQueryObject()},e.prototype.queryIdentifier=function(){var e=this.queryObject(),t=I(e);return"{}"===t?"default":t},e.prototype.isEqual=function(t){if(s.validateArgCount("Query.isEqual",1,1,arguments.length),!(t instanceof e)){var n="Query.isEqual failed: First argument must be an instance of firebase.database.Query.";throw new Error(n)}var r=this.repo===t.repo,i=this.path.equals(t.path),o=this.queryIdentifier()===t.queryIdentifier();return r&&i&&o},e.getCancelAndContextArgs_=function(e,t,n){var r={cancel:null,context:null};if(t&&n)r.cancel=t,s.validateCallback(e,3,r.cancel,!0),r.context=n,s.validateContextObject(e,4,r.context,!0);else if(t)if("object"===typeof t&&null!==t)r.context=t;else{if("function"!==typeof t)throw new Error(s.errorPrefix(e,3,!0)+" must either be a cancel callback or a context object.");r.cancel=t}return r},Object.defineProperty(e.prototype,"ref",{get:function(){return this.getRef()},enumerable:!0,configurable:!0}),e}(),Je=function(){function e(){this.value=null,this.children=new Map}return e.prototype.find=function(e){if(null!=this.value)return this.value.getChild(e);if(!e.isEmpty()&&this.children.size>0){var t=e.getFront();return e=e.popFront(),this.children.has(t)?this.children.get(t).find(e):null}return null},e.prototype.remember=function(t,n){if(t.isEmpty())this.value=n,this.children.clear();else if(null!==this.value)this.value=this.value.updateChild(t,n);else{var r=t.getFront();this.children.has(r)||this.children.set(r,new e);var i=this.children.get(r);t=t.popFront(),i.remember(t,n)}},e.prototype.forget=function(e){if(e.isEmpty())return this.value=null,this.children.clear(),!0;if(null!==this.value){if(this.value.isLeafNode())return!1;var t=this.value;this.value=null;var n=this;return t.forEachChild(ke,function(e,t){n.remember(new j(e),t)}),this.forget(e)}if(this.children.size>0){var r=e.getFront();if(e=e.popFront(),this.children.has(r))this.children.get(r).forget(e)&&this.children.delete(r);return 0===this.children.size}return!0},e.prototype.forEachTree=function(e,t){null!==this.value?t(e,this.value):this.forEachChild(function(n,r){var i=new j(e.toString()+"/"+n);r.forEachTree(i,t)})},e.prototype.forEachChild=function(e){this.children.forEach(function(t,n){e(n,t)})},e}(),Ze=function(e,t){return e&&"object"===typeof e?(s.assert(".sv"in e,"Unexpected leaf node or priority contents"),t[e[".sv"]]):e},et=function e(t,n){var r,i=t.getPriority().val(),o=Ze(i,n);if(t.isLeafNode()){var a=t,s=Ze(a.getValue(),n);return s!==a.getValue()||o!==a.getPriority().val()?new Ce(s,je(o)):t}var l=t;return r=l,o!==l.getPriority().val()&&(r=r.updatePriority(new Ce(o))),l.forEachChild(ke,function(t,i){var o=e(i,n);o!==i&&(r=r.updateImmediateChild(t,o))}),r};!function(e){e[e.OVERWRITE=0]="OVERWRITE",e[e.MERGE=1]="MERGE",e[e.ACK_USER_WRITE=2]="ACK_USER_WRITE",e[e.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(Be||(Be={}));var tt,nt,rt=function(){function e(e,t,n,r){this.fromUser=e,this.fromServer=t,this.queryId=n,this.tagged=r,s.assert(!r||t,"Tagged queries must be from server.")}return e.User=new e(!0,!1,null,!1),e.Server=new e(!1,!0,null,!1),e.forServerTaggedQuery=function(t){return new e(!1,!0,t,!0)},e}(),it=function(){function e(e,t,n){this.path=e,this.affectedTree=t,this.revert=n,this.type=Be.ACK_USER_WRITE,this.source=rt.User}return e.prototype.operationForChild=function(t){if(this.path.isEmpty()){if(null!=this.affectedTree.value)return s.assert(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;var n=this.affectedTree.subtree(new j(t));return new e(j.Empty,n,this.revert)}return s.assert(this.path.getFront()===t,"operationForChild called for unrelated child."),new e(this.path.popFront(),this.affectedTree,this.revert)},e}(),ot=function(){return tt||(tt=new Re(R)),tt},at=function(){function e(e,t){void 0===t&&(t=ot()),this.value=e,this.children=t}return e.fromObject=function(t){var n=e.Empty;return A(t,function(e,t){n=n.set(new j(e),t)}),n},e.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},e.prototype.findRootMostMatchingPathAndValue=function(e,t){if(null!=this.value&&t(this.value))return{path:j.Empty,value:this.value};if(e.isEmpty())return null;var n=e.getFront(),r=this.children.get(n);if(null!==r){var i=r.findRootMostMatchingPathAndValue(e.popFront(),t);return null!=i?{path:new j(n).child(i.path),value:i.value}:null}return null},e.prototype.findRootMostValueAndPath=function(e){return this.findRootMostMatchingPathAndValue(e,function(){return!0})},e.prototype.subtree=function(t){if(t.isEmpty())return this;var n=t.getFront(),r=this.children.get(n);return null!==r?r.subtree(t.popFront()):e.Empty},e.prototype.set=function(t,n){if(t.isEmpty())return new e(n,this.children);var r=t.getFront(),i=(this.children.get(r)||e.Empty).set(t.popFront(),n),o=this.children.insert(r,i);return new e(this.value,o)},e.prototype.remove=function(t){if(t.isEmpty())return this.children.isEmpty()?e.Empty:new e(null,this.children);var n=t.getFront(),r=this.children.get(n);if(r){var i=r.remove(t.popFront()),o=void 0;return o=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),null===this.value&&o.isEmpty()?e.Empty:new e(this.value,o)}return this},e.prototype.get=function(e){if(e.isEmpty())return this.value;var t=e.getFront(),n=this.children.get(t);return n?n.get(e.popFront()):null},e.prototype.setTree=function(t,n){if(t.isEmpty())return n;var r=t.getFront(),i=(this.children.get(r)||e.Empty).setTree(t.popFront(),n),o=void 0;return o=i.isEmpty()?this.children.remove(r):this.children.insert(r,i),new e(this.value,o)},e.prototype.fold=function(e){return this.fold_(j.Empty,e)},e.prototype.fold_=function(e,t){var n={};return this.children.inorderTraversal(function(r,i){n[r]=i.fold_(e.child(r),t)}),t(e,this.value,n)},e.prototype.findOnPath=function(e,t){return this.findOnPath_(e,j.Empty,t)},e.prototype.findOnPath_=function(e,t,n){var r=!!this.value&&n(t,this.value);if(r)return r;if(e.isEmpty())return null;var i=e.getFront(),o=this.children.get(i);return o?o.findOnPath_(e.popFront(),t.child(i),n):null},e.prototype.foreachOnPath=function(e,t){return this.foreachOnPath_(e,j.Empty,t)},e.prototype.foreachOnPath_=function(t,n,r){if(t.isEmpty())return this;this.value&&r(n,this.value);var i=t.getFront(),o=this.children.get(i);return o?o.foreachOnPath_(t.popFront(),n.child(i),r):e.Empty},e.prototype.foreach=function(e){this.foreach_(j.Empty,e)},e.prototype.foreach_=function(e,t){this.children.inorderTraversal(function(n,r){r.foreach_(e.child(n),t)}),this.value&&t(e,this.value)},e.prototype.foreachChild=function(e){this.children.inorderTraversal(function(t,n){n.value&&e(t,n.value)})},e.Empty=new e(null),e}(),st=function(){function e(e,t){this.source=e,this.path=t,this.type=Be.LISTEN_COMPLETE}return e.prototype.operationForChild=function(t){return this.path.isEmpty()?new e(this.source,j.Empty):new e(this.source,this.path.popFront())},e}(),lt=function(){function e(e,t,n){this.source=e,this.path=t,this.snap=n,this.type=Be.OVERWRITE}return e.prototype.operationForChild=function(t){return this.path.isEmpty()?new e(this.source,j.Empty,this.snap.getImmediateChild(t)):new e(this.source,this.path.popFront(),this.snap)},e}(),ut=function(){function e(e,t,n){this.source=e,this.path=t,this.children=n,this.type=Be.MERGE}return e.prototype.operationForChild=function(t){if(this.path.isEmpty()){var n=this.children.subtree(new j(t));return n.isEmpty()?null:n.value?new lt(this.source,j.Empty,n.value):new e(this.source,j.Empty,n)}return s.assert(this.path.getFront()===t,"Can't get a merge for a child not on the path of the operation"),new e(this.source,this.path.popFront(),this.children)},e.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},e}(),ct=function(){function e(e,t,n){this.node_=e,this.fullyInitialized_=t,this.filtered_=n}return e.prototype.isFullyInitialized=function(){return this.fullyInitialized_},e.prototype.isFiltered=function(){return this.filtered_},e.prototype.isCompleteForPath=function(e){if(e.isEmpty())return this.isFullyInitialized()&&!this.filtered_;var t=e.getFront();return this.isCompleteForChild(t)},e.prototype.isCompleteForChild=function(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)},e.prototype.getNode=function(){return this.node_},e}(),pt=function(){function e(e,t){this.eventCache_=e,this.serverCache_=t}return e.prototype.updateEventSnap=function(t,n,r){return new e(new ct(t,n,r),this.serverCache_)},e.prototype.updateServerSnap=function(t,n,r){return new e(this.eventCache_,new ct(t,n,r))},e.prototype.getEventCache=function(){return this.eventCache_},e.prototype.getCompleteEventSnap=function(){return this.eventCache_.isFullyInitialized()?this.eventCache_.getNode():null},e.prototype.getServerCache=function(){return this.serverCache_},e.prototype.getCompleteServerSnap=function(){return this.serverCache_.isFullyInitialized()?this.serverCache_.getNode():null},e.Empty=new e(new ct(We.EMPTY_NODE,!1,!1),new ct(We.EMPTY_NODE,!1,!1)),e}(),ht=function(){function e(e,t,n,r,i){this.type=e,this.snapshotNode=t,this.childName=n,this.oldSnap=r,this.prevName=i}return e.valueChange=function(t){return new e(e.VALUE,t)},e.childAddedChange=function(t,n){return new e(e.CHILD_ADDED,n,t)},e.childRemovedChange=function(t,n){return new e(e.CHILD_REMOVED,n,t)},e.childChangedChange=function(t,n,r){return new e(e.CHILD_CHANGED,n,t,r)},e.childMovedChange=function(t,n){return new e(e.CHILD_MOVED,n,t)},e.CHILD_ADDED="child_added",e.CHILD_REMOVED="child_removed",e.CHILD_CHANGED="child_changed",e.CHILD_MOVED="child_moved",e.VALUE="value",e}(),dt=function(){function e(e){this.index_=e}return e.prototype.updateChild=function(e,t,n,r,i,o){s.assert(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");var a=e.getImmediateChild(t);return a.getChild(r).equals(n.getChild(r))&&a.isEmpty()==n.isEmpty()?e:(null!=o&&(n.isEmpty()?e.hasChild(t)?o.trackChildChange(ht.childRemovedChange(t,a)):s.assert(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?o.trackChildChange(ht.childAddedChange(t,n)):o.trackChildChange(ht.childChangedChange(t,n,a))),e.isLeafNode()&&n.isEmpty()?e:e.updateImmediateChild(t,n).withIndex(this.index_))},e.prototype.updateFullNode=function(e,t,n){return null!=n&&(e.isLeafNode()||e.forEachChild(ke,function(e,r){t.hasChild(e)||n.trackChildChange(ht.childRemovedChange(e,r))}),t.isLeafNode()||t.forEachChild(ke,function(t,r){if(e.hasChild(t)){var i=e.getImmediateChild(t);i.equals(r)||n.trackChildChange(ht.childChangedChange(t,r,i))}else n.trackChildChange(ht.childAddedChange(t,r))})),t.withIndex(this.index_)},e.prototype.updatePriority=function(e,t){return e.isEmpty()?We.EMPTY_NODE:e.updatePriority(t)},e.prototype.filtersNodes=function(){return!1},e.prototype.getIndexedFilter=function(){return this},e.prototype.getIndex=function(){return this.index_},e}(),ft=function(){function e(){this.changeMap=new Map}return e.prototype.trackChildChange=function(e){var t=e.type,n=e.childName;s.assert(t==ht.CHILD_ADDED||t==ht.CHILD_CHANGED||t==ht.CHILD_REMOVED,"Only child changes supported for tracking"),s.assert(".priority"!==n,"Only non-priority child changes can be tracked.");var r=this.changeMap.get(n);if(r){var i=r.type;if(t==ht.CHILD_ADDED&&i==ht.CHILD_REMOVED)this.changeMap.set(n,ht.childChangedChange(n,e.snapshotNode,r.snapshotNode));else if(t==ht.CHILD_REMOVED&&i==ht.CHILD_ADDED)this.changeMap.delete(n);else if(t==ht.CHILD_REMOVED&&i==ht.CHILD_CHANGED)this.changeMap.set(n,ht.childRemovedChange(n,r.oldSnap));else if(t==ht.CHILD_CHANGED&&i==ht.CHILD_ADDED)this.changeMap.set(n,ht.childAddedChange(n,e.snapshotNode));else{if(t!=ht.CHILD_CHANGED||i!=ht.CHILD_CHANGED)throw s.assertionError("Illegal combination of changes: "+e+" occurred after "+r);this.changeMap.set(n,ht.childChangedChange(n,e.snapshotNode,r.oldSnap))}}else this.changeMap.set(n,e)},e.prototype.getChanges=function(){return Array.from(this.changeMap.values())},e}(),yt=new(function(){function e(){}return e.prototype.getCompleteChild=function(e){return null},e.prototype.getChildAfterChild=function(e,t,n){return null},e}()),vt=function(){function e(e,t,n){void 0===n&&(n=null),this.writes_=e,this.viewCache_=t,this.optCompleteServerCache_=n}return e.prototype.getCompleteChild=function(e){var t=this.viewCache_.getEventCache();if(t.isCompleteForChild(e))return t.getNode().getImmediateChild(e);var n=null!=this.optCompleteServerCache_?new ct(this.optCompleteServerCache_,!0,!1):this.viewCache_.getServerCache();return this.writes_.calcCompleteChild(e,n)},e.prototype.getChildAfterChild=function(e,t,n){var r=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:this.viewCache_.getCompleteServerSnap(),i=this.writes_.calcIndexedSlice(r,t,1,n,e);return 0===i.length?null:i[0]},e}(),mt=function(){return function(e,t){this.viewCache=e,this.changes=t}}(),gt=function(){function e(e){this.filter_=e}return e.prototype.assertIndexed=function(e){s.assert(e.getEventCache().getNode().isIndexed(this.filter_.getIndex()),"Event snap not indexed"),s.assert(e.getServerCache().getNode().isIndexed(this.filter_.getIndex()),"Server snap not indexed")},e.prototype.applyOperation=function(t,n,r,i){var o,a,l=new ft;if(n.type===Be.OVERWRITE){var u=n;u.source.fromUser?o=this.applyUserOverwrite_(t,u.path,u.snap,r,i,l):(s.assert(u.source.fromServer,"Unknown source."),a=u.source.tagged||t.getServerCache().isFiltered()&&!u.path.isEmpty(),o=this.applyServerOverwrite_(t,u.path,u.snap,r,i,a,l))}else if(n.type===Be.MERGE){var c=n;c.source.fromUser?o=this.applyUserMerge_(t,c.path,c.children,r,i,l):(s.assert(c.source.fromServer,"Unknown source."),a=c.source.tagged||t.getServerCache().isFiltered(),o=this.applyServerMerge_(t,c.path,c.children,r,i,a,l))}else if(n.type===Be.ACK_USER_WRITE){var p=n;o=p.revert?this.revertUserWrite_(t,p.path,r,i,l):this.ackUserWrite_(t,p.path,p.affectedTree,r,i,l)}else{if(n.type!==Be.LISTEN_COMPLETE)throw s.assertionError("Unknown operation type: "+n.type);o=this.listenComplete_(t,n.path,r,l)}var h=l.getChanges();return e.maybeAddValueEvent_(t,o,h),new mt(o,h)},e.maybeAddValueEvent_=function(e,t,n){var r=t.getEventCache();if(r.isFullyInitialized()){var i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=e.getCompleteEventSnap();(n.length>0||!e.getEventCache().isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(ht.valueChange(t.getCompleteEventSnap()))}},e.prototype.generateEventCacheAfterServerEvent_=function(e,t,n,r,i){var o=e.getEventCache();if(null!=n.shadowingWrite(t))return e;var a=void 0,l=void 0;if(t.isEmpty())if(s.assert(e.getServerCache().isFullyInitialized(),"If change path is empty, we must have complete server data"),e.getServerCache().isFiltered()){var u=e.getCompleteServerSnap(),c=u instanceof We?u:We.EMPTY_NODE,p=n.calcCompleteEventChildren(c);a=this.filter_.updateFullNode(e.getEventCache().getNode(),p,i)}else{var h=n.calcCompleteEventCache(e.getCompleteServerSnap());a=this.filter_.updateFullNode(e.getEventCache().getNode(),h,i)}else{var d=t.getFront();if(".priority"==d){s.assert(1==t.getLength(),"Can't have a priority with additional path components");var f=o.getNode();l=e.getServerCache().getNode();var y=n.calcEventCacheAfterServerOverwrite(t,f,l);a=null!=y?this.filter_.updatePriority(f,y):o.getNode()}else{var v=t.popFront(),m=void 0;if(o.isCompleteForChild(d)){l=e.getServerCache().getNode();var g=n.calcEventCacheAfterServerOverwrite(t,o.getNode(),l);m=null!=g?o.getNode().getImmediateChild(d).updateChild(v,g):o.getNode().getImmediateChild(d)}else m=n.calcCompleteChild(d,e.getServerCache());a=null!=m?this.filter_.updateChild(o.getNode(),d,m,v,r,i):o.getNode()}}return e.updateEventSnap(a,o.isFullyInitialized()||t.isEmpty(),this.filter_.filtersNodes())},e.prototype.applyServerOverwrite_=function(e,t,n,r,i,o,a){var s,l=e.getServerCache(),u=o?this.filter_:this.filter_.getIndexedFilter();if(t.isEmpty())s=u.updateFullNode(l.getNode(),n,null);else if(u.filtersNodes()&&!l.isFiltered()){var c=l.getNode().updateChild(t,n);s=u.updateFullNode(l.getNode(),c,null)}else{var p=t.getFront();if(!l.isCompleteForPath(t)&&t.getLength()>1)return e;var h=t.popFront(),d=l.getNode().getImmediateChild(p).updateChild(h,n);s=".priority"==p?u.updatePriority(l.getNode(),d):u.updateChild(l.getNode(),p,d,h,yt,null)}var f=e.updateServerSnap(s,l.isFullyInitialized()||t.isEmpty(),u.filtersNodes()),y=new vt(r,f,i);return this.generateEventCacheAfterServerEvent_(f,t,r,y,a)},e.prototype.applyUserOverwrite_=function(e,t,n,r,i,o){var a,s,l=e.getEventCache(),u=new vt(r,e,i);if(t.isEmpty())s=this.filter_.updateFullNode(e.getEventCache().getNode(),n,o),a=e.updateEventSnap(s,!0,this.filter_.filtersNodes());else{var c=t.getFront();if(".priority"===c)s=this.filter_.updatePriority(e.getEventCache().getNode(),n),a=e.updateEventSnap(s,l.isFullyInitialized(),l.isFiltered());else{var p=t.popFront(),h=l.getNode().getImmediateChild(c),d=void 0;if(p.isEmpty())d=n;else{var f=u.getCompleteChild(c);d=null!=f?".priority"===p.getBack()&&f.getChild(p.parent()).isEmpty()?f:f.updateChild(p,n):We.EMPTY_NODE}if(h.equals(d))a=e;else{var y=this.filter_.updateChild(l.getNode(),c,d,p,u,o);a=e.updateEventSnap(y,l.isFullyInitialized(),this.filter_.filtersNodes())}}}return a},e.cacheHasChild_=function(e,t){return e.getEventCache().isCompleteForChild(t)},e.prototype.applyUserMerge_=function(t,n,r,i,o,a){var s=this,l=t;return r.foreach(function(r,u){var c=n.child(r);e.cacheHasChild_(t,c.getFront())&&(l=s.applyUserOverwrite_(l,c,u,i,o,a))}),r.foreach(function(r,u){var c=n.child(r);e.cacheHasChild_(t,c.getFront())||(l=s.applyUserOverwrite_(l,c,u,i,o,a))}),l},e.prototype.applyMerge_=function(e,t){return t.foreach(function(t,n){e=e.updateChild(t,n)}),e},e.prototype.applyServerMerge_=function(e,t,n,r,i,o,a){var s=this;if(e.getServerCache().getNode().isEmpty()&&!e.getServerCache().isFullyInitialized())return e;var l,u=e;l=t.isEmpty()?n:at.Empty.setTree(t,n);var c=e.getServerCache().getNode();return l.children.inorderTraversal(function(t,n){if(c.hasChild(t)){var l=e.getServerCache().getNode().getImmediateChild(t),p=s.applyMerge_(l,n);u=s.applyServerOverwrite_(u,new j(t),p,r,i,o,a)}}),l.children.inorderTraversal(function(t,n){var l=!e.getServerCache().isCompleteForChild(t)&&null==n.value;if(!c.hasChild(t)&&!l){var p=e.getServerCache().getNode().getImmediateChild(t),h=s.applyMerge_(p,n);u=s.applyServerOverwrite_(u,new j(t),h,r,i,o,a)}}),u},e.prototype.ackUserWrite_=function(e,t,n,r,i,o){if(null!=r.shadowingWrite(t))return e;var a=e.getServerCache().isFiltered(),s=e.getServerCache();if(null!=n.value){if(t.isEmpty()&&s.isFullyInitialized()||s.isCompleteForPath(t))return this.applyServerOverwrite_(e,t,s.getNode().getChild(t),r,i,a,o);if(t.isEmpty()){var l=at.Empty;return s.getNode().forEachChild(me,function(e,t){l=l.set(new j(e),t)}),this.applyServerMerge_(e,t,l,r,i,a,o)}return e}var u=at.Empty;return n.foreach(function(e,n){var r=t.child(e);s.isCompleteForPath(r)&&(u=u.set(e,s.getNode().getChild(r)))}),this.applyServerMerge_(e,t,u,r,i,a,o)},e.prototype.listenComplete_=function(e,t,n,r){var i=e.getServerCache(),o=e.updateServerSnap(i.getNode(),i.isFullyInitialized()||t.isEmpty(),i.isFiltered());return this.generateEventCacheAfterServerEvent_(o,t,n,yt,r)},e.prototype.revertUserWrite_=function(e,t,n,r,i){var o;if(null!=n.shadowingWrite(t))return e;var a=new vt(n,e,r),l=e.getEventCache().getNode(),u=void 0;if(t.isEmpty()||".priority"===t.getFront()){var c=void 0;if(e.getServerCache().isFullyInitialized())c=n.calcCompleteEventCache(e.getCompleteServerSnap());else{var p=e.getServerCache().getNode();s.assert(p instanceof We,"serverChildren would be complete if leaf node"),c=n.calcCompleteEventChildren(p)}c=c,u=this.filter_.updateFullNode(l,c,i)}else{var h=t.getFront(),d=n.calcCompleteChild(h,e.getServerCache());null==d&&e.getServerCache().isCompleteForChild(h)&&(d=l.getImmediateChild(h)),(u=null!=d?this.filter_.updateChild(l,h,d,t.popFront(),a,i):e.getEventCache().getNode().hasChild(h)?this.filter_.updateChild(l,h,We.EMPTY_NODE,t.popFront(),a,i):l).isEmpty()&&e.getServerCache().isFullyInitialized()&&(o=n.calcCompleteEventCache(e.getCompleteServerSnap())).isLeafNode()&&(u=this.filter_.updateFullNode(u,o,i))}return o=e.getServerCache().isFullyInitialized()||null!=n.shadowingWrite(j.Empty),e.updateEventSnap(u,o,this.filter_.filtersNodes())},e}(),_t=function(){function e(e){this.query_=e,this.index_=this.query_.getQueryParams().getIndex()}return e.prototype.generateEventsForChanges=function(e,t,n){var r=this,i=[],o=[];return e.forEach(function(e){e.type===ht.CHILD_CHANGED&&r.index_.indexedValueChanged(e.oldSnap,e.snapshotNode)&&o.push(ht.childMovedChange(e.childName,e.snapshotNode))}),this.generateEventsForType_(i,ht.CHILD_REMOVED,e,n,t),this.generateEventsForType_(i,ht.CHILD_ADDED,e,n,t),this.generateEventsForType_(i,ht.CHILD_MOVED,o,n,t),this.generateEventsForType_(i,ht.CHILD_CHANGED,e,n,t),this.generateEventsForType_(i,ht.VALUE,e,n,t),i},e.prototype.generateEventsForType_=function(e,t,n,r,i){var o=this,a=n.filter(function(e){return e.type===t});a.sort(this.compareChanges_.bind(this)),a.forEach(function(t){var n=o.materializeSingleChange_(t,i);r.forEach(function(r){r.respondsTo(t.type)&&e.push(r.createEvent(n,o.query_))})})},e.prototype.materializeSingleChange_=function(e,t){return"value"===e.type||"child_removed"===e.type?e:(e.prevName=t.getPredecessorChildName(e.childName,e.snapshotNode,this.index_),e)},e.prototype.compareChanges_=function(e,t){if(null==e.childName||null==t.childName)throw s.assertionError("Should only compare child_ events.");var n=new fe(e.childName,e.snapshotNode),r=new fe(t.childName,t.snapshotNode);return this.index_.compare(n,r)},e}(),bt=function(){function e(e,t){this.query_=e,this.eventRegistrations_=[];var n=this.query_.getQueryParams(),r=new dt(n.getIndex()),i=n.getNodeFilter();this.processor_=new gt(i);var o=t.getServerCache(),a=t.getEventCache(),s=r.updateFullNode(We.EMPTY_NODE,o.getNode(),null),l=i.updateFullNode(We.EMPTY_NODE,a.getNode(),null),u=new ct(s,o.isFullyInitialized(),r.filtersNodes()),c=new ct(l,a.isFullyInitialized(),i.filtersNodes());this.viewCache_=new pt(c,u),this.eventGenerator_=new _t(this.query_)}return e.prototype.getQuery=function(){return this.query_},e.prototype.getServerCache=function(){return this.viewCache_.getServerCache().getNode()},e.prototype.getCompleteServerCache=function(e){var t=this.viewCache_.getCompleteServerSnap();return t&&(this.query_.getQueryParams().loadsAllData()||!e.isEmpty()&&!t.getImmediateChild(e.getFront()).isEmpty())?t.getChild(e):null},e.prototype.isEmpty=function(){return 0===this.eventRegistrations_.length},e.prototype.addEventRegistration=function(e){this.eventRegistrations_.push(e)},e.prototype.removeEventRegistration=function(e,t){var n=[];if(t){s.assert(null==e,"A cancel should cancel all event registrations.");var r=this.query_.path;this.eventRegistrations_.forEach(function(e){t=t;var i=e.createCancelEvent(t,r);i&&n.push(i)})}if(e){for(var i=[],o=0;o<this.eventRegistrations_.length;++o){var a=this.eventRegistrations_[o];if(a.matches(e)){if(e.hasAnyCallback()){i=i.concat(this.eventRegistrations_.slice(o+1));break}}else i.push(a)}this.eventRegistrations_=i}else this.eventRegistrations_=[];return n},e.prototype.applyOperation=function(e,t,n){e.type===Be.MERGE&&null!==e.source.queryId&&(s.assert(this.viewCache_.getCompleteServerSnap(),"We should always have a full cache before handling merges"),s.assert(this.viewCache_.getCompleteEventSnap(),"Missing event cache, even though we have a server cache"));var r=this.viewCache_,i=this.processor_.applyOperation(r,e,t,n);return this.processor_.assertIndexed(i.viewCache),s.assert(i.viewCache.getServerCache().isFullyInitialized()||!r.getServerCache().isFullyInitialized(),"Once a server snap is complete, it should never go back"),this.viewCache_=i.viewCache,this.generateEventsForChanges_(i.changes,i.viewCache.getEventCache().getNode(),null)},e.prototype.getInitialEvents=function(e){var t=this.viewCache_.getEventCache(),n=[];t.getNode().isLeafNode()||t.getNode().forEachChild(ke,function(e,t){n.push(ht.childAddedChange(e,t))});return t.isFullyInitialized()&&n.push(ht.valueChange(t.getNode())),this.generateEventsForChanges_(n,t.getNode(),e)},e.prototype.generateEventsForChanges_=function(e,t,n){var r=n?[n]:this.eventRegistrations_;return this.eventGenerator_.generateEventsForChanges(e,t,r)},e}(),wt=function(){function e(){this.views=new Map}return Object.defineProperty(e,"__referenceConstructor",{get:function(){return s.assert(nt,"Reference.ts has not been loaded"),nt},set:function(e){s.assert(!nt,"__referenceConstructor has already been defined"),nt=e},enumerable:!0,configurable:!0}),e.prototype.isEmpty=function(){return 0===this.views.size},e.prototype.applyOperation=function(e,t,n){var r,i,o=e.source.queryId;if(null!==o){var l=this.views.get(o);return s.assert(null!=l,"SyncTree gave us an op for an invalid query."),l.applyOperation(e,t,n)}var u=[];try{for(var c=a.__values(this.views.values()),p=c.next();!p.done;p=c.next()){l=p.value;u=u.concat(l.applyOperation(e,t,n))}}catch(h){r={error:h}}finally{try{p&&!p.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return u},e.prototype.addEventRegistration=function(e,t,n,r,i){var o=e.queryIdentifier(),a=this.views.get(o);if(!a){var s=n.calcCompleteEventCache(i?r:null),l=!1;s?l=!0:r instanceof We?(s=n.calcCompleteEventChildren(r),l=!1):(s=We.EMPTY_NODE,l=!1);var u=new pt(new ct(s,l,!1),new ct(r,i,!1));a=new bt(e,u),this.views.set(o,a)}return a.addEventRegistration(t),a.getInitialEvents(t)},e.prototype.removeEventRegistration=function(t,n,r){var i,o,s=t.queryIdentifier(),l=[],u=[],c=this.hasCompleteView();if("default"===s)try{for(var p=a.__values(this.views.entries()),h=p.next();!h.done;h=p.next()){var d=a.__read(h.value,2),f=d[0],y=d[1];u=u.concat(y.removeEventRegistration(n,r)),y.isEmpty()&&(this.views.delete(f),y.getQuery().getQueryParams().loadsAllData()||l.push(y.getQuery()))}}catch(v){i={error:v}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}else(y=this.views.get(s))&&(u=u.concat(y.removeEventRegistration(n,r)),y.isEmpty()&&(this.views.delete(s),y.getQuery().getQueryParams().loadsAllData()||l.push(y.getQuery())));return c&&!this.hasCompleteView()&&l.push(new e.__referenceConstructor(t.repo,t.path)),{removed:l,events:u}},e.prototype.getQueryViews=function(){var e,t,n=[];try{for(var r=a.__values(this.views.values()),i=r.next();!i.done;i=r.next()){var o=i.value;o.getQuery().getQueryParams().loadsAllData()||n.push(o)}}catch(s){e={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return n},e.prototype.getCompleteServerCache=function(e){var t,n,r=null;try{for(var i=a.__values(this.views.values()),o=i.next();!o.done;o=i.next()){var s=o.value;r=r||s.getCompleteServerCache(e)}}catch(l){t={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r},e.prototype.viewForQuery=function(e){if(e.getQueryParams().loadsAllData())return this.getCompleteView();var t=e.queryIdentifier();return this.views.get(t)},e.prototype.viewExistsForQuery=function(e){return null!=this.viewForQuery(e)},e.prototype.hasCompleteView=function(){return null!=this.getCompleteView()},e.prototype.getCompleteView=function(){var e,t;try{for(var n=a.__values(this.views.values()),r=n.next();!r.done;r=n.next()){var i=r.value;if(i.getQuery().getQueryParams().loadsAllData())return i}}catch(o){e={error:o}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return null},e}(),Et=function(){function e(e){this.writeTree_=e}return e.prototype.addWrite=function(t,n){if(t.isEmpty())return new e(new at(n));var r=this.writeTree_.findRootMostValueAndPath(t);if(null!=r){var i=r.path,o=r.value,a=j.relativePath(i,t);return o=o.updateChild(a,n),new e(this.writeTree_.set(i,o))}var s=new at(n);return new e(this.writeTree_.setTree(t,s))},e.prototype.addWrites=function(e,t){var n=this;return A(t,function(t,r){n=n.addWrite(e.child(t),r)}),n},e.prototype.removeWrite=function(t){return t.isEmpty()?e.Empty:new e(this.writeTree_.setTree(t,at.Empty))},e.prototype.hasCompleteWrite=function(e){return null!=this.getCompleteNode(e)},e.prototype.getCompleteNode=function(e){var t=this.writeTree_.findRootMostValueAndPath(e);return null!=t?this.writeTree_.get(t.path).getChild(j.relativePath(t.path,e)):null},e.prototype.getCompleteChildren=function(){var e=[],t=this.writeTree_.value;return null!=t?t.isLeafNode()||t.forEachChild(ke,function(t,n){e.push(new fe(t,n))}):this.writeTree_.children.inorderTraversal(function(t,n){null!=n.value&&e.push(new fe(t,n.value))}),e},e.prototype.childCompoundWrite=function(t){if(t.isEmpty())return this;var n=this.getCompleteNode(t);return new e(null!=n?new at(n):this.writeTree_.subtree(t))},e.prototype.isEmpty=function(){return this.writeTree_.isEmpty()},e.prototype.apply=function(e){return function e(t,n,r){if(null!=n.value)return r.updateChild(t,n.value);var i=null;return n.children.inorderTraversal(function(n,o){".priority"===n?(s.assert(null!==o.value,"Priority writes must always be leaf nodes"),i=o.value):r=e(t.child(n),o,r)}),r.getChild(t).isEmpty()||null===i||(r=r.updateChild(t.child(".priority"),i)),r}(j.Empty,this.writeTree_,e)},e.Empty=new e(new at(null)),e}();var Ct=function(){function e(){this.visibleWrites_=Et.Empty,this.allWrites_=[],this.lastWriteId_=-1}return e.prototype.childWrites=function(e){return new Tt(e,this)},e.prototype.addOverwrite=function(e,t,n,r){s.assert(n>this.lastWriteId_,"Stacking an older write on top of newer ones"),void 0===r&&(r=!0),this.allWrites_.push({path:e,snap:t,writeId:n,visible:r}),r&&(this.visibleWrites_=this.visibleWrites_.addWrite(e,t)),this.lastWriteId_=n},e.prototype.addMerge=function(e,t,n){s.assert(n>this.lastWriteId_,"Stacking an older merge on top of newer ones"),this.allWrites_.push({path:e,children:t,writeId:n,visible:!0}),this.visibleWrites_=this.visibleWrites_.addWrites(e,t),this.lastWriteId_=n},e.prototype.getWrite=function(e){for(var t=0;t<this.allWrites_.length;t++){var n=this.allWrites_[t];if(n.writeId===e)return n}return null},e.prototype.removeWrite=function(e){var t=this,n=this.allWrites_.findIndex(function(t){return t.writeId===e});s.assert(n>=0,"removeWrite called with nonexistent writeId.");var r=this.allWrites_[n];this.allWrites_.splice(n,1);for(var i=r.visible,o=!1,a=this.allWrites_.length-1;i&&a>=0;){var l=this.allWrites_[a];l.visible&&(a>=n&&this.recordContainsPath_(l,r.path)?i=!1:r.path.contains(l.path)&&(o=!0)),a--}if(i){if(o)return this.resetTree_(),!0;r.snap?this.visibleWrites_=this.visibleWrites_.removeWrite(r.path):A(r.children,function(e){t.visibleWrites_=t.visibleWrites_.removeWrite(r.path.child(e))});return!0}return!1},e.prototype.getCompleteWriteData=function(e){return this.visibleWrites_.getCompleteNode(e)},e.prototype.calcCompleteEventCache=function(t,n,r,i){if(r||i){var o=this.visibleWrites_.childCompoundWrite(t);if(!i&&o.isEmpty())return n;if(i||null!=n||o.hasCompleteWrite(j.Empty)){var a=e.layerTree_(this.allWrites_,function(e){return(e.visible||i)&&(!r||!~r.indexOf(e.writeId))&&(e.path.contains(t)||t.contains(e.path))},t);u=n||We.EMPTY_NODE;return a.apply(u)}return null}var s=this.visibleWrites_.getCompleteNode(t);if(null!=s)return s;var l=this.visibleWrites_.childCompoundWrite(t);if(l.isEmpty())return n;if(null!=n||l.hasCompleteWrite(j.Empty)){var u=n||We.EMPTY_NODE;return l.apply(u)}return null},e.prototype.calcCompleteEventChildren=function(e,t){var n=We.EMPTY_NODE,r=this.visibleWrites_.getCompleteNode(e);if(r)return r.isLeafNode()||r.forEachChild(ke,function(e,t){n=n.updateImmediateChild(e,t)}),n;if(t){var i=this.visibleWrites_.childCompoundWrite(e);return t.forEachChild(ke,function(e,t){var r=i.childCompoundWrite(new j(e)).apply(t);n=n.updateImmediateChild(e,r)}),i.getCompleteChildren().forEach(function(e){n=n.updateImmediateChild(e.name,e.node)}),n}return this.visibleWrites_.childCompoundWrite(e).getCompleteChildren().forEach(function(e){n=n.updateImmediateChild(e.name,e.node)}),n},e.prototype.calcEventCacheAfterServerOverwrite=function(e,t,n,r){s.assert(n||r,"Either existingEventSnap or existingServerSnap must exist");var i=e.child(t);if(this.visibleWrites_.hasCompleteWrite(i))return null;var o=this.visibleWrites_.childCompoundWrite(i);return o.isEmpty()?r.getChild(t):o.apply(r.getChild(t))},e.prototype.calcCompleteChild=function(e,t,n){var r=e.child(t),i=this.visibleWrites_.getCompleteNode(r);return null!=i?i:n.isCompleteForChild(t)?this.visibleWrites_.childCompoundWrite(r).apply(n.getNode().getImmediateChild(t)):null},e.prototype.shadowingWrite=function(e){return this.visibleWrites_.getCompleteNode(e)},e.prototype.calcIndexedSlice=function(e,t,n,r,i,o){var a,s=this.visibleWrites_.childCompoundWrite(e),l=s.getCompleteNode(j.Empty);if(null!=l)a=l;else{if(null==t)return[];a=s.apply(t)}if((a=a.withIndex(o)).isEmpty()||a.isLeafNode())return[];for(var u=[],c=o.getCompare(),p=i?a.getReverseIteratorFrom(n,o):a.getIteratorFrom(n,o),h=p.getNext();h&&u.length<r;)0!==c(h,n)&&u.push(h),h=p.getNext();return u},e.prototype.recordContainsPath_=function(e,t){if(e.snap)return e.path.contains(t);for(var n in e.children)if(e.children.hasOwnProperty(n)&&e.path.child(n).contains(t))return!0;return!1},e.prototype.resetTree_=function(){this.visibleWrites_=e.layerTree_(this.allWrites_,e.DefaultFilter_,j.Empty),this.allWrites_.length>0?this.lastWriteId_=this.allWrites_[this.allWrites_.length-1].writeId:this.lastWriteId_=-1},e.DefaultFilter_=function(e){return e.visible},e.layerTree_=function(e,t,n){for(var r=Et.Empty,i=0;i<e.length;++i){var o=e[i];if(t(o)){var a=o.path,l=void 0;if(o.snap)n.contains(a)?(l=j.relativePath(n,a),r=r.addWrite(l,o.snap)):a.contains(n)&&(l=j.relativePath(a,n),r=r.addWrite(j.Empty,o.snap.getChild(l)));else{if(!o.children)throw s.assertionError("WriteRecord should have .snap or .children");if(n.contains(a))l=j.relativePath(n,a),r=r.addWrites(l,o.children);else if(a.contains(n))if((l=j.relativePath(a,n)).isEmpty())r=r.addWrites(j.Empty,o.children);else{var u=s.safeGet(o.children,l.getFront());if(u){var c=u.getChild(l.popFront());r=r.addWrite(j.Empty,c)}}}}}return r},e}(),Tt=function(){function e(e,t){this.treePath_=e,this.writeTree_=t}return e.prototype.calcCompleteEventCache=function(e,t,n){return this.writeTree_.calcCompleteEventCache(this.treePath_,e,t,n)},e.prototype.calcCompleteEventChildren=function(e){return this.writeTree_.calcCompleteEventChildren(this.treePath_,e)},e.prototype.calcEventCacheAfterServerOverwrite=function(e,t,n){return this.writeTree_.calcEventCacheAfterServerOverwrite(this.treePath_,e,t,n)},e.prototype.shadowingWrite=function(e){return this.writeTree_.shadowingWrite(this.treePath_.child(e))},e.prototype.calcIndexedSlice=function(e,t,n,r,i){return this.writeTree_.calcIndexedSlice(this.treePath_,e,t,n,r,i)},e.prototype.calcCompleteChild=function(e,t){return this.writeTree_.calcCompleteChild(this.treePath_,e,t)},e.prototype.child=function(t){return new e(this.treePath_.child(t),this.writeTree_)},e}(),St=function(){function e(e){this.listenProvider_=e,this.syncPointTree_=at.Empty,this.pendingWriteTree_=new Ct,this.tagToQueryMap=new Map,this.queryToTagMap=new Map}return e.prototype.applyUserOverwrite=function(e,t,n,r){return this.pendingWriteTree_.addOverwrite(e,t,n,r),r?this.applyOperationToSyncPoints_(new lt(rt.User,e,t)):[]},e.prototype.applyUserMerge=function(e,t,n){this.pendingWriteTree_.addMerge(e,t,n);var r=at.fromObject(t);return this.applyOperationToSyncPoints_(new ut(rt.User,e,r))},e.prototype.ackUserWrite=function(e,t){void 0===t&&(t=!1);var n=this.pendingWriteTree_.getWrite(e);if(this.pendingWriteTree_.removeWrite(e)){var r=at.Empty;return null!=n.snap?r=r.set(j.Empty,!0):A(n.children,function(e,t){r=r.set(new j(e),t)}),this.applyOperationToSyncPoints_(new it(n.path,r,t))}return[]},e.prototype.applyServerOverwrite=function(e,t){return this.applyOperationToSyncPoints_(new lt(rt.Server,e,t))},e.prototype.applyServerMerge=function(e,t){var n=at.fromObject(t);return this.applyOperationToSyncPoints_(new ut(rt.Server,e,n))},e.prototype.applyListenComplete=function(e){return this.applyOperationToSyncPoints_(new st(rt.Server,e))},e.prototype.applyTaggedQueryOverwrite=function(t,n,r){var i=this.queryKeyForTag_(r);if(null!=i){var o=e.parseQueryKey_(i),a=o.path,s=o.queryId,l=j.relativePath(a,t),u=new lt(rt.forServerTaggedQuery(s),l,n);return this.applyTaggedOperation_(a,u)}return[]},e.prototype.applyTaggedQueryMerge=function(t,n,r){var i=this.queryKeyForTag_(r);if(i){var o=e.parseQueryKey_(i),a=o.path,s=o.queryId,l=j.relativePath(a,t),u=at.fromObject(n),c=new ut(rt.forServerTaggedQuery(s),l,u);return this.applyTaggedOperation_(a,c)}return[]},e.prototype.applyTaggedListenComplete=function(t,n){var r=this.queryKeyForTag_(n);if(r){var i=e.parseQueryKey_(r),o=i.path,a=i.queryId,s=j.relativePath(o,t),l=new st(rt.forServerTaggedQuery(a),s);return this.applyTaggedOperation_(o,l)}return[]},e.prototype.addEventRegistration=function(t,n){var r=t.path,i=null,o=!1;this.syncPointTree_.foreachOnPath(r,function(e,t){var n=j.relativePath(e,r);i=i||t.getCompleteServerCache(n),o=o||t.hasCompleteView()});var a,l=this.syncPointTree_.get(r);(l?(o=o||l.hasCompleteView(),i=i||l.getCompleteServerCache(j.Empty)):(l=new wt,this.syncPointTree_=this.syncPointTree_.set(r,l)),null!=i)?a=!0:(a=!1,i=We.EMPTY_NODE,this.syncPointTree_.subtree(r).foreachChild(function(e,t){var n=t.getCompleteServerCache(j.Empty);n&&(i=i.updateImmediateChild(e,n))}));var u=l.viewExistsForQuery(t);if(!u&&!t.getQueryParams().loadsAllData()){var c=e.makeQueryKey_(t);s.assert(!this.queryToTagMap.has(c),"View does not exist, but we have a tag");var p=e.getNextQueryTag_();this.queryToTagMap.set(c,p),this.tagToQueryMap.set(p,c)}var h=this.pendingWriteTree_.childWrites(r),d=l.addEventRegistration(t,n,h,i,a);if(!u&&!o){var f=l.viewForQuery(t);d=d.concat(this.setupListener_(t,f))}return d},e.prototype.removeEventRegistration=function(t,n,r){var i=this,o=t.path,a=this.syncPointTree_.get(o),s=[];if(a&&("default"===t.queryIdentifier()||a.viewExistsForQuery(t))){var l=a.removeEventRegistration(t,n,r);a.isEmpty()&&(this.syncPointTree_=this.syncPointTree_.remove(o));var u=l.removed;s=l.events;var c=-1!==u.findIndex(function(e){return e.getQueryParams().loadsAllData()}),p=this.syncPointTree_.findOnPath(o,function(e,t){return t.hasCompleteView()});if(c&&!p){var h=this.syncPointTree_.subtree(o);if(!h.isEmpty())for(var d=this.collectDistinctViewsForSubTree_(h),f=0;f<d.length;++f){var y=d[f],v=y.getQuery(),m=this.createListenerForView_(y);this.listenProvider_.startListening(e.queryForListening_(v),this.tagForQuery_(v),m.hashFn,m.onComplete)}}if(!p&&u.length>0&&!r)if(c){this.listenProvider_.stopListening(e.queryForListening_(t),null)}else u.forEach(function(t){var n=i.queryToTagMap.get(e.makeQueryKey_(t));i.listenProvider_.stopListening(e.queryForListening_(t),n)});this.removeTags_(u)}return s},e.prototype.calcCompleteEventCache=function(e,t){var n=this.pendingWriteTree_,r=this.syncPointTree_.findOnPath(e,function(t,n){var r=j.relativePath(t,e),i=n.getCompleteServerCache(r);if(i)return i});return n.calcCompleteEventCache(e,r,t,!0)},e.prototype.collectDistinctViewsForSubTree_=function(e){return e.fold(function(e,t,n){if(t&&t.hasCompleteView())return[t.getCompleteView()];var r=[];return t&&(r=t.getQueryViews()),A(n,function(e,t){r=r.concat(t)}),r})},e.prototype.removeTags_=function(t){for(var n=0;n<t.length;++n){var r=t[n];if(!r.getQueryParams().loadsAllData()){var i=e.makeQueryKey_(r),o=this.queryToTagMap.get(i);this.queryToTagMap.delete(i),this.tagToQueryMap.delete(o)}}},e.queryForListening_=function(e){return e.getQueryParams().loadsAllData()&&!e.getQueryParams().isDefault()?e.getRef():e},e.prototype.setupListener_=function(t,n){var r=t.path,i=this.tagForQuery_(t),o=this.createListenerForView_(n),a=this.listenProvider_.startListening(e.queryForListening_(t),i,o.hashFn,o.onComplete),l=this.syncPointTree_.subtree(r);if(i)s.assert(!l.value.hasCompleteView(),"If we're adding a query, it shouldn't be shadowed");else for(var u=l.fold(function(e,t,n){if(!e.isEmpty()&&t&&t.hasCompleteView())return[t.getCompleteView().getQuery()];var r=[];return t&&(r=r.concat(t.getQueryViews().map(function(e){return e.getQuery()}))),A(n,function(e,t){r=r.concat(t)}),r}),c=0;c<u.length;++c){var p=u[c];this.listenProvider_.stopListening(e.queryForListening_(p),this.tagForQuery_(p))}return a},e.prototype.createListenerForView_=function(e){var t=this,n=e.getQuery(),r=this.tagForQuery_(n);return{hashFn:function(){return(e.getServerCache()||We.EMPTY_NODE).hash()},onComplete:function(e){if("ok"===e)return r?t.applyTaggedListenComplete(n.path,r):t.applyListenComplete(n.path);var i=function(e,t){var n="Unknown Error";"too_big"===e?n="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"==e?n="Client doesn't have permission to access the desired data.":"unavailable"==e&&(n="The service is unavailable");var r=new Error(e+" at "+t.path.toString()+": "+n);return r.code=e.toUpperCase(),r}(e,n);return t.removeEventRegistration(n,null,i)}}},e.makeQueryKey_=function(e){return e.path.toString()+"$"+e.queryIdentifier()},e.parseQueryKey_=function(e){var t=e.indexOf("$");return s.assert(-1!==t&&t<e.length-1,"Bad queryKey."),{queryId:e.substr(t+1),path:new j(e.substr(0,t))}},e.prototype.queryKeyForTag_=function(e){return this.tagToQueryMap.get(e)},e.prototype.tagForQuery_=function(t){var n=e.makeQueryKey_(t);return this.queryToTagMap.get(n)},e.getNextQueryTag_=function(){return e.nextQueryTag_++},e.prototype.applyTaggedOperation_=function(e,t){var n=this.syncPointTree_.get(e);s.assert(n,"Missing sync point for query tag that we're tracking");var r=this.pendingWriteTree_.childWrites(e);return n.applyOperation(t,r,null)},e.prototype.applyOperationToSyncPoints_=function(e){return this.applyOperationHelper_(e,this.syncPointTree_,null,this.pendingWriteTree_.childWrites(j.Empty))},e.prototype.applyOperationHelper_=function(e,t,n,r){if(e.path.isEmpty())return this.applyOperationDescendantsHelper_(e,t,n,r);var i=t.get(j.Empty);null==n&&null!=i&&(n=i.getCompleteServerCache(j.Empty));var o=[],a=e.path.getFront(),s=e.operationForChild(a),l=t.children.get(a);if(l&&s){var u=n?n.getImmediateChild(a):null,c=r.child(a);o=o.concat(this.applyOperationHelper_(s,l,u,c))}return i&&(o=o.concat(i.applyOperation(e,r,n))),o},e.prototype.applyOperationDescendantsHelper_=function(e,t,n,r){var i=this,o=t.get(j.Empty);null==n&&null!=o&&(n=o.getCompleteServerCache(j.Empty));var a=[];return t.children.inorderTraversal(function(t,o){var s=n?n.getImmediateChild(t):null,l=r.child(t),u=e.operationForChild(t);u&&(a=a.concat(i.applyOperationDescendantsHelper_(u,o,s,l)))}),o&&(a=a.concat(o.applyOperation(e,r,n))),a},e.nextQueryTag_=1,e}(),kt=function(){function e(){this.rootNode_=We.EMPTY_NODE}return e.prototype.getNode=function(e){return this.rootNode_.getChild(e)},e.prototype.updateSnapshot=function(e,t){this.rootNode_=this.rootNode_.updateChild(e,t)},e}(),xt=function(){function e(e){this.app_=e}return e.prototype.getToken=function(e){return this.app_.INTERNAL.getToken(e).then(null,function(e){return e&&"auth/token-not-initialized"===e.code?(w("Got auth/token-not-initialized error.  Treating as null token."),null):Promise.reject(e)})},e.prototype.addTokenChangeListener=function(e){this.app_.INTERNAL.addAuthTokenListener(e)},e.prototype.removeTokenChangeListener=function(e){this.app_.INTERNAL.removeAuthTokenListener(e)},e.prototype.notifyForInvalidToken=function(){var e='Provided authentication credentials for the app named "'+this.app_.name+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.app_.options?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.app_.options?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',S(e)},e}(),Nt=function(){function e(){this.counters_={}}return e.prototype.incrementCounter=function(e,t){void 0===t&&(t=1),s.contains(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=t},e.prototype.get=function(){return s.deepCopy(this.counters_)},e}(),Pt=function(){function e(){}return e.getCollection=function(e){var t=e.toString();return this.collections_[t]||(this.collections_[t]=new Nt),this.collections_[t]},e.getOrCreateReporter=function(e,t){var n=e.toString();return this.reporters_[n]||(this.reporters_[n]=t()),this.reporters_[n]},e.collections_={},e.reporters_={},e}(),Rt=function(){function e(e){this.collection_=e,this.last_=null}return e.prototype.get=function(){var e=this.collection_.get(),t=a.__assign({},e);return this.last_&&A(this.last_,function(e,n){t[e]=t[e]-n}),this.last_=e,t},e}(),Ot=1e4,It=3e4,Dt=function(){function e(e,t){this.server_=t,this.statsToReport_={},this.statsListener_=new Rt(e);var n=Ot+(It-Ot)*Math.random();V(this.reportStats_.bind(this),Math.floor(n))}return e.prototype.includeStat=function(e){this.statsToReport_[e]=!0},e.prototype.reportStats_=function(){var e=this,t=this.statsListener_.get(),n={},r=!1;A(t,function(t,i){i>0&&s.contains(e.statsToReport_,t)&&(n[t]=i,r=!0)}),r&&this.server_.reportStats(n),V(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))},e}(),At=function(){function e(){this.eventLists_=[],this.recursionDepth_=0}return e.prototype.queueEvents=function(e){for(var t=null,n=0;n<e.length;n++){var r=e[n],i=r.getPath();null===t||i.equals(t.getPath())||(this.eventLists_.push(t),t=null),null===t&&(t=new Ft(i)),t.add(r)}t&&this.eventLists_.push(t)},e.prototype.raiseEventsAtPath=function(e,t){this.queueEvents(t),this.raiseQueuedEventsMatchingPredicate_(function(t){return t.equals(e)})},e.prototype.raiseEventsForChangedPath=function(e,t){this.queueEvents(t),this.raiseQueuedEventsMatchingPredicate_(function(t){return t.contains(e)||e.contains(t)})},e.prototype.raiseQueuedEventsMatchingPredicate_=function(e){this.recursionDepth_++;for(var t=!0,n=0;n<this.eventLists_.length;n++){var r=this.eventLists_[n];if(r)e(r.getPath())?(this.eventLists_[n].raise(),this.eventLists_[n]=null):t=!1}t&&(this.eventLists_=[]),this.recursionDepth_--},e}(),Ft=function(){function e(e){this.path_=e,this.events_=[]}return e.prototype.add=function(e){this.events_.push(e)},e.prototype.raise=function(){for(var e=0;e<this.events_.length;e++){var t=this.events_[e];if(null!==t){this.events_[e]=null;var n=t.getEventRunner();g&&w("event: "+t.toString()),W(n)}}},e.prototype.getPath=function(){return this.path_},e}(),Mt=function(){function e(e){this.allowedEvents_=e,this.listeners_={},s.assert(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}return e.prototype.trigger=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Array.isArray(this.listeners_[e]))for(var r=a.__spread(this.listeners_[e]),i=0;i<r.length;i++)r[i].callback.apply(r[i].context,t)},e.prototype.on=function(e,t,n){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:t,context:n});var r=this.getInitialEvent(e);r&&t.apply(n,r)},e.prototype.off=function(e,t,n){this.validateEventType_(e);for(var r=this.listeners_[e]||[],i=0;i<r.length;i++)if(r[i].callback===t&&(!n||n===r[i].context))return void r.splice(i,1)},e.prototype.validateEventType_=function(e){s.assert(this.allowedEvents_.find(function(t){return t===e}),"Unknown event: "+e)},e}(),Lt=function(e){function t(){var t,n,r=e.call(this,["visible"])||this;return"undefined"!==typeof document&&"undefined"!==typeof document.addEventListener&&("undefined"!==typeof document.hidden?(n="visibilitychange",t="hidden"):"undefined"!==typeof document.mozHidden?(n="mozvisibilitychange",t="mozHidden"):"undefined"!==typeof document.msHidden?(n="msvisibilitychange",t="msHidden"):"undefined"!==typeof document.webkitHidden&&(n="webkitvisibilitychange",t="webkitHidden")),r.visible_=!0,n&&document.addEventListener(n,function(){var e=!document[t];e!==r.visible_&&(r.visible_=e,r.trigger("visible",e))},!1),r}return a.__extends(t,e),t.getInstance=function(){return new t},t.prototype.getInitialEvent=function(e){return s.assert("visible"===e,"Unknown event type: "+e),[this.visible_]},t}(Mt),Wt=function(e){function t(){var t=e.call(this,["online"])||this;return t.online_=!0,"undefined"===typeof window||"undefined"===typeof window.addEventListener||s.isMobileCordova()||(window.addEventListener("online",function(){t.online_||(t.online_=!0,t.trigger("online",!0))},!1),window.addEventListener("offline",function(){t.online_&&(t.online_=!1,t.trigger("online",!1))},!1)),t}return a.__extends(t,e),t.getInstance=function(){return new t},t.prototype.getInitialEvent=function(e){return s.assert("online"===e,"Unknown event type: "+e),[this.online_]},t.prototype.currentlyOnline=function(){return this.online_},t}(Mt),Ut=function(){function e(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}return e.prototype.closeAfter=function(e,t){this.closeAfterResponse=e,this.onClose=t,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)},e.prototype.handleResponse=function(e,t){var n=this;this.pendingResponses[e]=t;for(var r=function(){var e=i.pendingResponses[i.currentResponseNum];delete i.pendingResponses[i.currentResponseNum];for(var t=function(t){e[t]&&W(function(){n.onMessage_(e[t])})},r=0;r<e.length;++r)t(r);if(i.currentResponseNum===i.closeAfterResponse)return i.onClose&&(i.onClose(),i.onClose=null),"break";i.currentResponseNum++},i=this;this.pendingResponses[this.currentResponseNum];){if("break"===r())break}},e}(),Vt="pLPCommand",jt="pRTLPCB",zt=function(){function e(e,t,n,r){this.connId=e,this.repoInfo=t,this.transportSessionId=n,this.lastSessionId=r,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=E(e),this.stats_=Pt.getCollection(t),this.urlFn=function(e){return t.connectionURL(B,e)}}return e.prototype.open=function(e,t){var n=this;this.curSegmentNum=0,this.onDisconnect_=t,this.myPacketOrderer=new Ut(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(function(){n.log_("Timed out trying to connect."),n.onClosed_(),n.connectTimeoutTimer_=null},Math.floor(3e4)),function(e){if(s.isNodeSdk()||"complete"===document.readyState)e();else{var t=!1,n=function n(){document.body?t||(t=!0,e()):setTimeout(n,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&n()}),window.attachEvent("onload",n))}}(function(){if(!n.isClosed_){n.scriptTagHolder=new Bt(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=a.__read(e,5),i=r[0],o=r[1],s=r[2];r[3],r[4];if(n.incrementIncomingBytes_(e),n.scriptTagHolder)if(n.connectTimeoutTimer_&&(clearTimeout(n.connectTimeoutTimer_),n.connectTimeoutTimer_=null),n.everConnected_=!0,"start"==i)n.id=o,n.password=s;else{if("close"!==i)throw new Error("Unrecognized command received: "+i);o?(n.scriptTagHolder.sendNewPolls=!1,n.myPacketOrderer.closeAfter(o,function(){n.onClosed_()})):n.onClosed_()}},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=a.__read(e,2),i=r[0],o=r[1];n.incrementIncomingBytes_(e),n.myPacketOrderer.handleResponse(i,o)},function(){n.onClosed_()},n.urlFn);var e={start:"t"};e.ser=Math.floor(1e8*Math.random()),n.scriptTagHolder.uniqueCallbackIdentifier&&(e.cb=n.scriptTagHolder.uniqueCallbackIdentifier),e.v="5",n.transportSessionId&&(e.s=n.transportSessionId),n.lastSessionId&&(e.ls=n.lastSessionId),!s.isNodeSdk()&&"undefined"!==typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(e.r="f");var t=n.urlFn(e);n.log_("Connecting via long-poll to "+t),n.scriptTagHolder.addTag(t,function(){})}})},e.prototype.start=function(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)},e.forceAllow=function(){e.forceAllow_=!0},e.forceDisallow=function(){e.forceDisallow_=!0},e.isAvailable=function(){return e.forceAllow_||!e.forceDisallow_&&"undefined"!==typeof document&&null!=document.createElement&&!("object"===typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))&&!("object"===typeof Windows&&"object"===typeof Windows.UI)&&!s.isNodeSdk()},e.prototype.markConnectionHealthy=function(){},e.prototype.shutdown_=function(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)},e.prototype.onClosed_=function(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))},e.prototype.close=function(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())},e.prototype.send=function(e){var t=s.stringify(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);for(var n=s.base64Encode(t),r=D(n,1840),i=0;i<r.length;i++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,r.length,r[i]),this.curSegmentNum++},e.prototype.addDisconnectPingFrame=function(e,t){if(!s.isNodeSdk()){this.myDisconnFrame=document.createElement("iframe");var n={dframe:"t"};n.id=e,n.pw=t,this.myDisconnFrame.src=this.urlFn(n),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}},e.prototype.incrementIncomingBytes_=function(e){var t=s.stringify(e).length;this.bytesReceived+=t,this.stats_.incrementCounter("bytes_received",t)},e}(),Bt=function(){function e(t,n,r,i){if(this.onDisconnect=r,this.urlFn=i,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(1e8*Math.random()),this.sendNewPolls=!0,s.isNodeSdk())this.commandCB=t,this.onMessageCB=n;else{this.uniqueCallbackIdentifier=y(),window[Vt+this.uniqueCallbackIdentifier]=t,window[jt+this.uniqueCallbackIdentifier]=n,this.myIFrame=e.createIFrame_();var o="";if(this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,"javascript:".length))o='<script>document.domain="'+document.domain+'";<\/script>';var a="<html><body>"+o+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(a),this.myIFrame.doc.close()}catch(l){w("frame writing exception"),l.stack&&w(l.stack),w(l)}}}return e.createIFrame_=function(){var e=document.createElement("iframe");if(e.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(e);try{e.contentWindow.document||w("No IE domain setting required")}catch(n){var t=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+t+"';document.close();})())"}return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e},e.prototype.close=function(){var t=this;if(this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.innerHTML="",setTimeout(function(){null!==t.myIFrame&&(document.body.removeChild(t.myIFrame),t.myIFrame=null)},Math.floor(0))),s.isNodeSdk()&&this.myID){var n={disconn:"t"};n.id=this.myID,n.pw=this.myPW;var r=this.urlFn(n);e.nodeRestRequest(r)}var i=this.onDisconnect;i&&(this.onDisconnect=null,i())},e.prototype.startLongPoll=function(e,t){for(this.myID=e,this.myPW=t,this.alive=!0;this.newRequest_(););},e.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var e={};e.id=this.myID,e.pw=this.myPW,e.ser=this.currentSerial;for(var t=this.urlFn(e),n="",r=0;this.pendingSegs.length>0;){if(!(this.pendingSegs[0].d.length+30+n.length<=1870))break;var i=this.pendingSegs.shift();n=n+"&seg"+r+"="+i.seg+"&ts"+r+"="+i.ts+"&d"+r+"="+i.d,r++}return t+=n,this.addLongPollTag_(t,this.currentSerial),!0}return!1},e.prototype.enqueueSegment=function(e,t,n){this.pendingSegs.push({seg:e,ts:t,d:n}),this.alive&&this.newRequest_()},e.prototype.addLongPollTag_=function(e,t){var n=this;this.outstandingRequests.add(t);var r=function(){n.outstandingRequests.delete(t),n.newRequest_()},i=setTimeout(r,Math.floor(25e3));this.addTag(e,function(){clearTimeout(i),r()})},e.prototype.addTag=function(e,t){var n=this;s.isNodeSdk()?this.doNodeLongPoll(e,t):setTimeout(function(){try{if(!n.sendNewPolls)return;var r=n.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){var e=r.readyState;e&&"loaded"!==e&&"complete"!==e||(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),t())},r.onerror=function(){w("Long-poll script failed to load: "+e),n.sendNewPolls=!1,n.close()},n.myIFrame.doc.body.appendChild(r)}catch(i){}},Math.floor(1))},e}(),Qt="";var qt=null;"undefined"!==typeof MozWebSocket?qt=MozWebSocket:"undefined"!==typeof WebSocket&&(qt=WebSocket);var Ht=function(){function e(t,n,r,i){this.connId=t,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=E(this.connId),this.stats_=Pt.getCollection(n),this.connURL=e.connectionURL_(n,r,i)}return e.connectionURL_=function(e,t,n){var r={v:"5"};return!s.isNodeSdk()&&"undefined"!==typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(r.r="f"),t&&(r.s=t),n&&(r.ls=n),e.connectionURL("websocket",r)},e.prototype.open=function(e,t){var n=this;this.onDisconnect=t,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,h.set("previous_websocket_failure",!0);try{if(s.isNodeSdk()){var i=s.CONSTANTS.NODE_ADMIN?"AdminNode":"Node",o={headers:{"User-Agent":"Firebase/5/"+Qt+"/"+r.platform+"/"+i}},a=Object({NODE_ENV:"production",PUBLIC_URL:""}),l=0==this.connURL.indexOf("wss://")?a.HTTPS_PROXY||a.https_proxy:a.HTTP_PROXY||a.http_proxy;l&&(o.proxy={origin:l}),this.mySock=new qt(this.connURL,[],o)}else this.mySock=new qt(this.connURL)}catch(c){this.log_("Error instantiating WebSocket.");var u=c.message||c.data;return u&&this.log_(u),void this.onClosed_()}this.mySock.onopen=function(){n.log_("Websocket connected."),n.everConnected_=!0},this.mySock.onclose=function(){n.log_("Websocket connection was disconnected."),n.mySock=null,n.onClosed_()},this.mySock.onmessage=function(e){n.handleIncomingFrame(e)},this.mySock.onerror=function(e){n.log_("WebSocket error.  Closing connection.");var t=e.message||e.data;t&&n.log_(t),n.onClosed_()}},e.prototype.start=function(){},e.forceDisallow=function(){e.forceDisallow_=!0},e.isAvailable=function(){var t=!1;if("undefined"!==typeof navigator&&navigator.userAgent){var n=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);n&&n.length>1&&parseFloat(n[1])<4.4&&(t=!0)}return!t&&null!==qt&&!e.forceDisallow_},e.previouslyFailed=function(){return h.isInMemoryStorage||!0===h.get("previous_websocket_failure")},e.prototype.markConnectionHealthy=function(){h.remove("previous_websocket_failure")},e.prototype.appendFrame_=function(e){if(this.frames.push(e),this.frames.length==this.totalFrames){var t=this.frames.join("");this.frames=null;var n=s.jsonEval(t);this.onMessage(n)}},e.prototype.handleNewFrameCount_=function(e){this.totalFrames=e,this.frames=[]},e.prototype.extractFrameCount_=function(e){if(s.assert(null===this.frames,"We already have a frame buffer"),e.length<=6){var t=Number(e);if(!isNaN(t))return this.handleNewFrameCount_(t),null}return this.handleNewFrameCount_(1),e},e.prototype.handleIncomingFrame=function(e){if(null!==this.mySock){var t=e.data;if(this.bytesReceived+=t.length,this.stats_.incrementCounter("bytes_received",t.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(t);else{var n=this.extractFrameCount_(t);null!==n&&this.appendFrame_(n)}}},e.prototype.send=function(e){this.resetKeepAlive();var t=s.stringify(e);this.bytesSent+=t.length,this.stats_.incrementCounter("bytes_sent",t.length);var n=D(t,16384);n.length>1&&this.sendString_(String(n.length));for(var r=0;r<n.length;r++)this.sendString_(n[r])},e.prototype.shutdown_=function(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)},e.prototype.onClosed_=function(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))},e.prototype.close=function(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())},e.prototype.resetKeepAlive=function(){var e=this;clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(function(){e.mySock&&e.sendString_("0"),e.resetKeepAlive()},Math.floor(45e3))},e.prototype.sendString_=function(e){try{this.mySock.send(e)}catch(t){this.log_("Exception thrown from WebSocket.send():",t.message||t.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}},e.responsesRequiredToBeHealthy=2,e.healthyTimeout=3e4,e}(),Yt=function(){function e(e){this.initTransports_(e)}return Object.defineProperty(e,"ALL_TRANSPORTS",{get:function(){return[zt,Ht]},enumerable:!0,configurable:!0}),e.prototype.initTransports_=function(t){var n,r,i=Ht&&Ht.isAvailable(),o=i&&!Ht.previouslyFailed();if(t.webSocketOnly&&(i||S("wss:// URL used, but browser isn't known to support websockets.  Trying anyway."),o=!0),o)this.transports_=[Ht];else{var s=this.transports_=[];try{for(var l=a.__values(e.ALL_TRANSPORTS),u=l.next();!u.done;u=l.next()){var c=u.value;c&&c.isAvailable()&&s.push(c)}}catch(p){n={error:p}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}},e.prototype.initialTransport=function(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")},e.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},e}(),Kt=function(){function e(e,t,n,r,i,o,a){this.id=e,this.repoInfo_=t,this.onMessage_=n,this.onReady_=r,this.onDisconnect_=i,this.onKill_=o,this.lastSessionId=a,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=E("c:"+this.id+":"),this.transportManager_=new Yt(t),this.log_("Connection created"),this.start_()}return e.prototype.start_=function(){var e=this,t=this.transportManager_.initialTransport();this.conn_=new t(this.nextTransportId_(),this.repoInfo_,void 0,this.lastSessionId),this.primaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(function(){e.conn_&&e.conn_.open(n,r)},Math.floor(0));var i=t.healthyTimeout||0;i>0&&(this.healthyTimeout_=V(function(){e.healthyTimeout_=null,e.isHealthy_||(e.conn_&&e.conn_.bytesReceived>102400?(e.log_("Connection exceeded healthy timeout but has received "+e.conn_.bytesReceived+" bytes.  Marking connection healthy."),e.isHealthy_=!0,e.conn_.markConnectionHealthy()):e.conn_&&e.conn_.bytesSent>10240?e.log_("Connection exceeded healthy timeout but has sent "+e.conn_.bytesSent+" bytes.  Leaving connection alive."):(e.log_("Closing unhealthy connection after timeout."),e.close()))},Math.floor(i)))},e.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},e.prototype.disconnReceiver_=function(e){var t=this;return function(n){e===t.conn_?t.onConnectionLost_(n):e===t.secondaryConn_?(t.log_("Secondary connection lost."),t.onSecondaryConnectionLost_()):t.log_("closing an old connection")}},e.prototype.connReceiver_=function(e){var t=this;return function(n){2!=t.state_&&(e===t.rx_?t.onPrimaryMessageReceived_(n):e===t.secondaryConn_?t.onSecondaryMessageReceived_(n):t.log_("message on old connection"))}},e.prototype.sendRequest=function(e){var t={t:"d",d:e};this.sendData_(t)},e.prototype.tryCleanupConnection=function(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)},e.prototype.onSecondaryControl_=function(e){if("t"in e){var t=e.t;"a"===t?this.upgradeIfSecondaryHealthy_():"r"===t?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===t&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},e.prototype.onSecondaryMessageReceived_=function(e){var t=O("t",e),n=O("d",e);if("c"==t)this.onSecondaryControl_(n);else{if("d"!=t)throw new Error("Unknown protocol layer: "+t);this.pendingDataMessages.push(n)}},e.prototype.upgradeIfSecondaryHealthy_=function(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:"p",d:{}}}))},e.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:"a",d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:"n",d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},e.prototype.onPrimaryMessageReceived_=function(e){var t=O("t",e),n=O("d",e);"c"==t?this.onControl_(n):"d"==t&&this.onDataMessage_(n)},e.prototype.onDataMessage_=function(e){this.onPrimaryResponse_(),this.onMessage_(e)},e.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},e.prototype.onControl_=function(e){var t=O("t",e);if("d"in e){var n=e.d;if("h"===t)this.onHandshake_(n);else if("n"===t){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(var r=0;r<this.pendingDataMessages.length;++r)this.onDataMessage_(this.pendingDataMessages[r]);this.pendingDataMessages=[],this.tryCleanupConnection()}else"s"===t?this.onConnectionShutdown_(n):"r"===t?this.onReset_(n):"e"===t?C("Server Error: "+n):"o"===t?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):C("Unknown control packet command: "+t)}},e.prototype.onHandshake_=function(e){var t=e.ts,n=e.v,r=e.h;this.sessionId=e.s,this.repoInfo_.updateHost(r),0==this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,t),"5"!==n&&S("Protocol version mismatch detected"),this.tryStartUpgrade_())},e.prototype.tryStartUpgrade_=function(){var e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)},e.prototype.startUpgrade_=function(e){var t=this;this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,r),V(function(){t.secondaryConn_&&(t.log_("Timed out trying to upgrade."),t.secondaryConn_.close())},Math.floor(6e4))},e.prototype.onReset_=function(e){this.log_("Reset packet received.  New host: "+e),this.repoInfo_.updateHost(e),1===this.state_?this.close():(this.closeConnections_(),this.start_())},e.prototype.onConnectionEstablished_=function(e,t){var n=this;this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(t,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):V(function(){n.sendPingOnPrimaryIfNecessary_()},Math.floor(5e3))},e.prototype.sendPingOnPrimaryIfNecessary_=function(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))},e.prototype.onSecondaryConnectionLost_=function(){var e=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==e&&this.rx_!==e||this.close()},e.prototype.onConnectionLost_=function(e){this.conn_=null,e||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(h.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()},e.prototype.onConnectionShutdown_=function(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()},e.prototype.sendData_=function(e){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(e)},e.prototype.close=function(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))},e.prototype.closeConnections_=function(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)},e}(),Gt=function(){function e(){}return e.prototype.put=function(e,t,n,r){},e.prototype.merge=function(e,t,n,r){},e.prototype.refreshAuthToken=function(e){},e.prototype.onDisconnectPut=function(e,t,n){},e.prototype.onDisconnectMerge=function(e,t,n){},e.prototype.onDisconnectCancel=function(e,t){},e.prototype.reportStats=function(e){},e}(),$t=1e3,Xt=3e5,Jt=function(e){function t(n,r,i,o,a,l){var u=e.call(this)||this;if(u.repoInfo_=n,u.onDataUpdate_=r,u.onConnectStatus_=i,u.onServerInfoUpdate_=o,u.authTokenProvider_=a,u.authOverride_=l,u.id=t.nextPersistentConnectionId_++,u.log_=E("p:"+u.id+":"),u.interruptReasons_={},u.listens=new Map,u.outstandingPuts_=[],u.outstandingPutCount_=0,u.onDisconnectRequestQueue_=[],u.connected_=!1,u.reconnectDelay_=$t,u.maxReconnectDelay_=Xt,u.securityDebugCallback_=null,u.lastSessionId=null,u.establishConnectionTimer_=null,u.visible_=!1,u.requestCBHash_={},u.requestNumber_=0,u.realtime_=null,u.authToken_=null,u.forceTokenRefresh_=!1,u.invalidAuthTokenCount_=0,u.firstConnection_=!0,u.lastConnectionAttemptTime_=null,u.lastConnectionEstablishedTime_=null,l&&!s.isNodeSdk())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return u.scheduleConnect_(0),Lt.getInstance().on("visible",u.onVisible_,u),-1===n.host.indexOf("fblocal")&&Wt.getInstance().on("online",u.onOnline_,u),u}return a.__extends(t,e),t.prototype.sendRequest=function(e,t,n){var r=++this.requestNumber_,i={r:r,a:e,b:t};this.log_(s.stringify(i)),s.assert(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),n&&(this.requestCBHash_[r]=n)},t.prototype.listen=function(e,t,n,r){var i=e.queryIdentifier(),o=e.path.toString();this.log_("Listen called for "+o+" "+i),this.listens.has(o)||this.listens.set(o,new Map),s.assert(e.getQueryParams().isDefault()||!e.getQueryParams().loadsAllData(),"listen() called for non-default but complete query"),s.assert(!this.listens.get(o).has(i),"listen() called twice for same path/queryId.");var a={onComplete:r,hashFn:t,query:e,tag:n};this.listens.get(o).set(i,a),this.connected_&&this.sendListen_(a)},t.prototype.sendListen_=function(e){var n=this,r=e.query,i=r.path.toString(),o=r.queryIdentifier();this.log_("Listen on "+i+" for "+o);var a={p:i};e.tag&&(a.q=r.queryObject(),a.t=e.tag),a.h=e.hashFn(),this.sendRequest("q",a,function(a){var s=a.d,l=a.s;t.warnOnListenWarnings_(s,r),(n.listens.get(i)&&n.listens.get(i).get(o))===e&&(n.log_("listen response",a),"ok"!==l&&n.removeListen_(i,o),e.onComplete&&e.onComplete(l,s))})},t.warnOnListenWarnings_=function(e,t){if(e&&"object"===typeof e&&s.contains(e,"w")){var n=s.safeGet(e,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){var r='".indexOn": "'+t.getQueryParams().getIndex().toString()+'"',i=t.path.toString();S("Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding "+r+" at "+i+" to your security rules for better performance.")}}},t.prototype.refreshAuthToken=function(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},function(){}),this.reduceReconnectDelayIfAdminCredential_(e)},t.prototype.reduceReconnectDelayIfAdminCredential_=function(e){(e&&40===e.length||s.isAdmin(e))&&(this.log_("Admin auth credential detected.  Reducing max reconnect time."),this.maxReconnectDelay_=3e4)},t.prototype.tryAuth=function(){var e=this;if(this.connected_&&this.authToken_){var t=this.authToken_,n=s.isValidFormat(t)?"auth":"gauth",r={cred:t};null===this.authOverride_?r.noauth=!0:"object"===typeof this.authOverride_&&(r.authvar=this.authOverride_),this.sendRequest(n,r,function(n){var r=n.s,i=n.d||"error";e.authToken_===t&&("ok"===r?e.invalidAuthTokenCount_=0:e.onAuthRevoked_(r,i))})}},t.prototype.unlisten=function(e,t){var n=e.path.toString(),r=e.queryIdentifier();this.log_("Unlisten called for "+n+" "+r),s.assert(e.getQueryParams().isDefault()||!e.getQueryParams().loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(n,r)&&this.connected_&&this.sendUnlisten_(n,r,e.queryObject(),t)},t.prototype.sendUnlisten_=function(e,t,n,r){this.log_("Unlisten on "+e+" for "+t);var i={p:e};r&&(i.q=n,i.t=r),this.sendRequest("n",i)},t.prototype.onDisconnectPut=function(e,t,n){this.connected_?this.sendOnDisconnect_("o",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:t,onComplete:n})},t.prototype.onDisconnectMerge=function(e,t,n){this.connected_?this.sendOnDisconnect_("om",e,t,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:t,onComplete:n})},t.prototype.onDisconnectCancel=function(e,t){this.connected_?this.sendOnDisconnect_("oc",e,null,t):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:t})},t.prototype.sendOnDisconnect_=function(e,t,n,r){var i={p:t,d:n};this.log_("onDisconnect "+e,i),this.sendRequest(e,i,function(e){r&&setTimeout(function(){r(e.s,e.d)},Math.floor(0))})},t.prototype.put=function(e,t,n,r){this.putInternal("p",e,t,n,r)},t.prototype.merge=function(e,t,n,r){this.putInternal("m",e,t,n,r)},t.prototype.putInternal=function(e,t,n,r,i){var o={p:t,d:n};void 0!==i&&(o.h=i),this.outstandingPuts_.push({action:e,request:o,onComplete:r}),this.outstandingPutCount_++;var a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+t)},t.prototype.sendPut_=function(e){var t=this,n=this.outstandingPuts_[e].action,r=this.outstandingPuts_[e].request,i=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(n,r,function(r){t.log_(n+" response",r),delete t.outstandingPuts_[e],t.outstandingPutCount_--,0===t.outstandingPutCount_&&(t.outstandingPuts_=[]),i&&i(r.s,r.d)})},t.prototype.reportStats=function(e){var t=this;if(this.connected_){var n={c:e};this.log_("reportStats",n),this.sendRequest("s",n,function(e){if("ok"!==e.s){var n=e.d;t.log_("reportStats","Error sending stats: "+n)}})}},t.prototype.onDataMessage_=function(e){if("r"in e){this.log_("from server: "+s.stringify(e));var t=e.r,n=this.requestCBHash_[t];n&&(delete this.requestCBHash_[t],n(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}},t.prototype.onDataPush_=function(e,t){this.log_("handleServerMessage",e,t),"d"===e?this.onDataUpdate_(t.p,t.d,!1,t.t):"m"===e?this.onDataUpdate_(t.p,t.d,!0,t.t):"c"===e?this.onListenRevoked_(t.p,t.q):"ac"===e?this.onAuthRevoked_(t.s,t.d):"sd"===e?this.onSecurityDebugPacket_(t):C("Unrecognized action received from server: "+s.stringify(e)+"\nAre you using the latest client?")},t.prototype.onReady_=function(e,t){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(e),this.lastSessionId=t,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},t.prototype.scheduleConnect_=function(e){var t=this;s.assert(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(function(){t.establishConnectionTimer_=null,t.establishConnection_()},Math.floor(e))},t.prototype.onVisible_=function(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible.  Reducing delay."),this.reconnectDelay_=$t,this.realtime_||this.scheduleConnect_(0)),this.visible_=e},t.prototype.onOnline_=function(e){e?(this.log_("Browser went online."),this.reconnectDelay_=$t,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline.  Killing connection."),this.realtime_&&this.realtime_.close())},t.prototype.onRealtimeDisconnect_=function(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){if(this.visible_){if(this.lastConnectionEstablishedTime_){(new Date).getTime()-this.lastConnectionEstablishedTime_>3e4&&(this.reconnectDelay_=$t),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible.  Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();var e=(new Date).getTime()-this.lastConnectionAttemptTime_,t=Math.max(0,this.reconnectDelay_-e);t=Math.random()*t,this.log_("Trying to reconnect in "+t+"ms"),this.scheduleConnect_(t),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)},t.prototype.establishConnection_=function(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;var e=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),i=this.id+":"+t.nextConnectionId_++,o=this,a=this.lastSessionId,l=!1,u=null,c=function(){u?u.close():(l=!0,r())};this.realtime_={close:c,sendRequest:function(e){s.assert(u,"sendRequest call when we're not connected not allowed."),u.sendRequest(e)}};var p=this.forceTokenRefresh_;this.forceTokenRefresh_=!1,this.authTokenProvider_.getToken(p).then(function(t){l?w("getToken() completed but was canceled"):(w("getToken() completed. Creating connection."),o.authToken_=t&&t.accessToken,u=new Kt(i,o.repoInfo_,e,n,r,function(e){S(e+" ("+o.repoInfo_.toString()+")"),o.interrupt("server_kill")},a))}).then(null,function(e){o.log_("Failed to get token: "+e),l||(s.CONSTANTS.NODE_ADMIN&&S(e),c())})}},t.prototype.interrupt=function(e){w("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},t.prototype.resume=function(e){w("Resuming connection for reason: "+e),delete this.interruptReasons_[e],s.isEmpty(this.interruptReasons_)&&(this.reconnectDelay_=$t,this.realtime_||this.scheduleConnect_(0))},t.prototype.handleTimestamp_=function(e){var t=e-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:t})},t.prototype.cancelSentTransactions_=function(){for(var e=0;e<this.outstandingPuts_.length;e++){var t=this.outstandingPuts_[e];t&&"h"in t.request&&t.queued&&(t.onComplete&&t.onComplete("disconnect"),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])},t.prototype.onListenRevoked_=function(e,t){var n;n=t?t.map(function(e){return I(e)}).join("$"):"default";var r=this.removeListen_(e,n);r&&r.onComplete&&r.onComplete("permission_denied")},t.prototype.removeListen_=function(e,t){var n,r=new j(e).toString();if(this.listens.has(r)){var i=this.listens.get(r);n=i.get(t),i.delete(t),0===i.size&&this.listens.delete(r)}else n=void 0;return n},t.prototype.onAuthRevoked_=function(e,t){w("Auth token revoked: "+e+"/"+t),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==e&&"permission_denied"!==e||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))},t.prototype.onSecurityDebugPacket_=function(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace("\n","\nFIREBASE: "))},t.prototype.restoreState_=function(){var e,t,n,r;this.tryAuth();try{for(var i=a.__values(this.listens.values()),o=i.next();!o.done;o=i.next()){var s=o.value;try{for(var l=(n=void 0,a.__values(s.values())),u=l.next();!u.done;u=l.next()){var c=u.value;this.sendListen_(c)}}catch(d){n={error:d}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}}catch(f){e={error:f}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}for(var p=0;p<this.outstandingPuts_.length;p++)this.outstandingPuts_[p]&&this.sendPut_(p);for(;this.onDisconnectRequestQueue_.length;){var h=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(h.action,h.pathString,h.data,h.onComplete)}},t.prototype.sendConnectStats_=function(){var e={},t="js";s.CONSTANTS.NODE_ADMIN?t="admin_node":s.CONSTANTS.NODE_CLIENT&&(t="node"),e["sdk."+t+"."+Qt.replace(/\./g,"-")]=1,s.isMobileCordova()?e["framework.cordova"]=1:s.isReactNative()&&(e["framework.reactnative"]=1),this.reportStats(e)},t.prototype.shouldReconnect_=function(){var e=Wt.getInstance().currentlyOnline();return s.isEmpty(this.interruptReasons_)&&e},t.nextPersistentConnectionId_=0,t.nextConnectionId_=0,t}(Gt),Zt=function(e){function t(t,n,r){var i=e.call(this)||this;return i.repoInfo_=t,i.onDataUpdate_=n,i.authTokenProvider_=r,i.log_=E("p:rest:"),i.listens_={},i}return a.__extends(t,e),t.prototype.reportStats=function(e){throw new Error("Method not implemented.")},t.getListenId_=function(e,t){return void 0!==t?"tag$"+t:(s.assert(e.getQueryParams().isDefault(),"should have a tag if it's not a default query."),e.path.toString())},t.prototype.listen=function(e,n,r,i){var o=this,a=e.path.toString();this.log_("Listen called for "+a+" "+e.queryIdentifier());var l=t.getListenId_(e,r),u={};this.listens_[l]=u;var c=e.getQueryParams().toRestQueryStringParameters();this.restRequest_(a+".json",c,function(e,t){var n=t;(404===e&&(n=null,e=null),null===e&&o.onDataUpdate_(a,n,!1,r),s.safeGet(o.listens_,l)===u)&&i(e?401==e?"permission_denied":"rest_error:"+e:"ok",null)})},t.prototype.unlisten=function(e,n){var r=t.getListenId_(e,n);delete this.listens_[r]},t.prototype.refreshAuthToken=function(e){},t.prototype.restRequest_=function(e,t,n){var r=this;void 0===t&&(t={}),t.format="export",this.authTokenProvider_.getToken(!1).then(function(i){var o=i&&i.accessToken;o&&(t.auth=o);var a=(r.repoInfo_.secure?"https://":"http://")+r.repoInfo_.host+e+"?ns="+r.repoInfo_.namespace+s.querystring(t);r.log_("Sending REST request for "+a);var l=new XMLHttpRequest;l.onreadystatechange=function(){if(n&&4===l.readyState){r.log_("REST Response for "+a+" received. status:",l.status,"response:",l.responseText);var e=null;if(l.status>=200&&l.status<300){try{e=s.jsonEval(l.responseText)}catch(t){S("Failed to parse JSON response for "+a+": "+l.responseText)}n(null,e)}else 401!==l.status&&404!==l.status&&S("Got unsuccessful REST response for "+a+" Status: "+l.status),n(l.status);n=null}},l.open("GET",a,!0),l.send()})},t}(Gt),en=function(){function e(e,t,n){var r=this;this.repoInfo_=e,this.app=n,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new At,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=new Je,this.persistentConnection_=null;var i=new xt(n);if(this.stats_=Pt.getCollection(e),t||U())this.server_=new Zt(this.repoInfo_,this.onDataUpdate_.bind(this),i),setTimeout(this.onConnectStatus_.bind(this,!0),0);else{var o=n.options.databaseAuthVariableOverride;if("undefined"!==typeof o&&null!==o){if("object"!==typeof o)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{s.stringify(o)}catch(a){throw new Error("Invalid authOverride provided: "+a)}}this.persistentConnection_=new Jt(this.repoInfo_,this.onDataUpdate_.bind(this),this.onConnectStatus_.bind(this),this.onServerInfoUpdate_.bind(this),i,o),this.server_=this.persistentConnection_}i.addTokenChangeListener(function(e){r.server_.refreshAuthToken(e)}),this.statsReporter_=Pt.getOrCreateReporter(e,function(){return new Dt(r.stats_,r.server_)}),this.transactions_init_(),this.infoData_=new kt,this.infoSyncTree_=new St({startListening:function(e,t,n,i){var o=[],a=r.infoData_.getNode(e.path);return a.isEmpty()||(o=r.infoSyncTree_.applyServerOverwrite(e.path,a),setTimeout(function(){i("ok")},0)),o},stopListening:function(){}}),this.updateInfo_("connected",!1),this.serverSyncTree_=new St({startListening:function(e,t,n,i){return r.server_.listen(e,n,t,function(t,n){var o=i(t,n);r.eventQueue_.raiseEventsForChangedPath(e.path,o)}),[]},stopListening:function(e,t){r.server_.unlisten(e,t)}})}return e.prototype.toString=function(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host},e.prototype.name=function(){return this.repoInfo_.namespace},e.prototype.serverTime=function(){var e=this.infoData_.getNode(new j(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+e},e.prototype.generateServerValues=function(){return(e=(e={timestamp:this.serverTime()})||{}).timestamp=e.timestamp||(new Date).getTime(),e;var e},e.prototype.onDataUpdate_=function(e,t,n,r){this.dataUpdateCount++;var i=new j(e);t=this.interceptServerDataCallback_?this.interceptServerDataCallback_(e,t):t;var o=[];if(r)if(n){var a=s.map(t,function(e){return je(e)});o=this.serverSyncTree_.applyTaggedQueryMerge(i,a,r)}else{var l=je(t);o=this.serverSyncTree_.applyTaggedQueryOverwrite(i,l,r)}else if(n){var u=s.map(t,function(e){return je(e)});o=this.serverSyncTree_.applyServerMerge(i,u)}else{var c=je(t);o=this.serverSyncTree_.applyServerOverwrite(i,c)}var p=i;o.length>0&&(p=this.rerunTransactions_(i)),this.eventQueue_.raiseEventsForChangedPath(p,o)},e.prototype.interceptServerData_=function(e){this.interceptServerDataCallback_=e},e.prototype.onConnectStatus_=function(e){this.updateInfo_("connected",e),!1===e&&this.runOnDisconnectEvents_()},e.prototype.onServerInfoUpdate_=function(e){var t=this;A(e,function(e,n){t.updateInfo_(n,e)})},e.prototype.updateInfo_=function(e,t){var n=new j("/.info/"+e),r=je(t);this.infoData_.updateSnapshot(n,r);var i=this.infoSyncTree_.applyServerOverwrite(n,r);this.eventQueue_.raiseEventsForChangedPath(n,i)},e.prototype.getNextWriteId_=function(){return this.nextWriteId_++},e.prototype.setWithPriority=function(e,t,n,r){var i=this;this.log_("set",{path:e.toString(),value:t,priority:n});var o=this.generateServerValues(),a=je(t,n),s=et(a,o),l=this.getNextWriteId_(),u=this.serverSyncTree_.applyUserOverwrite(e,s,l,!0);this.eventQueue_.queueEvents(u),this.server_.put(e.toString(),a.val(!0),function(t,n){var o="ok"===t;o||S("set at "+e+" failed: "+t);var a=i.serverSyncTree_.ackUserWrite(l,!o);i.eventQueue_.raiseEventsForChangedPath(e,a),i.callOnCompleteCallback(r,t,n)});var c=this.abortTransactions_(e);this.rerunTransactions_(c),this.eventQueue_.raiseEventsForChangedPath(c,[])},e.prototype.update=function(e,t,n){var r=this;this.log_("update",{path:e.toString(),value:t});var i=!0,o=this.generateServerValues(),a={};if(A(t,function(e,t){i=!1;var n=je(t);a[e]=et(n,o)}),i)w("update() called with empty data.  Don't do anything."),this.callOnCompleteCallback(n,"ok");else{var s=this.getNextWriteId_(),l=this.serverSyncTree_.applyUserMerge(e,a,s);this.eventQueue_.queueEvents(l),this.server_.merge(e.toString(),t,function(t,i){var o="ok"===t;o||S("update at "+e+" failed: "+t);var a=r.serverSyncTree_.ackUserWrite(s,!o),l=a.length>0?r.rerunTransactions_(e):e;r.eventQueue_.raiseEventsForChangedPath(l,a),r.callOnCompleteCallback(n,t,i)}),A(t,function(t){var n=r.abortTransactions_(e.child(t));r.rerunTransactions_(n)}),this.eventQueue_.raiseEventsForChangedPath(e,[])}},e.prototype.runOnDisconnectEvents_=function(){var e=this;this.log_("onDisconnectEvents");var t=this.generateServerValues(),n=function(e,t){var n=new Je;return e.forEachTree(new j(""),function(e,r){n.remember(e,et(r,t))}),n}(this.onDisconnect_,t),r=[];n.forEachTree(j.Empty,function(t,n){r=r.concat(e.serverSyncTree_.applyServerOverwrite(t,n));var i=e.abortTransactions_(t);e.rerunTransactions_(i)}),this.onDisconnect_=new Je,this.eventQueue_.raiseEventsForChangedPath(j.Empty,r)},e.prototype.onDisconnectCancel=function(e,t){var n=this;this.server_.onDisconnectCancel(e.toString(),function(r,i){"ok"===r&&n.onDisconnect_.forget(e),n.callOnCompleteCallback(t,r,i)})},e.prototype.onDisconnectSet=function(e,t,n){var r=this,i=je(t);this.server_.onDisconnectPut(e.toString(),i.val(!0),function(t,o){"ok"===t&&r.onDisconnect_.remember(e,i),r.callOnCompleteCallback(n,t,o)})},e.prototype.onDisconnectSetWithPriority=function(e,t,n,r){var i=this,o=je(t,n);this.server_.onDisconnectPut(e.toString(),o.val(!0),function(t,n){"ok"===t&&i.onDisconnect_.remember(e,o),i.callOnCompleteCallback(r,t,n)})},e.prototype.onDisconnectUpdate=function(e,t,n){var r=this;if(s.isEmpty(t))return w("onDisconnect().update() called with empty data.  Don't do anything."),void this.callOnCompleteCallback(n,"ok");this.server_.onDisconnectMerge(e.toString(),t,function(i,o){"ok"===i&&A(t,function(t,n){var i=je(n);r.onDisconnect_.remember(e.child(t),i)}),r.callOnCompleteCallback(n,i,o)})},e.prototype.addEventCallbackForQuery=function(e,t){var n;n=".info"===e.path.getFront()?this.infoSyncTree_.addEventRegistration(e,t):this.serverSyncTree_.addEventRegistration(e,t),this.eventQueue_.raiseEventsAtPath(e.path,n)},e.prototype.removeEventCallbackForQuery=function(e,t){var n;n=".info"===e.path.getFront()?this.infoSyncTree_.removeEventRegistration(e,t):this.serverSyncTree_.removeEventRegistration(e,t),this.eventQueue_.raiseEventsAtPath(e.path,n)},e.prototype.interrupt=function(){this.persistentConnection_&&this.persistentConnection_.interrupt("repo_interrupt")},e.prototype.resume=function(){this.persistentConnection_&&this.persistentConnection_.resume("repo_interrupt")},e.prototype.stats=function(e){if(void 0===e&&(e=!1),"undefined"!==typeof console){var t;e?(this.statsListener_||(this.statsListener_=new Rt(this.stats_)),t=this.statsListener_.get()):t=this.stats_.get();var n=Object.keys(t).reduce(function(e,t){return Math.max(t.length,e)},0);A(t,function(e,t){for(var r=e,i=e.length;i<n+2;i++)r+=" ";console.log(r+t)})}},e.prototype.statsIncrementCounter=function(e){this.stats_.incrementCounter(e),this.statsReporter_.includeStat(e)},e.prototype.log_=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n="";this.persistentConnection_&&(n=this.persistentConnection_.id+":"),w.apply(void 0,a.__spread([n],e))},e.prototype.callOnCompleteCallback=function(e,t,n){e&&W(function(){if("ok"==t)e(null);else{var r=(t||"error").toUpperCase(),i=r;n&&(i+=": "+n);var o=new Error(i);o.code=r,e(o)}})},Object.defineProperty(e.prototype,"database",{get:function(){return this.__database||(this.__database=new pn(this))},enumerable:!0,configurable:!0}),e}(),tn=function(){function e(t){this.indexedFilter_=new dt(t.getIndex()),this.index_=t.getIndex(),this.startPost_=e.getStartPost_(t),this.endPost_=e.getEndPost_(t)}return e.prototype.getStartPost=function(){return this.startPost_},e.prototype.getEndPost=function(){return this.endPost_},e.prototype.matches=function(e){return this.index_.compare(this.getStartPost(),e)<=0&&this.index_.compare(e,this.getEndPost())<=0},e.prototype.updateChild=function(e,t,n,r,i,o){return this.matches(new fe(t,n))||(n=We.EMPTY_NODE),this.indexedFilter_.updateChild(e,t,n,r,i,o)},e.prototype.updateFullNode=function(e,t,n){t.isLeafNode()&&(t=We.EMPTY_NODE);var r=t.withIndex(this.index_);r=r.updatePriority(We.EMPTY_NODE);var i=this;return t.forEachChild(ke,function(e,t){i.matches(new fe(e,t))||(r=r.updateImmediateChild(e,We.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,r,n)},e.prototype.updatePriority=function(e,t){return e},e.prototype.filtersNodes=function(){return!0},e.prototype.getIndexedFilter=function(){return this.indexedFilter_},e.prototype.getIndex=function(){return this.index_},e.getStartPost_=function(e){if(e.hasStart()){var t=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),t)}return e.getIndex().minPost()},e.getEndPost_=function(e){if(e.hasEnd()){var t=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),t)}return e.getIndex().maxPost()},e}(),nn=function(){function e(e){this.rangedFilter_=new tn(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft()}return e.prototype.updateChild=function(e,t,n,r,i,o){return this.rangedFilter_.matches(new fe(t,n))||(n=We.EMPTY_NODE),e.getImmediateChild(t).equals(n)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,t,n,r,i,o):this.fullLimitUpdateChild_(e,t,n,i,o)},e.prototype.updateFullNode=function(e,t,n){var r;if(t.isLeafNode()||t.isEmpty())r=We.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<t.numChildren()&&t.isIndexed(this.index_)){r=We.EMPTY_NODE.withIndex(this.index_);var i=void 0;i=this.reverse_?t.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):t.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);for(var o=0;i.hasNext()&&o<this.limit_;){var a=i.getNext();if(!(this.reverse_?this.index_.compare(this.rangedFilter_.getStartPost(),a)<=0:this.index_.compare(a,this.rangedFilter_.getEndPost())<=0))break;r=r.updateImmediateChild(a.name,a.node),o++}}else{r=(r=t.withIndex(this.index_)).updatePriority(We.EMPTY_NODE);var s=void 0,l=void 0,u=void 0;i=void 0;if(this.reverse_){i=r.getReverseIterator(this.index_),s=this.rangedFilter_.getEndPost(),l=this.rangedFilter_.getStartPost();var c=this.index_.getCompare();u=function(e,t){return c(t,e)}}else i=r.getIterator(this.index_),s=this.rangedFilter_.getStartPost(),l=this.rangedFilter_.getEndPost(),u=this.index_.getCompare();o=0;for(var p=!1;i.hasNext();){a=i.getNext();!p&&u(s,a)<=0&&(p=!0),p&&o<this.limit_&&u(a,l)<=0?o++:r=r.updateImmediateChild(a.name,We.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,r,n)},e.prototype.updatePriority=function(e,t){return e},e.prototype.filtersNodes=function(){return!0},e.prototype.getIndexedFilter=function(){return this.rangedFilter_.getIndexedFilter()},e.prototype.getIndex=function(){return this.index_},e.prototype.fullLimitUpdateChild_=function(e,t,n,r,i){var o;if(this.reverse_){var a=this.index_.getCompare();o=function(e,t){return a(t,e)}}else o=this.index_.getCompare();var l=e;s.assert(l.numChildren()==this.limit_,"");var u=new fe(t,n),c=this.reverse_?l.getFirstChild(this.index_):l.getLastChild(this.index_),p=this.rangedFilter_.matches(u);if(l.hasChild(t)){for(var h=l.getImmediateChild(t),d=r.getChildAfterChild(this.index_,c,this.reverse_);null!=d&&(d.name==t||l.hasChild(d.name));)d=r.getChildAfterChild(this.index_,d,this.reverse_);var f=null==d?1:o(d,u);if(p&&!n.isEmpty()&&f>=0)return null!=i&&i.trackChildChange(ht.childChangedChange(t,n,h)),l.updateImmediateChild(t,n);null!=i&&i.trackChildChange(ht.childRemovedChange(t,h));var y=l.updateImmediateChild(t,We.EMPTY_NODE);return null!=d&&this.rangedFilter_.matches(d)?(null!=i&&i.trackChildChange(ht.childAddedChange(d.name,d.node)),y.updateImmediateChild(d.name,d.node)):y}return n.isEmpty()?e:p&&o(c,u)>=0?(null!=i&&(i.trackChildChange(ht.childRemovedChange(c.name,c.node)),i.trackChildChange(ht.childAddedChange(t,n))),l.updateImmediateChild(t,n).updateImmediateChild(c.name,We.EMPTY_NODE)):e},e}(),rn=function(){function e(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=ke}return e.prototype.hasStart=function(){return this.startSet_},e.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:this.viewFrom_===e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT},e.prototype.getIndexStartValue=function(){return s.assert(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},e.prototype.getIndexStartName=function(){return s.assert(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:x},e.prototype.hasEnd=function(){return this.endSet_},e.prototype.getIndexEndValue=function(){return s.assert(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},e.prototype.getIndexEndName=function(){return s.assert(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:N},e.prototype.hasLimit=function(){return this.limitSet_},e.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},e.prototype.getLimit=function(){return s.assert(this.limitSet_,"Only valid if limit has been set"),this.limit_},e.prototype.getIndex=function(){return this.index_},e.prototype.copy_=function(){var t=new e;return t.limitSet_=this.limitSet_,t.limit_=this.limit_,t.startSet_=this.startSet_,t.indexStartValue_=this.indexStartValue_,t.startNameSet_=this.startNameSet_,t.indexStartName_=this.indexStartName_,t.endSet_=this.endSet_,t.indexEndValue_=this.indexEndValue_,t.endNameSet_=this.endNameSet_,t.indexEndName_=this.indexEndName_,t.index_=this.index_,t.viewFrom_=this.viewFrom_,t},e.prototype.limit=function(e){var t=this.copy_();return t.limitSet_=!0,t.limit_=e,t.viewFrom_="",t},e.prototype.limitToFirst=function(t){var n=this.copy_();return n.limitSet_=!0,n.limit_=t,n.viewFrom_=e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT,n},e.prototype.limitToLast=function(t){var n=this.copy_();return n.limitSet_=!0,n.limit_=t,n.viewFrom_=e.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_RIGHT,n},e.prototype.startAt=function(e,t){var n=this.copy_();return n.startSet_=!0,void 0===e&&(e=null),n.indexStartValue_=e,null!=t?(n.startNameSet_=!0,n.indexStartName_=t):(n.startNameSet_=!1,n.indexStartName_=""),n},e.prototype.endAt=function(e,t){var n=this.copy_();return n.endSet_=!0,void 0===e&&(e=null),n.indexEndValue_=e,void 0!==t?(n.endNameSet_=!0,n.indexEndName_=t):(n.endNameSet_=!1,n.indexEndName_=""),n},e.prototype.orderBy=function(e){var t=this.copy_();return t.index_=e,t},e.prototype.getQueryObject=function(){var t=e.WIRE_PROTOCOL_CONSTANTS_,n={};if(this.startSet_&&(n[t.INDEX_START_VALUE]=this.indexStartValue_,this.startNameSet_&&(n[t.INDEX_START_NAME]=this.indexStartName_)),this.endSet_&&(n[t.INDEX_END_VALUE]=this.indexEndValue_,this.endNameSet_&&(n[t.INDEX_END_NAME]=this.indexEndName_)),this.limitSet_){n[t.LIMIT]=this.limit_;var r=this.viewFrom_;""===r&&(r=this.isViewFromLeft()?t.VIEW_FROM_LEFT:t.VIEW_FROM_RIGHT),n[t.VIEW_FROM]=r}return this.index_!==ke&&(n[t.INDEX]=this.index_.toString()),n},e.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},e.prototype.isDefault=function(){return this.loadsAllData()&&this.index_==ke},e.prototype.getNodeFilter=function(){return this.loadsAllData()?new dt(this.getIndex()):this.hasLimit()?new nn(this):new tn(this)},e.prototype.toRestQueryStringParameters=function(){var t,n=e.REST_QUERY_CONSTANTS_,r={};return this.isDefault()?r:(this.index_===ke?t=n.PRIORITY_INDEX:this.index_===Qe?t=n.VALUE_INDEX:this.index_===me?t=n.KEY_INDEX:(s.assert(this.index_ instanceof qe,"Unrecognized index type!"),t=this.index_.toString()),r[n.ORDER_BY]=s.stringify(t),this.startSet_&&(r[n.START_AT]=s.stringify(this.indexStartValue_),this.startNameSet_&&(r[n.START_AT]+=","+s.stringify(this.indexStartName_))),this.endSet_&&(r[n.END_AT]=s.stringify(this.indexEndValue_),this.endNameSet_&&(r[n.END_AT]+=","+s.stringify(this.indexEndName_))),this.limitSet_&&(this.isViewFromLeft()?r[n.LIMIT_TO_FIRST]=this.limit_:r[n.LIMIT_TO_LAST]=this.limit_),r)},e.WIRE_PROTOCOL_CONSTANTS_={INDEX_START_VALUE:"sp",INDEX_START_NAME:"sn",INDEX_END_VALUE:"ep",INDEX_END_NAME:"en",LIMIT:"l",VIEW_FROM:"vf",VIEW_FROM_LEFT:"l",VIEW_FROM_RIGHT:"r",INDEX:"i"},e.REST_QUERY_CONSTANTS_={ORDER_BY:"orderBy",PRIORITY_INDEX:"$priority",VALUE_INDEX:"$value",KEY_INDEX:"$key",START_AT:"startAt",END_AT:"endAt",LIMIT_TO_FIRST:"limitToFirst",LIMIT_TO_LAST:"limitToLast"},e.DEFAULT=new e,e}(),on=function(e){function t(t,n){if(!(t instanceof en))throw new Error("new Reference() no longer supported - use app.database().");return e.call(this,t,n,rn.DEFAULT,!1)||this}return a.__extends(t,e),t.prototype.getKey=function(){return s.validateArgCount("Reference.key",0,0,arguments.length),this.path.isEmpty()?null:this.path.getBack()},t.prototype.child=function(e){return s.validateArgCount("Reference.child",1,1,arguments.length),"number"===typeof e?e=String(e):e instanceof j||(null===this.path.getFront()?se("Reference.child",1,e,!1):ae("Reference.child",1,e,!1)),new t(this.repo,this.path.child(e))},t.prototype.getParent=function(){s.validateArgCount("Reference.parent",0,0,arguments.length);var e=this.path.parent();return null===e?null:new t(this.repo,e)},t.prototype.getRoot=function(){s.validateArgCount("Reference.root",0,0,arguments.length);for(var e=this;null!==e.getParent();)e=e.getParent();return e},t.prototype.databaseProp=function(){return this.repo.database},t.prototype.set=function(e,t){s.validateArgCount("Reference.set",1,2,arguments.length),le("Reference.set",this.path),ee("Reference.set",1,e,this.path,!1),s.validateCallback("Reference.set",2,t,!0);var n=new s.Deferred;return this.repo.setWithPriority(this.path,e,null,n.wrapCallback(t)),n.promise},t.prototype.update=function(e,t){if(s.validateArgCount("Reference.update",1,2,arguments.length),le("Reference.update",this.path),Array.isArray(e)){for(var n={},r=0;r<e.length;++r)n[""+r]=e[r];e=n,S("Passing an Array to Firebase.update() is deprecated. Use set() if you want to overwrite the existing data, or an Object with integer keys if you really do want to only update some of the children.")}ne("Reference.update",1,e,this.path,!1),s.validateCallback("Reference.update",2,t,!0);var i=new s.Deferred;return this.repo.update(this.path,e,i.wrapCallback(t)),i.promise},t.prototype.setWithPriority=function(e,t,n){if(s.validateArgCount("Reference.setWithPriority",2,3,arguments.length),le("Reference.setWithPriority",this.path),ee("Reference.setWithPriority",1,e,this.path,!1),re("Reference.setWithPriority",2,t,!1),s.validateCallback("Reference.setWithPriority",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.setWithPriority failed: "+this.getKey()+" is a read-only object.";var r=new s.Deferred;return this.repo.setWithPriority(this.path,e,t,r.wrapCallback(n)),r.promise},t.prototype.remove=function(e){return s.validateArgCount("Reference.remove",0,1,arguments.length),le("Reference.remove",this.path),s.validateCallback("Reference.remove",1,e,!0),this.set(null,e)},t.prototype.transaction=function(e,t,n){if(s.validateArgCount("Reference.transaction",1,3,arguments.length),le("Reference.transaction",this.path),s.validateCallback("Reference.transaction",1,e,!1),s.validateCallback("Reference.transaction",2,t,!0),ce("Reference.transaction",3,n,!0),".length"===this.getKey()||".keys"===this.getKey())throw"Reference.transaction failed: "+this.getKey()+" is a read-only object.";void 0===n&&(n=!0);var r=new s.Deferred;"function"===typeof t&&r.promise.catch(function(){});var i=function(e,n,i){e?r.reject(e):r.resolve(new he(n,i)),"function"===typeof t&&t(e,n,i)};return this.repo.startTransaction(this.path,e,i,n),r.promise},t.prototype.setPriority=function(e,t){s.validateArgCount("Reference.setPriority",1,2,arguments.length),le("Reference.setPriority",this.path),re("Reference.setPriority",1,e,!1),s.validateCallback("Reference.setPriority",2,t,!0);var n=new s.Deferred;return this.repo.setWithPriority(this.path.child(".priority"),e,null,n.wrapCallback(t)),n.promise},t.prototype.push=function(e,t){s.validateArgCount("Reference.push",0,2,arguments.length),le("Reference.push",this.path),ee("Reference.push",1,e,this.path,!0),s.validateCallback("Reference.push",2,t,!0);var n,r=this.repo.serverTime(),i=de(r),o=this.child(i),a=this.child(i);return n=null!=e?o.set(e,t).then(function(){return a}):Promise.resolve(a),o.then=n.then.bind(n),o.catch=n.then.bind(n,void 0),"function"===typeof t&&n.catch(function(){}),o},t.prototype.onDisconnect=function(){return le("Reference.onDisconnect",this.path),new pe(this.repo,this.path)},Object.defineProperty(t.prototype,"database",{get:function(){return this.databaseProp()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"key",{get:function(){return this.getKey()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.getParent()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this.getRoot()},enumerable:!0,configurable:!0}),t}(Xe);Xe.__referenceConstructor=on,wt.__referenceConstructor=on;var an,sn=function(){return function(){this.children={},this.childCount=0,this.value=null}}(),ln=function(){function e(e,t,n){void 0===e&&(e=""),void 0===t&&(t=null),void 0===n&&(n=new sn),this.name_=e,this.parent_=t,this.node_=n}return e.prototype.subTree=function(t){for(var n,r=t instanceof j?t:new j(t),i=this;null!==(n=r.getFront());){i=new e(n,i,s.safeGet(i.node_.children,n)||new sn),r=r.popFront()}return i},e.prototype.getValue=function(){return this.node_.value},e.prototype.setValue=function(e){s.assert("undefined"!==typeof e,"Cannot set value to undefined"),this.node_.value=e,this.updateParents_()},e.prototype.clear=function(){this.node_.value=null,this.node_.children={},this.node_.childCount=0,this.updateParents_()},e.prototype.hasChildren=function(){return this.node_.childCount>0},e.prototype.isEmpty=function(){return null===this.getValue()&&!this.hasChildren()},e.prototype.forEachChild=function(t){var n=this;A(this.node_.children,function(r,i){t(new e(r,n,i))})},e.prototype.forEachDescendant=function(e,t,n){t&&!n&&e(this),this.forEachChild(function(t){t.forEachDescendant(e,!0,n)}),t&&n&&e(this)},e.prototype.forEachAncestor=function(e,t){for(var n=t?this:this.parent();null!==n;){if(e(n))return!0;n=n.parent()}return!1},e.prototype.forEachImmediateDescendantWithValue=function(e){this.forEachChild(function(t){null!==t.getValue()?e(t):t.forEachImmediateDescendantWithValue(e)})},e.prototype.path=function(){return new j(null===this.parent_?this.name_:this.parent_.path()+"/"+this.name_)},e.prototype.name=function(){return this.name_},e.prototype.parent=function(){return this.parent_},e.prototype.updateParents_=function(){null!==this.parent_&&this.parent_.updateChild_(this.name_,this)},e.prototype.updateChild_=function(e,t){var n=t.isEmpty(),r=s.contains(this.node_.children,e);n&&r?(delete this.node_.children[e],this.node_.childCount--,this.updateParents_()):n||r||(this.node_.children[e]=t.node_,this.node_.childCount++,this.updateParents_())},e}();!function(e){e[e.RUN=0]="RUN",e[e.SENT=1]="SENT",e[e.COMPLETED=2]="COMPLETED",e[e.SENT_NEEDS_ABORT=3]="SENT_NEEDS_ABORT",e[e.NEEDS_ABORT=4]="NEEDS_ABORT"}(an||(an={})),en.MAX_TRANSACTION_RETRIES_=25,en.prototype.transactions_init_=function(){this.transactionQueueTree_=new ln},en.prototype.startTransaction=function(e,t,n,r){this.log_("transaction on "+e);var i=function(){},o=new on(this,e);o.on("value",i);var a={path:e,update:t,onComplete:n,status:null,order:y(),applyLocally:r,retryCount:0,unwatcher:function(){o.off("value",i)},abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},l=this.getLatestState_(e);a.currentInputSnapshot=l;var u=a.update(l.val());if(void 0===u){if(a.unwatcher(),a.currentOutputSnapshotRaw=null,a.currentOutputSnapshotResolved=null,a.onComplete){var c=new He(a.currentInputSnapshot,new on(this,a.path),ke);a.onComplete(null,!1,c)}}else{te("transaction failed: Data returned ",u,a.path),a.status=an.RUN;var p=this.transactionQueueTree_.subTree(e),h=p.getValue()||[];h.push(a),p.setValue(h);var d=void 0;if("object"===typeof u&&null!==u&&s.contains(u,".priority"))d=s.safeGet(u,".priority"),s.assert(Z(d),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.");else d=(this.serverSyncTree_.calcCompleteEventCache(e)||We.EMPTY_NODE).getPriority().val();d=d;var f=this.generateServerValues(),v=je(u,d),m=et(v,f);a.currentOutputSnapshotRaw=v,a.currentOutputSnapshotResolved=m,a.currentWriteId=this.getNextWriteId_();var g=this.serverSyncTree_.applyUserOverwrite(e,m,a.currentWriteId,a.applyLocally);this.eventQueue_.raiseEventsForChangedPath(e,g),this.sendReadyTransactions_()}},en.prototype.getLatestState_=function(e,t){return this.serverSyncTree_.calcCompleteEventCache(e,t)||We.EMPTY_NODE},en.prototype.sendReadyTransactions_=function(e){var t=this;if(void 0===e&&(e=this.transactionQueueTree_),e||this.pruneCompletedTransactionsBelowNode_(e),null!==e.getValue()){var n=this.buildTransactionQueue_(e);s.assert(n.length>0,"Sending zero length transaction queue"),n.every(function(e){return e.status===an.RUN})&&this.sendTransactionQueue_(e.path(),n)}else e.hasChildren()&&e.forEachChild(function(e){t.sendReadyTransactions_(e)})},en.prototype.sendTransactionQueue_=function(e,t){for(var n=this,r=t.map(function(e){return e.currentWriteId}),i=this.getLatestState_(e,r),o=i,a=i.hash(),l=0;l<t.length;l++){var u=t[l];s.assert(u.status===an.RUN,"tryToSendTransactionQueue_: items in queue should all be run."),u.status=an.SENT,u.retryCount++;var c=j.relativePath(e,u.path);o=o.updateChild(c,u.currentOutputSnapshotRaw)}var p=o.val(!0),h=e;this.server_.put(h.toString(),p,function(r){n.log_("transaction put response",{path:h.toString(),status:r});var i=[];if("ok"===r){for(var o=[],a=0;a<t.length;a++){if(t[a].status=an.COMPLETED,i=i.concat(n.serverSyncTree_.ackUserWrite(t[a].currentWriteId)),t[a].onComplete){var s=t[a].currentOutputSnapshotResolved,l=new on(n,t[a].path),u=new He(s,l,ke);o.push(t[a].onComplete.bind(null,null,!0,u))}t[a].unwatcher()}n.pruneCompletedTransactionsBelowNode_(n.transactionQueueTree_.subTree(e)),n.sendReadyTransactions_(),n.eventQueue_.raiseEventsForChangedPath(e,i);for(a=0;a<o.length;a++)W(o[a])}else{if("datastale"===r)for(a=0;a<t.length;a++)t[a].status===an.SENT_NEEDS_ABORT?t[a].status=an.NEEDS_ABORT:t[a].status=an.RUN;else{S("transaction at "+h.toString()+" failed: "+r);for(a=0;a<t.length;a++)t[a].status=an.NEEDS_ABORT,t[a].abortReason=r}n.rerunTransactions_(e)}},a)},en.prototype.rerunTransactions_=function(e){var t=this.getAncestorTransactionNode_(e),n=t.path(),r=this.buildTransactionQueue_(t);return this.rerunTransactionQueue_(r,n),n},en.prototype.rerunTransactionQueue_=function(e,t){if(0!==e.length){for(var n,r=[],i=[],o=e.filter(function(e){return e.status===an.RUN}).map(function(e){return e.currentWriteId}),a=0;a<e.length;a++){var l=e[a],u=j.relativePath(t,l.path),c=!1,p=void 0;if(s.assert(null!==u,"rerunTransactionsUnderNode_: relativePath should not be null."),l.status===an.NEEDS_ABORT)c=!0,p=l.abortReason,i=i.concat(this.serverSyncTree_.ackUserWrite(l.currentWriteId,!0));else if(l.status===an.RUN)if(l.retryCount>=en.MAX_TRANSACTION_RETRIES_)c=!0,p="maxretry",i=i.concat(this.serverSyncTree_.ackUserWrite(l.currentWriteId,!0));else{var h=this.getLatestState_(l.path,o);l.currentInputSnapshot=h;var d=e[a].update(h.val());if(void 0!==d){te("transaction failed: Data returned ",d,l.path);var f=je(d);"object"===typeof d&&null!=d&&s.contains(d,".priority")||(f=f.updatePriority(h.getPriority()));var y=l.currentWriteId,v=this.generateServerValues(),m=et(f,v);l.currentOutputSnapshotRaw=f,l.currentOutputSnapshotResolved=m,l.currentWriteId=this.getNextWriteId_(),o.splice(o.indexOf(y),1),i=(i=i.concat(this.serverSyncTree_.applyUserOverwrite(l.path,m,l.currentWriteId,l.applyLocally))).concat(this.serverSyncTree_.ackUserWrite(y,!0))}else c=!0,p="nodata",i=i.concat(this.serverSyncTree_.ackUserWrite(l.currentWriteId,!0))}if(this.eventQueue_.raiseEventsForChangedPath(t,i),i=[],c&&(e[a].status=an.COMPLETED,n=e[a].unwatcher,setTimeout(n,Math.floor(0)),e[a].onComplete))if("nodata"===p){var g=new on(this,e[a].path),_=e[a].currentInputSnapshot,b=new He(_,g,ke);r.push(e[a].onComplete.bind(null,null,!1,b))}else r.push(e[a].onComplete.bind(null,new Error(p),!1,null))}this.pruneCompletedTransactionsBelowNode_(this.transactionQueueTree_);for(a=0;a<r.length;a++)W(r[a]);this.sendReadyTransactions_()}},en.prototype.getAncestorTransactionNode_=function(e){for(var t,n=this.transactionQueueTree_;null!==(t=e.getFront())&&null===n.getValue();)n=n.subTree(t),e=e.popFront();return n},en.prototype.buildTransactionQueue_=function(e){var t=[];return this.aggregateTransactionQueuesForNode_(e,t),t.sort(function(e,t){return e.order-t.order}),t},en.prototype.aggregateTransactionQueuesForNode_=function(e,t){var n=this,r=e.getValue();if(null!==r)for(var i=0;i<r.length;i++)t.push(r[i]);e.forEachChild(function(e){n.aggregateTransactionQueuesForNode_(e,t)})},en.prototype.pruneCompletedTransactionsBelowNode_=function(e){var t=this,n=e.getValue();if(n){for(var r=0,i=0;i<n.length;i++)n[i].status!==an.COMPLETED&&(n[r]=n[i],r++);n.length=r,e.setValue(n.length>0?n:null)}e.forEachChild(function(e){t.pruneCompletedTransactionsBelowNode_(e)})},en.prototype.abortTransactions_=function(e){var t=this,n=this.getAncestorTransactionNode_(e).path(),r=this.transactionQueueTree_.subTree(e);return r.forEachAncestor(function(e){t.abortTransactionsOnNode_(e)}),this.abortTransactionsOnNode_(r),r.forEachDescendant(function(e){t.abortTransactionsOnNode_(e)}),n},en.prototype.abortTransactionsOnNode_=function(e){var t=e.getValue();if(null!==t){for(var n=[],r=[],i=-1,o=0;o<t.length;o++)if(t[o].status===an.SENT_NEEDS_ABORT);else if(t[o].status===an.SENT)s.assert(i===o-1,"All SENT items should be at beginning of queue."),i=o,t[o].status=an.SENT_NEEDS_ABORT,t[o].abortReason="set";else if(s.assert(t[o].status===an.RUN,"Unexpected transaction status in abort"),t[o].unwatcher(),r=r.concat(this.serverSyncTree_.ackUserWrite(t[o].currentWriteId,!0)),t[o].onComplete){n.push(t[o].onComplete.bind(null,new Error("set"),!1,null))}-1===i?e.setValue(null):t.length=i+1,this.eventQueue_.raiseEventsForChangedPath(e.path(),r);for(o=0;o<n.length;o++)W(n[o])}};var un,cn=function(){function e(){this.repos_={},this.useRestClient_=!1}return e.getInstance=function(){return un||(un=new e),un},e.prototype.interrupt=function(){for(var e in this.repos_)for(var t in this.repos_[e])this.repos_[e][t].interrupt()},e.prototype.resume=function(){for(var e in this.repos_)for(var t in this.repos_[e])this.repos_[e][t].resume()},e.prototype.databaseFromApp=function(e,t){var n=t||e.options.databaseURL;void 0===n&&T("Can't determine Firebase Database URL.  Be sure to include databaseURL option when calling firebase.initializeApp().");var i=Y(n),o=i.repoInfo,a=void 0;return"undefined"!==typeof r&&(a=Object({NODE_ENV:"production",PUBLIC_URL:""}).FIREBASE_DATABASE_EMULATOR_HOST),a&&(n="http://"+a+"?ns="+o.namespace),ue("Invalid Firebase Database URL",1,i),i.path.isEmpty()||T("Database URL must point to the root of a Firebase Database (not including a child path)."),this.createRepo(o,e).database},e.prototype.deleteRepo=function(e){var t=s.safeGet(this.repos_,e.app.name);t&&s.safeGet(t,e.repoInfo_.toURLString())===e||T("Database "+e.app.name+"("+e.repoInfo_+") has already been deleted."),e.interrupt(),delete t[e.repoInfo_.toURLString()]},e.prototype.createRepo=function(e,t){var n=s.safeGet(this.repos_,t.name);n||(n={},this.repos_[t.name]=n);var r=s.safeGet(n,e.toURLString());return r&&T("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),r=new en(e,this.useRestClient_,t),n[e.toURLString()]=r,r},e.prototype.forceRestClient=function(e){this.useRestClient_=e},e}(),pn=function(){function e(e){this.repo_=e,e instanceof en||T("Don't call new Database() directly - please use firebase.database()."),this.root_=new on(e,j.Empty),this.INTERNAL=new hn(this)}return Object.defineProperty(e.prototype,"app",{get:function(){return this.repo_.app},enumerable:!0,configurable:!0}),e.prototype.ref=function(e){return this.checkDeleted_("ref"),s.validateArgCount("database.ref",0,1,arguments.length),e instanceof on?this.refFromURL(e.toString()):void 0!==e?this.root_.child(e):this.root_},e.prototype.refFromURL=function(e){var t="database.refFromURL";this.checkDeleted_(t),s.validateArgCount(t,1,1,arguments.length);var n=Y(e);ue(t,1,n);var r=n.repoInfo;return r.host!==this.repo_.repoInfo_.host&&T(t+": Host name does not match the current database: (found "+r.host+" but expected "+this.repo_.repoInfo_.host+")"),this.ref(n.path.toString())},e.prototype.checkDeleted_=function(e){null===this.repo_&&T("Cannot call "+e+" on a deleted database.")},e.prototype.goOffline=function(){s.validateArgCount("database.goOffline",0,0,arguments.length),this.checkDeleted_("goOffline"),this.repo_.interrupt()},e.prototype.goOnline=function(){s.validateArgCount("database.goOnline",0,0,arguments.length),this.checkDeleted_("goOnline"),this.repo_.resume()},e.ServerValue={TIMESTAMP:{".sv":"timestamp"}},e}(),hn=function(){function e(e){this.database=e}return e.prototype.delete=function(){return a.__awaiter(this,void 0,void 0,function(){return a.__generator(this,function(e){return this.database.checkDeleted_("delete"),cn.getInstance().deleteRepo(this.database.repo_),this.database.repo_=null,this.database.root_=null,this.database.INTERNAL=null,this.database=null,[2]})})},e}(),dn=Object.freeze({forceLongPolling:function(){Ht.forceDisallow(),zt.forceAllow()},forceWebSockets:function(){zt.forceDisallow()},isWebSocketsAvailable:function(){return Ht.isAvailable()},setSecurityDebugCallback:function(e,t){e.repo.persistentConnection_.securityDebugCallback_=t},stats:function(e,t){e.repo.stats(t)},statsIncrementCounter:function(e,t){e.repo.statsIncrementCounter(t)},dataUpdateCount:function(e){return e.repo.dataUpdateCount},interceptServerData:function(e,t){return e.repo.interceptServerData_(t)}}),fn=Jt;Jt.prototype.simpleListen=function(e,t){this.sendRequest("q",{p:e},t)},Jt.prototype.echo=function(e,t){this.sendRequest("echo",{d:e},t)};var yn=Kt,vn=Q,mn=Object.freeze({DataConnection:fn,RealTimeConnection:yn,hijackHash:function(e){var t=Jt.prototype.put;return Jt.prototype.put=function(n,r,i,o){void 0!==o&&(o=e()),t.call(this,n,r,i,o)},function(){Jt.prototype.put=t}},ConnectionTarget:vn,queryIdentifier:function(e){return e.queryIdentifier()},forceRestClient:function(e){cn.getInstance().forceRestClient(e)}}),gn=pn.ServerValue;function _n(t){var n;n=t.SDK_VERSION,Qt=n;var r=t.INTERNAL.registerService("database",function(e,t,n){return cn.getInstance().databaseFromApp(e,n)},{Reference:on,Query:Xe,Database:pn,DataSnapshot:He,enableLogging:b,INTERNAL:dn,ServerValue:gn,TEST_ACCESS:mn},null,!0);s.isNodeSdk()&&(e.exports=r)}_n(o),t.DataSnapshot=He,t.Database=pn,t.OnDisconnect=pe,t.Query=Xe,t.Reference=on,t.ServerValue=gn,t.enableLogging=b,t.registerDatabase=_n}).call(this,n(32))},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"===typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var l,u=[],c=!1,p=-1;function h(){c&&l&&(c=!1,l.length?u=l.concat(u):p=-1,u.length&&d())}function d(){if(!c){var e=s(h);c=!0;for(var t=u.length;t;){for(l=u,u=[];++p<t;)l&&l[p].run();p=-1,t=u.length}l=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function y(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new f(e,t)),1!==u.length||c||s(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}}]]);
  //# sourceMappingURL=2.92f679b6.chunk.js.map