PageSourceSearch

http://www.mulletshockey.com/nginbar.js

js mulletshockey.com collected 2026-10-09 17:08:08 UTC 891,350 bytes, 640 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
2let window = _____WB$wombat$assign$function_____("window");
3let self = _____WB$wombat$assign$function_____("self");
4let document = _____WB$wombat$assign$function_____("document");
5let location = _____WB$wombat$assign$function_____("location");
6let top = _____WB$wombat$assign$function_____("top");
7let parent = _____WB$wombat$assign$function_____("parent");
8let frames = _____WB$wombat$assign$function_____("frames");
9let opens = _____WB$wombat$assign$function_____("opens");
10!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=272)}([function(t,e,n){var r=n(227)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));
11/*! *****************************************************************************
12Copyright (c) Microsoft Corporation. All rights reserved.
13Licensed under the Apache License, Version 2.0 (the "License"); you may not use
14this file except in compliance with the License. You may obtain a copy of the
15License at http://www.apache.org/licenses/LICENSE-2.0
16
17THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
19WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
20MERCHANTABLITY OR NON-INFRINGEMENT.
21
22See the Apache Version 2.0 License for specific language governing permissions
23and limitations under the License.
24***************************************************************************** */
25var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}},function(t,e,n){var r=n(140);t.exports=function(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function n(t,e,n,r,i,o,s){try{var a=t[o](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,i)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var s=t.apply(e,r);function a(t){n(s,i,o,a,c,"next",t)}function c(t){n(s,i,o,a,c,"throw",t)}a(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";var r=n(5);var i=n(34),o=n(38);var s=n(18),a=n(29);function c(t){return t?1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}:a.a}var u=n(12);n.d(e,"a",(function(){return l}));var l=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var s=this.operator,a=function(t,e,n){if(t){if(t instanceof r.a)return t;if(t[i.a])return t[i.a]()}return t||e||n?new r.a(t,e,n):new r.a(o.a)}(t,e,n);if(s?a.add(s.call(a,this.source)):a.add(this.source||u.a.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a)),u.a.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){u.a.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),!function(t){for(;t;){var e=t,n=e.closed,i=e.destination,o=e.isStopped;
vendor: 4,503 bytes, line 25
25if(n||o)return!1;t=i&&i instanceof r.a?i:null}return!0}(t)?console.warn(e):t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=h(e))((function(e,r){var i;i=n.subscribe((function(e){try{t(e)}catch(t){r(t),i&&i.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[s.a]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:c(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=h(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function h(t){if(t||(t=u.a.Promise||Promise),!t)throw new Error("no Promise impl found");return t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(1),i=n(25),o=n(38),s=n(8),a=n(34),c=n(12),u=n(21),l=function(t){function e(n,r,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=o.a;break;case 1:if(!n){s.destination=o.a;break}if("object"==typeof n){n instanceof e?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new h(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new h(s,n,r,i)}return s}return r.a(e,t),e.prototype[a.a]=function(){return this},e.create=function(t,n,r){var i=new e(t,n,r);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(s.a),h=function(t){function e(e,n,r,s){var a,c=t.call(this)||this;c._parentSubscriber=e;var u=c;return Object(i.a)(n)?a=n:n&&(a=n.next,r=n.error,s=n.complete,n!==o.a&&(u=Object.create(n),Object(i.a)(u.unsubscribe)&&c.add(u.unsubscribe.bind(u)),u.unsubscribe=c.unsubscribe.bind(c))),c._context=u,c._next=a,c._error=r,c._complete=s,c}return r.a(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;c.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=c.a.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):Object(u.a)(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;Object(u.a)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};c.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),c.a.useDeprecatedSynchronousErrorHandling)throw t;Object(u.a)(t)}},e.prototype.__tryOrSetError=function(t,e,n){if(!c.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return c.a.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(Object(u.a)(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(l)},function(t,e,n){"use strict";n(84);const r={urls:{accountSettings:"https://my.sportngin.com/user/account",apiProxy:"https://api.sportngin.com",hq:"https://app.sportngin.com/org",mySe:"https://my.sportngin.com/user",nginUserDashboard:"https://login.sportngin.com",peo
25pleAndOrgsUrl:"https://people-and-orgs.ui.sportsengine.com",se:"https://www.sportsengine.com",profile:"https://my.sportngin.com/user/profiles",seApi:"https://se-api.sportsengine.com",seBar:"https://se-bar.sportngin.com",snFrontend:"https://app.sportngin.com",snapAsset:"https://s3.amazonaws.com/sportngin-snap-production/ui_themes/assets/latest",snapTheme:"https://s3.amazonaws.com/sportngin-snap-production/ui_themes/ngin-bar/latest",sprites:"sportngin-snap-production/ui_themes/assets/latest/images/system-sprite.svg",svg:"sportngin-snap-production/ui_themes/assets/latest/images/system-sprite.svg",teamCenter:"https://app.sportngin.com/teams",userService:"https://user.sportngin.com"},firebase:{seBar:{apiKey:"AIzaSyB2OaWyPzfB56ouB2dLGUPngayKU-7sD9Y",authDomain:"sportngin-android.firebaseapp.com",databaseURL:"https://sportsengine-production-se-bar.firebaseio.com/",projectId:"sportngin-android",storageBucket:"sportngin-android.appspot.com"},chat:{apiKey:"AIzaSyB2OaWyPzfB56ouB2dLGUPngayKU-7sD9Y",authDomain:"sportngin-android.firebaseapp.com",databaseURL:"https://sportngin-android.firebaseio.com/",projectId:"sportngin-android",storageBucket:"sportngin-android.appspot.com"}},stream:{apiKey:"bpmpcfvfbv78"},crossDomain:{targetOrigin:"https://se-bar.sportngin.com",hostPath:"/cross-domain.html"},signOutUrl:"".concat("https://user.sportngin.com","/oauth/sign_out"),signInUrl:"".concat("https://user.sportngin.com","/users/sign_in"),signInUserReturnToOverride:void 0,signOutUserReturnToOverride:void 0,signInReloadOverrideUrl:void 0},i=Object.assign(r,window.nginBarConfig,window.seBarConfig);e.a=i},function(t,e,n){"use strict";n.d(e,"i",(function(){return r})),n.d(e,"h",(function(){return i})),n.d(e,"j",(function(){return o})),n.d(e,"k",(function(){return s})),n.d(e,"g",(function(){return a})),n.d(e,"f",(function(){return c})),n.d(e,"n",(function(){return u})),n.d(e,"o",(function(){return l})),n.d(e,"p",(function(){return h})),n.d(e,"q",(function(){return p})),n.d(e,"l",(function(){return d})),n.d(e,"m",(function(){return f})),n.d(e,"r",(function(){return v})),n.d(e,"s",(function(){return g})),n.d(e,"a",(function(){return m})),n.d(e,"b",(function(){return y})),n.d(e,"c",(function(){return b})),n.d(e,"d",(function(){return _})),n.d(e,"e",(function(){return w}));const r="nb-sportngin",i="hq",o="my-se",s="team-center",a="DEFAULT",c=[i,o,s,a],u="guardian_invite",l="orphan_invite",h="roster_invite",p="team_invite",d="accept",f="decline",v="action-progress",g="view",m="application-error",y="connection-error",b="ok",_="processing",w="response-error"},function(t,e,n){"use strict";var r=n(22),i=n(42),o=n(25),s=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n  "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}();n.d(e,"a",(function(){return a}));var a=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var e;if(!this.closed){var n=this._parentOrParents,a=this._unsubscribe,u=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(null!==n)for(var l=0;l<n.length;++l){n[l].remove(this)}if(Object(o.a)(a))try{a.call(this)}catch(t){e=t instanceof s?c(t.errors):[t]}if(Object(r.a)(u)){l=-1;for(var h=u.length;++l<h;){var p=u[l];if(Object(i.a)(p))try{p.unsubscribe()}catch(t){e=e||[],t instanceof s?e=e.concat(c(t.errors)):e.push(t)}}}if(e)throw new s(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=n._parentOrParents;if(null===i)n._parentOrParents=this;else if(i instanceof t){if(i===this)return n;n._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return n;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[n]:o.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=((e=new t).closed=!0,e),t}();function c(t){return t.reduce((function(t,e){return t.concat(e instanceof s?e.errors:e)}),[])}},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t.storageRegisterClient="storage-host:register-client",t.storageSetItem="storage-host:set-item",t.storageUnregisterClient="storage-host:unregister-client",t.mutexCancel="mutex:cancel",t.mutexExtend="mutex:extend",t.mutexRelease="mutex:release",t.mutexRequest="mutex:request"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(28),i=n(50),o=n(4);function s(t,e,n,s,a){if(void 0===a&&(a=new r.a(t,n,s)),!a.closed)return e instanceof o.a?e.subscribe(a):Object(i.a)(e)(a)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(1),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(n(5).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;r=t},get useDeprecatedSynchronousErrorHandling(){return r}}},function(t,e,n){"use strict";var r=n(8);class i{constructor(){this.subscriptions=[]}dispose(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions.length=0}trackSubscription(t,e){let n;n=t instanceof r.a?t:t.subscribe(e?e.bind(this):void 0),this.subscriptions.push(n)}}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";var r=n(13),i=n(40),o=n(35),s=n(26),a=n(73),c=n.n(a),u=n(6),l=n(7);const h=["parent","elementId"],p=document,d=window,f=p.documentElement;let v,g=0;function m(t){return t}class y extends r.a{constructor(t){super(),v=v||this,t=t||{},this._id=++g,this._hasExternalElement=!!t.elementId,this._elementId=t.elementId||"nb-component-".concat(this._id),this._elementAttr="data-nb-component-".concat(this._id),this.selector=".".concat(this._elementId),this._elements={},this._components={},this.loaded=!1,this.updated=!1,this.doc=p,this.win=d,this.html=f,Object(s.a)(this),this._setOptions(Object(s.e)(t,...h)),this._setParent(t.parent),t.elementId&&this._init()}get root(){return v}get referrerConfigParams(){var t="se-bar-theme=".concat(this.root.theme,"&se-bar-app=").concat(this.root.app);switch(this.root.app){case l.h:return t+(this.root.orgId?"&se-bar-org-id=".concat(this.root.orgId):"");case l.k:return t+(this.root.teamId?"&se-bar-team-id=".concat(this.root.teamId):"");default:return t}}
25render(){if("function"!=typeof this.templateFn)throw new Error("templateFn must be a function");const t=Object.assign({$ctrl:this,config:u.a},i);return this.templateFn(t)}toString(){return'<span id="'.concat(this._elementId,'"></span>')}trackElementAs(t){return this._elements[t]=null," ".concat(this._elementAttr,'="').concat(t,'" ')}_afterRender(){return Promise.resolve().then(this._setElements).then(this._bindEvents).then(this._emitFn("render")).then(this.afterRender||m)}_afterUpdate(){return Promise.resolve().then(()=>this.updated=!0).then(this._emitFn("update")).then(this.afterUpdate||m)}_destroy(){return this.dispose(),Promise.resolve().then(this._unbindEvents).then(this._unsetParent).then(this._emitFn("destroy"))}_init(){const t=Promise.resolve().then(this.init||m).then(()=>this._inited=!0).then(this._emitFn("init"));return this._parent?t:t.then(this._update)}_update(){return this.loaded||(this.loaded=!this.load),this.loaded?Promise.resolve().then(this._render).then(this._afterRender).then(this._afterUpdate):Promise.resolve().then(this._render).then(this._afterRender).then(this.load).then(()=>this.loaded=!0).then(this._emitFn("load")).then(this.afterLoad||m).then(this._render).then(this._afterRender).then(this._afterUpdate)}_render(){const t=this.render(),e=this.appendTo?Object(s.c)(this.appendTo):null,n=this._parent&&this._parent.element||null,r=e||n||f,i=this._hasExternalElement;let o,a=Object(s.c)(this.element,r);if(a||(a=Object(s.c)("#".concat(this._elementId),r)),!a&&e&&(o=!0,a=e),a){if(i?(a.innerHTML=t,this.element=a):(this.element=Object(s.b)(t),o?a.appendChild(this.element):Object(s.f)(a,this.element)),this.element.classList)this.element.classList.add(this._elementId);else{const t=this.element.getAttribute("class");this.element.setAttribute("class","".concat(t," ").concat(this._elementId))}return this.element}}_setElements(){for(const t in this._elements)this[t]=this._findElement("[".concat(this._elementAttr,'="').concat(t,'"]'))}_setOptions(t){const e=Object(s.d)(this);for(const n in t)e.includes(n)||(this[n]=t[n])}_setParent(t){t&&(this._parent=t,t._trackComponent(this),t.on("init",this._init),t.on("update",this._update),t.on("destroy",this._destroy),t._inited&&!this._inited&&this._init())}_trackComponent(t){t instanceof y&&(this._components[t._id]=t)}_unsetParent(){const t=this._parent;t&&(t._untrackComponent(this),t.off("init",this._init),t.off("update",this._update),t.off("destroy",this._destroy))}_untrackComponent(t){t instanceof y&&delete this._components[t._id]}_findPlaceholder(){}_findElement(t){return this.element&&!this.findInParent?this.element.matches(t)?this.element:Object(s.c)(t,this.element):this._parent?this._parent._findElement(t):null}_bindEvents(){Object(o.a)("on",this._rawEventBindings())}_unbindEvents(){Object(o.a)("off",this._rawEventBindings())}_rawEventBindings(){return this.eventBindings||[]}_emitFn(t){return e=>(this.emit(t,this),e)}}c()(y.prototype),e.a=y},,function(t,e,n){"use strict";var r=n(74),i=n.n(r),o=n(6);const s=["HEAD","GET","POST"],a={accept:!0,"accept-language":!0,"content-language":!0,"content-type":["application/x-www-form-urlencoded","multipart/form-data","text/plain"],dpr:!0,downlink:!0,"save-data":!0,"viewport-width":!0,width:!0};function c(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(t){if(!s.includes(t.toLocaleUpperCase()))throw new Error("Cannot simplify a '".concat(t,"' request"))}(t),e?Object.keys(e).reduce((t,r)=>{const i=a[r.toLocaleLowerCase()];if(!i)return t;const o=e[r];if(!0===i)return t[r]=o,t;if(Array.isArray(i)){if(i.includes(o))return t[r]=o,t;if(!n)throw new Error("Header '".concat(r,": ").concat(o," cannot be simplified"))}return t},{}):e}const u=i.a.create({withCredentials:!0});u.defaults.headers={Accept:"application/vnd.ngin-api.v2, application/json","X-SPORTS-VERSION":"v1"},u.defaults.baseURL=o.a.urls.seApi;u.interceptors.response.use(t=>(t=>{const e=t&&t.result;if(!(e&&e instanceof Object))return t;const n=t.metadata||{};return e&&n.pagination&&(e._pagination=n.pagination),n.trace_id&&(e._trace_id=n.trace_id),e})(t.data),t=>{var e;return(null===(e=t.response)||void 0===e?void 0:e.data)&&(t.data=t.response.data.error),Promise.reject(t)}),u.interceptors.request.use(t=>{var e;return(null===(e=t)||void 0===e?void 0:e.simpleHeaders)&&(t.headers=c(t.method,t.headers)),t}),u.setRequestBaseUrl=function(t){return u.defaults.baseURL=t,this};e.a=u},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return i}));const r={menu:"Menu",sportsengine:"SportsEngine",sportsengine_hq:"SportsEngine HQ",sportsengine_alt:"sportsengine.com - Get out and play.",HELP:{tooltip:"Help"}
25,MESSAGES:{empty_description:"We will let you know when you have a new message in your inbox.",empty_title:"No Messages",error:"An error occured",menu_error:"An error occured getting messages",messages_list:"Messages List",new:"New message",plus:"+ ",see_all:"See All",title:"Messages",tooltip:"Messages"},CHAT:{empty_description:"You have not joined any teams. When you do, chat notifications will appear here.",empty_title:"No Chats",error:"An error occured",menu_error:"An error occured getting chats",tooltip:"Chat",chats:"${count} unread chat messages",chats_list:"Chat List",chats_plural:"${count} unread chat messages",chats_none:"Chats",last_read:"Last read: ${last_read_date}"},NAVIGATION:{label:"Navigation"},NOTIFICATIONS:{application_error:"An unexpected application error occured.",done_accept:"Accepted",done_decline:"Successfully declined",empty_title:"You're All Caught Up!",empty_description:"We will let you know when you have new notifications.",error_connection_lost:"Connection lost.",error_occured:"An error occured",processing_accept:"Accepting",processing_decline:"Declining",subject_guardian_invite:"guardianship",subject_orphan_invite:"claim",subject_roster_invite:"roster addition",subject_team_invite:"team addition",title:"Notifications",tooltip:"Notifications"},PROFILE:{account_settings:"Account Settings",ca_notice:"CA Notice",do_not_sell:"Do Not Sell My Personal Information",get_help:"Help Center",messages:"${count} unread message",messages_plural:"${count} unread messages",messages_none:"Messages",my_sportsengine:"My SportsEngine",notifications:"${count} new notification",notifications_plural:"${count} new notifications",notifications_none:"Notifications",privacy_policy:"Privacy Policy",settings:"Settings",sign_in:"Sign In",sign_out:"Sign Out",signed_in_as:"Signed In As",tooltip:"Your Profile and Settings"},SESSION_TIMEOUT:{INACTIVITY:{header:"Are you still there?",message:"For your security, you will be signed out in <b>${secondsRemaining} seconds</b>.",button__sign_out:"Sign Out",button__extend:"I'm Here"}},SPINNER:{loading:"Loading"},SWITCHER:{empty_title:"No Teams",empty_description:"Your teams will show here once you or members of your household are rostered",organizations_view_all:"View all organizations",organizations:"My Organizations",organizations_mobile:"My Orgs",teams_view_all:"View all teams",teams:"My Teams",tooltip:"Switch views"}};function i(t,e){if("string"!=typeof t)return console.error("Translation key is an invalid type (".concat(typeof t,"):"),t);if(!t)return console.lerror("Translation key cannot be an empty string.");let n,i=r,s="count"in(e=e||{});const a=t.split(".");for(;i&&a.length;)n=a.shift(),!a.length&&s&&(n=o(n,e.count,i)),i=i[n];return i?function(t,e){let n,r,i;for(n in e)e.hasOwnProperty(n)&&("number"==typeof(r=e[n])&&(r=r.toString()),"string"==typeof r&&(i=new RegExp("\\$\\{"+n+"\\}","g"),t=t.replace(i,e[n])));return t}(i,e):(s?console.error("No translation found for key '".concat(t,"' (").concat(n,").")):console.error("No translation found for key '".concat(t,"'.")),t)}function o(t,e,n){return 1===e?t:0===e&&"".concat(t,"_none")in n?"".concat(t,"_none"):"".concat(t,"_plural")}e.a=i},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";function r(t){setTimeout((function(){throw t}),0)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return h}));var r=n(1),i=n(4),o=n(5),s=n(8),a=n(20),c=n(47),u=n(34),l=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return r.a(e,t),e}(o.a),h=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return r.a(e,t),e.prototype[u.a]=function(){return new l(this)},e.prototype.lift=function(t){var e=new p(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new a.a;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new a.a;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),i=0;i<n;i++)r[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new a.a;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new a.a;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new a.a;return this.hasError?(t.error(this.thrownError),s.a.EMPTY):this.isStopped?(t.complete(),s.a.EMPTY):(this.observers.push(t),new c.a(this,t))},e.prototype.asObservable=function(){var t=new i.a;return t.source=this,t},e.create=function(t,e){return new p(t,e)},e}(i.a),p=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return r.a(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):s.a.EMPTY},e}(h)},function(t,e,n){"use strict";function r(t){return t&&"function"==typeof t.schedule}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){return"function"==typeof t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}
25)),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"d",(function(){return i})),n.d(e,"e",(function(){return u})),n.d(e,"f",(function(){return c})),n.d(e,"g",(function(){return r}));const r=(t,e)=>{let n;return function(){const r=arguments,i=this;n||(t.apply(i,r),n=!0,setTimeout(()=>n=!1,e))}},i=(t,e)=>{if(!t)return[];let n=[];const r=Object.getOwnPropertyNames(t);for(const i of r){const r=Object.getOwnPropertyDescriptor(t,i)||{},o=r.hasOwnProperty("get")||r.hasOwnProperty("set");e&&(o||typeof t[i]!==e)||("function"===e&&"constructor"===i||n.push(i))}return n.concat(i(Object.getPrototypeOf(t),e))},o=t=>{const e=i(t,"function");for(const n of e)try{t[n]=t[n].bind(t)}catch(t){}},s=(t,e)=>(e=e||document.documentElement,t instanceof HTMLElement&&e.contains(t)?t:"string"!=typeof t?null:e.querySelector(t)),a=t=>{var e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild},c=(t,e)=>{t.parentNode.replaceChild(e,t)},u=(t,e)=>{for(var n=Object.keys(t),r={},i=0;i<n.length;i++){var o=n[i],s=t[o];e.includes(o)||(r[o]=s)}return r}},function(t,e,n){"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}n.d(e,"a",(function(){return i}));var i=r()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(1),i=function(t){function e(e,n,r){var i=t.call(this)||this;return i.parent=e,i.outerValue=n,i.outerIndex=r,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(n(5).a)},function(t,e,n){"use strict";function r(){}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(77),i=n(114),o=Object.prototype.toString;function s(t){return"[object Array]"===o.call(t)}function a(t){return null!==t&&"object"==typeof t}function c(t){return"[object Function]"===o.call(t)}function u(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),s(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}t.exports={isArray:s,isArrayBuffer:function(t){return"[object ArrayBuffer]"===o.call(t)},isBuffer:i,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===o.call(t)},isFile:function(t){return"[object File]"===o.call(t)},isBlob:function(t){return"[object Blob]"===o.call(t)},isFunction:c,isStream:function(t){return a(t)&&c(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:u,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,i=arguments.length;r<i;r++)u(arguments[r],n);return e},extend:function(t,e,n){return u(e,(function(e,i){t[i]=n&&"function"==typeof e?r(e,n):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t.storageUpdate="storage-client:update",t.mutexTimeout="mutex:timeout",t.mutexGranted="mutex:granted"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(4),i=n(44),o=n(36);function s(t,e){return e?Object(o.a)(t,e):new r.a(Object(i.a)(t))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(52),i=new(n(51).a)(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"d",(function(){return o}
25));let r=1,i=!0,o=!0;try{const t=function(){},e={passive:!0};window.addEventListener("test",t,e),window.removeEventListener("test",t,e),i={passive:!0,capture:!0},o={passive:!1,capture:!0}}catch(t){}function s(t,e){const n=t;if(!n||!e)return;const r=n.data=n.data||{};r.handlers=r.handlers||[];r.handled=!0,r.handlers.push(e)}function a(t,e){const n=function(t){const e=t;return e&&e.data&&e.data.handlers||[]}(t),r=[].concat(e||[]);for(const t of r)if(-1!==n.indexOf(t))return!0;return!1}function c(t,e){let n,r;const i=[].concat(e||[]),o="on"===t;for(;i.length>2;)r="function"==typeof i[3],n=i.splice(0,r?4:3),l.apply(void 0,n),o&&u.apply(void 0,n)}function u(t,e,n,i,o){if(!t)return;const s="string"==typeof n?n:void 0,a=s?i:n,c=s?function(t,e,n){return function(r){if(h(t,r,e))return n.apply(void 0,arguments)}}(t,s,a):function(t){return function(){return t.apply(void 0,arguments)}}(a);(t.seEventBindings=t.seEventBindings||[]).push({type:e,handler:c,guid:a.guid=a.guid||r++,selector:s}),t.addEventListener(e,c,o||!1)}function l(t,e,n,r){if(!t)return;const i=t.seEventBindings||[],o="string"==typeof n?n:void 0,s=o?r:n;i.filter(t=>t.type===e&&t.guid===s.guid&&t.selector===o).forEach(n=>t.removeEventListener(e,n.handler))}function h(t,e,n){let r;const i=[].concat(function(t){const e=t.data=t.data||{};let n=t.target;if(!e.seTargets){e.seTargets=[];do{e.seTargets.unshift(n)}while(n=n.parentNode)}return e.seTargets}(e));for(;i.length;)if((r=i.pop()).matches&&r.matches(n))return e.data.delegatedTarget=r,!0;return!1}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(4),i=n(8);function o(t,e){return new r.a((function(n){var r=new i.a,o=0;return r.add(e.schedule((function(){o!==t.length?(n.next(t[o++]),n.closed||r.add(this.schedule())):n.complete()}))),r}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(1),i=n(5);function o(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new s(t,e))}}var s=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.thisArg))},t}(),a=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return r.a(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(12),i=n(21),o={closed:!0,next:function(t){},error:function(t){if(r.a.useDeprecatedSynchronousErrorHandling)throw t;Object(i.a)(t)},complete:function(){}}},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return i})),function(t){t.production="production",t.staging="staging",t.development="development",t.test="test"}(r||(r={}));const i={current:"production"}},function(t,e,n){"use strict";n.r(e),n.d(e,"formatDate",(function(){return s})),n.d(e,"hasTouch",(function(){return o})),n.d(e,"initializeCSSVars",(function(){return f})),n.d(e,"initialsFromFullName",(function(){return a})),n.d(e,"multiToggleFactory",(function(){return c}));var r=n(19);n.d(e,"t",(function(){return r.a}));var i=n(26);const o="ontouchstart"in window;function s(t){const e=new Date(Date.parse(t));return isNaN(e.getTime())?"Unknown":e.toLocaleString("en-US",{month:"short",day:"numeric"})}function a(t){if(!t.trim())return"";return t.trim().split(" ").filter(t=>""!=t).map(t=>t[0].toUpperCase()).join("")}const c=(t,e)=>(n,r)=>t.includes(r)?(t.forEach(t=>n.classList.remove(e(t))),n.classList.add(e(r)),!0):console.error("multiToggleFactory: '".concat(r,"' must be in the list: ").concat(t.join(", ")));let u,l=!1;const h=document.querySelector("se-bar, #ngin-bar"),p=document.documentElement.style,d=30;function f(){l||(l=!0,v(),g(),m(),window.addEventListener("resize",Object(i.g)(v),d),window.addEventListener("scroll",g,!0),setInterval(m,d))}function v(){p.setProperty("--vh","".concat(.01*window.innerHeight,"px"))}function g(){y()}function m(){y()}function y(){var t=h.getBoundingClientRect();
25u!==t.top&&(u=t.top,p.setProperty("--se-bar-top","".concat(t.top,"px")))}},function(t,e,n){"use strict";var r=n(13);class i extends r.a{constructor(t){super(),this.sessionState$=t}static isExpired(t){return t.expires_at<=Date.now()}static isValid(t){return!!(t&&t.id&&t.expires_at&&t.alert_after&&t.ping_after)}static isAuthenticated(t){return i.isValid(t)&&!i.isExpired(t)}get authenticated(){const t=this.sessionState$.currentSessionState;return i.isAuthenticated(t)}signOut(t){var e,n;this.sessionState$.next({authenticated:!1,reason:t,trace_id:null===(e=this.sessionState$.currentSessionState)||void 0===e?void 0:e.trace_id,prev_trace_id:null===(n=this.sessionState$.currentSessionState)||void 0===n?void 0:n.prev_trace_id})}}var o=n(57),s=n(46),a=n(4),c=n(69),u=n(37),l=n(164),h=n(156),p=n(1),d=n(23),f=n(11),v=n(10);var g=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new m(t,this.notifier,this.source))},t}(),m=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.notifier=n,i.source=r,i}return p.a(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.errors,r=this.retries,i=this.retriesSubscription;if(r)this.errors=null,this.retriesSubscription=null;else{n=new d.a;try{r=(0,this.notifier)(n)}catch(e){return t.prototype.error.call(this,e)}i=Object(v.a)(this,r)}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=i,n.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype.notifyNext=function(t,e,n,r,i){var o=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=o,this.source.subscribe(this)},e}(f.a),y=n(6);const b=(()=>{function t(t){return Error.call(this),this.message="User is not authenticated",this.traceId=t,this}return t.prototype=Object.create(Error.prototype),t})();var _;!function(t){t[t.network=-1]="network",t[t.unauthorized=401]="unauthorized",t[t.notFound=404]="notFound"}(_||(_={}));const w=Object.keys(_).map(t=>_[t]);function S(t){const e=Date.now();return Object.assign(t,{authenticated:!0,expires_at:new Date(e+t.expires_in).valueOf(),ping_after:new Date(e+t.ping_in).valueOf(),alert_after:new Date(e+t.alert_in).valueOf(),trace_id:t._trace_id})}const C="global_session/me",E=2;function x(t){return e=>e.pipe(Object(c.a)((e,n)=>(function(t){var e;return t instanceof b||(null===(e=t.response)||void 0===e?void 0:e.status)&&w.includes(t.response.status)})(e)&&n<t?Object(o.a)(e):Object(s.a)(e)))}class T{constructor(t,e){this.location=t,this.request=e}get primaryAPIBaseUrl(){return y.a.urls.seApi}get alternateAPIBaseUrl(){return this.location.isVanityDomain?"https://".concat(this.location.origin,"/apigateway"):y.a.urls.apiProxy}get explicitFallbackUrl(){return y.a.apiFallbackUrl}fetch(){return this.doRequest("get").pipe(Object(u.a)(S),Object(l.a)())}ping(t){const e={last_activity_from_expires:t};return this.doRequest("post",e).pipe(Object(u.a)(S),Object(l.a)())}doRequest(t,e){if(this.location.isVanityDomain&&!y.a.loggedIn)return Object(s.a)(new b("auto"));return this.doRequestWithRetries(t,e).pipe(Object(h.a)(t=>(console.log("[se-bar] GlobalSessionEndpoint.doRequest.  Interpreting request errors as unauthenticated",t),Object(s.a)(new b(function(t){var e,n,r;return t instanceof b?t.traceId:null===(r=null===(n=null===(e=t.response)||void 0===e?void 0:e.data)||void 0===n?void 0:n.metadata)||void 0===r?void 0:r.trace_id}(t))))))}doRequestWithRetries(t,e){return this.doRequestWithBaseUrlDiscovery(t,e).pipe(Object(h.a)(n=>this.doRequestWithBaseUrlDiscovery(t,e)))}
25doRequestWithBaseUrlDiscovery(t,e){return this.createRequest(t,this.primaryAPIBaseUrl,e).pipe(Object(h.a)(n=>this.createRequest(t,this.alternateAPIBaseUrl,e)))}attemptBaseUrlRequest(t,e,n){return this.createRequest(t,e,n).pipe((r=x(E),function(t){return t.lift(new g(r,t))}));var r}conditionalDiscovery(t){return e=>this.request.defaults.baseURL?Object(s.a)(e):t(e)}getMakeRequestFn(t,e,n){const r={headers:{Accept:"application/json"},simpleHeaders:!0};return e&&(r.baseURL=e),n&&(r.headers["Content-Type"]="application/x-www-form-urlencoded"),"get"===t?()=>this.request[t](C,r):()=>this.request[t](C,function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).reduce((e,n)=>{const r=t[n];if("object"==typeof r)throw new Error("complex objects are not supported");return e.length&&(e+="&"),e+"".concat(n,"=").concat(encodeURIComponent(r.toString()))},e)}(n),r)}createRequest(t,e,n){const r=this.getMakeRequestFn(t,e,n);return new a.a(n=>{console.log("[se-bar] GlobalSessionEndpoint.createRequest",{baseUrl:e}),r().then(n=>{var r,o;const s="post"===t&&i.isAuthenticated(n),a="get"===t&&!!(null===(r=n)||void 0===r?void 0:r.id);return s||a?(this.request.setRequestBaseUrl(e),n):(console.warn("not authenticated",t,n),Promise.reject(new b(null===(o=n)||void 0===o?void 0:o.trace_id)))}).then(t=>{n.next(t),n.complete()}).catch(t=>n.error(t))})}}var I=n(20),k=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return p.a(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new I.a;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(d.a),O=n(260),A=n(160),R=n(159),N=n(67),P=n(5),M=n(29),D=n(25);function L(t,e,n){return function(r){return r.lift(new j(t,e,n))}}var j=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new U(t,this.nextOrObserver,this.error,this.complete))},t}(),U=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o._tapNext=M.a,o._tapError=M.a,o._tapComplete=M.a,o._tapError=r||M.a,o._tapComplete=i||M.a,Object(D.a)(n)?(o._context=o,o._tapNext=n):n&&(o._context=n,o._tapNext=n.next||M.a,o._tapError=n.error||M.a,o._tapComplete=n.complete||M.a),o}return p.a(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(P.a),F=n(31),H=n(56),B=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};class q extends H.a{constructor(){super(F.a),this.crossdomainFrame=q.createCrossDomainHostFrame(),this.ready=this.initIFrame()}static createCrossDomainHostFrame(){const t=document.createElement("iframe");return t.src="".concat(y.a.urls.seBar).concat(y.a.crossDomain.hostPath),t.width="0",t.height="0",Object.assign(t.style,{border:"none",position:"absolute",left:"-9999px",top:"-9999px"}),t}postMessageToHost(t,e){return B(this,void 0,void 0,(function*(){yield this.ready,this.crossdomainFrame.contentWindow.postMessage({type:t,data:e},y.a.crossDomain.targetOrigin)}))}dispose(){super.dispose(),this.crossdomainFrame.remove()}initIFrame(){return new Promise(t=>{console.log("[se-bar CrossDomainClient] initIFrame"),this.crossdomainFrame.addEventListener("load",()=>t()),document.body.appendChild(this.crossdomainFrame)})}}var V=n(9),W=n(158);function z(t){return t.type===F.a.storageUpdate}class $ extends r.a{constructor(t){super(),this.xdClient=t,this.items={},this.updates$=this.xdClient.messages$.pipe(Object(W.a)(z),Object(u.a)(t=>t.data),Object(R.a)()),this.trackSubscription(this.xdClient.messages$,this.onMessage),this.xdClient.postMessageToHost(V.a.storageRegisterClient)}setItem(t,e){this.xdClient.postMessageToHost(V.a.storageSetItem,{key:t,value:e}),this.items[t]=e}getItem(t){return this.items[t]}observeKey(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.updates$.pipe(Object(W.a)(n=>n.key===t&&(!e||void 0!==n.value)),Object(u.a)(t=>t.value),Object(l.a)())}onMessage(t){switch(t.type){case F.a.storageUpdate:this.onStorageUpdate(t)}}onStorageUpdate(t){this.items[t.data.key]=t.data.value}}n(59);var Y=n(65),K=n(68),G=n(66),Q=n(165),X=n(166),J=n(85),Z=n(259);const tt=250;class et extends r.a{constructor(t,e,n){super(),this.xdClient=t,this.request=e,this.event=n,this.request.options.autoExtend&&(this.autoExtend$=this.initAutoExtend(this.request.options.autoExtend),this.trackSubscription(this.autoExtend$,this.extend))}extend(){this.xdClient.postMessageToHost(V.a.mutexExtend,this.request.mutexData)}release(){this.dispose()}dispose(){super.dispose(),console.log("[se-bar MutexLock] releasing",this.request.mutexData),this.xdClient.postMessageToHost(V.a.mutexRelease,this.request.mutexData)}initAutoExtend(t){return Object(Z.a)(this.request.releaseTimeout-tt).pipe(Object(X.a)(!0===t?1/0:t),Object(u.a)(()=>{}),Object(R.a)())}}
25class nt extends Error{constructor(t){super("Mutex request aborted by requester".concat(t?": ".concat(t):"")),this.reason=t,this.mutexCanceled=!0}static isMutexAbortedError(t){return t&&t.mutexCanceled}}class rt extends Error{constructor(t){super("Mutex request canceled by requester".concat(t?": ".concat(t):"")),this.reason=t,this.mutexCanceled=!0}static isMutexCanceledError(t){return t&&t.mutexCanceled}}class it extends a.a{constructor(t,e,n,r){super(t=>(this.observer=t,this.init(t))),this.xdClient=t,this.resourceKey=e,this.releaseTimeout=n,this.options=r,this.requestId=Object(J.v4)(),this.cancel$$=new K.a,this.cancel$=this.cancel$$.asObservable(),this.mutexData={resourceKey:e,requestId:this.requestId}}get granted(){return this._granted}cancel(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];console.log("[se-bar MutexClientRequest] cancel: %s",t,this.mutexData,...n),this.cancel$$.next(t),this.observer.error(new rt(t)),this.xdClient.postMessageToHost(V.a.mutexCancel,this.mutexData)}abort(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];console.log("[se-bar MutexClientRequest] abort: %s",t,this.mutexData,...n),this.observer.error(new nt(t)),this.xdClient.postMessageToHost(V.a.mutexCancel,this.mutexData)}initGranted(){const t=this.options.grantTimeout?Object(Q.a)(this.options.grantTimeout):L();return this.xdClient.filterMessages(F.a.mutexGranted).pipe(L(t=>console.log("[se-bar MutexClientRequest] received mutexGranted",t.data)),Object(W.a)(t=>t.data.requestId===this.requestId),t,Object(h.a)(t=>(t instanceof G.a&&this.abort("timeout"),Object(s.a)(t))),Object(X.a)(1),Object(u.a)(t=>new et(this.xdClient,this,t.data)),L(()=>this._granted=!0),Object(l.a)())}init(t){const e=this.initGranted().subscribe(t),n=Object.assign({releaseTimeout:this.releaseTimeout},this.mutexData);return console.log("[se-bar MutexClientRequest] sending mutexRequest",n),this.xdClient.postMessageToHost(V.a.mutexRequest,n),()=>{e.unsubscribe()}}}class ot extends r.a{constructor(t){super(),this.xdClient=t}request(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new it(this.xdClient,t,e,n||{})}}class st extends Error{constructor(){super("Mutex aborted by user"),this.mutexAborted=!0}static isMutexAbortedError(t){return t&&t.mutexAborted}}var at,ct;!function(t){t.byTraceId="byTraceId"}(at||(at={}));class ut{constructor(t,e,n,r,i){this.lockRequest$=n,this.response$=r,this.subscription=i,this.abort$$=new d.a,this.abort$=this.abort$$.asObservable(),this._prevTraceId=t,this._protection=e}get isProtected(){return!!this.protection}get prevTraceId(){return this._prevTraceId}get protection(){return this._protection}protect(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._prevTraceId=t,!0!==this._protection&&(this._protection=e)}canAbort(t){return!this.isProtected||this.protection===at.byTraceId&&this.prevTraceId===t}abort(){this.abort$$.error(new st)}dispose(){this.abort$$.complete(),this.subscription.unsubscribe()}}!function(t){t.inactivity="inactivity",t.unknown="unknown",t.userSignOut="user-sign-out"}(ct||(ct={}));const lt="se-bar:session-state:ping",ht=5e3,pt=250;class dt extends r.a{constructor(t,e,n){super(),this.endpoint=t,this.mutexClient=e,this.userActivity$=n,this.lastDebugState={},this.debug$$=new k(void 0),this.debug$=this.debug$$.pipe(Object(u.a)(t=>Object.assign(this.lastDebugState,t)),Object(R.a)()),this.resetDebug()}get pingInProgress(){return!!this.pingRequest}ping(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.pingInProgress)return console.log("[se-bar PingService] skipping ping - existing ping request"),n&&this.pingRequest.protect(t,n),this.pingRequest.response$;console.log("[se-bar PingService] requesting lock for ping",{protection:n});const r=this.mutexClient.request(lt,ht),i=r.pipe(Object(N.a)(t=>{this.debug$$.next({grantedLock:!0}),console.log("[se-bar PingService] received lock for ping");const n=this.userActivity$.lastUserActivity,r=this.execPing(t,n,e);this.debug$$.next({sentPing:!0});const i=this.pingRequest.abort$.pipe(Object(h.a)(e=>(t.release(),Object(s.a)(e))));
25return Object(O.a)([Object(o.a)(t),Object(A.a)(r,i)])}),Object(u.a)(t=>{let[e,n]=t;const r=this.pingRequest.prevTraceId;return this.debug$$.next({receivedPing:!0}),setTimeout(()=>{e.release(),this.resetDebug()},pt),Object.assign(n,{prev_trace_id:r})}),L(console.log.bind(console,"[se-bar PingService] ping emit")),Object(l.a)()),a=this.onPingComplete.bind(this),c=i.subscribe({complete:a,error:a});return this.pingRequest=new ut(t,n,r,i,c),this.debug$$.next({requestedLock:!0}),this.pingRequest.response$}abort(t,e){this.pingInProgress&&this.pingRequest.canAbort(e)&&(console.log("[se-bar PingService] abort",{reason:t,forTraceId:e}),this.pingRequest.lockRequest$.granted?this.pingRequest.abort():this.pingRequest.lockRequest$.cancel(t||"abort"))}execPing(t,e,n){let r;if(e){const t=n?n-e.ts:1;r=this.endpoint.ping(t)}else r=this.endpoint.fetch();return r.pipe(Object(h.a)(e=>(t.release(),this.resetDebug(),e instanceof b?Object(o.a)({authenticated:!1,reason:ct.unknown,trace_id:e.traceId,prev_trace_id:this.pingRequest.prevTraceId}):Object(s.a)(e))))}onPingComplete(t){let e;this.pingRequest.dispose(),this.pingRequest=void 0,e=t instanceof Error?rt.isMutexCanceledError(t)?"canceled":st.isMutexAbortedError(t)?"aborted":"error":"complete",console.log("[se-bar PingService] ping %s",e),this.resetDebug()}resetDebug(){this.debug$$.next({requestedLock:!1,grantedLock:!1,sentPing:!1,receivedPing:!1})}}var ft=n(161);function vt(t,e){return e?Object(c.a)((function(){return t}),e):Object(c.a)((function(){return t}))}var gt,mt=n(274),yt=n(261);!function(t){t.extendSession="extend-session",t.initial="initial",t.lastBeforeAlert="last-before-alert",t.manual="manual",t.timerInterval="timer-interval"}(gt||(gt={}));var bt=n(63),_t=n(53),wt=n(16);class St extends a.a{constructor(t){super(t=>this.source$.subscribe(t)),this.storageClient=t,this.source$=this.storageClient.observeKey(Y.a.globalSessionState).pipe(Object(mt.a)(void 0),Object(yt.a)(),Object(W.a)(t=>{let[e,n]=t;var r,i,o,s,a,c;e&&!e.trace_id&&console.warn("prev with no trace_id",e,n),(null===(r=n)||void 0===r?void 0:r.prev_trace_id)||console.warn("next with no prev_trace_id",n);const u=(null===(i=e)||void 0===i?void 0:i.trace_id)===(null===(o=n)||void 0===o?void 0:o.trace_id)||!e||!e.trace_id||(null===(a=null===(s=n)||void 0===s?void 0:s.prev_trace_id)||void 0===a?void 0:a.startsWith(gt.initial))||!(null===(c=n)||void 0===c?void 0:c.prev_trace_id)||e.trace_id===n.prev_trace_id;return u||console.warn("filtering out of order state update",{prev:e,next:n}),u}),Object(u.a)(t=>{let[,e]=t;return e}),L(console.log.bind(console,"[se-bar SessionStateService] onState")),Object(l.a)()),this.sessionStart$=St.initSessionStart(this),this.sessionAuthenticatedNonReload$=St.initSessionStartWhileSitting$(this),this.sessionEnd$=St.initSessionEnd(this.sessionStart$,this)}static initSessionStart(t){return t.pipe(Object(mt.a)(void 0),Object(yt.a)(),Object(W.a)(t=>{let[e,n]=t;return!i.isAuthenticated(e)&&i.isAuthenticated(n)}),Object(u.a)(t=>{let[,e]=t;return e}),Object(l.a)())}static initSessionStartWhileSitting$(t){return t.pipe(Object(mt.a)(void 0),Object(yt.a)(),Object(W.a)(t=>{let[e,n]=t;return console.log("[SessionStateService]:initSessionStartWhileSitting$ observable on what the hech prev is: ",null!=e&&!i.isAuthenticated(e)&&i.isAuthenticated(n),e),null!=e&&!i.isAuthenticated(e)&&i.isAuthenticated(n)}),Object(u.a)(t=>{let[,e]=t;return e}),Object(l.a)())}static initSessionEnd(t,e){return t.pipe(vt(e.pipe(Object(W.a)(t=>!i.isAuthenticated(t)),Object(X.a)(1))),Object(l.a)())}get currentSessionState(){return this.storageClient.getItem(Y.a.globalSessionState)}get currentTraceId(){var t;return null===(t=this.currentSessionState)||void 0===t?void 0:t.trace_id}next(t){Object.assign(t,{received_at:Date.now()}),this.storageClient.setItem(Y.a.globalSessionState,t)}}class Ct extends a.a{constructor(){super(t=>this.timer$$.subscribe(t)),this.timer$$=new d.a}get remaining(){if(!isNaN(this.duration))return this.duration-(Date.now()-this.timerStarted)}get running(){return!!this.triggerTimeout}start(t){if(this.triggerTimeout)throw new Error("Timer is already running");this.stop(),t=t<0?0:t,this.duration=t,this.timerStarted=Date.now(),this.triggerTimeout=setTimeout(this.trigger.bind(this),t)}restart(t){this.stop(),this.start(t)}suspend(t){this.triggerTimeout&&(this.cancelTriggerTimeout(),t&&(this.resumeTimeout=setTimeout(this.resume.bind(this),t)))}resume(){isNaN(this.remaining)||this.start(this.remaining)}stop(){this.cancelTriggerTimeout(),this.cancelResumeTimeout(),this.cleanup()}dispose(){this.stop(),this.timer$$.complete()}asObservable(){return this.pipe()}trigger(){this.timer$$.next(),this.stop()}cancelResumeTimeout(){this.resumeTimeout&&(clearTimeout(this.resumeTimeout),this.resumeTimeout=void 0)}cancelTriggerTimeout(){this.triggerTimeout&&(clearTimeout(this.triggerTimeout),this.triggerTimeout=void 0)}cleanup(){this.duration=void 0,this.timerStarted=void 0}}var Et=n(157),xt={leading:!0,trailing:!1};var Tt=function(){function t(t,e,n){this.durationSelector=t,this.leading=e,this.trailing=n}return t.prototype.call=function(t,e){return e.subscribe(new It(t,this.durationSelector,this.leading,this.trailing))},t}(),It=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.destination=e,o.durationSelector=n,o._leading=r,o._trailing=i,o._hasValue=!1,o}return p.a(e,t),e.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},e.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=null},e.prototype.throttle=function(t){var e=this.tryDurationSelector(t);e&&this.add(this._throttled=Object(v.a)(this,e))},e.prototype.tryDurationSelector=function(t){try{return this.durationSelector(t)}catch(t){return this.destination.error(t),null}},e.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=null,e&&this.send()},e.prototype.notifyNext=function(t,e,n,r,i){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(f.a);const kt=500;const Ot={load:Object(o.a)(function(){if("function"==typeof Event)return new Event("load");try{return document.createEvent("load")}catch(t){const e=document.createEvent("HTMLEvents");return e.initEvent("load",!0,!1),e}}())};function At(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const r=e.map(t=>Ot[t]||Object(Et.a)(document,t).pipe(Object(R.a)()));return Object(ft.a)(...r).pipe((i=()=>Object(Z.a)(kt),void 0===o&&(o=xt),function(t){return t.lift(new Tt(i,o.leading,o.trailing))}),Object(u.a)(t=>({ts:Date.now(),type:t.type})),Object(R.a)(1));var i,o}class Rt extends a.a{constructor(t){super(t=>{const e=this.storageClient.observeKey(Y.a.lastUserActivity,!0),n=this.localUserActivity$.pipe(L(t=>this.storageClient.setItem(Y.a.lastUserActivity,t)));return Object(ft.a)(n,e,this.manualUserActivity$$).subscribe(t)}),this.storageClient=t,this.localUserActivity$=At("load","click","mousemove","keypress","scroll","wheel"),this.manualUserActivity$$=new d.a}get lastUserActivity(){return this.storageClient.getItem(Y.a.lastUserActivity)}next(t){console.log("[se-bar UserActivityService] next",t),this.storageClient.setItem(Y.a.lastUserActivity,t),this.manualUserActivity$$.next(t)}}var Nt=n(33),Pt=n(61),Mt=n(24);function Dt(t,e,n){void 0===t&&(t=0);var r=-1;return Object(Pt.a)(e)?r=Number(e)<1?1:Number(e):Object(Mt.a)(e)&&(n=e),Object(Mt.a)(n)||(n=Nt.a),new a.a((function(e){var i=Object(Pt.a)(t)?t:+t-n.now();return n.schedule(Lt,i,{index:0,period:r,subscriber:e})}))}function Lt(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(-1===n)return r.complete();t.index=e+1,this.schedule(t,n)}}var jt,Ut=n(262);!function(t){t.unknown="unknown",t.active="active",t.idle="idle",t.expired="expired"}(jt||(jt={}));class Ft extends a.a{constructor(t){super(t=>{return this.sessionState$.pipe(Object(c.a)(t=>{const e=Object(o.a)(t);if(!i.isAuthenticated(t))return e;const n=Date.now(),r=Dt(t.expires_at-n+1).pipe(Object(u.a)(()=>t));if(t.alert_after<n)return Object(ft.a)(e,r);const s=Dt(t.alert_after-n+1).pipe(Object(u.a)(()=>t));return Object(ft.a)(e,s,r)})).pipe(Object(u.a)(t=>Ft.determineState(t)),Object(mt.a)(jt.unknown),Object(Ut.a)(),Object(l.a)()).subscribe(t)}),this.sessionState$=t}static determineState(t){return i.isAuthenticated(t)?t.alert_after<Date.now()?jt.idle:jt.active:jt.expired}get currentUserState(){return Ft.determineState(this.sessionState$.currentSessionState)}}let Ht;class Bt extends r.a{constructor(t,e,n,r,i,o,s,a,c){super(),this.auth=t,this.authUrls=e,this.location=n,this.pingService=r,this.config=i,this.sessionState$=o,this.userActivity$=a,this.userState$=c,console.log("[se-bar SessionStateManager] session timeout beta enabled"),this.pingDebug$=this.pingService.debug$,this.pingTimer=new s,this.sessionExpirationTimer=new s,this.authState$=this.initAuthState(),this.userInactivityAlert$=this.initUserInactivityAlert(),this.sessionExpired$=this.sessionExpirationTimer.pipe(this.mapToCurrentGlobalSessionState()),this.initialState$=this.initInitialState(),this.trackSubscription(this.initialState$),this.trackSubscription(this.userActivity$);const u=Object(ft.a)(this.sessionState$.sessionStart$,this.sessionState$.sessionStart$.pipe(vt(this.sessionState$)));this.trackSubscription(u,this.onGlobalSessionStateUpdate),this.trackSubscription(this.sessionState$.sessionStart$,this.onSessionStart),this.trackSubscription(this.sessionState$.sessionAuthenticatedNonReload$,this.onAuthenticatedNonReload),this.trackSubscription(this.sessionState$.sessionEnd$,this.onSessionEnd),this.trackSubscription(this.pingTimer,this.onPingTimer),this.trackSubscription(this.userInactivityAlert$,this.onInactivityAlert),this.trackSubscription(this.sessionExpirationTimer,this.onSessionExpirationTimer)}static init(t){if(!Ht){const e=function(t){let[e,n,r,o,s,a,c,u,l,h,p,d,f]=t||[];const v=!u,g=!h||!d,m=!u;return!a&&(v||g)&&(r=r||new q),g&&(o=o||new $(r)),v&&(a=a||new ot(r)),h=h||new St(o),p=p||Ct,e=e||new i(h),n=n||bt.a,d=d||new Rt(o),f=f||new Ft(h),s=s||_t.b,m&&(c=c||new T(s,wt.a)),l=l||y.a,[e,n,s,u=u||new dt(c,a,d),l,h,p,d,f]}(t);Ht=new Bt(...e)}return Ht}static get instance(){return Ht}dispose(){console.log("[se-bar SessionStateManager] dispose (shutting down)"),super.dispose(),this.pingTimer.dispose(),this.sessionExpirationTimer.dispose(),Ht=void 0}extendSession(){if(this.userState$.currentUserState===jt.idle){this.userActivity$.next({ts:Date.now(),type:"extend-session"});const t=this.sessionState$.currentSessionState;this.sessionState$.next(Object.assign(t,{alert_after:Date.now()+1e4})),this.doPing(gt.extendSession,at.byTraceId)}}manualPing(){return this.doPing(gt.manual)}initAuthState(){return this.sessionState$.pipe(Object(mt.a)(Object(o.a)(void 0)),Object(yt.a)(),Object(W.a)(t=>{let e,n,r,o,[s,a]=t;return i.isAuthenticated(s)&&(e=!0,n=s.id),i.isAuthenticated(a)&&(r=!0,o=a.id),e!==r||n!==o}),Object(u.a)(t=>{let[,e]=t;return i.isAuthenticated(e)?e:void 0}),Object(l.a)())}initUserInactivityAlert(){return this.userState$.pipe(Object(W.a)(t=>t===jt.idle),Object(c.a)(()=>this.doPing(gt.lastBeforeAlert,at.byTraceId)),Object(u.a)(t=>t),Object(l.a)())}initInitialState(){const t=this.doPing(gt.initial,at.byTraceId),e=this.sessionState$.sessionStart$.pipe(Object(X.a)(1),Object(c.a)(e=>e.ping_after<Date.now()?t:Object(o.a)(e)));return Object(A.a)(t,e)}onGlobalSessionStateUpdate(t){if(console.log("[se-bar SessionStateManager] onGlobalSessionStateUpdate",t),i.isAuthenticated(t)){this.pingService.pingInProgress&&this.pingService.abort("received updated session state",t.prev_trace_id);const e=Date.now();if(t.ping_after<e)console.warn("[se-bar SessionStateManager] state update received with next ping in the past",t);else if(t.alert_after>e){const n=t.ping_after-e;this.pingTimer.restart(n),console.log("[se-bar SessionStateManager] pinging in %sms",n)}this.sessionExpirationTimer.restart(t.expires_at-e)}}onPingTimer(){console.log("[se-bar SessionStateManager] ping timer",Number(Date.now().toString().substring(6))),this.doPing(gt.timerInterval)}doPing(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];console.log("[se-bar SessionStateManager] initiating ping (%s)",t),this.pingTimer.suspend(),this.sessionExpirationTimer.suspend();const n=this.sessionState$.currentTraceId||(t===gt.initial?"".concat(gt.initial,"-").concat(Math.random()):void 0),r=i.isAuthenticated(this.sessionState$.currentSessionState)?this.sessionState$.currentSessionState.expires_at:void 0,a=this.pingService.ping(n,r,e).pipe(Object(h.a)(t=>rt.isMutexCanceledError(t)?Object(o.a)(this.sessionState$.currentSessionState):Object(s.a)(t)));return a.subscribe(t=>this.sessionState$.next(t)),a}onInactivityAlert(){const t=this.sessionState$.currentSessionState;this.pingTimer.stop(),console.warn("[se-bar SessionStateManager] user inactivity warning: logout in %sms",t.expires_at-Date.now())}onSessionExpirationTimer(){console.log("[se-bar SessionStateManager] onSessionExpirationTimer"),this.pingTimer.stop(),this.auth.signOut(ct.inactivity)}onSessionStart(){console.log("[se-bar SessionStateManager] onAuthenticatedReload obser");const t=this.location.queryParam("user_return_to");t&&this.location.navigateTo(t)}onAuthenticatedNonReload(){console.log("[se-bar SessionStateManager] onAuthenticatedNonReload obser"),this.authUrls.getSignInReloadUrl()&&this.location.navigateTo(this.authUrls.getSignInReloadUrl())}onSessionEnd(t){var e;console.log("[se-bar SessionStateManager] onSessionEnd"),this.pingTimer.stop(),this.sessionExpirationTimer.stop(),this.pingService.abort("session ended"),this.doSignOutRedirect((null===(e=t)||void 0===e?void 0:e.reason)||ct.userSignOut)}doSignOutRedirect(t){t===ct.inactivity||ct.userSignOut;const e=encodeURIComponent(this.location.hrefFiltered),n="".concat(this.config.urls.userService,"/session_ended?user_return_to=").concat(e);return this.location.navigateTo(this.authUrls.getSignOutUrl(n))}mapToCurrentGlobalSessionState(){return Object(u.a)(()=>this.sessionState$.currentSessionState)}}n.d(e,"a",(function(){return T})),n.d(e,"b",(function(){return Bt})),n.d(e,"c",(function(){return ct})),n.d(e,"d",(function(){return jt}))},function(t,e,n){"use strict";function r(t){return null!==t&&"object"==typeof t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}}},function(t,e,n){"use strict";function r(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(4);function i(t,e){return e?new r.a((function(n){return e.schedule(o,0,{error:t,subscriber:n})})):new r.a((function(e){return e.error(t)}))}function o(t){var e=t.error;t.subscriber.error(e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(1),i=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return r.a(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(n(8).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}
25));var r=n(4),i=new r.a((function(t){return t.complete()}));function o(t){return t?function(t){return new r.a((function(e){return t.schedule((function(){return e.complete()}))}))}(t):i}},function(t,e,n){"use strict";var r=n(4),i=n(50),o=n(8),s=n(18);var a=n(36),c=n(27);var u=n(45),l=n(43);function h(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[s.a]}(t))return function(t,e){return new r.a((function(n){var r=new o.a;return r.add(e.schedule((function(){var i=t[s.a]();r.add(i.subscribe({next:function(t){r.add(e.schedule((function(){return n.next(t)})))},error:function(t){r.add(e.schedule((function(){return n.error(t)})))},complete:function(){r.add(e.schedule((function(){return n.complete()})))}}))}))),r}))}(t,e);if(Object(u.a)(t))return function(t,e){return new r.a((function(n){var r=new o.a;return r.add(e.schedule((function(){return t.then((function(t){r.add(e.schedule((function(){n.next(t),r.add(e.schedule((function(){return n.complete()})))})))}),(function(t){r.add(e.schedule((function(){return n.error(t)})))}))}))),r}))}(t,e);if(Object(l.a)(t))return Object(a.a)(t,e);if(function(t){return t&&"function"==typeof t[c.a]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new r.a((function(n){var r,i=new o.a;return i.add((function(){r&&"function"==typeof r.return&&r.return()})),i.add(e.schedule((function(){r=t[c.a](),i.add(e.schedule((function(){if(!n.closed){var t,e;try{var i=r.next();t=i.value,e=i.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}})))}))),i}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}function p(t,e){return e?h(t,e):t instanceof r.a?t:new r.a(Object(i.a)(t))}n.d(e,"a",(function(){return p}))},function(t,e,n){"use strict";var r=n(44),i=n(21),o=n(27),s=n(18),a=n(43),c=n(45),u=n(42);n.d(e,"a",(function(){return l}));var l=function(t){if(t&&"function"==typeof t[s.a])return l=t,function(t){var e=l[s.a]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(Object(a.a)(t))return Object(r.a)(t);if(Object(c.a)(t))return n=t,function(t){return n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,i.a),t};if(t&&"function"==typeof t[o.a])return e=t,function(t){for(var n=e[o.a]();;){var r=n.next();if(r.done){t.complete();break}if(t.next(r.value),t.closed)break}return"function"==typeof n.return&&t.add((function(){n.return&&n.return()})),t};var e,n,l,h=Object(u.a)(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+h+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},function(t,e,n){"use strict";var r=n(1),i=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}();n.d(e,"a",(function(){return o}));var o=function(t){function e(n,r){void 0===r&&(r=i.now);var o=t.call(this,n,(function(){return e.delegate&&e.delegate!==o?e.delegate.now():r()}))||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return r.a(e,t),e.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,i):t.prototype.schedule.call(this,n,r,i)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(i)},function(t,e,n){"use strict";var r=n(1),i=function(t){function e(e,n){return t.call(this)||this}return r.a(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(n(8).a);n.d(e,"a",(function(){return o}));var o=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return r.a(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);
25this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(i)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(39);const i={development:[".sportngin.com.dev",".sportsengine.com.dev"],staging:[".stage.ngin-staging.com",".sestage.us",".sportngin.com.dev",".sportsengine.com.dev"],production:[".sportngin.com",".sportsengine.com"]},o={development:[],staging:["https://s3.amazonaws.com/sportngin-snap-staging/ui_themes"],production:["https://s3.amazonaws.com/sportngin-snap-production/ui_themes"]};class s{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;this.window=t}get href(){return this.window.location.href}get origin(){var t;return(null===(t=this.window.location)||void 0===t?void 0:t.hostname)||""}get hostWithScheme(){let t="";return this.window.location&&(t=this.window.location.protocol+"//"+this.window.location.hostname),t}get hrefFiltered(){let t=this.hostWithScheme;return t=this.href}get baseURI(){return this.window.document.baseURI}get isSEDomain(){return!(!r.a.current||!i[r.a.current])&&(i[r.a.current].some(t=>this.origin.endsWith(t))||o[r.a.current].some(t=>this.origin.startsWith(t)))}get isVanityDomain(){return!this.isSEDomain}navigateTo(t){this.window.location.href=t}getQueryParams(){return((t=this.window.location.search).startsWith("?")?t.substring(1):t).split("&").reduce((t,e)=>{const[n,r]=e.split("=");return t[n]=decodeURIComponent(r),t},{});var t}queryParam(t){return this.getQueryParams()[t]}}e.b=new s},function(t,e,n){var r=n(223),i=n(224),o=n(139),s=n(225);t.exports=function(t){return r(t)||i(t)||o(t)||s()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";var r=n(146),i=Object.prototype.toString;function o(t){return"[object Array]"===i.call(t)}function s(t){return void 0===t}function a(t){return null!==t&&"object"==typeof t}function c(t){if("[object Object]"!==i.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function u(t){return"[object Function]"===i.call(t)}function l(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),o(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}t.exports={isArray:o,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:function(t){return null!==t&&!s(t)&&null!==t.constructor&&!s(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isPlainObject:c,isUndefined:s,isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:u,isStream:function(t){return a(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:l,merge:function t(){var e={};function n(n,r){c(e[r])&&c(n)?e[r]=t(e[r],n):c(n)?e[r]=t({},n):o(n)?e[r]=n.slice():e[r]=n}for(var r=0,i=arguments.length;r<i;r++)l(arguments[r],n);return e},extend:function(t,e,n){return l(e,(function(e,i){t[i]=n&&"function"==typeof e?r(e,n):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},function(t,e,n){"use strict";var r=n(158),i=n(13),o=n(157),s=n(37),a=n(164),c=n(39);const u=/^https:\/\/[\w-]+\.sport(ngin|sengine)\.com\.dev$/;function l(t){const e=Object.values(t),n=function(){switch(c.a.current){case"production":return[/.*/];case"staging":return[/\.sestage\.us$/,/\.stage\.ngin-staging\.com$/,/staging\..*$./,/\.fortheloveofsportsball.com$/,u];default:return[/^http:\/\/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{2,5})?$/,/^http:\/\/localhost(:\d{2,5})?$/,u]}}();return t=>!!e.some(e=>t.data.type===e)&&(!!n.some(e=>e.test(t.origin))||(console.error("[se-bar allowedMessages] disallowed origin",t.origin,n),!1))}n.d(e,"a",(function(){return h}));class h extends i.a{constructor(t){var e;super(),this.messages$=(e=t,Object(o.a)(window,"message").pipe(Object(r.a)(l(e)),Object(s.a)(t=>(function(t){return{data:t.data.data,event:t,type:t.data.type}})(t)),Object(a.a)()))}filterMessages(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.messages$.pipe(Object(r.a)(t=>e.includes(t.type)))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(24),i=n(32),o=n(36);function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Object(r.a)(n)?(t.pop(),Object(o.a)(t,n)):Object(i.a)(t)}},function(t,e,n){"use strict";var r=n(67);function i(t){return t}function o(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),Object(r.a)(i,t)}n.d(e,"a",(function(){return o}
25))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r="se-bar-xd:"},function(t,e){function n(e){return t.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(22);function i(t){return!Object(r.a)(t)&&t-parseFloat(t)+1>=0}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";var r=n(6),i=n(53);e.a=new class{constructor(t,e){this.config=t,this.location=e}getSignInUrl(){const t=this.config.signInUrl,e=t.includes("?")?"&":"?",n=this.config.signInUserReturnToOverride||this.location.queryParam("user_return_to")||this.location.hrefFiltered;return"".concat(t).concat(e,"user_return_to=").concat(encodeURIComponent(n))}getSignOutUrl(t){const e=this.config.signOutUrl,n=e.includes("?")?"&":"?",r=encodeURIComponent(this.config.signOutUserReturnToOverride||t||this.getSignInUrl());return"".concat(e).concat(n,"redirect_uri=").concat(r)}getSignInReloadUrl(){const t=this.config.signInReloadOverrideUrl,e=this.location.queryParam("user_return_to");return t||e}}(r.a,i.b)},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(t){r=s}}();var c,u=[],l=!1,h=-1;function p(){l&&c&&(l=!1,c.length?u=c.concat(u):h=-1,u.length&&d())}function d(){if(!l){var t=a(p);l=!0;for(var e=u.length;e;){for(c=u,u=[];++h<e;)c&&c[h].run();h=-1,e=u.length}c=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];u.push(new f(t,e)),1!==u.length||l||a(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=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";var r;n.d(e,"a",(function(){return r})),function(t){t.globalSessionState="global-session-state",t.lastUserActivity="last-user-activity"}(r||(r={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(1),i=n(10),o=n(11),s=n(28),a=n(37),c=n(49);function u(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?function(r){return r.pipe(u((function(n,r){return Object(c.a)(t(n,r)).pipe(Object(a.a)((function(t,i){return e(n,t,r,i)})))}),n))}:("number"==typeof e&&(n=e),function(e){return e.lift(new l(t,n))})}var l=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.project,this.concurrent))},t}(),h=function(t){function e(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this,e)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=new s.a(this,void 0,void 0);this.destination.add(r),Object(i.a)(this,t,e,n,r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(o.a)},function(t,e,n){"use strict";var r,i=n(1),o=n(23),s=function(t){function e(e,n){var r=t.call(this,e,n)||this;
vendor: 1,759 bytes, line 25
25return r.scheduler=e,r.work=n,r}return i.a(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(n(52).a),a=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.a(e,t),e}(n(51).a))(s),c=n(8),u=n(5),l=n(48),h=n(57),p=n(46);r||(r={});var d=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return Object(h.a)(this.value);case"E":return Object(p.a)(this.error);case"C":return Object(l.a)()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();var f=function(t){function e(e,n,r){void 0===r&&(r=0);var i=t.call(this,e)||this;
25return i.scheduler=n,i.delay=r,i}return i.a(e,t),e.dispatch=function(t){var e=t.notification,n=t.destination;e.observe(n),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new v(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(d.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(d.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(d.createComplete()),this.unsubscribe()},e}(u.a),v=function(){return function(t,e){this.notification=t,this.destination=e}}(),g=n(20),m=n(47);n.d(e,"a",(function(){return y}));var y=function(t){function e(e,n,r){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var i=t.call(this)||this;return i.scheduler=r,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=e<1?1:e,i._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return i.a(e,t),e.prototype.nextInfiniteTimeWindow=function(e){var n=this._events;n.push(e),n.length>this._bufferSize&&n.shift(),t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this._events.push(new b(this._getNow(),e)),this._trimBufferThenGetEvents(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=r.length;if(this.closed)throw new g.a;if(this.isStopped||this.hasError?e=c.a.EMPTY:(this.observers.push(t),e=new m.a(this,t)),i&&t.add(t=new f(t,i)),n)for(var s=0;s<o&&!t.closed;s++)t.next(r[s]);else for(s=0;s<o&&!t.closed;s++)t.next(r[s].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||a).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,i=r.length,o=0;o<i&&!(t-r[o].time<n);)o++;return i>e&&(o=Math.max(o,i-e)),o>0&&r.splice(0,o),r},e}(o.a),b=function(){return function(t,e){this.time=t,this.value=e}}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(1),i=n(11),o=n(28),s=n(10),a=n(37),c=n(49);function u(t,e){return"function"==typeof e?function(n){return n.pipe(u((function(n,r){return Object(c.a)(t(n,r)).pipe(Object(a.a)((function(t,i){return e(n,t,r,i)})))})))}:function(e){return e.lift(new l(t))}}var l=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.project))},t}(),h=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.index=0,r}return r.a(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=this.innerSubscription;r&&r.unsubscribe();var i=new o.a(this,void 0,void 0);this.destination.add(i),this.innerSubscription=Object(s.a)(this,t,e,n,i)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.destination.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e}(i.a)},function(t,e,n){"use strict";var r=n(105)();t.exports=function(t){return t!==r&&null!==t}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";(function(e){var r=n(30),i=n(116),o={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a,c={adapter:("undefined"!=typeof XMLHttpRequest?a=n(78):void 0!==e&&(a=n(78)),a),transformRequest:[function(t,e){return i(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(s(e,"a
25pplication/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(s(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(t){c.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){c.headers[t]=r.merge(o)})),t.exports=c}).call(this,n(64))},function(t,e,n){"use strict";var r,i,o,s,a,c,u,l=n(94),h=n(111),p=Function.prototype.apply,d=Function.prototype.call,f=Object.create,v=Object.defineProperty,g=Object.defineProperties,m=Object.prototype.hasOwnProperty,y={configurable:!0,enumerable:!1,writable:!0};i=function(t,e){var n,i;return h(e),i=this,r.call(this,t,n=function(){o.call(i,t,n),p.call(e,this,arguments)}),n.__eeOnceListener__=e,this},a={on:r=function(t,e){var n;return h(e),m.call(this,"__ee__")?n=this.__ee__:(n=y.value=f(null),v(this,"__ee__",y),y.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:i,off:o=function(t,e){var n,r,i,o;if(h(e),!m.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(r=n[t]))for(o=0;i=r[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===r.length?n[t]=r[o?0:1]:r.splice(o,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},emit:s=function(t){var e,n,r,i,o;if(m.call(this,"__ee__")&&(i=this.__ee__[t]))if("object"==typeof i){for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];for(i=i.slice(),e=0;r=i[e];++e)p.call(r,this,o)}else switch(arguments.length){case 1:d.call(i,this);break;case 2:d.call(i,this,arguments[1]);break;case 3:d.call(i,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,o=new Array(n-1),e=1;e<n;++e)o[e-1]=arguments[e];p.call(i,this,o)}}},c={on:l(r),once:l(i),off:l(o),emit:l(s)},u=g({},c),t.exports=e=function(t){return null==t?f(u):g(Object(t),c)},e.methods=a},function(t,e,n){t.exports=n(113)},function(t,e,n){var r=n(140);function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,r(i.key),i)}}t.exports=function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";t.exports=function(t){return null!=t}},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(30),i=n(117),o=n(119),s=n(120),a=n(121),c=n(79);t.exports=function(t){return new Promise((function(e,u){var l=t.data,h=t.headers;r.isFormData(l)&&delete h["Content-Type"];var p=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",f=t.auth.password||"";h.Authorization="Basic "+btoa(d+":"+f)}if(p.open(t.method.toUpperCase(),o(t.url,t.params,t.paramsSerializer),!0),p.timeout=t.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in p?s(p.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:t,request:p};i(e,u,r),p=null}},p.onerror=function(){u(c("Network Error",t,null,p)),p=null},p.ontimeout=function(){u(c("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var v=n(122),g=(t.withCredentials||a(t.url))&&t.xsrfCookieName?v.read(t.xsrfCookieName):void 0;g&&(h[t.xsrfHeaderName]=g)}if("setRequestHeader"in p&&r.forEach(h,(function(t,e){void 0===l&&"content-type"===e.toLowerCase()?delete h[e]:p.setRequestHeader(e,t)})),t.withCredentials&&(p.withCredentials=!0),t.responseType)try{p.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&p.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){p&&(p.abort(),u(t),p=null)})),void 0===l&&(l=null),p.send(l)}))}},function(t,e,n){"use strict";var r=n(118);t.exports=function(t,e,n,i,o){var s=new Error(t);return r(s,e,n,i,o)}},function(t,e,n){"use strict";
25t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);t.exports=function(){return n(r),r}}else{var i=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),i[e]=t>>>((3&e)<<3)&255;return i}}},function(t,e){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);t.exports=function(t,e){var r=e||0,i=n;return[i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],"-",i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]],i[t[r++]]].join("")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(6),i=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};const o="se-bar:use-session-timeout",s="true";class a{constructor(t,e,n,r,i,o,s,a,c,u,l){this.document=t,this.localStorage=e,this.SeBar=n,this.sessionStateManagerInit=r,this.globalSessionEndpoint=i,this.userPreferencesService=o,this.messagesService=s,this.streamChatService=a,this.beginCacheSession=c,this.loadAllResources=u,this.initializeCSSVars=l}run(t,e,n){return i(this,void 0,void 0,(function*(){let i=this.preemptiveInitSessionStateManager();this.beginCacheSession();const o=this.safeGetSessionProfile(),s=this.loadAllResources(),a=yield o;if(i=this.initSessionStateManager(i,a),yield this.initProfile(a),this.initElement(t,e,n))return yield s,this.initializeCSSVars(),new this.SeBar({elementId:t,config:r.a,profile:a,sessionStateManager:i})}))}preemptiveInitSessionStateManager(){if(this.localStorage.getItem(o)===s)return this.sessionStateManagerInit.init()}safeGetSessionProfile(){return i(this,void 0,void 0,(function*(){try{return yield this.globalSessionEndpoint.fetch().toPromise()}catch(t){return void console.warn("[se-bar SeBarBootStrapper] error retrieving session profile",t)}}))}initSessionStateManager(t,e){return e?e.pingable?(this.localStorage.setItem(o,s),t||this.sessionStateManagerInit.init()):(this.localStorage.removeItem(o),void(t&&t.dispose())):t}initProfile(t){if(!t)return Promise.resolve();t.preferences&&this.userPreferencesService.setPreferences(t.preferences),this.messagesService.setUser(t),this.streamChatService.setUser(t)}initElement(t,e,n){const r=this.document.querySelector("".concat(e,", #").concat(t));return!!r&&(r.id=t,r.classList.add(n?"has-touch":"no-touch"),!0)}}},function(t,e,n){var r=n(132),i=n(133),o=i;o.v1=r,o.v4=i,t.exports=o},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function n(){return t.exports=n=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},t.exports.__esModule=!0,t.exports.default=t.exports,n.apply(null,arguments)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){t.exports=n(231)},function(t,e,n){"use strict";(function(e){var r=n(55),i=n(236),o=n(148),s={"Content-Type":"application/x-www-form-urlencoded"};function a(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:("undefined"!=typeof XMLHttpRequest?c=n(149):void 0!==e&&"[object process]"===Object.prototype.toString.call(e)&&(c=n(149)),c),transformRequest:[function(t,e){return i(e,"Accept"),i(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(a(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)||e&&"application/json"===e["Content-Type"]?(a(e,"application/json"),function(t,e,n){if(r.isString(t))try{return(e||JSON.parse)(t),r.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||u.transitional,n=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,s=!n&&"json"===this.responseType;if(s||i&&r.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(s){if("SyntaxError"===t.name)throw o(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(t){u.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){u.headers[t]=r.merge(s)})),t.exports=u}).call(this,n(64))},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")}
vendor: 7,427 bytes, lines 25-40
25,r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return s})),n.d(e,"__decorate",(function(){return a})),n.d(e,"__param",(function(){return c})),n.d(e,"__metadata",(function(){return u})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__createBinding",(function(){return p})),n.d(e,"__exportStar",(function(){return d})),n.d(e,"__values",(function(){return f})),n.d(e,"__read",(function(){return v})),n.d(e,"__spread",(function(){return g})),n.d(e,"__spreadArrays",(function(){return m})),n.d(e,"__await",(function(){return y})),n.d(e,"__asyncGenerator",(function(){return b})),n.d(e,"__asyncDelegator",(function(){return _})),n.d(e,"__asyncValues",(function(){return w})),n.d(e,"__makeTemplateObject",(function(){return S})),n.d(e,"__importStar",(function(){return C})),n.d(e,"__importDefault",(function(){return E})),n.d(e,"__classPrivateFieldGet",(function(){return x})),n.d(e,"__classPrivateFieldSet",(function(){return T}));
26/*! *****************************************************************************
27Copyright (c) Microsoft Corporation.
28
29Permission to use, copy, modify, and/or distribute this software for any
30purpose with or without fee is hereby granted.
31
32THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
33REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
34AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
35INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
36LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
37OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
38PERFORMANCE OF THIS SOFTWARE.
39***************************************************************************** */
40var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function a(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function c(t,e){return function(n,r){e(n,r,t)}}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))}function h(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function p(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function d(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function f(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function g(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(v(arguments[e]));return t}function m(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}function y(t){return this instanceof y?(this.v=t,this):new y(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||a(t,e)}))})}function a(t,e){try{(n=i[t](e)).value instanceof y?Promise.resolve(n.value.v).then(c,u):l(o[0][2],n)}catch(t){l(o[0][3],t)}var n}function c(t){a("next",t)}function u(t){a("throw",t)}function l(t,e){t(e),o.shift(),o.length&&a(o[0][0],o[0][1])}}function _(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:y(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=f(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function S(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function C(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function E(t){return t&&t.__esModule?t:{default:t}}function x(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function T(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}}
40,function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=r(n(130));
41/**
42 * @license
43 * Copyright 2018 Google LLC
44 *
45 * Licensed under the Apache License, Version 2.0 (the "License");
46 * you may not use this file except in compliance with the License.
47 * You may obtain a copy of the License at
48 *
49 *   http://www.apache.org/licenses/LICENSE-2.0
50 *
51 * Unless required by applicable law or agreed to in writing, software
52 * distributed under the License is distributed on an "AS IS" BASIS,
53 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
54 * See the License for the specific language governing permissions and
55 * limitations under the License.
56 */
57i.default.registerVersion("firebase","7.24.0","app"),t.exports=i.default},function(t,e,n){"use strict";var r=n(76),i=n(95),o=n(99),s=n(107),a=n(108);(t.exports=function(t,e){var n,i,c,u,l;return arguments.length<2||"string"!=typeof t?(u=e,e=t,t=null):u=arguments[2],r(t)?(n=a.call(t,"c"),i=a.call(t,"e"),c=a.call(t,"w")):(n=c=!0,i=!1),l={value:e,configurable:n,enumerable:i,writable:c},u?o(s(u),l):l}).gs=function(t,e,n){var c,u,l,h;return"string"!=typeof t?(l=n,n=e,e=t,t=null):l=arguments[3],r(e)?i(e)?r(n)?i(n)||(l=n,n=void 0):n=void 0:(l=e,e=n=void 0):e=void 0,r(t)?(c=a.call(t,"c"),u=a.call(t,"e")):(c=!0,u=!1),h={get:e,set:n,configurable:c,enumerable:u},l?o(s(l),h):h}},function(t,e,n){"use strict";var r=n(96),i=/^\s*class[\s{/}]/,o=Function.prototype.toString;t.exports=function(t){return!!r(t)&&!i.test(o.call(t))}},function(t,e,n){"use strict";var r=n(97);t.exports=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!r(t)}},function(t,e,n){"use strict";var r=n(98);t.exports=function(t){if(!r(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},function(t,e,n){"use strict";var r=n(76),i={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!r(t)&&hasOwnProperty.call(i,typeof t)}},function(t,e,n){"use strict";t.exports=n(100)()?Object.assign:n(101)},function(t,e,n){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,n){"use strict";var r=n(102),i=n(106),o=Math.max;t.exports=function(t,e){var n,s,a,c=o(arguments.length,2);for(t=Object(i(t)),a=function(r){try{t[r]=e[r]}catch(t){n||(n=t)}},s=1;s<c;++s)e=arguments[s],r(e).forEach(a);if(void 0!==n)throw n;return t}},function(t,e,n){"use strict";t.exports=n(103)()?Object.keys:n(104)},function(t,e,n){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,n){"use strict";var r=n(70),i=Object.keys;t.exports=function(t){return i(r(t)?Object(t):t)}},function(t,e,n){"use strict";t.exports=function(){}},function(t,e,n){"use strict";var r=n(70);t.exports=function(t){if(!r(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,n){"use strict";var r=n(70),i=Array.prototype.forEach,o=Object.create,s=function(t,e){var n;for(n in t)e[n]=t[n]};t.exports=function(t){var e=o(null);return i.call(arguments,(function(t){r(t)&&s(Object(t),e)})),e}},function(t,e,n){"use strict";t.exports=n(109)()?String.prototype.contains:n(110)},function(t,e,n){"use strict";var r="razdwatrzy";t.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},function(t,e,n){"use strict";var r=String.prototype.indexOf;t.exports=function(t){return r.call(this,t,arguments[1])>-1}},function(t,e,n){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}}
vendor: 5,893 bytes, lines 57-64
57,function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,n(e,r)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";var r=n(30),i=n(77),o=n(115),s=n(72);function a(t){var e=new o(t),n=i(o.prototype.request,e);return r.extend(n,o.prototype,e),r.extend(n,e),n}var c=a(s);c.Axios=o,c.create=function(t){return a(r.merge(s,t))},c.Cancel=n(81),c.CancelToken=n(128),c.isCancel=n(80),c.all=function(t){return Promise.all(t)},c.spread=n(129),t.exports=c,t.exports.default=c},function(t,e){
58/*!
59 * Determine if an object is a Buffer
60 *
61 * @author   Feross Aboukhadijeh <https://feross.org>
62 * @license  MIT
63 */
64t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},function(t,e,n){"use strict";var r=n(72),i=n(30),o=n(123),s=n(124);function a(t){this.defaults=t,this.interceptors={request:new o,response:new o}}a.prototype.request=function(t){"string"==typeof t&&(t=i.merge({url:arguments[0]},arguments[1])),(t=i.merge(r,{method:"get"},this.defaults,t)).method=t.method.toLowerCase();var e=[s,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));e.length;)n=n.then(e.shift(),e.shift());return n},i.forEach(["delete","get","head","options"],(function(t){a.prototype[t]=function(e,n){return this.request(i.merge(n||{},{method:t,url:e}))}})),i.forEach(["post","put","patch"],(function(t){a.prototype[t]=function(e,n,r){return this.request(i.merge(r||{},{method:t,url:e,data:n}))}})),t.exports=a},function(t,e,n){"use strict";var r=n(30);t.exports=function(t,e){r.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))}},function(t,e,n){"use strict";var r=n(79);t.exports=function(t,e,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,i){return t.config=e,n&&(t.code=n),t.request=r,t.response=i,t}},function(t,e,n){"use strict";var r=n(30);function i(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(r.isURLSearchParams(e))o=e.toString();else{var s=[];r.forEach(e,(function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,(function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),s.push(i(e)+"="+i(t))})))})),o=s.join("&")}return o&&(t+=(-1===t.indexOf("?")?"?":"&")+o),t}},function(t,e,n){"use strict";var r=n(30),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,o,s={};return t?(r.forEach(t.split("\n"),(function(t){if(o=t.indexOf(":"),e=r.trim(t.substr(0,o)).toLowerCase(),n=r.trim(t.substr(o+1)),e){if(s[e]&&i.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([n]):s[e]?s[e]+", "+n:n}})),s):s}},function(t,e,n){"use strict";var r=n(30);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){var n=r.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r=n(30);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,i,o,s){var a=[];a.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";var r=n(30);function i(){this.handlers=[]}i.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=i},function(t,e,n){"use strict";var r=n(30),i=n(125),o=n(80),s=n(72),a=n(126),c=n(127);function u(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return u(t),t.baseURL&&!a(t.url)&&(t.url=c(t.baseURL,t.url)),t.headers=t.headers||{},t.data=i(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||s.adapter)(t).then((function(e){return u(t),e.data=i(e.data,e.headers,t.transformResponse),e}),(function(e){return o(e)||(u(t),e&&e.response&&(e.response.data=i(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,n){"use strict";var r=n(30);t.exports=function(t,e,n){return r.forEach(n,(function(n){t=n(t,e)})),t}},function(t,e,n){"use strict";
64t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(81);function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new r(t),e(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var t;return{token:new i((function(e){t=e})),cancel:t}},t.exports=i},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i,o=n(91),s=n(131),a=n(154),c=n(155),u=((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["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",r["invalid-log-argument"]="First argument to `onLog` must be null or a function.",r),l=new s.ErrorFactory("app","Firebase",u),h="@firebase/app",p="0.6.11",d="[DEFAULT]",f=((i={})[h]="fire-core",i["@firebase/analytics"]="fire-analytics",i["@firebase/auth"]="fire-auth",i["@firebase/database"]="fire-rtdb",i["@firebase/functions"]="fire-fn",i["@firebase/installations"]="fire-iid",i["@firebase/messaging"]="fire-fcm",i["@firebase/performance"]="fire-perf",i["@firebase/remote-config"]="fire-rc",i["@firebase/storage"]="fire-gcs",i["@firebase/firestore"]="fire-fst",i["fire-js"]="fire-js",i["firebase-wrapper"]="fire-js-all",i),v=new c.Logger("@firebase/app"),g=function(){function t(t,e,n){var r,i,c=this;this.firebase_=n,this.isDeleted_=!1,this.name_=e.name,this.automaticDataCollectionEnabled_=e.automaticDataCollectionEnabled||!1,this.options_=s.deepCopy(t),this.container=new a.ComponentContainer(e.name),this._addComponent(new a.Component("app",(function(){return c}),"PUBLIC"));try{for(var u=o.__values(this.firebase_.INTERNAL.components.values()),l=u.next();!l.done;l=u.next()){var h=l.value;this._addComponent(h)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}return Object.defineProperty(t.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed_(),this.automaticDataCollectionEnabled_},set:function(t){this.checkDestroyed_(),this.automaticDataCollectionEnabled_=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this.checkDestroyed_(),this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.checkDestroyed_(),this.options_},enumerable:!1,configurable:!0}),t.prototype.delete=function(){var t=this;return new Promise((function(e){t.checkDestroyed_(),e()})).then((function(){return t.firebase_.INTERNAL.removeApp(t.name_),Promise.all(t.container.getProviders().map((function(t){return t.delete()})))})).then((function(){t.isDeleted_=!0}))},t.prototype._getService=function(t,e){return void 0===e&&(e=d),this.checkDestroyed_(),this.container.getProvider(t).getImmediate({identifier:e})},t.prototype._removeServiceInstance=function(t,e){void 0===e&&(e=d),this.container.getProvider(t).clearInstance(e)},t.prototype._addComponent=function(t){try{this.container.addComponent(t)}catch(e){v.debug("Component "+t.name+" failed to register with FirebaseApp "+this.name,e)}},t.prototype._addOrOverwriteComponent=function(t){this.container.addOrOverwriteComponent(t)},t.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw l.create("app-deleted",{appName:this.name_})},t}();g.prototype.name&&g.prototype.options||g.prototype.delete||console.log("dc");var m="7.20.0";
65/**
66 * @license
67 * Copyright 2019 Google LLC
68 *
69 * Licensed under the Apache License, Version 2.0 (the "License");
70 * you may not use this file except in compliance with the License.
71 * You may obtain a copy of the License at
72 *
73 *   http://www.apache.org/licenses/LICENSE-2.0
74 *
75 * Unless required by applicable law or agreed to in writing, software
76 * distributed under the License is distributed on an "AS IS" BASIS,
77 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
78 * See the License for the specific language governing permissions and
79 * limitations under the License.
80 */var y=
81/**
82 * @license
83 * Copyright 2019 Google LLC
84 *
85 * Licensed under the Apache License, Version 2.0 (the "License");
86 * you may not use this file except in compliance with the License.
87 * You may obtain a copy of the License at
88 *
89 *   http://www.apache.org/licenses/LICENSE-2.0
90 *
91 * Unless required by applicable law or agreed to in writing, software
92 * distributed under the License is distributed on an "AS IS" BASIS,
93 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
94 * See the License for the specific language governing permissions and
95 * limitations under the License.
96 */
97function t(){var e=function(t){var e={},n=new Map,r={__esModule:!0,initializeApp:function(n,i){void 0===i&&(i={});if("object"!=typeof i||null===i){i={name:i}}var o=i;void 0===o.name&&(o.name=d);var a=o.name;if("string"!=typeof a||!a)throw l.create("bad-app-name",{appName:String(a)});if(s.contains(e,a))throw l.create("duplicate-app",{appName:a});var c=new t(n,o,r);return e[a]=c,c},app:i,registerVersion:function(t,e,n){var r,i=null!==(r=f[t])&&void 0!==r?r:t;n&&(i+="-"+n);var o=i.match(/\s|\//),s=e.match(/\s|\//);if(o||s){var c=['Unable to register library "'+i+'" with version "'+e+'":'];return o&&c.push('library name "'+i+'" contains illegal characters (whitespace or "/")'),o&&s&&c.push("and"),s&&c.push('version name "'+e+'" contains illegal characters (whitespace or "/")'),void v.warn(c.join(" "))}u(new a.Component(i+"-version",(function(){return{library:i,version:e}}),"VERSION"))},setLogLevel:c.setLogLevel,onLog:function(t,e){if(null!==t&&"function"!=typeof t)throw l.create("invalid-log-argument",{appName:name});c.setUserLogHandler(t,e)},apps:null,SDK_VERSION:m,INTERNAL:{registerComponent:u,removeApp:function(t){delete e[t]},components:n,useAsService:function(t,e){if("serverAuth"===e)return null;return e}}};function i(t){if(t=t||d,!s.contains(e,t))throw l.create("no-app",{appName:t});return e[t]}function u(a){var c,u,h=a.name;if(n.has(h))return v.debug("There were multiple attempts to register component "+h+"."),"PUBLIC"===a.type?r[h]:null;if(n.set(h,a),"PUBLIC"===a.type){var p=function(t){if(void 0===t&&(t=i()),"function"!=typeof t[h])throw l.create("invalid-app-argument",{appName:h});return t[h]()};void 0!==a.serviceProps&&s.deepExtend(p,a.serviceProps),r[h]=p,t.prototype[h]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this._getService.bind(this,h);return n.apply(this,a.multipleInstances?t:[])}}try{for(var d=o.__values(Object.keys(e)),f=d.next();!f.done;f=d.next()){var g=f.value;e[g]._addComponent(a)}}catch(t){c={error:t}}finally{try{f&&!f.done&&(u=d.return)&&u.call(d)}finally{if(c)throw c.error}}return"PUBLIC"===a.type?r[h]:null}return(r.default=r,Object.defineProperty(r,"apps",{get:function(){return Object.keys(e).map((function(t){return e[t]}))}}),i.App=t,r)}(g);return e.INTERNAL=o.__assign(o.__assign({},e.INTERNAL),{createFirebaseNamespace:t,extendNamespace:function(t){s.deepExtend(e,t)},createSubscribe:s.createSubscribe,ErrorFactory:s.ErrorFactory,deepExtend:s.deepExtend}),e}(),b=function(){function t(t){this.container=t}return t.prototype.getPlatformInfoString=function(){return this.container.getProviders().map((function(t){if(function(t){var e=t.getComponent();return"VERSION"===(null==e?void 0:e.type)}
98/**
99 * @license
100 * Copyright 2019 Google LLC
101 *
102 * Licensed under the Apache License, Version 2.0 (the "License");
103 * you may not use this file except in compliance with the License.
104 * You may obtain a copy of the License at
105 *
106 *   http://www.apache.org/licenses/LICENSE-2.0
107 *
108 * Unless required by applicable law or agreed to in writing, softw
108are
109 * distributed under the License is distributed on an "AS IS" BASIS,
110 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
111 * See the License for the specific language governing permissions and
112 * limitations under the License.
113 */(t)){var e=t.getImmediate();return e.library+"/"+e.version}return null})).filter((function(t){return t})).join(" ")},t}();
114/**
115 * @license
116 * Copyright 2019 Google LLC
117 *
118 * Licensed under the Apache License, Version 2.0 (the "License");
119 * you may not use this file except in compliance with the License.
120 * You may obtain a copy of the License at
121 *
122 *   http://www.apache.org/licenses/LICENSE-2.0
123 *
124 * Unless required by applicable law or agreed to in writing, software
125 * distributed under the License is distributed on an "AS IS" BASIS,
126 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
127 * See the License for the specific language governing permissions and
128 * limitations under the License.
129 */
130/**
131 * @license
132 * Copyright 2017 Google LLC
133 *
134 * Licensed under the Apache License, Version 2.0 (the "License");
135 * you may not use this file except in compliance with the License.
136 * You may obtain a copy of the License at
137 *
138 *   http://www.apache.org/licenses/LICENSE-2.0
139 *
140 * Unless required by applicable law or agreed to in writing, software
141 * distributed under the License is distributed on an "AS IS" BASIS,
142 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
143 * See the License for the specific language governing permissions and
144 * limitations under the License.
145 */
146if(s.isBrowser()&&void 0!==self.firebase){v.warn("\n    Warning: Firebase is already defined in the global scope. Please make sure\n    Firebase library is only loaded once.\n  ");var _=self.firebase.SDK_VERSION;_&&_.indexOf("LITE")>=0&&v.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 w=y.initializeApp;y.initializeApp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return s.isNode()&&v.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      '),w.apply(void 0,t)};var S=y;!function(t,e){t.INTERNAL.registerComponent(new a.Component("platform-logger",(function(t){return new b(t)}),"PRIVATE")),t.registerVersion(h,p,e),t.registerVersion("fire-js","")}(S),e.default=S,e.firebase=S},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r=n(91),i={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},o=function(t,e){if(!t)throw s(e)},s=function(t){return new Error("Firebase Database ("+i.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)},a=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):55296==(64512&i)&&r+1<t.length&&56320==(64512&t.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&t.charCodeAt(++r)),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},c={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(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();for(var n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[],i=0;i<t.length;i+=3){var o=t[i],s=i+1<t.length,a=s?t[i+1]:0,c=i+2<t.length,u=c?t[i+2]:0,l=o>>2,h=(3&o)<<4|a>>4,p=(15&a)<<2|u>>6,d=63&u;c||(d=64,s||(p=64)),r.push(n[l],n[h],n[p],n[d])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(a(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){for(var e=[],n=0,r=0;n<t.length;){var i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){var o=t[n++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var s=((7&i)<<18|(63&(o=t[n++]))<<12|(63&(a=t[n++]))<<6|63&t[n++])-65536;e[r++]=String.fromCharCode(55296+(s>>10)),e[r++]=String.fromCharCode(56320+(1023&s))}else{o=t[n++];var a=t[n++];
146e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i<t.length;){var o=n[t.charAt(i++)],s=i<t.length?n[t.charAt(i)]:0,a=++i<t.length?n[t.charAt(i)]:64,c=++i<t.length?n[t.charAt(i)]:64;if(++i,null==o||null==s||null==a||null==c)throw Error();var u=o<<2|s>>4;if(r.push(u),64!==a){var l=s<<4&240|a>>2;if(r.push(l),64!==c){var h=a<<6&192|c;r.push(h)}}}return r},init_:function(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(var t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},u=function(t){try{return c.decodeString(t,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};
147/**
148 * @license
149 * Copyright 2017 Google LLC
150 *
151 * Licensed under the Apache License, Version 2.0 (the "License");
152 * you may not use this file except in compliance with the License.
153 * You may obtain a copy of the License at
154 *
155 *   http://www.apache.org/licenses/LICENSE-2.0
156 *
157 * Unless required by applicable law or agreed to in writing, software
158 * distributed under the License is distributed on an "AS IS" BASIS,
159 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
160 * See the License for the specific language governing permissions and
161 * limitations under the License.
162 */function l(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:return new Date(e.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var n in e)e.hasOwnProperty(n)&&(t[n]=l(t[n],e[n]));return t}
163/**
164 * @license
165 * Copyright 2017 Google LLC
166 *
167 * Licensed under the Apache License, Version 2.0 (the "License");
168 * you may not use this file except in compliance with the License.
169 * You may obtain a copy of the License at
170 *
171 *   http://www.apache.org/licenses/LICENSE-2.0
172 *
173 * Unless required by applicable law or agreed to in writing, software
174 * distributed under the License is distributed on an "AS IS" BASIS,
175 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
176 * See the License for the specific language governing permissions and
177 * limitations under the License.
178 */var h=function(){function t(){var t=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))}return t.prototype.wrapCallback=function(t){var e=this;return function(n,r){n?e.reject(n):e.resolve(r),"function"==typeof t&&(e.promise.catch((function(){})),1===t.length?t(n):t(n,r))}},t}();
179/**
180 * @license
181 * Copyright 2017 Google LLC
182 *
183 * Licensed under the Apache License, Version 2.0 (the "License");
184 * you may not use this file except in compliance with the License.
185 * You may obtain a copy of the License at
186 *
187 *   http://www.apache.org/licenses/LICENSE-2.0
188 *
189 * Unless required by applicable law or agreed to in writing, software
190 * distributed under the License is distributed on an "AS IS" BASIS,
191 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
192 * See the License for the specific language governing permissions and
193 * limitations under the License.
194 */function p(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function d(){try{return"[object process]"===Object.prototype.toString.call(t.process)}catch(t){return!1}}
195/**
196 * @license
197 * Copyright 2017 Google LLC
198 *
199 * Licensed under the Apache License, Version 2.0 (the "License");
200 * you may not use this file except in compliance with the License.
201 * You may obtain a copy of the License at
202 *
203 *   http://www.apache.org/licenses/LICENSE-2.0
204 *
205 * Unless required by applicable law or agreed to in writing, softw
205are
206 * distributed under the License is distributed on an "AS IS" BASIS,
207 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
208 * See the License for the specific language governing permissions and
209 * limitations under the License.
210 */
211var f="FirebaseError",v=function(t){function e(n,r){var i=t.call(this,r)||this;return i.code=n,i.name=f,Object.setPrototypeOf(i,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,g.prototype.create),i}return r.__extends(e,t),e}(Error),g=function(){function t(t,e,n){this.service=t,this.serviceName=e,this.errors=n}return t.prototype.create=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=e[0]||{},i=this.service+"/"+t,o=this.errors[t],s=o?m(o,r):"Error",a=this.serviceName+": "+s+" ("+i+").",c=new v(i,a),u=0,l=Object.keys(r);u<l.length;u++){var h=l[u];"_"!==h.slice(-1)&&(h in c&&console.warn('Overwriting FirebaseError base field "'+h+'" can cause unexpected behavior.'),c[h]=r[h])}return c},t}();function m(t,e){return t.replace(y,(function(t,n){var r=e[n];return null!=r?String(r):"<"+n+"?>"}))}var y=/\{\$([^}]+)}/g;
212/**
213 * @license
214 * Copyright 2017 Google LLC
215 *
216 * Licensed under the Apache License, Version 2.0 (the "License");
217 * you may not use this file except in compliance with the License.
218 * You may obtain a copy of the License at
219 *
220 *   http://www.apache.org/licenses/LICENSE-2.0
221 *
222 * Unless required by applicable law or agreed to in writing, software
223 * distributed under the License is distributed on an "AS IS" BASIS,
224 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
225 * See the License for the specific language governing permissions and
226 * limitations under the License.
227 */function b(t){return JSON.parse(t)}
228/**
229 * @license
230 * Copyright 2017 Google LLC
231 *
232 * Licensed under the Apache License, Version 2.0 (the "License");
233 * you may not use this file except in compliance with the License.
234 * You may obtain a copy of the License at
235 *
236 *   http://www.apache.org/licenses/LICENSE-2.0
237 *
238 * Unless required by applicable law or agreed to in writing, software
239 * distributed under the License is distributed on an "AS IS" BASIS,
240 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
241 * See the License for the specific language governing permissions and
242 * limitations under the License.
243 */
244var _=function(t){var e={},n={},r={},i="";try{var o=t.split(".");e=b(u(o[0])||""),n=b(u(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(t){}return{header:e,claims:n,data:r,signature:i}};
245/**
246 * @license
247 * Copyright 2017 Google LLC
248 *
249 * Licensed under the Apache License, Version 2.0 (the "License");
250 * you may not use this file except in compliance with the License.
251 * You may obtain a copy of the License at
252 *
253 *   http://www.apache.org/licenses/LICENSE-2.0
254 *
255 * Unless required by applicable law or agreed to in writing, software
256 * distributed under the License is distributed on an "AS IS" BASIS,
257 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
258 * See the License for the specific language governing permissions and
259 * limitations under the License.
260 */
261var w=function(){function t(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(var t=1;t<this.blockSize;++t)this.pad_[t]=0;this.reset()}return t.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},t.prototype.compress_=function(t,e){e||(e=0);var n=this.W_;if("string"==typeof t)for(var r=0;r<16;r++)n[r]=t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|t.charCodeAt(e+3),e+=4;else for(r=0;r<16;r++)n[r]=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],e+=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,s,a=this.chain_[0],c=this.chain_[1],u=this.chain_[2],l=this.chain_[3],h=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(o=l^c&(u^l),s=1518500249):(o=c^u^l,s=1859775393):r<60?(o=c&u|l&(c|u),s=2400959708):(o=c^u^l,s=3395469782);i=(a<<5|a>>>27)+o+h+s+n[r]&4294967295;h=l,l=u,u=4294967295&(c<<30|c>>>2),c=a,a=i}this.chain_[0]=this.chain_[0]+a&4294967295,this.chain_[1]=this.chain_[1]+c&4294967295,this.chain_[2]=this.chain_[2]+u&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+h&4294967295},t.prototype.update=function(t,e){if(null!=t){void 0===e&&(e=t.length);for(var n=e-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r<e;){if(0===o)for(;r<=n;)this.compress_(t,r),r+=this.blockSize;if("string"==typeof t){for(;r<e;)if(i[o]=t.charCodeAt(r),++r,++o===this.blockSize){this.compress_(i),o=0;break}}else for(;r<e;)if(i[o]=t[r],++r,++o===this.blockSize){this.compress_(i),o=0;break}}this.inbuf_=o,this.total_+=e}},t.prototype.digest=function(){var t=[],e=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&e,e/=256;this.compress_(this.buf_);var r=0;for(n=0;n<5;n++)for(var i=24;i>=0;i-=8)t[r]=this.chain_[n]>>i&255,++r;return t},t}();var S=function(){function t(t,e){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Prom
261ise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then((function(){t(n)})).catch((function(t){n.error(t)}))}return t.prototype.next=function(t){this.forEachObserver((function(e){e.next(t)}))},t.prototype.error=function(t){this.forEachObserver((function(e){e.error(t)})),this.close(t)},t.prototype.complete=function(){this.forEachObserver((function(t){t.complete()})),this.close()},t.prototype.subscribe=function(t,e,n){var r,i=this;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=0,r=e;n<r.length;n++){var i=r[n];if(i in t&&"function"==typeof t[i])return!0}return!1}(t,["next","error","complete"])?t:{next:t,error:e,complete:n}).next&&(r.next=C),void 0===r.error&&(r.error=C),void 0===r.complete&&(r.complete=C);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(t){}})),this.observers.push(r),o},t.prototype.unsubscribeOne=function(t){void 0!==this.observers&&void 0!==this.observers[t]&&(delete this.observers[t],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))},t.prototype.forEachObserver=function(t){if(!this.finalized)for(var e=0;e<this.observers.length;e++)this.sendOne(e,t)},t.prototype.sendOne=function(t,e){var n=this;this.task.then((function(){if(void 0!==n.observers&&void 0!==n.observers[t])try{e(n.observers[t])}catch(t){"undefined"!=typeof console&&console.error&&console.error(t)}}))},t.prototype.close=function(t){var e=this;this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then((function(){e.observers=void 0,e.onNoObservers=void 0})))},t}();function C(){}
262/**
263 * @license
264 * Copyright 2017 Google LLC
265 *
266 * Licensed under the Apache License, Version 2.0 (the "License");
267 * you may not use this file except in compliance with the License.
268 * You may obtain a copy of the License at
269 *
270 *   http://www.apache.org/licenses/LICENSE-2.0
271 *
272 * Unless required by applicable law or agreed to in writing, software
273 * distributed under the License is distributed on an "AS IS" BASIS,
274 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
275 * See the License for the specific language governing permissions and
276 * limitations under the License.
277 */function E(t,e,n){var r="";switch(e){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=t+" failed: ";return i+=r+" argument "}
278/**
279 * @license
280 * Copyright 2017 Google LLC
281 *
282 * Licensed under the Apache License, Version 2.0 (the "License");
283 * you may not use this file except in compliance with the License.
284 * You may obtain a copy of the License at
285 *
286 *   http://www.apache.org/licenses/LICENSE-2.0
287 *
288 * Unless required by applicable law or agreed to in writing, software
289 * distributed under the License is distributed on an "AS IS" BASIS,
290 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
291 * See the License for the specific language governing permissions and
292 * limitations under the License.
293 */
294var x=1e3,T=2,I=144e5,k=.5;e.CONSTANTS=i,e.Deferred=h,e.ErrorFactory=g,e.FirebaseError=v,e.MAX_VALUE_MILLIS=I,e.RANDOM_FACTOR=k,e.Sha1=w,e.areCookiesEnabled=function(){return!(!navigator||!navigator.cookieEnabled)},e.assert=o,e.assertionError=s,e.async=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Promise.resolve(!0).then((function(){t.apply(void 0,n)})).catch((function(t){e&&e(t)}))}},e.base64=c,e.base64Decode=u,e.base64Encode=function(t){var e=a(t);return c.encodeByteArray(e,!0)},e.calculateBackoffMillis=function(t,e,n){void 0===e&&(e=x),void 0===n&&(n=T);var r=e*Math.pow(n,t),i=Math.round(k*r*(Math.random()-.5)*2);return Math.min(I,r+i)},e.contains=
295/**
296 * @license
297 * Copyright 2017 Google LLC
298 *
299 * Licensed under the Apache License, Version 2.0 (the "License");
300 * you may not use this file except in compliance with the License.
301 * You may obtain a copy of the License at
302 *
303 *   http://www.apache.org/licenses/LICENSE-2.0
304 *
305 * Unless required by applicable law or agreed to in writing, software
306 * distributed under the License is distributed on an "AS IS" BASIS,
307 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
308 * See the License for the specific language governing permissions and
309 * limitations under the License.
310 */
311function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.createSubscribe=function(t,e){var n=new S(t,e);return n.subscribe.bind(n)},e.decode=_,e.deepCopy=
312/**
313 * @license
314 * Copyright 2017 Google LLC
315 *
316 * Licensed under the Apache License, Version 2.0 (the "License");
317 * you may not use this file except in compliance with the License.
318 * You may obtain a copy of the License at
319 *
320 *   http://www.apache.org/licenses/LICENSE-2.0
321 *
322 * Unless required by applicable law or agreed to in writing, software
323 * distributed under the License is distributed on an "AS IS" BASIS,
324 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
325 * See the License for the specific language governing permissions and
326 * limitations under the License.
327 */
328function(t){return l(void 0,t)},e.deepExtend=l,e.errorPrefix=E,e.getUA=p,e.isAdmin=function(t){var e=_(t).claims;return"object"==typeof e&&!0===e.admin},e.isBrowser=function(){return"object"==typeof self&&self.self===self},e.isBrowserExtension=function(){var t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id},e.isElectron=function(){return p().indexOf("Electron/")>=0},e.isEmpty=function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0},e.isIE=function(){var t=p();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0},e.isIndexedDBAvailable=function(){return"indexedDB"in self&&null!=indexedDB},e.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(p())},e.isNode=d,e.isNodeSdk=function(){return!0===i.NODE_CLIENT||!0===i.NODE_ADMIN},e.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},e.isSafari=function(){return!d()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")},e.isUWP=function(){return p().indexOf("MSAppHost/")>=0},e.isValidFormat=function(t){var e=_(t).claims;return!!e&&"object"==typeof e&&e.hasOwnProperty("iat")},e.isValidTimestamp=function(t){var e=_(t).claims,n=Math.floor((new Date).getTime()/1e3),r=0,i=0;return"object"==typeof e&&(e.hasOwnProperty("nbf")?r=e.nbf:e.hasOwnProperty("iat")&&(r=e.iat),i=e.hasOwnProperty("exp")?e.exp:r+86400),!!n&&!!r&&!!i&&n>=r&&n<=i},e.issuedAtTime=function(t){var e=_(t).claims;return"object"==typeof e&&e.hasOwnProperty("iat")?e.iat:null},e.jsonEval=b,e.map=function(t,e,n){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=e.call(n,t[i],i,t));return r}
329/**
330 * @license
331 * Copyright 2017 Google LLC
332 *
333 * Licensed under the Apache License, Version 2.0 (the "License");
334 * you may not use this file except in compliance with the License.
335 * You may obtain a copy of the License at
336 *
337 *   http://www.apache.org/licenses/LICENSE-2.0
338 *
339 * Unless required by applicable law or agreed to in writing, software
340 * distributed under the License is distributed on an "AS IS" BASIS,
341 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
342 * See the License for the specific language governing permissions and
343 * limitations under the License.
344 */,e.querystring=function(t){for(var e=[],n=function(t,n){Array.isArray(n)?n.forEach((function(n){e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))})):e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))},r=0,i=Object.entries(t);r<i.length;r++){var o=i[r];n(o[0],o[1])}return e.length?"&"+e.join("&"):""},e.querystringDecode=function(t){var e={};return t.replace(/^\?/,"").split("&").forEach((function(t){if(t){var n=t.split("=");e[n[0]]=n[1]}})),e},e.safeGet=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0},e.stringLength=function(t){for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);
344r<128?e++:r<2048?e+=2:r>=55296&&r<=56319?(e+=4,n++):e+=3}return e},e.stringToByteArray=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);if(i>=55296&&i<=56319){var s=i-55296;r++,o(r<t.length,"Surrogate pair missing trail surrogate."),i=65536+(s<<10)+(t.charCodeAt(r)-56320)}i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):i<65536?(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},e.stringify=function(t){return JSON.stringify(t)},e.validateArgCount=function(t,e,n,r){var i;if(r<e?i="at least "+e:r>n&&(i=0===n?"none":"no more than "+n),i)throw new Error(t+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")},e.validateCallback=function(t,e,n,r){if((!r||n)&&"function"!=typeof n)throw new Error(E(t,e,r)+"must be a valid function.")},e.validateContextObject=function(t,e,n,r){if((!r||n)&&("object"!=typeof n||null===n))throw new Error(E(t,e,r)+"must be a valid context object.")},e.validateIndexedDBOpenable=function(){return new Promise((function(t,e){try{var n=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=window.indexedDB.open(r);i.onsuccess=function(){i.result.close(),n||window.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=function(){n=!1},i.onerror=function(){var t;e((null===(t=i.error)||void 0===t?void 0:t.message)||"")}}catch(t){e(t)}}))},e.validateNamespace=function(t,e,n,r){if((!r||n)&&"string"!=typeof n)throw new Error(E(t,e,r)+"must be a valid firebase namespace.")}}).call(this,n(71))},function(t,e,n){var r,i,o=n(82),s=n(83),a=0,c=0;t.exports=function(t,e,n){var u=e&&n||0,l=e||[],h=(t=t||{}).node||r,p=void 0!==t.clockseq?t.clockseq:i;if(null==h||null==p){var d=o();null==h&&(h=r=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==p&&(p=i=16383&(d[6]<<8|d[7]))}var f=void 0!==t.msecs?t.msecs:(new Date).getTime(),v=void 0!==t.nsecs?t.nsecs:c+1,g=f-a+(v-c)/1e4;if(g<0&&void 0===t.clockseq&&(p=p+1&16383),(g<0||f>a)&&void 0===t.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=f,c=v,i=p;var m=(1e4*(268435455&(f+=122192928e5))+v)%4294967296;l[u++]=m>>>24&255,l[u++]=m>>>16&255,l[u++]=m>>>8&255,l[u++]=255&m;var y=f/4294967296*1e4&268435455;l[u++]=y>>>8&255,l[u++]=255&y,l[u++]=y>>>24&15|16,l[u++]=y>>>16&255,l[u++]=p>>>8|128,l[u++]=255&p;for(var b=0;b<6;++b)l[u+b]=h[b];return e||s(l)}},function(t,e,n){var r=n(82),i=n(83);t.exports=function(t,e,n){var o=e&&n||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var s=(t=t||{}).random||(t.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var a=0;a<16;++a)e[o+a]=s[a];return e||i(s)}},function(t,e,n){var r=n(248),i=n(249),o=n(139),s=n(250);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||s()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 18 18"><defs><path id="a1" d="M9 18A9 9 0 1 1 9 0a9 9 0 0 1 0 18zM7.36 6.96v.4h.82v6.14h-.82v.41h3.28v-.41h-.82V6.96H7.36zM8.8 5.72a1.02 1.02 0 1 0 0-2.05 1.02 1.02 0 0 0 0 2.05z"/></defs><g fill="none" fill-rule="evenodd"><mask id="b1" fill="#fff"><use xlink:href="#a1"/></mask><use fill="#000" xlink:href="#a1"/><g fill="#B42846" mask="url(#b1)"><path d="M0 0h18v18H0z"/></g></g></svg>'},function(t,e){NodeList.prototype.forEach||(NodeList.prototype.forEach=Array.prototype.forEach)},function(t,e){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector)},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(138);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}
vendor: 1,774 bytes, lines 344-346
344,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(60).default,i=n(226);t.exports=function(t){var e=i(t,"string");return"symbol"==r(e)?e:e+""},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){this.v=t,this.k=e},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(143);function i(){
345/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
346var e,n,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.toStringTag||"@@toStringTag";function c(t,i,o,s){var a=i&&i.prototype instanceof l?i:l,c=Object.create(a.prototype);return r(c,"_invoke",function(t,r,i){var o,s,a,c=0,l=i||[],h=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return o=t,s=0,a=e,p.n=n,u}};function d(t,r){for(s=t,a=r,n=0;!h&&c&&!i&&n<l.length;n++){var i,o=l[n],d=p.p,f=o[2];t>3?(i=f===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=d&&((i=t<2&&d<o[1])?(s=0,p.v=r,p.n=o[1]):d<f&&(i=t<3||o[0]>r||r>f)&&(o[4]=t,o[5]=r,p.n=f,s=0))}if(i||t>1)return u;throw h=!0,r}return function(i,l,f){if(c>1)throw TypeError("Generator is already running");for(h&&1===l&&d(l,f),s=l,a=f;(n=s<2?e:a)||!h;){o||(s?s<3?(s>1&&(p.n=-1),d(s,a)):p.n=a:p.v=a);try{if(c=2,o){if(s||(i="next"),n=o[i]){if(!(n=n.call(o,a)))throw TypeError("iterator result is not an object");if(!n.done)return n;a=n.value,s<2&&(s=0)}else 1===s&&(n=o.return)&&n.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((n=(h=p.n<0)?a:t.call(r,p))!==u)break}catch(t){o=e,s=1,a=t}finally{c=1}}return{value:n,done:h}}}(t,o,s),!0),c}var u={};function l(){}function h(){}function p(){}n=Object.getPrototypeOf;
346var d=[][s]?n(n([][s]())):(r(n={},s,(function(){return this})),n),f=p.prototype=l.prototype=Object.create(d);function v(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,r(t,a,"GeneratorFunction")),t.prototype=Object.create(f),t}return h.prototype=p,r(f,"constructor",p),r(p,"constructor",h),h.displayName="GeneratorFunction",r(p,a,"GeneratorFunction"),r(f),r(f,a,"Generator"),r(f,s,(function(){return this})),r(f,"toString",(function(){return"[object Generator]"})),(t.exports=i=function(){return{w:c,m:v}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function n(e,r,i,o){var s=Object.defineProperty;try{s({},"",{})}catch(e){s=0}t.exports=n=function(t,e,r,i){function o(e,r){n(t,e,(function(t){return this._invoke(e,r,t)}))}e?s?s(t,e,{value:r,enumerable:!i,configurable:!i,writable:!i}):t[e]=r:(o("next",0),o("throw",1),o("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,n(e,r,i,o)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(142),i=n(145);t.exports=function(t,e,n,o,s){return new i(r().w(t,e,n,o),s||Promise)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(141),i=n(143);t.exports=function t(e,n){function o(t,i,s,a){try{var c=e[t](i),u=c.value;return u instanceof r?n.resolve(u.v).then((function(t){o("next",t,s,a)}),(function(t){o("throw",t,s,a)})):n.resolve(u).then((function(t){c.value=t,s(c)}),(function(t){return o("throw",t,s,a)}))}catch(t){a(t)}}var s;this.next||(i(t.prototype),i(t.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),i(this,"_invoke",(function(t,e,r){function i(){return new n((function(e,n){o(t,r,e,n)}))}return s=s?s.then(i,i):i()}),!0)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(55);function i(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(r.isURLSearchParams(e))o=e.toString();else{var s=[];r.forEach(e,(function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,(function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),s.push(i(e)+"="+i(t))})))})),o=s.join("&")}if(o){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,i){return t.config=e,n&&(t.code=n),t.request=r,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t}},function(t,e,n){"use strict";var r=n(55),i=n(237),o=n(238),s=n(147),a=n(239),c=n(242),u=n(243),l=n(150),h=n(89),p=n(90);t.exports=function(t){return new Promise((function(e,n){var d,f=t.data,v=t.headers,g=t.responseType;function m(){t.cancelToken&&t.cancelToken.unsubscribe(d),t.signal&&t.signal.removeEventListener("abort",d)}r.isFormData(f)&&delete v["Content-Type"];var y=new XMLHttpRequest;if(t.auth){var b=t.auth.username||"",_=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";v.Authorization="Basic "+btoa(b+":"+_)}var w=a(t.baseURL,t.url);function S(){if(y){var r="getAllResponseHeaders"in y?c(y.getAllResponseHeaders()):null,o={data:g&&"text"!==g&&"json"!==g?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:t,request:y};i((function(t){e(t),m()}),(function(t){n(t),m()}),o),y=null}}if(y.open(t.method.toUpperCase(),s(w,t.params,t.paramsSerializer),!0),y.timeout=t.timeout,"onloadend"in y?y.onloadend=S:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(S)},y.onabort=function(){y&&(n(l("Request aborted",t,"ECONNABORTED",y)),y=null)},y.onerror=function(){n(l("Network Error",t,null,y)),y=null},y.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded",r=t.transitional||h.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(l(e,t,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",y)),y=null},r.isStandardBrowserEnv()){var C=(t.withCredentials||u(w))&&t.xsrfCookieName?o.read(t.xsrfCookieName):void 0;C&&(v[t.xsrfHeaderName]=C)}"setRequestHeader"in y&&r.forEach(v,(function(t,e){void 0===f&&"content-type"===e.toLowerCase()?delete v[e]:y.setRequestHeader(e,t)}
346)),r.isUndefined(t.withCredentials)||(y.withCredentials=!!t.withCredentials),g&&"json"!==g&&(y.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&y.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&y.upload&&y.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(d=function(t){y&&(n(!t||t&&t.type?new p("canceled"):t),y.abort(),y=null)},t.cancelToken&&t.cancelToken.subscribe(d),t.signal&&(t.signal.aborted?d():t.signal.addEventListener("abort",d))),f||(f=null),y.send(f)}))}},function(t,e,n){"use strict";var r=n(148);t.exports=function(t,e,n,i,o){var s=new Error(t);return r(s,e,n,i,o)}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";var r=n(55);t.exports=function(t,e){e=e||{};var n={};function i(t,e){return r.isPlainObject(t)&&r.isPlainObject(e)?r.merge(t,e):r.isPlainObject(e)?r.merge({},e):r.isArray(e)?e.slice():e}function o(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:i(void 0,t[n]):i(t[n],e[n])}function s(t){if(!r.isUndefined(e[t]))return i(void 0,e[t])}function a(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:i(void 0,t[n]):i(void 0,e[n])}function c(n){return n in e?i(t[n],e[n]):n in t?i(void 0,t[n]):void 0}var u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return r.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||o,i=e(t);r.isUndefined(i)&&e!==c||(n[t]=i)})),n}},function(t,e){t.exports={version:"0.22.0"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(91),i=n(131),o=function(){function t(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY"}return t.prototype.setInstantiationMode=function(t){return this.instantiationMode=t,this},t.prototype.setMultipleInstances=function(t){return this.multipleInstances=t,this},t.prototype.setServiceProps=function(t){return this.serviceProps=t,this},t}(),s="[DEFAULT]",a=function(){function t(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map}return t.prototype.get=function(t){void 0===t&&(t=s);var e=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(e)){var n=new i.Deferred;this.instancesDeferred.set(e,n);try{var r=this.getOrInitializeService(e);r&&n.resolve(r)}catch(t){}}return this.instancesDeferred.get(e).promise},t.prototype.getImmediate=function(t){var e=r.__assign({identifier:s,optional:!1},t),n=e.identifier,i=e.optional,o=this.normalizeInstanceIdentifier(n);try{var a=this.getOrInitializeService(o);if(!a){if(i)return null;throw Error("Service "+this.name+" is not available")}return a}catch(t){if(i)return null;throw t}},t.prototype.getComponent=function(){return this.component},t.prototype.setComponent=function(t){var e,n;if(t.name!==this.name)throw Error("Mismatching Component "+t.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=t,function(t){return"EAGER"===t.instantiationMode}
347/**
348 * @license
349 * Copyright 2019 Google LLC
350 *
351 * Licensed under the Apache License, Version 2.0 (the "License");
352 * you may not use this file except in compliance with the License.
353 * You may obtain a copy of the License at
354 *
355 *   http://www.apache.org/licenses/LICENSE-2.0
356 *
357 * Unless required by applicable law or agreed to in writing, software
358 * distributed under the License is distributed on an "AS IS" BASIS,
359 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
360 * See the License for the specific language governing permissions and
361 * limitations under the License.
362 */(t))try{this.getOrInitializeService(s)}catch(t){}try{for(var i=r.__values(this.instancesDeferred.entries()),o=i.next();!o.done;o=i.next()){var a=r.__read(o.value,2),c=a[0],u=a[1],l=this.normalizeInstanceIdentifier(c);try{var h=this.getOrInitializeService(l);u.resolve(h)}catch(t){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t.prototype.clearInstance=function(t){void 0===t&&(t=s),this.instancesDeferred.delete(t),this.instances.delete(t)},t.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(e){switch(e.label){case 0:return t=Array.from(this.instances.values()),[4,Promise.all(r.__spread(t.filter((function(t){return"INTERNAL"in t})).map((function(t){return t.INTERNAL.delete()})),t.filter((function(t){return"_delete"in t})).map((function(t){return t._delete()}))))];case 1:return e.sent(),[2]}}))}))},t.prototype.isComponentSet=function(){return null!=this.component},t.prototype.getOrInitializeService=function(t){var e=this.instances.get(t);return!e&&this.component&&(e=this.component.instanceFactory(this.container,function(t){return t===s?void 0:t}(t)),this.instances.set(t,e)),e||null},t.prototype.normalizeInstanceIdentifier=function(t){return this.component?this.component.multipleInstances?t:s:t},t}();var c=function(){function t(t){this.name=t,this.providers=new Map}return t.prototype.addComponent=function(t){var e=this.getProvider(t.name);if(e.isComponentSet())throw new Error("Component "+t.name+" has already been registered with "+this.name);e.setComponent(t)},t.prototype.addOrOverwriteComponent=function(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)},t.prototype.getProvider=function(t){if(this.providers.has(t))return this.providers.get(t);var e=new a(t,this);return this.providers.set(t,e),e},t.prototype.getProviders=function(){return Array.from(this.providers.values())},t}();e.Component=o,e.ComponentContainer=c,e.Provider=a},function(t,e,n){"use strict";
363/*! *****************************************************************************
364Copyright (c) Microsoft Corporation. All rights reserved.
365Licensed under the Apache License, Version 2.0 (the "License");
365 you may not use
366this file except in compliance with the License. You may obtain a copy of the
367License at http://www.apache.org/licenses/LICENSE-2.0
368
369THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
370KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
371WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
372MERCHANTABLITY OR NON-INFRINGEMENT.
373
374See the Apache Version 2.0 License for specific language governing permissions
375and limitations under the License.
376***************************************************************************** */
377function r(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}
378/**
379 * @license
380 * Copyright 2017 Google LLC
381 *
382 * Licensed under the Apache License, Version 2.0 (the "License");
383 * you may not use this file except in compliance with the License.
384 * You may obtain a copy of the License at
385 *
386 *   http://www.apache.org/licenses/LICENSE-2.0
387 *
388 * Unless required by applicable law or agreed to in writing, software
389 * distributed under the License is distributed on an "AS IS" BASIS,
390 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
391 * See the License for the specific language governing permissions and
392 * limitations under the License.
393 */var i;n.r(e),n.d(e,"LogLevel",(function(){return o})),n.d(e,"Logger",(function(){return h})),n.d(e,"setLogLevel",(function(){return p})),n.d(e,"setUserLogHandler",(function(){return d}));var o,s=[];!function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"}(o||(o={}));var a={debug:o.DEBUG,verbose:o.VERBOSE,info:o.INFO,warn:o.WARN,error:o.ERROR,silent:o.SILENT},c=o.INFO,u=((i={})[o.DEBUG]="log",i[o.VERBOSE]="log",i[o.INFO]="info",i[o.WARN]="warn",i[o.ERROR]="error",i),l=function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(!(e<t.logLevel)){var o=(new Date).toISOString(),s=u[e];if(!s)throw new Error("Attempted to log a message with an invalid logType (value: "+e+")");console[s].apply(console,r(["["+o+"]  "+t.name+":"],n))}},h=function(){function t(t){this.name=t,this._logLevel=c,this._logHandler=l,this._userLogHandler=null,s.push(this)}return Object.defineProperty(t.prototype,"logLevel",{get:function(){return this._logLevel},set:function(t){if(!(t in o))throw new TypeError('Invalid value "'+t+'" assigned to `logLevel`');this._logLevel=t},enumerable:!1,configurable:!0}),t.prototype.setLogLevel=function(t){this._logLevel="string"==typeof t?a[t]:t},Object.defineProperty(t.prototype,"logHandler",{get:function(){return this._logHandler},set:function(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(t){this._userLogHandler=t},enumerable:!1,configurable:!0}),t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.DEBUG],t)),this._logHandler.apply(this,r([this,o.DEBUG],t))},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.VERBOSE],t)),this._logHandler.apply(this,r([this,o.VERBOSE],t))},t.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.INFO],t)),this._logHandler.apply(this,r([this,o.INFO],t))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.WARN],t)),this._logHandler.apply(this,r([this,o.WARN],t))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,o.ERROR],t)),this._logHandler.apply(this,r([this,o.ERROR],t))},t}();
393function p(t){s.forEach((function(e){e.setLogLevel(t)}))}function d(t,e){for(var n=function(n){var r=null;e&&e.level&&(r=a[e.level]),n.userLogHandler=null===t?null:function(e,n){for(var i=[],s=2;s<arguments.length;s++)i[s-2]=arguments[s];var a=i.map((function(t){if(null==t)return null;if("string"==typeof t)return t;if("number"==typeof t||"boolean"==typeof t)return t.toString();if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch(t){return null}})).filter((function(t){return t})).join(" ");n>=(null!=r?r:e.logLevel)&&t({level:o[n].toLowerCase(),message:a,args:i,type:e.name})}},r=0,i=s;r<i.length;r++){n(i[r])}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(1),i=n(11),o=n(28),s=n(10);function a(t){return function(e){var n=new c(t),r=e.lift(n);return n.caught=r}}var c=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.selector,this.caught))},t}(),u=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.selector=n,i.caught=r,i}return r.a(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var r=new o.a(this,void 0,void 0);this.add(r),Object(s.a)(this,n,void 0,void 0,r)}},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(4),i=n(22),o=n(25),s=n(37);function a(t,e,n,c){return Object(o.a)(n)&&(c=n,n=void 0),c?a(t,e,n).pipe(Object(s.a)((function(t){return Object(i.a)(t)?c.apply(void 0,t):c(t)}))):new r.a((function(r){!function t(e,n,r,i,o){var s;if(function(t){return t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}(e)){var a=e;e.addEventListener(n,r,o),s=function(){return a.removeEventListener(n,r,o)}}else if(function(t){return t&&"function"==typeof t.on&&"function"==typeof t.off}(e)){var c=e;e.on(n,r),s=function(){return c.off(n,r)}}else if(function(t){return t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}(e)){var u=e;e.addListener(n,r),s=function(){return u.removeListener(n,r)}}else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var l=0,h=e.length;l<h;l++)t(e[l],n,r,i,o)}i.add(s)}(t,e,(function(t){arguments.length>1?r.next(Array.prototype.slice.call(arguments)):r.next(t)}),r,n)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(1),i=n(5);function o(t,e){return function(n){return n.lift(new s(t,e))}}var s=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.thisArg))},t}(),a=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.thisArg=r,i.count=0,i}return r.a(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(68);function i(t,e,n){var i;return i=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},function(t){return t.lift(function(t){var e,n,i=t.bufferSize,o=void 0===i?Number.POSITIVE_INFINITY:i,s=t.windowTime,a=void 0===s?Number.POSITIVE_INFINITY:s,c=t.refCount,u=t.scheduler,l=0,h=!1,p=!1;return function(t){l++,e&&!h||(h=!1,e=new r.a(o,a,u),n=t.subscribe({next:function(t){e.next(t)},error:function(t){h=!0,e.error(t)},complete:function(){p=!0,e.complete()}}));var i=e.subscribe(this);this.add((function(){l--,i.unsubscribe(),n&&!p&&c&&0===l&&(n.unsubscribe(),n=void 0,e=void 0)}))}}(i))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(1),i=n(22),o=n(32),s=n(11),a=n(10);function c(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!Object(i.a)(t[0]))return t[0];t=t[0]}return Object(o.a)(t,void 0).lift(new u)}var u=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new l(t))},t}(),l=function(t){function e(e){var n=t.call(this,e)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return r.a(e,t),e.prototype._next=function(t){this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var n=0;n<e&&!this.hasFirst;n++){var r=t[n],i=Object(a.a)(this,r,r,n);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}},e.prototype.notifyNext=function(t,e,n,r,i){if(!this.hasFirst){this.hasFirst=!0;for(var o=0;o<this.subscriptions.length;o++)if(o!==n){var s=this.subscriptions[o];s.unsubscribe(),this.remove(s)}this.subscriptions=null}this.destination.next(e)},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(4),i=n(24),o=n(58),s=n(32);function a(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,a=null,c=t[t.length-1];return Object(i.a)(c)?(a=t.pop(),t.length>
3931&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof c&&(n=t.pop()),null===a&&1===t.length&&t[0]instanceof r.a?t[0]:Object(o.a)(n)(Object(s.a)(t,a))}},,,function(t,e,n){"use strict";var r=n(1),i=n(23),o=n(4),s=n(5),a=n(8);function c(){return function(t){return t.lift(new u(t))}}var u=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new l(t,n),i=e.subscribe(r);return r.closed||(r.connection=n.connect()),i},t}(),l=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.a(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(s.a),h=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return r.a(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new a.a).add(this.source.subscribe(new d(this.getSubject(),this))),t.closed&&(this._connection=null,t=a.a.EMPTY)),t},e.prototype.refCount=function(){return c()(this)},e}(o.a),p=function(){var t=h.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),d=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.a(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(i.b);s.a;var f=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),i=n(r).subscribe(t);return i.add(e.subscribe(r)),i},t}();function v(){return new i.a}function g(){return function(t){return c()((e=v,function(t){var r;if(r="function"==typeof e?e:function(){return e},"function"==typeof n)return t.lift(new f(r,n));var i=Object.create(t,p);return i.source=t,i.subjectFactory=r,i})(t));var e,n}}n.d(e,"a",(function(){return g}))},function(t,e,n){"use strict";var r=n(33),i=n(66),o=n(1);var s=n(11),a=n(10);function c(t,e,n){return void 0===n&&(n=r.a),function(r){var i,o=(i=t)instanceof Date&&!isNaN(+i),s=o?+t-n.now():Math.abs(t);return r.lift(new u(s,o,e,n))}}var u=function(){function t(t,e,n,r){this.waitFor=t,this.absoluteTimeout=e,this.withObservable=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),l=function(t){function e(e,n,r,i,o){var s=t.call(this,e)||this;return s.absoluteTimeout=n,s.waitFor=r,s.withObservable=i,s.scheduler=o,s.action=null,s.scheduleTimeout(),s}return o.a(e,t),e.dispatchTimeout=function(t){var e=t.withObservable;t._unsubscribeAndRecycle(),t.add(Object(a.a)(t,e))},e.prototype.scheduleTimeout=function(){var t=this.action;t?this.action=t.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(e){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,e)},e.prototype._unsubscribe=function(){this.action=null,this.scheduler=null,this.withObservable=null},e}(s.a),h=n(46);function p(t,e){return void 0===e&&(e=r.a),c(t,Object(h.a)(new i.a),e)}n.d(e,"a",(function(){return p}))},function(t,e,n){"use strict";var r=n(1),i=n(5),o=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),s=n(48);function a(t){return function(e){return 0===t?Object(s.a)():e.lift(new c(t))}}n.d(e,"a",(function(){return a}));var c=function(){function t(t){if(this.total=t,this.total<0)throw new o}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.total))},t}(),u=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return r.a(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(i.a)},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-20 -20 64 64"><path d="M37.328 28.589S32.662 21.332 32.662 12V1.632c0-11.406-9.331-20.738-20.739-20.738-11.404 0-20.735 9.332-20.735 20.738V12c0 9.332-4.666 16.589-4.666 16.589a2.352 2.352 0 0 0 0 2.594c.258 1.036 1.035 1.556 2.071 1.556h46.658c1.038 0 1.816-.52 2.332-1.298.522-1.036.262-1.814-.255-2.852zM11.923 43.106c3.631 0 6.997-2.075 8.812-5.186H3.11c1.814 3.111 5.185 5.186 8.813 5.186z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" aria-label="chat" role="img">\n  <path stroke-width="0" d="M19.2727273,7.85714286 C19.2727273,7.45548122 19.5983384,7.12987013 20,7.12987013 C20.4016616,7.
39312987013 20.7272727,7.45548122 20.7272727,7.85714286 L20.7272727,17.1428571 C20.7272727,17.5445188 20.4016616,17.8701299 20,17.8701299 L17.8181818,17.8701299 L17.8181818,20 C17.8181818,20.5781429 17.1762044,20.9251484 16.6925193,20.6084498 L12.5103579,17.8701299 L12,17.8701299 C11.5983384,17.8701299 11.2727273,17.5445188 11.2727273,17.1428571 C11.2727273,16.7411955 11.5983384,16.4155844 12,16.4155844 L12.7272727,16.4155844 C12.8688021,16.4155844 13.0072564,16.4568795 13.1256625,16.5344073 L16.3636364,18.6545092 L16.3636364,17.1428571 C16.3636364,16.7411955 16.6892475,16.4155844 17.0909091,16.4155844 L19.2727273,16.4155844 L19.2727273,7.85714286 Z"></path>\n  <path stroke-width="0" d="M6.18181818,15.012987 L4,15.012987 C3.59833836,15.012987 3.27272727,14.6873759 3.27272727,14.2857143 L3.27272727,5 C3.27272727,4.59833836 3.59833836,4.27272727 4,4.27272727 L17.0909091,4.27272727 C17.4925707,4.27272727 17.8181818,4.59833836 17.8181818,5 L17.8181818,14.2857143 C17.8181818,14.6873759 17.4925707,15.012987 17.0909091,15.012987 L12.229663,15.012987 L7.32676582,18.4525195 C6.84481368,18.7906236 6.18181818,18.4458638 6.18181818,17.8571429 L6.18181818,15.012987 Z"></path>\n</svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" aria-label="chevron down" role="img">\n  <path stroke-width="0" d="M19.4343146,7.43431458 C19.746734,7.12189514 20.253266,7.12189514 20.5656854,7.43431458 C20.8781049,7.74673401 20.8781049,8.25326599 20.5656854,8.56568542 L12.5656854,16.5656854 C12.253266,16.8781049 11.746734,16.8781049 11.4343146,16.5656854 L3.43431458,8.56568542 C3.12189514,8.25326599 3.12189514,7.74673401 3.43431458,7.43431458 C3.74673401,7.12189514 4.25326599,7.12189514 4.56568542,7.43431458 L12,14.8686292 L19.4343146,7.43431458 Z"></path>\n</svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-label="chevron-left" role="img">\n  <path d="M15.566 19.434a.8.8 0 1 1-1.132 1.132l-8-8a.8.8 0 0 1 0-1.132l8-8a.8.8 0 1 1 1.132 1.132L8.13 12l7.435 7.434z"/>\n</svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-label="chevron-right" role="img">\n  <path d="M15.869 12L8.434 4.566a.8.8 0 1 1 1.132-1.132l8 8a.8.8 0 0 1 0 1.132l-8 8a.8.8 0 1 1-1.132-1.132L15.87 12z"/>\n</svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-1 0 25 24">\n  <path d="M12.64,14a1.83,1.83,0,0,1-1.11.32A1.84,1.84,0,0,1,10.41,14L2,9.48v9.6a.75.75,0,0,0,.79.8H20.26a.75.75,0,0,0,.79-.8V9.48Z"/>\n  <path d="M20.26,4H2.79A.75.75,0,0,0,2,4.79V7.18a.84.84,0,0,0,.4.71l8.73,4.76a.72.72,0,0,0,.4.08.7.7,0,0,0,.39-.08l8.73-4.76a.84.84,0,0,0,.4-.71V4.79A.75.75,0,0,0,20.26,4Z"/>\n</svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M4.52 6.438c-.247-.405-.743-.567-1.073-.324-.413.243-.578.728-.33 1.133l7.846 13.348a.871.871 0 0 0 .743.405c.165 0 .248 0 .413-.08.413-.244.496-.729.33-1.134L4.522 6.438z"/><path class="se-icon__accent-path" d="M15.102 10.542h.85c1.645 0 2.609-.169 3.476-.74l-3.187-5.148c-1.12.792-2.316 1.012-4.115 1.012h-.935c-1.56 0-2.505.202-3.273.88l3.202 5.11c.965-.869 2.147-1.114 3.982-1.114zm.721-6.563c.024.045.05.085.076.122l-.076-.122zm.592.42l.047.001h-.047zm4.467 5.09c.17.396.17.792-.085 1.029-1.615 1.345-3.315 1.424-4.845 1.424h-.85c-1.616 0-2.806.08-3.826 1.741a.643.643 0 0 1-.34.317l-4.76-7.597c1.445-1.979 3.315-2.137 5.015-2.137h.935c1.275 0 2.55-.079 3.656-1.029.17-.237.425-.237.68-.237.255 0 .51.158.595.317l3.825 6.172z"/></svg>\n'},function(t,e){t.exports='<svg viewBox="0 0 24 24"><g><path fill="currentColor" d="M22 11.091H2a.908.908 0 1 0 0 1.818h20a.909.909 0 0 0 0-1.818zM2 6.842h20a.909.909 0 0 0 0-1.818H2a.909.909 0 0 0 0 1.818zM22 17.158H2a.908.908 0 1 0 0 1.818h20a.91.91 0 0 0 0-1.818z"/></g></svg>\r\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3.61C9.517 5.44 5.793 6.661 3.31 6.661c0 5.705 2.887 11.593 8.69 14.034 5.803-2.44 8.69-8.329 8.69-14.034-2.483 0-6.207-1.22-8.69-3.05z"/><path d="M12 21c-.031 0-.093 0-.124-.03C6.476 18.711 3 13.097 3 6.66c0-.183.124-.305.31-.305 2.545 0 6.207-1.281 8.504-2.99.124-.091.248-.091.372 0 2.297 1.709 5.959 2.99 8.504 2.99.186 0 .31.122.31.305 0 6.437-3.476 12.05-8.876 14.308-.03.031-.093.031-.124.031z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
393<path d="M20.181 3.34c-.318-.328-.79-.535-1.434-.682-.57-.132-1.23-.195-1.984-.195a14.762 14.762 0 0 0-3.834.525c-.716.19-1.41.426-2.083.711-.682.288-1.369.657-2.058 1.107-.697.454-1.335.969-1.905 1.54-.72.72-1.35 1.53-1.884 2.43-.53.892-.937 1.77-1.218 2.635-.274.843-.48 1.689-.615 2.53a11.758 11.758 0 0 0-.156 2.344c.03.702.114 1.32.25 1.85.152.602.37 1.064.69 1.385.34.34.84.57 1.505.726.6.147 1.287.217 2.061.217.741 0 1.503-.069 2.29-.205a16.32 16.32 0 0 0 2.44-.63 12.872 12.872 0 0 0 2.568-1.21 12.46 12.46 0 0 0 2.33-1.827 11.91 11.91 0 0 0 1.659-2.085c.48-.76.86-1.519 1.149-2.275.28-.735.51-1.485.682-2.242.177-.765.288-1.485.333-2.167.04-.665.045-1.28.015-1.845a7.134 7.134 0 0 0-.23-1.522c-.139-.481-.316-.85-.57-1.116zM7.432 18.967c-.666 0-1.236-.06-1.71-.172-.405-.098-.657-.215-.745-.3-.075-.075-.177-.29-.266-.642a8.017 8.017 0 0 1-.202-1.55c-.027-.604.02-1.286.14-2.051.034-.218.073-.43.118-.645l5.1 5.1a11.821 11.821 0 0 1-2.435.261zm10.084-5.284c-.425.675-.911 1.287-1.46 1.835-.615.614-1.3 1.154-2.055 1.609-.765.465-1.527.825-2.286 1.08-.338.112-.666.216-.99.3l-5.757-5.755A11.588 11.588 0 0 1 6.3 9.581a10.895 10.895 0 0 1 1.665-2.15c.5-.5 1.057-.951 1.671-1.349a11.577 11.577 0 0 1 1.836-.99c.594-.25 1.208-.462 1.84-.634l5.716 5.71c-.14.503-.305 1.004-.492 1.5a11.233 11.233 0 0 1-1.02 2.016zm1.717-4.368l-5.068-5.067a13.133 13.133 0 0 1 2.687-.285c.652 0 1.202.053 1.65.155.37.084.584.18.632.228.03.036.102.183.176.435.09.31.147.71.172 1.195.03.51.024 1.07-.015 1.684a11.554 11.554 0 0 1-.234 1.655zm-7.572-1.152v-.002a.377.377 0 0 1 .525-.006L13.5 9.47l1.353-1.35a.375.375 0 0 1 .522.009c.147.147.15.384.009.519L14.031 10l1.242 1.239a.376.376 0 0 1-.009.525.375.375 0 0 1-.525.006L13.5 10.53l-.972.97 1.245 1.239a.373.373 0 0 1-.007.524.375.375 0 0 1-.525.006L12 12.03l-.969.969 1.24 1.24a.374.374 0 0 1-.006.525.375.375 0 0 1-.525.006l-1.24-1.24-1.316 1.314a.375.375 0 0 1-.522-.01.373.373 0 0 1-.009-.52l1.317-1.316-1.314-1.311a.374.374 0 0 1 .005-.525.375.375 0 0 1 .525-.006l1.314 1.312.97-.97-1.314-1.311a.374.374 0 0 1 .005-.525.375.375 0 0 1 .525-.006L12 10.968l.97-.968-1.314-1.311a.374.374 0 0 1 .005-.525z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.267 3.734A2.506 2.506 0 0 0 18.49 3c-.642 0-1.283.245-1.773.734L15.142 5.31 3.668 9.14 3 11.51l2.71 1.926v4.855h5.076L13.202 21l1.824-.507 3.657-11.628 1.58-1.58a2.51 2.51 0 0 0 .004-3.55zm-9.483 13.05H7.75l3.62-3.618a.379.379 0 0 0 0-.533.384.384 0 0 0-.535 0l-3.62 3.62v-2.818a1.47 1.47 0 0 0-.105-.524l8.76-6.152 1.26 1.352-6.1 8.698a1.632 1.632 0 0 0-.243-.024h-.002zm6.963-9.113l-1.37-1.47.43-.429 1.42 1.42-.481.48h.001zm-13.01 3.227l.165-.581 8.76-2.926-6.984 4.906c-.033-.03-.06-.063-.096-.09l-1.845-1.31zm9.098 8.362l-.135.038-1.791-2.01c-.056-.06-.12-.112-.18-.165l5.038-7.187-2.935 9.323.003.001zM19.2 6.217l-.441.443-1.418-1.42.442-.442a.996.996 0 0 1 1.418 0 1.003 1.003 0 0 1 0 1.418l-.001.001z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 12c0-5.522-4.478-10-10-10S2 6.478 2 12s4.478 10 10 10 10-4.478 10-10zm-16.617.733a.34.34 0 0 0 .154.197.306.306 0 0 0 .25.033.365.365 0 0 0 .196-.16.272.272 0 0 0 .034-.241l-.177-.654a9.373 9.373 0 0 0 1.612-.661l.333.583c.05.075.117.127.2.15a.32.32 0 0 0 .25-.033.327.327 0 0 0 .155-.2.289.289 0 0 0-.033-.25l-.339-.589a8.82 8.82 0 0 0 1.37-1.056l.492.483a.33.33 0 0 0 .233.092c.09 0 .165-.032.22-.094a.326.326 0 0 0 .092-.221.339.339 0 0 0-.09-.234l-.483-.483a9.146 9.146 0 0 0 1.058-1.378l.59.34c.075.05.16.058.25.033a.339.339 0 0 0 .195-.158.289.289 0 0 0 .033-.25.337.337 0 0 0-.15-.2l-.59-.34c.292-.56.517-1.095.672-1.6l.653.176a.301.301 0 0 0 .242-.033.387.387 0 0 0 .162-.2.313.313 0 0 0-.034-.25.328.328 0 0 0-.2-.15l-.65-.17c.13-.573.207-1.143.234-1.71a8.414 8.414 0 0 1 3.126.725 8.456 8.456 0 0 1 2.579 1.75 8.54 8.54 0 0 1 1.755 2.577c.445.995.688 2.036.73 3.128-.579.03-1.15.107-1.717.233l-.173-.653a.336.336 0 0 0-.15-.195.294.294 0 0 0-.25-.033.384.384 0 0 0-.2.16.28.28 0 0 0-.034.24l.179.653a9.373 9.373 0 0 0-1.612.662l-.333-.584a.322.322 0 0 0-.2-.15.303.303 0 0 0-.244.034.326.326 0 0 0-.158.2.294.294 0 0 0 .03.25l.342.588c-.467.287-.927.64-1.38 1.057l-.482-.48a.333.333 0 0 0-.233-.09.304.304 0 0 0-.312.313c0 .092.03.167.09.233l.483.484a9.323 9.323 0 0 0-1.055 1.38l-.59-.342a.312.312 0 0 0-.25-.033.334.334 0 0 0-.196.16.279.279 0 0 0-.034.245.342.342 0 0 0 .15.2l.59.341a9.542 9.542 0 0 0-.673 1.6l-.653-.176a.277.277 0 0 0-.242.033.4.4 0 0 0-.163.197.323.323 0 0 0 .233.4l.65.173c-.123.567-.2 1.142-.233 1.717a8.297 8.297 0 0 1-3.127-.729 8.59 8.59 0 0 1-2.578-1.755 8.522 8.522 0 0 1-1.757-2.578 8.371 8.371 0 0 1-.73-3.128c.578-.03 1.15-.107 1.717-.234l.171.654v.001zm7.784 6.392c.09.023.173.013.25-.033a.328.328 0 0 0 .15-.2.3.3 0 0 0-.03-.25.318.318 0 0 0-.2-.15l-.61-.164c.138-.458.336-.941.6-1.45l.546.317c.084.04.167.05.25.03a.303.303 0 0 0 .195-.15.388.388 0 0 0 .034-.25.321.321 0 0 0-.15-.193l-.545-.317c.255-.417.573-.83.946-1.243l.45.45a.32.32 0 0 0 .467 0 .318.318 0 0 0 .1-.234.318.318 0 0 0-.1-.233l-.45-.45a8.466 8.466 0 0 1 1.247-.947l.313.545a.324.324 0 0 0 .195.15.377.377 0 0 0 .25-.033.33.33 0 0 0 .15-.197.35.35 0 0 0-.033-.25l-.314-.546a7.592 7.592 0 0 1 1.45-.6l.162.61a.318.318 0 0 0 .15.2.328.328 0 0 0 .25.033.357.357 0 0 0 .2-.153.299.299 0 0 0 .033-.25l-.17-.607a8.02 8.02 0 0 1 1.55-.207 8.383 8.383 0 0 1-1.196 4.02 8.446 8.446 0 0 1-2.95 2.95 8.295 8.295 0 0 1-4.02 1.187c.023-.52.093-1.033.206-1.55l.624.167v-.002zM10.84 4.875a.323.323 0 0 0-.4.233.306.306 0 0 0 .03.25.318.318 0 0 0 .2.15l.61.
393162c-.138.46-.337.943-.6 1.45l-.547-.313a.377.377 0 0 0-.25-.034.316.316 0 0 0-.196.15.377.377 0 0 0-.034.25.323.323 0 0 0 .15.195l.547.317a8.22 8.22 0 0 1-.95 1.243l-.447-.45a.315.315 0 0 0-.233-.096.318.318 0 0 0-.233.1.315.315 0 0 0-.1.233c0 .092.033.167.1.233l.45.447a8.325 8.325 0 0 1-1.247.95l-.313-.55a.332.332 0 0 0-.197-.147.35.35 0 0 0-.25.034.307.307 0 0 0-.147.195.341.341 0 0 0 .034.25l.311.546c-.45.245-.933.445-1.45.6l-.161-.608a.313.313 0 0 0-.15-.2.314.314 0 0 0-.25-.033.351.351 0 0 0-.2.15.294.294 0 0 0-.034.25l.17.61c-.5.12-1.016.191-1.54.216a8.222 8.222 0 0 1 .73-3.116 8.592 8.592 0 0 1 1.75-2.56 8.57 8.57 0 0 1 2.56-1.75 8.253 8.253 0 0 1 3.117-.73 9.403 9.403 0 0 1-.208 1.54l-.622-.167z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.478 2 2 6.478 2 12c0 5.52 4.478 10 10 10 5.52 0 10-4.48 10-10 0-5.522-4.48-10-10-10zm8.333 10c0 .117-.03.23-.033.35-1.843-.237-3.71-1.158-5.283-2.587l3.233-3.23C19.528 8 20.333 9.9 20.333 12zM17.45 5.745l-3.222 3.228C12.803 7.4 11.887 5.54 11.65 3.7c.122 0 .233-.033.35-.033 2.097 0 3.992.8 5.45 2.078zM13.4 9.8l-1.412 1.41-5.455-5.455c1.075-.942 2.372-1.633 3.827-1.923.345 2.09 1.405 4.19 3.038 5.966l.002.002zM5.743 6.55L11.2 12l-1.4 1.4c-1.775-1.633-3.875-2.697-5.967-3.04.289-1.45.977-2.742 1.912-3.817l-.002.007zm6.244 6.243l5.463 5.467c-1.072.933-2.362 1.625-3.813 1.91-.345-2.097-1.407-4.2-3.047-5.98l1.4-1.397h-.003zM3.667 12c0-.117.03-.23.033-.35 1.84.237 3.7 1.153 5.273 2.577l-3.228 3.226C4.467 15.992 3.667 14.097 3.667 12zm2.866 6.245l3.234-3.228c1.428 1.573 2.35 3.436 2.583 5.28-.117.006-.228.036-.347.036-2.1 0-4-.803-5.466-2.088h-.004zm11.712-.78L12.778 12l1.41-1.408c1.779 1.638 3.884 2.7 5.984 3.046-.294 1.454-.984 2.754-1.927 3.827z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.996 6.306c-.045-.825.555-1.515 1.335-1.56.783-.045 1.473.55 1.52 1.33.045.828-.552 1.515-1.335 1.563-.78.045-1.47-.552-1.518-1.332l-.002-.001zM3 20.45v-.051h12.376l3.223-8.955-2.67-.32-1.47-1.331-2.349 2.755 2.393 2.572c.507.504.276 1.194.276 1.194l-1.104 3.58h-1.794l1.104-3.674-3.36-2.937c-.321-.23-.504-.597-.55-1.056-.049-.459.09-.825.365-1.147l1.932-2.25s.783-.873 1.106-1.24c.504-.55 1.793-.366 2.253.324l2.07 1.927 2.255.277c.368.045.645.413.6.78-.048.368-.37.597-.738.597l-3.22 8.955h4.462c.555 0 .83-.552.83-.552s.138 1.01-.6 1.102H3v-.55zm7.04-10.884l-2.76 4.178-1.29-1.101 3.82-3.584 2.16-2.662 1.705-2.112-.645-.55.278-.276.645.55L14.734 3l.368.276-5.062 6.29zm-6.717 6.519l.505-1.744 3.267.139 1.47-1.929c.095.46.325.873.694 1.15l.552.458c-.138.18-.921 1.1-1.473 1.65-.461.507-.829.46-.829.46l-4.185-.184h-.001z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.995 5.615c-.045-.855.555-1.566 1.335-1.612.783-.046 1.473.569 1.52 1.376.044.85-.553 1.56-1.336 1.61-.78.046-1.47-.569-1.518-1.376l-.001.002zM3 20.215v-.046h12.375l3.225-9.245-2.67-.333-1.47-1.375-2.348 2.844 2.393 2.658c.507.519.276 1.23.276 1.23l-1.104 3.7H11.88l1.104-3.793-3.36-3.034c-.321-.236-.504-.618-.55-1.09-.049-.472.09-.85.366-1.183l1.934-2.323s.78-.9 1.103-1.282c.504-.568 1.793-.378 2.253.333l2.07 1.99 2.255.285c.367.047.645.427.6.807-.049.379-.371.618-.739.618l-3.22 9.242h4.463c.555 0 .829-.569.829-.569s.138 1.043-.597 1.138H3v-.572zm.322-4.504l.506-1.802 3.267.143 1.47-1.99c.095.474.324.9.693 1.184l.552.475a25.197 25.197 0 0 1-1.473 1.706c-.46.52-.828.475-.828.475l-4.185-.189-.002-.002z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.672 7.75c.03.105.086.194.086.32 0 .258 0 .787-1.1 1.25a2.514 2.514 0 0 1 1.516 2.328v.531c-1.632.445-4.547.95-9.357.95-4.672 0-7.436-.475-8.995-.908v-.573c0-1.058.631-1.958 1.518-2.33-1.1-.464-1.1-.992-1.1-1.254 0-.075.008-.178.037-.29A4.406 4.406 0 0 0 1 11.65v1.646c0 .216.022.427.05.636v.057l.005.007c.266 1.82 1.558 3.277 3.648 4.059 1.925.72 2.75.945 7.297.945 4.492 0 5.733-.388 7.233-1.03C20.974 17.235 23 15.567 23 13.294v-1.646a4.394 4.394 0 0 0-2.328-3.898zm-2.136 8.49c-1.115.476-2.081.888-6.536.888-4.44 0-5.049-.226-6.673-.834-.545-.202-1.298-.588-1.834-1.219 1.606.434 4.199.825 8.324.825 4.07 0 6.691-.339 8.354-.715a5.902 5.902 0 0 1-1.635 1.054z"/><path d="M12 9c4.049 0 7.333-.454 7.333-1.016 0-.199-.428-.382-1.14-.538h.021s-.558-.882-1.144-1.868c-.59-.986-2.013-1.543-3.273-1.57-1.254-.023-4.252.008-5.191.081-.937.072-1.628.155-1.628.784 0 .628.72.746 1.645.774.93.027 2.286.008 4.115-.066 1.83-.073 2.343.111 2.622.536.212.318.28.658.296.996A43.08 43.08 0 0 0 12 6.966c-4.049 0-7.333.457-7.333 1.017C4.667 8.546 7.95 9 12 9z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
393<path d="M19.05 3.45L18.3 3c-.15 0-.3 0-.45.15L12.6 12.3 11.1 15 9 18.75c-.45.6-1.2.75-1.8.45-.6-.45-.75-1.2-.45-1.8.15-.45.15-.9-.3-1.2-.3-.15-.75-.15-1.05.3-.9 1.35-.45 3 .9 3.9.45.3 1.05.45 1.65.45.9 0 1.65-.45 2.25-1.2l1.5-2.7 1.5-2.55 6-10.35c0-.3 0-.45-.15-.6zM18.6 16.5c-.15-.3-.75-.45-1.05-.3-.3.15-.45.75-.3 1.05.45.6.15 1.35-.45 1.8-.6.45-1.35.15-1.8-.45l-1.65-3-.9 1.5 1.35 2.4c.45.75 1.35 1.2 2.25 1.35.6 0 1.2-.15 1.65-.45 1.2-.9 1.65-2.7.9-3.9z"/><path d="M11.55 12.6l-5.4-9.45C6 3 5.85 3 5.7 3l-.75.45c-.15.15-.15.3-.15.45l5.85 10.05.9-1.35z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.926 19.83c-.039-.684.483-1.29 1.17-1.37a1.26 1.26 0 0 1 1.327 1.17c.038.724-.486 1.328-1.17 1.369-.684.037-1.29-.486-1.329-1.17l.002.001zm14.94-10.428L8.391 3.363 8.589 3l11.152 5.919.12.483h.005zm-5.559-.927a8.637 8.637 0 0 1-.285.645c.322.24.726.483 1.05.684-1.53 1.77-3.225 3.865-4.47 5.557-1.128 1.692-2.055 2.86-2.136 2.981l-.039.04-.081.08c-.04.04-.081.04-.12.081h-.04c-.043 0-.083.042-.123.042h-.2c-.081 0-.12-.04-.201-.04h-.04a.301.301 0 0 1-.202-.08h-.04c-.162-.12-.24-.28-.282-.483 0-.039-.564-3.06-2.415-5.396-.285-.36-.243-.844.12-1.125.36-.284.846-.242 1.125.12 1.17 1.49 1.854 3.14 2.257 4.348.24-.322.522-.684.803-1.087 1.29-1.934 2.94-4.67 3.906-7.29L9.309 5.258l.201-.322 3.51 2.252.24-.726c.363.162 1.209.564 1.491.726-.081.321-.16.603-.282.926l5.718 3.701.039.485-5.916-3.825h-.003zm.2 10.35c.36.24.482.723.282 1.086a.79.79 0 0 1-.684.36.796.796 0 0 1-.443-.12c-.042-.039-2.014-1.245-4.914-1.488l.081-.081c.081-.081.483-.564 1.047-1.37 2.738.445 4.55 1.571 4.63 1.611v.002z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3c-3.863 0-7 3.233-7 7.212 0 2.13.906 4.04 2.337 5.363a.36.36 0 0 0-.291.173.389.389 0 0 0-.03.347c1.696 3.029 2.623 4.371 2.81 4.89.603.023 3.616.013 4.35 0 .188-.52 1.114-1.861 2.784-4.843a.381.381 0 0 0 .015-.372.357.357 0 0 0-.303-.204A7.281 7.281 0 0 0 19 10.212C18.999 6.233 15.862 3 12 3zm.63 13.265c-.209.015-.42.035-.63.035-.212 0-.422-.018-.631-.035l-.186-.025a.37.37 0 0 0 .104-.26.36.36 0 0 0-.358-.363.359.359 0 0 0-.354.364c0 .055.01.103.03.15a5.825 5.825 0 0 1-2.598-1.435.348.348 0 0 0 .215-.325.349.349 0 0 0-.343-.353.344.344 0 0 0-.316.212 6.107 6.107 0 0 1-.65-.924c.161-.03.278-.18.279-.348a.349.349 0 0 0-.343-.352.34.34 0 0 0-.238.098 6.219 6.219 0 0 1 .056-5.098.36.36 0 0 0 .182.055.35.35 0 0 0 .343-.352.359.359 0 0 0-.194-.322c.185-.303.397-.588.63-.854a.346.346 0 0 0 .252.115.35.35 0 0 0 .343-.352.36.36 0 0 0-.11-.257 5.823 5.823 0 0 1 2.57-1.353.36.36 0 0 0-.055.194c0 .195.154.353.343.353.19 0 .343-.158.343-.353a.357.357 0 0 0-.142-.285c.271-.04.549-.067.83-.067.282 0 .558.027.83.066a.359.359 0 0 0-.143.286.35.35 0 0 0 .343.353.35.35 0 0 0 .343-.353.344.344 0 0 0-.06-.196c.972.227 1.85.7 2.574 1.353a.35.35 0 0 0-.108.254c0 .195.155.353.343.353.095 0 .188-.04.253-.114.233.265.444.552.63.855a.354.354 0 0 0-.195.32c0 .194.154.351.343.351.063 0 .124-.02.179-.053a6.238 6.238 0 0 1 .058 5.098.346.346 0 0 0-.238-.098.348.348 0 0 0-.343.352c0 .169.116.314.279.348-.19.33-.406.637-.652.924a.346.346 0 0 0-.313-.212c-.19 0-.342.16-.342.353 0 .144.083.272.211.326a5.837 5.837 0 0 1-2.595 1.437.406.406 0 0 0 .03-.148.36.36 0 0 0-.355-.363.361.361 0 0 0-.358.364c0 .103.039.196.104.26-.067.005-.128.013-.19.02zM9.812 5.252a.371.371 0 0 0-.365.376c0 .207.164.375.365.375a.371.371 0 0 0 .365-.375.371.371 0 0 0-.365-.376zm1.822.376a.37.37 0 0 0 .365.374.37.37 0 0 0 .364-.376.37.37 0 0 0-.364-.374.371.371 0 0 0-.365.376zm2.553-.376a.37.37 0 0 0-.365.376c0 .207.164.375.365.375a.371.371 0 0 0 .365-.375.371.371 0 0 0-.365-.376zM8.353 7.126c0 .209.164.377.365.377a.371.371 0 0 0 .365-.375.37.37 0 0 0-.365-.374.366.366 0 0 0-.365.372zm2.187 0c0 .209.164.377.367.377a.371.371 0 0 0 .365-.375.37.37 0 0 0-.364-.374.367.367 0 0 0-.368.372zm2.186 0c0 .209.164.377.366.377a.37.37 0 0 0 .365-.375.37.37 0 0 0-.365-.374.366.366 0 0 0-.366.372zm2.191 0c0 .209.164.377.364.377.2 0 .366-.168.366-.375a.37.37 0 0 0-.365-.374.365.365 0 0 0-.365.372zm-7.656 1.5c0 .207.16.376.363.376a.37.37 0 0 0 .365-.376.371.371 0 0 0-.366-.375.372.372 0 0 0-.362.375zm2.187 0c0 .207.164.376.365.376a.371.371 0 0 0 .365-.376.371.371 0 0 0-.365-.375.373.373 0 0 0-.365.375zm2.188 0c0 .207.164.376.365.376a.37.37 0 0 0 .363-.376.37.37 0 0 0-.363-.375.373.373 0 0 0-.365.375zm2.187 0c0 .207.164.376.365.376a.371.371 0 0 0 .365-.376.371.371 0 0 0-.365-.375.372.372 0 0 0-.365.375zm2.19 0a.37.37 0 0 0 .363.376.37.37 0 0 0 .363-.376.37.37 0 0 0-.363-.375.372.372 0 0 0-.364.375zm-9.846 1.5a.37.37 0 0 0 .365.374.371.371 0 0 0 .365-.375.37.37 0 0 0-.365-.377.376.376 0 0 0-.365.378zm2.187 0a.37.37 0 0 0 .365.374.371.371 0 0 0 .366-.375.37.37 0 0 0-.366-.377.376.376 0 0 0-.365.378zm2.188 0a.37.37 0 0 0 .366.374.371.371 0 0 0 .366-.375.37.37 0 0 0-.364-.377.376.376 0 0 0-.368.378zm2.186 0a.37.37 0 0 0 .365.374.37.37 0 0 0 .365-.375.37.37 0 0 0-.365-.377.376.376 0 0 0-.365.378zm2.19 0a.37.37 0 0 0 .364.374c.2 0 .367-.168.367-.375
393a.37.37 0 0 0-.365-.377.375.375 0 0 0-.366.378zm2.188 0a.37.37 0 0 0 .365.374.37.37 0 0 0 .364-.375.37.37 0 0 0-.364-.377.375.375 0 0 0-.365.378zm-9.844 1.499c0 .207.161.375.364.375a.37.37 0 0 0 .365-.375.371.371 0 0 0-.367-.375.37.37 0 0 0-.362.375zm2.553-.375a.371.371 0 0 0-.365.375c0 .207.164.375.365.375a.371.371 0 0 0 .365-.375.371.371 0 0 0-.365-.375zm2.187 0a.371.371 0 0 0-.365.375c0 .207.164.375.365.375a.37.37 0 0 0 .364-.375.37.37 0 0 0-.364-.375zm2.188 0a.37.37 0 0 0-.365.375c0 .207.164.375.365.375a.371.371 0 0 0 .365-.375.371.371 0 0 0-.365-.375zm2.187 0a.37.37 0 0 0-.363.375.37.37 0 0 0 .363.375.37.37 0 0 0 .364-.375.37.37 0 0 0-.364-.375zm-8.021 1.875a.37.37 0 0 0 .365.374.37.37 0 0 0 .364-.375.37.37 0 0 0-.364-.374.371.371 0 0 0-.365.375zm2.187 0a.37.37 0 0 0 .367.374.37.37 0 0 0 .365-.374.37.37 0 0 0-.364-.375.372.372 0 0 0-.368.375zm2.186 0a.37.37 0 0 0 .366.374.37.37 0 0 0 .365-.374.37.37 0 0 0-.365-.375.371.371 0 0 0-.366.375zm2.191 0a.37.37 0 0 0 .364.374c.2 0 .366-.169.366-.374a.37.37 0 0 0-.365-.375.37.37 0 0 0-.365.375zM9.816 14.25a.37.37 0 0 0-.365.374.37.37 0 0 0 .365.373.37.37 0 0 0 .365-.373.37.37 0 0 0-.365-.374zM12 14.247a.37.37 0 0 0-.365.374.37.37 0 0 0 .365.373.37.37 0 0 0 .364-.373.37.37 0 0 0-.364-.374zm2.188 0a.37.37 0 0 0-.365.374.37.37 0 0 0 .365.373.37.37 0 0 0 .365-.373.37.37 0 0 0-.365-.374zm-.945 5.8h-2.489c-.213-.321-1.56-2.46-1.98-3.165.62.233 1.498.506 2.563.593.22.025.44.04.663.04.224 0 .444-.015.66-.04a9.47 9.47 0 0 0 2.563-.597c-.415.709-1.98 3.165-1.98 3.168z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.978 7.384c0 .766-.635 1.385-1.42 1.385-.785 0-1.422-.619-1.422-1.385 0-.764.637-1.384 1.421-1.384s1.421.62 1.421 1.384zm-2.715 7.502a2.244 2.244 0 0 0-.094 1.125c.041.226-.151.425-.385.424l-7.739-.058c-.58-.004-1.05-.466-1.045-1.031a1.041 1.041 0 0 1 1.052-1.019h.007l7.845.058c.264 0 .44.252.357.498l.002.003zm3.521-5.006l-.01-.02c-.276-.51-.026-1.14.514-1.375 1.503-.652 3.958-1.724 3.958-1.724.531-.233 1.156 0 1.392.513a1.015 1.015 0 0 1-.527 1.356l-3.957 1.737c-.514.225-1.109 0-1.37-.487zm8.074 4.23c.57-.036 1.09.37 1.138.934a1.03 1.03 0 0 1-.956 1.11s-9.592.8-10.168.843c-.38.03-.637-.207-.78-.38-.737-1.045-.09-1.996.259-2.393.172-.143.362-.352.474-.659.204-.554.097-1.3-.302-2.17l-6.69-1.63a1.024 1.024 0 0 1-.764-1.246c.14-.547.715-.88 1.276-.744 0 0 4.773 1.166 5.561 1.356a3.8 3.8 0 0 0 1.335.067c.275-.014.723.163 1.392 1.822 0 .005.003.01.005.013l-.002.003c.46 1.208.522 2.31.15 3.269a3.63 3.63 0 0 1-.233.495l8.308-.69h-.003z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.018 13.999l5.101-9.16a.338.338 0 0 0-.12-.461l-.552-.333a.322.322 0 0 0-.445.124l-4.542 8.155.008.006-1.286 2.306-.007-.002-1.852 3.325H4.505c-.362 0-.79.25-.964.58l-.47.88c-.172.32-.019.58.33.58h5.932c.296 0 .547-.211.617-.498l1.78-3.194L13.018 14V14zm.098 1.153l1.564 2.81h4.816c.36 0 .788.25.964.58l.47.88c.17.32.018.578-.332.578h-5.931a.647.647 0 0 1-.62-.497l-1.677-3.014.746-1.335v-.002zm-1.482-2.657L7 4.17a.32.32 0 0 0-.444-.123l-.553.334a.336.336 0 0 0-.12.458l5.009 8.992.742-1.337v.001z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.825 7.659c0 .786-.63 1.421-1.407 1.421a1.412 1.412 0 0 1-1.405-1.421c0-.782.63-1.417 1.405-1.417.777 0 1.407.635 1.407 1.418V7.66zm-.14 2.44a.66.66 0 0 1 .221.9c-.24.403-.555.926-.759 1.256-.45.726-.975.86-1.347.847-.56-.023-1.03-.393-1.395-1.104-.13-.257-.244-.469-.348-.661-.204-.375-.38-.7-.57-1.15-.057-.136-.082-.23-.082-.23s-2.88.734-2.963.766c1.223.53 1.695.726 1.947.81.51.169.87.463 1.073.876.225.46.222 1.002-.008 1.656-.189.542-.627 3.09-.855 4.538l-1.863-.056c.102-.654.67-4.243.97-5.105.023-.06.037-.113.046-.154-.453-.163-1.976-.817-3.056-1.285.015.73-.005 1.482-.072 1.9-.135.846-.45 1.448-1.665 2.029-.59.281-2.37 1.698-3.4 2.565l-1.41-1.24c.475-.401 3.044-2.55 4.016-3.015.573-.272.585-.343.63-.638.07-.438.07-1.76 0-2.616-.13-1.573.58-2.272 1.44-2.56.222-.072 2.28-.747 3.205-1.073-.563-.68-.951-1.13-1.038-1.245-.11-.148-.2-.257-.348-.333-.356-.181-1.523-.907-1.756-1.048a.938.938 0 0 1-.3-1.285.925.925 0 0 1 1.275-.306c.508.315 1.391.856 1.61.968.552.277.855.685 1 .88.112.146 1.268 1.55 2.045 2.49l.03.01c.758.394.99 1.171 1.145 1.685.03.106.06.204.093.285.154.367.303.64.49.989.057.106.12.219.183.342l.42-.696a.71.71 0 0 1 .981-.242l.42.252-.004-.003zM16.402 19.65h-.438a.5.5 0 1 1-.995 0h-.438a.5.5 0 1 1-.995 0h-.438a.5.5 0 1 1-.978-.088.563.563 0 0 1 .555-.474H16.8c.227 0 .423.134.512.328a.5.5 0 1 1-.91.234zM6.608 20.047l-.33-.287a.5.5 0 1 1-.751-.653l-.332-.288a.5.5 0 1 1-.751-.653l-.33-.287a.5.5 0 1 1-.68-.708.563.563 0 0 1 .73.006l3.113 2.706c.172.15.23.38.17.585a.5.5 0 1 1-.84-.42"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
393<path d="M14.876 10.69c.016.013.04.013.107-.02a.504.504 0 0 0 .15-.118c.29-.279.654-.514 1.06-.694.078-.034.153-.065.228-.092l-.667-.57-1.087 1.314.21.18zm3.053-1.604l-1.224-1.043-.478.575 1.027.878c.24-.103.467-.241.675-.41zm.908-1.194l-1.18-1.005-.475.577 1.267 1.081c.16-.208.289-.428.388-.653zm.22-.796c.066-.555-.048-1.09-.342-1.49l-.582.704.924.786zm-2.415-2.053l.923.785.58-.701c-.44-.225-.972-.248-1.503-.084zm-1.297.86l1.266 1.08.476-.577-1.177-1.002c-.199.136-.39.304-.565.499zm-.718 1.354l1.034.88.476-.577-1.223-1.042c-.134.24-.23.491-.287.74zm-.163 1.132c-.106.44-.273.847-.517 1.215a.46.46 0 0 0-.06.136c-.021.074-.016.097 0 .108l.21.182 1.084-1.314-.667-.569c-.012.077-.03.158-.05.242zm-1.316 4.237l-.686-.831.95-1.152-.109-.092c-.32-.275-.419-.687-.307-1.093.046-.162.118-.309.187-.406.173-.262.303-.57.381-.912.054-.227.08-.43.083-.615a3.953 3.953 0 0 1 .901-2.144c1.214-1.47 3.22-1.84 4.494-.753 1.275 1.086 1.264 3.156.048 4.627a3.822 3.822 0 0 1-1.987 1.287c-.116.023-.31.085-.52.176-.31.138-.59.318-.778.5a1.365 1.365 0 0 1-.387.293c-.378.19-.8.163-1.126-.115l-.073-.063-1.07 1.293zm-3.336-1.323l-.106.092c-.324.275-.74.298-1.115.116a1.258 1.258 0 0 1-.36-.257 2.817 2.817 0 0 0-.819-.538 2.713 2.713 0 0 0-.581-.19c-.727-.197-1.408-.647-1.924-1.272-1.213-1.47-1.223-3.54.053-4.626 1.272-1.086 3.276-.718 4.494.753.522.634.836 1.39.901 2.212 0 .122.027.325.08.549.08.338.207.647.35.866.094.126.169.274.217.44.117.41.018.827-.307 1.103l-.075.064 1.243 1.506 1.307 1.586 5.339 6.46c.117.142.1.353-.043.475l-.296.253a.327.327 0 0 1-.467-.04l-5.4-6.534c-.003-.008-.442-.54-1.316-1.597-.005-.01-.397-.483-1.175-1.421zm-4.288 8.89a.342.342 0 0 0 .043.475l.296.252c.143.121.35.102.467-.041l5.264-6.37-.687-.833-5.383 6.518zm4.587-10.348c.017-.013.023-.037 0-.112a.525.525 0 0 0-.087-.17 3.723 3.723 0 0 1-.49-1.178 5.016 5.016 0 0 1-.051-.243l-.667.568L9.9 10.027l.212-.182zm-1.024-3.33L7.86 7.558l.478.578 1.029-.88a3.028 3.028 0 0 0-.28-.741zm-1-1.118L6.908 6.404l.476.577 1.267-1.084a3.063 3.063 0 0 0-.564-.5zm-2.235-.273l.582.704.92-.788c-.527-.163-1.063-.141-1.502.084zm-.91 1.975l.922-.789-.582-.704c-.292.4-.408.935-.34 1.493zm.608 1.446l1.266-1.08-.474-.578-1.18 1.005c.1.225.228.445.388.653zm1.186.954l1.034-.88-.476-.578L6.07 9.084c.21.172.436.312.665.415zm1.07.359c.41.18.773.42 1.089.727a.484.484 0 0 0 .12.084c.07.034.093.032.107.02l.21-.18-1.085-1.314-.667.57c.074.028.148.059.226.093z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.751 4.996c-.135-.486-.315-.855-.57-1.12-.315-.327-.787-.534-1.431-.681C18.18 3.063 17.52 3 16.764 3a14.782 14.782 0 0 0-3.836.525c-.715.189-1.41.426-2.082.71-.682.289-1.37.658-2.058 1.108-.696.454-1.335.968-1.905 1.54-.72.72-1.35 1.53-1.884 2.43-.53.892-.937 1.77-1.218 2.635a16.56 16.56 0 0 0-.615 2.53 11.766 11.766 0 0 0-.157 2.344c.03.702.114 1.32.249 1.849.15.603.369 1.065.69 1.386.339.34.84.57 1.504.726.6.147 1.287.217 2.061.217.741 0 1.503-.069 2.29-.205a16.32 16.32 0 0 0 2.44-.63 12.872 12.872 0 0 0 2.568-1.21 12.46 12.46 0 0 0 2.33-1.827 11.91 11.91 0 0 0 1.659-2.085c.48-.76.86-1.52 1.15-2.275.28-.735.51-1.485.683-2.242.177-.765.288-1.485.333-2.167.04-.665.045-1.281.015-1.845-.033-.585-.105-1.092-.23-1.522v.004zM4.716 18.392a7.555 7.555 0 0 1-.206-1.55c-.027-.604.02-1.286.141-2.051.123-.774.312-1.55.564-2.328.246-.757.608-1.54 1.088-2.345a10.895 10.895 0 0 1 1.665-2.15c.5-.5 1.057-.952 1.67-1.35a11.577 11.577 0 0 1 1.837-.989c.612-.26 1.245-.475 1.902-.65a13.56 13.56 0 0 1 1.83-.371c.57-.075 1.116-.11 1.647-.11.652 0 1.203.053 1.65.155a4.6 4.6 0 0 1 .279.072l-5.28 5.279-1.314-1.312a.375.375 0 0 0-.525.006.374.374 0 0 0-.006.524l1.312 1.311-.967.97-1.314-1.312a.375.375 0 0 0-.525.006.374.374 0 0 0-.006.525l1.312 1.311-.967.97-1.314-1.312a.375.375 0 0 0-.525.006.374.374 0 0 0-.006.525l1.312 1.31-5.164 5.164a3.672 3.672 0 0 1-.09-.307v.003zM19.47 8.198a11.587 11.587 0 0 1-.3 1.935c-.159.7-.369 1.39-.63 2.07-.25.664-.591 1.334-1.02 2.018a10.468 10.468 0 0 1-1.461 1.834c-.615.615-1.3 1.155-2.055 1.61-.765.464-1.527.824-2.286 1.08-.78.263-1.526.457-2.235.578-.71.123-1.392.185-2.05.185-.665 0-1.235-.06-1.71-.173a4.349 4.349 0 0 1-.377-.11l5.155-5.157 1.24 1.24c.14.14.379.141.526-.006a.374.374 0 0 0 .006-.524l-1.24-1.24.971-.97 1.24 1.24c.142.14.379.142.526-.005a.373.373 0 0 0 .007-.525l-1.245-1.239.972-.969 1.24 1.24c.14.14.377.141.524-.006a.376.376 0 0 0 .01-.524l-1.246-1.24 5.269-5.263.015.045c.09.31.15.709.172 1.195.026.51.021 1.072-.015 1.687l-.003-.006z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
393<path d="M16.701 13.809c-.675.59-4.355 3.03-5.093 3.116-.195.02-.342 0-.405-.072-.075-.082-.045-.226-.045-.226.012-.054-.022-.094-.048-.135 1.625-1.027 2.094-1.869 2.715-3.19.105-.217.215-.453.345-.714.008-.018.021-.034.03-.052.735-.117 1.233.12 1.461.284.243.175.375.046.474-.037.033-.03.267-.21.558-.435.02.027.024.06.054.075.245.108.388.265.418.465.045.282-.131.626-.465.921h.001zm-6.833 4.32c-.173.184-.907.657-1.747 1.128-.304.17-.55.234-.696.19-.09-.03-.157-.097-.222-.228-.087-.175-.024-.432.008-.517.015-.036-.005-.07-.015-.108.66-.185 1.465-.654 2.779-1.422l.048.082-.012.03.04.015.02.033.015-.009c.054.036.07.078.078.111.045.201-.147.537-.294.695h-.001zm-3.997-1.935c0-.375.07-.66.174-.897.75-.375 3.48-1.89 4.089-4.215.765-2.94-.969-4.584-1.044-4.653-.146-.135-.318-.53-.018-.938.276-.243.77-.61 1.38-.694.915-.12 1.5-.231 1.746-.39 0 0 .18.651.528 1.042.522.783 1.782 1.065 2.37 1.848.588.785.567 1.568.567 1.568s-1.848 1.365-2.718 3.105c-.87 1.74-.915 2.415-2.94 3.59-2.022 1.174-3.045 1.826-3.522 1.74 0 0-.61-.262-.61-1.11l-.002.004zm2.055-3.084c-.115.105-.237.195-.356.294.098-.15.18-.3.26-.465l.099.171h-.003zM6.465 5.904s0-.369.76-.413c.428-.022.743-.057 1.016-.024-.183.521-.042 1.031.202 1.355l-.608.577c-.06-.078-.101-.154-.173-.232-.891-.957-1.195-1.26-1.195-1.26l-.002-.003zm2.08 2.79a3.473 3.473 0 0 0-.307-.726l1.023.282-.715.442v.002zm.116.532c-.006-.052-.004-.09-.015-.154l.801-.495c.075.294.113.64.12 1.012l-.906-.36v-.003zm-.099.99c.048-.232.086-.438.105-.585l.75.3-.855.286zm-.112.54l.025-.114 1.044-.35c-.027.197-.048.39-.105.605-.045.176-.13.338-.205.504l-.758-.645h-.002zm.315 1.415a6.193 6.193 0 0 1-.56.66l-.188-.335c.01-.03.028-.056.037-.087.007-.03.014-.067.025-.099l.684-.139h.002zm-.586-.262c.06-.24.12-.493.18-.743l.665.57-.844.172zm.517-4.81c.114.131.297.38.474.74l-.97-.27.496-.47zm12.255 4.915a2.192 2.192 0 0 1-.275-.31.402.402 0 0 0-.27-.16c-.142-.015-.318.045-.5.186-.247.189-1.307.555-1.56.352-.266-.213-.09-.708-.086-.712.024-.067-.01-.135-.057-.184.045-.075.015-.185-.18-.465-.218-.31-.72-1.271-.99-1.791 0-.011.007-.02.007-.03.006-.21-.007-1.318-.84-2.428-.453-.604-1.08-.972-1.585-1.267-.275-.162-.651-.384-.741-.519a1.32 1.32 0 0 0-.116-.15c-.067-.075-.18-.324-.232-.498-.117-.42-.387-.786-.795-.942-.411-.153-.83-.128-1.2.111-.08.033-.353.108-1.257.228-.675.09-1.254.39-1.68.685-.411-.075-.8-.045-1.15-.02l-.296.019c-1.626.093-2.055 1.209-2.055 1.785 0 .365.144.714.4.97.015.015.318.323 1.163 1.23.627.676.65 1.306.654 1.306-.021.265-.294 1.54-.585 2.655-.132.504-.65 1.134-1.08 1.507-.768.675-1.14 1.53-1.14 2.62 0 1.387.906 2.146 1.44 2.374.045.018.09.025.135.04-.01.037-.027.075-.012.114.319.855-.17 1.305-.191 1.32a.192.192 0 0 0-.063.17c.01.064.051.12.11.143l1.429.63a.192.192 0 0 0 .177-.015.177.177 0 0 0 .075-.102 1.88 1.88 0 0 1 .18-.115l.09-.054c.023-.015.098-.051.219-.11.638-.302 2.577-1.227 5.757-3.12 3-1.789 5.37-3.515 6.378-4.255.288-.21.48-.348.555-.393.19-.12.3-.258.318-.42a.48.48 0 0 0-.153-.39l.002.005z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.528 5c.473 0 1.09.279 1.835.705l2.9 1.64 1.51 5.86 1.776.76c.968.416.753 1.85-.772 1.19l-2.157-.939a.95.95 0 0 1-.534-.612l-.636-2.412-3.39-1.973.387 1.554a.967.967 0 0 1-.386.995l-3.403 1.963 8.79 5.098c.56.322.826.304 1.067.206.24-.097.517-.308.739-.59a.447.447 0 0 1 .415-.173c.262.03.385.244.385.442 0 .136-.04.268-.15.375-.216.22-.532.59-1.035.793-.208.085-.46.118-.71.118-.366-.007-.755-.105-1.186-.351L3.238 11.677A.426.426 0 0 1 3 11.27c0-.204.127-.405.298-.44.168-.033.306-.032.414.03l3.197 1.846 3.525-2.138L9.78 7.9c-.108-.437-.148-.522-.148-1.023C9.633 5.469 10.58 5 11.528 5zm7.577 5.627a1.885 1.885 0 0 1-1.892-1.876c0-1.038.847-1.875 1.892-1.875 1.046 0 1.895.837 1.895 1.875a1.887 1.887 0 0 1-1.895 1.876z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16.582 5.961c-.799 0-1.455-.66-1.455-1.455 0-.848.656-1.506 1.455-1.506s1.456.705 1.456 1.505c0 .798-.657 1.455-1.456 1.455v.001zm-7.38 6.015L6.81 16.725l-2.445.705 4.137-8.32c.141-.236.282-.423.516-.564l3.855-2.538c.705-.423 1.598-.234 2.02.47.423.706.236 1.643-.469 2.066l-5.22 3.432h-.002zm10.2-1.316L3.33 21 3 20.483l16.073-10.34c1.035-.75.799-1.551.799-1.551.423.705.236 1.646-.47 2.07v-.002z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
393<path d="M13.954 16.55c-.71.076-1.22.667-1.143 1.373a1.5 1.5 0 0 0 .432.865c.238.197.513.277.788.277h.12c.71-.08 1.22-.67 1.143-1.377-.039-.668-.67-1.179-1.34-1.139zm4.1-4.48c.158.12.355.158.552.12L19 12.07 7.488 3.041 7.448 3l-.71.235 11.315 8.835zm-2.484-1.098l-.04.04c-.038.038-.077.116-.117.156-.119.157-.236.277-.355.431l-.12.159c-.63.824-1.457 1.769-1.97 2.316l-.04.077c-.037.042-.077.08-.116.12l-.395.434 1.42.47s.078-.118.117-.118l.04-.077c.553-.589 1.301-1.649 1.893-2.553.236-.354.236-.354.513-.823l-.828-.63-.002-.002zM9.777 7.28l.193-.508 1.42 1.061-.08.194c-.315.668-.945 1.73-1.18 2.163-.119.154-.24.35-.316.508l-.037.04-1.46.118.04-.118c.04-.04.04-.079.078-.159.115-.275.236-.629.393-1.023.158-.469.63-1.569.949-2.276zm3.27 1.806l.002-.002 1.42 1.061-.278.236-.827.826c-.277.274-.55.55-.828.861-.117.157-.276.314-.395.471l-.355.472a.989.989 0 0 1-.71.314h-.038s-1.263-.118-1.853-.157c0 .037 1.024 1.768 2.64 2.16.433.08.748.434.788.865a.993.993 0 0 1-.829 1.061c-.039.038-.077.077-.154.077-.356.077-.79.237-1.183.43-.396.2-.75.396-1.066.631a2.234 2.234 0 0 0-.313.236l-.158.115-.234.2c-.08.04-.16.118-.201.158l-.077.077c-.116.119-.237.197-.317.314l-.315.354c-.198.197-.474.59-.672.905a.67.67 0 0 1-.787.193.622.622 0 0 1-.238-.824c.198-.354.474-.786.71-1.1l.355-.43c.12-.116.237-.275.356-.393l.038-.037.238-.237.117-.115.12-.119c.038-.04.117-.078.157-.117.119-.117.276-.196.394-.316.315-.237.63-.471.985-.668-.552-.272-1.066-.59-1.498-.98a6.064 6.064 0 0 1-1.262-1.454c-.315-.549-.553-1.178-.63-1.806-.04-.235.039-.43.158-.63a.872.872 0 0 1 .553-.314h.154c.355 0 3.667.158 3.667.158.04-.038.08-.117.12-.157.157-.157.274-.313.432-.472.316-.354.59-.666.868-.943.355-.354.946-.904.946-.904z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.733 20.177l.47-.467a.34.34 0 0 0 .042-.43l-1.358-2.037a.35.35 0 0 0-.164-.13l-2.716-1.016a.34.34 0 0 0-.4.128l-.489.733a8.434 8.434 0 0 1-1.593-4.545l.82.547a.338.338 0 0 0 .468-.093l1.359-2.039a.346.346 0 0 0 .056-.188V7.923a.344.344 0 0 0-.11-.25.328.328 0 0 0-.258-.086l-1.167.105a8.514 8.514 0 0 1 4.714-3.774l-.44 1.174a.322.322 0 0 0 .016.276c.047.085.124.15.217.172l2.717.678a.336.336 0 0 0 .166 0L14.8 5.54a.344.344 0 0 0 .217-.172.347.347 0 0 0 .016-.276l-.44-1.172a8.55 8.55 0 0 1 4.717 3.775l-1.167-.105a.342.342 0 0 0-.373.338v2.717c0 .067.02.133.057.187l1.358 2.036c.067.097.173.15.283.15.064 0 .129-.02.187-.056l.817-.547a8.406 8.406 0 0 1-1.594 4.543l-.488-.733a.342.342 0 0 0-.4-.128l-2.717 1.016a.384.384 0 0 0-.166.134l-1.355 2.033a.342.342 0 0 0 .041.43l.467.467a8.33 8.33 0 0 1-2.263.313c-.784 0-1.544-.11-2.267-.312l.003-.001zm10.034-1.89A9.948 9.948 0 0 0 22 12a9.965 9.965 0 0 0-1.012-4.377l-.005-.01C19.353 4.293 15.94 2 12 2 8.06 2 4.642 4.295 3.017 7.617c0 .003-.005.006-.007.01A9.916 9.916 0 0 0 2 12c0 2.357.822 4.527 2.192 6.237.01.02.025.033.038.05a10.038 10.038 0 0 0 4.447 3.143c.013.007.028.01.041.013a9.924 9.924 0 0 0 6.56 0 10.048 10.048 0 0 0 4.492-3.157h-.003zM14.2 14.353l1.11-2.963a.373.373 0 0 0-.125-.427l-2.962-2.221a.368.368 0 0 0-.445 0l-2.965 2.221a.369.369 0 0 0-.125.427L9.8 14.353c.055.144.193.24.347.24h3.703a.376.376 0 0 0 .35-.24z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 12c0-5.522-4.478-10-10-10S2 6.478 2 12s4.478 10 10 10 10-4.478 10-10zm-16.617.733a.34.34 0 0 0 .154.197.306.306 0 0 0 .25.033.365.365 0 0 0 .196-.16.272.272 0 0 0 .034-.241l-.177-.654a9.373 9.373 0 0 0 1.612-.661l.333.583c.05.075.117.127.2.15a.32.32 0 0 0 .25-.033.327.327 0 0 0 .155-.2.289.289 0 0 0-.033-.25l-.339-.589a8.82 8.82 0 0 0 1.37-1.056l.492.483a.33.33 0 0 0 .233.092c.09 0 .165-.032.22-.094a.326.326 0 0 0 .092-.221.339.339 0 0 0-.09-.234l-.483-.483a9.146 9.146 0 0 0 1.058-1.378l.59.34c.075.05.16.058.25.033a.339.339 0 0 0 .195-.158.289.289 0 0 0 .033-.25.337.337 0 0 0-.15-.2l-.59-.34c.292-.56.517-1.095.672-1.6l.653.176a.301.301 0 0 0 .242-.033.387.387 0 0 0 .162-.2.313.313 0 0 0-.034-.25.328.328 0 0 0-.2-.15l-.65-.17c.13-.573.207-1.143.234-1.71a8.414 8.414 0 0 1 3.126.725 8.456 8.456 0 0 1 2.579 1.75 8.54 8.54 0 0 1 1.755 2.577c.445.995.688 2.036.73 3.128-.579.03-1.15.107-1.717.233l-.173-.653a.336.336 0 0 0-.15-.195.294.294 0 0 0-.25-.033.384.384 0 0 0-.2.16.28.28 0 0 0-.034.24l.179.653a9.373 9.373 0 0 0-1.612.662l-.333-.584a.322.322 0 0 0-.2-.15.303.303 0 0 0-.244.034.326.326 0 0 0-.158.2.294.294 0 0 0 .03.25l.342.588c-.467.287-.927.64-1.38 1.057l-.482-.48a.333.333 0 0 0-.233-.09.304.304 0 0 0-.312.313c0 .092.03.167.09.233l.483.484a9.323 9.323 0 0 0-1.055 1.38l-.59-.342a.312.312 0 0 0-.25-.033.334.334 0 0 0-.196.16.279.279 0 0 0-.034.245.342.342 0 0 0 .15.2l.59.341a9.542 9.542 0 0 0-.673 1.6l-.653-.176a.277.277 0 0 0-.242.033.4.4 0 0 0-.163.197.323.323 0 0 0 .233.4l.65.173c-.123.567-.2 1.142-.233 1.717a8.297 8.297 0 0 1-3.127-.729 8.59 8.59 0 0 1-2.578-1.755 8.522 8.522 0 0 1-1.757-2.578 8.371 8.371 0 0 1-.73-3.128c.578-.03 1.15-.107 1.717-.234l.171.654v.001zm7.784 6.392c.09.023.173.013.25-.033a.328.328 0 0 0 .15-.2.3.3 0 0 0-.03-.25.318.318 0 0 0-.2-.15l-.61-.164c.138-.458.336-.941.6-1.45l.546.317c.084.04.167.05.25.03a.303.303 0 0 0 .195-.15.388.388 0 0 0 .034-.25.321.321 0 0 0-.15-.193l-.545-.317c.255-.417.573-.83.946-1.243l.45.45a.32.32 0 0 0 .467 0 .318.318 0 0 0 .1-.234.318.318 0 0 0-.1-.233l-.45-.45a8.466 8.466 0 0 1 1.247-.947l.313.545a.324.324 0 0 0 .195.15.377.377 0 0 0 .25-.033.33.33 0 0 0 .15-.197.35.35 0 0 0-.033-.25l-.314-.546a7.592 7.592 0 0 1 1.45-.6l.162.61a.318.318 0 0 0 .15.2.328.328 0 0 0 .25.033.357.357 0 0 0 .2-.153.299.299 0 0 0 .033-.25l-.17-.607a8.02 8.02 0 0 1 1.55-.207 8.383 8.383 0 0 1-1.196 4.02 8.446 8.446 0 0 1-2.95 2.95 8.295 8.295 0 0 1-4.02 1.187c.023-.52.093-1.033.206-1.55l.624.167v-.002zM10.84 4.875a.323.323 0 0 0-.4.233.306.306 0 0 0 .03.25.318.318 0 0 0 .2.15l.61.
393162c-.138.46-.337.943-.6 1.45l-.547-.313a.377.377 0 0 0-.25-.034.316.316 0 0 0-.196.15.377.377 0 0 0-.034.25.323.323 0 0 0 .15.195l.547.317a8.22 8.22 0 0 1-.95 1.243l-.447-.45a.315.315 0 0 0-.233-.096.318.318 0 0 0-.233.1.315.315 0 0 0-.1.233c0 .092.033.167.1.233l.45.447a8.325 8.325 0 0 1-1.247.95l-.313-.55a.332.332 0 0 0-.197-.147.35.35 0 0 0-.25.034.307.307 0 0 0-.147.195.341.341 0 0 0 .034.25l.311.546c-.45.245-.933.445-1.45.6l-.161-.608a.313.313 0 0 0-.15-.2.314.314 0 0 0-.25-.033.351.351 0 0 0-.2.15.294.294 0 0 0-.034.25l.17.61c-.5.12-1.016.191-1.54.216a8.222 8.222 0 0 1 .73-3.116 8.592 8.592 0 0 1 1.75-2.56 8.57 8.57 0 0 1 2.56-1.75 8.253 8.253 0 0 1 3.117-.73 9.403 9.403 0 0 1-.208 1.54l-.622-.167z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.436 19.88l-5.565.128.37-.666a.357.357 0 0 1 .233-.095l4.305-.098a.464.464 0 0 1 .357.151l.3.578v.001zm2.39-12.221c0 .786-.63 1.421-1.408 1.421a1.412 1.412 0 0 1-1.405-1.421c0-.782.63-1.417 1.405-1.417.777 0 1.407.635 1.407 1.418V7.66zm-.14 2.44a.66.66 0 0 1 .22.9c-.24.403-.555.926-.759 1.256-.45.726-.975.86-1.347.847-.56-.023-1.03-.393-1.395-1.104-.13-.257-.244-.469-.348-.661-.204-.375-.38-.7-.57-1.15a2.013 2.013 0 0 1-.082-.23s-2.88.734-2.963.766c1.223.53 1.695.726 1.947.81.51.169.87.463 1.073.876.225.46.222 1.002-.008 1.656-.189.542-.627 3.09-.855 4.538l-1.863-.056c.102-.654.67-4.243.97-5.105.023-.06.037-.113.046-.154-.453-.163-1.976-.817-3.056-1.285.015.73-.005 1.482-.072 1.9-.135.846-.45 1.448-1.665 2.029-.59.281-2.37 1.698-3.4 2.565l-1.41-1.24c.475-.401 3.044-2.55 4.016-3.015.573-.272.585-.343.63-.638.07-.438.07-1.76 0-2.616-.13-1.573.58-2.272 1.44-2.56.222-.072 2.28-.747 3.205-1.073-.563-.68-.951-1.13-1.038-1.245-.11-.148-.2-.257-.348-.333-.356-.181-1.523-.907-1.756-1.048a.938.938 0 0 1-.3-1.285.925.925 0 0 1 1.275-.306c.508.315 1.391.856 1.61.968.552.277.855.685 1 .88.112.146 1.268 1.55 2.045 2.49l.03.01c.758.394.99 1.171 1.145 1.685.03.106.06.204.093.285.154.367.303.64.49.989.057.106.12.219.183.342l.42-.696a.71.71 0 0 1 .981-.242l.42.252-.004-.003zM7.906 20.994L3 18.353l.645-.393a.333.333 0 0 1 .249.03l3.8 2.048a.463.463 0 0 1 .23.312l-.019.65v-.005z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.263 11.517l-1.592.372L5.82 9.614l1.806-.472c.63-1.076 1.303-2.218 1.476-2.444a1.674 1.674 0 0 1 1.182-.692 1.756 1.756 0 0 1 1.384.515l.302.272C13.36 8.052 14.818 9.4 15.242 9.86a2.19 2.19 0 0 1 .618 1.883 2.072 2.072 0 0 1-.996 1.399h-.299a3.572 3.572 0 0 0-1.902.515 1.1 1.1 0 0 1-.687.2c-.3.01-.598-.052-.87-.179a4.152 4.152 0 0 0-1.704-.349 4.244 4.244 0 0 0-1.883.458c-.23.133-.488.207-.75.214a1.23 1.23 0 0 1-.663-.194 4.603 4.603 0 0 0-.942-.36c2.672-.807 6.408-1.932 7.582-2.322a104.757 104.757 0 0 0-2.1-1.96c-.312.522-.72 1.216-1.096 1.86l-.288.492zm9.307.978c-1.165 0-2.11-.984-2.11-2.197S17.404 8.1 18.57 8.1c1.166 0 2.111.985 2.111 2.198s-.945 2.197-2.11 2.197zM6.76 16c-.523 0-1.04-.133-1.504-.392a2.068 2.068 0 0 0-2.07 0A3.162 3.162 0 0 1 1.646 16 .659.659 0 0 1 1 15.328c0-.372.289-.676.646-.676.346 0 .687-.093.987-.271a3.302 3.302 0 0 1 3.179 0c.288.171.61.263.938.264a2.2 2.2 0 0 0 1.02-.272 3.64 3.64 0 0 1 1.636-.39 3.518 3.518 0 0 1 1.47.3c.35.158.725.235 1.104.225.35.011.696-.086.994-.278a2.953 2.953 0 0 1 1.6-.435 4.156 4.156 0 0 1 1.505.244c.347.131.714.194 1.085.186.358.01.718-.05 1.054-.18.482-.18.993-.265 1.505-.251a4.331 4.331 0 0 1 1.526.243c.357.132.728.193 1.104.186.23 0 .445.129.56.336a.696.696 0 0 1 0 .673.642.642 0 0 1-.56.339 4.256 4.256 0 0 1-1.505-.243 3.134 3.134 0 0 0-1.127-.19 2.82 2.82 0 0 0-1.097.187c-.467.171-.96.257-1.457.246a4.137 4.137 0 0 1-1.477-.248 2.98 2.98 0 0 0-1.127-.186 1.723 1.723 0 0 0-.995.28 2.945 2.945 0 0 1-1.599.434 3.753 3.753 0 0 1-1.567-.319 2.29 2.29 0 0 0-1.007-.212c-.393 0-.78.1-1.127.29a3.383 3.383 0 0 1-1.507.383L6.76 16z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 11.708c0-.04-.017-.075-.023-.113a9.983 9.983 0 0 0-9.55-9.573c-.049-.005-.09-.022-.139-.022-.023 0-.043.01-.066.013C12.15 2.013 12.075 2 12 2 6.478 2 2 6.483 2 
39312c0 5.522 4.478 10 10 10 5.52 0 10-4.478 10-10 0-.078-.01-.157-.012-.238 0-.017.012-.034.012-.054zM11.462 3.725c-.175 1.942-.979 3.792-2.4 5.215-1.45 1.45-3.342 2.258-5.33 2.41a8.279 8.279 0 0 1 7.728-7.627l.002.002zm-7.7 9.205a9.949 9.949 0 0 0 6.39-2.9 9.928 9.928 0 0 0 2.895-6.257 8.284 8.284 0 0 1 7.183 7.184 9.959 9.959 0 0 0-6.258 2.893 9.942 9.942 0 0 0-2.9 6.39 8.277 8.277 0 0 1-7.31-7.31zm8.883 7.34c.155-1.988.963-3.88 2.412-5.333 1.425-1.422 3.273-2.222 5.223-2.4a8.283 8.283 0 0 1-7.633 7.733h-.002z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2C6.478 2 2 6.478 2 12c0 5.52 4.478 10 10 10 5.52 0 10-4.48 10-10 0-5.522-4.48-10-10-10zm8.192 11.4a11.672 11.672 0 0 0-2.912-1.73 9.15 9.15 0 0 0-1.158-.403 14.432 14.432 0 0 0-2.547-.45c-.517-.05-.923-.067-1.16-.067h-.133c-.09-.16-.2-.35-.314-.572a13.647 13.647 0 0 1-.95-2.25c-.12-.38-.211-.75-.273-1.1a9.444 9.444 0 0 1-.053-.313l.203-.037c.21-.036.59-.088 1.083-.13a13.763 13.763 0 0 1 2.445.004c.394.038.767.1 1.117.178.542.117 1.075.28 1.593.48.547.21 1.05.45 1.497.7.267.145.453.262.55.327l.173.116c.605 1.164.98 2.455.98 3.847 0 .48-.063.94-.141 1.4zm-1.897-6.8c-.293-.145-.567-.295-.895-.422a12.09 12.09 0 0 0-1.707-.516 9.987 9.987 0 0 0-1.213-.194c-.84-.08-1.717-.071-2.583 0-.52.04-.922.095-1.155.137l-.15.027c-.012-.15-.017-.304-.024-.457-.016-.483.014-.933.05-1.367A7.988 7.988 0 0 1 12 3.667c2.53 0 4.767 1.15 6.295 2.933zM9.738 4.017c-.025.403-.058.8-.043 1.24.02.596.083 1.19.192 1.771.066.384.166.784.295 1.192.25.805.6 1.61 1.005 2.38.103.197.2.373.286.525l-.178.31c-.107.187-.31.512-.597.917a13.882 13.882 0 0 1-1.575 1.87c-.123.12-.246.238-.37.345l-.25-.317c-.13-.17-.353-.483-.621-.9a13.788 13.788 0 0 1-1.145-2.158 9.157 9.157 0 0 1-.367-1.07c-.15-.534-.255-1.08-.322-1.634-.07-.58-.095-1.138-.086-1.65.003-.275.016-.47.03-.59a8.275 8.275 0 0 1 3.745-2.233l.001.002zM8.562 14.733c-.1.08-.194.154-.29.225-.04.034-.084.062-.122.094l.412-.317v-.002zM5.117 7.305c.008.433.016.867.071 1.34.072.592.184 1.178.345 1.75.1.373.234.763.397 1.16.322.78.74 1.553 1.21 2.283.283.44.517.767.663.955l.254.324c-.377.276-.77.525-1.18.75-.512.283-1.017.516-1.5.7-.105.045-.192.075-.277.105A8.283 8.283 0 0 1 3.667 12a8.29 8.29 0 0 1 1.45-4.693v-.002zm.566 10.075a13.705 13.705 0 0 0 1.663-.77c.522-.29 1.024-.617 1.494-.977.31-.233.622-.505.927-.805a14.699 14.699 0 0 0 1.666-1.983c.279-.392.487-.717.609-.925l.438-.283c.222 0 .578.016 1.023.06.824.078 1.644.216 2.405.428.274.077.534.162.784.255l-.054.105a20.644 20.644 0 0 1-1.967 3.033 12.684 12.684 0 0 1-1.421 1.559l-.333.305a15.025 15.025 0 0 1-2.467 1.741c-.503.287-.892.472-1.107.56l-.238.1a8.353 8.353 0 0 1-3.42-2.408l-.002.005zM12 20.333a8.436 8.436 0 0 1-1.703-.175c.171-.09.35-.178.561-.3a16.022 16.022 0 0 0 2.607-1.841l.35-.322a13.28 13.28 0 0 0 1.513-1.655 21.699 21.699 0 0 0 2.052-3.173l.08-.155a11.4 11.4 0 0 1 1.003.538c.5.303.955.625 1.354.947.058.045.1.083.146.12-1.008 3.471-4.171 6.016-7.963 6.016z"/></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.948 8.183c0 .636-.527 1.147-1.18 1.147-.654 0-1.18-.513-1.18-1.147s.527-1.147 1.18-1.147c.653 0 1.18.515 1.18 1.147zm-2.575-1.036c0 .635-.53 1.147-1.18 1.147-.65 0-1.18-.515-1.18-1.147S9.538 6 10.192 6c.654 0 1.18.515 1.18 1.147zm-2.501 8.094a1.487 1.487 0 0 0-.45-.808l-1.06-1a.794.794 0 0 1-.019-1.146.85.85 0 0 1 1.178-.019l1.44 1.358c.232.219.39.503.449.81l.696 3.563H9.407l-.535-2.757zm6.804-.767c-.31.314-.47.738-.437 1.169l.171 2.356h-1.674l-.212-2.962c-.032-.43.128-.856.436-1.168l1.313-1.318a.851.851 0 0 1 1.18-.018.798.798 0 0 1 .02 1.144l-.795.796-.002.001zm1.65-3.187l-1.646-1.184a.293.293 0 0 0-.405.058c-.004.004-.006.01-.012.012l-1.152 1.725c-.299.45-.823.714-1.37.697l-2.131-.07a1.566 1.566 0 0 1-1.345-.823l-.862-1.616a.293.293 0 0 0-.446-.085l-1.332 1.081a.273.273 0 0 0-.102.238l.205 2.94a1.5 1.5 0 0 1-.19.84L4.904 18H3l1.838-3.266c.144-.255.21-.547.188-.835l-.183-2.661c-.034-.486.174-.96.559-1.271l1.854-1.51c.087-.07.183-.132.285-.184.77-.39 1.716-.096 2.116.65l.979 1.839a.292.292 0 0 0 .25.152l1.69.054a.302.302 0 0 0 .252-.13l1.26-1.884c.017-.027.036-.05.052-.076.518-.679 1.5-.82 2.195-.318l2.148 1.545c.424.304.662.794.633 1.304l-.144 2.677c-.017.295.056.585.207.84L21 18h-1.927l-1.583-2.68a1.482 1.482 0 0 1-.207-.84l.157-2.95a.28.28 0 0 0-.113-.243z"/></svg>\n'},function(t,e){t.exports='<svg width="108" height="108" viewBox="0 0 108 108" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M97.4701 53.73C97.4701 77.5887 78.1288 96.93 54.2701 96.93C30.4114 96.93 11.0701 77.5887 11.0701 53.73C11.0701 29.8713 30.4114 10.53 54.2701 10.53C78.1288 10.53 97.4701 29.8713 97.4701 53.73Z" fill="#C7E7F3"/>\n<path d="M54.3677 10.8906C46.0045 20.7831 26.7392 26.2231 19.701 26.8622C19.6403 26.8678 19.6009 26.922 19.608 26.9826C23.7987 62.6526 34.3333 94.4999 54.4441 94.4999C74.5453 94.4999 87.5116 52.0004 89.2852 26.9847C89.2896 26.9223 89.2405 26.8716 89.1779 26.8713C75.3429 26.8097 59.2612 15.6761 54.524 10.8813C54.479 10.8358 54.409 10.8418 54.3677 10.8906Z" fill="white"/>\n<path d="M47.5236 15.3194C47.9754 15.0419 48.4356 14.8271 48.906 14.689L47.5236 15.3194C43.3939 17.8561 39.9679 25.6314 35.8376 27.913C27.67 32.4247 25.7253 52.1829 38.7937 61.2063C51.8621 70.2297 38.7937 87.9654 51.8621 93.7217C49.0358 93.6958 42.2786 92.1659 37.8603 86.2541C33.4419 80.3422 27.8775 68.5962 25.6475 63.4621C23.3139 54.9832 18.5844 36.0029 18.3354 27.913L19.6577 25.5793L29.4591 23.5568L47.5236 15.3194Z" fill="#E0F1FA"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M53.6996 11.4125L52.2184 10.0661C53.3599 8.81018 55.333 8.6969 56.601 9.88915C59.0752 12.2156 63.9453 15.8406 69.8113 18.9341C75.6946 22.0368 82.3541 24.4841 88.4437 24.6966C90.0776 24.7536 91.5227 26.1351 91.3784 27.955C90.3666 40.711 86.5899 57.249 80.5145 70.6582C77.4777 77.3608 73.8139 83.3999 69.5376 87.7952C65.2569 92.1948 60.1983 95.1041 54.4441 95.1041C43.1761 95.1041 34.9991 86.6406 29.23 74.529C23.4238 62.3397 19.6931 45.7752 17.5559 28.0178C17.3526 26.3283 18.5681 24.8379 20.2099 24.6349C23.7055 24.2029 29.7781 22.7322 36.0008 20.235C42.2528 17.7259 48.3795 14.2893 52.2184 10.0661L53.6996 11.4125ZM20.4749 26.7786C27.8919 25.862 45.4917 20.6776 53.8167 11.5189C54.1609 11.1403 54.7486 11.1123 55.1214 11.4628C60.3885 16.4154 75.258 26.3978 88.3684 26.8553C88.8689 26.8728 89.2647 27.2849 89.2251 27.7842C87.2363 52.858 74.3326 92.9441 54.4441 92.9441C34.4795 92.9441 23.9524 63.0883 19.7004 27.7597C19.6422 27.2754 19.9908 26.8385 20.4749 26.7786Z" fill="#00477C"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M40.5439 39.9891C40.5439 32.5449 46.5786 26.5102 54.0228 26.5102C61.467 26.5102 67.5018 32.5449 67.5018 39.9891V43.3375C67.5018 43.8147 67.115 44.2015 66.6378 44.2015H61.5582C61.081 44.2015 60.6942 43.8147 60.6942 43.3375V40.1255C60.6942 36.5292 57.7
393787 33.6137 54.1824 33.6137C50.586 33.6137 47.6706 36.5292 47.6706 40.1255V45.0221C47.6706 45.4993 48.0574 45.8861 48.5346 45.8861H54.8428C54.8503 45.8863 54.8578 45.8864 54.8653 45.8864H67.5017C67.5018 45.8864 67.5018 45.8864 67.5018 45.8865V45.8865C67.5018 45.8865 67.5018 45.8865 67.5019 45.8865H69.9214C72.3073 45.8865 74.2414 47.8207 74.2414 50.2065V65.9972C74.2414 68.383 72.3073 70.3172 69.9214 70.3172H38.967C36.5811 70.3172 34.647 68.383 34.647 65.9972V50.2065C34.647 47.8207 36.5811 45.8865 38.967 45.8865H39.6799C40.157 45.8865 40.5439 45.4997 40.5439 45.0225V39.9891ZM58.2353 58.1013C58.2353 60.195 56.538 61.8923 54.4443 61.8923C52.3506 61.8923 50.6534 60.195 50.6534 58.1013C50.6534 56.0076 52.3506 54.3104 54.4443 54.3104C56.538 54.3104 58.2353 56.0076 58.2353 58.1013Z" fill="#F9C5A8"/>\n<path d="M46.2506 40.5279C45.1929 37.4755 46.4738 32.9958 46.2506 31.322L41.6476 37.9335V46.6373L39.2206 47.1394L36.124 49.7338V66.3882L38.1326 68.8152H49.9329C48.1475 66.4161 41.1415 62.4701 42.066 57.6844C43.4888 50.3197 49.1797 48.9806 46.2506 40.5279Z" fill="#F7A97D"/>\n<path d="M52.8202 57.517C53.791 55.5419 53.2247 54.3228 52.8202 53.9602L49.8491 55.634L50.0583 59.8185L52.8202 62.6221L56.5862 62.4129C54.9264 61.6039 51.8494 59.4921 52.8202 57.517Z" fill="#C7E7F3"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M54.8653 45.8863L54.8428 45.886H48.5346C48.0574 45.886 47.6706 45.4992 47.6706 45.022V40.1255C47.6706 36.5291 50.586 33.6137 54.1824 33.6137C57.7787 33.6137 60.6942 36.5291 60.6942 40.1255V43.3375C60.6942 43.4773 60.7274 43.6094 60.7864 43.7263C60.9287 44.0082 61.2209 44.2014 61.5582 44.2014H68.0497C68.387 44.2014 68.6791 44.0082 68.8214 43.7263C68.8804 43.6094 68.9137 43.4773 68.9137 43.3375V39.7457C68.9137 31.8117 62.4819 25.38 54.548 25.38C46.614 25.38 40.1823 31.8117 40.1823 39.7457V45.0227C40.1823 45.4999 39.7955 45.8867 39.3183 45.8867H38.967C36.5811 45.8867 34.647 47.8208 34.647 50.2067V65.9973C34.647 68.3832 36.5811 70.3173 38.967 70.3173H69.9214C72.3073 70.3173 74.2414 68.3832 74.2414 65.9973V50.2067C74.2414 47.8208 72.3073 45.8867 69.9214 45.8867H68.9138L54.8653 45.8863ZM68.8733 48.0463C68.8868 48.0466 68.9003 48.0467 68.9138 48.0467H69.9214C71.1144 48.0467 72.0814 49.0138 72.0814 50.2067V65.9973C72.0814 67.1903 71.1144 68.1573 69.9214 68.1573H38.967C37.774 68.1573 36.807 67.1902 36.807 65.9973V50.2067C36.807 49.0138 37.774 48.0467 38.967 48.0467H39.3183C40.9884 48.0467 42.3423 46.6928 42.3423 45.0227V39.7457C42.3423 33.0047 47.807 27.54 54.548 27.54C61.289 27.54 66.7537 33.0047 66.7537 39.7457V42.0415H62.8542V40.1255C62.8542 35.3362 58.9717 31.4537 54.1824 31.4537C49.3931 31.4537 45.5106 35.3362 45.5106 40.1255V45.022C45.5106 46.6921 46.8645 48.046 48.5346 48.046H54.8231C54.8372 48.0462 54.8512 48.0463 54.8653 48.0463H68.8733ZM60.3953 58.1013C60.3953 61.3879 57.7309 64.0522 54.4443 64.0522C51.1577 64.0522 48.4934 61.3879 48.4934 58.1013C48.4934 54.8146 51.1577 52.1503 54.4443 52.1503C57.7309 52.1503 60.3953 54.8146 60.3953 58.1013ZM54.4443 61.8922C56.538 61.8922 58.2353 60.1949 58.2353 58.1013C58.2353 56.0076 56.538 54.3103 54.4443 54.3103C52.3506 54.3103 50.6534 56.0076 50.6534 58.1013C50.6534 60.1949 52.3506 61.8922 54.4443 61.8922Z" fill="#00477C"/>\n</svg>\n'},function(t,e,n){"use strict";(function(t,r){n.d(e,"a",(function(){return Xt}));var i=n(204),o=n(87),s=n.n(o),a=n(60),c=n.n(a),u=n(205),l=n.n(u),h=n(54),p=n.n(h),d=n(3),f=n.n(d),v=n(62),g=n.n(v),m=n(75),y=n.n(m),b=n(2),_=n.n(b),w=n(0),S=n.n(w),C=n(88),E=n.n(C),x=n(134),T=n.n(x),I=n(206),k=n.n(I),O=n(207),A=n.n(O),R=n(86),N=n.n(R),P=n(208),M=n.n(P),D=n(209),L=n.n(D),j=n(92),U=n.n(j),F=n(210),H=n.n(F);function B(t){return"string"==typeof t}function q(t,e){return!!e&&B(t)}var V=function(t){return Object(i.fromByteArray)(new Uint8Array(function(t,e){var n=[];if(B(t)&&q(t,e)){for(var r=0,i=t.length;r<i;r++)if(t.charAt(r)){var o=e(t.charAt(r),r,t);n[r]=o}}else if(!B(t)&&!q(t,e))for(var s=0,a=t.length;s<a;s++)if(s in t){var c=e(t[s],s,t);n[s]=c}return n}(t,(function(t){return t.charCodeAt(0)}))))},W=function(t){var e,n,r,i={},o=String.fromCharCode,s=t.length,a=0,c=0,u="";for(e=0;e<64;e++)i["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
393+/".charAt(e)]=e;for(n=0;n<s;n++)for(a=(a<<6)+i[t.charAt(n)],c+=6;c>=8;)((r=a>>>(c-=8)&255)||n<s-2)&&(u+=o(r));return u},z=null;function $(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$(Object(n),!0).forEach((function(e){_()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var K=function(){function t(e){var n,r=this;g()(this,t),_()(this,"_channel",void 0),_()(this,"watcher_count",void 0),_()(this,"typing",void 0),_()(this,"read",void 0),_()(this,"pinnedMessages",void 0),_()(this,"pending_messages",void 0),_()(this,"threads",void 0),_()(this,"mutedUsers",void 0),_()(this,"watchers",void 0),_()(this,"members",void 0),_()(this,"unreadCount",void 0),_()(this,"membership",void 0),_()(this,"last_message_at",void 0),_()(this,"isUpToDate",void 0),_()(this,"messageSets",[]),_()(this,"setIsUpToDate",(function(t){r.isUpToDate=t})),_()(this,"removeMessageFromArray",(function(t,e){var n=t.filter((function(t){return!(t.id&&e.id&&t.id===e.id)}));return{removed:n.length<t.length,result:n}})),_()(this,"updateUserMessages",(function(t){var e=function(t,e){for(var n=0;n<t.length;n++){var r,i=t[n];(null===(r=i.user)||void 0===r?void 0:r.id)===e.id&&(t[n]=Y(Y({},i),{},{user:e}))}};for(var n in r.messageSets.forEach((function(n){return e(n.messages,t)})),r.threads)e(r.threads[n],t);e(r.pinnedMessages,t)})),_()(this,"deleteUserMessages",(function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=0;r<t.length;r++){var i,o=t[r];(null===(i=o.user)||void 0===i?void 0:i.id)===e.id&&(t[r]=n?{cid:o.cid,created_at:o.created_at,deleted_at:e.deleted_at,id:o.id,latest_reactions:[],mentioned_users:[],own_reactions:[],parent_id:o.parent_id,reply_count:o.reply_count,status:o.status,thread_participants:o.thread_participants,type:"deleted",updated_at:o.updated_at,user:o.user}:Y(Y({},o),{},{type:"deleted",deleted_at:e.deleted_at}))}};for(var i in r.messageSets.forEach((function(r){return n(r.messages,t,e)})),r.threads)n(r.threads[i],t,e);n(r.pinnedMessages,t,e)})),this._channel=e,this.watcher_count=0,this.typing={},this.read={},this.initMessages(),this.pinnedMessages=[],this.pending_messages=[],this.threads={},this.mutedUsers=[],this.watchers={},this.members={},this.membership={},this.unreadCount=0,this.isUpToDate=!0,this.last_message_at=null!=(null==e?void 0:null===(n=e.state)||void 0===n?void 0:n.last_message_at)?new Date(e.state.last_message_at):null}var e;return y()(t,[{key:"messages",get:function(){var t;return(null===(t=this.messageSets.find((function(t){return t.isCurrent})))||void 0===t?void 0:t.messages)||[]},set:function(t){var e=this.messageSets.findIndex((function(t){return t.isCurrent}));this.messageSets[e].messages=t}},{key:"latestMessages",get:function(){var t;return(null===(t=this.messageSets.find((function(t){return t.isLatest})))||void 0===t?void 0:t.messages)||[]},set:function(t){var e=this.messageSets.findIndex((function(t){return t.isLatest}));this.messageSets[e].messages=t}},{key:"addMessageSorted",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"latest";return this.addMessagesSorted([t],e,!1,n,r)}},{key:"formatMessage",value:function(t){return Y(Y({},t),{},{__html:t.html,pinned_at:t.pinned_at?new Date(t.pinned_at):null,created_at:t.created_at?new Date(t.created_at):new Date,updated_at:t.updated_at?new Date(t.updated_at):new Date,status:t.status||"received"})}},{key:"addMessagesSorted",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"current",o=this.findTargetMessageSet(t,r,i),s=o.messagesToAdd,a=o.targetMessageSetIndex,c=0;c<s.length;c+=1){var u=s[c].shadowed;if(!u){var l,h=s[c].created_at instanceof Date,p=void 0;if(h)p=s[c];else(p=this.formatMessage(s[c])).user&&null!==(l=this._channel)&&void 0!==l&&l.cid&&this._channel.getClient().state.updateUserReference(p.user,this._channel.cid),n&&p.id&&this.threads[p.id]&&delete this.threads[p.id],this.last_message_at||(this.last_message_at=new Date(p.created_at.getTime())),p.created_at.getTime()>this.last_message_at.getTime()&&(this.last_message_at=new Date(p.created_at.getTime()));var d=p.parent_id;if(d&&!p.show_in_channel||-1===a||(this.messageSets[a].messages=this._addToMessageList(this.messageSets[a].messages,p,e,"created_at",r)),d&&!n){var f=this.threads[d]||[],v=this._addToMessageList(f,p,e,"created_at",r);this.threads[d]=v}}}return{messageSet:this.messageSets[a]}}},{key:"addPinnedMessages",value:function(t){for(var e=0;e<t.length;e+=1)this.addPinnedMessage(t[e])}},{key:"addPinnedMessage",value:function(t){this.pinnedMessages=this._addToMessageList(this.pinnedMessages,this.formatMessage(t),!1,"pinned_at")}},{key:"removePinnedMessage",value:function(t){var e=this.removeMessageFromArray(this.pinnedMessages,t).result;this.pinnedMessages=e}},{key:"addReaction",value:function(t,e,n){var r=this;if(e){var i=e;return this._updateMessage(e,(function(e){return i.own_reactions=r._addOwnReactionToMessage(e.own_reactions,t,n),r.formatMessage(i)})),i}}},{key:"_addOwnReactionToMessage",value:function(t,e,n){return t=(t=n?[]:this._removeOwnReactionFromMessage(t,e))||[],this._channel.getClient().userID===e.user_id&&t.pu
393sh(e),t}},{key:"_removeOwnReactionFromMessage",value:function(t,e){return t?t.filter((function(t){return t.user_id!==e.user_id||t.type!==e.type})):t}},{key:"removeReaction",value:function(t,e){var n=this;if(e){var r=e;return this._updateMessage(e,(function(e){return r.own_reactions=n._removeOwnReactionFromMessage(e.own_reactions,t),n.formatMessage(r)})),r}}},{key:"removeQuotedMessageReferences",value:function(t){var e=this,n=function(t){var e,n;return Y(Y({},t),{},{created_at:t.created_at.toString(),pinned_at:null===(e=t.pinned_at)||void 0===e?void 0:e.toString(),updated_at:null===(n=t.updated_at)||void 0===n?void 0:n.toString()})};this.messageSets.forEach((function(r){var i=r.messages.filter((function(e){return e.quoted_message_id===t.id})).map(n).map((function(e){return Y(Y({},e),{},{quoted_message:Y(Y({},t),{},{attachments:[]})})}));e.addMessagesSorted(i,!0)}))}},{key:"_updateMessage",value:function(t,e){var n=t.parent_id,r=t.show_in_channel,i=t.pinned;if(n&&this.threads[n]){var o=this.threads[n],s=o.findIndex((function(e){return e.id===t.id}));-1!==s&&(o[s]=e(o[s]),this.threads[n]=o)}if(!r&&!n||r){var a=this.findMessageSetIndex(t);if(-1!==a){var c=this.messageSets[a].messages.findIndex((function(e){return e.id===t.id}));-1!==c&&(this.messageSets[a].messages[c]=e(this.messageSets[a].messages[c]))}}if(i){var u=this.pinnedMessages.findIndex((function(e){return e.id===t.id}));-1!==u&&(this.pinnedMessages[u]=e(this.pinnedMessages[u]))}}},{key:"_addToMessageList",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"created_at",i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=i||n,s=t;n&&(s=s.filter((function(t){return!(t.id&&e.id===t.id)})));var a=s.length;if(0===a&&o)return s.concat(e);if(0===a)return p()(s);var c=e[r].getTime(),u=s[a-1][r].getTime()<c;if(u&&o)return s.concat(e);if(u)return p()(s);for(var l=0,h=0,d=a-1;l<=d;)s[h=Math.floor((d+l)/2)][r].getTime()<=c?l=h+1:d=h-1;if(!n&&e.id){if(s[l]&&e.id===s[l].id)return s[l]=e,p()(s);if(s[l-1]&&e.id===s[l-1].id)return s[l-1]=e,p()(s)}return o&&s.splice(l,0,e),p()(s)}},{key:"removeMessage",value:function(t){var e=!1;if(t.parent_id&&this.threads[t.parent_id]){var n=this.removeMessageFromArray(this.threads[t.parent_id],t),r=n.removed,i=n.result;this.threads[t.parent_id]=i,e=r}else{var o,s=null!==(o=t.messageSetIndex)&&void 0!==o?o:this.findMessageSetIndex(t);if(-1!==s){var a=this.removeMessageFromArray(this.messageSets[s].messages,t),c=a.removed,u=a.result;this.messageSets[s].messages=u,e=c}}return e}},{key:"filterErrorMessages",value:function(){var t=this.latestMessages.filter((function(t){return"error"!==t.type}));this.latestMessages=t}},{key:"clean",value:function(){for(var t=new Date,e=0,n=Object.entries(this.typing);e<n.length;e++){var r=T()(n[e],2),i=r[0],o=r[1],s="string"==typeof o.received_at?new Date(o.received_at):o.received_at||new Date;t.getTime()-s.getTime()>7e3&&(delete this.typing[i],this._channel.getClient().dispatchEvent({cid:this._channel.cid,type:"typing.stop",user:{id:i}}))}}},{key:"clearMessages",value:function(){this.initMessages(),this.pinnedMessages=[]}},{key:"initMessages",value:function(){this.messageSets=[{messages:[],isLatest:!0,isCurrent:!0}]}},{key:"loadMessageIntoState",value:(e=f()(S.a.mark((function t(e,n){var r,i,o,s,a,c,u=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=u.length>2&&void 0!==u[2]?u[2]:25,s=!1,a=!1,c=n||e,"latest"!==e){t.next=10;break}if(this.messages!==this.latestMessages){t.next=7;break}return t.abrupt("return");case 7:o=this.messageSets.findIndex((function(t){return t.isLatest})),t.next=11;break;case 10:o=this.findMessageSetIndex({id:c});case 11:if(-1!==o&&(this.switchToMessageSet(o),s=!0),a=!n||!(null===(r=this.threads[n])||void 0===r||!r.find((function(t){return t.id===e}))),!s||!a){t.next=15;break}return t.abrupt("return");case 15:if(s){t.next=18;break}return t.next=18,this._channel.query({messages:{id_around:c,limit:i}},"new");case 18:if(a||!n){t.next=21;break}return t.next=21,this._channel.getReplies(n,{id_around:e,limit:i});case 21:-1!==(o=this.findMessageSetIndex({id:c}))&&this.switchToMessageSet(o);case 23:case"end":return t.stop()}}),t,this)}))),function(t,n){return e.apply(this,arguments)})},{key:"findMessage",value:function(t,e){if(e){var n=this.threads[e];if(!n)return;return n.find((function(e){return e.id===t}))}var r=this.findMessageSetIndex({id:t});if(-1!==r)return this.messageSets[r].messages.find((function(e){return e.id===t}))}},{key:"switchToMessageSet",value:function(t){var e=this.messageSets.find((function(t){return t.isCurrent}));e&&(e.isCurrent=!1,this.messageSets[t].isCurrent=!0)}},{key:"areMessageSetsOverlap",value:function(t,e){return t.some((function(t){return e.find((function(e){return t.id===e.id}))}))}},{key:"findMessageSetIndex",value:function(t){return this.messageSets.findIndex((function(e){return!!e.messages.find((function(e){return e.id===t.id}))}))}},{key:"findTargetMessageSet",value:function(t){var e,n=this,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"current",o=t;if(r){var s=this.messageSets.map((function(t,e){return e})).filter((function(e){return n.areMessageSetsOverlap(n.messageSets[e].messages,t)}));switch(i){case"new":s.length>0?e=s[0]:t.some((function(t){return!t.parent_id}))&&(this.messageSets.push({messages:[],isCurrent:!1,isLatest:!1}),e=this.messageSets.length-1);break;case"current":e=this.messageSets.findIndex((function(t){return t.isCurrent}));break;case"latest":e=this.messageSets.findIndex((function(t){return t.isLatest}));break;default:e=-1}var a=s.splice(0,1)[0],c=p()(s);if(void 0!==a&&a!==e&&c.push(e),c.length>0){var u=this.messageSets[a],l=this.messageSets.filter((function(t,e){return-1!==c.indexOf(e)}));l.forEach((function(t){u.isLatest=u.isLatest||t.isLatest,u.isCurrent=u.isCurrent||t.isCurrent,o=[].concat(p()(o),p()(t.messages))})),l.forEach((function(t){return n.messageSets.splice(n.messageSets.indexOf(t),1)}));var h=this.messageSets.findIndex((function(e){return n.areMessageSetsOverlap(e.messages,t)}));e=h}}else e=this.findMessageSetIndex(t[0]);return{targetMessageSetIndex:e,messagesToAdd:o}}}]),t}();function G(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];
393if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Q(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){throw t})),f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){a=!0,o=t})),f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function Q(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var X=function(t){return new Promise((function(e){return setTimeout(e,t)}))};function J(t){return t&&("[object Function]"===Object.prototype.toString.call(t)||"function"==typeof t||t instanceof Function)}var Z={TOKEN_EXPIRED:40,WS_CLOSED_SUCCESS:1e3};function tt(t,e,n){var r,i=new k.a;return null!==(r=t)&&"object"===c()(r)&&(r.readable||"function"==typeof r._read)||function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}(t)||function(t){return"undefined"!=typeof window&&"File"in window&&t instanceof File}(t)||function(t){return"undefined"!=typeof window&&"Blob"in window&&t instanceof Blob}(t)?e?i.append("file",t,e):i.append("file",t):i.append("file",{uri:t,name:e||t.split("/").reverse()[0],contentType:n||void 0,type:n||void 0}),i}function et(t){var e,n=[],r=G(Array.isArray(t)?t:[t]);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=Object.entries(i);o.length>1&&console.warn("client._buildSort() - multiple fields in a single sort object detected. Object's field order is not guaranteed");for(var s=0,a=o;s<a.length;s++){var c=T()(a[s],2),u=c[0],l=c[1];n.push({field:u,direction:l})}}}catch(t){r.e(t)}finally{r.f()}return n}function nt(t){var e=Math.min(500+2e3*t,25e3),n=Math.min(Math.max(250,2e3*(t-1)),25e3);return Math.floor(Math.random()*(e-n)+n)}function rt(){return(t=function(t){var e=new Uint8Array(t);return st(e),e}(16))[6]=15&t[6]|64,t[8]=191&t[8]|128,it(t.subarray(0,4))+"-"+it(t.subarray(4,6))+"-"+it(t.subarray(6,8))+"-"+it(t.subarray(8,10))+"-"+it(t.subarray(10,16));var t}function it(t){for(var e="",n=0;n<t.length;n++)e+=t[n].toString(16).padStart(2,"0");return e}function ot(t){for(var e=Math.pow(2,8*t.byteLength/t.length),n=0;n<t.length;n++)t[n]=Math.random()*e}var st="undefined"!=typeof crypto?crypto.getRandomValues.bind(crypto):"undefined"!=typeof msCrypto?msCrypto.getRandomValues.bind(msCrypto):ot;function at(t){var e={};if(!t)return e;try{Object.getOwnPropertyNames(t).forEach((function(n){e[n]=Object.getOwnPropertyDescriptor(t,n)}))}catch(t){return{error:"failed to serialize the error"}}return e}function ct(t){"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("offline",t),window.addEventListener("online",t))}function ut(t){"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("offline",t),window.removeEventListener("online",t))}function lt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ht(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ht(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t}
393,f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function pt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function dt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pt(Object(n),!0).forEach((function(e){_()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ft=function(){function t(e,n,r,i){var o=this;g()(this,t),_()(this,"_client",void 0),_()(this,"type",void 0),_()(this,"id",void 0),_()(this,"data",void 0),_()(this,"_data",void 0),_()(this,"cid",void 0),_()(this,"listeners",void 0),_()(this,"state",void 0),_()(this,"initialized",void 0),_()(this,"offlineMode",void 0),_()(this,"lastKeyStroke",void 0),_()(this,"lastTypingEvent",void 0),_()(this,"isTyping",void 0),_()(this,"disconnected",void 0),_()(this,"create",f()(S.a.mark((function t(){var e;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e={watch:!1,state:!1,presence:!1},t.next=3,o.query(e,"latest");case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})))),_()(this,"_callChannelListeners",(function(t){var e=o,n=[];e.listeners.all&&n.push.apply(n,p()(e.listeners.all)),e.listeners[t.type]&&n.push.apply(n,p()(e.listeners[t.type]));for(var r=0,i=n;r<i.length;r++){var s=i[r];"string"!=typeof s&&s(t)}})),_()(this,"_channelURL",(function(){if(!o.id)throw new Error("channel id is not defined");return"".concat(o.getClient().baseURL,"/channels/").concat(o.type,"/").concat(o.id)}));if(!/^[\w_-]+$/.test(n))throw new Error("Invalid chat type ".concat(n,', letters, numbers and "_-" are allowed'));if("string"==typeof r&&!/^[\w!_-]+$/.test(r))throw new Error("Invalid chat id ".concat(r,', letters, numbers and "!-_" are allowed'));this._client=e,this.type=n,this.id=r,this.data=i,this._data=dt({},i),this.cid="".concat(n,":").concat(r),this.listeners={},this.state=new K(this),this.initialized=!1,this.offlineMode=!1,this.lastTypingEvent=null,this.isTyping=!1,this.disconnected=!1}var e,n,r,i,o,s,a,u,l,h,d,v,m,b,w,C,E,x,T,I,k,O,A,R,N,P,M,D,L,j,U,F,H,B,q,V,W;return y()(t,[{key:"getClient",value:function(){if(!0===this.disconnected)throw Error("You can't use a channel after client.disconnect() was called");return this._client}},{key:"getConfig",value:function(){return this.getClient().configs[this.cid]}},{key:"sendMessage",value:(W=f()(S.a.mark((function t(e,n){var r;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getClient().post(this._channelURL()+"/message",dt({message:e},n));case 2:return r=t.sent,this.state.unreadCount=0,t.abrupt("return",r);case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return W.apply(this,arguments)})},{key:"sendFile",value:function(t,e,n,r){return this.getClient().sendFile("".concat(this._channelURL(),"/file"),t,e,n,r)}},{key:"sendImage",value:function(t,e,n,r){return this.getClient().sendFile("".concat(this._channelURL(),"/image"),t,e,n,r)}},{key:"deleteFile",value:function(t){return this.getClient().delete("".concat(this._channelURL(),"/file"),{url:t})}},{key:"deleteImage",value:function(t){return this.getClient().delete("".concat(this._channelURL(),"/image"),{url:t})}},{key:"sendEvent",value:(V=f()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkInitialized(),t.next=3,this.getClient().post(this._channelURL()+"/event",{event:e});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return V.apply(this,arguments)})},{key:"search",value:(q=f()(S.a.mark((function t(e){var n,r,i=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=i.length>1&&void 0!==i[1]?i[1]:{}).offset||!n.sort&&!n.next){t.next=3;break}throw Error("Cannot specify offset with sort or next parameters");case 3:if(r=dt(dt({filter_conditions:{cid:this.cid}},n),{},{sort:n.sort?et(n.sort):void 0}),"string"!=typeof e){t.next=8;break}r.query=e,t.next=13;break;case 8:if("object"!==c()(e)){t.next=12;break}r.message_filter_conditions=e,t.next=13;break;case 12:throw Error("Invalid type ".concat(c()(e)," for query parameter"));case 13:return t.next=15,this.getClient().wsPromise;case 15:return t.next=17,this.getClient().get(this.getClient().baseURL+"/search",{payload:r});case 17:return t.abrupt("return",t.sent);case 18:case"end":return t.stop()}}),t,this)}))),function(t){return q.apply(this,arguments)})}
393,{key:"queryMembers",value:(B=f()(S.a.mark((function t(e){var n,r,i,o,s,a,c=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=c.length>1&&void 0!==c[1]?c[1]:[],i=c.length>2&&void 0!==c[2]?c[2]:{},s=this.type,this.id?o=this.id:null!==(n=this.data)&&void 0!==n&&n.members&&Array.isArray(this.data.members)&&(a=this.data.members),t.next=6,this.getClient().get(this.getClient().baseURL+"/members",{payload:dt({type:s,id:o,members:a,sort:et(r),filter_conditions:e},i)});case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return B.apply(this,arguments)})},{key:"sendReaction",value:(H=f()(S.a.mark((function t(e,n,r){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}throw Error("Message id is missing");case 2:if(n&&0!==Object.keys(n).length){t.next=4;break}throw Error("Reaction object is missing");case 4:return t.next=6,this.getClient().post(this.getClient().baseURL+"/messages/".concat(e,"/reaction"),dt({reaction:n},r));case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return H.apply(this,arguments)})},{key:"deleteReaction",value:function(t,e,n){if(this._checkInitialized(),!e||!t)throw Error("Deleting a reaction requires specifying both the message and reaction type");var r=this.getClient().baseURL+"/messages/".concat(t,"/reaction/").concat(e);return n?this.getClient().delete(r,{user_id:n}):this.getClient().delete(r,{})}},{key:"update",value:(F=f()(S.a.mark((function t(){var e,n,r,i=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},n=i.length>1?i[1]:void 0,r=i.length>2?i[2]:void 0,["config","cid","created_by","id","member_count","type","created_at","updated_at","last_message_at","own_capabilities"].forEach((function(t){delete e[t]})),t.next=7,this._update(dt({message:n,data:e},r));case 7:return t.abrupt("return",t.sent);case 8:case"end":return t.stop()}}),t,this)}))),function(){return F.apply(this,arguments)})},{key:"updatePartial",value:(U=f()(S.a.mark((function t(e){var n;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getClient().patch(this._channelURL(),e);case 2:return n=t.sent,this.data=n.channel,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return U.apply(this,arguments)})},{key:"enableSlowMode",value:(j=f()(S.a.mark((function t(e){var n;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getClient().post(this._channelURL(),{cooldown:e});case 2:return n=t.sent,this.data=n.channel,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return j.apply(this,arguments)})},{key:"disableSlowMode",value:(L=f()(S.a.mark((function t(){var e;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getClient().post(this._channelURL(),{cooldown:0});case 2:return e=t.sent,this.data=e.channel,t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return L.apply(this,arguments)})},{key:"delete",value:(D=f()(S.a.mark((function t(){var e,n=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},t.next=3,this.getClient().delete(this._channelURL(),dt({},e));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(){return D.apply(this,arguments)})},{key:"truncate",value:(M=f()(S.a.mark((function t(){var e,n=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},t.next=3,this.getClient().post(this._channelURL()+"/truncate",e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(){return M.apply(this,arguments)})},{key:"acceptInvite",value:(P=f()(S.a.mark((function t(){var e,n=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},t.next=3,this._update(dt({accept_invite:!0},e));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(){return P.apply(this,arguments)})},{key:"rejectInvite",value:(N=f()(S.a.mark((function t(){var e,n=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},t.next=3,this._update(dt({reject_invite:!0},e));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(){return N.apply(this,arguments)})},{key:"addMembers",value:(R=f()(S.a.mark((function t(e,n){var r,i=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:{},t.next=3,this._update(dt({add_members:e,message:n},r));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return R.apply(this,arguments)})}
393,{key:"addModerators",value:(A=f()(S.a.mark((function t(e,n){var r,i=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:{},t.next=3,this._update(dt({add_moderators:e,message:n},r));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return A.apply(this,arguments)})},{key:"assignRoles",value:(O=f()(S.a.mark((function t(e,n){var r,i=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:{},t.next=3,this._update(dt({assign_roles:e,message:n},r));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return O.apply(this,arguments)})},{key:"inviteMembers",value:(k=f()(S.a.mark((function t(e,n){var r,i=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:{},t.next=3,this._update(dt({invites:e,message:n},r));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return k.apply(this,arguments)})},{key:"removeMembers",value:(I=f()(S.a.mark((function t(e,n){var r,i=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:{},t.next=3,this._update(dt({remove_members:e,message:n},r));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return I.apply(this,arguments)})},{key:"demoteModerators",value:(T=f()(S.a.mark((function t(e,n){var r,i=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:{},t.next=3,this._update(dt({demote_moderators:e,message:n},r));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return T.apply(this,arguments)})},{key:"_update",value:(x=f()(S.a.mark((function t(e){var n;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getClient().post(this._channelURL(),e);case 2:return n=t.sent,this.data=n.channel,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return x.apply(this,arguments)})},{key:"mute",value:(E=f()(S.a.mark((function t(){var e,n=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},t.next=3,this.getClient().post(this.getClient().baseURL+"/moderation/mute/channel",dt({channel_cid:this.cid},e));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(){return E.apply(this,arguments)})},{key:"unmute",value:(C=f()(S.a.mark((function t(){var e,n=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},t.next=3,this.getClient().post(this.getClient().baseURL+"/moderation/unmute/channel",dt({channel_cid:this.cid},e));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(){return C.apply(this,arguments)})},{key:"muteStatus",value:function(){return this._checkInitialized(),this.getClient()._muteStatus(this.cid)}},{key:"sendAction",value:function(t,e){if(this._checkInitialized(),!t)throw Error("Message id is missing");return this.getClient().post(this.getClient().baseURL+"/messages/".concat(t,"/action"),{message_id:t,form_data:e,id:this.id,type:this.t
393ype})}},{key:"keystroke",value:(w=f()(S.a.mark((function t(e){var n,r,i;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==(n=this.getConfig())&&void 0!==n&&n.typing_events){t.next=2;break}return t.abrupt("return");case 2:if(r=new Date,i=this.lastTypingEvent&&r.getTime()-this.lastTypingEvent.getTime(),this.lastKeyStroke=r,this.isTyping=!0,!(null===i||i>2e3)){t.next=10;break}return this.lastTypingEvent=new Date,t.next=10,this.sendEvent({type:"typing.start",parent_id:e});case 10:case"end":return t.stop()}}),t,this)}))),function(t){return w.apply(this,arguments)})},{key:"stopTyping",value:(b=f()(S.a.mark((function t(e){var n;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==(n=this.getConfig())&&void 0!==n&&n.typing_events){t.next=2;break}return t.abrupt("return");case 2:return this.lastTypingEvent=null,this.isTyping=!1,t.next=6,this.sendEvent({type:"typing.stop",parent_id:e});case 6:case"end":return t.stop()}}),t,this)}))),function(t){return b.apply(this,arguments)})},{key:"lastMessage",value:function(){var t=this.state.latestMessages.length-5;t<0&&(t=0);var e=this.state.latestMessages.length+1,n=this.state.latestMessages.slice(t,e);return n.sort((function(t,e){return e.created_at.getTime()-t.created_at.getTime()})),n[0]}},{key:"markRead",value:(m=f()(S.a.mark((function t(){var e,n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.length>0&&void 0!==r[0]?r[0]:{},this._checkInitialized(),null!==(e=this.getConfig())&&void 0!==e&&e.read_events){t.next=4;break}return t.abrupt("return",Promise.resolve(null));case 4:return t.next=6,this.getClient().post(this._channelURL()+"/read",dt({},n));case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)}))),function(){return m.apply(this,arguments)})},{key:"clean",value:function(){this.lastKeyStroke&&((new Date).getTime()-this.lastKeyStroke.getTime()>1e3&&this.isTyping&&function(t,e){t.then().catch((function(t){console.warn("failed to do ".concat(e,", ran into error: "),t)}))}(this.stopTyping(),"stop typing event"));this.state.clean()}},{key:"watch",value:(v=f()(S.a.mark((function t(e){var n,r,i;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n={state:!0,watch:!0,presence:!1},t.next=3,this.getClient().wsPromise;case 3:return this.getClient()._hasConnectionID()||(n.watch=!1),r=dt(dt({},n),e),t.next=7,this.query(r,"latest");case 7:return i=t.sent,this.initialized=!0,this.data=i.channel,this._client.logger("info","channel:watch() - started watching channel ".concat(this.cid),{tags:["channel"],channel:this}),t.abrupt("return",i);case 12:case"end":return t.stop()}}),t,this)}))),function(t){return v.apply(this,arguments)})},{key:"stopWatching",value:(d=f()(S.a.mark((function t(){var e;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getClient().post(this._channelURL()+"/stop-watching",{});case 2:return e=t.sent,this._client.logger("info","channel:watch() - stopped watching channel ".concat(this.cid),{tags:["channel"],channel:this}),t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(){return d.apply(this,arguments)})},{key:"getReplies",value:(h=f()(S.a.mark((function t(e,n){var r;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getClient().get(this.getClient().baseURL+"/messages/".concat(e,"/replies"),dt({},n));case 2:return(r=t.sent).messages&&this.state.addMessagesSorted(r.messages),t.abrupt("return",r);case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return h.apply(this,arguments)})},{key:"getPinnedMessages",value:(l=f()(S.a.mark((function t(e){var n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:[],t.next=3,this.getClient().get(this.getClient().baseURL+"/channels/".concat(this.type,"/").concat(this.id,"/pinned_messages"),{payload:dt(dt({},e),{},{sort:et(n)})});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"getReactions",value:function(t,e){return this.getClient().get(this.getClient().baseURL+"/messages/".concat(t,"/reactions"),dt({},e))}},{key:"getMessagesById",value:function(t){return this.getClient().get(this._channelURL()+"/messages",{ids:t.join(",")})}},{key:"lastRead",value:function(){this._checkInitialized();var t=this.getClient().userID;if(t)return this.state.read[t]?this.state.read[t].last_read:null}},{key:"_countMessageAsUnread",value:function(t){var e,n,r,i;return!t.shadowed&&(!t.silent&&(!(t.parent_id&&!t.show_in_channel)&&((null===(e=t.user)||void 0===e?void 0:e.id)!==this.getClient().userID&&((null===(n=t.user)||void 0===n||!n.id||!this.getClient().userMuteStatus(t.user.id))&&("system"!==t.type&&(!(Array.isArray(null===(r=this.data)||void 0===r?void 0:r.own_capabilities)&&(null===(i=this.data)||void 0===i||!i.own_capabilities.includes("read-events")))&&!this.muteStatus().muted))))))}},{key:"countUnread",value:function(t){if(!t)return this.state.unreadCount;for(var e=0,n=0;n<this.state.latestMessages.length;n+=1){var r=this.state.latestMessages[n];r.created_at>t&&this._countMessageAsUnread(r)&&e++}return e}},{key:"countUnreadMentions",value:function(){for(var t=this.lastRead(),e=this.getClient().userID,n=0,r=0;r<this.state.latestMessages.length;r+=1){var i,o=this.state.latestMessages[r];this._countMessageAsUnread(o)&&(!t||o.created_at>t)&&null!==(i=o.mentioned_users)&&void 0!==i&&i.some((function(t){return t.id===e}))&&n++}return n}}
393,{key:"query",value:(u=f()(S.a.mark((function t(e){var n,r,i,o,s,a,c,u=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:"current",t.next=3,this.getClient().wsPromise;case 3:return r="".concat(this.getClient().baseURL,"/channels/").concat(this.type),this.id&&(r+="/".concat(this.id)),t.next=7,this.getClient().post(r+"/query",dt({data:this._data,state:!0},e));case 7:return i=t.sent,this.id||(this.id=i.channel.id,this.cid=i.channel.cid,o=i.members.map((function(t){var e;return t.user_id||(null===(e=t.user)||void 0===e?void 0:e.id)})).sort().join(","),(s="".concat(this.type,":!members-").concat(o))in this.getClient().activeChannels&&delete this.getClient().activeChannels[s],this.cid in this.getClient().activeChannels||(this.getClient().activeChannels[this.cid]=this)),this.getClient()._addChannelConfig(i.channel),a=this._initializeState(i,n),c=a.messageSet,this.data=i.channel,this.getClient().dispatchEvent({type:"channels.queried",queriedChannels:{channels:[i],isLatestMessageSet:c.isLatest}}),t.abrupt("return",i);case 14:case"end":return t.stop()}}),t,this)}))),function(t){return u.apply(this,arguments)})},{key:"banUser",value:(a=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkInitialized(),t.next=3,this.getClient().banUser(e,dt(dt({},n),{}
393,{type:this.type,id:this.id}));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return a.apply(this,arguments)})},{key:"hide",value:(s=f()(S.a.mark((function t(){var e,n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:null,n=r.length>1&&void 0!==r[1]&&r[1],this._checkInitialized(),t.next=5,this.getClient().post("".concat(this._channelURL(),"/hide"),{user_id:e,clear_history:n});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"show",value:(o=f()(S.a.mark((function t(){var e,n=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:null,this._checkInitialized(),t.next=4,this.getClient().post("".concat(this._channelURL(),"/show"),{user_id:e});case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"unbanUser",value:(i=f()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkInitialized(),t.next=3,this.getClient().unbanUser(e,{type:this.t
393ype,id:this.id});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"shadowBan",value:(r=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkInitialized(),t.next=3,this.getClient().shadowBan(e,dt(dt({},n),{},{type:this.type,id:this.id}));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"removeShadowBan",value:(n=f()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkInitialized(),t.next=3,this.getClient().removeShadowBan(e,{type:this.type,id:this.id});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"createCall",value:(e=f()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getClient().post(this._channelURL()+"/call",e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"on",value:function(t,e){var n=this,r=e?t:"all",i=e||t;return r in this.listeners||(this.listeners[r]=[]),this._client.logger("info","Attaching listener for ".concat(r," event on channel ").concat(this.cid),{tags:["event","channel"],channel:this}),this.listeners[r].push(i),{unsubscribe:function(){n._client.logger("info","Removing listener for ".concat(r," event from channel ").concat(n.cid),{tags:["event","channel"],channel:n}),n.listeners[r]=n.listeners[r].filter((function(t){return t!==i}))}}}},{key:"off",value:function(t,e){var n=e?t:"all",r=e||t;n in this.listeners||(this.listeners[n]=[]),this._client.logger("info","Removing listener for ".concat(n," event from channel ").concat(this.cid),{tags:["event","channel"],channel:this}),this.listeners[n]=this.listeners[n].filter((function(t){return t!==r}))}},{key:"_handleChannelEvent",value:function(t){var e,n,r,i,o,s,a,c;this._client.logger("info","channel:_handleChannelEvent - Received event of type { ".concat(t.type," } on ").concat(this.cid),{tags:["event","channel"],channel:this});var u=this.state;switch(t.type){case"typing.start":null!==(e=t.user)&&void 0!==e&&e.id&&(u.typing[t.user.id]=t);break;case"typing.stop":null!==(n=t.user)&&void 0!==n&&n.id&&delete u.typing[t.user.id];break;case"message.read":var l,h;if(null!==(r=t.user)&&void 0!==r&&r.id)u.read[t.user.id]={last_read:t.received_at,user:t.user,unread_messages:0},(null===(l=t.user)||void 0===l?void 0:l.id)===(null===(h=this.getClient().user)||void 0===h?void 0:h.id)&&(u.unreadCount=0);break;case"user.watching.start":case"user.updated":null!==(i=t.user)&&void 0!==i&&i.id&&(u.watchers[t.user.id]=t.user);break;case"user.watching.stop":null!==(o=t.user)&&void 0!==o&&o.id&&delete u.watchers[t.user.id];break;case"message.deleted":t.message&&(this._extendEventWithOwnReactions(t),t.hard_delete?u.removeMessage(t.message):u.addMessageSorted(t.message,!1,!1),u.removeQuotedMessageReferences(t.message),t.message.pinned&&u.removePinnedMessage(t.message));break;case"message.new":if(t.message){var p,d,f,v=(null===(p=t.user)||void 0===p?void 0:p.id)===(null===(d=this.getClient().user)||void 0===d?void 0:d.id),g=t.message.parent_id&&!t.message.show_in_channel;(this.state.isUpToDate||g)&&u.addMessageSorted(t.message,v),t.message.pinned&&u.addPinnedMessage(t.message),v&&null!==(f=t.user)&&void 0!==f&&f.id?(u.unreadCount=0,u.read[t.user.id]={last_read:new Date(t.created_at),user:t.user,unread_messages:0}):this._countMessageAsUnread(t.message)&&(u.unreadCount=u.unreadCount+1)}break;case"message.updated":t.message&&(this._extendEventWithOwnReactions(t),u.addMessageSorted(t.message,!1,!1),t.message.pinned?u.addPinnedMessage(t.message):u.removePinnedMessage(t.message));break;case"channel.truncated":if(null!==(s=t.channel)&&void 0!==s&&s.truncated_at){var m=+new Date(t.channel.truncated_at);u.messageSets.forEach((function(t,e){t.messages.forEach((function(t){var n=t.created_at,r=t.id;m>+n&&u.removeMessage({id:r,messageSetIndex:e})}))}
393)),u.pinnedMessages.forEach((function(t){var e=t.id,n=t.created_at;m>+n&&u.removePinnedMessage({id:e})}))}else u.clearMessages();u.unreadCount=0,t.message&&(u.addMessageSorted(t.message),t.message.pinned&&u.addPinnedMessage(t.message));break;case"member.added":case"member.updated":null!==(a=t.member)&&void 0!==a&&a.user_id&&(u.members[t.member.user_id]=t.member);break;case"member.removed":null!==(c=t.user)&&void 0!==c&&c.id&&delete u.members[t.user.id];break;case"channel.updated":var y,b,_,w,S,C;if(t.channel)this.data=dt(dt({},t.channel),{},{hidden:null!==(y=null===(b=t.channel)||void 0===b?void 0:b.hidden)&&void 0!==y?y:null===(_=this.data)||void 0===_?void 0:_.hidden,own_capabilities:null!==(w=null===(S=t.channel)||void 0===S?void 0:S.own_capabilities)&&void 0!==w?w:null===(C=this.data)||void 0===C?void 0:C.own_capabilities});break;case"reaction.new":t.message&&t.reaction&&(t.message=u.addReaction(t.reaction,t.message));break;case"reaction.deleted":t.reaction&&(t.message=u.removeReaction(t.reaction,t.message));break;case"reaction.updated":t.reaction&&(t.message=u.addReaction(t.reaction,t.message,!0));break;case"channel.hidden":t.clear_history&&u.clearMessages()}void 0!==t.watcher_count&&(this.state.watcher_count=t.watcher_count)}},{key:"_checkInitialized",value:function(){if(!this.initialized&&!this.offlineMode&&!this.getClient()._isUsingServerAuth())throw Error("Channel ".concat(this.cid," hasn't been initialized yet. Make sure to call .watch() and wait for it to resolve"))}},{key:"_initializeState",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"latest",n=this.getClient(),r=n.state,i=n.user,o=n.userID;if(t.members){var s,a=lt(t.members);try{for(a.s();!(s=a.n()).done;){var c=s.value;c.user&&r.updateUserReference(c.user,this.cid)}}catch(t){a.e(t)}finally{a.f()}}this.state.membership=t.membership||{};var u=t.messages||[];this.state.messages||this.state.initMessages();var l=this.state.addMessagesSorted(u,!1,!0,!0,e),h=l.messageSet;if(this.state.pinnedMessages||(this.state.pinnedMessages=[]),this.state.addPinnedMessages(t.pinned_messages||[]),t.pending_messages&&(this.state.pending_messages=t.pending_messages),this.state.watcher_count=t.watcher_count||0,t.watchers){var p,d=lt(t.watchers);try{for(d.s();!(p=d.n()).done;){var f=p.value;f&&(r.updateUserReference(f,this.cid),this.state.watchers[f.id]=f)}}catch(t){d.e(t)}finally{d.f()}}if(null!=o){var v=this.state.last_message_at||new Date;i&&(this.state.read[i.id]={user:i,last_read:v,unread_messages:0})}if(t.read){var g,m=lt(t.read);try{for(m.s();!(g=m.n()).done;){var y,b=g.value;this.state.read[b.user.id]={last_read:new Date(b.last_read),unread_messages:null!==(y=b.unread_messages)&&void 0!==y?y:0,user:b.user},b.user.id===(null==i?void 0:i.id)&&(this.state.unreadCount=this.state.read[b.user.id].unread_messages)}}catch(t){m.e(t)}finally{m.f()}}return t.members&&(this.state.members=t.members.reduce((function(t,e){return e.user&&(t[e.user.id]=e),t}),{})),{messageSet:h}}},{key:"_extendEventWithOwnReactions",value:function(t){if(t.message){var e=this.state.findMessage(t.message.id,t.message.parent_id);e&&(t.message.own_reactions=e.own_reactions)}}},{key:"_disconnect",value:function(){this._client.logger("info","channel:disconnect() - Disconnecting the channel ".concat(this.cid),{tags:["connection","channel"],channel:this}),this.disconnected=!0,this.state.setIsUpToDate(!1)}}]),t}();function vt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return gt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gt(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t}
393,f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var mt=function(){function t(){g()(this,t),_()(this,"users",void 0),_()(this,"userChannelReferences",void 0),this.users={},this.userChannelReferences={}}return y()(t,[{key:"updateUsers",value:function(t){var e,n=vt(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.updateUser(r)}}catch(t){n.e(t)}finally{n.f()}}},{key:"updateUser",value:function(t){null!=t&&(this.users[t.id]=t)}},{key:"updateUserReference",value:function(t,e){null!=t&&(this.updateUser(t),this.userChannelReferences[t.id]||(this.userChannelReferences[t.id]={}),this.userChannelReferences[t.id][e]=!0)}},{key:"deleteAllChannelReference",value:function(t){for(var e in this.userChannelReferences)delete this.userChannelReferences[e][t]}}]),t}();function yt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function bt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?yt(Object(n),!0).forEach((function(e){_()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var _t=function t(){g()(this,t),_()(this,"connectionStartTimestamp",void 0),_()(this,"wsConsecutiveFailures",void 0),_()(this,"wsTotalFailures",void 0),_()(this,"instanceClientId",void 0),this.connectionStartTimestamp=null,this.wsTotalFailures=0,this.wsConsecutiveFailures=0,this.instanceClientId=rt()},wt=function(){var t=f()(S.a.mark((function t(e,n){var r,i;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=3,i=0;case 2:if(!(i<r)){t.next=17;break}return t.prev=3,t.next=6,E.a.post("https://chat-insights.getstream.io/insights/".concat(e),n);case 6:t.next=13;break;case 8:return t.prev=8,t.t0=t.catch(3),t.next=12,X(3e3*(i+1));case 12:return t.abrupt("continue",14);case 13:return t.abrupt("break",17);case 14:i++,t.next=2;break;case 17:case"end":return t.stop()}}),t,null,[[3,8]])})));return function(e,n){return t.apply(this,arguments)}}();function St(t,e){return bt(bt({},e),Ct(t))}function Ct(t){var e,n,r,i=t.client;return{ready_state:null===(e=t.ws)||void 0===e?void 0:e.readyState,url:t._buildUrl(),api_key:i.key,start_ts:i.insightMetrics.connectionStartTimestamp,end_ts:(new Date).getTime(),auth_type:i.getAuthType(),token:i.tokenManager.token,user_id:i.userID,user_details:i._user,device:i.options.device,client_id:t.connectionID,ws_details:t.ws,ws_consecutive_failures:i.insightMetrics.wsConsecutiveFailures,ws_total_failures:i.insightMetrics.wsTotalFailures,request_id:t.requestID,online:"undefined"!=typeof navigator?null===(n=navigator)||void 0===n?void 0:n.onLine:null,user_agent:"undefined"!=typeof navigator?null===(r=navigator)||void 0===r?void 0:r.userAgent:null,instance_client_id:i.insightMetrics.instanceClientId}}function Et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function xt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Et(Object(n),!0).forEach((function(e){_()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Et(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Tt=function(t){return void 0!==t.code},It=function(t){return void 0!==t.error},kt=function(){function t(e){var n=this,r=e.client;g()(this,t),_()(this,"client",void 0),_()(this,"connectionID",void 0),_()(this,"connectionOpen",void 0),_()(this,"consecutiveFailures",void 0),_()(this,"pingInterval",void 0),_()(this,"healthCheckTimeoutRef",void 0),_()(this,"isConnecting",void 0),_()(this,"isDisconnected",void 0),_()(this,"isHealthy",void 0),_()(this,"isResolved",void 0),_()(this,"lastEvent",void 0),_()(this,"connectionCheckTimeout",void 0),_()(this,"connectionCheckTimeoutRef",void 0),_()(this,"rejectPromise",void 0),_()(this,"requestID",void 0),_()(this,"resolvePromise",void 0),_()(this,"totalFailures",void 0),_()(this,"ws",void 0),_()(this,"wsID",void 0),_()(this,"_buildUrl",(function(){var t=encodeURIComponent(n.client._buildWSPayload(n.requestID)),e=n.client.tokenManager.getToken();return"".concat(n.client.wsBaseURL,"/connect?json=").concat(t,"&api_key=").concat(n.client.key,"&authorization=").concat(e,"&stream-auth-type=").concat(n.client.getAuthType(),"&X-Stream-Client=").concat(n.client.getUserAgent())}
393)),_()(this,"onlineStatusChanged",(function(t){"offline"===t.type?(n._log("onlineStatusChanged() - Status changing to offline"),n._setHealth(!1)):"online"===t.type&&(n._log("onlineStatusChanged() - Status changing to online. isHealthy: ".concat(n.isHealthy)),n.isHealthy||n._reconnect({interval:10}))})),_()(this,"onopen",(function(t){n.wsID===t&&n._log("onopen() - onopen callback",{wsID:t})})),_()(this,"onmessage",(function(t,e){if(n.wsID===t){n._log("onmessage() - onmessage callback",{event:e,wsID:t});var r="string"==typeof e.data?JSON.parse(e.data):null;if(!n.isResolved&&r){var i,o;if(n.isResolved=!0,r.error)return void(null===(o=n.rejectPromise)||void 0===o||o.call(n,n._errorFromWSEvent(r,!1)));null===(i=n.resolvePromise)||void 0===i||i.call(n,r),n._setHealth(!0)}n.lastEvent=new Date,r&&"health.check"===r.type&&n.scheduleNextPing(),n.client.handleEvent(e),n.scheduleConnectionCheck()}})),_()(this,"onclose",(function(t,e){if(n.wsID===t)if(n._log("onclose() - onclose callback - "+e.code,{event:e,wsID:t}),e.code===Z.WS_CLOSED_SUCCESS){var r,i=new Error("WS connection reject with error ".concat(e.reason));i.reason=e.reason,i.code=e.code,i.wasClean=e.wasClean,i.target=e.target,null===(r=n.rejectPromise)||void 0===r||r.call(n,i),n._log("onclose() - WS connection reject with error ".concat(e.reason),{event:e})}else{var o;n.consecutiveFailures+=1,n.totalFailures+=1,n._setHealth(!1),n.isConnecting=!1,null===(o=n.rejectPromise)||void 0===o||o.call(n,n._errorFromWSEvent(e)),n._log("onclose() - WS connection closed. Calling reconnect ...",{event:e}),n._reconnect()}})),_()(this,"onerror",(function(t,e){var r;n.wsID===t&&(n.consecutiveFailures+=1,n.totalFailures+=1,n._setHealth(!1),n.isConnecting=!1,null===(r=n.rejectPromise)||void 0===r||r.call(n,n._errorFromWSEvent(e)),n._log("onerror() - WS connection resulted into error",{event:e}),n._reconnect())})),_()(this,"_setHealth",(function(t){t!==n.isHealthy&&(n.isHealthy=t,n.isHealthy?n.client.dispatchEvent({type:"connection.changed",online:n.isHealthy}):setTimeout((function(){n.isHealthy||n.client.dispatchEvent({type:"connection.changed",online:n.isHealthy})}),5e3))})),_()(this,"_errorFromWSEvent",(function(t){var e,r,i,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Tt(t)&&(e=t.code,r="unknown",i=t.reason),It(t)&&(e=t.error.code,r=t.error.StatusCode,i=t.error.message),n._log("_errorFromWSEvent() - WS failed with code ".concat(e),{event:t},"warn");var s=new Error("WS failed with code ".concat(e," and reason - ").concat(i));return s.code=e,s.StatusCode=r,s.isWSFailure=o,s})),_()(this,"_setupConnectionPromise",(function(){n.isResolved=!1,n.connectionOpen=new Promise((function(t,e){n.resolvePromise=t,n.rejectPromise=e}))})),_()(this,"scheduleNextPing",(function(){n.healthCheckTimeoutRef&&clearTimeout(n.healthCheckTimeoutRef),n.healthCheckTimeoutRef=setTimeout((function(){var t=[{type:"health.check",client_id:n.client.clientID}];try{var e;null===(e=n.ws)||void 0===e||e.send(JSON.stringify(t))}catch(t){}}),n.pingInterval)})),_()(this,"scheduleConnectionCheck",(function(){n.connectionCheckTimeoutRef&&clearTimeout(n.connectionCheckTimeoutRef),n.connectionCheckTimeoutRef=setTimeout((function(){var t=new Date;n.lastEvent&&t.getTime()-n.lastEvent.getTime()>n.connectionCheckTimeout&&(n._log("scheduleConnectionCheck - going to reconnect"),n._setHealth(!1),n._reconnect())}),n.connectionCheckTimeout)})),this.client=r,this.consecutiveFailures=0,this.totalFailures=0,this.isConnecting=!1,this.isDisconnected=!1,this.isResolved=!1,this.isHealthy=!1,this.wsID=1,this.lastEvent=null,this.pingInterval=25e3,this.connectionCheckTimeout=this.pingInterval+1e4,ct(this.onlineStatusChanged)}var e,n,r,i;return y()(t,[{key:"_log",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info";this.client.logger(n,"connection:"+t,xt({tags:["connection"]},e))}},{key:"setClient",value:function(t){this.client=t}},{key:"connect",value:(i=f()(S.a.mark((function t(){var e,n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=r.length>0&&void 0!==r[0]?r[0]:15e3,!this.isConnecting){t.next=3;break}throw Error("You've called connect twice, can only attempt 1 connection at the time");case 3:return this.isDisconnected=!1,t.prev=4,t.next=7,this._connect();case 7:n=t.sent,this.consecutiveFailures=0,this._log("connect() - Established ws connection with healthcheck: ".concat(n)),t.next=23;break;case 12:if(t.prev=12,t.t0=t.catch(4),this.isHealthy=!1,this.consecutiveFailures+=1,t.t0.code!==Z.TOKEN_EXPIRED||this.client.tokenManager.isStatic()){t.next=21;break}this._log("connect() - WS failure due to expired token, so going to try to reload token and reconnect"),this._reconnect({refreshToken:!0}),t.next=23;break;case 21:if(t.t0.isWSFailure){t.next=23;break}throw new Error(JSON.stringify({code:t.t0.code,StatusCode:t.t0.StatusCode,message:t.t0.message,isWSFailure:t.t0.isWSFailure}));case 23:return t.next=25,this._waitForHealthy(e);case 25:return t.abrupt("return",t.sent);case 26:case"end":return t.stop()}}),t,this,[[4,12]])}))),function(){return i.apply(this,arguments)})},{key:"_waitForHealthy",value:(r=f()(S.a.mark((function t(){var e,n=this,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:15e3,t.abrupt("return",Promise.race([f()(S.a.mark((function t(){var r,i;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=50,i=0;case 2:if(!(i<=e)){t.next=18;break}return t.prev=3,t.next=6,n.connectionOpen;case 6:return t.abrupt("return",t.sent);case 9:if(t.prev=9,t.t0=t.catch(3),i!==e){t.next=13;break}throw new Error(JSON.stringify({code:t.t0.code,StatusCode:t.t0.StatusCode,message:t.t0.message,isWSFailure:t.t0.isWSFailure}));case 13:return t.next=15,X(r);case 15:i+=r,t.next=2;break;case 18:case"end":return t.stop()}}),t,null,[[3,9]])})))(),f()(S.a.mark((function t(){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,X(e);case 2:throw n.isConnecting=!1,new Error(JSON.stringify({code:"",StatusCode:"",message:"initial WS connection could not be established",isWSFailure:!0}));case 4:case"end":return t.stop()}}),t)})))()]));case 2:case"end":return t.stop()}}),t)}))),function(){return r.apply(this,arguments)})},{key:"disconnect",value:function(t){var e,n=this;this._log("disconnect() - Closing the websocket connection for wsID ".concat(this.wsID)),this.wsID+=1,this.isConnecting=!1,this.isDisconnected=!0,this.healthCheckTimeoutRef&&clearInterval(this.healthCheckTimeoutRef),this.connectionCheckTimeoutRef&&clearInterval(this.connectionCheckTimeoutRef),ut(this.onlineStatusChanged),this.isHealthy=!1,this.ws&&this.ws.removeAllListeners&&this.ws.removeAllListeners();var r=this.ws;return r&&r.close&&r.readyState===r.OPEN?(e=new Promise((function(e){var i=function(t){n._log("disconnect() - resolving isClosedPromise ".concat(t?"with":"without"," close frame"),{event:t}),e()};r.onclose=i,setTimeout(i,null!=t?t:1e3)})),this._log("disconnect() - Manually closed connection by calling client.disconnect()"),r.close(Z.WS_CLOSED_SUCCESS,"Manually closed connection by calling client.disconnect()")):(this._log("disconnect() - ws connection doesn't exist or it is already closed."),e=Promise.resolve()),delete this.ws,e}},{key:"_connect",value:(n=f()(S.a.mark((function t(){var e,n,r,i;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(this.isConnecting||this.isDisconnected&&this.client.options.enableWSFallback)){t.next=2;break}return t.abrupt("return");case 2:return this.isConnecting=!0,this.requestID=rt(),this.client.insightMetrics.connectionStartTimestamp=(new Date).getTime(),e=!1,t.prev=6,this._log("_connect() - waiting for token"),t.next=10,this.client.tokenManager.tokenReady();case 10:e=!0,t.next=15;break;case 13:t.prev=13,t.t0=t.catch(6);case 15:if(t.prev=15,e){t.next=20;break}return this._log("_connect() - tokenProvider failed before, so going to retry"),t.next=20,this.client.tokenManager.loadToken();case 20:return this._setupConnectionPromise(),n=this._buildUrl(),this._log("_connect() - Connecting to ".concat(n),{wsURL:n,requestID:this.requestID}),this.ws=new A.a(n),this.ws.onopen=this.onopen.bind(this,this.wsID),this.ws.onclose
393=this.onclose.bind(this,this.wsID),this.ws.onerror=this.onerror.bind(this,this.wsID),this.ws.onmessage=this.onmessage.bind(this,this.wsID),t.next=30,this.connectionOpen;case 30:if(r=t.sent,this.isConnecting=!1,!r){t.next=36;break}return this.connectionID=r.connection_id,this.client.insightMetrics.wsConsecutiveFailures>0&&this.client.options.enableInsights&&(wt("ws_success_after_failure",Ct(this)),this.client.insightMetrics.wsConsecutiveFailures=0),t.abrupt("return",r);case 36:t.next=44;break;case 38:throw t.prev=38,t.t1=t.catch(15),this.isConnecting=!1,this._log("_connect() - Error - ",t.t1),this.client.options.enableInsights&&(this.client.insightMetrics.wsConsecutiveFailures++,this.client.insightMetrics.wsTotalFailures++,i=St(this,at(t.t1)),null==wt||wt("ws_fatal",i)),t.t1;case 44:case"end":return t.stop()}}),t,this,[[6,13],[15,38]])}))),function(){return n.apply(this,arguments)})},{key:"_reconnect",value:(e=f()(S.a.mark((function t(){var e,n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=r.length>0&&void 0!==r[0]?r[0]:{},this._log("_reconnect() - Initiating the reconnect"),!this.isConnecting&&!this.isHealthy){t.next=5;break}return this._log("_reconnect() - Abort (1) since already connecting or healthy"),t.abrupt("return");case 5:return(n=e.interval)||(n=nt(this.consecutiveFailures)),t.next=9,X(n);case 9:if(!this.isConnecting&&!this.isHealthy){t.next=12;break}return this._log("_reconnect() - Abort (2) since already connecting or healthy"),t.abrupt("return");case 12:if(!this.isDisconnected||!this.client.options.enableWSFallback){t.next=15;break}return this._log("_reconnect() - Abort (3) since disconnect() is called"),t.abrupt("return");case 15:if(this._log("_reconnect() - Destroying current WS connection"),this._destroyCurrentWSConnection(),!e.refreshToken){t.next=20;break}return t.next=20,this.client.tokenManager.loadToken();case 20:return t.prev=20,t.next=23,this._connect();case 23:return this._log("_reconnect() - Waiting for recoverCallBack"),t.next=26,this.client.recoverState();case 26:this._log("_reconnect() - Finished recoverCallBack"),this.consecutiveFailures=0,t.next=38;break;case 30:if(t.prev=30,t.t0=t.catch(20),this.isHealthy=!1,this.consecutiveFailures+=1,t.t0.code!==Z.TOKEN_EXPIRED||this.client.tokenManager.isStatic()){t.next=37;break}return this._log("_reconnect() - WS failure due to expired token, so going to try to reload token and reconnect"),t.abrupt("return",this._reconnect({refreshToken:!0}));case 37:t.t0.isWSFailure&&(this._log("_reconnect() - WS failure, so going to try to reconnect"),this._reconnect());case 38:this._log("_reconnect() - == END ==");case 39:case"end":return t.stop()}}),t,this,[[20,30]])}))),function(){return e.apply(this,arguments)})},{key:"_destroyCurrentWSConnection",value:function(){this.wsID+=1;try{var t,e;null==this||null===(t=this.ws)||void 0===t||t.removeAllListeners(),null==this||null===(e=this.ws)||void 0===e||e.close()}catch(t){}}}]),t}(),Ot=null,At=null;function Rt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Nt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("string"!=typeof e)throw new TypeError("userId should be a string");!function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Rt(Object(n),!0).forEach((function(e){_()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Rt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}}({user_id:e},n);throw Error("Unable to find jwt crypto, if you are getting this error is probably because you are trying to generate tokens on browser or React Native (or other environment where crypto functions are not available). Please Note: token should only be generated server-side.")}function Pt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=s()({algorithm:"HS256",noTimestamp:!0},e);return Ot.sign({server:!0},t,n)}var Mt,Dt=function t(e){var n=this;g()(this,t),_()(this,"loadTokenPromise",void 0),_()(this,"type",void 0),_()(this,"secret",void 0),_()(this,"token",void 0),_()(this,"tokenProvider",void 0),_()(this,"user",void 0),_()(this,"setTokenOrProvider",function(){var t=f()(S.a.mark((function t(e,r){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.validateToken(e,r),n.user=r,J(e)&&(n.tokenProvider=e,n.type="provider"),"string"==typeof e&&(n.token=e,n.type="static"),!e&&n.user&&n.secret&&(n.token=Nt(n.secret,r.id,{},{}),n.type="static"),t.next=7,n.loadToken();case 7:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()),_()(this,"reset",(function(){n.token=void 0,n.user=void 0,n.loadTokenPromise=null})),_()(this,"validateToken",(function(t,e){if(!e||!e.anon||t){if(!n.secret&&!t)throw new Error("User token can not be empty");if(t&&"string"!=typeof t&&!J(t))throw new Error("user token should either be a string or a function");if("string"==typeof t){if(e.anon&&""===t)return;var r=function(t){var e=t.split(".");if(3!==e.length)return"";var n=e[1],r=W(n);return JSON.parse(r).user_id}(t);if(null!=t&&(null==r||""===r||r!==e.id))throw new Error("userToken does not have a user_id or is not matching with user.id")}}})),_()(this,"tokenReady",(function(){return n.loadTokenPromise})),_()(this,"loadToken",(function(){return n.loadTokenPromise=new Promise(function(){var t=f()(S.a.mark((function t(e,r){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("static"!==n.type){t.next=2;break}return t.abrupt("return",e(n.token));case 2:if(!n.tokenProvider||"string"==typeof n.tokenProvider){t.next=13;break}return t.prev=3,t.next=6,n.tokenProvider();case 6:n.token=t.sent,t.next=12;break;case 9:return t.prev=9,t.t0=t.catch(3),t.abrupt("return",r(new Error("Call to tokenProvider failed with message: ".concat(t.t0))));case 12:e(n.token);case 13:case"end":return t.stop()}}),t,null,[[3,9]])})));return function(e,n){return t.apply(this,arguments)}}()),n.loadTokenPromise})),_()(this,"getToken",(function(){if(n.token)return n.token;if(n.user&&n.user.anon&&!n.token)return n.token;if(n.secret)return Pt(n.secret);throw new Error("Both secret and user tokens are not set. Either client.connectUser wasn't called or client.disconnect was called")})),_()(this,"isStatic",(function(){return"static"===n.type})),this.loadTokenPromise=null,e&&(this.secret=e),this.type="static",this.secret&&(this.token=Pt(this.secret))},Lt={"-1":{name:"InternalSystemError",retryable:!0}
393,2:{name:"AccessKeyError",retryable:!1},3:{name:"AuthenticationFailedError",retryable:!0},4:{name:"InputError",retryable:!1},6:{name:"DuplicateUsernameError",retryable:!1},9:{name:"RateLimitError",retryable:!0},16:{name:"DoesNotExistError",retryable:!1},17:{name:"NotAllowedError",retryable:!1},18:{name:"EventNotSupportedError",retryable:!1},19:{name:"ChannelFeatureNotSupportedError",retryable:!1},20:{name:"MessageTooLongError",retryable:!1},21:{name:"MultipleNestingLevelError",retryable:!1},22:{name:"PayloadTooBigError",retryable:!1},23:{name:"RequestTimeoutError",retryable:!0},24:{name:"MaxHeaderSizeExceededError",retryable:!1},40:{name:"AuthErrorTokenExpired",retryable:!1},41:{name:"AuthErrorTokenNotValidYet",retryable:!1},42:{name:"AuthErrorTokenUsedBeforeIssuedAt",retryable:!1},43:{name:"AuthErrorTokenSignatureInvalid",retryable:!1},44:{name:"CustomCommandEndpointMissingError",retryable:!1},45:{name:"CustomCommandEndpointCallError",retryable:!0},46:{name:"ConnectionIDNotFoundError",retryable:!1},60:{name:"CoolDownError",retryable:!0},69:{name:"ErrWrongRegion",retryable:!1},70:{name:"ErrQueryChannelPermissions",retryable:!1},71:{name:"ErrTooManyConnections",retryable:!0},99:{name:"AppSuspendedError",retryable:!1}};function jt(t){return void 0!==t.code}function Ut(t){if(!t.code)return!1;var e=Lt["".concat(t.code)];return!!e&&e.retryable}function Ft(t){if("boolean"==typeof t.isWSFailure)return t.isWSFailure;try{return JSON.parse(t.message).isWSFailure}catch(t){return!1}}function Ht(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Bt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ht(Object(n),!0).forEach((function(e){_()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ht(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}!function(t){t.Closed="CLOSED",t.Connected="CONNECTED",t.Connecting="CONNECTING",t.Disconnected="DISCONNECTED",t.Init="INIT"}(Mt||(Mt={}));var qt=function(){function t(e){var n=this,r=e.client;g()(this,t),_()(this,"client",void 0),_()(this,"state",void 0),_()(this,"consecutiveFailures",void 0),_()(this,"connectionID",void 0),_()(this,"cancelToken",void 0),_()(this,"_onlineStatusChanged",(function(t){var e;if(n._log("_onlineStatusChanged() - ".concat(t.type)),"offline"===t.type)return n._setState(Mt.Closed),null===(e=n.cancelToken)||void 0===e||e.cancel("disconnect() is called"),void(n.cancelToken=void 0);"online"===t.type&&n.state===Mt.Closed&&n.connect(!0)})),_()(this,"_req",function(){var t=f()(S.a.mark((function t(e,r,i){var o,s;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.cancelToken||e.close||(n.cancelToken=E.a.CancelToken.source()),t.prev=1,t.next=4,n.client.doAxiosRequest("get",n.client.baseURL.replace(":3030",":8900")+"/longpoll",void 0,{config:Bt(Bt({},r),{},{cancelToken:null===(o=n.cancelToken)||void 0===o?void 0:o.token}),params:e});case 4:return s=t.sent,n.consecutiveFailures=0,t.abrupt("return",s);case 9:if(t.prev=9,t.t0=t.catch(1),n.consecutiveFailures+=1,!i||!Ut(t.t0)){t.next=17;break}return n._log("_req() - Retryable error, retrying request"),t.next=16,X(nt(n.consecutiveFailures));case 16:return t.abrupt("return",n._req(e,r,i));case 17:throw t.t0;case 18:case"end":return t.stop()}}),t,null,[[1,9]])})));return function(e,n,r){return t.apply(this,arguments)}}()),_()(this,"_poll",f()(S.a.mark((function t(){var e,r,i;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.state!==Mt.Connected){t.next=25;break}return t.prev=1,t.next=4,n._req({},{timeout:3e4},!0);case 4:if(r=t.sent,null!==(e=r.events)&&void 0!==e&&e.length)for(i=0;i<r.events.length;i++)n.client.dispatchEvent(r.events[i]);t.next=23;break;case 8:if(t.prev=8,t.t0=t.catch(1),!E.a.isCancel(t.t0)){t.next=13;break}return n._log("_poll() - axios canceled request"),t.abrupt("return");case 13:if(46!==t.t0.code){t.next=18;break}return n._log("_poll() - ConnectionID error, connecting without ID..."),n._setState(Mt.Disconnected),n.connect(!0),t.abrupt("return");case 18:if(!jt(t.t0)||Ut(t.t0)){t.next=21;break}return n._setState(Mt.Closed),t.abrupt("return");case 21:return t.next=23,X(nt(n.consecutiveFailures));case 23:t.next=0;break;case 25:case"end":return t.stop()}}),t,null,[[1,8]])})))),_()(this,"connect",f()(S.a.mark((function t(){var e,r,i,o=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=o.length>0&&void 0!==o[0]&&o[0],n.state!==Mt.Connecting){t.next=4;break}return n._log("connect() - connecting already in progress",{reconnect:e},"warn"),t.abrupt("return");case 4:if(n.state!==Mt.Connected){t.next=7;break}return n._log("connect() - already connected and polling",{reconnect:e},"warn"),t.abrupt("return");case 7:return n._setState(Mt.Connecting),n.connectionID=void 0,t.prev=9,t.next=12,n._req({json:n.client._buildWSPayload()},{timeout:8e3},e);case 12:return r=t.sent,i=r.event,n._setState(Mt.Connected),n.connectionID=i.connection_id,n.client.dispatchEvent(i),n._poll(),e&&n.client.re
393coverState(),t.abrupt("return",i);case 22:throw t.prev=22,t.t0=t.catch(9),n._setState(Mt.Closed),t.t0;case 26:case"end":return t.stop()}}),t,null,[[9,22]])})))),_()(this,"isHealthy",(function(){return!!n.connectionID&&n.state===Mt.Connected})),_()(this,"disconnect",f()(S.a.mark((function t(){var e,r,i,o=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>0&&void 0!==o[0]?o[0]:2e3,ut(n._onlineStatusChanged),n._setState(Mt.Disconnected),null===(e=n.cancelToken)||void 0===e||e.cancel("disconnect() is called"),n.cancelToken=void 0,i=n.connectionID,n.connectionID=void 0,t.prev=7,t.next=10,n._req({close:!0,connection_id:i},{timeout:r},!1);case 10:n._log("disconnect() - Closed connectionID"),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(7),n._log("disconnect() - Failed",{err:t.t0},"error");case 16:case"end":return t.stop()}}),t,null,[[7,13]])})))),this.client=r,this.state=Mt.Init,this.consecutiveFailures=0,ct(this._onlineStatusChanged)}return y()(t,[{key:"_log",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info";this.client.logger(n,"WSConnectionFallback:"+t,Bt({tags:["connection_fallback","connection"]},e))}},{key:"_setState",value:function(t){this._log("_setState() - ".concat(t)),this.state===Mt.Connecting&&t===Mt.Connected&&this.client.dispatchEvent({type:"connection.changed",online:!0}),t!==Mt.Closed&&t!==Mt.Disconnected||this.client.dispatchEvent({type:"connection.changed",online:!1}),this.state=t}}]),t}();function Vt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=U()(t);if(e){var i=U()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return L()(this,n)}}var Wt=function(t){M()(n,t);var e=Vt(n);function n(){var t;g()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),_()(N()(t),"code",void 0),_()(N()(t),"response",void 0),_()(N()(t),"status",void 0),t}return n}(H()(Error)),zt=["created_at","updated_at","last_active","online"];function $t(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Yt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yt(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function Yt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Kt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Gt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Kt(Object(n),!0).forEach((function(e){_()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Qt(t){return"string"==typeof t||t instanceof String}var Xt=function(){function e(t,n,i){var o,s=this;g()(this,e),_()(this,"_user",void 0),_()(this,"activeChannels",void 0),_()(this,"anonymous",void 0),_()(this,"persistUserOnConnectionFailure",void 0),_()(this,"axiosInstance",void 0),_()(this,"baseURL",void 0),_()(this,"browser",void 0),_()(this,"cleaningIntervalRef",void 0),_()(this,"clientID",void 0),_()(this,"configs",void 0),_()(this,"key",void 0),_()(this,"listeners",void 0),_()(this,"logger",void 0),_()(this,"recoverStateOnReconnect",void 0),_()(this,"mutedChannels",void 0),_()(this,"mutedUsers",void 0),_()(this,"node",void 0),_()(this,"options",void 0),_()(this,"secret",void 0),_()(this,"setUserPromise",void 0),_()(this,"state",void 0),_()(this,"tokenManager",void 0),_()(this,"user",void 0),_()(this,"userAgent",void 0),_()(this,"userID",void 0),_()(this,"wsBaseURL",void 0),_()(this,"wsConnection",void 0),_()(this,"wsFallback",void 0),_()(this,"wsPromise",void 0),_()(this,"consecutiveFailures",void 0),_()(this,"insightMetrics",void 0),_()(this,"defaultWSTimeoutWithFallback",void 0),_()(this,"defaultWSTimeout",void 0),_()(this,"nextRequestAbortController",null),_()(this,"_getConnectionID",(function(){var t,e;return(null===(t=s.wsConnection)||void 0===t?void 0:t.connectionID)||(null===(e=s.wsFallback)||void 0===e?void 0:e.connectionID)}
393)),_()(this,"_hasConnectionID",(function(){return Boolean(s._getConnectionID())})),_()(this,"connectUser",function(){var t=f()(S.a.mark((function t(e,n){var r,i;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.id){t.next=2;break}throw new Error('The "id" field on the user is missing');case 2:if(s.userID!==e.id||!s.setUserPromise){t.next=5;break}return console.warn("Consecutive calls to connectUser is detected, ideally you should only call this function once in your app."),t.abrupt("return",s.setUserPromise);case 5:if(!s.userID){t.next=7;break}throw new Error("Use client.disconnect() before trying to connect as a different user. connectUser was called twice.");case 7:return!s._isUsingServerAuth()&&!s.node||s.options.allowServerSideConnect||console.warn('Please do not use connectUser server side. connectUser impacts MAU and concurrent connection usage and thus your bill. If you have a valid use-case, add "allowServerSideConnect: true" to the client options to disable this warning.'),s.userID=e.id,s.anonymous=!1,r=s._setToken(e,n),s._setUser(e),i=s.openConnection(),s.setUserPromise=Promise.all([r,i]).then((function(t){return t[1]})),t.prev=14,t.next=17,s.setUserPromise;case 17:return t.abrupt("return",t.sent);case 20:throw t.prev=20,t.t0=t.catch(14),s.persistUserOnConnectionFailure?s.closeConnection():s.disconnectUser(),t.t0;case 24:case"end":return t.stop()}}),t,null,[[14,20]])})));return function(e,n){return t.apply(this,arguments)}}()),_()(this,"setUser",this.connectUser),_()(this,"_setToken",(function(t,e){return s.tokenManager.setTokenOrProvider(e,t)})),_()(this,"closeConnection",function(){var t=f()(S.a.mark((function t(e){var n,r;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return null!=s.cleaningIntervalRef&&(clearInterval(s.cleaningIntervalRef),s.cleaningIntervalRef=void 0),t.next=3,Promise.all([null===(n=s.wsConnection)||void 0===n?void 0:n.disconnect(e),null===(r=s.wsFallback)||void 0===r?void 0:r.disconnect(e)]);case 3:return t.abrupt("return",Promise.resolve());case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),_()(this,"openConnection",f()(S.a.mark((function t(){var e,n,r;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s.userID){t.next=2;break}throw Error("User is not set on client, use client.connectUser or client.connectAnonymousUser instead");case 2:if(null===(e=s.wsConnection)||void 0===e||!e.isConnecting||!s.wsPromise){t.next=5;break}return s.logger("info","client:openConnection() - connection already in progress",{tags:["connection","client"]}),t.abrupt("return",s.wsPromise);case 5:if(!(null!==(n=s.wsConnection)&&void 0!==n&&n.isHealthy||null!==(r=s.wsFallback)&&void 0!==r&&r.isHealthy())||!s._hasConnectionID()){t.next=8;break}return s.logger("info","client:openConnection() - openConnection called twice, healthy connection already exists",{tags:["connection","client"]}),t.abrupt("return",Promise.resolve());case 8:return s.clientID="".concat(s.userID,"--").concat(rt()),s.wsPromise=s.connect(),s._startCleaning(),t.abrupt("return",s.wsPromise);case 12:case"end":return t.stop()}}),t)})))),_()(this,"_setupConnection",this.openConnection),_()(this,"_normalizeDate",(function(t){if(t instanceof Date&&(t=t.toISOString()),""===t)throw new Error("Don't pass blank string for since, use null instead if resetting the token revoke");return t})),_()(this,"disconnectUser",function(){var t=f()(S.a.mark((function t(e){var n,r,i;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(s.logger("info","client:disconnect() - Disconnecting the client",{tags:["connection","client"]}),delete s.user,delete s._user,delete s.userID,s.anonymous=!1,n=s.closeConnection(e),r=0,i=Object.values(s.activeChannels);r<i.length;r++)i[r]._disconnect();return s.activeChannels={},s.state=new mt,setTimeout(s.tokenManager.reset),t.abrupt("return",n);case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),_()(this,"disconnect",this.disconnectUser),_()(this,"connectAnonymousUser",(function(){!s._isUsingServerAuth()&&!s.node||s.options.allowServerSideConnect||console.warn('Please do not use connectUser server side. connectUser impacts MAU and concurrent connection usage and thus your bill. If you have a valid use-case, add "allowServerSideConnect: true" to the client options to disable this warning.'),s.anonymous=!0,s.userID=rt();var t={id:s.userID,anon:!0};return s._setToken(t,""),s._setUser(t),s._setupConnection()})),_()(this,"setAnonymousUser",this.connectAnonymousUser),_()(this,"doAxiosRequest",function(){var t=f()(S.a.mark((function t(e,n,r){var i,o,a,c,u=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=u.length>3&&void 0!==u[3]?u[3]:{},t.next=3,s.tokenManager.tokenReady();case 3:o=s._enrichAxiosOptions(i),t.prev=4,s._logApiRequest(e,n,r,o),t.t0=e,t.next="get"===t.t0?9:"delete"===t.t0?13:"post"===t.t0?17:"put"===t.t0?21:"patch"===t.t0?25:"options"===t.t0?29:33;break;case 9:return t.next=11,s.axiosInstance.get(n,o);case 11:return a=t.sent,t.abrupt("break",34);case 13:return t.next=15,s.axiosInstance.delete(n,o);case 15:return a=t.sent,t.abrupt("break",34);case 17:return t.next=19,s.axiosInstance.post(n,r,o);case 19:return a=t.sent,t.abrupt("break",34);case 21:return t.next=23,s.axiosInstance.put(n,r,o);case 23:return a=t.sent,t.abrupt("break",34);case 25:return t.next=27,s.axiosInstance.patch(n,r,o);case 27:return a=t.sent,t.abrupt("break",34);case 29:return t.next=31,s.axiosInstance.options(n,o);case 31:return a=t.sent,t.abrupt("break",34);case 33:throw new Error("Invalid request type");case 34:return s._logApiResponse(e,n,a),s.consecutiveFailures=0,t.abrupt("return",s.handleResponse(a
393));case 39:if(t.prev=39,t.t1=t.catch(4),t.t1.client_request_id=null===(c=o.headers)||void 0===c?void 0:c["x-client-request-id"],s._logApiError(e,n,t.t1),s.consecutiveFailures+=1,!t.t1.response){t.next=56;break}if(t.t1.response.data.code!==Z.TOKEN_EXPIRED||s.tokenManager.isStatic()){t.next=53;break}if(!(s.consecutiveFailures>1)){t.next=49;break}return t.next=49,X(nt(s.consecutiveFailures));case 49:return s.tokenManager.loadToken(),t.next=52,s.doAxiosRequest(e,n,r,i);case 52:return t.abrupt("return",t.sent);case 53:return t.abrupt("return",s.handleResponse(t.t1.response));case 56:throw t.t1;case 57:case"end":return t.stop()}}),t,null,[[4,39]])})));return function(e,n,r){return t.apply(this,arguments)}}()),_()(this,"dispatchEvent",(function(t){t.received_at||(t.received_at=new Date);var e=s._handleClientEvent(t),n=t.cid,r=n?s.activeChannels[n]:void 0;r&&r._handleChannelEvent(t),s._callClientListeners(t),r&&r._callChannelListeners(t),e.forEach((function(t){return t()}))})),_()(this,"handleEvent",(function(t){var e=t.data,n=JSON.parse(e);s.dispatchEvent(n)})),_()(this,"_updateMemberWatcherReferences",(function(t){var e=s.state.userChannelReferences[t.id]||{};for(var n in e){var r=s.activeChannels[n];null!=r&&r.state&&(r.state.members[t.id]&&(r.state.members[t.id].user=t),r.state.watchers[t.id]&&(r.state.watchers[t.id]=t))}})),_()(this,"_updateUserReferences",this._updateMemberWatcherReferences),_()(this,"_updateUserMessageReferences",(function(t){var e=s.state.userChannelReferences[t.id]||{};for(var n in e){var r=s.activeChannels[n].state;null==r||r.updateUserMessages(t)}})),_()(this,"_deleteUserMessageReference",(function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=s.state.userChannelReferences[t.id]||{};for(var r in n){var i=s.activeChannels[r],o=i.state;null==o||o.deleteUserMessages(t,e)}})),_()(this,"_handleUserEvent",(function(t){if(t.user){if("user.presence.changed"===t.type||"user.updated"===t.type){if(t.user.id===s.userID){var e=Gt({},s.user||{}),n=Gt({},s._user||{});for(var r in s.user)r in t.user||{channel_mutes:!0,devices:!0,mutes:!0,total_unread_count:!0,unread_channels:!0,unread_count:!0,invisible:!0,roles:!0}[r]||(delete e[r],delete n[r]);for(var i in t.user)n&&i in n&&(n[i]=t.user[i]);s._user=Gt({},n),s.user=Gt(Gt({},e),t.user)}s.state.updateUser(t.user),s._updateMemberWatcherReferences(t.user)}"user.updated"===t.type&&s._updateUserMessageReferences(t.user),"user.deleted"===t.type&&t.user.deleted_at&&(t.mark_messages_deleted||t.hard_delete)&&s._deleteUserMessageReference(t.user,t.hard_delete)}})),_()(this,"_callClientListeners",(function(t){var e=s,n=[];e.listeners.all&&n.push.apply(n,p()(e.listeners.all)),e.listeners[t.type]&&n.push.apply(n,p()(e.listeners[t.type]));for(var r=0,i=n;r<i.length;r++){(0,i[r])(t)}})),_()(this,"recoverState",f()(S.a.mark((function t(){var e;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s.logger("info","client:recoverState() - Start of recoverState with connectionID ".concat(s._getConnectionID()),{tags:["connection"]}),!(e=Object.keys(s.activeChannels)).length||!s.recoverStateOnReconnect){t.next=10;break}return s.logger("info","client:recoverState() - Start the querying of ".concat(e.length," channels"),{tags:["connection","client"]}),t.next=6,s.queryChannels({cid:{$in:e}},{last_message_at:-1},{limit:30});case 6:s.logger("info","client:recoverState() - Querying channels finished",{tags:["connection","client"]}),s.dispatchEvent({type:"connection.recovered"}),t.next=11;break;case 10:s.dispatchEvent({type:"connection.recovered"});case 11:s.wsPromise=Promise.resolve(),s.setUserPromise=Promise.resolve();case 13:case"end":return t.stop()}}),t)})))),_()(this,"getChannelByMembers",(function(t,e){var n=p()(e.members||[]).sort().join(","),r="".concat(t,":!members-").concat(n);if(!n)throw Error("Please specify atleast one member when creating unique conversation");for(var i in s.activeChannels){var o=s.activeChannels[i];if(!o.disconnected){if(i===r)return o;if(0===i.indexOf("".concat(t,":!members-")))if(Object.keys(o.state.members).sort().join(",")===n)return o}}var a=new ft(s,t,void 0,e);return s.activeChannels[r]=a,a})),_()(this,"getChannelById",(function(t,e,n){if("string"==typeof e&&~e.indexOf(":"))throw Error("Invalid channel id ".concat(e,", can't contain the : character"));var r="".concat(t,":").concat(e);
393if(r in s.activeChannels&&!s.activeChannels[r].disconnected){var i=s.activeChannels[r];return Object.keys(n).length>0&&(i.data=n,i._data=n),i}var o=new ft(s,t,e,n);return s.activeChannels[o.cid]=o,o})),_()(this,"updateUsers",this.upsertUsers),_()(this,"updateUser",this.upsertUser),_()(this,"markAllRead",this.markChannelsRead),_()(this,"_isUsingServerAuth",(function(){return!!s.secret})),_()(this,"_buildWSPayload",(function(t){return JSON.stringify({user_id:s.userID,user_details:s._user,device:s.options.device,client_request_id:t})})),this.key=t,this.listeners={},this.state=new mt,this.mutedChannels=[],this.mutedUsers=[],n&&Qt(n)&&(this.secret=n);var a=i||(n&&!Qt(n)?n:{});this.browser=void 0!==a.browser?a.browser:"undefined"!=typeof window,this.node=!this.browser,this.options=Gt({timeout:3e3,withCredentials:!1,warmUp:!1,recoverStateOnReconnect:!0},a),this.node&&!this.options.httpsAgent&&(this.options.httpsAgent=new z.Agent({keepAlive:!0,keepAliveMsecs:3e3})),this.axiosInstance=E.a.create(this.options),this.setBaseURL(this.options.baseURL||"https://chat.stream-io-api.com"),void 0!==r&&r.env.STREAM_LOCAL_TEST_RUN&&this.setBaseURL("http://localhost:3030"),void 0!==r&&r.env.STREAM_LOCAL_TEST_HOST&&this.setBaseURL("http://"+r.env.STREAM_LOCAL_TEST_HOST),this.wsConnection=null,this.wsPromise=null,this.setUserPromise=null,this.activeChannels={},this.configs={},this.anonymous=!1,this.persistUserOnConnectionFailure=null===(o=this.options)||void 0===o?void 0:o.persistUserOnConnectionFailure,this.tokenManager=new Dt(this.secret),this.consecutiveFailures=0,this.insightMetrics=new _t,this.defaultWSTimeoutWithFallback=6e3,this.defaultWSTimeout=15e3,this.logger=J(a.logger)?a.logger:function(){return null},this.recoverStateOnReconnect=this.options.recoverStateOnReconnect}var n,i,o,a,u,h,d,v,m,b,w,C,x,T,I,k,O,A,R,N,P,M,D,L,j,U,F,H,B,q,W,$,Y,K,G,Q,it,ot,st,at,ct,ut,lt,ht,pt,dt,vt,gt,yt,bt,St,Ct,Et,xt,Tt,It,Ot,Rt,Pt,Mt,Lt,jt,Ut,Ht,Bt,Vt,Yt,Kt,Xt,Jt,Zt;return y()(e,[{key:"devToken",value:function(t){return e=t,["eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",V(JSON.stringify({user_id:e})),"devtoken"].join(".");var e}},{key:"getAuthType",value:function(){return this.anonymous?"anonymous":"jwt"}},{key:"setBaseURL",value:function(t){this.baseURL=t,this.wsBaseURL=this.baseURL.replace("http","ws").replace(":3030",":8800")}},{key:"_setUser",value:function(t){this.user=t,this.userID=t.id,this._user=Gt({},t)}},{key:"updateAppSettings",value:(Zt=f()(S.a.mark((function e(n){var r;return S.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null!=(r=n.apn_config)&&r.p12_cert&&(n=Gt(Gt({},n),{},{apn_config:Gt(Gt({},r),{},{p12_cert:t.from(r.p12_cert).toString("base64")})})),e.next=4,this.patch(this.baseURL+"/app",n);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)}))),function(t){return Zt.apply(this,arguments)})},{key:"revokeTokens",value:(Jt=f()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.updateAppSettings({revoke_tokens_issued_before:this._normalizeDate(e)});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return Jt.apply(this,arguments)})},{key:"revokeUserToken",value:(Xt=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.revokeUsersToken([e],n);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return Xt.apply(this,arguments)})},{key:"revokeUsersToken",value:(Kt=f()(S.a.mark((function t(e,n){var r,i,o,s;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=void 0===n?(new Date).toISOString():this._normalizeDate(n),r=[],i=$t(e);try{for(i.s();!(o=i.n()).done;)s=o.value,r.push({id:s,set:{revoke_tokens_issued_before:n}})}catch(t){i.e(t)}finally{i.f()}return t.next=6,this.partialUpdateUsers(r);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)}))),function(t,e){return Kt.apply(this,arguments)})},{key:"getAppSettings",value:(Yt=f()(S.a.mark((function t(){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.get(this.baseURL+"/app");case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(){return Yt.apply(this,arguments)})},{key:"testPushSettings",value:(Vt=f()(S.a.mark((function t(e){var n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=3,this.post(this.baseURL+"/check_push",Gt(Gt(Gt(Gt(Gt(Gt(Gt({user_id:e},n.messageID?{message_id:n.messageID}:{}),n.apnTemplate?{apn_template:n.apnTemplate}:{}),n.firebaseTemplate?{firebase_template:n.firebaseTemplate}:{}),n.firebaseDataTemplate?{firebase_data_template:n.firebaseDataTemplate}:{}),n.skipDevices?{skip_devices:!0}:{}),n.pushProviderName?{push_provider_name:n.pushProviderName}:{}),n.pushProviderType?{push_provider_type:n.pushProviderType}:{}));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return Vt.apply(this,arguments)})},{key:"testSQSSettings",value:(Bt=f()(S.a.mark((function t(){var e,n=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},t.next=3,this.post(this.baseURL+"/check_sqs",e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(){return Bt.apply(this,arguments)})},{key:"setGuestUser",value:(Ht=f()(S.a.mark((function t(e){var n,r,i;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.anonymous=!0,t.prev=1,t.next=4,this.post(this.baseURL+"/guest",{user:e});case 4:n=t.sent,t.next=11;break;case 7:throw t.prev=7,t.t0=t.catch(1),this.anonymous=!1,t.t0;case 11:return this.anonymous=!1,(r=n.user).created_at,r.updated_at,r.last_active,r.online,i=l()(r,zt),t.next=15,this.connectUser(i,n.access_token);case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}}),t,this,[[1,7]])}))),function(t){return Ht.apply(this,arguments)})},{key:"createToken",value:function(t,e,n){if(null==this.secret)throw Error("tokens can only be created server-side using the API Secret");var r={};return e&&(r.exp=e),n&&(r.iat=n),Nt(this.secret,t,r,{})}},{key:"on",value:function(t,e){var n=this,r=e?t:"all",i=e||t;return r in this.listeners||(this.listeners[r]=[]),this.logger("info","Attaching listener for ".concat(r," event"),{tags:["event","client"]}),this.listeners[r].push(i),{unsubscribe:function(){n.logger("info","Removing listener for ".concat(r," event"),{tags:["event","client"]}),n.listeners[r]=n.listeners[r].filter((function(t){return t!==i}))}}}},{key:"off",value:function(t,e){var n=e?t:"all",r=e||t;n in this.listeners||(this.listeners[n]=[]),this.logger("info","Removing listener for ".concat(n," event"),{tags:["event","client"]}),this.listeners[n]=this.listeners[n].filter((function(t){return t!==r}))}},{key:"_logApiRequest",value:function(t,e,n,r){this.logger("info","client: ".concat(t," - Request - ").concat(e),{tags:["api","api_request","client"],url:e,payload:n,config:r})}},{key:"_logApiResponse",value:function(t,e,n){this.logger("info","client:".concat(t," - Response - url: ").concat(e," > status ").concat(n.status),{tags:["api","api_response","client"],url:e,response:n})}},{key:"_logApiError",value:function(t,e,n){this.logger("error","client:".concat(t," - Error - url: ").concat(e),{tags:["api","api_response","client"],url:e,error:n})}},{key:"get",value:function(t,e){return this.doAxiosRequest("get",t,null,{params:e})}},{key:"put",value:function(t,e){return this.doAxiosRequest("put",t,e)}},{key:"post",value:function(t,e){return this.doAxiosRequest("post",t,e)}},{key:"patch",value:function(t,e){return this.doAxiosRequest("patch",t,e)}},{key:"delete",value:function(t,e){return this.doAxiosRequest("delete",t,null,{params:e})}},{key:"sendFile",value:function(t,e,n,r,i){var o=tt(e,n,r);return null!=i&&o.append("user",JSON.stringify(i)),this.doAxiosRequest("post",t,o,{headers:o.getHeaders?o.getHeaders():{},config:{timeout:0,maxContentLength:1/0,maxBodyLength:1/0}})}},{key:"errorFromResponse",value:function(t){var e;return e=new Wt("StreamChat error HTTP code: ".concat(t.status)),t.data&&t.data.code&&((e=new Error("StreamChat error code ".concat(t.data.code,": ").concat(t.data.message))).code=t.data.code),e.response=t,e.status=t.status,e}},{key:"handleResponse",value:function(t){var e,n=t.data;if(!(e=t).status||e.status<200||300<=e.status)throw this.errorFromResponse(t);return n}},{key:"_handleClientEvent",value:function(t){var e,n,r,i=this,o=[];if(this.logger("info","client:_handleClientEvent - Received event of type { ".concat(t.type," }"),{tags:["event","client"],event:t}),"user.presence.changed"!==t.type&&"user.updated"!==t.type&&"user.deleted"!==t.type||this._handleUserEvent(t),"health.check"===t.type&&t.me&&(this.user=t.me,this.state.updateUser(t.me),this.mutedChannels=t.me.channel_mutes,this.mutedUsers=t.me.mutes),t.channel&&"notification.message_new"===t.type&&this._addChannelConfig(t.channel),"notification.channel_mutes_updated"===t.type&&null!==(e=t.me)&&void 0!==e&&e.channel_mutes){var s=[],a=[];
393this.mutedChannels.forEach((function(t){return t.channel&&s.push(t.channel.cid)})),t.me.channel_mutes.forEach((function(t){return t.channel&&a.push(t.channel.cid)})),s.forEach((function(t){!a.includes(t)&&i.activeChannels[t]&&(i.activeChannels[t].state.unreadCount=0)})),this.mutedChannels=t.me.channel_mutes}("notification.mutes_updated"===t.type&&null!==(n=t.me)&&void 0!==n&&n.mutes&&(this.mutedUsers=t.me.mutes),"notification.mark_read"===t.type&&0===t.unread_channels)&&Object.keys(this.activeChannels).forEach((function(t){return i.activeChannels[t].state.unreadCount=0}));"channel.deleted"!==t.type&&"notification.channel_deleted"!==t.type||!t.cid||(this.state.deleteAllChannelReference(t.cid),null===(r=this.activeChannels[t.cid])||void 0===r||r._disconnect(),o.push((function(){t.cid&&delete i.activeChannels[t.cid]})));return o}},{key:"_muteStatus",value:function(t){for(var e,n=0;n<this.mutedChannels.length;n++){var r,i=this.mutedChannels[n];if((null===(r=i.channel)||void 0===r?void 0:r.cid)===t){e={muted:!i.expires||new Date(i.expires).getTime()>(new Date).getTime(),createdAt:i.created_at?new Date(i.created_at):new Date,expiresAt:i.expires?new Date(i.expires):null};break}}return e||{muted:!1,createdAt:null,expiresAt:null}}},{key:"connect",value:(Ut=f()(S.a.mark((function t(){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.userID&&this._user){t.next=2;break}throw Error("Call connectUser or connectAnonymousUser before starting the connection");case 2:if(this.wsBaseURL){t.next=4;break}throw Error("Websocket base url not set");case 4:if(this.clientID){t.next=6;break}throw Error("clientID is not set");case 6:if(this.wsConnection||!this.options.warmUp&&!this.options.enableInsights||this._sayHi(),this.options.wsConnection&&this.node?(this.options.wsConnection.setClient(this),this.wsConnection=this.options.wsConnection):this.wsConnection=new kt({client:this}),t.prev=8,!this.wsFallback){t.next=13;break}return t.next=12,this.wsFallback.connect();case 12:return t.abrupt("return",t.sent);case 13:return t.next=15,this.wsConnection.connect(this.options.enableWSFallback?this.defaultWSTimeoutWithFallback:this.defaultWSTimeout);case 15:return t.abrupt("return",t.sent);case 18:if(t.prev=18,t.t0=t.catch(8),!(this.options.enableWSFallback&&Ft(t.t0)&&(e=void 0,e="undefined"!=typeof navigator?navigator:"undefined"!=typeof window&&window.navigator?window.navigator:void 0,e?"boolean"!=typeof e.onLine||e.onLine:(console.warn("isOnline failed to access window.navigator and assume browser is online"),1)))){t.next=29;break}return this.logger("info","client:connect() - WS failed, fallback to longpoll",{tags:["connection","client"]}),this.dispatchEvent({type:"transport.changed",mode:"longpoll"}),this.wsConnection._destroyCurrentWSConnection(),this.wsConnection.disconnect().then(),this.wsFallback=new qt({client:this}),t.next=28,this.wsFallback.connect();case 28:return t.abrupt("return",t.sent);case 29:throw t.t0;case 30:case"end":return t.stop()}var e}),t,this,[[8,18]])}))),function(){return Ut.apply(this,arguments)})},{key:"_sayHi",value:function(){var t=this,e=rt(),n={headers:{"x-client-request-id":e}};this.doAxiosRequest("get",this.baseURL+"/hi",null,n).catch((function(n){t.options.enableInsights&&wt("http_hi_failed",{api_key:t.key,err:n,client_request_id:e})}))}},{key:"queryUsers",value:(jt=f()(S.a.mark((function t(e){var n,r,i,o,s=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:[],r=s.length>2&&void 0!==s[2]?s[2]:{},i={presence:!1},t.next=5,this.wsPromise;case 5:return this._hasConnectionID()||(i.presence=!1),t.next=8,this.get(this.baseURL+"/users",{payload:Gt(Gt({filter_conditions:e,sort:et(n)},i),r)});case 8:return o=t.sent,this.state.updateUsers(o.users),t.abrupt("return",o);case 11:case"end":return t.stop()}}),t,this)}))),function(t){return jt.apply(this,arguments)})},{key:"queryBannedUsers",value:(Lt=f()(S.a.mark((function t(){var e,n,r,i=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},n=i.length>1&&void 0!==i[1]?i[1]:[],r=i.length>2&&void 0!==i[2]?i[2]:{},t.next=5,this.get(this.baseURL+"/query_banned_users",{payload:Gt({filter_conditions:e,sort:et(n)},r)});case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)}))),function(){return Lt.apply(this,arguments)})},{key:"queryMessageFlags",value:(Mt=f()(S.a.mark((function t(){var e,n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=4,this.get(this.baseURL+"/moderation/flags/message",{payload:Gt({filter_conditions:e},n)});case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)}))),function(){return Mt.apply(this,arguments)})},{key:"queryChannels",value:(Pt=f()(S.a.mark((function t(e){var n,r,i,o,s,a,c=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=c.length>1&&void 0!==c[1]?c[1]:[],r=c.length>2&&void 0!==c[2]?c[2]:{},i=c.length>3&&void 0!==c[3]?c[3]:{},o={state:!0,watch:!0,presence:!1},t.next=6,this.wsPromise;case 6:return this._hasConnectionID()||(o.watch=!1),s=Gt(Gt({filter_conditions:e,sort:et(n)},o),r),t.next=10,this.post(this.baseURL+"/channels",s);case 10:return a=t.sent,this.dispatchEvent({type:"channels.queried",queriedChannels:{channels:a.channels,isLatestMessageSet:!0}}),t.abrupt("return",this.hydrateActiveChannels(a.channels,i));case 13:case"end":return t.stop()}}),t,this)}))),function(t){return Pt.apply(this,arguments)})},{key:"hydrateActiveChannels",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.skipInitialization,i=n.offlineMode,o=void 0!==i&&i,s=$t(e);try{for(s.s();!(t=s.n()).done;){var a=t.value;this._addChannelConfig(a.channel)}}catch(t){s.e(t)}finally{s.f()}var c,u=[],l=$t(e);try{for(l.s();!(c=l.n()).done;
393){var h=c.value,p=this.channel(h.channel.type,h.channel.id);p.data=h.channel,p.offlineMode=o,p.initialized=!o,void 0===r?p._initializeState(h,"latest"):r.includes(h.channel.id)||(p.state.clearMessages(),p._initializeState(h,"latest")),u.push(p)}}catch(t){l.e(t)}finally{l.f()}if(!o)for(var d in this.activeChannels){var f=this.activeChannels[d];f.offlineMode&&delete this.activeChannels[d]}return u}},{key:"search",value:(Rt=f()(S.a.mark((function t(e,n){var r,i,o=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=o.length>2&&void 0!==o[2]?o[2]:{}).offset||!r.sort&&!r.next){t.next=3;break}throw Error("Cannot specify offset with sort or next parameters");case 3:if(i=Gt(Gt({filter_conditions:e},r),{},{sort:r.sort?et(r.sort):void 0}),"string"!=typeof n){t.next=8;break}i.query=n,t.next=13;break;case 8:if("object"!==c()(n)){t.next=12;break}i.message_filter_conditions=n,t.next=13;break;case 12:throw Error("Invalid type ".concat(c()(n)," for query parameter"));case 13:return t.next=15,this.wsPromise;case 15:return t.next=17,this.get(this.baseURL+"/search",{payload:i});case 17:return t.abrupt("return",t.sent);case 18:case"end":return t.stop()}}),t,this)}))),function(t,e){return Rt.apply(this,arguments)})},{key:"setLocalDevice",value:function(t){if(this.wsConnection||this.wsFallback)throw new Error("you can only set device before opening a websocket connection");this.options.device=t}},{key:"addDevice",value:(Ot=f()(S.a.mark((function t(e,n,r,i){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.post(this.baseURL+"/devices",Gt(Gt({id:e,push_provider:n},null!=r?{user_id:r}:{}),null!=i?{push_provider_name:i}:{}));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e,n,r){return Ot.apply(this,arguments)})},{key:"getDevices",value:(It=f()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.get(this.baseURL+"/devices",e?{user_id:e}:{});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return It.apply(this,arguments)})},{key:"removeDevice",value:(Tt=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.delete(this.baseURL+"/devices",Gt({id:e},n?{user_id:n}:{}));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return Tt.apply(this,arguments)})},{key:"getRateLimits",value:(xt=f()(S.a.mark((function t(e){var n,r,i,o,s,a;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(n=e||{}).serverSide,i=n.web,o=n.android,s=n.ios,a=n.endpoints,t.abrupt("return",this.get(this.baseURL+"/rate_limits",{server_side:r,web:i,android:o,ios:s,endpoints:a?a.join(","):void 0}));case 2:case"end":return t.stop()}}),t,this)}))),function(t){return xt.apply(this,arguments)})},{key:"_addChannelConfig",value:function(t){var e=t.cid,n=t.config;this.configs[e]=n}},{key:"channel",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!this.userID&&!this._isUsingServerAuth())throw Error("Call connectUser or connectAnonymousUser before creating a channel");if(~t.indexOf(":"))throw Error("Invalid channel group ".concat(t,", can't contain the : character"));return null==e||""===e?new ft(this,t,void 0,n):"object"===c()(e)?this.getChannelByMembers(t,e):this.getChannelById(t,e,n)}},{key:"partialUpdateUser",value:(Et=f()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.partialUpdateUsers([e]);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return Et.apply(this,arguments)})},{key:"upsertUsers",value:(Ct=f()(S.a.mark((function t(e){var n,r,i,o;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n={},r=$t(e),t.prev=2,r.s();case 4:if((i=r.n()).done){t.next=11;break}if((o=i.value).id){t.next=8;break}throw Error("User ID is required when updating a user");case 8:n[o.id]=o;case 9:t.next=4;break;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(2),r.e(t.t0);case 16:return t.prev=16,r.f(),t.finish(16);case 19:return t.next=21,this.post(this.baseURL+"/users",{users:n});case 21:return t.abrupt("return",t.sent);case 22:case"end":return t.stop()}}),t,this,[[2,13,16,19]])}))),function(t){return Ct.apply(this,arguments)})},{key:"upsertUser",value:function(t){return this.upsertUsers([t])}},{key:"partialUpdateUsers",value:(St=f()(S.a.mark((function t(e){var n,r;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=$t(e),t.prev=1,n.s();case 3:if((r=n.n()).done){t.next=9;break}if(r.value.id){t.next=7;break}throw Error("User ID is required when updating a user");case 7:t.next=3;break;case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),n.e(t.t0);case 14:return t.prev=14,n.f(),t.finish(14);case 17:return t.next=19,this.patch(this.baseURL+"/users",{users:e});case 19:return t.abrupt("return",t.sent);case 20:case"end":return t.stop()}}),t,this,[[1,11,14,17]])}))),function(t){return St.apply(this,arguments)})},{key:"deleteUser",value:(bt=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.delete(this.baseURL+"/users/".concat(e),n);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return bt.apply(this,arguments)})},{key:"reactivateUser",value:(yt=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.post(this.baseURL+"/users/".concat(e,"/reactivate"),Gt({},n));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return yt.apply(this,arguments)})},{key:"deactivateUser",value:(gt=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.post(this.baseURL+"/users/".concat(e,"/deactivate"),Gt({},n));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return gt.apply(this,arguments)})},{key:"exportUser",value:(vt=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.get(this.baseURL+"/users/".concat(e,"/export"),Gt({},n));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return vt.apply(this,arguments)})},{key:"banUser",value:(dt=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.post(this.baseURL+"/moderation/ban",Gt({target_user_id:e},n));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return dt.apply(this,arguments)})},{key:"unbanUser",value:(pt=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.delete(this.baseURL+"/moderation/ban",Gt({target_user_id:e},n));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return pt.apply(this,arguments)})},{key:"shadowBan",value:(ht=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.banUser(e,Gt({shadow:!0}
393,n));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return ht.apply(this,arguments)})},{key:"removeShadowBan",value:(lt=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.unbanUser(e,Gt({shadow:!0},n));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return lt.apply(this,arguments)})},{key:"muteUser",value:(ut=f()(S.a.mark((function t(e,n){var r,i=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:{},t.next=3,this.post(this.baseURL+"/moderation/mute",Gt(Gt({target_id:e},n?{user_id:n}:{}),r));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return ut.apply(this,arguments)})},{key:"unmuteUser",value:(ct=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.post(this.baseURL+"/moderation/unmute",Gt({target_id:e},n?{user_id:n}:{}));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return ct.apply(this,arguments)})},{key:"userMuteStatus",value:function(t){if(!this.user||!this.wsPromise)throw new Error("Make sure to await connectUser() first.");for(var e=0;e<this.mutedUsers.length;e+=1)if(this.mutedUsers[e].target.id===t)return!0;return!1}},{key:"flagMessage",value:(at=f()(S.a.mark((function t(e){var n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=3,this.post(this.baseURL+"/moderation/flag",Gt({target_message_id:e},n));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}
393))),function(t){return at.apply(this,arguments)})},{key:"flagUser",value:(st=f()(S.a.mark((function t(e){var n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=3,this.post(this.baseURL+"/moderation/flag",Gt({target_user_id:e},n));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return st.apply(this,arguments)})},{key:"unflagMessage",value:(ot=f()(S.a.mark((function t(e){var n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=3,this.post(this.baseURL+"/moderation/unflag",Gt({target_message_id:e},n));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return ot.apply(this,arguments)})},{key:"unflagUser",value:(it=f()(S.a.mark((function t(e){var n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=3,this.post(this.baseURL+"/moderation/unflag",Gt({target_user_id:e},n));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return it.apply(this,arguments)})},{key:"getCallToken",value:(Q=f()(S.a.mark((function t(e){var n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=3,this.post(this.baseURL+"/calls/".concat(e),Gt({},n));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return Q.apply(this,arguments)})},{key:"_queryFlags",value:(G=f()(S.a.mark((function t(){var e,n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=4,this.post(this.baseURL+"/moderation/flags",Gt({filter_conditions:e},n));case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)}))),function(){return G.apply(this,arguments)})},{key:"_queryFlagReports",value:(K=f()(S.a.mark((function t(){var e,n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=4,this.post(this.baseURL+"/moderation/reports",Gt({filter_conditions:e},n));case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)}))),function(){return K.apply(this,arguments)})},{key:"_reviewFlagReport",value:(Y=f()(S.a.mark((function t(e,n){var r,i=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:{},t.next=3,this.patch(this.baseURL+"/moderation/reports/".concat(e),Gt({review_result:n},r));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return Y.apply(this,arguments)})},{key:"_unblockMessage",value:($=f()(S.a.mark((function t(e){var n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=3,this.post(this.baseURL+"/moderation/unblock_message",Gt({target_message_id:e},n));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return $.apply(this,arguments)})},{key:"markChannelsRead",value:(W=f()(S.a.mark((function t(){var e,n=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},t.next=3,this.post(this.baseURL+"/channels/read",Gt({},e));case 3:case"end":return t.stop()}}),t,this)}))),function(){return W.apply(this,arguments)})},{key:"createCommand",value:function(t){return this.post(this.baseURL+"/commands",t)}},{key:"getCommand",value:function(t){return this.get(this.baseURL+"/commands/".concat(t))}},{key:"updateCommand",value:function(t,e){return this.put(this.baseURL+"/commands/".concat(t),e)}},{key:"deleteCommand",value:function(t){return this.delete(this.baseURL+"/commands/".concat(t))}},{key:"listCommands",value:function(){return this.get(this.baseURL+"/commands")}},{key:"createChannelType",value:function(t){var e=s()({},{commands:["all"]},t);return this.post(this.baseURL+"/channeltypes",e)}},{key:"getChannelType",value:function(t){return this.get(this.baseURL+"/channeltypes/".concat(t))}},{key:"updateChannelType",value:function(t,e){return this.put(this.baseURL+"/channeltypes/".concat(t),e)}},{key:"deleteChannelType",value:function(t){return this.delete(this.baseURL+"/channeltypes/".concat(t))}},{key:"listChannelTypes",value:function(){return this.get(this.baseURL+"/channeltypes")}},{key:"translateMessage",value:(q=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.post(this.baseURL+"/messages/".concat(e,"/translate"),{language:n});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return q.apply(this,arguments)})},{key:"_normalizeExpiration",value:function(t){var e=null;if("number"==typeof t){var n=new Date;n.setSeconds(n.getSeconds()+t),e=n.toISOString()}else Qt(t)?e=t:t instanceof Date&&(e=t.toISOString());return e}},{key:"_validateAndGetMessageId",value:function(t,e){var n;if("string"==typeof t)n=t;else{if(!t.id)throw Error(e);
393n=t.id}return n}},{key:"pinMessage",value:function(t,e,n,r){var i=this._validateAndGetMessageId(t,"Please specify the message id when calling unpinMessage");return this.partialUpdateMessage(i,{set:{pinned:!0,pin_expires:this._normalizeExpiration(e),pinned_at:this._normalizeExpiration(r)}},n)}},{key:"unpinMessage",value:function(t,e){var n=this._validateAndGetMessageId(t,"Please specify the message id when calling unpinMessage");return this.partialUpdateMessage(n,{set:{pinned:!1}},e)}},{key:"updateMessage",value:(B=f()(S.a.mark((function t(e,n,r){var i;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.id){t.next=2;break}throw Error("Please specify the message id when calling updateMessage");case 2:return delete(i=s()({},e)).id,["command","created_at","html","latest_reactions","own_reactions","quoted_message","reaction_counts","reply_count","type","updated_at","user","__html"].forEach((function(t){null!=i[t]&&delete i[t]})),null!=n&&(Qt(n)?i.user_id=n:i.user={id:n.id}),Array.isArray(i.mentioned_users)&&!Qt(i.mentioned_users[0])&&(i.mentioned_users=i.mentioned_users.map((function(t){return t.id}))),t.next=10,this.post(this.baseURL+"/messages/".concat(e.id),Gt({message:i},r));case 10:return t.abrupt("return",t.sent);case 11:case"end":return t.stop()}}),t,this)}))),function(t,e,n){return B.apply(this,arguments)})},{key:"partialUpdateMessage",value:(H=f()(S.a.mark((function t(e,n,r,i){var o;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}throw Error("Please specify the message id when calling partialUpdateMessage");case 2:return o=r,null!=r&&Qt(r)&&(o={id:r}),t.next=6,this.put(this.baseURL+"/messages/".concat(e),Gt(Gt(Gt({},n),i),{},{user:o}));case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)}))),function(t,e,n,r){return H.apply(this,arguments)})},{key:"deleteMessage",value:(F=f()(S.a.mark((function t(e,n){var r;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={},n&&(r={hard:!0}),t.next=4,this.delete(this.baseURL+"/messages/".concat(e),r);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return F.apply(this,arguments)})},{key:"getMessage",value:(U=f()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.get(this.baseURL+"/messages/".concat(e));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return U.apply(this,arguments)})},{key:"getUserAgent",value:function(){return this.userAgent||"stream-chat-javascript-client-".concat(this.node?"node":"browser","-","7.2.0")}},{key:"setUserAgent",value:function(t){this.userAgent=t}},{key:"_enrichAxiosOptions",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{params:{},headers:{},config:{}},n=this._getToken(),r=n?{Authorization:n}:void 0,i=null;return null!==this.nextRequestAbortController&&(i=this.nextRequestAbortController.signal,this.nextRequestAbortController=null),null!==(t=e.headers)&&void 0!==t&&t["x-client-request-id"]||(e.headers=Gt(Gt({},e.headers),{},{"x-client-request-id":rt()})),Gt(Gt({params:Gt({user_id:this.userID,connection_id:this._getConnectionID(),api_key:this.key},e.params),headers:Gt(Gt({},r),{},{"stream-auth-type":this.getAuthType(),"X-Stream-Client":this.getUserAgent()},e.headers)},i?{signal:i}:{}),e.config)}},{key:"_getToken",value:function(){return!this.tokenManager||this.anonymous?null:this.tokenManager.getToken()}},{key:"_startCleaning",value:function(){var t=this;null==this.cleaningIntervalRef&&(this.cleaningIntervalRef=setInterval((function(){for(var e=0,n=Object.values(t.activeChannels);e<n.length;e++){n[e].clean()}}),500))}},{key:"verifyWebhook",value:function(e,n){return!!this.secret&&(r=e,i=this.secret,o=n,s=t.from(i,"ascii"),At.createHmac("sha256",s).update(r).digest("hex")===o);var r,i,o,s}},{key:"getPermission",value:function(t){return this.get("".concat(this.baseURL,"/permissions/").concat(t))}},{key:"createPermission",value:function(t){return this.post("".concat(this.baseURL,"/permissions"),Gt({},t))}},{key:"updatePermission",value:function(t,e){return this.put("".concat(this.baseURL,"/permissions/").concat(t),Gt({},e))}},{key:"deletePermission",value:function(t){return this.delete("".concat(this.baseURL,"/permissions/").concat(t))}},{key:"listPermissions",value:function(){return this.get("".concat(this.baseURL,"/permissions"))}},{key:"createRole",value:function(t){return this.post("".concat(this.baseURL,"/roles"),{name:t})}},{key:"listRoles",value:function(){return this.get("".concat(this.baseURL,"/roles"))}},{key:"deleteRole",value:function(t){return this.delete("".concat(this.baseURL,"/roles/").concat(t))}},{key:"sync",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.post("".concat(this.baseURL,"/sync"),Gt({channel_cids:t,last_sync_at:e},n))}},{key:"sendUserCustomEvent",value:(j=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.post("".concat(this.baseURL,"/users/").concat(e,"/event"),{event:n});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return j.apply(this,arguments)})},{key:"createBlockList",value:function(t){return this.post("".concat(this.baseURL,"/blocklists"),t)}},{key:"listBlockLists",value:function(){return this.get("".concat(this.baseURL,"/blocklists"))}},{key:"getBlockList",value:function(t){return this.get("".concat(this.baseURL,"/blocklists/").concat(t))}},{key:"updateBlockList",value:function(t,e){return this.put("".concat(this.baseURL,"/blocklists/").concat(t),e)}},{key:"deleteBlockList",value:function(t){return this.delete("".concat(this.baseURL,"/blocklists/").concat(t))}},{key:"exportChannels",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Gt({channels:t},e);return this.post("".concat(this.baseURL,"/export_channels"),n)}},{key:"exportUsers",value:function(t){return this.post("".concat(this.baseURL,"/export/users"),t)}},{key:"exportChannel",value:function(t,e){return this.exportChannels([t],e)}},{key:"getExportChannelStatus",value:function(t){return this.get("".concat(this.baseURL,"/export_channels/").concat(t))}},{key:"createSegment",value:(L=f()(S.a.mark((function t(e){var n,r;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.post(this.baseURL+"/segments",{segment:e});case 2:return n=t.sent,r=n.segment,t.abrupt("return",r);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return L.apply(this,arguments)})},{key:"querySegments",value:(D=f()(S.a.mark((function t(e){var n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=3,this.get(this.baseURL+"/segments",{payload:Gt({filter_conditions:e},n)});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return D.apply(this,arguments)})}
393,{key:"updateSegment",value:(M=f()(S.a.mark((function t(e,n){var r,i;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.put(this.baseURL+"/segments/".concat(e),{segment:n});case 2:return r=t.sent,i=r.segment,t.abrupt("return",i);case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return M.apply(this,arguments)})},{key:"deleteSegment",value:(P=f()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.delete(this.baseURL+"/segments/".concat(e)));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return P.apply(this,arguments)})},{key:"createCampaign",value:(N=f()(S.a.mark((function t(e){var n,r;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.post(this.baseURL+"/campaigns",{campaign:e});case 2:return n=t.sent,r=n.campaign,t.abrupt("return",r);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return N.apply(this,arguments)})},{key:"queryCampaigns",value:(R=f()(S.a.mark((function t(e){var n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=3,this.get(this.baseURL+"/campaigns",{payload:Gt({filter_conditions:e},n)});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return R.apply(this,arguments)})},{key:"updateCampaign",value:(A=f()(S.a.mark((function t(e,n){var r,i;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.put(this.baseURL+"/campaigns/".concat(e),{campaign:n});case 2:return r=t.sent,i=r.campaign,t.abrupt("return",i);case 5:case"end":return t.stop()}}),t,this)}))),function(t,e){return A.apply(this,arguments)})},{key:"deleteCampaign",value:(O=f()(S.a.mark((function t(e){var n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.abrupt("return",this.delete(this.baseURL+"/campaigns/".concat(e),n));case 2:case"end":return t.stop()}}),t,this)}))),function(t){return O.apply(this,arguments)})},{key:"scheduleCampaign",value:(k=f()(S.a.mark((function t(e,n){var r,i,o;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.scheduledFor,t.next=3,this.patch(this.baseURL+"/campaigns/".concat(e,"/schedule"),{scheduled_for:r});case 3:return i=t.sent,o=i.campaign,t.abrupt("return",o);case 6:case"end":return t.stop()}}),t,this)}))),function(t,e){return k.apply(this,arguments)})},{key:"stopCampaign",value:(I=f()(S.a.mark((function t(e){var n,r;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.patch(this.baseURL+"/campaigns/".concat(e,"/stop"));case 2:return n=t.sent,r=n.campaign,t.abrupt("return",r);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return I.apply(this,arguments)})},{key:"resumeCampaign",value:(T=f()(S.a.mark((function t(e){var n,r;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.patch(this.baseURL+"/campaigns/".concat(e,"/resume"));case 2:return n=t.sent,r=n.campaign,t.abrupt("return",r);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return T.apply(this,arguments)})},{key:"testCampaign",value:(x=f()(S.a.mark((function t(e,n){var r;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.users,t.next=3,this.post(this.baseURL+"/campaigns/".concat(e,"/test"),{users:r});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t,e){return x.apply(this,arguments)})},{key:"queryRecipients",value:(C=f()(S.a.mark((function t(e){var n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=3,this.get(this.baseURL+"/recipients",{payload:Gt({filter_conditions:e},n)});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return C.apply(this,arguments)})},{key:"enrichURL",value:(w=f()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.get(this.baseURL+"/og",{url:e}));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return w.apply(this,arguments)})},{key:"getTask",value:(b=f()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.get("".concat(this.baseURL,"/tasks/").concat(e)));case 1:case"end":return t.stop()}}),t,this)}))),function(t){return b.apply(this,arguments)})},{key:"deleteChannels",value:(m=f()(S.a.mark((function t(e){var n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{},t.next=3,this.post(this.baseURL+"/channels/delete",Gt({cids:e},n));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return m.apply(this,arguments)})},{key:"deleteUsers",value:(v=f()(S.a.mark((function t(e,n){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("soft"===(null==n?void 0:n.user)||"hard"===(null==n?void 0:n.user)){t.next=2;break}throw new Error("Invalid delete user options. user must be one of [soft hard]");case 2:if(void 0===n.messages||"soft"===n.messages||"hard"===n.messages){t.next=4;break}throw new Error("Invalid delete user options. messages must be one of [soft hard]");case 4:if(void 0===n.conversations||"soft"===n.conversations||"hard"===n.conversations){t.next=6;break}throw new Error("Invalid delete user options. conversations must be one of [soft hard]");case 6:return t.next=8,this.post(this.baseURL+"/users/delete",Gt({user_ids:e},n));case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t,this)}))),function(t,e){return v.apply(this,arguments)})},{key:"_createImportURL",value:(d=f()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.post(this.baseURL+"/import_urls",{filename:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return d.apply(this,arguments)})},{key:"_createImport",value:(h=f()(S.a.mark((function t(e){var n,r=arguments;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>1&&void 0!==r[1]?r[1]:{mode:"upsert"},t.next=3,this.post(this.baseURL+"/imports",Gt({path:e},n));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return h.apply(this,arguments)})}
393,{key:"_getImport",value:(u=f()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.get(this.baseURL+"/imports/".concat(e));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return u.apply(this,arguments)})},{key:"_listImports",value:(a=f()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.get(this.baseURL+"/imports",e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return a.apply(this,arguments)})},{key:"upsertPushProvider",value:(o=f()(S.a.mark((function t(e){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.post(this.baseURL+"/push_providers",{push_provider:e});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"deletePushProvider",value:(i=f()(S.a.mark((function t(e){var n,r;return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.type,r=e.name,t.next=3,this.delete(this.baseURL+"/push_providers/".concat(n,"/").concat(r));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"listPushProviders",value:(n=f()(S.a.mark((function t(){return S.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.get(this.baseURL+"/push_providers");case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"createAbortControllerForNextRequest",value:function(){return this.nextRequestAbortController=new AbortController}}],[{key:"getInstance",value:function(t,n,r){return e._instance||(e._instance="string"==typeof n?new e(t,n,r):new e(t,n)),e._instance}}]),e}();_()(Xt,"_instance",void 0);var Jt=["*"],Zt=["*"],te=function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Jt,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Zt,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"Allow";g()(this,t),_()(this,"name",void 0),_()(this,"action",void 0),_()(this,"owner",void 0),_()(this,"priority",void 0),_()(this,"resources",void 0),_()(this,"roles",void 0),this.name=e,this.action=s,this.owner=o,this.priority=n,this.resources=r,this.roles=i};new te("Allow all",999,Jt,Zt,!1,"Allow"),new te("Deny all",1,Jt,Zt,!1,"Deny")}).call(this,n(218).Buffer,n(64))},function(t,e,n){"use strict";e.byteLength=function(t){var e=u(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=u(t),s=r[0],a=r[1],c=new o(function(t,e,n){return 3*(e+n)/4-n}(0,s,a)),l=0,h=a>0?s-4:s;for(n=0;n<h;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],c[l++]=e>>16&255,c[l++]=e>>8&255,c[l++]=255&e;2===a&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,c[l++]=255&e);1===a&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,c[l++]=e>>8&255,c[l++]=255&e);return c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(l(t,s,s+16383>a?a:s+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)r[a]=s[a],i[s.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e,n){var r=n(222);t.exports=function(t,e){if(null==t)return{};var n,i,o=r(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}
393,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";t.exports="object"==typeof self?self.FormData:window.FormData},function(t,e,n){(function(e){var n=null;"undefined"!=typeof WebSocket?n=WebSocket:"undefined"!=typeof MozWebSocket?n=MozWebSocket:void 0!==e?n=e.WebSocket||e.MozWebSocket:"undefined"!=typeof window?n=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(n=self.WebSocket||self.MozWebSocket),t.exports=n}).call(this,n(71))},function(t,e,n){var r=n(112);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(60).default,i=n(86);t.exports=function(t,e){if(e&&("object"==r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return i(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(92),i=n(112),o=n(251),s=n(252);function a(e){var n="function"==typeof Map?new Map:void 0;return t.exports=a=function(t){if(null===t||!o(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return s(t,arguments,r(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i(e,t)},t.exports.__esModule=!0,t.exports.default=t.exports,a(e)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports},function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__;
394/**
395 * [js-sha256]{@link https://github.com/emn178/js-sha256}
396 *
397 * @version 0.9.0
398 * @author Chen, Yi-Cyuan [[email protected]]
399 * @copyright Chen, Yi-Cyuan 2014-2017
400 * @license MIT
401 */!function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD=__webpack_require__(254),ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];!root.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!ARRAY_BUFFER||!root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,e){return function(n){return new Sha256(e,!0).update(n)[t]()}},createMethod=function(t){var e=createOutputMethod("hex",t);NODE_JS&&(e=nodeWrap(e,t)),e.create=function(){return new Sha256(t)},e.update=function(t){return e.create().update(t)};for(var n=0;n<OUTPUT_TYPES.length;++n){var r=OUTPUT_TYPES[n];e[r]=createOutputMethod(r,t)}return e},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(t){if("string"==typeof t)return crypto.createHash(algorithm).update(t,"utf8").digest("hex");
401if(null==t)throw new Error(ERROR);return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod},createHmacOutputMethod=function(t,e){return function(n,r){return new HmacSha256(n,e,!0).update(r)[t]()}},createHmacMethod=function(t){var e=createHmacOutputMethod("hex",t);e.create=function(e){return new HmacSha256(e,t)},e.update=function(t,n){return e.create(t).update(n)};for(var n=0;n<OUTPUT_TYPES.length;++n){var r=OUTPUT_TYPES[n];e[r]=createHmacOutputMethod(r,t)}return e};function Sha256(t,e){e?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}function HmacSha256(t,e,n){var r,i=typeof t;if("string"===i){var o,s=[],a=t.length,c=0;for(r=0;r<a;++r)(o=t.charCodeAt(r))<128?s[c++]=o:o<2048?(s[c++]=192|o>>6,s[c++]=128|63&o):o<55296||o>=57344?(s[c++]=224|o>>12,s[c++]=128|o>>6&63,s[c++]=128|63&o):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++r)),s[c++]=240|o>>18,s[c++]=128|o>>12&63,s[c++]=128|o>>6&63,s[c++]=128|63&o);t=s}else{if("object"!==i)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR)}t.length>64&&(t=new Sha256(e,!0).update(t).array());var u=[],l=[];for(r=0;r<64;++r){var h=t[r]||0;u[r]=92^h,l[r]=54^h}Sha256.call(this,e,n),this.update(l),this.oKeyPad=u,this.inner=!0,this.sharedMemory=n}Sha256.prototype.update=function(t){if(!this.finalized){var e,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(ERROR);if(null===t)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||ARRAY_BUFFER&&ArrayBuffer.isView(t)))throw new Error(ERROR);e=!0}for(var r,i,o=0,s=t.length,a=this.blocks;o<s;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),e)for(i=this.start;o<s&&i<64;++o)a[i>>2]|=t[o]<<SHIFT[3&i++];else for(i=this.start;o<s&&i<64;++o)(r=t.charCodeAt(o))<128?a[i>>2]|=r<<SHIFT[3&i++]:r<2048?(a[i>>2]|=(192|r>>6)<<SHIFT[3&i++],a[i>>2]|=(128|63&r)<<SHIFT[3&i++]):r<55296||r>=57344?(a[i>>2]|=(224|r>>12)<<SHIFT[3&i++],a[i>>2]|=(128|r>>6&63)<<SHIFT[3&i++],a[i>>2]|=(128|63&r)<<SHIFT[3&i++]):(r=65536+((1023&r)<<10|1023&t.charCodeAt(++o)),a[i>>2]|=(240|r>>18)<<SHIFT[3&i++],a[i>>2]|=(128|r>>12&63)<<SHIFT[3&i++],a[i>>2]|=(128|r>>6&63)<<SHIFT[3&i++],a[i>>2]|=(128|63&r)<<SHIFT[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=a[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=EXTRA[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t,e,n,r,i,o,s,a,c,u=this.h0,l=this.h1,h=this.h2,p=this.h3,d=this.h4,f=this.h5,v=this.h6,g=this.h7,m=this.blocks;for(t=16;t<64;++t)e=((i=m[t-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,n=((i=m[t-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,m[t]=m[t-16]+e+m[t-7]+n<<0;for(c=l&h,t=0;t<64;t+=4)this.first?(this.is224?(o=300032,g=(i=m[0]-1413257819)-150054599<<0,p=i+24177077<<0):(o=704751109,g=(i=m[0]-210244248)-1521486534<<0,p=i+143694565<<0),this.first=!1):(e=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>
40122|u<<10),r=(o=u&l)^u&h^c,g=p+(i=g+(n=(d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&f^~d&v)+K[t]+m[t])<<0,p=i+(e+r)<<0),e=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),r=(s=p&u)^p&l^o,v=h+(i=v+(n=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&d^~g&f)+K[t+1]+m[t+1])<<0,e=((h=i+(e+r)<<0)>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),r=(a=h&p)^h&u^s,f=l+(i=f+(n=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&g^~v&d)+K[t+2]+m[t+2])<<0,e=((l=i+(e+r)<<0)>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),r=(c=l&h)^l&p^a,d=u+(i=d+(n=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&v^~f&g)+K[t+3]+m[t+3])<<0,u=i+(e+r)<<0;this.h0=this.h0+u<<0,this.h1=this.h1+l<<0,this.h2=this.h2+h<<0,this.h3=this.h3+p<<0,this.h4=this.h4+d<<0,this.h5=this.h5+f<<0,this.h6=this.h6+v<<0,this.h7=this.h7+g<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,r=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,c=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s];return this.is224||(c+=HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a]),c},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,r=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,c=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24&255,n>>16&255,n>>8&255,255&n,r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,s>>24&255,s>>16&255,s>>8&255,255&s];return this.is224||c.push(a>>24&255,a>>16&255,a>>8&255,255&a),c},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(64),__webpack_require__(71))},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20"><defs><circle id="a" cx="10" cy="10" r="10"/></defs><g fill="none" fill-rule="evenodd"><mask id="b" fill="#fff"><use xlink:href="#a"/></mask><use fill="#E16428" xlink:href="#a"/><g stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" mask="url(#b)"><g transform="translate(4 4)"><circle cx="6" cy="6" r="5.6"/><path d="M6 2.8v6.4M2.8 6h6.4"/></g></g></g></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewB
401ox="0 0 20 20"><defs><circle id="a" cx="10" cy="10" r="10"/></defs><g fill="none" fill-rule="evenodd"><mask id="b" fill="#fff"><use xlink:href="#a"/></mask><use fill="#5A5A96" xlink:href="#a"/><g stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" mask="url(#b)"><g transform="translate(5 5)"><path d="M6.875 6.981a3.11 3.11 0 0 0-1.563-.418H3.438A3.125 3.125 0 0 0 .313 9.688h4.375"/><circle cx="4.375" cy="2.5" r="2.188"/><path d="M5.938 8.438l1.25 1.25 2.5-2.5"/></g></g></g></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 20 20"><defs><circle id="a" cx="10" cy="10" r="10"/></defs><g fill="none" fill-rule="evenodd"><mask id="b" fill="#fff"><use xlink:href="#a"/></mask><use fill="#00A846" xlink:href="#a"/><g stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" mask="url(#b)"><g transform="translate(5 5)"><path d="M5.313 6.563H3.438A3.125 3.125 0 0 0 .312 9.688h5.625"/><circle cx="4.375" cy="2.5" r="2.188"/><path d="M7.813 6.563v2.5m-1.25-1.25h2.5"/></g></g></g></svg>\n'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 18 18"><defs><path id="a2" d="M6.67 11.47L4.22 9.02l-1.27 1.27 3.7 3.72.62-.61v.01l7.64-7.64-1.27-1.27-6.97 6.97zM9 18A9 9 0 1 1 9 0a9 9 0 0 1 0 18z"/></defs><g fill="none" fill-rule="evenodd"><mask id="b2" fill="#fff"><use xlink:href="#a2"/></mask><g fill="#00A846" mask="url(#b2)"><path d="M0 0h18v18H0z"/></g></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 18 18"><defs><path id="a3" d="M9.93 10.84a.92.92 0 0 1-.93.91.92.92 0 0 1-.93-.91V5.96c0-.5.42-.91.93-.91s.93.4.93.91v4.88zM9 14.8a.92.92 0 0 1-.93-.92c0-.5.42-.91.93-.91s.93.41.93.91a.92.92 0 0 1-.93.92zm8.75-1.3L10.8 2.93a2.2 2.2 0 0 0-3.56-.
vendor: 15,756 bytes, lines 401-408
40103L.25 13.51a.28.28 0 0 0-.02.04c-.03.05-.23.51-.23.94 0 1.18.97 2.14 2.17 2.14h13.66c1.2 0 2.17-.96 2.17-2.14 0-.43-.2-.89-.23-.94a.28.28 0 0 0-.02-.04z"/></defs><g fill="none" fill-rule="evenodd"><mask id="b3" fill="#fff"><use xlink:href="#a3"/></mask><use fill="#F0B428" xlink:href="#a3"/><g fill="#F0B428" mask="url(#b3)"><path d="M0 0h18v18H0z"/></g></g></svg>'},function(t,e,n){"use strict";n(136),n(137)},function(t,e,n){"use strict";(function(t){
402/*!
403 * The buffer module from node.js, for the browser.
404 *
405 * @author   Feross Aboukhadijeh <http://feross.org>
406 * @license  MIT
407 */
408var r=n(219),i=n(220),o=n(221);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,n){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return u(this,t,e,n)}function u(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|f(e,n),i=(t=a(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(c.isBuffer(e)){var n=0|d(e.length);return 0===(t=a(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?a(t,0):p(t,e);if("Buffer"===e.type&&o(e.data))return p(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(l(e),t=a(t,e<0?0:0|d(e)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function p(t,e){var n=e.length<0?0:0|d(e.length);t=a(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function d(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function f(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(t).length;default:if(r)return B(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,e,n);case"utf8":case"utf-8":return T(this,e,n);case"ascii":return k(this,e,n);case"latin1":case"binary":return O(this,e,n);case"base64":return x(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function g(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=c.from(e,r)),c.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var o,s=1,a=t.length,c=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var l=-1;for(o=n;o<a;o++)if(u(t,o)===u(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===c)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(n+c>a&&(n=a-c),o=n;o>=0;o--){for(var h=!0,p=0;p<c;p++)if(u(t,o+p)!==u(e,p)){h=!1;break}if(h)return o}return-1}function b(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function _(t,e,n,r){return V(B(e,t.length-n),t,n,r)}function w(t,e,n,r){return V(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function S(t,e,n,r){return w(t,e,n,r)}function C(t,e,n,r){return V(q(e),t,n,r)}function E(t,e,n,r){return V(function(t,e){for(var n,r,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function x(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function T(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,s,a,c,u=t[i],l=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=n)switch(h){case 1:u<128&&(l=u);break;case 2:128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)>127&&(l=c);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(c=(15&u)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(l=c)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=h}return function(t){var e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=I));return n}(r)}e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,n){return u(null,t,e,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,n){return function(t,e,n,r){return l(e),e<=0?a(t,e):void 0!==n?"string"==typeof r?a(t,e).fill(n,r):a(t,e).fill(n):a(t,e)}(null,t,e,n)},c.allocUnsafe=function(t){return h(null,t)},c.allocUnsafeSlow=function(t){return h(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=c.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var s=t[n];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},c.byteLength=f,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?T(this,0,t):v.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,n,r,i){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(r,i),l=t.slice(e,n),h=0;h<a;++h)if(u[h]!==l[h]){o=u[h],s=l[h];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},c.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},c.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},c.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return _(this,t,e,n);case"ascii":return w(this,t,e,n);case"latin1":case"binary":return S(this,t,e,n);case"base64":return C(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function k(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function O(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function A(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=H(t[o]);return i}function R(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function N(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,n,r,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function M(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function D(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function L(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(t,e,n,r,o){return o||L(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function U(t,e,n,r,o){return o||L(t,0,n,8),i.write(t,e,n,r,52,8),n+8}c.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=c.prototype;else{var i=e-t;n=new c(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},c.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||N(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},c.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||N(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},c.prototype.readUInt8=function(t,e){return e||N(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||N(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||N(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||N(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},c.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||N(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return e||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||N(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(t,e){e||N(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(t,e){return e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||N(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||N(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||N(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||N(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||P(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},c.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||P(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},c.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>
vendor: 5,458 bytes, line 408
4088,this[e+1]=255&t):M(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);P(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},c.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);P(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},c.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,n){return j(this,t,e,!0,n)},c.prototype.writeFloatBE=function(t,e,n){return j(this,t,e,!1,n)},c.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},c.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},c.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},c.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var s=c.isBuffer(t)?t:B(new c(t,r).toString()),a=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%a]}return this};var F=/[^+\/0-9A-Za-z-_]/g;function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function B(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function q(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(71))},function(t,e,n){"use strict";e.byteLength=function(t){var e=u(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=u(t),s=r[0],a=r[1],c=new o(function(t,e,n){return 3*(e+n)/4-n}(0,s,a)),l=0,h=a>0?s-4:s;for(n=0;n<h;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],c[l++]=e>>16&255,c[l++]=e>>8&255,c[l++]=255&e;2===a&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,c[l++]=255&e);1===a&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,c[l++]=e>>8&255,c[l++]=255&e);return c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(l(t,s,s+16383>a?a:s+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
vendor: 4,179 bytes, line 408
408+/",a=0,c=s.length;a<c;++a)r[a]=s[a],i[s.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,u=c>>1,l=-7,h=n?i-1:0,p=n?-1:1,d=t[e+h];for(h+=p,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+t[e+h],h+=p,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+t[e+h],h+=p,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),o-=u}return(d?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,c,u=8*o-i-1,l=(1<<u)-1,h=l>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,f=r?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+h>=1?p/c:p*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*c-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[n+d]=255&a,d+=f,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[n+d]=255&s,d+=f,s/=256,u-=8);t[n+d-f]|=128*v}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e){t.exports=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(138);t.exports=function(t){if(Array.isArray(t))return r(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(60).default;t.exports=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(141),i=n(142),o=n(228),s=n(144),a=n(145),c=n(229),u=n(230);function l(){"use strict";var e=i(),n=e.m(l),h=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function p(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))}var d={throw:1,return:2,break:3,continue:3};function f(t){var e,n;return function(r){e||(e={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(t,e){return n(r.a,d[t],e)},delegateYield:function(t,i,o){return e.resultName=i,n(r.d,u(t),o)},finish:function(t){return n(r.f,t)}},n=function(t,n,i){r.p=e.prev,r.n=e.next;try{return t(n,i)}finally{e.next=r.n}}),e.resultName&&(e[e.resultName]=r.v,e.resultName=void 0),e.sent=r.v,e.next=r.n;try{return t.call(this,e)}finally{r.p=e.prev,r.n=e.next}}}return(t.exports=l=function(){return{wrap:function(t,n,r,i){return e.w(f(t),n,r,i&&i.reverse())},isGeneratorFunction:p,mark:e.m,awrap:function(t,e){return new r(t,e)},AsyncIterator:a,async:function(t,e,n,r,i){return(p(e)?s:o)(f(t),e,n,r,i)},keys:c,values:u}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=l,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(144);t.exports=function(t,e,n,i,o){var s=r(t,e,n,i,o);return s.next().then((function(t){return t.done?t.value:s.next()}))},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){var e=Object(t),n=[];for(var r in e)n.unshift(r);return function t(){for(;n.length;)if((r=n.pop())in e)return t.value=r,t.done=!1,t;return t.done=!0,t}}
408,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(60).default;t.exports=function(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(r(t)+" is not iterable")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";var r=n(55),i=n(146),o=n(232),s=n(152);var a=function t(e){var n=new o(e),a=i(o.prototype.request,n);return r.extend(a,o.prototype,n),r.extend(a,n),a.create=function(n){return t(s(e,n))},a}(n(89));a.Axios=o,a.Cancel=n(90),a.CancelToken=n(245),a.isCancel=n(151),a.VERSION=n(153).version,a.all=function(t){return Promise.all(t)},a.spread=n(246),a.isAxiosError=n(247),t.exports=a,t.exports.default=a},function(t,e,n){"use strict";var r=n(55),i=n(147),o=n(233),s=n(234),a=n(152),c=n(244),u=c.validators;function l(t){this.defaults=t,this.interceptors={request:new o,response:new o}}l.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&c.assertOptions(e,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(r=r&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var i,o=[];if(this.interceptors.response.forEach((function(t){o.push(t.fulfilled,t.rejected)})),!r){var l=[s,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(o),i=Promise.resolve(t);l.length;)i=i.then(l.shift(),l.shift());return i}for(var h=t;n.length;){var p=n.shift(),d=n.shift();try{h=p(h)}catch(t){d(t);break}}try{i=s(h)}catch(t){return Promise.reject(t)}for(;o.length;)i=i.then(o.shift(),o.shift());return i},l.prototype.getUri=function(t){return t=a(this.defaults,t),i(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(t){l.prototype[t]=function(e,n){return this.request(a(n||{},{method:t,url:e,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(t){l.prototype[t]=function(e,n,r){return this.request(a(r||{},{method:t,url:e,data:n}))}})),t.exports=l},function(t,e,n){"use strict";var r=n(55);function i(){this.handlers=[]}i.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=i},function(t,e,n){"use strict";var r=n(55),i=n(235),o=n(151),s=n(89),a=n(90);function c(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new a("canceled")}t.exports=function(t){return c(t),t.headers=t.headers||{},t.data=i.call(t,t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||s.adapter)(t).then((function(e){return c(t),e.data=i.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return o(e)||(c(t),e&&e.response&&(e.response.data=i.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,n){"use strict";var r=n(55),i=n(89);t.exports=function(t,e,n){var o=this||i;return r.forEach(n,(function(n){t=n.call(o,t,e)})),t}},function(t,e,n){"use strict";var r=n(55);t.exports=function(t,e){r.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))}},function(t,e,n){"use strict";var r=n(150);t.exports=function(t,e,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},function(t,e,n){"use strict";var r=n(55);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,i,o,s){var a=[];a.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";var r=n(240),i=n(241);t.exports=function(t,e){return t&&!r(e)?i(t,e):e}},function(t,e,n){"use strict";
vendor: 4,207 bytes, line 408
408t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(55),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,o,s={};return t?(r.forEach(t.split("\n"),(function(t){if(o=t.indexOf(":"),e=r.trim(t.substr(0,o)).toLowerCase(),n=r.trim(t.substr(o+1)),e){if(s[e]&&i.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([n]):s[e]?s[e]+", "+n:n}})),s):s}},function(t,e,n){"use strict";var r=n(55);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){var n=r.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r=n(153).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){i[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));var o={};i.transitional=function(t,e,n){function i(t,e){return"[Axios v"+r+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,r,s){if(!1===t)throw new Error(i(r," has been removed"+(e?" in "+e:"")));return e&&!o[r]&&(o[r]=!0,console.warn(i(r," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,r,s)}},t.exports={assertOptions:function(t,e,n){if("object"!=typeof t)throw new TypeError("options must be an object");for(var r=Object.keys(t),i=r.length;i-- >0;){var o=r[i],s=e[o];if(s){var a=t[o],c=void 0===a||s(a,o,t);if(!0!==c)throw new TypeError("option "+o+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+o)}},validators:i}},function(t,e,n){"use strict";var r=n(90);function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;this.promise.then((function(t){if(n._listeners){var e,r=n._listeners.length;for(e=0;e<r;e++)n._listeners[e](t);n._listeners=null}})),this.promise.then=function(t){var e,r=new Promise((function(t){n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t){n.reason||(n.reason=new r(t),e(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},i.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},i.source=function(){var t;return{token:new i((function(e){t=e})),cancel:t}},t.exports=i},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){"use strict";t.exports=function(t){return"object"==typeof t&&!0===t.isAxiosError}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],c=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(t){u=!0,i=t}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}
408,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(253),i=n(112);t.exports=function(t,e,n){if(r())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var s=new(t.bind.apply(t,o));return n&&i(s,n.prototype),s},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function n(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(t.exports=n=function(){return!!e},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,n){(function(t){var r=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(256),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(71))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,s,a,c=1,u={},l=!1,h=t.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(t);p=p&&p.setTimeout?p:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){f(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){f(t.data)},r=function(t){o.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(t){var e=h.createElement("script");e.onreadystatechange=function(){f(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(f,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&f(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),r=function(e){t.postMessage(s+e,"*")}),p.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var i={callback:t,args:e};return u[c]=i,r(c),c++},p.clearImmediate=d}function d(t){delete u[t]}function f(t){if(l)setTimeout(f,0,t);else{var e=u[t];if(e){l=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(n,r)}}(e)}finally{d(t),l=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(71),n(64))},function(t,e,n){(function(t){(function(){var e,r=n(130).default,i="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)};var o=function(e){e=["object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof t&&t,e];for(var n=0;n<e.length;++n){var r=e[n];if(r&&r.Math==Math)return r}return globalThis}(this);function s(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}function a(t){var e="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:s(t)}}!function(t,e){if(e){var n=o;t=t.split(".");for(var r=0;r<t.length-1;r++){var s=t[r];s in n||(n[s]={}),n=n[s]}(e=e(r=n[t=t[t.length-1]]))!=r&&null!=e&&i(n,t,{configurable:!0,writable:!0,value:e})}}("Promise",(function(t){function e(t){this.b=0,this.c=void 0,this.a=[];var e=this.f();try{t(e.resolve,e.reject)}catch(t){e.reject(t)}}function n(){this.a=null}function r(t){return t instanceof e?t:new e((function(e){e(t)}))}if(t)return t;n.prototype.b=function(t){if(null==this.a){this.a=[];var e=this;this.c((function(){e.g()}))}this.a.push(t)};var i=o.setTimeout;n.prototype.c=function(t){i(t,0)},n.prototype.g=function(){for(;this.a&&this.a.length;){var t=this.a;this.a=[];for(var e=0;e<t.length;++e){var n=t[e];t[e]=null;try{n()}catch(t){this.f(t)}}}this.a=null},n.prototype.f=function(t){this.c((function(){throw t}))},e.prototype.f=function(){function t(t){return function(r){n||(n=!0,t.call(e,r))}}var e=this,n=!1;return{resolve:t(this.v),reject:t(this.g)}}
vendor: 1,338 bytes, line 408
408,e.prototype.v=function(t){if(t===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(t instanceof e)this.o(t);else{t:switch(typeof t){case"object":var n=null!=t;break t;case"function":n=!0;break t;default:n=!1}n?this.m(t):this.h(t)}},e.prototype.m=function(t){var e=void 0;try{e=t.then}catch(t){return void this.g(t)}"function"==typeof e?this.u(e,t):this.h(t)},e.prototype.g=function(t){this.i(2,t)},e.prototype.h=function(t){this.i(1,t)},e.prototype.i=function(t,e){if(0!=this.b)throw Error("Cannot settle("+t+", "+e+"): Promise already settled in state"+this.b);this.b=t,this.c=e,this.l()},e.prototype.l=function(){if(null!=this.a){for(var t=0;t<this.a.length;++t)s.b(this.a[t]);this.a=null}};var s=new n;return e.prototype.o=function(t){var e=this.f();t.Pa(e.resolve,e.reject)},e.prototype.u=function(t,e){var n=this.f();try{t.call(e,n.resolve,n.reject)}catch(t){n.reject(t)}},e.prototype.then=function(t,n){function r(t,e){return"function"==typeof t?function(e){try{i(t(e))}catch(t){o(t)}}:e}var i,o,s=new e((function(t,e){i=t,o=e}));return this.Pa(r(t,i),r(n,o)),s},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype.Pa=function(t,e){function n(){switch(r.b){case 1:t(r.c);break;case 2:e(r.c);break;default:throw Error("Unexpected state: "+r.b)}}var r=this;null==this.a?s.b(n):this.a.push(n)}
408,e.resolve=r,e.reject=function(t){return new e((function(e,n){n(t)}))},e.race=function(t){return new e((function(e,n){for(var i=a(t),o=i.next();!o.done;o=i.next())r(o.value).Pa(e,n)}))},e.all=function(t){var n=a(t),i=n.next();return i.done?r([]):new e((function(t,e){function o(e){return function(n){s[e]=n,0==--a&&t(s)}}var s=[],a=0;do{s.push(void 0),a++,r(i.value).Pa(o(s.length-1),e),i=n.next()}while(!i.done)}))},e}));var c=c||{},u=this||self,l=/^[\w+/_-]+[=]{0,2}$/,h=null;function p(){}function d(t){var e=typeof t;if("object"==e){if(!t)return"null";if(t instanceof Array)return"array";if(t instanceof Object)return e;var n=Object.prototype.toString.call(t);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof t.length&&void 0!==t.splice&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||void 0!==t.call&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&void 0===t.call)return"object";return e}function f(t){var e=d(t);return"array"==e||"object"==e&&"number"==typeof t.length}function v(t){return"function"==d(t)}function g(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function m(t){return Object.prototype.hasOwnProperty.call(t,y)&&t[y]||(t[y]=++b)}var y="closure_uid_"+(1e9*Math.random()>>>0),b=0;function _(t,e,n){return t.call.apply(t.bind,arguments)}function w(t,e,n){if(!t)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),t.apply(e,n)}}return function(){return t.apply(e,arguments)}}function S(t,e,n){return(S=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?_:w).apply(null,arguments)}function C(t,e){var n=Array.prototype.slice.call(arguments,1);return function(){var e=n.slice();return e.push.apply(e,arguments),t.apply(this,e)}}var E=Date.now||function(){return+new Date};function x(t,e){function n(){}n.prototype=e.prototype,t.$a=e.prototype,t.prototype=new n,t.prototype.constructor=t}
408function T(t,e,n){this.code=O+t,this.message=e||A[t]||"",this.a=n||null}function I(t){var e=t&&t.code;return e?new T(e.substring(O.length),t.message,t.serverResponse):null}x(T,Error),T.prototype.w=function(){var t={code:this.code,message:this.message};return this.a&&(t.serverResponse=this.a),t},T.prototype.toJSON=function(){return this.w()};var k,O="auth/",A={"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must al
408ways have a verified email.","email-already-in-use":"The email address is already in use by another account.","expired-action-code":"The action code has expired. ","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal error has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal error has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invali
408d-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal error has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network error (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal error has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted.  Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled."},R={kd:{Sa:"https://staging-identitytoolkit.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",Ya:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Va:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"b"},rd:{Sa:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",Ya:"https://securetoken.googleapis.com/v1/token",Va:"https://identitytoolkit.googleapis.com/v2/",id:"p"},td:{Sa:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",Ya:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Va:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"s"},ud:{Sa:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",Ya:"https://test-securetoken.sandbox.googleapis.com/v1/token",Va:"https://test-identitytoolkit.sandbox.googleapis.com/v2/",id:"t"}};function N(t){for(var e in R)if(R[e].id===t)return{firebaseEndpoint:(t=R[e]).Sa,secureTokenEndpoint:t.Ya,identityPlatformEndpoint:t.Va};return null}function P(t){if(!t)return!1;
408try{return!!t.$goog_Thenable}catch(t){return!1}}function M(t){if(Error.captureStackTrace)Error.captureStackTrace(this,M);else{var e=Error().stack;e&&(this.stack=e)}t&&(this.message=String(t))}function D(t,e){for(var n="",r=(t=t.split("%s")).length-1,i=0;i<r;i++)n+=t[i]+(i<e.length?e[i]:"%s");M.call(this,n+t[r])}function L(t,e){throw new D("Failure"+(t?": "+t:""),Array.prototype.slice.call(arguments,1))}function j(t,e){this.c=t,this.f=e,this.b=0,this.a=null}function U(t,e){t.f(e),100>t.b&&(t.b++,e.next=t.a,t.a=e)}function F(){this.b=this.a=null}k=N("__EID__")?"__EID__":void 0,x(M,Error),M.prototype.name="CustomError",x(D,M),D.prototype.name="AssertionError",j.prototype.get=function(){if(0<this.b){this.b--;var t=this.a;this.a=t.next,t.next=null}else t=this.c();return t};var H=new j((function(){return new q}),(function(t){t.reset()}));function B(){var t=be,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function q(){this.next=this.b=this.a=null}F.prototype.add=function(t,e){var n=H.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},q.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},q.prototype.reset=function(){this.next=this.b=this.a=null};var V=Array.prototype.indexOf?function(t,e){return Array.prototype.indexOf.call(t,e,void 0)}:function(t,e){if("string"==typeof t)return"string"!=typeof e||1!=e.length?-1:t.indexOf(e,0);for(var n=0;n<t.length;n++)if(n in t&&t[n]===e)return n;return-1},W=Array.prototype.forEach?function(t,e,n){Array.prototype.forEach.call(t,e,n)}:function(t,e,n){for(var r=t.length,i="string"==typeof t?t.split(""):t,o=0;o<r;o++)o in i&&e.call(n,i[o],o,t)};var z=Array.prototype.filter?function(t,e){return Array.prototype.filter.call(t,e,void 0)}:function(t,e){for(var n=t.length,r=[],i=0,o="string"==typeof t?t.split(""):t,s=0;s<n;s++)if(s in o){var a=o[s];e.call(void 0,a,s,t)&&(r[i++]=a)}return r},$=Array.prototype.map?function(t,e){return Array.prototype.map.call(t,e,void 0)}:function(t,e){for(var n=t.length,r=Array(n),i="string"==typeof t?t.split(""):t,o=0;o<n;o++)o in i&&(r[o]=e.call(void 0,i[o],o,t));return r},Y=Array.prototype.some?function(t,e){return Array.prototype.some.call(t,e,void 0)}:function(t,e){for(var n=t.length,r="string"==typeof t?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t))return!0;return!1};function K(t,e){return 0<=V(t,e)}function G(t,e){var n;return(n=0<=(e=V(t,e)))&&Array.prototype.splice.call(t,e,1),n}function Q(t,e){!function(t,e){for(var n="string"==typeof t?t.split(""):t,r=t.length-1;0<=r;--r)r in n&&e.call(void 0,n[r],r,t)}(t,(function(n,r){e.call(void 0,n,r,t)&&1==Array.prototype.splice.call(t,r,1).length&&0}))}function X(t){return Array.prototype.concat.apply([],arguments)}function J(t){var e=t.length;if(0<e){for(var n=Array(e),r=0;r<e;r++)n[r]=t[r];return n}return[]}var Z,tt=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]},et=/&/g,nt=/</g,rt=/>/g,it=/"/g,ot=/'/g,st=/\x00/g,at=/[\x00&<>"']/;function ct(t,e){return-1!=t.indexOf(e)}function ut(t,e){return t<e?-1:t>e?1:0}t:{var lt=u.navigator;if(lt){var ht=lt.userAgent;if(ht){Z=ht;break t}}Z=""}function pt(t){return ct(Z,t)}function dt(t,e){for(var n in t)e.call(void 0,t[n],n,t)}function ft(t){for(var e in t)return!1;return!0}function vt(t){var e,n={};for(e in t)n[e]=t[e];return n}var gt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function mt(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])t[n]=r[n];for(var o=0;o<gt.length;o++)n=gt[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function yt(t,e){t:{try{var n=t&&t.ownerDocument,r=n&&(n.defaultView||n.parentWindow);if((r=r||u).Element&&r.Location){var i=r;break t}}catch(t){}i=null}if(i&&void 0!==i[e]&&(!t||!(t instanceof i[e])&&(t instanceof i.Location||t instanceof i.Element))){if(g(t))try{var o=t.constructor.displayName||t.constructor.name||Object.prototype.toString.call(t)}catch(t){o="<object could not be stringified>"}else o=void 0===t?"undefined":null===t?"null":typeof t;L("Argument is not a %s (or a non-Element, non-Location mock); got: %s",e,o)}}function bt(t,e){this.a=t===St&&e||"",this.b=wt}function _t(t){return t instanceof bt&&t.constructor===bt&&t.b===wt?t.a:(L("expected object of type Const, got '"+t+"'"),"type_error:Const")}bt.prototype.sa=!0,bt.prototype.ra=function(){return this.a},bt.prototype.toString=function(){return"Const{"+this.a+"}"};var wt={},St={},Ct=new bt(St,"");function Et(t,e){this.a=t===At&&e||"",this.b=Ot}function xt(t){return t instanceof Et&&t.constructor===Et&&t.b===Ot?t.a:(L("expected object of type TrustedResourceUrl, got '"+t+"' of type "+d(t)),"type_error:TrustedResourceUrl")}function Tt(t,e){var n=_t(t);if(!kt.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return t=n.replace(It,(function(t,r){if(!Object.prototype.hasOwnProperty.call(e,r))throw Error('Found marker, "'+r+'", in format str
408ing, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(e));return(t=e[r])instanceof bt?_t(t):encodeURIComponent(String(t))})),new Et(At,t)}Et.prototype.sa=!0,Et.prototype.ra=function(){return this.a.toString()},Et.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var It=/%{(\w+)}/g,kt=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,Ot={},At={};function Rt(t,e){this.a=t===Lt&&e||"",this.b=Dt}function Nt(t){return t instanceof Rt&&t.constructor===Rt&&t.b===Dt?t.a:(L("expected object of type SafeUrl, got '"+t+"' of type "+d(t)),"type_error:SafeUrl")}Rt.prototype.sa=!0,Rt.prototype.ra=function(){return this.a.toString()},Rt.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var Pt=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function Mt(t){return t instanceof Rt?t:(t="object"==typeof t&&t.sa?t.ra():String(t),Pt.test(t)||(t="about:invalid#zClosurez"),new Rt(Lt,t))}var Dt={},Lt={};function jt(){this.a="",this.b=Ft}function Ut(t){return t instanceof jt&&t.constructor===jt&&t.b===Ft?t.a:(L("expected object of type SafeHtml, got '"+t+"' of type "+d(t)),"type_error:SafeHtml")}jt.prototype.sa=!0,jt.prototype.ra=function(){return this.a.toString()},jt.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var Ft={};function Ht(t){var e=new jt;return e.a=t,e}Ht("<!DOCTYPE html>");var Bt=Ht("");function qt(t,e){for(var n=t.split("%s"),r="",i=Array.prototype.slice.call(arguments,1);i.length&&1<n.length;)r+=n.shift()+i.shift();return r+n.join("%s")}function Vt(t){return at.test(t)&&(-1!=t.indexOf("&")&&(t=t.replace(et,"&amp;")),-1!=t.indexOf("<")&&(t=t.replace(nt,"&lt;")),-1!=t.indexOf(">")&&(t=t.replace(rt,"&gt;")),-1!=t.indexOf('"')&&(t=t.replace(it,"&quot;")),-1!=t.indexOf("'")&&(t=t.replace(ot,"&#39;")),-1!=t.indexOf("\0")&&(t=t.replace(st,"&#0;"))),t}function Wt(t){return Wt[" "](t),t}Ht("<br>"),Wt[" "]=p;var zt,$t,Yt=pt("Opera"),Kt=pt("Trident")||pt("MSIE"),Gt=pt("Edge"),Qt=Gt||Kt,Xt=pt("Gecko")&&!(ct(Z.toLowerCase(),"webkit")&&!pt("Edge"))&&!(pt("Trident")||pt("MSIE"))&&!pt("Edge"),Jt=ct(Z.toLowerCase(),"webkit")&&!pt("Edge");function Zt(){var t=u.document;return t?t.documentMode:void 0}t:{var te="",ee=($t=Z,Xt?/rv:([^\);]+)(\)|;)/.exec($t):Gt?/Edge\/([\d\.]+)/.exec($t):Kt?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec($t):Jt?/WebKit\/(\S+)/.exec($t):Yt?/(?:Version)[ \/]?(\S+)/.exec($t):void 0);if(ee&&(te=ee?ee[1]:""),Kt){var ne=Zt();if(null!=ne&&ne>parseFloat(te)){zt=String(ne);break t}}zt=te}var re,ie={};function oe(t){return function(t,e){var n=ie;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e(t)}(t,(function(){for(var e=0,n=tt(String(zt)).split("."),r=tt(String(t)).split("."),i=Math.max(n.length,r.length),o=0;0==e&&o<i;o++){var s=n[o]||"",a=r[o]||"";do{if(s=/(\d*)(\D*)(.*)/.exec(s)||["","","",""],a=/(\d*)(\D*)(.*)/.exec(a)||["","","",""],0==s[0].length&&0==a[0].length)break;e=ut(0==s[1].length?0:parseInt(s[1],10),0==a[1].length?0:parseInt(a[1],10))||ut(0==s[2].length,0==a[2].length)||ut(s[2],a[2]),s=s[3],a=a[3]}while(0==e)}return 0<=e}))}re=u.document&&Kt?Zt():void 0;try{new self.OffscreenCanvas(0,0).getContext("2d")}catch($t){}var se=!Kt||9<=Number(re);function ae(t){var e=document;return"string"==typeof t?e.getElementById(t):t}function ce(t,e){dt(e,(function(e,n){e&&"object"==typeof e&&e.sa&&(e=e.ra()),"style"==n?t.style.cssText=e:"class"==n?t.className=e:"for"==n?t.htmlFor=e:he.hasOwnProperty(n)?t.setAttribute(he[n],e):0==n.lastIndexOf("aria-",0)||0==n.lastIndexOf("data-",0)?t.setAttribute(n,e):t[n]=e}))}var ue,le,he={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};function pe(t,e,n){var r=arguments,i=document,o=String(r[0]),s=r[1];if(!se&&s&&(s.name||s.type)){if(o=["<",o],s.name&&o.push(' name="',Vt(s.name),'"'),s.type){o.push(' type="',Vt(s.type),'"');var a={};mt(a,s),delete a.type,s=a}o.push(">"),o=o.join("")}
408return o=de(i,o),s&&("string"==typeof s?o.className=s:Array.isArray(s)?o.className=s.join(" "):ce(o,s)),2<r.length&&function(t,e,n){function r(n){n&&e.appendChild("string"==typeof n?t.createTextNode(n):n)}for(var i=2;i<n.length;i++){var o=n[i];!f(o)||g(o)&&0<o.nodeType?r(o):W(fe(o)?J(o):o,r)}}(i,o,r),o}function de(t,e){return e=String(e),"application/xhtml+xml"===t.contentType&&(e=e.toLowerCase()),t.createElement(e)}function fe(t){if(t&&"number"==typeof t.length){if(g(t))return"function"==typeof t.item||"string"==typeof t.item;if(v(t))return"function"==typeof t.item}return!1}function ve(t){u.setTimeout((function(){throw t}),0)}function ge(){var t=u.MessageChannel;if(void 0===t&&"undefined"!=typeof window&&window.postMessage&&window.addEventListener&&!pt("Presto")&&(t=function(){var t=de(document,"IFRAME");t.style.display="none",function(t){var e=new Et(At,_t(Ct));yt(t,"HTMLIFrameElement"),t.src=xt(e).toString()}(t),document.documentElement.appendChild(t);var e=t.contentWindow;(t=e.document).open(),t.write(Ut(Bt)),t.close();var n="callImmediate"+Math.random(),r="file:"==e.location.protocol?"*":e.location.protocol+"//"+e.location.host;t=S((function(t){"*"!=r&&t.origin!=r||t.data!=n||this.port1.onmessage()}),this),e.addEventListener("message",t,!1),this.port1={},this.port2={postMessage:function(){e.postMessage(n,r)}}}),void 0!==t&&!pt("Trident")&&!pt("MSIE")){var e=new t,n={},r=n;return e.port1.onmessage=function(){if(void 0!==n.next){var t=(n=n.next).Fb;n.Fb=null,t()}},function(t){r.next={Fb:t},r=r.next,e.port2.postMessage(0)}}return function(t){u.setTimeout(t,0)}}function me(t,e){le||function(){if(u.Promise&&u.Promise.resolve){var t=u.Promise.resolve(void 0);le=function(){t.then(_e)}}else le=function(){var t=_e;!v(u.setImmediate)||u.Window&&u.Window.prototype&&!pt("Edge")&&u.Window.prototype.setImmediate==u.setImmediate?(ue||(ue=ge()),ue(t)):u.setImmediate(t)}}(),ye||(le(),ye=!0),be.add(t,e)}var ye=!1,be=new F;function _e(){for(var t;t=B();){try{t.a.call(t.b)}catch(t){ve(t)}U(H,t)}ye=!1}function we(t,e){if(this.a=Se,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,t!=p)try{var n=this;t.call(e,(function(t){Me(n,Ce,t)}),(function(t){if(!(t instanceof Be))try{if(t instanceof Error)throw t;throw Error("Promise rejected.")}catch(t){}Me(n,Ee,t)}))}catch(t){Me(this,Ee,t)}}var Se=0,Ce=2,Ee=3;function xe(){this.next=this.f=this.b=this.g=this.a=null,this.c=!1}xe.prototype.reset=function(){this.f=this.b=this.g=this.a=null,this.c=!1};var Te=new j((function(){return new xe}),(function(t){t.reset()}));function Ie(t,e,n){var r=Te.get();return r.g=t,r.b=e,r.f=n,r}function ke(t){if(t instanceof we)return t;var e=new we(p);return Me(e,Ce,t),e}
408function Oe(t){return new we((function(e,n){n(t)}))}function Ae(t,e,n){De(t,e,n,null)||me(C(e,t))}function Re(t){return new we((function(e){var n=t.length,r=[];if(n)for(var i=function(t,i,o){n--,r[t]=i?{Ob:!0,value:o}:{Ob:!1,reason:o},0==n&&e(r)},o=0;o<t.length;o++)Ae(t[o],C(i,o,!0),C(i,o,!1));else e(r)}))}function Ne(t,e){t.b||t.a!=Ce&&t.a!=Ee||Le(t),t.f?t.f.next=e:t.b=e,t.f=e}function Pe(t,e,n,r){var i=Ie(null,null,null);return i.a=new we((function(t,o){i.g=e?function(n){try{var i=e.call(r,n);t(i)}catch(t){o(t)}}:t,i.b=n?function(e){try{var i=n.call(r,e);void 0===i&&e instanceof Be?o(e):t(i)}catch(t){o(t)}}:o})),i.a.c=t,Ne(t,i),i.a}function Me(t,e,n){t.a==Se&&(t===n&&(e=Ee,n=new TypeError("Promise cannot resolve to itself")),t.a=1,De(n,t.Zc,t.$c,t)||(t.i=n,t.a=e,t.c=null,Le(t),e!=Ee||n instanceof Be||function(t,e){t.g=!0,me((function(){t.g&&He.call(null,e)}))}(t,n)))}function De(t,e,n,r){if(t instanceof we)return Ne(t,Ie(e||p,n||null,r)),!0;if(P(t))return t.then(e,n,r),!0;if(g(t))try{var i=t.then;if(v(i))return function(t,e,n,r,i){function o(t){s||(s=!0,r.call(i,t))}var s=!1;try{e.call(t,(function(t){s||(s=!0,n.call(i,t))}),o)}catch(t){o(t)}}(t,i,e,n,r),!0}catch(t){return n.call(r,t),!0}return!1}function Le(t){t.h||(t.h=!0,me(t.fc,t))}function je(t){var e=null;return t.b&&(e=t.b,t.b=e.next,e.next=null),t.b||(t.f=null),e}function Ue(t,e,n,r){if(n==Ee&&e.b&&!e.c)for(;t&&t.g;t=t.c)t.g=!1;if(e.a)e.a.c=null,Fe(e,n,r);else try{e.c?e.g.call(e.f):Fe(e,n,r)}catch(t){He.call(null,t)}U(Te,e)}function Fe(t,e,n){e==Ce?t.g.call(t.f,n):t.b&&t.b.call(t.f,n)}we.prototype.then=function(t,e,n){return Pe(this,v(t)?t:null,v(e)?e:null,n)},we.prototype.$goog_Thenable=!0,(e=we.prototype).na=function(t,e){return(t=Ie(t,t,e)).c=!0,Ne(this,t),this},e.s=function(t,e){return Pe(this,null,t,e)},e.cancel=function(t){if(this.a==Se){var e=new Be(t);me((function(){!function t(e,n){if(e.a==Se)if(e.c){var r=e.c;if(r.b){for(var i=0,o=null,s=null,a=r.b;a&&(a.c||(i++,a.a==e&&(o=a),!(o&&1<i)));a=a.next)o||(s=a);o&&(r.a==Se&&1==i?t(r,n):(s?((i=s).next==r.f&&(r.f=i),i.next=i.next.next):je(r),Ue(r,o,Ee,n)))}e.c=null}else Me(e,Ee,n)}(this,e)}),this)}},e.Zc=function(t){this.a=Se,Me(this,Ce,t)},e.$c=function(t){this.a=Se,Me(this,Ee,t)},e.fc=function(){for(var t;t=je(this);)Ue(this,t,this.a,this.i);this.h=!1};var He=ve;function Be(t){M.call(this,t)}function qe(){0!=Ve&&(We[m(this)]=this),this.xa=this.xa,this.oa=this.oa}x(Be,M),Be.prototype.name="cancel";var Ve=0,We={};function ze(t){if(!t.xa&&(t.xa=!0,t.Da(),0!=Ve)){var e=m(t);if(0!=Ve&&t.oa&&0<t.oa.length)throw Error(t+" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.");delete We[e]}}qe.prototype.xa=!1,qe.prototype.Da=function(){if(this.oa)for(;this.oa.length;)this.oa.shift()()};var $e=Object.freeze||function(t){return t},Ye=!Kt||9<=Number(re),Ke=Kt&&!oe("9"),Ge=function(){if(!u.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{u.addEventListener("test",p,e),u.removeEventListener("test",p,e)}catch(t){}return t}();function Qe(t,e){this.type=t,this.b=this.target=e,this.defaultPrevented=!1}function Xe(t,e){if(Qe.call(this,t?t.type:""),this.relatedTarget=this.b=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.pointerId=0,this.pointerType="",this.a=null,t){var n=this.type=t.type,r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:null;if(this.target=t.target||t.srcElement,this.b=e,e=t.relatedTarget){if(Xt){t:{try{Wt(e.nodeName);var i=!0;break t}catch(t){}i=!1}i||(e=null)}}else"mouseover"==n?e=t.fromElement:"mouseout"==n&&(e=t.toElement);this.relatedTarget=e,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==t.clientX?t.clientX:t.pageX,this.clientY=void 0!==t.clientY?t.clientY:t.pageY,this.screenX=t.screenX||0,this.screenY=t.screenY||0),this.button=t.button,this.key=t.key||"",this.ctrlKey=t.ctrlKey,this.altKey=t.altKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.pointerId=t.pointerId||0,this.pointerType="string"==typeof t.pointerType?t.pointerType:Je[t.pointerType]||"",this.a=t,t.defaultPrevented&&this.preventDefault()}}Qe.prototype.preventDefault=function(){this.defaultPrevented=!0},x(Xe,Qe);var Je=$e({2:"touch",3:"pen",4:"mouse"});Xe.prototype.preventDefault=function(){Xe.$a.preventDefault.call(this);var t=this.a;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,Ke)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(t){}},Xe.prototype.g=function(){return this.a};var Ze="closure_listenable_"+(1e6*Math.random()|0),tn=0;function en(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.Ua=i,this.key=++tn,this.va=this.Oa=!1}
408function nn(t){t.va=!0,t.listener=null,t.proxy=null,t.src=null,t.Ua=null}function rn(t){this.src=t,this.a={},this.b=0}function on(t,e){var n=e.type;n in t.a&&G(t.a[n],e)&&(nn(e),0==t.a[n].length&&(delete t.a[n],t.b--))}function sn(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.va&&o.listener==e&&o.capture==!!n&&o.Ua==r)return i}return-1}rn.prototype.add=function(t,e,n,r,i){var o=t.toString();(t=this.a[o])||(t=this.a[o]=[],this.b++);var s=sn(t,e,r,i);return-1<s?(e=t[s],n||(e.Oa=!1)):((e=new en(e,this.src,o,!!r,i)).Oa=n,t.push(e)),e};var an="closure_lm_"+(1e6*Math.random()|0),cn={};function un(t,e,n,r,i){if(r&&r.once)hn(t,e,n,r,i);else if(Array.isArray(e))for(var o=0;o<e.length;o++)un(t,e[o],n,r,i);else n=_n(n),t&&t[Ze]?Sn(t,e,n,g(r)?!!r.capture:!!r,i):ln(t,e,n,!1,r,i)}function ln(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var s=g(i)?!!i.capture:!!i,a=yn(t);if(a||(t[an]=a=new rn(t)),!(n=a.add(e,n,r,s,o)).proxy){if(r=function(){var t=mn,e=Ye?function(n){return t.call(e.src,e.listener,n)}:function(n){if(!(n=t.call(e.src,e.listener,n)))return n};return e}(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)Ge||(i=s),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(fn(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}0}}function hn(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)hn(t,e[o],n,r,i);else n=_n(n),t&&t[Ze]?Cn(t,e,n,g(r)?!!r.capture:!!r,i):ln(t,e,n,!0,r,i)}function pn(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)pn(t,e[o],n,r,i);else r=g(r)?!!r.capture:!!r,n=_n(n),t&&t[Ze]?(t=t.v,(e=String(e).toString())in t.a&&(-1<(n=sn(o=t.a[e],n,r,i))&&(nn(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.a[e],t.b--)))):t&&(t=yn(t))&&(e=t.a[e.toString()],t=-1,e&&(t=sn(e,n,r,i)),(n=-1<t?e[t]:null)&&dn(n))}function dn(t){if("number"!=typeof t&&t&&!t.va){var e=t.src;if(e&&e[Ze])on(e.v,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(fn(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=yn(e))?(on(n,t),0==n.b&&(n.src=null,e[an]=null)):nn(t)}}}function fn(t){return t in cn?cn[t]:cn[t]="on"+t}function vn(t,e,n,r){var i=!0;if((t=yn(t))&&(e=t.a[e.toString()]))for(e=e.concat(),t=0;t<e.length;t++){var o=e[t];o&&o.capture==n&&!o.va&&(o=gn(o,r),i=i&&!1!==o)}return i}function gn(t,e){var n=t.listener,r=t.Ua||t.src;return t.Oa&&dn(t),n.call(r,e)}function mn(t,e){if(t.va)return!0;if(!Ye){if(!e)t:{e=["window","event"];for(var n=u,r=0;r<e.length;r++)if(null==(n=n[e[r]])){e=null;break t}e=n}if(e=new Xe(r=e,this),n=!0,!(0>r.keyCode||null!=r.returnValue)){t:{var i=!1;if(0==r.keyCode)try{r.keyCode=-1;break t}catch(t){i=!0}(i||null==r.returnValue)&&(r.returnValue=!0)}for(r=[],i=e.b;i;i=i.parentNode)r.push(i);for(t=t.type,i=r.length-1;0<=i;i--){e.b=r[i];var o=vn(r[i],t,!0,e);n=n&&o}for(i=0;i<r.length;i++)e.b=r[i],o=vn(r[i],t,!1,e),n=n&&o}return n}return gn(t,new Xe(e,this))}function yn(t){return(t=t[an])instanceof rn?t:null}var bn="__closure_events_fn_"+(1e9*Math.random()>>>0);function _n(t){return v(t)?t:(t[bn]||(t[bn]=function(e){return t.handleEvent(e)}),t[bn])}function wn(){qe.call(this),this.v=new rn(this),this.$b=this,this.fb=null}function Sn(t,e,n,r,i){t.v.add(String(e),n,!1,r,i)}function Cn(t,e,n,r,i){t.v.add(String(e),n,!0,r,i)}function En(t,e,n,r){if(!(e=t.v.a[String(e)]))return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var s=e[o];if(s&&!s.va&&s.capture==n){var a=s.listener,c=s.Ua||s.src;s.Oa&&on(t.v,s),i=!1!==a.call(c,r)&&i}}return i&&!r.defaultPrevented}function xn(t,e,n){if(v(t))n&&(t=S(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=S(t.handleEvent,t)}return 2147483647<Number(e)?-1:u.setTimeout(t,e||0)}function Tn(t){var e=null;return new we((function(n,r){-1==(e=xn((function(){n(void 0)}),t))&&r(Error("Failed to schedule timer."))})).s((function(t){throw u.clearTimeout(e),t}))}function In(t){if(t.V&&"function"==typeof t.V)return t.V();if("string"==typeof t)return t.split("");
408if(f(t)){for(var e=[],n=t.length,r=0;r<n;r++)e.push(t[r]);return e}for(r in e=[],n=0,t)e[n++]=t[r];return e}function kn(t){if(t.Y&&"function"==typeof t.Y)return t.Y();if(!t.V||"function"!=typeof t.V){if(f(t)||"string"==typeof t){var e=[];t=t.length;for(var n=0;n<t;n++)e.push(n);return e}for(var r in e=[],n=0,t)e[n++]=r;return e}}function On(t,e){this.b={},this.a=[],this.c=0;var n=arguments.length;if(1<n){if(n%2)throw Error("Uneven number of arguments");for(var r=0;r<n;r+=2)this.set(arguments[r],arguments[r+1])}else if(t)if(t instanceof On)for(n=t.Y(),r=0;r<n.length;r++)this.set(n[r],t.get(n[r]));else for(r in t)this.set(r,t[r])}function An(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];Rn(t.b,r)&&(t.a[n++]=r),e++}t.a.length=n}if(t.c!=t.a.length){var i={};for(n=e=0;e<t.a.length;)Rn(i,r=t.a[e])||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function Rn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}x(wn,qe),wn.prototype[Ze]=!0,wn.prototype.addEventListener=function(t,e,n,r){un(this,t,e,n,r)},wn.prototype.removeEventListener=function(t,e,n,r){pn(this,t,e,n,r)},wn.prototype.dispatchEvent=function(t){var e,n=this.fb;if(n)for(e=[];n;n=n.fb)e.push(n);n=this.$b;var r=t.type||t;if("string"==typeof t)t=new Qe(t,n);else if(t instanceof Qe)t.target=t.target||n;else{var i=t;mt(t=new Qe(r,n),i)}if(i=!0,e)for(var o=e.length-1;0<=o;o--){var s=t.b=e[o];i=En(s,r,!0,t)&&i}if(i=En(s=t.b=n,r,!0,t)&&i,i=En(s,r,!1,t)&&i,e)for(o=0;o<e.length;o++)i=En(s=t.b=e[o],r,!1,t)&&i;return i},wn.prototype.Da=function(){if(wn.$a.Da.call(this),this.v){var t,e=this.v;for(t in e.a){for(var n=e.a[t],r=0;r<n.length;r++)nn(n[r]);delete e.a[t],e.b--}}this.fb=null},(e=On.prototype).V=function(){An(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},e.Y=function(){return An(this),this.a.concat()},e.clear=function(){this.b={},this.c=this.a.length=0},e.get=function(t,e){return Rn(this.b,t)?this.b[t]:e},e.set=function(t,e){Rn(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},e.forEach=function(t,e){for(var n=this.Y(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var Nn=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/\\#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Pn(t,e){var n;this.a=this.l=this.f="",this.g=null,this.h=this.c="",this.i=!1,t instanceof Pn?(this.i=void 0!==e?e:t.i,Mn(this,t.f),this.l=t.l,this.a=t.a,Dn(this,t.g),this.c=t.c,Ln(this,er(t.b)),this.h=t.h):t&&(n=String(t).match(Nn))?(this.i=!!e,Mn(this,n[1]||"",!0),this.l=Bn(n[2]||""),this.a=Bn(n[3]||"",!0),Dn(this,n[4]),this.c=Bn(n[5]||"",!0),Ln(this,n[6]||"",!0),this.h=Bn(n[7]||"")):(this.i=!!e,this.b=new Gn(null,this.i))}function Mn(t,e,n){t.f=n?Bn(e,!0):e,t.f&&(t.f=t.f.replace(/:$/,""))}function Dn(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.g=e}else t.g=null}function Ln(t,e,n){e instanceof Gn?(t.b=e,function(t,e){e&&!t.f&&(Qn(t),t.c=null,t.a.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(Jn(this,e),tr(this,n,t))}),t)),t.f=e}(t.b,t.i)):(n||(e=qn(e,Yn)),t.b=new Gn(e,t.i))}function jn(t,e,n){t.b.set(e,n)}function Un(t,e){return t.b.get(e)}function Fn(t){return t instanceof Pn?new Pn(t):new Pn(t,void 0)}function Hn(t,e,n,r){var i=new Pn(null,void 0);return t&&Mn(i,t),e&&(i.a=e),n&&Dn(i,n),r&&(i.c=r),i}function Bn(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function qn(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,Vn),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function Vn(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Pn.prototype.toString=function(){var t=[],e=this.f;e&&t.push(qn(e,Wn,!0),":");var n=this.a;return(n||"file"==e)&&(t.push("//"),(e=this.l)&&t.push(qn(e,Wn,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.g)&&t.push(":",String(n))),(n=this.c)&&(this.a&&"/"!=n.charAt(0)&&t.push("/"),t.push(qn(n,"/"==n.charAt(0)?$n:zn,!0))),(n=this.b.toString())&&t.push("?",n),(n=this.h)&&t.push("#",qn(n,Kn)),t.join("")},Pn.prototype.resolve=function(t){var e=new Pn(this),n=!!t.f;n?Mn(e,t.f):n=!!t.l,n?e.l=t.l:n=!!t.a,n?e.a=t.a:n=null!=t.g;var r=t.c;if(n)Dn(e,t.g);else if(n=!!t.c){if("/"!=r.charAt(0))if(this.a&&!this.c)r="/"+r;else{var i=e.c.lastIndexOf("/");-1!=i&&(r=e.c.substr(0,i+1)+r)}if(".."==(i=r)||"."==i)r="";else if(ct(i,"./")||ct(i,"/.")){r=0==i.lastIndexOf("/",0),i=i.split("/");for(var o=[],s=0;s<i.length;){var a=i[s++];"."==a?r&&s==i.length&&o.push(""):".."==a?((1<o.length||1==o.length&&""!=o[0])&&o.pop(),r&&s==i.length&&o.push("")):(o.push(a),r=!0)}r=o.join("/")}else r=i}return n?e.c=r:n=""!==t.b.toString(),n?Ln(e,er(t.b)):n=!!t.h,n&&(e.h=t.h),e};var Wn=/[#\/\?@]/g,zn=/[#\?:]/g,$n=/[#\?]/g,Yn=/[#\?@]/g,Kn=/#/g;function Gn(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function Qn(t){t.a||(t.a=new On,t.b=0,t.c&&function(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var o=t[n].substring(0,r);i=t[n].substring(r+1)}else o=t[n];e(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(t.c,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})))}function Xn(t){var e=kn(t);
408if(void 0===e)throw Error("Keys are undefined");var n=new Gn(null,void 0);t=In(t);for(var r=0;r<e.length;r++){var i=e[r],o=t[r];Array.isArray(o)?tr(n,i,o):n.add(i,o)}return n}function Jn(t,e){Qn(t),e=nr(t,e),Rn(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,Rn((t=t.a).b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&An(t)))}function Zn(t,e){return Qn(t),e=nr(t,e),Rn(t.a.b,e)}function tr(t,e,n){Jn(t,e),0<n.length&&(t.c=null,t.a.set(nr(t,e),J(n)),t.b+=n.length)}function er(t){var e=new Gn;return e.c=t.c,t.a&&(e.a=new On(t.a),e.b=t.b),e}function nr(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}function rr(t){var e=[];return function t(e,n,r){if(null==n)r.push("null");else{if("object"==typeof n){if(Array.isArray(n)){var i=n;n=i.length,r.push("[");for(var o="",s=0;s<n;s++)r.push(o),t(e,i[s],r),o=",";return void r.push("]")}if(!(n instanceof String||n instanceof Number||n instanceof Boolean)){for(i in r.push("{"),o="",n)Object.prototype.hasOwnProperty.call(n,i)&&("function"!=typeof(s=n[i])&&(r.push(o),ar(i,r),r.push(":"),t(e,s,r),o=","));return void r.push("}")}n=n.valueOf()}switch(typeof n){case"string":ar(n,r);break;case"number":r.push(isFinite(n)&&!isNaN(n)?String(n):"null");break;case"boolean":r.push(String(n));break;case"function":r.push("null");break;default:throw Error("Unknown type: "+typeof n)}}}(new ir,t,e),e.join("")}function ir(){}(e=Gn.prototype).add=function(t,e){Qn(this),this.c=null,t=nr(this,t);var n=this.a.get(t);return n||this.a.set(t,n=[]),n.push(e),this.b+=1,this},e.clear=function(){this.a=this.c=null,this.b=0},e.forEach=function(t,e){Qn(this),this.a.forEach((function(n,r){W(n,(function(n){t.call(e,n,r,this)}),this)}),this)},e.Y=function(){Qn(this);for(var t=this.a.V(),e=this.a.Y(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},e.V=function(t){Qn(this);var e=[];if("string"==typeof t)Zn(this,t)&&(e=X(e,this.a.get(nr(this,t))));else{t=this.a.V();for(var n=0;n<t.length;n++)e=X(e,t[n])}return e},e.set=function(t,e){return Qn(this),this.c=null,Zn(this,t=nr(this,t))&&(this.b-=this.a.get(t).length),this.a.set(t,[e]),this.b+=1,this},e.get=function(t,e){return t&&0<(t=this.V(t)).length?String(t[0]):e},e.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],e=this.a.Y(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.V(r);for(var o=0;o<r.length;o++){var s=i;""!==r[o]&&(s+="="+encodeURIComponent(String(r[o]))),t.push(s)}}return this.c=t.join("&")};var or={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},sr=/\uffff/.test("ï¿¿")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;function ar(t,e){e.push('"',t.replace(sr,(function(t){var e=or[t];return e||(e="\\u"+(65536|t.charCodeAt(0)).toString(16).substr(1),or[t]=e),e})),'"')}function cr(){var t=Ir();return Kt&&!!re&&11==re||/Edge\/\d+/.test(t)}function ur(){return u.window&&u.window.location.href||self&&self.location&&self.location.href||""}function lr(t,e){e=e||u.window;var n="about:blank";t&&(n=Nt(Mt(t))),e.location.href=n}function hr(t){return!!((t=(t||Ir()).toLowerCase()).match(/android/)||t.match(/webos/)||t.match(/iphone|ipad|ipod/)||t.match(/blackberry/)||t.match(/windows phone/)||t.match(/iemobile/))}function pr(t){t=t||u.window;try{t.close()}catch(t){}}function dr(t,e,n){var r=Math.floor(1e9*Math.random()).toString();e=e||500,n=n||600;var i=(window.screen.availHeight-n)/2,o=(window.screen.availWidth-e)/2;for(s in e={width:e,height:n,top:0<i?i:0,left:0<o?o:0,location:!0,resizable:!0,statusbar:!0,toolbar:!1},n=Ir().toLowerCase(),r&&(e.target=r,ct(n,"crios/")&&(e.target="_blank")),Er(Ir())==Sr&&(t=t||"http://localhost",e.scrollbars=!0),n=t||"",(t=e)||(t={}),r=window,e=n instanceof Rt?n:Mt(void 0!==n.href?n.href:String(n)),n=t.target||n.target,i=[],t)switch(s){case"width":case"height":case"top":case"left":i.push(s+"="+t[s]);break;case"target":case"noopener":case"noreferrer":break;default:i.push(s+"="+(t[s]?1:0))}var s=i.join(",");if((pt("iPhone")&&!pt("iPod")&&!pt("iPad")||pt("iPad")||pt("iPod"))&&r.navigator&&r.navigator.standalone&&n&&"_self"!=n?(yt(s=de(document,"A"),"HTMLAnchorElement"),e instanceof Rt||e instanceof Rt||(e="object"==typeof e&&e.sa?e.ra():String(e),Pt.test(e)||(e="about:invalid#zClosurez"),e=new Rt(Lt,e)),s.href=Nt(e),s.setAttribute("target",n),t.noreferrer&&s.setAttribute("rel","noreferrer"),(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,r,1),s.dispatchEvent(t),s={}):t.noreferrer?(s=r.open("",n,s),t=Nt(e),s&&(Qt&&ct(t,";")&&(t="'"+t.replace(/'/g,"%27")+"'"),s.opener=null,t=Ht('<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url='+Vt(t)+'">'),r=s.document)&&(r.write(Ut(t)),r.close())):(s=r.open(Nt(e),n,s))&&t.noopener&&(s.opener=null),s)try{s.focus()}catch(t){}return s}var fr=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,vr=/^[^@]+@[^@]+$/;function gr(){var t=null;return new we((function(e){"complete"==u.document.readyState?e():(t=function(){e()},hn(window,"load",t))})).s((function(e){throw pn(window,"load",t),e}))}function mr(t){return t=t||Ir(),!("file:"!==Nr()&&"ionic:"!==Nr()||!t.toLowerCase().match(/iphone|ipad|ipod|android/))}function yr(){var t=u.window;try{return!(!t||t==t.top)}catch(t){return!1}}function br(){return void 0!==u.WorkerGlobalScope&&"function"==typeof u.importScripts}function _r(){return r.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":r.INTERNAL.hasOwnProperty("node")?"Node":br()?"Worker":"Browser"}function wr(){var t=_r();return"ReactNative"===t||"Node"===t}var Sr="Firefox",Cr="Chrome";function Er(t){var e=t.toLowerCase();return ct(e,"opera/")||ct(e,"opr/")||ct(e,"opios/")?"Opera":ct(e,"iemobile")?"IEMobile":ct(e,"msie")||ct(e,"trident/")?"IE":ct(e,"edge/")?"Edge":ct(e,"firefox/")?Sr:ct(e,"silk/")?"Silk":ct(e,"blackberry")?"Blackberry":ct(e,"webos")?"Webos":!ct(e,"safari/")||ct(e,"chrome/")||ct(e,"crios/")||ct(e,"android")?!ct(e,"chrome/")&&!ct(e,"crios/")||ct(e,"edge/")?ct
408(e,"android")?"Android":(t=t.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==t.length?t[1]:"Other":Cr:"Safari"}var xr={ld:"FirebaseCore-web",nd:"FirebaseUI-web"};function Tr(t,e){e=e||[];var n,r=[],i={};for(n in xr)i[xr[n]]=!0;for(n=0;n<e.length;n++)void 0!==i[e[n]]&&(delete i[e[n]],r.push(e[n]));return r.sort(),(e=r).length||(e=["FirebaseCore-web"]),"Browser"===(r=_r())?r=Er(i=Ir()):"Worker"===r&&(r=Er(i=Ir())+"-"+r),r+"/JsCore/"+t+"/"+e.join(",")}function Ir(){return u.navigator&&u.navigator.userAgent||""}function kr(t,e){t=t.split("."),e=e||u;for(var n=0;n<t.length&&"object"==typeof e&&null!=e;n++)e=e[t[n]];return n!=t.length&&(e=void 0),e}function Or(){try{var t=u.localStorage,e=jr();if(t)return t.setItem(e,"1"),t.removeItem(e),!cr()||!!u.indexedDB}catch(t){return br()&&!!u.indexedDB}return!1}function Ar(){return(Rr()||"chrome-extension:"===Nr()||mr())&&!wr()&&Or()&&!br()}function Rr(){return"http:"===Nr()||"https:"===Nr()}function Nr(){return u.location&&u.location.protocol||null}function Pr(t){return!hr(t=t||Ir())&&Er(t)!=Sr}function Mr(t){return void 0===t?null:rr(t)}function Dr(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&null!==t[e]&&void 0!==t[e]&&(n[e]=t[e]);return n}function Lr(t){if(null!==t)return JSON.parse(t)}function jr(t){return t||Math.floor(1e9*Math.random()).toString()}function Ur(t){return"Safari"!=Er(t=t||Ir())&&!t.toLowerCase().match(/iphone|ipad|ipod/)}function Fr(){var t=u.___jsl;if(t&&t.H)for(var e in t.H)if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=t.H[e].L.concat(),t.CP)for(var n=0;n<t.CP.length;n++)t.CP[n]=null}function Hr(t,e){if(t>e)throw Error("Short delay should be less than long delay!");this.a=t,this.c=e,t=Ir(),e=_r(),this.b=hr(t)||"ReactNative"===e}function Br(){var t=u.document;return!t||void 0===t.visibilityState||"visible"==t.visibilityState}function qr(t){"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t)}function Vr(t){try{var e=new Date(parseInt(t,10));if(!isNaN(e.getTime())&&!/[^0-9]/.test(t))return e.toUTCString()}catch(t){}return null}function Wr(){return!(!kr("fireauth.oauthhelper",u)&&!kr("fireauth.iframe",u))}Hr.prototype.get=function(){var t=u.navigator;return!t||"boolean"!=typeof t.onLine||!Rr()&&"chrome-extension:"!==Nr()&&void 0===t.connection||t.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};var zr,$r={};function Yr(t){$r[t]||($r[t]=!0,qr(t))}try{var Kr={};Object.defineProperty(Kr,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(Kr,"abcd",{configurable:!0,enumerable:!0,value:2}),zr=2==Kr.abcd}catch($t){zr=!1}function Gr(t,e,n){zr?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n}):t[e]=n}function Qr(t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&Gr(t,n,e[n])}function Xr(t){var e={};return Qr(e,t),e}function Jr(t){var e=t;if("object"==typeof t&&null!=t)for(var n in e="length"in t?[]:{},t)Gr(e,n,Jr(t[n]));return e}function Zr(t){var e=t&&(t[ii]?"phone":null);if(!(e&&t&&t[ri]))throw new T("internal-error","Internal assert: invalid MultiFactorInfo object");Gr(this,"uid",t[ri]),Gr(this,"displayName",t[ei]||null);var n=null;t[ni]&&(n=new Date(t[ni]).toUTCString()),Gr(this,"enrollmentTime",n),Gr(this,"factorId",e)}function ti(t){try{var e=new oi(t)}catch(t){e=null}return e}Zr.prototype.w=function(){return{uid:this.uid,displayName:this.displayName,factorId:this.factorId,enrollmentTime:this.enrollmentTime}};var ei="displayName",ni="enrolledAt",ri="mfaEnrollmentId",ii="phoneInfo";function oi(t){Zr.call(this,t),Gr(this,"phoneNumber",t[ii])}function si(t){var e={},n=t[li],r=t[pi],i=t[di];if(t=ti(t[hi]),!i||i!=ci&&i!=ui&&!n||i==ui&&!r||i==ai&&!t)throw Error("Invalid checkActionCode response!");i==ui?(e[vi]=n||null,e[mi]=n||null,e[fi]=r):(e[vi]=r||null,e[mi]=r||null,e[fi]=n||null),e[gi]=t||null,Gr(this,bi,i),Gr(this,yi,Jr(e))}x(oi,Zr),oi.prototype.w=function(){var t=oi.$a.w.call(this);return t.phoneNumber=this.phoneNumber,t};var ai="REVERT_SECOND_FACTOR_ADDITION",ci="EMAIL_SIGNIN",ui="VERIFY_AND_CHANGE_EMAIL",li="email",hi="mfaInfo",pi="newEmail",di="requestType",fi="email",vi="fromEmail",gi="multiFactorInfo",mi="previousEmail",yi="data",bi="operation";function _i(t){var e=Un(t=Fn(t),wi)||null,n=Un(t,Si)||null,r=Un(t,xi)||null;if(r=r&&Ii[r]||null,!e||!n||!r)throw new T("argument-error",wi+", "+Si+"and "+xi+" are required in a valid action code URL.");Qr(this,{apiKey:e,operation:r,code:n,continueUrl:Un(t,Ci)||null,languageCode:Un(t,Ei)||null,tenantId:Un(t,Ti)||null})}var wi="apiKey",Si="oobCode",Ci="continueUrl",Ei="languageCode",xi="mode",Ti="tenantId",Ii={recoverEmail:"RECOVER_EMAIL",resetPassword:"PASSWORD_RESET",revertSecondFactorAddition:ai,signIn:ci,verifyAndChangeEmail:ui,verifyEmail:"VERIFY_EMAIL"};function ki(t){try{return new _i(t)}catch(t){return null}}function Oi(t){var e=t[Mi];if(void 0===e)throw new T("missing-continue-uri");if("string"!=typeof e||"string"==typeof e&&!e.length)throw new T("invalid-continue-uri");this.h=e,this.b=this.a=null,this.g=!1;var n=t[Ai];if(n&&"object"==typeof n){e=n[ji];var r=n[Di];if(n=n[Li],"string"==typeof e&&e.length){if(this.a=e,void 0!==r&&"boolean"!=typeof r)throw new T("argument-error",Di+" property must be a boolean when specified.");if(this.g=!!r,void 0!==n&&("string"!=typeof n||"string"==typeof n&&!n.length))throw new T("argument-error",Li+" property must be a non empty string when specified.");this.b=n||null}else{if(void 0!==e)throw new T("argument-error",ji+" property must be a non empty string when specified.");if(void 0!==r||void 0!==n)throw new T("missing-android-pkg-name")}}else if(void 0!==n)throw new T("argument-error",Ai+" property must be a non null object when specified.");if(this.f=null,(e=t[Pi])&&"object"==typeof e){if("string"==typeof(e=e[Ui])&&e.length)this.f=e;else if(void 0!==e)throw new T("argument-error",Ui+" property must be a non empty string when specified.")}else if(void 0!==e)throw new T("argument-error",Pi+" property must be a non null object when specified.");if(void 0!==(e=t[Ni])&&"boolean"!=typeof e)throw new T("argument-error",Ni+" property must be a boolean when specified.");if(this.c=!!e,void 0!==(t=t[Ri])&&("string"!=typeof t||"string"==typeof t&&!t.length))throw new T("argument-error",Ri+" property must be a non empty string when specified.");this.i=t||null}var Ai="android",Ri="dynamicLinkDomain",Ni="handleCodeInApp",Pi="iOS",Mi="url",Di="installApp",Li="minimumVersion",ji="packageName",Ui="bundleId";function Fi(t){var e={};for(var n in e.continueUrl=t.h,e.canHandleCodeInApp=t.c,(e.androidPackageName=t.a)&&(e.androidMinimumVersion=t.b,e.androidInstallApp=t.g),e.iOSBundleId=t.f,e.dynamicLinkDomain=t.i,e)null===e[n]&&delete e[n];return e}var Hi=null;function Bi(t){var e="";return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=Hi[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}!function(){if(!Hi){Hi={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++)for(var r=t.concat(e[n].split("")),i=0;i<r.length;i++){var o=r[i];void 0===Hi[o]&&(Hi[o]=i)}}}();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;e(i<<2|o>>4),64!=s&&(e(o<<4&240|s>>2),64!=a&&e(s<<6&192|a))}}(t,(function(t){e+=String.fromCharCode(t)})),e}function qi(t){var e=Wi(t);if(!(e&&e.sub&&e.iss&&e.aud&&e.exp))throw Error("Invalid JWT");this.g=t,this.c=e.exp,this.h=e.sub,E(),this.a=e.provider_id||e.firebase&&e.firebase.sign_in_provider||null,this.f=e.firebase&&e.firebase.tenant||null,this.b=!!e.is_anonymous||"anonymous"==this.a}function Vi(t){try{return new qi(t)}catch(t){return null}}function Wi(t){if(!t)return null;if(3!=(t=t.split(".")).length)return null;for(var e=(4-(t=t[1]).length%4)%4,n=0;n<e;n++)t+=".";try{return JSON.parse(Bi(t))}catch(t){}return null}qi.prototype.S=function(){return this.f},qi.prototype.i=function(){return this.b},qi.prototype.toString=function(){return this.g};var zi="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),$i=["client_id","response_type","scope","redirect_uri","state"],Yi={md:{Ja:"locale",ua:700,ta:600,fa:"facebook.com",Wa:$i},od:{Ja:null,ua:500,ta:750,fa:"github.com",Wa:$i},pd:{Ja:"hl",ua:515,ta:680,fa:"google.com",Wa:$i},vd:{Ja:"lang",ua:485,ta:705,fa:"twitter.com",Wa:zi},jd:{Ja:"locale",ua:640,ta:600,fa:"apple.com",Wa:[]}};function Ki(t){for(var e in Yi)if(Yi[e].fa==t)return Yi[e];return null}function Gi(t){var e={};
408e["facebook.com"]=to,e["google.com"]=no,e["github.com"]=eo,e["twitter.com"]=ro;var n=t&&t[Xi];try{if(n)return e[n]?new e[n](t):new Zi(t);if(void 0!==t[Qi])return new Ji(t)}catch(t){}return null}var Qi="idToken",Xi="providerId";function Ji(t){var e=t[Xi];if(!e&&t[Qi]){var n=Vi(t[Qi]);n&&n.a&&(e=n.a)}if(!e)throw Error("Invalid additional user info!");"anonymous"!=e&&"custom"!=e||(e=null),n=!1,void 0!==t.isNewUser?n=!!t.isNewUser:"identitytoolkit#SignupNewUserResponse"===t.kind&&(n=!0),Gr(this,"providerId",e),Gr(this,"isNewUser",n)}function Zi(t){Ji.call(this,t),Gr(this,"profile",Jr((t=Lr(t.rawUserInfo||"{}"))||{}))}function to(t){if(Zi.call(this,t),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function eo(t){if(Zi.call(this,t),"github.com"!=this.providerId)throw Error("Invalid provider ID!");Gr(this,"username",this.profile&&this.profile.login||null)}function no(t){if(Zi.call(this,t),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function ro(t){if(Zi.call(this,t),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");Gr(this,"username",t.screenName||null)}function io(t){var e=Fn(t),n=Un(e,"link"),r=Un(Fn(n),"link");return e=Un(e,"deep_link_id"),Un(Fn(e),"link")||e||r||n||t}function oo(t,e){if(!t&&!e)throw new T("internal-error","Internal assert: no raw session string available");if(t&&e)throw new T("internal-error","Internal assert: unable to determine the session type");this.a=t||null,this.b=e||null,this.type=this.a?so:ao}x(Zi,Ji),x(to,Zi),x(eo,Zi),x(no,Zi),x(ro,Zi);var so="enroll",ao="signin";function co(){}function uo(t,e){return t.then((function(t){if(t[Xs]){var n=Vi(t[Xs]);if(!n||e!=n.h)throw new T("user-mismatch");return t}throw new T("user-mismatch")})).s((function(t){throw t&&t.code&&t.code==O+"user-not-found"?new T("user-mismatch"):t}))}function lo(t,e){if(!e)throw new T("internal-error","failed to construct a credential");this.a=e,Gr(this,"providerId",t),Gr(this,"signInMethod",t)}function ho(t){return{pendingToken:t.a,requestUri:"http://localhost"}}function po(t){if(t&&t.providerId&&t.signInMethod&&0==t.providerId.indexOf("saml.")&&t.pendingToken)try{return new lo(t.providerId,t.pendingToken)}catch(t){}return null}function fo(t,e,n){if(this.a=null,e.idToken||e.accessToken)e.idToken&&Gr(this,"idToken",e.idToken),e.accessToken&&Gr(this,"accessToken",e.accessToken),e.nonce&&!e.pendingToken&&Gr(this,"nonce",e.nonce),e.pendingToken&&(this.a=e.pendingToken);else{if(!e.oauthToken||!e.oauthTokenSecret)throw new T("internal-error","failed to construct a credential");Gr(this,"accessToken",e.oauthToken),Gr(this,"secret",e.oauthTokenSecret)}Gr(this,"providerId",t),Gr(this,"signInMethod",n)}function vo(t){var e={};return t.idToken&&(e.id_token=t.idToken),t.accessToken&&(e.access_token=t.accessToken),t.secret&&(e.oauth_token_secret=t.secret),e.providerId=t.providerId,t.nonce&&!t.a&&(e.nonce=t.nonce),e={postBody:Xn(e).toString(),requestUri:"http://localhost"},t.a&&(delete e.postBody,e.pendingToken=t.a),e}function go(t){if(t&&t.providerId&&t.signInMethod){var e={idToken:t.oauthIdToken,accessToken:t.oauthTokenSecret?null:t.oauthAccessToken,oauthTokenSecret:t.oauthTokenSecret,oauthToken:t.oauthTokenSecret&&t.oauthAccessToken,nonce:t.nonce,pendingToken:t.pendingToken};try{return new fo(t.providerId,e,t.signInMethod)}catch(t){}}return null}function mo(t,e){this.Pc=e||[],Qr(this,{providerId:t,isOAuthProvider:!0}),this.Hb={},this.ob=(Ki(t)||{}).Ja||null,this.nb=null}function yo(t){if("string"!=typeof t||0!=t.indexOf("saml."))throw new T("argument-error",'SAML provider IDs must be prefixed with "saml."');mo.call(this,t,[])}function bo(t){mo.call(this,t,$i),this.a=[]}function _o(){bo.call(this,"facebook.com")}function wo(t){if(!t)throw new T("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return g(t)&&(e=t.accessToken),(new _o).credential({accessToken:e})}function So(){bo.call(this,"github.com")}function Co(t){if(!t)throw new T("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return g(t)&&(e=t.accessToken),(new So).credential({accessToken:e})}function Eo(){bo.call(this,"google.com"),this.Ca("profile")}function xo(t,e){var n=t;return g(t)&&(n=t.idToken,e=t.accessToken),(new Eo).credential({idToken:n,accessToken:e})}function To(){mo.call(this,"twitter.com",zi)}function Io(t,e){var n=t;if(g(n)||(n={oauthToken:t,oauthTokenSecret:e}),!n.oauthToken||!n.oauthTokenSecret)throw new T("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new fo("twitter.com",n,"twitter.com")}function ko(t,e,n){this.a=t,this.f=e,Gr(this,"providerId","password"),Gr(this,"signInMethod",n===Ao.EMAIL_LINK_SIGN_IN_METHOD?Ao.EMAIL_LINK_SIGN_IN_METHOD:Ao.EMAIL_PASSWORD_SIGN_IN_METHOD)}function Oo(t){return t&&t.email&&t.password?new ko(t.email,t.password,t.signInMethod):null}function Ao(){Qr(this,{providerId:"password",isOAuthProvider:!1})}function Ro(t,e){if(!(e=No(e)))throw new T("argument-error","Invalid email link!");return new ko(t,e.code,Ao.EMAIL_LINK_SIGN_IN_METHOD)}function No(t){return(t=ki(t=io(t)))&&t.operation===ci?t:null}function Po(t){if(!(t.cb&&t.bb||t.La&&t.ea))throw new T("internal-error");this.a=t,Gr(this,"providerId","phone"),this.fa="phone",Gr(this,"signInMethod","phone")}function Mo(t){if(t&&"phone"===t.providerId&&(t.verificationId&&t.verificationCode||t.temporaryProof&&t.phoneNumber)){var e={};return W(["verificationId","verificationCode","temporaryProof","phoneNumber"],(function(n){t[n]&&(e[n]=t[n])})),new Po(e)}return null}function Do(t){return t.a.La&&t.a.ea?{temporaryProof:t.a.La,phoneNumber:t.a.ea}:{sessionInfo:t.a.cb,code:t.a.bb}}function Lo(t){try{this.a=t||r.auth()}catch(t){throw new T("argument-error","Either an instance of firebase.auth.Auth must be passed as an argument to the firebase.auth.PhoneAuthProvider constructor, or the default firebase App instance must be initialized via firebase.initializeApp().")}Qr(this,{providerId:"phone",isOAuthProvider:!1})}function jo(t,e){if(!t)throw new T("missing-verification-id");if(!e)throw new T("missing-verification-code");return new Po({cb:t,bb:e})}function Uo(t){if(t.temporaryProof&&t.phoneNumber)return new Po({L
408a:t.temporaryProof,ea:t.phoneNumber});var e=t&&t.providerId;if(!e||"password"===e)return null;var n=t&&t.oauthAccessToken,r=t&&t.oauthTokenSecret,i=t&&t.nonce,o=t&&t.oauthIdToken,s=t&&t.pendingToken;try{switch(e){case"google.com":return xo(o,n);case"facebook.com":return wo(n);case"github.com":return Co(n);case"twitter.com":return Io(n,r);default:return n||r||o||s?s?0==e.indexOf("saml.")?new lo(e,s):new fo(e,{pendingToken:s,idToken:t.oauthIdToken,accessToken:t.oauthAccessToken},e):new bo(e).credential({idToken:o,accessToken:n,rawNonce:i}):null}}catch(t){return null}}function Fo(t){if(!t.isOAuthProvider)throw new T("invalid-oauth-provider")}function Ho(t,e,n,r,i,o,s){if(this.c=t,this.b=e||null,this.g=n||null,this.f=r||null,this.i=o||null,this.h=s||null,this.a=i||null,!this.g&&!this.a)throw new T("invalid-auth-event");if(this.g&&this.a)throw new T("invalid-auth-event");if(this.g&&!this.f)throw new T("invalid-auth-event")}function Bo(t){return(t=t||{}).type?new Ho(t.type,t.eventId,t.urlResponse,t.sessionId,t.error&&I(t.error),t.postBody,t.tenantId):null}function qo(){this.b=null,this.a=[]}oo.prototype.Ha=function(){return this.a?ke(this.a):ke(this.b)},oo.prototype.w=function(){return this.type==so?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}},co.prototype.ja=function(){},co.prototype.b=function(){},co.prototype.c=function(){},co.prototype.w=function(){},lo.prototype.ja=function(t){return ba(t,ho(this))},lo.prototype.b=function(t,e){var n=ho(this);return n.idToken=e,_a(t,n)},lo.prototype.c=function(t,e){return uo(wa(t,ho(this)),e)},lo.prototype.w=function(){return{providerId:this.providerId,sign
408InMethod:this.signInMethod,pendingToken:this.a}},fo.prototype.ja=function(t){return ba(t,vo(this))},fo.prototype.b=function(t,e){var n=vo(this);return n.idToken=e,_a(t,n)},fo.prototype.c=function(t,e){return uo(wa(t,vo(this)),e)},fo.prototype.w=function(){var t={providerId:this.providerId,signInMethod:this.signInMethod};return this.idToken&&(t.oauthIdToken=this.idToken),this.accessToken&&(t.oauthAccessToken=this.accessToken),this.secret&&(t.oauthTokenSecret=this.secret),this.nonce&&(t.nonce=this.nonce),this.a&&(t.pendingToken=this.a),t},mo.prototype.Ka=function(t){return this.Hb=vt(t),this},x(yo,mo),x(bo,mo),bo.prototype.Ca=function(t){return K(this.a,t)||this.a.push(t),this},bo.prototype.Pb=function(){return J(this.a)},bo.prototype.credential=function(t,e){var n;if(!(n=g(t)?{idToken:t.idToken||null,accessToken:t.accessToken||null,nonce:t.rawNonce||null}:{idToken:t||null,accessToken:e||null}).idToken&&!n.accessToken)throw new T("argument-error","credential failed: must provide the ID token and/or the access token.");return new fo(this.providerId,n,this.providerId)},x(_o,bo),Gr(_o,"PROVIDER_ID","facebook.com"),Gr(_o,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),x(So,bo),Gr(So,"PROVIDER_ID","github.com"),Gr(So,"GITHUB_SIGN_IN_METHOD","github.com"),x(Eo,bo),Gr(Eo,"PROVIDER_ID","google.com"),Gr(Eo,"GOOGLE_SIGN_IN_METHOD","google.com"),x(To,mo),Gr(To,"PROVIDER_ID","twitter.com"),Gr(To,"TWITTER_SIGN_IN_METHOD","twitter.com"),ko.prototype.ja=function(t){return this.signInMethod==Ao.EMAIL_LINK_SIGN_IN_METHOD?nc(t,Oa,{email:this.a,oobCode:this.f}):nc(t,Xa,{email:this.a,password:this.f})},ko.prototype.b=function(t,e){return this.signInMethod==Ao.EMAIL_LINK_SIGN_IN_METHOD?nc(t,Aa,{idToken:e,email:this.a,oobCode:this.f}):nc(t,Va,{idToken:e,email:this.a,password:this.f})},ko.prototype.c=function(t,e){return uo(this.ja(t),e)},ko.prototype.w=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}},Qr(Ao,{PROVIDER_ID:"password"}),Qr(Ao,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),Qr(Ao,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),Po.prototype.ja=function(t){return t.eb(Do(this))},Po.prototype.b=function(t,e){var n=Do(this);return n.idToken=e,nc(t,Za,n)},Po.prototype.c=function(t,e){var n=Do(this);return n.operation="REAUTH",uo(t=nc(t,tc,n),e)},Po.prototype.w=function(){var t={providerId:"phone"};return this.a.cb&&(t.verificationId=this.a.cb),this.a.bb&&(t.verificationCode=this.a.bb),this.a.La&&(t.temporaryProof=this.a.La),this.a.ea&&(t.phoneNumber=this.a.ea),t},Lo.prototype.eb=function(t,e){var n=this.a.a;return ke(e.verify()).then((function(r){if("string"!=typeof r)throw new T("argument-error","An implementation of firebase.auth.ApplicationVerifier.prototype.verify() must return a firebase.Promise that resolves with a string.");switch(e.type){case"recaptcha":var i=g(t)?t.session:null,o=g(t)?t.phoneNumber:t;return(i&&i.type==so?i.Ha().then((function(t){return function(t,e){return nc(t,za,e).then((function(t){return t.phoneSessionInfo.sessionInfo}))}(n,{idToken:t,phoneEnrollmentInfo:{phoneNumber:o,recaptchaToken:r}})})):i&&i.type==ao?i.Ha().then((function(e){return function(t,e){return nc(t,$a,e).then((function(t){return t.phoneResponseInfo.sessionInfo}))}(n,{mfaPendingCredential:e,mfaEnrollmentId:t.multiFactorHint&&t.multiFactorHint.uid||t.multiFactorUid,phoneSignInInfo:{recaptchaToken:r}})})):function(t,e){return nc(t,Ba,e)}(n,{phoneNumber:o,recaptchaToken:r})).then((function(t){return"function"==typeof e.reset&&e.reset(),t}),(function(t){throw"function"==typeof e.reset&&e.reset(),t}));default:throw new T("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}}))},Qr(Lo,{PROVIDER_ID:"phone"}),Qr(Lo,{PHONE_SIGN_IN_METHOD:"phone"}),Ho.prototype.getUid=function(){var t=[];return t.push(this.c),this.b&&t.push(this.b),this.f&&t.push(this.f),this.h&&t.push(this.h),t.join("-")},Ho.prototype.S=function(){return this.h},Ho.prototype.w=function(){return{type:this.c,eventId:this.b,urlResponse:this.g,sessionId:this.f,postBody:this.i,tenantId:this.h,error:this.a&&this.a.w()}};var Vo,Wo=null;function zo(t){var e="unauthorized-domain",n=void 0,r=Fn(t);
408t=r.a,"chrome-extension"==(r=r.f)?n=qt("This chrome extension ID (chrome-extension://%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",t):"http"==r||"https"==r?n=qt("This domain (%s) is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab.",t):e="operation-not-supported-in-this-environment",T.call(this,e,n)}function $o(t,e,n){T.call(this,t,n),(t=e||{}).Ib&&Gr(this,"email",t.Ib),t.ea&&Gr(this,"phoneNumber",t.ea),t.credential&&Gr(this,"credential",t.credential),t.Yb&&Gr(this,"tenantId",t.Yb)}function Yo(t){if(t.code){var e=t.code||"";0==e.indexOf(O)&&(e=e.substring(O.length));var n={credential:Uo(t),Yb:t.tenantId};if(t.email)n.Ib=t.email;else if(t.phoneNumber)n.ea=t.phoneNumber;else if(!n.credential)return new T(e,t.message||void 0);return new $o(e,n,t.message)}return null}function Ko(){}function Go(t){return t.c||(t.c=t.b())}function Qo(){}function Xo(t){if(!t.f&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var e=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],n=0;n<e.length;n++){var r=e[n];try{return new ActiveXObject(r),t.f=r}catch(t){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return t.f}function Jo(){}function Zo(){this.a=new XDomainRequest,this.readyState=0,this.onreadystatechange=null,this.responseType=this.responseText=this.response="",this.status=-1,this.statusText="",this.a.onload=S(this.pc,this),this.a.onerror=S(this.Rb,this),this.a.onprogress=S(this.qc,this),this.a.ontimeout=S(this.uc,this)}function ts(t,e){t.readyState=e,t.onreadystatechange&&t.onreadystatechange()}function es(t,e,n){this.reset(t,e,n,void 0,void 0)}x(zo,T),x($o,T),$o.prototype.w=function(){var t={code:this.code,message:this.message};this.email&&(t.email=this.email),this.phoneNumber&&(t.phoneNumber=this.phoneNumber),this.tenantId&&(t.tenantId=this.tenantId);var e=this.credential&&this.credential.w();return e&&mt(t,e),t},$o.prototype.toJSON=function(){return this.w()},Ko.prototype.c=null,x(Qo,Ko),Qo.prototype.a=function(){var t=Xo(this);return t?new ActiveXObject(t):new XMLHttpRequest},Qo.prototype.b=function(){var t={};return Xo(this)&&(t[0]=!0,t[1]=!0),t},Vo=new Qo,x(Jo,Ko),Jo.prototype.a=function(){var t=new XMLHttpRequest;if("withCredentials"in t)return t;if("undefined"!=typeof XDomainRequest)return new Zo;throw Error("Unsupported browser")},Jo.prototype.b=function(){return{}},(e=Zo.prototype).open=function(t,e,n){if(null!=n&&!n)throw Error("Only async requests are supported.");this.a.open(t,e)},e.send=function(t){if(t){if("string"!=typeof t)throw Error("Only string data is supported");this.a.send(t)}else this.a.send()},e.abort=function(){this.a.abort()},e.setRequestHeader=function(){},e.getResponseHeader=function(t){return"content-type"==t.toLowerCase()?this.a.contentType:""},e.pc=function(){this.status=200,this.response=this.responseText=this.a.responseText,ts(this,4)},e.Rb=function(){this.status=500,this.response=this.responseText="",ts(this,4)},e.uc=function(){this.Rb()},e.qc=function(){this.status=200,ts(this,1)},e.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType},es.prototype.a=null;function ns(t){this.f=t,this.b=this.c=this.a=null}function rs(t,e){this.name=t,this.value=e}es.prototype.reset=function(t,e,n,r,i){"number"==typeof i||0,r||E(),delete this.a},rs.prototype.toString=function(){return this.name};var is=new rs("SEVERE",1e3),os=new rs("WARNING",900),ss=new rs("CONFIG",700),as=new rs("FINE",500);ns.prototype.log=function(t,e,n){if(t.value>=function t(e){return e.c?e.c:e.a?t(e.a):(L("Root logger has no level set."),null)}(this).value)for(v(e)&&(e=e()),t=new es(t,String(e),this.f),n&&(t.a=n),n=this;n;)n=n.a};var cs={},us=null;function ls(t){var e;if(us||(us=new ns(""),cs[""]=us,us.c=ss),!(e=cs[t])){e=new ns(t);var n=t.lastIndexOf("."),r=t.substr(n+1);(n=ls(t.substr(0,n))).b||(n.b={}),n.b[r]=e,e.a=n,cs[t]=e}return e}function hs(t,e){t&&t.log(as,e,void 0)}function ps(t){this.f=t}function ds(t){wn.call(this),this.o=t,this.readyState=fs,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.i=new Headers,this.b=null,this.m="GET",this.g="",this.a=!1,this.h=ls("goog.net.FetchXmlHttp"),this.l=this.c=this.f=null}x(ps,Ko),ps.prototype.a=function(){return new ds(this.f)},ps.prototype.b=function(t){return function(){return t}}({}),x(ds,wn);var fs=0;function vs(t){t.c.read().then(t.oc.bind(t)).catch(t.Ta.bind(t))}function gs(t,e){e&&t.f&&(t.status=t.f.status,t.statusText=t.f.statusText),t.readyState=4,t.f=null,t.c=null,t.l=null,ms(t)}function ms(t){t.onreadystatechange&&t.onreadystatechange.call(t)}function ys(t){wn.call(this),this.headers=new On,this.O=t||null,this.c=!1,this.A=this.a=null,this.h=this.P=this.l="",this.f=this.N=this.i=this.G=!1,this.g=0,this.o=null,this.m=bs,this.u=this.R=!1}(e=ds.prototype).open=function(t,e){if(this.readyState!=fs)throw this.abort(),Error("Error reopening a connection");this.m=t,this.g=e,this.readyState=1,ms(this)},e.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.a=!0;var e={headers:this.i,method:this.m,credentials:void 0,cache:void 0};
408t&&(e.body=t),this.o.fetch(new Request(this.g,e)).then(this.tc.bind(this),this.Ta.bind(this))},e.abort=function(){this.response=this.responseText="",this.i=new Headers,this.status=0,this.c&&this.c.cancel("Request was aborted."),1<=this.readyState&&this.a&&4!=this.readyState&&(this.a=!1,gs(this,!1)),this.readyState=fs},e.tc=function(t){this.a&&(this.f=t,this.b||(this.b=t.headers,this.readyState=2,ms(this)),this.a&&(this.readyState=3,ms(this),this.a&&("arraybuffer"===this.responseType?t.arrayBuffer().then(this.rc.bind(this),this.Ta.bind(this)):void 0!==u.ReadableStream&&"body"in t?(this.response=this.responseText="",this.c=t.body.getReader(),this.l=new TextDecoder,vs(this)):t.text().then(this.sc.bind(this),this.Ta.bind(this)))))},e.oc=function(t){if(this.a){var e=this.l.decode(t.value?t.value:new Uint8Array(0),{stream:!t.done});e&&(this.response=this.responseText+=e),t.done?gs(this,!0):ms(this),3==this.readyState&&vs(this)}},e.sc=function(t){this.a&&(this.response=this.responseText=t,gs(this,!0))},e.rc=function(t){this.a&&(this.response=t,gs(this,!0))},e.Ta=function(t){var e=this.h;e&&e.log(os,"Failed to fetch url "+this.g,t instanceof Error?t:Error(t)),this.a&&gs(this,!0)},e.setRequestHeader=function(t,e){this.i.append(t,e)},e.getResponseHeader=function(t){return this.b?this.b.get(t.toLowerCase())||"":((t=this.h)&&t.log(os,"Attempting to get response header but no headers have been received for url: "+this.g,void 0),"")},e.getAllResponseHeaders=function(){if(!this.b){var t=this.h;return t&&t.log(os,"Attempting to get all response headers but no headers have been received for url: "+this.g,void 0),""}t=[];for(var e=this.b.entries(),n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},x(ys,wn);var bs="";ys.prototype.b=ls("goog.net.XhrIo");var _s=/^https?$/i,ws=["POST","PUT"];function Ss(t,e,n,r,i){if(t.a)throw Error("[goog.net.XhrIo] Object is active with another request="+t.l+"; newUri="+e);n=n?n.toUpperCase():"GET",t.l=e,t.h="",t.P=n,t.G=!1,t.c=!0,t.a=t.O?t.O.a():Vo.a(),t.A=t.O?Go(t.O):Go(Vo),t.a.onreadystatechange=S(t.Ub,t);try{hs(t.b,Rs(t,"Opening Xhr")),t.N=!0,t.a.open(n,String(e),!0),t.N=!1}catch(e){return hs(t.b,Rs(t,"Error opening Xhr: "+e.message)),void Es(t,e)}e=r||"";var o=new On(t.headers);i&&function(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(f(t)||"string"==typeof t)W(t,e,void 0);else for(var n=kn(t),r=In(t),i=r.length,o=0;o<i;o++)e.call(void 0,r[o],n&&n[o],t)}(i,(function(t,e){o.set(e,t)})),i=function(t){t:{for(var e=Cs,n=t.length,r="string"==typeof t?t.split(""):t,i=0;i<n;i++)if(i in r&&e.call(void 0,r[i],i,t)){e=i;break t}e=-1}return 0>e?null:"string"==typeof t?t.charAt(e):t[e]}(o.Y()),r=u.FormData&&e instanceof u.FormData,!K(ws,n)||i||r||o.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),o.forEach((function(t,e){this.a.setRequestHeader(e,t)}),t),t.m&&(t.a.responseType=t.m),"withCredentials"in t.a&&t.a.withCredentials!==t.R&&(t.a.withCredentials=t.R);try{ks(t),0<t.g&&(t.u=function(t){return Kt&&oe(9)&&"number"==typeof t.timeout&&void 0!==t.ontimeout}(t.a),hs(t.b,Rs(t,"Will abort after "+t.g+"ms if incomplete, xhr2 "+t.u)),t.u?(t.a.timeout=t.g,t.a.ontimeout=S(t.Ma,t)):t.o=xn(t.Ma,t.g,t)),hs(t.b,Rs(t,"Sending request")),t.i=!0,t.a.send(e),t.i=!1}catch(e){hs(t.b,Rs(t,"Send error: "+e.message)),Es(t,e)}}function Cs(t){return"content-type"==t.toLowerCase()}function Es(t,e){t.c=!1,t.a&&(t.f=!0,t.a.abort(),t.f=!1),t.h=e,xs(t),Is(t)}function xs(t){t.G||(t.G=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function Ts(t){if(t.c&&void 0!==c)if(t.A[1]&&4==Os(t)&&2==As(t))hs(t.b,Rs(t,"Local request error detected and ignored"));else if(t.i&&4==Os(t))xn(t.Ub,0,t);else if(t.dispatchEvent("readystatechange"),4==Os(t)){hs(t.b,Rs(t,"Request complete")),t.c=!1;try{var e,n=As(t);t:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r=!0;break t;default:r=!1}if(!(e=r)){var i;if(i=0===n){var o=String(t.l).match(Nn)[1]||null;if(!o&&u.self&&u.self.location){var s=u.self.location.protocol;o=s.substr(0,s.length-1)}i=!_s.test(o?o.toLowerCase():"")}e=i}if(e)t.dispatchEvent("complete"),t.dispatchEvent("success");else{try{var a=2<Os(t)?t.a.statusText:""}catch(e){hs(t.b,"Can not get status: "+e.message),a=""}t.h=a+" ["+As(t)+"]",xs(t)}}finally{Is(t)}}}function Is(t,e){if(t.a){ks(t);var n=t.a,r=t.A[0]?p:null;
408t.a=null,t.A=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=r}catch(e){(t=t.b)&&t.log(is,"Problem encountered resetting onreadystatechange: "+e.message,void 0)}}}function ks(t){t.a&&t.u&&(t.a.ontimeout=null),t.o&&(u.clearTimeout(t.o),t.o=null)}function Os(t){return t.a?t.a.readyState:0}function As(t){try{return 2<Os(t)?t.a.status:-1}catch(t){return-1}}function Rs(t,e){return e+" ["+t.P+" "+t.l+" "+As(t)+"]"}function Ns(t){var e=Vs;this.g=[],this.u=e,this.o=t||null,this.f=this.a=!1,this.c=void 0,this.m=this.A=this.i=!1,this.h=0,this.b=null,this.l=0}function Ps(t,e,n){t.a=!0,t.c=n,t.f=!e,js(t)}function Ms(t){if(t.a){if(!t.m)throw new Us(t);t.m=!1}}function Ds(t,e,n,r){t.g.push([e,n,r]),t.a&&js(t)}function Ls(t){return Y(t.g,(function(t){return v(t[1])}))}function js(t){if(t.h&&t.a&&Ls(t)){var e=t.h,n=Bs[e];n&&(u.clearTimeout(n.a),delete Bs[e]),t.h=0}t.b&&(t.b.l--,delete t.b),e=t.c;for(var r=n=!1;t.g.length&&!t.i;){var i=t.g.shift(),o=i[0],s=i[1];if(i=i[2],o=t.f?s:o)try{var a=o.call(i||t.o,e);void 0!==a&&(t.f=t.f&&(a==e||a instanceof Error),t.c=e=a),(P(e)||"function"==typeof u.Promise&&e instanceof u.Promise)&&(r=!0,t.i=!0)}catch(r){e=r,t.f=!0,Ls(t)||(n=!0)}}t.c=e,r&&(a=S(t.v,t,!0),r=S(t.v,t,!1),e instanceof Ns?(Ds(e,a,r),e.A=!0):e.then(a,r)),n&&(e=new Hs(e),Bs[e.a]=e,t.h=e.a)}function Us(){M.call(this)}function Fs(){M.call(this)}function Hs(t){this.a=u.setTimeout(S(this.c,this),0),this.b=t}(e=ys.prototype).Ma=function(){void 0!==c&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",hs(this.b,Rs(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))},e.abort=function(){this.a&&this.c&&(hs(this.b,Rs(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),Is(this))},e.Da=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),Is(this,!0)),ys.$a.Da.call(this)},e.Ub=function(){this.xa||(this.N||this.i||this.f?Ts(this):this.Ic())},e.Ic=function(){Ts(this)},e.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.m){case bs:case"text":return this.a.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in this.a)return this.a.mozResponseArrayBuffer}var t=this.b;return t&&t.log(is,"Response type "+this.m+" is not supported on this browser",void 0),null}catch(t){return hs(this.b,"Can not get response: "+t.message),null}},Ns.prototype.cancel=function(t){if(this.a)this.c instanceof Ns&&this.c.cancel();else{if(this.b){var e=this.b;delete this.b,t?e.cancel(t):(e.l--,0>=e.l&&e.cancel())}this.u?this.u.call(this.o,this):this.m=!0,this.a||(t=new Fs(this),Ms(this),Ps(this,!1,t))}},Ns.prototype.v=function(t,e){this.i=!1,Ps(this,t,e)},Ns.prototype.then=function(t,e,n){var r,i,o=new we((function(t,e){r=t,i=e}));return Ds(this,r,(function(t){t instanceof Fs?o.cancel():i(t)})),o.then(t,e,n)},Ns.prototype.$goog_Thenable=!0,x(Us,M),Us.prototype.message="Deferred has already fired",Us.prototype.name="AlreadyCalledError",x(Fs,M),Fs.prototype.message="Deferred was canceled",Fs.prototype.name="CanceledError",Hs.prototype.c=function(){throw delete Bs[this.a],this.b};var Bs={};function qs(t){var e={},n=e.document||document,r=xt(t).toString(),i=de(document,"SCRIPT"),o={Vb:i,Ma:void 0},s=new Ns(o),a=null,c=null!=e.timeout?e.timeout:5e3;return 0<c&&(a=window.setTimeout((function(){Ws(i,!0);var t=new Ys($s,"Timeout reached for loading script "+r);Ms(s),Ps(s,!1,t)}),c),o.Ma=a),i.onload=i.onreadystatechange=function(){i.readyState&&"loaded"!=i.readyState&&"complete"!=i.readyState||(Ws(i,e.wd||!1,a),Ms(s),Ps(s,!0,null))},i.onerror=function(){Ws(i,!0,a);var t=new Ys(zs,"Error while loading script "+r);Ms(s),Ps(s,!1,t)},mt(o=e.attributes||{},{type:"text/javascript",charset:"UTF-8"}),ce(i,o),function(t,e){yt(t,"HTMLScriptElement"),t.src=xt(e),null===h&&(h=(e=(e=u.document).querySelector&&e.querySelector("script[nonce]"))&&(e=e.nonce||e.getAttribute("nonce"))&&l.test(e)?e:""),(e=h)&&t.setAttribute("nonce",e)}(i,t),function(t){var e;return(e=(t||document).getElementsByTagName("HEAD"))&&0!=e.length?e[0]:t.documentElement}(n).appendChild(i),s}function Vs(){if(this&&this.Vb){var t=this.Vb;t&&"SCRIPT"==t.tagName&&Ws(t,!0,this.Ma)}}function Ws(t,e,n){null!=n&&u.clearTimeout(n),t.onload=p,t.onerror=p,t.onreadystatechange=p,e&&window.setTimeout((function(){t&&t.parentNode&&t.parentNode.removeChild(t)}),0)}var zs=0,$s=1;function Ys(t,e){var n="Jsloader error (code #"+t+")";e&&(n+=": "+e),M.call(this,n),this.code=t}function Ks(t){this.f=t}function Gs(t,e,n){if(this.c=t,t=e||{},this.l=t.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.v=t.secureTokenTimeout||Js,this.g=vt(t.secureTokenHeaders||Zs),this.h=t.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.i=t.identityPlatformEndpoint||"https://identitytoolkit.googleapis.com/v2/",this.m=t.firebaseTimeout||ta,this.a=vt(t.firebaseHeaders||ea),n&&(this.a["X-Client-Version"]=n,this.g["X-Client-Version"]=n),n="Node"==_r(),!(n=u.XMLHttpRequest||n&&r.INTERNAL.node&&r.INTERNAL.node.XMLHttpRequest)&&!br())throw new T("internal-error","The XMLHttpRequest compatibility library was not found.");this.f=void 0,br()?this.f=new ps(self):wr()?this.f=new Ks(n):this.f=new Jo,this.b=null}x(Ys,M),x(Ks,Ko),Ks.prototype.a=function(){return new this.f},Ks.prototype.b=function(){return{}};var Qs,Xs="idToken",Js=new Hr(3e4,6e4),Zs={"Content-Type":"application/x-www-form-urlencoded"},ta=new Hr(3e4,6e4),ea={"Content-Type":"application/json"};function na(t,e){e?t.a["X-Firebase-Locale"]=e:delete t.a["X-Firebase-Locale"]}function ra(t,e){e&&(t.l=ia("https://securetoken.googleapis.com/v1/token",e),t.h=ia("https://www.googleapis.com/identitytoolkit/v3/relyingparty/",e),t.i=ia("https://identitytoolkit.googleapis.com/v2/",e))}function ia(t,e){return t=Fn(t),e=Fn(e.url),t.c=t.a+t.c,Mn(t,e.f),t.a=e.a,Dn(t,e.g),t.toString()}function oa(t,e){e?(t.a["X-Client-Version"]=e,t.g["X-Client-Version"]=e):(delete t.a["X-Client-Version"],delete t.g["X-Client-Version"])}function sa(t,e,n,r,i,o,s){(function(){var t=Ir();return!((t=Er(t)!=Cr?null:(t=t.match(/\sChrome\/(\d+)/i))&&2==t.length?parseInt(t[1],10):null)&&30>t)&&(!Kt||!re||9<re)})()||br()?t=S(t.u,t):(Qs||(Qs=new we((function(t,e){!function(t,e){if(((window.gapi||{}).client||{}).request)t();else{u[ca]=function(){((window.gapi||{}).client||{}).request?t():e(Error("CORS_UNSUPPORTED"))},function(t,e){Ds(t,null,e,void 0)}(qs(Tt(aa,{onload:ca})),(function(){e(Error("CORS_UNSUPPORTED"))}))}}(t,e)}))),t=S(t.o,t)),t(e,n,r,i,o,s)}Gs.prototype.S=function(){return this.b},Gs.prototype.u=function(t,e,n,r,i,o){if(br()&&(void 0===u.fetch||void 0===u.Headers||void 0===u.Request))throw new T("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to supp
408ort HTTP requests from a Worker environment.");var s=new ys(this.f);if(o){s.g=Math.max(0,o);var a=setTimeout((function(){s.dispatchEvent("timeout")}),o)}Sn(s,"complete",(function(){a&&clearTimeout(a);var t=null;try{t=JSON.parse(function(t){try{return t.a?t.a.responseText:""}catch(e){return hs(t.b,"Can not get responseText: "+e.message),""}}(this))||null}catch(e){t=null}e&&e(t)})),Cn(s,"ready",(function(){a&&clearTimeout(a),ze(this)})),Cn(s,"timeout",(function(){a&&clearTimeout(a),ze(this),e&&e(null)})),Ss(s,t,n,r,i)};var aa=new bt(St,"https://apis.google.com/js/client.js?onload=%{onload}"),ca="__fcb"+Math.floor(1e6*Math.random()).toString();function ua(t,e,n,r,i,o,s){var a=Fn(e+n);jn(a,"key",t.c),s&&jn(a,"cb",E().toString());var c="GET"==r;if(c)for(var u in i)i.hasOwnProperty(u)&&jn(a,u,i[u]);return new we((function(e,n){sa(t,a.toString(),(function(t){t?t.error?n(ic(t,o||{})):e(t):n(new T("network-request-failed"))}),r,c?void 0:rr(Dr(i)),t.a,t.m.get())}))}function la(t){if("string"!=typeof(t=t.email)||!vr.test(t))throw new T("invalid-email")}function ha(t){"email"in t&&la(t)}function pa(t){if(!t[Xs]){if(t.mfaPendingCredential)throw new T("multi-factor-auth-required",null,vt(t));throw new T("internal-error")}}function da(t){if(t.phoneNumber||t.temporaryProof){if(!t.phoneNumber||!t.temporaryProof)throw new T("internal-error")}else{if(!t.sessionInfo)throw new T("missing-verification-id");if(!t.code)throw new T("missing-verification-code")}}Gs.prototype.o=function(t,e,n,r,i){var o=this;Qs.then((function(){window.gapi.client.setApiKey(o.c);var s=window.gapi.auth.getToken();window.gapi.auth.setToken(null),window.gapi.client.request({path:t,method:n,body:r,headers:i,authType:"none",callback:function(t){window.gapi.auth.setToken(s),e&&e(t)}})})).s((function(t){e&&e({error:{message:t&&t.message||"CORS_UNSUPPORTED"}})}))},Gs.prototype.yb=function(){return nc(this,Wa,{})},Gs.prototype.Ab=function(t,e){return nc(this,qa,{idToken:t,email:e})},Gs.prototype.Bb=function(t,e){return nc(this,Va,{idToken:t,password:e})};var fa={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};function va(t){if(!t.phoneVerificationInfo)throw new T("internal-error");if(!t.phoneVerificationInfo.sessionInfo)throw new T("missing-verification-id");if(!t.phoneVerificationInfo.code)throw new T("missing-verification-code")}function ga(t){if(!t.requestUri||!t.sessionId&&!t.postBody&&!t.pendingToken)throw new T("internal-error")}function ma(t,e){return e.oauthIdToken&&e.providerId&&0==e.providerId.indexOf("oidc.")&&!e.pendingToken&&(t.sessionId?e.nonce=t.sessionId:t.postBody&&(Zn(t=new Gn(t.postBody),"nonce")&&(e.nonce=t.get("nonce")))),e}function ya(t){var e=null;if(t.needConfirmation?(t.code="account-exists-with-different-credential",e=Yo(t)):"FEDERATED_USER_ID_ALREADY_LINKED"==t.errorMessage?(t.code="credential-already-in-use",e=Yo(t)):"EMAIL_EXISTS"==t.errorMessage?(t.code="email-already-in-use",e=Yo(t)):t.errorMessage&&(e=rc(t.errorMessage)),e)throw e;pa(t)}function ba(t,e){return e.returnIdpCredential=!0,nc(t,Ya,e)}function _a(t,e){return e.returnIdpCredential=!0,nc(t,Ga,e)}function wa(t,e){return e.returnIdpCredential=!0,e.autoCreate=!1,nc(t,Ka,e)}function Sa(t){if(!t.oobCode)throw new T("invalid-action-code")}(e=Gs.prototype).Cb=function(t,e){var n={idToken:t},r=[];return dt(fa,(function(t,i){var o=e[i];null===o?r.push(t):i in e&&(n[i]=o)})),r.length&&(n.deleteAttribute=r),nc(this,qa,n)},e.ub=function(t,e){return mt(t={requestType:"PASSWORD_RESET",email:t},e),nc(this,ja,t)},e.vb=function(t,e){return mt(t={requestType:"EMAIL_SIGNIN",email:t},e),nc(this,Ma,t)},e.tb=function(t,e){return mt(t={requestType:"VERIFY_EMAIL",idToken:t},e),nc(this,Da,t)},e.Db=function(t,e,n){return mt(t={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:t,newEmail:e},n),nc(this,La,t)},e.eb=function(t){return nc(this,Ja,t)},e.mb=function(t,e){return nc(this,Ha,{oobCode:t,newPassword:e})},e.Qa=function(t){return nc(this,Ea,{oobCode:t})},e.ib=function(t){return nc(this,Ca,{oobCode:t})};var Ca={endpoint:"setAccountInfo",B:Sa,Z:"email",C:!0},Ea={endpoint:"resetPassword",B:Sa,F:function(t){var e=t.requestType;if(!e||!t.email&&"EMAIL_SIGNIN"!=e&&"VERIFY_AND_CHANGE_EMAIL"!=e)throw new T("internal-error")},C:!0},xa={endpoint:"signupNewUser",B:function(t){if(la(t),!t.password)throw new T("weak-
408password")},F:pa,U:!0,C:!0},Ta={endpoint:"createAuthUri",C:!0},Ia={endpoint:"deleteAccount",M:["idToken"]},ka={endpoint:"setAccountInfo",M:["idToken","deleteProvider"],B:function(t){if("array"!=d(t.deleteProvider))throw new T("internal-error")}},Oa={endpoint:"emailLinkSignin",M:["email","oobCode"],B:la,F:pa,U:!0,C:!0},Aa={endpoint:"emailLinkSignin",M:["idToken","email","oobCode"],B:la,F:pa,U:!0},Ra={endpoint:"accounts/mfaEnrollment:finalize",M:["idToken","phoneVerificationInfo"],B:va,F:pa,C:!0,Na:!0},Na={endpoint:"accounts/mfaSignIn:finalize",M:["mfaPendingCredential","phoneVerificationInfo"],B:va,F:pa,C:!0,Na:!0},Pa={endpoint:"getAccountInfo"},Ma={endpoint:"getOobConfirmationCode",M:["requestType"],B:function(t){if("EMAIL_SIGNIN"!=t.requestType)throw new T("internal-error");la(t)},Z:"email",C:!0},Da={endpoint:"getOobConfirmationCode",M:["idToken","requestType"],B:function(t){if("VERIFY_EMAIL"!=t.requestType)throw new T("internal-error")},Z:"email",C:!0},La={endpoint:"getOobConfirmationCode",M:["idToken","newEmail","requestType"],B:function(t){if("VERIFY_AND_CHANGE_EMAIL"!=t.requestType)throw new T("internal-error")},Z:"email",C:!0},ja={endpoint:"getOobConfirmationCode",M:["requestType"],B:function(t){if("PASSWORD_RESET"!=t.requestType)throw new T("internal-error");la(t)},Z:"email",C:!0},Ua={kb:!0,endpoint:"getProjectConfig",Tb:"GET"},Fa={kb:!0,endpoint:"getRecaptchaParam",Tb:"GET",F:function(t){if(!t.recaptchaSiteKey)throw new T("internal-error")}},Ha={endpoint:"resetPassword",B:Sa,Z:"email",C:!0},Ba={endpoint:"sendVerificationCode",M:["phoneNumber","recaptchaToken"],Z:"sessionInfo",C:!0},qa={endpoint:"setAccountInfo",M:["idToken"],B:ha,U:!0},Va={endpoint:"setAccountInfo",M:["idToken"],B:function(t){if(ha(t),!t.password)throw new T("weak-password")},F:pa,U:!0},Wa={endpoint:"signupNewUser",F:pa,U:!0,C:!0},za={endpoint:"accounts/mfaEnrollment:start",M:["idToken","phoneEnrollmentInfo"],B:function(t){if(!t.phoneEnrollmentInfo)throw new T("internal-error");if(!t.phoneEnrollmentInfo.phoneNumber)throw new T("missing-phone-number");if(!t.phoneEnrollmentInfo.recaptchaToken)throw new T("missing-app-credential")},F:function(t){if(!t.phoneSessionInfo||!t.phoneSessionInfo.sessionInfo)throw new T("internal-error")},C:!0,Na:!0},$a={endpoint:"accounts/mfaSignIn:start",M:["mfaPendingCredential","mfaEnrollmentId","phoneSignInInfo"],B:function(t){if(!t.phoneSignInInfo||!t.phoneSignInInfo.recaptchaToken)throw new T("missing-app-credential")},F:function(t){if(!t.phoneResponseInfo||!t.phoneResponseInfo.sessionInfo)throw new T("internal-error")},C:!0,Na:!0},Ya={endpoint:"verifyAssertion",B:ga,Xa:ma,F:ya,U:!0,C:!0},Ka={endpoint:"verifyAssertion",B:ga,Xa:ma,F:function(t){if(t.errorMessage&&"USER_NOT_FOUND"==t.errorMessage)throw new T("user-not-found");if(t.errorMessage)throw rc(t.errorMessage);pa(t)},U:!0,C:!0},Ga={endpoint:"verifyAssertion",B:function(t){if(ga(t),!t.idToken)throw new T("internal-error")},Xa:ma,F:ya,U:!0},Qa={endpoint:"verifyCustomToken",B:function(t){if(!t.token)throw new T("invalid-custom-token")},F:pa,U:!0,C:!0},Xa={endpoint:"verifyPassword",B:function(t){if(la(t),!t.password)throw new T("wrong-password")},F:pa,U:!0,C:!0},Ja={endpoint:"verifyPhoneNumber",B:da,F:pa,C:!0},Za={endpoint:"verifyPhoneNumber",B:function(t){if(!t.idToken)throw new T("internal-error");da(t)},F:function(t){if(t.temporaryProof)throw t.code="credential-already-in-use",Yo(t);pa(t)}},tc={Gb:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",B:da,F:pa,C:!0},ec={endpoint:"accounts/mfaEnrollment:withdraw",M:["idToken","mfaEnrollmentId"],F:function(t){if(!!t[Xs]^!!t.refreshToken)throw new T("internal-error")},C:!0,Na:!0};function nc(t,e,n){if(!function(t,e){if(!e||!e.length)return!0;if(!t)return!1;for(var n=0;n<e.length;n++){var r=t[e[n]];if(null==r||""===r)return!1}return!0}(n,e.M))return Oe(new T("internal-error"));var r,i=!!e.Na,o=e.Tb||"POST";return ke(n).then(e.B).then((function(){return e.U&&(n.returnSecureToken=!0),e.C&&t.b&&void 0===n.tenantId&&(n.tenantId=t.b),ua(t,i?t.i:t.h,e.endpoint,o,n,e.Gb,e.kb||!1)})).then((function(t){return r=t,e.Xa?e.Xa(n,r):r})).then(e.F).then((function(){if(!e.Z)return r;if(!(e.Z in r))throw new T("internal-error");return r[e.Z]}))}function rc(t){return ic({error:{errors:[{message:t}],code:400,message:t}})}function ic(t,e){var n=(t.error&&t.error.errors&&t.error.errors[0]||{}).reason||"",r={keyInvalid:"invalid-api-key",ipRefererBlocked:"app-not-authorized"};if(n=r[n]?new T(r[n]):null)return n;for(var i in n=t.error&&t.error.message||"",mt(r={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVA
408LID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_EMAIL:"invalid-email",INVALID_PASSWORD:"wrong-password",USER_DISABLED:"user-disabled",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_OR_INVALID_NONCE:"missing-or-invalid-nonce",INVALID_MESSAGE_PAYLOAD:"invalid-message-payload",INVALID_RECIPIENT_EMAIL:"invalid-recipient-email",INVALID_SENDER:"invalid-sender",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",INVALID_PROVIDER_ID:"invalid-provider-id",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",CORS_UNSUPPORTED:"cors-unsupported",DYNAMIC_LINK_NOT_ACTIVATED:"dynamic-link-not-activated",INVALID_APP_ID:"invalid-app-id",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",WEAK_PASSWORD:"weak-password",OPERATION_NOT_ALLOWED:"operation-not-allowed",USER_CANCELLED:"user-cancelled",CAPTCHA_CHECK_FAILED:"captcha-check-failed",INVALID_APP_CREDENTIAL:"invalid-app-credential",INVALID_CODE:"invalid-verification-code",INVALID_PHONE_NUMBER:"invalid-phone-number",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_APP_CREDENTIAL:"missing-app-credential",MISSING_CODE:"missing-verification-code",MISSING_PHONE_NUMBER:"missing-phone-number",MISSING_SESSION_INFO:"missing-verification-id",QUOTA_EXCEEDED:"quota-exceeded",SESSION_EXPIRED:"code-expired",REJECTED_CREDENTIAL:"rejected-credential",INVALID_CONTINUE_URI:"invalid-continue-uri",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",MISSING_IOS_BUNDLE_ID:"missing-ios-bundle-id",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_DYNAMIC_LINK_DOMAIN:"invalid-dynamic-link-domain",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",INVALID_CERT_HASH:"invalid-cert-hash",UNSUPPORTED_TENANT_OPERATION:"unsupported-tenant-operation",INVALID_TENANT_ID:"invalid-tenant-id",TENANT_ID_MISMATCH:"tenant-id-mismatch",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",EMAIL_CHANGE_NEEDS_VERIFICATION:"email-change-needs-verification",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",UNSUPPORTED_FIRST_FACTOR:"unsupported-first-factor",UNVERIFIED_EMAIL:"unverified-email"},e||{}),e=(e=n.match(/^[^\s]+\s*:\s*([\s\S]*)$/))&&1<e.length?e[1]:void 0,r)if(0===n.indexOf(i))return new T(r[i],e);return!e&&t&&(e=Mr(t)),new T("internal-error",e)}function oc(t){this.b=t,this.a=null,this.qb=function(t){return(uc||(uc=new we((function(t,e){function n(){Fr(),kr("gapi.load")("gapi.iframes",{callback:t,ontimeout:function(){Fr(),e(Error("Network Error"))},timeout:ac.get()})}if(kr("gapi.iframes.Iframe"))t();else if(kr("gapi.load"))n();else{var r="__iframefcb"+Math.floor(1e6*Math.random()).toString();u[r]=function(){kr("gapi.load")?n():e(Error("Network Error"))},ke(qs(r=Tt(sc,{onload:r}))).s((function(){e(Error("Network Error"))}))}})).s((function(t){throw uc=null,t})))).then((function(){return new we((function(e,n){kr("gapi.iframes.getContext")().open({where:document.body,url:t.b,messageHandlersFilter:kr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"),attributes:{style:{position:"absolute",top:"-100px",width:"1px",height:"1px"}},dontclear:!0},(function(r){function i(){clearTimeout(o),e()}t.a=r,t.a.restyle({setHideOnLeave:!1});var o=setTimeout((function(){n(Error("Network Error"))}),cc.get());r.ping(i).then(i,(function(){n(Error("Network Error"))}))}))}))}))}(this)}var sc=new bt(St,"https://apis.google.com/js/api.js?onload=%{onload}"),ac=new Hr(3e4,6e4),cc=new Hr(5e3,15e3),uc=null;function lc(t,e,n,r){this.l=t,this.h=e,this.i=n,this.g=r,this.f=null,this.g?t=Hn((t=Fn(this.g.url)).f,t.a,t.g,"/emulator/auth/iframe"):t=Hn("https",this.l,null,"/__/auth/iframe"),this.a=t,jn(this.a,"apiKey",this.h),jn(this.a,"appName",this.i),this.b=null,this.c=[]}function hc(t,e,n,r,i,o){this.u=t,this.o=e,this.c=n,this.v=r,this.m=o,this.i=this.g=this.l=null,this.a=i,this.h=this.f=null}function pc(t){try{return r.app(t).auth().Ga()}catch(t){return[]}}function dc(t,e,n,r,i,o){this.o=t,this.g=e,this.b=n,this.f=o,this.c=r||null,this.i=i||null,this.l=this.u=this.A=null,this.h=[],this.v=this.a=null}function fc(t){var e=ur();return function(t){return nc(t,Ua,{}).then((function(t){return t.authorizedDomains||[]}))}(t).then((function(t){t:{var n=Fn(e),r=n.f;n=n.a;for(var i=0;i<t.length;i++){var o=t[i],s=n,a=r;
408if(0==o.indexOf("chrome-extension://")?s=Fn(o).a==s&&"chrome-extension"==a:"http"!=a&&"https"!=a?s=!1:fr.test(o)?s=s==o:(o=o.split(".").join("\\."),s=new RegExp("^(.+\\."+o+"|"+o+")$","i").test(s)),s){t=!0;break t}}t=!1}if(!t)throw new zo(ur())}))}function vc(t){return t.v?t.v:(t.v=gr().then((function(){if(!t.u){var e=t.c,n=t.i,r=pc(t.b),i=new lc(t.o,t.g,t.b,t.f);i.f=e,i.b=n,i.c=J(r||[]),t.u=i.toString()}t.m=new oc(t.u),function(t){if(!t.m)throw Error("IfcHandler must be initialized!");!function(t,e){t.qb.then((function(){t.a.register("authEvent",e,kr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}(t.m,(function(e){var n={};if(e&&e.authEvent){var r=!1;for(e=Bo(e.authEvent),n=0;n<t.h.length;n++)r=t.h[n](e)||r;return(n={}).status=r?"ACK":"ERROR",ke(n)}return n.status="ERROR",ke(n)}))}(t)})),t.v)}function gc(t){return t.l||(t.A=t.c?Tr(t.c,pc(t.b)):null,t.l=new Gs(t.g,N(t.i),t.A),t.f&&ra(t.l,t.f)),t.l}function mc(t,e,n,r,i,o,s,a,c,u,l,h){return(t=new hc(t,e,n,r,i,h)).l=o,t.g=s,t.i=a,t.b=vt(c||null),t.f=u,t.xb(l).toString()}function yc(t){if(this.a=t||r.INTERNAL.reactNative&&r.INTERNAL.reactNative.AsyncStorage,!this.a)throw new T("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function bc(t){this.b=t,this.a={},this.f=S(this.c,this)}lc.prototype.toString=function(){return this.f?jn(this.a,"v",this.f):Jn(this.a.b,"v"),this.b?jn(this.a,"eid",this.b):Jn(this.a.b,"eid"),this.c.length?jn(this.a,"fw",this.c.join(",")):Jn(this.a.b,"fw"),this.a.toString()},hc.prototype.xb=function(t){return this.h=t,this},hc.prototype.toString=function(){if(this.m){var t=Fn(this.m.url);t=Hn(t.f,t.a,t.g,"/emulator/auth/handler")}else t=Hn("https",this.u,null,"/__/auth/handler");if(jn(t,"apiKey",this.o),jn(t,"appName",this.c),jn(t,"authType",this.v),this.a.isOAuthProvider){var e=this.a;try{var n=r.app(this.c).auth().ka()}catch(t){n=null}for(var i in e.nb=n,jn(t,"providerId",this.a.providerId),e=Dr((n=this.a).Hb))e[i]=e[i].toString();i=n.Pc,e=vt(e);for(var o=0;o<i.length;o++){var s=i[o];s in e&&delete e[s]}n.ob&&n.nb&&!e[n.ob]&&(e[n.ob]=n.nb),ft(e)||jn(t,"customParameters",Mr(e))}if("function"==typeof this.a.Pb&&((n=this.a.Pb()).length&&jn(t,"scopes",n.join(","))),this.l?jn(t,"redirectUrl",this.l):Jn(t.b,"redirectUrl"),this.g?jn(t,"eventId",this.g):Jn(t.b,"eventId"),this.i?jn(t,"v",this.i):Jn(t.b,"v"),this.b)for(var a in this.b)this.b.hasOwnProperty(a)&&!Un(t,a)&&jn(t,a,this.b[a]);return this.h?jn(t,"tid",this.h):Jn(t.b,"tid"),this.f?jn(t,"eid",this.f):Jn(t.b,"eid"),(a=pc(this.c)).length&&jn(t,"fw",a.join(",")),t.toString()},(e=dc.prototype).Nb=function(t,e,n){var r=new T("popup-closed-by-user"),i=new T("web-storage-unsupported"),o=this,s=!1;return this.la().then((function(){(function(t){var e={type:"webStorageSupport"};return vc(t).then((function(){return function(t,e){return t.qb.then((function(){return new we((function(n){t.a.send(e.type,e,n,kr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}))}(t.m,e)})).then((function(t){if(t&&t.length&&void 0!==t[0].webStorageSupport)return t[0].webStorageSupport;throw Error()}))})(o).then((function(n){n||(t&&pr(t),e(i),s=!0)}))})).s((function(){})).then((function(){if(!s)return function(t){return new we((function(e){return function n(){Tn(2e3).then((function(){if(t&&!t.closed)return n();e()}))}()}))}(t)})).then((function(){if(!s)return Tn(n).then((function(){e(r)}))}))},e.Wb=function(){var t=Ir();return!Pr(t)&&!Ur(t)},e.Sb=function(){return!1},e.Lb=function(t,e,n,r,i,o,s,a){if(!t)return Oe(new T("popup-blocked"));if(s&&!Pr())return this.la().s((function(e){pr(t),i(e)})),r(),ke();this.a||(this.a=fc(gc(this)));var c=this;return this.a.then((function(){var e=c.la().s((function(e){throw pr(t),i(e),e}));return r(),e})).then((function(){(Fo(n),s)||lr(mc(c.o,c.g,c.b,e,n,null,o,c.c,void 0,c.i,a,c.f),t)})).s((function(t){throw"auth/network-request-failed"==t.code&&(c.a=null),t}))},e.Mb=function(t,e,n,r){this.a||(this.a=fc(gc(this)));var i=this;return this.a.then((function(){Fo(e),lr(mc(i.o,i.g,i.b,t,e,ur(),n,i.c,void 0,i.i,r,i.f))})).s((function(t){throw"auth/network-request-failed"==t.code&&(i.a=null),t}))},e.la=function(){var t=this;
408return vc(this).then((function(){return t.m.qb})).s((function(){throw t.a=null,new T("network-request-failed")}))},e.Zb=function(){return!0},e.Ea=function(t){this.h.push(t)},e.Ra=function(t){Q(this.h,(function(e){return e==t}))},(e=yc.prototype).get=function(t){return ke(this.a.getItem(t)).then((function(t){return t&&Lr(t)}))},e.set=function(t,e){return ke(this.a.setItem(t,Mr(e)))},e.T=function(t){return ke(this.a.removeItem(t))},e.ca=function(){},e.ia=function(){};var _c,wc=[];function Sc(t,e,n){ft(t.a)&&t.b.addEventListener("message",t.f),void 0===t.a[e]&&(t.a[e]=[]),t.a[e].push(n)}function Cc(t){this.a=t}function Ec(t){this.c=t,this.b=!1,this.a=[]}function xc(t,e,n,r){var i,o,s,a,c=n||{},u=null;if(t.b)return Oe(Error("connection_unavailable"));var l=r?800:50,h="undefined"!=typeof MessageChannel?new MessageChannel:null;return new we((function(n,r){h?(i=Math.floor(Math.random()*Math.pow(10,20)).toString(),h.port1.start(),s=setTimeout((function(){r(Error("unsupported_event"))}),l),u={messageChannel:h,onMessage:o=function(t){t.data.eventId===i&&("ack"===t.data.status?(clearTimeout(s),a=setTimeout((function(){r(Error("timeout"))}),3e3)):"done"===t.data.status?(clearTimeout(a),void 0!==t.data.response?n(t.data.response):r(Error("unknown_error"))):(clearTimeout(s),clearTimeout(a),r(Error("invalid_response"))))}},t.a.push(u),h.port1.addEventListener("message",o),t.c.postMessage({eventType:e,eventId:i,data:c},[h.port2])):r(Error("connection_unavailable"))})).then((function(e){return Tc(t,u),e})).s((function(e){throw Tc(t,u),e}))}function Tc(t,e){if(e){var n=e.messageChannel,r=e.onMessage;n&&(n.port1.removeEventListener("message",r),n.port1.close()),Q(t.a,(function(t){return t==e}))}}function Ic(){if(!Ac())throw new T("web-storage-unsupported");this.c={},this.a=[],this.b=0,this.m=u.indexedDB,this.type="indexedDB",this.g=this.l=this.f=this.i=null,this.o=!1,this.h=null;var t=this;br()&&self?(this.l=function(){var t=br()?self:null;if(W(wc,(function(n){n.b==t&&(e=n)})),!e){var e=new bc(t);wc.push(e)}return e}(),Sc(this.l,"keyChanged",(function(e,n){return Dc(t).then((function(e){return 0<e.length&&W(t.a,(function(t){t(e)})),{keyProcessed:K(e,n.key)}}))})),Sc(this.l,"ping",(function(){return ke(["keyChanged"])}))):function(){var t=u.navigator;return t&&t.serviceWorker?ke().then((function(){return t.serviceWorker.ready})).then((function(t){return t.active||null})).s((function(){return null})):ke(null)}().then((function(e){(t.h=e)&&(t.g=new Ec(new Cc(e)),xc(t.g,"ping",null,!0).then((function(e){e[0].fulfilled&&K(e[0].value,"keyChanged")&&(t.o=!0)})).s((function(){})))}))}function kc(t){return new we((function(e,n){var r=t.m.open("firebaseLocalStorageDb",1);r.onerror=function(t){try{t.preventDefault()}catch(t){}n(Error(t.target.error))},r.onupgradeneeded=function(t){t=t.target.result;try{t.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(t){n(t)}},r.onsuccess=function(r){(r=r.target.result).objectStoreNames.contains("firebaseLocalStorage")?e(r):function(t){return new we((function(e,n){var r=t.m.deleteDatabase("firebaseLocalStorageDb");r.onsuccess=function(){e()},r.onerror=function(t){n(Error(t.target.error))}}))}(t).then((function(){return kc(t)})).then((function(t){e(t)})).s((function(t){n(t)}))}}))}function Oc(t){return t.v||(t.v=kc(t)),t.v}function Ac(){try{return!!u.indexedDB}catch(t){return!1}}function Rc(t){return t.objectStore("firebaseLocalStorage")}function Nc(t,e){return t.transaction(["firebaseLocalStorage"],e?"readwrite":"readonly")}function Pc(t){return new we((function(e,n){t.onsuccess=function(t){t&&t.target?e(t.target.result):e()},t.onerror=function(t){n(t.target.error)}}))}function Mc(t,e){return t.g&&t.h&&function(){var t=u.navigator;return t&&t.serviceWorker&&t.serviceWorker.controller||null}()===t.h?xc(t.g,"keyChanged",{key:e},t.o).then((function(){})).s((function(){})):ke()}function Dc(t){return Oc(t).then((function(t){var e=Rc(Nc(t,!1));return e.getAll?Pc(e.getAll()):new we((function(t,n){var r=[],i=e.openCursor();i.onsuccess=function(e){(e=e.target.result)?(r.push(e.value),e.continue()):t(r)},i.onerror=function(t){n(t.target.error)}}))})).then((function(e){var n={},r=[];if(0==t.b){for(r=0;r<e.length;r++)n[e[r].fbase_key]=e[r].value;r=function t(e,n){var r,i=[];for(r in e)r in n?typeof e[r]!=typeof n[r]?i.push(r):"object"==typeof e[r]&&null!=e[r]&&null!=n[r]?0<t(e[r],n[r]).length&&i.push(r):e[r]!==n[r]&&i.push(r):i.push(r);for(r in n)r in e||i.push(r);return i}(t.c,n),t.c=n}return r}))}function Lc(t){t.i&&t.i.cancel("STOP_EVENT"),t.f&&(clearTimeout(t.f),t.f=null)}function jc(t){var e=this,n=null;this.a=[],this.type="indexedDB",this.c=t,this.b=ke().then((function(){if(Ac()){var t=jr(),r="__sak"+t;return _c||(_c=new Ic),(n=_c).set(r,t).then((function(){return n.get(r)})).then((function(e){if(e!==t)throw Error("indexedDB not supported!");return n.T(r)})).then((function(){return n})).s((function(){return e.c}))}return e.c})).then((function(t){return e.type=t.type,t.ca((function(t){W(e.a,(function(e){e(t)}))}
408)),t}))}function Uc(){this.a={},this.type="inMemory"}function Fc(){if(!function(){var t="Node"==_r();if(!(t=Hc()||t&&r.INTERNAL.node&&r.INTERNAL.node.localStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(t){return!1}}()){if("Node"==_r())throw new T("internal-error","The LocalStorage compatibility library was not found.");throw new T("web-storage-unsupported")}this.a=Hc()||r.INTERNAL.node.localStorage,this.type="localStorage"}function Hc(){try{var t=u.localStorage,e=jr();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(t){return null}}function Bc(){this.type="nullStorage"}function qc(){if(!function(){var t="Node"==_r();if(!(t=Vc()||t&&r.INTERNAL.node&&r.INTERNAL.node.sessionStorage))return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(t){return!1}}()){if("Node"==_r())throw new T("internal-error","The SessionStorage compatibility library was not found.");throw new T("web-storage-unsupported")}this.a=Vc()||r.INTERNAL.node.sessionStorage,this.type="sessionStorage"}function Vc(){try{var t=u.sessionStorage,e=jr();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(t){return null}}function Wc(){var t={};t.Browser=Yc,t.Node=Kc,t.ReactNative=Gc,t.Worker=Qc,this.a=t[_r()]}bc.prototype.c=function(t){var e=t.data.eventType,n=t.data.eventId,r=this.a[e];if(r&&0<r.length){t.ports[0].postMessage({status:"ack",eventId:n,eventType:e,response:null});var i=[];W(r,(function(e){i.push(ke().then((function(){return e(t.origin,t.data.data)})))})),Re(i).then((function(r){var i=[];W(r,(function(t){i.push({fulfilled:t.Ob,value:t.value,reason:t.reason?t.reason.message:void 0})})),W(i,(function(t){for(var e in t)void 0===t[e]&&delete t[e]})),t.ports[0].postMessage({status:"done",eventId:n,eventType:e,response:i})}))}},Cc.prototype.postMessage=function(t,e){this.a.postMessage(t,e)},Ec.prototype.close=function(){for(;0<this.a.length;)Tc(this,this.a[0]);this.b=!0},(e=Ic.prototype).set=function(t,e){var n,r=!1,i=this;return Oc(this).then((function(e){return Pc((e=Rc(Nc(n=e,!0))).get(t))})).then((function(o){var s=Rc(Nc(n,!0));return o?(o.value=e,Pc(s.put(o))):(i.b++,r=!0,(o={}).fbase_key=t,o.value=e,Pc(s.add(o)))})).then((function(){return i.c[t]=e,Mc(i,t)})).na((function(){r&&i.b--}))},e.get=function(t){return Oc(this).then((function(e){return Pc(Rc(Nc(e,!1)).get(t))})).then((function(t){return t&&t.value}))},e.T=function(t){var e=!1,n=this;return Oc(this).then((function(r){return e=!0,n.b++,Pc(Rc(Nc(r,!0)).delete(t))})).then((function(){return delete n.c[t],Mc(n,t)})).na((function(){e&&n.b--}))},e.ca=function(t){0==this.a.length&&function(t){Lc(t),function e(){t.f=setTimeout((function(){t.i=Dc(t).then((function(e){0<e.length&&W(t.a,(function(t){t(e)}))})).then((function(){e()})).s((function(t){"STOP_EVENT"!=t.message&&e()}))}),800)}()}(this),this.a.push(t)},e.ia=function(t){Q(this.a,(function(e){return e==t})),0==this.a.length&&Lc(this)},(e=jc.prototype).get=function(t){return this.b.then((function(e){return e.get(t)}))},e.set=function(t,e){return this.b.then((function(n){return n.set(t,e)}))},e.T=function(t){return this.b.then((function(e){return e.T(t)}))},e.ca=function(t){this.a.push(t)},e.ia=function(t){Q(this.a,(function(e){return e==t}))},(e=Uc.prototype).get=function(t){return ke(this.a[t])},e.set=function(t,e){return this.a[t]=e,ke()},e.T=function(t){return delete this.a[t],ke()},e.ca=function(){},e.ia=function(){},(e=Fc.prototype).get=function(t){var e=this;return ke().then((function(){return Lr(e.a.getItem(t))}))},e.set=function(t,e){var n=this;return ke().then((function(){var r=Mr(e);null===r?n.T(t):n.a.setItem(t,r)}))},e.T=function(t){var e=this;return ke().then((function(){e.a.removeItem(t)}))},e.ca=function(t){u.window&&un(u.window,"storage",t)},e.ia=function(t){u.window&&pn(u.window,"storage",t)},(e=Bc.prototype).get=function(){return ke(null)},e.set=function(){return ke()},e.T=function(){return ke()},e.ca=function(){},e.ia=function(){},(e=qc.prototype).get=function(t){var e=this;return ke().then((function(){return Lr(e.a.getItem(t))}))},e.set=function(t,e){var n=this;return ke().then((function(){var r=Mr(e);null===r?n.T(t):n.a.setItem(t,r)}))},e.T=function(t){var e=this;return ke().then((function(){e.a.removeItem(t)}))},e.ca=function(){},e.ia=function(){};var zc,$c,Yc={D:Fc,ab:qc},Kc={D:Fc,ab:qc},Gc={D:yc,ab:Bc},Qc={D:Fc,ab:Bc},Xc={qd:"local",NONE:"none",sd:"session"};
408function Jc(){var t=!(Ur(Ir())||!yr()),e=Pr(),n=Or();this.v=t,this.h=e,this.l=n,this.a={},zc||(zc=new Wc),t=zc;try{this.g=!cr()&&Wr()||!u.indexedDB?new t.a.D:new jc(br()?new Uc:new t.a.D)}catch(t){this.g=new Uc,this.h=!0}try{this.i=new t.a.ab}catch(t){this.i=new Uc}this.m=new Uc,this.f=S(this.Xb,this),this.b={}}function Zc(){return $c||($c=new Jc),$c}function tu(t,e){switch(e){case"session":return t.i;case"none":return t.m;default:return t.g}}function eu(t,e){return"firebase:"+t.name+(e?":"+e:"")}function nu(t,e,n){return n=eu(e,n),"local"==e.D&&(t.b[n]=null),tu(t,e.D).T(n)}function ru(t){t.c&&(clearInterval(t.c),t.c=null)}function iu(t){this.a=t,this.b=Zc()}(e=Jc.prototype).get=function(t,e){return tu(this,t.D).get(eu(t,e))},e.set=function(t,e,n){var r=eu(t,n),i=this,o=tu(this,t.D);return o.set(r,e).then((function(){return o.get(r)})).then((function(e){"local"==t.D&&(i.b[r]=e)}))},e.addListener=function(t,e,n){t=eu(t,e),this.l&&(this.b[t]=u.localStorage.getItem(t)),ft(this.a)&&(tu(this,"local").ca(this.f),this.h||(cr()||!Wr())&&u.indexedDB||!this.l||function(t){ru(t),t.c=setInterval((function(){for(var e in t.a){var n=u.localStorage.getItem(e),r=t.b[e];n!=r&&(t.b[e]=n,n=new Xe({type:"storage",key:e,target:window,oldValue:r,newValue:n,a:!0}),t.Xb(n))}}),1e3)}(this)),this.a[t]||(this.a[t]=[]),this.a[t].push(n)},e.removeListener=function(t,e,n){t=eu(t,e),this.a[t]&&(Q(this.a[t],(function(t){return t==n})),0==this.a[t].length&&delete this.a[t]),ft(this.a)&&(tu(this,"local").ia(this.f),ru(this))},e.Xb=function(t){if(t&&t.g){var e=t.a.key;if(null==e)for(var n in this.a){var r=this.b[n];void 0===r&&(r=null);var i=u.localStorage.getItem(n);i!==r&&(this.b[n]=i,this.lb(n))}else if(0==e.indexOf("firebase:")&&this.a[e]){if(void 0!==t.a.a?tu(this,"local").ia(this.f):ru(this),this.v)if(n=u.localStorage.getItem(e),(r=t.a.newValue)!==n)null!==r?u.localStorage.setItem(e,r):u.localStorage.removeItem(e);else if(this.b[e]===r&&void 0===t.a.a)return;var o=this;n=function(){void 0===t.a.a&&o.b[e]===u.localStorage.getItem(e)||(o.b[e]=u.localStorage.getItem(e),o.lb(e))},Kt&&re&&10==re&&u.localStorage.getItem(e)!==t.a.newValue&&t.a.newValue!==t.a.oldValue?setTimeout(n,10):n()}}else W(t,S(this.lb,this))},e.lb=function(t){this.a[t]&&W(this.a[t],(function(t){t()}))};var ou,su={name:"authEvent",D:"local"};function au(){this.a=Zc()}function cu(t,e){this.b=uu,this.f=u.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=t,this.h=e,this.l=u.Int32Array?new Int32Array(64):Array(64),void 0===ou&&(ou=u.Int32Array?new Int32Array(gu):gu),this.reset()}x(cu,(function(){this.b=-1}));for(var uu=64,lu=uu-1,hu=[],pu=0;pu<lu;pu++)hu[pu]=0;var du=X(128,hu);function fu(t){for(var e=t.f,n=t.l,r=0,i=0;i<e.length;)n[r++]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3],i=4*r;for(e=16;64>e;e++){i=0|n[e-15],r=0|n[e-2];var o=(0|n[e-16])+((i>>>7|i<<25)^(i>>>18|i<<14)^i>>>3)|0,s=(0|n[e-7])+((r>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)|0;n[e]=o+s|0}r=0|t.a[0],i=0|t.a[1];var a=0|t.a[2],c=0|t.a[3],u=0|t.a[4],l=0|t.a[5],h=0|t.a[6];for(o=0|t.a[7],e=0;64>e;e++){var p=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&i^r&a^i&a)|0;s=(o=o+((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))|0)+((s=(s=u&l^~u&h)+(0|ou[e])|0)+(0|n[e])|0)|0,o=h,h=l,l=u,u=c+s|0,c=a,a=i,i=r,r=s+p|0}t.a[0]=t.a[0]+r|0,t.a[1]=t.a[1]+i|0,t.a[2]=t.a[2]+a|0,t.a[3]=t.a[3]+c|0,t.a[4]=t.a[4]+u|0,t.a[5]=t.a[5]+l|0,t.a[6]=t.a[6]+h|0,t.a[7]=t.a[7]+o|0}function vu(t,e,n){void 0===n&&(n=e.length);var r=0,i=t.c;if("string"==typeof e)for(;r<n;)t.f[i++]=e.charCodeAt(r++),i==t.b&&(fu(t),i=0);else{if(!f(e))throw Error("message must be string or array");for(;r<n;){var o=e[r++];if(!("number"==typeof o&&0<=o&&255>=o&&o==(0|o)))throw Error("message must be a byte array");t.f[i++]=o,i==t.b&&(fu(t),i=0)}}t.c=i,t.g+=n}cu.prototype.reset=function(){this.g=this.c=0,this.a=u.Int32Array?new Int32Array(this.h):J(this.h)};var gu=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
408734187,3204031479,3329325298];function mu(){cu.call(this,8,yu)}x(mu,cu);var yu=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function bu(t,e,n,r,i,o){this.m=t,this.i=e,this.l=n,this.v=r||null,this.u=i||null,this.o=o,this.h=e+":"+n,this.A=new au,this.g=new iu(this.h),this.f=null,this.b=[],this.a=this.c=null}function _u(t){return new T("invalid-cordova-configuration",t)}function wu(t){var e=new mu;vu(e,t),t=[];var n=8*e.g;56>e.c?vu(e,du,56-e.c):vu(e,du,e.b-(e.c-56));for(var r=63;56<=r;r--)e.f[r]=255&n,n/=256;for(fu(e),r=n=0;r<e.i;r++)for(var i=24;0<=i;i-=8)t[n++]=e.a[r]>>i&255;return function(t){return $(t,(function(t){return 1<(t=t.toString(16)).length?t:"0"+t})).join("")}(t)}function Su(t,e){for(var n=0;n<t.b.length;n++)try{t.b[n](e)}catch(t){}}function Cu(t){return t.f||(t.f=t.la().then((function(){return new we((function(e){t.Ea((function n(r){return e(r),t.Ra(n),!1})),function(t){function e(e){r=!0,i&&i.cancel(),Eu(t).then((function(r){var i=n;if(r&&e&&e.url){var o=null;-1!=(i=io(e.url)).indexOf("/__/auth/callback")&&(o=(o="object"==typeof(o=Lr(Un(o=Fn(i),"firebaseError")||null))?I(o):null)?new Ho(r.c,r.b,null,null,o,null,r.S()):new Ho(r.c,r.b,i,r.f,null,null,r.S())),i=o||n}Su(t,i)}))}var n=new Ho("unknown",null,null,null,new T("no-auth-event")),r=!1,i=Tn(500).then((function(){return Eu(t).then((function(){r||Su(t,n)}))})),o=u.handleOpenURL;u.handleOpenURL=function(t){if(0==t.toLowerCase().indexOf(kr("BuildInfo.packageName",u).toLowerCase()+"://")&&e({url:t}),"function"==typeof o)try{o(t)}catch(t){console.error(t)}},Wo||(Wo=new qo),function(t){var e=Wo;e.a.push(t),e.b||(e.b=function(t){for(var n=0;n<e.a.length;n++)e.a[n](t)},"function"==typeof(t=kr("universalLinks.subscribe",u))&&t(null,e.b))}(e)}(t)}))}))),t.f}function Eu(t){var e=null;return function(t){return t.b.get(su,t.a).then((function(t){return Bo(t)}))}(t.g).then((function(n){return e=n,nu((n=t.g).b,su,n.a)})).then((function(){return e}))}function xu(t){this.a=t,this.b=Zc()}(e=bu.prototype).la=function(){return this.Ia?this.Ia:this.Ia=(mr(void 0)?gr().then((function(){return new we((function(t,e){var n=u.document,r=setTimeout((function(){e(Error("Cordova framework is not ready."))}),1e3);n.addEventListener("deviceready",(function(){clearTimeout(r),t()}),!1)}))})):Oe(Error("Cordova must run in an Android or iOS file scheme."))).then((function(){if("function"!=typeof kr("universalLinks.subscribe",u))throw _u("cordova-universal-links-plugin-fix is not installed");if(void 0===kr("BuildInfo.packageName",u))throw _u("cordova-plugin-buildinfo is not installed");if("function"!=typeof kr("cordova.plugins.browsertab.openUrl",u))throw _u("cordova-plugin-browsertab is not installed");if("function"!=typeof kr("cordova.InAppBrowser.open",u))throw _u("cordova-plugin-inappbrowser is not installed")}),(function(){throw new T("cordova-not-ready")}))},e.Nb=function(t,e){return e(new T("operation-not-supported-in-this-environment")),ke()},e.Lb=function(){return Oe(new T("operation-not-supported-in-this-environment"))},e.Zb=function(){return!1},e.Wb=function(){return!0},e.Sb=function(){return!0},e.Mb=function(t,e,n,r){if(this.c)return Oe(new T("redirect-operation-pending"));var i=this,o=u.document,s=null,a=null,c=null,l=null;return this.c=ke().then((function(){return Fo(e),Cu(i)})).then((function(){return function(t,e,n,r,i){var o=function(){for(var t=20,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}(),s=new Ho(e,r,null,o,new T("no-auth-event"),null,i),a=kr("BuildInfo.packageName",u);if("string"!=typeof a)throw new T("invalid-cordova-configuration");var c=kr("BuildInfo.displayName",u),l={};if(Ir().toLowerCase().match(/iphone|ipad|ipod/))l.ibi=a;else{if(!Ir().toLowerCase().match(/android/))return Oe(new T("operation-not-supported-in-this-environment"));l.apn=a}c&&(l.appDisplayName=c),o=wu(o),l.sessionId=o;var h=mc(t.m,t.i,t.l,e,n,null,r,t.v,l,t.u,i,t.o);return t.la().then((function(){var e=t.h;return t.A.a.set(su,s.w(),e)})).then((function(){var e=kr("cordova.plugins.browsertab.isAvailable",u);if("function"!=typeof e)throw new T("invalid-cordova-configuration");var n=null;e((function(e){if(e){if("function"!=typeof(n=kr("cordova.plugins.browsertab.openUrl",u)))throw new T("invalid-cordova-configuration");n(h)}else{if("function"!=typeof(n=kr("cordova.InAppBrowser.open",u)))throw new T("invalid-cordova-configuration");e=Ir(),t.a=n(h,e.match(/(iPad|iPhone|iPod).*OS 7_\d/i)||e.match(/(iPad|iPhone|iPod).*OS 8_\d/i)?"_blank":"_system","location=yes")}}))}))}(i,t,e,n,r)})).then((function(){return new we((function(t,e){a=function(){var e=kr("cordova.plugins.browsertab.close",u);return t(),"function"==typeof e&&e(),i.a&&"function"==typeof i.a.close&&(i.a.close(),i.a=null),!1},i.Ea(a),c=function(){s||(s=Tn(2e3).then((function(){e(new T("redirect-cancelled-by-user"))})))},l=function(){Br()&&c()},o.addEventListener("resume",c,!1),Ir().toLowerCase().match(/android/)||o.addEventListener("visibilitychange",l,!1)})).s((function(t){return Eu(i).then((function(){throw t}))}))})).na((function(){c&&o.removeEventListener("resume",c,!1),l&&o.removeEventListener("visibilitychange",l,!1),s&&s.cancel(),a&&i.Ra(a),i.c=null}))},e.Ea=function(t){this.b.push(t),Cu(this).s((function(e){"auth/invalid-cordova-configuration"===e.code&&(e=new Ho("unknown",null,null,null,new T("no-auth-event")),t(e))}))},e.Ra=function(t){Q(this.b,(function(e){return e==t}))};var Tu={name:"pendingRedirect",D:"session"};function Iu(t){return nu(t.b,Tu,t.a)}function ku(t,e,n,r){this.i={},this.u=0,this.O=t,this.m=e,this.v=n,this.G=r,this.h=[],this.f=!1,this.l=S(this.o,this),this.b=new Vu,this.A=new Ku,this.g=new xu(Bu(this.m,this.v)),this.c={},this.c.unknown=this.b,this.c.signInViaRedirect=this.b,this.c.linkViaRedirect=this.b,this.c.reauthViaRedirect=this.b,this.c.signInViaPopup=this.A,this.c.linkViaPopup=this.A,this.c.reauthViaPopup=this.A,this.a=Ou(this.O,this.m,this.v,k,this.G)}function Ou(t,e,n,i,o){var s=r.SDK_VERSION||null;return mr()?new bu(t,e,n,s,i,o):new dc(t,e,n,s,i,o)}
408function Au(t){t.f||(t.f=!0,t.a.Ea(t.l));var e=t.a;return t.a.la().s((function(n){throw t.a==e&&t.reset(),n}))}function Ru(t){t.a.Wb()&&Au(t).s((function(e){var n=new Ho("unknown",null,null,null,new T("operation-not-supported-in-this-environment"));ju(e)&&t.o(n)})),t.a.Sb()||Wu(t.b)}function Nu(t,e){K(t.h,e)||t.h.push(e),t.f||function(t){return t.b.get(Tu,t.a).then((function(t){return"pending"==t}))}(t.g).then((function(e){e?Iu(t.g).then((function(){Au(t).s((function(e){var n=new Ho("unknown",null,null,null,new T("operation-not-supported-in-this-environment"));ju(e)&&t.o(n)}))})):Ru(t)})).s((function(){Ru(t)}))}function Pu(t,e){Q(t.h,(function(t){return t==e}))}ku.prototype.reset=function(){this.f=!1,this.a.Ra(this.l),this.a=Ou(this.O,this.m,this.v,null,this.G),this.i={}},ku.prototype.o=function(t){if(!t)throw new T("invalid-auth-event");if(6e5<=E()-this.u&&(this.i={},this.u=0),t&&t.getUid()&&this.i.hasOwnProperty(t.getUid()))return!1;for(var e=!1,n=0;n<this.h.length;n++){var r=this.h[n];if(r.Eb(t.c,t.b)){(e=this.c[t.c])&&(e.h(t,r),t&&(t.f||t.b)&&(this.i[t.getUid()]=!0,this.u=E())),e=!0;break}}return Wu(this.b),e};var Mu=new Hr(2e3,1e4),Du=new Hr(3e4,6e4);function Lu(t,e,n,r,i,o,s){return t.a.Lb(e,n,r,(function(){t.f||(t.f=!0,t.a.Ea(t.l))}),(function(){t.reset()}),i,o,s)}function ju(t){return!(!t||"auth/cordova-not-ready"!=t.code)}function Uu(t,e,n,r,i){var o;return function(t){return t.b.set(Tu,"pending",t.a)}(t.g).then((function(){return t.a.Mb(e,n,r,i).s((function(e){if(ju(e))throw new T("operation-not-supported-in-this-environment");return o=e,Iu(t.g).then((function(){throw o}))})).then((function(){return t.a.Zb()?new we((function(){})):Iu(t.g).then((function(){return t.qa()})).then((function(){})).s((function(){}))}))}))}function Fu(t,e,n,r,i){return t.a.Nb(r,(function(t){e.ma(n,null,t,i)}),Mu.get())}ku.prototype.qa=function(){return this.b.qa()};var Hu={};function Bu(t,e,n){return t=t+":"+e,n&&(t=t+":"+n.url),t}function qu(t,e,n,r){var i=Bu(e,n,r);return Hu[i]||(Hu[i]=new ku(t,e,n,r)),Hu[i]}function Vu(){this.b=null,this.f=[],this.c=[],this.a=null,this.i=this.g=!1}function Wu(t){t.g||(t.g=!0,Yu(t,!1,null,null))}function zu(t){t.g&&!t.i&&Yu(t,!1,null,null)}function $u(t,e){if(t.b=function(){return ke(e)},t.f.length)for(var n=0;n<t.f.length;n++)t.f[n](e)}function Yu(t,e,n,r){e?r?function(t,e){if(t.b=function(){return Oe(e)},t.c.length)for(var n=0;n<t.c.length;n++)t.c[n](e)}(t,r):$u(t,n):$u(t,{user:null}),t.f=[],t.c=[]}function Ku(){}function Gu(){this.hb=!1,Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.hb},set:function(t){this.hb=t},enumerable:!1})}function Qu(t,e){this.a=e,Gr(this,"verificationId",t)}function Xu(t,e,n,r){return new Lo(t).eb(e,n).then((function(t){return new Qu(t,r)}))}function Ju(t){var e=Wi(t);if(!(e&&e.exp&&e.auth_time&&e.iat))throw new T("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");Qr(this,{token:t,expirationTime:Vr(1e3*e.exp),authTime:Vr(1e3*e.auth_time),issuedAtTime:Vr(1e3*e.iat),signInProvider:e.firebase&&e.firebase.sign_in_provider?e.firebase.sign_in_provider:null,signInSecondFactor:e.firebase&&e.firebase.sign_in_second_factor?e.firebase.sign_in_second_factor:null,claims:e})}function Zu(t,e,n){var r=e&&e[el];if(!r)throw new T("argument-error","Internal assert: Invalid MultiFactorResolver");this.a=t,this.f=vt(e),this.g=n,this.c=new oo(null,r),this.b=[];var i=this;W(e[tl]||[],(function(t){(t=ti(t))&&i.b.push(t)})),Gr(this,"auth",this.a),Gr(this,"session",this.c),Gr(this,"hints",this.b)}Vu.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},Vu.prototype.h=function(t,e){if(t){this.reset(),this.g=!0;var n=t.c,r=t.b,i=t.a&&"auth/web-storage-unsupported"==t.a.code,o=t.a&&"auth/operation-not-supported-in-this-environment"==t.a.code;this.i=!(!i&&!o),"unknown"!=n||i||o?t.a?(Yu(this,!0,null,t.a),ke()):e.Fa(n,r)?function(t,e,n){n=n.Fa(e.c,e.b);var r=e.g,i=e.f,o=e.i,s=e.S(),a=!!e.c.match(/Redirect$/);n(r,i,s,o).then((function(e){Yu(t,a,e,null)})).s((function(e){Yu(t,a,null,e)}))}(this,t,e):Oe(new T("invalid-auth-event")):(Yu(this,!1,null,null),ke())}else Oe(new T("invalid-auth-event"))},Vu.prototype.qa=function(){var t=this;return new we((function(e,n){t.b?t.b().then(e,n):(t.f.push(e),t.c.push(n),function(t){var e=new T("timeout");t.a&&t.a.cancel(),t.a=Tn(Du.get()).then((function(){t.b||(t.g=!0,Yu(t,!0,null,e))}))}(t))}))},Ku.prototype.h=function(t,e){if(t){var n=t.c,r=t.b;t.a?(e.ma(t.c,null,t.a,t.b),ke()):e.Fa(n,r)?function(t,e){var n=t.b,r=t.c;e.Fa(r,n)(t.g,t.f,t.S(),t.i).then((function(t){e.ma(r,t,null,n)})).s((function(t){e.ma(r,null,t,n)}))}(t,e):Oe(new T("invalid-auth-event"))}else Oe(new T("invalid-auth-event"))},Qu.prototype.confirm=function(t){return t=jo(this.verificationId,t),this.a(t)};var tl="mfaInfo",el="mfaPendingCredential";function nl(t,e,n,r){T.call(this,"multi-factor-auth-required",r,e),this.b=new Zu(t,e,n),Gr(this,"resolver",this.b)}function rl(t,e,n){if(t&&g(t.serverResponse)&&"auth/multi-factor-auth-required"===t.code)try{return new nl(e,t.serverResponse,n,t.message)}catch(t){}return null}function il(){}function ol(t){Gr(this,"factorId",t.fa),this.a=t}function sl(t){if(ol.call(this,t),this.a.fa!=Lo.PROVIDER_ID)throw new T("argument-error","firebase.auth.PhoneMultiFactorAssertion requires a valid firebase.auth.PhoneAuthCredential")}function al(t,e){for(var n in Qe.call(this,t),e)this[n]=e[n]}function cl(t,e){this.a=t,this.b=[],this.c=S(this.xc,this),un(this.a,"userReloaded",this.c);var n=[];e&&e.multiFactor&&e.multiFactor.enrolledFactors&&W(e.multiFactor.enrolledFactors,(function(t){var e=null,r={};
408if(t){t.uid&&(r[ri]=t.uid),t.displayName&&(r[ei]=t.displayName),t.enrollmentTime&&(r[ni]=new Date(t.enrollmentTime).toISOString()),t.phoneNumber&&(r[ii]=t.phoneNumber);try{e=new oi(r)}catch(t){}t=e}else t=null;t&&n.push(t)})),ul(this,n)}function ul(t,e){t.b=e,Gr(t,"enrolledFactors",e)}function ll(t,e,n){if(this.h=t,this.i=e,this.g=n,this.c=3e4,this.f=96e4,this.b=null,this.a=this.c,this.f<this.c)throw Error("Proactive refresh lower bound greater than upper bound!")}function hl(t){this.c=t,this.b=this.a=null}function pl(t){return t.b&&1e3*t.b.c||0}function dl(t,e){var n=e.refreshToken;t.b=Vi(e[Xs]||""),t.a=n}function fl(t,e){return function(t,e){return new we((function(n,r){"refresh_token"==e.grant_type&&e.refresh_token||"authorization_code"==e.grant_type&&e.code?sa(t,t.l+"?key="+encodeURIComponent(t.c),(function(t){t?t.error?r(ic(t)):t.access_token&&t.refresh_token?n(t):r(new T("internal-error")):r(new T("network-request-failed"))}),"POST",Xn(e).toString(),t.g,t.v.get()):r(new T("internal-error"))}))}(t.c,e).then((function(e){return t.b=Vi(e.access_token),t.a=e.refresh_token,{accessToken:t.b.toString(),refreshToken:t.a}})).s((function(e){throw"auth/user-token-expired"==e.code&&(t.a=null),e}))}function vl(t,e){this.a=t||null,this.b=e||null,Qr(this,{lastSignInTime:Vr(e||null),creationTime:Vr(t||null)})}function gl(t,e,n,r,i,o){Qr(this,{uid:t,displayName:r||null,photoURL:i||null,email:n||null,phoneNumber:o||null,providerId:e})}function ml(t,e,n){this.G=[],this.l=t.apiKey,this.m=t.appName,this.o=t.authDomain||null;var i=r.SDK_VERSION?Tr(r.SDK_VERSION):null;this.a=new Gs(this.l,N(k),i),t.emulatorConfig&&ra(this.a,t.emulatorConfig),this.b=new hl(this.a),xl(this,e[Xs]),dl(this.b,e),Gr(this,"refreshToken",this.b.a),kl(this,n||{}),wn.call(this),this.P=!1,this.o&&Ar()&&(this.i=qu(this.o,this.l,this.m)),this.R=[],this.f=null,this.u=function(t){return new ll((function(){return t.I(!0)}),(function(t){return!(!t||"auth/network-request-failed"!=t.code)}),(function(){var e=pl(t.b)-E()-3e5;return 0<e?e:0}))}(this),this.$=S(this.gb,this);var o=this;this.pa=null,this.Ba=function(t){o.wa(t.h)},this.ba=null,this.za=function(t){ra(o.a,t.c)},this.W=null,this.X=[],this.Aa=function(t){_l(o,t.f)},this.aa=null,this.N=new cl(this,n),Gr(this,"multiFactor",this.N)}function yl(t,e){t.ba&&pn(t.ba,"languageCodeChanged",t.Ba),(t.ba=e)&&un(e,"languageCodeChanged",t.Ba)}function bl(t,e){t.W&&pn(t.W,"emulatorConfigChanged",t.za),(t.W=e)&&un(e,"emulatorConfigChanged",t.za)}function _l(t,e){t.X=e,oa(t.a,r.SDK_VERSION?Tr(r.SDK_VERSION,t.X):null)}function wl(t,e){t.aa&&pn(t.aa,"frameworkChanged",t.Aa),(t.aa=e)&&un(e,"frameworkChanged",t.Aa)}function Sl(t){try{return r.app(t.m).auth()}catch(e){throw new T("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+t.m+"'!")}}function Cl(t){t.A||t.u.b||(t.u.start(),pn(t,"tokenChanged",t.$),un(t,"tokenChanged",t.$))}function El(t){pn(t,"tokenChanged",t.$),t.u.stop()}function xl(t,e){t.ya=e,Gr(t,"_lat",e)}function Tl(t){for(var e=[],n=0;n<t.R.length;n++)e.push(t.R[n](t));return Re(e).then((function(){return t}))}function Il(t){t.i&&!t.P&&(t.P=!0,Nu(t.i,t))}function kl(t,e){Qr(t,{uid:e.uid,displayName:e.displayName||null,photoURL:e.photoURL||null,email:e.email||null,emailVerified:e.emailVerified||!1,phoneNumber:e.phoneNumber||null,isAnonymous:e.isAnonymous||!1,tenantId:e.tenantId||null,metadata:new vl(e.createdAt,e.lastLoginAt),providerData:[]}),t.a.b=t.tenantId}function Ol(){}function Al(t){return ke().then((function(){if(t.A)throw new T("app-deleted")}))}function Rl(t){return $(t.providerData,(function(t){return t.providerId}))}function Nl(t,e){e&&(Pl(t,e.providerId),t.providerData.push(e))}function Pl(t,e){Q(t.providerData,(function(t){return t.providerId==e}))}function Ml(t,e,n){("uid"!=e||n)&&t.hasOwnProperty(e)&&Gr(t,e,n)}function Dl(t,e){t!=e&&(Qr(t,{uid:e.uid,displayName:e.displayName,photoURL:e.photoURL,email:e.email,emailVerified:e.emailVerified,phoneNumber:e.phoneNumber,isAnonymous:e.isAnonymous,tenantId:e.tenantId,providerData:[]}),e.metadata?Gr(t,"metadata",function(t){return new vl(t.a,t.b)}(e.metadata)):Gr(t,"metadata",new vl),W(e.providerData,(function(e){Nl(t,e)})),function(t,e){t.b=e.b,t.a=e.a}(t.b,e.b),Gr(t,"refreshToken",t.b.a),ul(t.N,e.N.b))}function Ll(t){return t.I().then((function(e){var n=t.isAnonymous;return function(t,e){return nc(t.a,Pa,{idToken:e}).then(S(t.Jc,t))}(t,e).then((function(){return n||Ml(t,"isAnonymous",!1),e}))}))}function jl(t,e){e[Xs]&&t.ya!=e[Xs]&&(dl(t.b,e),t.dispatchEvent(new al("tokenChanged")),xl(t,e[Xs]),Ml(t,"refreshToken",t.b.a))}function Ul(t,e){return Ll(t).then((function(){if(K(Rl(t),e))return Tl(t).then((function(){throw new T("provider-already-linked")}))}))}function Fl(t,e,n){return Xr({user:t,credential:Uo(e),additionalUserInfo:e=Gi(e),operationType:n})}function Hl(t,e){return jl(t,e),t.reload().then((function(){return t}))}function Bl(t,e,n,i,o){if(!Ar())return Oe(new T("operation-not-supported-in-this-environment"));if(t.f&&!o)return Oe(t.f);var s=Ki(n.providerId),a=jr(t.uid+":::"),c=null;(!Pr()||yr())&&t.o&&n.isOAuthProvider&&(c=mc(t.o,t.l,t.m,e,n,null,a,r.SDK_VERSION||null,null,null,t.tenantId));var u=dr(c,s&&s.ua,s&&s.ta);return i=i().then((function(){if(Vl(t),!o)return t.I().then((function(){}))})).then((function(){return Lu(t.i,u,e,n,a,!!c,t.tenantId)})).then((function(){return new we((function(n,r){t.ma(e,null,new T("cancelled-popup-request"),t.h||null),t.g=n,t.O=r,t.h=a,t.c=Fu(t.i,t,e,u,a)}))})).then((function(t){return u&&pr(u),t?Xr(t):null})).s((function(t){throw u&&pr(u),t})),Wl(t,i,o)}function ql(t,e,n,r,i){if(!Ar())return Oe(new T("operation-not-supported-in-this-environment"));if(t.f&&!i)return Oe(t.f);
408var o=null,s=jr(t.uid+":::");return r=r().then((function(){if(Vl(t),!i)return t.I().then((function(){}))})).then((function(){return t.ga=s,Tl(t)})).then((function(e){return t.ha&&(e=(e=t.ha).b.set(Yl,t.w(),e.a)),e})).then((function(){return Uu(t.i,e,n,s,t.tenantId)})).s((function(e){if(o=e,t.ha)return Kl(t.ha);throw o})).then((function(){if(o)throw o})),Wl(t,r,i)}function Vl(t){if(!t.i||!t.P){if(t.i&&!t.P)throw new T("internal-error");throw new T("auth-domain-config-required")}}function Wl(t,e,n){var r=function(t,e,n){return t.f&&!n?(e.cancel(),Oe(t.f)):e.s((function(e){throw!e||"auth/user-disabled"!=e.code&&"auth/user-token-expired"!=e.code||(t.f||t.dispatchEvent(new al("userInvalidated")),t.f=e),e}))}(t,e,n);return t.G.push(r),r.na((function(){G(t.G,r)})),r.s((function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=rl(e.w(),Sl(t),S(t.ic,t))),n||e}))}function zl(t){if(!t.apiKey)return null;var e={apiKey:t.apiKey,authDomain:t.authDomain,appName:t.appName,emulatorConfig:t.emulatorConfig},n={};if(!t.stsTokenManager||!t.stsTokenManager.accessToken)return null;n[Xs]=t.stsTokenManager.accessToken,n.refreshToken=t.stsTokenManager.refreshToken||null;var r=new ml(e,n,t);return t.providerData&&W(t.providerData,(function(t){t&&Nl(r,Xr(t))})),t.redirectEventId&&(r.ga=t.redirectEventId),r}function $l(t){this.a=t,this.b=Zc()}Zu.prototype.Qc=function(t){var e=this;return t.rb(this.a.a,this.c).then((function(t){var n=vt(e.f);return delete n[tl],delete n[el],mt(n,t),e.g(n)}))},x(nl,T),il.prototype.rb=function(t,e,n){return e.type==so?function(t,e,n,r){return n.Ha().then((function(n){return n={idToken:n},void 0!==r&&(n.displayName=r),mt(n,{phoneVerificationInfo:Do(t.a)}),nc(e,Ra,n)}))}(this,t,e,n):function(t,e,n){return n.Ha().then((function(n){return mt(n={mfaPendingCredential:n},{phoneVerificationInfo:Do(t.a)}),nc(e,Na,n)}))}(this,t,e)},x(ol,il),x(sl,ol),x(al,Qe),(e=cl.prototype).xc=function(t){ul(this,function(t){var e=[];return W(t.mfaInfo||[],(function(t){(t=ti(t))&&e.push(t)})),e}(t.gd))},e.Qb=function(){return this.a.I().then((function(t){return new oo(t,null)}))},e.ec=function(t,e){var n=this,r=this.a.a;return this.Qb().then((function(n){return t.rb(r,n,e)})).then((function(t){return jl(n.a,t),n.a.reload()}))},e.ad=function(t){var e=this,n="string"==typeof t?t:t.uid,r=this.a.a;return this.a.I().then((function(t){return nc(r,ec,{idToken:t,mfaEnrollmentId:n})})).then((function(t){var r=z(e.b,(function(t){return t.uid!=n}));return ul(e,r),jl(e.a,t),e.a.reload().s((function(t){if("auth/user-token-expired"!=t.code)throw t}))}))},e.w=function(){return{multiFactor:{enrolledFactors:$(this.b,(function(t){return t.w()}))}}},ll.prototype.start=function(){this.a=this.c,function t(e,n){e.stop(),e.b=Tn(function(t,e){return e?(t.a=t.c,t.g()):(e=t.a,t.a*=2,t.a>t.f&&(t.a=t.f),e)}(e,n)).then((function(){return function(){var t=u.document,e=null;return Br()||!t?ke():new we((function(n){e=function(){Br()&&(t.removeEventListener("visibilitychange",e,!1),n())},t.addEventListener("visibilitychange",e,!1)})).s((function(n){throw t.removeEventListener("visibilitychange",e,!1),n}))}()})).then((function(){return e.h()})).then((function(){t(e,!0)})).s((function(n){e.i(n)&&t(e,!1)}))}(this,!0)},ll.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},hl.prototype.w=function(){return{apiKey:this.c.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:pl(this)}},hl.prototype.getToken=function(t){return t=!!t,this.b&&!this.a?Oe(new T("user-token-expired")):t||!this.b||E()>pl(this)-3e4?this.a?fl(this,{grant_type:"refresh_token",refresh_token:this.a}):ke(null):ke({accessToken:this.b.toString(),refreshToken:this.a})},vl.prototype.w=function(){return{lastLoginAt:this.b,createdAt:this.a}},x(ml,wn),ml.prototype.wa=function(t){this.pa=t,na(this.a,t)},ml.prototype.ka=function(){return this.pa},ml.prototype.Ga=function(){return J(this.X)},ml.prototype.gb=function(){this.u.b&&(this.u.stop(),this.u.start())},Gr(ml.prototype,"providerId","firebase"),(e=ml.prototype).reload=function(){var t=this;return Wl(this,Al(this).then((function(){return Ll(t).then((function(){return Tl(t)})).then(Ol)})))},e.nc=function(t){return this.I(t).then((function(t){return new Ju(t)}))},e.I=function(t){var e=this;return Wl(this,Al(this).then((function(){return e.b.getToken(t)})).then((function(t){if(!t)throw new T("internal-error");
408return t.accessToken!=e.ya&&(xl(e,t.accessToken),e.dispatchEvent(new al("tokenChanged"))),Ml(e,"refreshToken",t.refreshToken),t.accessToken})))},e.Jc=function(t){if(!(t=t.users)||!t.length)throw new T("internal-error");kl(this,{uid:(t=t[0]).localId,displayName:t.displayName,photoURL:t.photoUrl,email:t.email,emailVerified:!!t.emailVerified,phoneNumber:t.phoneNumber,lastLoginAt:t.lastLoginAt,createdAt:t.createdAt,tenantId:t.tenantId});for(var e=function(t){return(t=t.providerUserInfo)&&t.length?$(t,(function(t){return new gl(t.rawId,t.providerId,t.email,t.displayName,t.photoUrl,t.phoneNumber)})):[]}(t),n=0;n<e.length;n++)Nl(this,e[n]);Ml(this,"isAnonymous",!(this.email&&t.passwordHash||this.providerData&&this.providerData.length)),this.dispatchEvent(new al("userReloaded",{gd:t}))},e.Kc=function(t){return Yr("firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateWithCredential instead."),this.sb(t)},e.sb=function(t){var e=this,n=null;return Wl(this,t.c(this.a,this.uid).then((function(t){return jl(e,t),n=Fl(e,t,"reauthenticate"),e.f=null,e.reload()})).then((function(){return n})),!0)},e.Bc=function(t){return Yr("firebase.User.prototype.linkAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.linkWithCredential instead."),this.pb(t)},e.pb=function(t){var e=this,n=null;return Wl(this,Ul(this,t.providerId).then((function(){return e.I()})).then((function(n){return t.b(e.a,n)})).then((function(t){return n=Fl(e,t,"link"),Hl(e,t)})).then((function(){return n})))},e.Cc=function(t,e){var n=this;return Wl(this,Ul(this,"phone").then((function(){return Xu(Sl(n),t,e,S(n.pb,n))})))},e.Lc=function(t,e){var n=this;return Wl(this,ke().then((function(){return Xu(Sl(n),t,e,S(n.sb,n))})),!0)},e.Ab=function(t){var e=this;return Wl(this,this.I().then((function(n){return e.a.Ab(n,t)})).then((function(t){return jl(e,t),e.reload()})))},e.dd=function(t){var e=this;return Wl(this,this.I().then((function(n){return t.b(e.a,n)})).then((function(t){return jl(e,t),e.reload()})))},e.Bb=function(t){var e=this;return Wl(this,this.I().then((function(n){return e.a.Bb(n,t)})).then((function(t){return jl(e,t),e.reload()})))},e.Cb=function(t){if(void 0===t.displayName&&void 0===t.photoURL)return Al(this);var e=this;return Wl(this,this.I().then((function(n){return e.a.Cb(n,{displayName:t.displayName,photoUrl:t.photoURL})})).then((function(t){return jl(e,t),Ml(e,"displayName",t.displayName||null),Ml(e,"photoURL",t.photoUrl||null),W(e.providerData,(function(t){"password"===t.providerId&&(Gr(t,"displayName",e.displayName),Gr(t,"photoURL",e.photoURL))})),Tl(e)})).then(Ol))},e.bd=function(t){var e=this;return Wl(this,Ll(this).then((function(n){return K(Rl(e),t)?function(t,e,n){return nc(t,ka,{idToken:e,deleteProvider:n})}(e.a,n,[t]).then((function(t){var n={};return W(t.providerUserInfo||[],(function(t){n[t.providerId]=!0})),W(Rl(e),(function(t){n[t]||Pl(e,t)})),n[Lo.PROVIDER_ID]||Gr(e,"phoneNumber",null),Tl(e)})):Tl(e).then((function(){throw new T("no-such-provider")}))})))},e.delete=function(){var t=this;return Wl(this,this.I().then((function(e){return nc(t.a,Ia,{idToken:e})})).then((function(){t.dispatchEvent(new al("userDeleted"))}))).then((function(){for(var e=0;e<t.G.length;e++)t.G[e].cancel("app-deleted");yl(t,null),bl(t,null),wl(t,null),t.G=[],t.A=!0,El(t),Gr(t,"refreshToken",null),t.i&&Pu(t.i,t)}))},e.Eb=function(t,e){return!!("linkViaPopup"==t&&(this.h||null)==e&&this.g||"reauthViaPopup"==t&&(this.h||null)==e&&this.g||"linkViaRedirect"==t&&(this.ga||null)==e||"reauthViaRedirect"==t&&(this.ga||null)==e)},e.ma=function(t,e,n,r){"linkViaPopup"!=t&&"reauthViaPopup"!=t||r!=(this.h||null)||(n&&this.O?this.O(n):e&&!n&&this.g&&this.g(e),this.c&&(this.c.cancel(),this.c=null),delete this.g,delete this.O)},e.Fa=function(t,e){return"linkViaPopup"==t&&e==(this.h||null)?S(this.Jb,this):"reauthViaPopup"==t&&e==(this.h||null)?S(this.Kb,this):"linkViaRedirect"==t&&(this.ga||null)==e?S(this.Jb,this):"reauthViaRedirect"==t&&(this.ga||null)==e?S(this.Kb,this):null},e.Dc=function(t){var e=this;return Bl(this,"linkViaPopup",t,(function(){return Ul(e,t.providerId).then((function(){return Tl(e)}))}),!1)},e.Mc=function(t){return Bl(this,"reauthViaPopup",t,(function(){return ke()}),!0)},e.Ec=function(t){var e=this;return ql(this,"linkViaRedirect",t,(function(){return Ul(e,t.providerId)}),!1)},e.Nc=function(t){return ql(this,"reauthViaRedirect",t,(function(){return ke()}),!0)},e.Jb=function(t,e,n,r){var i=this;this.c&&(this.c.cancel(),this.c=null);var o=null;return Wl(this,this.I().then((function(n){return _a(i.a,{requestUri:t,postBody:r,sessionId:e,idToken:n})})).then((function(t){return o=Fl(i,t,"link"),Hl(i,t)})).then((function(){return o}
408)))},e.Kb=function(t,e,n,r){var i=this;this.c&&(this.c.cancel(),this.c=null);var o=null;return Wl(this,ke().then((function(){return uo(wa(i.a,{requestUri:t,sessionId:e,postBody:r,tenantId:n}),i.uid)})).then((function(t){return o=Fl(i,t,"reauthenticate"),jl(i,t),i.f=null,i.reload()})).then((function(){return o})),!0)},e.tb=function(t){var e=this,n=null;return Wl(this,this.I().then((function(e){return n=e,void 0===t||ft(t)?{}:Fi(new Oi(t))})).then((function(t){return e.a.tb(n,t)})).then((function(t){if(e.email!=t)return e.reload()})).then((function(){})))},e.Db=function(t,e){var n=this,r=null;return Wl(this,this.I().then((function(t){return r=t,void 0===e||ft(e)?{}:Fi(new Oi(e))})).then((function(e){return n.a.Db(r,t,e)})).then((function(t){if(n.email!=t)return n.reload()})).then((function(){})))},e.ic=function(t){var e=null,n=this;return Wl(this,t=uo(ke(t),n.uid).then((function(t){return e=Fl(n,t,"reauthenticate"),jl(n,t),n.f=null,n.reload()})).then((function(){return e})),!0)},e.toJSON=function(){return this.w()},e.w=function(){var t={uid:this.uid,displayName:this.displayName,photoURL:this.photoURL,email:this.email,emailVerified:this.emailVerified,phoneNumber:this.phoneNumber,isAnonymous:this.isAnonymous,tenantId:this.tenantId,providerData:[],apiKey:this.l,appName:this.m,authDomain:this.o,stsTokenManager:this.b.w(),redirectEventId:this.ga||null};return this.metadata&&mt(t,this.metadata.w()),W(this.providerData,(function(e){t.providerData.push(function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}(e))})),mt(t,this.N.w()),t};var Yl={name:"redirectUser",D:"session"};function Kl(t){return nu(t.b,Yl,t.a)}function Gl(t){this.a=t,this.b=Zc(),this.c=null,this.f=function(t){var e=Jl("local"),n=Jl("session"),r=Jl("none");return function(t,e,n){var r=eu(e,n),i=tu(t,e.D);return t.get(e,n).then((function(o){var s=null;try{s=Lr(u.localStorage.getItem(r))}catch(t){}if(s&&!o)return u.localStorage.removeItem(r),t.set(e,s,n);s&&o&&"localStorage"!=i.type&&u.localStorage.removeItem(r)}))}(t.b,e,t.a).then((function(){return t.b.get(n,t.a)})).then((function(i){return i?n:t.b.get(r,t.a).then((function(n){return n?r:t.b.get(e,t.a).then((function(n){return n?e:t.b.get(Xl,t.a).then((function(t){return t?Jl(t):e}))}))}))})).then((function(e){return t.c=e,Ql(t,e.D)})).s((function(){t.c||(t.c=e)}))}(this),this.b.addListener(Jl("local"),this.a,S(this.g,this))}function Ql(t,e){var n,r=[];for(n in Xc)Xc[n]!==e&&r.push(nu(t.b,Jl(Xc[n]),t.a));return r.push(nu(t.b,Xl,t.a)),function(t){return new we((function(e,n){var r=t.length,i=[];if(r)for(var o=function(t,n){r--,i[t]=n,0==r&&e(i)},s=function(t){n(t)},a=0;a<t.length;a++)Ae(t[a],C(o,a),s);else e(i)}))}(r)}Gl.prototype.g=function(){var t=this,e=Jl("local");nh(this,(function(){return ke().then((function(){return t.c&&"local"!=t.c.D?t.b.get(e,t.a):null})).then((function(n){if(n)return Ql(t,"local").then((function(){t.c=e}))}))}))};var Xl={name:"persistence",D:"session"};function Jl(t){return{name:"authUser",D:t}}function Zl(t,e){return nh(t,(function(){return t.b.set(t.c,e.w(),t.a)}))}function th(t){return nh(t,(function(){return nu(t.b,t.c,t.a)}))}function eh(t,e,n){return nh(t,(function(){return t.b.get(t.c,t.a).then((function(t){return t&&e&&(t.authDomain=e),t&&n&&(t.emulatorConfig=n),zl(t||{})}))}))}function nh(t,e){return t.f=t.f.then(e,e),t.f}function rh(t){if(this.m=!1,Gr(this,"settings",new Gu),Gr(this,"app",t),!ph(this).options||!ph(this).options.apiKey)throw new T("invalid-api-key");t=r.SDK_VERSION?Tr(r.SDK_VERSION):null,this.a=new Gs(ph(this).options&&ph(this).options.apiKey,N(k),t),this.R=[],this.u=[],this.P=[],this.ac=r.INTERNAL.createSubscribe(S(this.yc,this)),this.X=void 0,this.bc=r.INTERNAL.createSubscribe(S(this.zc,this)),lh(this,null),this.l=new Gl(ph(this).options.apiKey+":"+ph(this).name),this.G=new $l(ph(this).options.apiKey+":"+ph(this).name),this.$=gh(this,function(t){var e=ph(t).options.authDomain,n=function(t){var e=function(t,e){return t.b.get(Yl,t.a).then((function(t){return t&&e&&(t.authDomain=e),zl(t||{})}))}(t.G,ph(t).options.authDomain).then((function(e){return(t.o=e)&&(e.ha=t.G),Kl(t.G)}));return gh(t,e)}(t).then((function(){return eh(t.l,e,t.f)})).then((function(e){return e?(e.ha=t.G,t.o&&(t.o.ga||null)==(e.ga||null)?e:e.reload().then((function(){return Zl(t.l,e).then((function(){return e}))})).s((function(n){return"auth/network-request-failed"==n.code?e:th(t.l)}))):null})).then((function(e){lh(t,e||null)}));return gh(t,n)}(this)),this.i=gh(this,function(t){return t.$.then((function(){return ch(t)})).s((function(){})).then((function(){if(!t.m)return t.pa()})).s((function(){})).then((function(){if(!t.m){t.ba=!0;var e=t.l;e.b.addListener(Jl("local"),e.a,t.pa)}}))}(this)),this.ba=!1,this.pa=S(this.Yc,this),this.Ba=S(this.da,this),this.ya=S(this.kc,this),this.za=S(this.vc,this),this.Aa=S(this.wc,this),this.b=null,function(t){var e=ph(t).options.authDomain,n=ph(t).options.apiKey;e&&Ar()&&(t.gb=t.$.then((function(){if(!t.m){if(t.b=qu(e,n,ph(t).name,t.f),Nu(t.b,t),dh(t)&&Il(dh(t)),t.o){Il(t.o);var r=t.o;r.wa(t.ka()),yl(r,t),_l(r=t.o,t.N),wl(r,t),ra((r=t.o).a,t.f),bl(r,t),t.o=null}return t.b}})))}(this),this.INTERNAL={},this.INTERNAL.delete=S(this.delete,this),this.INTERNAL.logFramework=S(this.Fc,this),this.A=0,wn.call(this),function(t){Object.defineProperty(t,"lc",{get:function(){return this.ka()},set:function(t){this.wa(t)},enumerable:!1}),t.aa=null,Object.defineProperty(t,"ti",{get:function(){return this.S()},set:function(t){this.xb(t)},enumerable:!1}),t.W=null}(this),this.N=[],this.f=null}function ih(t){Qe.call(this,"languageCodeChanged"),this.h=t}function oh(t){Qe.call(this,"emulatorConfigChanged"),this.c=t}function sh(t){Qe.call(this,"frameworkChanged"),this.f=t}function ah(t){return t.gb||Oe(new T("auth-domain-config-required"))}function ch(t){if(!Ar())return Oe(new T("operation-not-supported-in-this-environment"));var e=ah(t).then((function(){return t.b.qa()})).then((function(t){return t?Xr(t):null}));return gh(t,e)}function uh(t,e){var n={};return n.apiKey=ph(t).options.apiKey,n.authDomain=ph(t).options.authDomain,n.appName=ph(t).name,t.f&&(n.emulatorConfig=t.f),t.$.then((function(){return function(t,e,n,r){var i=new ml(t,e);return n&&(i.ha=n),r&&_l(i,r),i.reload().then((function(){return i}))}(n,e,t.G,t.Ga())})).then((function(e){return dh(t)&&e.uid==dh(t).uid?(Dl(dh(t),e),t.da(e)):(lh(t,e),Il(e),t.da(e))})).then((function(){vh(t)}))}function lh(t,e){dh(t)&&(function(t,e){Q(t.R,(function(t){return t==e}))}(dh(t),t.Ba),pn(dh(t),"tokenChanged",t.ya),pn(dh(t),"userDeleted",t.za),pn(dh(t),"userInvalidated",t.Aa),El(dh(t))),e&&(e.R.push(t.Ba),un(e,"tokenChanged",t.ya),un(e,"userDeleted",t.za),un(e,"userInvalidated",t.Aa),0<t.A&&Cl(e)),Gr(t,"currentUser",e),e&&(e.wa(t.ka()),yl(e,t),_l(e,t.N),wl(e,t),ra(e.a,t.f),bl(e,t))}function hh(t,e){var n=null,r=null;return gh(t,e.then((function(e){return n=Uo(e),r=Gi(e),uh(t,e)}),(function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=rl(e.w(),t,S(t.jc,t))),n||e})).then((function(){return Xr({user:dh(t),credential:n,additionalUserInfo:r,operationType:"signIn"})})))}function ph(t){return t.app}function dh(t){return t.currentUser}function fh(t){return dh(t)&&dh(t)._lat||null}function vh(t){if(t.ba){for(var e=0;e<t.u.length;e++)t.u[e]&&t.u[e](fh(t));if(t.X!==t.getUid()&&t.P.length)for(t.X=t.getUid(),e=0;e<t.P.length;e++)t.P[e]&&t.P[e](fh(t))}}function gh(t,e){return t.R.push(e),e.na((function(){G(t.R,e)})),e}function mh(){}function yh(){this.a={},this.b=1e12}Gl.prototype.wb=function(t){var e=null,n=this;return function(t){var e=new T("invalid-persistence-type"),n=new T("unsupported-persistence-type");t:{for(r in Xc)if(Xc[r]==t){var r=!0;break t}r=!1}if(!r||"string"!=typeof t)throw e;switch(_r()){case"ReactNative":if("session"===t)throw n;break;case"Node":if("none"!==t)throw n;break;case"Worker":if("session"===t||!Ac()&&"none"!==t)throw n;break;default:if(!Or()&&"none"!==t)throw n}}(t),nh(this,(function(){return t!=n.c.D?n.b.get(n.c,n.a).then((function(r){return e=r,Ql(n,t)})).then((function(){if(n.c=Jl(t),e)return n.b.set(n.c,e,n.a)})):ke()}))},x(rh,wn),x(ih,Qe),x(oh,Qe),x(sh,Qe),(e=rh.prototype).wb=function(t){return gh(this,t=this.l.wb(t))},e.wa=function(t){this.aa===t||this.m||(this.aa=t,na(this.a,this.aa),this.dispatchEvent(new ih(this.ka())))},e.ka=function(){return this.aa},e.ed=function(){var t=u.navigator;this.wa(t&&(t.languages&&t.languages[0]||t.language||t.userLanguage)||null)},e.fd=function(t){if(!this.f){if(!/^https?:\/\//.test(t))throw new T("argument-error","Emulator URL must start with a valid scheme (http:// or https://).");qr("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials."),u.document&&gr().then((function(){var t=u.document.createElement("div");t.innerText="Running in emulator mode. Do not use with production credentials.",t.style.position="fixed",t.style.width="100%",t.style.backgroundColor="#ffffff",t.style.border=".1em solid #000000",t.style.color="#ff0000",t.style.bottom="0px",t.style.left="0px",t.style.margin="0px",t.style.zIndex=1e4,t.style.textAlign="center",t.classList.add("firebase-emulator-warning"),u.document.body.appendChild(t)})),this.f={url:t},this.settings.hb=!0,ra(this.a,this.f),this.dispatchEvent(new oh(this.f))}},e.Fc=function(t){this.N.push(t),oa(this.a,r.SDK_VERSION?Tr(r.SDK_VERSION,this.N):null),this.dispatchEvent(new sh(this.N))},e.Ga=function(){return J(this.N)},e.xb=function(t){this.W===t||this.m||(this.W=t,this.a.b=this.W)},e.S=function(){return this.W},e.toJSON=function(){return{apiKey:ph(this).options.apiKey,authDomain:ph(this).options.authDomain,appName:ph(this).name,currentUser:dh(this)&&dh(this).w()}},e.Eb=function(t,e){switch(t){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.h==e&&!!this.g;default:return!1}},e.ma=function(t,e,n,r){"signInViaPopup"==t&&this.h==r&&(n&&this.O?this.O(n):e&&!n&&this.g&&this.g(e),this.c&&(this.c.cancel(),this.c=null),delete this.g,delete this.O)},e.Fa=function(t,e){return"signInViaRedirect"==t||"signInViaPopup"==t&&this.h==e&&this.g?S(this.hc,this):null},e.hc=function(t,e,n,r){var i=this,o={requestUri:t,postBody:r,sessionId:e,tenantId:n};return this.c&&(this.c.cancel(),this.c=null),i.$.then((function(){return hh(i,ba(i.a,o))}))},e.Wc=function(t){if(!Ar())return Oe(new T("operation-not-supported-in-this-environment"));var e=this,n=Ki(t.providerId),i=jr(),o=null;(!Pr()||yr())&&ph(this).options.authDomain&&t.isOAuthProvider&&(o=mc(ph(this).options.authDomain,ph(this).options.apiKey,ph(this).name,"signInViaPopup",t,null,i,r.SDK_VERSION||null,null,null,this.S(),this.f));
408var s=dr(o,n&&n.ua,n&&n.ta);return gh(this,n=ah(this).then((function(n){return Lu(n,s,"signInViaPopup",t,i,!!o,e.S())})).then((function(){return new we((function(t,n){e.ma("signInViaPopup",null,new T("cancelled-popup-request"),e.h),e.g=t,e.O=n,e.h=i,e.c=Fu(e.b,e,"signInViaPopup",s,i)}))})).then((function(t){return s&&pr(s),t?Xr(t):null})).s((function(t){throw s&&pr(s),t})))},e.Xc=function(t){if(!Ar())return Oe(new T("operation-not-supported-in-this-environment"));var e=this;return gh(this,ah(this).then((function(){return function(t){return nh(t,(function(){return t.b.set(Xl,t.c.D,t.a)}))}(e.l)})).then((function(){return Uu(e.b,"signInViaRedirect",t,void 0,e.S())})))},e.qa=function(){var t=this;return ch(this).then((function(e){return t.b&&zu(t.b.b),e})).s((function(e){throw t.b&&zu(t.b.b),e}))},e.cd=function(t){if(!t)return Oe(new T("null-user"));if(this.W!=t.tenantId)return Oe(new T("tenant-id-mismatch"));var e=this,n={};n.apiKey=ph(this).options.apiKey,n.authDomain=ph(this).options.authDomain,n.appName=ph(this).name;var r=function(t,e,n,r){var i=t.b,o={};return o[Xs]=i.b&&i.b.toString(),o.refreshToken=i.a,e=new ml(e||{apiKey:t.l,authDomain:t.o,appName:t.m},o),n&&(e.ha=n),r&&_l(e,r),Dl(e,t),e}(t,n,e.G,e.Ga());return gh(this,this.i.then((function(){if(ph(e).options.apiKey!=t.l)return r.reload()})).then((function(){return dh(e)&&t.uid==dh(e).uid?(Dl(dh(e),t),e.da(t)):(lh(e,r),Il(r),e.da(r))})).then((function(){vh(e)})))},e.zb=function(){var t=this;return gh(this,this.i.then((function(){return t.b&&zu(t.b.b),dh(t)?(lh(t,null),th(t.l).then((function(){vh(t)}))):ke()})))},e.Yc=function(){var t=this;return eh(this.l,ph(this).options.authDomain).then((function(e){if(!t.m){var n;if(n=dh(t)&&e){n=dh(t).uid;var r=e.uid;n=null!=n&&""!==n&&null!=r&&""!==r&&n==r}if(n)return Dl(dh(t),e),dh(t).I();(dh(t)||e)&&(lh(t,e),e&&(Il(e),e.ha=t.G),t.b&&Nu(t.b,t),vh(t))}}))},e.da=function(t){return Zl(this.l,t)},e.kc=function(){vh(this),this.da(dh(this))},e.vc=function(){this.zb()},e.wc=function(){this.zb()},e.jc=function(t){var e=this;return this.i.then((function(){return hh(e,ke(t))}))},e.yc=function(t){var e=this;this.addAuthTokenListener((function(){t.next(dh(e))}))},e.zc=function(t){var e=this;!function(t,e){t.P.push(e),gh(t,t.i.then((function(){!t.m&&K(t.P,e)&&t.X!==t.getUid()&&(t.X=t.getUid(),e(fh(t)))})))}(this,(function(){t.next(dh(e))}))},e.Hc=function(t,e,n){var r=this;return this.ba&&Promise.resolve().then((function(){"function"==typeof t?t(dh(r)):"function"==typeof t.next&&t.next(dh(r))})),this.ac(t,e,n)},e.Gc=function(t,e,n){var r=this;return this.ba&&Promise.resolve().then((function(){r.X=r.getUid(),"function"==typeof t?t(dh(r)):"function"==typeof t.next&&t.next(dh(r))})),this.bc(t,e,n)},e.mc=function(t){var e=this;return gh(this,this.i.then((function(){return dh(e)?dh(e).I(t).then((function(t){return{accessToken:t}})):null})))},e.Sc=function(t){var e=this;return this.i.then((function(){return hh(e,nc(e.a,Qa,{token:t}))})).then((function(t){var n=t.user;return Ml(n,"isAnonymous",!1),e.da(n),t}))},e.Tc=function(t,e){var n=this;return this.i.then((function(){return hh(n,nc(n.a,Xa,{email:t,password:e}))}))},e.dc=function(t,e){var n=this;return this.i.then((function(){return hh(n,nc(n.a,xa,{email:t,password:e}))}))},e.Za=function(t){var e=this;return this.i.then((function(){return hh(e,t.ja(e.a))}))},e.Rc=function(t){return Yr("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInWithCredential instead."),this.Za(t)},e.yb=function(){var t=this;return this.i.then((function(){var e=dh(t);if(e&&e.isAnonymous){var n=Xr({providerId:null,isNewUser:!1});return Xr({user:e,credential:null,additionalUserInfo:n,operationType:"signIn"})}return hh(t,t.a.yb()).then((function(e){var n=e.user;return Ml(n,"isAnonymous",!0),t.da(n),e}))}))},e.getUid=function(){return dh(this)&&dh(this).uid||null},e.cc=function(t){this.addAuthTokenListener(t),this.A++,0<this.A&&dh(this)&&Cl(dh(this))},e.Oc=function(t){var e=this;W(this.u,(function(n){n==t&&e.A--})),0>this.A&&(this.A=0),0==this.A&&dh(this)&&El(dh(this)),this.removeAuthTokenListener(t)},e.addAuthTokenListener=function(t){var e=this;this.u.push(t),gh(this,this.i.then((function(){e.m||K(e.u,t)&&t(fh(e))})))},e.removeAuthTokenListener=function(t){Q(this.u,(function(e){return e==t}))},e.delete=function(){this.m=!0;for(var t=0;t<this.R.length;t++)this.R[t].cancel("app-deleted");return this.R=[],this.l&&(t=this.l).b.removeListener(Jl("local"),t.a,this.pa),this.b&&(Pu(this.b,this),zu(this.b.b)),Promise.resolve()},e.gc=function(t){return gh(this,function(t,e){return nc(t,Ta,{identifier:e,continueUri:Rr()?ur():"http://localhost"}).then((function(t){return t.signinMethods||[]}))}(this.a,t))},e.Ac=function(t){return!!No(t)},e.vb=function(t,e){var n=this;return gh(this,ke().then((function(){var t=new Oi(e);if(!t.c)throw new T("argument-error",Ni+" must be true when sending sign in link to email");return Fi(t)})).then((function(e){return n.a.vb(t,e)})).then((function(){})))},e.hd=function(t){return this.Qa(t).then((function(t){return t.data.email}))},e.mb=function(t,e){return gh(this,this.a.mb(t,e).then((function(){})))},e.Qa=function(t){return gh(this,this.a.Qa(t).then((function(t){return new si(t)})))},e.ib=function(t){return gh(this,this.a.ib(t).then((function(){})))},e.ub=function(t,e){var n=this;return gh(this,ke().then((function(){return void 0===e||ft(e)?{}:Fi(new Oi(e))})).then((function(e){return n.a.ub(t,e)})).then((function(){})))},e.Vc=function(t,e){return gh(this,Xu(this,t,e,S(this.Za,this)))},e.Uc=function(t,e){var n=this;return gh(this,ke().then((function(){var r=e||ur(),i=Ro(t,r);if(!(r=No(r)))throw new T("argument-error","Invalid email link!");if(r.tenantId!==n.S())throw new T("tenant-id-mismatch");return n.Za(i)})))},mh.prototype.render=function(){},mh.prototype.reset=function(){},mh.prototype.getResponse=function(){},mh.prototype.execute=function(){};var bh=null;function _h(t,e){return(e=wh(e))&&t.a[e]||null}function wh(t){return(t=void 0===t?1e12:t)?t.toString():null}function Sh(t,e){this.g=!1,this.c=e,this.a=this.b=null,this.h="invisible"!==this.c.size,this.f=ae(t);var n=this;this.i=function(){n.execute()},this.h?this.execute():un(this.f,"click",this.i)}function Ch(t){if(t.g)throw Error("reCAPTCHA mock was already deleted!")}function Eh(){}function xh(){}
408yh.prototype.render=function(t,e){return this.a[this.b.toString()]=new Sh(t,e),this.b++},yh.prototype.reset=function(t){var e=_h(this,t);t=wh(t),e&&t&&(e.delete(),delete this.a[t])},yh.prototype.getResponse=function(t){return(t=_h(this,t))?t.getResponse():null},yh.prototype.execute=function(t){(t=_h(this,t))&&t.execute()},Sh.prototype.getResponse=function(){return Ch(this),this.b},Sh.prototype.execute=function(){Ch(this);var t=this;this.a||(this.a=setTimeout((function(){t.b=function(){for(var t=50,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}();var e=t.c.callback,n=t.c["expired-callback"];if(e)try{e(t.b)}catch(t){}t.a=setTimeout((function(){if(t.a=null,t.b=null,n)try{n()}catch(t){}t.h&&t.execute()}),6e4)}),500))},Sh.prototype.delete=function(){Ch(this),this.g=!0,clearTimeout(this.a),this.a=null,pn(this.f,"click",this.i)},Gr(Eh,"FACTOR_ID","phone"),xh.prototype.g=function(){return bh||(bh=new yh),ke(bh)},xh.prototype.c=function(){};var Th=null;function Ih(){this.b=u.grecaptcha?1/0:0,this.f=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}var kh=new bt(St,"https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),Oh=new Hr(3e4,6e4);Ih.prototype.g=function(t){var e=this;return new we((function(n,r){var i=setTimeout((function(){r(new T("network-request-failed"))}),Oh.get());!u.grecaptcha||t!==e.f&&!e.b?(u[e.a]=function(){if(u.grecaptcha){e.f=t;var o=u.grecaptcha.render;u.grecaptcha.render=function(t,n){return t=o(t,n),e.b++,t},clearTimeout(i),n(u.grecaptcha)}else clearTimeout(i),r(new T("internal-error"));delete u[e.a]},ke(qs(Tt(kh,{onload:e.a,hl:t||""}))).s((function(){clearTimeout(i),r(new T("internal-error","Unable to load external reCAPTCHA dependencies!"))}))):(clearTimeout(i),n(u.grecaptcha))}))},Ih.prototype.c=function(){this.b--};var Ah=null;function Rh(t,e,n,r,i,o,s){if(Gr(this,"type","recaptcha"),this.c=this.f=null,this.A=!1,this.m=e,this.g=null,s?(Th||(Th=new xh),s=Th):(Ah||(Ah=new Ih),s=Ah),this.v=s,this.a=n||{theme:"light",type:"image"},this.h=[],this.a[Mh])throw new T("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[Dh],!u.document)throw new T("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!ae(e)||!this.i&&ae(e).hasChildNodes())throw new T("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.o=new Gs(t,o||null,i||null),this.u=r||function(){return null};var a=this;this.l=[];var c=this.a[Nh];this.a[Nh]=function(t){if(Lh(a,t),"function"==typeof c)c(t);else if("string"==typeof c){var e=kr(c,u);"function"==typeof e&&e(t)}};var l=this.a[Ph];this.a[Ph]=function(){if(Lh(a,null),"function"==typeof l)l();else if("string"==typeof l){var t=kr(l,u);"function"==typeof t&&t()}}}var Nh="callback",Ph="expired-callback",Mh="sitekey",Dh="size";function Lh(t,e){for(var n=0;n<t.l.length;n++)try{t.l[n](e)}catch(t){}}function jh(t,e){return t.h.push(e),e.na((function(){G(t.h,e)})),e}function Uh(t){if(t.A)throw new T("internal-error","RecaptchaVerifier instance has been destroyed.")}function Fh(t,e,n){var i=!1;try{this.b=n||r.app()}catch(t){throw new T("argument-error","No firebase.app.App instance is currently initialized.")}if(!this.b.options||!this.b.options.apiKey)throw new T("invalid-api-key");n=this.b.options.apiKey;var o=this,s=null;try{s=this.b.auth().Ga()}catch(t){}try{i=this.b.auth().settings.appVerificationDisabledForTesting}catch(t){}s=r.SDK_VERSION?Tr(r.SDK_VERSION,s):null,Rh.call(this,n,t,e,(function(){try{var t=o.b.auth().ka()}catch(e){t=null}return t}),s,N(k),i)}function Hh(t,e,n,r){t:{n=Array.prototype.slice.call(n);for(var i=0,o=!1,s=0;s<e.length;s++)if(e[s].optional)o=!0;else{if(o)throw new T("internal-error","Argument validator encountered a required argument after an optional argument.");i++}if(o=e.length,n.length<i||o<n.length)r="Expected "+(i==o?1==i?"1 argument":i+" arguments":i+"-"+o+" arguments")+" but got "+n.length+".";else{for(i=0;i<n.length;i++)if(o=e[i].optional&&void 0===n[i],!e[i].K(n[i])&&!o){if(e=e[i],0>i||i>=Bh.length)throw new T("internal-error","Argument validator received an unsupported number of arguments.");
408n=Bh[i],r=(r?"":n+" argument ")+(e.name?'"'+e.name+'" ':"")+"must be "+e.J+".";break t}r=null}}if(r)throw new T("argument-error",t+" failed: "+r)}(e=Rh.prototype).Ia=function(){var t=this;return this.f?this.f:this.f=jh(this,ke().then((function(){if(Rr()&&!br())return gr();throw new T("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")})).then((function(){return t.v.g(t.u())})).then((function(e){return t.g=e,nc(t.o,Fa,{})})).then((function(e){t.a[Mh]=e.recaptchaSiteKey})).s((function(e){throw t.f=null,e})))},e.render=function(){Uh(this);var t=this;return jh(this,this.Ia().then((function(){if(null===t.c){var e=t.m;if(!t.i){var n=ae(e);e=pe("DIV"),n.appendChild(e)}t.c=t.g.render(e,t.a)}return t.c})))},e.verify=function(){Uh(this);var t=this;return jh(this,this.render().then((function(e){return new we((function(n){var r=t.g.getResponse(e);if(r)n(r);else{var i=function(e){e&&(function(t,e){Q(t.l,(function(t){return t==e}))}(t,i),n(e))};t.l.push(i),t.i&&t.g.execute(t.c)}}))})))},e.reset=function(){Uh(this),null!==this.c&&this.g.reset(this.c)},e.clear=function(){Uh(this),this.A=!0,this.v.c();for(var t=0;t<this.h.length;t++)this.h[t].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.i){t=ae(this.m);for(var e;e=t.firstChild;)t.removeChild(e)}},x(Fh,Rh);var Bh="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function qh(t,e){return{name:t||"",J:"a valid string",optional:!!e,K:function(t){return"string"==typeof t}}}function Vh(t,e){return{name:t||"",J:"a boolean",optional:!!e,K:function(t){return"boolean"==typeof t}}}function Wh(t,e){return{name:t||"",J:"a valid object",optional:!!e,K:g}}function zh(t,e){return{name:t||"",J:"a function",optional:!!e,K:function(t){return"function"==typeof t}}}function $h(t,e){return{name:t||"",J:"null",optional:!!e,K:function(t){return null===t}}}function Yh(t){return{name:t?t+"Credential":"credential",J:t?"a valid "+t+" credential":"a valid credential",optional:!1,K:function(e){if(!e)return!1;var n=!t||e.providerId===t;return!(!e.ja||!n)}}}function Kh(t,e){return g(t)&&"string"==typeof t.type&&t.type===e&&"function"==typeof t.Ha}function Gh(t){return g(t)&&"string"==typeof t.uid}function Qh(t,e,n,r){return{name:n||"",J:t.J+" or "+e.J,optional:!!r,K:function(n){return t.K(n)||e.K(n)}}}function Xh(t,e){for(var n in e){var r=e[n].name;t[r]=tp(r,t[n],e[n].j)}}function Jh(t,e){for(var n in e){var r=e[n].name;r!==n&&Object.defineProperty(t,r,{get:C((function(t){return this[t]}),n),set:C((function(t,e,n,r){Hh(t,[n],[r],!0),this[e]=r}),r,n,e[n].jb),enumerable:!0})}}function Zh(t,e,n,r){t[e]=tp(e,n,r)}function tp(t,e,n){function r(){var t=Array.prototype.slice.call(arguments);return Hh(o,n,t),e.apply(this,t)}if(!n)return e;var i,o=function(t){return(t=t.split("."))[t.length-1]}(t);for(i in e)r[i]=e[i];for(i in e.prototype)r.prototype[i]=e.prototype[i];return r}Xh(rh.prototype,{ib:{name:"applyActionCode",j:[qh("code")]},Qa:{name:"checkActionCode",j:[qh("code")]},mb:{name:"confirmPasswordReset",j:[qh("code"),qh("newPassword")]},dc:{name:"createUserWithEmailAndPassword",j:[qh("email"),qh("password")]},gc:{name:"fetchSignInMethodsForEmail",j:[qh("email")]},qa:{name:"getRedirectResult",j:[]},Ac:{name:"isSignInWithEmailLink",j:[qh("emailLink")]},Gc:{name:"onAuthStateChanged",j:[Qh(Wh(),zh(),"nextOrObserver"),zh("opt_error",!0),zh("opt_completed",!0)]},Hc:{name:"onIdTokenChanged",j:[Qh(Wh(),zh(),"nextOrObserver"),zh("opt_error",!0),zh("opt_completed",!0)]},ub:{name:"sendPasswordResetEmail",j:[qh("email"),Qh(Wh("opt_actionCodeSettings",!0),$h(null,!0),"opt_actionCodeSettings",!0)]},vb:{name:"sendSignInLinkToEmail",j:[qh("email"),Wh("actionCodeSettings")]},wb:{name:"setPersistence",j:[qh("persistence")]},Rc:{name:"signInAndRetrieveDataWithCredential",j:[Yh()]},yb:{name:"signInAnonymously",j:[]},Za:{name:"signInWithCredential",j:[Yh()]},Sc:{name:"signInWithCustomToken",j:[qh("token")]},Tc:{name:"signInWithEmailAndPassword",j:[qh("email"),qh("password")]},Uc:{name:"signInWithEmailLink",j:[qh("email"),qh("emailLink",!0)]},Vc:{name:"signInWithPhoneNumber",j:[qh("phoneNumber"),{name:"applicationVerifier",J:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,K:function(t){return!(!t||"string"!=typeof t.type||"function"!=typeof t.verify)}}]}
408,Wc:{name:"signInWithPopup",j:[{name:"authProvider",J:"a valid Auth provider",optional:!1,K:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Xc:{name:"signInWithRedirect",j:[{name:"authProvider",J:"a valid Auth provider",optional:!1,K:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},cd:{name:"updateCurrentUser",j:[Qh({name:"user",J:"an instance of Firebase User",optional:!1,K:function(t){return!!(t&&t instanceof ml)}},$h(),"user")]},zb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[qh(null,!0)]},ed:{name:"useDeviceLanguage",j:[]},fd:{name:"useEmulator",j:[qh("url")]},hd:{name:"verifyPasswordResetCode",j:[qh("code")]}}),Jh(rh.prototype,{lc:{name:"languageCode",jb:Qh(qh(),$h(),"languageCode")},ti:{name:"tenantId",jb:Qh(qh(),$h(),"tenantId")}}),rh.Persistence=Xc,rh.Persistence.LOCAL="local",rh.Persistence.SESSION="session",rh.Persistence.NONE="none",Xh(ml.prototype,{delete:{name:"delete",j:[]},nc:{name:"getIdTokenResult",j:[Vh("opt_forceRefresh",!0)]},I:{name:"getIdToken",j:[Vh("opt_forceRefresh",!0)]},Bc:{name:"linkAndRetrieveDataWithCredential",j:[Yh()]},pb:{name:"linkWithCredential",j:[Yh()]},Cc:{name:"linkWithPhoneNumber",j:[qh("phoneNumber"),{name:"applicationVerifier",J:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,K:function(t){return!(!t||"string"!=typeof t.type||"function"!=typeof t.verify)}}]},Dc:{name:"linkWithPopup",j:[{name:"authProvider",J:"a valid Auth provider",optional:!1,K:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Ec:{name:"linkWithRedirect",j:[{name:"authProvider",J:"a valid Auth provider",optional:!1,K:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Kc:{name:"reauthenticateAndRetrieveDataWithCredential",j:[Yh()]},sb:{name:"reauthenticateWithCredential",j:[Yh()]},Lc:{name:"reauthenticateWithPhoneNumber",j:[qh("phoneNumber"),{name:"applicationVerifier",J:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,K:function(t){return!(!t||"string"!=typeof t.type||"function"!=typeof t.verify)}}]},Mc:{name:"reauthenticateWithPopup",j:[{name:"authProvider",J:"a valid Auth provider",optional:!1,K:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},Nc:{name:"reauthenticateWithRedirect",j:[{name:"authProvider",J:"a valid Auth provider",optional:!1,K:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}]},reload:{name:"reload",j:[]},tb:{name:"sendEmailVerification",j:[Qh(Wh("opt_actionCodeSettings",!0),$h(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[qh(null,!0)]},bd:{name:"unlink",j:[qh("provider")]},Ab:{name:"updateEmail",j:[qh("email")]},Bb:{name:"updatePassword",j:[qh("password")]},dd:{name:"updatePhoneNumber",j:[Yh("phone")]},Cb:{name:"updateProfile",j:[Wh("profile")]},Db:{name:"verifyBeforeUpdateEmail",j:[qh("email"),Qh(Wh("opt_actionCodeSettings",!0),$h(null,!0),"opt_actionCodeSettings",!0)]}}),Xh(yh.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Xh(mh.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Xh(we.prototype,{na:{name:"finally"},s:{name:"catch"},then:{name:"then"}}),Jh(Gu.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",jb:Vh("appVerificationDisabledForTesting")}}),Xh(Qu.prototype,{confirm:{name:"confirm",j:[qh("verificationCode")]}}),Zh(co,"fromJSON",(function(t){t="string"==typeof t?JSON.parse(t):t;for(var e,n=[go,Oo,Mo,po],r=0;r<n.length;r++)if(e=n[r](t))return e;return null}),[Qh(qh(),Wh(),"json")]),Zh(Ao,"credential",(function(t,e){return new ko(t,e)}),[qh("email"),qh("password")]),Xh(ko.prototype,{w:{name:"toJSON",j:[qh(null,!0)]}}),Xh(_o.prototype,{Ca:{name:"addScope",j:[qh("scope")]},Ka:{name:"setCustomParameters",j:[Wh("customOAuthParameters")]}}),Zh(_o,"credential",wo,[Qh(qh(),Wh(),"token")]),Zh(Ao,"credentialWithLink",Ro,[qh("email"),qh("emailLink")]),Xh(So.prototype,{Ca:{name:"addScope",j:[qh("scope")]},Ka:{name:"setCustomParameters",j:[Wh("customOAuthParameters")]}}),Zh(So,"credential",Co,[Qh(qh(),Wh(),"token")]),Xh(Eo.prototype,{Ca:{name:"addScope",j:[qh("scope")]},Ka:{name:"setCustomParameters",j:[Wh("customOAuthParameters")]}}),Zh(Eo,"credential",xo,[Qh(qh(),Qh(Wh(),$h()),"idToken"),Qh(qh(),$h(),"accessToken",!0)]),Xh(To.prototype,{Ka:{name:"setCustomParameters",j:[Wh("customOAuthParameters")]}}),Zh(To,"credential",Io,[Qh(qh(),Wh(),"token"),qh("secret",!0)]),Xh(bo.prototype,{Ca:{name:"addScope",j:[qh("scope")]},credential:{name:"credential",j:[Qh(qh(),Qh(Wh(),$h()),"optionsOrIdToken"),Qh(qh(),$h(),"accessToken",!0)]},Ka:{name:"setCustomParameters",j:[Wh("customOAuthParameters")]}}),Xh(fo.prototype,{w:{name:"toJSON",j:[qh(null,!0)]}}),Xh(lo.prototype,{w:{name:"toJSON",j:[qh(null,!0)]}}),Zh(Lo,"credential",jo,[qh("verificationId"),qh("verificationCode")]),Xh(Lo.prototype,{eb:{name:"verifyPhoneNumber",j:[Qh(qh(),{name:"phoneInfoOptions",J:"valid phone info o
408ptions",optional:!1,K:function(t){return!!t&&(t.session&&t.phoneNumber?Kh(t.session,so)&&"string"==typeof t.phoneNumber:t.session&&t.multiFactorHint?Kh(t.session,ao)&&Gh(t.multiFactorHint):t.session&&t.multiFactorUid?Kh(t.session,ao)&&"string"==typeof t.multiFactorUid:!!t.phoneNumber&&"string"==typeof t.phoneNumber)}},"phoneInfoOptions"),{name:"applicationVerifier",J:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,K:function(t){return!(!t||"string"!=typeof t.type||"function"!=typeof t.verify)}}]}}),Xh(Po.prototype,{w:{name:"toJSON",j:[qh(null,!0)]}}),Xh(T.prototype,{toJSON:{name:"toJSON",j:[qh(null,!0)]}}),Xh($o.prototype,{toJSON:{name:"toJSON",j:[qh(null,!0)]}}),Xh(zo.prototype,{toJSON:{name:"toJSON",j:[qh(null,!0)]}}),Xh(nl.prototype,{toJSON:{name:"toJSON",j:[qh(null,!0)]}}),Xh(Zu.prototype,{Qc:{name:"resolveSignIn",j:[{name:"multiFactorAssertion",J:"a valid multiFactorAssertion",optional:!1,K:function(t){return!!t&&!!t.rb}}]}}),Xh(cl.prototype,{Qb:{name:"getSession",j:[]},ec:{name:"enroll",j:[{name:"multiFactorAssertion",J:"a valid multiFactorAssertion",optional:!1,K:function(t){return!!t&&!!t.rb}},qh("displayName",!0)]},ad:{name:"unenroll",j:[Qh({name:"multiFactorInfo",J:"a valid multiFactorInfo",optional:!1,K:Gh},qh(),"multiFactorInfoIdentifier")]}}),Xh(Fh.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),Zh(_i,"parseLink",ki,[qh("link")]),Zh(Eh,"assertion",(function(t){return new sl(t)}),[Yh("phone")]),function(){if(void 0===r||!r.INTERNAL||!r.INTERNAL.registerComponent)throw Error("Cannot find the firebase namespace; be sure to include firebase-app.js before this library.");var t={ActionCodeInfo:{Operation:{EMAIL_SIGNIN:ci,PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:ai,VERIFY_AND_CHANGE_EMAIL:ui,VERIFY_EMAIL:"VERIFY_EMAIL"}},Auth:rh,AuthCredential:co,Error:T};Zh(t,"EmailAuthProvider",Ao,[]),Zh(t,"FacebookAuthProvider",_o,[]),Zh(t,"GithubAuthProvider",So,[]),Zh(t,"GoogleAuthProvider",Eo,[]),Zh(t,"TwitterAuthProvider",To,[]),Zh(t,"OAuthProvider",bo,[qh("providerId")]),Zh(t,"SAMLAuthProvider",yo,[qh("providerId")]),Zh(t,"PhoneAuthProvider",Lo,[{name:"auth",J:"an instance of Firebase Auth",optional:!0,K:function(t){return!!(t&&t instanceof rh)}}]),Zh(t,"RecaptchaVerifier",Fh,[Qh(qh(),{name:"",J:"an HTML element",optional:!1,K:function(t){return!!(t&&t instanceof Element)}},"recaptchaContainer"),Wh("recaptchaParameters",!0),{name:"app",J:"an instance of Firebase App",optional:!0,K:function(t){return!!(t&&t instanceof r.app.App)}}]),Zh(t,"ActionCodeURL",_i,[]),Zh(t,"PhoneMultiFactorGenerator",Eh,[]),r.INTERNAL.registerComponent({name:"auth",instanceFactory:function(t){return new rh(t=t.getProvider("app").getImmediate())},multipleInstances:!1,serviceProps:t,instantiationMode:"LAZY",type:"PUBLIC"}),r.INTERNAL.registerComponent({name:"auth-internal",instanceFactory:function(t){return{getUid:S((t=t.getProvider("auth").getImmediate()).getUid,t),getToken:S(t.mc,t),addAuthTokenListener:S(t.cc,t),removeAuthTokenListener:S(t.Oc,t)}},multipleInstances:!1,instantiationMode:"LAZY",type:"PRIVATE"}),r.registerVersion("@firebase/auth","0.15.0"),r.INTERNAL.extendNamespace({User:ml})}()}).apply(void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})}).call(this,n(71))},function(t,e,n){"use strict";(function(r){Object.defineProperty(e,"__esModule",{value:!0});var i=n(130),o=n(91),s=n(131),a=n(155),c=n(154);function u(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var l,h=u(i),p=function(){function t(t){this.domStorage_=t,this.prefix_="firebase:"}return t.prototype.set=function(t,e){null==e?this.domStorage_.removeItem(this.prefixedName_(t)):this.domStorage_.setItem(this.prefixedName_(t),s.stringify(e))},t.prototype.get=function(t){var e=this.domStorage_.getItem(this.prefixedName_(t));return null==e?null:s.jsonEval(e)},t.prototype.remove=function(t){this.domStorage_.removeItem(this.prefixedName_(t))},t.prototype.prefixedName_=function(t){return this.prefix_+t},t.prototype.toString=function(){return this.domStorage_.toString()},t}(),d=function(){function t(){this.cache_={},this.isInMemoryStorage=!0}return t.prototype.set=function(t,e){null==e?delete this.cache_[t]:this.cache_[t]=e},t.prototype.get=function(t){return s.contains(this.cache_,t)?this.cache_[t]:null},t.prototype.remove=function(t){delete this.cache_[t]},t}(),f=function(t){try{if("undefined"!=typeof window&&void 0!==window[t]){var e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new p(e)}}catch(t){}return new d},v=f("localStorage"),g=f("sessionStorage"),m=new a.Logger("@firebase/database"),y=(l=1,function(){return l++}),b=function(t){var e=s.stringToByteArray(t),n=new s.Sha1;n.update(e);var r=n.digest();return s.base64.encodeByteArray(r)},_=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n="",r=0;r<t.length;r++){var i=t[r];Array.isArray(i)||i&&"object"==typeof i&&"number"==typeof i.length?n+=_.apply(null,i):n+="object"==typeof i?s.stringify(i):i,n+=" "}return n},w=null,S=!0,C=function(t,e){s.assert(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?(m.logLevel=a.LogLevel.VERBOSE,w=m.log.bind(m),e&&g.set("logging_enabled",!0)):"function"==typeof t?w=t:(w=null,g.remove("logging_enabled"))},E=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!0===S&&(S=!1,null===w&&!0===g.get("logging_enabled")&&C(!0)),w){var n=_.apply(null,t);w(n)}},x=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];E.apply(void 0,o.__spread([t],e))}},T=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE INTERNAL ERROR: "+_.apply(void 0,o.__spread(t));m.error(n)},I=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE FATAL ERROR: "+_.apply(void 0,o.__spread(t));throw m.error(n),new Error(n)},k=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE WARNING: "+_.apply(void 0,o.__spread(t));m.warn(n)},O=function(t){return"number"==typeof t&&(t!=t||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY)},A="[MIN_NAME]",R="[MAX_NAME]",N=function(t,e){if(t===e)return 0;if(t===A||e===R)return-1;if(e===A||t===R)return 1;var n=H(t),r=H(e);return null!==n?null!==r?n-r==0?t.length-e.length:n-r:-1:null!==r?1:t<e?-1:1},P=function(t,e){return t===e?0:t<e?-1:1},M=function(t,e){if(e&&t in e)return e[t];throw new Error("Missing required key ("+t+") in object: "+s.stringify(e))},D=function(t){if("object"!=typeof t||null===t)return s.stringify(t);var e=[];for(var n in t)e.push(n);e.sort();for(var r="{",i=0;i<e.length;i++)0!==i&&(r+=","),r+=s.stringify(e[i]),r+=":",r+=D(t[e[i]]);return r+="}"},L=function(t,e){var n=t.length;if(n<=e)return[t];for(var r=[],i=0;i<n;i+=e)i+e>n?r.push(t.substring(i,n)):r.push(t.substring(i,i+e));return r};
409/**
410 * @license
411 * Copyright 2017 Google LLC
412 *
413 * Licensed under the Apache License, Version 2.0 (the "License");
414 * you may not use this file except in compliance with the License.
415 * You may obtain a copy of the License at
416 *
417 *   http://www.apache.org/licenses/LICENSE-2.0
418 *
419 * Unless required by applicable law or agreed to in writing, software
420 * distributed under the License is distributed on an "AS IS" BASIS,
421 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
422 * See the License for the specific language governing permissions and
423 * limitations under the License.
424 */function j(t,e){for(var n in t)t.hasOwnProperty(n)&&e(n,t[n])}var U=function(t){s.assert(!O(t),"Invalid JSON number");var e,n,r,i,o;0===t?(n=0,r=0,e=1/t==-1/0?1:0):(e=t<0,(t=Math.abs(t))>=Math.pow(2,-1022)?(n=(i=Math.min(Math.floor(Math.log(t)/Math.LN2),1023))+1023,r=Math.round(t*Math.pow(2,52-i)-Math.pow(2,52))):(n=0,r=Math.round(t/Math.pow(2,-1074))));var a=[];for(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(e?1:0),a.reverse();var c=a.join(""),u="";for(o=0;o<64;o+=8){var l=parseInt(c.substr(o,8),2).toString(16);1===l.length&&(l="0"+l),u+=l}return u.toLowerCase()},F=new RegExp("^-?(0*)\\d{1,10}$"),H=function(t){if(F.test(t)){var e=Number(t);if(e>=-2147483648&&e<=2147483647)return e}return null},B=function(t){try{t()}catch(t){setTimeout((function(){var e=t.stack||"";throw k("Exception was thrown by user callback.",e),t}),Math.floor(0))}},q=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(t,e){var n=setTimeout(t,e);return"object"==typeof n&&n.unref&&n.unref(),n},W=function(){function t(t,e){if(void 0===e){this.pieces_=t.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_=t,this.pieceNum_=e}return Object.defineProperty(t,"Empty",{get:function(){return new t("")},enumerable:!1,configurable:!0}),t.prototype.getFront=function(){return this.pieceNum_>=this.pieces_.length?null:this.pieces_[this.pieceNum_]},t.prototype.getLength=function(){return this.pieces_.length-this.pieceNum_},t.prototype.popFront=function(){var e=this.pieceNum_;return e<this.pieces_.length&&e++,new t(this.pieces_,e)},t.prototype.getBack=function(){return this.pieceNum_<this.pieces_.length?this.pieces_[this.pieces_.length-1]:null},t.prototype.toString=function(){for(var t="",e=this.pieceNum_;e<this.pieces_.length;e++)""!==this.pieces_[e]&&(t+="/"+this.pieces_[e]);return t||"/"},t.prototype.toUrlEncodedString=function(){for(var t="",e=this.pieceNum_;e<this.pieces_.length;e++)""!==this.pieces_[e]&&(t+="/"+encodeURIComponent(String(this.pieces_[e])));return t||"/"},t.prototype.slice=function(t){return void 0===t&&(t=0),this.pieces_.slice(this.pieceNum_+t)},t.prototype.parent=function(){if(this.pieceNum_>=this.pieces_.length)return null;for(var e=[],n=this.pieceNum_;n<this.pieces_.length-1;n++)e.push(this.pieces_[n]);return new t(e,0)},t.prototype.child=function(e){for(var n=[],r=this.pieceNum_;r<this.pieces_.length;r++)n.push(this.pieces_[r]);if(e instanceof t)for(r=e.pieceNum_;r<e.pieces_.length;r++)n.push(e.pieces_[r]);else{var i=e.split("/");for(r=0;r<i.length;r++)i[r].length>0&&n.push(i[r])}return new t(n,0)},t.prototype.isEmpty=function(){return this.pieceNum_>=this.pieces_.length},t.relativePath=function(e,n){var r=e.getFront(),i=n.getFront();if(null===r)return n;if(r===i)return t.relativePath(e.popFront(),n.popFront());throw new Error("INTERNAL ERROR: innerPath ("+n+") is not within outerPath ("+e+")")},t.comparePaths=function(t,e){for(var n=t.slice(),r=e.slice(),i=0;i<n.length&&i<r.length;i++){var o=N(n[i],r[i]);if(0!==o)return o}return n.length===r.length?0:n.length<r.length?-1:1},t.prototype.equals=function(t){if(this.getLength()!==t.getLength())return!1;for(var e=this.pieceNum_,n=t.pieceNum_;e<=this.pieces_.length;e++,n++)if(this.pieces_[e]!==t.pieces_[n])return!1;return!0},t.prototype.contains=function(t){var e=this.pieceNum_,n=t.pieceNum_;if(this.getLength()>t.getLength())return!1;for(;e<this.pieces_.length;){if(this.pieces_[e]!==t.pieces_[n])return!1;++e,++n}return!0},t}(),z=function(){function t(t,e){this.errorPrefix_=e,this.parts_=t.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(t,"MAX_PATH_DEPTH",{get:function(){return 32}
424,enumerable:!1,configurable:!0}),Object.defineProperty(t,"MAX_PATH_LENGTH_BYTES",{get:function(){return 768},enumerable:!1,configurable:!0}),t.prototype.push=function(t){this.parts_.length>0&&(this.byteLength_+=1),this.parts_.push(t),this.byteLength_+=s.stringLength(t),this.checkValid_()},t.prototype.pop=function(){var t=this.parts_.pop();this.byteLength_-=s.stringLength(t),this.parts_.length>0&&(this.byteLength_-=1)},t.prototype.checkValid_=function(){if(this.byteLength_>t.MAX_PATH_LENGTH_BYTES)throw new Error(this.errorPrefix_+"has a key path longer than "+t.MAX_PATH_LENGTH_BYTES+" bytes ("+this.byteLength_+").");if(this.parts_.length>t.MAX_PATH_DEPTH)throw new Error(this.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+t.MAX_PATH_DEPTH+") or object contains a cycle "+this.toErrorString())},t.prototype.toErrorString=function(){return 0===this.parts_.length?"":"in property '"+this.parts_.join(".")+"'"},t}(),$="long_polling",Y=function(){function t(t,e,n,r,i,o,s){void 0===i&&(i=!1),void 0===o&&(o=""),void 0===s&&(s=!1),this.secure=e,this.namespace=n,this.webSocketOnly=r,this.nodeAdmin=i,this.persistenceKey=o,this.includeNamespaceInQueryParams=s,this.host=t.toLowerCase(),this.domain=this.host.substr(this.host.indexOf(".")+1),this.internalHost=v.get("host:"+t)||this.host}return t.prototype.needsQueryParam=function(){return this.host!==this.internalHost||this.isCustomHost()||this.includeNamespaceInQueryParams},t.prototype.isCacheableHost=function(){return"s-"===this.internalHost.substr(0,2)},t.prototype.isDemoHost=function(){return"firebaseio-demo.com"===this.domain},t.prototype.isCustomHost=function(){return"firebaseio.com"!==this.domain&&"firebaseio-demo.com"!==this.domain},t.prototype.updateHost=function(t){t!==this.internalHost&&(this.internalHost=t,this.isCacheableHost()&&v.set("host:"+this.host,this.internalHost))},t.prototype.connectionURL=function(t,e){var n;if(s.assert("string"==typeof t,"typeof type must == string"),s.assert("object"==typeof e,"typeof params must == object"),"websocket"===t)n=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if(t!==$)throw new Error("Unknown connection type: "+t);n=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(e.ns=this.namespace);var r=[];return j(e,(function(t,e){r.push(t+"="+e)})),n+r.join("&")},t.prototype.toString=function(){var t=this.toURLString();return this.persistenceKey&&(t+="<"+this.persistenceKey+">"),t},t.prototype.toURLString=function(){return(this.secure?"https://":"http://")+this.host},t}();var K,G,Q,X,J,Z=function(t,e){var n=tt(t),r=n.namespace;"firebase.com"===n.domain&&I(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),r&&"undefined"!==r||"localhost"===n.domain||I("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&k("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().");var i="ws"===n.scheme||"wss"===n.scheme;return{repoInfo:new Y(n.host,n.secure,r,e,i,"",r!==n.subdomain),path:new W(n.pathString)}},tt=function(t){var e="",n="",r="",i="",s="",a=!0,c="https",u=443;if("string"==typeof t){var l=t.indexOf("//");l>=0&&(c=t.substring(0,l-1),t=t.substring(l+2));var h=t.indexOf("/");-1===h&&(h=t.length);var p=t.indexOf("?");-1===p&&(p=t.length),e=t.substring(0,Math.min(h,p)),h<p&&(i=
425/**
426 * @license
427 * Copyright 2017 Google LLC
428 *
429 * Licensed under the Apache License, Version 2.0 (the "License");
430 * you may not use this file except in compliance with the License.
431 * You may obtain a copy of the License at
432 *
433 *   http://www.apache.org/licenses/LICENSE-2.0
434 *
435 * Unless required by applicable law or agreed to in writing, software
436 * distributed under the License is distributed on an "AS IS" BASIS,
437 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
438 * See the License for the specific language governing permissions and
439 * limitations under the License.
440 */
441function(t){for(var e="",n=t.split("/"),r=0;r<n.length;r++)if(n[r].length>0){var i=n[r];try{i=decodeURIComponent(i.replace(/\+/g," "))}catch(t){}e+="/"+i}return e}(t.substring(h,p)));var d=function(t){var e,n,r={};"?"===t.charAt(0)&&(t=t.substring(1));try{for(var i=o.__values(t.split("&")),s=i.next();!s.done;s=i.next()){var a=s.value;if(0!==a.length){var c=a.split("=");
4412===c.length?r[decodeURIComponent(c[0])]=decodeURIComponent(c[1]):k("Invalid query segment '"+a+"' in query '"+t+"'")}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}(t.substring(Math.min(t.length,p)));(l=e.indexOf(":"))>=0?(a="https"===c||"wss"===c,u=parseInt(e.substring(l+1),10)):l=e.length;var f=e.slice(0,l);if("localhost"===f.toLowerCase())n="localhost";else if(f.split(".").length<=2)n=f;else{var v=e.indexOf(".");r=e.substring(0,v).toLowerCase(),n=e.substring(v+1),s=r}"ns"in d&&(s=d.ns)}return{host:e,port:u,domain:n,subdomain:r,secure:a,scheme:c,pathString:i,namespace:s}},et=/[\[\].#$\/\u0000-\u001F\u007F]/,nt=/[\[\].#$\u0000-\u001F\u007F]/,rt=function(t){return"string"==typeof t&&0!==t.length&&!et.test(t)},it=function(t){return"string"==typeof t&&0!==t.length&&!nt.test(t)},ot=function(t){return null===t||"string"==typeof t||"number"==typeof t&&!O(t)||t&&"object"==typeof t&&s.contains(t,".sv")},st=function(t,e,n,r,i){i&&void 0===n||at(s.errorPrefix(t,e,i),n,r)},at=function(t,e,n){var r=n instanceof W?new z(n,t):n;if(void 0===e)throw new Error(t+"contains undefined "+r.toErrorString());if("function"==typeof e)throw new Error(t+"contains a function "+r.toErrorString()+" with contents = "+e.toString());if(O(e))throw new Error(t+"contains "+e.toString()+" "+r.toErrorString());if("string"==typeof e&&e.length>10485760/3&&s.stringLength(e)>10485760)throw new Error(t+"contains a string greater than 10485760 utf8 bytes "+r.toErrorString()+" ('"+e.substring(0,50)+"...')");if(e&&"object"==typeof e){var i=!1,o=!1;if(j(e,(function(e,n){if(".value"===e)i=!0;else if(".priority"!==e&&".sv"!==e&&(o=!0,!rt(e)))throw new Error(t+" contains an invalid key ("+e+") "+r.toErrorString()+'.  Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');r.push(e),at(t,n,r),r.pop()})),i&&o)throw new Error(t+' contains ".value" child '+r.toErrorString()+" in addition to actual children.")}},ct=function(t,e,n,r,i){if(!i||void 0!==n){var o=s.errorPrefix(t,e,i);if(!n||"object"!=typeof n||Array.isArray(n))throw new Error(o+" must be an object containing the children to replace.");var a=[];j(n,(function(t,e){var n=new W(t);if(at(o,e,r.child(n)),".priority"===n.getBack()&&!ot(e))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(t,e){var n,r;for(n=0;n<e.length;n++)for(var i=(r=e[n]).slice(),o=0;o<i.length;o++)if(".priority"===i[o]&&o===i.length-1);else if(!rt(i[o]))throw new Error(t+"contains an invalid key ("+i[o]+") in path "+r.toString()+'. Keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]"');e.sort(W.comparePaths);var s=null;for(n=0;n<e.length;n++){if(r=e[n],null!==s&&s.contains(r))throw new Error(t+"contains a path "+s.toString()+" that is ancestor of another path "+r.toString());s=r}}(o,a)}},ut=function(t,e,n,r){if(!r||void 0!==n){if(O(n))throw new Error(s.errorPrefix(t,e,r)+"is "+n.toString()+", but must be a valid Firebase priority (a string, finite number, server value, or null).");if(!ot(n))throw new Error(s.errorPrefix(t,e,r)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},lt=function(t,e,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(t,e,r)+'must be a valid event type = "value", "child_added", "child_removed", "child_changed", or "child_moved".')}},ht=function(t,e,n,r){if(!(r&&void 0===n||rt(n)))throw new Error(s.errorPrefix(t,e,r)+'was an invalid key = "'+n+'".  Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},pt=function(t,e,n,r){if(!(r&&void 0===n||it(n)))throw new Error(s.errorPrefix(t,e,r)+'was an invalid path = "'+n+'". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')},dt=function(t,e,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),pt(t,e,n,r)},ft=function(t,e){if(".info"===e.getFront())throw new Error(t+" failed = Can't modify data under /.info/")},vt=function(t,e,n){var r=n.path.toString();if("string"!=typeof n.repoInfo.host||0===n.repoInfo.host.length||!rt(n.repoInfo.namespace)&&"localhost"!==n.repoInfo.host.split(":")[0]||0!==r.length&&!function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),it(t)}(r))throw new Error(s.errorPrefix(t,e,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},gt=function(t,e,n,r){if((!r||void 0!==n)&&"boolean"!=typeof n)throw new Error(s.errorPrefix(t,e,r)+"must be a boolean.")},mt=function(){function t(t,e){this.repo_=t,this.path_=e}return t.prototype.cancel=function(t){s.validateArgCount("OnDisconnect.cancel",0,1,arguments.length),s.validateCallback("OnDisconnect.cancel",1,t,!0);var e=new s.Deferred;return this.repo_.onDisconnectCancel(this.path_,e.wrapCallback(t)),e.promise},t.prototype.remove=function(t){s.validateArgCount("OnDisconnect.remove",0,1,arguments.length),ft("OnDisconnect.remove",this.path_),s.validateCallback("OnDisconnect.remove",1,t,!0);var e=new s.Deferred;return this.repo_.onDisconnectSet(this.path_,null,e.wrapCallback(t)),e.promise},t.prototype.set=function(t,e){s.validateArgCount("OnDisconnect.set",1,2,arguments.length),ft("OnDisconnect.set",this.path_),st("OnDisconnect.set",1,t,this.path_,!1),s.validateCallback("OnDisconnect.set",2,e,!0);var n=new s.Deferred;return this.repo_.onDisconnectSet(this.path_,t,n.wrapCallback(e)),n.promise},t.prototype.setWithPriority=function(t,e,n){s.validateArgCount("OnDisconnect.setWithPriority",2,3,arguments.length),ft("OnDisconnect.setWithPriority",this.path_),st("OnDisconnect.setWithPriority",1,t,this.path_,!1),ut("OnDisconnect.setWithPriority",2,e,!1),s.validateCallback("OnDisconnect.setWithPriority",3,n,!0);var r=new s.Deferred;return this.repo_.onDisconnectSetWithPriority(this.path_,t,e,r.wrapCallback(n)),r.promise},t.prototype.update=function(t,e){if(s.validateArgCount("OnDisconnect.update",1,2,arguments.length),ft("OnDisconnect.update",this.path_),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,k("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.")}ct("OnDisconnect.update",1,t,this.path_,!1),s.validateCallback("OnDisconnect.update",2,e,!0);var i=new s.Deferred;return this.repo_.onDisconnectUpdate(this.path_,t,i.wrapCallback(e)),i.promise},t}(),yt=function(){function t(t,e){this.committed=t,this.snapshot=e}return t.prototype.toJSON=function(){return s.validateArgCount("TransactionResult.toJSON",0,1,arguments.length),{committed:this.committed,snapshot:this.snapshot.toJSON()}},t}(),bt=(K="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",G=0,Q=[],function(t){var e,n=t===G;G=t;var r=new Array(8);for(e=7;e>=0;e--)r[e]=K.charAt(t%64),t=Math.floor(t/64);s.assert(0===t,"Cannot push at time == 0");var i=r.join("");if(n){for(e=11;e>=0&&63===Q[e];e--)Q[e]=0;Q[e]++}else for(e=0;e<12;e++)Q[e]=Math.floor(64*Math.random());for(e=0;e<12;e++)i+=K.charAt(Q[e]);return s.assert(20===i.length,"nextPushId: Length should be 20."),i}),_t=function(){function t(t,e){this.name=t,this.node=e}return t.Wrap=function(e,n){return new t(e,n)},t}(),wt=function(){function t(){}return t.prototype.getCompare=function(){return this.compare.bind(this)},t.prototype.indexedValueChanged=function(t,e){var n=new _t(A,t),r=new _t(A,e);return 0!==this.compare(n,r)},t.prototype.minPost=function(){return _t.MIN},t}(),St=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),Object.defineProperty(e,"__EMPTY_NODE",{get:function(){return X},set:function(t){X=t}
441,enumerable:!1,configurable:!0}),e.prototype.compare=function(t,e){return N(t.name,e.name)},e.prototype.isDefinedOn=function(t){throw s.assertionError("KeyIndex.isDefinedOn not expected to be called.")},e.prototype.indexedValueChanged=function(t,e){return!1},e.prototype.minPost=function(){return _t.MIN},e.prototype.maxPost=function(){return new _t(R,X)},e.prototype.makePost=function(t,e){return s.assert("string"==typeof t,"KeyIndex indexValue must always be a string."),new _t(t,X)},e.prototype.toString=function(){return".key"},e}(wt),Ct=new St;var Et,xt,Tt,It=function(t){return"number"==typeof t?"number:"+U(t):"string:"+t},kt=function(t){if(t.isLeafNode()){var e=t.val();s.assert("string"==typeof e||"number"==typeof e||"object"==typeof e&&s.contains(e,".sv"),"Priority must be a string or number.")}else s.assert(t===J||t.isEmpty(),"priority of unexpected type.");s.assert(t===J||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},Ot=function(){function t(e,n){void 0===n&&(n=t.__childrenNodeConstructor.EMPTY_NODE),this.value_=e,this.priorityNode_=n,this.lazyHash_=null,s.assert(void 0!==this.value_&&null!==this.value_,"LeafNode shouldn't be created with null/undefined value."),kt(this.priorityNode_)}return Object.defineProperty(t,"__childrenNodeConstructor",{get:function(){return Et},set:function(t){Et=t},enumerable:!1,configurable:!0}),t.prototype.isLeafNode=function(){return!0},t.prototype.getPriority=function(){return this.priorityNode_},t.prototype.updatePriority=function(e){return new t(this.value_,e)},t.prototype.getImmediateChild=function(e){return".priority"===e?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.getChild=function(e){return e.isEmpty()?this:".priority"===e.getFront()?this.priorityNode_:t.__childrenNodeConstructor.EMPTY_NODE},t.prototype.hasChild=function(){return!1},t.prototype.getPredecessorChildName=function(t,e){return null},t.prototype.updateImmediateChild=function(e,n){return".priority"===e?this.updatePriority(n):n.isEmpty()&&".priority"!==e?this:t.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,n).updatePriority(this.priorityNode_)},t.prototype.updateChild=function(e,n){var r=e.getFront();return null===r?n:n.isEmpty()&&".priority"!==r?this:(s.assert(".priority"!==r||1===e.getLength(),".priority must be the last token in a path"),this.updateImmediateChild(r,t.__childrenNodeConstructor.EMPTY_NODE.updateChild(e.popFront(),n)))},t.prototype.isEmpty=function(){return!1},t.prototype.numChildren=function(){return 0},t.prototype.forEachChild=function(t,e){return!1},t.prototype.val=function(t){return t&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()},t.prototype.hash=function(){if(null===this.lazyHash_){var t="";this.priorityNode_.isEmpty()||(t+="priority:"+It(this.priorityNode_.val())+":");var e=typeof this.value_;t+=e+":",t+="number"===e?U(this.value_):this.value_,this.lazyHash_=b(t)}return this.lazyHash_},t.prototype.getValue=function(){return this.value_},t.prototype.compareTo=function(e){return e===t.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof t.__childrenNodeConstructor?-1:(s.assert(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))},t.prototype.compareToLeafNode_=function(e){var n=typeof e.value_,r=typeof this.value_,i=t.VALUE_TYPE_ORDER.indexOf(n),o=t.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_<e.value_?-1:this.value_===e.value_?0:1:o-i},t.prototype.withIndex=function(){return this},t.prototype.isIndexed=function(){return!0},t.prototype.equals=function(t){if(t===this)return!0;if(t.isLeafNode()){var e=t;return this.value_===e.value_&&this.priorityNode_.equals(e.priorityNode_)}return!1},t.VALUE_TYPE_ORDER=["object","boolean","number","string"],t}();var At,Rt,Nt=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.compare=function(t,e){var n=t.node.getPriority(),r=e.node.getPriority(),i=n.compareTo(r);return 0===i?N(t.name,e.name):i},e.prototype.isDefinedOn=function(t){return!t.getPriority().isEmpty()},e.prototype.indexedValueChanged=function(t,e){return!t.getPriority().equals(e.getPriority())},e.prototype.minPost=function(){return _t.MIN},e.prototype.maxPost=function(){return new _t(R,new Ot("[PRIORITY-POST]",Tt))},e.prototype.makePost=function(t,e){var n=xt(t);return new _t(e,new Ot("[PRIORITY-POST]",n))},e.prototype.toString=function(){return".priority"},e}(wt)),Pt=function(){function t(t,e,n,r,i){void 0===i&&(i=null),this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];for(var o=1;!t.isEmpty();)if(t=t,o=e?n(t.key,e):1,r&&(o*=-1),o<0)t=this.isReverse_?t.left:t.right;else{if(0===o){this.nodeStack_.push(t);break}this.nodeStack_.push(t),t=this.isReverse_?t.right:t.left}}return t.prototype.getNext=function(){if(0===this.nodeStack_.length)return null;var t,e=this.nodeStack_.pop();if(t=this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value},this.isReverse_)for(e=e.left;!e.isEmpty();)this.nodeStack_.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack_.push(e),e=e.left;return t},t.prototype.hasNext=function(){return this.nodeStack_.length>0},t.prototype.peek=function(){if(0===this.nodeStack_.length)return null;var t=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value}},t}(),Mt=function(){function t(e,n,r,i,o){this.key=e,this.value=n,this.color=null!=r?r:t.RED,this.left=null!=i?i:Lt.EMPTY_NODE,this.right=null!=o?o:Lt.EMPTY_NODE}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,
441null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.count=function(){return this.left.count()+1+this.right.count()},t.prototype.isEmpty=function(){return!1},t.prototype.inorderTraversal=function(t){return this.left.inorderTraversal(t)||!!t(this.key,this.value)||this.right.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)},t.prototype.min_=function(){return this.left.isEmpty()?this:this.left.min_()},t.prototype.minKey=function(){return this.min_().key},t.prototype.maxKey=function(){return this.right.isEmpty()?this.key:this.right.maxKey()},t.prototype.insert=function(t,e,n){var r=this,i=n(t,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.insert(t,e,n))).fixUp_()},t.prototype.removeMin_=function(){if(this.left.isEmpty())return Lt.EMPTY_NODE;var t=this;return t.left.isRed_()||t.left.left.isRed_()||(t=t.moveRedLeft_()),(t=t.copy(null,null,null,t.left.removeMin_(),null)).fixUp_()},t.prototype.remove=function(t,e){var n,r;if(e(t,(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(t,e),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),n.right.isEmpty()||n.right.isRed_()||n.right.left.isRed_()||(n=n.moveRedRight_()),0===e(t,n.key)){if(n.right.isEmpty())return Lt.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(t,e))}return n.fixUp_()},t.prototype.isRed_=function(){return this.color},t.prototype.fixUp_=function(){var t=this;return t.right.isRed_()&&!t.left.isRed_()&&(t=t.rotateLeft_()),t.left.isRed_()&&t.left.left.isRed_()&&(t=t.rotateRight_()),t.left.isRed_()&&t.right.isRed_()&&(t=t.colorFlip_()),t},t.prototype.moveRedLeft_=function(){var t=this.colorFlip_();return t.right.left.isRed_()&&(t=(t=(t=t.copy(null,null,null,null,t.right.rotateRight_())).rotateLeft_()).colorFlip_()),t},t.prototype.moveRedRight_=function(){var t=this.colorFlip_();return t.left.left.isRed_()&&(t=(t=t.rotateRight_()).colorFlip_()),t},t.prototype.rotateLeft_=function(){var e=this.copy(null,null,t.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)},t.prototype.rotateRight_=function(){var e=this.copy(null,null,t.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)},t.prototype.colorFlip_=function(){var t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)},t.prototype.checkMaxDepth_=function(){var t=this.check_();return Math.pow(2,t)<=this.count()+1},t.prototype.check_=function(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");
441if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");var t=this.left.check_();if(t!==this.right.check_())throw new Error("Black depths differ");return t+(this.isRed_()?0:1)},t.RED=!0,t.BLACK=!1,t}(),Dt=function(){function t(){}return t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new Mt(t,e,null)},t.prototype.remove=function(t,e){return this},t.prototype.count=function(){return 0},t.prototype.isEmpty=function(){return!0},t.prototype.inorderTraversal=function(t){return!1},t.prototype.reverseTraversal=function(t){return!1},t.prototype.minKey=function(){return null},t.prototype.maxKey=function(){return null},t.prototype.check_=function(){return 0},t.prototype.isRed_=function(){return!1},t}(),Lt=function(){function t(e,n){void 0===n&&(n=t.EMPTY_NODE),this.comparator_=e,this.root_=n}return t.prototype.insert=function(e,n){return new t(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,Mt.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,Mt.BLACK,null,null))},t.prototype.get=function(t){for(var e,n=this.root_;!n.isEmpty();){if(0===(e=this.comparator_(t,n.key)))return n.value;e<0?n=n.left:e>0&&(n=n.right)}return null},t.prototype.getPredecessorKey=function(t){for(var e,n=this.root_,r=null;!n.isEmpty();){if(0===(e=this.comparator_(t,n.key))){if(n.left.isEmpty())return r?r.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}e<0?n=n.left:e>0&&(r=n,n=n.right)}throw new Error("Attempted to find predecessor key for a nonexistent key.  What gives?")},t.prototype.isEmpty=function(){return this.root_.isEmpty()},t.prototype.count=function(){return this.root_.count()},t.prototype.minKey=function(){return this.root_.minKey()},t.prototype.maxKey=function(){return this.root_.maxKey()},t.prototype.inorderTraversal=function(t){return this.root_.inorderTraversal(t)},t.prototype.reverseTraversal=function(t){return this.root_.reverseTraversal(t)},t.prototype.getIterator=function(t){return new Pt(this.root_,null,this.comparator_,!1,t)},t.prototype.getIteratorFrom=function(t,e){return new Pt(this.root_,t,this.comparator_,!1,e)},t.prototype.getReverseIteratorFrom=function(t,e){return new Pt(this.root_,t,this.comparator_,!0,e)},t.prototype.getReverseIterator=function(t){return new Pt(this.root_,null,this.comparator_,!0,t)},t.EMPTY_NODE=new Dt,t}(),jt=Math.log(2),Ut=function(){function t(t){var e;this.count=(e=t+1,parseInt(Math.log(e)/jt,10)),this.current_=this.count-1;var n,r=(n=this.count,parseInt(Array(n+1).join("1"),2));this.bits_=t+1&r}return t.prototype.nextBitIsOne=function(){var t=!(this.bits_&1<<this.current_);return this.current_--,t},t}(),Ft=function(t,e,n,r){t.sort(e);var i=function(e,r){var o,s,a=r-e;if(0===a)return null;if(1===a)return o=t[e],s=n?n(o):o,new Mt(s,o.node,Mt.BLACK,null,null);var c=parseInt(a/2,10)+e,u=i(e,c),l=i(c+1,r);return o=t[c],s=n?n(o):o,new Mt(s,o.node,Mt.BLACK,u,l)},o=function(e){for(var r=null,o=null,s=t.length,a=function(e,r){var o=s-e,a=s;s-=e;var u=i(o+1,a),l=t[o],h=n?n(l):l;c(new Mt(h,l.node,r,null,u))},c=function(t){r?(r.left=t,r=t):(o=t,r=t)},u=0;u<e.count;++u){var l=e.nextBitIsOne(),h=Math.pow(2,e.count-(u+1));l?a(h,Mt.BLACK):(a(h,Mt.BLACK),a(h,Mt.RED))}return o}(new Ut(t.length));return new Lt(r||e,o)},Ht={},Bt=function(){function t(t,e){this.indexes_=t,this.indexSet_=e}return Object.defineProperty(t,"Default",{get:function(){return s.assert(Ht&&Nt,"ChildrenNode.ts has not been loaded"),At=At||new t({".priority":Ht},{".priority":Nt})},enumerable:!1,configurable:!0}),t.prototype.get=function(t){var e=s.safeGet(this.indexes_,t);if(!e)throw new Error("No index defined for "+t);return e instanceof Lt?e:null},t.prototype.hasIndex=function(t){return s.contains(this.indexSet_,t.toString())},t.prototype.addIndex=function(e,n){s.assert(e!==Ct,"KeyIndex always exists and isn't meant to be added to the IndexMap.");for(var r,i=[],a=!1,c=n.getIterator(_t.Wrap),u=c.getNext();u;)a=a||e.isDefinedOn(u.node),i.push(u),u=c.getNext();r=a?Ft(i,e.getCompare()):Ht;var l=e.toString(),h=o.__assign({},this.indexSet_);h[l]=e;var p=o.__assign({},this.indexes_);return p[l]=r,new t(p,h)},t.prototype.addToIndexes=function(e,n){var r=this;return new t(s.map(this.indexes_,(function(t,i){var o=s.safeGet(r.indexSet_,i);if(s.assert(o,"Missing index implementation for "+i),t===Ht){if(o.isDefinedOn(e.node)){for(var a=[],c=n.getIterator(_t.Wrap),u=c.getNext();u;)u.name!==e.name&&a.push(u),u=c.getNext();return a.push(e),Ft(a,o.getCompare())}return Ht}var l=n.get(e.name),h=t;return l&&(h=h.remove(new _t(e.name,l))),h.insert(e,e.node)})),this.indexSet_)}
441,t.prototype.removeFromIndexes=function(e,n){return new t(s.map(this.indexes_,(function(t){if(t===Ht)return t;var r=n.get(e.name);return r?t.remove(new _t(e.name,r)):t})),this.indexSet_)},t}();
442/**
443 * @license
444 * Copyright 2017 Google LLC
445 *
446 * Licensed under the Apache License, Version 2.0 (the "License");
447 * you may not use this file except in compliance with the License.
448 * You may obtain a copy of the License at
449 *
450 *   http://www.apache.org/licenses/LICENSE-2.0
451 *
452 * Unless required by applicable law or agreed to in writing, software
453 * distributed under the License is distributed on an "AS IS" BASIS,
454 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
455 * See the License for the specific language governing permissions and
456 * limitations under the License.
457 */
458function qt(t,e){return N(t.name,e.name)}function Vt(t,e){return N(t,e)}
459/**
460 * @license
461 * Copyright 2017 Google LLC
462 *
463 * Licensed under the Apache License, Version 2.0 (the "License");
464 * you may not use this file except in compliance with the License.
465 * You may obtain a copy of the License at
466 *
467 *   http://www.apache.org/licenses/LICENSE-2.0
468 *
469 * Unless required by applicable law or agreed to in writing, software
470 * distributed under the License is distributed on an "AS IS" BASIS,
471 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
472 * See the License for the specific language governing permissions and
473 * limitations under the License.
474 */var Wt=function(){function t(t,e,n){this.children_=t,this.priorityNode_=e,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&kt(this.priorityNode_),this.children_.isEmpty()&&s.assert(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}return Object.defineProperty(t,"EMPTY_NODE",{get:function(){return Rt||(Rt=new t(new Lt(Vt),null,Bt.Default))},enumerable:!1,configurable:!0}),t.prototype.isLeafNode=function(){return!1},t.prototype.getPriority=function(){return this.priorityNode_||Rt},t.prototype.updatePriority=function(e){return this.children_.isEmpty()?this:new t(this.children_,e,this.indexMap_)},t.prototype.getImmediateChild=function(t){if(".priority"===t)return this.getPriority();var e=this.children_.get(t);return null===e?Rt:e},t.prototype.getChild=function(t){var e=t.getFront();return null===e?this:this.getImmediateChild(e).getChild(t.popFront())},t.prototype.hasChild=function(t){return null!==this.children_.get(t)},t.prototype.updateImmediateChild=function(e,n){if(s.assert(n,"We should always be passing snapshot nodes"),".priority"===e)return this.updatePriority(n);var r=new _t(e,n),i=void 0,o=void 0;n.isEmpty()?(i=this.children_.remove(e),o=this.indexMap_.removeFromIndexes(r,this.children_)):(i=this.children_.insert(e,n),o=this.indexMap_.addToIndexes(r,this.children_));var a=i.isEmpty()?Rt:this.priorityNode_;return new t(i,a,o)},t.prototype.updateChild=function(t,e){var n=t.getFront();if(null===n)return e;s.assert(".priority"!==t.getFront()||1===t.getLength(),".priority must be the last token in a path");var r=this.getImmediateChild(n).updateChild(t.popFront(),e);return this.updateImmediateChild(n,r)},t.prototype.isEmpty=function(){return this.children_.isEmpty()},t.prototype.numChildren=function(){return this.children_.count()},t.prototype.val=function(e){if(this.isEmpty())return null;var n={},r=0,i=0,o=!0;if(this.forEachChild(Nt,(function(s,a){n[s]=a.val(e),r++,o&&t.INTEGER_REGEXP_.test(s)?i=Math.max(i,Number(s)):o=!1})),!e&&o&&i<2*r){var s=[];for(var a in n)s[a]=n[a];return s}return e&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n},t.prototype.hash=function(){if(null===this.lazyHash_){var t="";this.getPriority().isEmpty()||(t+="priority:"+It(this.getPriority().val())+":"),this.forEachChild(Nt,(function(e,n){var r=n.hash();""!==r&&(t+=":"+e+":"+r)})),this.lazyHash_=""===t?"":b(t)}return this.lazyHash_},t.prototype.getPredecessorChildName=function(t,e,n){var r=this.resolveIndex_(n);if(r){var i=r.getPredecessorKey(new _t(t,e));return i?i.name:null}return this.children_.getPredecessorKey(t)},t.prototype.getFirstChildName=function(t){var e=this.resolveIndex_(t);if(e){var n=e.minKey();return n&&n.name}return this.children_.minKey()},t.prototype.getFirstChild=function(t){var e=this.getFirstChildName(t);return e?new _t(e,this.children_.get(e)):null},t.prototype.getLastChildName=function(t){var e=this.resolveIndex_(t);if(e){var n=e.maxKey();return n&&n.name}return this.children_.maxKey()},t.prototype.getLastChild=function(t){var e=this.getLastChildName(t);return e?new _t(e,this.children_.get(e)):null},t.prototype.forEachChild=function(t,e){var n=this.resolveIndex_(t);return n?n.inorderTraversal((function(t){return e(t.name,t.node)})):this.children_.inorderTraversal(e)},t.prototype.getIterator=function(t){return this.getIteratorFrom(t.minPost(),t)}
474,t.prototype.getIteratorFrom=function(t,e){var n=this.resolveIndex_(e);if(n)return n.getIteratorFrom(t,(function(t){return t}));for(var r=this.children_.getIteratorFrom(t.name,_t.Wrap),i=r.peek();null!=i&&e.compare(i,t)<0;)r.getNext(),i=r.peek();return r},t.prototype.getReverseIterator=function(t){return this.getReverseIteratorFrom(t.maxPost(),t)},t.prototype.getReverseIteratorFrom=function(t,e){var n=this.resolveIndex_(e);if(n)return n.getReverseIteratorFrom(t,(function(t){return t}));for(var r=this.children_.getReverseIteratorFrom(t.name,_t.Wrap),i=r.peek();null!=i&&e.compare(i,t)>0;)r.getNext(),i=r.peek();return r},t.prototype.compareTo=function(t){return this.isEmpty()?t.isEmpty()?0:-1:t.isLeafNode()||t.isEmpty()?1:t===zt?-1:0},t.prototype.withIndex=function(e){if(e===Ct||this.indexMap_.hasIndex(e))return this;var n=this.indexMap_.addIndex(e,this.children_);return new t(this.children_,this.priorityNode_,n)},t.prototype.isIndexed=function(t){return t===Ct||this.indexMap_.hasIndex(t)},t.prototype.equals=function(t){if(t===this)return!0;if(t.isLeafNode())return!1;var e=t;if(this.getPriority().equals(e.getPriority())){if(this.children_.count()===e.children_.count()){for(var n=this.getIterator(Nt),r=e.getIterator(Nt),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},t.prototype.resolveIndex_=function(t){return t===Ct?null:this.indexMap_.get(t.toString())},t.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,t}(),zt=new(function(t){function e(){return t.call(this,new Lt(Vt),Wt.EMPTY_NODE,Bt.Default)||this}return o.__extends(e,t),e.prototype.compareTo=function(t){return t===this?0:1},e.prototype.equals=function(t){return t===this},e.prototype.getPriority=function(){return this},e.prototype.getImmediateChild=function(t){return Wt.EMPTY_NODE},e.prototype.isEmpty=function(){return!1},e}(Wt));Object.defineProperties(_t,{MIN:{value:new _t(A,Wt.EMPTY_NODE)},MAX:{value:new _t(R,zt)}}),St.__EMPTY_NODE=Wt.EMPTY_NODE,Ot.__childrenNodeConstructor=Wt,J=zt,function(t){Tt=t}(zt);
475/**
476 * @license
477 * Copyright 2017 Google LLC
478 *
479 * Licensed under the Apache License, Version 2.0 (the "License");
480 * you may not use this file except in compliance with the License.
481 * You may obtain a copy of the License at
482 *
483 *   http://www.apache.org/licenses/LICENSE-2.0
484 *
485 * Unless required by applicable law or agreed to in writing, software
486 * distributed under the License is distributed on an "AS IS" BASIS,
487 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
488 * See the License for the specific language governing permissions and
489 * limitations under the License.
490 */
491var $t=!0;function Yt(t,e){if(void 0===e&&(e=null),null===t)return Wt.EMPTY_NODE;if("object"==typeof t&&".priority"in t&&(e=t[".priority"]),s.assert(null===e||"string"==typeof e||"number"==typeof e||"object"==typeof e&&".sv"in e,"Invalid priority type found: "+typeof e),"object"==typeof t&&".value"in t&&null!==t[".value"]&&(t=t[".value"]),"object"!=typeof t||".sv"in t)return new Ot(t,Yt(e));if(t instanceof Array||!$t){var n=Wt.EMPTY_NODE;return j(t,(function(e,r){if(s.contains(t,e)&&"."!==e.substring(0,1)){var i=Yt(r);!i.isLeafNode()&&i.isEmpty()||(n=n.updateImmediateChild(e,i))}})),n.updatePriority(Yt(e))}var r=[],i=!1;if(j(t,(function(t,e){if("."!==t.substring(0,1)){var n=Yt(e);n.isEmpty()||(i=i||!n.getPriority().isEmpty(),r.push(new _t(t,n)))}})),0===r.length)return Wt.EMPTY_NODE;var o=Ft(r,qt,(function(t){return t.name}),Vt);if(i){var a=Ft(r,Nt.getCompare());return new Wt(o,Yt(e),new Bt({".priority":a},{".priority":Nt}))}return new Wt(o,Yt(e),Bt.Default)}!function(t){xt=t}(Yt);
492/**
493 * @license
494 * Copyright 2017 Google LLC
495 *
496 * Licensed under the Apache License, Version 2.0 (the "License");
497 * you may not use this file except in compliance with the License.
498 * You may obtain a copy of the License at
499 *
500 *   http://www.apache.org/licenses/LICENSE-2.0
501 *
502 * Unless required by applicable law or agreed to in writing, software
503 * distributed under the License is distributed on an "AS IS" BASIS,
504 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
505 * See the License for the specific language governing permissions and
506 * limitations under the License.
507 */
508var Kt,Gt=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.compare=function(t,e){var n=t.node.compareTo(e.node);return 0===n?N(t.name,e.name):n},e.prototype.isDefinedOn=function(t){return!0},e.prototype.indexedValueChanged=function(t,e){return!t.equals(e)},e.prototype.minPost=function(){return _t.MIN},e.prototype.maxPost=function(){return _t.MAX},e.prototype.makePost=function(t,e){var n=Yt(t);return new _t(e,n)},e.prototype.toString=function(){return".value"},e}(wt)),Qt=function(t){function e(e){var n=t.call(this)||this;return n.indexPath_=e,s.assert(!e.isEmpty()&&".priority"!==e.getFront(),"Can't 
508create PathIndex with empty path or .priority key"),n}return o.__extends(e,t),e.prototype.extractChild=function(t){return t.getChild(this.indexPath_)},e.prototype.isDefinedOn=function(t){return!t.getChild(this.indexPath_).isEmpty()},e.prototype.compare=function(t,e){var n=this.extractChild(t.node),r=this.extractChild(e.node),i=n.compareTo(r);return 0===i?N(t.name,e.name):i},e.prototype.makePost=function(t,e){var n=Yt(t),r=Wt.EMPTY_NODE.updateChild(this.indexPath_,n);return new _t(e,r)},e.prototype.maxPost=function(){var t=Wt.EMPTY_NODE.updateChild(this.indexPath_,zt);return new _t(R,t)},e.prototype.toString=function(){return this.indexPath_.slice().join("/")},e}(wt),Xt=function(){function t(t,e,n){this.node_=t,this.ref_=e,this.index_=n}return t.prototype.val=function(){return s.validateArgCount("DataSnapshot.val",0,0,arguments.length),this.node_.val()},t.prototype.exportVal=function(){return s.validateArgCount("DataSnapshot.exportVal",0,0,arguments.length),this.node_.val(!0)},t.prototype.toJSON=function(){return s.validateArgCount("DataSnapshot.toJSON",0,1,arguments.length),this.exportVal()},t.prototype.exists=function(){return s.validateArgCount("DataSnapshot.exists",0,0,arguments.length),!this.node_.isEmpty()},t.prototype.child=function(e){s.validateArgCount("DataSnapshot.child",0,1,arguments.length),e=String(e),pt("DataSnapshot.child",1,e,!1);var n=new W(e),r=this.ref_.child(n);return new t(this.node_.getChild(n),r,Nt)},t.prototype.hasChild=function(t){s.validateArgCount("DataSnapshot.hasChild",1,1,arguments.length),pt("DataSnapshot.hasChild",1,t,!1);var e=new W(t);return!this.node_.getChild(e).isEmpty()},t.prototype.getPriority=function(){return s.validateArgCount("DataSnapshot.getPriority",0,0,arguments.length),this.node_.getPriority().val()},t.prototype.forEach=function(e){var n=this;if(s.validateArgCount("DataSnapshot.forEach",1,1,arguments.length),s.validateCallback("DataSnapshot.forEach",1,e,!1),this.node_.isLeafNode())return!1;var r=this.node_;return!!r.forEachChild(this.index_,(function(r,i){return e(new t(i,n.ref_.child(r),Nt))}))},t.prototype.hasChildren=function(){return s.validateArgCount("DataSnapshot.hasChildren",0,0,arguments.length),!this.node_.isLeafNode()&&!this.node_.isEmpty()},Object.defineProperty(t.prototype,"key",{get:function(){return this.ref_.getKey()},enumerable:!1,configurable:!0}),t.prototype.numChildren=function(){return s.validateArgCount("DataSnapshot.numChildren",0,0,arguments.length),this.node_.numChildren()},t.prototype.getRef=function(){return s.validateArgCount("DataSnapshot.ref",0,0,arguments.length),this.ref_},Object.defineProperty(t.prototype,"ref",{get:function(){return this.getRef()},enumerable:!1,configurable:!0}),t}(),Jt=function(){function t(t,e,n,r){this.eventType=t,this.eventRegistration=e,this.snapshot=n,this.prevName=r}return t.prototype.getPath=function(){var t=this.snapshot.getRef();return"value"===this.eventType?t.path:t.getParent().path},t.prototype.getEventType=function(){return this.eventType},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.getPath().toString()+":"+this.eventType+":"+s.stringify(this.snapshot.exportVal())},t}(),Zt=function(){function t(t,e,n){this.eventRegistration=t,this.error=e,this.path=n}return t.prototype.getPath=function(){return this.path},t.prototype.getEventType=function(){return"cancel"},t.prototype.getEventRunner=function(){return this.eventRegistration.getEventRunner(this)},t.prototype.toString=function(){return this.path.toString()+":cancel"},t}(),te=function(){function t(t,e,n){this.callback_=t,this.cancelCallback_=e,this.context_=n}return t.prototype.respondsTo=function(t){return"value"===t},t.prototype.createEvent=function(t,e){var n=e.getQueryParams().getIndex();return new Jt("value",this,new Xt(t.snapshotNode,e.getRef(),n))},t.prototype.getEventRunner=function(t){var e=this.context_;if("cancel"===t.getEventType()){s.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(e,t.error)}}var r=this.callback_;return function(){r.call(e,t.snapshot)}},t.prototype.createCancelEvent=function(t,e){return this.cancelCallback_?new Zt(this,t,e):null},t.prototype.matches=function(e){return e instanceof t&&(!e.callback_||!this.callback_||e.callback_===this.callback_&&e.context_===this.context_)},t.prototype.hasAnyCallback=function(){return null!==this.callback_},t}(),ee=function(){function t(t,e,n){this.callbacks_=t,this.cancelCallback_=e,this.context_=n}return t.prototype.respondsTo=function(t){var e="children_added"===t?"child_added":t;return e="children_removed"===e?"child_removed":e,s.contains(this.callbacks_,e)},t.prototype.createCancelEvent=function(t,e){return this.cancelCallback_?new Zt(this,t,e):null},t.prototype.createEvent=function(t,e){s.assert(null!=t.childName,"Child events should have a childName.");var n=e.getRef().child(t.childName),r=e.getQueryParams().getIndex();return new Jt(t.type,this,new Xt(t.snapshotNode,n,r),t.prevName)},t.prototype.getEventRunner=function(t){var e=this.context_;if("cancel"===t.getEventType()){s.assert(this.cancelCallback_,"Raising a cancel event on a listener with no cancel callback");var n=this.cancelCallback_;return function(){n.call(e,t.error)}}var r=this.callbacks_[t.eventType];return function(){r.call(e,t.snapshot,t.prevName)}},t.prototype.matches=function(e){var n=this;if(e instanceof t){if(!this.callbacks_||!e.callbacks_)return!0;
508if(this.context_===e.context_){var r=Object.keys(e.callbacks_),i=Object.keys(this.callbacks_),o=r.length;if(o===i.length){if(1===o){var s=r[0],a=i[0];return!(a!==s||e.callbacks_[s]&&this.callbacks_[a]&&e.callbacks_[s]!==this.callbacks_[a])}return i.every((function(t){return e.callbacks_[t]===n.callbacks_[t]}))}}}return!1},t.prototype.hasAnyCallback=function(){return null!==this.callbacks_},t}(),ne=function(){function t(t,e,n,r){this.repo=t,this.path=e,this.queryParams_=n,this.orderByCalled_=r}return Object.defineProperty(t,"__referenceConstructor",{get:function(){return s.assert(Kt,"Reference.ts has not been loaded"),Kt},set:function(t){Kt=t},enumerable:!1,configurable:!0}),t.validateQueryEndpoints_=function(t){var e=null,n=null;if(t.hasStart()&&(e=t.getIndexStartValue()),t.hasEnd()&&(n=t.getIndexEndValue()),t.getIndex()===Ct){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(t.hasStart()){if(t.getIndexStartName()!==A)throw new Error(r);if("string"!=typeof e)throw new Error(i)}if(t.hasEnd()){if(t.getIndexEndName()!==R)throw new Error(r);if("string"!=typeof n)throw new Error(i)}}else if(t.getIndex()===Nt){if(null!=e&&!ot(e)||null!=n&&!ot(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(t.getIndex()instanceof Qt||t.getIndex()===Gt,"unknown index type."),null!=e&&"object"==typeof e||null!=n&&"object"==typeof n)throw new Error("Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.")},t.validateLimit_=function(t){if(t.hasStart()&&t.hasEnd()&&t.hasLimit()&&!t.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), endAt(), and limit(). Use limitToFirst() or limitToLast() instead.")},t.prototype.validateNoPreviousOrderByCall_=function(t){if(!0===this.orderByCalled_)throw new Error(t+": You can't combine multiple orderBy calls.")},t.prototype.getQueryParams=function(){return this.queryParams_},t.prototype.getRef=function(){return s.validateArgCount("Query.ref",0,0,arguments.length),new t.__referenceConstructor(this.repo,this.path)},t.prototype.on=function(e,n,r,i){s.validateArgCount("Query.on",2,4,arguments.length),lt("Query.on",1,e,!1),s.validateCallback("Query.on",2,n,!1);var o=t.getCancelAndContextArgs_("Query.on",r,i);if("value"===e)this.onValueEvent(n,o.cancel,o.context);else{var a={};a[e]=n,this.onChildEvent(a,o.cancel,o.context)}return n},t.prototype.onValueEvent=function(t,e,n){var r=new te(t,e||null,n||null);this.repo.addEventCallbackForQuery(this,r)},t.prototype.onChildEvent=function(t,e,n){var r=new ee(t,e,n);this.repo.addEventCallbackForQuery(this,r)},t.prototype.off=function(t,e,n){s.validateArgCount("Query.off",0,3,arguments.length),lt("Query.off",1,t,!0),s.validateCallback("Query.off",2,e,!0),s.validateContextObject("Query.off",3,n,!0);var r=null,i=null;if("value"===t){var o=e||null;r=new te(o,null,n||null)}else t&&(e&&((i={})[t]=e),r=new ee(i,null,n||null));this.repo.removeEventCallbackForQuery(this,r)},t.prototype.once=function(e,n,r,i){var o=this;s.validateArgCount("Query.once",1,4,arguments.length),lt("Query.once",1,e,!1),s.validateCallback("Query.once",2,n,!0);var a=t.getCancelAndContextArgs_("Query.once",r,i),c=!0,u=new s.Deferred;u.promise.catch((function(){}));var l=function(t){c&&(c=!1,o.off(e,l),n&&n.bind(a.context)(t),u.resolve(t))};return this.on(e,l,(function(t){o.off(e,l),a.cancel&&a.cancel.bind(a.context)(t),u.reject(t)})),u.promise},t.prototype.limitToFirst=function(e){if(s.validateArgCount("Query.limitToFirst",1,1,arguments.length),"number"!=typeof e||Math.floor(e)!==e||e<=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 t(this.repo,this.path,this.queryParams_.limitToFirst(e),this.orderByCalled_)},t.prototype.limitToLast=function(e){if(s.validateArgCount("Query.limitToLast",1,1,arguments.length),"number"!=typeof e||Math.floor(e)!==e||e<=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 
508(by another call to limit, limitToFirst, or limitToLast).");return new t(this.repo,this.path,this.queryParams_.limitToLast(e),this.orderByCalled_)},t.prototype.orderByChild=function(e){if(s.validateArgCount("Query.orderByChild",1,1,arguments.length),"$key"===e)throw new Error('Query.orderByChild: "$key" is invalid.  Use Query.orderByKey() instead.');if("$priority"===e)throw new Error('Query.orderByChild: "$priority" is invalid.  Use Query.orderByPriority() instead.');if("$value"===e)throw new Error('Query.orderByChild: "$value" is invalid.  Use Query.orderByValue() instead.');pt("Query.orderByChild",1,e,!1),this.validateNoPreviousOrderByCall_("Query.orderByChild");var n=new W(e);if(n.isEmpty())throw new Error("Query.orderByChild: cannot pass in empty path.  Use Query.orderByValue() instead.");var r=new Qt(n),i=this.queryParams_.orderBy(r);return t.validateQueryEndpoints_(i),new t(this.repo,this.path,i,!0)},t.prototype.orderByKey=function(){s.validateArgCount("Query.orderByKey",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByKey");var e=this.queryParams_.orderBy(Ct);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.orderByPriority=function(){s.validateArgCount("Query.orderByPriority",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByPriority");var e=this.queryParams_.orderBy(Nt);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.orderByValue=function(){s.validateArgCount("Query.orderByValue",0,0,arguments.length),this.validateNoPreviousOrderByCall_("Query.orderByValue");var e=this.queryParams_.orderBy(Gt);return t.validateQueryEndpoints_(e),new t(this.repo,this.path,e,!0)},t.prototype.startAt=function(e,n){void 0===e&&(e=null),s.validateArgCount("Query.startAt",0,2,arguments.length),st("Query.startAt",1,e,this.path,!0),ht("Query.startAt",2,n,!0);var r=this.queryParams_.startAt(e,n);if(t.validateLimit_(r),t.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===e&&(e=null,n=null),new t(this.repo,this.path,r,this.orderByCalled_)},t.prototype.endAt=function(e,n){void 0===e&&(e=null),s.validateArgCount("Query.endAt",0,2,arguments.length),st("Query.endAt",1,e,this.path,!0),ht("Query.endAt",2,n,!0);var r=this.queryParams_.endAt(e,n);if(t.validateLimit_(r),t.validateQueryEndpoints_(r),this.queryParams_.hasEnd())throw new Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new t(this.repo,this.path,r,this.orderByCalled_)},t.prototype.equalTo=function(t,e){if(s.validateArgCount("Query.equalTo",1,2,arguments.length),st("Query.equalTo",1,t,this.path,!1),ht("Query.equalTo",2,e,!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(t,e).endAt(t,e)},t.prototype.toString=function(){return s.validateArgCount("Query.toString",0,0,arguments.length),this.repo.toString()+this.path.toUrlEncodedString()},t.prototype.toJSON=function(){return s.validateArgCount("Query.toJSON",0,1,arguments.length),this.toString()},t.prototype.queryObject=function(){return this.queryParams_.getQueryObject()},t.prototype.queryIdentifier=function(){var t=this.queryObject(),e=D(t);return"{}"===e?"default":e},t.prototype.isEqual=function(e){if(s.validateArgCount("Query.isEqual",1,1,arguments.length),!(e instanceof t)){var n="Query.isEqual failed: First argument must be an instance of firebase.database.Query.";throw new Error(n)}
508var r=this.repo===e.repo,i=this.path.equals(e.path),o=this.queryIdentifier()===e.queryIdentifier();return r&&i&&o},t.getCancelAndContextArgs_=function(t,e,n){var r={cancel:null,context:null};if(e&&n)r.cancel=e,s.validateCallback(t,3,r.cancel,!0),r.context=n,s.validateContextObject(t,4,r.context,!0);else if(e)if("object"==typeof e&&null!==e)r.context=e;else{if("function"!=typeof e)throw new Error(s.errorPrefix(t,3,!0)+" must either be a cancel callback or a context object.");r.cancel=e}return r},Object.defineProperty(t.prototype,"ref",{get:function(){return this.getRef()},enumerable:!1,configurable:!0}),t}(),re=function(){function t(t){this.node_=t}return t.prototype.getImmediateChild=function(e){return new t(this.node_.getImmediateChild(e))},t.prototype.node=function(){return this.node_},t}(),ie=function(){function t(t,e){this.syncTree_=t,this.path_=e}return t.prototype.getImmediateChild=function(e){var n=this.path_.child(e);return new t(this.syncTree_,n)},t.prototype.node=function(){return this.syncTree_.calcCompleteEventCache(this.path_)},t}(),oe=function(t,e,n){return t&&"object"==typeof t?(s.assert(".sv"in t,"Unexpected leaf node or priority contents"),"string"==typeof t[".sv"]?se(t[".sv"],e,n):"object"==typeof t[".sv"]?ae(t[".sv"],e):void s.assert(!1,"Unexpected server value: "+JSON.stringify(t,null,2))):t},se=function(t,e,n){switch(t){case"timestamp":return n.timestamp;default:s.assert(!1,"Unexpected server value: "+t)}},ae=function(t,e,n){t.hasOwnProperty("increment")||s.assert(!1,"Unexpected server value: "+JSON.stringify(t,null,2));var r=t.increment;"number"!=typeof r&&s.assert(!1,"Unexpected increment value: "+r);var i=e.node();if(s.assert(null!=i,"Expected ChildrenNode.EMPTY_NODE for nulls"),!i.isLeafNode())return r;var o=i.getValue();return"number"!=typeof o?r:o+r},ce=function(t,e,n,r){return le(e,new ie(n,t),r)},ue=function(t,e,n){return le(t,new re(e),n)};function le(t,e,n){var r,i=t.getPriority().val(),o=oe(i,e.getImmediateChild(".priority"),n);if(t.isLeafNode()){var s=t,a=oe(s.getValue(),e,n);return a!==s.getValue()||o!==s.getPriority().val()?new Ot(a,Yt(o)):t}var c=t;return r=c,o!==c.getPriority().val()&&(r=r.updatePriority(new Ot(o))),c.forEachChild(Nt,(function(t,i){var o=le(i,e.getImmediateChild(t),n);o!==i&&(r=r.updateImmediateChild(t,o))})),r}
509/**
510 * @license
511 * Copyright 2017 Google LLC
512 *
513 * Licensed under the Apache License, Version 2.0 (the "License");
514 * you may not use this file except in compliance with the License.
515 * You may obtain a copy of the License at
516 *
517 *   http://www.apache.org/licenses/LICENSE-2.0
518 *
519 * Unless required by applicable law or agreed to in writing, software
520 * distributed under the License is distributed on an "AS IS" BASIS,
521 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
522 * See the License for the specific language governing permissions and
523 * limitations under the License.
524 */var he,pe=function(){function t(){this.value=null,this.children=new Map}return t.prototype.find=function(t){if(null!=this.value)return this.value.getChild(t);if(!t.isEmpty()&&this.children.size>0){var e=t.getFront();return t=t.popFront(),this.children.has(e)?this.children.get(e).find(t):null}return null},t.prototype.remember=function(e,n){if(e.isEmpty())this.value=n,this.children.clear();else if(null!==this.value)this.value=this.value.updateChild(e,n);else{var r=e.getFront();this.children.has(r)||this.children.set(r,new t);var i=this.children.get(r);e=e.popFront(),i.remember(e,n)}},t.prototype.forget=function(t){if(t.isEmpty())return this.value=null,this.children.clear(),!0;if(null!==this.value){if(this.value.isLeafNode())return!1;var e=this.value;this.value=null;var n=this;return e.forEachChild(Nt,(function(t,e){n.remember(new W(t),e)})),this.forget(t)}if(this.children.size>0){var r=t.getFront();if(t=t.popFront(),this.children.has(r))this.children.get(r).forget(t)&&this.children.delete(r);return 0===this.children.size}return!0},t.prototype.forEachTree=function(t,e){null!==this.value?e(t,this.value):this.forEachChild((function(n,r){var i=new W(t.toString()+"/"+n);r.forEachTree(i,e)}))}
524,t.prototype.forEachChild=function(t){this.children.forEach((function(e,n){t(n,e)}))},t}();
525/**
526 * @license
527 * Copyright 2017 Google LLC
528 *
529 * Licensed under the Apache License, Version 2.0 (the "License");
530 * you may not use this file except in compliance with the License.
531 * You may obtain a copy of the License at
532 *
533 *   http://www.apache.org/licenses/LICENSE-2.0
534 *
535 * Unless required by applicable law or agreed to in writing, software
536 * distributed under the License is distributed on an "AS IS" BASIS,
537 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
538 * See the License for the specific language governing permissions and
539 * limitations under the License.
540 */!function(t){t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"}(he||(he={}));var de,fe,ve=function(){function t(t,e,n,r){this.fromUser=t,this.fromServer=e,this.queryId=n,this.tagged=r,s.assert(!r||e,"Tagged queries must be from server.")}return t.User=new t(!0,!1,null,!1),t.Server=new t(!1,!0,null,!1),t.forServerTaggedQuery=function(e){return new t(!1,!0,e,!0)},t}(),ge=function(){function t(t,e,n){this.path=t,this.affectedTree=e,this.revert=n,this.type=he.ACK_USER_WRITE,this.source=ve.User}return t.prototype.operationForChild=function(e){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 W(e));return new t(W.Empty,n,this.revert)}return s.assert(this.path.getFront()===e,"operationForChild called for unrelated child."),new t(this.path.popFront(),this.affectedTree,this.revert)},t}(),me=function(){return de||(de=new Lt(P)),de},ye=function(){function t(t,e){void 0===e&&(e=me()),this.value=t,this.children=e}return t.fromObject=function(e){var n=t.Empty;return j(e,(function(t,e){n=n.set(new W(t),e)})),n},t.prototype.isEmpty=function(){return null===this.value&&this.children.isEmpty()},t.prototype.findRootMostMatchingPathAndValue=function(t,e){if(null!=this.value&&e(this.value))return{path:W.Empty,value:this.value};if(t.isEmpty())return null;var n=t.getFront(),r=this.children.get(n);if(null!==r){var i=r.findRootMostMatchingPathAndValue(t.popFront(),e);return null!=i?{path:new W(n).child(i.path),value:i.value}:null}return null},t.prototype.findRootMostValueAndPath=function(t){return this.findRootMostMatchingPathAndValue(t,(function(){return!0}))},t.prototype.subtree=function(e){if(e.isEmpty())return this;var n=e.getFront(),r=this.children.get(n);return null!==r?r.subtree(e.popFront()):t.Empty},t.prototype.set=function(e,n){if(e.isEmpty())return new t(n,this.children);var r=e.getFront(),i=(this.children.get(r)||t.Empty).set(e.popFront(),n),o=this.children.insert(r,i);return new t(this.value,o)},t.prototype.remove=function(e){if(e.isEmpty())return this.children.isEmpty()?t.Empty:new t(null,this.children);var n=e.getFront(),r=this.children.get(n);if(r){var i=r.remove(e.popFront()),o=void 0;return o=i.isEmpty()?this.children.remove(n):this.children.insert(n,i),null===this.value&&o.isEmpty()?t.Empty:new t(this.value,o)}return this},t.prototype.get=function(t){if(t.isEmpty())return this.value;var e=t.getFront(),n=this.children.get(e);return n?n.get(t.popFront()):null},t.prototype.setTree=function(e,n){if(e.isEmpty())return n;var r=e.getFront(),i=(this.children.get(r)||t.Empty).setTree(e.popFront(),n),o=void 0;return o=i.isEmpty()?this.children.remove(r):this.children.insert(r,i),new t(this.value,o)},t.prototype.fold=function(t){return this.fold_(W.Empty,t)},t.prototype.fold_=function(t,e){var n={};return this.children.inorderTraversal((function(r,i){n[r]=i.fold_(t.child(r),e)})),e(t,this.value,n)},t.prototype.findOnPath=function(t,e){return this.findOnPath_(t,W.Empty,e)},t.prototype.findOnPath_=function(t,e,n){var r=!!this.value&&n(e,this.value);if(r)return r;if(t.isEmpty())return null;var i=t.getFront(),o=this.children.get(i);return o?o.findOnPath_(t.popFront(),e.child(i),n):null},t.prototype.foreachOnPath=function(t,e){return this.foreachOnPath_(t,W.Empty,e)},t.prototype.foreachOnPath_=function(e,n,r){if(e.isEmpty())return this;this.value&&r(n,this.value);var i=e.getFront(),o=this.children.get(i);return o?o.foreachOnPath_(e.popFront(),n.child(i),r):t.Empty},t.prototype.foreach=function(t){this.foreach_(W.Empty,t)},t.prototype.foreach_=function(t,e){this.children.inorderTraversal((function(n,r){r.foreach_(t.child(n),e)})),this.value&&e(t,this.value)},t.prototype.foreachChild=function(t){this.children.inorderTraversal((function(e,n){
540n.value&&t(e,n.value)}))},t.Empty=new t(null),t}(),be=function(){function t(t,e){this.source=t,this.path=e,this.type=he.LISTEN_COMPLETE}return t.prototype.operationForChild=function(e){return this.path.isEmpty()?new t(this.source,W.Empty):new t(this.source,this.path.popFront())},t}(),_e=function(){function t(t,e,n){this.source=t,this.path=e,this.snap=n,this.type=he.OVERWRITE}return t.prototype.operationForChild=function(e){return this.path.isEmpty()?new t(this.source,W.Empty,this.snap.getImmediateChild(e)):new t(this.source,this.path.popFront(),this.snap)},t}(),we=function(){function t(t,e,n){this.source=t,this.path=e,this.children=n,this.type=he.MERGE}return t.prototype.operationForChild=function(e){if(this.path.isEmpty()){var n=this.children.subtree(new W(e));return n.isEmpty()?null:n.value?new _e(this.source,W.Empty,n.value):new t(this.source,W.Empty,n)}return s.assert(this.path.getFront()===e,"Can't get a merge for a child not on the path of the operation"),new t(this.source,this.path.popFront(),this.children)},t.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"},t}(),Se=function(){function t(t,e,n){this.node_=t,this.fullyInitialized_=e,this.filtered_=n}return t.prototype.isFullyInitialized=function(){return this.fullyInitialized_},t.prototype.isFiltered=function(){return this.filtered_},t.prototype.isCompleteForPath=function(t){if(t.isEmpty())return this.isFullyInitialized()&&!this.filtered_;var e=t.getFront();return this.isCompleteForChild(e)},t.prototype.isCompleteForChild=function(t){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(t)},t.prototype.getNode=function(){return this.node_},t}(),Ce=function(){function t(t,e){this.eventCache_=t,this.serverCache_=e}return t.prototype.updateEventSnap=function(e,n,r){return new t(new Se(e,n,r),this.serverCache_)},t.prototype.updateServerSnap=function(e,n,r){return new t(this.eventCache_,new Se(e,n,r))},t.prototype.getEventCache=function(){return this.eventCache_},t.prototype.getCompleteEventSnap=function(){return this.eventCache_.isFullyInitialized()?this.eventCache_.getNode():null},t.prototype.getServerCache=function(){return this.serverCache_},t.prototype.getCompleteServerSnap=function(){return this.serverCache_.isFullyInitialized()?this.serverCache_.getNode():null},t.Empty=new t(new Se(Wt.EMPTY_NODE,!1,!1),new Se(Wt.EMPTY_NODE,!1,!1)),t}(),Ee=function(){function t(t,e,n,r,i){this.type=t,this.snapshotNode=e,this.childName=n,this.oldSnap=r,this.prevName=i}return t.valueChange=function(e){return new t(t.VALUE,e)},t.childAddedChange=function(e,n){return new t(t.CHILD_ADDED,n,e)},t.childRemovedChange=function(e,n){return new t(t.CHILD_REMOVED,n,e)},t.childChangedChange=function(e,n,r){return new t(t.CHILD_CHANGED,n,e,r)},t.childMovedChange=function(e,n){return new t(t.CHILD_MOVED,n,e)},t.CHILD_ADDED="child_added",t.CHILD_REMOVED="child_removed",t.CHILD_CHANGED="child_changed",t.CHILD_MOVED="child_moved",t.VALUE="value",t}(),xe=function(){function t(t){this.index_=t}return t.prototype.updateChild=function(t,e,n,r,i,o){s.assert(t.isIndexed(this.index_),"A node must be indexed if only a child is updated");var a=t.getImmediateChild(e);return a.getChild(r).equals(n.getChild(r))&&a.isEmpty()===n.isEmpty()?t:(null!=o&&(n.isEmpty()?t.hasChild(e)?o.trackChildChange(Ee.childRemovedChange(e,a)):s.assert(t.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?o.trackChildChange(Ee.childAddedChange(e,n)):o.trackChildChange(Ee.childChangedChange(e,n,a))),t.isLeafNode()&&n.isEmpty()?t:t.updateImmediateChild(e,n).withIndex(this.index_))},t.prototype.updateFullNode=function(t,e,n){return null!=n&&(t.isLeafNode()||t.forEachChild(Nt,(function(t,r){e.hasChild(t)||n.trackChildChange(Ee.childRemovedChange(t,r))})),e.isLeafNode()||e.forEachChild(Nt,(function(e,r){if(t.hasChild(e)){var i=t.getImmediateChild(e);i.equals(r)||n.trackChildChange(Ee.childChangedChange(e,r,i))}else n.trackChildChange(Ee.childAddedChange(e,r))}))),e.withIndex(this.index_)},t.prototype.updatePriority=function(t,e){return t.isEmpty()?Wt.EMPTY_NODE:t.updatePriority(e)},t.prototype.filtersNodes=function(){return!1},t.prototype.getIndexedFilter=function(){return this},t.prototype.getIndex=function(){return this.index_},t}(),Te=function(){function t(){this.changeMap=new Map}return t.prototype.trackChildChange=function(t){var e=t.type,n=t.childName;s.assert(e===Ee.CHILD_ADDED||e===Ee.CHILD_CHANGED||e===Ee.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(e===Ee.CHILD_ADDED&&i===Ee.CHILD_REMOVED)this.changeMap.set(n,Ee.childChangedChange(n,t.snapshotNode,r.snapshotNode));else if(e===Ee.CHILD_REMOVED&&i===Ee.CHILD_ADDED)this.changeMap.delete(n);else if(e===Ee.CHILD_REMOVED&&i===Ee.CHILD_CHANGED)this.changeMap.set(n,Ee.childRemovedChange(n,r.oldSnap));else if(e===Ee.CHILD_CHANGED&&i===Ee.CHILD_ADDED)this.changeMap.set(n,Ee.childAddedChange(n,t.snapshotNode));else{if(e!==Ee.CHILD_CHANGED||i!==Ee.CHILD_CHANGED)throw s.assertionError("Illegal combination of changes: "+t+" occurred after "+r);this.changeMap.set(n,Ee.childChangedChange(n,t.snapshotNode,r.oldSnap))}}else this.changeMap.set(n,t)},t.prototype.getChanges=function(){return Array.from(this.changeMap.values())},t}(),Ie=new(function(){function t(){}return t.prototype.getCompleteChild=function(t){return null},t.prototype.getChildAfterChild=function(t,e,n){return null},t}()),ke=function(){function t(t,e,n){void 0===n&&(n=null),this.writes_=t,this.viewCache_=e,this.optCompleteServerCache_=n}return t.prototype.getCompleteChild=function(t){var e=this.viewCache_.getEventCache();if(e.isCompleteForChild(t))return e.getNode().getImmediateChild(t);var n=null!=this.optCompleteServerCache_?new Se(this.optCompleteServerCache_,!0,!1):this.viewCache_.getServerCache();return this.writes_.calcCompleteChild(t,n)},t.prototype.getChildAfterChild=function(t,e,n){var r=null!=this.optCompleteServerCache_?this.optCompleteServerCache_:this.viewCache_.getCompleteServerSnap(),i=this.writes_.calcIndexedSlice(r,e,1,n,t);return 0===i.length?null:i[0]},t}(),Oe=function(t,e){this.viewCache=t,this.changes=e},Ae=function(){function t(t){this.filter_=t}return t.prototype.assertIndexed=function(t){s.assert(t.getEventCache().getNode().isIndexed(this.filter_.getIndex()),"Event snap not indexed"),s.assert(t.getServerCache().getNode().isIndexed(this.filter_.getIndex()),"Server snap not indexed")},t.prototype.applyOperation=function(e,n,r,i){var o,a,c=new Te;if(n.type===he.OVERWRITE){var u=n;u.source.fromUser?o=this.applyUserOverwrite_(e,u.path,u.snap,r,i,c):(s.assert(u.source.fromServer,"Unknown source."),a=u.source.tagged||e.getServerCache().isFiltered()&&!u.path.isEmpty(),o=this.applyServerOverwrite_(e,u.path,u.snap,r,i,a,c))}else if(n.type===he.MERGE){var l=n;l.source.fromUser?o=this.applyUserMerge_(e,l.path,l.children,r,i,c):(s.assert(l.source.fromServer,"Unknown source."),a=l.source.tagged||e.getServerCache().isFiltered(),o=this.applyServerMerge_(e,l.path,l.children,r,i,a,c))}else if(n.type===he.ACK_USER_WRITE){var h=n;o=h.revert?this.revertUserWrite_(e,h.path,r,i,c):this.ackUserWrite_(e,h.path,h.affectedTree,r,i,c)}else{if(n.type!==he.LISTEN_COMPLETE)throw s.assertionError("Unknown operation type: "+n.type);o=this.listenComplete_(e,n.path,r,c)}var p=c.getChanges();return t.maybeAddValueEvent_(e,o,p),new Oe(o,p)},t.maybeAddValueEvent_=function(t,e,n){var r=e.getEventCache();if(r.isFullyInitialized()){var i=r.getNode().isLeafNode()||r.getNode().isEmpty(),o=t.getCompleteEventSnap();(n.length>
5400||!t.getEventCache().isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(Ee.valueChange(e.getCompleteEventSnap()))}},t.prototype.generateEventCacheAfterServerEvent_=function(t,e,n,r,i){var o=t.getEventCache();if(null!=n.shadowingWrite(e))return t;var a=void 0,c=void 0;if(e.isEmpty())if(s.assert(t.getServerCache().isFullyInitialized(),"If change path is empty, we must have complete server data"),t.getServerCache().isFiltered()){var u=t.getCompleteServerSnap(),l=u instanceof Wt?u:Wt.EMPTY_NODE,h=n.calcCompleteEventChildren(l);a=this.filter_.updateFullNode(t.getEventCache().getNode(),h,i)}else{var p=n.calcCompleteEventCache(t.getCompleteServerSnap());a=this.filter_.updateFullNode(t.getEventCache().getNode(),p,i)}else{var d=e.getFront();if(".priority"===d){s.assert(1===e.getLength(),"Can't have a priority with additional path components");var f=o.getNode();c=t.getServerCache().getNode();var v=n.calcEventCacheAfterServerOverwrite(e,f,c);a=null!=v?this.filter_.updatePriority(f,v):o.getNode()}else{var g=e.popFront(),m=void 0;if(o.isCompleteForChild(d)){c=t.getServerCache().getNode();var y=n.calcEventCacheAfterServerOverwrite(e,o.getNode(),c);m=null!=y?o.getNode().getImmediateChild(d).updateChild(g,y):o.getNode().getImmediateChild(d)}else m=n.calcCompleteChild(d,t.getServerCache());a=null!=m?this.filter_.updateChild(o.getNode(),d,m,g,r,i):o.getNode()}}return t.updateEventSnap(a,o.isFullyInitialized()||e.isEmpty(),this.filter_.filtersNodes())},t.prototype.applyServerOverwrite_=function(t,e,n,r,i,o,s){var a,c=t.getServerCache(),u=o?this.filter_:this.filter_.getIndexedFilter();if(e.isEmpty())a=u.updateFullNode(c.getNode(),n,null);else if(u.filtersNodes()&&!c.isFiltered()){var l=c.getNode().updateChild(e,n);a=u.updateFullNode(c.getNode(),l,null)}else{var h=e.getFront();if(!c.isCompleteForPath(e)&&e.getLength()>1)return t;var p=e.popFront(),d=c.getNode().getImmediateChild(h).updateChild(p,n);a=".priority"===h?u.updatePriority(c.getNode(),d):u.updateChild(c.getNode(),h,d,p,Ie,null)}var f=t.updateServerSnap(a,c.isFullyInitialized()||e.isEmpty(),u.filtersNodes()),v=new ke(r,f,i);return this.generateEventCacheAfterServerEvent_(f,e,r,v,s)},t.prototype.applyUserOverwrite_=function(t,e,n,r,i,o){var s,a,c=t.getEventCache(),u=new ke(r,t,i);if(e.isEmpty())a=this.filter_.updateFullNode(t.getEventCache().getNode(),n,o),s=t.updateEventSnap(a,!0,this.filter_.filtersNodes());else{var l=e.getFront();if(".priority"===l)a=this.filter_.updatePriority(t.getEventCache().getNode(),n),s=t.updateEventSnap(a,c.isFullyInitialized(),c.isFiltered());else{var h=e.popFront(),p=c.getNode().getImmediateChild(l),d=void 0;if(h.isEmpty())d=n;else{var f=u.getCompleteChild(l);d=null!=f?".priority"===h.getBack()&&f.getChild(h.parent()).isEmpty()?f:f.updateChild(h,n):Wt.EMPTY_NODE}if(p.equals(d))s=t;else{var v=this.filter_.updateChild(c.getNode(),l,d,h,u,o);s=t.updateEventSnap(v,c.isFullyInitialized(),this.filter_.filtersNodes())}}}return s},t.cacheHasChild_=function(t,e){return t.getEventCache().isCompleteForChild(e)},t.prototype.applyUserMerge_=function(e,n,r,i,o,s){var a=this,c=e;return r.foreach((function(r,u){var l=n.child(r);t.cacheHasChild_(e,l.getFront())&&(c=a.applyUserOverwrite_(c,l,u,i,o,s))})),r.foreach((function(r,u){var l=n.child(r);t.cacheHasChild_(e,l.getFront())||(c=a.applyUserOverwrite_(c,l,u,i,o,s))})),c},t.prototype.applyMerge_=function(t,e){return e.foreach((function(e,n){t=t.updateChild(e,n)})),t},t.prototype.applyServerMerge_=function(t,e,n,r,i,o,s){var a=this;if(t.getServerCache().getNode().isEmpty()&&!t.getServerCache().isFullyInitialized())return t;var c,u=t;c=e.isEmpty()?n:ye.Empty.setTree(e,n);var l=t.getServerCache().getNode();return c.children.inorderTraversal((function(e,n){if(l.hasChild(e)){var c=t.getServerCache().getNode().getImmediateChild(e),h=a.applyMerge_(c,n);u=a.applyServerOverwrite_(u,new W(e),h,r,i,o,s)}})),c.children.inorderTraversal((function(e,n){var c=!t.getServerCache().isCompleteForChild(e)&&null==n.value;if(!l.hasChild(e)&&!c){var h=t.getServerCache().getNode().getImmediateChild(e),p=a.applyMerge_(h,n);u=a.applyServerOverwrite_(u,new W(e),p,r,i,o,s)}})),u},t.prototype.ackUserWrite_=function(t,e,n,r,i,o){if(null!=r.shadowingWrite(e))return t;var s=t.getServerCache().isFiltered(),a=t.getServerCache();if(null!=n.value){if(e.isEmpty()&&a.isFullyInitialized()||a.isCompleteForPath(e))return this.applyServerOverwrite_(t,e,a.getNode().getChild(e),r,i,s,o);if(e.isEmpty()){var c=ye.Empty;
540return a.getNode().forEachChild(Ct,(function(t,e){c=c.set(new W(t),e)})),this.applyServerMerge_(t,e,c,r,i,s,o)}return t}var u=ye.Empty;return n.foreach((function(t,n){var r=e.child(t);a.isCompleteForPath(r)&&(u=u.set(t,a.getNode().getChild(r)))})),this.applyServerMerge_(t,e,u,r,i,s,o)},t.prototype.listenComplete_=function(t,e,n,r){var i=t.getServerCache(),o=t.updateServerSnap(i.getNode(),i.isFullyInitialized()||e.isEmpty(),i.isFiltered());return this.generateEventCacheAfterServerEvent_(o,e,n,Ie,r)},t.prototype.revertUserWrite_=function(t,e,n,r,i){var o;if(null!=n.shadowingWrite(e))return t;var a=new ke(n,t,r),c=t.getEventCache().getNode(),u=void 0;if(e.isEmpty()||".priority"===e.getFront()){var l=void 0;if(t.getServerCache().isFullyInitialized())l=n.calcCompleteEventCache(t.getCompleteServerSnap());else{var h=t.getServerCache().getNode();s.assert(h instanceof Wt,"serverChildren would be complete if leaf node"),l=n.calcCompleteEventChildren(h)}l=l,u=this.filter_.updateFullNode(c,l,i)}else{var p=e.getFront(),d=n.calcCompleteChild(p,t.getServerCache());null==d&&t.getServerCache().isCompleteForChild(p)&&(d=c.getImmediateChild(p)),(u=null!=d?this.filter_.updateChild(c,p,d,e.popFront(),a,i):t.getEventCache().getNode().hasChild(p)?this.filter_.updateChild(c,p,Wt.EMPTY_NODE,e.popFront(),a,i):c).isEmpty()&&t.getServerCache().isFullyInitialized()&&(o=n.calcCompleteEventCache(t.getCompleteServerSnap())).isLeafNode()&&(u=this.filter_.updateFullNode(u,o,i))}return o=t.getServerCache().isFullyInitialized()||null!=n.shadowingWrite(W.Empty),t.updateEventSnap(u,o,this.filter_.filtersNodes())},t}(),Re=function(){function t(t){this.query_=t,this.index_=this.query_.getQueryParams().getIndex()}return t.prototype.generateEventsForChanges=function(t,e,n){var r=this,i=[],o=[];return t.forEach((function(t){t.type===Ee.CHILD_CHANGED&&r.index_.indexedValueChanged(t.oldSnap,t.snapshotNode)&&o.push(Ee.childMovedChange(t.childName,t.snapshotNode))})),this.generateEventsForType_(i,Ee.CHILD_REMOVED,t,n,e),this.generateEventsForType_(i,Ee.CHILD_ADDED,t,n,e),this.generateEventsForType_(i,Ee.CHILD_MOVED,o,n,e),this.generateEventsForType_(i,Ee.CHILD_CHANGED,t,n,e),this.generateEventsForType_(i,Ee.VALUE,t,n,e),i},t.prototype.generateEventsForType_=function(t,e,n,r,i){var o=this,s=n.filter((function(t){return t.type===e}));s.sort(this.compareChanges_.bind(this)),s.forEach((function(e){var n=o.materializeSingleChange_(e,i);r.forEach((function(r){r.respondsTo(e.type)&&t.push(r.createEvent(n,o.query_))}))}))},t.prototype.materializeSingleChange_=function(t,e){return"value"===t.type||"child_removed"===t.type?t:(t.prevName=e.getPredecessorChildName(t.childName,t.snapshotNode,this.index_),t)},t.prototype.compareChanges_=function(t,e){if(null==t.childName||null==e.childName)throw s.assertionError("Should only compare child_ events.");var n=new _t(t.childName,t.snapshotNode),r=new _t(e.childName,e.snapshotNode);return this.index_.compare(n,r)},t}(),Ne=function(){function t(t,e){this.query_=t,this.eventRegistrations_=[];var n=this.query_.getQueryParams(),r=new xe(n.getIndex()),i=n.getNodeFilter();this.processor_=new Ae(i);var o=e.getServerCache(),s=e.getEventCache(),a=r.updateFullNode(Wt.EMPTY_NODE,o.getNode(),null),c=i.updateFullNode(Wt.EMPTY_NODE,s.getNode(),null),u=new Se(a,o.isFullyInitialized(),r.filtersNodes()),l=new Se(c,s.isFullyInitialized(),i.filtersNodes());this.viewCache_=new Ce(l,u),this.eventGenerator_=new Re(this.query_)}return t.prototype.getQuery=function(){return this.query_},t.prototype.getServerCache=function(){return this.viewCache_.getServerCache().getNode()},t.prototype.getCompleteServerCache=function(t){var e=this.viewCache_.getCompleteServerSnap();return e&&(this.query_.getQueryParams().loadsAllData()||!t.isEmpty()&&!e.getImmediateChild(t.getFront()).isEmpty())?e.getChild(t):null},t.prototype.isEmpty=function(){return 0===this.eventRegistrations_.length},t.prototype.addEventRegistration=function(t){this.eventRegistrations_.push(t)},t.prototype.removeEventRegistration=function(t,e){var n=[];if(e){s.assert(null==t,"A cancel should cancel all event registrations.");var r=this.query_.path;this.eventRegistrations_.forEach((function(t){e=e;var i=t.createCancelEvent(e,r);i&&n.push(i)}))}if(t){for(var i=[],o=0;o<this.eventRegistrations_.length;++o){var a=this.eventRegistrations_[o];if(a.matches(t)){if(t.hasAnyCallback()){i=i.concat(this.eventRegistrations_.slice(o+1));break}}else i.push(a)}this.eventRegistrations_=i}else this.eventRegistrations_=[];return n},t.prototype.applyOperation=function(t,e,n){t.type===he.MERGE&&null!==t.source.queryId&&(s.assert(this.viewCache_.getCompleteServerSnap(),"We should always have a full c
540ache 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,t,e,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)},t.prototype.getInitialEvents=function(t){var e=this.viewCache_.getEventCache(),n=[];e.getNode().isLeafNode()||e.getNode().forEachChild(Nt,(function(t,e){n.push(Ee.childAddedChange(t,e))}));return e.isFullyInitialized()&&n.push(Ee.valueChange(e.getNode())),this.generateEventsForChanges_(n,e.getNode(),t)},t.prototype.generateEventsForChanges_=function(t,e,n){var r=n?[n]:this.eventRegistrations_;return this.eventGenerator_.generateEventsForChanges(t,e,r)},t}(),Pe=function(){function t(){this.views=new Map}return Object.defineProperty(t,"__referenceConstructor",{get:function(){return s.assert(fe,"Reference.ts has not been loaded"),fe},set:function(t){s.assert(!fe,"__referenceConstructor has already been defined"),fe=t},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return 0===this.views.size},t.prototype.applyOperation=function(t,e,n){var r,i,a=t.source.queryId;if(null!==a){var c=this.views.get(a);return s.assert(null!=c,"SyncTree gave us an op for an invalid query."),c.applyOperation(t,e,n)}var u=[];try{for(var l=o.__values(this.views.values()),h=l.next();!h.done;h=l.next()){c=h.value;u=u.concat(c.applyOperation(t,e,n))}}catch(t){r={error:t}}finally{try{h&&!h.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return u},t.prototype.addEventRegistration=function(t,e,n,r,i){var o=t.queryIdentifier(),s=this.views.get(o);if(!s){var a=n.calcCompleteEventCache(i?r:null),c=!1;a?c=!0:r instanceof Wt?(a=n.calcCompleteEventChildren(r),c=!1):(a=Wt.EMPTY_NODE,c=!1);var u=new Ce(new Se(a,c,!1),new Se(r,i,!1));s=new Ne(t,u),this.views.set(o,s)}return s.addEventRegistration(e),s.getInitialEvents(e)},t.prototype.removeEventRegistration=function(e,n,r){var i,s,a=e.queryIdentifier(),c=[],u=[],l=this.hasCompleteView();if("default"===a)try{for(var h=o.__values(this.views.entries()),p=h.next();!p.done;p=h.next()){var d=o.__read(p.value,2),f=d[0],v=d[1];u=u.concat(v.removeEventRegistration(n,r)),v.isEmpty()&&(this.views.delete(f),v.getQuery().getQueryParams().loadsAllData()||c.push(v.getQuery()))}}catch(t){i={error:t}}finally{try{p&&!p.done&&(s=h.return)&&s.call(h)}finally{if(i)throw i.error}}else(v=this.views.get(a))&&(u=u.concat(v.removeEventRegistration(n,r)),v.isEmpty()&&(this.views.delete(a),v.getQuery().getQueryParams().loadsAllData()||c.push(v.getQuery())));return l&&!this.hasCompleteView()&&c.push(new t.__referenceConstructor(e.repo,e.path)),{removed:c,events:u}},t.prototype.getQueryViews=function(){var t,e,n=[];try{for(var r=o.__values(this.views.values()),i=r.next();!i.done;i=r.next()){var s=i.value;s.getQuery().getQueryParams().loadsAllData()||n.push(s)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t.prototype.getCompleteServerCache=function(t){var e,n,r=null;try{for(var i=o.__values(this.views.values()),s=i.next();!s.done;s=i.next()){var a=s.value;r=r||a.getCompleteServerCache(t)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},t.prototype.viewForQuery=function(t){if(t.getQueryParams().loadsAllData())return this.getCompleteView();var e=t.queryIdentifier();return this.views.get(e)},t.prototype.viewExistsForQuery=function(t){return null!=this.viewForQuery(t)},t.prototype.hasCompleteView=function(){return null!=this.getCompleteView()},t.prototype.getCompleteView=function(){var t,e;try{for(var n=o.__values(this.views.values()),r=n.next();!r.done;r=n.next()){var i=r.value;if(i.getQuery().getQueryParams().loadsAllData())return i}}catch(e){t={error:e}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return null},t}(),Me=function(){function t(t){this.writeTree_=t}return t.prototype.addWrite=function(e,n){if(e.isEmpty())return new t(new ye(n));var r=this.writeTree_.findRootMostValueAndPath(e);if(null!=r){var i=r.path,o=r.value,s=W.relativePath(i,e);return o=o.updateChild(s,n),new t(this.writeTree_.set(i,o))}var a=new ye(n);return new t(this.writeTree_.setTree(e,a))},t.prototype.addWrites=function(t,e){var n=this;return j(e,(function(e,r){n=n.addWrite(t.child(e),r)})),n},t.prototype.removeWrite=function(e){return e.isEmpty()?t.Empty:new t(this.writeTree_.setTree(e,ye.Empty))},t.prototype.hasCompleteWrite=function(t){return null!=this.getCompleteNode(t)},t.prototype.getCompleteNode=function(t){var e=this.writeTree_.findRootMostValueAndPath(t);return null!=e?this.writeTree_.get(e.path).getChild(W.relativePath(e.path,t)):null},t.prototype.getCompleteChildren=function(){var t=[],e=this.writeTree_.value;return null!=e?e.isLeafNode()||e.forEachChild(Nt,(function(e,n){t.push(new _t(e,n))}
540)):this.writeTree_.children.inorderTraversal((function(e,n){null!=n.value&&t.push(new _t(e,n.value))})),t},t.prototype.childCompoundWrite=function(e){if(e.isEmpty())return this;var n=this.getCompleteNode(e);return new t(null!=n?new ye(n):this.writeTree_.subtree(e))},t.prototype.isEmpty=function(){return this.writeTree_.isEmpty()},t.prototype.apply=function(t){return function t(e,n,r){if(null!=n.value)return r.updateChild(e,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=t(e.child(n),o,r)})),r.getChild(e).isEmpty()||null===i||(r=r.updateChild(e.child(".priority"),i)),r}
541/**
542 * @license
543 * Copyright 2017 Google LLC
544 *
545 * Licensed under the Apache License, Version 2.0 (the "License");
546 * you may not use this file except in compliance with the License.
547 * You may obtain a copy of the License at
548 *
549 *   http://www.apache.org/licenses/LICENSE-2.0
550 *
551 * Unless required by applicable law or agreed to in writing, software
552 * distributed under the License is distributed on an "AS IS" BASIS,
553 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
554 * See the License for the specific language governing permissions and
555 * limitations under the License.
556 */(W.Empty,this.writeTree_,t)},t.Empty=new t(new ye(null)),t}();
557/**
558 * @license
559 * Copyright 2017 Google LLC
560 *
561 * Licensed under the Apache License, Version 2.0 (the "License");
562 * you may not use this file except in compliance with the License.
563 * You may obtain a copy of the License at
564 *
565 *   http://www.apache.org/licenses/LICENSE-2.0
566 *
567 * Unless required by applicable law or agreed to in writing, software
568 * distributed under the License is distributed on an "AS IS" BASIS,
569 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
570 * See the License for the specific language governing permissions and
571 * limitations under the License.
572 */var De=function(){function t(){this.visibleWrites_=Me.Empty,this.allWrites_=[],this.lastWriteId_=-1}return t.prototype.childWrites=function(t){return new Le(t,this)},t.prototype.addOverwrite=function(t,e,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:t,snap:e,writeId:n,visible:r}),r&&(this.visibleWrites_=this.visibleWrites_.addWrite(t,e)),this.lastWriteId_=n},t.prototype.addMerge=function(t,e,n){s.assert(n>this.lastWriteId_,"Stacking an older merge on top of newer ones"),this.allWrites_.push({path:t,children:e,writeId:n,visible:!0}),this.visibleWrites_=this.visibleWrites_.addWrites(t,e),this.lastWriteId_=n},t.prototype.getWrite=function(t){for(var e=0;e<this.allWrites_.length;e++){var n=this.allWrites_[e];if(n.writeId===t)return n}return null},t.prototype.removeWrite=function(t){var e=this,n=this.allWrites_.findIndex((function(e){return e.writeId===t}));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 c=this.allWrites_[a];c.visible&&(a>=n&&this.recordContainsPath_(c,r.path)?i=!1:r.path.contains(c.path)&&(o=!0)),a--}if(i){if(o)return this.resetTree_(),!0;r.snap?this.visibleWrites_=this.visibleWrites_.removeWrite(r.path):j(r.children,(function(t){e.visibleWrites_=e.visibleWrites_.removeWrite(r.path.child(t))}));return!0}return!1},t.prototype.getCompleteWriteData=function(t){return this.visibleWrites_.getCompleteNode(t)},t.prototype.calcCompleteEventCache=function(e,n,r,i){if(r||i){var o=this.visibleWrites_.childCompoundWrite(e);if(!i&&o.isEmpty())return n;if(i||null!=n||o.hasCompleteWrite(W.Empty)){var s=t.layerTree_(this.allWrites_,(function(t){return(t.visible||i)&&(!r||!~r.indexOf(t.writeId))&&(t.path.contains(e)||e.contains(t.path))}),e);u=n||Wt.EMPTY_NODE;return s.apply(u)}return null}var a=this.visibleWrites_.getCompleteNode(e);if(null!=a)return a;var c=this.visibleWrites_.childCompoundWrite(e);if(c.isEmpty())return n;if(null!=n||c.hasCompleteWrite(W.Empty)){var u=n||Wt.EMPTY_NODE;return c.apply(u)}return null},t.prototype.calcCompleteEventChildren=function(t,e){var n=Wt.EMPTY_NODE,r=this.visibleWrites_.getCompleteNode(t);if(r)return r.isLeafNode()||r.forEachChild(Nt,(function(t,e){n=n.updateImmediateChild(t,e)})),n;if(e){var i=this.visibleWrites_.childCompoundWrite(t);return e.forEachChild(Nt,(function(t,e){var r=i.childCompoundWrite(new W(t)).apply(e);n=n.updateImmediateChild(t,r)}
572)),i.getCompleteChildren().forEach((function(t){n=n.updateImmediateChild(t.name,t.node)})),n}return this.visibleWrites_.childCompoundWrite(t).getCompleteChildren().forEach((function(t){n=n.updateImmediateChild(t.name,t.node)})),n},t.prototype.calcEventCacheAfterServerOverwrite=function(t,e,n,r){s.assert(n||r,"Either existingEventSnap or existingServerSnap must exist");var i=t.child(e);if(this.visibleWrites_.hasCompleteWrite(i))return null;var o=this.visibleWrites_.childCompoundWrite(i);return o.isEmpty()?r.getChild(e):o.apply(r.getChild(e))},t.prototype.calcCompleteChild=function(t,e,n){var r=t.child(e),i=this.visibleWrites_.getCompleteNode(r);return null!=i?i:n.isCompleteForChild(e)?this.visibleWrites_.childCompoundWrite(r).apply(n.getNode().getImmediateChild(e)):null},t.prototype.shadowingWrite=function(t){return this.visibleWrites_.getCompleteNode(t)},t.prototype.calcIndexedSlice=function(t,e,n,r,i,o){var s,a=this.visibleWrites_.childCompoundWrite(t),c=a.getCompleteNode(W.Empty);if(null!=c)s=c;else{if(null==e)return[];s=a.apply(e)}if((s=s.withIndex(o)).isEmpty()||s.isLeafNode())return[];for(var u=[],l=o.getCompare(),h=i?s.getReverseIteratorFrom(n,o):s.getIteratorFrom(n,o),p=h.getNext();p&&u.length<r;)0!==l(p,n)&&u.push(p),p=h.getNext();return u},t.prototype.recordContainsPath_=function(t,e){if(t.snap)return t.path.contains(e);for(var n in t.children)if(t.children.hasOwnProperty(n)&&t.path.child(n).contains(e))return!0;return!1},t.prototype.resetTree_=function(){this.visibleWrites_=t.layerTree_(this.allWrites_,t.DefaultFilter_,W.Empty),this.allWrites_.length>0?this.lastWriteId_=this.allWrites_[this.allWrites_.length-1].writeId:this.lastWriteId_=-1},t.DefaultFilter_=function(t){return t.visible},t.layerTree_=function(t,e,n){for(var r=Me.Empty,i=0;i<t.length;++i){var o=t[i];if(e(o)){var a=o.path,c=void 0;if(o.snap)n.contains(a)?(c=W.relativePath(n,a),r=r.addWrite(c,o.snap)):a.contains(n)&&(c=W.relativePath(a,n),r=r.addWrite(W.Empty,o.snap.getChild(c)));else{if(!o.children)throw s.assertionError("WriteRecord should have .snap or .children");if(n.contains(a))c=W.relativePath(n,a),r=r.addWrites(c,o.children);else if(a.contains(n))if((c=W.relativePath(a,n)).isEmpty())r=r.addWrites(W.Empty,o.children);else{var u=s.safeGet(o.children,c.getFront());if(u){var l=u.getChild(c.popFront());r=r.addWrite(W.Empty,l)}}}}}return r},t}(),Le=function(){function t(t,e){this.treePath_=t,this.writeTree_=e}return t.prototype.calcCompleteEventCache=function(t,e,n){return this.writeTree_.calcCompleteEventCache(this.treePath_,t,e,n)},t.prototype.calcCompleteEventChildren=function(t){return this.writeTree_.calcCompleteEventChildren(this.treePath_,t)},t.prototype.calcEventCacheAfterServerOverwrite=function(t,e,n){return this.writeTree_.calcEventCacheAfterServerOverwrite(this.treePath_,t,e,n)},t.prototype.shadowingWrite=function(t){return this.writeTree_.shadowingWrite(this.treePath_.child(t))},t.prototype.calcIndexedSlice=function(t,e,n,r,i){return this.writeTree_.calcIndexedSlice(this.treePath_,t,e,n,r,i)},t.prototype.calcCompleteChild=function(t,e){return this.writeTree_.calcCompleteChild(this.treePath_,t,e)},t.prototype.child=function(e){return new t(this.treePath_.child(e),this.writeTree_)},t}(),je=function(){function t(t){this.listenProvider_=t,this.syncPointTree_=ye.Empty,this.pendingWriteTree_=new De,this.tagToQueryMap=new Map,this.queryToTagMap=new Map}return t.prototype.applyUserOverwrite=function(t,e,n,r){return this.pendingWriteTree_.addOverwrite(t,e,n,r),r?this.applyOperationToSyncPoints_(new _e(ve.User,t,e)):[]},t.prototype.applyUserMerge=function(t,e,n){this.pendingWriteTree_.addMerge(t,e,n);var r=ye.fromObject(e);return this.applyOperationToSyncPoints_(new we(ve.User,t,r))},t.prototype.ackUserWrite=function(t,e){void 0===e&&(e=!1);var n=this.pendingWriteTree_.getWrite(t);if(this.pendingWriteTree_.removeWrite(t)){var r=ye.Empty;return null!=n.snap?r=r.set(W.Empty,!0):j(n.children,(function(t,e){r=r.set(new W(t),e)})),this.applyOperationToSyncPoints_(new ge(n.path,r,e))}return[]},t.prototype.applyServerOverwrite=function(t,e){return this.applyOperationToSyncPoints_(new _e(ve.Server,t,e))},t.prototype.applyServerMerge=function(t,e){var n=ye.fromObject(e);return this.applyOperationToSyncPoints_(new we(ve.Server,t,n))},t.prototype.applyListenComplete=function(t){return this.applyOperationToSyncPoints_(new be(ve.Server,t))},t.prototype.applyTaggedQueryOverwrite=function(e,n,r){var i=this.queryKeyForTag_(r);if(null!=i){var o=t.parseQueryKey_(i),s=o.path,a=o.queryId,c=W.relativePath(s,e),u=new _e(ve.forServerTaggedQuery(a),c,n);return this.applyTaggedOperation_(s,u)}return[]},t.prototype.applyTaggedQueryMerge=function(e,n,r){var i=this.queryKeyForTag_(r);if(i){var o=t.parseQueryKey_(i),s=o.path,a=o.queryId,c=W.relativePath(s,e),u=ye.fromObject(n),l=new we(ve.forServerTaggedQuery(a),c,u);return this.applyTaggedOperation_(s,l)}return[]},t.prototype.applyTaggedListenComplete=function(e,n){var r=this.queryKeyForTag_(n);if(r){var i=t.parseQueryKey_(r),o=i.path,s=i.queryId,a=W.relativePath(o,e),c=new be(ve.forServerTaggedQuery(s),a);return this.applyTaggedOperation_(o,c)}return[]},t.prototype.addEventRegistration=function(e,n){var r=e.path,i=null,o=!1;this.syncPointTree_.foreachOnPath(r,(function(t,e){var n=W.relativePath(t,r);i=i||e.getCompleteServerCache(n),o=o||e.hasCompleteView()}));var a,c=this.syncPointTree_.get(r);(c?(o=o||c.hasCompleteView(),i=i||c.getCompleteServerCache(W.Empty)):(c=new Pe,this.syncPointTree_=this.syncPointTree_.set(r,c)),null!=i)?a=!0:(a=!1,i=Wt.EMPTY_NODE,this.syncPointTree_.subtree(r).foreachChild((function(t,e){var n=e.getCompleteServerCache(W.Empty);n&&(i=i.updateImmediateChild(t,n))}
572)));var u=c.viewExistsForQuery(e);if(!u&&!e.getQueryParams().loadsAllData()){var l=t.makeQueryKey_(e);s.assert(!this.queryToTagMap.has(l),"View does not exist, but we have a tag");var h=t.getNextQueryTag_();this.queryToTagMap.set(l,h),this.tagToQueryMap.set(h,l)}var p=this.pendingWriteTree_.childWrites(r),d=c.addEventRegistration(e,n,p,i,a);if(!u&&!o){var f=c.viewForQuery(e);d=d.concat(this.setupListener_(e,f))}return d},t.prototype.removeEventRegistration=function(e,n,r){var i=this,o=e.path,s=this.syncPointTree_.get(o),a=[];if(s&&("default"===e.queryIdentifier()||s.viewExistsForQuery(e))){var c=s.removeEventRegistration(e,n,r);s.isEmpty()&&(this.syncPointTree_=this.syncPointTree_.remove(o));var u=c.removed;a=c.events;var l=-1!==u.findIndex((function(t){return t.getQueryParams().loadsAllData()})),h=this.syncPointTree_.findOnPath(o,(function(t,e){return e.hasCompleteView()}));if(l&&!h){var p=this.syncPointTree_.subtree(o);if(!p.isEmpty())for(var d=this.collectDistinctViewsForSubTree_(p),f=0;f<d.length;++f){var v=d[f],g=v.getQuery(),m=this.createListenerForView_(v);this.listenProvider_.startListening(t.queryForListening_(g),this.tagForQuery_(g),m.hashFn,m.onComplete)}}if(!h&&u.length>0&&!r)if(l){this.listenProvider_.stopListening(t.queryForListening_(e),null)}else u.forEach((function(e){var n=i.queryToTagMap.get(t.makeQueryKey_(e));i.listenProvider_.stopListening(t.queryForListening_(e),n)}));this.removeTags_(u)}return a},t.prototype.calcCompleteEventCache=function(t,e){var n=this.pendingWriteTree_,r=this.syncPointTree_.findOnPath(t,(function(e,n){var r=W.relativePath(e,t),i=n.getCompleteServerCache(r);if(i)return i}));return n.calcCompleteEventCache(t,r,e,!0)},t.prototype.collectDistinctViewsForSubTree_=function(t){return t.fold((function(t,e,n){if(e&&e.hasCompleteView())return[e.getCompleteView()];var r=[];return e&&(r=e.getQueryViews()),j(n,(function(t,e){r=r.concat(e)})),r}))},t.prototype.removeTags_=function(e){for(var n=0;n<e.length;++n){var r=e[n];if(!r.getQueryParams().loadsAllData()){var i=t.makeQueryKey_(r),o=this.queryToTagMap.get(i);this.queryToTagMap.delete(i),this.tagToQueryMap.delete(o)}}},t.queryForListening_=function(t){return t.getQueryParams().loadsAllData()&&
572!t.getQueryParams().isDefault()?t.getRef():t},t.prototype.setupListener_=function(e,n){var r=e.path,i=this.tagForQuery_(e),o=this.createListenerForView_(n),a=this.listenProvider_.startListening(t.queryForListening_(e),i,o.hashFn,o.onComplete),c=this.syncPointTree_.subtree(r);if(i)s.assert(!c.value.hasCompleteView(),"If we're adding a query, it shouldn't be shadowed");else for(var u=c.fold((function(t,e,n){if(!t.isEmpty()&&e&&e.hasCompleteView())return[e.getCompleteView().getQuery()];var r=[];return e&&(r=r.concat(e.getQueryViews().map((function(t){return t.getQuery()})))),j(n,(function(t,e){r=r.concat(e)})),r})),l=0;l<u.length;++l){var h=u[l];this.listenProvider_.stopListening(t.queryForListening_(h),this.tagForQuery_(h))}return a},t.prototype.createListenerForView_=function(t){var e=this,n=t.getQuery(),r=this.tagForQuery_(n);return{hashFn:function(){return(t.getServerCache()||Wt.EMPTY_NODE).hash()},onComplete:function(t){if("ok"===t)return r?e.applyTaggedListenComplete(n.path,r):e.applyListenComplete(n.path);var i=function(t,e){var n="Unknown Error";"too_big"===t?n="The data requested exceeds the maximum size that can be accessed with a single request.":"permission_denied"===t?n="Client doesn't have permission to access the desired data.":"unavailable"===t&&(n="The service is unavailable");var r=new Error(t+" at "+e.path.toString()+": "+n);return r.code=t.toUpperCase(),r}(t,n);return e.removeEventRegistration(n,null,i)}}},t.makeQueryKey_=function(t){return t.path.toString()+"$"+t.queryIdentifier()},t.parseQueryKey_=function(t){var e=t.indexOf("$");return s.assert(-1!==e&&e<t.length-1,"Bad queryKey."),{queryId:t.substr(e+1),path:new W(t.substr(0,e))}},t.prototype.queryKeyForTag_=function(t){return this.tagToQueryMap.get(t)},t.prototype.tagForQuery_=function(e){var n=t.makeQueryKey_(e);return this.queryToTagMap.get(n)},t.getNextQueryTag_=function(){return t.nextQueryTag_++},t.prototype.applyTaggedOperation_=function(t,e){var n=this.syncPointTree_.get(t);s.assert(n,"Missing sync point for query tag that we're tracking");var r=this.pendingWriteTree_.childWrites(t);return n.applyOperation(e,r,null)},t.prototype.applyOperationToSyncPoints_=function(t){return this.applyOperationHelper_(t,this.syncPointTree_,null,this.pendingWriteTree_.childWrites(W.Empty))},t.prototype.applyOperationHelper_=function(t,e,n,r){if(t.path.isEmpty())return this.applyOperationDescendantsHelper_(t,e,n,r);var i=e.get(W.Empty);null==n&&null!=i&&(n=i.getCompleteServerCache(W.Empty));var o=[],s=t.path.getFront(),a=t.operationForChild(s),c=e.children.get(s);if(c&&a){var u=n?n.getImmediateChild(s):null,l=r.child(s);o=o.concat(this.applyOperationHelper_(a,c,u,l))}return i&&(o=o.concat(i.applyOperation(t,r,n))),o},t.prototype.applyOperationDescendantsHelper_=function(t,e,n,r){var i=this,o=e.get(W.Empty);null==n&&null!=o&&(n=o.getCompleteServerCache(W.Empty));var s=[];return e.children.inorderTraversal((function(e,o){var a=n?n.getImmediateChild(e):null,c=r.child(e),u=t.operationForChild(e);u&&(s=s.concat(i.applyOperationDescendantsHelper_(u,o,a,c)))})),o&&(s=s.concat(o.applyOperation(t,r,n))),s},t.nextQueryTag_=1,t}(),Ue=function(){function t(){this.rootNode_=Wt.EMPTY_NODE}return t.prototype.getNode=function(t){return this.rootNode_.getChild(t)},t.prototype.updateSnapshot=function(t,e){this.rootNode_=this.rootNode_.updateChild(t,e)},t}(),Fe=function(){function t(){this.counters_={}}return t.prototype.incrementCounter=function(t,e){void 0===e&&(e=1),s.contains(this.counters_,t)||(this.counters_[t]=0),this.counters_[t]+=e},t.prototype.get=function(){return s.deepCopy(this.counters_)},t}(),He=function(){function t(){}return t.getCollection=function(t){var e=t.toString();return this.collections_[e]||(this.collections_[e]=new Fe),this.collections_[e]},t.getOrCreateReporter=function(t,e){var n=t.toString();return this.reporters_[n]||(this.reporters_[n]=e()),this.reporters_[n]},t.collections_={},t.reporters_={},t}(),Be=function(){function t(t){this.collection_=t,this.last_=null}return t.prototype.get=function(){var t=this.collection_.get(),e=o.__assign({},t);return this.last_&&j(this.last_,(function(t,n){e[t]=e[t]-n})),this.last_=t,e},t}(),qe=1e4,Ve=3e4,We=function(){function t(t,e){this.server_=e,this.statsToReport_={},this.statsListener_=new Be(t);var n=qe+(Ve-qe)*Math.random();V(this.reportStats_.bind(this),Math.floor(n))}return t.prototype.includeStat=function(t){this.statsToReport_[t]=!0},t.prototype.reportStats_=function(){var t=this,e=this.statsListener_.get(),n={},r=!1;j(e,(function(e,i){i>0&&s.contains(t.statsToReport_,e)&&(n[e]=i,r=!0)})),r&&this.server_.reportStats(n),V(this.reportStats_.bind(this),Math.floor(2*Math.random()*3e5))},t}(),ze=function(){function t(){this.eventLists_=[],this.recursionDepth_=0}return t.prototype.queueEvents=function(t){for(var e=null,n=0;n<t.length;n++){var r=t[n],i=r.getPath();null===e||i.equals(e.getPath())||(this.eventLists_.push(e),e=null),null===e&&(e=new $e(i)),e.add(r)}e&&this.eventLists_.push(e)},t.prototype.raiseEventsAtPath=function(t,e){this.queueEvents(e),this.raiseQueuedEventsMatchingPredicate_((function(e){return e.equals(t)}))},t.prototype.raiseEventsForChangedPath=function(t,e){this.queueEvents(e),this.raiseQueuedEventsMatchingPredicate_((function(e){return e.contains(t)||t.contains(e)}))},t.prototype.raiseQueuedEventsMatchingPredicate_=function(t){this.recursionDepth_++;for(var e=!0,n=0;n<this.eventLists_.length;n++){var r=this.eventLists_[n];if(r)t(r.getPath())?(this.eventLists_[n].raise(),this.eventLists_[n]=null):e=!1}e&&(this.eventLists_=[]),this.recursionDepth_--},t}(),$e=function(){function t(t){this.path_=t,this.events_=[]}
572return t.prototype.add=function(t){this.events_.push(t)},t.prototype.raise=function(){for(var t=0;t<this.events_.length;t++){var e=this.events_[t];if(null!==e){this.events_[t]=null;var n=e.getEventRunner();w&&E("event: "+e.toString()),B(n)}}},t.prototype.getPath=function(){return this.path_},t}(),Ye=function(){function t(t){this.allowedEvents_=t,this.listeners_={},s.assert(Array.isArray(t)&&t.length>0,"Requires a non-empty array")}return t.prototype.trigger=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Array.isArray(this.listeners_[t]))for(var r=o.__spread(this.listeners_[t]),i=0;i<r.length;i++)r[i].callback.apply(r[i].context,e)},t.prototype.on=function(t,e,n){this.validateEventType_(t),this.listeners_[t]=this.listeners_[t]||[],this.listeners_[t].push({callback:e,context:n});var r=this.getInitialEvent(t);r&&e.apply(n,r)},t.prototype.off=function(t,e,n){this.validateEventType_(t);for(var r=this.listeners_[t]||[],i=0;i<r.length;i++)if(r[i].callback===e&&(!n||n===r[i].context))return void r.splice(i,1)},t.prototype.validateEventType_=function(t){s.assert(this.allowedEvents_.find((function(e){return e===t})),"Unknown event: "+t)},t}(),Ke=function(t){function e(){var e,n,r=t.call(this,["visible"])||this;return"undefined"!=typeof document&&void 0!==document.addEventListener&&(void 0!==document.hidden?(n="visibilitychange",e="hidden"):void 0!==document.mozHidden?(n="mozvisibilitychange",e="mozHidden"):void 0!==document.msHidden?(n="msvisibilitychange",e="msHidden"):void 0!==document.webkitHidden&&(n="webkitvisibilitychange",e="webkitHidden")),r.visible_=!0,n&&document.addEventListener(n,(function(){var t=!document[e];t!==r.visible_&&(r.visible_=t,r.trigger("visible",t))}),!1),r}return o.__extends(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return s.assert("visible"===t,"Unknown event type: "+t),[this.visible_]},e}(Ye),Ge=function(t){function e(){var e=t.call(this,["online"])||this;return e.online_=!0,"undefined"==typeof window||void 0===window.addEventListener||s.isMobileCordova()||(window.addEventListener("online",(function(){e.online_||(e.online_=!0,e.trigger("online",!0))}),!1),window.addEventListener("offline",(function(){e.online_&&(e.online_=!1,e.trigger("online",!1))}),!1)),e}return o.__extends(e,t),e.getInstance=function(){return new e},e.prototype.getInitialEvent=function(t){return s.assert("online"===t,"Unknown event type: "+t),[this.online_]},e.prototype.currentlyOnline=function(){return this.online_},e}(Ye),Qe=function(){function t(t){this.onMessage_=t,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}return t.prototype.closeAfter=function(t,e){this.closeAfterResponse=t,this.onClose=e,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)},t.prototype.handleResponse=function(t,e){var n=this;this.pendingResponses[t]=e;for(var r=function(){var t=i.pendingResponses[i.currentResponseNum];delete i.pendingResponses[i.currentResponseNum];for(var e=function(e){t[e]&&B((function(){n.onMessage_(t[e])}))},r=0;r<t.length;++r)e(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}},t}(),Xe="pLPCommand",Je="pRTLPCB",Ze=function(){function t(t,e,n,r,i){this.connId=t,this.repoInfo=e,this.applicationId=n,this.transportSessionId=r,this.lastSessionId=i,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=x(t),this.stats_=He.getCollection(e),this.urlFn=function(t){return e.connectionURL($,t)}}return t.prototype.open=function(t,e){var n=this;this.curSegmentNum=0,this.onDisconnect_=e,this.myPacketOrderer=new Qe(t),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout((function(){n.log_("Timed out trying to connect."),n.onClosed_(),n.connectTimeoutTimer_=null}),Math.floor(3e4)),function(t){if(s.isNodeSdk()||"complete"===document.readyState)t();else{var e=!1,n=function(){document.body?e||(e=!0,t()):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 tn((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=o.__read(t,5),i=r[0],s=r[1],a=r[2];r[3],r[4];if(n.incrementIncomingBytes_(t),n.scriptTagHolder)if(n.connectTimeoutTimer_&&(clearTimeout(n.connectTimeoutTimer_),n.connectTimeoutTimer_=null),n.everConnected_=!0,"start"===i)n.id=s,n.password=a;else{if("close"!==i)throw new Error("Unrecognized command received: "+i);s?(n.scriptTagHolder.sendNewPolls=!1,n.myPacketOrderer.closeAfter(s,(function(){n.onClosed_()}))):n.onClosed_()}}),(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=o.__read(t,2),i=r[0],s=r[1];n.incrementIncomingBytes_(t),n.myPacketOrderer.handleResponse(i,s)}),(function(){n.onClosed_()}),n.urlFn);var t={start:"t"};t.ser=Math.floor(1e8*Math.random()),n.scriptTagHolder.uniqueCallbackIdentifier&&(t.cb=n.scriptTagHolder.uniqueCallbackIdentifier),t.v="5",n.transportSessionId&&(t.s=n.transportSessionId),n.lastSessionId&&(t.ls=n.lastSessionId),n.applicationId&&(t.p=n.applicationId),"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(t.r="f");var e=n.urlFn(t);n.log_("Connecting via long-poll to "+e),n.scriptTagHolder.addTag(e,(function(){}))}}))},t.prototype.start=function(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)},t.forceAllow=function(){t.forceAllow_=!0},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){return!s.isNodeSdk()&&(!!t.forceAllow_||!(t.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))},t.prototype.markConnectionHealthy=function(){},t.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)},t.prototype.onClosed_=function(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))},t.prototype.close=function(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())},t.prototype.send=function(t){var e=s.stringify(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);for(var n=s.base64Encode(e),r=L(n,1840),i=0;i<r.length;i++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,r.length,r[i]),this.curSegmentNum++},t.prototype.addDisconnectPingFrame=function(t,e){if(!s.isNodeSdk()){this.myDisconnFrame=document.createElement("iframe");var n={dframe:"t"};n.id=t,n.pw=e,this.myDisconnFrame.src=this.urlFn(n),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}},t.prototype.incrementIncomingBytes_=function(t){var e=s.stringify(t).length;this.bytesReceived+=e,this.stats_.incrementCounter("bytes_received",e)},t}(),tn=function(){function t(e,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=e,this.onMessageCB=n;else{this.uniqueCallbackIdentifier=y(),window[Xe+this.uniqueCallbackIdentifier]=e,window[Je+this.uniqueCallbackIdentifier]=n,this.myIFrame=t.createI
572Frame_();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(t){E("frame writing exception"),t.stack&&E(t.stack),E(t)}}}return t.createIFrame_=function(){var t=document.createElement("iframe");if(t.style.display="none",!document.body)throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";document.body.appendChild(t);try{t.contentWindow.document||E("No IE domain setting required")}catch(n){var e=document.domain;t.src="javascript:void((function(){document.open();document.domain='"+e+"';document.close();})())"}return t.contentDocument?t.doc=t.contentDocument:t.contentWindow?t.doc=t.contentWindow.document:t.document&&(t.doc=t.document),t},t.prototype.close=function(){var t=this;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)));var e=this.onDisconnect;e&&(this.onDisconnect=null,e())},t.prototype.startLongPoll=function(t,e){for(this.myID=t,this.myPW=e,this.alive=!0;this.newRequest_(););},t.prototype.newRequest_=function(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;var t={};t.id=this.myID,t.pw=this.myPW,t.ser=this.currentSerial;for(var e=this.urlFn(t),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 e+=n,this.addLongPollTag_(e,this.currentSerial),!0}return!1},t.prototype.enqueueSegment=function(t,e,n){this.pendingSegs.push({seg:t,ts:e,d:n}),this.alive&&this.newRequest_()},t.prototype.addLongPollTag_=function(t,e){var n=this;this.outstandingRequests.add(e);var r=function(){n.outstandingRequests.delete(e),n.newRequest_()},i=setTimeout(r,Math.floor(25e3));this.addTag(t,(function(){clearTimeout(i),r()}))},t.prototype.addTag=function(t,e){var n=this;s.isNodeSdk()?this.doNodeLongPoll(t,e):setTimeout((function(){try{if(!n.sendNewPolls)return;var r=n.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=t,r.onload=r.onreadystatechange=function(){var t=r.readyState;t&&"loaded"!==t&&"complete"!==t||(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),e())},r.onerror=function(){E("Long-poll script failed to load: "+t),n.sendNewPolls=!1,n.close()},n.myIFrame.doc.body.appendChild(r)}catch(t){}}),Math.floor(1))},t}(),en="";
573/**
574 * @license
575 * Copyright 2017 Google LLC
576 *
577 * Licensed under the Apache License, Version 2.0 (the "License");
578 * you may not use this file except in compliance with the License.
579 * You may obtain a copy of the License at
580 *
581 *   http://www.apache.org/licenses/LICENSE-2.0
582 *
583 * Unless required by applicable law or agreed to in writing, software
584 * distributed under the License is distributed on an "AS IS" BASIS,
585 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
586 * See the License for the specific language governing permissions and
587 * limitations under the License.
588 */
589var nn=null;"undefined"!=typeof MozWebSocket?nn=MozWebSocket:"undefined"!=typeof WebSocket&&(nn=WebSocket);var rn=function(){function t(e,n,r,i,o){this.connId=e,this.applicationId=r,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=x(this.connId),this.stats_=He.getCollection(n),this.connURL=t.connectionURL_(n,i,o),this.nodeAdmin=n.nodeAdmin}return t.connectionURL_=function(t,e,n){var r={v:"5"};return!s.isNodeSdk()&&"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(r.r="f"),e&&(r.s=e),n&&(r.ls=n),t.connectionURL("websocket",r)},t.prototype.open=function(t,e){var n=this;this.onDisconnect=e,this.onMessage=t,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,v.set("previous_websocket_failure",!0);try{if(s.isNodeSdk()){var i=this.nodeAdmin?"AdminNode":"Node",o={headers:{"User-Agent":"Firebase/5/"+en+"/"+r.platform+"/"+i,"X-Firebase-GMPID":this.applicationId||""}},a=r.env,c=0===this.connURL.indexOf("wss://")?a.HTTPS_PROXY||a.https_proxy:a.HTTP_PROXY||a.http_proxy;c&&(o.proxy={origin:c}),this.mySock=new nn(this.connURL,[],o)}else{o={headers:{"X-Firebase-GMPID":this.applicationId||""}};this.mySock=new nn(this.connURL,[],o)}}catch(t){this.log_("Error instantiating WebSocket.");var u=t.message||t.data;return u&&this.log_(u),void this.onClosed_()}this.mySock.onopen=function(){n.log_("Websocket connected."),n.everConnected_=!0}
589,this.mySock.onclose=function(){n.log_("Websocket connection was disconnected."),n.mySock=null,n.onClosed_()},this.mySock.onmessage=function(t){n.handleIncomingFrame(t)},this.mySock.onerror=function(t){n.log_("WebSocket error.  Closing connection.");var e=t.message||t.data;e&&n.log_(e),n.onClosed_()}},t.prototype.start=function(){},t.forceDisallow=function(){t.forceDisallow_=!0},t.isAvailable=function(){var e=!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&&(e=!0)}return!e&&null!==nn&&!t.forceDisallow_},t.previouslyFailed=function(){return v.isInMemoryStorage||!0===v.get("previous_websocket_failure")},t.prototype.markConnectionHealthy=function(){v.remove("previous_websocket_failure")},t.prototype.appendFrame_=function(t){if(this.frames.push(t),this.frames.length===this.totalFrames){var e=this.frames.join("");this.frames=null;var n=s.jsonEval(e);this.onMessage(n)}},t.prototype.handleNewFrameCount_=function(t){this.totalFrames=t,this.frames=[]},t.prototype.extractFrameCount_=function(t){if(s.assert(null===this.frames,"We already have a frame buffer"),t.length<=6){var e=Number(t);if(!isNaN(e))return this.handleNewFrameCount_(e),null}return this.handleNewFrameCount_(1),t},t.prototype.handleIncomingFrame=function(t){if(null!==this.mySock){var e=t.data;if(this.bytesReceived+=e.length,this.stats_.incrementCounter("bytes_received",e.length),this.resetKeepAlive(),null!==this.frames)this.appendFrame_(e);else{var n=this.extractFrameCount_(e);null!==n&&this.appendFrame_(n)}}},t.prototype.send=function(t){this.resetKeepAlive();var e=s.stringify(t);this.bytesSent+=e.length,this.stats_.incrementCounter("bytes_sent",e.length);var n=L(e,16384);n.length>1&&this.sendString_(String(n.length));for(var r=0;r<n.length;r++)this.sendString_(n[r])},t.prototype.shutdown_=function(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)},t.prototype.onClosed_=function(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))},t.prototype.close=function(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())},t.prototype.resetKeepAlive=function(){var t=this;clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval((function(){t.mySock&&t.sendString_("0"),t.resetKeepAlive()}),Math.floor(45e3))},t.prototype.sendString_=function(t){try{this.mySock.send(t)}catch(t){this.log_("Exception thrown from WebSocket.send():",t.message||t.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}},t.responsesRequiredToBeHealthy=2,t.healthyTimeout=3e4,t}(),on=function(){function t(t){this.initTransports_(t)}return Object.defineProperty(t,"ALL_TRANSPORTS",{get:function(){return[Ze,rn]},enumerable:!1,configurable:!0}),t.prototype.initTransports_=function(e){var n,r,i=rn&&rn.isAvailable(),s=i&&!rn.previouslyFailed();if(e.webSocketOnly&&(i||k("wss:// URL used, but browser isn't known to support websockets.  Trying anyway."),s=!0),s)this.transports_=[rn];else{var a=this.transports_=[];try{for(var c=o.__values(t.ALL_TRANSPORTS),u=c.next();!u.done;u=c.next()){var l=u.value;l&&l.isAvailable()&&a.push(l)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}},t.prototype.initialTransport=function(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")},t.prototype.upgradeTransport=function(){return this.transports_.length>1?this.transports_[1]:null},t}(),sn=function(){function t(t,e,n,r,i,o,s,a){this.id=t,this.repoInfo_=e,this.applicationId_=n,this.onMessage_=r,this.onReady_=i,this.onDisconnect_=o,this.onKill_=s,this.lastSessionId=a,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=x("c:"+this.id+":"),this.transportManager_=new on(e),this.log_("Connection created"),this.start_()}return t.prototype.start_=function(){var t=this,e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,void 0,this.lastSessionId),this.primaryResponsesRequired_=e.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(){t.conn_&&t.conn_.open(n,r)}),Math.floor(0));var i=e.healthyTimeout||0;i>0&&(this.healthyTimeout_=V((function(){t.healthyTimeout_=null,t.isHealthy_||(t.conn_&&t.conn_.bytesReceived>
589102400?(t.log_("Connection exceeded healthy timeout but has received "+t.conn_.bytesReceived+" bytes.  Marking connection healthy."),t.isHealthy_=!0,t.conn_.markConnectionHealthy()):t.conn_&&t.conn_.bytesSent>10240?t.log_("Connection exceeded healthy timeout but has sent "+t.conn_.bytesSent+" bytes.  Leaving connection alive."):(t.log_("Closing unhealthy connection after timeout."),t.close()))}),Math.floor(i)))},t.prototype.nextTransportId_=function(){return"c:"+this.id+":"+this.connectionCount++},t.prototype.disconnReceiver_=function(t){var e=this;return function(n){t===e.conn_?e.onConnectionLost_(n):t===e.secondaryConn_?(e.log_("Secondary connection lost."),e.onSecondaryConnectionLost_()):e.log_("closing an old connection")}},t.prototype.connReceiver_=function(t){var e=this;return function(n){2!==e.state_&&(t===e.rx_?e.onPrimaryMessageReceived_(n):t===e.secondaryConn_?e.onSecondaryMessageReceived_(n):e.log_("message on old connection"))}},t.prototype.sendRequest=function(t){var e={t:"d",d:t};this.sendData_(e)},t.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)},t.prototype.onSecondaryControl_=function(t){if("t"in t){var e=t.t;"a"===e?this.upgradeIfSecondaryHealthy_():"r"===e?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):"o"===e&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},t.prototype.onSecondaryMessageReceived_=function(t){var e=M("t",t),n=M("d",t);if("c"===e)this.onSecondaryControl_(n);else{if("d"!==e)throw new Error("Unknown protocol layer: "+e);this.pendingDataMessages.push(n)}},t.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:{}}}))},t.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()},t.prototype.onPrimaryMessageReceived_=function(t){var e=M("t",t),n=M("d",t);"c"===e?this.onControl_(n):"d"===e&&this.onDataMessage_(n)},t.prototype.onDataMessage_=function(t){this.onPrimaryResponse_(),this.onMessage_(t)},t.prototype.onPrimaryResponse_=function(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))},t.prototype.onControl_=function(t){var e=M("t",t);if("d"in t){var n=t.d;if("h"===e)this.onHandshake_(n);else if("n"===e){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"===e?this.onConnectionShutdown_(n):"r"===e?this.onReset_(n):"e"===e?T("Server Error: "+n):"o"===e?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):T("Unknown control packet command: "+e)}},t.prototype.onHandshake_=function(t){var e=t.ts,n=t.v,r=t.h;this.sessionId=t.s,this.repoInfo_.updateHost(r),0===this.state_&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,e),"5"!==n&&k("Protocol version mismatch detected"),this.tryStartUpgrade_())},t.prototype.tryStartUpgrade_=function(){var t=this.transportManager_.upgradeTransport();t&&this.startUpgrade_(t)},t.prototype.startUpgrade_=function(t){var e=this;this.secondaryConn_=new t(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.sessionId),this.secondaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;var n=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,r),V((function(){e.secondaryConn_&&(e.log_("Timed out trying to upgrade."),e.secondaryConn_.close())}),Math.floor(6e4))},t.prototype.onReset_=function(t){this.log_("Reset packet received.  New host: "+t),this.repoInfo_.updateHost(t),1===this.state_?this.close():(this.closeConnections_(),this.start_())},t.prototype.onConnectionEstablished_=function(t,e){var n=this;this.log_("Realtime connection established."),this.conn_=t,this.state_=1,this.onReady_&&(this.onReady_(e,this.sessionId),this.onReady_=null),0===this.primaryResponsesRequired_?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):V((function(){n.sendPingOnPrimaryIfNecessary_()}),Math.floor(5e3))},t.prototype.sendPingOnPrimaryIfNecessary_=function(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:"p",d:{}}}))},t.prototype.onSecondaryConnectionLost_=function(){var t=this.secondaryConn_;this.secondaryConn_=null,this.tx_!==t&&this.rx_!==t||this.close()},t.prototype.onConnectionLost_=function(t){this.conn_=null,t||0!==this.state_?1===this.state_&&this.log_("Realtime connection lost."):(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(v.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)),this.close()},t.prototype.onConnectionShutdown_=function(t){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(t),this.onKill_=null),this.onDisconnect_=null,this.close()},t.prototype.sendData_=function(t){if(1!==this.state_)throw"Connection is not connected";this.tx_.send(t)},t.prototype.close=function(){2!==this.state_&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))},t.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)},t}(),an=function(){function t(){}return t.prototype.put=function(t,e,n,r){},t.prototype.merge=function(t,e,n,r){},t.prototype.refreshAuthToken=function(t){},t.prototype.onDisconnectPut=function(t,e,n){},t.prototype.onDisconnectMerge=function(t,e,n){},t.prototype.onDisconnectCancel=function(t,e){},t.prototype.reportStats=function(t){},t}(),cn=1e3,un=3e5,ln=function(t){function e(n,r,i,o,a,c,u){var l=t.call(this)||this;if(l.repoInfo_=n,l.applicationId_=r,l.onDataUpdate_=i,l.onConnectStatus_=o,l.onServerInfoUpdate_=a,l.authTokenProvider_=c,l.authOverride_=u,l.id=e.nextPersistentConnectionId_++,l.log_=x("p:"+l.id+":"),l.interruptReasons_={},l.listens=new Map,l.outstandingPuts_=[],l.outstandingPutCount_=0,l.onDisconnectRequestQueue_=[],l.connected_=!1,l.reconnectDelay_=cn,l.maxReconnectDelay_=un,l.securityDebugCallback_=null,l.lastSessionId=null,l.establishConnectionTimer_=null,l.visible_=!1,l.requestCBHash_={},l.requestNumber_=0,l.realtime_=null,l.authToken_=null,l.forceTokenRefresh_=!1,l.invali
589dAuthTokenCount_=0,l.firstConnection_=!0,l.lastConnectionAttemptTime_=null,l.lastConnectionEstablishedTime_=null,u&&!s.isNodeSdk())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return l.scheduleConnect_(0),Ke.getInstance().on("visible",l.onVisible_,l),-1===n.host.indexOf("fblocal")&&Ge.getInstance().on("online",l.onOnline_,l),l}return o.__extends(e,t),e.prototype.sendRequest=function(t,e,n){var r=++this.requestNumber_,i={r:r,a:t,b:e};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)},e.prototype.listen=function(t,e,n,r){var i=t.queryIdentifier(),o=t.path.toString();this.log_("Listen called for "+o+" "+i),this.listens.has(o)||this.listens.set(o,new Map),s.assert(t.getQueryParams().isDefault()||!t.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:e,query:t,tag:n};this.listens.get(o).set(i,a),this.connected_&&this.sendListen_(a)},e.prototype.sendListen_=function(t){var n=this,r=t.query,i=r.path.toString(),o=r.queryIdentifier();this.log_("Listen on "+i+" for "+o);var s={p:i};t.tag&&(s.q=r.queryObject(),s.t=t.tag),s.h=t.hashFn(),this.sendRequest("q",s,(function(s){var a=s.d,c=s.s;e.warnOnListenWarnings_(a,r),(n.listens.get(i)&&n.listens.get(i).get(o))===t&&(n.log_("listen response",s),"ok"!==c&&n.removeListen_(i,o),t.onComplete&&t.onComplete(c,a))}))},e.warnOnListenWarnings_=function(t,e){if(t&&"object"==typeof t&&s.contains(t,"w")){var n=s.safeGet(t,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){var r='".indexOn": "'+e.getQueryParams().getIndex().toString()+'"',i=e.path.toString();k("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.")}}},e.prototype.refreshAuthToken=function(t){this.authToken_=t,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},(function(){})),this.reduceReconnectDelayIfAdminCredential_(t)},e.prototype.reduceReconnectDelayIfAdminCredential_=function(t){(t&&40===t.length||s.isAdmin(t))&&(this.log_("Admin auth credential detected.  Reducing max reconnect time."),this.maxReconnectDelay_=3e4)},e.prototype.tryAuth=function(){var t=this;if(this.connected_&&this.authToken_){var e=this.authToken_,n=s.isValidFormat(e)?"auth":"gauth",r={cred:e};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";t.authToken_===e&&("ok"===r?t.invalidAuthTokenCount_=0:t.onAuthRevoked_(r,i))}))}},e.prototype.unlisten=function(t,e){var n=t.path.toString(),r=t.queryIdentifier();this.log_("Unlisten called for "+n+" "+r),s.assert(t.getQueryParams().isDefault()||!t.getQueryParams().loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(n,r)&&this.connected_&&this.sendUnlisten_(n,r,t.queryObject(),e)},e.prototype.sendUnlisten_=function(t,e,n,r){this.log_("Unlisten on "+t+" for "+e);var i={p:t};r&&(i.q=n,i.t=r),this.sendRequest("n",i)},e.prototype.onDisconnectPut=function(t,e,n){this.connected_?this.sendOnDisconnect_("o",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"o",data:e,onComplete:n})},e.prototype.onDisconnectMerge=function(t,e,n){this.connected_?this.sendOnDisconnect_("om",t,e,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"om",data:e,onComplete:n})},e.prototype.onDisconnectCancel=function(t,e){this.connected_?this.sendOnDisconnect_("oc",t,null,e):this.onDisconnectRequestQueue_.push({pathString:t,action:"oc",data:null,onComplete:e})},e.prototype.sendOnDisconnect_=function(t,e,n,r){var i={p:e,d:n};this.log_("onDisconnect "+t,i),this.sendRequest(t,i,(function(t){r&&setTimeout((function(){r(t.s,t.d)}),Math.floor(0))}))},e.prototype.put=function(t,e,n,r){this.putInternal("p",t,e,n,r)},e.prototype.merge=function(t,e,n,r){this.putInternal("m",t,e,n,r)},e.prototype.putInternal=function(t,e,n,r,i){var o={p:e,d:n};void 0!==i&&(o.h=i),this.outstandingPuts_.push({action:t,request:o,onComplete:r}),this.outstandingPutCount_++;var s=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(s):this.log_("Buffering put: "+e)},e.prototype.sendPut_=function(t){var e=this,n=this.outstandingPuts_[t].action,r=this.outstandingPuts_[t].request,i=this.outstandingPuts_[t].onComplete;this.outstandingPuts_[t].queued=this.connected_,this.sendRequest(n,r,(function(r){e.log_(n+" response",r),delete e.outstandingPuts_[t],e.outstandingPutCount_--,0===e.outstandingPutCount_&&(e.outstandingPuts_=[]),i&&i(r.s,r.d)}))},e.prototype.reportStats=function(t){var e=this;if(this.connected_){var n={c:t};this.log_("reportStats",n),this.sendRequest("s",n,(function(t){if("ok"!==t.s){var n=t.d;e.log_("reportStats","Error sending stats: "+n)}}))}},e.prototype.onDataMessage_=function(t){if("r"in t){this.log_("from server: "+s.stringify(t));var e=t.r,n=this.requestCBHash_[e];n&&(delete this.requestCBHash_[e],n(t.b))}else{if("error"in t)throw"A server-side error has occurred: "+t.error;"a"in t&&this.onDataPush_(t.a,t.b)}},e.prototype.onDataPush_=function(t,e){this.log_("handleServerMessage",t,e),"d"===t?this.onDataUpdate_(e.p,e.d,!1,e.t):"m"===t?this.onDataUpdate_(e.p,e.d,!0,e.t):"c"===t?this.onListenRevoked_(e.p,e.q):"ac"===t?this.onAuthRevoked_(e.s,e.d):"sd"===t?this.onSecurityDebugPacket_(e):T("Unrecognized action received from server: "+s.stringify(t)+"\nAre you using the latest client?")},e.prototype.onReady_=function(t,e){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=(new Date).getTime(),this.handleTimestamp_(t),this.lastSessionId=e,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)},e.prototype.scheduleConnect_=function(t){var e=this;s.assert(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout((function(){e.establishConnectionTimer_=null,e.establishConnection_()}),Math.floor(t))},e.prototype.onVisible_=function(t){t&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible.  Reducing delay."),this.reconnectDelay_=cn,this.realtime_||this.scheduleConnect_(0)),this.visible_=t},e.prototype.onOnline_=function(t){t?(this.log_("Browser went online."),this.reconnectDelay_=cn,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline.  Killing connection."),this.realtime_&&this.realtime_.close())},e.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_=cn),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible.  Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();var t=(new Date).getTime()-this.lastConnectionAttemptTime_,e=Math.max(0,this.reconnectDelay_-t);
589e=Math.random()*e,this.log_("Trying to reconnect in "+e+"ms"),this.scheduleConnect_(e),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,1.3*this.reconnectDelay_)}this.onConnectStatus_(!1)},e.prototype.establishConnection_=function(){var t=this;if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=(new Date).getTime(),this.lastConnectionEstablishedTime_=null;var n=this.onDataMessage_.bind(this),r=this.onReady_.bind(this),i=this.onRealtimeDisconnect_.bind(this),o=this.id+":"+e.nextConnectionId_++,a=this,c=this.lastSessionId,u=!1,l=null,h=function(){l?l.close():(u=!0,i())};this.realtime_={close:h,sendRequest:function(t){s.assert(l,"sendRequest call when we're not connected not allowed."),l.sendRequest(t)}};var p=this.forceTokenRefresh_;this.forceTokenRefresh_=!1,this.authTokenProvider_.getToken(p).then((function(t){u?E("getToken() completed but was canceled"):(E("getToken() completed. Creating connection."),a.authToken_=t&&t.accessToken,l=new sn(o,a.repoInfo_,a.applicationId_,n,r,i,(function(t){k(t+" ("+a.repoInfo_.toString()+")"),a.interrupt("server_kill")}),c))})).then(null,(function(e){a.log_("Failed to get token: "+e),u||(t.repoInfo_.nodeAdmin&&k(e),h())}))}},e.prototype.interrupt=function(t){E("Interrupting connection for reason: "+t),this.interruptReasons_[t]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())},e.prototype.resume=function(t){E("Resuming connection for reason: "+t),delete this.interruptReasons_[t],s.isEmpty(this.interruptReasons_)&&(this.reconnectDelay_=cn,this.realtime_||this.scheduleConnect_(0))},e.prototype.handleTimestamp_=function(t){var e=t-(new Date).getTime();this.onServerInfoUpdate_({serverTimeOffset:e})},e.prototype.cancelSentTransactions_=function(){for(var t=0;t<this.outstandingPuts_.length;t++){var e=this.outstandingPuts_[t];e&&"h"in e.request&&e.queued&&(e.onComplete&&e.onComplete("disconnect"),delete this.outstandingPuts_[t],this.outstandingPutCount_--)}0===this.outstandingPutCount_&&(this.outstandingPuts_=[])},e.prototype.onListenRevoked_=function(t,e){var n;n=e?e.map((function(t){return D(t)})).join("$"):"default";var r=this.removeListen_(t,n);r&&r.onComplete&&r.onComplete("permission_denied")},e.prototype.removeListen_=function(t,e){var n,r=new W(t).toString();if(this.listens.has(r)){var i=this.listens.get(r);n=i.get(e),i.delete(e),0===i.size&&this.listens.delete(r)}else n=void 0;return n},e.prototype.onAuthRevoked_=function(t,e){E("Auth token revoked: "+t+"/"+e),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==t&&"permission_denied"!==t||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=3&&(this.reconnectDelay_=3e4,this.authTokenProvider_.notifyForInvalidToken()))},e.prototype.onSecurityDebugPacket_=function(t){this.securityDebugCallback_?this.securityDebugCallback_(t):"msg"in t&&console.log("FIREBASE: "+t.msg.replace("\n","\nFIREBASE: "))},e.prototype.restoreState_=function(){var t,e,n,r;this.tryAuth();try{for(var i=o.__values(this.listens.values()),s=i.next();!s.done;s=i.next()){var a=s.value;try{for(var c=(n=void 0,o.__values(a.values())),u=c.next();!u.done;u=c.next()){var l=u.value;this.sendListen_(l)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}for(var h=0;h<this.outstandingPuts_.length;h++)this.outstandingPuts_[h]&&this.sendPut_(h);for(;this.onDisconnectRequestQueue_.length;){var p=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(p.action,p.pathString,p.data,p.onComplete)}},e.prototype.sendConnectStats_=function(){var t={},e="js";s.isNodeSdk()&&(e=this.repoInfo_.nodeAdmin?"admin_node":"node"),t["sdk."+e+"."+en.replace(/\./g,"-")]=1,s.isMobileCordova()?t["framework.cordova"]=1:s.isReactNative()&&(t["framework.reactnative"]=1),this.reportStats(t)},e.prototype.shouldReconnect_=function(){var t=Ge.getInstance().currentlyOnline();return s.isEmpty(this.interruptReasons_)&&t},e.nextPersistentConnectionId_=0,e.nextConnectionId_=0,e}(an),hn=function(t){function e(e,n,r){var i=t.call(this)||this;return i.repoInfo_=e,i.onDataUpdate_=n,i.authTokenProvider_=r,i.log_=x("p:rest:"),i.listens_={},i}return o.__extends(e,t),e.prototype.reportStats=function(t){throw new Error("Method not implemented.")},e.getListenId_=function(t,e){return void 0!==e?"tag$"+e:(s.assert(t.getQueryParams().isDefault(),"should have a tag if it's not a default query."),t.path.toString())},e.prototype.listen=function(t,n,r,i){var o=this,a=t.path.toString();this.log_("Listen called for "+a+" "+t.queryIdentifier());var c=e.getListenId_(t,r),u={};this.listens_[c]=u;var l=t.getQueryParams().toRestQueryStringParameters();this.restRequest_(a+".json",l,(function(t,e){var n=e;(404===t&&(n=null,t=null),null===t&&o.onDataUpdate_(a,n,!1,r),s.safeGet(o.listens_,c)===u)&&i(t?401===t?"permission_denied":"rest_error:"+t:"ok",null)}))},e.prototype.unlisten=function(t,n){var r=e.getListenId_(t,n);delete this.listens_[r]},e.prototype.refreshAuthToken=function(t){},e.prototype.restRequest_=function(t,e,n){var r=this;void 0===e&&(e={}),e.format="export",this.authTokenProvider_.getToken(!1).then((function(i){var o=i&&i.accessToken;o&&(e.auth=o);var a=(r.repoInfo_.secure?"https://":"http://")+r.repoInfo_.host+t+"?ns="+r.repoInfo_.namespace+s.querystring(e);r.log_("Sending REST request for "+a);var c=new XMLHttpRequest;c.onreadystatechange=function(){if(n&&4===c.readyState){r.log_("REST Response for "+a+" received. status:",c.status,"response:",c.responseText);var t=null;if(c.status>=200&&c.status<300){try{t=s.jsonEval(c.responseText)}catch(t){k("Failed to parse JSON response for "+a+": "+c.responseText)}n(null,t)}else 401!==c.status&&404!==c.status&&k("Got unsuccessful REST response for "+a+" Status: "+c.status),n(c.status);n=null}},c.open("GET",a,!0),c.send()}))},e}(an),pn=function(){function t(t,e,n,r){var i=this;if(this.repoInfo_=t,this.app=n,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new ze,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=new pe,this.persistentConnection_=null,this.stats_=He.getCollection(t),e||q())this.server_=new hn(this.repoInfo_,this.onDataUpdate_.bind(this),r),setTimeout(this.onConnectStatus_.bind(this,!0),0);else{var o=n.options.databaseAuthVariableOverride;
589if(null!=o){if("object"!=typeof o)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{s.stringify(o)}catch(t){throw new Error("Invalid authOverride provided: "+t)}}this.persistentConnection_=new ln(this.repoInfo_,n.options.appId,this.onDataUpdate_.bind(this),this.onConnectStatus_.bind(this),this.onServerInfoUpdate_.bind(this),r,o),this.server_=this.persistentConnection_}r.addTokenChangeListener((function(t){i.server_.refreshAuthToken(t)})),this.statsReporter_=He.getOrCreateReporter(t,(function(){return new We(i.stats_,i.server_)})),this.transactionsInit_(),this.infoData_=new Ue,this.infoSyncTree_=new je({startListening:function(t,e,n,r){var o=[],s=i.infoData_.getNode(t.path);return s.isEmpty()||(o=i.infoSyncTree_.applyServerOverwrite(t.path,s),setTimeout((function(){r("ok")}),0)),o},stopListening:function(){}}),this.updateInfo_("connected",!1),this.serverSyncTree_=new je({startListening:function(t,e,n,r){return i.server_.listen(t,n,e,(function(e,n){var o=r(e,n);i.eventQueue_.raiseEventsForChangedPath(t.path,o)})),[]},stopListening:function(t,e){i.server_.unlisten(t,e)}})}return t.prototype.toString=function(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host},t.prototype.name=function(){return this.repoInfo_.namespace},t.prototype.serverTime=function(){var t=this.infoData_.getNode(new W(".info/serverTimeOffset")).val()||0;return(new Date).getTime()+t},t.prototype.generateServerValues=function(){return(t=(t={timestamp:this.serverTime()})||{}).timestamp=t.timestamp||(new Date).getTime(),t;var t},t.prototype.onDataUpdate_=function(t,e,n,r){this.dataUpdateCount++;var i=new W(t);e=this.interceptServerDataCallback_?this.interceptServerDataCallback_(t,e):e;var o=[];if(r)if(n){var a=s.map(e,(function(t){return Yt(t)}));o=this.serverSyncTree_.applyTaggedQueryMerge(i,a,r)}else{var c=Yt(e);o=this.serverSyncTree_.applyTaggedQueryOverwrite(i,c,r)}else if(n){var u=s.map(e,(function(t){return Yt(t)}));o=this.serverSyncTree_.applyServerMerge(i,u)}else{var l=Yt(e);o=this.serverSyncTree_.applyServerOverwrite(i,l)}var h=i;o.length>0&&(h=this.rerunTransactions_(i)),this.eventQueue_.raiseEventsForChangedPath(h,o)},t.prototype.interceptServerData_=function(t){this.interceptServerDataCallback_=t},t.prototype.onConnectStatus_=function(t){this.updateInfo_("connected",t),!1===t&&this.runOnDisconnectEvents_()},t.prototype.onServerInfoUpdate_=function(t){var e=this;j(t,(function(t,n){e.updateInfo_(t,n)}))},t.prototype.updateInfo_=function(t,e){var n=new W("/.info/"+t),r=Yt(e);this.infoData_.updateSnapshot(n,r);var i=this.infoSyncTree_.applyServerOverwrite(n,r);this.eventQueue_.raiseEventsForChangedPath(n,i)},t.prototype.getNextWriteId_=function(){return this.nextWriteId_++},t.prototype.setWithPriority=function(t,e,n,r){var i=this;this.log_("set",{path:t.toString(),value:e,priority:n});var o=this.generateServerValues(),s=Yt(e,n),a=this.serverSyncTree_.calcCompleteEventCache(t),c=ue(s,a,o),u=this.getNextWriteId_(),l=this.serverSyncTree_.applyUserOverwrite(t,c,u,!0);this.eventQueue_.queueEvents(l),this.server_.put(t.toString(),s.val(!0),(function(e,n){var o="ok"===e;o||k("set at "+t+" failed: "+e);var s=i.serverSyncTree_.ackUserWrite(u,!o);i.eventQueue_.raiseEventsForChangedPath(t,s),i.callOnCompleteCallback(r,e,n)}));var h=this.abortTransactions_(t);this.rerunTransactions_(h),this.eventQueue_.raiseEventsForChangedPath(h,[])},t.prototype.update=function(t,e,n){var r=this;this.log_("update",{path:t.toString(),value:e});var i=!0,o=this.generateServerValues(),s={};if(j(e,(function(e,n){i=!1,s[e]=ce(t.child(e),Yt(n),r.serverSyncTree_,o)})),i)E("update() called with empty data.  Don't do anything."),this.callOnCompleteCallback(n,"ok");else{var a=this.getNextWriteId_(),c=this.serverSyncTree_.applyUserMerge(t,s,a);this.eventQueue_.queueEvents(c),this.server_.merge(t.toString(),e,(function(e,i){var o="ok"===e;o||k("update at "+t+" failed: "+e);var s=r.serverSyncTree_.ackUserWrite(a,!o),c=s.length>0?r.rerunTransactions_(t):t;r.eventQueue_.raiseEventsForChangedPath(c,s),r.callOnCompleteCallback(n,e,i)})),j(e,(function(e){var n=r.abortTransactions_(t.child(e));r.rerunTransactions_(n)})),this.eventQueue_.raiseEventsForChangedPath(t,[])}},t.prototype.runOnDisconnectEvents_=function(){var t=this;this.log_("onDisconnectEvents");var e=this.generateServerValues(),n=new pe;this.onDisconnect_.forEachTree(W.Empty,(function(r,i){var o=ce(r,i,t.serverSyncTree_,e);n.remember(r,o)}));var r=[];
589n.forEachTree(W.Empty,(function(e,n){r=r.concat(t.serverSyncTree_.applyServerOverwrite(e,n));var i=t.abortTransactions_(e);t.rerunTransactions_(i)})),this.onDisconnect_=new pe,this.eventQueue_.raiseEventsForChangedPath(W.Empty,r)},t.prototype.onDisconnectCancel=function(t,e){var n=this;this.server_.onDisconnectCancel(t.toString(),(function(r,i){"ok"===r&&n.onDisconnect_.forget(t),n.callOnCompleteCallback(e,r,i)}))},t.prototype.onDisconnectSet=function(t,e,n){var r=this,i=Yt(e);this.server_.onDisconnectPut(t.toString(),i.val(!0),(function(e,o){"ok"===e&&r.onDisconnect_.remember(t,i),r.callOnCompleteCallback(n,e,o)}))},t.prototype.onDisconnectSetWithPriority=function(t,e,n,r){var i=this,o=Yt(e,n);this.server_.onDisconnectPut(t.toString(),o.val(!0),(function(e,n){"ok"===e&&i.onDisconnect_.remember(t,o),i.callOnCompleteCallback(r,e,n)}))},t.prototype.onDisconnectUpdate=function(t,e,n){var r=this;if(s.isEmpty(e))return E("onDisconnect().update() called with empty data.  Don't do anything."),void this.callOnCompleteCallback(n,"ok");this.server_.onDisconnectMerge(t.toString(),e,(function(i,o){"ok"===i&&j(e,(function(e,n){var i=Yt(n);r.onDisconnect_.remember(t.child(e),i)})),r.callOnCompleteCallback(n,i,o)}))},t.prototype.addEventCallbackForQuery=function(t,e){var n;n=".info"===t.path.getFront()?this.infoSyncTree_.addEventRegistration(t,e):this.serverSyncTree_.addEventRegistration(t,e),this.eventQueue_.raiseEventsAtPath(t.path,n)},t.prototype.removeEventCallbackForQuery=function(t,e){var n;n=".info"===t.path.getFront()?this.infoSyncTree_.removeEventRegistration(t,e):this.serverSyncTree_.removeEventRegistration(t,e),this.eventQueue_.raiseEventsAtPath(t.path,n)},t.prototype.interrupt=function(){this.persistentConnection_&&this.persistentConnection_.interrupt("repo_interrupt")},t.prototype.resume=function(){this.persistentConnection_&&this.persistentConnection_.resume("repo_interrupt")},t.prototype.stats=function(t){if(void 0===t&&(t=!1),"undefined"!=typeof console){var e;t?(this.statsListener_||(this.statsListener_=new Be(this.stats_)),e=this.statsListener_.get()):e=this.stats_.get();var n=Object.keys(e).reduce((function(t,e){return Math.max(e.length,t)}),0);j(e,(function(t,e){for(var r=t,i=t.length;i<n+2;i++)r+=" ";console.log(r+e)}))}},t.prototype.statsIncrementCounter=function(t){this.stats_.incrementCounter(t),this.statsReporter_.includeStat(t)},t.prototype.log_=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="";this.persistentConnection_&&(n=this.persistentConnection_.id+":"),E.apply(void 0,o.__spread([n],t))},t.prototype.callOnCompleteCallback=function(t,e,n){t&&B((function(){if("ok"===e)t(null);else{var r=(e||"error").toUpperCase(),i=r;n&&(i+=": "+n);var o=new Error(i);o.code=r,t(o)}}))},Object.defineProperty(t.prototype,"database",{get:function(){return this.__database||(this.__database=new En(this))},enumerable:!1,configurable:!0}),t}(),dn=function(){function t(e){this.indexedFilter_=new xe(e.getIndex()),this.index_=e.getIndex(),this.startPost_=t.getStartPost_(e),this.endPost_=t.getEndPost_(e)}return t.prototype.getStartPost=function(){return this.startPost_},t.prototype.getEndPost=function(){return this.endPost_},t.prototype.matches=function(t){return this.index_.compare(this.getStartPost(),t)<=0&&this.index_.compare(t,this.getEndPost())<=0},t.prototype.updateChild=function(t,e,n,r,i,o){return this.matches(new _t(e,n))||(n=Wt.EMPTY_NODE),this.indexedFilter_.updateChild(t,e,n,r,i,o)},t.prototype.updateFullNode=function(t,e,n){e.isLeafNode()&&(e=Wt.EMPTY_NODE);var r=e.withIndex(this.index_);r=r.updatePriority(Wt.EMPTY_NODE);var i=this;return e.forEachChild(Nt,(function(t,e){i.matches(new _t(t,e))||(r=r.updateImmediateChild(t,Wt.EMPTY_NODE))})),this.indexedFilter_.updateFullNode(t,r,n)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.indexedFilter_},t.prototype.getIndex=function(){return this.index_},t.getStartPost_=function(t){if(t.hasStart()){var e=t.getIndexStartName();return t.getIndex().makePost(t.getIndexStartValue(),e)}return t.getIndex().minPost()},t.getEndPost_=function(t){if(t.hasEnd()){var e=t.getIndexEndName();return t.getIndex().makePost(t.getIndexEndValue(),e)}return t.getIndex().maxPost()},t}
589(),fn=function(){function t(t){this.rangedFilter_=new dn(t),this.index_=t.getIndex(),this.limit_=t.getLimit(),this.reverse_=!t.isViewFromLeft()}return t.prototype.updateChild=function(t,e,n,r,i,o){return this.rangedFilter_.matches(new _t(e,n))||(n=Wt.EMPTY_NODE),t.getImmediateChild(e).equals(n)?t:t.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(t,e,n,r,i,o):this.fullLimitUpdateChild_(t,e,n,i,o)},t.prototype.updateFullNode=function(t,e,n){var r;if(e.isLeafNode()||e.isEmpty())r=Wt.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<e.numChildren()&&e.isIndexed(this.index_)){r=Wt.EMPTY_NODE.withIndex(this.index_);var i=void 0;i=this.reverse_?e.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):e.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);for(var o=0;i.hasNext()&&o<this.limit_;){var s=i.getNext();if(!(this.reverse_?this.index_.compare(this.rangedFilter_.getStartPost(),s)<=0:this.index_.compare(s,this.rangedFilter_.getEndPost())<=0))break;r=r.updateImmediateChild(s.name,s.node),o++}}else{r=(r=e.withIndex(this.index_)).updatePriority(Wt.EMPTY_NODE);var a=void 0,c=void 0,u=void 0;i=void 0;if(this.reverse_){i=r.getReverseIterator(this.index_),a=this.rangedFilter_.getEndPost(),c=this.rangedFilter_.getStartPost();var l=this.index_.getCompare();u=function(t,e){return l(e,t)}}else i=r.getIterator(this.index_),a=this.rangedFilter_.getStartPost(),c=this.rangedFilter_.getEndPost(),u=this.index_.getCompare();o=0;for(var h=!1;i.hasNext();){s=i.getNext();!h&&u(a,s)<=0&&(h=!0),h&&o<this.limit_&&u(s,c)<=0?o++:r=r.updateImmediateChild(s.name,Wt.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(t,r,n)},t.prototype.updatePriority=function(t,e){return t},t.prototype.filtersNodes=function(){return!0},t.prototype.getIndexedFilter=function(){return this.rangedFilter_.getIndexedFilter()},t.prototype.getIndex=function(){return this.index_},t.prototype.fullLimitUpdateChild_=function(t,e,n,r,i){var o;if(this.reverse_){var a=this.index_.getCompare();o=function(t,e){return a(e,t)}}else o=this.index_.getCompare();var c=t;s.assert(c.numChildren()===this.limit_,"");var u=new _t(e,n),l=this.reverse_?c.getFirstChild(this.index_):c.getLastChild(this.index_),h=this.rangedFilter_.matches(u);if(c.hasChild(e)){for(var p=c.getImmediateChild(e),d=r.getChildAfterChild(this.index_,l,this.reverse_);null!=d&&(d.name===e||c.hasChild(d.name));)d=r.getChildAfterChild(this.index_,d,this.reverse_);var f=null==d?1:o(d,u);if(h&&!n.isEmpty()&&f>=0)return null!=i&&i.trackChildChange(Ee.childChangedChange(e,n,p)),c.updateImmediateChild(e,n);null!=i&&i.trackChildChange(Ee.childRemovedChange(e,p));var v=c.updateImmediateChild(e,Wt.EMPTY_NODE);return null!=d&&this.rangedFilter_.matches(d)?(null!=i&&i.trackChildChange(Ee.childAddedChange(d.name,d.node)),v.updateImmediateChild(d.name,d.node)):v}return n.isEmpty()?t:h&&o(l,u)>=0?(null!=i&&(i.trackChildChange(Ee.childRemovedChange(l.name,l.node)),i.trackChildChange(Ee.childAddedChange(e,n))),c.updateImmediateChild(e,n).updateImmediateChild(l.name,Wt.EMPTY_NODE)):t},t}(),vn=function(){function t(){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_=Nt}return t.prototype.hasStart=function(){return this.startSet_},t.prototype.isViewFromLeft=function(){return""===this.viewFrom_?this.startSet_:this.viewFrom_===t.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT},t.prototype.getIndexStartValue=function(){return s.assert(this.startSet_,"Only valid if start has been set"),this.indexStartValue_},t.prototype.getIndexStartName=function(){return s.assert(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:A},t.prototype.hasEnd=function(){return this.endSet_},t.prototype.getIndexEndValue=function(){return s.assert(this.endSet_,"Only valid if end has been set"),this.indexEndValue_},t.prototype.getIndexEndName=function(){return s.assert(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:R},t.prototype.hasLimit=function(){return this.limitSet_},t.prototype.hasAnchoredLimit=function(){return this.limitSet_&&""!==this.viewFrom_},t.prototype.getLimit=function(){return s.assert(this.limitSet_,"Only valid if limit has been set"),this.limit_},t.prototype.getIndex=function(){return this.index_},t.prototype.copy_=function(){var e=new t;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e},t.prototype.limit=function(t){var e=this.copy_();return e.limitSet_=!0,e.limit_=t,e.viewFrom_="",e},t.prototype.limitToFirst=function(e){var n=this.copy_();return n.limitSet_=!0,n.limit_=e,n.viewFrom_=t.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_LEFT,n},t.prototype.limitToLast=function(e){var n=this.copy_();return n.limitSet_=!0,n.limit_=e,n.viewFrom_=t.WIRE_PROTOCOL_CONSTANTS_.VIEW_FROM_RIGHT,n},t.prototype.startAt=function(t,e){var n=this.copy_();return n.startSet_=!0,void 0===t&&(t=null),n.indexStartValue_=t,null!=e?(n.startNameSet_=!0,n.indexStartName_=e):(n.startNameSet_=!1,n.indexStartName_=""),n},t.prototype.endAt=function(t,e){var n=this.copy_();return n.endSet_=!0,void 0===t&&(t=null),n.indexEndValue_=t,void 0!==e?(n.endNameSet_=!0,n.indexEndName_=e):(n.endNameSet_=!1,n.indexEndName_=""),n},t.prototype.orderBy=function(t){var e=this.copy_();return e.index_=t,e},t.prototype.getQueryObject=function(){var e=t.WIRE_PROTOCOL_CONSTANTS_,n={};
589if(this.startSet_&&(n[e.INDEX_START_VALUE]=this.indexStartValue_,this.startNameSet_&&(n[e.INDEX_START_NAME]=this.indexStartName_)),this.endSet_&&(n[e.INDEX_END_VALUE]=this.indexEndValue_,this.endNameSet_&&(n[e.INDEX_END_NAME]=this.indexEndName_)),this.limitSet_){n[e.LIMIT]=this.limit_;var r=this.viewFrom_;""===r&&(r=this.isViewFromLeft()?e.VIEW_FROM_LEFT:e.VIEW_FROM_RIGHT),n[e.VIEW_FROM]=r}return this.index_!==Nt&&(n[e.INDEX]=this.index_.toString()),n},t.prototype.loadsAllData=function(){return!(this.startSet_||this.endSet_||this.limitSet_)},t.prototype.isDefault=function(){return this.loadsAllData()&&this.index_===Nt},t.prototype.getNodeFilter=function(){return this.loadsAllData()?new xe(this.getIndex()):this.hasLimit()?new fn(this):new dn(this)},t.prototype.toRestQueryStringParameters=function(){var e,n=t.REST_QUERY_CONSTANTS_,r={};return this.isDefault()?r:(this.index_===Nt?e=n.PRIORITY_INDEX:this.index_===Gt?e=n.VALUE_INDEX:this.index_===Ct?e=n.KEY_INDEX:(s.assert(this.index_ instanceof Qt,"Unrecognized index type!"),e=this.index_.toString()),r[n.ORDER_BY]=s.stringify(e),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)},t.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"},t.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"},t.DEFAULT=new t,t}(),gn=function(t){function e(e,n){if(!(e instanceof pn))throw new Error("new Reference() no longer supported - use app.database().");return t.call(this,e,n,vn.DEFAULT,!1)||this}return o.__extends(e,t),e.prototype.getKey=function(){return s.validateArgCount("Reference.key",0,0,arguments.length),this.path.isEmpty()?null:this.path.getBack()},e.prototype.child=function(t){return s.validateArgCount("Reference.child",1,1,arguments.length),"number"==typeof t?t=String(t):t instanceof W||(null===this.path.getFront()?dt("Reference.child",1,t,!1):pt("Reference.child",1,t,!1)),new e(this.repo,this.path.child(t))},e.prototype.getParent=function(){s.validateArgCount("Reference.parent",0,0,arguments.length);var t=this.path.parent();return null===t?null:new e(this.repo,t)},e.prototype.getRoot=function(){s.validateArgCount("Reference.root",0,0,arguments.length);for(var t=this;null!==t.getParent();)t=t.getParent();return t},e.prototype.databaseProp=function(){return this.repo.database},e.prototype.set=function(t,e){s.validateArgCount("Reference.set",1,2,arguments.length),ft("Reference.set",this.path),st("Reference.set",1,t,this.path,!1),s.validateCallback("Reference.set",2,e,!0);var n=new s.Deferred;return this.repo.setWithPriority(this.path,t,null,n.wrapCallback(e)),n.promise},e.prototype.update=function(t,e){if(s.validateArgCount("Reference.update",1,2,arguments.length),ft("Reference.update",this.path),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,k("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.")}ct("Reference.update",1,t,this.path,!1),s.validateCallback("Reference.update",2,e,!0);var i=new s.Deferred;return this.repo.update(this.path,t,i.wrapCallback(e)),i.promise},e.prototype.setWithPriority=function(t,e,n){if(s.validateArgCount("Reference.setWithPriority",2,3,arguments.length),ft("Reference.setWithPriority",this.path),st("Reference.setWithPriority",1,t,this.path,!1),ut("Reference.setWithPriority",2,e,!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,t,e,r.wrapCallback(n)),r.promise},e.prototype.remove=function(t){return s.validateArgCount("Reference.remove",0,1,arguments.length),ft("Reference.remove",this.path),s.validateCallback("Reference.remove",1,t,!0),this.set(null,t)},e.prototype.transaction=function(t,e,n){if(s.validateArgCount("Reference.transaction",1,3,arguments.length),ft("Reference.transaction",this.path),s.validateCallback("Reference.transaction",1,t,!1),s.validateCallback("Reference.transaction",2,e,!0),gt("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 e&&r.promise.catch((function(){}));var i=function(t,n,i){t?r.reject(t):r.resolve(new yt(n,i)),"function"==typeof e&&e(t,n,i)};return this.repo.startTransaction(this.path,t,i,n),r.promise},e.prototype.setPriority=function(t,e){s.validateArgCount("Reference.setPriority",1,2,arguments.length),ft("Reference.setPriority",this.path),ut("Reference.setPriority",1,t,!1),s.validateCallback("Reference.setPriority",2,e,!0);var n=new s.Deferred;return this.repo.setWithPriority(this.path.child(".priority"),t,null,n.wrapCallback(e)),n.promise},e.prototype.push=function(t,e){s.validateArgCount("Reference.push",0,2,arguments.length),ft("Reference.push",this.path),st("Reference.push",1,t,this.path,!0),s.validateCallback("Reference.push",2,e,!0);var n,r=this.repo.serverTime(),i=bt(r),o=this.child(i),a=this.child(i);return n=null!=t?o.set(t,e).then((function(){return a})):Promise.resolve(a),o.then=n.then.bind(n),o.catch=n.then.bind(n,void 0),"function"==typeof e&&n.catch((function(){})),o},e.prototype.onDisconnect=function(){return ft("Reference.onDisconnect",this.path),new mt(this.repo,this.path)},Object.defineProperty(e.prototype,"database",{get:function(){return this.databaseProp()}
589,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"key",{get:function(){return this.getKey()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.getParent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this.getRoot()},enumerable:!1,configurable:!0}),e}(ne);
590/**
591 * @license
592 * Copyright 2017 Google LLC
593 *
594 * Licensed under the Apache License, Version 2.0 (the "License");
595 * you may not use this file except in compliance with the License.
596 * You may obtain a copy of the License at
597 *
598 *   http://www.apache.org/licenses/LICENSE-2.0
599 *
600 * Unless required by applicable law or agreed to in writing, software
601 * distributed under the License is distributed on an "AS IS" BASIS,
602 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
603 * See the License for the specific language governing permissions and
604 * limitations under the License.
605 */ne.__referenceConstructor=gn,Pe.__referenceConstructor=gn;
606/**
607 * @license
608 * Copyright 2017 Google LLC
609 *
610 * Licensed under the Apache License, Version 2.0 (the "License");
611 * you may not use this file except in compliance with the License.
612 * You may obtain a copy of the License at
613 *
614 *   http://www.apache.org/licenses/LICENSE-2.0
615 *
616 * Unless required by applicable law or agreed to in writing, software
617 * distributed under the License is distributed on an "AS IS" BASIS,
618 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
619 * See the License for the specific language governing permissions and
620 * limitations under the License.
621 */
622var mn,yn=function(){this.children={},this.childCount=0,this.value=null},bn=function(){function t(t,e,n){void 0===t&&(t=""),void 0===e&&(e=null),void 0===n&&(n=new yn),this.name_=t,this.parent_=e,this.node_=n}return t.prototype.subTree=function(e){for(var n=e instanceof W?e:new W(e),r=this,i=n.getFront();null!==i;){r=new t(i,r,s.safeGet(r.node_.children,i)||new yn),i=(n=n.popFront()).getFront()}return r},t.prototype.getValue=function(){return this.node_.value},t.prototype.setValue=function(t){s.assert(void 0!==t,"Cannot set value to undefined"),this.node_.value=t,this.updateParents_()},t.prototype.clear=function(){this.node_.value=null,this.node_.children={},this.node_.childCount=0,this.updateParents_()},t.prototype.hasChildren=function(){return this.node_.childCount>0},t.prototype.isEmpty=function(){return null===this.getValue()&&!this.hasChildren()},t.prototype.forEachChild=function(e){var n=this;j(this.node_.children,(function(r,i){e(new t(r,n,i))}))},t.prototype.forEachDescendant=function(t,e,n){e&&!n&&t(this),this.forEachChild((function(e){e.forEachDescendant(t,!0,n)})),e&&n&&t(this)},t.prototype.forEachAncestor=function(t,e){for(var n=e?this:this.parent();null!==n;){if(t(n))return!0;n=n.parent()}return!1},t.prototype.forEachImmediateDescendantWithValue=function(t){this.forEachChild((function(e){null!==e.getValue()?t(e):e.forEachImmediateDescendantWithValue(t)}))},t.prototype.path=function(){return new W(null===this.parent_?this.name_:this.parent_.path()+"/"+this.name_)},t.prototype.name=function(){return this.name_},t.prototype.parent=function(){return this.parent_},t.prototype.updateParents_=function(){null!==this.parent_&&this.parent_.updateChild_(this.name_,this)},t.prototype.updateChild_=function(t,e){var n=e.isEmpty(),r=s.contains(this.node_.children,t);n&&r?(delete this.node_.children[t],this.node_.childCount--,this.updateParents_()):n||r||(this.node_.children[t]=e.node_,this.node_.childCount++,this.updateParents_())},t}();!function(t){t[t.RUN=0]="RUN",t[t.SENT=1]="SENT",t[t.COMPLETED=2]="COMPLETED",t[t.SENT_NEEDS_ABORT=3]="SENT_NEEDS_ABORT",t[t.NEEDS_ABORT=4]="NEEDS_ABORT"}(mn||(mn={})),pn.MAX_TRANSACTION_RETRIES_=25,pn.prototype.transactionsInit_=function(){this.transactionQueueTree_=new bn},pn.prototype.startTransaction=function(t,e,n,r){this.log_("transaction on "+t);var i=function(){},o=new gn(this,t);o.on("value",i);var a={path:t,update:e,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},c=this.getLatestState_(t);a.currentInputSnapshot=c;var u=a.update(c.val());if(void 0===u){if(a.unwatcher(),a.currentOutputSnapshotRaw=null,a.currentOutputSnapshotResolved=null,a.onComplete){var l=new Xt(a.currentInputSnapshot,new gn(this,a.path),Nt);a.onComplete(null,!1,l)}}else{at("transaction failed: Data returned ",u,a.path),a.status=mn.RUN;var h=this.transactionQueueTree_.subTree(t),p=h.getValue()||[];p.push(a),h.setValue(p);var d=void 0;if("object"==typeof u&&null!==u&&s.contains(u,".priority"))d=s.safeGet(u,".priority"),s.assert(ot(d),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.");else d=(this.serverSyncTree_.calcCompleteEventCache(t)||Wt.EMPTY_NODE).getPriority().val();d=d;var f=this.generateServerValues(),v=Yt(u,d),g=ue(v,c,f);a.currentOutputSnapshotRaw=v,a.currentOutputSnapshotResolved=g,a.currentWriteId=this.getNextWriteId_();var m=this.serverSyncTree_.applyUserOverwrite(t,g,a.currentWriteId,a.applyLocally);this.eventQueue_.raiseEventsForChangedPath(t,m),this.sendReadyTransactions_()}},pn.prototype.getLatestState_=function(t,e){return this.serverSyncTree_.calcCompleteEventCache(t,e)||Wt.EMPTY_NODE},pn.prototype.sendReadyTransactions_=function(t){var e=this;if(void 0===t&&(t=this.transactionQueueTree_),t||this.pruneCompletedTransactionsBelowNode_(t),null!==t.getValue()){var n=this.buildTransactionQueue_(t);s.assert(n.length>0,"Sending zero length transaction queue"),n.every((function(t){return t.status===mn.RUN}))&&this.sendTransactionQueue_(t.path(),n)}else t.hasChildren()&&t.forEachChild((function(t){e.sendReadyTransactions_(t)}))},pn.prototype.sendTransactionQueue_=function(t,e){for(var n=this,r=e.map((function(t){return t.currentWriteId})),i=this.getLatestState_(t,r),o=i,a=i.hash(),c=0;c<e.length;c++){var u=e[c];s.assert(u.status===mn.RUN,"tryToSendTransactionQueue_: items in queue should all be run."),u.status=mn.SENT,u.retryCount++;var l=W.relativePath(t,u.path);o=o.updateChild(l,u.currentOutputSnapshotRaw)}var h=o.val(!0),p=t;this.server_.put(p.toString(),h,(function(r){n.log_("transaction put response",{path:p.toString(),status:r});var i=[];if("ok"===r){for(var o=[],s=0;s<e.length;
622s++){if(e[s].status=mn.COMPLETED,i=i.concat(n.serverSyncTree_.ackUserWrite(e[s].currentWriteId)),e[s].onComplete){var a=e[s].currentOutputSnapshotResolved,c=new gn(n,e[s].path),u=new Xt(a,c,Nt);o.push(e[s].onComplete.bind(null,null,!0,u))}e[s].unwatcher()}n.pruneCompletedTransactionsBelowNode_(n.transactionQueueTree_.subTree(t)),n.sendReadyTransactions_(),n.eventQueue_.raiseEventsForChangedPath(t,i);for(s=0;s<o.length;s++)B(o[s])}else{if("datastale"===r)for(s=0;s<e.length;s++)e[s].status===mn.SENT_NEEDS_ABORT?e[s].status=mn.NEEDS_ABORT:e[s].status=mn.RUN;else{k("transaction at "+p.toString()+" failed: "+r);for(s=0;s<e.length;s++)e[s].status=mn.NEEDS_ABORT,e[s].abortReason=r}n.rerunTransactions_(t)}}),a)},pn.prototype.rerunTransactions_=function(t){var e=this.getAncestorTransactionNode_(t),n=e.path(),r=this.buildTransactionQueue_(e);return this.rerunTransactionQueue_(r,n),n},pn.prototype.rerunTransactionQueue_=function(t,e){if(0!==t.length){for(var n,r=[],i=[],o=t.filter((function(t){return t.status===mn.RUN})).map((function(t){return t.currentWriteId})),a=0;a<t.length;a++){var c=t[a],u=W.relativePath(e,c.path),l=!1,h=void 0;if(s.assert(null!==u,"rerunTransactionsUnderNode_: relativePath should not be null."),c.status===mn.NEEDS_ABORT)l=!0,h=c.abortReason,i=i.concat(this.serverSyncTree_.ackUserWrite(c.currentWriteId,!0));else if(c.status===mn.RUN)if(c.retryCount>=pn.MAX_TRANSACTION_RETRIES_)l=!0,h="maxretry",i=i.concat(this.serverSyncTree_.ackUserWrite(c.currentWriteId,!0));else{var p=this.getLatestState_(c.path,o);c.currentInputSnapshot=p;var d=t[a].update(p.val());if(void 0!==d){at("transaction failed: Data returned ",d,c.path);var f=Yt(d);"object"==typeof d&&null!=d&&s.contains(d,".priority")||(f=f.updatePriority(p.getPriority()));var v=c.currentWriteId,g=this.generateServerValues(),m=ue(f,p,g);c.currentOutputSnapshotRaw=f,c.currentOutputSnapshotResolved=m,c.currentWriteId=this.getNextWriteId_(),o.splice(o.indexOf(v),1),i=(i=i.concat(this.serverSyncTree_.applyUserOverwrite(c.path,m,c.currentWriteId,c.applyLocally))).concat(this.serverSyncTree_.ackUserWrite(v,!0))}else l=!0,h="nodata",i=i.concat(this.serverSyncTree_.ackUserWrite(c.currentWriteId,!0))}if(this.eventQueue_.raiseEventsForChangedPath(e,i),i=[],l&&(t[a].status=mn.COMPLETED,n=t[a].unwatcher,setTimeout(n,Math.floor(0)),t[a].onComplete))if("nodata"===h){var y=new gn(this,t[a].path),b=t[a].currentInputSnapshot,_=new Xt(b,y,Nt);r.push(t[a].onComplete.bind(null,null,!1,_))}else r.push(t[a].onComplete.bind(null,new Error(h),!1,null))}this.pruneCompletedTransactionsBelowNode_(this.transactionQueueTree_);for(a=0;a<r.length;a++)B(r[a]);this.sendReadyTransactions_()}},pn.prototype.getAncestorTransactionNode_=function(t){var e,n=this.transactionQueueTree_;for(e=t.getFront();null!==e&&null===n.getValue();)n=n.subTree(e),e=(t=t.popFront()).getFront();return n},pn.prototype.buildTransactionQueue_=function(t){var e=[];return this.aggregateTransactionQueuesForNode_(t,e),e.sort((function(t,e){return t.order-e.order})),e},pn.prototype.aggregateTransactionQueuesForNode_=function(t,e){var n=this,r=t.getValue();if(null!==r)for(var i=0;i<r.length;i++)e.push(r[i]);t.forEachChild((function(t){n.aggregateTransactionQueuesForNode_(t,e)}))},pn.prototype.pruneCompletedTransactionsBelowNode_=function(t){var e=this,n=t.getValue();if(n){for(var r=0,i=0;i<n.length;i++)n[i].status!==mn.COMPLETED&&(n[r]=n[i],r++);n.length=r,t.setValue(n.length>0?n:null)}t.forEachChild((function(t){e.pruneCompletedTransactionsBelowNode_(t)}))},pn.prototype.abortTransactions_=function(t){var e=this,n=this.getAncestorTransactionNode_(t).path(),r=this.transactionQueueTree_.subTree(t);return r.forEachAncestor((function(t){e.abortTransactionsOnNode_(t)})),this.abortTransactionsOnNode_(r),r.forEachDescendant((function(t){e.abortTransactionsOnNode_(t)})),n},pn.prototype.abortTransactionsOnNode_=function(t){var e=t.getValue();if(null!==e){for(var n=[],r=[],i=-1,o=0;o<e.length;o++)if(e[o].status===mn.SENT_NEEDS_ABORT);else if(e[o].status===mn.SENT)s.assert(i===o-1,"All SENT items should be at beginning of queue."),i=o,e[o].status=mn.SENT_NEEDS_ABORT,e[o].abortReason="set";else if(s.assert(e[o].status===mn.RUN,"Unexpected transaction status in abort"),e[o].unwatcher(),r
622=r.concat(this.serverSyncTree_.ackUserWrite(e[o].currentWriteId,!0)),e[o].onComplete){n.push(e[o].onComplete.bind(null,new Error("set"),!1,null))}-1===i?t.setValue(null):e.length=i+1,this.eventQueue_.raiseEventsForChangedPath(t.path(),r);for(o=0;o<n.length;o++)B(n[o])}};
623/**
624 * @license
625 * Copyright 2017 Google LLC
626 *
627 * Licensed under the Apache License, Version 2.0 (the "License");
628 * you may not use this file except in compliance with the License.
629 * You may obtain a copy of the License at
630 *
631 *   http://www.apache.org/licenses/LICENSE-2.0
632 *
633 * Unless required by applicable law or agreed to in writing, software
634 * distributed under the License is distributed on an "AS IS" BASIS,
635 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
636 * See the License for the specific language governing permissions and
637 * limitations under the License.
638 */
639var _n,wn=function(){function t(t,e){var n=this;this.app_=t,this.authProvider_=e,this.auth_=null,this.auth_=e.getImmediate({optional:!0}),this.auth_||e.get().then((function(t){return n.auth_=t}))}return t.prototype.getToken=function(t){return this.auth_?this.auth_.getToken(t).catch((function(t){return t&&"auth/token-not-initialized"===t.code?(E("Got auth/token-not-initialized error.  Treating as null token."),null):Promise.reject(t)})):Promise.resolve(null)},t.prototype.addTokenChangeListener=function(t){this.auth_?this.auth_.addAuthTokenListener(t):(setTimeout((function(){return t(null)}),0),this.authProvider_.get().then((function(e){return e.addAuthTokenListener(t)})))},t.prototype.removeTokenChangeListener=function(t){this.authProvider_.get().then((function(e){return e.removeAuthTokenListener(t)}))},t.prototype.notifyForInvalidToken=function(){var t='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?t+='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?t+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':t+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',k(t)},t}(),Sn=function(){function t(){}return t.prototype.getToken=function(e){return Promise.resolve({accessToken:t.EMULATOR_AUTH_TOKEN})},t.prototype.addTokenChangeListener=function(e){e(t.EMULATOR_AUTH_TOKEN)},t.prototype.removeTokenChangeListener=function(t){},t.prototype.notifyForInvalidToken=function(){},t.EMULATOR_AUTH_TOKEN="owner",t}(),Cn=function(){function t(){this.repos_={},this.useRestClient_=!1}return t.getInstance=function(){return _n||(_n=new t),_n},t.prototype.interrupt=function(){var t,e,n,r;try{for(var i=o.__values(Object.keys(this.repos_)),s=i.next();!s.done;s=i.next()){var a=s.value;try{for(var c=(n=void 0,o.__values(Object.keys(this.repos_[a]))),u=c.next();!u.done;u=c.next()){var l=u.value;this.repos_[a][l].interrupt()}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}},t.prototype.resume=function(){var t,e,n,r;try{for(var i=o.__values(Object.keys(this.repos_)),s=i.next();!s.done;s=i.next()){var a=s.value;try{for(var c=(n=void 0,o.__values(Object.keys(this.repos_[a]))),u=c.next();!u.done;u=c.next()){var l=u.value;this.repos_[a][l].resume()}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}},t.prototype.databaseFromApp=function(t,e,n,i){var o=n||t.options.databaseURL;void 0===o&&(t.options.projectId||I("Can't determine Firebase Database URL. Be sure to include  a Project ID when calling firebase.initializeApp()."),E("Using default host for project ",t.options.projectId),o=t.options.projectId+"-default-rtdb.firebaseio.com");var s,a=Z(o,i),c=a.repoInfo,u=void 0;void 0!==r&&(u=r.env.FIREBASE_DATABASE_EMULATOR_HOST),u?(s=!0,o="http://"+u+"?ns="+c.namespace,c=(a=Z(o,i)).repoInfo):s=!a.repoInfo.secure;var l=i&&s?new Sn:new wn(t,e);return vt("Invalid Firebase Database URL",1,a),a.path.isEmpty()||I("Database URL must point to the root of a Firebase Database (not including a child path)."),this.createRepo(c,t,l).database},t.prototype.deleteRepo=function(t){var e=s.safeGet(this.repos_,t.app.name);e&&s.safeGet(e,t.repoInfo_.toURLString())===t||I("Database "+t.app.name+"("+t.repoInfo_+") has already been deleted."),t.interrupt(),delete e[t.repoInfo_.toURLString()]},t.prototype.createRepo=function(t,e,n){var r=s.safeGet(this.repos_,e.name);r||(r={},this.repos_[e.name]=r);var i=s.safeGet(r,t.toURLString());return i&&I("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),i=new pn(t,this.useRestClient_,e,n),r[t.toURLString()]=i,i},t.prototype.forceRestClient=function(t){this.useRestClient_=t},t}(),En=function(){function t(t){this.repo_=t,t instanceof pn||I("Don't call new Database() directly - please use firebase.database()."),this.root_=new gn(t,W.Empty),this.INTERNAL=new xn(this)}return Object.defineProperty(t.prototype,"app",{get:function(){return this.repo_.app}
639,enumerable:!1,configurable:!0}),t.prototype.ref=function(t){return this.checkDeleted_("ref"),s.validateArgCount("database.ref",0,1,arguments.length),t instanceof gn?this.refFromURL(t.toString()):void 0!==t?this.root_.child(t):this.root_},t.prototype.refFromURL=function(t){var e="database.refFromURL";this.checkDeleted_(e),s.validateArgCount(e,1,1,arguments.length);var n=Z(t,this.repo_.repoInfo_.nodeAdmin);vt(e,1,n);var r=n.repoInfo;return r.host!==this.repo_.repoInfo_.host&&I(e+": Host name does not match the current database: (found "+r.host+" but expected "+this.repo_.repoInfo_.host+")"),this.ref(n.path.toString())},t.prototype.checkDeleted_=function(t){null===this.repo_&&I("Cannot call "+t+" on a deleted database.")},t.prototype.goOffline=function(){s.validateArgCount("database.goOffline",0,0,arguments.length),this.checkDeleted_("goOffline"),this.repo_.interrupt()},t.prototype.goOnline=function(){s.validateArgCount("database.goOnline",0,0,arguments.length),this.checkDeleted_("goOnline"),this.repo_.resume()},t.ServerValue={TIMESTAMP:{".sv":"timestamp"},increment:function(t){return{".sv":{increment:t}}}},t}(),xn=function(){function t(t){this.database=t}return t.prototype.delete=function(){return o.__awaiter(this,void 0,void 0,(function(){return o.__generator(this,(function(t){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]}))}))},t}(),Tn=Object.freeze({__proto__:null,forceLongPolling:function(){rn.forceDisallow(),Ze.forceAllow()},forceWebSockets:function(){Ze.forceDisallow()},isWebSocketsAvailable:function(){return rn.isAvailable()},setSecurityDebugCallback:function(t,e){t.repo.persistentConnection_.securityDebugCallback_=e},stats:function(t,e){t.repo.stats(e)},statsIncrementCounter:function(t,e){t.repo.statsIncrementCounter(e)},dataUpdateCount:function(t){return t.repo.dataUpdateCount},interceptServerData:function(t,e){return t.repo.interceptServerData_(e)}}),In=ln;ln.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)},ln.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};var kn=sn,On=Y,An=Object.freeze({__proto__:null,DataConnection:In,RealTimeConnection:kn,hijackHash:function(t){var e=ln.prototype.put;return ln.prototype.put=function(n,r,i,o){void 0!==o&&(o=t()),e.call(this,n,r,i,o)},function(){ln.prototype.put=e}},ConnectionTarget:On,queryIdentifier:function(t){return t.queryIdentifier()},forceRestClient:function(t){Cn.getInstance().forceRestClient(t)}}),Rn="@firebase/database",Nn="0.6.13",Pn=En.ServerValue;function Mn(e){!function(t){en=t}(e.SDK_VERSION);var n=e.INTERNAL.registerComponent(new c.Component("database",(function(t,e){var n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal");return Cn.getInstance().databaseFromApp(n,r,e)}),"PUBLIC").setServiceProps({Reference:gn,Query:ne,Database:En,DataSnapshot:Xt,enableLogging:C,INTERNAL:Tn,ServerValue:Pn,TEST_ACCESS:An}).setMultipleInstances(!0));e.registerVersion(Rn,Nn),s.isNodeSdk()&&(t.exports=n)}Mn(h.default),e.DataSnapshot=Xt,e.Database=En,e.OnDisconnect=mt,e.Query=ne,e.Reference=gn,e.ServerValue=Pn,e.enableLogging=C,e.registerDatabase=Mn}).call(this,n(64))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(4),i=n(33),o=n(61);function s(t,e){return void 0===t&&(t=0),void 0===e&&(e=i.a),(!Object(o.a)(t)||t<0)&&(t=0),e&&"function"==typeof e.schedule||(e=i.a),new r.a((function(n){return n.add(e.schedule(a,t,{subscriber:n,counter:0,period:t})),n}))}function a(t){var e=t.subscriber,n=t.counter,r=t.period;e.next(n),this.schedule({subscriber:e,counter:n+1,period:r},r)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(1),i=n(24),o=n(22),s=n(11),a=n(10),c=n(32),u={};function l(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null,r=null;return Object(i.a)(t[t.length-1])&&(r=t.pop()),"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&Object(o.a)(t[0])&&(t=t[0]),Object(c.a)(t,r).lift(new h(n))}var h=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new p(t,this.resultSelector))},t}(),p=function(t){function e(e,n){var r=t.call(this,e)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return r.a(e,t),e.prototype._next=function(t){this.values.push(u),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var n=0;n<e;n++){var r=t[n];this.add(Object(a.a)(this,r,r,n))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,n,r,i){var o=this.values,s=o[n],a=this.toRespond?s===u?--this.toRespond:this.toRespond:0;o[n]=e,0===a&&(this.resultSelector?this._tryResultSelector(o):this.destination.next(o.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}
639));var r=n(1),i=n(5);function o(){return function(t){return t.lift(new s)}}var s=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(e){var n=t.call(this,e)||this;return n.hasPrev=!1,n}return r.a(e,t),e.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(1),i=n(5);function o(t,e){return function(n){return n.lift(new s(t,e))}}var s=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.compare,this.keySelector))},t}(),a=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return r.a(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var n=this.keySelector;e=n?n(t):t}catch(t){return this.destination.error(t)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;r||(this.key=e,this.destination.next(t))},e}(i.a)},function(t,e,n){"use strict";n.r(e),n.d(e,"templateFn",(function(){return r}));const r=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl;l.config,l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t,l.htmlWebpackPlugin;return u(e(h.value)),u("\n"),a=2,c}catch(t){r(t,"<%= $ctrl.value %>\n",void 0,a,e)}};e.default=r},function(t,e,n){"use strict";n.r(e),n.d(e,"templateFn",(function(){return r}));const r=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl,p=(l.config,l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t);l.htmlWebpackPlugin;return u('<div class="nb-modal--medium-large">\n  <div class="nb-modal__content">\n    <p class="nb-text">'),a=3,u(e(p("SESSION_TIMEOUT.INACTIVITY.header"))),u('</p>\n    <p class="nb-text">'),a=4,u(p("SESSION_TIMEOUT.INACTIVITY.message",{secondsRemaining:h.countdownContent})),u('</p>\n  </div>\n  <div class="nb-modal__footer nb-button-group">\n    <button class="nb-button--minimal se-bar__session-inactivity-warning__sign_out">'),a=7,u(e(p("SESSION_TIMEOUT.INACTIVITY.button__sign_out"))),u('</button>\n    <button class="nb-button--primary se-bar__session-inactivity-warning__extend">\n      '),a=9,u(e(p("SESSION_TIMEOUT.INACTIVITY.button__extend"))),u("\n    </button>\n  </div>\n</div>\n"),a=13,c}catch(t){r(t,'<div class="nb-modal--medium-large">\n  <div class="nb-modal__content">\n    <p class="nb-text"><%= t(\'SESSION_TIMEOUT.INACTIVITY.header\') %></p>\n    <p class="nb-text"><%- t(\'SESSION_TIMEOUT.INACTIVITY.message\', { secondsRemaining: $ctrl.countdownContent }) %></p>\n  </div>\n  <div class="nb-modal__footer nb-button-group">\n    <button class="nb-button--minimal se-bar__session-inactivity-warning__sign_out"><%= t(\'SESSION_TIMEOUT.INACTIVITY.button__sign_out\') %></button>\n    <button class="nb-button--primary se-bar__session-inactivity-warning__extend">\n      <%= t(\'SESSION_TIMEOUT.INACTIVITY.button__extend\') %>\n    </button>\n  </div>\n</div>\n',void 0,a,e)}};e.default=r},function(t,e,n){"use strict";n.r(e),n.d(e,"templateFn",(function(){return r}));const r=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl;l.config,l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t,l.htmlWebpackPlugin;return u('<div id="se-bar__session-timeout">\n  '),a=2,h.inactivityWarning&&(u('\n  <div class="se-bar__session-inactivity">\n    <div class="nb-overlay">\n      <div class="nb-overlay__content">\n        '),a=6,u(h.inactivityWarning),u("\n      </div>\n    </div>\n  </div>\n  "),a=10),u("\n</div>\n"),a=12,c}catch(t){r(t,'<div id="se-bar__session-timeout">\n  <% if ($ctrl.inactivityWarning) { %>\n  <div class="se-bar__session-inactivity">\n    <div class="nb-overlay">\n      <div class="nb-overlay__content">\n        <%- $ctrl.inactivityWarning %>\n      </div>\n    </div>\n  </div>\n  <% } %>\n</div>\n',void 0,a,e)}};e.default=r},function(t,e,n){"use strict";n.r(e),n.d(e,"templateFn",(function(){return r}));const r=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl,p=(l.config,l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t);l.htmlWebpackPlugin;return u('<span class="nb-user">\n    <a id="nb-sign-in-link" class="nb-signin nb-link" href="'),a=2,u(e(h.signInUrl)),u('" target="_self">'),u(e(p("PROFILE.sign_in"))),u("</a>\n</span>\n"),a=4,c}catch(t){r(t,'<span class="nb-user">\n    <a id="nb-sign-in-link" class="nb-signin nb-link" href="<%= $ctrl.signInUrl %>" target="_self"><%= t(\'PROFILE.sign_in\') %></a>\n</span>\n',void 0,a,e)}};e.default=r},,,,,,function(t,e,n){"use strict";n.r(e);n(217);var r=n(6),i=n(19);const o=window,s=document,a=o.GoogleAnalyticsObject=o.GoogleAnalyticsObject||"ga",c="NginBar",u="https://www.googletagmanager.com/gtm.js",l="https://www.google-analytics.com/analytics.js",h="NB",p=50;var d=new class{constructor(t){var e=o[a]||s.querySelector('script[src*="'.concat(u,'"]'));if(this.ga("create",t,"auto",h),!e){var n=s.createElement("script"),r=s.getElementsByTagName("script")[0];n.async=1,n.src=l,r.parentNode.insertBefore(n,r)}}get ga(){return o[a]||(o[a]=function(){(o[a].q=o[a].q||[]).push(arguments)},o[a].l||new Date),o[a]}sendEvent(t,e,n,r,i){o[a]("".concat(h,".send"),"event","".concat(c,".").concat(t),e,n,r,i)}sendEventLink(t,e,n,r,i,o){const s=t.data&&t.data.delegatedTarget||t.currentTarget,a=s.getAttribute("href"),c=s.getAttribute("target")||"_self",u="_top"==c||"_self"===c;let l=!!t.defaultPrevented;this.sendEvent(e,n,r,i,o),u&&a&&(t.preventDefault(),t.preventDefault=()=>l=!0,setTimeout(()=>{l||(u?window[c.substring(1)].location=a:window.new(a,c))},p))}}("UA-821370-90"),f=n(40),v=n(14),g=n(167),m=n.n(g),y=n(168),b=n.n(y),_=n(169),w=n.n(_),S=n(170),C=n.n(S),E=n(171),x=n.n(E),T=n(172),I=n.n(T),k=n(173),O=n.n(k),A=n(174),R=n.n(A),N=n(175),P=n.n(N),M=n(176),D=n.n(M),L=n(177),j=n.n(L),U=n(178),F=n.n(U),H=n(179),B=n.n(H),q=n(180),V=n.n(q),W=n(181),z=n.n(W),$=n(182),Y=n.n($),K=n(183),G=n.n(K),Q=n(184),X=n.n(Q),J=n(185),Z=n.n(J),tt=n(186),et=n.n(tt),nt=n(187),rt=n.n(nt),it=n(188),ot=n.n(it),st=n(189),at=n.n(st),ct=n(190),ut=n.n(ct),lt=n(191),ht=n.n(lt),pt=n(192),dt=n.n(pt),ft=n(193),vt=n.n(ft),gt=n(194),mt=n.n(gt),yt=n(195),bt=n.n(yt),_t=n(196),wt=n.n(_t),St=n(197),Ct=n.n(St),Et=n(198),xt=n.n(Et),Tt=n(199),It=n.n(Tt),kt=n(200),Ot=n.n(kt),At=n(201),Rt=n.n(At),Nt=n(202),Pt=n.n(Nt);const Mt={bell:m.a,chat:b.a,chevronDown:w.a,chevronLeft:C.a,chevronRight:x.a,envelope:I.a,flag:O.a,menu:R.a,shield:P.a,sportAmericanFootball:D.a,sportBadminton:j.a,sportBaseball:F.a,sportBasketball:B.a,sportBiathlon:V.a,sportCrossCountrySkiing:z.a,sportCurling:Y.a,sportFieldHockey:G.a,sportFreeski:X.a,sportGolf:Z.a,sportGymnastics:et.a,sportIceHockey:rt.a,sportInlineSkating:ot.a,sportLacrosse:at.a,sportRugby:ut.a,sportSkating:ht.a,sportSkiing:dt.a,sportSkiJumping:vt.a,sportSnowboarding:mt.a,sportSoccer:bt.a,sportSoftball:wt.a,sportSpeedSkating:Ct.a,sportSwimming:xt.a,sportTennis:It.a,sportVolleyball:Ot.a,sportWrestling:Rt.a,spotSafety:Pt.a};class Dt extends v.a{constructor(t){super(t),this.templateFn=()=>Mt[t.icon]}render(){const t=super.render();let e='class="'.concat(this.class,'"');return this.color?e+=' style="color: '.concat(this.color,'"'):this.style&&(e+=' style="'.concat(this.style,'"')),t.replace(/(<[a-z-]+)/,"$1 ".concat(e))}}var Lt=Dt;var jt=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl;l.config,l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t,l.htmlWebpackPlugin;return u('<button class="nb-back">\n  '),a=2,u(h.chevronLeft),u(" Back\n</button>\n"),a=4,c}catch(t){r(t,'<button class="nb-back">\n  <%- $ctrl.chevronLeft %> Back\n</button>\n',void 0,a,e)}};class Ut extends v.a{constructor(t){super(t),this.templateFn=jt}init(){this.chevronLeft=new Lt({parent:this,icon:"chevronLeft",class:"nb-back__chevron-icon"})}}var Ft=Ut,Ht=n(35);const Bt="flag",qt={flag:["sport-other","sport-archery","sport-ball-hockey","sport-bandy","
639sport-bobsled","sport-bowling","sport-cheerleading","sport-climbing","sport-cricket","sport-cross-country","sport-cycling","sport-dance","sport-diving","sport-fencing","sport-roller-hockey","sport-sled-hockey","sport-judo","sport-karate","sport-taekwondo","sport-para-biathlon","sport-rifle-shooting","sport-trap-shooting","sport-short-track-skating","sport-snowshoe","sport-para-alpine-skiing","sport-para-cross-country-skiing","sport-para-snowboarding","sport-running","sport-track-and-field","sport-water-polo","sport-paintball","sport-luge","sport-pentathlon","sport-racquetball","sport-rowing","sport-sailing","sport-skeleton","sport-squash"],"sport-curling":["sport-wheelchair-curling"],"sport-ski-jumping":["sport-nordic-combined"],"sport-skiing":["sport-alpine-skiing"],"sport-freeski":["sport-freestyle-skiing"],"sport-skating":["sport-ice-dance","sport-ice-skating","sport-figure-skating"],"sport-soccer":["sport-futsal"]},Vt={};for(const t in qt)qt[t].forEach(e=>Vt[e]=t);function Wt(t,e){const n=zt(t),r=zt(e);return!(!n||!r)&&function(t,e){const n=($t(t)+.05)/($t(e)+.05);return n<1?1/n:n}(n,r)>3}function zt(t){const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:void 0}function $t(t){const e=[t.r,t.g,t.b].map(t=>(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}var Yt=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl;l.config,l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t,l.htmlWebpackPlugin;return u('<span class="nb-avatar">\n    '),a=2,h.loaded&&(u("\n        "),a=3,u(h.image||""),u("\n        "),a=4,u(h.icon||""),u("\n        "),a=5,u(h.background||""),u("\n        "),a=6,u(h.abbrev||""),u("\n    "),a=7),u("\n</span>\n"),a=9,c}catch(t){r(t,"<span class=\"nb-avatar\">\n    <% if ($ctrl.loaded) { %>\n        <%- $ctrl.image || '' %>\n        <%- $ctrl.icon || '' %>\n        <%- $ctrl.background || '' %>\n        <%- $ctrl.abbrev || '' %>\n    <% } %>\n</span>\n",void 0,a,e)}};const Kt=["team","team_instance"];class Gt extends v.a{constructor(t){super(t),this.templateFn=Yt}load(){const t=()=>{const t=this.getIcon();this.isTeamType()||(this.abbrev=this.getAbbrev()),t?this.icon=new Lt({parent:this,icon:t,class:"nb-avatar__icon",color:this.getColor()}):this.background='<span class="nb-avatar__background"></span>'};if(!this.imgUrl)return t();const e=document.createElement("img"),n=document.body,r=this.identity||"";return e.setAttribute("src",this.imgUrl),e.setAttribute("alt",r),e.setAttribute("style","position:fixed;height:0;width:0;"),new Promise((i,o)=>{e.addEventListener("error",()=>{t(),n.removeChild(e),i()}),e.addEventListener("load",()=>{this.image='<img src="'.concat(this.imgUrl,'" alt="').concat(r,'" class="nb-avatar__image">'),n.removeChild(e),i()}),n.appendChild(e)})}render(){const t=super.render();let e="nb-avatar nb-avatar--".concat(this.type);return this.size&&(e+=" nb-avatar--".concat(this.size)),t.replace(/(<[a-z-]+)/,'$1 class="'.concat(e,'"'))}getIcon(){return"organization"===this.type?"shield":this.isTeamType()?function(t){if(!t)return Bt;const e="sport-".concat(t).replace(/(-|_|\s)([a-z])/g,(function(t){return t[1].toUpperCase()}));return Vt[e]||e}(this.sport):void 0}getAbbrev(){const t=(this.identity||"").split(/\s+/).map(t=>t[0]);return t.length="person"===this.type?2:1,'<span class="nb-avatar__abbrev">'.concat(t.join(""),"</span>")}getColor(){if(this.color&&this.isTeamType()&&Wt(this.color,"#FFFFFF"))return this.color}isTeamType(){return Kt.includes(this.type)}}var Qt=Gt;var Xt=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl;l.config,l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t,l.htmlWebpackPlugin;return u('<span class="nb-tooltip"><span class="nb-tooltip__text">'),u(e(h.text)),u("</span></span>\n"),a=2,c}catch(t){r(t,'<span class="nb-tooltip"><span class="nb-tooltip__text"><%= $ctrl.text %></span></span>\n',void 0,a,e)}};const Jt="nb-tooltip--visible",Zt=200,te=1500,ee="ontouchstart"in document.documentElement;class ne extends v.a{constructor(t){super(t),this.templateFn=Xt,this.visible=!1,this._disabled=!1}get disabled(){return this._disabled}set disabled(t){t&&!this.disabled&&this.hide(),this._disabled=t}get findInParent(){return!0}get appendTo(){return"body"}get eventBindings(){return(ee?this.touchBindings:this.mouseBindings).concat([this.doc,"scroll",this.hide,this.doc,"resize",this.hide])}get touchBindings(){return[this.$target,"touchstart",this.toggle,this.doc,"touchstart",this.hide]}
639get mouseBindings(){return[this.$target,"mouseenter",this.showSoon,this.$target,"mouseleave",this.hideSoon,this.$target,"mousedown",this.toggle,this.element,"mouseenter",this.show,this.element,"mouseleave",this.hideSoon,this.element,"mousedown",this.hide,this.doc,"mousedown",this.hide]}toggle(t){Object(Ht.c)(t,this),this.visible=!this.visible,this.visible?this.show():this.hide()}show(){this.disabled||(this.visible=!0,this.clearTimeouts(),this.position())}showSoon(){this.visible?this.clearTimeouts():this.showTimeout=setTimeout(this.show,te)}hide(t){Object(Ht.b)(t,this)||(this.visible=!1,this.clearTimeouts(),this.element.classList.remove(Jt),this.hideTimeout=setTimeout(()=>this.element.style.display="none",200))}hideSoon(){this.visible?this.hideTimeout=setTimeout(this.hide,Zt):this.clearTimeouts()}clearTimeouts(){clearTimeout(this.showTimeout),clearTimeout(this.hideTimeout)}position(){this.element.style.display="";const t=window.document,e=t.documentElement||t.body,n=e.clientHeight,r=e.clientWidth,i=this.$target.getBoundingClientRect(),o=i.left,s=i.top,a=i.bottom,c=i.right-o,u=this.element.getBoundingClientRect(),l=u.right-u.left,h=u.bottom-u.top,p=o+c/2,d=p+l/2,f=a+h;let v=p-l/2,g=s-h;const m=g<0?0-g:0,y=f>n?f-n:0;(v<0?0-v:0)?v=0:(d>r?d-r:0)&&(v=r-l),m&&(g=y?m<y?0:n-h:a),this.element.classList.add(Jt),this.element.style.top="".concat(g,"px"),this.element.style.left="".concat(v,"px")}get target(){return this.trackElementAs("$target")}}var re=ne;var ie=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl;l.config,l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t,l.htmlWebpackPlugin;return u('<div class="nb-menu-item">\n  <span\n    aria-label="'),a=3,u(e(h.label)),u('"\n    aria-expanded="'),a=4,u(e(h.active||!1)),u('"\n    class="nb-menu-button"\n    id="'),a=6,u(e(h._elementId)),u('"\n    role="button"\n    tabindex="0"\n    '),a=9,u(h.tooltip.target),u("\n  >\n    "),a=11,u(h.indicatorDot),u("\n    "),a=12,u(h.iconSvg||h.avatar||""),u("\n  </span>\n  "),a=14,u(h.dropdown),u("\n</div>\n\n"),a=17,c}catch(t){r(t,'<div class="nb-menu-item">\n  <span\n    aria-label="<%= $ctrl.label %>"\n    aria-expanded="<%= $ctrl.active || false %>"\n    class="nb-menu-button"\n    id="<%= $ctrl._elementId %>"\n    role="button"\n    tabindex="0"\n    <%- $ctrl.tooltip.target %>\n  >\n    <%- $ctrl.indicatorDot %>\n    <%- $ctrl.iconSvg || $ctrl.avatar || \'\' %>\n  </span>\n  <%- $ctrl.dropdown %>\n</div>\n\n',void 0,a,e)}};class oe extends v.a{constructor(t){super(t),this.templateFn=ie,this.active=!1,this.dropdownClass=t.dropdownClass,this.dropdownOptions=t.dropdownOptions||{}}get eventBindings(){return[this.element,"mousedown","[nb-close-dropdown-desktop]",this.setTarget,this.element,"click","[nb-close-dropdown-desktop]",this.closeClick,this.element,"click",".nb-menu-dropdown",this.dropdownClick,this.element,"click",this.buttonClick,this.element,"keydown",this.keyClick,this.doc,"click",this.docClick,this.doc,"focusin",this.closeDropdownOnOtherFocus]}init(){this.indicatorDot=this.indicatorClass?new this.indicatorClass({parent:this}):"",this.tooltip=new re({parent:this,text:this.label}),this.icon?this.iconSvg=new Lt({parent:this,icon:this.icon,class:"nb-menu-button__icon"}):this.avatarData&&(this.avatar=new Qt(Object.assign({parent:this,class:"nb-menu-button__icon"},this.avatarData))),this.dropdown=this.dropdownClass&&new this.dropdownClass(Object.assign({parent:this},this.dropdownOptions))}setTarget(t){const e=t.data.delegatedTarget;e&&e.getAttribute("href")&&!e.getAttribute("target")&&e.setAttribute("target","_self")}buttonClick(t){Object(Ht.c)(t,"".concat(this._elementId,"-button"))}keyClick(t){13!==t.keyCode&&32!==t.keyCode||t.srcElement.parentElement==this.element&&(t.preventDefault(),this.element.click())}dropdownClick(t){Object(Ht.c)(t,"".concat(this._elementId,"-dropdown"))}closeClick(t){this.dropdown.isFullScreen()||Object(Ht.c)(t,"".concat(this._elementId,"-close"))}closeDropdownOnOtherFocus(t){var e,n;(null===(e=this.dropdown)||void 0===e?void 0:null===(n=e.element)||void 0===n?void 0:n.contains(t.target))||this.dropdown.isFullScreen()||this.dropdown.close()}docClick(t){return Object(Ht.b)(t,"".concat(this._elementId,"-close"))?this.deactivate():Object(Ht.b)(t,"".concat(this._elementId,"-dropdown"))?void 0:Object(Ht.b)(t,"".concat(this._elementId,"-button"))&&!this.active?this.activate():void this.deactivate()}activate(){this.active||(this.element.firstElementChild.setAttribute("aria-expanded",this.active=!0),d.sendEvent("Main","Open",this.gaLabel),this.dropdown&&this.dropdown.open(!0),this.tooltip.disabled=!0)}deactivate(){this.active&&(this.element.firstElementChild.setAttribute("aria-expanded",this.active=!1),this.dropdown&&this.dropdown.close(!0),this.tooltip.disabled=!1)}statusDisplay(){const t=this.status;return"number"==typeof t&&t>0?t:""}}
639var se=oe;const ae=[],ce=[];let ue={x:0,y:0};function le(t){const e="".concat(t?"add":"remove","EventListener");document[e]("touchmove",he,Ht.d),document[e]("touchstart",pe,Ht.d),document[e]("touchend",de,Ht.d)}function he(t){if(!ae.length)return;let e;for(;(e=e?e.parentNode:t.target)&&e!==document;){const n=ve(e);if(n&&(!ge(t,e)||!me(n)))return}t.preventDefault()}function pe(t){ue=fe(t)}function de(){ue={x:0,y:0}}function fe(t){return{x:t.changedTouches[0].screenX,y:t.changedTouches[0].screenY}}function ve(t){for(let e=0;e<ae.length;e++)do{if(t.matches(ae[e]))return ae[e]}while(t=t.parentElement)}function ge(t,e){const n=ue,r=fe(t);return ue=r,0===e.scrollTop&&n.y<r.y||(e.scrollHeight-e.scrollTop-e.clientHeight<1&&n.y>r.y||void 0)}function me(t){const e=ce.find(e=>e.el=t);return!!e&&e.conditions.when()}const ye=".nb-menu-container .nb-menu-body",be=".nb-menu-body";class _e extends v.a{constructor(t){super(t),this.active=!1,this.closeOnClick={},this.mainScrollSelector="".concat(this.selector," ").concat(ye),this.scrollSelector="".concat(this.selector," ").concat(be)}init(){setInterval(()=>"IFRAME"!==(document.activeElement||{}).tagName||this.close(),100),document.addEventListener("scroll",this.closeOnOtherScroll,!0),this.on("destroy",this.destroy)}get eventBindings(){return[this.win,"resize",this.close]}open(){var t;this.active||(t=this.mainScrollSelector,(document.querySelectorAll(t)||[]).forEach(t=>t.scrollTop=0),function t(e,n){if(f.hasTouch)return e.forEach?e.forEach(e=>t(e,n)):void(ae.includes(e)||(ae.length||le(!0),ae.push(e),n&&ce.push({selector:e,conditions:n})))}(this.scrollSelector,{when:this.isFullScreen}),this.active=!0,this.element.classList.remove("nb-menu-dropdown--closed"),this.element.classList.add("nb-menu-dropdown--open"),document.documentElement.classList.add("se-bar--dropdown-open","dropdown-for-".concat(this._parent._elementId)),this._parent.activate(),this.emit("open"),this.root.openOverlay("dropdown",!0),this.root.closeMobileMenu())}close(){if(!this.element||!this.active)return;!function t(e){if(e.forEach)return e.forEach(e=>t(e));const n=ae.indexOf(e);if(-1===n)return;ae.splice(n,1);const r=ce.findIndex(t=>t.selector===e);-1!==r&&ce.splice(r,1),ae.length||le(!1)}(this.scrollSelector),this.active=!1,this.element.classList.remove("nb-menu-dropdown--open"),this.element.classList.add("nb-menu-dropdown--closed");const{classList:t}=document.documentElement;t.remove("dropdown-for-".concat(this._parent._elementId)),Array.from(t.values()).find(t=>t.includes("dropdown-for-"))||(t.remove("se-bar--dropdown-open"),this.root.openOverlay("dropdown",!1)),this._parent.deactivate(),this.emit("close")}closeOnOtherScroll(t){this.element&&!this.element.parentNode.contains(this.element,t.target)&&this.close()}isFullScreen(){return this.element&&this.element.offsetWidth===window.innerWidth}destroy(){this.close(),document.removeEventListener("scroll",this.close,!0)}}var we=_e,Se=n(26),Ce=n(73);const Ee="production",xe={development:["sportngin.com.dev","sportsengine.com.dev"],staging:["stage.ngin-staging.com","sestage.us","sportngin.com.dev","sportsengine.com.dev"],production:["sportngin.com","sportsengine.com"]};class Te{constructor(){Object(Se.a)(this),this.data={}}isSEDomain(){return!!Ee&&xe[Ee].some(t=>this.origin.endsWith(t))}isVanityDomain(){return!this.isSEDomain()}isSEApiDomain(){this.origin.endsWith(this.primaryAPIBaseUrl.replace("https://se-api.",""))}get origin(){return(window.location||{}).hostname||""}get primaryAPIBaseUrl(){return r.a.urls.seApi}get alternateAPIBaseUrl(){return this.isVanityDomain()?"https://".concat(this.origin,"/apigateway"):r.a.urls.apiProxy}get explicitFallbackUrl(){return r.a.apiFallbackUrl||""}get derivedBaseUrl(){return this.isSEApiDomain()?this.primaryAPIBaseUrl:this.alternateAPIBaseUrl}}n.n(Ce)()(Te.prototype);var Ie=Te,ke=n(203),Oe=n(16);const Ae=["message.new","notification.message_new","notification.mark_read","notification.mark_unread","notification.channel_truncated","notification.channel_deleted"];var Re=new class extends Ie{constructor(){super(),this.client=null,this.userId=null,this.connected=!1,this.listenersRegistered=!1}async connect(){if(this.connected)return!0;let t;try{t=await Oe.a.post("v3/chat/stream/tokens")}catch(t){throw console.error("StreamService: cannot fetch token",t),t}const{stream_user_key:e,token:n}=t;this.userId=e;try{return this.client=ke.a.getInstance(r.a.stream.apiKey),await this.client.connectUser({id:this.userId},n),this.connected=!0,this.registerUnreadListener(),!0}catch(t){throw console.error("StreamService: failed to connect user",t),await this.disconnect(),t}}async disconnect(){this.client&&(await this.client.disconnectUser().catch(t=>console.warn(t)),this.client=null,this.userId=null,this.connected=!1,this.listenersRegistered=!1)}async getUserStreamChannels(){this.isConnected()||await this.connect();try{const t={members:{$in:[this.userId]}},e=[{last_message_at:-1}];return await this.client.queryChannels(t,e,{state:!0,watch:!0,presence:!0})}catch(t){return console.error("StreamService: failed to get user channels",t),[]}}registerUnreadListener(){this.client&&!this.listenersRegistered&&(this.listenersRegistered=!0,this.unreadHandler=t=>
639{"number"==typeof t.total_unread_count&&this.emit("unread.total",t.total_unread_count)},Ae.forEach(t=>this.client.on(t,this.unreadHandler)))}isConnected(){return this.connected&&!!this.client}};var Ne=new class extends Ie{constructor(){super(),this.chatsPromise=null,this.unreadHandler=null}async setUser(t){(null==t?void 0:t.uuid)&&await this.initStream()}async initStream(){await Re.connect(),this.unreadHandler||(this.unreadHandler=t=>{this.chatsPromise=null,this.setUnreadCount(t)},Re.on("unread.total",this.unreadHandler));const t=(await Re.getUserStreamChannels()).reduce((t,e)=>{var n;return t+((null===(n=e.state)||void 0===n?void 0:n.unreadCount)||0)},0);this.setUnreadCount(t)}setUnreadCount(t){this.emit("unreadCount",t)}async getChats(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]||!this.chatsPromise?(this.chatsPromise=(async()=>{const t=await this.getUserChannels(),e=await Re.getUserStreamChannels(),n=new Map(e.map(t=>[t.id,t])),r=t.map(t=>{var e,r;const i=n.get(t.stream_channel_key)||{},o=(null===(e=i.state)||void 0===e?void 0:e.unreadCount)||0;return{id:t.originator_id||t.id,name:t.display_name,unreadCount:o,originator_system:t.originator_system,originator_type:t.originator_type,originator_id:t.originator_id,avatar:{imgUrl:t.image_url||(null===(r=i.data)||void 0===r?void 0:r.image),identity:t.display_name,type:t.originator_type,sport:t.sport,color:t.primary_color,size:300}}});return r.sort((t,e)=>(e.unreadCount||0)-(t.unreadCount||0)),this.emit("teams",r),r})(),this.chatsPromise):this.chatsPromise}async getUserChannels(){return(await Oe.a.get("v3/chat/channels_chat_users/mine")).map(t=>t.channel)}};var Pe=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl,p=l.config,d=l.formatDate,f=(l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t);l.htmlWebpackPlugin;return u('<div class="nb-menu-body">\n  <div class="nb-messages-list">\n    '),a=3,h.teams?h.teams.length<=0?(u('\n      <div class="nb-menu-empty-state">\n        <h2 class="nb-menu-empty-state__main">'),a=10,u(e(f("CHAT.empty_title"))),u('</h2>\n        <p class="nb-menu-empty-state__sub">'),a=11,u(e(f("CHAT.empty_description"))),u("</p>\n      </div>\n    "),a=13):(u('\n      <div role="list" aria-label="'),a=14,u(e(f("CHAT.chats_list"))),u('">\n      '),a=15,h.teams.forEach((function(t){u('\n          <a\n            role="listitem"\n            href="'),a=18,u(e(p.urls.apiProxy)),u("/v3/doorway_redirect?originator_system="),u(e("Ngin"===t.originator_system?"Ngin":"TeamService")),u("&originator_type="),u(e("Ngin"===t.originator_system?t.originator_type:"team")),u("&originator_id="),u(e("Ngin"===t.originator_system?t.originator_id:t.id)),u('&context_tags=chat"\n            nb-event="Chats:Click:ViewChat"\n            target="_top"\n            class="nb-messages-list__item nb-messages-list__item--'),a=21,u(e(t.unreadCount<1?"read":"unread")),u('"\n            data-message-id="'),a=22,u(e(t.id)),u('">\n            <span class="nb-list-item__avatar">\n              '),a=24,u(t.avatar),u('\n            </span>\n            <span class="nb-message-summary">\n              <div class="nb-message-summary__head">\n                <span class="nb-message-summary__subject">'),a=28,u(e(t.name)),u('</span>\n                <span class="nb-message-summary__unread-indicator"></span>\n                <span class="nb-message-summary__date">'),a=30,u(e(t.unreadCount)),u(' unread</span>\n              </div>\n              <div class="nb-message-summary__detail">\n                '),a=33,t.lastReadMessage&&!isNaN(t.lastReadMessage.getTime())&&(u("\n                  "),a=34,u(e(f("CHAT.last_read",{last_read_date:d(t.lastReadMessage)}))),u("\n                "),a=35),u("\n              </div>\n            </span>\n          </a>\n      "),a=39})),u("\n      </div>\n    "),a=41):(u('\n      <svg class="nb-spinner" aria-label="'),a=4,u(e(f("SPINNER.loading"))),u('">\n        <title>'),a=5,f("SPINNER.loading"),u('</title>\n        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-spinner"></use>\n      </svg>\n    '),a=8),u("\n  </div>\n</div>\n"),a=44,c}catch(t){r(t,'<div class="nb-menu-body">\n  <div class="nb-messages-list">\n    <% if (!$ctrl.teams) { %>\n      <svg class="nb-spinner" aria-label="<%= t(\'SPINNER.loading\')%>">\n        <title><% t(\'SPINNER.loading\')%></title>\n        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-spinner"></use>\n      </svg>\n    <% } else if ($ctrl.teams.length <= 0) { %>\n      <div class="nb-menu-empty-state">\n        <h2 class="nb-menu-empty-state__main"><%= t(\'CHAT.empty_title\') %></h2>\n        <p class="nb-menu-empty-state__sub"><%= t(\'CHAT.empty_description\') %></p>\n      </div>\n    <% } else { %>\n      <div role="list" aria-label="<%= t(\'CHAT.chats_list\')%>">
639\n      <% $ctrl.teams.forEach(function(team) { %>\n          <a\n            role="listitem"\n            href="<%= config.urls.apiProxy %>/v3/doorway_redirect?originator_system=<%= team.originator_system === \'Ngin\' ? \'Ngin\' : \'TeamService\' %>&originator_type=<%= team.originator_system === \'Ngin\' ? team.originator_type : \'team\' %>&originator_id=<%= team.originator_system === \'Ngin\' ? team.originator_id : team.id %>&context_tags=chat"\n            nb-event="Chats:Click:ViewChat"\n            target="_top"\n            class="nb-messages-list__item nb-messages-list__item--<%= team.unreadCount < 1 ? \'read\' : \'unread\' %>"\n            data-message-id="<%= team.id %>">\n            <span class="nb-list-item__avatar">\n              <%- team.avatar %>\n            </span>\n            <span class="nb-message-summary">\n              <div class="nb-message-summary__head">\n                <span class="nb-message-summary__subject"><%= team.name %></span>\n                <span class="nb-message-summary__unread-indicator"></span>\n                <span class="nb-message-summary__date"><%= team.unreadCount%> unread</span>\n              </div>\n              <div class="nb-message-summary__detail">\n                <% if (team.lastReadMessage && !isNaN(team.lastReadMessage.getTime())) { %>\n                  <%= t(\'CHAT.last_read\', { last_read_date: formatDate(team.lastReadMessage) }) %>\n                <% } %>\n              </div>\n            </span>\n          </a>\n      <% }) %>\n      </div>\n    <% } %>\n  </div>\n</div>\n',void 0,a,e)}};class Me extends v.a{constructor(t){super(t),this.templateFn=Pe,Ne.on("teams",this.update)}update(t){this.teams=t,this.teams.forEach(t=>t.avatar=new Qt(Object.assign({parent:this},t.avatar))),this.element&&this._update()}}var De=Me;var Le=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl,p=(l.config,l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t);l.htmlWebpackPlugin;return u('<div class="nb-menu-dropdown nb-menu-dropdown--messages nb-menu-dropdown--'),u(e(h.active?"open":"closed")),u('"\n  role="region"\n  aria-label="'),a=3,u(e(p("CHAT.tooltip"))),u('">\n  <div class="nb-menu-container">\n    '),a=5,u(h.chatList),u("\n    "),a=6,u(h.chatFooter),u("\n  </div>\n</div>\n"),a=9,c}catch(t){r(t,'<div class="nb-menu-dropdown nb-menu-dropdown--messages nb-menu-dropdown--<%= $ctrl.active ? \'open\' : \'closed\' %>"\n  role="region"\n  aria-label="<%= t(\'CHAT.tooltip\')%>">\n  <div class="nb-menu-container">\n    <%- $ctrl.chatList %>\n    <%- $ctrl.chatFooter %>\n  </div>\n</div>\n',void 0,a,e)}};var je=class extends we{constructor(t){super(t),this.templateFn=Le,this.updateMessages=this.updateMessages.bind(this)}init(){super.init(),this.chatList=new De({parent:this})}async open(){Ne.on("unreadCount",this.updateMessages),await Ne.getChats(!1),super.open()}close(){Ne.off("unreadCount",this.updateMessages),super.close()}async updateMessages(){await Ne.getChats(!0)}};var Ue=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl;l.config,l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t,l.htmlWebpackPlugin;return u('<span class="nb-menu-button__indicator nb-indicator-dot '),u(e(h.status?h.indicatorStates.indicatorOn:h.indicatorStates.indicatorOff)),u('">\n  '),a=2,u(e(h.display)),u("\n</span>\n"),a=4,c}catch(t){r(t,'<span class="nb-menu-button__indicator nb-indicator-dot <%= $ctrl.status ? $ctrl.indicatorStates.indicatorOn : $ctrl.indicatorStates.indicatorOff %>">\n  <%= $ctrl.display %>\n</span>\n',void 0,a,e)}};const Fe="".concat("nb-indicator-dot","--off"),He="".concat("nb-indicator-dot","--on");class Be extends v.a{constructor(t){super(t),this.templateFn=Ue,this.indicatorStates={off:Fe,on:He},this.setStatus(this.status)}setStatus(t){switch(typeof t){case"string":this.status=!0,this.display=t;break;case"number":this.status=t>0,this.display=t>0?t:"";break;default:this.status=!!t,this.display=""}}updateStatus(t){this.setStatus(t);const e=this.element;e&&(e.innerText=this.display,e.classList.remove(this.status?Fe:He),e.classList.add(this.status?He:Fe))}}var qe=Be;var Ve=class extends qe{init(){Ne.on("unreadCount",this.update)}update(t){this.unreadCount!==t&&(this.unreadCount=t,this.updateStatus(this.getStatus(t)))}getStatus(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t>99?"99+":0!==t&&t}};var We=class extends se{constructor(t){super({parent:t.parent,dropdownClass:je,label:Object(i.a)("CHAT.tooltip"),gaLabel:"ChatMenu",icon:"chat",indicatorClass:Ve})}},ze=n(211);const $e=()=>(t=>{var e=("; "+document.cookie).split("; "+t+"=");if(2==e.length)return e.pop().split(";").shift()})("sportngin_session"),Ye=()=>
639{const t=$e();if(t)return Object(ze.sha224)(t)},Ke=1e3,Ge=20,Qe="sessionStorage",Xe=["memory",Qe,"localStorage"],Je=Qe,Ze="i",tn="ngin-bar",en=100,nn="PAGINATION",rn=window.localStorage,on=window.sessionStorage,sn=function(t){return JSON.stringify(function(t){return Array.isArray(t)&&t._pagination?t.concat({meta:nn,data:t._pagination}):t}(t))},an=function(t){return function(t){(Array.isArray(t)&&t[t.length-1]||{}).meta===nn&&(t._pagination=t.pop().data);return t}(JSON.parse(t))};let cn={};function un(t){return new Promise(e=>setTimeout(e,t))}const ln=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.join(":")},hn=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return ln(tn,"data",...e)},pn=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return ln(tn,"ctrl",...e)},dn=t=>{for(let e=0;e<t.length;e++){let e;const n=[];for(e=0;e<t.length;e++){const r=t.key(e);r.startsWith(tn+":")&&n.push(r)}for(e=0;e<n.length;e++)t.removeItem(n[e])}},fn={memory:{get:t=>cn[t],set:(t,e)=>cn[t]=e,del:t=>delete cn[t],flush:()=>cn={}},sessionStorage:{get:t=>on.getItem(t),set:(t,e)=>on.setItem(t,e),del:t=>on.removeItem(t),flush:()=>dn(on)},localStorage:{get:t=>rn.getItem(t),set:(t,e)=>rn.setItem(t,e),del:t=>rn.removeItem(t),flush:()=>dn(rn)}};function vn(){const t=function(){for(const t of Xe){const e=fn[t].get(ln(tn,Ze));if(e)return e}}(),e=Ye();return!t||!e||t!=e}function gn(){Xe.forEach(t=>{fn[t].flush()})}function mn(t){let{expiresInSeconds:e=Ge,cacheBackend:n=Qe}=t;const r=e*Ke,i=t=>an(fn[n].get(t)),o=(t,e)=>fn[n].set(t,sn(e)),s=(t,e)=>fn[n].del(t),a=t=>i(hn(t)),c=(t,e)=>o(hn(t),e),u=t=>o(pn(t,"t"),Date.now()),l=t=>s(pn(t,"t")),h=t=>i(pn(t,"poll-id")),p=(t,e)=>o(pn(t,"poll-id"),e),d=t=>o(pn(t,"in-flight"),!0),f=t=>s(pn(t,"in-flight")),v=t=>i(pn(t,"in-flight")),g=t=>(()=>Date.now())()-((t=>i(pn(t,"t")))(t)||0)>(t=>i(pn(t,"x")))(t);return(t,e,n)=>{f(e),((t,e)=>o(pn(t,"x"),e))(e,r);let i,s=[];Object.defineProperty(t,"".concat(e,"PollOn"),{value:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(s.push(t),i)return void(v(e)||i.then(t));const a=function(){i=Promise.resolve().then(()=>n.value.call(this,...o)).then(t=>(s.forEach(e=>e(t)),t))},c=function(){l(e),a.call(this)};p(e,setInterval(c.bind(this),r)),a.call(this)}}),Object.defineProperty(t,"".concat(e,"PollOff"),{value:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};(s=s.filter(e=>e!==t)).length||(clearInterval(h(e)),i=null)}}),Object.defineProperty(t,"".concat(e,"ClearCache"),{value:function(){l(e)}}),Object.defineProperty(t,"".concat(e,"SetCache"),{value:function(t){c(e,t),s.forEach(e=>e(t))}});const m=n.value;n.value=function t(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return v(e)?un(en).then(()=>t()):(d(e),Promise.resolve().then(()=>{if(g(e))return l(e),m.call(this,...r)}).then(t=>(void 0!==t&&(c(e,t),u(e)),f(e),a(e))).catch(t=>{throw f(e),t}))}}}function yn(t,e){const n=t.find(t=>t.image_type===e);if(n)return n.url}function bn(t){return _n(yn(t,"crop")||yn(t,"crop_icon")||yn(t,"original"))}function _n(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!!t.match(/images\/avatar.svg$/)?"":t}var wn,Sn,Cn=n(7);n(255);var En,xn,Tn,In,kn,On;var An=new(wn=mn({expiresInSeconds:600}),En=(Sn=class extends Ie{constructor(){super(),window.addEventListener("message",this.onPostMessage,!1)}acceptGuardianInvite(t){return Oe.a.put("persona_listeners/".concat(t,"/accept"))}declineOrphanInvite(t){return Oe.a.delete("orphan_invites/".concat(t))}declineRosterInvite(t){return Oe.a.delete("orphan_invites/".concat(t))}declineGuardianInvite(t){return Oe.a.delete("persona_listeners/".concat(t))}declineTeamInvite(t){return Oe.a.delete("invitations/".concat(t,"/decline"),{baseURL:this.derivedBaseUrl})}submitNotificationAction(t){let{id:e,type:n,method:r,uuid:i=nil,originatorId:o}=t;return Promise.resolve().then(()=>{if(r===Cn.l&&n===Cn.n)return this.acceptGuardianInvite(e);if(r===Cn.m){if(n===Cn.n)return this.declineGuardianInvite(e);if(n===Cn.o)return this.declineOrphanInvite(o);if(n===Cn.p)return this.declineRosterInvite(o);if(n===Cn.q)return this.declineTeamInvite(e)}})}getUserServiceInvites(){return Oe.a.get("invitations/mine",{baseURL:this.derivedBaseUrl,simpleHeaders:!0})}getOrphanInvites(){return Oe.a.get("orphan_invites/mine",{baseURL:this.derivedBaseUrl,simpleHeaders:!0})}getTeamInvites(){return Oe.a.get("v3/roster_personas/invitations/mine",{baseURL:this.derivedBaseUrl,simpleHeaders:!0})}getPersonaListeners(){return Oe.a.get("persona_listeners",{params:{status:"pending"}})}getNotifications(){return Promise.all([this.getPersonaListeners(),this.getUserServiceInvites()]).then(t=>{const[e,n]=t;e.forEach(t=>{t.notification_type=Cn.n});const r=[],i=n.filter(t=>t.originator_type===Cn.q),o=n.filter(t=>t.originator_type===Cn.o);o&&r.push(this.getOrphanInvites()),i&&r.push(this.getTeamInvites());let s=[],a=[];return Promise.all(r).then(t=>{const[e,n]=t;s=this.convertOrphanInvites(o,e),a=this.convertTeamInvites(i,n)}).then(()=>{const t=[].concat(e,a,s);return t.forEach(t=>{var e;t.subject_avatar=(null===(e=t.persona)||void 0===e?void 0:e.profile_images)?bn(t.persona.profile_images):null,t.persona.name=t.persona.name?t.persona.name:"".concat(t.persona.first_name," ").concat(t.persona.last_name)}),t})})}convertOrphanInvites(t,e){const n=[];return t.forEach(t=>{const r=e.find(e=>e.id===Number(t.originator_id));r&&(r.is_roster_player?(t.notification_type=Cn.p,Object.assign(t,function(t){const e=/^([^()]+)\(([^()]+)\)$/.exec(t);return e?{roster_team_name:e[1],organization_name:e[2]}:""===t?{}:{roster_team_name:t}}(r.inviter_name))):t.notification_type=Cn.o,t.uuid=r.uuid,t.originator_id=r.id,n.push(t))}),n}convertTeamInvites(t,e){const n=[];return t.forEach(t=>{var r;const i=e.find(e=>e.id===t.originator_id);t.notification_type=Cn.q,t.organization_name=t.organization.name,t.uuid=t.originator_uuid,t.originator_id=i.id,t.team_name=null==i?void 0:null===(r=i.team)||void 0===r?void 0:r.name,n.push(t)}),n}onPostMessage(t){const e=t.data||{};"notification:resolved"===e.type&&this.removeNotification(e.notificationType,e.notificationId)}removeNotification(t,e){const n=[].findIndex(n=>n.notification_type===t&&n.id.toString()===e);-1!==n&&((void 0).splice(n,1),this.getNotificationsSetCache(void 0))}}).prototype,xn="getNotifications",Tn=[wn],In=Object.getOwnPropertyDescriptor(Sn.prototype,"getNotifications"),kn=Sn.prototype,On={}
639,Object.keys(In).forEach((function(t){On[t]=In[t]})),On.enumerable=!!On.enumerable,On.configurable=!!On.configurable,("value"in On||On.initializer)&&(On.writable=!0),On=Tn.slice().reverse().reduce((function(t,e){return e(En,xn,t)||t}),On),kn&&void 0!==On.initializer&&(On.value=On.initializer?On.initializer.call(kn):void 0,On.initializer=void 0),void 0===On.initializer&&(Object.defineProperty(En,xn,On),On=null),Sn);var Rn=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl,p=(l.config,l.formatDate),d=(l.hasTouch,l.initializeCSSVars,l.initialsFromFullName),f=(l.multiToggleFactory,l.t);l.htmlWebpackPlugin;return h.notificationsLoaded?h.notifications.length?(u('\n  <div class="nb-menu-body" role="list">\n    <div class="nb-notifications-list">\n      '),a=22,h.notifications.forEach((function(t){u('\n        <div\n          class="nb-notifications-list__item nb-notifications-list__item--view"\n          data-notification-type="'),a=25,u(e(t.notification_type)),u('"\n          data-notification-id="'),a=26,u(e(t.id)),u('"\n          data-notification-uuid="'),a=27,u(e(t.uuid)),u('"\n          data-notification-originator-id="'),a=28,u(e(t.originator_id)),u('"\n          role="listitem"\n          aria-labelledby="notification-id-'),a=30,u(e(t.id)),u('">\n          <div class="nb-notification-view">\n            <span\n              aria-hidden="true"\n              class="nb-simple-avatar nb-simple-avatar--'),a=34,u(e(t.subject_avatar?"image":"initials")),u('"\n                '),a=35,t.subject_avatar&&(u("\n                  style=\"background-image: url('"),a=36,u(e(t.subject_avatar)),u("');\"\n                "),a=37),u('\n              >\n              <div class="nb-simple-avatar__invite-badge-container">\n                '),a=40,u(h.inviteBadges[t.notification_type]),u('\n              </div>\n              <span class="nb-menu__profile-initials">\n                '),a=43,u(e(d(t.persona.name))),u('\n              </span>\n            </span>\n            <span class="nb-notification-summary">\n              <div class="nb-notification-summary__info" id="notification-id-'),a=47,u(e(t.id)),u('">\n                '),a=48,u(h.buildPhrase(t)),u('\n              </div>\n              <div class="nb-notification-summary__date">\n                '),a=51,u(e(p(t.updated_at))),u('\n              </div>\n              <div class="nb-notification-summary__actions">\n                <a href="'),a=54,u(e(h.buildAcceptUrl(t))),u('" class="nb-notification-summary__action" data-notification-method="accept" nb-event="Notification:Click:Accept">\n                  Accept\n                </a>\n                |\n                <button type="button" class="nb-notification-summary__action" data-notification-method="decline" nb-event="Notification:Click:Decline">Decline</button>\n              </div>\n            </span>\n          </div>\n          <div class="nb-notification-action-progress">\n            <div class="nb-notification-action-progress__message-container">\n              <span class="nb-notification-action-progress__message"> In Progress </span>\n              <button type="button" class="nb-button nb-notification-action-progress__retry-button" data-notification-method="retry" nb-event="Notification:Click:Retry"> Try Again </button>\n            </div>\n            <div class="nb-progress-bar">\n              <span class="nb-progress-bar__progress"></span>\n            </div>\n          </div>\n        </div>\n      '),a=72})),u("\n    </div>\n  </div>\n"),a=75):(u('\n  <div class="nb-menu-body">\n    <div class="nb-notifications-list">\n      <div class="nb-menu-empty-state">\n        <h2 class="nb-menu-empty-state__main">'),a=14,u(e(f("NOTIFICATIONS.empty_title"))),u('</h2>\n        <p class="nb-menu-empty-state__sub">
639'),a=15,u(e(f("NOTIFICATIONS.empty_description"))),u("</p>\n      </div>\n    </div>\n  </div>\n"),a=19):(u('\n  <div class="nb-menu-body">\n    <div class="nb-notifications-list">\n      <svg class="nb-spinner" aria-label="'),a=4,f("SPINNER.loading"),u('">\n        <title>'),a=5,f("SPINNER.loading"),u('</title>\n        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-spinner"></use>\n      </svg>\n    </div>\n  </div>\n'),a=10),u("\n"),a=76,c}catch(t){r(t,'<% if (!$ctrl.notificationsLoaded) { %>\n  <div class="nb-menu-body">\n    <div class="nb-notifications-list">\n      <svg class="nb-spinner" aria-label="<% t(\'SPINNER.loading\')%>">\n        <title><% t(\'SPINNER.loading\')%></title>\n        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-spinner"></use>\n      </svg>\n    </div>\n  </div>\n<% } else if (!$ctrl.notifications.length) { %>\n  <div class="nb-menu-body">\n    <div class="nb-notifications-list">\n      <div class="nb-menu-empty-state">\n        <h2 class="nb-menu-empty-state__main"><%= t(\'NOTIFICATIONS.empty_title\') %></h2>\n        <p class="nb-menu-empty-state__sub"><%= t(\'NOTIFICATIONS.empty_description\') %></p>\n      </div>\n    </div>\n  </div>\n<% } else { %>\n  <div class="nb-menu-body" role="list">\n    <div class="nb-notifications-list">\n      <% $ctrl.notifications.forEach(function(notification) { %>\n        <div\n          class="nb-notifications-list__item nb-notifications-list__item--view"\n          data-notification-type="<%= notification.notification_type %>"\n          data-notification-id="<%= notification.id %>"\n          data-notification-uuid="<%= notification.uuid %>"\n          data-notification-originator-id="<%= notification.originator_id %>"\n          role="listitem"\n          aria-labelledby="notification-id-<%= notification.id %>">\n          <div class="nb-notification-view">\n            <span\n              aria-hidden="true"\n              class="nb-simple-avatar nb-simple-avatar--<%= notification.subject_avatar ? \'image\' : \'initials\' %>"\n                <% if (notification.subject_avatar) { %>\n                  style="background-image: url(\'<%= notification.subject_avatar %>\');"\n                <% } %>\n              >\n              <div class="nb-simple-avatar__invite-badge-container">\n                <%- $ctrl.inviteBadges[notification.notification_type] %>\n              </div>\n              <span class="nb-menu__profile-initials">\n                <%= initialsFromFullName(notification.persona.name) %>\n              </span>\n            </span>\n            <span class="nb-notification-summary">\n              <div class="nb-notification-summary__info" id="notification-id-<%= notification.id %>">\n                <%- $ctrl.buildPhrase(notification) %>\n              </div>\n              <div class="nb-notification-summary__date">\n                <%= formatDate(notification.updated_at) %>\n              </div>\n              <div class="nb-notification-summary__actions">\n                <a href="<%= $ctrl.buildAcceptUrl(notification) %>" class="nb-notification-summary__action" data-notification-method="accept" nb-event="Notification:Click:Accept">\n                  Accept\n                </a>\n                |\n                <button type="button" class="nb-notification-summary__action" data-notification-method="decline" nb-event="Notification:Click:Decline">Decline</button>\n              </div>\n            </span>\n          </div>\n          <div class="nb-notification-action-progress">\n            <div class="nb-notification-action-progress__message-container">\n              <span class="nb-notification-action-progress__message"> In Progress </span>\n              <button type="button" class="nb-button nb-notification-action-progress__retry-button" data-notification-method="retry" nb-event="Notification:Click:Retry"> Try Again </button>\n            </div>\n            <div class="nb-progress-bar">\n              <span class="nb-progress-bar__progress"></span>\n            </div>\n          </div>\n        </div>\n      <% }) %>\n    </div>\n  </div>\n<% } %>\n',void 0,a,e)}},Nn=n(212),Pn=n.n(Nn),Mn=n(213),Dn=n.n(Mn),Ln=n(214),jn=n.n(Ln),Un={[Cn.p]:Pn.a,[Cn.o]:Dn.a,[Cn.n]:jn.a},Fn=n(215),Hn=n.n(Fn),Bn=n(135),qn=n.n(Bn),Vn=n(216),Wn=n.n(Vn),zn={[Cn.a]:qn.a,[Cn.b]:Wn.a,[Cn.c]:Hn.a,[Cn.e]:qn.a};const $n=2500,Yn=t=>new Promise(e=>setInterval(e,t)),Kn=(t,e)=>t.getAttribute("data-notification-".concat(e)),Gn=Object(f.multiToggleFactory)([Cn.r,Cn.s],t=>"nb-notifications-list__item--".concat(t)),Qn=Object(f.multiToggleFactory)([Cn.a,Cn.b,Cn.c,Cn.d,Cn.e],t=>"nb-notification-action-progress--".concat(t)),Xn=(t,e,n,r)=>n===Cn.a?"".concat(zn[Cn.e]," ").concat(Object(i.a)("NOTIFICATIONS.application_error")):n===Cn.b?"".concat(zn[Cn.b]," ").concat(Object(i.a)("NOTIFICATIONS.error_connection_lost")):n===Cn.c?"".concat(zn[Cn.c]," ").concat((t=>Object(i.a)("NOTIFICATIONS.done_".concat(t)))(t)):n===Cn.d?"".concat((t=>Object(i.a)("NOTIFICATIONS.processing_".concat(t)))(t)," ").concat((t=>Object(i.a)("NOTIFICATIONS.subject_".concat(t)))(e),"..."):n===Cn.e?"".concat(zn[Cn.e]," ").concat(Object(i.a)("NOTIFICATIONS.error_occured"),": \n").concat(r.data.messages.join("\n"),"."):void 0;class Jn extends v.a{constructor(t){super(t),this.templateFn=Rn,this.inviteBadges=Un,this.statusIcons=zn,this.config=r.a}get eventBindings(){return[this.element,"click",this.clickHandler]}init(){An.getNotificationsPollOn(this.update)}update(t){this.notifications=t,this.notificationsLoaded=!0,this.element&&this._update()}clickHandler(t){const e=t.target;if(!e.matches("[data-notification-method]"))return;
639const n=e.closest(".nb-notifications-list__item"),r=Kn(n,"type"),i=Kn(n,"id"),o=Kn(n,"uuid"),s=Kn(n,"originator-id"),a=Kn(e,"method"),c={type:r,id:i,method:a,uuid:o,originatorId:s};(r!==Cn.o&&r!==Cn.p||a!==Cn.l)&&(n.querySelector(".nb-notification-action-progress__retry-button").setAttribute("data-notification-method",c.method),this.changeActionStatus(c,Cn.d),this.changeItemView(c,Cn.r),An.getNotificationsClearCache(),An.submitNotificationAction(c).then(()=>(this.changeActionStatus(c,Cn.c),n.classList.add("nb-notifications-list__item--dismissed"),Yn($n))).then(()=>{window.postMessage({notificationType:r,notificationId:i,type:"notification:resolved"})}).catch(t=>t.response?404==t.response.status?this.changeActionStatus(c,Cn.c):this.changeActionStatus(c,Cn.e,t):t.request?this.changeActionStatus(c,Cn.b,t):this.changeActionStatus(c,Cn.a,t)))}changeItemView(t,e){let{id:n}=t;const r=this.element.querySelector("[data-notification-id='".concat(n,"']"));Gn(r,e)}changeActionStatus(t,e,n){let{id:r,method:i,type:o}=t;const s=this.element.querySelector("[data-notification-id='".concat(r,"'] .nb-notification-action-progress"));this.element.querySelector("[data-notification-id='".concat(r,"'] .nb-notification-action-progress__message")).innerHTML=Xn(i,o,e,n),Qn(s,e)}buildPhrase(t){const e=t=>'<span class="nb-notification-summary__emphasis">'.concat(t,"</span>");switch(t.notification_type){case Cn.n:return"".concat(e(t.owner_persona_name)," added you as a guardian for ").concat(e(t.persona.name));case Cn.o:return"You have been invited to claim ".concat(e(t.persona.name));case Cn.p:return"".concat(e(t.organization_name)," added ").concat(e(t.persona.name)," to their roster: ").concat(e(t.roster_team_name));case Cn.q:return"".concat(e(t.organization_name)," invited ").concat(e(t.persona.name)," to join their team: ").concat(e(t.team_name));default:return""}}buildAcceptUrl(t){switch(t.notification_type){case Cn.o:case Cn.p:return"".concat(this.config.urls.userService,"/invitations/originator_redirect?originator_uuid=").concat(t.uuid);default:return"".concat(this.config.urls.userService,"/invitations/").concat(t.token,"/claim")}}}var Zn=Jn;var tr=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl,p=(l.config,l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t);l.htmlWebpackPlugin;return u('<div class="nb-menu-dropdown nb-menu-dropdown--notifications nb-menu-dropdown--'),u(e(h.active?"open":"closed")),u('"\n  role="region"\n  aria-label="'),a=3,u(e(p("NOTIFICATIONS.title"))),u('">\n  <div class="nb-menu-container">\n    <div class="nb-menu-header">
639\n      <span class="nb-menu-header__title">'),a=6,u(e(p("NOTIFICATIONS.title"))),u("</span>\n    </div>\n    "),a=8,u(h.notificationsList),u("\n  </div>\n</div>\n"),a=11,c}catch(t){r(t,'<div class="nb-menu-dropdown nb-menu-dropdown--notifications nb-menu-dropdown--<%= $ctrl.active ? \'open\' : \'closed\' %>"\n  role="region"\n  aria-label="<%= t(\'NOTIFICATIONS.title\') %>">\n  <div class="nb-menu-container">\n    <div class="nb-menu-header">\n      <span class="nb-menu-header__title"><%= t(\'NOTIFICATIONS.title\') %></span>\n    </div>\n    <%- $ctrl.notificationsList %>\n  </div>\n</div>\n',void 0,a,e)}};var er=class extends we{constructor(t){super(t),this.templateFn=tr}init(){super.init(),this.notificationsList=new Zn({parent:this})}};var nr=class extends qe{init(){An.getNotificationsPollOn(this.update)}update(t){this.updateStatus(this.getStatus(t))}getStatus(t){const e=t.length;return!!e&&(e>99?"99+":e)}};var rr=class extends se{constructor(t){super({parent:t.parent,dropdownClass:er,label:Object(i.a)("NOTIFICATIONS.tooltip"),gaLabel:"NotificationsMenu",icon:"bell",indicatorClass:nr})}},ir=n(93);n(257),n(258);var or,sr,ar=new class extends Ie{constructor(){super()}getJwt(){return this._getJwt=this._getJwt=Oe.a.post("firebase/auth",{},{baseURL:this.derivedBaseUrl}).then(t=>t.jwt)}getData(t,e){return this.getCached("ref","".concat(t,"/").concat(e),()=>this.getDatabase(t).then(t=>t.ref(e)))}getApp(t){return this.getCached("app",t,()=>{const e=this.initApp(t),n=ir.auth(e);return this.getJwt().then(t=>n.signInWithCustomToken(t)).then(()=>e)})}getDatabase(t){return this.getCached("database",t,()=>this.getApp(t).then(t=>ir.database(t)))}getCached(t,e,n){const r=this.data[t]=this.data[t]||{};return r[e]=r[e]||n()}initApp(t){const e=this.data.apps=this.data.apps||{};return e[t]=e[t]||ir.initializeApp(r.a.firebase[t],t)}};function cr(t){return t.sort((t,e)=>{const n=Date.parse(t.message.sent_on),r=Date.parse(e.message.sent_on);return n<r?1:n>r?-1:0})}var ur=new(or=mn({expiresInSeconds:600}),function(t,e,n,r,i){var o={};Object.keys(r).forEach((function(t){o[t]=r[t]})),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce((function(n,r){return r(t,e,n)||n}),o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(t,e,o),o=null)}((sr=class extends Ie{constructor(){super(),window.addEventListener("message",this.onPostMessage,!1)}setUser(t){t.uuid?this.firebaseUnreadCount(t.uuid):this.pollUnreadCount()}firebaseUnreadCount(t){ar.getData("seBar","users/".concat(t,"/unreadMessageCount")).then(t=>t.on("value",this.onUnreadCount))}getMessages(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.messagesPromise)return this.messagesPromise;const t=t=>{t.sender_avatar=bn(t.from_user_profile_images)};return this.messagesPromise=Oe.a.get("user_messages",{params:{mail_folder_name:"Inbox",order_by:"messages.sent_on",direction:"desc",page:1,hide_recipients:1}}).then(cr).then(e=>{const n=e._pagination;return n&&n.total_unread&&this.setUnreadCount(n.total_unread,!0),e.forEach(t),this.emit("messages",e),e})}onUnreadCount(t){t.exists()?this.setUnreadCount(t.val()):this.pollUnreadCount()}pollUnreadCount(){this.getUnreadCountPollOn(t=>this.setUnreadCount(t))}getUnreadCount(){return Oe.a.get("user_messages/unread").then(t=>t.unread_count)}setUnreadCount(t,e){e||delete this.messagesPromise,this.emit("unreadCount",t,e)}onPostMessage(t){"message:viewed"===(t.data||{}).type&&this.getMessages(!0)}}).prototype,"getUnreadCount",[or],Object.getOwnPropertyDescriptor(sr.prototype,"getUnreadCount"),sr.prototype),sr);var lr=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl,p=l.config,d=l.formatDate,f=(l.hasTouch,l.initializeCSSVars,l.initialsFromFullName),v=(l.multiToggleFactory,l.t);l.htmlWebpackPlugin;return u('<div class="nb-menu-body">\n  <div class="nb-messages-list">\n    '),a=3,h.messages?h.messages.length<=0?(u('\n      <div class="nb-menu-empty-state">\n        <h2 class="nb-menu-empty-state__main">'),a=10,u(e(v("MESSAGES.empty_title"))),u('</h2>\n        <p class="nb-menu-empty-state__sub">'),a=11,u(e(v("MESSAGES.empty_description"))),u("</p>\n      </div>\n    "),a=13):(u('\n      <div role="list" aria-label="'),a=14,u(e(v("MESSAGES.messages_list"))),u('">
639\n      '),a=15,h.messages.forEach((function(t){u('\n          <a\n            role="listitem"\n            href="'),a=18,u(e(p.urls.mySe)),u("/messages/"),u(e(t.message.id)),u("?"),u(e(h.referrerConfigParams)),u('"\n            nb-event="Messages:Click:ViewMessage"\n            target="_top"\n            class="nb-messages-list__item nb-messages-list__item--'),a=21,u(e(t.read?"read":"unread")),u('"\n            data-message-id="'),a=22,u(e(t.message.id)),u('">\n            <span\n              class="nb-simple-avatar nb-simple-avatar--'),a=24,u(e(t.sender_avatar?"image":"initials")),u('"\n              style="'),a=25,t.sender_avatar&&(u("background-image: url('"),u(e(t.sender_avatar)),u("');")),u('">\n              <span class="nb-menu__profile-initials">'),a=26,u(e(f(t.from_user))),u('</span>\n            </span>\n            <span class="nb-message-summary">\n              <div class="nb-message-summary__head">\n                <span class="nb-message-summary__subject">'),a=30,u(e(t.subject)),u('</span>\n                <span class="nb-message-summary__unread-indicator"></span>\n                <span class="nb-message-summary__date">'),a=32,u(e(d(t.message.sent_on))),u(' </span>\n              </div>\n              <div class="nb-message-summary__detail">'),a=34,u(e(t.from_user)),u(" - "),u(e(t.plain_text_body.replace("\n"," "))),u(" </div>\n            </span>\n          </a>\n      "),a=37})),u("\n      </div>\n    "),a=39):(u('\n      <svg class="nb-spinner" aria-label="'),a=4,u(e(v("SPINNER.loading"))),u('">\n        <title>'),a=5,v("SPINNER.loading"),u('</title>\n        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-spinner"></use>\n      </svg>\n    '),a=8),u("\n  </div>\n</div>\n"),a=42,c}catch(t){r(t,'<div class="nb-menu-body">\n  <div class="nb-messages-list">\n    <% if (!$ctrl.messages) { %>\n      <svg class="nb-spinner" aria-label="<%= t(\'SPINNER.loading\')%>">\n        <title><% t(\'SPINNER.loading\')%></title>\n        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-spinner"></use>\n      </svg>\n    <% } else if ($ctrl.messages.length <= 0) { %>\n      <div class="nb-menu-empty-state">\n        <h2 class="nb-menu-empty-state__main"><%= t(\'MESSAGES.empty_title\') %></h2>\n        <p class="nb-menu-empty-state__sub"><%= t(\'MESSAGES.empty_description\') %></p>\n      </div>\n    <% } else { %>\n      <div role="list" aria-label="<%= t(\'MESSAGES.messages_list\')%>">\n      <% $ctrl.messages.forEach(function(message) { %>\n          <a\n            role="listitem"\n            href="<%= config.urls.mySe %>/messages/<%= message.message.id %>?<%= $ctrl.referrerConfigParams %>"\n            nb-event="Messages:Click:ViewMessage"\n            target="_top"\n            class="nb-messages-list__item nb-messages-list__item--<%= message.read ? \'read\' : \'unread\' %>"\n            data-message-id="<%= message.message.id %>">\n            <span\n              class="nb-simple-avatar nb-simple-avatar--<%= message.sender_avatar ? \'image\' : \'initials\' %>"\n              style="<% if (message.sender_avatar) { %>background-image: url(\'<%= message.sender_avatar %>\');<% } %>">\n              <span class="nb-menu__profile-initials"><%= initialsFromFullName(message.from_user) %></span>\n            </span>\n            <span class="nb-message-summary">\n              <div class="nb-message-summary__head">\n                <span class="nb-message-summary__subject"><%= message.subject %></span>\n                <span class="nb-message-summary__unread-indicator"></span>\n                <span class="nb-message-summary__date"><%= formatDate(message.message.sent_on) %> </span>\n              </div>\n              <div class="nb-message-summary__detail"><%= message.from_user %> - <%= message.plain_text_body.replace(\'\\n\',\' \') %> </div>\n            </span>\n          </a>\n      <% }) %>\n      </div>\n    <% } %>\n  </div>\n</div>\n',void 0,a,e)}};class hr extends v.a{constructor(t){super(t),this.templateFn=lr,ur.on("messages",this.update)}update(t){this.messages=t,this.element&&this._update()}}var pr=hr;var dr=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl,p=l.config;l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t,l.htmlWebpackPlugin;return u('\n<div class="nb-menu-footer">'),a=2,h.showFooter&&(u('<a href="'),u(e(p.urls.mySe)),u("/messages?"),u(e(h.referrerConfigParams)),u('" class="nb-menu-footer__action" nb-event="Messages:Click:ViewAllMessages">View all messages</a>')),u("</div>\n"),a=3,c}catch(t){r(t,'<%# No whitespace allowed %>\n<div class="nb-menu-footer">
639<% if ($ctrl.showFooter) { %><a href="<%= config.urls.mySe %>/messages?<%= $ctrl.referrerConfigParams %>" class="nb-menu-footer__action" nb-event="Messages:Click:ViewAllMessages">View all messages</a><% } %></div>\n',void 0,a,e)}};class fr extends v.a{constructor(t){super(t),this.templateFn=dr,ur.on("messages",this.update)}update(t){this.showFooter=!!t.length,this.element&&this._update()}}var vr=fr;var gr=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl,p=l.config,d=(l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t);l.htmlWebpackPlugin;return u('<div class="nb-menu-dropdown nb-menu-dropdown--messages nb-menu-dropdown--'),u(e(h.active?"open":"closed")),u('"\n  role="region"\n  aria-label="'),a=3,u(e(d("MESSAGES.title"))),u('">\n  <div class="nb-menu-container">\n    <div class="nb-menu-header">
639\n      <span class="nb-menu-header__title">'),a=6,u(e(d("MESSAGES.title"))),u('</span>\n      <a class="nb-menu-header__action" href="'),a=7,u(e(p.urls.mySe)),u('/messages" nb-event="Messages:Click:NewMessage" aria-label="'),u(e(d("MESSAGES.new"))),u('">'),u(e(d("MESSAGES.plus")+d("MESSAGES.new"))),u("</a>\n    </div>\n    "),a=9,u(h.messagesList),u("\n    "),a=10,u(h.messagesFooter),u("\n  </div>\n</div>\n"),a=13,c}catch(t){r(t,'<div class="nb-menu-dropdown nb-menu-dropdown--messages nb-menu-dropdown--<%= $ctrl.active ? \'open\' : \'closed\' %>"\n  role="region"\n  aria-label="<%= t(\'MESSAGES.title\') %>">\n  <div class="nb-menu-container">\n    <div class="nb-menu-header">\n      <span class="nb-menu-header__title"><%= t(\'MESSAGES.title\') %></span>\n      <a class="nb-menu-header__action" href="<%= config.urls.mySe %>/messages" nb-event="Messages:Click:NewMessage" aria-label="<%= t(\'MESSAGES.new\') %>"><%= t(\'MESSAGES.plus\') + t(\'MESSAGES.new\') %></a>\n    </div>\n    <%- $ctrl.messagesList %>\n    <%- $ctrl.messagesFooter %>\n  </div>\n</div>\n',void 0,a,e)}};var mr=class extends we{constructor(t){super(t),this.templateFn=gr}init(){super.init(),this.messagesList=new pr({parent:this}),this.messagesFooter=new vr({parent:this})}open(){ur.on("unreadCount",this.updateMessages),ur.getMessages(!1),super.open()}close(){ur.off("unreadCount",this.updateMessages),super.close()}updateMessages(t,e){e||ur.getMessages(!0)}};var yr=class extends qe{init(){ur.on("unreadCount",this.update)}update(t){this.unreadCount!==t&&(this.unreadCount=t,this.updateStatus(this.getStatus(t)))}getStatus(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return t>99?"99+":0!==t&&t}};var br=class extends se{constructor(t){super({parent:t.parent,dropdownClass:mr,label:Object(i.a)("MESSAGES.tooltip"),gaLabel:"MessagesMenu",icon:"envelope",indicatorClass:yr})}};var _r=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl,p=(l.config,l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t);l.htmlWebpackPlugin;return u('<div class="nb-menu-dropdown nb-menu-dropdown--'),u(e(h.active?"open":"closed")),u('"\n  role="region"\n  aria-label="'),a=3,u(e(p("PROFILE.tooltip"))),u('">\n  <div style="padding: var(--se-container-spacing)">\n    <se-account-menu-element\n      '),a=6,u(h.trackElementAs("$accountMenu")),u('\n      aria-label="Your Profile and Settings"\n      id="se-account-menu">\n    </se-account-menu-element>\n  </div>\n</div>\n'),a=12,c}catch(t){r(t,'<div class="nb-menu-dropdown nb-menu-dropdown--<%= $ctrl.active ? \'open\' : \'closed\' %>"\n  role="region"\n  aria-label="<%= t(\'PROFILE.tooltip\') %>">\n  <div style="padding: var(--se-container-spacing)">\n    <se-account-menu-element\n      <%- $ctrl.trackElementAs(\'$accountMenu\') %>\n      aria-label="Your Profile and Settings"\n      id="se-account-menu">\n    </se-account-menu-element>\n  </div>\n</div>\n',void 0,a,e)}},wr=n(63);class Sr{loadAccountMenu(){return this.loadScripts("se-account-menu-v1")}loadScripts(t){return new Promise(e=>{document.getElementById(t)?e(null):["runtime","polyfills","element"].forEach(n=>{if("polyfills"===n&&window.Zone)return;const i="".concat(r.a.urls.peopleAndOrgsUrl,"/").concat(t,"/").concat(n,".js"),o=document.createElement("script");o.src=i,o.type="module",o.async=!1,"element"===n&&(o.id=t,o.addEventListener("load",e)),document.body.append(o)})})}}var Cr=n(41);var Er=class extends we{constructor(t){super(t),this.templateFn=_r,this.config=r.a,this.loader=new Sr}async init(){super.init(),await this.loader.loadAccountMenu(),this.$accountMenu?this.loadAccountMenu():this.once("render",this.loadAccountMenu.bind(this))}loadAccountMenu(){this.$accountMenu.setAttribute("options",JSON.stringify({signOutUrl:wr.a.get
639SignOutUrl()})),this.$accountMenu.addEventListener("signingOut",this.signingOut)}signingOut(){var t,e;gn(),null===(t=Cr.b.instance)||void 0===t||null===(e=t.auth)||void 0===e||e.signOut(Cr.c.userSignOut)}};var xr,Tr,Ir,kr=class extends se{constructor(t){const e=t.profile;super({parent:t.parent,label:Object(i.a)("PROFILE.tooltip"),gaLabel:"ProfileMenu",dropdownClass:Er,dropdownOptions:{profile:e},avatarData:{type:"person",identity:(e.first_name||"")+" "+(e.last_name||""),imgUrl:_n(e.profile_image_url)}}),this.profile=e}};function Or(t,e,n,r,i){var o={};return Object.keys(r).forEach((function(t){o[t]=r[t]})),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce((function(n,r){return r(t,e,n)||n}),o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(t,e,o),o=null),o}var Ar=new(xr=mn({expiresInSeconds:1800}),Tr=mn({expiresInSeconds:1800}),Or((Ir=class extends Ie{constructor(){super(),this.buttonText=Object(i.a)("SWITCHER.teams"),this.label="",this.menus=[]}getOrgMenu(){return this.orgMenuPromise?this.orgMenuPromise:this.orgMenuPromise=this.getMenu("organizations",3,3,"organizations/mine?excluded_org_types=Team","parseOrg")}getTeamMenu(){return this.teamMenuPromise?this.teamMenuPromise:this.teamMenuPromise=this.getMenu("teams",3,1,"v3/teams/mine?include_favorites=1&with_retired=1&originator_system=Ngin,TeamService,StatNgin","parseTeam")}getMenu(t,e,n,o,s){const a={showCount:e,viewAllThreshold:n,viewAllUrl:"".concat(r.a.urls.snFrontend,"/user/").concat(t),title:Object(i.a)("SWITCHER.".concat(t)),key:"".concat(t[0].toUpperCase()).concat(t.substring(1)),viewAll:Object(i.a)("SWITCHER.".concat(t,"_view_all"))};return this.menus.push(a),Oe.a.get(o).then(t=>{if(a.items=t.map(t=>this[s](t)).filter(t=>!!t),!a.items.length){const t=this.menus.indexOf(a);-1!==t&&this.menus.splice(t,1)}})}parseOrg(t){if(this.buttonText=Object(i.a)("SWITCHER.organizations"),this.mobileButtonText=Object(i.a)("SWITCHER.organizations_mobile"),"Team"!==t.organization_types)return{title:t.name,avatar:{identity:t.name,type:"organization",imgUrl:t.logo&&!t.logo.is_default?t.logo.large_logo_url:null,size:300},url:"".concat(r.a.urls.snFrontend,"/org/").concat(t.id)}}parseTeam(t){const e="".concat(r.a.urls.snFrontend).concat(this.setTeamURL(t)),n=t.program_secondary_text;(t.trigger_roster_personas||[]).map(t=>t.nickname).join(", ");return{title:t.name,subtitle:t.org_details&&t.org_details.name,descriptionList:[n],avatar:{imgUrl:t.logo&&t.logo.image_urls&&t.logo.image_urls.large||null,identity:t.name,type:t.originator_type,sport:t.sport,color:t.primary_color,size:300},url:e}}setTeamURL(t){return"Ngin"===t.originator_system?"/teams/team-instance-redirect/".concat(t.originator_id):"/teams/".concat(t.id)}}).prototype,"getOrgMenu",[xr],Object.getOwnPropertyDescriptor(Ir.prototype,"getOrgMenu"),Ir.prototype),Or(Ir.prototype,"getTeamMenu",[Tr],Object.getOwnPropertyDescriptor(Ir.prototype,"getTeamMenu"),Ir.prototype),Ir);var Rr=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl,p=(l.config,l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t);l.htmlWebpackPlugin;return u('<div class="nb-menu-dropdown nb-menu-dropdown--switcher nb-menu-dropdown--'),u(e(h.active?"open":"closed")),u('"\n  role="region"\n  aria-label="'),a=3,u(e(p("SWITCHER.organizations"))),u('"\n>\n  <div class="nb-menu-container">\n    <div class="nb-menu-body">\n      '),a=7,h.fetchedTeams?h.menus.length<=0?(u('\n        <div class="nb-menu-empty-state" >\n          <h2 class="nb-menu-empty-state__main">'),a=14,u(e(p("SWITCHER.empty_title"))),u('</h2>\n          <p class="nb-menu-empty-state__sub">
639'),a=15,u(e(p("SWITCHER.empty_description"))),u("</p>\n        </div>\n      "),a=17):(u("\n        "),a=18,h.menus.forEach((function(t,n){u('\n          <div class="nb-list">\n            <span class="nb-list__header" aria-hidden="true" id="switcher-list-header-'),a=20,u(e(n)),u('">\n              '),a=21,u(e(t.title)),u('\n            </span>\n            <div class="nb-list__items" role="list" aria-labelledby="switcher-list-header-'),a=23,u(e(n)),u('">\n              '),a=24,t.items.slice(0,t.showCount).forEach((function(n,r){u('\n                <a nb-close-dropdown class="nb-list-item--clickable" href="'),a=25,u(e(n.url)),u('" target="_self"\n                  nb-event="ContextSwitcher:Click:View'),a=26,u(e(t.key)),u(":"),u(e(r+1)),u('"\n                  role="listitem"\n                  aria-labelledby="switcher-listitem-title-'),a=28,u(e(t.key)),u("-"),u(e(r)),u('">\n                  <span class="nb-list-item__avatar" aria-hidden="true">\n                    '),a=30,u(n.avatar),u('\n                  </span>\n                  <span class="nb-list-item__summary">\n                    <div class="nb-list-item__header">\n                      <span class="nb-list-item__title" id="switcher-listitem-title-'),a=34,u(e(t.key)),u("-"),u(e(r)),u('">\n                        '),a=35,u(e(n.title)),u("\n                      </span>\n                      "),a=37,n.subtitle&&"Ngin"===n.originator_system&&(u('\n                        <span class="nb-list-item__subtitle">'),a=38,u(e(n.subtitle)),u("</span>\n                      "),a=39),u("\n                    </div>\n                    "),a=41,n.descriptionList&&"Ngin"===n.originator_system&&(u('\n                      <ul class="nb-list-item__description-list" >\n                        '),a=43,n.descriptionList.forEach((function(t){u("\n                          <li>"),a=44,u(e(t)),u("</li>\n                        "),a=45})),u("\n                      </ul>\n                    "),a=47),u("\n                  </span>\n                </a>\n              "),a=50})),u("\n            </div>\n            "),a=52,t.items.length>=t.viewAllThreshold&&(u('\n              <div class="nb-list__footer">\n                <a nb-close-dropdown href="'),a=54,u(e(t.viewAllUrl)),u("?"),u(e(h.referrerConfigParams)),u('" target="_self" class="nb-link-2" nb-event="ContextSwitcher:Click:ViewAll'),u(e(t.key)),u('">'),u(e(t.viewAll)),u("</a>\n              </div>\n            "),a=56),u("\n          </div>\n        "),a=58})),u("\n      "),a=59):(u('\n        <svg class="nb-spinner" aria-label="'),a=8,u(e(p("SPINNER.loading"))),u('">\n          <title>'),a=9,p("SPINNER.loading"),u('</title>\n          <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-spinner"></use>\n        </svg>\n      '),a=12),u("\n    </div>\n  </div>\n</div>\n"),a=63,c}catch(t){r(t,'<div class="nb-menu-dropdown nb-menu-dropdown--switcher nb-menu-dropdown--<%= $ctrl.active ? \'open\' : \'closed\' %>"\n  role="region"\n  aria-label="<%= t(\'SWITCHER.organizations\') %>"\n>\n  <div class="nb-menu-container">\n    <div class="nb-menu-body">\n      <% if (!$ctrl.fetchedTeams) { %>\n        <svg class="nb-spinner" aria-label="<%= t(\'SPINNER.loading\')%>">\n          <title><% t(\'SPINNER.loading\')%></title>\n          <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#svg-spinner"></use>\n        </svg>\n      <% } else if ($ctrl.menus.length <= 0)  { %>\n        <div class="nb-menu-empty-state" >\n          <h2 class="nb-menu-empty-state__main"><%= t(\'SWITCHER.empty_title\') %></h2>\n          <p class="nb-menu-empty-state__sub"><%= t(\'SWITCHER.empty_description\') %></p>\n        </div>\n      <% } else { %>\n        <% $ctrl.menus.forEach(function(menu, index) { %>\n          <div class="nb-list">\n            <span class="nb-list__header" aria-hidden="true" id="switcher-list-header-<%= index %>">\n              <%= menu.title %>\n            </span>\n            <div class="nb-list__items" role="list" aria-labelledby="switcher-list-header-<%= index %>">\n              <% menu.items.slice(0, menu.showCount).forEach(function(item, i) { %>\n                <a nb-close-dropdown class="nb-list-item--clickable" href="<%= item.url %>" target="_self"\n                  nb-event="ContextSwitcher:Click:View<%= menu.key %>:<%= (i + 1) %>"\n                  role="listitem"\n                  aria-labelledby="switcher-listitem-title-<%= menu.key %>-<%= i %>">
639\n                  <span class="nb-list-item__avatar" aria-hidden="true">\n                    <%- item.avatar %>\n                  </span>\n                  <span class="nb-list-item__summary">\n                    <div class="nb-list-item__header">\n                      <span class="nb-list-item__title" id="switcher-listitem-title-<%= menu.key %>-<%= i %>">\n                        <%= item.title %>\n                      </span>\n                      <% if (item.subtitle && item.originator_system === \'Ngin\') { %>\n                        <span class="nb-list-item__subtitle"><%= item.subtitle %></span>\n                      <% } %>\n                    </div>\n                    <% if (item.descriptionList && item.originator_system === \'Ngin\') { %>\n                      <ul class="nb-list-item__description-list" >\n                        <% item.descriptionList.forEach(function(description) { %>\n                          <li><%= description %></li>\n                        <% }) %>\n                      </ul>\n                    <% } %>\n                  </span>\n                </a>\n              <% }) %>\n            </div>\n            <% if (menu.items.length >= menu.viewAllThreshold) { %>\n              <div class="nb-list__footer">\n                <a nb-close-dropdown href="<%= menu.viewAllUrl %>?<%= $ctrl.referrerConfigParams %>" target="_self" class="nb-link-2" nb-event="ContextSwitcher:Click:ViewAll<%= menu.key %>"><%= menu.viewAll %></a>\n              </div>\n            <% } %>\n          </div>\n        <% }) %>\n      <% } %>\n    </div>\n  </div>\n</div>\n',void 0,a,e)}};var Nr=class extends we{constructor(t){super(t),this.fetchedTeams=!1,this.templateFn=Rr}open(){return super.open(),Ar.getTeamMenu().then(()=>{this.updateMenus(Ar.menus)}).finally(()=>{this.fetchedTeams=!0,this._update()})}updateMenus(t){this.menus=t,t.forEach(this.createAvatars)}createAvatars(t){t.items.forEach(this.createAvatar)}createAvatar(t){t.avatar&&(t.avatar=new Qt(Object.assign({parent:this},t.avatar)))}};var Pr=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl;l.config,l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t,l.htmlWebpackPlugin;return u('<div class="nb-menu-item">\n  <span\n    aria-label="'),a=3,u(e(h.buttonText)),u('"\n    aria-expanded="'),a=4,u(e(h.active||!1)),u('"\n    class="nb-switcher-button"\n    id="'),a=6,u(e(h._elementId)),u('"\n    role="button"\n    tabindex="0"\n    '),a=9,u(h.tooltip.target),u('\n  >\n    <div class="nb-switcher-button__target hide-mobile">\n      '),a=12,u(h.buttonText+h.iconSvg),u('\n    </div>\n    <div class="nb-switcher-button__target mobile-only">\n      '),a=15,u((h.mobileButtonText||h.buttonText)+h.mobileIconSvg),u("\n    </div>\n  </span>\n  "),a=18,u(h.dropdown),u("\n</div>\n\n"),a=21,c}catch(t){r(t,'<div class="nb-menu-item">\n  <span\n    aria-label="<%= $ctrl.buttonText %>"\n    aria-expanded="<%= $ctrl.active || false %>"\n    class="nb-switcher-button"\n    id="<%= $ctrl._elementId %>"\n    role="button"\n    tabindex="0"\n    <%- $ctrl.tooltip.target %>\n  >\n    <div class="nb-switcher-button__target hide-mobile">\n      <%- $ctrl.buttonText + $ctrl.iconSvg %>\n    </div>\n    <div class="nb-switcher-button__target mobile-only">\n      <%- ($ctrl.mobileButtonText || $ctrl.buttonText) + $ctrl.mobileIconSvg %>\n    </div>\n  </span>\n  <%- $ctrl.dropdown %>\n</div>\n\n',void 0,a,e)}};var Mr=class extends se{constructor(t){super({parent:t.parent,label:Object(i.a)("SWITCHER.tooltip"),gaLabel:"ContextSwitcher",dropdownClass:Nr}),this.templateFn=Pr,this.buttonText=Ar.buttonText,this.mobileButtonText=Ar.mobileButtonText,this.iconSvg
639=new Lt({parent:this,icon:"chevronDown",class:"nb-switcher-button__icon"}),this.mobileIconSvg=new Lt({parent:this,icon:"chevronDown",class:"nb-switcher-button__icon"})}load(){return Ar.getOrgMenu().then(()=>{this.buttonText=Ar.buttonText,this.mobileButtonText=Ar.mobileButtonText,this.dropdown.updateMenus(Ar.menus)})}};var Dr=new class extends Ie{constructor(){super(),this.baseUrl="",this.promise=null}showOnboardingPrompt(){return Oe.a.get("v3/mfa_onboarding/show_onboarding_prompt",{baseURL:this.derivedBaseUrl,simpleHeaders:!0}).then(t=>t).catch(t=>(console.log("[se-bar] Show show_onboarding_prompt error",t),{}))}};var Lr=function(t,e,n,r){r=r||function(t,e,n,r,i){var o=e.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),u=o.slice(s,a).map((function(t,e){var n=e+s+1;return(n==r?" >> ":"    ")+n+"| "+t})).join("\n");throw t.path=c,t.message=(c||"ejs")+":"+r+"\n"+u+"\n\n"+t.message,t},e=e||function(t){return null==t?"":String(t).replace(o,s)};var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},o=/[&<>'"]/g;function s(t){return i[t]||t}var a=1;try{var c="";function u(t){null!=t&&(c+=t)}var l=t||{},h=l.$ctrl,p=(l.config,l.formatDate,l.hasTouch,l.initializeCSSVars,l.initialsFromFullName,l.multiToggleFactory,l.t);l.htmlWebpackPlugin;return u('<span class="nb-container" new-nginbar>\n  <span class="nb-main '),a=2,u(e(h.nbMainClass)),u('">\n\n    '),a=4,u(h.backButton),u("\n\n    "),a=6,u("\n    <a "),a=7,u(h.trackElementAs("$seLogo")),u(' href="'),u(e(h.appHomeUrl)),u('" target="_top" class="'),u(e(h.logoClass)),u('">'),u(e(h.appName)),u("</a>\n    "),a=8,h.hasMobileNav?(u('\n      <button aria-label="'),a=9,u(e(p("NAVIGATION.label"))),u('" '),u(h.trackElementAs("$mobileTrigger")),u('class="nb-sportngin--mobile nb-sportngin--mobile-with-nav">\n        '),a=10,u(h.mobileNavIcon),u('\n        <span class="nb-mobile-nav__label">'),a=11,u(e(p("menu"))),u("</span>\n      </button>\n    "),a=13):(u('\n      <a href="'),a=14,u(e(h.config.urls.se)),u('" alt="'),u(e(p("sportsengine_alt"))),u('" class="nb-sportngin--mobile">'),u(e(p("sportsengine"))),u("</a>\n    "),a=15),u('\n\n    <span class="nb-search__container" '),a=17,u(h.trackElementAs("searchContainer")),u("></span>\n\n    "),a=19,h.profile&&(u("\n      "),a=20,u(h.switcherButton),u("\n    "),a=21),u("\n\n    "),a=23,u("\n    "),a=24,h.profile&&(u("\n      "),a=25,u(h.chatButton),u("\n    "),a=26),u("\n\n    "),a=28,u("\n    "),a=29,h.profile&&(u("\n      "),a=30,u(h.messagesButton),u("\n    "),a=31),u("\n\n    "),a=33,u("\n    "),a=34,h.profile&&(u("\n      "),a=35,u(h.notificationsButton),u("\n    "),a=36),u("\n\n    "),a=38,u("\n    "),a=39,h.profile?(u("\n      "),a=40,u(h.profileButton),u("\n    "),a=41):(u("\n      "),a=42,u(h.signInButton),u("\n    "),a=43),u("\n  </span>\n  "),a=45,h.sessionStateManager&&(u("\n    "),a=46,u(h.sessionTimeout),u("\n  "),a=47),u("\n</span>\n\n"),a=50,h.showMfaOnboardingPrompt&&(u('\n  <div class="nb-modal--medium-large" id="mfa-onboarding-modal" style="margin-top: 10px; max-height: 1000%;">\n    <div class="nb-modal__content">\n      '),a=53,u(h.mfaOnboardingIcon),u('\n      <p class="nb-text" style="font-size: 16px; font-family: \'Open Sans\'; font-weight: 500;">\n        Due to your status as an admin, you are required to configure Multi-Factor Authentication (MFA) on your account.\n        <br><br>\n        This is to provide enhanced security for your business and user data. To learn what MFA is and how it works <a href="https://help.sportsengine.com/en/articles/8646656-multi-factor-authentication-overview" target="_blank">click here</a>.\n        <br><br>\n        Click the "Set up MFA" button below to continue.\n      </p>\n    </div>\n    <div class="nb-modal__footer nb-button-group" style="font-size: 15px; font-family: \'Open Sans\';">\n      <button class="nb-button--minimal se-bar__mfa-onboarding__skip">Skip for now</button>\n      <button class="nb-button--primary se-bar__mfa-onboarding__setup">Set up MFA</button>\n    </div>\n  </div>\n'),a=67),u("\n"),a=68,c}catch(t){r(t,'<span class="nb-container" new-nginbar>\n  <span class="nb-main <%= $ctrl.nbMainClass %>">\n\n    <%- $ctrl.backButton %>\n\n    <%# SE Logo / Mobile Menu %>\n    <a <%- $ctrl.trackElementAs(\'$seLogo\') %> href="<%= $ctrl.appHomeUrl %>" target="_top" class="<%= $ctrl.logoClass %>"><%= $ctrl.appName %></a>\n    <% if ($ctrl.hasMobileNav) { %>\n      <button aria-label="<%= t(\'NAVIGATION.label\')%>" <%- $ctrl.trackElementAs(\'$mobileTrigger\') %>class="nb-sportngin--mobile nb-sportngin--mobile-with-nav">\n        <%- $ctrl.mobileNavIcon %>
639\n        <span class="nb-mobile-nav__label"><%= t(\'menu\') %></span>\n      </button>\n    <% } else { %>\n      <a href="<%= $ctrl.config.urls.se %>" alt="<%= t(\'sportsengine_alt\') %>" class="nb-sportngin--mobile"><%= t(\'sportsengine\') %></a>\n    <% } %>\n\n    <span class="nb-search__container" <%- $ctrl.trackElementAs(\'searchContainer\') %>></span>\n\n    <% if ($ctrl.profile) { %>\n      <%- $ctrl.switcherButton %>\n    <% } %>\n\n    <%# Chat %>\n    <% if ($ctrl.profile) { %>\n      <%- $ctrl.chatButton %>\n    <% } %>\n\n    <%# Messages %>\n    <% if ($ctrl.profile) { %>\n      <%- $ctrl.messagesButton %>\n    <% } %>\n\n    <%# Notifications %>\n    <% if ($ctrl.profile) { %>\n      <%- $ctrl.notificationsButton %>\n    <% } %>\n\n    <%# User / Sign In %>\n    <% if ($ctrl.profile) { %>\n      <%- $ctrl.profileButton %>\n    <% } else { %>\n      <%- $ctrl.signInButton %>\n    <% } %>\n  </span>\n  <% if ($ctrl.sessionStateManager) { %>\n    <%- $ctrl.sessionTimeout %>\n  <% } %>\n</span>\n\n<% if ($ctrl.showMfaOnboardingPrompt) { %>\n  <div class="nb-modal--medium-large" id="mfa-onboarding-modal" style="margin-top: 10px; max-height: 1000%;">\n    <div class="nb-modal__content">\n      <%- $ctrl.mfaOnboardingIcon %>\n      <p class="nb-text" style="font-size: 16px; font-family: \'Open Sans\'; font-weight: 500;">\n        Due to your status as an admin, you are required to configure Multi-Factor Authentication (MFA) on your account.\n        <br><br>\n        This is to provide enhanced security for your business and user data. To learn what MFA is and how it works <a href="https://help.sportsengine.com/en/articles/8646656-multi-factor-authentication-overview" target="_blank">click here</a>.\n        <br><br>\n        Click the "Set up MFA" button below to continue.\n      </p>\n    </div>\n    <div class="nb-modal__footer nb-button-group" style="font-size: 15px; font-family: \'Open Sans\';">\n      <button class="nb-button--minimal se-bar__mfa-onboarding__skip">Skip for now</button>\n      <button class="nb-button--primary se-bar__mfa-onboarding__setup">Set up MFA</button>\n    </div>\n  </div>\n<% } %>\n',void 0,a,e)}},jr=n(161),Ur=n(57),Fr=n(262),Hr=n(37),Br=n(164),qr=n(274),Vr=n(261),Wr=n(158),zr=n(166),$r=n(69),Yr=n(23),Kr=n(259),Gr=n(260),Qr=n(46),Xr=n(1),Jr=n(5);var Zr=function(){function t(t,e){this.predicate=t,this.inclusive=e}return t.prototype.call=function(t,e){return e.subscribe(new ti(t,this.predicate,this.inclusive))},t}(),ti=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.inclusive=r,i.index=0,i}return Xr.a(e,t),e.prototype._next=function(t){var e,n=this.destination;try{e=this.predicate(t,this.index++)}catch(t){return void n.error(t)}this.nextOrComplete(t,e)},e.prototype.nextOrComplete=function(t,e){var n=this.destination;Boolean(e)?n.next(t):(this.inclusive&&n.next(t),n.complete())},e}(Jr.a),ei=n(8);var ni=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new ri(t,this.callback))},t}(),ri=function(t){function e(e,n){var r=t.call(this,e)||this;return r.add(new ei.a(n)),r}return Xr.a(e,t),e}(Jr.a);const{templateFn:ii}=n(263);class oi extends v.a{constructor(t,e,n){super({parent:e,elementId:n}),this.templateFn=ii,this.trackSubscription(t,this.onValue)}get value(){return this._value}onValue(t){this._value=t,this._update()}}const{templateFn:si}=n(264),ai=1e3,ci="nb-session-countdown";class ui extends v.a{constructor(t,e){super({parent:e}),this.countdownContent='<span id="'.concat(ci,'"></span>'),this.extend$$=new Yr.a,this.signOut$$=new Yr.a,this.templateFn=si,this.extend$=this.extend$$.asObservable(),this.signOut$=this.signOut$$.asObservable(),this.countdown=new oi(this.initCountdown(t),this,ci)}get eventBindings(){return this.element?[this.element,"click",".se-bar__session-inactivity-warning__extend",this.onExtend,this.element,"click",".se-bar__session-inactivity-warning__sign_out",this.onSignOut]:[]}initCountdown(t){const e=Object(jr.a)(Object(Ur.a)(0),Object(Kr.a)(ai));return Object(Gr.a)([Object(Ur.a)(t),e]).pipe((r=t=>{let[e]=t;return e.expires_at>Date.now()},void 0===i&&(i=!1),function(t){return t.lift(new Zr(r,i))}),Object(Hr.a)(t=>{let[e]=t;return this.toCountdownData(e)}),(n=()=>Object(Qr.a)(new Error("Session Expired!")),function(t){return t.lift(new ni(n))}));var n,r,i}toCountdownData(t){if(t)return Math.ceil((t.expires_at-Date.now())/1e3)}dispose(){super.dispose(),this.extend$$.complete(),this.signOut$$.complete()}onExtend(){this.extend$$.next()}onSignOut(){this.signOut$$.next()}}const{templateFn:li}=n(265);function hi(t){let[e,n]=t;return n===Cr.d.active&&e!==Cr.d.active}class pi extends v.a{constructor(t){super(),this.sessionState=t,this.templateFn=li,console.log("[se-bar SessionTimeout] ctr"),this.inactivityWarning$=this.initCountdownState().pipe(Object(Fr.a)((t,e)=>!(!t&&e||t&&!e)&&(!t&&!e||t.authenticated===e.authenticated&&t.expires_at===e.expires_at)),Object(Hr.a)(t=>t?new ui(t,this):void 0),Object(Br.a)()),this.trackSubscription(this.inactivityWarning$,this.onInactivityWarning)}initCountdownState(){const t=this.sessionState.userState$.pipe(Object(qr.a)(void 0),Object(Vr.a)(),Object(Wr.a)(hi),Object(Hr.a)(()=>void 0),Object(zr.a)(1));return this.sessionState.userInactivityAlert$.pipe(Object($r.a)(e=>Object(jr.a)(Object(Ur.a)(e),t)))}onInactivityWarning(t){this.removeInactivityWarning(),this.initInactivityWarning(t),this._update()}removeInactivityWarning(){this.inactivityWarning&&(this.inactivityWarning._destroy(),this.inactivityWarning=void 0)}initInactivityWarning(t){t?(console.log("[se-bar SessionTimeout] detected idle state, showing countdown"),t.extend$.subscribe(()=>this.onExtend()),t.signOut$.subscribe(()=>this.onSignOut())):console.log("[se-bar SessionTimeout] detected non-idle state, hiding countdown"),this.inactivityWarning=t}onExtend(){this.sessionState.extendSession(),this.removeInactivityWarning(),this._update()}onSignOut(){this.sessionState.auth.signOut(Cr.c.userSignOut),this.removeInactivityWarning(),this._update()}}var di=n(157),fi=n(53);const{templateFn:vi}=n(266);class gi extends v.a{constructor(t){super({parent:t}),this.locationChange$=Object(di.a)(window,"popstate").pipe(Object(qr.a)(()=>fi.b.href),Object(Hr.a)(()=>fi.b.href),Object(Fr.a)(),Object(Br.a)()),this.templateFn=vi,this.trackSubscription(this.locationChange$,this.onLocationChange)}get signInUrl(){return this._signInUrl}
639updateUrlProperties(){this._signInUrl=wr.a.getSignInUrl()}onLocationChange(){this.updateUrlProperties(),this._update()}}const mi="--se-z-global-nav",yi=document.getElementById("ngin-bar"),bi=window.getComputedStyle(document.documentElement),_i=yi&&window.getComputedStyle(yi),wi=_i&&Number(_i.getPropertyValue("z-index")),Si=Number(bi.getPropertyValue("--se-z-global-nav"))||98,Ci=wi||Si,Ei=992147483e3,xi="nb-mobile-nav-enabled",Ti="nb-mobile-nav-open",Ii=document.body.classList,ki="se-left-nav.toggle",Oi="se-left-nav.close",Ai="light",Ri="dark",Ni=[Ri,Ai],Pi=Object(f.multiToggleFactory)(Ni,t=>"".concat("nb","-").concat(t)),Mi="normal",Di="standalone",Li=[Mi,Di],ji=Object(f.multiToggleFactory)(Li,t=>"".concat("nb-page-mode","--").concat(t)),Ui=t=>t===Cn.h?"".concat(Cn.i,"--").concat(t):Cn.i,Fi=Object(f.multiToggleFactory)(Cn.f,Ui);let Hi;class Bi extends v.a{static get instance(){return Hi}constructor(t){super(t),Hi&&Hi._destroy(),Hi=this,this.html=document.documentElement,this.html.classList.add("has-se-bar"),this.ready=!1,this.templateFn=Lr,this.data={},this.profile=t.profile,this.hasMobileNav=!(!r.a.mobileNav&&!r.a.mobileNavToggle),this.mobileNavOpen=!1,this.dropdownOpen=!1,this.readyHandlers=[].concat(window.nginBar||window.seBar||[]),this.sessionState=t.sessionStateManager,window.nginBar=window.seBar=this,this.mfaOnboardingService=Dr}push(t){this.ready?t(this):this.readyHandlers.push(t)}
639async init(){this.mfaOnboardingIcon=new Lt({parent:this,icon:"spotSafety",style:"display: block; margin-left: auto; margin-right: auto; width: 50%;"}),this.hasMobileNav&&(this.mobileNavIcon=new Lt({parent:this,icon:"menu",class:"nb-mobile-nav__icon"})),this.backButton=new Ft({parent:this}),this.signInButton=new gi(this),await this.initProfileDependentChildren(),this.setZIndex(),this.legacySupport(),this.initConfigEvents(),this.initSessionState()}openOverlay(t,e){switch(t){case"mobileNav":this.mobileNavOpen=e;break;case"dropdown":this.dropdownOpen=e}this.setZIndex()}overlayOpen(){return this.mobileNavOpen||this.dropdownOpen}setZIndex(){if(yi){yi.style.zIndex="var(--se-z-global-nav)";const t=this.overlayOpen()?Ei:Ci;this.html.style.setProperty(mi,t.toString())}}async initProfileDependentChildren(){if(await this.destroyProfileDependentChildren(),this.profile){this.notificationsButton=new rr({parent:this}),this.messagesButton=new br({parent:this}),this.profileButton=new kr({parent:this,profile:this.profile}),this.switcherButton=r.a.hideSwitcher?"":new Mr({parent:this}),this.chatButton=new We({parent:this});const t=await this.mfaOnboardingService.showOnboardingPrompt();this.showMfaOnboardingPrompt=null==t?void 0:t.show_mfa_onboarding_prompt}}destroyProfileDependentChildren(){return Promise.all([this._removeChild(this.notificationsButton),this._removeChild(this.chatButton),this._removeChild(this.profileButton),this._removeChild(this.switcherButton)])}initSessionState(){this.sessionState&&(this.sessionTimeout=new pi(this.sessionStateManager),this.trackSubscription(this.sessionState.sessionState$.sessionStart$,async t=>{this.profile&&this.profile.id===t.id||(this.profile=t,await this.initProfileDependentChildren(),this._update())}),this.trackSubscription(this.sessionState.sessionState$.sessionEnd$,async()=>{this.profile=void 0,this.destroyProfileDependentChildren(),this._update()}))}async _removeChild(t){t&&(await t._destroy(),t.element&&t.element.remove())}afterRender(){this.app=Cn.f.includes(this.app)?this.app:Cn.g,this.theme=this.themeIsLight?Ai:Ri,this.pageMode=this.pageMode===Di?Di:Mi}get logoClass(){return Ui(this.config.app)}get app(){return this.config.app}set app(t){Cn.f.includes(t)||(t=Cn.g),Fi(this.$seLogo,t)&&(this.config.app=t,this.$seLogo.innerText=this.appName)}get appName(){switch(this.config.app){case"hq":return Object(i.b)("sportsengine_hq");default:return Object(i.b)("sportsengine")}}set orgId(t){r.a.orgId=t}get orgId(){return this.config.orgId}set teamId(t){r.a.teamId=t}get teamId(){return this.config.teamId}get referrerParam(){return"se-ref=".concat(encodeURIComponent(window.location))}get appHomeUrl(){switch(this.config.app){case Cn.h:return"".concat(this.config.urls.hq,"/").concat(this.orgId);case Cn.j:return this.config.urls.mySe;case Cn.k:return"".concat(this.config.urls.teamCenter,"/").concat(this.teamId);default:return this.config.urls.se}}get nbMainClass(){return"nb-main--".concat("production")}initConfigEvents(){var t=r.a.on||{};for(var e in t)this.on(e,t[e])}get themeIsLight(){return this.config.theme?this.config.theme===Ai:this.element.classList.contains("nb-light")}get theme(){return this.config.theme}set theme(t){Pi(this.element,t)&&(this.config.theme=t)}get pageMode(){return this.config.pageMode}set pageMode(t){ji(this.element,t)&&(this.config.pageMode=t)}legacySupport(){r.a.onInit&&this.on("init",()=>r.a.onInit(this)),this.hasMobileNav&&Ii.add(xi)}get eventBindings(){const t=[this.element,"click","[nb-event]",this.sendEvent,this.element,"click",".nb-back",this.goBack,this.element,"click",".se-bar__mfa-onboarding__skip",this.mfaOnboardingModalClose,this.element,"click",".se-bar__mfa-onboarding__setup",this.mfaOnboardingSetup];return this.hasMobileNav&&t.push(this.$mobileTrigger,"click",this.toggleMobileMenu),t}goBack(){window.history.back()}toggleMobileMenu(){const t=!this.mobileNavOpen;this.openOverlay("mobileNav",t);const e=r.a.mobileNavToggle;if(Ii[t?"remove":"add"](Ti),document.dispatchEvent(new CustomEvent(ki,{detail:this.$mobileTrigger})),t&&d.sendEvent("Main","Open","MobileMenu"),e)return e(this.$mobileTrigger)}
639closeMobileMenu(){if(!this.mobileNavOpen)return;this.mobileNavOpen=!1;const t=r.a.mobileNavClose,e=r.a.mobileNavToggle;Ii.remove(Ti),document.dispatchEvent(new CustomEvent(Oi)),t?t():e&&e()}sendEvent(t){const e=t.data.delegatedTarget;if(!e)return;const n=e.getAttribute("nb-event").split(":"),r=n[0],i=n[1],o=n[2],s=parseInt(n[3],10)||void 0;e.matches("a")?d.sendEventLink(t,r,i,o,s):d.sendEvent(r,i,o,s)}afterUpdate(){this.revealNginBar()}revealNginBar(){setTimeout(()=>{this.element.classList.add("nb-shown"),document.body.className=document.body.className,this.readyHandlers.forEach(t=>{try{t(this)}catch(e){console.error("Error running readyHandler",{handler:t,error:e})}}),this.readyHandlers.length=0,this.ready=!0},0)}mfaOnboardingModalClose(){document.getElementById("mfa-onboarding-modal").style.display="none"}mfaOnboardingSetup(){window.location.href="".concat("https://user.sportngin.com","/v3/mfa_onboarding/new?user_return_to=").concat(encodeURIComponent(window.location.href))}}var qi=n(84),Vi=n(74),Wi=n.n(Vi);var zi=new class extends Ie{constructor(t){super(),this.cache={},this.promise=null}setPreferences(t){this.cacheAll({data:{result:t}})}clearCache(){for(var t in this.promise=null,this.cache)this.cache.hasOwnProperty(t)&&delete this.cache[t]}cacheAll(t){return this.clearCache(),t.forEach(t=>this.cacheOne(t)),this.cache}cacheOne(t){t=t.data||t;var e=this.cache[t.key]=t;return"boolean"===e.datatype&&(e.value="true"===e.value||!0===e.value),e}get(t){return this.promise?this.promise:this.promise=Oe.a.get("user_preferences").then(t=>this.cacheAll(t)).then(e=>t?(e[t]||{}).value:e)}set(t,e,n){var r={key:t,value:e};return n&&(r.feedback=n),Oe.a.put(URL,r).then(t=>this.cacheOne(t))}};new qi.a(document,localStorage,Bi,Cr.b,new Cr.a(new fi.a,Oe.a),zi,ur,Ne,(function(){var t;vn()&&gn(),t=Je,Ye()&&fn[t].set(ln(tn,Ze),Ye())}),(function(){return Promise.all([Wi.a.get(r.a.urls.svg).then(t=>{const e=document.createElement("span");e.innerHTML=t.data,document.body.appendChild(e)}),new Promise((t,e)=>{const n=document.createElement("link");n.id="nginBarCss",n.rel="stylesheet",n.href="".concat(r.a.urls.snapTheme,"/main-v2.css?20190108"),document.head.appendChild(n),n.addEventListener("load",()=>t()),n.addEventListener("error",t=>e(t))})])}),f.initializeCSSVars).run("ngin-bar","se-bar",f.hasTouch).catch(t=>console.log("[se-bar] error bootstrapping SE Bar",t))},,function(t,e,n){"use strict";var r=n(57),i=n(58);function o(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Object(i.a)(1)(r.a.apply(void 0,t))}var s=n(24);function a(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Object(s.a)(n)?(t.pop(),function(e){return o(t,e,n)}):function(e){return o(t,e)}}n.d(e,"a",(function(){return a}))}]);
640}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.