1(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-vendors"],{"000b":function(t,e,n){"use strict";n("dcaa")},"001a":function(t,e,n){"use strict";var r=n("c23d"),i=n("9ab4"),o=n("4be4");function s(t){return t&&"object"===typeof t&&"default"in t?t:{default:t}}var a=s(r),u={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},c=function(t){function e(n,r,i){var o=t.call(this,r)||this;return Object.setPrototypeOf(o,e.prototype),o.code=n,o.details=i,o}return i.__extends(e,t),e}(Error); 2/** 3 * @license 4 * Copyright 2017 Google LLC 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */function h(t){if(t>=200&&t<300)return"ok";switch(t){case 0:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 500:return"internal";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}function l(t,e,n){var r=h(t),i=r,o=void 0;try{var s=e&&e.error;if(s){var a=s.status;if("string"===typeof a){if(!u[a])return new c("internal","internal");r=u[a],i=a}var l=s.message;"string"===typeof l&&(i=l),o=s.details,void 0!==o&&(o=n.decode(o))}}catch(f){}return"ok"===r?null:new c(r,i,o)}var f=function(){function t(t,e){var n=this;this.auth=null,this.messaging=null,this.auth=t.getImmediate({optional:!0}),this.messaging=e.getImmediate({optional:!0}),this.auth||t.get().then((function(t){return n.auth=t}),(function(){})),this.messaging||e.get().then((function(t){return n.messaging=t}),(function(){}))}return t.prototype.getAuthToken=function(){return i.__awaiter(this,void 0,void 0,(function(){var t;return i.__generator(this,(function(e){switch(e.label){case 0:if(!this.auth)return[2,void 0];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.auth.getToken()];case 2:return t=e.sent(),t?[2,t.accessToken]:[2,void 0];case 3:return e.sent(),[2,void 0];case 4:return[2]}}
17))}))},t.prototype.getInstanceIdToken=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){if(!this.messaging||!("Notification"in self)||"granted"!==Notification.permission)return[2,void 0];try{return[2,this.messaging.getToken()]}catch(e){return[2,void 0]}return[2]}))}))},t.prototype.getContext=function(){return i.__awaiter(this,void 0,void 0,(function(){var t,e;return i.__generator(this,(function(n){switch(n.label){case 0:return[4,this.getAuthToken()];case 1:return t=n.sent(),[4,this.getInstanceIdToken()];case 2:return e=n.sent(),[2,{authToken:t,instanceIdToken:e}]}}))}))},t}(),p="type.googleapis.com/google.protobuf.Int64Value",d="type.googleapis.com/google.protobuf.UInt64Value"; 18/** 19 * @license 20 * Copyright 2017 Google LLC 21 * 22 * Licensed under the Apache License, Version 2.0 (the "License"); 23 * you may not use this file except in compliance with the License. 24 * You may obtain a copy of the License at 25 * 26 * http://www.apache.org/licenses/LICENSE-2.0 27 * 28 * Unless required by applicable law or agreed to in writing, software 29 * distributed under the License is distributed on an "AS IS" BASIS, 30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 31 * See the License for the specific language governing permissions and 32 * limitations under the License. 33 */function v(t,e){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]=e(t[r]));return n}var g=function(){function t(){}return t.prototype.encode=function(t){var e=this;if(null==t)return null;if(t instanceof Number&&(t=t.valueOf()),"number"===typeof t&&isFinite(t))return t;if(!0===t||!1===t)return t;if("[object String]"===Object.prototype.toString.call(t))return t;if(Array.isArray(t))return t.map((function(t){return e.encode(t)}));if("function"===typeof t||"object"===typeof t)return v(t,(function(t){return e.encode(t)}));throw new Error("Data cannot be encoded in JSON: "+t)},t.prototype.decode=function(t){var e=this;if(null==t)return t;if(t["@type"])switch(t["@type"]){case p:case d:var n=Number(t["value"]);if(isNaN(n))throw new Error("Data cannot be decoded from JSON: "+t);return n;default:throw new Error("Data cannot be decoded from JSON: "+t)}return Array.isArray(t)?t.map((function(t){return e.decode(t)})):"function"===typeof t||"object"===typeof t?v(t,(function(t){return e.decode(t)})):t},t}(); 34/** 35 * @license 36 * Copyright 2017 Google LLC 37 * 38 * Licensed under the Apache License, Version 2.0 (the "License"); 39 * you may not use this file except in compliance with the License. 40 * You may obtain a copy of the License at 41 * 42 * http://www.apache.org/licenses/LICENSE-2.0 43 * 44 * Unless required by applicable law or agreed to in writing, software 45 * distributed under the License is distributed on an "AS IS" BASIS, 46 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 47 * See the License for the specific language governing permissions and 48 * limitations under the License. 49 */function y(t){var e,n=new Promise((function(n,r){e=setTimeout((function(){r(new c("deadline-exceeded","deadline-exceeded"))}),t)}));return{timer:e,promise:n}}var m=function(){function t(t,e,n,r,i){var o=this;void 0===r&&(r="us-central1"),this.app_=t,this.fetchImpl=i,this.serializer=new g,this.emulatorOrigin=null,this.INTERNAL={delete:function(){return Promise.resolve(o.deleteService())}},this.contextProvider=new f(e,n),this.cancelAllRequests=new Promise((function(t){o.deleteService=function(){return t()}}));try{var s=new URL(r);this.customDomain=s.origin,this.region="us-central1"}catch(a){this.customDomain=null,this.region=r}}return Object.defineProperty(t.prototype,"app",{get:function(){return this.app_},enumerable:!1,configurable:!0}),t.prototype._url=function(t){var e=this.app_.options.projectId;if(null!==this.emulatorOrigin){var n=this.emulatorOrigin;return n+"/"+e+"/"+this.region+"/"+t}return null!==this.customDomain?this.customDomain+"/"+t:"https://"+this.region+"-"+e+".cloudfunctions.net/"+t},t.prototype.useFunctionsEmulator=function(t){this.emulatorOrigin=t},t.prototype.httpsCallable=function(t,e){var n=this;return function(r){return n.call(t,r,e||{})}},t.prototype.postJSON=function(t,e,n){return i.__awaiter(this,void 0,void 0,(function(){var r,o;return i.__generator(this,(function(i){switch(i.label){case 0:n["Content-Type"]="application/json",i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.fetchImpl(t,{method:"POST",body:JSON.stringify(e),headers:n})];case 2:return r=i.sent(),[3,4];case 3:return i.sent(),[2,{status:0,json:null}];case 4:o=null,i.label=5;case 5:return i.trys.push([5,7,,8]),[4,r.json()];case 6:return o=i.sent(),[3,8];case 7:return i.sent(),[3,8];case 8:return[2,{status:r.status,json:o}]}}))}))},t.prototype.call=function(t,e,n){return i.__awaiter(this,void 0,void 0,(function(){var r,o,s,a,u,h,f,p,d,v,g,m;return i.__generator(this,(function(i){switch(i.label){case 0:return r=this._url(t),e=this.serializer.encode(e),o={data:e},s={},[4,this.contextProvider.getContext()];case 1:return a=i.sent(),a.authToken&&(s["Authorization"]="Bearer "+a.authToken),a.instanceIdToken&&(s["Firebase-Instance-ID-Token"]=a.instanceIdToken),u=n.timeout||7e4,h=y(u),f=h.timer,p=h.promise,[4,Promise.race([_(f,this.postJSON(r,o,s)),p,_(f,this.cancelAllRequests)])];case 2:if(d=i.sent(),!d)throw new c("cancelled","Firebase Functions instance was deleted.");
49if(v=l(d.status,d.json,this.serializer),v)throw v;if(!d.json)throw new c("internal","Response is not valid JSON object.");if(g=d.json.data,"undefined"===typeof g&&(g=d.json.result),"undefined"===typeof g)throw new c("internal","Response is missing data field.");return m=this.serializer.decode(g),[2,{data:m}]}}))}))},t}();function _(t,e){return i.__awaiter(this,void 0,void 0,(function(){var n;return i.__generator(this,(function(r){switch(r.label){case 0:return[4,e];case 1:return n=r.sent(),clearTimeout(t),[2,n]}}))}))} 50/** 51 * @license 52 * Copyright 2019 Google LLC 53 * 54 * Licensed under the Apache License, Version 2.0 (the "License"); 55 * you may not use this file except in compliance with the License. 56 * You may obtain a copy of the License at 57 * 58 * http://www.apache.org/licenses/LICENSE-2.0 59 * 60 * Unless required by applicable law or agreed to in writing, software 61 * distributed under the License is distributed on an "AS IS" BASIS, 62 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 63 * See the License for the specific language governing permissions and 64 * limitations under the License. 65 */var b="functions";function w(t,e){var n={Functions:m};function r(t,n){var r=t.getProvider("app").getImmediate(),i=t.getProvider("auth-internal"),o=t.getProvider("messaging");return new m(r,i,o,n,e)}t.INTERNAL.registerComponent(new o.Component(b,r,"PUBLIC").setServiceProps(n).setMultipleInstances(!0))}var E="@firebase/functions",I="0.5.1"; 66/** 67 * @license 68 * Copyright 2017 Google LLC 69 * 70 * Licensed under the Apache License, Version 2.0 (the "License"); 71 * you may not use this file except in compliance with the License. 72 * You may obtain a copy of the License at 73 * 74 * http://www.apache.org/licenses/LICENSE-2.0 75 * 76 * Unless required by applicable law or agreed to in writing, software 77 * distributed under the License is distributed on an "AS IS" BASIS, 78 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 79 * See the License for the specific language governing permissions and 80 * limitations under the License. 81 */ 82w(a["default"],fetch.bind(self)),a["default"].registerVersion(E,I)},"00ee":function(t,e,n){var r=n("b622"),i=r("toStringTag"),o={};o[i]="z",t.exports="[object z]"===String(o)},"01b4":function(t,e){var n=function(){this.head=null,this.tail=null};n.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=n},"0366":function(t,e,n){var r=n("e330"),i=n("59ed"),o=n("40d5"),s=r(r.bind);t.exports=function(t,e){return i(t),void 0===e?t:o?s(t,e):function(){return t.apply(e,arguments)}}},"06cf":function(t,e,n){var r=n("83ab"),i=n("c65b"),o=n("d1e7"),s=n("5c6c"),a=n("fc6a"),u=n("a04b"),c=n("1a2d"),h=n("0cfb"),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=a(t),e=u(e),h)try{return l(t,e)}catch(n){}if(c(t,e))return s(!i(o.f,t,e),t[e])}},"07fa":function(t,e,n){var r=n("50c4");t.exports=function(t){return r(t.length)}},"0cfb":function(t,e,n){var r=n("83ab"),i=n("d039"),o=n("cc12");t.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},"0d51":function(t,e){var n=String;t.exports=function(t){try{return n(t)}catch(e){return"Object"}}},"13d2":function(t,e,n){var r=n("d039"),i=n("1626"),o=n("1a2d"),s=n("83ab"),a=n("5e77").CONFIGURABLE,u=n("8925"),c=n("69f3"),h=c.enforce,l=c.get,f=Object.defineProperty,p=s&&!r((function(){return 8!==f((function(){}),"length",{value:8}).length})),d=String(String).split("String"),v=t.exports=function(t,e,n){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!o(t,"name")||a&&t.name!==e)&&(s?f(t,"name",{value:e,configurable:!0}):t.name=e),p&&n&&o(n,"arity")&&t.length!==n.arity&&f(t,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?s&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(i){}var r=h(t);return o(r,"source")||(r.source=d.join("string"==typeof e?e:"")),t};Function.prototype.toString=v((function(){return i(this)&&l(this).source||u(this)}),"toString")},"14e5":function(t,e,n){"use strict";var r=n("23e7"),i=n("c65b"),o=n("59ed"),s=n("f069"),a=n("e667"),u=n("2266"),c=n("5eed");r({target:"Promise",stat:!0,forced:c},{all:function(t){var e=this,n=s.f(e),r=n.resolve,c=n.reject,h=a((function(){var n=o(e.resolve),s=[],a=0,h=1;u(t,(function(t){var o=a++,u=!1;h++,i(n,e,t).then((function(t){u||(u=!0,s[o]=t,--h||r(s))}),c)})),--h||r(s)}));return h.error&&c(h.value),n.promise}})},1626:function(t,e){t.exports=function(t){return"function"==typeof t}},"19aa":function(t,e,n){var r=n("3a9b"),i=TypeError;t.exports=function(t,e){if(r(e,t))return t;throw i("Incorrect invocation")}},"1a2d":function(t,e,n){var r=n("e330"),i=n("7b0b"),o=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(i(t),e)}},"1be4":function(t,e,n){var r=n("d066");t.exports=r("document","documentElement")},"1c7e":function(t,e,n){var r=n("b622"),i=r("iterator"),o=!1;try{var s=0,a={next:function(){return{done:!!s++}},return:function(){o=!0}};a[i]=function(){return this},Array.from(a,(function(){throw 2}))}catch(u){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var r={};r[i]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(u){}return n}},"1cdc":function(t,e,n){var r=n("342f");
82t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},"1d80":function(t,e){var n=TypeError;t.exports=function(t){if(void 0==t)throw n("Can't call method on "+t);return t}},2266:function(t,e,n){var r=n("0366"),i=n("c65b"),o=n("825a"),s=n("0d51"),a=n("e95a"),u=n("07fa"),c=n("3a9b"),h=n("9a1f"),l=n("35a1"),f=n("2a62"),p=TypeError,d=function(t,e){this.stopped=t,this.result=e},v=d.prototype;t.exports=function(t,e,n){var g,y,m,_,b,w,E,I=n&&n.that,T=!(!n||!n.AS_ENTRIES),C=!(!n||!n.IS_RECORD),S=!(!n||!n.IS_ITERATOR),O=!(!n||!n.INTERRUPTED),N=r(e,I),A=function(t){return g&&f(g,"normal",t),new d(!0,t)},k=function(t){return T?(o(t),O?N(t[0],t[1],A):N(t[0],t[1])):O?N(t,A):N(t)};if(C)g=t.iterator;else if(S)g=t;else{if(y=l(t),!y)throw p(s(t)+" is not iterable");if(a(y)){for(m=0,_=u(t);_>m;m++)if(b=k(t[m]),b&&c(v,b))return b;return new d(!1)}g=h(t,y)}w=C?t.next:g.next;while(!(E=i(w,g)).done){try{b=k(E.value)}catch(R){f(g,"throw",R)}if("object"==typeof b&&b&&c(v,b))return b}return new d(!1)}},"23cb":function(t,e,n){var r=n("5926"),i=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):o(n,e)}},"23e7":function(t,e,n){var r=n("da84"),i=n("06cf").f,o=n("9112"),s=n("cb2d"),a=n("6374"),u=n("e893"),c=n("94ca");t.exports=function(t,e){var n,h,l,f,p,d,v=t.target,g=t.global,y=t.stat;if(h=g?r:y?r[v]||a(v,{}):(r[v]||{}).prototype,h)for(l in e){if(p=e[l],t.dontCallGetSet?(d=i(h,l),f=d&&d.value):f=h[l],n=c(g?l:v+(y?".":"#")+l,t.forced),!n&&void 0!==f){if(typeof p==typeof f)continue;u(p,f)}(t.sham||f&&f.sham)&&o(p,"sham",!0),s(h,l,p,t)}}},"241c":function(t,e,n){var r=n("ca84"),i=n("7839"),o=i.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},2626:function(t,e,n){"use strict";var r=n("d066"),i=n("9bf2"),o=n("b622"),s=n("83ab"),a=o("species");t.exports=function(t){var e=r(t),n=i.f;s&&e&&!e[a]&&n(e,a,{configurable:!0,get:function(){return this}})}},"2a62":function(t,e,n){var r=n("c65b"),i=n("825a"),o=n("dc4a");t.exports=function(t,e,n){var s,a;i(t);try{if(s=o(t,"return"),!s){if("throw"===e)throw n;return n}s=r(s,t)}catch(u){a=!0,s=u}if("throw"===e)throw n;if(a)throw s;return i(s),n}},"2ba4":function(t,e,n){var r=n("40d5"),i=Function.prototype,o=i.apply,s=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(o):function(){return s.apply(o,arguments)})},"2ce1":function(t,e,n){(function(t){(function(){var e,r=n("c23d").default,i="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)};function o(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}var s=o(this);function a(t,e){if(e){var n=s;t=t.split(".");for(var r=0;r<t.length-1;r++){var o=t[r];o in n||(n[o]={}),n=n[o]}t=t[t.length-1],r=n[t],e=e(r),e!=r&&null!=e&&i(n,t,{configurable:!0,writable:!0,value:e})}}function u(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}function c(t){var e="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:u(t)}}a("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(n){e.reject(n)}}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=s.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(r){this.f(r)}}}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.m),reject:t(this.g)}},e.prototype.m=function(t){if(t===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(t instanceof e)this.s(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.u(t):this.h(t)}},e.prototype.u=function(t){var e=void 0;try{e=t.then}catch(n){return void this.g(n)}"function"==typeof e?this.w(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)o.b(this.a[t]);this.a=null}};var o=new n;return e.prototype.s=function(t){var e=this.f();t.Oa(e.resolve,e.reject)},e.prototype.w=function(t,e){var n=this.f();try{t.call(e,n.resolve,n.reject)}catch(r){n.reject(r)}},e.prototype.then=function(t,n){function r(t,e){return"function"==typeof t?function(e){try{i(t(e))}catch(n){o(n)}}:e}var i,o,s=new e((function(t,e){i=t,o=e}));return this.Oa(r(t,i),r(n,o)),s},e.prototype.catch=function(t){return this.then(void 0,t)},e.prototype.Oa=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?o.b(n):this.a.push(n)}
82,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=c(t),o=i.next();!o.done;o=i.next())r(o.value).Oa(e,n)}))},e.all=function(t){var n=c(t),i=n.next();return i.done?r([]):new e((function(t,e){function o(e){return function(n){s[e]=n,a--,0==a&&t(s)}}var s=[],a=0;do{s.push(void 0),a++,r(i.value).Oa(o(s.length-1),e),i=n.next()}while(!i.done)}))},e}));var h=h||{},l=this||self,f=/^[\w+/_-]+[=]{0,2}$/,p=null;function d(){}function v(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&&"undefined"!=typeof t.splice&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||"undefined"!=typeof t.call&&"undefined"!=typeof t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&"undefined"==typeof t.call)return"object";return e}function g(t){var e=v(t);return"array"==e||"object"==e&&"number"==typeof t.length}function y(t){return"function"==v(t)}function m(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function _(t){return Object.prototype.hasOwnProperty.call(t,b)&&t[b]||(t[b]=++w)}var b="closure_uid_"+(1e9*Math.random()>>>0),w=0;function E(t,e,n){return t.call.apply(t.bind,arguments)}function I(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 T(t,e,n){return T=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?E:I,T.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 S=Date.now||function(){return+new Date};function O(t,e){function n(){}n.prototype=e.prototype,t.Za=e.prototype,t.prototype=new n,t.prototype.constructor=t}
82function N(t,e,n){this.code=R+t,this.message=e||P[t]||"",this.a=n||null}function A(t){var e=t&&t.code;return e?new N(e.substring(R.length),t.message,t.serverResponse):null}O(N,Error),N.prototype.v=function(){var t={code:this.code,message:this.message};return this.a&&(t.serverResponse=this.a),t},N.prototype.toJSON=function(){return this.v()};var k,R="auth/",P={"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
82ways 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
82d-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."},x={hd:{Ra:"https://staging-identitytoolkit.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",Xa:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Ua:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"b"},pd:{Ra:"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",Xa:"https://securetoken.googleapis.com/v1/token",Ua:"https://identitytoolkit.googleapis.com/v2/",id:"p"},rd:{Ra:"https://staging-www.sandbox.googleapis.com/identitytoolkit/v3/relyingparty/",Xa:"https://staging-securetoken.sandbox.googleapis.com/v1/token",Ua:"https://staging-identitytoolkit.sandbox.googleapis.com/v2/",id:"s"},sd:{Ra:"https://www-googleapis-test.sandbox.google.com/identitytoolkit/v3/relyingparty/",Xa:"https://test-securetoken.sandbox.googleapis.com/v1/token",Ua:"https://test-identitytoolkit.sandbox.googleapis.com/v2/",id:"t"}};function D(t){for(var e in x)if(x[e].id===t)return t=x[e],{firebaseEndpoint:t.Ra,secureTokenEndpoint:t.Xa,identityPlatformEndpoint:t.Ua};return null}function L(t){if(!t)return!1;
82try{return!!t.$goog_Thenable}catch(e){return!1}}function j(t){if(Error.captureStackTrace)Error.captureStackTrace(this,j);else{var e=Error().stack;e&&(this.stack=e)}t&&(this.message=String(t))}function M(t,e){t=t.split("%s");for(var n="",r=t.length-1,i=0;i<r;i++)n+=t[i]+(i<e.length?e[i]:"%s");j.call(this,n+t[r])}function F(t,e){throw new M("Failure"+(t?": "+t:""),Array.prototype.slice.call(arguments,1))}function U(t,e){this.c=t,this.f=e,this.b=0,this.a=null}function V(t,e){t.f(e),100>t.b&&(t.b++,e.next=t.a,t.a=e)}function q(){this.b=this.a=null}k=D("__EID__")?"__EID__":void 0,O(j,Error),j.prototype.name="CustomError",O(M,j),M.prototype.name="AssertionError",U.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 B=new U((function(){return new G}),(function(t){t.reset()}));function W(){var t=Oe,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function G(){this.next=this.b=this.a=null}q.prototype.add=function(t,e){var n=B.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},G.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},G.prototype.reset=function(){this.next=this.b=this.a=null};var H=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},K=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)};function z(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)}var Q=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},Y=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},X=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 $(t){t:{for(var e=ea,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]}function J(t,e){return 0<=H(t,e)}function Z(t,e){var n;return e=H(t,e),(n=0<=e)&&Array.prototype.splice.call(t,e,1),n}function tt(t,e){z(t,(function(n,r){e.call(void 0,n,r,t)&&1==Array.prototype.splice.call(t,r,1).length&&0}))}function et(t){return Array.prototype.concat.apply([],arguments)}function nt(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 rt,it=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]},ot=/&/g,st=/</g,at=/>/g,ut=/"/g,ct=/'/g,ht=/\x00/g,lt=/[\x00&<>"']/;function ft(t,e){return-1!=t.indexOf(e)}function pt(t,e){return t<e?-1:t>e?1:0}t:{var dt=l.navigator;if(dt){var vt=dt.userAgent;if(vt){rt=vt;break t}}rt=""}function gt(t){return ft(rt,t)}function yt(t,e){for(var n in t)e.call(void 0,t[n],n,t)}function mt(t){for(var e in t)return!1;return!0}function _t(t){var e,n={};for(e in t)n[e]=t[e];return n}var bt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function wt(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i],r)t[n]=r[n];for(var o=0;o<bt.length;o++)n=bt[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function Et(t,e){t:{try{var n=t&&t.ownerDocument,r=n&&(n.defaultView||n.parentWindow);if(r=r||l,r.Element&&r.Location){var i=r;break t}}catch(s){}i=null}if(i&&"undefined"!=typeof i[e]&&(!t||!(t instanceof i[e])&&(t instanceof i.Location||t instanceof i.Element))){if
82(m(t))try{var o=t.constructor.displayName||t.constructor.name||Object.prototype.toString.call(t)}catch(s){o="<object could not be stringified>"}else o=void 0===t?"undefined":null===t?"null":typeof t;F("Argument is not a %s (or a non-Element, non-Location mock); got: %s",e,o)}}function It(t,e){this.a=t===St&&e||"",this.b=Ct}function Tt(t){return t instanceof It&&t.constructor===It&&t.b===Ct?t.a:(F("expected object of type Const, got '"+t+"'"),"type_error:Const")}It.prototype.ra=!0,It.prototype.qa=function(){return this.a},It.prototype.toString=function(){return"Const{"+this.a+"}"};var Ct={},St={},Ot=new It(St,"");function Nt(t,e){this.a=t===Dt&&e||"",this.b=xt}function At(t){return t instanceof Nt&&t.constructor===Nt&&t.b===xt?t.a:(F("expected object of type TrustedResourceUrl, got '"+t+"' of type "+v(t)),"type_error:TrustedResourceUrl")}function kt(t,e){var n=Tt(t);if(!Pt.test(n))throw Error("Invalid TrustedResourceUrl format: "+n);return t=n.replace(Rt,(function(t,r){if(!Object.prototype.hasOwnProperty.call(e,r))throw Error('Found marker, "'+r+'", in format string, "'+n+'", but no valid label mapping found in args: '+JSON.stringify(e));return t=e[r],t instanceof It?Tt(t):encodeURIComponent(String(t))})),new Nt(Dt,t)}Nt.prototype.ra=!0,Nt.prototype.qa=function(){return this.a.toString()},Nt.prototype.toString=function(){return"TrustedResourceUrl{"+this.a+"}"};var Rt=/%{(\w+)}/g,Pt=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i,xt={},Dt={};function Lt(t,e){this.a=t===Vt&&e||"",this.b=Ut}function jt(t){return t instanceof Lt&&t.constructor===Lt&&t.b===Ut?t.a:(F("expected object of type SafeUrl, got '"+t+"' of type "+v(t)),"type_error:SafeUrl")}Lt.prototype.ra=!0,Lt.prototype.qa=function(){return this.a.toString()},Lt.prototype.toString=function(){return"SafeUrl{"+this.a+"}"};var Mt=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;function Ft(t){return t instanceof Lt?t:(t="object"==typeof t&&t.ra?t.qa():String(t),Mt.test(t)||(t="about:invalid#zClosurez"),new Lt(Vt,t))}var Ut={},Vt={};function qt(){this.a="",this.b=Wt}function Bt(t){return t instanceof qt&&t.constructor===qt&&t.b===Wt?t.a:(F("expected object of type SafeHtml, got '"+t+"' of type "+v(t)),"type_error:SafeHtml")}qt.prototype.ra=!0,qt.prototype.qa=function(){return this.a.toString()},qt.prototype.toString=function(){return"SafeHtml{"+this.a+"}"};var Wt={};function Gt(t){var e=new qt;return e.a=t,e}Gt("<!DOCTYPE html>");var Ht=Gt("");function Kt(t){var e=new Nt(Dt,Tt(Ot));Et(t,"HTMLIFrameElement"),t.src=At(e).toString()}function zt(t,e){Et(t,"HTMLScriptElement"),t.src=At(e),null===p&&(e=l.document,p=(e=e.querySelector&&e.querySelector("script[nonce]"))&&(e=e.nonce||e.getAttribute("nonce"))&&f.test(e)?e:""),e=p,e&&t.setAttribute("nonce",e)}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 Yt(t){return lt.test(t)&&(-1!=t.indexOf("&")&&(t=t.replace(ot,"&")),-1!=t.indexOf("<")&&(t=t.replace(st,"<")),-1!=t.indexOf(">")&&(t=t.replace(at,">")),-1!=t.indexOf('"')&&(t=t.replace(ut,""")),-1!=t.indexOf("'")&&(t=t.replace(ct,"'")),-1!=t.indexOf("\0")&&(t=t.replace(ht,"�"))),t}function Xt(t){return Xt[" "](t),t}function $t(t,e){var n=he;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e(t)}Gt("<br>"),Xt[" "]=d;var Jt,Zt=gt("Opera"),te=gt("Trident")||gt("MSIE"),ee=gt("Edge"),ne=ee||te,re=gt("Gecko")&&!(ft(rt.toLowerCase(),"webkit")&&!gt("Edge"))&&!(gt("Trident")||gt("MSIE"))&&!gt("Edge"),ie=ft(rt.toLowerCase(),"webkit")&&!gt("Edge");function oe(){var t=l.document;return t?t.documentMode:void 0}t:{var se="",ae=function(){var t=rt;return re?/rv:([^\);]+)(\)|;)/.exec(t):ee?/Edge\/([\d\.]+)/.exec(t):te?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(t):ie?/WebKit\/(\S+)/.exec(t):Zt?/(?:Version)[ \/]?(\S+)/.exec(t):void 0}();if(ae&&(se=ae?ae[1]:""),te){var ue=oe();if(null!=ue&&ue>parseFloat(se)){Jt=String(ue);break t}}Jt=se}var ce,he={};function le(t){return $t(t,(function(){for(var e=0,n=it(String(Jt)).split("."),r=it(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=pt(0==s[1].length?0:parseInt(s[1],10),0==a[1].length?0:parseInt(a[1],10))||pt(0==s[2].length,0==a[2].length)||pt(s[2],a[2]),s=s[3],a=a[3]}while(0==e)}return 0<=e}))}ce=l.document&&te?oe():void 0;try{new self.OffscreenCanvas(0,0).getContext("2d")}catch(Bp){}var fe=!te||9<=Number(ce);function pe(t){var e=document;return"string"===typeof t?e.getElementById(t):t}function de(t,e){yt(e,(function(e,n){e&&"object"==typeof e&&e.ra&&(e=e.qa()),"style"==n?t.style.cssText=e:"class"==n?t.className=e:"for"==n?t.htmlFor=e:ye.hasOwnProperty(n)?t.setAttribute(ye[n],e):0==n.lastIndexOf("aria-",0)||0==n.lastIndexOf("data-",0)?t.setAttribute(n,e):t[n]=e}))}var ve,ge,ye={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",
82nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};function me(t,e,n){var r=arguments,i=document,o=String(r[0]),s=r[1];if(!fe&&s&&(s.name||s.type)){if(o=["<",o],s.name&&o.push(' name="',Yt(s.name),'"'),s.type){o.push(' type="',Yt(s.type),'"');var a={};wt(a,s),delete a.type,s=a}o.push(">"),o=o.join("")}return o=be(i,o),s&&("string"===typeof s?o.className=s:Array.isArray(s)?o.className=s.join(" "):de(o,s)),2<r.length&&_e(i,o,r),o}function _e(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];!g(o)||m(o)&&0<o.nodeType?r(o):K(we(o)?nt(o):o,r)}}function be(t,e){return e=String(e),"application/xhtml+xml"===t.contentType&&(e=e.toLowerCase()),t.createElement(e)}function we(t){if(t&&"number"==typeof t.length){if(m(t))return"function"==typeof t.item||"string"==typeof t.item;if(y(t))return"function"==typeof t.item}return!1}function Ee(t){l.setTimeout((function(){throw t}),0)}function Ie(){var t=l.MessageChannel;if("undefined"===typeof t&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&!gt("Presto")&&(t=function(){var t=be(document,"IFRAME");t.style.display="none",Kt(t),document.documentElement.appendChild(t);var e=t.contentWindow;t=e.document,t.open(),t.write(Bt(Ht)),t.close();var n="callImmediate"+Math.random(),r="file:"==e.location.protocol?"*":e.location.protocol+"//"+e.location.host;t=T((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)}}}),"undefined"!==typeof t&&!gt("Trident")&&!gt("MSIE")){var e=new t,n={},r=n;return e.port1.onmessage=function(){if(void 0!==n.next){n=n.next;var t=n.Db;n.Db=null,t()}},function(t){r.next={Db:t},r=r.next,e.port2.postMessage(0)}}return function(t){l.setTimeout(t,0)}}function Te(t,e){ge||Ce(),Se||(ge(),Se=!0),Oe.add(t,e)}function Ce(){if(l.Promise&&l.Promise.resolve){var t=l.Promise.resolve(void 0);ge=function(){t.then(Ne)}}else ge=function(){var t=Ne;!y(l.setImmediate)||l.Window&&l.Window.prototype&&!gt("Edge")&&l.Window.prototype.setImmediate==l.setImmediate?(ve||(ve=Ie()),ve(t)):l.setImmediate(t)}}var Se=!1,Oe=new q;function Ne(){for(var t;t=W();){try{t.a.call(t.b)}catch(e){Ee(e)}V(B,t)}Se=!1}function Ae(t,e){if(this.a=ke,this.i=void 0,this.f=this.b=this.c=null,this.g=this.h=!1,t!=d)try{var n=this;t.call(e,(function(t){Ge(n,Re,t)}),(function(t){if(!(t instanceof Ze))try{if(t instanceof Error)throw t;throw Error("Promise rejected.")}catch(e){}Ge(n,Pe,t)}))}catch(r){Ge(this,Pe,r)}}var ke=0,Re=2,Pe=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 De=new U((function(){return new xe}),(function(t){t.reset()}));function Le(t,e,n){var r=De.get();return r.g=t,r.b=e,r.f=n,r}function je(t){if(t instanceof Ae)return t;var e=new Ae(d);return Ge(e,Re,t),e}
82function Me(t){return new Ae((function(e,n){n(t)}))}function Fe(t,e,n){He(t,e,n,null)||Te(C(e,t))}function Ue(t){return new Ae((function(e,n){var r=t.length,i=[];if(r)for(var o,s=function(t,n){r--,i[t]=n,0==r&&e(i)},a=function(t){n(t)},u=0;u<t.length;u++)o=t[u],Fe(o,C(s,u),a);else e(i)}))}function Ve(t){return new Ae((function(e){var n=t.length,r=[];if(n)for(var i,o=function(t,i,o){n--,r[t]=i?{Mb:!0,value:o}:{Mb:!1,reason:o},0==n&&e(r)},s=0;s<t.length;s++)i=t[s],Fe(i,C(o,s,!0),C(o,s,!1));else e(r)}))}function qe(t,e){if(t.a==ke)if(t.c){var n=t.c;if(n.b){for(var r=0,i=null,o=null,s=n.b;s&&(s.c||(r++,s.a==t&&(i=s),!(i&&1<r)));s=s.next)i||(o=s);i&&(n.a==ke&&1==r?qe(n,e):(o?(r=o,r.next==n.f&&(n.f=r),r.next=r.next.next):Qe(n),Ye(n,i,Pe,e)))}t.c=null}else Ge(t,Pe,e)}function Be(t,e){t.b||t.a!=Re&&t.a!=Pe||ze(t),t.f?t.f.next=e:t.b=e,t.f=e}function We(t,e,n,r){var i=Le(null,null,null);return i.a=new Ae((function(t,o){i.g=e?function(n){try{var i=e.call(r,n);t(i)}catch(s){o(s)}}:t,i.b=n?function(e){try{var i=n.call(r,e);void 0===i&&e instanceof Ze?o(e):t(i)}catch(s){o(s)}}:o})),i.a.c=t,Be(t,i),i.a}function Ge(t,e,n){t.a==ke&&(t===n&&(e=Pe,n=new TypeError("Promise cannot resolve to itself")),t.a=1,He(n,t.Yc,t.Zc,t)||(t.i=n,t.a=e,t.c=null,ze(t),e!=Pe||n instanceof Ze||$e(t,n)))}function He(t,e,n,r){if(t instanceof Ae)return Be(t,Le(e||d,n||null,r)),!0;if(L(t))return t.then(e,n,r),!0;if(m(t))try{var i=t.then;if(y(i))return Ke(t,i,e,n,r),!0}catch(o){return n.call(r,o),!0}return!1}function Ke(t,e,n,r,i){function o(t){a||(a=!0,r.call(i,t))}function s(t){a||(a=!0,n.call(i,t))}var a=!1;try{e.call(t,s,o)}catch(u){o(u)}}function ze(t){t.h||(t.h=!0,Te(t.ec,t))}function Qe(t){var e=null;return t.b&&(e=t.b,t.b=e.next,e.next=null),t.b||(t.f=null),e}function Ye(t,e,n,r){if(n==Pe&&e.b&&!e.c)for(;t&&t.g;t=t.c)t.g=!1;if(e.a)e.a.c=null,Xe(e,n,r);else try{e.c?e.g.call(e.f):Xe(e,n,r)}catch(i){Je.call(null,i)}V(De,e)}function Xe(t,e,n){e==Re?t.g.call(t.f,n):t.b&&t.b.call(t.f,n)}function $e(t,e){t.g=!0,Te((function(){t.g&&Je.call(null,e)}))}Ae.prototype.then=function(t,e,n){return We(this,y(t)?t:null,y(e)?e:null,n)},Ae.prototype.$goog_Thenable=!0,e=Ae.prototype,e.ma=function(t,e){return t=Le(t,t,e),t.c=!0,Be(this,t),this},e.o=function(t,e){return We(this,null,t,e)},e.cancel=function(t){if(this.a==ke){var e=new Ze(t);Te((function(){qe(this,e)}),this)}},e.Yc=function(t){this.a=ke,Ge(this,Re,t)},e.Zc=function(t){this.a=ke,Ge(this,Pe,t)},e.ec=function(){for(var t;t=Qe(this);)Ye(this,t,this.a,this.i);this.h=!1};var Je=Ee;function Ze(t){j.call(this,t)}function tn(){0!=en&&(nn[_(this)]=this),this.wa=this.wa,this.na=this.na}O(Ze,j),Ze.prototype.name="cancel";var en=0,nn={};function rn(t){if(!t.wa&&(t.wa=!0,t.Ba(),0!=en)){var e=_(t);if(0!=en&&t.na&&0<t.na.length)throw Error(t+" did not empty its onDisposeCallbacks queue. This probably means it overrode dispose() or disposeInternal() without calling the superclass' method.");delete nn[e]}}tn.prototype.wa=!1,tn.prototype.Ba=function(){if(this.na)for(;this.na.length;)this.na.shift()()};var on=Object.freeze||function(t){return t},sn=!te||9<=Number(ce),an=te&&!le("9"),un=function(){if(!l.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{l.addEventListener("test",d,e),l.removeEventListener("test",d,e)}catch(n){}return t}();function cn(t,e){this.type=t,this.b=this.target=e,this.defaultPrevented=!1}function hn(t,e){if(cn.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(re){t:{try{Xt(e.nodeName);var i=!0;break t}catch(o){}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:ln[t.pointerType]||"",this.a=t,t.defaultPrevented&&this.preventDefault()}}cn.prototype.preventDefault=function(){this.defaultPrevented=!0},O(hn,cn);var ln=on({2:"touch",3:"pen",4:"mouse"});hn.prototype.preventDefault=function(){hn.Za.preventDefault.call(this);var t=this.a;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,an)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}},hn.prototype.f=function(){return this.a};var fn="closure_listenable_"+(1e6*Math.random()|0),pn=0;function dn(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.Ta=i,this.key=++pn,this.ua=this.Na=!1}function vn(t){t.ua=!0,t.listener=null,t.proxy=null,t.src=null,t.Ta=null}function gn(t){this.src=t,this.a={},this.b=0}function yn(t,e){var n=e.type;n in t.a&&Z(t.a[n],e)&&(vn(e),0==t.a[n].length&&(delete t.a[n],t.b--))}function mn(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.ua&&o.listener==e&&o.capture==!!n&&o.Ta==r)return i}return-1}gn.prototype.add=function(t,e,n,r,i){var o=t.toString();t=this.a[o],t||(t=this.a[o]=[],this.b++);var s=mn(t,e,r,i);return-1<s?(e=t[s],n||(e.Na=!1)):(e=new dn(e,this.src,o,!!r,i),e.Na=n,t.pu
82sh(e)),e};var _n="closure_lm_"+(1e6*Math.random()|0),bn={};function wn(t,e,n,r,i){if(r&&r.once)Tn(t,e,n,r,i);else if(Array.isArray(e))for(var o=0;o<e.length;o++)wn(t,e[o],n,r,i);else n=xn(n),t&&t[fn]?Ln(t,e,n,m(r)?!!r.capture:!!r,i):En(t,e,n,!1,r,i)}function En(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var s=m(i)?!!i.capture:!!i,a=Rn(t);if(a||(t[_n]=a=new gn(t)),n=a.add(e,n,r,s,o),!n.proxy){if(r=In(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)un||(i=s),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(On(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}0}}function In(){var t=kn,e=sn?function(n){return t.call(e.src,e.listener,n)}:function(n){if(n=t.call(e.src,e.listener,n),!n)return n};return e}function Tn(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)Tn(t,e[o],n,r,i);else n=xn(n),t&&t[fn]?jn(t,e,n,m(r)?!!r.capture:!!r,i):En(t,e,n,!0,r,i)}function Cn(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)Cn(t,e[o],n,r,i);else r=m(r)?!!r.capture:!!r,n=xn(n),t&&t[fn]?(t=t.u,e=String(e).toString(),e in t.a&&(o=t.a[e],n=mn(o,n,r,i),-1<n&&(vn(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.a[e],t.b--)))):t&&(t=Rn(t))&&(e=t.a[e.toString()],t=-1,e&&(t=mn(e,n,r,i)),(n=-1<t?e[t]:null)&&Sn(n))}function Sn(t){if("number"!==typeof t&&t&&!t.ua){var e=t.src;if(e&&e[fn])yn(e.u,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(On(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=Rn(e))?(yn(n,t),0==n.b&&(n.src=null,e[_n]=null)):vn(t)}}}function On(t){return t in bn?bn[t]:bn[t]="on"+t}function Nn(t,e,n,r){var i=!0;if((t=Rn(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.ua&&(o=An(o,r),i=i&&!1!==o)}return i}function An(t,e){var n=t.listener,r=t.Ta||t.src;return t.Na&&Sn(t),n.call(r,e)}function kn(t,e){if(t.ua)return!0;if(!sn){if(!e)t:{e=["window","event"];for(var n=l,r=0;r<e.length;r++)if(n=n[e[r]],null==n){e=null;break t}e=n}if(r=e,e=new hn(r,this),n=!0,!(0>r.keyCode||void 0!=r.returnValue)){t:{var i=!1;if(0==r.keyCode)try{r.keyCode=-1;break t}catch(s){i=!0}(i||void 0==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=Nn(r[i],t,!0,e);n=n&&o}for(i=0;i<r.length;i++)e.b=r[i],o=Nn(r[i],t,!1,e),n=n&&o}return n}return An(t,new hn(e,this))}function Rn(t){return t=t[_n],t instanceof gn?t:null}var Pn="__closure_events_fn_"+(1e9*Math.random()>>>0);function xn(t){return y(t)?t:(t[Pn]||(t[Pn]=function(e){return t.handleEvent(e)}),t[Pn])}function Dn(){tn.call(this),this.u=new gn(this),this.Yb=this,this.eb=null}function Ln(t,e,n,r,i){t.u.add(String(e),n,!1,r,i)}function jn(t,e,n,r,i){t.u.add(String(e),n,!0,r,i)}function Mn(t,e,n,r){if(e=t.u.a[String(e)],!e)return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var s=e[o];if(s&&!s.ua&&s.capture==n){var a=s.listener,u=s.Ta||s.src;s.Na&&yn(t.u,s),i=!1!==a.call(u,r)&&i}}return i&&!r.defaultPrevented}function Fn(t,e,n){if(y(t))n&&(t=T(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=T(t.handleEvent,t)}return 2147483647<Number(e)?-1:l.setTimeout(t,e||0)}function Un(t){var e=null;return new Ae((function(n,r){e=Fn((function(){n(void 0)}),t),-1==e&&r(Error("Failed to schedule timer."))})).o((function(t){throw l.clearTimeout(e),t}))}function Vn(t){if(t.V&&"function"==typeof t.V)return t.V();if("string"===typeof t)return t.split("");if(g(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 qn(t){if(t.X&&"function"==typeof t.X)return t.X();if(!t.V||"function"!=typeof t.V){if(g(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 Bn(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(g(t)||"string"===typeof t)K(t,e,void 0);else for(var n=qn(t),r=Vn(t),i=r.length,o=0;o<i;o++)e.call(void 0,r[o],n&&n[o],t)}function Wn(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 Wn)for(n=t.X(),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 Gn(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];Hn(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;)r=t.a[e],Hn(i,r)||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function Hn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}O(Dn,tn),Dn.prototype[fn]=!0,Dn.prototype.addEventListener=function(t,e,n,r){wn(this,t,e,n,r)},Dn.prototype.removeEventListener=function(t,e,n,r){Cn(this,t,e,n,r)},Dn.prototype.dispatchEvent=function(t){var e,n=this.eb;if(n)for(e=[];n;n=n.eb)e.push(n);n=this.Yb;var r=t.type||t;if("string"===typeof t)t=new cn(t,n);else if(t instanceof cn)t.target=t.target||n;else{var i=t;t=new cn(r,n),wt(t,i)}if(i=!0,e)for(var o=e.length-1;0<=o;o--){var s=t.b=e[o];i=Mn(s,r,!0,t)&&i}if(s=t.b=n,i=Mn(s,r,!0,t)&&i,i=Mn(s,r,!1,t)&&i,e)for(o=0;o<e.length;o++)s=t.b=e[o],i=Mn(s,r,!1,t)&&i;return i},Dn.prototype.Ba=function(){if(Dn.Za.Ba.call(this),this.u){var t,e=this.u;for(t in e.a){for(var n=e.a[t],r=0;r<n.length;r++)vn(n[r]);delete e.a[t],e.b--}}this.eb=null},e=Wn.prototype,e.V=function(){Gn(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},e.X=function(){return Gn(this),this.a.concat()},e.clear=function(){this.b={},this.c=this.a.length=0},e.get=function(t,e){return Hn(this.b,t)?this.b[t]:e},e.set=function(t,e){Hn(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},e.forEach=function(t,e){for(var n=this.X(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var Kn=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/\\#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function zn(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," ")):"")}}}function Qn(t,e){var n;this.b=this.i=this.f="",this.l=null,this.g=this.c="",this.h=!1,t instanceof Qn?(this.h=void 0!==e?e:t.h,Yn(this,t.f),this.i=t.i,this.b=t.b,Xn(this,t.l),this.c=t.c,$n(this,gr(t.a)),this.g=t.g):t&&(n=String(t).match(Kn))?(this.h=!!e,Yn(this,n[1]||"",!0),this.i=nr(n[2]||""),this.b=nr(n[3]||"",!0),Xn(this,n[4]),this.c=nr(n[5]||"",!0),$n(this,n[6]||"",!0),this.g=nr(n[7]||"")):(this.h=!!e,this.a=new hr(null,this.h))}
82function Yn(t,e,n){t.f=n?nr(e,!0):e,t.f&&(t.f=t.f.replace(/:$/,""))}function Xn(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.l=e}else t.l=null}function $n(t,e,n){e instanceof hr?(t.a=e,mr(t.a,t.h)):(n||(e=rr(e,ur)),t.a=new hr(e,t.h))}function Jn(t,e,n){t.a.set(e,n)}function Zn(t,e){return t.a.get(e)}function tr(t){return t instanceof Qn?new Qn(t):new Qn(t,void 0)}function er(t,e){var n=new Qn(null,void 0);return Yn(n,"https"),t&&(n.b=t),e&&(n.c=e),n}function nr(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function rr(t,e,n){return"string"===typeof t?(t=encodeURI(t).replace(e,ir),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function ir(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(15&t).toString(16)}Qn.prototype.toString=function(){var t=[],e=this.f;e&&t.push(rr(e,or,!0),":");var n=this.b;return(n||"file"==e)&&(t.push("//"),(e=this.i)&&t.push(rr(e,or,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),n=this.l,null!=n&&t.push(":",String(n))),(n=this.c)&&(this.b&&"/"!=n.charAt(0)&&t.push("/"),t.push(rr(n,"/"==n.charAt(0)?ar:sr,!0))),(n=this.a.toString())&&t.push("?",n),(n=this.g)&&t.push("#",rr(n,cr)),t.join("")},Qn.prototype.resolve=function(t){var e=new Qn(this),n=!!t.f;n?Yn(e,t.f):n=!!t.i,n?e.i=t.i:n=!!t.b,n?e.b=t.b:n=null!=t.l;var r=t.c;if(n)Xn(e,t.l);else if(n=!!t.c){if("/"!=r.charAt(0))if(this.b&&!this.c)r="/"+r;else{var i=e.c.lastIndexOf("/");-1!=i&&(r=e.c.substr(0,i+1)+r)}if(i=r,".."==i||"."==i)r="";else if(ft(i,"./")||ft(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.a.toString(),n?$n(e,gr(t.a)):n=!!t.g,n&&(e.g=t.g),e};var or=/[#\/\?@]/g,sr=/[#\?:]/g,ar=/[#\?]/g,ur=/[#\?@]/g,cr=/#/g;function hr(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function lr(t){t.a||(t.a=new Wn,t.b=0,t.c&&zn(t.c,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})))}function fr(t){var e=qn(t);if("undefined"==typeof e)throw Error("Keys are undefined");var n=new hr(null,void 0);t=Vn(t);for(var r=0;r<e.length;r++){var i=e[r],o=t[r];Array.isArray(o)?vr(n,i,o):n.add(i,o)}return n}function pr(t,e){lr(t),e=yr(t,e),Hn(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,t=t.a,Hn(t.b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&Gn(t)))}function dr(t,e){return lr(t),e=yr(t,e),Hn(t.a.b,e)}function vr(t,e,n){pr(t,e),0<n.length&&(t.c=null,t.a.set(yr(t,e),nt(n)),t.b+=n.length)}function gr(t){var e=new hr;return e.c=t.c,t.a&&(e.a=new Wn(t.a),e.b=t.b),e}function yr(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}function mr(t,e){e&&!t.f&&(lr(t),t.c=null,t.a.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(pr(this,e),vr(this,n,t))}),t)),t.f=e}function _r(t){var e=[];return wr(new br,t,e),e.join("")}function br(){}function wr(t,e,n){if(null==e)n.push("null");else{if("object"==typeof e){if(Array.isArray(e)){var r=e;e=r.length,n.push("[");for(var i="",o=0;o<e;o++)n.push(i),wr(t,r[o],n),i=",";return void n.push("]")}if(!(e instanceof String||e instanceof Number||e instanceof Boolean)){for(r in n.push("{"),i="",e)Object.prototype.hasOwnProperty.call(e,r)&&(o=e[r],"function"!=typeof o&&(n.push(i),Tr(r,n),n.push(":"),wr(t,o,n),i=","));return void n.push("}")}e=e.valueOf()}switch(typeof e){case"string":Tr(e,n);break;case"number":n.push(isFinite(e)&&!isNaN(e)?String(e):"null");break;case"boolean":n.push(String(e));break;case"function":n.push("null");break;default:throw Error("Unknown type: "+typeof e)}}}e=hr.prototype,e.add=function(t,e){lr(this),this.c=null,t=yr(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){lr(this),this.a.forEach((function(n,r){K(n,(function(n){t.call(e,n,r,this)}),this)}),this)},e.X=function(){lr(this);for(var t=this.a.V(),e=this.a.X(),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){lr(this);var e=[];
82if("string"===typeof t)dr(this,t)&&(e=et(e,this.a.get(yr(this,t))));else{t=this.a.V();for(var n=0;n<t.length;n++)e=et(e,t[n])}return e},e.set=function(t,e){return lr(this),this.c=null,t=yr(this,t),dr(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?(t=this.V(t),0<t.length?String(t[0]):e):e},e.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],e=this.a.X(),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 Er={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},Ir=/\uffff/.test("ï¿¿")?/[\\"\x00-\x1f\x7f-\uffff]/g:/[\\"\x00-\x1f\x7f-\xff]/g;function Tr(t,e){e.push('"',t.replace(Ir,(function(t){var e=Er[t];return e||(e="\\u"+(65536|t.charCodeAt(0)).toString(16).substr(1),Er[t]=e),e})),'"')}function Cr(){var t=Yr();return te&&!!ce&&11==ce||/Edge\/\d+/.test(t)}function Sr(){return l.window&&l.window.location.href||self&&self.location&&self.location.href||""}function Or(t,e){e=e||l.window;var n="about:blank";t&&(n=jt(Ft(t))),e.location.href=n}function Nr(t,e){var n,r=[];for(n in t)n in e?typeof t[n]!=typeof e[n]?r.push(n):"object"==typeof t[n]&&null!=t[n]&&null!=e[n]?0<Nr(t[n],e[n]).length&&r.push(n):t[n]!==e[n]&&r.push(n):r.push(n);for(n in e)n in t||r.push(n);return r}function Ar(){var t=Yr();return t=Kr(t)!=Hr?null:(t=t.match(/\sChrome\/(\d+)/i))&&2==t.length?parseInt(t[1],10):null,!(t&&30>t)&&(!te||!ce||9<ce)}function kr(t){return t=(t||Yr()).toLowerCase(),!!(t.match(/android/)||t.match(/webos/)||t.match(/iphone|ipad|ipod/)||t.match(/blackberry/)||t.match(/windows phone/)||t.match(/iemobile/))}function Rr(t){t=t||l.window;try{t.close()}catch(e){}}function Pr(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=Yr().toLowerCase(),r&&(e.target=r,ft(n,"crios/")&&(e.target="_blank")),Kr(Yr())==Gr&&(t=t||"http://localhost",e.scrollbars=!0),n=t||"",(t=e)||(t={}),r=window,e=n instanceof Lt?n:Ft("undefined"!=typeof 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((gt("iPhone")&&!gt("iPod")&&!gt("iPad")||gt("iPad")||gt("iPod"))&&r.navigator&&r.navigator.standalone&&n&&"_self"!=n?(s=be(document,"A"),Et(s,"HTMLAnchorElement"),e instanceof Lt||e instanceof Lt||(e="object"==typeof e&&e.ra?e.qa():String(e),Mt.test(e)||(e="about:invalid#zClosurez"),e=new Lt(Vt,e)),s.href=jt(e),s.setAttribute("target",n),t.noreferrer&&s.setAttribute("rel","noreferrer"),t=document.createEvent("MouseEvent"),t.initMouseEvent("click",!0,!0,r,1),s.dispatchEvent(t),s={}):t.noreferrer?(s=r.open("",n,s),t=jt(e),s&&(ne&&ft(t,";")&&(t="'"+t.replace(/'/g,"%27")+"'"),s.opener=null,t=Gt('<meta name="referrer" content="no-referrer"><meta http-equiv="refresh" content="0; url='+Yt(t)+'">'),r=s.document)&&(r.write(Bt(t)),r.close())):(s=r.open(jt(e),n,s))&&t.noopener&&(s.opener=null),s)try{s.focus()}catch(a){}return s}function xr(t){return new Ae((function(e){function n(){Un(2e3).then((function(){if(t&&!t.closed)return n();e()}))}return n()}))}var Dr=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Lr=/^[^@]+@[^@]+$/;function jr(){var t=null;return new Ae((function(e){"complete"==l.document.readyState?e():(t=function(){e()},Tn(window,"load",t))})).o((function(e){throw Cn(window,"load",t),e}))}function Mr(){return Fr(void 0)?jr().then((function(){return new Ae((function(t,e){var n=l.document,r=setTimeout((function(){e(Error("Cordova framework is not ready."))}),1e3);n.addEventListener("deviceready",(function(){clearTimeout(r),t()}),!1)}))})):Me(Error("Cordova must run in an Android or iOS file scheme."))}function Fr(t){return t=t||Yr(),!("file:"!==ti()&&"ionic:"!==ti()||!t.toLowerCase().match(/iphone|ipad|ipod|android/))}function Ur(){var t=l.window;try{return!(!t||t==t.top)}catch(e){return!1}}function Vr(){return"undefined"!==typeof l.WorkerGlobalScope&&"function"===typeof l.importScripts}function qr(){return r.INTERNAL.hasOwnProperty("reactNative")?"ReactNative":r.INTERNAL.hasOwnProperty("node")?"Node":Vr()?"Worker":"Browser"}function Br(){var t=qr();return"ReactNative"===t||"Node"===t}function Wr(){for(var t=50,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}var Gr="Firefox",Hr="Chrome";function Kr(t){var e=t.toLowerCase();return ft(e,"opera/")||ft(e,"opr/")||ft(e,"opios/")?"Opera":ft(e,"iemobile")?"IEMobile":ft(e,"msie")||ft(e,"trident/")?"IE":ft(e,"edge/")?"Edge":ft(e,"firefox/")?Gr:ft(e,"silk/")?"Silk":ft(e,"blackberry")?"Blackberry":ft(e,"webos")?"Webos":!ft(e,"safari/")||ft(e,"chrome/")||ft(e,"crios/")||ft(e,"android")?!ft(e,"chrome/")&&!ft(e,"crios/")||ft(e,"edge/")?ft(e,"android")?"Android":(t=t.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/))&&2==t.length?t[1]:"Other":Hr:"Safari"}var zr={jd:"FirebaseCore-web",ld:"FirebaseUI-web"};function Qr(t,e){e=e||[];var n,r=[],i={};for(n in zr)i[zr[n]]=!0;for(n=0;n<e.length;n++)"undefined"!==typeof i[e[n]]&&(delete i[e[n]],r.push(e[n]));return r.sort(),e=r,e.length||(e=["FirebaseCore-web"]),r=qr(),"Browser"===r?(i=Yr(),r=Kr(i)):"Worker"===r&&(i=Yr(),r=Kr(i)+"-"+r),r+"/JsCore/"+t+"/"+e.join(",")}function Yr(){return l.navigator&&l.navigator.userAgent||""}function Xr(t,e){t=t.split("."),e=e||l;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 $r(){try{var t=l.localStorage,e=oi();if(t)return t.setItem(e,"1"),t.removeItem(e),!Cr()||!!l.indexedDB}catch(n){return Vr()&&!!l.indexedDB}return!1}function Jr(){return(Zr()||"chrome-extension:"===ti()||Fr())&&!Br()&&$r()&&!Vr()}function Zr(){return"http:"===ti()||"https:"===ti()}function ti(){return l.location&&l.location.protocol||null}function ei(t){return t=t||Yr(),!kr(t)&&Kr(t)!=Gr}function ni(t){return"undefined"===typeof t?null:_r(t)}function ri(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 ii(t){if(null!==t)return JSON.parse(t)}function oi(t){return t||Math.floor(1e9*Math.random()).toString()}function si(t){return t=t||Yr(),"Safari"!=Kr(t)&&!t.toLowerCase().match(/iphone|ipad|ipod/)}function ai(){var t=l.___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 ui(t,e){if(t>
82e)throw Error("Short delay should be less than long delay!");this.a=t,this.c=e,t=Yr(),e=qr(),this.b=kr(t)||"ReactNative"===e}function ci(){var t=l.document;return!t||"undefined"===typeof t.visibilityState||"visible"==t.visibilityState}function hi(){var t=l.document,e=null;return ci()||!t?je():new Ae((function(n){e=function(){ci()&&(t.removeEventListener("visibilitychange",e,!1),n())},t.addEventListener("visibilitychange",e,!1)})).o((function(n){throw t.removeEventListener("visibilitychange",e,!1),n}))}function li(t){try{var e=new Date(parseInt(t,10));if(!isNaN(e.getTime())&&!/[^0-9]/.test(t))return e.toUTCString()}catch(n){}return null}function fi(){return!(!Xr("fireauth.oauthhelper",l)&&!Xr("fireauth.iframe",l))}function pi(){var t=l.navigator;return t&&t.serviceWorker&&t.serviceWorker.controller||null}function di(){var t=l.navigator;return t&&t.serviceWorker?je().then((function(){return t.serviceWorker.ready})).then((function(t){return t.active||null})).o((function(){return null})):je(null)}ui.prototype.get=function(){var t=l.navigator;return!t||"boolean"!==typeof t.onLine||!Zr()&&"chrome-extension:"!==ti()&&"undefined"===typeof t.connection||t.onLine?this.b?this.c:this.a:Math.min(5e3,this.a)};var vi,gi={};function yi(t){gi[t]||(gi[t]=!0,"undefined"!==typeof console&&"function"===typeof console.warn&&console.warn(t))}try{var mi={};Object.defineProperty(mi,"abcd",{configurable:!0,enumerable:!0,value:1}),Object.defineProperty(mi,"abcd",{configurable:!0,enumerable:!0,value:2}),vi=2==mi.abcd}catch(Bp){vi=!1}function _i(t,e,n){vi?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n}):t[e]=n}function bi(t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&_i(t,n,e[n])}function wi(t){var e={};return bi(e,t),e}function Ei(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}function Ii(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(void 0===r||null===r||""===r)return!1}return!0}function Ti(t){var e=t;if("object"==typeof t&&null!=t)for(var n in e="length"in t?[]:{},t)_i(e,n,Ti(t[n]));return e}function Ci(t){var e=t&&(t[ki]?"phone":null);if(!(e&&t&&t[Ai]))throw new N("internal-error","Internal assert: invalid MultiFactorInfo object");_i(this,"uid",t[Ai]),_i(this,"displayName",t[Oi]||null);var n=null;t[Ni]&&(n=new Date(t[Ni]).toUTCString()),_i(this,"enrollmentTime",n),_i(this,"factorId",e)}function Si(t){try{var e=new Ri(t)}catch(n){e=null}return e}Ci.prototype.v=function(){return{uid:this.uid,displayName:this.displayName,factorId:this.factorId,enrollmentTime:this.enrollmentTime}};var Oi="displayName",Ni="enrolledAt",Ai="mfaEnrollmentId",ki="phoneInfo";function Ri(t){Ci.call(this,t),_i(this,"phoneNumber",t[ki])}function Pi(t){var e={},n=t[ji],r=t[Fi],i=t[Ui];if(t=Si(t[Mi]),!i||i!=Di&&i!=Li&&!n||i==Li&&!r||i==xi&&!t)throw Error("Invalid checkActionCode response!");i==Li?(e[qi]=n||null,e[Wi]=n||null,e[Vi]=r):(e[qi]=r||null,e[Wi]=r||null,e[Vi]=n||null),e[Bi]=t||null,_i(this,Hi,i),_i(this,Gi,Ti(e))}O(Ri,Ci),Ri.prototype.v=function(){var t=Ri.Za.v.call(this);return t.phoneNumber=this.phoneNumber,t};var xi="REVERT_SECOND_FACTOR_ADDITION",Di="EMAIL_SIGNIN",Li="VERIFY_AND_CHANGE_EMAIL",ji="email",Mi="mfaInfo",Fi="newEmail",Ui="requestType",Vi="email",qi="fromEmail",Bi="multiFactorInfo",Wi="previousEmail",Gi="data",Hi="operation";function Ki(t){t=tr(t);var e=Zn(t,zi)||null,n=Zn(t,Qi)||null,r=Zn(t,$i)||null;if(r=r&&Zi[r]||null,!e||!n||!r)throw new N("argument-error",zi+", "+Qi+"and "+$i+" are required in a valid action code URL.");bi(this,{apiKey:e,operation:r,code:n,continueUrl:Zn(t,Yi)||null,languageCode:Zn(t,Xi)||null,tenantId:Zn(t,Ji)||null})}var zi="apiKey",Qi="oobCode",Yi="continueUrl",Xi="languageCode",$i="mode",Ji="tenantId",Zi={recoverEmail:"RECOVER_EMAIL",resetPassword:"PASSWORD_RESET",revertSecondFactorAddition:xi,signIn:Di,verifyAndChangeEmail:Li,verifyEmail:"VERIFY_EMAIL"};function to(t){try{return new Ki(t)}catch(e){return null}}function eo(t){var e=t[so];if("undefined"===typeof e)throw new N("missing-continue-uri");if("string"!==typeof e||"string"===typeof e&&!e.length)throw new N("invalid-continue-uri");this.h=e,this.b=this.a=null,this.g=!1;var n=t[no];if(n&&"object"===typeof n){e=n[co];var r=n[ao];if(n=n[uo],"string"===typeof e&&e.length){if(this.a=e,"undefined"!==typeof r&&"boolean"!==typeof r)throw new N("argument-error",ao+" property must be a boolean when specified.");if(this.g=!!r,"undefined"!==typeof n&&("string"!==typeof n||"string"===typeof n&&!n.length))throw new N("argument-error",uo+" property must be a non empty string when specified.");this.b=n||null}else{if("undefined"!==typeof e)throw new N("argument-error",co+" property must be a non empty string when specified.");if("undefined"!==typeof r||"undefined"!==typeof n)throw new N("missing-android-pkg-name")}}
82else if("undefined"!==typeof n)throw new N("argument-error",no+" property must be a non null object when specified.");if(this.f=null,(e=t[oo])&&"object"===typeof e){if(e=e[ho],"string"===typeof e&&e.length)this.f=e;else if("undefined"!==typeof e)throw new N("argument-error",ho+" property must be a non empty string when specified.")}else if("undefined"!==typeof e)throw new N("argument-error",oo+" property must be a non null object when specified.");if(e=t[io],"undefined"!==typeof e&&"boolean"!==typeof e)throw new N("argument-error",io+" property must be a boolean when specified.");if(this.c=!!e,t=t[ro],"undefined"!==typeof t&&("string"!==typeof t||"string"===typeof t&&!t.length))throw new N("argument-error",ro+" property must be a non empty string when specified.");this.i=t||null}var no="android",ro="dynamicLinkDomain",io="handleCodeInApp",oo="iOS",so="url",ao="installApp",uo="minimumVersion",co="packageName",ho="bundleId";function lo(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}function fo(t){return Y(t,(function(t){return t=t.toString(16),1<t.length?t:"0"+t})).join("")}var po=null;function vo(t){var e="";return go(t,(function(t){e+=String.fromCharCode(t)})),e}function go(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=po[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}yo();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))}}function yo(){if(!po){po={};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===po[o]&&(po[o]=i)}}}function mo(t){var e=bo(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,S(),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 _o(t){try{return new mo(t)}catch(e){return null}}function bo(t){if(!t)return null;if(t=t.split("."),3!=t.length)return null;t=t[1];for(var e=(4-t.length%4)%4,n=0;n<e;n++)t+=".";try{return JSON.parse(vo(t))}catch(r){}return null}mo.prototype.S=function(){return this.f},mo.prototype.i=function(){return this.b},mo.prototype.toString=function(){return this.g};var wo="oauth_consumer_key oauth_nonce oauth_signature oauth_signature_method oauth_timestamp oauth_token oauth_version".split(" "),Eo=["client_id","response_type","scope","redirect_uri","state"],Io={kd:{Ha:"locale",ta:700,sa:600,ea:"facebook.com",Va:Eo},md:{Ha:null,ta:500,sa:750,ea:"github.com",Va:Eo},nd:{Ha:"hl",ta:515,sa:680,ea:"google.com",Va:Eo},td:{Ha:"lang",ta:485,sa:705,ea:"twitter.com",Va:wo},gd:{Ha:"locale",ta:640,sa:600,ea:"apple.com",Va:[]}};function To(t){for(var e in Io)if(Io[e].ea==t)return Io[e];return null}function Co(t){var e={};e["facebook.com"]=ko,e["google.com"]=Po,e["github.com"]=Ro,e["twitter.com"]=xo;var n=t&&t[Oo];try{if(n)return e[n]?new e[n](t):new Ao(t);if("undefined"!==typeof t[So])return new No(t)}catch(r){}return null}var So="idToken",Oo="providerId";function No(t){var e=t[Oo];if(!e&&t[So]){var n=_o(t[So]);n&&n.a&&(e=n.a)}if(!e)throw Error("Invalid additional user info!");"anonymous"!=e&&"custom"!=e||(e=null),n=!1,"undefined"!==typeof t.isNewUser?n=!!t.isNewUser:"identitytoolkit#SignupNewUserResponse"===t.kind&&(n=!0),_i(this,"providerId",e),_i(this,"isNewUser",n)}
82function Ao(t){No.call(this,t),t=ii(t.rawUserInfo||"{}"),_i(this,"profile",Ti(t||{}))}function ko(t){if(Ao.call(this,t),"facebook.com"!=this.providerId)throw Error("Invalid provider ID!")}function Ro(t){if(Ao.call(this,t),"github.com"!=this.providerId)throw Error("Invalid provider ID!");_i(this,"username",this.profile&&this.profile.login||null)}function Po(t){if(Ao.call(this,t),"google.com"!=this.providerId)throw Error("Invalid provider ID!")}function xo(t){if(Ao.call(this,t),"twitter.com"!=this.providerId)throw Error("Invalid provider ID!");_i(this,"username",t.screenName||null)}function Do(t){var e=tr(t),n=Zn(e,"link"),r=Zn(tr(n),"link");return e=Zn(e,"deep_link_id"),Zn(tr(e),"link")||e||r||n||t}function Lo(t,e){if(!t&&!e)throw new N("internal-error","Internal assert: no raw session string available");if(t&&e)throw new N("internal-error","Internal assert: unable to determine the session type");this.a=t||null,this.b=e||null,this.type=this.a?jo:Mo}O(Ao,No),O(ko,Ao),O(Ro,Ao),O(Po,Ao),O(xo,Ao);var jo="enroll",Mo="signin";function Fo(){}function Uo(t,e){return t.then((function(t){if(t[Pa]){var n=_o(t[Pa]);if(!n||e!=n.h)throw new N("user-mismatch");return t}throw new N("user-mismatch")})).o((function(t){throw t&&t.code&&t.code==R+"user-not-found"?new N("user-mismatch"):t}))}function Vo(t,e){if(!e)throw new N("internal-error","failed to construct a credential");this.a=e,_i(this,"providerId",t),_i(this,"signInMethod",t)}function qo(t){return{pendingToken:t.a,requestUri:"http://localhost"}}function Bo(t){if(t&&t.providerId&&t.signInMethod&&0==t.providerId.indexOf("saml.")&&t.pendingToken)try{return new Vo(t.providerId,t.pendingToken)}catch(e){}return null}function Wo(t,e,n){if(this.a=null,e.idToken||e.accessToken)e.idToken&&_i(this,"idToken",e.idToken),e.accessToken&&_i(this,"accessToken",e.accessToken),e.nonce&&!e.pendingToken&&_i(this,"nonce",e.nonce),e.pendingToken&&(this.a=e.pendingToken);else{if(!e.oauthToken||!e.oauthTokenSecret)throw new N("internal-error","failed to construct a credential");_i(this,"accessToken",e.oauthToken),_i(this,"secret",e.oauthTokenSecret)}_i(this,"providerId",t),_i(this,"signInMethod",n)}function Go(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:fr(e).toString(),requestUri:"http://localhost"},t.a&&(delete e.postBody,e.pendingToken=t.a),e}function Ho(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 Wo(t.providerId,e,t.signInMethod)}catch(n){}}return null}function Ko(t,e){this.Oc=e||[],bi(this,{providerId:t,isOAuthProvider:!0}),this.Fb={},this.lb=(To(t)||{}).Ha||null,this.kb=null}function zo(t){if("string"!==typeof t||0!=t.indexOf("saml."))throw new N("argument-error",'SAML provider IDs must be prefixed with "saml."');Ko.call(this,t,[])}function Qo(t){Ko.call(this,t,Eo),this.a=[]}function Yo(){Qo.call(this,"facebook.com")}function Xo(t){if(!t)throw new N("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return m(t)&&(e=t.accessToken),(new Yo).credential({accessToken:e})}function $o(){Qo.call(this,"github.com")}function Jo(t){if(!t)throw new N("argument-error","credential failed: expected 1 argument (the OAuth access token).");var e=t;return m(t)&&(e=t.accessToken),(new $o).credential({accessToken:e})}function Zo(){Qo.call(this,"google.com"),this.Aa("profile")}function ts(t,e){var n=t;return m(t)&&(n=t.idToken,e=t.accessToken),(new Zo).credential({idToken:n,accessToken:e})}function es(){Ko.call(this,"twitter.com",wo)}function ns(t,e){var n=t;if(m(n)||(n={oauthToken:t,oauthTokenSecret:e}),!n.oauthToken||!n.oauthTokenSecret)throw new N("argument-error","credential failed: expected 2 arguments (the OAuth access token and secret).");return new Wo("twitter.com",n,"twitter.com")}function rs(t,e,n){this.a=t,this.f=e,_i(this,"providerId","password"),_i(this,"signInMethod",n===os.EMAIL_LINK_SIGN_IN_METHOD?os.EMAIL_LINK_SIGN_IN_METHOD:os.EMAIL_PASSWORD_SIGN_IN_METHOD)}function is(t){return t&&t.email&&t.password?new rs(t.email,t.password,t.signInMethod):null}function os(){bi(this,{providerId:"password",isOAuthProvider:!1})}function ss(t,e){if(e=as(e),!e)throw new N("argument-error","Invalid email link!");return new rs(t,e.code,os.EMAIL_LINK_SIGN_IN_METHOD)}function as(t){return t=Do(t),(t=to(t))&&t.operation===Di?t:null}function us(t){if(!(t.bb&&t.ab||t.Ja&&t.da))throw new N("internal-error");this.a=t,_i(this,"providerId","phone"),this.ea="phone",_i(this,"signInMethod","phone")}function cs(t){if(t&&"phone"===t.providerId&&(t.verificationId&&t.verificationCode||t.temporaryProof&&t.phoneNumber)){var e={};return K(["verificationId","verificationCode","temporaryProof","phoneNumber"],(function(n){t[n]&&(e[n]=t[n])})),new us(e)}return null}function hs(t){return t.a.Ja&&t.a.da?{temporaryProof:t.a.Ja,phoneNumber:t.a.da}:{sessionInfo:t.a.bb,code:t.a.ab}}function ls(t){try{this.a=t||r.auth()}catch(e){throw new N("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().")}bi(this,{providerId:"phone",isOAuthProvider:!1})}function fs(t,e){if(!t)throw new N("missing-verification-id");if(!e)throw new N("missing-verification-code");return new us({bb:t,ab:e})}function ps(t){if(t.temporaryProof&&t.phoneNumber)return new us({Ja:t.temporaryProof,da: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 ts(o,n);case"facebook.com":return Xo(n);case"github.com":return Jo(n);case"twitter.com":return ns(n,r);default:return n||r||o||s?s?0==e.indexOf("saml.")?new Vo(e,s):new Wo(e,{pendingToken:s,idToken:t.oauthIdToken,accessToken:t.oauthAccessToken},e):new Qo(e).credential({idToken:o,accessToken:n,rawNonce:i}):null}}catch(a){return null}}function ds(t){if(!t.isOAuthProvider)throw new N("invalid-oauth-provider")}
82function vs(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 N("invalid-auth-event");if(this.g&&this.a)throw new N("invalid-auth-event");if(this.g&&!this.f)throw new N("invalid-auth-event")}function gs(t){return t=t||{},t.type?new vs(t.type,t.eventId,t.urlResponse,t.sessionId,t.error&&A(t.error),t.postBody,t.tenantId):null}function ys(){this.b=null,this.a=[]}Lo.prototype.Fa=function(){return this.a?je(this.a):je(this.b)},Lo.prototype.v=function(){return this.type==jo?{multiFactorSession:{idToken:this.a}}:{multiFactorSession:{pendingCredential:this.b}}},Fo.prototype.ia=function(){},Fo.prototype.b=function(){},Fo.prototype.c=function(){},Fo.prototype.v=function(){},Vo.prototype.ia=function(t){return su(t,qo(this))},Vo.prototype.b=function(t,e){var n=qo(this);return n.idToken=e,au(t,n)},Vo.prototype.c=function(t,e){return Uo(uu(t,qo(this)),e)},Vo.prototype.v=function(){return{providerId:this.providerId,signInMethod:this.signInMethod,pendingToken:this.a}},Wo.prototype.ia=function(t){return su(t,Go(this))},Wo.prototype.b=function(t,e){var n=Go(this);return n.idToken=e,au(t,n)},Wo.prototype.c=function(t,e){var n=Go(this);return Uo(uu(t,n),e)},Wo.prototype.v=function(){var t={providerId:this.providerId,sign
82InMethod: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},Ko.prototype.Ia=function(t){return this.Fb=_t(t),this},O(zo,Ko),O(Qo,Ko),Qo.prototype.Aa=function(t){return J(this.a,t)||this.a.push(t),this},Qo.prototype.Nb=function(){return nt(this.a)},Qo.prototype.credential=function(t,e){var n;if(n=m(t)?{idToken:t.idToken||null,accessToken:t.accessToken||null,nonce:t.rawNonce||null}:{idToken:t||null,accessToken:e||null},!n.idToken&&!n.accessToken)throw new N("argument-error","credential failed: must provide the ID token and/or the access token.");return new Wo(this.providerId,n,this.providerId)},O(Yo,Qo),_i(Yo,"PROVIDER_ID","facebook.com"),_i(Yo,"FACEBOOK_SIGN_IN_METHOD","facebook.com"),O($o,Qo),_i($o,"PROVIDER_ID","github.com"),_i($o,"GITHUB_SIGN_IN_METHOD","github.com"),O(Zo,Qo),_i(Zo,"PROVIDER_ID","google.com"),_i(Zo,"GOOGLE_SIGN_IN_METHOD","google.com"),O(es,Ko),_i(es,"PROVIDER_ID","twitter.com"),_i(es,"TWITTER_SIGN_IN_METHOD","twitter.com"),rs.prototype.ia=function(t){return this.signInMethod==os.EMAIL_LINK_SIGN_IN_METHOD?Wu(t,gu,{email:this.a,oobCode:this.f}):Wu(t,Fu,{email:this.a,password:this.f})},rs.prototype.b=function(t,e){return this.signInMethod==os.EMAIL_LINK_SIGN_IN_METHOD?Wu(t,yu,{idToken:e,email:this.a,oobCode:this.f}):Wu(t,ku,{idToken:e,email:this.a,password:this.f})},rs.prototype.c=function(t,e){return Uo(this.ia(t),e)},rs.prototype.v=function(){return{email:this.a,password:this.f,signInMethod:this.signInMethod}},bi(os,{PROVIDER_ID:"password"}),bi(os,{EMAIL_LINK_SIGN_IN_METHOD:"emailLink"}),bi(os,{EMAIL_PASSWORD_SIGN_IN_METHOD:"password"}),us.prototype.ia=function(t){return t.cb(hs(this))},us.prototype.b=function(t,e){var n=hs(this);return n.idToken=e,Wu(t,Vu,n)},us.prototype.c=function(t,e){var n=hs(this);return n.operation="REAUTH",t=Wu(t,qu,n),Uo(t,e)},us.prototype.v=function(){var t={providerId:"phone"};return this.a.bb&&(t.verificationId=this.a.bb),this.a.ab&&(t.verificationCode=this.a.ab),this.a.Ja&&(t.temporaryProof=this.a.Ja),this.a.da&&(t.phoneNumber=this.a.da),t},ls.prototype.cb=function(t,e){var n=this.a.b;return je(e.verify()).then((function(r){if("string"!==typeof r)throw new N("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,o=m(t)?t.session:null,s=m(t)?t.phoneNumber:t;return i=o&&o.type==jo?o.Fa().then((function(t){return Za(n,{idToken:t,phoneEnrollmentInfo:{phoneNumber:s,recaptchaToken:r}})})):o&&o.type==Mo?o.Fa().then((function(e){return eu(n,{mfaPendingCredential:e,mfaEnrollmentId:t.multiFactorHint&&t.multiFactorHint.uid||t.multiFactorUid,phoneSignInInfo:{recaptchaToken:r}})})):Ja(n,{phoneNumber:s,recaptchaToken:r}),i.then((function(t){return"function"===typeof e.reset&&e.reset(),t}),(function(t){throw"function"===typeof e.reset&&e.reset(),t}));default:throw new N("argument-error",'Only firebase.auth.ApplicationVerifiers with type="recaptcha" are currently supported.')}}))},bi(ls,{PROVIDER_ID:"phone"}),bi(ls,{PHONE_SIGN_IN_METHOD:"phone"}),vs.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("-")},vs.prototype.S=function(){return this.h},vs.prototype.v=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.v()}};var ms,_s=null;function bs(t){var e=_s;e.a.push(t),e.b||(e.b=function(t){for(var n=0;n<e.a.length;n++)e.a[n](t)},t=Xr("universalLinks.subscribe",l),"function"===typeof t&&t(null,e.b))}function ws(t){var e="unauthorized-domain",n=void 0,r=tr(t);t=r.b,r=r.f,"chrome-extension"==r?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",N.call(this,e,n)}function Es(t,e,n){N.call(this,t,n),t=e||{},t.Gb&&_i(this,"email",t.Gb),t.da&&_i(this,"phoneNumber",t.da),t.credential&&_i(this,"credential",t.credential),t.Wb&&_i(this,"tenantId",t.Wb)}function Is(t){if(t.code){var e=t.code||"";0==e.indexOf(R)&&(e=e.substring(R.length));var n={credential:ps(t),Wb:t.tenantId};if(t.email)n.Gb=t.email;else if(t.phoneNumber)n.da=t.phoneNumber;else if(!n.credential)return new N(e,t.message||void 0);return new Es(e,n,t.message)}return null}function Ts(){}function Cs(t){return t.c||(t.c=t.b())}function Ss(){}function Os(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(i){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed")}return t.f}function Ns(){}function As(){this.a=new XDomainRequest,this.readyState=0,this.onreadystatechange=null,this.responseType=this.responseText=this.response="",this.status=-1,this.statusText="",this.a.onload=T(this.oc,this),this.a.onerror=T(this.Pb,this),this.a.onprogress=T(this.pc,this),this.a.ontimeout=T(this.tc,this)}function ks(t,e){t.readyState=e,t.onreadystatechange&&t.onreadystatechange()}function Rs(t,e,n){this.reset(t,e,n,void 0,void 0)}O(ws,N),O(Es,N),Es.prototype.v=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.v();return e&&wt(t,e),t},Es.prototype.toJSON=function(){return this.v()},Ts.prototype.c=null,O(Ss,Ts),Ss.prototype.a=function(){var t=Os(this);return t?new ActiveXObject(t):new XMLHttpRequest},Ss.prototype.b=function(){var t={};return Os(this)&&(t[0]=!0,t[1]=!0),t},ms=new Ss,O(Ns,Ts),Ns.prototype.a=function(){var t=new XMLHttpRequest;if("withCredentials"in t)return t;if("undefined"!=typeof XDomainRequest)return new As;throw Error("Unsupported browser")},Ns.prototype.b=function(){return{}},e=As.prototype,e.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.oc=function(){this.status=200,this.response=this.responseText=this.a.responseText,ks(this,4)},e.Pb=function(){this.status=500,this.response=this.responseText="",ks(this,4)},e.tc=function(){this.Pb()},e.pc=function(){this.status=200,ks(this,1)},e.getAllResponseHeaders=function(){return"content-type: "+this.a.contentType},Rs.prototype.a=null;function Ps(t){this.f=t,this.b=this.c=this.a=null}function xs(t,e){this.name=t,this.value=e}Rs.prototype.reset=function(t,e,n,r,i){"number"==typeof i||0,r||S(),delete this.a},xs.prototype.toString=function(){return this.name};var Ds=new xs("SEVERE",1e3),Ls=new xs("WARNING",900),js=new xs("CONFIG",700),Ms=new xs("FINE",500);function Fs(t){return t.c?t.c:t.a?Fs(t.a):(F("Root logger has no level set."),null)}Ps.prototype.log=function(t,e,n){if(t.value>=Fs(this).value)for(y(e)&&(e=e()),t=new Rs(t,String(e),this.f),n&&(t.a=n),n=this;n;)n=n.a};var Us={},Vs=null;function qs(t){var e;
82if(Vs||(Vs=new Ps(""),Us[""]=Vs,Vs.c=js),!(e=Us[t])){e=new Ps(t);var n=t.lastIndexOf("."),r=t.substr(n+1);n=qs(t.substr(0,n)),n.b||(n.b={}),n.b[r]=e,e.a=n,Us[t]=e}return e}function Bs(t,e){t&&t.log(Ms,e,void 0)}function Ws(t){this.f=t}function Gs(t){Dn.call(this),this.s=t,this.readyState=Hs,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=qs("goog.net.FetchXmlHttp"),this.l=this.c=this.f=null}O(Ws,Ts),Ws.prototype.a=function(){return new Gs(this.f)},Ws.prototype.b=function(t){return function(){return t}}({}),O(Gs,Dn);var Hs=0;function Ks(t){t.c.read().then(t.nc.bind(t)).catch(t.Sa.bind(t))}function zs(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,Qs(t)}function Qs(t){t.onreadystatechange&&t.onreadystatechange.call(t)}function Ys(t){Dn.call(this),this.headers=new Wn,this.D=t||null,this.c=!1,this.B=this.a=null,this.h=this.P=this.l="",this.f=this.O=this.i=this.N=!1,this.g=0,this.s=null,this.m=Xs,this.w=this.R=!1}e=Gs.prototype,e.open=function(t,e){if(this.readyState!=Hs)throw this.abort(),Error("Error reopening a connection");this.m=t,this.g=e,this.readyState=1,Qs(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};t&&(e.body=t),this.s.fetch(new Request(this.g,e)).then(this.sc.bind(this),this.Sa.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,zs(this,!1)),this.readyState=Hs},e.sc=function(t){this.a&&(this.f=t,this.b||(this.b=t.headers,this.readyState=2,Qs(this)),this.a&&(this.readyState=3,Qs(this),this.a&&("arraybuffer"===this.responseType?t.arrayBuffer().then(this.qc.bind(this),this.Sa.bind(this)):"undefined"!==typeof l.ReadableStream&&"body"in t?(this.response=this.responseText="",this.c=t.body.getReader(),this.l=new TextDecoder,Ks(this)):t.text().then(this.rc.bind(this),this.Sa.bind(this)))))},e.nc=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?zs(this,!0):Qs(this),3==this.readyState&&Ks(this)}},e.rc=function(t){this.a&&(this.response=this.responseText=t,zs(this,!0))},e.qc=function(t){this.a&&(this.response=t,zs(this,!0))},e.Sa=function(t){var e=this.h;e&&e.log(Ls,"Failed to fetch url "+this.g,t instanceof Error?t:Error(t)),this.a&&zs(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(Ls,"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(Ls,"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")},O(Ys,Dn);var Xs="";Ys.prototype.b=qs("goog.net.XhrIo");var $s=/^https?$/i,Js=["POST","PUT"];function Zs(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.N=!1,t.c=!0,t.a=t.D?t.D.a():ms.a(),t.B=t.D?Cs(t.D):Cs(ms),t.a.onreadystatechange=T(t.Sb,t);try{Bs(t.b,ha(t,"Opening Xhr")),t.O=!0,t.a.open(n,String(e),!0),t.O=!1}catch(s){return Bs(t.b,ha(t,"Error opening Xhr: "+s.message)),void na(t,s)}e=r||"";var o=new Wn(t.headers);i&&Bn(i,(function(t,e){o.set(e,t)})),i=$(o.X()),r=l.FormData&&e instanceof l.FormData,!J(Js,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{sa(t),0<t.g&&(t.w=ta(t.a),Bs(t.b,ha(t,"Will abort after "+t.g+"ms if incomplete, xhr2 "+t.w)),t.w?(t.a.timeout=t.g,t.a.ontimeout=T(t.Ka,t)):t.s=Fn(t.Ka,t.g,t)),Bs(t.b,ha(t,"Sending request")),t.i=!0,t.a.send(e),t.i=!1}catch(s){Bs(t.b,ha(t,"Send error: "+s.message)),na(t,s)}}function ta(t){return te&&le(9)&&"number"===typeof t.timeout&&void 0!==t.ontimeout}function ea(t){return"content-type"==t.toLowerCase()}function na(t,e){t.c=!1,t.a&&(t.f=!0,t.a.abort(),t.f=!1),t.h=e,ra(t),oa(t)}function ra(t){t.N||(t.N=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function ia(t){if(t.c&&"undefined"!=typeof h)if(t.B[1]&&4==aa(t)&&2==ua(t))Bs(t.b,ha(t,"Local request error detected and ignored"));else if(t.i&&4==aa(t))Fn(t.Sb,0,t);else if(t.dispatchEvent("readystatechange"),4==aa(t)){Bs(t.b,ha(t,"Request complete")),t.c=!1;try{var e,n=ua(t);t:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r
82=!0;break t;default:r=!1}if(!(e=r)){var i;if(i=0===n){var o=String(t.l).match(Kn)[1]||null;if(!o&&l.self&&l.self.location){var s=l.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<aa(t)?t.a.statusText:""}catch(u){Bs(t.b,"Can not get status: "+u.message),a=""}t.h=a+" ["+ua(t)+"]",ra(t)}}finally{oa(t)}}}function oa(t,e){if(t.a){sa(t);var n=t.a,r=t.B[0]?d:null;t.a=null,t.B=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=r}catch(i){(t=t.b)&&t.log(Ds,"Problem encountered resetting onreadystatechange: "+i.message,void 0)}}}function sa(t){t.a&&t.w&&(t.a.ontimeout=null),t.s&&(l.clearTimeout(t.s),t.s=null)}function aa(t){return t.a?t.a.readyState:0}function ua(t){try{return 2<aa(t)?t.a.status:-1}catch(e){return-1}}function ca(t){try{return t.a?t.a.responseText:""}catch(e){return Bs(t.b,"Can not get responseText: "+e.message),""}}function ha(t,e){return e+" ["+t.P+" "+t.l+" "+ua(t)+"]"}function la(t){var e=Ta;this.g=[],this.w=e,this.s=t||null,this.f=this.a=!1,this.c=void 0,this.u=this.B=this.i=!1,this.h=0,this.b=null,this.l=0}function fa(t,e,n){t.a=!0,t.c=n,t.f=!e,ya(t)}function pa(t){if(t.a){if(!t.u)throw new ma(t);t.u=!1}}function da(t,e){va(t,null,e,void 0)}function va(t,e,n,r){t.g.push([e,n,r]),t.a&&ya(t)}function ga(t){return X(t.g,(function(t){return y(t[1])}))}function ya(t){if(t.h&&t.a&&ga(t)){var e=t.h,n=wa[e];n&&(l.clearTimeout(n.a),delete wa[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.s,e);void 0!==a&&(t.f=t.f&&(a==e||a instanceof Error),t.c=e=a),(L(e)||"function"===typeof l.Promise&&e instanceof l.Promise)&&(r=!0,t.i=!0)}catch(u){e=u,t.f=!0,ga(t)||(n=!0)}}t.c=e,r&&(a=T(t.m,t,!0),r=T(t.m,t,!1),e instanceof la?(va(e,a,r),e.B=!0):e.then(a,r)),n&&(e=new ba(e),wa[e.a]=e,t.h=e.a)}function ma(){j.call(this)}function _a(){j.call(this)}function ba(t){this.a=l.setTimeout(T(this.c,this),0),this.b=t}e=Ys.prototype,e.Ka=function(){"undefined"!=typeof h&&this.a&&(this.h="Timed out after "+this.g+"ms, aborting",Bs(this.b,ha(this,this.h)),this.dispatchEvent("timeout"),this.abort(8))},e.abort=function(){this.a&&this.c&&(Bs(this.b,ha(this,"Aborting")),this.c=!1,this.f=!0,this.a.abort(),this.f=!1,this.dispatchEvent("complete"),this.dispatchEvent("abort"),oa(this))},e.Ba=function(){this.a&&(this.c&&(this.c=!1,this.f=!0,this.a.abort(),this.f=!1),oa(this,!0)),Ys.Za.Ba.call(this)},e.Sb=function(){this.wa||(this.O||this.i||this.f?ia(this):this.Hc())},e.Hc=function(){ia(this)},e.getResponse=function(){try{if(!this.a)return null;if("response"in this.a)return this.a.response;switch(this.m){case Xs: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(Ds,"Response type "+this.m+" is not supported on this browser",void 0),null}catch(e){return Bs(this.b,"Can not get response: "+e.message),null}},la.prototype.cancel=function(t){if(this.a)this.c instanceof la&&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.w?this.w.call(this.s,this):this.u=!0,this.a||(t=new _a(this),pa(this),fa(this,!1,t))}},la.prototype.m=function(t,e){this.i=!1,fa(this,t,e)},la.prototype.then=function(t,e,n){var r,i,o=new Ae((function(t,e){r=t,i=e}));return va(this,r,(function(t){t instanceof _a?o.cancel():i(t)})),o.then(t,e,n)},la.prototype.$goog_Thenable=!0,O(ma,j),ma.prototype.message="Deferred has already fired",ma.prototype.name="AlreadyCalledError",O(_a,j),_a.prototype.message="Deferred was canceled",_a.prototype.name="CanceledError",ba.prototype.c=function(){throw delete wa[this.a],this.b};var wa={};function Ea(t){var e={},n=e.document||document,r=At(t).toString(),i=be(document,"SCRIPT"),o={Tb:i,Ka:void 0},s=new la(o),a=null,u=null!=e.timeout?e.timeout:5e3;return 0<u&&(a=window.setTimeout((function(){Ca(i,!0);var t=new Na(Oa,"Timeout reached for loading script "+r);pa(s),fa(s,!1,t)}),u),o.Ka=a),i.onload=i.onreadystatechange=function(){i.readyState&&"loaded"!=i.readyState&&"complete"!=i.readyState||(Ca(i,e.ud||!1,a),pa(s),fa(s,!0,null))}
82,i.onerror=function(){Ca(i,!0,a);var t=new Na(Sa,"Error while loading script "+r);pa(s),fa(s,!1,t)},o=e.attributes||{},wt(o,{type:"text/javascript",charset:"UTF-8"}),de(i,o),zt(i,t),Ia(n).appendChild(i),s}function Ia(t){var e;return(e=(t||document).getElementsByTagName("HEAD"))&&0!=e.length?e[0]:t.documentElement}function Ta(){if(this&&this.Tb){var t=this.Tb;t&&"SCRIPT"==t.tagName&&Ca(t,!0,this.Ka)}}function Ca(t,e,n){null!=n&&l.clearTimeout(n),t.onload=d,t.onerror=d,t.onreadystatechange=d,e&&window.setTimeout((function(){t&&t.parentNode&&t.parentNode.removeChild(t)}),0)}var Sa=0,Oa=1;function Na(t,e){var n="Jsloader error (code #"+t+")";e&&(n+=": "+e),j.call(this,n),this.code=t}function Aa(t){this.f=t}function ka(t,e,n){if(this.c=t,t=e||{},this.u=t.secureTokenEndpoint||"https://securetoken.googleapis.com/v1/token",this.m=t.secureTokenTimeout||xa,this.g=_t(t.secureTokenHeaders||Da),this.h=t.firebaseEndpoint||"https://www.googleapis.com/identitytoolkit/v3/relyingparty/",this.l=t.identityPlatformEndpoint||"https://identitytoolkit.googleapis.com/v2/",this.i=t.firebaseTimeout||La,this.a=_t(t.firebaseHeaders||ja),n&&(this.a["X-Client-Version"]=n,this.g["X-Client-Version"]=n),n="Node"==qr(),n=l.XMLHttpRequest||n&&r.INTERNAL.node&&r.INTERNAL.node.XMLHttpRequest,!n&&!Vr())throw new N("internal-error","The XMLHttpRequest compatibility library was not found.");this.f=void 0,Vr()?this.f=new Ws(self):Br()?this.f=new Aa(n):this.f=new Ns,this.b=null}O(Na,j),O(Aa,Ts),Aa.prototype.a=function(){return new this.f},Aa.prototype.b=function(){return{}};var Ra,Pa="idToken",xa=new ui(3e4,6e4),Da={"Content-Type":"application/x-www-form-urlencoded"},La=new ui(3e4,6e4),ja={"Content-Type":"application/json"};function Ma(t,e){e?t.a["X-Firebase-Locale"]=e:delete t.a["X-Firebase-Locale"]}function Fa(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"])}
82function Ua(t,e,n,r,i,o,s){Ar()||Vr()?t=T(t.w,t):(Ra||(Ra=new Ae((function(t,e){Ba(t,e)}))),t=T(t.s,t)),t(e,n,r,i,o,s)}ka.prototype.S=function(){return this.b},ka.prototype.w=function(t,e,n,r,i,o){if(Vr()&&("undefined"===typeof l.fetch||"undefined"===typeof l.Headers||"undefined"===typeof l.Request))throw new N("operation-not-supported-in-this-environment","fetch, Headers and Request native APIs or equivalent Polyfills must be available to support 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)}Ln(s,"complete",(function(){a&&clearTimeout(a);var t=null;try{t=JSON.parse(ca(this))||null}catch(n){t=null}e&&e(t)})),jn(s,"ready",(function(){a&&clearTimeout(a),rn(this)})),jn(s,"timeout",(function(){a&&clearTimeout(a),rn(this),e&&e(null)})),Zs(s,t,n,r,i)};var Va=new It(St,"https://apis.google.com/js/client.js?onload=%{onload}"),qa="__fcb"+Math.floor(1e6*Math.random()).toString();function Ba(t,e){if(((window.gapi||{}).client||{}).request)t();else{l[qa]=function(){((window.gapi||{}).client||{}).request?t():e(Error("CORS_UNSUPPORTED"))};var n=kt(Va,{onload:qa});da(Ea(n),(function(){e(Error("CORS_UNSUPPORTED"))}))}}function Wa(t,e){return new Ae((function(n,r){"refresh_token"==e.grant_type&&e.refresh_token||"authorization_code"==e.grant_type&&e.code?Ua(t,t.u+"?key="+encodeURIComponent(t.c),(function(t){t?t.error?r(Hu(t)):t.access_token&&t.refresh_token?n(t):r(new N("internal-error")):r(new N("network-request-failed"))}),"POST",fr(e).toString(),t.g,t.m.get()):r(new N("internal-error"))}))}function Ga(t,e,n,r,i,o,s){var a=tr(e+n);Jn(a,"key",t.c),s&&Jn(a,"cb",S().toString());var u="GET"==r;if(u)for(var c in i)i.hasOwnProperty(c)&&Jn(a,c,i[c]);return new Ae((function(e,n){Ua(t,a.toString(),(function(t){t?t.error?n(Hu(t,o||{})):e(t):n(new N("network-request-failed"))}),r,u?void 0:_r(ri(i)),t.a,t.i.get())}))}function Ha(t){if(t=t.email,"string"!==typeof t||!Lr.test(t))throw new N("invalid-email")}function Ka(t){"email"in t&&Ha(t)}function za(t,e){return Wu(t,pu,{identifier:e,continueUri:Zr()?Sr():"http://localhost"}).then((function(t){return t.signinMethods||[]}))}function Qa(t){return Wu(t,Cu,{}).then((function(t){return t.authorizedDomains||[]}))}function Ya(t){if(!t[Pa]){if(t.mfaPendingCredential)throw new N("multi-factor-auth-required",null,_t(t));throw new N("internal-error")}}function Xa(t){if(t.phoneNumber||t.temporaryProof){if(!t.phoneNumber||!t.temporaryProof)throw new N("internal-error")}else{if(!t.sessionInfo)throw new N("missing-verification-id");if(!t.code)throw new N("missing-verification-code")}}ka.prototype.s=function(t,e,n,r,i){var o=this;Ra.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)}})})).o((function(t){e&&e({error:{message:t&&t.message||"CORS_UNSUPPORTED"}})}))},ka.prototype.vb=function(){return Wu(this,Ru,{})},ka.prototype.xb=function(t,e){return Wu(this,Au,{idToken:t,email:e})},ka.prototype.yb=function(t,e){return Wu(this,ku,{idToken:t,password:e})};var $a={displayName:"DISPLAY_NAME",photoUrl:"PHOTO_URL"};function Ja(t,e){return Wu(t,Nu,e)}function Za(t,e){return Wu(t,Pu,e).then((function(t){return t.phoneSessionInfo.sessionInfo}))}function tu(t){if(!t.phoneVerificationInfo)throw new N("internal-error");if(!t.phoneVerificationInfo.sessionInfo)throw new N("missing-verification-id");if(!t.phoneVerificationInfo.code)throw new N("missing-verification-code")}function eu(t,e){return Wu(t,xu,e).then((function(t){return t.phoneResponseInfo.sessionInfo}))}function nu(t,e,n){return Wu(t,vu,{idToken:e,deleteProvider:n})}function ru(t){if(!t.requestUri||!t.sessionId&&!t.postBody&&!t.pendingToken)throw new N("internal-error")}function iu(t,e){return e.oauthIdToken&&e.providerId&&0==e.providerId.indexOf("oidc.")&&!e.pendingToken&&(t.sessionId?e.nonce=t.sessionId:t.postBody&&(t=new hr(t.postBody),dr(t,"nonce")&&(e.nonce=t.get("nonce")))),e}function ou(t){var e=null;if(t.needConfirmation?(t.code="account-exists-with-different-credential",e=Is(t)):"FEDERATED_USER_ID_ALREADY_LINKED"==t.errorMessage?(t.code="credential-already-in-use",e=Is(t)):"EMAIL_EXISTS"==t.errorMessage?(t.code="email-already-in-use",e=Is(t)):t.errorMessage&&(e=Gu(t.errorMessage)),e)throw e;Ya(t)}function su(t,e){return e.returnIdpCredential=!0,Wu(t,Du,e)}function au(t,e){return e.returnIdpCredential=!0,Wu(t,ju,e)}function uu(t,e){return e.returnIdpCredential=!0,e.autoCreate=!1,Wu(t,Lu,e)}function cu(t){if(!t.oobCode)throw new N("invalid-action-code")}e=ka.prototype,e.zb=function(t,e){var n={idToken:t},r=[];return yt($a,(function(t,i){var o=e[i];null===o?r.push(t):i in e&&(n[i]=o)})),r.length&&(n.deleteAttribute=r),Wu(this,Au,n)},e.rb=function(t,e){return t={requestType:"PASSWORD_RESET",email:t},wt(t,e),Wu(this,Tu,t)},e.sb=function(t,e){return t={requestType:"EMAIL_SIGNIN",email:t},wt(t,e),Wu(this,wu,t)},e.qb=function(t,e){return t={requestType:"VERIFY_EMAIL",idToken:t},wt(t,e),Wu(this,Eu,t)},e.Ab=function(t,e,n){return t={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:t,newEmail:e},wt(t,n),Wu(this,Iu,t)},e.cb=function(t){return Wu(this,Uu,t)},e.jb=function(t,e){return Wu(this,Ou,{oobCode:t,newPassword:e})},e.Pa=function(t){return Wu(this,lu,{oobCode:t})},e.fb=function(t){return Wu(this,hu,{oobCode:t})};var hu={endpoint:"setAccountInfo",A:cu,Y:"email",C:!0},lu={endpoint:"resetPassword",A:cu,G:function(t){var e=t.requestType;if(!e||!t.email&&"EMAIL_SIGNIN"!=e&&"VERIFY_AND_CHANGE_EMAIL"!=e)throw new N("internal-error")},C:!0},fu={endpoint:"signupNewUser",A:function(t){if(Ha(t),!t.password)throw new N("weak-password")},G:Ya,U:!0,C:!0},pu={endpoint:"createAuthUri",C:!0},du={endpoint:"deleteAccount",M:["idToken"]},vu={endpoint:"setAccountInfo",M:["idToken","deleteProvider"],A:function(t){if("array"!=v(t.deleteProvider))throw new N("internal-error")}},gu={endpoint:"emailLinkSignin",M:["email","oobCode"],A:Ha,G:Ya,U:!0,C:!0},yu={endpoint:"emailLinkSignin",M:["idToken","email","oobCode"],A:Ha,G:Ya,U:!0},mu={endpoint:"accounts/mfaEnrollment:finalize",M:["idToken","phoneVerificationInfo"],A:tu,G:Ya,C:!0,La:!0},_u={endpoint:"accounts/mfaSignIn:finalize",M:["mfaPendingCredential","phoneVerificationInfo"],A:tu,G:Ya,C:!0,La:!0},bu={endpoint:"getAccountInfo"},wu={endpoint:"getOobConfirmationCode",M:["requestType"],A:function(t){if("EMAIL_SIGNIN"!=t.requestType)throw new N("internal-error");Ha(t)},Y:"email",C:!0},Eu={endpoint:"getOobConfirmationCode",M:["idToken","requestType"],A:function(t){if("VERIFY_EMAIL"!=t.requestType)throw new N("internal-error")},Y:"email",C:!0},Iu={endpoint:"getOobConfirmationCode",M:["idToken","newEmail","requestType"],A:function(t){if("VERIFY_AND_CHANGE_EMAIL"!=t.requestType)throw new N("internal-error")},Y:"email",C:!0},Tu={endpoint:"getOobConfirmationCode",M:["requestType"],A:function(t){if("PASSWORD_RESET"!=t.requestType)throw new N("internal-error");Ha(t)},Y:"email",C:!0},Cu={hb:!0,endpoint:"getProjectConfig",Rb:"GET"},Su={hb:!0,endpoint:"getRecaptchaParam",Rb:"GET",G:function(t){if(!t.recaptchaSiteKey)throw new N("internal-error")}},Ou={endpoint:"resetPassword",A:cu,Y:"email",C:!0},Nu={endpoint:"sendVerificationCode",M:["phoneNumber","recaptchaToken"],Y:"sessionInfo",C:!0},Au={endpoint:"setAccountInfo",M:["idToken"],A:Ka,U:!0},ku={endpoint:"setAccountInfo",M:["idToken"],A:function(t){if(Ka(t),!t.password)throw new N("weak-password")},G:Ya,U:!0},Ru={endpoint:"signupNewUser",G:Ya,U:!0,C:!0},Pu={endpoint:"accounts/mfaEnrollment:start",M:["idToken","phoneEnrollmentInfo"],A:function(t){if(!t.phone
82EnrollmentInfo)throw new N("internal-error");if(!t.phoneEnrollmentInfo.phoneNumber)throw new N("missing-phone-number");if(!t.phoneEnrollmentInfo.recaptchaToken)throw new N("missing-app-credential")},G:function(t){if(!t.phoneSessionInfo||!t.phoneSessionInfo.sessionInfo)throw new N("internal-error")},C:!0,La:!0},xu={endpoint:"accounts/mfaSignIn:start",M:["mfaPendingCredential","mfaEnrollmentId","phoneSignInInfo"],A:function(t){if(!t.phoneSignInInfo||!t.phoneSignInInfo.recaptchaToken)throw new N("missing-app-credential")},G:function(t){if(!t.phoneResponseInfo||!t.phoneResponseInfo.sessionInfo)throw new N("internal-error")},C:!0,La:!0},Du={endpoint:"verifyAssertion",A:ru,Wa:iu,G:ou,U:!0,C:!0},Lu={endpoint:"verifyAssertion",A:ru,Wa:iu,G:function(t){if(t.errorMessage&&"USER_NOT_FOUND"==t.errorMessage)throw new N("user-not-found");if(t.errorMessage)throw Gu(t.errorMessage);Ya(t)},U:!0,C:!0},ju={endpoint:"verifyAssertion",A:function(t){if(ru(t),!t.idToken)throw new N("internal-error")},Wa:iu,G:ou,U:!0},Mu={endpoint:"verifyCustomToken",A:function(t){if(!t.token)throw new N("invalid-custom-token")},G:Ya,U:!0,C:!0},Fu={endpoint:"verifyPassword",A:function(t){if(Ha(t),!t.password)throw new N("wrong-password")},G:Ya,U:!0,C:!0},Uu={endpoint:"verifyPhoneNumber",A:Xa,G:Ya,C:!0},Vu={endpoint:"verifyPhoneNumber",A:function(t){if(!t.idToken)throw new N("internal-error");Xa(t)},G:function(t){if(t.temporaryProof)throw t.code="credential-already-in-use",Is(t);Ya(t)}},qu={Eb:{USER_NOT_FOUND:"user-not-found"},endpoint:"verifyPhoneNumber",A:Xa,G:Ya,C:!0},Bu={endpoint:"accounts/mfaEnrollment:withdraw",M:["idToken","mfaEnrollmentId"],G:function(t){if(!!t[Pa]^!!t.refreshToken)throw new N("internal-error")},C:!0,La:!0};function Wu(t,e,n){if(!Ii(n,e.M))return Me(new N("internal-error"));var r,i=!!e.La,o=e.Rb||"POST";return je(n).then(e.A).then((function(){return e.U&&(n.returnSecureToken=!0),e.C&&t.b&&"undefined"===typeof n.tenantId&&(n.tenantId=t.b),Ga(t,i?t.l:t.h,e.endpoint,o,n,e.Eb,e.hb||!1)})).then((function(t){return r=t,e.Wa?e.Wa(n,r):r})).then(e.G).then((function(){if(!e.Y)return r;if(!(e.Y in r))throw new N("internal-error");return r[e.Y]}))}function Gu(t){return Hu({error:{errors:[{message:t}],code:400,message:t}})}function Hu(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 N(r[n]):null)return n;for(var i in n=t.error&&t.error.message||"",r={INVALID_CUSTOM_TOKEN:"invalid-custom-token",CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_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_
82NONCE:"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"},wt(r,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 N(r[i],e);return!e&&t&&(e=ni(t)),new N("internal-error",e)}function Ku(t){this.b=t,this.a=null,this.nb=zu(this)}function zu(t){return tc().then((function(){return new Ae((function(e,n){Xr("gapi.iframes.getContext")().open({where:document.body,url:t.b,messageHandlersFilter:Xr("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"))}),Ju.get());r.ping(i).then(i,(function(){n(Error("Network Error"))}))}))}))}))}function Qu(t,e){return t.nb.then((function(){return new Ae((function(n){t.a.send(e.type,e,n,Xr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}))}function Yu(t,e){t.nb.then((function(){t.a.register("authEvent",e,Xr("gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER"))}))}var Xu=new It(St,"https://apis.google.com/js/api.js?onload=%{onload}"),$u=new ui(3e4,6e4),Ju=new ui(5e3,15e3),Zu=null;function tc(){return Zu||(Zu=new Ae((function(t,e){function n(){ai(),Xr("gapi.load")("gapi.iframes",{callback:t,ontimeout:function(){ai(),e(Error("Network Error"))},timeout:$u.get()})}if(Xr("gapi.iframes.Iframe"))t();else if(Xr("gapi.load"))n();else{var r="__iframefcb"+Math.floor(1e6*Math.random()).toString();l[r]=function(){Xr("gapi.load")?n():e(Error("Network Error"))},r=kt(Xu,{onload:r}),je(Ea(r)).o((function(){e(Error("Network Error"))}))}})).o((function(t){throw Zu=null,t})))}function ec(t,e,n){this.i=t,this.g=e,this.h=n,this.f=null,this.a=er(this.i,"/__/auth/iframe"),Jn(this.a,"apiKey",this.g),Jn(this.a,"appName",this.h),this.b=null,this.c=[]}function nc(t,e,n,r,i){this.s=t,this.m=e,this.c=n,this.u=r,this.i=this.g=this.l=null,this.a=i,this.h=this.f=null}function rc(t){try{return r.app(t).auth().Ea()}catch(e){return[]}}function ic(t,e,n,r,i){this.u=t,this.f=e,this.b=n,this.c=r||null,this.h=i||null,this.m=this.s=this.w=null,this.g=[],this.l=this.a=null}function oc(t){var e=Sr();return Qa(t).then((function(t){t:{var n=tr(e),r=n.f;n=n.b;for(var i=0;i<t.length;i++){var o=t[i],s=n,a=r;if(0==o.indexOf("chrome-extension://")?s=tr(o).b==s&&"chrome-extension"==a:"http"!=a&&"https"!=a?s=!1:Dr.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 ws(Sr())}
82))}function sc(t){return t.l||(t.l=jr().then((function(){if(!t.s){var e=t.c,n=t.h,r=rc(t.b),i=new ec(t.u,t.f,t.b);i.f=e,i.b=n,i.c=nt(r||[]),t.s=i.toString()}t.i=new Ku(t.s),cc(t)}))),t.l}function ac(t){return t.m||(t.w=t.c?Qr(t.c,rc(t.b)):null,t.m=new ka(t.f,D(t.h),t.w)),t.m}function uc(t,e,n,r,i,o,s,a,u,c,h){return t=new nc(t,e,n,r,i),t.l=o,t.g=s,t.i=a,t.b=_t(u||null),t.f=c,t.ub(h).toString()}function cc(t){if(!t.i)throw Error("IfcHandler must be initialized!");Yu(t.i,(function(e){var n={};if(e&&e.authEvent){var r=!1;for(e=gs(e.authEvent),n=0;n<t.g.length;n++)r=t.g[n](e)||r;return n={},n.status=r?"ACK":"ERROR",je(n)}return n.status="ERROR",je(n)}))}function hc(t){var e={type:"webStorageSupport"};return sc(t).then((function(){return Qu(t.i,e)})).then((function(t){if(t&&t.length&&"undefined"!==typeof t[0].webStorageSupport)return t[0].webStorageSupport;throw Error()}))}function lc(t){if(this.a=t||r.INTERNAL.reactNative&&r.INTERNAL.reactNative.AsyncStorage,!this.a)throw new N("internal-error","The React Native compatibility library was not found.");this.type="asyncStorage"}function fc(t){this.b=t,this.a={},this.f=T(this.c,this)}ec.prototype.toString=function(){return this.f?Jn(this.a,"v",this.f):pr(this.a.a,"v"),this.b?Jn(this.a,"eid",this.b):pr(this.a.a,"eid"),this.c.length?Jn(this.a,"fw",this.c.join(",")):pr(this.a.a,"fw"),this.a.toString()},nc.prototype.ub=function(t){return this.h=t,this},nc.prototype.toString=function(){var t=er(this.s,"/__/auth/handler");if(Jn(t,"apiKey",this.m),Jn(t,"appName",this.c),Jn(t,"authType",this.u),this.a.isOAuthProvider){var e=this.a;try{var n=r.app(this.c).auth().ja()}catch(u){n=null}for(var i in e.kb=n,Jn(t,"providerId",this.a.providerId),e=this.a,n=ri(e.Fb),n)n[i]=n[i].toString();i=e.Oc,n=_t(n);for(var o=0;o<i.length;o++){var s=i[o];s in n&&delete n[s]}e.lb&&e.kb&&!n[e.lb]&&(n[e.lb]=e.kb),mt(n)||Jn(t,"customParameters",ni(n))}if("function"===typeof this.a.Nb&&(e=this.a.Nb(),e.length&&Jn(t,"scopes",e.join(","))),this.l?Jn(t,"redirectUrl",this.l):pr(t.a,"redirectUrl"),this.g?Jn(t,"eventId",this.g):pr(t.a,"eventId"),this.i?Jn(t,"v",this.i):pr(t.a,"v"),this.b)for(var a in this.b)this.b.hasOwnProperty(a)&&!Zn(t,a)&&Jn(t,a,this.b[a]);return this.h?Jn(t,"tid",this.h):pr(t.a,"tid"),this.f?Jn(t,"eid",this.f):pr(t.a,"eid"),a=rc(this.c),a.length&&Jn(t,"fw",a.join(",")),t.toString()},e=ic.prototype,e.Lb=function(t,e,n){var r=new N("popup-closed-by-user"),i=new N("web-storage-unsupported"),o=this,s=!1;return this.ka().then((function(){hc(o).then((function(n){n||(t&&Rr(t),e(i),s=!0)}))})).o((function(){})).then((function(){if(!s)return xr(t)})).then((function(){if(!s)return Un(n).then((function(){e(r)}))}))},e.Ub=function(){var t=Yr();return!ei(t)&&!si(t)},e.Qb=function(){return!1},e.Jb=function(t,e,n,r,i,o,s,a){if(!t)return Me(new N("popup-blocked"));if(s&&!ei())return this.ka().o((function(e){Rr(t),i(e)})),r(),je();this.a||(this.a=oc(ac(this)));var u=this;return this.a.then((function(){var e=u.ka().o((function(e){throw Rr(t),i(e),e}));return r(),e})).then((function(){if(ds(n),!s){var r=uc(u.u,u.f,u.b,e,n,null,o,u.c,void 0,u.h,a);Or(r,t)}})).o((function(t){throw"auth/network-request-failed"==t.code&&(u.a=null),t}))},e.Kb=function(t,e,n,r){this.a||(this.a=oc(ac(this)));var i=this;return this.a.then((function(){ds(e);var o=uc(i.u,i.f,i.b,t,e,Sr(),n,i.c,void 0,i.h,r);Or(o)})).o((function(t){throw"auth/network-request-failed"==t.code&&(i.a=null),t}))},e.ka=function(){var t=this;return sc(this).then((function(){return t.i.nb})).o((function(){throw t.a=null,new N("network-request-failed")}))},e.Xb=function(){return!0},e.Ca=function(t){this.g.push(t)},e.Qa=function(t){tt(this.g,(function(e){return e==t}))},e=lc.prototype,e.get=function(t){return je(this.a.getItem(t)).then((function(t){return t&&ii(t)}))},e.set=function(t,e){return je(this.a.setItem(t,ni(e)))},e.T=function(t){return je(this.a.removeItem(t))},e.ba=function(){},e.ha=function(){};var pc,dc=[];function vc(){var t=Vr()?self:null;if(K(dc,(function(n){n.b==t&&(e=n)})),!e){var e=new fc(t);dc.push(e)}return e}function gc(t,e,n){mt(t.a)&&t.b.addEventListener("message",t.f),"undefined"===typeof t.a[e]&&(t.a[e]=[]),t.a[e].push(n)}function yc(t){this.a=t}function mc(t){this.c=t,this.b=!1,this.a=[]}function _c(t,e,n,r){var i,o,s,a,u=n||{},c=null;if(t.b)return Me(Error("connection_unavailable"));var h=r?800:50,l="undefined"!==typeof MessageChannel?new MessageChannel:null;return new Ae((function(n,r){l?(i=Math.floor(Math.random()*Math.pow(10,20)).toString(),l.port1.start(),s=setTimeout((function(){r(Error("unsupported_event"))}),h),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),"undefined"!==typeof t.data.response?n(t.data.response):r(Error("unknown_error"))):(clearTimeout(s),clearTimeout(a),r(Error("invalid_response"))))},c={messageChannel:l,onMessage:o},t.a.push(c),l.port1.addEventListener("message",o),t.c.postMessage({eventType:e,eventId:i,data:u},[l.port2])):r(Error("connection_unavailable"))})).then((function(e){return bc(t,c),e})).o((function(e){throw bc(t,c),e}))}function bc(t,e){if(e){var n=e.messageChannel,r=e.onMessage;n&&(n.port1.removeEventListener("message",r),n.port1.close()),tt(t.a,(function(t){return t==e}))}}function wc(){if(!Cc())throw new N("web-storage-unsupported");this.c={},this.a=[],this.b=0,this.u=l.indexedDB,this.type="indexedDB",this.g=this.l=this.f=this.i=null,this.s=!1,this.h=null;var t=this;Vr()&&self?(this.l=vc(),gc(this.l,"keyChanged",(function(e,n){return kc(t).then((function(e){return 0<e.length&&K(t.a,(function(t){t(e)})),{keyProcessed:J(e,n.key)}}))})),gc(this.l,"ping",(function(){return je(["keyChanged"])}))):di().then((function(e){(t.h=e)&&(t.g=new mc(new yc(e)),_c(t.g,"ping",null,!0).then((function(e){e[0].fulfilled&&J(e[0].value,"keyChanged")&&(t.s=!0)})).o((function(){})))}))}function Ec(t){return new Ae((function(e,n){var r=t.u.deleteDatabase("firebaseLocalStorageDb");r.onsuccess=function(){e()},r.onerror=function(t){n(Error(t.target.error))}}))}function Ic(t){return new Ae((function(e,n){var r=t.u.open("firebaseLocalStorageDb",1);r.onerror=function(t){try{t.preventDefault()}catch(e){}n(Error(t.target.error))},r.onupgradeneeded=function(t){t=t.target.result;try{t.createObjectStore("firebaseLocalStorage",{keyPath:"fbase_key"})}catch(e){n(e)}},r.onsuccess=function(r){r=r.target.result,r.objectStoreNames.contains("firebaseLocalStorage")?e(r):Ec(t).then((function(){return Ic(t)})).then((function(t){e(t)})).o((function(t){n(t)}))}}))}function Tc(t){return t.m||(t.m=Ic(t)),t.m}function Cc(){try{return!!l.indexedDB}catch(Bp){return!1}}function Sc(t){return t.objectStore("firebaseLocalStorage")}function Oc(t,e){return t.transaction(["firebaseLocalStorage"],e?"readwrite":"readonly")}function Nc(t){return new Ae((function(e,n){t.onsuccess=function(t){t&&t.target?e(t.target.result):e()},t.onerror=function(t){n(t.target.error)}}))}function Ac(t,e){return t.g&&t.h&&pi()===t.h?_c(t.g,"keyChanged",{key:e},t.s).then((function(){})).o((function(){})):je()}function kc(t){return Tc(t).then((function(t){var e=Sc(Oc(t,!1));return e.getAll?Nc(e.getAll()):new Ae((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=Nr(t.c,n),t.c=n}return r}))}function Rc(t){function e(){t.f=setTimeout((function(){t.i=kc(t).then((function(e){0<e.length&&K(t.a,(function(t){t(e)}))})).then((function(){e()})).o((function(t){"STOP_EVENT"!=t.message&&e()}))}),800)}Pc(t),e()}function Pc(t){t.i&&t.i.cancel("STOP_EVENT"),t.f&&(clearTimeout(t.f),t.f=null)}function xc(t){var e=this,n=null;this.a=[],this.type="indexedDB",this.c=t,this.b=je().then((function(){if(Cc()){var t=oi(),r="__sak"+t;return pc||(pc=new wc),n=pc,n.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})).o((function(){return e.c}))}return e.c})).then((function(t){return e.type=t.type,t.ba((function(t){K(e.a,
82(function(e){e(t)}))})),t}))}function Dc(){this.a={},this.type="inMemory"}function Lc(){if(!Mc()){if("Node"==qr())throw new N("internal-error","The LocalStorage compatibility library was not found.");throw new N("web-storage-unsupported")}this.a=jc()||r.INTERNAL.node.localStorage,this.type="localStorage"}function jc(){try{var t=l.localStorage,e=oi();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(n){return null}}function Mc(){var t="Node"==qr();if(t=jc()||t&&r.INTERNAL.node&&r.INTERNAL.node.localStorage,!t)return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(e){return!1}}function Fc(){this.type="nullStorage"}function Uc(){if(!qc()){if("Node"==qr())throw new N("internal-error","The SessionStorage compatibility library was not found.");throw new N("web-storage-unsupported")}this.a=Vc()||r.INTERNAL.node.sessionStorage,this.type="sessionStorage"}function Vc(){try{var t=l.sessionStorage,e=oi();return t&&(t.setItem(e,"1"),t.removeItem(e)),t}catch(n){return null}}function qc(){var t="Node"==qr();if(t=Vc()||t&&r.INTERNAL.node&&r.INTERNAL.node.sessionStorage,!t)return!1;try{return t.setItem("__sak","1"),t.removeItem("__sak"),!0}catch(e){return!1}}function Bc(){var t={};t.Browser=Hc,t.Node=Kc,t.ReactNative=zc,t.Worker=Qc,this.a=t[qr()]}fc.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=[];K(r,(function(e){i.push(je().then((function(){return e(t.origin,t.data.data)})))})),Ve(i).then((function(r){var i=[];K(r,(function(t){i.push({fulfilled:t.Mb,value:t.value,reason:t.reason?t.reason.message:void 0})})),K(i,(function(t){for(var e in t)"undefined"===typeof t[e]&&delete t[e]})),t.ports[0].postMessage({status:"done",eventId:n,eventType:e,response:i})}))}},yc.prototype.postMessage=function(t,e){this.a.postMessage(t,e)},mc.prototype.close=function(){for(;0<this.a.length;)bc(this,this.a[0]);this.b=!0},e=wc.prototype,e.set=function(t,e){var n,r=!1,i=this;return Tc(this).then((function(e){return n=e,e=Sc(Oc(n,!0)),Nc(e.get(t))})).then((function(o){var s=Sc(Oc(n,!0));return o?(o.value=e,Nc(s.put(o))):(i.b++,r=!0,o={},o.fbase_key=t,o.value=e,Nc(s.add(o)))})).then((function(){return i.c[t]=e,Ac(i,t)})).ma((function(){r&&i.b--}))},e.get=function(t){return Tc(this).then((function(e){return Nc(Sc(Oc(e,!1)).get(t))})).then((function(t){return t&&t.value}))},e.T=function(t){var e=!1,n=this;return Tc(this).then((function(r){return e=!0,n.b++,Nc(Sc(Oc(r,!0))["delete"](t))})).then((function(){return delete n.c[t],Ac(n,t)})).ma((function(){e&&n.b--}))},e.ba=function(t){0==this.a.length&&Rc(this),this.a.push(t)},e.ha=function(t){tt(this.a,(function(e){return e==t})),0==this.a.length&&Pc(this)},e=xc.prototype,e.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.ba=function(t){this.a.push(t)},e.ha=function(t){tt(this.a,(function(e){return e==t}))},e=Dc.prototype,e.get=function(t){return je(this.a[t])},e.set=function(t,e){return this.a[t]=e,je()},e.T=function(t){return delete this.a[t],je()},e.ba=function(){},e.ha=function(){},e=Lc.prototype,e.get=function(t){var e=this;return je().then((function(){var n=e.a.getItem(t);return ii(n)}))},e.set=function(t,e){var n=this;return je().then((function(){var r=ni(e);null===r?n.T(t):n.a.setItem(t,r)}))},e.T=function(t){var e=this;return je().then((function(){e.a.removeItem(t)}))},e.ba=function(t){l.window&&wn(l.window,"storage",t)},e.ha=function(t){l.window&&Cn(l.window,"storage",t)},e=Fc.prototype,e.get=function(){return je(null)},e.set=function(){return je()},e.T=function(){return je()},e.ba=function(){},e.ha=function(){},e=Uc.prototype,e.get=function(t){var e=this;return je().then((function(){var n=e.a.getItem(t);return ii(n)}))},e.set=function(t,e){var n=this;return je().then((function(){var r=ni(e);null===r?n.T(t):n.a.setItem(t,r)}))},e.T=function(t){var e=this;return je().then((function(){e.a.removeItem(t)}))},e.ba=function(){},e.ha=function(){};var Wc,Gc,Hc={F:Lc,$a:Uc},Kc={F:Lc,$a:Uc},zc={F:lc,$a:Fc},Qc={F:Lc,$a:Fc},Yc={od:"local",NONE:"none",qd:"session"};function Xc(t){var e=new N("invalid-persistence-type"),n=new N("unsupported-persistence-type");t:{for(r in Yc)if(Yc[r]==t){var r=!0;break t}r=!1}if(!r||"string"!==typeof t)throw e;switch(qr()){case"ReactNative":if("session"===t)throw n;break;case"Node":if("none"!==t)throw n;break;case"Worker":if("session"===t||!Cc()&&"none"!==t)throw n;break;default:if(!$r()&&"none"!==t)throw n}}function $c(){var t=!(si(Yr())||!Ur()),e=ei(),n=$r();this.m=t,this.h=e,this.l=n,this.a={},Wc||(Wc=new Bc),t=Wc;try{this.g=!Cr()&&fi()||!l.indexedDB?new t.a.F:new xc(Vr()?new Dc:new t.a.F)}catch(r){this.g=new Dc,this.h=!0}try{this.i=new t.a.$a}catch(r){this.i=new Dc}this.u=new Dc,this.f=T(this.Vb,this),this.b={}}
82function Jc(){return Gc||(Gc=new $c),Gc}function Zc(t,e){switch(e){case"session":return t.i;case"none":return t.u;default:return t.g}}function th(t,e){return"firebase:"+t.name+(e?":"+e:"")}function eh(t,e,n){var r=th(e,n),i=Zc(t,e.F);return t.get(e,n).then((function(o){var s=null;try{s=ii(l.localStorage.getItem(r))}catch(a){}if(s&&!o)return l.localStorage.removeItem(r),t.set(e,s,n);s&&o&&"localStorage"!=i.type&&l.localStorage.removeItem(r)}))}function nh(t,e,n){return n=th(e,n),"local"==e.F&&(t.b[n]=null),Zc(t,e.F).T(n)}function rh(t){ih(t),t.c=setInterval((function(){for(var e in t.a){var n=l.localStorage.getItem(e),r=t.b[e];n!=r&&(t.b[e]=n,n=new hn({type:"storage",key:e,target:window,oldValue:r,newValue:n,a:!0}),t.Vb(n))}}),1e3)}function ih(t){t.c&&(clearInterval(t.c),t.c=null)}function oh(t){this.a=t,this.b=Jc()}e=$c.prototype,e.get=function(t,e){return Zc(this,t.F).get(th(t,e))},e.set=function(t,e,n){var r=th(t,n),i=this,o=Zc(this,t.F);return o.set(r,e).then((function(){return o.get(r)})).then((function(e){"local"==t.F&&(i.b[r]=e)}))},e.addListener=function(t,e,n){t=th(t,e),this.l&&(this.b[t]=l.localStorage.getItem(t)),mt(this.a)&&(Zc(this,"local").ba(this.f),this.h||(Cr()||!fi())&&l.indexedDB||!this.l||rh(this)),this.a[t]||(this.a[t]=[]),this.a[t].push(n)},e.removeListener=function(t,e,n){t=th(t,e),this.a[t]&&(tt(this.a[t],(function(t){return t==n})),0==this.a[t].length&&delete this.a[t]),mt(this.a)&&(Zc(this,"local").ha(this.f),ih(this))},e.Vb=function(t){if(t&&t.f){var e=t.a.key;if(null==e)for(var n in this.a){var r=this.b[n];"undefined"===typeof r&&(r=null);var i=l.localStorage.getItem(n);i!==r&&(this.b[n]=i,this.ib(n))}else if(0==e.indexOf("firebase:")&&this.a[e]){if("undefined"!==typeof t.a.a?Zc(this,"local").ha(this.f):ih(this),this.m)if(n=l.localStorage.getItem(e),r=t.a.newValue,r!==n)null!==r?l.localStorage.setItem(e,r):l.localStorage.removeItem(e);else if(this.b[e]===r&&"undefined"===typeof t.a.a)return;var o=this;n=function(){"undefined"===typeof t.a.a&&o.b[e]===l.localStorage.getItem(e)||(o.b[e]=l.localStorage.getItem(e),o.ib(e))},te&&ce&&10==ce&&l.localStorage.getItem(e)!==t.a.newValue&&t.a.newValue!==t.a.oldValue?setTimeout(n,10):n()}}else K(t,T(this.ib,this))},e.ib=function(t){this.a[t]&&K(this.a[t],(function(t){t()}))};var sh,ah={name:"authEvent",F:"local"};function uh(t){return t.b.get(ah,t.a).then((function(t){return gs(t)}))}function ch(){this.a=Jc()}function hh(){this.b=-1}function lh(t,e){this.b=fh,this.f=l.Uint8Array?new Uint8Array(this.b):Array(this.b),this.g=this.c=0,this.a=[],this.i=t,this.h=e,this.l=l.Int32Array?new Int32Array(64):Array(64),void 0===sh&&(sh=l.Int32Array?new Int32Array(_h):_h),this.reset()}O(lh,hh);for(var fh=64,ph=fh-1,dh=[],vh=0;vh<ph;vh++)dh[vh]=0;var gh=et(128,dh);function yh(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],u=0|t.a[3],c=0|t.a[4],h=0|t.a[5],l=0|t.a[6];for(o=0|t.a[7],e=0;64>e;e++){var f=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&i^r&a^i&a)|0;s=c&h^~c&l,o=o+((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))|0,s=s+(0|sh[e])|0,s=o+(s+(0|n[e])|0)|0,o=l,l=h,h=c,c=u+s|0,u=a,a=i,i=r,r=s+f|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]+u|0,t.a[4]=t.a[4]+c|0,t.a[5]=t.a[5]+h|0,t.a[6]=t.a[6]+l|0,t.a[7]=t.a[7]+o|0}function mh(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&&(yh(t),i=0);else{if(!g(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&&(yh(t),i=0)}}t.c=i,t.g+=n}lh.prototype.reset=function(){this.g=this.c=0,this.a=l.Int32Array?new Int32Array(this.h):nt(this.h)};var _h=[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
82734187,3204031479,3329325298];function bh(){lh.call(this,8,wh)}O(bh,lh);var wh=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];function Eh(t,e,n,r,i){this.u=t,this.i=e,this.l=n,this.m=r||null,this.s=i||null,this.h=e+":"+n,this.w=new ch,this.g=new oh(this.h),this.f=null,this.b=[],this.a=this.c=null}function Ih(t){return new N("invalid-cordova-configuration",t)}function Th(){for(var t=20,e=[];0<t;)e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(Math.floor(62*Math.random()))),t--;return e.join("")}function Ch(t){var e=new bh;mh(e,t),t=[];var n=8*e.g;56>e.c?mh(e,gh,56-e.c):mh(e,gh,e.b-(e.c-56));for(var r=63;56<=r;r--)e.f[r]=255&n,n/=256;for(yh(e),r=n=0;r<e.i;r++)for(var i=24;0<=i;i-=8)t[n++]=e.a[r]>>i&255;return fo(t)}function Sh(t,e,n,r,i){var o=Th(),s=new vs(e,r,null,o,new N("no-auth-event"),null,i),a=Xr("BuildInfo.packageName",l);if("string"!==typeof a)throw new N("invalid-cordova-configuration");var u=Xr("BuildInfo.displayName",l),c={};if(Yr().toLowerCase().match(/iphone|ipad|ipod/))c.ibi=a;else{if(!Yr().toLowerCase().match(/android/))return Me(new N("operation-not-supported-in-this-environment"));c.apn=a}u&&(c.appDisplayName=u),o=Ch(o),c.sessionId=o;var h=uc(t.u,t.i,t.l,e,n,null,r,t.m,c,t.s,i);return t.ka().then((function(){var e=t.h;return t.w.a.set(ah,s.v(),e)})).then((function(){var e=Xr("cordova.plugins.browsertab.isAvailable",l);if("function"!==typeof e)throw new N("invalid-cordova-configuration");var n=null;e((function(e){if(e){if(n=Xr("cordova.plugins.browsertab.openUrl",l),"function"!==typeof n)throw new N("invalid-cordova-configuration");n(h)}else{if(n=Xr("cordova.InAppBrowser.open",l),"function"!==typeof n)throw new N("invalid-cordova-configuration");e=Yr(),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")}}))}))}function Oh(t,e){for(var n=0;n<t.b.length;n++)try{t.b[n](e)}catch(r){}}function Nh(t){return t.f||(t.f=t.ka().then((function(){return new Ae((function(e){function n(r){return e(r),t.Qa(n),!1}t.Ca(n),kh(t)}))}))),t.f}function Ah(t){var e=null;return uh(t.g).then((function(n){return e=n,n=t.g,nh(n.b,ah,n.a)})).then((function(){return e}))}function kh(t){function e(e){r=!0,i&&i.cancel(),Ah(t).then((function(r){var i=n;if(r&&e&&e.url){var o=null;i=Do(e.url),-1!=i.indexOf("/__/auth/callback")&&(o=tr(i),o=ii(Zn(o,"firebaseError")||null),o=(o="object"===typeof o?A(o):null)?new vs(r.c,r.b,null,null,o,null,r.S()):new vs(r.c,r.b,i,r.f,null,null,r.S())),i=o||n}Oh(t,i)}))}var n=new vs("unknown",null,null,null,new N("no-auth-event")),r=!1,i=Un(500).then((function(){return Ah(t).then((function(){r||Oh(t,n)}))})),o=l.handleOpenURL;l.handleOpenURL=function(t){if(0==t.toLowerCase().indexOf(Xr("BuildInfo.packageName",l).toLowerCase()+"://")&&e({url:t}),"function"===typeof o)try{o(t)}catch(n){console.error(n)}},_s||(_s=new ys),bs(e)}function Rh(t){this.a=t,this.b=Jc()}e=Eh.prototype,e.ka=function(){return this.Ga?this.Ga:this.Ga=Mr().then((function(){if("function"!==typeof Xr("universalLinks.subscribe",l))throw Ih("cordova-universal-links-plugin-fix is not installed");if("undefined"===typeof Xr("BuildInfo.packageName",l))throw Ih("cordova-plugin-buildinfo is not installed");if("function"!==typeof Xr("cordova.plugins.browsertab.openUrl",l))throw Ih("cordova-plugin-browsertab is not installed");if("function"!==typeof Xr("cordova.InAppBrowser.open",l))throw Ih("cordova-plugin-inappbrowser is not installed")}),(function(){throw new N("cordova-not-ready")}))},e.Lb=function(t,e){return e(new N("operation-not-supported-in-this-environment")),je()},e.Jb=function(){return Me(new N("operation-not-supported-in-this-environment"))},e.Xb=function(){return!1},e.Ub=function(){return!0},e.Qb=function(){return!0},e.Kb=function(t,e,n,r){if(this.c)return Me(new N("redirect-operation-pending"));var i=this,o=l.document,s=null,a=null,u=null,c=null;return this.c=je().then((function(){return ds(e),Nh(i)})).then((function(){return Sh(i,t,e,n,r)})).then((function(){return new Ae((function(t,e){a=function(){var e=Xr("cordova.plugins.browsertab.close",l);return t(),"function"===typeof e&&e(),i.a&&"function"===typeof i.a.close&&(i.a.close(),i.a=null),!1},i.Ca(a),u=function(){s||(s=Un(2e3).then((function(){e(new N("redirect-cancelled-by-user"))})))},c=function(){ci()&&u()},o.addEventListener("resume",u,!1),Yr().toLowerCase().match(/android/)||o.addEventListener("visibilitychange",c,!1)})).o((function(t){return Ah(i).then((function(){throw t}))}))})).ma((function(){u&&o.removeEventListener("resume",u,!1),c&&o.removeEventListener("visibilitychange",c,!1),s&&s.cancel(),a&&i.Qa(a),i.c=null}))},e.Ca=function(t){this.b.push(t),Nh(this).o((function(e){"auth/invalid-cordova-configuration"===e.code&&(e=new vs("unknown",null,null,null,new N("no-auth-event")),t(e))}))},e.Qa=function(t){tt(this.b,(function(e){return e==t}))};var Ph={name:"pendingRedirect",F:"session"};function xh(t){return t.b.set(Ph,"pending",t.a)}function Dh(t){return nh(t.b,Ph,t.a)}function Lh(t){return t.b.get(Ph,t.a).then((function(t){return"pending"==t}))}function jh(t,e,n){this.i={},this.w=0,this.D=t,this.u=e,this.m=n,this.h=[],this.f=!1,this.l=T(this.s,this),this.b=new Xh,this.B=new il,this.g=new Rh(this.u+":"+this.m),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.B,this.c.linkViaPopup=this.B,this.c.reauthViaPopup=this.B,this.a=Mh(this.D,this.u,this.m,k)}function Mh(t,e,n,i){var o=r.SDK_VERSION||null;return Fr()?new Eh(t,e,n,o,i):new ic(t,e,n,o,i)}
82function Fh(t){t.f||(t.f=!0,t.a.Ca(t.l));var e=t.a;return t.a.ka().o((function(n){throw t.a==e&&t.reset(),n}))}function Uh(t){t.a.Ub()&&Fh(t).o((function(e){var n=new vs("unknown",null,null,null,new N("operation-not-supported-in-this-environment"));Hh(e)&&t.s(n)})),t.a.Qb()||$h(t.b)}function Vh(t,e){J(t.h,e)||t.h.push(e),t.f||Lh(t.g).then((function(e){e?Dh(t.g).then((function(){Fh(t).o((function(e){var n=new vs("unknown",null,null,null,new N("operation-not-supported-in-this-environment"));Hh(e)&&t.s(n)}))})):Uh(t)})).o((function(){Uh(t)}))}function qh(t,e){tt(t.h,(function(t){return t==e}))}jh.prototype.reset=function(){this.f=!1,this.a.Qa(this.l),this.a=Mh(this.D,this.u,this.m),this.i={}},jh.prototype.s=function(t){if(!t)throw new N("invalid-auth-event");if(6e5<=S()-this.w&&(this.i={},this.w=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.Cb(t.c,t.b)){(e=this.c[t.c])&&(e.h(t,r),t&&(t.f||t.b)&&(this.i[t.getUid()]=!0,this.w=S())),e=!0;break}}return $h(this.b),e};var Bh=new ui(2e3,1e4),Wh=new ui(3e4,6e4);function Gh(t,e,n,r,i,o,s){return t.a.Jb(e,n,r,(function(){t.f||(t.f=!0,t.a.Ca(t.l))}),(function(){t.reset()}),i,o,s)}function Hh(t){return!(!t||"auth/cordova-not-ready"!=t.code)}function Kh(t,e,n,r,i){var o;return xh(t.g).then((function(){return t.a.Kb(e,n,r,i).o((function(e){if(Hh(e))throw new N("operation-not-supported-in-this-environment");return o=e,Dh(t.g).then((function(){throw o}))})).then((function(){return t.a.Xb()?new Ae((function(){})):Dh(t.g).then((function(){return t.pa()})).then((function(){})).o((function(){}))}))}))}function zh(t,e,n,r,i){return t.a.Lb(r,(function(t){e.la(n,null,t,i)}),Bh.get())}jh.prototype.pa=function(){return this.b.pa()};var Qh={};function Yh(t,e,n){var r=e+":"+n;return Qh[r]||(Qh[r]=new jh(t,e,n)),Qh[r]}function Xh(){this.b=null,this.f=[],this.c=[],this.a=null,this.i=this.g=!1}function $h(t){t.g||(t.g=!0,nl(t,!1,null,null))}function Jh(t){t.g&&!t.i&&nl(t,!1,null,null)}function Zh(t,e,n){n=n.Da(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){nl(t,a,e,null)})).o((function(e){nl(t,a,null,e)}))}function tl(t,e){if(t.b=function(){return Me(e)},t.c.length)for(var n=0;n<t.c.length;n++)t.c[n](e)}function el(t,e){if(t.b=function(){return je(e)},t.f.length)for(var n=0;n<t.f.length;n++)t.f[n](e)}function nl(t,e,n,r){e?r?tl(t,r):el(t,n):el(t,{user:null}),t.f=[],t.c=[]}function rl(t){var e=new N("timeout");t.a&&t.a.cancel(),t.a=Un(Wh.get()).then((function(){t.b||(t.g=!0,nl(t,!0,null,e))}))}function il(){}function ol(t,e){var n=t.b,r=t.c;e.Da(r,n)(t.g,t.f,t.S(),t.i).then((function(t){e.la(r,t,null,n)})).o((function(t){e.la(r,null,t,n)}))}function sl(){this.Bb=!1,Object.defineProperty(this,"appVerificationDisabled",{get:function(){return this.Bb},set:function(t){this.Bb=t},enumerable:!1})}function al(t,e){this.a=e,_i(this,"verificationId",t)}function ul(t,e,n,r){return new ls(t).cb(e,n).then((function(t){return new al(t,r)}))}function cl(t){var e=bo(t);if(!(e&&e.exp&&e.auth_time&&e.iat))throw new N("internal-error","An internal error occurred. The token obtained by Firebase appears to be malformed. Please retry the operation.");bi(this,{token:t,expirationTime:li(1e3*e.exp),authTime:li(1e3*e.auth_time),issuedAtTime:li(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 hl(t,e,n){var r=e&&e[fl];if(!r)throw new N("argument-error","Internal assert: Invalid MultiFactorResolver");this.a=t,this.f=_t(e),this.g=n,this.c=new Lo(null,r),this.b=[];var i=this;K(e[ll]||[],(function(t){(t=Si(t))&&i.b.push(t)})),_i(this,"auth",this.a),_i(this,"session",this.c),_i(this,"hints",this.b)}Xh.prototype.reset=function(){this.b=null,this.a&&(this.a.cancel(),this.a=null)},Xh.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?(nl(this,!0,null,t.a),je()):e.Da(n,r)?Zh(this,t,e):Me(new N("invalid-auth-event")):(nl(this,!1,null,null),je())}else Me(new N("invalid-auth-event"))},Xh.prototype.pa=function(){var t=this;return new Ae((function(e,n){t.b?t.b().then(e,n):(t.f.push(e),t.c.push(n),rl(t))}))},il.prototype.h=function(t,e){if(t){var n=t.c,r=t.b;t.a?(e.la(t.c,null,t.a,t.b),je()):e.Da(n,r)?ol(t,e):Me(new N("invalid-auth-event"))}else Me(new N("invalid-auth-event"))},al.prototype.confirm=function(t){return t=fs(this.verificationId,t),this.a(t)};var ll="mfaInfo",fl="mfaPendingCredential";function pl(t,e,n,r){N.call(this,"multi-factor-auth-required",r,e),this.b=new hl(t,e,n),_i(this,"resolver",this.b)}function dl(t,e,n){if(t&&m(t.serverResponse)&&"auth/multi-factor-auth-required"===t.code)try{return new pl(e,t.serverResponse,n,t.message)}catch(r){}return null}function vl(){}function gl(t,e,n,r){return n.Fa().then((function(n){return n={idToken:n},"undefined"!==typeof r&&(n.displayName=r),wt(n,{phoneVerificationInfo:hs(t.a)}),Wu(e,mu,n)}))}function yl(t,e,n){return n.Fa().then((function(n){return n={mfaPendingCredential:n},wt(n,{phoneVerificationInfo:hs(t.a)}),Wu(e,_u,n)}))}function ml(t){_i(this,"factorId",t.ea),this.a=t}function _l(t){if(ml.call(this,t),this.a.ea!=ls.PROVIDER_ID)throw new N("argument-error","firebase.auth.PhoneMultiFactorAssertion requires a valid firebase.auth.PhoneAuthCredential")}function bl(t,e){for(var n in cn.call(this,t),e)this[n]=e[n]}function wl(t,e){this.a=t,this.b=[],this.c=T(this.wc,this),wn(this.a,"userReloaded",this.c);var n=[];e&&e.multiFactor&&e.multiFactor.enrolledFactors&&K(e.multiFactor.enrolledFactors,(function(t){var e=null,r={};
82if(t){t.uid&&(r[Ai]=t.uid),t.displayName&&(r[Oi]=t.displayName),t.enrollmentTime&&(r[Ni]=new Date(t.enrollmentTime).toISOString()),t.phoneNumber&&(r[ki]=t.phoneNumber);try{e=new Ri(r)}catch(i){}t=e}else t=null;t&&n.push(t)})),Il(this,n)}function El(t){var e=[];return K(t.mfaInfo||[],(function(t){(t=Si(t))&&e.push(t)})),e}function Il(t,e){t.b=e,_i(t,"enrolledFactors",e)}function Tl(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 Cl(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)}function Sl(t,e){t.stop(),t.b=Un(Cl(t,e)).then((function(){return hi()})).then((function(){return t.h()})).then((function(){Sl(t,!0)})).o((function(e){t.i(e)&&Sl(t,!1)}))}function Ol(t){this.c=t,this.b=this.a=null}function Nl(t){return t.b&&1e3*t.b.c||0}function Al(t,e){var n=e.refreshToken;t.b=_o(e[Pa]||""),t.a=n}function kl(t,e){t.b=e.b,t.a=e.a}function Rl(t,e){return Wa(t.c,e).then((function(e){return t.b=_o(e.access_token),t.a=e.refresh_token,{accessToken:t.b.toString(),refreshToken:t.a}})).o((function(e){throw"auth/user-token-expired"==e.code&&(t.a=null),e}))}function Pl(t,e){this.a=t||null,this.b=e||null,bi(this,{lastSignInTime:li(e||null),creationTime:li(t||null)})}function xl(t){return new Pl(t.a,t.b)}function Dl(t,e,n,r,i,o){bi(this,{uid:t,displayName:r||null,photoURL:i||null,email:n||null,phoneNumber:o||null,providerId:e})}function Ll(t,e,n){this.N=[],this.l=t.apiKey,this.m=t.appName,this.s=t.authDomain||null,t=r.SDK_VERSION?Qr(r.SDK_VERSION):null,this.a=new ka(this.l,D(k),t),this.b=new Ol(this.a),Wl(this,e[Pa]),Al(this.b,e),_i(this,"refreshToken",this.b.a),zl(this,n||{}),Dn.call(this),this.P=!1,this.s&&Jr()&&(this.i=Yh(this.s,this.l,this.m)),this.R=[],this.h=null,this.B=Vl(this),this.Z=T(this.Ma,this);var i=this;this.oa=null,this.za=function(t){i.va(t.g)},this.aa=null,this.W=[],this.ya=function(t){Ml(i,t.c)},this.$=null,this.O=new wl(this,n),_i(this,"multiFactor",this.O)}function jl(t,e){t.aa&&Cn(t.aa,"languageCodeChanged",t.za),(t.aa=e)&&wn(e,"languageCodeChanged",t.za)}function Ml(t,e){t.W=e,Fa(t.a,r.SDK_VERSION?Qr(r.SDK_VERSION,t.W):null)}function Fl(t,e){t.$&&Cn(t.$,"frameworkChanged",t.ya),(t.$=e)&&wn(e,"frameworkChanged",t.ya)}function Ul(t){try{return r.app(t.m).auth()}catch(e){throw new N("internal-error","No firebase.auth.Auth instance is available for the Firebase App '"+t.m+"'!")}}function Vl(t){return new Tl((function(){return t.I(!0)}),(function(t){return!(!t||"auth/network-request-failed"!=t.code)}),(function(){var e=Nl(t.b)-S()-3e5;return 0<e?e:0}))}function ql(t){t.D||t.B.b||(t.B.start(),Cn(t,"tokenChanged",t.Z),wn(t,"tokenChanged",t.Z))}function Bl(t){Cn(t,"tokenChanged",t.Z),t.B.stop()}function Wl(t,e){t.xa=e,_i(t,"_lat",e)}function Gl(t,e){tt(t.R,(function(t){return t==e}))}function Hl(t){for(var e=[],n=0;n<t.R.length;n++)e.push(t.R[n](t));return Ve(e).then((function(){return t}))}function Kl(t){t.i&&!t.P&&(t.P=!0,Vh(t.i,t))}function zl(t,e){bi(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 Pl(e.createdAt,e.lastLoginAt),providerData:[]}),t.a.b=t.tenantId}function Ql(){}function Yl(t){return je().then((function(){if(t.D)throw new N("app-deleted")}))}function Xl(t){return Y(t.providerData,(function(t){return t.providerId}))}function $l(t,e){e&&(Jl(t,e.providerId),t.providerData.push(e))}function Jl(t,e){tt(t.providerData,(function(t){return t.providerId==e}))}function Zl(t,e,n){("uid"!=e||n)&&t.hasOwnProperty(e)&&_i(t,e,n)}function tf(t,e){t!=e&&(bi(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?_i(t,"metadata",xl(e.metadata)):_i(t,"metadata",new Pl),K(e.providerData,(function(e){$l(t,e)})),kl(t.b,e.b),_i(t,"refreshToken",t.b.a),Il(t.O,e.O.b))}function ef(t){return t.I().then((function(e){var n=t.isAnonymous;return rf(t,e).then((function(){return n||Zl(t,"isAnonymous",!1),e}))}))}function nf(t,e){e[Pa]&&t.xa!=e[Pa]&&(Al(t.b,e),t.dispatchEvent(new bl("tokenChanged")),Wl(t,e[Pa]),Zl(t,"refreshToken",t.b.a))}function rf(t,e){return Wu(t.a,bu,{idToken:e}).then(T(t.Ic,t))}function of(t){return(t=t.providerUserInfo)&&t.length?Y(t,(function(t){return new Dl(t.rawId,t.providerId,t.email,t.displayName,t.photoUrl,t.phoneNumber)})):[]}function sf(t,e){return ef(t).then((function(){if(J(Xl(t),e))return Hl(t).then((function(){throw new N("provider-already-linked")}))}))}function af(t,e,n){var r=ps(e);return e=Co(e),wi({user:t,credential:r,additionalUserInfo:e,operationType:n})}function uf(t,e){return nf(t,e),t.reload().then((function(){return t}))}function cf(t,e,n,i,o){if(!Jr())return Me(new N("operation-not-supported-in-this-environment"));if(t.h&&!o)return Me(t.h);var s=To(n.providerId),a=oi(t.uid+":::"),u=null;(!ei()||Ur())&&t.s&&n.isOAuthProvider&&(u=uc(t.s,t.l,t.m,e,n,null,a,r.SDK_VERSION||null,null,null,t.tenantId));var c=Pr(u,s&&s.ta,s&&s.sa);return i=i().then((function(){if(lf(t),!o)return t.I().then((function(){}))}
82)).then((function(){return Gh(t.i,c,e,n,a,!!u,t.tenantId)})).then((function(){return new Ae((function(n,r){t.la(e,null,new N("cancelled-popup-request"),t.g||null),t.f=n,t.w=r,t.g=a,t.c=zh(t.i,t,e,c,a)}))})).then((function(t){return c&&Rr(c),t?wi(t):null})).o((function(t){throw c&&Rr(c),t})),ff(t,i,o)}function hf(t,e,n,r,i){if(!Jr())return Me(new N("operation-not-supported-in-this-environment"));if(t.h&&!i)return Me(t.h);var o=null,s=oi(t.uid+":::");return r=r().then((function(){if(lf(t),!i)return t.I().then((function(){}))})).then((function(){return t.fa=s,Hl(t)})).then((function(e){return t.ga&&(e=t.ga,e=e.b.set(mf,t.v(),e.a)),e})).then((function(){return Kh(t.i,e,n,s,t.tenantId)})).o((function(e){if(o=e,t.ga)return _f(t.ga);throw o})).then((function(){if(o)throw o})),ff(t,r,i)}function lf(t){if(!t.i||!t.P){if(t.i&&!t.P)throw new N("internal-error");throw new N("auth-domain-config-required")}}function ff(t,e,n){var r=pf(t,e,n);return t.N.push(r),r.ma((function(){Z(t.N,r)})),r.o((function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=dl(e.v(),Ul(t),T(t.hc,t))),n||e}))}function pf(t,e,n){return t.h&&!n?(e.cancel(),Me(t.h)):e.o((function(e){throw!e||"auth/user-disabled"!=e.code&&"auth/user-token-expired"!=e.code||(t.h||t.dispatchEvent(new bl("userInvalidated")),t.h=e),e}))}function df(t){if(!t.apiKey)return null;var e={apiKey:t.apiKey,authDomain:t.authDomain,appName:t.appName},n={};if(!t.stsTokenManager||!t.stsTokenManager.accessToken)return null;n[Pa]=t.stsTokenManager.accessToken,n.refreshToken=t.stsTokenManager.refreshToken||null;var r=new Ll(e,n,t);return t.providerData&&K(t.providerData,(function(t){t&&$l(r,wi(t))})),t.redirectEventId&&(r.fa=t.redirectEventId),r}function vf(t,e,n,r){var i=new Ll(t,e);return n&&(i.ga=n),r&&Ml(i,r),i.reload().then((function(){return i}))}function gf(t,e,n,r){var i=t.b,o={};return o[Pa]=i.b&&i.b.toString(),o.refreshToken=i.a,e=new Ll(e||{apiKey:t.l,authDomain:t.s,appName:t.m},o),n&&(e.ga=n),r&&Ml(e,r),tf(e,t),e}function yf(t){this.a=t,this.b=Jc()}hl.prototype.Pc=function(t){var e=this;return t.ob(this.a.b,this.c).then((function(t){var n=_t(e.f);return delete n[ll],delete n[fl],wt(n,t),e.g(n)}))},O(pl,N),vl.prototype.ob=function(t,e,n){return e.type==jo?gl(this,t,e,n):yl(this,t,e)},O(ml,vl),O(_l,ml),O(bl,cn),e=wl.prototype,e.wc=function(t){Il(this,El(t.ed))},e.Ob=function(){return this.a.I().then((function(t){return new Lo(t,null)}))},e.dc=function(t,e){var n=this,r=this.a.a;return this.Ob().then((function(n){return t.ob(r,n,e)})).then((function(t){return nf(n.a,t),n.a.reload()}))},e.$c=function(t){var e=this,n="string"===typeof t?t:t.uid,r=this.a.a;return this.a.I().then((function(t){return Wu(r,Bu,{idToken:t,mfaEnrollmentId:n})})).then((function(t){var r=Q(e.b,(function(t){return t.uid!=n}));return Il(e,r),nf(e.a,t),e.a.reload().o((function(t){if("auth/user-token-expired"!=t.code)throw t}))}))},e.v=function(){return{multiFactor:{enrolledFactors:Y(this.b,(function(t){return t.v()}))}}},Tl.prototype.start=function(){this.a=this.c,Sl(this,!0)},Tl.prototype.stop=function(){this.b&&(this.b.cancel(),this.b=null)},Ol.prototype.v=function(){return{apiKey:this.c.c,refreshToken:this.a,accessToken:this.b&&this.b.toString(),expirationTime:Nl(this)}},Ol.prototype.getToken=function(t){return t=!!t,this.b&&!this.a?Me(new N("user-token-expired")):t||!this.b||S()>Nl(this)-3e4?this.a?Rl(this,{grant_type:"refresh_token",refresh_token:this.a}):je(null):je({accessToken:this.b.toString(),refreshToken:this.a})},Pl.prototype.v=function(){return{lastLoginAt:this.b,createdAt:this.a}},O(Ll,Dn),Ll.prototype.va=function(t){this.oa=t,Ma(this.a,t)},Ll.prototype.ja=function(){return this.oa},Ll.prototype.Ea=function(){return nt(this.W)},Ll.prototype.Ma=function(){this.B.b&&(this.B.stop(),this.B.start())},_i(Ll.prototype,"providerId","firebase"),e=Ll.prototype,e.reload=function(){var t=this;return ff(this,Yl(this).then((function(){return ef(t).then((function(){return Hl(t)})).then(Ql)})))},e.mc=function(t){return this.I(t).then((function(t){return new cl(t)}))},e.I=function(t){var e=this;return ff(this,Yl(this).then((function(){return e.b.getToken(t)})).then((function(t){if(!t)throw new N("internal-error");return t.accessToken!=e.xa&&(Wl(e,t.accessToken),e.dispatchEvent(new bl("tokenChanged"))),Zl(e,"refreshToken",t.refreshToken),t.accessToken})))},e.Ic=function(t){if(t=t.users,!t||!t.length)throw new N("internal-error");t=t[0],zl(this,{uid:t.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=of(t),n=0;n<e.length;n++)$l(this,e[n]);Zl(this,"isAnonymous",!(this.email&&t.passwordHash)&&!(this.providerData&&this.providerData.length)),this.dispatchEvent(new bl("userReloaded",{ed:t}))},e.Jc=function(t){return yi("firebase.User.prototype.reauthenticateAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.reauthenticateWithCredential instead."),this.pb(t)}
82,e.pb=function(t){var e=this,n=null;return ff(this,t.c(this.a,this.uid).then((function(t){return nf(e,t),n=af(e,t,"reauthenticate"),e.h=null,e.reload()})).then((function(){return n})),!0)},e.Ac=function(t){return yi("firebase.User.prototype.linkAndRetrieveDataWithCredential is deprecated. Please use firebase.User.prototype.linkWithCredential instead."),this.mb(t)},e.mb=function(t){var e=this,n=null;return ff(this,sf(this,t.providerId).then((function(){return e.I()})).then((function(n){return t.b(e.a,n)})).then((function(t){return n=af(e,t,"link"),uf(e,t)})).then((function(){return n})))},e.Bc=function(t,e){var n=this;return ff(this,sf(this,"phone").then((function(){return ul(Ul(n),t,e,T(n.mb,n))})))},e.Kc=function(t,e){var n=this;return ff(this,je().then((function(){return ul(Ul(n),t,e,T(n.pb,n))})),!0)},e.xb=function(t){var e=this;return ff(this,this.I().then((function(n){return e.a.xb(n,t)})).then((function(t){return nf(e,t),e.reload()})))},e.cd=function(t){var e=this;return ff(this,this.I().then((function(n){return t.b(e.a,n)})).then((function(t){return nf(e,t),e.reload()})))},e.yb=function(t){var e=this;return ff(this,this.I().then((function(n){return e.a.yb(n,t)})).then((function(t){return nf(e,t),e.reload()})))},e.zb=function(t){if(void 0===t.displayName&&void 0===t.photoURL)return Yl(this);var e=this;return ff(this,this.I().then((function(n){return e.a.zb(n,{displayName:t.displayName,photoUrl:t.photoURL})})).then((function(t){return nf(e,t),Zl(e,"displayName",t.displayName||null),Zl(e,"photoURL",t.photoUrl||null),K(e.providerData,(function(t){"password"===t.providerId&&(_i(t,"displayName",e.displayName),_i(t,"photoURL",e.photoURL))})),Hl(e)})).then(Ql))},e.ad=function(t){var e=this;return ff(this,ef(this).then((function(n){return J(Xl(e),t)?nu(e.a,n,[t]).then((function(t){var n={};return K(t.providerUserInfo||[],(function(t){n[t.providerId]=!0})),K(Xl(e),(function(t){n[t]||Jl(e,t)})),n[ls.PROVIDER_ID]||_i(e,"phoneNumber",null),Hl(e)})):Hl(e).then((function(){throw new N("no-such-provider")}))})))},e.delete=function(){var t=this;return ff(this,this.I().then((function(e){return Wu(t.a,du,{idToken:e})})).then((function(){t.dispatchEvent(new bl("userDeleted"))}))).then((function(){for(var e=0;e<t.N.length;e++)t.N[e].cancel("app-deleted");jl(t,null),Fl(t,null),t.N=[],t.D=!0,Bl(t),_i(t,"refreshToken",null),t.i&&qh(t.i,t)}))},e.Cb=function(t,e){return!!("linkViaPopup"==t&&(this.g||null)==e&&this.f||"reauthViaPopup"==t&&(this.g||null)==e&&this.f||"linkViaRedirect"==t&&(this.fa||null)==e||"reauthViaRedirect"==t&&(this.fa||null)==e)},e.la=function(t,e,n,r){"linkViaPopup"!=t&&"reauthViaPopup"!=t||r!=(this.g||null)||(n&&this.w?this.w(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.w)},e.Da=function(t,e){return"linkViaPopup"==t&&e==(this.g||null)?T(this.Hb,this):"reauthViaPopup"==t&&e==(this.g||null)?T(this.Ib,this):"linkViaRedirect"==t&&(this.fa||null)==e?T(this.Hb,this):"reauthViaRedirect"==t&&(this.fa||null)==e?T(this.Ib,this):null},e.Cc=function(t){var e=this;return cf(this,"linkViaPopup",t,(function(){return sf(e,t.providerId).then((function(){return Hl(e)}))}),!1)},e.Lc=function(t){return cf(this,"reauthViaPopup",t,(function(){return je()}),!0)},e.Dc=function(t){var e=this;return hf(this,"linkViaRedirect",t,(function(){return sf(e,t.providerId)}),!1)},e.Mc=function(t){return hf(this,"reauthViaRedirect",t,(function(){return je()}),!0)},e.Hb=function(t,e,n,r){var i=this;this.c&&(this.c.cancel(),this.c=null);var o=null;return n=this.I().then((function(n){return au(i.a,{requestUri:t,postBody:r,sessionId:e,idToken:n})})).then((function(t){return o=af(i,t,"link"),uf(i,t)})).then((function(){return o})),ff(this,n)},e.Ib=function(t,e,n,r){var i=this;this.c&&(this.c.cancel(),this.c=null);var o=null,s=je().then((function(){return Uo(uu(i.a,{requestUri:t,sessionId:e,postBody:r,tenantId:n}),i.uid)})).then((function(t){return o=af(i,t,"reauthenticate"),nf(i,t),i.h=null,i.reload()})).then((function(){return o}));return ff(this,s,!0)},e.qb=function(t){var e=this,n=null;return ff(this,this.I().then((function(e){return n=e,"undefined"===typeof t||mt(t)?{}:lo(new eo(t))})).then((function(t){return e.a.qb(n,t)})).then((function(t){if(e.email!=t)return e.reload()})).then((function(){})))},e.Ab=function(t,e){var n=this,r=null;return ff(this,this.I().then((function(t){return r=t,"undefined"===typeof e||mt(e)?{}:lo(new eo(e))})).then((function(e){return n.a.Ab(r,t,e)})).then((function(t){if(n.email!=t)return n.reload()})).then((function(){})))},e.hc=function(t){var e=null,n=this;return t=Uo(je(t),n.uid).then((function(t){return e=af(n,t,"reauthenticate"),nf(n,t),n.h=null,n.reload()})).then((function(){return e})),ff(this,t,!0)},e.toJSON=function(){return this.v()},e.v=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.s,stsTokenManager:this.b.v(),redirectEventId:this.fa||null};return this.metadata&&wt(t,this.metadata.v()),K(this.providerData,(function(e){t.providerData.push(Ei(e))})),wt(t,this.O.v()),t};var mf={name:"redirectUser",F:"session"};function _f(t){return nh(t.b,mf,t.a)}function bf(t,e){return t.b.get(mf,t.a).then((function(t){return t&&e&&(t.authDomain=e),df(t||{})}))}function wf(t){this.a=t,this.b=Jc(),this.c=null,this.f=If(this),this.b.addListener(Cf("local"),this.a,T(this.g,this))}function Ef(t,e){var n,r=[];for(n in Yc)Yc[n]!==e&&r.push(nh(t.b,Cf(Yc[n]),t.a));return r.push(nh(t.b,Tf,t.a)),Ue(r)}function If(t){var e=Cf("local"),n=Cf("session"),r=Cf("none");return eh(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(Tf,t.a).then((function(t){return t?Cf(t):e}))}))}))})).then((function(e){return t.c=e,Ef(t,e.F)})).o((function(){t.c||(t.c=e)}))}wf.prototype.g=function(){var t=this,e=Cf("local");kf(this,(function(){return je().then((function(){return t.c&&"local"!=t.c.F?t.b.get(e,t.a):null})).then((function(n){if(n)return Ef(t,"local").then((function(){t.c=e}))}))}))};var Tf={name:"persistence",F:"session"};function Cf(t){return{name:"authUser",F:t}}function Sf(t){return kf(t,(function(){return t.b.set(Tf,t.c.F,t.a)}))}function Of(t,e){return kf(t,(function(){return t.b.set(t.c,e.v(),t.a)}))}function Nf(t){return kf(t,(function(){return nh(t.b,t.c,t.a)}))}function Af(t,e){return kf(t,(function(){return t.b.get(t.c,t.a).then((function(t){return t&&e&&(t.authDomain=e),df(t||{})}))}))}function kf(t,e){return t.f=t.f.then(e,e),t.f}function Rf(t){if(this.l=!1,_i(this,"settings",new sl),_i(this,"app",t),!Gf(this).options||!Gf(this).options.apiKey)throw new N("invalid-api-key");t=r.SDK_VERSION?Qr(r.SDK_VERSION):null,this.b=new ka(Gf(this).options&&Gf(this).options.apiKey,D(k),t),this.P=[],this.m=[],this.O=[],this.$b=r.INTERNAL.createSubscribe(T(this.xc,this)),this.W=void 0,this.ac=r.INTERNAL.createSubscribe(T(this.yc,this)),Uf(this,null),this.i=new wf(Gf(this).options.apiKey+":"+Gf(this).name),this.B=new yf(Gf(this).options.apiKey+":"+Gf(this).name),this.Z=Yf(this,qf(this)),this.h=Yf(this,Bf(this)),this.aa=!1,this.oa=T(this.Xc,this),this.Ma=T(this.ca,this),this.xa=T(this.jc,this),this.ya=T(this.uc,this),this.za=T(this.vc,this),this.a=null,jf(this),this.INTERNAL={},this.INTERNAL["delete"]=T(this.delete,this),this.INTERNAL.logFramework=T(this.Ec,this),this.s=0,Dn.call(this),Df(this),this.N=[]}function Pf(t){cn.call(this,"languageCodeChanged"),this.g=t}function xf(t){cn.call(this,"frameworkChanged"),this.c=t}function Df(t){Object.defineProperty(t,"lc",{get:function(){return this.ja()},set:function(t){this.va(t)},enumerable:!1}),t.$=null,Object.defineProperty(t,"ti",{get:function(){return this.S()},set:function(t){this.ub(t)},enumerable:!1}),t.R=null}function Lf(t){return t.Zb||Me(new N("auth-domain-config-required"))}function jf(t){var e=Gf(t).options.authDomain,n=Gf(t).options.apiKey;e&&Jr()&&(t.Zb=t.Z.then((function(){if(!t.l){if(t.a=Yh(e,n,Gf(t).name),Vh(t.a,t),Hf(t)&&Kl(Hf(t)),t.D){Kl(t.D);var r=t.D;r.va(t.ja()),jl(r,t),r=t.D,Ml(r,t.N),Fl(r,t),t.D=null}return t.a}})))}function Mf(t){if(!Jr())return Me(new N("operation-not-supported-in-this-environment"));var e=Lf(t).then((function(){return t.a.pa()})).then((function(t){return t?wi(t):null}));return Yf(t,e)}function Ff(t,e){var n={};return n.apiKey=Gf(t).options.apiKey,n.authDomain=Gf(t).options.authDomain,n.appName=Gf(t).name,t.Z.then((function(){return vf(n,e,t.B,t.Ea())})).then((function(e){return Hf(t)&&e.uid==Hf(t).uid?(tf(Hf(t),e),t.ca(e)):(Uf(t,e),Kl(e),t.ca(e))})).then((function(){zf(t)}))}function Uf(t,e){Hf(t)&&(Gl(Hf(t),t.Ma),Cn(Hf(t),"tokenChanged",t.xa),Cn(Hf(t),"userDeleted",t.ya),
82Cn(Hf(t),"userInvalidated",t.za),Bl(Hf(t))),e&&(e.R.push(t.Ma),wn(e,"tokenChanged",t.xa),wn(e,"userDeleted",t.ya),wn(e,"userInvalidated",t.za),0<t.s&&ql(e)),_i(t,"currentUser",e),e&&(e.va(t.ja()),jl(e,t),Ml(e,t.N),Fl(e,t))}function Vf(t){var e=bf(t.B,Gf(t).options.authDomain).then((function(e){return(t.D=e)&&(e.ga=t.B),_f(t.B)}));return Yf(t,e)}function qf(t){var e=Gf(t).options.authDomain,n=Vf(t).then((function(){return Af(t.i,e)})).then((function(e){return e?(e.ga=t.B,t.D&&(t.D.fa||null)==(e.fa||null)?e:e.reload().then((function(){return Of(t.i,e).then((function(){return e}))})).o((function(n){return"auth/network-request-failed"==n.code?e:Nf(t.i)}))):null})).then((function(e){Uf(t,e||null)}));return Yf(t,n)}function Bf(t){return t.Z.then((function(){return Mf(t)})).o((function(){})).then((function(){if(!t.l)return t.oa()})).o((function(){})).then((function(){if(!t.l){t.aa=!0;var e=t.i;e.b.addListener(Cf("local"),e.a,t.oa)}}))}function Wf(t,e){var n=null,r=null;return Yf(t,e.then((function(e){return n=ps(e),r=Co(e),Ff(t,e)}),(function(e){var n=null;throw e&&"auth/multi-factor-auth-required"===e.code&&(n=dl(e.v(),t,T(t.ic,t))),n||e})).then((function(){return wi({user:Hf(t),credential:n,additionalUserInfo:r,operationType:"signIn"})})))}function Gf(t){return t.app}function Hf(t){return t.currentUser}function Kf(t){return Hf(t)&&Hf(t)._lat||null}function zf(t){if(t.aa){for(var e=0;e<t.m.length;e++)t.m[e]&&t.m[e](Kf(t));if(t.W!==t.getUid()&&t.O.length)for(t.W=t.getUid(),e=0;e<t.O.length;e++)t.O[e]&&t.O[e](Kf(t))}}function Qf(t,e){t.O.push(e),Yf(t,t.h.then((function(){!t.l&&J(t.O,e)&&t.W!==t.getUid()&&(t.W=t.getUid(),e(Kf(t)))})))}function Yf(t,e){return t.P.push(e),e.ma((function(){Z(t.P,e)})),e}function Xf(){}function $f(){this.a={},this.b=1e12}wf.prototype.tb=function(t){var e=null,n=this;return Xc(t),kf(this,(function(){return t!=n.c.F?n.b.get(n.c,n.a).then((function(r){return e=r,Ef(n,t)})).then((function(){if(n.c=Cf(t),e)return n.b.set(n.c,e,n.a)})):je()}))},O(Rf,Dn),O(Pf,cn),O(xf,cn),e=Rf.prototype,e.tb=function(t){return t=this.i.tb(t),Yf(this,t)},e.va=function(t){this.$===t||this.l||(this.$=t,Ma(this.b,this.$),this.dispatchEvent(new Pf(this.ja())))},e.ja=function(){return this.$},e.dd=function(){var t=l.navigator;this.va(t&&(t.languages&&t.languages[0]||t.language||t.userLanguage)||null)},e.Ec=function(t){this.N.push(t),Fa(this.b,r.SDK_VERSION?Qr(r.SDK_VERSION,this.N):null),this.dispatchEvent(new xf(this.N))},e.Ea=function(){return nt(this.N)},e.ub=function(t){this.R===t||this.l||(this.R=t,this.b.b=this.R)},e.S=function(){return this.R},e.toJSON=function(){return{apiKey:Gf(this).options.apiKey,authDomain:Gf(this).options.authDomain,appName:Gf(this).name,currentUser:Hf(this)&&Hf(this).v()}},e.Cb=function(t,e){switch(t){case"unknown":case"signInViaRedirect":return!0;case"signInViaPopup":return this.g==e&&!!this.f;default:return!1}},e.la=function(t,e,n,r){"signInViaPopup"==t&&this.g==r&&(n&&this.w?this.w(n):e&&!n&&this.f&&this.f(e),this.c&&(this.c.cancel(),this.c=null),delete this.f,delete this.w)},e.Da=function(t,e){return"signInViaRedirect"==t||"signInViaPopup"==t&&this.g==e&&this.f?T(this.gc,this):null},e.gc=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.Z.then((function(){return Wf(i,su(i.b,o))}))},e.Vc=function(t){if(!Jr())return Me(new N("operation-not-supported-in-this-environment"));var e=this,n=To(t.providerId),i=oi(),o=null;(!ei()||Ur())&&Gf(this).options.authDomain&&t.isOAuthProvider&&(o=uc(Gf(this).options.authDomain,Gf(this).options.apiKey,Gf(this).name,"signInViaPopup",t,null,i,r.SDK_VERSION||null,null,null,this.S()));var s=Pr(o,n&&n.ta,n&&n.sa);return n=Lf(this).then((function(n){return Gh(n,s,"signInViaPopup",t,i,!!o,e.S())})).then((function(){return new Ae((function(t,n){e.la("signInViaPopup",null,new N("cancelled-popup-request"),e.g),e.f=t,e.w=n,e.g=i,e.c=zh(e.a,e,"signInViaPopup",s,i)}))})).then((function(t){return s&&Rr(s),t?wi(t):null})).o((function(t){throw s&&Rr(s),t})),Yf(this,n)},e.Wc=function(t){if(!Jr())return Me(new N("operation-not-supported-in-this-environment"));var e=this,n=Lf(this).then((function(){return Sf(e.i)})).then((function(){return Kh(e.a,"signInViaRedirect",t,void 0,e.S())}));return Yf(this,n)},e.pa=function(){var t=this;return Mf(this).then((function(e){return t.a&&Jh(t.a.b),e})).o((function(e){throw t.a&&Jh(t.a.b),e}))},e.bd=function(t){if(!t)return Me(new N("null-user"));if(this.R!=t.tenantId)return Me(new N("tenant-id-mismatch"));var e=this,n={};n.apiKey=Gf(this).options.apiKey,n.authDomain=Gf(this).options.authDomain,n.appName=Gf(this).name;var r=gf(t,n,e.B,e.Ea());return Yf(this,this.h.then((function(){if(Gf(e).options.apiKey!=t.l)return r.reload()})).then((function(){return Hf(e)&&t.uid==Hf(e).uid?(tf(Hf(e),t),e.ca(t)):(Uf(e,r),Kl(r),e.ca(r))})).then((function(){zf(e)})))},e.wb=function(){var t=this,e=this.h.then((function(){return t.a&&Jh(t.a.b),Hf(t)?(Uf(t,null),Nf(t.i).then((function(){zf(t)}))):je()}));return Yf(this,e)},e.Xc=function(){var t=this;return Af(this.i,Gf(this).options.authDomain).then((function(e){if(!t.l){var n;if(n=Hf(t)&&e){n=Hf(t).uid;var r=e.uid;n=void 0!==n&&null!==n&&""!==n&&void 0!==r&&null!==r&&""!==r&&n==r}if(n)return tf(Hf(t),e),Hf(t).I();(Hf(t)||e)&&(Uf(t,e),e&&(Kl(e),e.ga=t.B),t.a&&Vh(t.a,t),zf(t))}}))},e.ca=function(t){return Of(this.i,t)},e.jc=function(){zf(this),this.ca(Hf(this))},e.uc=function(){this.wb()},e.vc=function(){this.wb()},e.ic=function(t){var e=this;return this.h.then((function(){return Wf(e,je(t))}))},e.xc=function(t){var e=this;this.addAuthTokenListener((function(){t.next(Hf(e))}))},e.yc=function(t){var e=this;Qf(this,(function(){t.next(Hf(e))}))},e.Gc=function(t,e,n){var r=this;return this.aa&&Promise.resolve().then((function(){"function"===typeof t?t(Hf(r)):"function"===typeof t.next&&t.next(Hf(r))})),this.$b(t,e,n)},e.Fc=function(t,e,n){var r=this;return this.aa&&Promise.resolve().then((function(){r.W=r.getUid(),"function"===typeof t?t(Hf(r)):"function"===typeof t.next&&t.next(Hf(r))})),this.ac(t,e,n)},e.kc=function(t){var e=this,n=this.h.then((function(){return Hf(e)?Hf(e).I(t).then((function(t){return{accessToken:t}})):null}));return Yf(this,n)},e.Rc=function(t){var e=this;return this.h.then((function(){return Wf(e,Wu(e.b,Mu,{token:t}))})).then((function(t){var n=t.user;return Zl(n,"isAnonymous",!1),e.ca(n),t}))},e.Sc=function(t,e){var n=this;return this.h.then((function(){return Wf(n,Wu(n.b,Fu,{email:t,password:e}))}))},e.cc=function(t,e){var n=this;return this.h.then((function(){return Wf(n,Wu(n.b,fu,{email:t,password:e}))}))},e.Ya=function(t){var e=this;return this.h.then((function(){return Wf(e,t.ia(e.b))}))},e.Qc=function(t){return yi("firebase.auth.Auth.prototype.signInAndRetrieveDataWithCredential is deprecated. Please use firebase.auth.Auth.prototype.signInWithCredential instead."),this.Ya(t)},e.vb=function(){var t=this;return this.h.then((function(){var e=Hf(t);if(e&&e.isAnonymous){var n=wi({providerId:null,isNewUser:!1});return wi({user:e,credential:null,additionalUserInfo:n,operationType:"signIn"})}return Wf(t,t.b.vb()).then((function(e){var n=e.user;return Zl(n,"isAnonymous",!0),t.ca(n),e}))}))},e.getUid=function(){return Hf(this)&&Hf(this).uid||null},e.bc=function(t){this.addAuthTokenListener(t),this.s++,0<this.s&&Hf(this)&&ql(Hf(this))},e.Nc=function(t){var e=this;K(this.m,(function(n){n==t&&e.s--})),0>this.s&&(this.s=0),0==this.s&&Hf(this)&&Bl(Hf(this)),this.removeAuthTokenListener(t)},e.addAuthTokenListener=function(t){var e=this;this.m.push(t),Yf(this,this.h.then((function(){e.l||J(e.m,t)&&t(Kf(e))})))},e.removeAuthTokenListener=function(t){tt(this.m,(function(e){return e==t}))},e.delete=function(){this.l=!0;for(var t=0;t<this.P.length;t++)this.P[t].cancel("app-deleted");return this.P=[],this.i&&(t=this.i,t.b.removeListener(Cf("local"),t.a,this.oa)),this.a&&(qh(this.a,this),Jh(this.a.b)),Promise.resolve()},e.fc=function(t){return Yf(this,za(this.b,t))},e.zc=function(t){return!!as(t)},e.sb=function(t,e){var n=this;return Yf(this,je().then((function(){var t=new eo(e);if(!t.c)throw new N("argument-error",io+" must be true when sending sign in link to email");return lo(t)})).then((function(e){return n.b.sb(t,e)})).then((function(){})))},e.fd=function(t){return this.Pa(t).then((function(t){return t.data.email}))},e.jb=function(t,e){return Yf(this,this.b.jb(t,e).then((function(){})))},e.Pa=function(t){return Yf(this,this.b.Pa(t).then((function(t){return new Pi(t)})))},e.fb=function(t){return Yf(this,this.b.fb(t).then((function(){})))},e.rb=function(t,e){var n=this;return Yf(this,je().then((function(){return"undefined"===typeof e||mt(e)?{}:lo(new eo(e))})).then((function(e){return n.b.rb(t,e)})).then((function(){})))},e.Uc=function(t,e){return Yf(this,ul(this,t,e,T(this.Ya,this)))},e.Tc=function(t,e){var n=this;return Yf(this,je().then((function(){var r=e||Sr(),i=ss(t,r);if(r=as(r),!r)throw new N("argument-error","Invalid email link!");if(r.tenantId!==n.S())throw new N("tenant-id-mismatch");return n.Ya(i)})))},Xf.prototype.render=function(){},Xf.prototype.reset=function(){},Xf.prototype.getResponse=function(){},Xf.prototype.execute=function(){};var Jf=null;function Zf(t,e){return(e=tp(e))&&t.a[e]||null}function tp(t){return(t="undefined"===typeof t?1e12:t)?t.toString():null}function ep(t,e){this.g=!1,this.c=e,this.a=this.b=null,this.h="invisible"!==this.c.size,this.f=pe(t);var n=this;this.i=function(){n.execute()},this.h?this.execute():wn(this.f,"click",this.i)}function np(t){if(t.g)throw Error("reCAPTCHA mock was already deleted!")}function rp(){}function ip(){}$f.prototype.render=function(t,e){return this.a[this.b.toString()]=new ep(t,e),this.b++},$f.prototype.reset=function(t){var e=Zf(this,t);t=tp(t),e&&t&&(e.delete(),delete this.a[t])},$f.prototype.getResponse=function(t){return(t=Zf(this,t))?t.getResponse():null},$f.prototype.execute=function(t){(t=Zf(this,t))&&t.execute()},ep.prototype.getResponse=function(){return np(this),this.b},ep.prototype.execute=function(){np(this);var t=this;this.a||(this.a=setTimeout((function(){t.b=Wr();var e=t.c.callback,n=t.c["expired-callback"];if(e)try{e(t.b)}catch(r){}t.a=setTimeout((function(){if(t.a=null,t.b=null,n)try{n()}catch(r){}t.h&&t.execute()}),6e4)}),500))},ep.prototype.delete=function(){np(this),this.g=!0,clearTimeout(this.a),this.a=null,Cn(this.f,"click",this.i)},_i(rp,"FACTOR_ID","phone"),ip.prototype.g=function(){return Jf||(Jf=new $f),je(Jf)},ip.prototype.c=function(){};var op=null;function sp(){this.b=l.grecaptcha?1/0:0,this.f=null,this.a="__rcb"+Math.floor(1e6*Math.random()).toString()}var ap=new It(St,"https://www.google.com/recaptcha/api.js?onload=%{onload}&render=explicit&hl=%{hl}"),up=new ui(3e4,6e4);sp.prototype.g=function(t){var e=this;return new Ae((function(n,r){var i=setTimeout((function(){r(new N("network-request-failed"))}),up.get());if(!l.grecaptcha||t!==e.f&&!e.b){l[e.a]=function(){if(l.grecaptcha){e.f=t;var o=l.grecaptcha.render;
82l.grecaptcha.render=function(t,n){return t=o(t,n),e.b++,t},clearTimeout(i),n(l.grecaptcha)}else clearTimeout(i),r(new N("internal-error"));delete l[e.a]};var o=kt(ap,{onload:e.a,hl:t||""});je(Ea(o)).o((function(){clearTimeout(i),r(new N("internal-error","Unable to load external reCAPTCHA dependencies!"))}))}else clearTimeout(i),n(l.grecaptcha)}))},sp.prototype.c=function(){this.b--};var cp=null;function hp(t,e,n,r,i,o,s){if(_i(this,"type","recaptcha"),this.c=this.f=null,this.D=!1,this.u=e,this.g=null,s?(op||(op=new ip),s=op):(cp||(cp=new sp),s=cp),this.m=s,this.a=n||{theme:"light",type:"image"},this.h=[],this.a[pp])throw new N("argument-error","sitekey should not be provided for reCAPTCHA as one is automatically provisioned for the current project.");if(this.i="invisible"===this.a[dp],!l.document)throw new N("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment with DOM support.");if(!pe(e)||!this.i&&pe(e).hasChildNodes())throw new N("argument-error","reCAPTCHA container is either not found or already contains inner elements!");this.s=new ka(t,o||null,i||null),this.w=r||function(){return null};var a=this;this.l=[];var u=this.a[lp];this.a[lp]=function(t){if(vp(a,t),"function"===typeof u)u(t);else if("string"===typeof u){var e=Xr(u,l);"function"===typeof e&&e(t)}};var c=this.a[fp];this.a[fp]=function(){if(vp(a,null),"function"===typeof c)c();else if("string"===typeof c){var t=Xr(c,l);"function"===typeof t&&t()}}}var lp="callback",fp="expired-callback",pp="sitekey",dp="size";function vp(t,e){for(var n=0;n<t.l.length;n++)try{t.l[n](e)}catch(r){}}function gp(t,e){tt(t.l,(function(t){return t==e}))}function yp(t,e){return t.h.push(e),e.ma((function(){Z(t.h,e)})),e}function mp(t){if(t.D)throw new N("internal-error","RecaptchaVerifier instance has been destroyed.")}function _p(t,e,n){var i=!1;try{this.b=n||r.app()}catch(a){throw new N("argument-error","No firebase.app.App instance is currently initialized.")}if(!this.b.options||!this.b.options.apiKey)throw new N("invalid-api-key");n=this.b.options.apiKey;var o=this,s=null;try{s=this.b.auth().Ea()}catch(a){}try{i=this.b.auth().settings.appVerificationDisabledForTesting}catch(a){}s=r.SDK_VERSION?Qr(r.SDK_VERSION,s):null,hp.call(this,n,t,e,(function(){try{var t=o.b.auth().ja()}catch(e){t=null}return t}),s,D(k),i)}function bp(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 N("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>=wp.length)throw new N("internal-error","Argument validator received an unsupported number of arguments.");n=wp[i],r=(r?"":n+" argument ")+(e.name?'"'+e.name+'" ':"")+"must be "+e.J+".";break t}r=null}}if(r)throw new N("argument-error",t+" failed: "+r)}e=hp.prototype,e.Ga=function(){var t=this;return this.f?this.f:this.f=yp(this,je().then((function(){if(Zr()&&!Vr())return jr();throw new N("operation-not-supported-in-this-environment","RecaptchaVerifier is only supported in a browser HTTP/HTTPS environment.")})).then((function(){return t.m.g(t.w())})).then((function(e){return t.g=e,Wu(t.s,Su,{})})).then((function(e){t.a[pp]=e.recaptchaSiteKey})).o((function(e){throw t.f=null,e})))},e.render=function(){mp(this);var t=this;return yp(this,this.Ga().then((function(){if(null===t.c){var e=t.u;if(!t.i){var n=pe(e);e=me("DIV"),n.appendChild(e)}t.c=t.g.render(e,t.a)}return t.c})))},e.verify=function(){mp(this);var t=this;return yp(this,this.render().then((function(e){return new Ae((function(n){var r=t.g.getResponse(e);if(r)n(r);else{var i=function(e){e&&(gp(t,i),n(e))};t.l.push(i),t.i&&t.g.execute(t.c)}}))})))},e.reset=function(){mp(this),null!==this.c&&this.g.reset(this.c)},e.clear=function(){mp(this),this.D=!0,this.m.c();for(var t=0;t<this.h.length;t++)this.h[t].cancel("RecaptchaVerifier instance has been destroyed.");if(!this.i){t=pe(this.u);for(var e;e=t.firstChild;)t.removeChild(e)}},O(_p,hp);var wp="First Second Third Fourth Fifth Sixth Seventh Eighth Ninth".split(" ");function Ep(t,e){return{name:t||"",J:"a valid string",optional:!!e,K:function(t){return"string"===typeof t}}}function Ip(t,e){return{name:t||"",J:"a boolean",optional:!!e,K:function(t){return"boolean"===typeof t}}}function Tp(t,e){return{name:t||"",J:"a valid object",optional:!!e,K:m}}function Cp(t,e){return{name:t||"",J:"a function",optional:!!e,K:function(t){return"function"===typeof t}}}function Sp(t,e){return{name:t||"",J:"null",optional:!!e,K:function(t){return null===t}}}function Op(){return{name:"",J:"an HTML element",optional:!1,K:function(t){return!!(t&&t instanceof Element)}}}function Np(){return{name:"auth",J:"an instance of Firebase Auth",optional:!0,K:function(t){return!!(t&&t instanceof Rf)}}}function Ap(){return{name:"app",J:"an instance of Firebase App",optional:!0,K:function(t){return!!(t&&t instanceof r.app.App)}}}function kp(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.ia||!n)}}}function Rp(){return{name:"multiFactorAssertion",J:"a valid multiFactorAssertion",optional:!1,K:function(t){return!!t&&!!t.ob}}}function Pp(){return{name:"authProvider",J:"a valid Auth provider",optional:!1,K:function(t){return!!(t&&t.providerId&&t.hasOwnProperty&&t.hasOwnProperty("isOAuthProvider"))}}}function xp(t,e){return m(t)&&"string"===typeof t.type&&t.type===e&&"function"===typeof t.Fa}function Dp(t){return m(t)&&"string"===typeof t.uid}function Lp(){return{name:"applicationVerifier",J:"an implementation of firebase.auth.ApplicationVerifier",optional:!1,K:function(t){return!(!t||"string"!==typeof t.type||"function"!==typeof t.verify)}}}function jp(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 Mp(t,e){for(var n in e){var r=e[n].name;t[r]=Vp(r,t[n],e[n].j)}}function Fp(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]}
82),n),set:C((function(t,e,n,r){bp(t,[n],[r],!0),this[e]=r}),r,n,e[n].gb),enumerable:!0})}}function Up(t,e,n,r){t[e]=Vp(e,n,r)}function Vp(t,e,n){function r(){var t=Array.prototype.slice.call(arguments);return bp(o,n,t),e.apply(this,t)}if(!n)return e;var i,o=qp(t);for(i in e)r[i]=e[i];for(i in e.prototype)r.prototype[i]=e.prototype[i];return r}function qp(t){return t=t.split("."),t[t.length-1]}Mp(Rf.prototype,{fb:{name:"applyActionCode",j:[Ep("code")]},Pa:{name:"checkActionCode",j:[Ep("code")]},jb:{name:"confirmPasswordReset",j:[Ep("code"),Ep("newPassword")]},cc:{name:"createUserWithEmailAndPassword",j:[Ep("email"),Ep("password")]},fc:{name:"fetchSignInMethodsForEmail",j:[Ep("email")]},pa:{name:"getRedirectResult",j:[]},zc:{name:"isSignInWithEmailLink",j:[Ep("emailLink")]},Fc:{name:"onAuthStateChanged",j:[jp(Tp(),Cp(),"nextOrObserver"),Cp("opt_error",!0),Cp("opt_completed",!0)]},Gc:{name:"onIdTokenChanged",j:[jp(Tp(),Cp(),"nextOrObserver"),Cp("opt_error",!0),Cp("opt_completed",!0)]},rb:{name:"sendPasswordResetEmail",j:[Ep("email"),jp(Tp("opt_actionCodeSettings",!0),Sp(null,!0),"opt_actionCodeSettings",!0)]},sb:{name:"sendSignInLinkToEmail",j:[Ep("email"),Tp("actionCodeSettings")]},tb:{name:"setPersistence",j:[Ep("persistence")]},Qc:{name:"signInAndRetrieveDataWithCredential",j:[kp()]},vb:{name:"signInAnonymously",j:[]},Ya:{name:"signInWithCredential",j:[kp()]},Rc:{name:"signInWithCustomToken",j:[Ep("token")]},Sc:{name:"signInWithEmailAndPassword",j:[Ep("email"),Ep("password")]},Tc:{name:"signInWithEmailLink",j:[Ep("email"),Ep("emailLink",!0)]},Uc:{name:"signInWithPhoneNumber",j:[Ep("phoneNumber"),Lp()]},Vc:{name:"signInWithPopup",j:[Pp()]},Wc:{name:"signInWithRedirect",j:[Pp()]},bd:{name:"updateCurrentUser",j:[jp(function(t){return{name:"user",J:"an instance of Firebase User",optional:!!t,K:function(t){return!!(t&&t instanceof Ll)}}}(),Sp(),"user")]},wb:{name:"signOut",j:[]},toJSON:{name:"toJSON",j:[Ep(null,!0)]},dd:{name:"useDeviceLanguage",j:[]},fd:{name:"verifyPasswordResetCode",j:[Ep("code")]}}),Fp(Rf.prototype,{lc:{name:"languageCode",gb:jp(Ep(),Sp(),"languageCode")},ti:{name:"tenantId",gb:jp(Ep(),Sp(),"tenantId")}}),Rf.Persistence=Yc,Rf.Persistence.LOCAL="local",Rf.Persistence.SESSION="session",Rf.Persistence.NONE="none",Mp(Ll.prototype,{delete:{name:"delete",j:[]},mc:{name:"getIdTokenResult",j:[Ip("opt_forceRefresh",!0)]},I:{name:"getIdToken",j:[Ip("opt_forceRefresh",!0)]},Ac:{name:"linkAndRetrieveDataWithCredential",j:[kp()]},mb:{name:"linkWithCredential",j:[kp()]},Bc:{name:"linkWithPhoneNumber",j:[Ep("phoneNumber"),Lp()]},Cc:{name:"linkWithPopup",j:[Pp()]},Dc:{name:"linkWithRedirect",j:[Pp()]},Jc:{name:"reauthenticateAndRetrieveDataWithCredential",j:[kp()]},pb:{name:"reauthenticateWithCredential",j:[kp()]},Kc:{name:"reauthenticateWithPhoneNumber",j:[Ep("phoneNumber"),Lp()]},Lc:{name:"reauthenticateWithPopup",j:[Pp()]},Mc:{name:"reauthenticateWithRedirect",j:[Pp()]},reload:{name:"reload",j:[]},qb:{name:"sendEmailVerification",j:[jp(Tp("opt_actionCodeSettings",!0),Sp(null,!0),"opt_actionCodeSettings",!0)]},toJSON:{name:"toJSON",j:[Ep(null,!0)]},ad:{name:"unlink",j:[Ep("provider")]},xb:{name:"updateEmail",j:[Ep("email")]},yb:{name:"updatePassword",j:[Ep("password")]},cd:{name:"updatePhoneNumber",j:[kp("phone")]},zb:{name:"updateProfile",j:[Tp("profile")]},Ab:{name:"verifyBeforeUpdateEmail",j:[Ep("email"),jp(Tp("opt_actionCodeSettings",!0),Sp(null,!0),"opt_actionCodeSettings",!0)]}}),Mp($f.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Mp(Xf.prototype,{execute:{name:"execute"},render:{name:"render"},reset:{name:"reset"},getResponse:{name:"getResponse"}}),Mp(Ae.prototype,{ma:{name:"finally"},o:{name:"catch"},then:{name:"then"}}),Fp(sl.prototype,{appVerificationDisabled:{name:"appVerificationDisabledForTesting",gb:Ip("appVerificationDisabledForTesting")}}),Mp(al.prototype,{confirm:{name:"confirm",j:[Ep("verificationCode")]}}),Up(Fo,"fromJSON",(function(t){t="string"===typeof t?JSON.parse(t):t;for(var e,n=[Ho,is,cs,Bo],r=0;r<n.length;r++)if(e=n[r](t))return e;return null}),[jp(Ep(),Tp(),"json")]),Up(os,"credential",(function(t,e){return new rs(t,e)}),[Ep("email"),Ep("password")]),Mp(rs.prototype,{v:{name:"toJSON",j:[Ep(null,!0)]}}),Mp(Yo.prototype,{Aa:{name:"addScope",j:[Ep("scope")]},Ia:{name:"setCustomParameters",j:[Tp("customOAuthParameters")]}}),Up(Yo,"credential",Xo,[jp(Ep(),Tp(),"token")]),Up(os,"credentialWithLink",
82ss,[Ep("email"),Ep("emailLink")]),Mp($o.prototype,{Aa:{name:"addScope",j:[Ep("scope")]},Ia:{name:"setCustomParameters",j:[Tp("customOAuthParameters")]}}),Up($o,"credential",Jo,[jp(Ep(),Tp(),"token")]),Mp(Zo.prototype,{Aa:{name:"addScope",j:[Ep("scope")]},Ia:{name:"setCustomParameters",j:[Tp("customOAuthParameters")]}}),Up(Zo,"credential",ts,[jp(Ep(),jp(Tp(),Sp()),"idToken"),jp(Ep(),Sp(),"accessToken",!0)]),Mp(es.prototype,{Ia:{name:"setCustomParameters",j:[Tp("customOAuthParameters")]}}),Up(es,"credential",ns,[jp(Ep(),Tp(),"token"),Ep("secret",!0)]),Mp(Qo.prototype,{Aa:{name:"addScope",j:[Ep("scope")]},credential:{name:"credential",j:[jp(Ep(),jp(Tp(),Sp()),"optionsOrIdToken"),jp(Ep(),Sp(),"accessToken",!0)]},Ia:{name:"setCustomParameters",j:[Tp("customOAuthParameters")]}}),Mp(Wo.prototype,{v:{name:"toJSON",j:[Ep(null,!0)]}}),Mp(Vo.prototype,{v:{name:"toJSON",j:[Ep(null,!0)]}}),Up(ls,"credential",fs,[Ep("verificationId"),Ep("verificationCode")]),Mp(ls.prototype,{cb:{name:"verifyPhoneNumber",j:[jp(Ep(),function(t,e){return{name:t||"phoneInfoOptions",J:"valid phone info options",optional:!!e,K:function(t){return!!t&&(t.session&&t.phoneNumber?xp(t.session,jo)&&"string"===typeof t.phoneNumber:t.session&&t.multiFactorHint?xp(t.session,Mo)&&Dp(t.multiFactorHint):t.session&&t.multiFactorUid?xp(t.session,Mo)&&"string"===typeof t.multiFactorUid:!!t.phoneNumber&&"string"===typeof t.phoneNumber)}}}(),"phoneInfoOptions"),Lp()]}}),Mp(us.prototype,{v:{name:"toJSON",j:[Ep(null,!0)]}}),Mp(N.prototype,{toJSON:{name:"toJSON",j:[Ep(null,!0)]}}),Mp(Es.prototype,{toJSON:{name:"toJSON",j:[Ep(null,!0)]}}),Mp(ws.prototype,{toJSON:{name:"toJSON",j:[Ep(null,!0)]}}),Mp(pl.prototype,{toJSON:{name:"toJSON",j:[Ep(null,!0)]}}),Mp(hl.prototype,{Pc:{name:"resolveSignIn",j:[Rp()]}}),Mp(wl.prototype,{Ob:{name:"getSession",j:[]},dc:{name:"enroll",j:[Rp(),Ep("displayName",!0)]},$c:{name:"unenroll",j:[jp({name:"multiFactorInfo",J:"a valid multiFactorInfo",optional:!1,K:Dp},Ep(),"multiFactorInfoIdentifier")]}}),Mp(_p.prototype,{clear:{name:"clear",j:[]},render:{name:"render",j:[]},verify:{name:"verify",j:[]}}),Up(Ki,"parseLink",to,[Ep("link")]),Up(rp,"assertion",(function(t){return new _l(t)}),[kp("phone")]),function(){if("undefined"===typeof 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:Di,PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:xi,VERIFY_AND_CHANGE_EMAIL:Li,VERIFY_EMAIL:"VERIFY_EMAIL"}},Auth:Rf,AuthCredential:Fo,Error:N};Up(t,"EmailAuthProvider",os,[]),Up(t,"FacebookAuthProvider",Yo,[]),Up(t,"GithubAuthProvider",$o,[]),Up(t,"GoogleAuthProvider",Zo,[]),Up(t,"TwitterAuthProvider",es,[]),Up(t,"OAuthProvider",Qo,[Ep("providerId")]),Up(t,"SAMLAuthProvider",zo,[Ep("providerId")]),Up(t,"PhoneAuthProvider",ls,[Np()]),Up(t,"RecaptchaVerifier",_p,[jp(Ep(),Op(),"recaptchaContainer"),Tp("recaptchaParameters",!0),Ap()]),Up(t,"ActionCodeURL",Ki,[]),Up(t,"PhoneMultiFactorGenerator",rp,[]),r.INTERNAL.registerComponent({name:"auth",instanceFactory:function(t){return t=t.getProvider("app").getImmediate(),new Rf(t)},multipleInstances:!1,serviceProps:t,instantiationMode:"LAZY",type:"PUBLIC"}),r.INTERNAL.registerComponent({name:"auth-internal",instanceFactory:function(t){return t=t.getProvider("auth").getImmediate(),{getUid:T(t.getUid,t),getToken:T(t.kc,t),addAuthTokenListener:T(t.bc,t),removeAuthTokenListener:T(t.Nc,t)}},multipleInstances:!1,instantiationMode:"LAZY",type:"PRIVATE"}),r.registerVersion("@firebase/auth","0.14.9"),r.INTERNAL.extendNamespace({User:Ll})}()}).apply("undefined"!==typeof t?t:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})}).call(this,n("c8ba"))},"2cf4":function(t,e,n){var r,i,o,s,a=n("da84"),u=n("2ba4"),c=n("0366"),h=n("1626"),l=n("1a2d"),f=n("d039"),p=n("1be4"),d=n("f36a"),v=n("cc12"),g=n("d6d6"),y=n("1cdc"),m=n("605d"),_=a.setImmediate,b=a.clearImmediate,w=a.process,E=a.Dispatch,I=a.Function,T=a.MessageChannel,C=a.String,S=0,O={},N="onreadystatechange";try{r=a.location}catch(x){}var A=function(t){if(l(O,t)){var e=O[t];delete O[t],e()}},k=function(t){return function(){A(t)}},R=function(t){A(t.data)},P=function(t){a.postMessage(C(t),r.protocol+"//"+r.host)};_&&b||(_=function(t){g(arguments.length,1);
82var e=h(t)?t:I(t),n=d(arguments,1);return O[++S]=function(){u(e,void 0,n)},i(S),S},b=function(t){delete O[t]},m?i=function(t){w.nextTick(k(t))}:E&&E.now?i=function(t){E.now(k(t))}:T&&!y?(o=new T,s=o.port2,o.port1.onmessage=R,i=c(s.postMessage,s)):a.addEventListener&&h(a.postMessage)&&!a.importScripts&&r&&"file:"!==r.protocol&&!f(P)?(i=P,a.addEventListener("message",R,!1)):i=N in v("script")?function(t){p.appendChild(v("script"))[N]=function(){p.removeChild(this),A(t)}}:function(t){setTimeout(k(t),0)}),t.exports={set:_,clear:b}},"2d00":function(t,e,n){var r,i,o=n("da84"),s=n("342f"),a=o.process,u=o.Deno,c=a&&a.versions||u&&u.version,h=c&&c.v8;h&&(r=h.split("."),i=r[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&s&&(r=s.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/),r&&(i=+r[1]))),t.exports=i},"2e66":function(t,e,n){"use strict";n.r(e),n.d(e,"registerStorage",(function(){return De}));var r=n("c23d"),i=n.n(r),o=n("9ab4"),s=n("4be4"),a="firebasestorage.googleapis.com",u="storageBucket",c=12e4,h=6e5,l=function(){function t(t,e){this.code_=p(t),this.message_="Firebase Storage: "+e,this.serverResponse_=null,this.name_="FirebaseError"}return t.prototype.codeProp=function(){return this.code},t.prototype.codeEquals=function(t){return p(t)===this.codeProp()},t.prototype.serverResponseProp=function(){return this.serverResponse_},t.prototype.setServerResponseProp=function(t){this.serverResponse_=t},Object.defineProperty(t.prototype,"name",{get:function(){return this.name_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"code",{get:function(){return this.code_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this.serverResponse_?this.message_+"\n"+this.serverResponse_:this.message_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"serverResponse",{get:function(){return this.serverResponse_},enumerable:!1,configurable:!0}),t}(),f={UNKNOWN:"unknown",OBJECT_NOT_FOUND:"object-not-found",BUCKET_NOT_FOUND:"bucket-not-found",PROJECT_NOT_FOUND:"project-not-found",QUOTA_EXCEEDED:"quota-exceeded",UNAUTHENTICATED:"unauthenticated",UNAUTHORIZED:"unauthorized",RETRY_LIMIT_EXCEEDED:"retry-limit-exceeded",INVALID_CHECKSUM:"invalid-checksum",CANCELED:"canceled",INVALID_EVENT_NAME:"invalid-event-name",INVALID_URL:"invalid-url",INVALID_DEFAULT_BUCKET:"invalid-default-bucket",NO_DEFAULT_BUCKET:"no-default-bucket",CANNOT_SLICE_BLOB:"cannot-slice-blob",SERVER_FILE_WRONG_SIZE:"server-file-wrong-size",NO_DOWNLOAD_URL:"no-download-url",INVALID_ARGUMENT:"invalid-argument",INVALID_ARGUMENT_COUNT:"invalid-argument-count",APP_DELETED:"app-deleted",INVALID_ROOT_OPERATION:"invalid-root-operation",INVALID_FORMAT:"invalid-format",INTERNAL_ERROR:"internal-error"};function p(t){return"storage/"+t}function d(){var t="An unknown error occurred, please check the error payload for server response.";return new l(f.UNKNOWN,t)}function v(t){return new l(f.OBJECT_NOT_FOUND,"Object '"+t+"' does not exist.")}function g(t){return new l(f.QUOTA_EXCEEDED,"Quota for bucket '"+t+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function y(){var t="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new l(f.UNAUTHENTICATED,t)}function m(t){return new l(f.UNAUTHORIZED,"User does not have permission to access '"+t+"'.")}function _(){return new l(f.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function b(){return new l(f.CANCELED,"User canceled the upload/download.")}function w(t){return new l(f.INVALID_URL,"Invalid URL '"+t+"'.")}function E(t){return new l(f.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function I(){return new l(f.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function T(){return new l(f.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.")}function C(){return new l(f.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function S(t,e,n){return new l(f.INVALID_ARGUMENT,"Invalid argument in `"+e+"` at index "+t+": "+n)}function O(t,e,n,r){var i,o;return t===e?(i=t,o=1===t?"argument":"arguments"):(i="between "+t+" and "+e,o="arguments"),new l(f.INVALID_ARGUMENT_COUNT,"Invalid argument count in `"+n+"`: Expected "+i+" "+o+", received "+r+".")}function N(){return new l(f.APP_DELETED,"The Firebase app was deleted.")}function A(t){return new l(f.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function k(t,e){return new l(f.INVALID_FORMAT,"String does not match format '"+t+"': "+e)}function R(t){throw new l(f.INTERNAL_ERROR,"Internal error: "+t)} 83/** 84 * @license 85 * Copyright 2017 Google LLC 86 * 87 * Licensed under the Apache License, Version 2.0 (the "License");
88 * you may not use this file except in compliance with the License. 89 * You may obtain a copy of the License at 90 * 91 * http://www.apache.org/licenses/LICENSE-2.0 92 * 93 * Unless required by applicable law or agreed to in writing, software 94 * distributed under the License is distributed on an "AS IS" BASIS, 95 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 96 * See the License for the specific language governing permissions and 97 * limitations under the License. 98 */var P={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};function x(t){switch(t){case P.RAW:case P.BASE64:case P.BASE64URL:case P.DATA_URL:return;default:throw"Expected one of the event types: ["+P.RAW+", "+P.BASE64+", "+P.BASE64URL+", "+P.DATA_URL+"]."}}var D=function(){function t(t,e){this.data=t,this.contentType=e||null}return t}();function L(t,e){switch(t){case P.RAW:return new D(j(e));case P.BASE64:case P.BASE64URL:return new D(F(t,e));case P.DATA_URL:return new D(V(e),q(e))}throw d()}function j(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r<=127)e.push(r);else if(r<=2047)e.push(192|r>>6,128|63&r);else if(55296===(64512&r)){var i=n<t.length-1&&56320===(64512&t.charCodeAt(n+1));if(i){var o=r,s=t.charCodeAt(++n);r=65536|(1023&o)<<10|1023&s,e.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r)}else e.push(239,191,189)}else 56320===(64512&r)?e.push(239,191,189):e.push(224|r>>12,128|r>>6&63,128|63&r)}return new Uint8Array(e)}function M(t){var e;try{e=decodeURIComponent(t)}catch(n){throw k(P.DATA_URL,"Malformed data URL.")}return j(e)}function F(t,e){switch(t){case P.BASE64:var n=-1!==e.indexOf("-"),r=-1!==e.indexOf("_");if(n||r){var i=n?"-":"_";throw k(t,"Invalid character '"+i+"' found: is it base64url encoded?")}break;case P.BASE64URL:var o=-1!==e.indexOf("+"),s=-1!==e.indexOf("/");if(o||s){i=o?"+":"/";throw k(t,"Invalid character '"+i+"' found: is it base64 encoded?")}e=e.replace(/-/g,"+").replace(/_/g,"/");break}var a;try{a=atob(e)}catch(h){throw k(t,"Invalid character found")}for(var u=new Uint8Array(a.length),c=0;c<a.length;c++)u[c]=a.charCodeAt(c);return u}var U=function(){function t(t){this.base64=!1,this.contentType=null;var e=t.match(/^data:([^,]+)?,/);if(null===e)throw k(P.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");var n=e[1]||null;null!=n&&(this.base64=B(n,";base64"),this.contentType=this.base64?n.substring(0,n.length-";base64".length):n),this.rest=t.substring(t.indexOf(",")+1)}return t}();function V(t){var e=new U(t);return e.base64?F(P.BASE64,e.rest):M(e.rest)}function q(t){var e=new U(t);return e.contentType}function B(t,e){var n=t.length>=e.length;return!!n&&t.substring(t.length-e.length)===e} 99/** 100 * @license 101 * Copyright 2017 Google LLC 102 * 103 * Licensed under the Apache License, Version 2.0 (the "License"); 104 * you may not use this file except in compliance with the License. 105 * You may obtain a copy of the License at 106 * 107 * http://www.apache.org/licenses/LICENSE-2.0 108 * 109 * Unless required by applicable law or agreed to in writing, software 110 * distributed under the License is distributed on an "AS IS" BASIS, 111 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 112 * See the License for the specific language governing permissions and 113 * limitations under the License. 114 */var W,G={STATE_CHANGED:"state_changed"},H={RUNNING:"running",PAUSING:"pausing",PAUSED:"paused",SUCCESS:"success",CANCELING:"canceling",CANCELED:"canceled",ERROR:"error"},K={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function z(t){switch(t){case H.RUNNING:case H.PAUSING:case H.CANCELING:return K.RUNNING;case H.PAUSED:return K.PAUSED;case H.SUCCESS:return K.SUCCESS;case H.CANCELED:return K.CANCELED;case H.ERROR:return K.ERROR;default:return K.ERROR}} 115/** 116 * @license 117 * Copyright 2017 Google LLC 118 * 119 * Licensed under the Apache License, Version 2.0 (the "License"); 120 * you may not use this file except in compliance with the License. 121 * You may obtain a copy of the License at 122 * 123 * http://www.apache.org/licenses/LICENSE-2.0 124 * 125 * Unless required by applicable law or agreed to in writing, softw
125are 126 * distributed under the License is distributed on an "AS IS" BASIS, 127 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 128 * See the License for the specific language governing permissions and 129 * limitations under the License. 130 */function Q(t){return null!=t}function Y(t){return void 0!==t}function X(t){return"function"===typeof t}function $(t){return"object"===typeof t}function J(t){return $(t)&&null!==t}function Z(t){return $(t)&&!Array.isArray(t)}function tt(t){return"string"===typeof t||t instanceof String}function et(t){return nt(t)&&Number.isInteger(t)}function nt(t){return"number"===typeof t||t instanceof Number}function rt(t){return it()&&t instanceof Blob}function it(){return"undefined"!==typeof Blob} 131/** 132 * @license 133 * Copyright 2017 Google LLC 134 * 135 * Licensed under the Apache License, Version 2.0 (the "License"); 136 * you may not use this file except in compliance with the License. 137 * You may obtain a copy of the License at 138 * 139 * http://www.apache.org/licenses/LICENSE-2.0 140 * 141 * Unless required by applicable law or agreed to in writing, software 142 * distributed under the License is distributed on an "AS IS" BASIS, 143 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 144 * See the License for the specific language governing permissions and 145 * limitations under the License. 146 */(function(t){t[t["NO_ERROR"]=0]="NO_ERROR",t[t["NETWORK_ERROR"]=1]="NETWORK_ERROR",t[t["ABORT"]=2]="ABORT"})(W||(W={})); 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 */ 163var ot=function(){function t(){var t=this;this.sent_=!1,this.xhr_=new XMLHttpRequest,this.errorCode_=W.NO_ERROR,this.sendPromise_=new Promise((function(e){t.xhr_.addEventListener("abort",(function(){t.errorCode_=W.ABORT,e(t)})),t.xhr_.addEventListener("error",(function(){t.errorCode_=W.NETWORK_ERROR,e(t)})),t.xhr_.addEventListener("load",(function(){e(t)}))}))}return t.prototype.send=function(t,e,n,r){if(this.sent_)throw R("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(e,t,!0),Q(r))for(var i in r)r.hasOwnProperty(i)&&this.xhr_.setRequestHeader(i,r[i].toString());return Q(n)?this.xhr_.send(n):this.xhr_.send(),this.sendPromise_},t.prototype.getErrorCode=function(){if(!this.sent_)throw R("cannot .getErrorCode() before sending");return this.errorCode_},t.prototype.getStatus=function(){if(!this.sent_)throw R("cannot .getStatus() before sending");try{return this.xhr_.status}catch(t){return-1}},t.prototype.getResponseText=function(){if(!this.sent_)throw R("cannot .getResponseText() before sending");return this.xhr_.responseText},t.prototype.abort=function(){this.xhr_.abort()},t.prototype.getResponseHeader=function(t){return this.xhr_.getResponseHeader(t)},t.prototype.addUploadProgressListener=function(t){Q(this.xhr_.upload)&&this.xhr_.upload.addEventListener("progress",t)},t.prototype.removeUploadProgressListener=function(t){Q(this.xhr_.upload)&&this.xhr_.upload.removeEventListener("progress",t)},t}(),st=function(){function t(){}return t.prototype.createXhrIo=function(){return new ot},t}(); 164/** 165 * @license 166 * Copyright 2017 Google LLC 167 * 168 * Licensed under the Apache License, Version 2.0 (the "License"); 169 * you may not use this file except in compliance with the License. 170 * You may obtain a copy of the License at 171 * 172 * http://www.apache.org/licenses/LICENSE-2.0 173 * 174 * Unless required by applicable law or agreed to in writing, software 175 * distributed under the License is distributed on an "AS IS" BASIS, 176 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 177 * See the License for the specific language governing permissions and 178 * limitations under the License. 179 */ 180/** 181 * @license 182 * Copyright 2017 Google LLC 183 * 184 * Licensed under the Apache License, Version 2.0 (the "License");
185 * you may not use this file except in compliance with the License. 186 * You may obtain a copy of the License at 187 * 188 * http://www.apache.org/licenses/LICENSE-2.0 189 * 190 * Unless required by applicable law or agreed to in writing, software 191 * distributed under the License is distributed on an "AS IS" BASIS, 192 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 193 * See the License for the specific language governing permissions and 194 * limitations under the License. 195 */ 196function at(){return"undefined"!==typeof BlobBuilder?BlobBuilder:"undefined"!==typeof WebKitBlobBuilder?WebKitBlobBuilder:void 0}function ut(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=at();if(void 0!==n){for(var r=new n,i=0;i<t.length;i++)r.append(t[i]);return r.getBlob()}if(it())return new Blob(t);throw Error("This browser doesn't seem to support creating Blobs")}function ct(t,e,n){return t.webkitSlice?t.webkitSlice(e,n):t.mozSlice?t.mozSlice(e,n):t.slice?t.slice(e,n):null} 197/** 198 * @license 199 * Copyright 2017 Google LLC 200 * 201 * Licensed under the Apache License, Version 2.0 (the "License"); 202 * you may not use this file except in compliance with the License. 203 * You may obtain a copy of the License at 204 * 205 * http://www.apache.org/licenses/LICENSE-2.0 206 * 207 * Unless required by applicable law or agreed to in writing, software 208 * distributed under the License is distributed on an "AS IS" BASIS, 209 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 210 * See the License for the specific language governing permissions and 211 * limitations under the License. 212 */var ht=function(){function t(t,e){var n=0,r="";rt(t)?(this.data_=t,n=t.size,r=t.type):t instanceof ArrayBuffer?(e?this.data_=new Uint8Array(t):(this.data_=new Uint8Array(t.byteLength),this.data_.set(new Uint8Array(t))),n=this.data_.length):t instanceof Uint8Array&&(e?this.data_=t:(this.data_=new Uint8Array(t.length),this.data_.set(t)),n=t.length),this.size_=n,this.type_=r}return t.prototype.size=function(){return this.size_},t.prototype.type=function(){return this.type_},t.prototype.slice=function(e,n){if(rt(this.data_)){var r=this.data_,i=ct(r,e,n);return null===i?null:new t(i)}var o=new Uint8Array(this.data_.buffer,e,n-e);return new t(o,!0)},t.getBlob=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(it()){var r=e.map((function(e){return e instanceof t?e.data_:e}));return new t(ut.apply(null,r))}var i=e.map((function(t){return tt(t)?L(P.RAW,t).data:t.data_})),o=0;i.forEach((function(t){o+=t.byteLength}));var s=new Uint8Array(o),a=0;return i.forEach((function(t){for(var e=0;e<t.length;e++)s[a++]=t[e]})),new t(s,!0)},t.prototype.uploadData=function(){return this.data_},t}(),lt=function(){function t(t,e){this.bucket=t,this.path_=e}return Object.defineProperty(t.prototype,"path",{get:function(){return this.path_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return 0===this.path.length},enumerable:!1,configurable:!0}),t.prototype.fullServerUrl=function(){var t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o/"+t(this.path)},t.prototype.bucketOnlyServerUrl=function(){var t=encodeURIComponent;return"/b/"+t(this.bucket)+"/o"},t.makeFromBucketSpec=function(e){var n;try{n=t.makeFromUrl(e)}catch(r){return new t(e,"")}if(""===n.path)return n;throw E(e)},t.makeFromUrl=function(e){var n=null,r="([A-Za-z0-9.\\-_]+)";function i(t){"/"===t.path.charAt(t.path.length-1)&&(t.path_=t.path_.slice(0,-1))}var o="(/(.*))?$",s=new RegExp("^gs://"+r+o,"i"),u={bucket:1,path:3};function c(t){t.path_=decodeURIComponent(t.path)}for(var h="v[A-Za-z0-9_]+",l=a.replace(/[.]/g,"\\."),f="(/([^?#]*).*)?$",p=new RegExp("^https?://"+l+"/"+h+"/b/"+r+"/o"+f,"i"),d={bucket:1,path:3},v="(?:storage.googleapis.com|storage.cloud.google.com)",g="([^?#]*)",y=new RegExp("^https?://"+v+"/"+r+"/"+g,"i"),m={bucket:1,path:2},_=[{regex:s,indices:u,postModify:i},{regex:p,indices:d,postModify:c},{regex:y,indices:m,postModify:c}],b=0;b<_.length;b++){var E=_[b],I=E.regex.exec(e);if(I){var T=I[E.indices.bucket],C=I[E.indices.path];C||(C=""),n=new t(T,C),E.postModify(n);break}}if(null==n)throw w(e);return n},t}(); 213/** 214 * @license 215 * Copyright 2017 Google LLC 216 * 217 * Licensed under the Apache License, Version 2.0 (the "License");
218 * you may not use this file except in compliance with the License. 219 * You may obtain a copy of the License at 220 * 221 * http://www.apache.org/licenses/LICENSE-2.0 222 * 223 * Unless required by applicable law or agreed to in writing, software 224 * distributed under the License is distributed on an "AS IS" BASIS, 225 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 226 * See the License for the specific language governing permissions and 227 * limitations under the License. 228 */ 229/** 230 * @license 231 * Copyright 2017 Google LLC 232 * 233 * Licensed under the Apache License, Version 2.0 (the "License"); 234 * you may not use this file except in compliance with the License. 235 * You may obtain a copy of the License at 236 * 237 * http://www.apache.org/licenses/LICENSE-2.0 238 * 239 * Unless required by applicable law or agreed to in writing, software 240 * distributed under the License is distributed on an "AS IS" BASIS, 241 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 242 * See the License for the specific language governing permissions and 243 * limitations under the License. 244 */ 245function ft(t){var e;try{e=JSON.parse(t)}catch(n){return null}return Z(e)?e:null} 246/** 247 * @license 248 * Copyright 2017 Google LLC 249 * 250 * Licensed under the Apache License, Version 2.0 (the "License"); 251 * you may not use this file except in compliance with the License. 252 * You may obtain a copy of the License at 253 * 254 * http://www.apache.org/licenses/LICENSE-2.0 255 * 256 * Unless required by applicable law or agreed to in writing, software 257 * distributed under the License is distributed on an "AS IS" BASIS, 258 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 259 * See the License for the specific language governing permissions and 260 * limitations under the License. 261 */function pt(t){if(0===t.length)return null;var e=t.lastIndexOf("/");if(-1===e)return"";var n=t.slice(0,e);return n}function dt(t,e){var n=e.split("/").filter((function(t){return t.length>0})).join("/");return 0===t.length?n:t+"/"+n}function vt(t){var e=t.lastIndexOf("/",t.length-2);return-1===e?t:t.slice(e+1)} 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 gt(t){return"https://"+a+"/v0"+t}function yt(t){var e=encodeURIComponent,n="?";for(var r in t)if(t.hasOwnProperty(r)){var i=e(r)+"="+e(t[r]);n=n+i+"&"}return n=n.slice(0,-1),n} 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 */function mt(t,e){return e}var _t=function(){function t(t,e,n,r){this.server=t,this.local=e||t,this.writable=!!n,this.xform=r||mt}return t}(),bt=null;function wt(t){return!tt(t)||t.length<2?t:vt(t)}function Et(){if(bt)return bt;var t=[];function e(t,e){return wt(e)}t.push(new _t("bucket")),t.push(new _t("generation")),t.push(new _t("metageneration")),t.push(new _t("name","fullPath",!0));var n=new _t("name");function r(t,e){return Q(e)?Number(e):e}n.xform=e,t.push(n);var i=new _t("size");return i.xform=r,t.push(i),t.push(new _t("timeCreated")),t.push(new _t("updated")),t.push(new _t("md5Hash",null,!0)),t.push(new _t("cacheControl",null,!0)),t.push(new _t("contentDisposition",null,!0)),t.push(new _t("contentEncoding",null,!0)),t.push(new _t("contentLanguage",null,!0)),t.push(new _t("contentType",null,!0)),t.push(new _t("metadata","customMetadata",!0)),bt=t,bt}function It(t,e){function n(){var n=t["bucket"],r=t["fullPath"],i=new lt(n,r);return e.makeStorageReference(i)}Object.defineProperty(t,"ref",{get:n})}function Tt(t,e,n){for(var r={type:"file"},i=n.length,o=0;o<i;o++){var s=n[o];r[s.local]=s.xform(r,e[s.server])}return It(r,t),r}function Ct(t,e,n){var r=ft(e);if(null===r)return null;var i=r;return Tt(t,i,n)}function St(t,e){var n=ft(e);if(null===n)return null;if(!tt(n["downloadTokens"]))return null;var r=n["downloadTokens"];if(0===r.length)return null;var i=encodeURIComponent,o=r.split(","),s=o.map((function(e){var n=t["bucket"],r=t["fullPath"],o="/b/"+i(n)+"/o/"+i(r),s=gt(o),a=yt({alt:"media",token:e});return s+a}));return s[0]}function Ot(t,e){for(var n={},r=e.length,i=0;i<r;i++){var o=e[i];o.writable&&(n[o.server]=t[o.local])}return JSON.stringify(n)}function Nt(t){if(!$(t)||!t)throw"Expected Metadata object.";for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];if("customMetadata"===e){if(!$(n))throw"Expected object for 'customMetadata' mapping."}else if(J(n))throw"Mapping for '"+e+"' cannot be an object."}} 294/** 295 * @license 296 * Copyright 2019 Google LLC 297 * 298 * Licensed under the Apache License, Version 2.0 (the "License");
299 * you may not use this file except in compliance with the License. 300 * You may obtain a copy of the License at 301 * 302 * http://www.apache.org/licenses/LICENSE-2.0 303 * 304 * Unless required by applicable law or agreed to in writing, software 305 * distributed under the License is distributed on an "AS IS" BASIS, 306 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 307 * See the License for the specific language governing permissions and 308 * limitations under the License. 309 */var At="maxResults",kt=1e3,Rt="pageToken",Pt="prefixes",xt="items";function Dt(t,e,n){var r={prefixes:[],items:[],nextPageToken:n["nextPageToken"]};if(n[Pt])for(var i=0,o=n[Pt];i<o.length;i++){var s=o[i],a=s.replace(/\/$/,""),u=t.makeStorageReference(new lt(e,a));r.prefixes.push(u)}if(n[xt])for(var c=0,h=n[xt];c<h.length;c++){var l=h[c];u=t.makeStorageReference(new lt(e,l["name"]));r.items.push(u)}return r}function Lt(t,e,n){var r=ft(n);if(null===r)return null;var i=r;return Dt(t,e,i)}function jt(t){if(!$(t)||!t)throw"Expected ListOptions object.";for(var e in t)if(e===At){if(!et(t[At])||t[At]<=0)throw"Expected maxResults to be a positive number.";if(t[At]>1e3)throw"Expected maxResults to be less than or equal to "+kt+"."}else{if(e!==Rt)throw"Unknown option: "+e;if(t[Rt]&&!tt(t[Rt]))throw"Expected pageToken to be string."}}var Mt=function(){function t(t,e,n,r){this.url=t,this.method=e,this.handler=n,this.timeout=r,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}return t}(); 310/** 311 * @license 312 * Copyright 2017 Google LLC 313 * 314 * Licensed under the Apache License, Version 2.0 (the "License"); 315 * you may not use this file except in compliance with the License. 316 * You may obtain a copy of the License at 317 * 318 * http://www.apache.org/licenses/LICENSE-2.0 319 * 320 * Unless required by applicable law or agreed to in writing, software 321 * distributed under the License is distributed on an "AS IS" BASIS, 322 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 323 * See the License for the specific language governing permissions and 324 * limitations under the License. 325 */function Ft(t){if(!t)throw d()}function Ut(t,e){function n(n,r){var i=Ct(t,r,e);return Ft(null!==i),i}return n}function Vt(t,e){function n(n,r){var i=Lt(t,e,r);return Ft(null!==i),i}return n}function qt(t,e){function n(n,r){var i=Ct(t,r,e);return Ft(null!==i),St(i,r)}return n}function Bt(t){function e(e,n){var r;return r=401===e.getStatus()?y():402===e.getStatus()?g(t.bucket):403===e.getStatus()?m(t.path):n,r.setServerResponseProp(n.serverResponseProp()),r}return e}function Wt(t){var e=Bt(t);function n(n,r){var i=e(n,r);return 404===n.getStatus()&&(i=v(t.path)),i.setServerResponseProp(r.serverResponseProp()),i}return n}function Gt(t,e,n){var r=e.fullServerUrl(),i=gt(r),o="GET",s=t.maxOperationRetryTime,a=new Mt(i,o,Ut(t,n),s);return a.errorHandler=Wt(e),a}function Ht(t,e,n,r,i){var o={};e.isRoot?o["prefix"]="":o["prefix"]=e.path+"/",n&&n.length>0&&(o["delimiter"]=n),r&&(o["pageToken"]=r),i&&(o["maxResults"]=i);var s=e.bucketOnlyServerUrl(),a=gt(s),u="GET",c=t.maxOperationRetryTime,h=new Mt(a,u,Vt(t,e.bucket),c);return h.urlParams=o,h.errorHandler=Bt(e),h}function Kt(t,e,n){var r=e.fullServerUrl(),i=gt(r),o="GET",s=t.maxOperationRetryTime,a=new Mt(i,o,qt(t,n),s);return a.errorHandler=Wt(e),a}function zt(t,e,n,r){var i=e.fullServerUrl(),o=gt(i),s="PATCH",a=Ot(n,r),u={"Content-Type":"application/json; charset=utf-8"},c=t.maxOperationRetryTime,h=new Mt(o,s,Ut(t,r),c);return h.headers=u,h.body=a,h.errorHandler=Wt(e),h}function Qt(t,e){var n=e.fullServerUrl(),r=gt(n),i="DELETE",o=t.maxOperationRetryTime;function s(t,e){}var a=new Mt(r,i,s,o);return a.successCodes=[200,204],a.errorHandler=Wt(e),a}function Yt(t,e){return t&&t["contentType"]||e&&e.type()||"application/octet-stream"}function Xt(t,e,n){var r=Object.assign({},n);return r["fullPath"]=t.path,r["size"]=e.size(),r["contentType"]||(r["contentType"]=Yt(null,e)),r}function $t(t,e,n,r,i){var o=e.bucketOnlyServerUrl(),s={"X-Goog-Upload-Protocol":"multipart"};function a(){for(var t="",e=0;e<2;e++)t+=Math.random().toString().slice(2);return t}var u=a();s["Content-Type"]="multipart/related; boundary="+u;var c=Xt(e,r,i),h=Ot(c,n),l="--"+u+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+h+"\r\n--"+u+"\r\nContent-Type: "+c["contentType"]+"\r\n\r\n",f="\r\n--"+u+"--",p=ht.getBlob(l,r,f);if(null===p)throw I();var d={name:c["fullPath"]}
325,v=gt(o),g="POST",y=t.maxUploadRetryTime,m=new Mt(v,g,Ut(t,n),y);return m.urlParams=d,m.headers=s,m.body=p.uploadData(),m.errorHandler=Bt(e),m}var Jt=function(){function t(t,e,n,r){this.current=t,this.total=e,this.finalized=!!n,this.metadata=r||null}return t}();function Zt(t,e){var n=null;try{n=t.getResponseHeader("X-Goog-Upload-Status")}catch(i){Ft(!1)}var r=e||["active"];return Ft(!!n&&-1!==r.indexOf(n)),n}function te(t,e,n,r,i){var o=e.bucketOnlyServerUrl(),s=Xt(e,r,i),a={name:s["fullPath"]},u=gt(o),c="POST",h={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":r.size(),"X-Goog-Upload-Header-Content-Type":s["contentType"],"Content-Type":"application/json; charset=utf-8"},l=Ot(s,n),f=t.maxUploadRetryTime;function p(t){var e;Zt(t);try{e=t.getResponseHeader("X-Goog-Upload-URL")}catch(n){Ft(!1)}return Ft(tt(e)),e}var d=new Mt(u,c,p,f);return d.urlParams=a,d.headers=h,d.body=l,d.errorHandler=Bt(e),d}function ee(t,e,n,r){var i={"X-Goog-Upload-Command":"query"};function o(t){var e=Zt(t,["active","final"]),n=null;try{n=t.getResponseHeader("X-Goog-Upload-Size-Received")}catch(o){Ft(!1)}n||Ft(!1);var i=Number(n);return Ft(!isNaN(i)),new Jt(i,r.size(),"final"===e)}var s="POST",a=t.maxUploadRetryTime,u=new Mt(n,s,o,a);return u.headers=i,u.errorHandler=Bt(e),u}var ne=262144;function re(t,e,n,r,i,o,s,a){var u=new Jt(0,0);if(s?(u.current=s.current,u.total=s.total):(u.current=0,u.total=r.size()),r.size()!==u.total)throw T();var c=u.total-u.current,h=c;i>0&&(h=Math.min(h,i));var l=u.current,f=l+h,p=h===c?"upload, finalize":"upload",d={"X-Goog-Upload-Command":p,"X-Goog-Upload-Offset":u.current},v=r.slice(l,f);if(null===v)throw I();function g(t,n){var i,s=Zt(t,["active","final"]),a=u.current+h,c=r.size();return i="final"===s?Ut(e,o)(t,n):null,new Jt(a,c,"final"===s,i)}var y="POST",m=e.maxUploadRetryTime,_=new Mt(n,y,g,m);return _.headers=d,_.body=v.uploadData(),_.progressCallback=a||null,_.errorHandler=Bt(t),_} 326/** 327 * @license 328 * Copyright 2017 Google LLC 329 * 330 * Licensed under the Apache License, Version 2.0 (the "License"); 331 * you may not use this file except in compliance with the License. 332 * You may obtain a copy of the License at 333 * 334 * http://www.apache.org/licenses/LICENSE-2.0 335 * 336 * Unless required by applicable law or agreed to in writing, software 337 * distributed under the License is distributed on an "AS IS" BASIS, 338 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 339 * See the License for the specific language governing permissions and 340 * limitations under the License. 341 */var ie=function(){function t(t,e,n){var r=X(t)||Q(e)||Q(n);if(r)this.next=t,this.error=e||null,this.complete=n||null;else{var i=t;this.next=i.next||null,this.error=i.error||null,this.complete=i.complete||null}}return t}(),oe=function(){function t(t,e,n,r,i,o){this.bytesTransferred=t,this.totalBytes=e,this.state=n,this.metadata=r,this.task=i,this.ref=o}return t}(); 342/** 343 * @license 344 * Copyright 2017 Google LLC 345 * 346 * Licensed under the Apache License, Version 2.0 (the "License"); 347 * you may not use this file except in compliance with the License. 348 * You may obtain a copy of the License at 349 * 350 * http://www.apache.org/licenses/LICENSE-2.0 351 * 352 * Unless required by applicable law or agreed to in writing, software 353 * distributed under the License is distributed on an "AS IS" BASIS, 354 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 355 * See the License for the specific language governing permissions and 356 * limitations under the License. 357 */ 358function se(t,e,n){for(var r=e.length,i=e.length,o=0;o<e.length;o++)if(e[o].optional){r=o;break}var s=r<=n.length&&n.length<=i;if(!s)throw O(r,i,t,n.length);for(o=0;o<n.length;o++)try{e[o].validator(n[o])}catch(a){throw a instanceof Error?S(o,t,a.message):S(o,t,a)}}var ae=function(){function t(t,e){var n=this;this.validator=function(e){n.optional&&!Y(e)||t(e)},this.optional=!!e}return t}();function ue(t,e){return function(n){t(n),e(n)}}function ce(t,e){function n(t){if(!tt(t))throw"Expected string."}var r;return r=t?ue(n,t):n,new ae(r,e)}function he(){function t(t){var e=t instanceof Uint8Array||t instanceof ArrayBuffer||it()&&t instanceof Blob;if(!e)throw"Expected Blob or File."}return new ae(t)}function le(t){return new ae(Nt,t)}function fe(t){return new ae(jt,t)}function pe(){function t(t){var e=nt(t)&&t>=0;if(!e)throw"Expected a number 0 or greater."}return new ae(t)}function de(t,e){function n(e){var n=null===e||Q(e)&&e instanceof Object;if(!n)throw"Expected an Object.";void 0!==t&&null!==t&&t(e)}return new ae(n,e)}function ve(t){function e(t){var e=null===t||X(t);if(!e)throw"Expected a Function."}return new ae(e,t)} 359/** 360 * @license 361 * Copyright 2017 Google LLC 362 * 363 * Licensed under the Apache License, Version 2.0 (the "License");
364 * you may not use this file except in compliance with the License. 365 * You may obtain a copy of the License at 366 * 367 * http://www.apache.org/licenses/LICENSE-2.0 368 * 369 * Unless required by applicable law or agreed to in writing, software 370 * distributed under the License is distributed on an "AS IS" BASIS, 371 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 372 * See the License for the specific language governing permissions and 373 * limitations under the License. 374 */function ge(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];Promise.resolve().then((function(){return t.apply(void 0,e)}))}} 375/** 376 * @license 377 * Copyright 2017 Google LLC 378 * 379 * Licensed under the Apache License, Version 2.0 (the "License"); 380 * you may not use this file except in compliance with the License. 381 * You may obtain a copy of the License at 382 * 383 * http://www.apache.org/licenses/LICENSE-2.0 384 * 385 * Unless required by applicable law or agreed to in writing, software 386 * distributed under the License is distributed on an "AS IS" BASIS, 387 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 388 * See the License for the specific language governing permissions and 389 * limitations under the License. 390 */var ye=function(){function t(t,e,n,r,i,o){var s=this;void 0===o&&(o=null),this.transferred_=0,this.needToFetchStatus_=!1,this.needToFetchMetadata_=!1,this.observers_=[],this.error_=null,this.uploadUrl_=null,this.request_=null,this.chunkMultiplier_=1,this.resolve_=null,this.reject_=null,this.ref_=t,this.service_=e,this.location_=n,this.blob_=i,this.metadata_=o,this.mappings_=r,this.resumable_=this.shouldDoResumable_(this.blob_),this.state_=H.RUNNING,this.errorHandler_=function(t){s.request_=null,s.chunkMultiplier_=1,t.codeEquals(f.CANCELED)?(s.needToFetchStatus_=!0,s.completeTransitions_()):(s.error_=t,s.transition_(H.ERROR))},this.metadataErrorHandler_=function(t){s.request_=null,t.codeEquals(f.CANCELED)?s.completeTransitions_():(s.error_=t,s.transition_(H.ERROR))},this.promise_=new Promise((function(t,e){s.resolve_=t,s.reject_=e,s.start_()}
390)),this.promise_.then(null,(function(){}))}return t.prototype.makeProgressCallback_=function(){var t=this,e=this.transferred_;return function(n){return t.updateProgress_(e+n)}},t.prototype.shouldDoResumable_=function(t){return t.size()>262144},t.prototype.start_=function(){this.state_===H.RUNNING&&null===this.request_&&(this.resumable_?null===this.uploadUrl_?this.createResumable_():this.needToFetchStatus_?this.fetchStatus_():this.needToFetchMetadata_?this.fetchMetadata_():this.continueUpload_():this.oneShotUpload_())},t.prototype.resolveToken_=function(t){var e=this;this.service_.getAuthToken().then((function(n){switch(e.state_){case H.RUNNING:t(n);break;case H.CANCELING:e.transition_(H.CANCELED);break;case H.PAUSING:e.transition_(H.PAUSED);break}}))},t.prototype.createResumable_=function(){var t=this;this.resolveToken_((function(e){var n=te(t.service_,t.location_,t.mappings_,t.blob_,t.metadata_),r=t.service_.makeRequest(n,e);t.request_=r,r.getPromise().then((function(e){t.request_=null,t.uploadUrl_=e,t.needToFetchStatus_=!1,t.completeTransitions_()}),t.errorHandler_)}))},t.prototype.fetchStatus_=function(){var t=this,e=this.uploadUrl_;this.resolveToken_((function(n){var r=ee(t.service_,t.location_,e,t.blob_),i=t.service_.makeRequest(r,n);t.request_=i,i.getPromise().then((function(e){e=e,t.request_=null,t.updateProgress_(e.current),t.needToFetchStatus_=!1,e.finalized&&(t.needToFetchMetadata_=!0),t.completeTransitions_()}),t.errorHandler_)}))},t.prototype.continueUpload_=function(){var t=this,e=ne*this.chunkMultiplier_,n=new Jt(this.transferred_,this.blob_.size()),r=this.uploadUrl_;this.resolveToken_((function(i){var o;try{o=re(t.location_,t.service_,r,t.blob_,e,t.mappings_,n,t.makeProgressCallback_())}catch(a){return t.error_=a,void t.transition_(H.ERROR)}var s=t.service_.makeRequest(o,i);t.request_=s,s.getPromise().then((function(e){t.increaseMultiplier_(),t.request_=null,t.updateProgress_(e.current),e.finalized?(t.metadata_=e.metadata,t.transition_(H.SUCCESS)):t.completeTransitions_()}),t.errorHandler_)}))},t.prototype.increaseMultiplier_=function(){var t=ne*this.chunkMultiplier_;t<33554432&&(this.chunkMultiplier_*=2)},t.prototype.fetchMetadata_=function(){var t=this;this.resolveToken_((function(e){var n=Gt(t.service_,t.location_,t.mappings_),r=t.service_.makeRequest(n,e);t.request_=r,r.getPromise().then((function(e){t.request_=null,t.metadata_=e,t.transition_(H.SUCCESS)}),t.metadataErrorHandler_)}))},t.prototype.oneShotUpload_=function(){var t=this;this.resolveToken_((function(e){var n=$t(t.service_,t.location_,t.mappings_,t.blob_,t.metadata_),r=t.service_.makeRequest(n,e);t.request_=r,r.getPromise().then((function(e){t.request_=null,t.metadata_=e,t.updateProgress_(t.blob_.size()),t.transition_(H.SUCCESS)}),t.errorHandler_)}))},t.prototype.updateProgress_=function(t){var e=this.transferred_;this.transferred_=t,this.transferred_!==e&&this.notifyObservers_()},t.prototype.transition_=function(t){if(this.state_!==t)switch(t){case H.CANCELING:this.state_=t,null!==this.request_&&this.request_.cancel();break;case H.PAUSING:this.state_=t,null!==this.request_&&this.request_.cancel();break;case H.RUNNING:var e=this.state_===H.PAUSED;this.state_=t,e&&(this.notifyObservers_(),this.start_());break;case H.PAUSED:this.state_=t,this.notifyObservers_();break;case H.CANCELED:this.error_=b(),this.state_=t,this.notifyObservers_();break;case H.ERROR:this.state_=t,this.notifyObservers_();break;case H.SUCCESS:this.state_=t,this.notifyObservers_();break}},t.prototype.completeTransitions_=function(){switch(this.state_){case H.PAUSING:this.transition_(H.PAUSED);break;case H.CANCELING:this.transition_(H.CANCELED);break;case H.RUNNING:this.start_();break}},Object.defineProperty(t.prototype,"snapshot",{get:function(){var t=z(this.state_);return new oe(this.transferred_,this.blob_.size(),t,this.metadata_,this,this.ref_)},enumerable:!1,configurable:!0}),t.prototype.on=function(t,e,n,r){function i(){if(t!==G.STATE_CHANGED)throw"Expected one of the event types: ["+G.STATE_CHANGED+"]."}var o="Expected a function or an Object with one of `next`, `error`, `complete` properties.",s=ve(!0).validator,a=de(null,!0).validator;function u(t){try{return void s(t)}catch(n){}try{a(t);var e=Y(t["next"])||Y(t["error"])||Y(t["complete"]);if(!e)throw"";return}catch(n){throw o}}var c=[ce(i),de(u,!0),ve(!0),ve(!0)];se("on",c,arguments);var h=this;function l(t){function e(e,n,i){null!==t&&se("on",t,arguments);var o=new ie(e,n,r);return h.addObserver_(o),function(){h.removeObserver_(o)}}return e}function f(t){if(null===t)throw o;u(t)}var p=[de(f),ve(!0),ve(!0)],d=!(Y(e)||Y(n)||Y(r));return d?l(p):l(null)(e,n,r)},t.prototype.then=function(t,e){return this.promise_.then(t,e)},t.prototype.catch=function(t){return this.then(null,t)},t.prototype.addObserver_=function(t){this.observers_.push(t),this.notifyObserver_(t)},t.prototype.removeObserver_=function(t){var e=this.observers_.indexOf(t);-1!==e&&this.observers_.splice(e,1)},t.prototype.notifyObservers_=function(){var t=this;this.finishPromise_();var e=this.observers_.slice();e.forEach((function(e){t.notifyObserver_(e)}))},t.prototype.finishPromise_=function(){if(null!==this.resolve_){var t=!0;switch(z(this.state_)){case K.SUCCESS:ge(this.resolve_.bind(null,this.snapshot))();break;case K.CANCELED:case K.ERROR:var e=this.reject_;ge(e.bind(null,this.error_))();break;default:t=!1;break}t&&(this.resolve_=null,this.reject_=null)}},t.prototype.notifyObserver_=function(t){var e=z(this.state_);switch(e){case K.RUNNING:case K.PAUSED:t.next&&ge(t.next.bind(t,this.snapshot))();break;case K.SUCCESS:t.complete&&ge(t.complete.bind(t))();break;case K.CANCELED:case K.ERROR:t.error&&ge(t.error.bind(t,this.error_))();break;default:t.error&&ge(t.error.bind(t,this.error_))()}},t.prototype.resume=function(){se("resume",[],arguments);var t=this.state_===H.PAUSED||this.state_===H.PAUSING;return t&&this.transition_(H.RUNNING),t},t.prototype.pause=function(){se("pause",[],arguments);var t=this.state_===H.RUNNING;return t&&this.transition_(H.PAUSING),t},t.prototype.cancel=function(){se("cancel",[],arguments);var t=this.state_===H.RUNNING||this.state_===H.PAUSING;return t&&this.transition_(H.CANCELING),t},t}(),me=function(){function t(t,e){this.service=t,this.location=e instanceof lt?e:lt.makeFromUrl(e)}return t.prototype.toString=function(){return se("toString",[],arguments),"gs://"+this.location.bucket+"/"+this.location.path},t.prototype.newRef=function(e,n){return new t(e,n)},t.prototype.mappings=function(){return Et()},t.prototype.child=function(t){se("child",[ce()],arguments);var e=dt(this.location.path,t),n=new lt(this.location.bucket,e);return this.newRef(this.service,n)},Object.defineProperty(t.prototype,"parent",{get:function(){var t=pt(this.location.path);if(null===t)return null;var e=new lt(this.location.bucket,t);return this.newRef(this.service,e)}
390,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){var t=new lt(this.location.bucket,"");return this.newRef(this.service,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bucket",{get:function(){return this.location.bucket},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullPath",{get:function(){return this.location.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return vt(this.location.path)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"storage",{get:function(){return this.service},enumerable:!1,configurable:!0}),t.prototype.put=function(t,e){return void 0===e&&(e=null),se("put",[he(),le(!0)],arguments),this.throwIfRoot_("put"),new ye(this,this.service,this.location,this.mappings(),new ht(t),e)},t.prototype.putString=function(t,e,n){void 0===e&&(e=P.RAW),se("putString",[ce(),ce(x,!0),le(!0)],arguments),this.throwIfRoot_("putString");var r=L(e,t),i=Object.assign({},n);return!Q(i["contentType"])&&Q(r.contentType)&&(i["contentType"]=r.contentType),new ye(this,this.service,this.location,this.mappings(),new ht(r.data,!0),i)},t.prototype.delete=function(){var t=this;return se("delete",[],arguments),this.throwIfRoot_("delete"),this.service.getAuthToken().then((function(e){var n=Qt(t.service,t.location);return t.service.makeRequest(n,e).getPromise()}))},t.prototype.listAll=function(){se("listAll",[],arguments);var t={prefixes:[],items:[]};return this.listAllHelper(t).then((function(){return t}))},t.prototype.listAllHelper=function(t,e){return Object(o["__awaiter"])(this,void 0,void 0,(function(){var n,r,i,s;return Object(o["__generator"])(this,(function(o){switch(o.label){case 0:return n={pageToken:e},[4,this.list(n)];case 1:return r=o.sent(),(i=t.prefixes).push.apply(i,r.prefixes),(s=t.items).push.apply(s,r.items),null==r.nextPageToken?[3,3]:[4,this.listAllHelper(t,r.nextPageToken)];case 2:o.sent(),o.label=3;case 3:return[2]}}
390))}))},t.prototype.list=function(t){se("list",[fe(!0)],arguments);var e=this;return this.service.getAuthToken().then((function(n){var r=t||{},i=Ht(e.service,e.location,"/",r.pageToken,r.maxResults);return e.service.makeRequest(i,n).getPromise()}))},t.prototype.getMetadata=function(){var t=this;return se("getMetadata",[],arguments),this.throwIfRoot_("getMetadata"),this.service.getAuthToken().then((function(e){var n=Gt(t.service,t.location,t.mappings());return t.service.makeRequest(n,e).getPromise()}))},t.prototype.updateMetadata=function(t){var e=this;return se("updateMetadata",[le()],arguments),this.throwIfRoot_("updateMetadata"),this.service.getAuthToken().then((function(n){var r=zt(e.service,e.location,t,e.mappings());return e.service.makeRequest(r,n).getPromise()}))},t.prototype.getDownloadURL=function(){var t=this;return se("getDownloadURL",[],arguments),this.throwIfRoot_("getDownloadURL"),this.service.getAuthToken().then((function(e){var n=Kt(t.service,t.location,t.mappings());return t.service.makeRequest(n,e).getPromise().then((function(t){if(null===t)throw C();return t}))}))},t.prototype.throwIfRoot_=function(t){if(""===this.location.path)throw A(t)},t}(),_e=function(){function t(t){this.promise_=Promise.reject(t)}return t.prototype.getPromise=function(){return this.promise_},t.prototype.cancel=function(t){},t}(); 391/** 392 * @license 393 * Copyright 2019 Google LLC 394 * 395 * Licensed under the Apache License, Version 2.0 (the "License"); 396 * you may not use this file except in compliance with the License. 397 * You may obtain a copy of the License at 398 * 399 * http://www.apache.org/licenses/LICENSE-2.0 400 * 401 * Unless required by applicable law or agreed to in writing, software 402 * distributed under the License is distributed on an "AS IS" BASIS, 403 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 404 * See the License for the specific language governing permissions and 405 * limitations under the License. 406 */ 407/** 408 * @license 409 * Copyright 2017 Google LLC 410 * 411 * Licensed under the Apache License, Version 2.0 (the "License"); 412 * you may not use this file except in compliance with the License. 413 * You may obtain a copy of the License at 414 * 415 * http://www.apache.org/licenses/LICENSE-2.0 416 * 417 * Unless required by applicable law or agreed to in writing, software 418 * distributed under the License is distributed on an "AS IS" BASIS, 419 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 420 * See the License for the specific language governing permissions and 421 * limitations under the License. 422 */ 423function be(t,e,n){var r=1,i=null,s=!1,a=0;function u(){return 2===a}var c=!1;function h(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];c||(c=!0,e.apply(null,t))}function l(e){i=setTimeout((function(){i=null,t(f,u())}),e)}function f(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!c)if(t)h.call.apply(h,Object(o["__spreadArrays"])([null,t],e));else{var i,f=u()||s;if(f)h.call.apply(h,Object(o["__spreadArrays"])([null,t],e));else r<64&&(r*=2),1===a?(a=2,i=0):i=1e3*(r+Math.random()),l(i)}}var p=!1;function d(t){p||(p=!0,c||(null!==i?(t||(a=2),clearTimeout(i),l(0)):t||(a=1)))}return l(0),setTimeout((function(){s=!0,d(!0)}),n),d}function we(t){t(!1)} 424/** 425 * @license 426 * Copyright 2017 Google LLC 427 * 428 * Licensed under the Apache License, Version 2.0 (the "License"); 429 * you may not use this file except in compliance with the License. 430 * You may obtain a copy of the License at 431 * 432 * http://www.apache.org/licenses/LICENSE-2.0 433 * 434 * Unless required by applicable law or agreed to in writing, software 435 * distributed under the License is distributed on an "AS IS" BASIS, 436 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 437 * See the License for the specific language governing permissions and 438 * limitations under the License. 439 */var Ee=function(){function t(t,e,n,r,i,o,s,a,u,c,h){var l=this;this.pendingXhr_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.url_=t,this.method_=e,this.headers_=n,this.body_=r,this.successCodes_=i.slice(),this.additionalRetryCodes_=o.slice(),this.callback_=s,this.errorCallback_=a,this.progressCallback_=c,this.timeout_=u,this.pool_=h,this.promise_=new Promise((function(t,e){l.resolve_=t,l.reject_=e,l.start_()}
439))}return t.prototype.start_=function(){var t=this;function e(e,n){if(n)e(!1,new Ie(!1,null,!0));else{var r=t.pool_.createXhrIo();t.pendingXhr_=r,null!==t.progressCallback_&&r.addUploadProgressListener(i),r.send(t.url_,t.method_,t.body_,t.headers_).then((function(n){null!==t.progressCallback_&&n.removeUploadProgressListener(i),t.pendingXhr_=null,n=n;var r=n.getErrorCode()===W.NO_ERROR,o=n.getStatus();if(r&&!t.isRetryStatusCode_(o)){var s=-1!==t.successCodes_.indexOf(o);e(!0,new Ie(s,n))}else{var a=n.getErrorCode()===W.ABORT;e(!1,new Ie(!1,null,a))}}))}function i(e){var n=e.loaded,r=e.lengthComputable?e.total:-1;null!==t.progressCallback_&&t.progressCallback_(n,r)}}function n(e,n){var r=t.resolve_,i=t.reject_,o=n.xhr;if(n.wasSuccessCode)try{var s=t.callback_(o,o.getResponseText());Y(s)?r(s):r()}catch(u){i(u)}else if(null!==o){var a=d();a.setServerResponseProp(o.getResponseText()),t.errorCallback_?i(t.errorCallback_(o,a)):i(a)}else if(n.canceled){a=t.appDelete_?N():b();i(a)}else{a=_();i(a)}}this.canceled_?n(!1,new Ie(!1,null,!0)):this.backoffId_=be(e,n,this.timeout_)},t.prototype.getPromise=function(){return this.promise_},t.prototype.cancel=function(t){this.canceled_=!0,this.appDelete_=t||!1,null!==this.backoffId_&&we(this.backoffId_),null!==this.pendingXhr_&&this.pendingXhr_.abort()},t.prototype.isRetryStatusCode_=function(t){var e=t>=500&&t<600,n=[408,429],r=-1!==n.indexOf(t),i=-1!==this.additionalRetryCodes_.indexOf(t);return e||r||i},t}(),Ie=function(){function t(t,e,n){this.wasSuccessCode=t,this.xhr=e,this.canceled=!!n}return t}();function Te(t,e){null!==e&&e.length>0&&(t["Authorization"]="Firebase "+e)}function Ce(t){var e="undefined"!==typeof i.a?i.a.SDK_VERSION:"AppManager";t["X-Firebase-Storage-Version"]="webjs/"+e}function Se(t,e){e&&(t["X-Firebase-GMPID"]=e)}function Oe(t,e,n,r){var i=yt(t.urlParams),o=t.url+i,s=Object.assign({},t.headers);return Se(s,e),Te(s,n),Ce(s),new Ee(o,t.method,s,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,r)} 440/** 441 * @license 442 * Copyright 2017 Google LLC 443 * 444 * Licensed under the Apache License, Version 2.0 (the "License"); 445 * you may not use this file except in compliance with the License. 446 * You may obtain a copy of the License at 447 * 448 * http://www.apache.org/licenses/LICENSE-2.0 449 * 450 * Unless required by applicable law or agreed to in writing, software 451 * distributed under the License is distributed on an "AS IS" BASIS, 452 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 453 * See the License for the specific language governing permissions and 454 * limitations under the License. 455 */var Ne=function(){function t(e,n,r,i){var o;this.bucket_=null,this.appId_=null,this.deleted_=!1,this.app_=e,this.authProvider_=n,this.maxOperationRetryTime_=c,this.maxUploadRetryTime_=h,this.requests_=new Set,this.pool_=r,this.bucket_=null!=i?lt.makeFromBucketSpec(i):t.extractBucket_(null===(o=this.app_)||void 0===o?void 0:o.options),this.internals_=new Ae(this)}return t.extractBucket_=function(t){var e=null===t||void 0===t?void 0:t[u];return null==e?null:lt.makeFromBucketSpec(e)},t.prototype.getAuthToken=function(){return Object(o["__awaiter"])(this,void 0,void 0,(function(){var t,e;return Object(o["__generator"])(this,(function(n){switch(n.label){case 0:return t=this.authProvider_.getImmediate({optional:!0}),t?[4,t.getToken()]:[3,2];case 1:if(e=n.sent(),null!==e)return[2,e.accessToken];n.label=2;case 2:return[2,null]}}))}))},t.prototype.deleteApp=function(){this.deleted_=!0,this.app_=null,this.requests_.forEach((function(t){return t.cancel()})),this.requests_.clear()},t.prototype.makeStorageReference=function(t){return new me(this,t)},t.prototype.makeRequest=function(t,e){var n=this;if(this.deleted_)return new _e(N());var r=Oe(t,this.appId_,e,this.pool_);return this.requests_.add(r),r.getPromise().then((function(){return n.requests_.delete(r)}),(function(){return n.requests_.delete(r)})),r},t.prototype.ref=function(t){function e(t){if("string"!==typeof t)throw"Path is not a string.";if(/^[A-Za-z]+:\/\//.test(t))throw"Expected child path but got a URL, use refFromURL instead."}if(se("ref",[ce(e,!0)],arguments),null==this.bucket_)throw new Error("No Storage Bucket defined in Firebase Options.");var n=new me(this,this.bucket_);return null!=t?n.child(t):n},t.prototype.refFromURL=function(t){function e(t){if("string"!==typeof t)throw"Path is not a string.";if(!/^[A-Za-z]+:\/\//.test(t))throw"Expected full URL but got a child path, use ref instead.";try{lt.makeFromUrl(t)}
455catch(e){throw"Expected valid full URL but got an invalid one."}}return se("refFromURL",[ce(e,!1)],arguments),new me(this,t)},Object.defineProperty(t.prototype,"maxUploadRetryTime",{get:function(){return this.maxUploadRetryTime_},enumerable:!1,configurable:!0}),t.prototype.setMaxUploadRetryTime=function(t){se("setMaxUploadRetryTime",[pe()],arguments),this.maxUploadRetryTime_=t},Object.defineProperty(t.prototype,"maxOperationRetryTime",{get:function(){return this.maxOperationRetryTime_},enumerable:!1,configurable:!0}),t.prototype.setMaxOperationRetryTime=function(t){se("setMaxOperationRetryTime",[pe()],arguments),this.maxOperationRetryTime_=t},Object.defineProperty(t.prototype,"app",{get:function(){return this.app_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"INTERNAL",{get:function(){return this.internals_},enumerable:!1,configurable:!0}),t}(),Ae=function(){function t(t){this.service_=t}return t.prototype.delete=function(){return this.service_.deleteApp(),Promise.resolve()},t}(),ke="@firebase/storage",Re="0.3.43",Pe="storage";function xe(t,e){var n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal");return new Ne(n,r,new st,e)}function De(t){var e={TaskState:K,TaskEvent:G,StringFormat:P,Storage:Ne,Reference:me};t.INTERNAL.registerComponent(new s["Component"](Pe,xe,"PUBLIC").setServiceProps(e).setMultipleInstances(!0)),t.registerVersion(ke,Re)}De(i.a)},"342f":function(t,e,n){var r=n("d066");t.exports=r("navigator","userAgent")||""},3523:function(t,e,n){"use strict";(function(r){Object.defineProperty(e,"__esModule",{value:!0});var i=n("c23d"),o=n("9ab4"),s=n("cd51"),a=n("abfd"),u=n("4be4");function c(t){return t&&"object"===typeof t&&"default"in t?t:{default:t}}var h=c(i),l=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}(),f=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}(),p=function(t){try{if("undefined"!==typeof window&&"undefined"!==typeof window[t]){var e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new l(e)}}catch(n){}return new f},d=p("localStorage"),v=p("sessionStorage"),g=new a.Logger("@firebase/database"),y=function(){var t=1;return function(){return t++}}(),m=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},b=null,w=!0,E=function(t,e){s.assert(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?(g.logLevel=a.LogLevel.VERBOSE,b=g.log.bind(g),e&&v.set("logging_enabled",!0)):"function"===typeof t?b=t:(b=null,v.remove("logging_enabled"))},I=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!0===w&&(w=!1,null===b&&!0===v.get("logging_enabled")&&E(!0)),b){var n=_.apply(null,t);b(n)}},T=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];I.apply(void 0,o.__spread([t],e))}},C=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));g.error(n)},S=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 g.error(n),new Error(n)},O=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="FIREBASE WARNING: "+_.apply(void 0,o.__spread(t));g.warn(n)},N=function(){"undefined"!==typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&O("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().")},A=function(t){return"number"===typeof t&&(t!==t||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY)},k=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))}},R="[MIN_NAME]",P="[MAX_NAME]",x=function(t,e){if(t===e)return 0;if(t===R||e===P)return-1;if(e===R||t===P)return 1;var n=G(t),r=G(e);return null!==n?null!==r?n-r===0?t.length-e.length:n-r:-1:null!==r?1:t<e?-1:1},D=function(t,e){return t===e?0:t<e?-1:1},L=function(t,e){if(e&&t in e)return e[t];throw new Error("Missing required key ("+t+") in object: "+s.stringify(e))},j=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+=j(t[e[i]]);return r+="}",r},M=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}; 456/** 457 * @license 458 * Copyright 2017 Google LLC 459 * 460 * Licensed under the Apache License, Version 2.0 (the "License");
461 * you may not use this file except in compliance with the License. 462 * You may obtain a copy of the License at 463 * 464 * http://www.apache.org/licenses/LICENSE-2.0 465 * 466 * Unless required by applicable law or agreed to in writing, software 467 * distributed under the License is distributed on an "AS IS" BASIS, 468 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 469 * See the License for the specific language governing permissions and 470 * limitations under the License. 471 */function F(t,e){for(var n in t)t.hasOwnProperty(n)&&e(n,t[n])}var U=function(t){s.assert(!A(t),"Invalid JSON number");var e,n,r,i,o,a=11,u=52,c=(1<<a-1)-1;0===t?(n=0,r=0,e=1/t===-1/0?1:0):(e=t<0,t=Math.abs(t),t>=Math.pow(2,1-c)?(i=Math.min(Math.floor(Math.log(t)/Math.LN2),c),n=i+c,r=Math.round(t*Math.pow(2,u-i)-Math.pow(2,u))):(n=0,r=Math.round(t/Math.pow(2,1-c-u))));var h=[];for(o=u;o;o-=1)h.push(r%2?1:0),r=Math.floor(r/2);for(o=a;o;o-=1)h.push(n%2?1:0),n=Math.floor(n/2);h.push(e?1:0),h.reverse();var l=h.join(""),f="";for(o=0;o<64;o+=8){var p=parseInt(l.substr(o,8),2).toString(16);1===p.length&&(p="0"+p),f+=p}return f.toLowerCase()},V=function(){return!("object"!==typeof window||!window["chrome"]||!window["chrome"]["extension"]||/^chrome/.test(window.location.href))},q=function(){return"object"===typeof Windows&&"object"===typeof Windows.UI},B=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},W=new RegExp("^-?(0*)\\d{1,10}$"),G=function(t){if(W.test(t)){var e=Number(t);if(e>=-2147483648&&e<=2147483647)return e}return null},H=function(t){try{t()}catch(e){setTimeout((function(){var t=e.stack||"";throw O("Exception was thrown by user callback.",t),e}),Math.floor(0))}},K=function(){var t="object"===typeof window&&window["navigator"]&&window["navigator"]["userAgent"]||"";return t.search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},z=function(t,e){var n=setTimeout(t,e);return"object"===typeof n&&n["unref"]&&n["unref"](),n},Q=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());
471throw 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=x(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;while(e<this.pieces_.length){if(this.pieces_[e]!==t.pieces_[n])return!1;++e,++n}return!0},t}(),Y=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},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}(),X="5",$="v",J="s",Z="r",tt="f",et="firebaseio.com",nt="ls",rt="p",it="websocket",ot="long_polling",st=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=d.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()&&d.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"),t===it)n=(this.secure?"wss://":"ws://")+this.internalHost+"/.ws?";else{if(t!==ot)throw new Error("Unknown connection type: "+t);n=(this.secure?"https://":"http://")+this.internalHost+"/.lp?"}this.needsQueryParam()&&(e["ns"]=this.namespace);var r=[];return F(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}(); 472/** 473 * @license 474 * Copyright 2017 Google LLC 475 * 476 * Licensed under the Apache License, Version 2.0 (the "License"); 477 * you may not use this file except in compliance with the License. 478 * You may obtain a copy of the License at 479 * 480 * http://www.apache.org/licenses/LICENSE-2.0 481 * 482 * Unless required by applicable law or agreed to in writing, software 483 * distributed under the License is distributed on an "AS IS" BASIS, 484 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 485 * See the License for the specific language governing permissions and 486 * limitations under the License. 487 */ 488function at(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(o){}e+="/"+i}return e}function ut(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 u=a.split("=");
4882===u.length?r[decodeURIComponent(u[0])]=decodeURIComponent(u[1]):O("Invalid query segment '"+a+"' in query '"+t+"'")}}}catch(c){e={error:c}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}var ct,ht,lt=function(t,e){var n=ft(t),r=n.namespace;"firebase.com"===n.domain&&S(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),r&&"undefined"!==r||"localhost"===n.domain||S("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||N();var i="ws"===n.scheme||"wss"===n.scheme;return{repoInfo:new st(n.host,n.secure,r,e,i,"",r!==n.subdomain),path:new Q(n.pathString)}},ft=function(t){var e="",n="",r="",i="",o="",s=!0,a="https",u=443;if("string"===typeof t){var c=t.indexOf("//");c>=0&&(a=t.substring(0,c-1),t=t.substring(c+2));var h=t.indexOf("/");-1===h&&(h=t.length);var l=t.indexOf("?");-1===l&&(l=t.length),e=t.substring(0,Math.min(h,l)),h<l&&(i=at(t.substring(h,l)));var f=ut(t.substring(Math.min(t.length,l)));c=e.indexOf(":"),c>=0?(s="https"===a||"wss"===a,u=parseInt(e.substring(c+1),10)):c=e.length;var p=e.slice(0,c);if("localhost"===p.toLowerCase())n="localhost";else if(p.split(".").length<=2)n=p;else{var d=e.indexOf(".");r=e.substring(0,d).toLowerCase(),n=e.substring(d+1),o=r}"ns"in f&&(o=f["ns"])}return{host:e,port:u,domain:n,subdomain:r,secure:s,scheme:a,pathString:i,namespace:o}},pt=/[\[\].#$\/\u0000-\u001F\u007F]/,dt=/[\[\].#$\u0000-\u001F\u007F]/,vt=10485760,gt=function(t){return"string"===typeof t&&0!==t.length&&!pt.test(t)},yt=function(t){return"string"===typeof t&&0!==t.length&&!dt.test(t)},mt=function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),yt(t)},_t=function(t){return null===t||"string"===typeof t||"number"===typeof t&&!A(t)||t&&"object"===typeof t&&s.contains(t,".sv")},bt=function(t,e,n,r,i){i&&void 0===n||wt(s.errorPrefix(t,e,i),n,r)},wt=function(t,e,n){var r=n instanceof Q?new Y(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(A(e))throw new Error(t+"contains "+e.toString()+" "+r.toErrorString());if("string"===typeof e&&e.length>vt/3&&s.stringLength(e)>vt)throw new Error(t+"contains a string greater than "+vt+" utf8 bytes "+r.toErrorString()+" ('"+e.substring(0,50)+"...')");if(e&&"object"===typeof e){var i=!1,o=!1;if(F(e,(function(e,n){if(".value"===e)i=!0;else if(".priority"!==e&&".sv"!==e&&(o=!0,!gt(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),wt(t,n,r),r.pop()})),i&&o)throw new Error(t+' contains ".value" child '+r.toErrorString()+" in addition to actual children.")}},Et=function(t,e){var n,r;for(n=0;n<e.length;n++){r=e[n];for(var i=r.slice(),o=0;o<i.length;o++)if(".priority"===i[o]&&o===i.length-1);else if(!gt(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(Q.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}},It=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=[];F(n,(function(t,e){var n=new Q(t);if(wt(o,e,r.child(n)),".priority"===n.getBack()&&!_t(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)})),Et(o,a)}},Tt=function(t,e,n,r){if(!r||void 0!==n){if(A(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(!_t(n))throw new Error(s.errorPrefix(t,e,r)+"must be a valid Firebase priority (a string, finite number, server value, or null).")}},Ct=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".')}},St=function(t,e,n,r){if((!r||void 0!==n)&&!gt(n))throw new Error(s.errorPrefix(t,e,r)+'was an invali
488d key = "'+n+'". Firebase keys must be non-empty strings and can\'t contain ".", "#", "$", "/", "[", or "]").')},Ot=function(t,e,n,r){if((!r||void 0!==n)&&!yt(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 "]"')},Nt=function(t,e,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),Ot(t,e,n,r)},At=function(t,e){if(".info"===e.getFront())throw new Error(t+" failed = Can't modify data under /.info/")},kt=function(t,e,n){var r=n.path.toString();if("string"!==typeof n.repoInfo.host||0===n.repoInfo.host.length||!gt(n.repoInfo.namespace)&&"localhost"!==n.repoInfo.host.split(":")[0]||0!==r.length&&!mt(r))throw new Error(s.errorPrefix(t,e,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".')},Rt=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.")},Pt=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),At("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),At("OnDisconnect.set",this.path_),bt("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),At("OnDisconnect.setWithPriority",this.path_),bt("OnDisconnect.setWithPriority",1,t,this.path_,!1),Tt("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),At("OnDisconnect.update",this.path_),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,O("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.")}It("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}(),xt=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}(),Dt=function(){var t="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",e=0,n=[];return function(r){var i,o=r===e;e=r;var a=new Array(8);for(i=7;i>=0;i--)a[i]=t.charAt(r%64),r=Math.floor(r/64);s.assert(0===r,"Cannot push at time == 0");var u=a.join("");if(o){for(i=11;i>=0&&63===n[i];i--)n[i]=0;n[i]++}else for(i=0;i<12;i++)n[i]=Math.floor(64*Math.random());for(i=0;i<12;i++)u+=t.charAt(n[i]);return s.assert(20===u.length,"nextPushId: Length should be 20."),u}}(),Lt=function(){function t(t,e){this.name=t,this.node=e}return t.Wrap=function(e,n){return new t(e,n)},t}(),jt=function(){function t(){}return t.prototype.getCompare=function(){return this.compare.bind(this)},t.prototype.indexedValueChanged=function(t,e){var n=new Lt(R,t),r=new Lt(R,e);return 0!==this.compare(n,r)},t.prototype.minPost=function(){return Lt.MIN},t}(),Mt=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 ct},set:function(t){ct=t}
488,enumerable:!1,configurable:!0}),e.prototype.compare=function(t,e){return x(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 Lt.MIN},e.prototype.maxPost=function(){return new Lt(P,ct)},e.prototype.makePost=function(t,e){return s.assert("string"===typeof t,"KeyIndex indexValue must always be a string."),new Lt(t,ct)},e.prototype.toString=function(){return".key"},e}(jt),Ft=new Mt;function Ut(t){ht=t}var Vt,qt,Bt,Wt=function(t){return"number"===typeof t?"number:"+U(t):"string:"+t},Gt=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===ht||t.isEmpty(),"priority of unexpected type.");s.assert(t===ht||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")},Ht=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."),Gt(this.priorityNode_)}return Object.defineProperty(t,"__childrenNodeConstructor",{get:function(){return Vt},set:function(t){Vt=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:"+Wt(this.priorityNode_.val())+":");var e=typeof this.value_;t+=e+":",t+="number"===e?U(this.value_):this.value_,this.lazyHash_=m(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}();function Kt(t){qt=t}function zt(t){Bt=t}var Qt,Yt,Xt=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?x(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 Lt.MIN},e.prototype.maxPost=function(){return new Lt(P,new Ht("[PRIORITY-POST]",Bt))},e.prototype.makePost=function(t,e){var n=qt(t);return new Lt(e,new Ht("[PRIORITY-POST]",n))},e.prototype.toString=function(){return".priority"},e}(jt),$t=new Xt,Jt=function(){function t(t,e,n,r,i){void 0===i&&(i=null),this.isReverse_=r,this.resultGenerator_=i,this.nodeStack_=[];var o=1;while(!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_){e=e.left;while(!e.isEmpty())this.nodeStack_.push(e),e=e.right}else{e=e.right;while(!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}(),Zt=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:ee.EMPTY_NODE,this.right=null!=o?o:ee.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,
488null!=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)),r.fixUp_()},t.prototype.removeMin_=function(){if(this.left.isEmpty())return ee.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),t.fixUp_()},t.prototype.remove=function(t,e){var n,r;if(n=this,e(t,n.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 ee.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.copy(null,null,null,null,t.right.rotateRight_()),t=t.rotateLeft_(),t=t.colorFlip_()),t},t.prototype.moveRedRight_=function(){var t=this.colorFlip_();return t.left.left.isRed_()&&(t=t.rotateRight_(),t=t.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+")");
488if(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}(),te=function(){function t(){}return t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.insert=function(t,e,n){return new Zt(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}(),ee=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,Zt.BLACK,null,null))},t.prototype.remove=function(e){return new t(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,Zt.BLACK,null,null))},t.prototype.get=function(t){var e,n=this.root_;while(!n.isEmpty()){if(e=this.comparator_(t,n.key),0===e)return n.value;e<0?n=n.left:e>0&&(n=n.right)}return null},t.prototype.getPredecessorKey=function(t){var e,n=this.root_,r=null;while(!n.isEmpty()){if(e=this.comparator_(t,n.key),0===e){if(n.left.isEmpty())return r?r.key:null;n=n.left;while(!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 Jt(this.root_,null,this.comparator_,!1,t)},t.prototype.getIteratorFrom=function(t,e){return new Jt(this.root_,t,this.comparator_,!1,e)},t.prototype.getReverseIteratorFrom=function(t,e){return new Jt(this.root_,t,this.comparator_,!0,e)},t.prototype.getReverseIterator=function(t){return new Jt(this.root_,null,this.comparator_,!0,t)},t.EMPTY_NODE=new te,t}(),ne=Math.log(2),re=function(){function t(t){var e=function(t){return parseInt(Math.log(t)/ne,10)},n=function(t){return parseInt(Array(t+1).join("1"),2)};this.count=e(t+1),this.current_=this.count-1;var r=n(this.count);this.bits_=t+1&r}return t.prototype.nextBitIsOne=function(){var t=!(this.bits_&1<<this.current_);return this.current_--,t},t}(),ie=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 Zt(s,o.node,Zt.BLACK,null,null);var u=parseInt(a/2,10)+e,c=i(e,u),h=i(u+1,r);return o=t[u],s=n?n(o):o,new Zt(s,o.node,Zt.BLACK,c,h)},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 c=i(o+1,a),h=t[o],l=n?n(h):h;u(new Zt(l,h.node,r,null,c))},u=function(t){r?(r.left=t,r=t):(o=t,r=t)},c=0;c<e.count;++c){var h=e.nextBitIsOne(),l=Math.pow(2,e.count-(c+1));h?a(l,Zt.BLACK):(a(l,Zt.BLACK),a(l,Zt.RED))}return o},s=new re(t.length),a=o(s);return new ee(r||e,a)},oe={},se=function(){function t(t,e){this.indexes_=t,this.indexSet_=e}return Object.defineProperty(t,"Default",{get:function(){return s.assert(oe&&$t,"ChildrenNode.ts has not been loaded"),Qt=Qt||new t({".priority":oe},{".priority":$t}),Qt},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 ee?e:null},t.prototype.hasIndex=function(t){return s.contains(this.indexSet_,t.toString())},t.prototype.addIndex=function(e,n){s.assert(e!==Ft,"KeyIndex always exists and isn't meant to be added to the IndexMap.");var r,i=[],a=!1,u=n.getIterator(Lt.Wrap),c=u.getNext();while(c)a=a||e.isDefinedOn(c.node),i.push(c),c=u.getNext();r=a?ie(i,e.getCompare()):oe;var h=e.toString(),l=o.__assign({},this.indexSet_);l[h]=e;var f=o.__assign({},this.indexes_);return f[h]=r,new t(f,l)},t.prototype.addToIndexes=function(e,n){var r=this,i=s.map(this.indexes_,(function(t,i){var o=s.safeGet(r.indexSet_,i);if(s.assert(o,"Missing index implementation for "+i),t===oe){if(o.isDefinedOn(e.node)){var a=[],u=n.getIterator(Lt.Wrap),c=u.getNext();while(c)c.name!==e.name&&a.push(c),c=u.getNext();return a.push(e),ie(a,o.getCompare())}return oe}var h=n.get(e.name),l=t;
488return h&&(l=l.remove(new Lt(e.name,h))),l.insert(e,e.node)}));return new t(i,this.indexSet_)},t.prototype.removeFromIndexes=function(e,n){var r=s.map(this.indexes_,(function(t){if(t===oe)return t;var r=n.get(e.name);return r?t.remove(new Lt(e.name,r)):t}));return new t(r,this.indexSet_)},t}(); 489/** 490 * @license 491 * Copyright 2017 Google LLC 492 * 493 * Licensed under the Apache License, Version 2.0 (the "License"); 494 * you may not use this file except in compliance with the License. 495 * You may obtain a copy of the License at 496 * 497 * http://www.apache.org/licenses/LICENSE-2.0 498 * 499 * Unless required by applicable law or agreed to in writing, software 500 * distributed under the License is distributed on an "AS IS" BASIS, 501 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 502 * See the License for the specific language governing permissions and 503 * limitations under the License. 504 */ 505function ae(t,e){return x(t.name,e.name)}function ue(t,e){return x(t,e)} 506/** 507 * @license 508 * Copyright 2017 Google LLC 509 * 510 * Licensed under the Apache License, Version 2.0 (the "License"); 511 * you may not use this file except in compliance with the License. 512 * You may obtain a copy of the License at 513 * 514 * http://www.apache.org/licenses/LICENSE-2.0 515 * 516 * Unless required by applicable law or agreed to in writing, software 517 * distributed under the License is distributed on an "AS IS" BASIS, 518 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 519 * See the License for the specific language governing permissions and 520 * limitations under the License. 521 */var ce=function(){function t(t,e,n){this.children_=t,this.priorityNode_=e,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&Gt(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 Yt||(Yt=new t(new ee(ue),null,se.Default))},enumerable:!1,configurable:!0}),t.prototype.isLeafNode=function(){return!1},t.prototype.getPriority=function(){return this.priorityNode_||Yt},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?Yt: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 Lt(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()?Yt: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($t,(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:"+Wt(this.getPriority().val())+":"),this.forEachChild($t,(function(e,n){var r=n.hash();""!==r&&(t+=":"+e+":"+r)})),this.lazyHash_=""===t?"":m(t)}return this.lazyHash_},t.prototype.getPredecessorChildName=function(t,e,n){var r=this.resolveIndex_(n);if(r){var i=r.getPredecessorKey(new Lt(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 Lt(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 Lt(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)}
521,t.prototype.getIteratorFrom=function(t,e){var n=this.resolveIndex_(e);if(n)return n.getIteratorFrom(t,(function(t){return t}));var r=this.children_.getIteratorFrom(t.name,Lt.Wrap),i=r.peek();while(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}));var r=this.children_.getReverseIteratorFrom(t.name,Lt.Wrap),i=r.peek();while(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===le?-1:0},t.prototype.withIndex=function(e){if(e===Ft||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===Ft||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()){var n=this.getIterator($t),r=e.getIterator($t),i=n.getNext(),o=r.getNext();while(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===Ft?null:this.indexMap_.get(t.toString())},t.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/,t}(),he=function(t){function e(){return t.call(this,new ee(ue),ce.EMPTY_NODE,se.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 ce.EMPTY_NODE},e.prototype.isEmpty=function(){return!1},e}(ce),le=new he;Object.defineProperties(Lt,{MIN:{value:new Lt(R,ce.EMPTY_NODE)},MAX:{value:new Lt(P,le)}}),Mt.__EMPTY_NODE=ce.EMPTY_NODE,Ht.__childrenNodeConstructor=ce,Ut(le),zt(le); 522/** 523 * @license 524 * Copyright 2017 Google LLC 525 * 526 * Licensed under the Apache License, Version 2.0 (the "License"); 527 * you may not use this file except in compliance with the License. 528 * You may obtain a copy of the License at 529 * 530 * http://www.apache.org/licenses/LICENSE-2.0 531 * 532 * Unless required by applicable law or agreed to in writing, software 533 * distributed under the License is distributed on an "AS IS" BASIS, 534 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 535 * See the License for the specific language governing permissions and 536 * limitations under the License. 537 */ 538var fe=!0;function pe(t,e){if(void 0===e&&(e=null),null===t)return ce.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){var n=t;return new Ht(n,pe(e))}if(t instanceof Array||!fe){var r=ce.EMPTY_NODE;return F(t,(function(e,n){if(s.contains(t,e)&&"."!==e.substring(0,1)){var i=pe(n);!i.isLeafNode()&&i.isEmpty()||(r=r.updateImmediateChild(e,i))}})),r.updatePriority(pe(e))}var i=[],o=!1,a=t;if(F(a,(function(t,e){if("."!==t.substring(0,1)){var n=pe(e);n.isEmpty()||(o=o||!n.getPriority().isEmpty(),i.push(new Lt(t,n)))}})),0===i.length)return ce.EMPTY_NODE;var u=ie(i,ae,(function(t){return t.name}),ue);if(o){var c=ie(i,$t.getCompare());return new ce(u,pe(e),new se({".priority":c},{".priority":$t}))}return new ce(u,pe(e),se.Default)}Kt(pe); 539/** 540 * @license 541 * Copyright 2017 Google LLC 542 * 543 * Licensed under the Apache License, Version 2.0 (the "License"); 544 * you may not use this file except in compliance with the License. 545 * You may obtain a copy of the License at 546 * 547 * http://www.apache.org/licenses/LICENSE-2.0 548 * 549 * Unless required by applicable law or agreed to in writing, software 550 * distributed under the License is distributed on an "AS IS" BASIS, 551 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 552 * See the License for the specific language governing permissions and 553 * limitations under the License. 554 */ 555var de,ve=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?x(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 Lt.MIN},e.prototype.maxPost=function(){return Lt.MAX},e.prototype.makePost=function(t,e){var n=pe(t);return new Lt(e,n)},e.prototype.toString=function(){return".value"},e}(jt),ge=new ve,ye=function(t){function e(e){var n=t.call(this)||this;return n.indexPath_=e,s.assert(!e.isEmpty()&&".priority"!==e.getFront(),"Can't
555create 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?x(t.name,e.name):i},e.prototype.makePost=function(t,e){var n=pe(t),r=ce.EMPTY_NODE.updateChild(this.indexPath_,n);return new Lt(e,r)},e.prototype.maxPost=function(){var t=ce.EMPTY_NODE.updateChild(this.indexPath_,le);return new Lt(P,t)},e.prototype.toString=function(){return this.indexPath_.slice().join("/")},e}(jt),me=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),Ot("DataSnapshot.child",1,e,!1);var n=new Q(e),r=this.ref_.child(n);return new t(this.node_.getChild(n),r,$t)},t.prototype.hasChild=function(t){s.validateArgCount("DataSnapshot.hasChild",1,1,arguments.length),Ot("DataSnapshot.hasChild",1,t,!1);var e=new Q(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),$t))}))},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}(),_e=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}(),be=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}(),we=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 _e("value",this,new me(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 be(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 be(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 _e(t.type,this,new me(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;
555if(this.context_===e.context_){var r=Object.keys(e.callbacks_),i=Object.keys(this.callbacks_),o=r.length,s=i.length;if(o===s){if(1===o){var a=r[0],u=i[0];return u===a&&(!e.callbacks_[a]||!this.callbacks_[u]||e.callbacks_[a]===this.callbacks_[u])}return i.every((function(t){return e.callbacks_[t]===n.callbacks_[t]}))}}}return!1},t.prototype.hasAnyCallback=function(){return null!==this.callbacks_},t}(),Ie=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(de,"Reference.ts has not been loaded"),de},set:function(t){de=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()===Ft){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()){var o=t.getIndexStartName();if(o!==R)throw new Error(r);if("string"!==typeof e)throw new Error(i)}if(t.hasEnd()){var a=t.getIndexEndName();if(a!==P)throw new Error(r);if("string"!==typeof n)throw new Error(i)}}else if(t.getIndex()===$t){if(null!=e&&!_t(e)||null!=n&&!_t(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 ye||t.getIndex()===ge,"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),Ct("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 we(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),Ct("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 we(o,null,n||null)}else t&&(e&&(i={},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),Ct("Query.once",1,e,!1),s.validateCallback("Query.once",2,n,!0);var a=t.getCancelAndContextArgs_("Query.once",r,i),u=!0,c=new s.Deferred;c.promise.catch((function(){}));var h=function(t){u&&(u=!1,o.off(e,h),n&&n.bind(a.context)(t),c.resolve(t))};return this.on(e,h,(function(t){o.off(e,h),a.cancel&&a.cancel.bind(a.context)(t),c.reject(t)})),c.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
555(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.');Ot("Query.orderByChild",1,e,!1),this.validateNoPreviousOrderByCall_("Query.orderByChild");var n=new Q(e);if(n.isEmpty())throw new Error("Query.orderByChild: cannot pass in empty path. Use Query.orderByValue() instead.");var r=new ye(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(Ft);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($t);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(ge);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),bt("Query.startAt",1,e,this.path,!0),St("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),bt("Query.endAt",1,e,this.path,!0),St("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),bt("Query.equalTo",1,t,this.path,!1),St("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=j(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)}
555var 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}(),Te=function(){function t(t){this.node_=t}return t.prototype.getImmediateChild=function(e){var n=this.node_.getImmediateChild(e);return new t(n)},t.prototype.node=function(){return this.node_},t}(),Ce=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}(),Se=function(t){return t=t||{},t["timestamp"]=t["timestamp"]||(new Date).getTime(),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"]?Ne(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},Ne=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&&"undefined"!==typeof i,"Expected ChildrenNode.EMPTY_NODE for nulls"),!i.isLeafNode())return r;var o=i,a=o.getValue();return"number"!==typeof a?r:a+r},ke=function(t,e,n,r){return Pe(e,new Ce(n,t),r)},Re=function(t,e,n){return Pe(t,new Te(e),n)};function Pe(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 Ht(a,pe(o)):t}var u=t;return r=u,o!==u.getPriority().val()&&(r=r.updatePriority(new Ht(o))),u.forEachChild($t,(function(t,i){var o=Pe(i,e.getImmediateChild(t),n);o!==i&&(r=r.updateImmediateChild(t,o))})),r} 556/** 557 * @license 558 * Copyright 2017 Google LLC 559 * 560 * Licensed under the Apache License, Version 2.0 (the "License"); 561 * you may not use this file except in compliance with the License. 562 * You may obtain a copy of the License at 563 * 564 * http://www.apache.org/licenses/LICENSE-2.0 565 * 566 * Unless required by applicable law or agreed to in writing, software 567 * distributed under the License is distributed on an "AS IS" BASIS, 568 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 569 * See the License for the specific language governing permissions and 570 * limitations under the License. 571 */var xe,De=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();if(t=t.popFront(),this.children.has(e)){var n=this.children.get(e);return n.find(t)}return 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($t,(function(t,e){n.remember(new Q(t),e)})),this.forget(t)}if(this.children.size>0){var r=t.getFront();if(t=t.popFront(),this.children.has(r)){var i=this.children.get(r).forget(t);i&&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 Q(t.toString()+"/"+n);r.forEachTree(i,e)}))}
571,t.prototype.forEachChild=function(t){this.children.forEach((function(e,n){t(n,e)}))},t}(); 572/** 573 * @license 574 * Copyright 2017 Google LLC 575 * 576 * Licensed under the Apache License, Version 2.0 (the "License"); 577 * you may not use this file except in compliance with the License. 578 * You may obtain a copy of the License at 579 * 580 * http://www.apache.org/licenses/LICENSE-2.0 581 * 582 * Unless required by applicable law or agreed to in writing, software 583 * distributed under the License is distributed on an "AS IS" BASIS, 584 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 585 * See the License for the specific language governing permissions and 586 * limitations under the License. 587 */(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"})(xe||(xe={}));var Le,je,Me=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}(),Fe=function(){function t(t,e,n){this.path=t,this.affectedTree=e,this.revert=n,this.type=xe.ACK_USER_WRITE,this.source=Me.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 Q(e));return new t(Q.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}(),Ue=function(){return Le||(Le=new ee(D)),Le},Ve=function(){function t(t,e){void 0===e&&(e=Ue()),this.value=t,this.children=e}return t.fromObject=function(e){var n=t.Empty;return F(e,(function(t,e){n=n.set(new Q(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:Q.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);if(null!=i){var o=new Q(n).child(i.path);return{path:o,value:i.value}}return 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,o=i.set(e.popFront(),n),s=this.children.insert(r,o);return new t(this.value,s)},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,o=i.setTree(e.popFront(),n),s=void 0;return s=o.isEmpty()?this.children.remove(r):this.children.insert(r,o),new t(this.value,s)},t.prototype.fold=function(t){return this.fold_(Q.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,Q.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,Q.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_(Q.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){
587n.value&&t(e,n.value)}))},t.Empty=new t(null),t}(),qe=function(){function t(t,e){this.source=t,this.path=e,this.type=xe.LISTEN_COMPLETE}return t.prototype.operationForChild=function(e){return this.path.isEmpty()?new t(this.source,Q.Empty):new t(this.source,this.path.popFront())},t}(),Be=function(){function t(t,e,n){this.source=t,this.path=e,this.snap=n,this.type=xe.OVERWRITE}return t.prototype.operationForChild=function(e){return this.path.isEmpty()?new t(this.source,Q.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=xe.MERGE}return t.prototype.operationForChild=function(e){if(this.path.isEmpty()){var n=this.children.subtree(new Q(e));return n.isEmpty()?null:n.value?new Be(this.source,Q.Empty,n.value):new t(this.source,Q.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}(),Ge=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}(),He=function(){function t(t,e){this.eventCache_=t,this.serverCache_=e}return t.prototype.updateEventSnap=function(e,n,r){return new t(new Ge(e,n,r),this.serverCache_)},t.prototype.updateServerSnap=function(e,n,r){return new t(this.eventCache_,new Ge(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 Ge(ce.EMPTY_NODE,!1,!1),new Ge(ce.EMPTY_NODE,!1,!1)),t}(),Ke=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}(),ze=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(Ke.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(Ke.childAddedChange(e,n)):o.trackChildChange(Ke.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($t,(function(t,r){e.hasChild(t)||n.trackChildChange(Ke.childRemovedChange(t,r))})),e.isLeafNode()||e.forEachChild($t,(function(e,r){if(t.hasChild(e)){var i=t.getImmediateChild(e);i.equals(r)||n.trackChildChange(Ke.childChangedChange(e,r,i))}else n.trackChildChange(Ke.childAddedChange(e,r))}))),e.withIndex(this.index_)},t.prototype.updatePriority=function(t,e){return t.isEmpty()?ce.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}(),Qe=function(){function t(){this.changeMap=new Map}return t.prototype.trackChildChange=function(t){var e=t.type,n=t.childName;s.assert(e===Ke.CHILD_ADDED||e===Ke.CHILD_CHANGED||e===Ke.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===Ke.CHILD_ADDED&&i===Ke.CHILD_REMOVED)this.changeMap.set(n,Ke.childChangedChange(n,t.snapshotNode,r.snapshotNode));else if(e===Ke.CHILD_REMOVED&&i===Ke.CHILD_ADDED)this.changeMap.delete(n);else if(e===Ke.CHILD_REMOVED&&i===Ke.CHILD_CHANGED)this.changeMap.set(n,Ke.childRemovedChange(n,r.oldSnap));else if(e===Ke.CHILD_CHANGED&&i===Ke.CHILD_ADDED)this.changeMap.set(n,Ke.childAddedChange(n,t.snapshotNode));else{if(e!==Ke.CHILD_CHANGED||i!==Ke.CHILD_CHANGED)throw s.assertionError("Illegal combination of changes: "+t+" occurred after "+r);this.changeMap.set(n,Ke.childChangedChange(n,t.snapshotNode,r.oldSnap))}}else this.changeMap.set(n,t)},t.prototype.getChanges=function(){return Array.from(this.changeMap.values())},t}(),Ye=function(){function t(){}return t.prototype.getCompleteChild=function(t){return null},t.prototype.getChildAfterChild=function(t,e,n){return null},t}(),Xe=new Ye,$e=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 Ge(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}(),Je=function(){function t(t,e){this.viewCache=t,this.changes=e}return t}
587(),Ze=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,u=new Qe;if(n.type===xe.OVERWRITE){var c=n;c.source.fromUser?o=this.applyUserOverwrite_(e,c.path,c.snap,r,i,u):(s.assert(c.source.fromServer,"Unknown source."),a=c.source.tagged||e.getServerCache().isFiltered()&&!c.path.isEmpty(),o=this.applyServerOverwrite_(e,c.path,c.snap,r,i,a,u))}else if(n.type===xe.MERGE){var h=n;h.source.fromUser?o=this.applyUserMerge_(e,h.path,h.children,r,i,u):(s.assert(h.source.fromServer,"Unknown source."),a=h.source.tagged||e.getServerCache().isFiltered(),o=this.applyServerMerge_(e,h.path,h.children,r,i,a,u))}else if(n.type===xe.ACK_USER_WRITE){var l=n;o=l.revert?this.revertUserWrite_(e,l.path,r,i,u):this.ackUserWrite_(e,l.path,l.affectedTree,r,i,u)}else{if(n.type!==xe.LISTEN_COMPLETE)throw s.assertionError("Unknown operation type: "+n.type);o=this.listenComplete_(e,n.path,r,u)}var f=u.getChanges();return t.maybeAddValueEvent_(e,o,f),new Je(o,f)},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>0||!t.getEventCache().isFullyInitialized()||i&&!r.getNode().equals(o)||!r.getNode().getPriority().equals(o.getPriority()))&&n.push(Ke.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,u=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 c=t.getCompleteServerSnap(),h=c instanceof ce?c:ce.EMPTY_NODE,l=n.calcCompleteEventChildren(h);a=this.filter_.updateFullNode(t.getEventCache().getNode(),l,i)}else{var f=n.calcCompleteEventCache(t.getCompleteServerSnap());a=this.filter_.updateFullNode(t.getEventCache().getNode(),f,i)}else{var p=e.getFront();if(".priority"===p){s.assert(1===e.getLength(),"Can't have a priority with additional path components");var d=o.getNode();u=t.getServerCache().getNode();var v=n.calcEventCacheAfterServerOverwrite(e,d,u);a=null!=v?this.filter_.updatePriority(d,v):o.getNode()}else{var g=e.popFront(),y=void 0;if(o.isCompleteForChild(p)){u=t.getServerCache().getNode();var m=n.calcEventCacheAfterServerOverwrite(e,o.getNode(),u);y=null!=m?o.getNode().getImmediateChild(p).updateChild(g,m):o.getNode().getImmediateChild(p)}else y=n.calcCompleteChild(p,t.getServerCache());a=null!=y?this.filter_.updateChild(o.getNode(),p,y,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,u=t.getServerCache(),c=o?this.filter_:this.filter_.getIndexedFilter();if(e.isEmpty())a=c.updateFullNode(u.getNode(),n,null);else if(c.filtersNodes()&&!u.isFiltered()){var h=u.getNode().updateChild(e,n);a=c.updateFullNode(u.getNode(),h,null)}else{var l=e.getFront();if(!u.isCompleteForPath(e)&&e.getLength()>1)return t;var f=e.popFront(),p=u.getNode().getImmediateChild(l),d=p.updateChild(f,n);a=".priority"===l?c.updatePriority(u.getNode(),d):c.updateChild(u.getNode(),l,d,f,Xe,null)}var v=t.updateServerSnap(a,u.isFullyInitialized()||e.isEmpty(),c.filtersNodes()),g=new $e(r,v,i);return this.generateEventCacheAfterServerEvent_(v,e,r,g,s)},t.prototype.applyUserOverwrite_=function(t,e,n,r,i,o){var s,a,u=t.getEventCache(),c=new $e(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 h=e.getFront();if(".priority"===h)a=this.filter_.updatePriority(t.getEventCache().getNode(),n),s=t.updateEventSnap(a,u.isFullyInitialized(),u.isFiltered());else{var l=e.popFront(),f=u.getNode().getImmediateChild(h),p=void 0;if(l.isEmpty())p=n;else{var d=c.getCompleteChild(h);p=null!=d?".priority"===l.getBack()&&d.getChild(l.parent()).isEmpty()?d:d.updateChild(l,n):ce.EMPTY_NODE}if(f.equals(p))s=t;else{var v=this.filter_.updateChild(u.getNode(),h,p,l,c,o);s=t.updateEventSnap(v,u.isFullyInitialized(),this.filter_.filtersNodes())}}}return s}
587,t.cacheHasChild_=function(t,e){return t.getEventCache().isCompleteForChild(e)},t.prototype.applyUserMerge_=function(e,n,r,i,o,s){var a=this,u=e;return r.foreach((function(r,c){var h=n.child(r);t.cacheHasChild_(e,h.getFront())&&(u=a.applyUserOverwrite_(u,h,c,i,o,s))})),r.foreach((function(r,c){var h=n.child(r);t.cacheHasChild_(e,h.getFront())||(u=a.applyUserOverwrite_(u,h,c,i,o,s))})),u},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 u,c=t;u=e.isEmpty()?n:Ve.Empty.setTree(e,n);var h=t.getServerCache().getNode();return u.children.inorderTraversal((function(e,n){if(h.hasChild(e)){var u=t.getServerCache().getNode().getImmediateChild(e),l=a.applyMerge_(u,n);c=a.applyServerOverwrite_(c,new Q(e),l,r,i,o,s)}})),u.children.inorderTraversal((function(e,n){var u=!t.getServerCache().isCompleteForChild(e)&&null==n.value;if(!h.hasChild(e)&&!u){var l=t.getServerCache().getNode().getImmediateChild(e),f=a.applyMerge_(l,n);c=a.applyServerOverwrite_(c,new Q(e),f,r,i,o,s)}})),c},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 u=Ve.Empty;return a.getNode().forEachChild(Ft,(function(t,e){u=u.set(new Q(t),e)})),this.applyServerMerge_(t,e,u,r,i,s,o)}return t}var c=Ve.Empty;return n.foreach((function(t,n){var r=e.child(t);a.isCompleteForPath(r)&&(c=c.set(t,a.getNode().getChild(r)))})),this.applyServerMerge_(t,e,c,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,Xe,r)},t.prototype.revertUserWrite_=function(t,e,n,r,i){var o;if(null!=n.shadowingWrite(e))return t;var a=new $e(n,t,r),u=t.getEventCache().getNode(),c=void 0;if(e.isEmpty()||".priority"===e.getFront()){var h=void 0;if(t.getServerCache().isFullyInitialized())h=n.calcCompleteEventCache(t.getCompleteServerSnap());else{var l=t.getServerCache().getNode();s.assert(l instanceof ce,"serverChildren would be complete if leaf node"),h=n.calcCompleteEventChildren(l)}h=h,c=this.filter_.updateFullNode(u,h,i)}else{var f=e.getFront(),p=n.calcCompleteChild(f,t.getServerCache());null==p&&t.getServerCache().isCompleteForChild(f)&&(p=u.getImmediateChild(f)),c=null!=p?this.filter_.updateChild(u,f,p,e.popFront(),a,i):t.getEventCache().getNode().hasChild(f)?this.filter_.updateChild(u,f,ce.EMPTY_NODE,e.popFront(),a,i):u,c.isEmpty()&&t.getServerCache().isFullyInitialized()&&(o=n.calcCompleteEventCache(t.getCompleteServerSnap()),o.isLeafNode()&&(c=this.filter_.updateFullNode(c,o,i)))}return o=t.getServerCache().isFullyInitialized()||null!=n.shadowingWrite(Q.Empty),t.updateEventSnap(c,o,this.filter_.filtersNodes())},t}(),tn=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===Ke.CHILD_CHANGED&&r.index_.indexedValueChanged(t.oldSnap,t.snapshotNode)&&o.push(Ke.childMovedChange(t.childName,t.snapshotNode))})),this.generateEventsForType_(i,Ke.CHILD_REMOVED,t,n,e),this.generateEventsForType_(i,Ke.CHILD_ADDED,t,n,e),this.generateEventsForType_(i,Ke.CHILD_MOVED,o,n,e),this.generateEventsForType_(i,Ke.CHILD_CHANGED,t,n,e),this.generateEventsForType_(i,Ke.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.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 Lt(t.childName,t.snapshotNode),r=new Lt(e.childName,e.snapshotNode);return this.index_.compare(n,r)},t}(),en=function(){function t(t,e){this.query_=t,this.eventRegistrations_=[];var n=this.query_.getQueryParams(),r=new ze(n.getIndex()),i=n.getNodeFilter();this.processor_=new Ze(i);var o=e.getServerCache(),s=e.getEventCache(),a=r.updateFullNode(ce.EMPTY_NODE,o.getNode(),null),u=i.updateFullNode(ce.EMPTY_NODE,s.getNode(),null),c=new Ge(a,o.isFullyInitialized(),r.filtersNodes()),h=new Ge(u,s.isFullyInitialized(),i.filtersNodes());this.viewCache_=new He(h,c),this.eventGenerator_=new tn(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===xe.MERGE&&null!==t.source.queryId&&(s.assert(this.viewCache_.getCompleteServerSnap(),"We should always have a full c
587ache 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=[];if(!e.getNode().isLeafNode()){var r=e.getNode();r.forEachChild($t,(function(t,e){n.push(Ke.childAddedChange(t,e))}))}return e.isFullyInitialized()&&n.push(Ke.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}(),nn=function(){function t(){this.views=new Map}return Object.defineProperty(t,"__referenceConstructor",{get:function(){return s.assert(je,"Reference.ts has not been loaded"),je},set:function(t){s.assert(!je,"__referenceConstructor has already been defined"),je=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 u=this.views.get(a);return s.assert(null!=u,"SyncTree gave us an op for an invalid query."),u.applyOperation(t,e,n)}var c=[];try{for(var h=o.__values(this.views.values()),l=h.next();!l.done;l=h.next()){u=l.value;c=c.concat(u.applyOperation(t,e,n))}}catch(f){r={error:f}}finally{try{l&&!l.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return c},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),u=!1;a?u=!0:r instanceof ce?(a=n.calcCompleteEventChildren(r),u=!1):(a=ce.EMPTY_NODE,u=!1);var c=new He(new Ge(a,u,!1),new Ge(r,i,!1));s=new en(t,c),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(),u=[],c=[],h=this.hasCompleteView();if("default"===a)try{for(var l=o.__values(this.views.entries()),f=l.next();!f.done;f=l.next()){var p=o.__read(f.value,2),d=p[0],v=p[1];c=c.concat(v.removeEventRegistration(n,r)),v.isEmpty()&&(this.views.delete(d),v.getQuery().getQueryParams().loadsAllData()||u.push(v.getQuery()))}}catch(g){i={error:g}}finally{try{f&&!f.done&&(s=l.return)&&s.call(l)}finally{if(i)throw i.error}}else{v=this.views.get(a);v&&(c=c.concat(v.removeEventRegistration(n,r)),v.isEmpty()&&(this.views.delete(a),v.getQuery().getQueryParams().loadsAllData()||u.push(v.getQuery())))}return h&&!this.hasCompleteView()&&u.push(new t.__referenceConstructor(e.repo,e.path)),{removed:u,events:c}},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(a){t={error:a}}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(u){e={error:u}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},t.prototype.viewForQuery=function(t){var e=t.getQueryParams();if(e.loadsAllData())return this.getCompleteView();var n=t.queryIdentifier();return this.views.get(n)},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(s){t={error:s}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return null},t}(),rn=function(){function t(t){this.writeTree_=t}return t.prototype.addWrite=function(e,n){if(e.isEmpty())return new t(new Ve(n));var r=this.writeTree_.findRootMostValueAndPath(e);if(null!=r){var i=r.path,o=r.value,s=Q.relativePath(i,e);return o=o.updateChild(s,n),new t(this.writeTree_.set(i,o))}var a=new Ve(n),u=this.writeTree_.setTree(e,a);return new t(u)},t.prototype.addWrites=function(t,e){var n=this;return F(e,(function(e,r){n=n.addWrite(t.child(e),r)})),n},t.prototype.removeWrite=function(e){if(e.isEmpty())return t.Empty;var n=this.writeTree_.setTree(e,Ve.Empty);return new t(n)},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(Q.relativePath(e.path,t)):null},t.prototype.getCompleteChildren=function(){var t=[],e=this.writeTree_.value;return null!=e?e.isLeafNode()||e.forEachChild($t,(function(e,n){t.push(new Lt(e,n))}
587)):this.writeTree_.children.inorderTraversal((function(e,n){null!=n.value&&t.push(new Lt(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 Ve(n):this.writeTree_.subtree(e))},t.prototype.isEmpty=function(){return this.writeTree_.isEmpty()},t.prototype.apply=function(t){return on(Q.Empty,this.writeTree_,t)},t.Empty=new t(new Ve(null)),t}(); 588/** 589 * @license 590 * Copyright 2017 Google LLC 591 * 592 * Licensed under the Apache License, Version 2.0 (the "License"); 593 * you may not use this file except in compliance with the License. 594 * You may obtain a copy of the License at 595 * 596 * http://www.apache.org/licenses/LICENSE-2.0 597 * 598 * Unless required by applicable law or agreed to in writing, software 599 * distributed under the License is distributed on an "AS IS" BASIS, 600 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 601 * See the License for the specific language governing permissions and 602 * limitations under the License. 603 */function on(t,e,n){if(null!=e.value)return n.updateChild(t,e.value);var r=null;return e.children.inorderTraversal((function(e,i){".priority"===e?(s.assert(null!==i.value,"Priority writes must always be leaf nodes"),r=i.value):n=on(t.child(e),i,n)})),n.getChild(t).isEmpty()||null===r||(n=n.updateChild(t.child(".priority"),r)),n} 604/** 605 * @license 606 * Copyright 2017 Google LLC 607 * 608 * Licensed under the Apache License, Version 2.0 (the "License"); 609 * you may not use this file except in compliance with the License. 610 * You may obtain a copy of the License at 611 * 612 * http://www.apache.org/licenses/LICENSE-2.0 613 * 614 * Unless required by applicable law or agreed to in writing, software 615 * distributed under the License is distributed on an "AS IS" BASIS, 616 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 617 * See the License for the specific language governing permissions and 618 * limitations under the License. 619 */var sn=function(){function t(){this.visibleWrites_=rn.Empty,this.allWrites_=[],this.lastWriteId_=-1}return t.prototype.childWrites=function(t){return new an(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);var i=r.visible,o=!1,a=this.allWrites_.length-1;while(i&&a>=0){var u=this.allWrites_[a];u.visible&&(a>=n&&this.recordContainsPath_(u,r.path)?i=!1:r.path.contains(u.path)&&(o=!0)),a--}if(i){if(o)return this.resetTree_(),!0;if(r.snap)this.visibleWrites_=this.visibleWrites_.removeWrite(r.path);else{var c=r.children;F(c,(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(Q.Empty)){var s=function(t){return(t.visible||i)&&(!r||!~r.indexOf(t.writeId))&&(t.path.contains(e)||e.contains(t.path))},a=t.layerTree_(this.allWrites_,s,e);h=n||ce.EMPTY_NODE;return a.apply(h)}return null}var u=this.visibleWrites_.getCompleteNode(e);if(null!=u)return u;var c=this.visibleWrites_.childCompoundWrite(e);if(c.isEmpty())return n;if(null!=n||c.hasCompleteWrite(Q.Empty)){var h=n||ce.EMPTY_NODE;return c.apply(h)}return null},t.prototype.calcCompleteEventChildren=function(t,e){var n=ce.EMPTY_NODE,r=this.visibleWrites_.getCompleteNode(t);if(r)return r.isLeafNode()||r.forEachChild($t,(function(t,e){n=n.updateImmediateChild(t,e)})),n;if(e){var i=this.visibleWrites_.childCompoundWrite(t);return e.forEachChild($t,(function(t,e){var r=i.childCompoundWrite(new Q(t)).apply(e);n=n.updateImmediateChild(t,r)}
619)),i.getCompleteChildren().forEach((function(t){n=n.updateImmediateChild(t.name,t.node)})),n}var o=this.visibleWrites_.childCompoundWrite(t);return o.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);if(null!=i)return i;if(n.isCompleteForChild(e)){var o=this.visibleWrites_.childCompoundWrite(r);return o.apply(n.getNode().getImmediateChild(e))}return 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),u=a.getCompleteNode(Q.Empty);if(null!=u)s=u;else{if(null==e)return[];s=a.apply(e)}if(s=s.withIndex(o),s.isEmpty()||s.isLeafNode())return[];var c=[],h=o.getCompare(),l=i?s.getReverseIteratorFrom(n,o):s.getIteratorFrom(n,o),f=l.getNext();while(f&&c.length<r)0!==h(f,n)&&c.push(f),f=l.getNext();return c},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_,Q.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=rn.Empty,i=0;i<t.length;++i){var o=t[i];if(e(o)){var a=o.path,u=void 0;if(o.snap)n.contains(a)?(u=Q.relativePath(n,a),r=r.addWrite(u,o.snap)):a.contains(n)&&(u=Q.relativePath(a,n),r=r.addWrite(Q.Empty,o.snap.getChild(u)));else{if(!o.children)throw s.assertionError("WriteRecord should have .snap or .children");if(n.contains(a))u=Q.relativePath(n,a),r=r.addWrites(u,o.children);else if(a.contains(n))if(u=Q.relativePath(a,n),u.isEmpty())r=r.addWrites(Q.Empty,o.children);else{var c=s.safeGet(o.children,u.getFront());if(c){var h=c.getChild(u.popFront());r=r.addWrite(Q.Empty,h)}}}}}return r},t}(),an=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}(),un=function(){function t(t){this.listenProvider_=t,this.syncPointTree_=Ve.Empty,this.pendingWriteTree_=new sn,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 Be(Me.User,t,e)):[]},t.prototype.applyUserMerge=function(t,e,n){this.pendingWriteTree_.addMerge(t,e,n);var r=Ve.fromObject(e);return this.applyOperationToSyncPoints_(new We(Me.User,t,r))},t.prototype.ackUserWrite=function(t,e){void 0===e&&(e=!1);var n=this.pendingWriteTree_.getWrite(t),r=this.pendingWriteTree_.removeWrite(t);if(r){var i=Ve.Empty;return null!=n.snap?i=i.set(Q.Empty,!0):F(n.children,(function(t,e){i=i.set(new Q(t),e)})),this.applyOperationToSyncPoints_(new Fe(n.path,i,e))}return[]},t.prototype.applyServerOverwrite=function(t,e){return this.applyOperationToSyncPoints_(new Be(Me.Server,t,e))},t.prototype.applyServerMerge=function(t,e){var n=Ve.fromObject(e);return this.applyOperationToSyncPoints_(new We(Me.Server,t,n))},t.prototype.applyListenComplete=function(t){return this.applyOperationToSyncPoints_(new qe(Me.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,u=Q.relativePath(s,e),c=new Be(Me.forServerTaggedQuery(a),u,n);
619return this.applyTaggedOperation_(s,c)}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,u=Q.relativePath(s,e),c=Ve.fromObject(n),h=new We(Me.forServerTaggedQuery(a),u,c);return this.applyTaggedOperation_(s,h)}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=Q.relativePath(o,e),u=new qe(Me.forServerTaggedQuery(s),a);return this.applyTaggedOperation_(o,u)}return[]},t.prototype.addEventRegistration=function(e,n){var r=e.path,i=null,o=!1;this.syncPointTree_.foreachOnPath(r,(function(t,e){var n=Q.relativePath(t,r);i=i||e.getCompleteServerCache(n),o=o||e.hasCompleteView()}));var a,u=this.syncPointTree_.get(r);if(u?(o=o||u.hasCompleteView(),i=i||u.getCompleteServerCache(Q.Empty)):(u=new nn,this.syncPointTree_=this.syncPointTree_.set(r,u)),null!=i)a=!0;else{a=!1,i=ce.EMPTY_NODE;var c=this.syncPointTree_.subtree(r);c.foreachChild((function(t,e){var n=e.getCompleteServerCache(Q.Empty);n&&(i=i.updateImmediateChild(t,n))}))}var h=u.viewExistsForQuery(e);if(!h&&!e.getQueryParams().loadsAllData()){var l=t.makeQueryKey_(e);s.assert(!this.queryToTagMap.has(l),"View does not exist, but we have a tag");var f=t.getNextQueryTag_();this.queryToTagMap.set(l,f),this.tagToQueryMap.set(f,l)}var p=this.pendingWriteTree_.childWrites(r),d=u.addEventRegistration(e,n,p,i,a);if(!h&&!o){var v=u.viewForQuery(e);d=d.concat(this.setupListener_(e,v))}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 u=s.removeEventRegistration(e,n,r);s.isEmpty()&&(this.syncPointTree_=this.syncPointTree_.remove(o));var c=u.removed;a=u.events;var h=-1!==c.findIndex((function(t){return t.getQueryParams().loadsAllData()})),l=this.syncPointTree_.findOnPath(o,(function(t,e){return e.hasCompleteView()}));if(h&&!l){var f=this.syncPointTree_.subtree(o);if(!f.isEmpty())for(var p=this.collectDistinctViewsForSubTree_(f),d=0;d<p.length;++d){var v=p[d],g=v.getQuery(),y=this.createListenerForView_(v);this.listenProvider_.startListening(t.queryForListening_(g),this.tagForQuery_(g),y.hashFn,y.onComplete)}}if(!l&&c.length>0&&!r)if(h){var m=null;this.listenProvider_.stopListening(t.queryForListening_(e),m)}else c.forEach((function(e){var n=i.queryToTagMap.get(t.makeQueryKey_(e));i.listenProvider_.stopListening(t.queryForListening_(e),n)}));this.removeTags_(c)}return a},t.prototype.calcCompleteEventCache=function(t,e){var n=!0,r=this.pendingWriteTree_,i=this.syncPointTree_.findOnPath(t,(function(e,n){var r=Q.relativePath(e,t),i=n.getCompleteServerCache(r);if(i)return i}));return r.calcCompleteEventCache(t,i,e,n)},t.prototype.collectDistinctViewsForSubTree_=function(t){return t.fold((function(t,e,n){if(e&&e.hasCompleteView()){var r=e.getCompleteView();return[r]}var i=[];return e&&(i=e.getQueryViews()),F(n,(function(t,e){i=i.concat(e)})),i}))},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()&&
619!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),u=this.syncPointTree_.subtree(r);if(i)s.assert(!u.value.hasCompleteView(),"If we're adding a query, it shouldn't be shadowed");else for(var c=u.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()})))),F(n,(function(t,e){r=r.concat(e)})),r})),h=0;h<c.length;++h){var l=c[h];this.listenProvider_.stopListening(t.queryForListening_(l),this.tagForQuery_(l))}return a},t.prototype.createListenerForView_=function(t){var e=this,n=t.getQuery(),r=this.tagForQuery_(n);return{hashFn:function(){var e=t.getServerCache()||ce.EMPTY_NODE;return e.hash()},onComplete:function(t){if("ok"===t)return r?e.applyTaggedListenComplete(n.path,r):e.applyListenComplete(n.path);var i=B(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 Q(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(Q.Empty))},t.prototype.applyOperationHelper_=function(t,e,n,r){if(t.path.isEmpty())return this.applyOperationDescendantsHelper_(t,e,n,r);var i=e.get(Q.Empty);null==n&&null!=i&&(n=i.getCompleteServerCache(Q.Empty));var o=[],s=t.path.getFront(),a=t.operationForChild(s),u=e.children.get(s);if(u&&a){var c=n?n.getImmediateChild(s):null,h=r.child(s);o=o.concat(this.applyOperationHelper_(a,u,c,h))}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(Q.Empty);null==n&&null!=o&&(n=o.getCompleteServerCache(Q.Empty));var s=[];return e.children.inorderTraversal((function(e,o){var a=n?n.getImmediateChild(e):null,u=r.child(e),c=t.operationForChild(e);c&&(s=s.concat(i.applyOperationDescendantsHelper_(c,o,a,u)))})),o&&(s=s.concat(o.applyOperation(t,r,n))),s},t.nextQueryTag_=1,t}(),cn=function(){function t(){this.rootNode_=ce.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}(),hn=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}(),ln=function(){function t(){}return t.getCollection=function(t){var e=t.toString();return this.collections_[e]||(this.collections_[e]=new hn),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}(),fn=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_&&F(this.last_,(function(t,n){e[t]=e[t]-n})),this.last_=t,e},t}(),pn=1e4,dn=3e4,vn=3e5,gn=function(){function t(t,e){this.server_=e,this.statsToReport_={},this.statsListener_=new fn(t);var n=pn+(dn-pn)*Math.random();z(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;F(e,(function(e,i){i>0&&s.contains(t.statsToReport_,e)&&(n[e]=i,r=!0)})),r&&this.server_.reportStats(n),z(this.reportStats_.bind(this),Math.floor(2*Math.random()*vn))},t}(),yn=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 mn(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){var i=r.getPath();t(i)?(this.eventLists_[n].raise(),this.eventLists_[n]=null):e=!1}}e&&(this.eventLists_=[]),this.recursionDepth_--},t}(),mn=function(){function t(t){this.path_=t,this.events_=[]}
619return 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();b&&I("event: "+e.toString()),H(n)}}},t.prototype.getPath=function(){return this.path_},t}(),_n=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}(),bn=function(t){function e(){var e,n,r=t.call(this,["visible"])||this;return"undefined"!==typeof document&&"undefined"!==typeof document.addEventListener&&("undefined"!==typeof document["hidden"]?(n="visibilitychange",e="hidden"):"undefined"!==typeof document["mozHidden"]?(n="mozvisibilitychange",e="mozHidden"):"undefined"!==typeof document["msHidden"]?(n="msvisibilitychange",e="msHidden"):"undefined"!==typeof 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}(_n),wn=function(t){function e(){var e=t.call(this,["online"])||this;return e.online_=!0,"undefined"===typeof window||"undefined"===typeof 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}(_n),En=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;var r=function(){var t=i.pendingResponses[i.currentResponseNum];delete i.pendingResponses[i.currentResponseNum];for(var e=function(e){t[e]&&H((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;while(this.pendingResponses[this.currentResponseNum]){var o=r();if("break"===o)break}},t}(),In="start",Tn="close",Cn="pLPCommand",Sn="pRTLPCB",On="id",Nn="pw",An="ser",kn="cb",Rn="seg",Pn="ts",xn="d",Dn="dframe",Ln=1870,jn=30,Mn=Ln-jn,Fn=25e3,Un=3e4,Vn=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_=T(t),this.stats_=ln.getCollection(e),this.urlFn=function(t){return e.connectionURL(ot,t)}}return t.prototype.open=function(t,e){var n=this;this.curSegmentNum=0,this.onDisconnect_=e,this.myPacketOrderer=new En(t),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout((function(){n.log_("Timed out trying to connect."),n.onClosed_(),n.connectTimeoutTimer_=null}),Math.floor(Un)),k((function(){if(!n.isClosed_){n.scriptTagHolder=new qn((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,i===In)n.id=s,n.password=a;else{if(i!==Tn)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={};t[In]="t",t[An]=Math.floor(1e8*Math.random()),n.scriptTagHolder.uniqueCallbackIdentifier&&(t[kn]=n.scriptTagHolder.uniqueCallbackIdentifier),t[$]=X,n.transportSessionId&&(t[J]=n.transportSessionId),n.lastSessionId&&(t[nt]=n.lastSessionId),n.applicationId&&(t[rt]=n.applicationId),"undefined"!==typeof location&&location.href&&-1!==location.href.indexOf(et)&&(t[Z]=tt);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&&!V()&&!q())},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=M(n,Mn),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={};n[Dn]="t",n[On]=t,n[Nn]=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}(),qn=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[Cn+this.uniqueCallbackIdentifier]=e,window[Sn+this.uniqueCallbackIdentifier]=n,this.myIFrame=t.createI
619Frame_();var o="";if(this.myIFrame.src&&"javascript:"===this.myIFrame.src.substr(0,"javascript:".length)){var a=document.domain;o='<script>document.domain="'+a+'";<\/script>'}var u="<html><body>"+o+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(u),this.myIFrame.doc.close()}catch(c){I("frame writing exception"),c.stack&&I(c.stack),I(c)}}}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{var e=t.contentWindow.document;e||I("No IE domain setting required")}catch(r){var n=document.domain;t.src="javascript:void((function(){document.open();document.domain='"+n+"';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){this.myID=t,this.myPW=e,this.alive=!0;while(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[On]=this.myID,t[Nn]=this.myPW,t[An]=this.currentSerial;var e=this.urlFn(t),n="",r=0;while(this.pendingSegs.length>0){var i=this.pendingSegs[0];if(!(i.d.length+jn+n.length<=Ln))break;var o=this.pendingSegs.shift();n=n+"&"+Rn+r+"="+o.seg+"&"+Pn+r+"="+o.ts+"&"+xn+r+"="+o.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(Fn)),o=function(){clearTimeout(i),r()};this.addTag(t,o)},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(){I("Long-poll script failed to load: "+t),n.sendNewPolls=!1,n.close()},n.myIFrame.doc.body.appendChild(r)}catch(i){}}),Math.floor(1))},t}(),Bn="";function Wn(t){Bn=t} 620/** 621 * @license 622 * Copyright 2017 Google LLC 623 * 624 * Licensed under the Apache License, Version 2.0 (the "License"); 625 * you may not use this file except in compliance with the License. 626 * You may obtain a copy of the License at 627 * 628 * http://www.apache.org/licenses/LICENSE-2.0 629 * 630 * Unless required by applicable law or agreed to in writing, software 631 * distributed under the License is distributed on an "AS IS" BASIS, 632 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 633 * See the License for the specific language governing permissions and 634 * limitations under the License. 635 */var Gn=16384,Hn=45e3,Kn=null;"undefined"!==typeof MozWebSocket?Kn=MozWebSocket:"undefined"!==typeof WebSocket&&(Kn=WebSocket);var zn=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_=T(this.connId),this.stats_=ln.getCollection(n),this.connURL=t.connectionURL_(n,i,o),this.nodeAdmin=n.nodeAdmin}return t.connectionURL_=function(t,e,n){var r={};return r[$]=X,!s.isNodeSdk()&&"undefined"!==typeof location&&location.href&&-1!==location.href.indexOf(et)&&(r[Z]=tt),e&&(r[J]=e),n&&(r[nt]=n),t.connectionURL(it,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,d.set("previous_websocket_failure",!0);try{if(s.isNodeSdk()){var i=this.nodeAdmin?"AdminNode":"Node",o={headers:{"User-Agent":"Firebase/"+X+"/"+Bn+"/"+r.platform+"/"+i,"X-Firebase-GMPID":this.applicationId||""}},a=Object({NODE_ENV:"production",BASE_URL:""}),u=0===this.connURL.indexOf("wss://")?a["HTTPS_PROXY"]||a["https_proxy"]:a["HTTP_PROXY"]||a["http_proxy"];u&&(o["proxy"]={origin:u}),this.mySock=new Kn(this.connURL,[],o)}else{o={headers:{"X-Firebase-GMPID":this.applicationId||""}};this.mySock=new Kn(this.connURL,[],o)}}catch(h){this.log_("Error instantiating WebSocket.");var c=h.message||h.data;return c&&this.log_(c),void this.onClosed_()}this.mySock.onopen=function(){n.log_("Websocket connected."),n.everConnected_=!0}
635,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=/Android ([0-9]{0,}\.[0-9]{0,})/,r=navigator.userAgent.match(n);r&&r.length>1&&parseFloat(r[1])<4.4&&(e=!0)}return!e&&null!==Kn&&!t.forceDisallow_},t.previouslyFailed=function(){return d.isInMemoryStorage||!0===d.get("previous_websocket_failure")},t.prototype.markConnectionHealthy=function(){d.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=M(e,Gn);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(Hn))},t.prototype.sendString_=function(t){try{this.mySock.send(t)}catch(e){this.log_("Exception thrown from WebSocket.send():",e.message||e.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}},t.responsesRequiredToBeHealthy=2,t.healthyTimeout=3e4,t}(),Qn=function(){function t(t){this.initTransports_(t)}return Object.defineProperty(t,"ALL_TRANSPORTS",{get:function(){return[Vn,zn]},enumerable:!1,configurable:!0}),t.prototype.initTransports_=function(e){var n,r,i=zn&&zn["isAvailable"](),s=i&&!zn.previouslyFailed();if(e.webSocketOnly&&(i||O("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),s=!0),s)this.transports_=[zn];else{var a=this.transports_=[];try{for(var u=o.__values(t.ALL_TRANSPORTS),c=u.next();!c.done;c=u.next()){var h=c.value;h&&h["isAvailable"]()&&a.push(h)}}catch(l){n={error:l}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}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}(),Yn=6e4,Xn=5e3,$n=10240,Jn=102400,Zn="t",tr="d",er="s",nr="r",rr="e",ir="o",or="a",sr="n",ar="p",ur="h",cr=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_=T("c:"+this.id+":"),this.transportManager_=new Qn(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_=z((function(){t.healthyTimeout_=null,t.isHealthy_||(t.conn_&&t.conn_.bytesReceived>
635Jn?(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>$n?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(Zn in t){var e=t[Zn];e===or?this.upgradeIfSecondaryHealthy_():e===nr?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),this.tx_!==this.secondaryConn_&&this.rx_!==this.secondaryConn_||this.close()):e===ir&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}},t.prototype.onSecondaryMessageReceived_=function(t){var e=L("t",t),n=L("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:ar,d:{}}}))},t.prototype.proceedWithUpgrade_=function(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:or,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:sr,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()},t.prototype.onPrimaryMessageReceived_=function(t){var e=L("t",t),n=L("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=L(Zn,t);if(tr in t){var n=t[tr];if(e===ur)this.onHandshake_(n);else if(e===sr){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 e===er?this.onConnectionShutdown_(n):e===nr?this.onReset_(n):e===rr?C("Server Error: "+n):e===ir?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):C("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),X!==n&&O("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),z((function(){e.secondaryConn_&&(e.log_("Timed out trying to upgrade."),e.secondaryConn_.close())}),Math.floor(Yn))},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):z((function(){n.sendPingOnPrimaryIfNecessary_()}),Math.floor(Xn))},t.prototype.sendPingOnPrimaryIfNecessary_=function(){this.isHealthy_||1!==this.state_||(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:ar,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()&&(d.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}(),hr=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}
635(),lr=1e3,fr=3e5,pr=3e4,dr=1.3,vr=3e4,gr="server_kill",yr=3,mr=function(t){function e(n,r,i,o,a,u,c){var h=t.call(this)||this;if(h.repoInfo_=n,h.applicationId_=r,h.onDataUpdate_=i,h.onConnectStatus_=o,h.onServerInfoUpdate_=a,h.authTokenProvider_=u,h.authOverride_=c,h.id=e.nextPersistentConnectionId_++,h.log_=T("p:"+h.id+":"),h.interruptReasons_={},h.listens=new Map,h.outstandingPuts_=[],h.outstandingPutCount_=0,h.onDisconnectRequestQueue_=[],h.connected_=!1,h.reconnectDelay_=lr,h.maxReconnectDelay_=fr,h.securityDebugCallback_=null,h.lastSessionId=null,h.establishConnectionTimer_=null,h.visible_=!1,h.requestCBHash_={},h.requestNumber_=0,h.realtime_=null,h.authToken_=null,h.forceTokenRefresh_=!1,h.invalidAuthTokenCount_=0,h.firstConnection_=!0,h.lastConnectionAttemptTime_=null,h.lastConnectionEstablishedTime_=null,c&&!s.isNodeSdk())throw new Error("Auth override specified in options, but not supported on non Node.js platforms");return h.scheduleConnect_(0),bn.getInstance().on("visible",h.onVisible_,h),-1===n.host.indexOf("fblocal")&&wn.getInstance().on("online",h.onOnline_,h),h}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},a="q";t.tag&&(s["q"]=r.queryObject(),s["t"]=t.tag),s["h"]=t.hashFn(),this.sendRequest(a,s,(function(s){var a=s["d"],u=s["s"];e.warnOnListenWarnings_(a,r);var c=n.listens.get(i)&&n.listens.get(i).get(o);c===t&&(n.log_("listen response",s),"ok"!==u&&n.removeListen_(i,o),t.onComplete&&t.onComplete(u,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();O("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){var e=t&&40===t.length;(e||s.isAdmin(t))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=pr)},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");var i=this.removeListen_(n,r);i&&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},o="n";r&&(i["q"]=n,i["t"]=r),this.sendRequest(o,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){var n=t["s"];if("ok"!==n){var r=t["d"];e.log_("reportStats","Error sending stats: "+r)}}
635))}},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):C("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_=lr,this.realtime_||this.scheduleConnect_(0)),this.visible_=t},e.prototype.onOnline_=function(t){t?(this.log_("Browser went online."),this.reconnectDelay_=lr,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_){var t=(new Date).getTime()-this.lastConnectionEstablishedTime_;t>vr&&(this.reconnectDelay_=lr),this.lastConnectionEstablishedTime_=null}}else this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=(new Date).getTime();var e=(new Date).getTime()-this.lastConnectionAttemptTime_,n=Math.max(0,this.reconnectDelay_-e);n=Math.random()*n,this.log_("Trying to reconnect in "+n+"ms"),this.scheduleConnect_(n),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*dr)}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,u=this.lastSessionId,c=!1,h=null,l=function(){h?h.close():(c=!0,i())},f=function(t){s.assert(h,"sendRequest call when we're not connected not allowed."),h.sendRequest(t)};this.realtime_={close:l,sendRequest:f};var p=this.forceTokenRefresh_;this.forceTokenRefresh_=!1,this.authTokenProvider_.getToken(p).then((function(t){c?I("getToken() completed but was canceled"):(I("getToken() completed. Creating connection."),a.authToken_=t&&t.accessToken,h=new cr(o,a.repoInfo_,a.applicationId_,n,r,i,(function(t){O(t+" ("+a.repoInfo_.toString()+")"),a.interrupt(gr)}),u))})).then(null,(function(e){a.log_("Failed to get token: "+e),c||(t.repoInfo_.nodeAdmin&&O(e),l())}))}},e.prototype.interrupt=function(t){I("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){I("Resuming connection for reason: "+t),delete this.interruptReasons_[t],s.isEmpty(this.interruptReasons_)&&(this.reconnectDelay_=lr,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 j(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 Q(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){I("Auth token revoked: "+t+"/"+e),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),"invalid_token"!==t&&"permission_denied"!==t||(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=yr&&(this.reconnectDelay_=pr,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;
635try{for(var u=(n=void 0,o.__values(a.values())),c=u.next();!c.done;c=u.next()){var h=c.value;this.sendListen_(h)}}catch(p){n={error:p}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(d){t={error:d}}finally{try{s&&!s.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}for(var l=0;l<this.outstandingPuts_.length;l++)this.outstandingPuts_[l]&&this.sendPut_(l);while(this.onDisconnectRequestQueue_.length){var f=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(f.action,f.pathString,f.data,f.onComplete)}},e.prototype.sendConnectStats_=function(){var t={},e="js";s.isNodeSdk()&&(e=this.repoInfo_.nodeAdmin?"admin_node":"node"),t["sdk."+e+"."+Bn.replace(/\./g,"-")]=1,s.isMobileCordova()?t["framework.cordova"]=1:s.isReactNative()&&(t["framework.reactnative"]=1),this.reportStats(t)},e.prototype.shouldReconnect_=function(){var t=wn.getInstance().currentlyOnline();return s.isEmpty(this.interruptReasons_)&&t},e.nextPersistentConnectionId_=0,e.nextConnectionId_=0,e}(hr),_r=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_=T("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 u=e.getListenId_(t,r),c={};this.listens_[u]=c;var h=t.getQueryParams().toRestQueryStringParameters();this.restRequest_(a+".json",h,(function(t,e){var n,h=e;(404===t&&(h=null,t=null),null===t&&o.onDataUpdate_(a,h,!1,r),s.safeGet(o.listens_,u)===c)&&(n=t?401===t?"permission_denied":"rest_error:"+t:"ok",i(n,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 u=new XMLHttpRequest;u.onreadystatechange=function(){if(n&&4===u.readyState){r.log_("REST Response for "+a+" received. status:",u.status,"response:",u.responseText);var t=null;if(u.status>=200&&u.status<300){try{t=s.jsonEval(u.responseText)}catch(e){O("Failed to parse JSON response for "+a+": "+u.responseText)}n(null,t)}else 401!==u.status&&404!==u.status&&O("Got unsuccessful REST response for "+a+" Status: "+u.status),n(u.status);n=null}},u.open("GET",a,!0),u.send()}))},e}(hr),br="repo_interrupt",wr=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 yn,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=new De,this.persistentConnection_=null,this.stats_=ln.getCollection(t),e||K())this.server_=new _r(this.repoInfo_,this.onDataUpdate_.bind(this),r),setTimeout(this.onConnectStatus_.bind(this,!0),0);else{var o=n.options["databaseAuthVariableOverride"];if("undefined"!==typeof o&&null!==o){if("object"!==typeof o)throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{s.stringify(o)}catch(a){throw new Error("Invalid authOverride provided: "+a)}}this.persistentConnection_=new mr(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_=ln.getOrCreateReporter(t,(function(){return new gn(i.stats_,i.server_)})),this.transactionsInit_(),this.infoData_=new cn,this.infoSyncTree_=new un({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 un({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 Q(".info/serverTimeOffset")),e=t.val()||0;return(new Date).getTime()+e},t.prototype.generateServerValues=function(){return Se({timestamp:this.serverTime()})},t.prototype.onDataUpdate_=function(t,e,n,r){this.dataUpdateCount++;var i=new Q(t);e=this.interceptServerDataCallback_?this.interceptServerDataCallback_(t,e):e;var o=[];if(r)if(n){var a=s.map(e,(function(t){return pe(t)}));o=this.serverSyncTree_.applyTaggedQueryMerge(i,a,r)}else{var u=pe(e);o=this.serverSyncTree_.applyTaggedQueryOverwrite(i,u,r)}else if(n){var c=s.map(e,(function(t){return pe(t)}));o=this.serverSyncTree_.applyServerMerge(i,c)}else{var h=pe(e);o=this.serverSyncTree_.applyServerOverwrite(i,h)}var l=i;o.length>0&&(l=this.rerunTransactions_(i)),this.eventQueue_.raiseEventsForChangedPath(l,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;F(t,(function(t,n){e.updateInfo_(t,n)}
635))},t.prototype.updateInfo_=function(t,e){var n=new Q("/.info/"+t),r=pe(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=pe(e,n),a=this.serverSyncTree_.calcCompleteEventCache(t),u=Re(s,a,o),c=this.getNextWriteId_(),h=this.serverSyncTree_.applyUserOverwrite(t,u,c,!0);this.eventQueue_.queueEvents(h),this.server_.put(t.toString(),s.val(!0),(function(e,n){var o="ok"===e;o||O("set at "+t+" failed: "+e);var s=i.serverSyncTree_.ackUserWrite(c,!o);i.eventQueue_.raiseEventsForChangedPath(t,s),i.callOnCompleteCallback(r,e,n)}));var l=this.abortTransactions_(t);this.rerunTransactions_(l),this.eventQueue_.raiseEventsForChangedPath(l,[])},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(F(e,(function(e,n){i=!1,s[e]=ke(t.child(e),pe(n),r.serverSyncTree_,o)})),i)I("update() called with empty data. Don't do anything."),this.callOnCompleteCallback(n,"ok");else{var a=this.getNextWriteId_(),u=this.serverSyncTree_.applyUserMerge(t,s,a);this.eventQueue_.queueEvents(u),this.server_.merge(t.toString(),e,(function(e,i){var o="ok"===e;o||O("update at "+t+" failed: "+e);var s=r.serverSyncTree_.ackUserWrite(a,!o),u=s.length>0?r.rerunTransactions_(t):t;r.eventQueue_.raiseEventsForChangedPath(u,s),r.callOnCompleteCallback(n,e,i)})),F(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 De;this.onDisconnect_.forEachTree(Q.Empty,(function(r,i){var o=ke(r,i,t.serverSyncTree_,e);n.remember(r,o)}));var r=[];n.forEachTree(Q.Empty,(function(e,n){r=r.concat(t.serverSyncTree_.applyServerOverwrite(e,n));var i=t.abortTransactions_(e);t.rerunTransactions_(i)})),this.onDisconnect_=new De,this.eventQueue_.raiseEventsForChangedPath(Q.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=pe(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=pe(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 I("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&&F(e,(function(e,n){var i=pe(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(br)},t.prototype.resume=function(){this.persistentConnection_&&this.persistentConnection_.resume(br)},t.prototype.stats=function(t){if(void 0===t&&(t=!1),"undefined"!==typeof console){var e;t?(this.statsListener_||(this.statsListener_=new fn(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);F(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)}
635,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+":"),I.apply(void 0,o.__spread([n],t))},t.prototype.callOnCompleteCallback=function(t,e,n){t&&H((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 Dr(this))},enumerable:!1,configurable:!0}),t}(),Er=function(){function t(e){this.indexedFilter_=new ze(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 Lt(e,n))||(n=ce.EMPTY_NODE),this.indexedFilter_.updateChild(t,e,n,r,i,o)},t.prototype.updateFullNode=function(t,e,n){e.isLeafNode()&&(e=ce.EMPTY_NODE);var r=e.withIndex(this.index_);r=r.updatePriority(ce.EMPTY_NODE);var i=this;return e.forEachChild($t,(function(t,e){i.matches(new Lt(t,e))||(r=r.updateImmediateChild(t,ce.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}(),Ir=function(){function t(t){this.rangedFilter_=new Er(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 Lt(e,n))||(n=ce.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=ce.EMPTY_NODE.withIndex(this.index_);else if(2*this.limit_<e.numChildren()&&e.isIndexed(this.index_)){r=ce.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_);var o=0;while(i.hasNext()&&o<this.limit_){var s=i.getNext(),a=void 0;if(a=this.reverse_?this.index_.compare(this.rangedFilter_.getStartPost(),s)<=0:this.index_.compare(s,this.rangedFilter_.getEndPost())<=0,!a)break;r=r.updateImmediateChild(s.name,s.node),o++}}else{r=e.withIndex(this.index_),r=r.updatePriority(ce.EMPTY_NODE);var u=void 0,c=void 0,h=void 0;i=void 0;if(this.reverse_){i=r.getReverseIterator(this.index_),u=this.rangedFilter_.getEndPost(),c=this.rangedFilter_.getStartPost();var l=this.index_.getCompare();h=function(t,e){return l(e,t)}}else i=r.getIterator(this.index_),u=this.rangedFilter_.getStartPost(),c=this.rangedFilter_.getEndPost(),h=this.index_.getCompare();o=0;var f=!1;while(i.hasNext()){s=i.getNext();!f&&h(u,s)<=0&&(f=!0);a=f&&o<this.limit_&&h(s,c)<=0;a?o++:r=r.updateImmediateChild(s.name,ce.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 u=t;s.assert(u.numChildren()===this.limit_,"");var c=new Lt(e,n),h=this.reverse_?u.getFirstChild(this.index_):u.getLastChild(this.index_),l=this.rangedFilter_.matches(c);if(u.hasChild(e)){var f=u.getImmediateChild(e),p=r.getChildAfterChild(this.index_,h,this.reverse_);while(null!=p&&(p.name===e||u.hasChild(p.name)))p=r.getChildAfterChild(this.index_,p,this.reverse_);var d=null==p?1:o(p,c),v=l&&!n.isEmpty()&&d>=0;if(v)return null!=i&&i.trackChildChange(Ke.childChangedChange(e,n,f)),u.updateImmediateChild(e,n);null!=i&&i.trackChildChange(Ke.childRemovedChange(e,f));var g=u.updateImmediateChild(e,ce.EMPTY_NODE),y=null!=p&&this.rangedFilter_.matches(p);return y?(null!=i&&i.trackChildChange(Ke.childAddedChange(p.name,p.node)),g.updateImmediateChild(p.name,p.node)):g}return n.isEmpty()?t:l&&o(h,c)>=0?(null!=i&&(i.trackChildChange(Ke.childRemovedChange(h.name,h.node)),i.trackChildChange(Ke.childAddedChange(e,n))),u.updateImmediateChild(e,n).updateImmediateChild(h.name,ce.EMPTY_NODE)):t},t}(),Tr=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_=$t}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_:R},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_:P},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={};
635if(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_!==$t&&(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_===$t},t.prototype.getNodeFilter=function(){return this.loadsAllData()?new ze(this.getIndex()):this.hasLimit()?new Ir(this):new Er(this)},t.prototype.toRestQueryStringParameters=function(){var e,n=t.REST_QUERY_CONSTANTS_,r={};return this.isDefault()||(this.index_===$t?e=n.PRIORITY_INDEX:this.index_===ge?e=n.VALUE_INDEX:this.index_===Ft?e=n.KEY_INDEX:(s.assert(this.index_ instanceof ye,"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}(),Cr=function(t){function e(e,n){var r=this;if(!(e instanceof wr))throw new Error("new Reference() no longer supported - use app.database().");return r=t.call(this,e,n,Tr.DEFAULT,!1)||this,r}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 Q||(null===this.path.getFront()?Nt("Reference.child",1,t,!1):Ot("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);var t=this;while(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),At("Reference.set",this.path),bt("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),At("Reference.update",this.path),Array.isArray(t)){for(var n={},r=0;r<t.length;++r)n[""+r]=t[r];t=n,O("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.")}It("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),At("Reference.setWithPriority",this.path),bt("Reference.setWithPriority",1,t,this.path,!1),Tt("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),At("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),At("Reference.transaction",this.path),s.validateCallback("Reference.transaction",1,t,!1),s.validateCallback("Reference.transaction",2,e,!0),Rt("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 xt(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),At("Reference.setPriority",this.path),Tt("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),At("Reference.push",this.path),bt("Reference.push",1,t,this.path,!0),s.validateCallback("Reference.push",2,e,!0);var n,r=this.repo.serverTime(),i=Dt(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 At("Reference.onDisconnect",this.path),new Pt(this.repo,this.path)},Object.defineProperty(e.prototype,"database",{get:function(){return this.databaseProp()}
635,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}(Ie); 636/** 637 * @license 638 * Copyright 2017 Google LLC 639 * 640 * Licensed under the Apache License, Version 2.0 (the "License"); 641 * you may not use this file except in compliance with the License. 642 * You may obtain a copy of the License at 643 * 644 * http://www.apache.org/licenses/LICENSE-2.0 645 * 646 * Unless required by applicable law or agreed to in writing, software 647 * distributed under the License is distributed on an "AS IS" BASIS, 648 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 649 * See the License for the specific language governing permissions and 650 * limitations under the License. 651 */Ie.__referenceConstructor=Cr,nn.__referenceConstructor=Cr; 652/** 653 * @license 654 * Copyright 2017 Google LLC 655 * 656 * Licensed under the Apache License, Version 2.0 (the "License"); 657 * you may not use this file except in compliance with the License. 658 * You may obtain a copy of the License at 659 * 660 * http://www.apache.org/licenses/LICENSE-2.0 661 * 662 * Unless required by applicable law or agreed to in writing, software 663 * distributed under the License is distributed on an "AS IS" BASIS, 664 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 665 * See the License for the specific language governing permissions and 666 * limitations under the License. 667 */ 668var Sr,Or=function(){function t(){this.children={},this.childCount=0,this.value=null}return t}(),Nr=function(){function t(t,e,n){void 0===t&&(t=""),void 0===e&&(e=null),void 0===n&&(n=new Or),this.name_=t,this.parent_=e,this.node_=n}return t.prototype.subTree=function(e){var n=e instanceof Q?e:new Q(e),r=this,i=n.getFront();while(null!==i){var o=s.safeGet(r.node_.children,i)||new Or;r=new t(i,r,o),n=n.popFront(),i=n.getFront()}return r},t.prototype.getValue=function(){return this.node_.value},t.prototype.setValue=function(t){s.assert("undefined"!==typeof 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;F(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){var n=e?this:this.parent();while(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 Q(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"})(Sr||(Sr={})),wr.MAX_TRANSACTION_RETRIES_=25,wr.prototype.transactionsInit_=function(){this.transactionQueueTree_=new Nr},wr.prototype.startTransaction=function(t,e,n,r){this.log_("transaction on "+t);var i=function(){},o=new Cr(this,t);o.on("value",i);var a=function(){o.off("value",i)},u={path:t,update:e,onComplete:n,status:null,order:y(),applyLocally:r,retryCount:0,unwatcher:a,abortReason:null,currentWriteId:null,currentInputSnapshot:null,currentOutputSnapshotRaw:null,currentOutputSnapshotResolved:null},c=this.getLatestState_(t);u.currentInputSnapshot=c;var h=u.update(c.val());if(void 0===h){if(u.unwatcher(),u.currentOutputSnapshotRaw=null,u.currentOutputSnapshotResolved=null,u.onComplete){var l=new me(u.currentInputSnapshot,new Cr(this,u.path),$t);u.onComplete(null,!1,l)}}else{wt("transaction failed: Data returned ",h,u.path),u.status=Sr.RUN;var f=this.transactionQueueTree_.subTree(t),p=f.getValue()||[];p.push(u),f.setValue(p);var d=void 0;if("object"===typeof h&&null!==h&&s.contains(h,".priority"))d=s.safeGet(h,".priority"),s.assert(_t(d),"Invalid priority returned by transaction. Priority must be a valid string, finite number, server value, or null.");else{var v=this.serverSyncTree_.calcCompleteEventCache(t)||ce.EMPTY_NODE;d=v.getPriority().val()}d=d;var g=this.generateServerValues(),m=pe(h,d),_=Re(m,c,g);u.currentOutputSnapshotRaw=m,u.currentOutputSnapshotResolved=_,u.currentWriteId=this.getNextWriteId_();var b=this.serverSyncTree_.applyUserOverwrite(t,_,u.currentWriteId,u.applyLocally);this.eventQueue_.raiseEventsForChangedPath(t,b),this.sendReadyTransactions_()}},wr.prototype.getLatestState_=function(t,e){return this.serverSyncTree_.calcCompleteEventCache(t,e)||ce.EMPTY_NODE},wr.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");var r=n.every((function(t){return t.status===Sr.RUN}));r&&this.sendTransactionQueue_(t.path(),n)}else t.hasChildren()&&t.forEachChild((function(t){e.sendReadyTransactions_(t)}))},wr.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(),u=0;u<e.length;u++){var c=e[u];s.assert(c.status===Sr.RUN,"tryToSendTransactionQueue_: items in queue should all be run."),c.status=Sr.SENT,c.retryCount++;var h=Q.relativePath(t,c.path);o=o.updateChild(h,c.currentOutputSnapshotRaw)}var l=o.val(!0),f=t;this.server_.put(f.toString(),l,(function(r){n.log_("transaction put response",{path:f.toString(),status:r});var i=[];if("ok"===r){for(var o=[],s=0;s<e.length;
668s++){if(e[s].status=Sr.COMPLETED,i=i.concat(n.serverSyncTree_.ackUserWrite(e[s].currentWriteId)),e[s].onComplete){var a=e[s].currentOutputSnapshotResolved,u=new Cr(n,e[s].path),c=new me(a,u,$t);o.push(e[s].onComplete.bind(null,null,!0,c))}e[s].unwatcher()}n.pruneCompletedTransactionsBelowNode_(n.transactionQueueTree_.subTree(t)),n.sendReadyTransactions_(),n.eventQueue_.raiseEventsForChangedPath(t,i);for(s=0;s<o.length;s++)H(o[s])}else{if("datastale"===r)for(s=0;s<e.length;s++)e[s].status===Sr.SENT_NEEDS_ABORT?e[s].status=Sr.NEEDS_ABORT:e[s].status=Sr.RUN;else{O("transaction at "+f.toString()+" failed: "+r);for(s=0;s<e.length;s++)e[s].status=Sr.NEEDS_ABORT,e[s].abortReason=r}n.rerunTransactions_(t)}}),a)},wr.prototype.rerunTransactions_=function(t){var e=this.getAncestorTransactionNode_(t),n=e.path(),r=this.buildTransactionQueue_(e);return this.rerunTransactionQueue_(r,n),n},wr.prototype.rerunTransactionQueue_=function(t,e){if(0!==t.length){for(var n=[],r=[],i=t.filter((function(t){return t.status===Sr.RUN})),o=i.map((function(t){return t.currentWriteId})),a=0;a<t.length;a++){var u=t[a],c=Q.relativePath(e,u.path),h=!1,l=void 0;if(s.assert(null!==c,"rerunTransactionsUnderNode_: relativePath should not be null."),u.status===Sr.NEEDS_ABORT)h=!0,l=u.abortReason,r=r.concat(this.serverSyncTree_.ackUserWrite(u.currentWriteId,!0));else if(u.status===Sr.RUN)if(u.retryCount>=wr.MAX_TRANSACTION_RETRIES_)h=!0,l="maxretry",r=r.concat(this.serverSyncTree_.ackUserWrite(u.currentWriteId,!0));else{var f=this.getLatestState_(u.path,o);u.currentInputSnapshot=f;var p=t[a].update(f.val());if(void 0!==p){wt("transaction failed: Data returned ",p,u.path);var d=pe(p),v="object"===typeof p&&null!=p&&s.contains(p,".priority");v||(d=d.updatePriority(f.getPriority()));var g=u.currentWriteId,y=this.generateServerValues(),m=Re(d,f,y);u.currentOutputSnapshotRaw=d,u.currentOutputSnapshotResolved=m,u.currentWriteId=this.getNextWriteId_(),o.splice(o.indexOf(g),1),r=r.concat(this.serverSyncTree_.applyUserOverwrite(u.path,m,u.currentWriteId,u.applyLocally)),r=r.concat(this.serverSyncTree_.ackUserWrite(g,!0))}else h=!0,l="nodata",r=r.concat(this.serverSyncTree_.ackUserWrite(u.currentWriteId,!0))}if(this.eventQueue_.raiseEventsForChangedPath(e,r),r=[],h&&(t[a].status=Sr.COMPLETED,function(t){setTimeout(t,Math.floor(0))}(t[a].unwatcher),t[a].onComplete))if("nodata"===l){var _=new Cr(this,t[a].path),b=t[a].currentInputSnapshot,w=new me(b,_,$t);n.push(t[a].onComplete.bind(null,null,!1,w))}else n.push(t[a].onComplete.bind(null,new Error(l),!1,null))}this.pruneCompletedTransactionsBelowNode_(this.transactionQueueTree_);for(a=0;a<n.length;a++)H(n[a]);this.sendReadyTransactions_()}},wr.prototype.getAncestorTransactionNode_=function(t){var e,n=this.transactionQueueTree_;e=t.getFront();while(null!==e&&null===n.getValue())n=n.subTree(e),t=t.popFront(),e=t.getFront();return n},wr.prototype.buildTransactionQueue_=function(t){var e=[];return this.aggregateTransactionQueuesForNode_(t,e),e.sort((function(t,e){return t.order-e.order})),e},wr.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)}))},wr.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!==Sr.COMPLETED&&(n[r]=n[i],r++);n.length=r,t.setValue(n.length>0?n:null)}t.forEachChild((function(t){e.pruneCompletedTransactionsBelowNode_(t)}))},wr.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},wr.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===Sr.SENT_NEEDS_ABORT);else if(e[o].status===Sr.SENT)s.assert(i===o-1,"All SENT items should be at beginning of queue."),i=o,e[o].status=Sr.SENT_NEEDS_ABORT,e[o].abortReason="set";else if(s.assert(e[o].status===Sr.RUN,"Unexpected transaction status in abort"),e[o].unwatcher(),r
668=r.concat(this.serverSyncTree_.ackUserWrite(e[o].currentWriteId,!0)),e[o].onComplete){var a=null;n.push(e[o].onComplete.bind(null,new Error("set"),!1,a))}-1===i?t.setValue(null):e.length=i+1,this.eventQueue_.raiseEventsForChangedPath(t.path(),r);for(o=0;o<n.length;o++)H(n[o])}}; 669/** 670 * @license 671 * Copyright 2017 Google LLC 672 * 673 * Licensed under the Apache License, Version 2.0 (the "License"); 674 * you may not use this file except in compliance with the License. 675 * You may obtain a copy of the License at 676 * 677 * http://www.apache.org/licenses/LICENSE-2.0 678 * 679 * Unless required by applicable law or agreed to in writing, software 680 * distributed under the License is distributed on an "AS IS" BASIS, 681 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 682 * See the License for the specific language governing permissions and 683 * limitations under the License. 684 */ 685var Ar,kr=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?(I("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/.',O(t)},t}(),Rr=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}(),Pr="FIREBASE_DATABASE_EMULATOR_HOST",xr=function(){function t(){this.repos_={},this.useRestClient_=!1}return t.getInstance=function(){return Ar||(Ar=new t),Ar},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 u=(n=void 0,o.__values(Object.keys(this.repos_[a]))),c=u.next();!c.done;c=u.next()){var h=c.value;this.repos_[a][h].interrupt()}}catch(l){n={error:l}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(f){t={error:f}}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 u=(n=void 0,o.__values(Object.keys(this.repos_[a]))),c=u.next();!c.done;c=u.next()){var h=c.value;this.repos_[a][h].resume()}}catch(l){n={error:l}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}}catch(f){t={error:f}}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||S("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),I("Using default host for project ",t.options.projectId),o=t.options.projectId+"-default-rtdb.firebaseio.com");var s,a=lt(o,i),u=a.repoInfo,c=void 0;"undefined"!==typeof r&&(c=Object({NODE_ENV:"production",BASE_URL:""})[Pr]),c?(s=!0,o="http://"+c+"?ns="+u.namespace,a=lt(o,i),u=a.repoInfo):s=!a.repoInfo.secure;var h=i&&s?new Rr:new kr(t,e);kt("Invalid Firebase Database URL",1,a),a.path.isEmpty()||S("Database URL must point to the root of a Firebase Database (not including a child path).");var l=this.createRepo(u,t,h);return l.database},t.prototype.deleteRepo=function(t){var e=s.safeGet(this.repos_,t.app.name);e&&s.safeGet(e,t.repoInfo_.toURLString())===t||S("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&&S("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),i=new wr(t,this.useRestClient_,e,n),r[t.toURLString()]=i,i},t.prototype.forceRestClient=function(t){this.useRestClient_=t},t}(),Dr=function(){function t(t){this.repo_=t,t instanceof wr||S("Don't call new Database() directly - please use firebase.database()."),this.root_=new Cr(t,Q.Empty),this.INTERNAL=new Lr(this)}return Object.defineProperty(t.prototype,"app",{get:function(){return this.repo_.app}
685,enumerable:!1,configurable:!0}),t.prototype.ref=function(t){return this.checkDeleted_("ref"),s.validateArgCount("database.ref",0,1,arguments.length),t instanceof Cr?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=lt(t,this.repo_.repoInfo_.nodeAdmin);kt(e,1,n);var r=n.repoInfo;return r.host!==this.repo_.repoInfo_.host&&S(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_&&S("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}(),Lr=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"),xr.getInstance().deleteRepo(this.database.repo_),this.database.repo_=null,this.database.root_=null,this.database.INTERNAL=null,this.database=null,[2]}))}))},t}(),jr=function(){zn.forceDisallow(),Vn.forceAllow()},Mr=function(){Vn.forceDisallow()},Fr=function(){return zn["isAvailable"]()},Ur=function(t,e){t.repo.persistentConnection_.securityDebugCallback_=e},Vr=function(t,e){t.repo.stats(e)},qr=function(t,e){t.repo.statsIncrementCounter(e)},Br=function(t){return t.repo.dataUpdateCount},Wr=function(t,e){return t.repo.interceptServerData_(e)},Gr=Object.freeze({__proto__:null,forceLongPolling:jr,forceWebSockets:Mr,isWebSocketsAvailable:Fr,setSecurityDebugCallback:Ur,stats:Vr,statsIncrementCounter:qr,dataUpdateCount:Br,interceptServerData:Wr}),Hr=mr;mr.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)},mr.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};var Kr=cr,zr=function(t){var e=mr.prototype.put;return mr.prototype.put=function(n,r,i,o){void 0!==o&&(o=t()),e.call(this,n,r,i,o)},function(){mr.prototype.put=e}},Qr=st,Yr=function(t){return t.queryIdentifier()},Xr=function(t){xr.getInstance().forceRestClient(t)},$r=Object.freeze({__proto__:null,DataConnection:Hr,RealTimeConnection:Kr,hijackHash:zr,ConnectionTarget:Qr,queryIdentifier:Yr,forceRestClient:Xr}),Jr="@firebase/database",Zr="0.6.13",ti=Dr.ServerValue;function ei(e){Wn(e.SDK_VERSION);var n=e.INTERNAL.registerComponent(new u.Component("database",(function(t,e){var n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal");return xr.getInstance().databaseFromApp(n,r,e)}),"PUBLIC").setServiceProps({Reference:Cr,Query:Ie,Database:Dr,DataSnapshot:me,enableLogging:E,INTERNAL:Gr,ServerValue:ti,TEST_ACCESS:$r}).setMultipleInstances(!0));e.registerVersion(Jr,Zr),s.isNodeSdk()&&(t.exports=n)}ei(h["default"]),e.DataSnapshot=me,e.Database=Dr,e.OnDisconnect=Pt,e.Query=Ie,e.Reference=Cr,e.ServerValue=ti,e.enableLogging=E,e.registerDatabase=ei}).call(this,n("4362"))},3529:function(t,e,n){"use strict";var r=n("23e7"),i=n("c65b"),o=n("59ed"),s=n("f069"),a=n("e667"),u=n("2266"),c=n("5eed");r({target:"Promise",stat:!0,forced:c},{race:function(t){var e=this,n=s.f(e),r=n.reject,c=a((function(){var s=o(e.resolve);u(t,(function(t){i(s,e,t).then(n.resolve,r)}))}));return c.error&&r(c.value),n.promise}})},"35a1":function(t,e,n){var r=n("f5df"),i=n("dc4a"),o=n("3f8c"),s=n("b622"),a=s("iterator");t.exports=function(t){if(void 0!=t)return i(t,a)||i(t,"@@iterator")||o[r(t)]}},"37e8":function(t,e,n){var r=n("83ab"),i=n("aed9"),o=n("9bf2"),s=n("825a"),a=n("fc6a"),u=n("df75");e.f=r&&!i?Object.defineProperties:function(t,e){s(t);var n,r=a(e),i=u(e),c=i.length,h=0;while(c>h)o.f(t,n=i[h++],r[n]);return t}},"3a9b":function(t,e,n){var r=n("e330");t.exports=r({}.isPrototypeOf)},"3b59":function(t,e,n){"use strict";
685Object.defineProperty(e,"__esModule",{value:!0});var r=n("c23d");n("7d28");var i=n("9ab4"),o=n("cd51"),s=n("abfd"),a=n("4be4");function u(t){return t&&"object"===typeof t&&"default"in t?t:{default:t}}var c,h=u(r),l=function(){function t(t,e,n,r){this.client=t,this.storage=e,this.storageCache=n,this.logger=r}return t.prototype.isCachedDataFresh=function(t,e){if(!e)return this.logger.debug("Config fetch cache check. Cache unpopulated."),!1;var n=Date.now()-e,r=n<=t;return this.logger.debug("Config fetch cache check. Cache age millis: "+n+". Cache max age millis (minimumFetchIntervalMillis setting): "+t+". Is cache hit: "+r+"."),r},t.prototype.fetch=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n,r,o,s;return i.__generator(this,(function(i){switch(i.label){case 0:return[4,Promise.all([this.storage.getLastSuccessfulFetchTimestampMillis(),this.storage.getLastSuccessfulFetchResponse()])];case 1:return e=i.sent(),n=e[0],r=e[1],r&&this.isCachedDataFresh(t.cacheMaxAgeMillis,n)?[2,r]:(t.eTag=r&&r.eTag,[4,this.client.fetch(t)]);case 2:return o=i.sent(),s=[this.storageCache.setLastSuccessfulFetchTimestampMillis(Date.now())],200===o.status&&s.push(this.storage.setLastSuccessfulFetchResponse(o)),[4,Promise.all(s)];case 3:return i.sent(),[2,o]}}))}))},t}(),f=(c={},c["registration-window"]="Undefined window object. This SDK only supports usage in a browser environment.",c["registration-project-id"]="Undefined project identifier. Check Firebase app initialization.",c["registration-api-key"]="Undefined API key. Check Firebase app initialization.",c["registration-app-id"]="Undefined app identifier. Check Firebase app initialization.",c["storage-open"]="Error thrown when opening storage. Original error: {$originalErrorMessage}.",c["storage-get"]="Error thrown when reading from storage. Original error: {$originalErrorMessage}.",c["storage-set"]="Error thrown when writing to storage. Original error: {$originalErrorMessage}.",c["storage-delete"]="Error thrown when deleting from storage. Original error: {$originalErrorMessage}.",c["fetch-client-network"]="Fetch client failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.",c["fetch-timeout"]='The config fetch request timed out. Configure timeout using "fetchTimeoutMillis" SDK setting.',c["fetch-throttle"]='The config fetch request timed out while in an exponential backoff state. Configure timeout using "fetchTimeoutMillis" SDK setting. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.',c["fetch-client-parse"]="Fetch client could not parse response. Original error: {$originalErrorMessage}.",c["fetch-status"]="Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.",c),p=new o.ErrorFactory("remoteconfig","Remote Config",f); 686/** 687 * @license 688 * Copyright 2019 Google LLC 689 * 690 * Licensed under the Apache License, Version 2.0 (the "License"); 691 * you may not use this file except in compliance with the License. 692 * You may obtain a copy of the License at 693 * 694 * http://www.apache.org/licenses/LICENSE-2.0 695 * 696 * Unless required by applicable law or agreed to in writing, software 697 * distributed under the License is distributed on an "AS IS" BASIS, 698 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 699 * See the License for the specific language governing permissions and 700 * limitations under the License. 701 */function d(t,e){return t instanceof o.FirebaseError&&-1!==t.code.indexOf(e)} 702/** 703 * @license 704 * Copyright 2019 Google LLC 705 * 706 * Licensed under the Apache License, Version 2.0 (the "License"); 707 * you may not use this file except in compliance with the License. 708 * You may obtain a copy of the License at 709 * 710 * http://www.apache.org/licenses/LICENSE-2.0 711 * 712 * Unless required by applicable law or agreed to in writing, software 713 * distributed under the License is distributed on an "AS IS" BASIS, 714 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 715 * See the License for the specific language governing permissions and 716 * limitations under the License. 717 */function v(t){return void 0===t&&(t=navigator),t.languages&&t.languages[0]||t.language} 718/** 719 * @license 720 * Copyright 2019 Google LLC 721 * 722 * Licensed under the Apache License, Version 2.0 (the "License");
723 * you may not use this file except in compliance with the License. 724 * You may obtain a copy of the License at 725 * 726 * http://www.apache.org/licenses/LICENSE-2.0 727 * 728 * Unless required by applicable law or agreed to in writing, software 729 * distributed under the License is distributed on an "AS IS" BASIS, 730 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 731 * See the License for the specific language governing permissions and 732 * limitations under the License. 733 */var g=function(){function t(t,e,n,r,i,o){this.firebaseInstallations=t,this.sdkVersion=e,this.namespace=n,this.projectId=r,this.apiKey=i,this.appId=o}return t.prototype.fetch=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n,r,o,s,a,u,c,h,l,f,d,g,y,m,_,b,w,E;return i.__generator(this,(function(i){switch(i.label){case 0:return[4,Promise.all([this.firebaseInstallations.getId(),this.firebaseInstallations.getToken()])];case 1:e=i.sent(),n=e[0],r=e[1],o=window.FIREBASE_REMOTE_CONFIG_URL_BASE||"https://firebaseremoteconfig.googleapis.com",s=o+"/v1/projects/"+this.projectId+"/namespaces/"+this.namespace+":fetch?key="+this.apiKey,a={"Content-Type":"application/json","Content-Encoding":"gzip","If-None-Match":t.eTag||"*"},u={sdk_version:this.sdkVersion,app_instance_id:n,app_instance_id_token:r,app_id:this.appId,language_code:v()},c={method:"POST",headers:a,body:JSON.stringify(u)},h=fetch(s,c),l=new Promise((function(e,n){t.signal.addEventListener((function(){var t=new Error("The operation was aborted.");t.name="AbortError",n(t)}))})),i.label=2;case 2:return i.trys.push([2,5,,6]),[4,Promise.race([h,l])];case 3:return i.sent(),[4,h];case 4:return f=i.sent(),[3,6];case 5:throw d=i.sent(),g="fetch-client-network","AbortError"===d.name&&(g="fetch-timeout"),p.create(g,{originalErrorMessage:d.message});case 6:if(y=f.status,m=f.headers.get("ETag")||void 0,200!==f.status)return[3,11];w=void 0,i.label=7;case 7:return i.trys.push([7,9,,10]),[4,f.json()];case 8:return w=i.sent(),[3,10];case 9:throw E=i.sent(),p.create("fetch-client-parse",{originalErrorMessage:E.message});case 10:_=w["entries"],b=w["state"],i.label=11;case 11:if("INSTANCE_STATE_UNSPECIFIED"===b?y=500:"NO_CHANGE"===b?y=304:"NO_TEMPLATE"!==b&&"EMPTY_CONFIG"!==b||(_={}),304!==y&&200!==y)throw p.create("fetch-status",{httpStatus:y});return[2,{status:y,eTag:m,config:_}]}}))}))},t}(),y=function(){function t(){this.listeners=[]}return t.prototype.addEventListener=function(t){this.listeners.push(t)},t.prototype.abort=function(){this.listeners.forEach((function(t){return t()}))},t}(),m=!1,_="",b=0,w=["1","true","t","yes","y","on"],E=function(){function t(t,e){void 0===e&&(e=_),this._source=t,this._value=e}return t.prototype.asString=function(){return this._value},t.prototype.asBoolean=function(){return"static"===this._source?m:w.indexOf(this._value.toLowerCase())>=0},t.prototype.asNumber=function(){if("static"===this._source)return b;var t=Number(this._value);return isNaN(t)&&(t=b),t},t.prototype.getSource=function(){return this._source},t}(),I=6e4,T=432e5,C=function(){function t(t,e,n,r,i){this.app=t,this._client=e,this._storageCache=n,this._storage=r,this._logger=i,this._isInitializationComplete=!1,this.settings={fetchTimeoutMillis:I,minimumFetchIntervalMillis:T},this.defaultConfig={}}return t.prototype.setLogLevel=function(t){switch(t){case"debug":this._logger.logLevel=s.LogLevel.DEBUG;break;case"silent":this._logger.logLevel=s.LogLevel.SILENT;break;default:this._logger.logLevel=s.LogLevel.ERROR}},Object.defineProperty(t.prototype,"fetchTimeMillis",{get:function(){return this._storageCache.getLastSuccessfulFetchTimestampMillis()||-1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastFetchStatus",{get:function(){return this._storageCache.getLastFetchStatus()||"no-fetch-yet"},enumerable:!1,configurable:!0}),t.prototype.activate=function(){return i.__awaiter(this,void 0,void 0,(function(){var t,e,n;return i.__generator(this,(function(r){switch(r.label){case 0:return[4,Promise.all([this._storage.getLastSuccessfulFetchResponse(),this._storage.getActiveConfigEtag()])];case 1:return t=r.sent(),e=t[0],n=t[1],e&&e.config&&e.eTag&&e.eTag!==n?[4,Promise.all([this._storageCache.setActiveConfig(e.config),this._storage.setActiveConfigEtag(e.eTag)])]:[2,!1];case 2:return r.sent(),[2,!0]}}))}))},t.prototype.ensureInitialized=function(){var t=this;return this._initializePromise||(this._initializePromise=this._storageCache.loadFromStorage().then((function(){t._isInitializationComplete=!0}))),this._initializePromise},t.prototype.fetch=function(){return i.__awaiter(this,void 0,void 0,(function(){var t,e,n,r=this;return i.__generator(this,(function(o){switch(o.label){case 0:t=new y,setTimeout((function(){return i.__awaiter(r,void 0,void 0,(function(){return i.__generator(this,(function(e){return t.abort(),[2]}))}
733))}),this.settings.fetchTimeoutMillis),o.label=1;case 1:return o.trys.push([1,4,,6]),[4,this._client.fetch({cacheMaxAgeMillis:this.settings.minimumFetchIntervalMillis,signal:t})];case 2:return o.sent(),[4,this._storageCache.setLastFetchStatus("success")];case 3:return o.sent(),[3,6];case 4:return e=o.sent(),n=d(e,"fetch-throttle")?"throttle":"failure",[4,this._storageCache.setLastFetchStatus(n)];case 5:throw o.sent(),e;case 6:return[2]}}))}))},t.prototype.fetchAndActivate=function(){return i.__awaiter(this,void 0,void 0,(function(){return i.__generator(this,(function(t){switch(t.label){case 0:return[4,this.fetch()];case 1:return t.sent(),[2,this.activate()]}}))}))},t.prototype.getAll=function(){var t=this;return S(this._storageCache.getActiveConfig(),this.defaultConfig).reduce((function(e,n){return e[n]=t.getValue(n),e}),{})},t.prototype.getBoolean=function(t){return this.getValue(t).asBoolean()},t.prototype.getNumber=function(t){return this.getValue(t).asNumber()},t.prototype.getString=function(t){return this.getValue(t).asString()},t.prototype.getValue=function(t){this._isInitializationComplete||this._logger.debug('A value was requested for key "'+t+'" before SDK initialization completed. Await on ensureInitialized if the intent was to get a previously activated value.');var e=this._storageCache.getActiveConfig();return e&&void 0!==e[t]?new E("remote",e[t]):this.defaultConfig&&void 0!==this.defaultConfig[t]?new E("default",String(this.defaultConfig[t])):(this._logger.debug('Returning static value for key "'+t+'". Define a default or remote value if this is unintentional.'),new E("static"))},t}(); 734/** 735 * @license 736 * Copyright 2019 Google LLC 737 * 738 * Licensed under the Apache License, Version 2.0 (the "License"); 739 * you may not use this file except in compliance with the License. 740 * You may obtain a copy of the License at 741 * 742 * http://www.apache.org/licenses/LICENSE-2.0 743 * 744 * Unless required by applicable law or agreed to in writing, software 745 * distributed under the License is distributed on an "AS IS" BASIS, 746 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 747 * See the License for the specific language governing permissions and 748 * limitations under the License. 749 */function S(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),Object.keys(i.__assign(i.__assign({},t),e))} 750/** 751 * @license 752 * Copyright 2019 Google LLC 753 * 754 * Licensed under the Apache License, Version 2.0 (the "License"); 755 * you may not use this file except in compliance with the License. 756 * You may obtain a copy of the License at 757 * 758 * http://www.apache.org/licenses/LICENSE-2.0 759 * 760 * Unless required by applicable law or agreed to in writing, software 761 * distributed under the License is distributed on an "AS IS" BASIS, 762 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 763 * See the License for the specific language governing permissions and 764 * limitations under the License. 765 */function O(t,e){var n=t.target.error||void 0;return p.create(e,{originalErrorMessage:n&&n.message})}var N="app_namespace_store",A="firebase_remote_config",k=1;function R(){return new Promise((function(t,e){var n=indexedDB.open(A,k);n.onerror=function(t){e(O(t,"storage-open"))},n.onsuccess=function(e){t(e.target.result)},n.onupgradeneeded=function(t){var e=t.target.result;switch(t.oldVersion){case 0:e.createObjectStore(N,{keyPath:"compositeKey"})}}}))}var P=function(){function t(t,e,n,r){void 0===r&&(r=R()),this.appId=t,this.appName=e,this.namespace=n,this.openDbPromise=r}return t.prototype.getLastFetchStatus=function(){return this.get("last_fetch_status")},t.prototype.setLastFetchStatus=function(t){return this.set("last_fetch_status",t)},t.prototype.getLastSuccessfulFetchTimestampMillis=function(){return this.get("last_successful_fetch_timestamp_millis")},t.prototype.setLastSuccessfulFetchTimestampMillis=function(t){return this.set("last_successful_fetch_timestamp_millis",t)},t.prototype.getLastSuccessfulFetchResponse=function(){return this.get("last_successful_fetch_response")},t.prototype.setLastSuccessfulFetchResponse=function(t){return this.set("last_successful_fetch_response",t)},t.prototype.getActiveConfig=function(){return this.get("active_config")},t.prototype.setActiveConfig=function(t){return this.set("active_config",t)},t.prototype.getActiveConfigEtag=function(){return this.get("active_config_etag")},t.prototype.setActiveConfigEtag=function(t){return this.set("active_config_etag",t)},t.prototype.getThrottleMetadata=function(){return this.get("throttle_metadata")},t.prototype.setThrottleMetadata=function(t){return this.set("throttle_metadata",t)},t.prototype.deleteThrottleMetadata=function(){return this.delete("throttle_metadata")},t.prototype.get=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n=this;return i.__generator(this,(function(r){switch(r.label){case 0:return[4,this.openDbPromise];case 1:return e=r.sent(),[2,new Promise((function(r,i){var o=e.transaction([N],"readonly"),s=o.objectStore(N),a=n.createCompositeKey(t);try{var u=s.get(a);u.onerror=function(t){i(O(t,"storage-get"))},u.onsuccess=function(t){var e=t.target.result;r(e?e.value:void 0)}}catch(c){i(p.create("storage-get",{originalErrorMessage:c&&c.message}))}}))]}}))}))},t.prototype.set=function(t,e){return i.__awaiter(this,void 0,void 0,(function(){var n,r=this;return i.__generator(this,(function(i){switch(i.label){case 0:return[4,this.openDbPromise];case 1:return n=i.sent(),[2,new Promise((function(i,o){var s=n.transaction([N],"readwrite"),a=s.objectStore(N),u=r.createCompositeKey(t);try{var c=a.put({compositeKey:u,value:e});c.onerror=function(t){o(O(t,"storage-set"))},c.onsuccess=function(){i()}}catch(h){o(p.create("storage-set",{originalErrorMessage:h&&h.message}))}}))]}}))}))},t.prototype.delete=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e,n=this;return i.__generator(this,(function(r){switch(r.label){case 0:return[4,this.openDbPromise];case 1:return e=r.sent(),[2,new Promise((function(r,i){var o=e.transaction([N],"readwrite"),s=o.objectStore(N),a=n.createCompositeKey(t);try{var u=s.delete(a);u.onerror=function(t){i(O(t,"storage-delete"))},u.onsuccess=function(){r()}}catch(c){i(p.create("storage-delete",{originalErrorMessage:c&&c.message}))}}))]}}))}))},t.prototype.createCompositeKey=function(t){return[this.appId,this.appName,this.namespace,t].join()},t}(),x=function(){function t(t){this.storage=t}return t.prototype.getLastFetchStatus=function(){return this.lastFetchStatus},t.prototype.getLastSuccessfulFetchTimestampMillis=function(){return this.lastSuccessfulFetchTimestampMillis},t.prototype.getActiveConfig=function(){return this.activeConfig},t.prototype.loadFromStorage=function(){return i.__awaiter(this,void 0,void 0,(function(){var t,e,n,r,o,s;return i.__generator(this,(function(i){switch(i.label){case 0:return t=this.storage.getLastFetchStatus(),e=this.storage.getLastSuccessfulFetchTimestampMillis(),n=this.storage.getActiveConfig(),[4,t];case 1:return r=i.sent(),r&&(this.lastFetchStatus=r),[4,e];case 2:return o=i.sent(),o&&(this.lastSuccessfulFetchTimestampMillis=o),[4,n];case 3:return s=i.sent(),s&&(this.activeConfig=s),[2]}}))}))},t.prototype.setLastFetchStatus=function(t){return this.lastFetchStatus=t,this.storage.setLastFetchStatus(t)},t.prototype.setLastSuccessfulFetchTimestampMillis=function(t){return this.lastSuccessfulFetchTimestampMillis=t,this.storage.setLastSuccessfulFetchTimestampMillis(t)},t.prototype.setActiveConfig=function(t){return this.activeConfig=t,this.storage.setActiveConfig(t)},t}(); 766/** 767 * @license 768 * Copyright 2019 Google LLC 769 * 770 * Licensed under the Apache License, Version 2.0 (the "License");
771 * you may not use this file except in compliance with the License. 772 * You may obtain a copy of the License at 773 * 774 * http://www.apache.org/licenses/LICENSE-2.0 775 * 776 * Unless required by applicable law or agreed to in writing, software 777 * distributed under the License is distributed on an "AS IS" BASIS, 778 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 779 * See the License for the specific language governing permissions and 780 * limitations under the License. 781 */ 782/** 783 * @license 784 * Copyright 2019 Google LLC 785 * 786 * Licensed under the Apache License, Version 2.0 (the "License"); 787 * you may not use this file except in compliance with the License. 788 * You may obtain a copy of the License at 789 * 790 * http://www.apache.org/licenses/LICENSE-2.0 791 * 792 * Unless required by applicable law or agreed to in writing, software 793 * distributed under the License is distributed on an "AS IS" BASIS, 794 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 795 * See the License for the specific language governing permissions and 796 * limitations under the License. 797 */ 798function D(t,e){return new Promise((function(n,r){var i=Math.max(e-Date.now(),0),o=setTimeout(n,i);t.addEventListener((function(){clearTimeout(o),r(p.create("fetch-throttle",{throttleEndTimeMillis:e}))}))}))}function L(t){if(!(t instanceof o.FirebaseError))return!1;var e=Number(t["httpStatus"]);return 429===e||500===e||503===e||504===e}var j=function(){function t(t,e){this.client=t,this.storage=e}return t.prototype.fetch=function(t){return i.__awaiter(this,void 0,void 0,(function(){var e;return i.__generator(this,(function(n){switch(n.label){case 0:return[4,this.storage.getThrottleMetadata()];case 1:return e=n.sent()||{backoffCount:0,throttleEndTimeMillis:Date.now()},[2,this.attemptFetch(t,e)]}}))}))},t.prototype.attemptFetch=function(t,e){var n=e.throttleEndTimeMillis,r=e.backoffCount;return i.__awaiter(this,void 0,void 0,(function(){var e,s,a;return i.__generator(this,(function(i){switch(i.label){case 0:return[4,D(t.signal,n)];case 1:i.sent(),i.label=2;case 2:return i.trys.push([2,5,,7]),[4,this.client.fetch(t)];case 3:return e=i.sent(),[4,this.storage.deleteThrottleMetadata()];case 4:return i.sent(),[2,e];case 5:if(s=i.sent(),!L(s))throw s;return a={throttleEndTimeMillis:Date.now()+o.calculateBackoffMillis(r),backoffCount:r+1},[4,this.storage.setThrottleMetadata(a)];case 6:return i.sent(),[2,this.attemptFetch(t,a)];case 7:return[2]}}
798))}))},t}(),M="@firebase/remote-config",F="0.1.28"; 799/** 800 * @license 801 * Copyright 2019 Google LLC 802 * 803 * Licensed under the Apache License, Version 2.0 (the "License"); 804 * you may not use this file except in compliance with the License. 805 * You may obtain a copy of the License at 806 * 807 * http://www.apache.org/licenses/LICENSE-2.0 808 * 809 * Unless required by applicable law or agreed to in writing, software 810 * distributed under the License is distributed on an "AS IS" BASIS, 811 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 812 * See the License for the specific language governing permissions and 813 * limitations under the License. 814 */ 815function U(t){function e(e,n){var r=e.getProvider("app").getImmediate(),i=e.getProvider("installations").getImmediate();if("undefined"===typeof window)throw p.create("registration-window");var o=r.options,a=o.projectId,u=o.apiKey,c=o.appId;if(!a)throw p.create("registration-project-id");if(!u)throw p.create("registration-api-key");if(!c)throw p.create("registration-app-id");n=n||"firebase";var h=new P(c,r.name,n),f=new x(h),d=new s.Logger(M);d.logLevel=s.LogLevel.ERROR;var v=new g(i,t.SDK_VERSION,n,a,u,c),y=new j(v,h),m=new l(y,h,f,d),_=new C(r,m,f,h,d);return _.ensureInitialized(),_}t.INTERNAL.registerComponent(new a.Component("remoteConfig",e,"PUBLIC").setMultipleInstances(!0)),t.registerVersion(M,F)}U(h["default"]),e.registerRemoteConfig=U},"3bbe":function(t,e,n){var r=n("1626"),i=String,o=TypeError;t.exports=function(t){if("object"==typeof t||r(t))return t;throw o("Can't set "+i(t)+" as a prototype")}},"3f8c":function(t,e){t.exports={}},"40d5":function(t,e,n){var r=n("d039");t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},4362:function(t,e,n){e.nextTick=function(t){var e=Array.prototype.slice.call(arguments);e.shift(),setTimeout((function(){t.apply(null,e)}),0)},e.platform=e.arch=e.execPath=e.title="browser",e.pid=1,e.browser=!0,e.env={},e.argv=[],e.binding=function(t){throw new Error("No such module. (Possibly not yet loaded)")},function(){var t,r="/";e.cwd=function(){return r},e.chdir=function(e){t||(t=n("df7c")),r=t.resolve(e,r)}}(),e.exit=e.kill=e.umask=e.dlopen=e.uptime=e.memoryUsage=e.uvCounters=function(){},e.features={}},"44ad":function(t,e,n){var r=n("e330"),i=n("d039"),o=n("c6b6"),s=Object,a=r("".split);t.exports=i((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?a(t,""):s(t)}:s},"44d2":function(t,e,n){var r=n("b622"),i=n("7c73"),o=n("9bf2").f,s=r("unscopables"),a=Array.prototype;void 0==a[s]&&o(a,s,{configurable:!0,value:i(null)}),t.exports=function(t){a[s][t]=!0}},"44de":function(t,e,n){var r=n("da84");t.exports=function(t,e){var n=r.console;n&&n.error&&(1==arguments.length?n.error(t):n.error(t,e))}},4738:function(t,e,n){var r=n("da84"),i=n("d256"),o=n("1626"),s=n("94ca"),a=n("8925"),u=n("b622"),c=n("6069"),h=n("6c59"),l=n("c430"),f=n("2d00"),p=i&&i.prototype,d=u("species"),v=!1,g=o(r.PromiseRejectionEvent),y=s("Promise",(function(){var t=a(i),e=t!==String(i);if(!e&&66===f)return!0;if(l&&(!p["catch"]||!p["finally"]))return!0;if(!f||f<51||!/native code/.test(t)){var n=new i((function(t){t(1)})),r=function(t){t((function(){}),(function(){}))},o=n.constructor={};if(o[d]=r,v=n.then((function(){}))instanceof r,!v)return!0}return!e&&(c||h)&&!g}));t.exports={CONSTRUCTOR:y,REJECTION_EVENT:g,SUBCLASSING:v}},4840:function(t,e,n){var r=n("825a"),i=n("5087"),o=n("b622"),s=o("species");t.exports=function(t,e){var n,o=r(t).constructor;return void 0===o||void 0==(n=r(o)[s])?e:i(n)}},"485a":function(t,e,n){var r=n("c65b"),i=n("1626"),o=n("861d"),s=TypeError;t.exports=function(t,e){var n,a;if("string"===e&&i(n=t.toString)&&!o(a=r(n,t)))return a;if(i(n=t.valueOf)&&!o(a=r(n,t)))return a;if("string"!==e&&i(n=t.toString)&&!o(a=r(n,t)))return a;throw s("Can't convert object to primitive value")}},4930:function(t,e,n){var r=n("2d00"),i=n("d039");t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},"4be4":function(t,e,n){"use strict";
815Object.defineProperty(e,"__esModule",{value:!0});var r=n("9ab4"),i=n("cd51"),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(o){}}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(u){if(i)return null;throw u}},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,c(t))try{this.getOrInitializeService(s)}catch(p){}try{for(var i=r.__values(this.instancesDeferred.entries()),o=i.next();!o.done;o=i.next()){var a=r.__read(o.value,2),u=a[0],h=a[1],l=this.normalizeInstanceIdentifier(u);try{var f=this.getOrInitializeService(l);h.resolve(f)}catch(p){}}}catch(d){e={error:d}}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,u(t)),this.instances.set(t,e)),e||null},t.prototype.normalizeInstanceIdentifier=function(t){return this.component?this.component.multipleInstances?t:s:t},t}();function u(t){return t===s?void 0:t}function c(t){return"EAGER"===t.instantiationMode} 816/** 817 * @license 818 * Copyright 2019 Google LLC 819 * 820 * Licensed under the Apache License, Version 2.0 (the "License"); 821 * you may not use this file except in compliance with the License. 822 * You may obtain a copy of the License at 823 * 824 * http://www.apache.org/licenses/LICENSE-2.0 825 * 826 * Unless required by applicable law or agreed to in writing, software 827 * distributed under the License is distributed on an "AS IS" BASIS, 828 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 829 * See the License for the specific language governing permissions and 830 * limitations under the License. 831 */var h=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){var e=this.getProvider(t.name);e.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=h,e.Provider=a},"4d64":function(t,e,n){var r=n("fc6a"),i=n("23cb"),o=n("07fa"),s=function(t){return function(e,n,s){var a,u=r(e),c=o(u),h=i(s,c);if(t&&n!=n){while(c>h)if(a=u[h++],a!=a)return!0}else for(;c>h;
vendor: 9,096 bytes, lines 831-848
831h++)if((t||h in u)&&u[h]===n)return t||h||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},5087:function(t,e,n){var r=n("68ee"),i=n("0d51"),o=TypeError;t.exports=function(t){if(r(t))return t;throw o(i(t)+" is not a constructor")}},"50c4":function(t,e,n){var r=n("5926"),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},5692:function(t,e,n){var r=n("c430"),i=n("c6cd");(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.24.1",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE",source:"https://github.com/zloirock/core-js"})},"56ef":function(t,e,n){var r=n("d066"),i=n("e330"),o=n("241c"),s=n("7418"),a=n("825a"),u=i([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(a(t)),n=s.f;return n?u(e,n(t)):e}},5926:function(t,e,n){var r=n("b42e");t.exports=function(t){var e=+t;return e!==e||0===e?0:r(e)}},"59ca":function(t,e,n){"use strict";var r=n("c23d");function i(t){return t&&"object"===typeof t&&"default"in t?t:{default:t}}var o=i(r),s="firebase",a="7.23.0"; 832/** 833 * @license 834 * Copyright 2018 Google LLC 835 * 836 * Licensed under the Apache License, Version 2.0 (the "License"); 837 * you may not use this file except in compliance with the License. 838 * You may obtain a copy of the License at 839 * 840 * http://www.apache.org/licenses/LICENSE-2.0 841 * 842 * Unless required by applicable law or agreed to in writing, software 843 * distributed under the License is distributed on an "AS IS" BASIS, 844 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 845 * See the License for the specific language governing permissions and 846 * limitations under the License. 847 */ 848o["default"].registerVersion(s,a,"app"),t.exports=o["default"]},"59ed":function(t,e,n){var r=n("1626"),i=n("0d51"),o=TypeError;t.exports=function(t){if(r(t))return t;throw o(i(t)+" is not a function")}},"5c6c":function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"5e77":function(t,e,n){var r=n("83ab"),i=n("1a2d"),o=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,a=i(o,"name"),u=a&&"something"===function(){}.name,c=a&&(!r||r&&s(o,"name").configurable);t.exports={EXISTS:a,PROPER:u,CONFIGURABLE:c}},"5e7e":function(t,e,n){"use strict";var r,i,o,s,a=n("23e7"),u=n("c430"),c=n("605d"),h=n("da84"),l=n("c65b"),f=n("cb2d"),p=n("d2bb"),d=n("d44e"),v=n("2626"),g=n("59ed"),y=n("1626"),m=n("861d"),_=n("19aa"),b=n("4840"),w=n("2cf4").set,E=n("b575"),I=n("44de"),T=n("e667"),C=n("01b4"),S=n("69f3"),O=n("d256"),N=n("4738"),A=n("f069"),k="Promise",R=N.CONSTRUCTOR,P=N.REJECTION_EVENT,x=N.SUBCLASSING,D=S.getterFor(k),L=S.set,j=O&&O.prototype,M=O,F=j,U=h.TypeError,V=h.document,q=h.process,B=A.f,W=B,G=!!(V&&V.createEvent&&h.dispatchEvent),H="unhandledrejection",K="rejectionhandled",z=0,Q=1,Y=2,X=1,$=2,J=function(t){var e;return!(!m(t)||!y(e=t.then))&&e},Z=function(t,e){var n,r,i,o=e.value,s=e.state==Q,a=s?t.ok:t.fail,u=t.resolve,c=t.reject,h=t.domain;try{a?(s||(e.rejection===$&&it(e),e.rejection=X),!0===a?n=o:(h&&h.enter(),n=a(o),h&&(h.exit(),i=!0)),n===t.promise?c(U("Promise-chain cycle")):(r=J(n))?l(r,n,u,c):u(n)):c(o)}catch(f){h&&!i&&h.exit(),c(f)}},tt=function(t,e){t.notified||(t.notified=!0,E((function(){var n,r=t.reactions;while(n=r.get())Z(n,t);t.notified=!1,e&&!t.rejection&&nt(t)})))},et=function(t,e,n){var r,i;G?(r=V.createEvent("Event"),r.promise=e,r.reason=n,r.initEvent(t,!1,!0),h.dispatchEvent(r)):r={promise:e,reason:n},!P&&(i=h["on"+t])?i(r):t===H&&I("Unhandled promise rejection",n)},nt=function(t){l(w,h,(function(){var e,n=t.facade,r=t.value,i=rt(t);if(i&&(e=T((function(){c?q.emit("unhandledRejection",r,n):et(H,n,r)})),t.rejection=c||rt(t)?$:X,e.error))throw e.value}))},rt=function(t){return t.rejection!==X&&!t.parent},it=function(t){l(w,h,(function(){var e=t.facade;c?q.emit("rejectionHandled",e):et(K,e,t.value)}))},ot=function(t,e,n){return function(r){t(e,r,n)}},st=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=Y,tt(t,!0))},at=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw U("Promise can't be resolved itself");var r=J(e);r?E((function(){var n={done:!1};try{l(r,e,ot(at,n,t),ot(st,n,t))}catch(i){st(n,i,t)}})):(t.value=e,t.state=Q,tt(t,!1))}catch(i){st({done:!1},i,t)}}};if(R&&(M=function(t){_(this,F),g(t),l(r,this);var e=D(this);try{t(ot(at,e),ot(st,e))}catch(n){st(e,n)}},F=M.prototype,r=function(t){L(this,{type:k,done:!1,notified:!1,parent:!1,reactions:new C,rejection:!1,state:z,value:void 0})},r.prototype=f(F,"then",(function(t,e){var n=D(this),r=B(b(this,M));return n.parent=!0,r.ok=!y(t)||t,r.fail=y(e)&&e,r.domain=c?q.domain:void 0,n.state==z?n.reactions.add(r):E((function(){Z(r,n)})),r.promise})),i=function(){var t=new r,e=D(t);this.promise=t,this.resolve=ot(at,e),this.reject=ot(st,e)},A.f=B=function(t){return t===M||t===o?new i(t):W(t)},!u&&y(O)&&j!==Object.prototype)){s=j.then,x||f(j,"then",(function(t,e){var n=this;return new M((function(t,e){l(s,n,t,e)})).then(t,e)}),{unsafe:!0});try{delete j.constructor}catch(ut){}p&&p(j,F)}a({global:!0,constructor:!0,wrap:!0,forced:R},{Promise:M}),d(M,k,!1,!0),v(k)},"5eed":function(t,e,n){var r=n("d256"),i=n("1c7e"),o=n("4738").CONSTRUCTOR;t.exports=o||!i((function(t){r.all(t).then(void 0,(function(){}))}))},"605d":function(t,e,n){var r=n("c6b6"),i=n("da84");t.exports="process"==r(i.process)},6069:function(t,e,n){var r=n("6c59"),i=n("605d");t.exports=!r&&!i&&"object"==typeof window&&"object"==typeof document},"60da":function(t,e,n){"use strict";var r=n("83ab"),i=n("e330"),o=n("c65b"),s=n("d039"),a=n("df75"),u=n("7418"),c=n("d1e7"),h=n("7b0b"),l=n("44ad"),f=Object.assign,p=Object.defineProperty,d=i([].concat);t.exports=!f||s((function(){if(r&&1!==f({b:1},f(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach((function(t){e[t]=t})),7!=f({},t)[n]||a(f({},e)).join("")!=i}))?function(t,e){var n=h(t),i=arguments.length,s=1,f=u.f,p=c.f;while(i>s){var v,g=l(arguments[s++]),y=f?d(a(g),f(g)):a(g),m=y.length,_=0;while(m>_)v=y[_++],r&&!o(p,g,v)||(n[v]=g[v])}return n}:f},6374:function(t,e,n){var r=n("da84"),i=Object.defineProperty;t.exports=function(t,e){try{i(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},"68ee":function(t,e,n){var r=n("e330"),i=n("d039"),o=n("1626"),s=n("f5df"),a=n("d066"),u=n("8925"),c=function(){},h=[],l=a("Reflect","construct"),f=/^\s*(?:class|function)\b/,p=r(f.exec),d=!f.exec(c),v=function(t){if(!o(t))return!1;try{return l(c,h,t),!0}catch(e){return!1}},g=function(t){if(!o(t))return!1;switch(s(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return d||!!p(f,u(t))}catch(e){return!0}};g.sham=!0,t.exports=!l||i((function(){var t;return v(v.call)||!v(Object)||!v((function(){t=!0}))||t}))?g:v},"69f3":function(t,e,n){var r,i,o,s=n("7f9a"),a=n("da84"),u=n("e330"),c=n("861d"),h=n("9112"),l=n("1a2d"),f=n("c6cd"),p=n("f772"),d=n("d012"),v="Object already initialized",g=a.TypeError,y=a.WeakMap,m=function(t){return o(t)?i(t):r(t,{})},_=function(t){return function(e){var n;if(!c(e)||(n=i(e)).type!==t)throw g("Incompatible receiver, "+t+" required");return n}};if(s||f.state){var b=f.state||(f.state=new y),w=u(b.get),E=u(b.has),I=u(b.set);r=function(t,e){if(E(b,t))throw new g(v);return e.facade=t,I(b,t,e),e},i=function(t){return w(b,t)||{}},o=function(t){return E(b,t)}}else{var T=p("state");d[T]=!0,r=function(t,e){if(l(t,T))throw new g(v);return e.facade=t,h(t,T,e),e},i=function(t){return l(t,T)?t[T]:{}},o=function(t){return l(t,T)}}t.exports={set:r,get:i,has:o,enforce:m,getterFor:_}},"6c59":function(t,e){t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},"6d09":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("c23d");n("7d28");var i=n("9ab4"),o=n("cd51"),s=n("abfd"),a=n("4be4");function u(t){return t&&"object"===typeof t&&"default"in t?t:{default:t}}var c,h,l,f=u(r),p="@firebase/performance",d="0.4.2",v=d,g="FB-PERF-TRACE-START",y="FB-PERF-TRACE-STOP",m="FB-PERF-TRACE-MEASURE",_="_wt_",b="_fp",w="_fcp",E="_fid",I="@firebase/performance/config",T="@firebase/performance/configexpire",C="performance",S="Performance",O=(c={},c["trace started"]="Trace {$traceName} was started before.",c["trace stopped"]="Trace {$traceName} is not running.",c["nonpositive trace startTime"]="Trace {$traceName} startTime should be positive.",c["nonpositive trace duration"]="Trace {$traceName} duration should be positive.",c["no window"]="Window is not available.",c["no app id"]="App id is not available.",c["no project id"]="Project id is not available.",c["no api key"]="Api key is not available.",c["invalid cc log"]="Attempted to queue invalid cc event",c["FB not default"]="Performance can only start when Firebase app instance is the default one.",c["RC response not ok"]="RC response is not ok",c["invalid attribute name"]="Attribute name {$attributeName}
848 is invalid.",c["invalid attribute value"]="Attribute value {$attributeValue} is invalid.",c["invalid custom metric name"]="Custom metric name {$customMetricName} is invalid",c["invalid String merger input"]="Input for String merger is invalid, contact support team to resolve.",c),N=new o.ErrorFactory(C,S,O),A=new s.Logger(S);A.logLevel=s.LogLevel.INFO;var k,R=function(){function t(t){if(this.window=t,!t)throw N.create("no window");this.performance=t.performance,this.PerformanceObserver=t.PerformanceObserver,this.windowLocation=t.location,this.navigator=t.navigator,this.document=t.document,this.navigator&&this.navigator.cookieEnabled&&(this.localStorage=t.localStorage),t.perfMetrics&&t.perfMetrics.onFirstInputDelay&&(this.onFirstInputDelay=t.perfMetrics.onFirstInputDelay)}return t.prototype.getUrl=function(){return this.windowLocation.href.split("?")[0]},t.prototype.mark=function(t){this.performance&&this.performance.mark&&this.performance.mark(t)},t.prototype.measure=function(t,e,n){this.performance&&this.performance.measure&&this.performance.measure(t,e,n)},t.prototype.getEntriesByType=function(t){return this.performance&&this.performance.getEntriesByType?this.performance.getEntriesByType(t):[]},t.prototype.getEntriesByName=function(t){return this.performance&&this.performance.getEntriesByName?this.performance.getEntriesByName(t):[]},t.prototype.getTimeOrigin=function(){return this.performance&&(this.performance.timeOrigin||this.performance.timing.navigationStart)},t.prototype.requiredApisAvailable=function(){return fetch&&Promise&&this.navigator&&this.navigator.cookieEnabled?!!o.isIndexedDBAvailable()||(A.info("IndexedDB is not supported by current browswer"),!1):(A.info("Firebase Performance cannot start if browser does not support fetch and Promise or cookie is disabled."),!1)},t.prototype.setupObserver=function(t,e){if(this.PerformanceObserver){var n=new this.PerformanceObserver((function(t){for(var n=0,r=t.getEntries();n<r.length;n++){var i=r[n];e(i)}}));n.observe({entryTypes:[t]})}},t.getInstance=function(){return void 0===h&&(h=new t(l)),h},t}();function P(t){l=t} 849/** 850 * @license 851 * Copyright 2019 Google LLC 852 * 853 * Licensed under the Apache License, Version 2.0 (the "License"); 854 * you may not use this file except in compliance with the License. 855 * You may obtain a copy of the License at 856 * 857 * http://www.apache.org/licenses/LICENSE-2.0 858 * 859 * Unless required by applicable law or agreed to in writing, software 860 * distributed under the License is distributed on an "AS IS" BASIS, 861 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 862 * See the License for the specific language governing permissions and 863 * limitations under the License. 864 */function x(t,e){var n=t.length-e.length;if(n<0||n>1)throw N.create("invalid String merger input");for(var r=[],i=0;i<t.length;i++)r.push(t.charAt(i)),e.length>i&&r.push(e.charAt(i));return r.join("")} 865/** 866 * @license 867 * Copyright 2019 Google LLC 868 * 869 * Licensed under the Apache License, Version 2.0 (the "License"); 870 * you may not use this file except in compliance with the License. 871 * You may obtain a copy of the License at 872 * 873 * http://www.apache.org/licenses/LICENSE-2.0 874 * 875 * Unless required by applicable law or agreed to in writing, software 876 * distributed under the License is distributed on an "AS IS" BASIS, 877 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 878 * See the License for the specific language governing permissions and 879 * limitations under the License. 880 */var D,L,j=function(){function t(){this.instrumentationEnabled=!0,this.dataCollectionEnabled=!0,this.loggingEnabled=!1,this.tracesSamplingRate=1,this.networkRequestsSamplingRate=1,this.logEndPointUrl="https://firebaselogging.googleapis.com/v0cc/log?format=json_proto",this.flTransportEndpointUrl=x("hts/frbslgigp.ogepscmv/ieo/eaylg","tp:/ieaeogn-agolai.o/1frlglgc/o"),this.transportKey=x("AzSC8r6ReiGqFMyfvgow","Iayx0u-XT3vksVM-pIV"),this.logSource=462,this.logTraceAfterSampling=!1,this.logNetworkAfterSampling=!1,this.configTimeToLive=12}return t.prototype.getAppId=function(){var t=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.appId;if(!t)throw N.create("no app id");return t},t.prototype.getProjectId=function(){var t=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.projectId;if(!t)throw N.create("no project id");return t},t.prototype.getApiKey=function(){var t=this.firebaseAppInstance&&this.firebaseAppInstance.options&&this.firebaseAppInstance.options.apiKey;if(!t)throw N.create("no api key");return t},t.prototype.getFlTransportFullUrl=function(){return this.flTrans
880portEndpointUrl.concat("?key=",this.transportKey)},t.getInstance=function(){return void 0===k&&(k=new t),k},t}(); 881/** 882 * @license 883 * Copyright 2019 Google LLC 884 * 885 * Licensed under the Apache License, Version 2.0 (the "License"); 886 * you may not use this file except in compliance with the License. 887 * You may obtain a copy of the License at 888 * 889 * http://www.apache.org/licenses/LICENSE-2.0 890 * 891 * Unless required by applicable law or agreed to in writing, software 892 * distributed under the License is distributed on an "AS IS" BASIS, 893 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 894 * See the License for the specific language governing permissions and 895 * limitations under the License. 896 */function M(){var t=j.getInstance().installationsService.getId();return t.then((function(t){D=t})),t}function F(){return D}function U(){var t=j.getInstance().installationsService.getToken();return t.then((function(t){})),t} 897/** 898 * @license 899 * Copyright 2019 Google LLC 900 * 901 * Licensed under the Apache License, Version 2.0 (the "License"); 902 * you may not use this file except in compliance with the License. 903 * You may obtain a copy of the License at 904 * 905 * http://www.apache.org/licenses/LICENSE-2.0 906 * 907 * Unless required by applicable law or agreed to in writing, software 908 * distributed under the License is distributed on an "AS IS" BASIS, 909 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 910 * See the License for the specific language governing permissions and 911 * limitations under the License. 912 */(function(t){t[t["UNKNOWN"]=0]="UNKNOWN",t[t["VISIBLE"]=1]="VISIBLE",t[t["HIDDEN"]=2]="HIDDEN"})(L||(L={}));var V=["firebase_","google_","ga_"],q=new RegExp("^[a-zA-Z]\\w*$"),B=40,W=100;function G(){var t=R.getInstance().navigator;return"serviceWorker"in t?t.serviceWorker.controller?2:3:1}function H(){var t=R.getInstance().document,e=t.visibilityState;switch(e){case"visible":return L.VISIBLE;case"hidden":return L.HIDDEN;default:return L.UNKNOWN}}function K(){var t=R.getInstance().navigator,e=t.connection,n=e&&e.effectiveType;switch(n){case"slow-2g":return 1;case"2g":return 2;case"3g":return 3;case"4g":return 4;default:return 0}}function z(t){if(0===t.length||t.length>B)return!1;var e=V.some((function(e){return t.startsWith(e)}));return!e&&!!t.match(q)}function Q(t){return 0!==t.length&&t.length<=W} 913/** 914 * @license 915 * Copyright 2019 Google LLC 916 * 917 * Licensed under the Apache License, Version 2.0 (the "License"); 918 * you may not use this file except in compliance with the License. 919 * You may obtain a copy of the License at 920 * 921 * http://www.apache.org/licenses/LICENSE-2.0 922 * 923 * Unless required by applicable law or agreed to in writing, software 924 * distributed under the License is distributed on an "AS IS" BASIS, 925 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 926 * See the License for the specific language governing permissions and 927 * limitations under the License. 928 */var Y="0.0.1",X={loggingEnabled:!0},$="FIREBASE_INSTALLATIONS_AUTH";function J(t){var e=Z();return e?(rt(e),Promise.resolve()):nt(t).then(rt).then((function(t){return tt(t)}),(function(){}))}function Z(){var t=R.getInstance().localStorage;if(t){var e=t.getItem(T);if(e&&it(e)){var n=t.getItem(I);if(n)try{var r=JSON.parse(n);return r}catch(c){return}}}}function tt(t){var e=R.getInstance().localStorage;t&&e&&(e.setItem(I,JSON.stringify(t)),e.setItem(T,String(Date.now()+60*j.getInstance().configTimeToLive*60*1e3)))}var et="Could not fetch config, will use default configs";function nt(t){return U().then((function(e){var n=j.getInstance().getProjectId(),r="https://firebaseremoteconfig.googleapis.com/v1/projects/"+n+"/namespaces/fireperf:fetch?key="+j.getInstance().getApiKey(),i=new Request(r,{method:"POST",headers:{Authorization:$+" "+e},body:JSON.stringify({app_instance_id:t,app_instance_id_token:e,app_id:j.getInstance().getAppId(),app_version:v,sdk_version:Y})});return fetch(i).then((function(t){if(t.ok)return t.json();throw N.create("RC response not ok")}))})).catch((function(){A.info(et)}))}function rt(t){if(!t)return t;var e=j.getInstance(),n=t.entries||{};return void 0!==n.fpr_enabled?e.loggingEnabled="true"===String(n.fpr_enabled):e.loggingEnabled=X.loggingEnabled,n.fpr_log_source&&(e.logSource=Number(n.fpr_log_source)),n.fpr_log_endpoint_url&&(e.logEndPointUrl=n.fpr_log_endpoint_url),n.fpr_log_transport_key&&(e.transportKey=n.fpr_log_transport_key),void 0!==n.fpr_vc_network_request_sampling_rate&&(e.networkRequestsSamplingRate=Number(n.fpr_vc_network_request_sampling_rate)),void 0!==n.fpr_vc_trace_sampling_rate&&(e.tracesSampl
928ingRate=Number(n.fpr_vc_trace_sampling_rate)),e.logTraceAfterSampling=ot(e.tracesSamplingRate),e.logNetworkAfterSampling=ot(e.networkRequestsSamplingRate),t}function it(t){return Number(t)>Date.now()}function ot(t){return Math.random()<=t} 929/** 930 * @license 931 * Copyright 2019 Google LLC 932 * 933 * Licensed under the Apache License, Version 2.0 (the "License"); 934 * you may not use this file except in compliance with the License. 935 * You may obtain a copy of the License at 936 * 937 * http://www.apache.org/licenses/LICENSE-2.0 938 * 939 * Unless required by applicable law or agreed to in writing, software 940 * distributed under the License is distributed on an "AS IS" BASIS, 941 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 942 * See the License for the specific language governing permissions and 943 * limitations under the License. 944 */var st,at=1;function ut(){return at=2,st=st||ht(),st}function ct(){return 3===at}function ht(){return lt().then((function(){return M()})).then((function(t){return J(t)})).then((function(){return ft()}),(function(){return ft()}))}function lt(){var t=R.getInstance().document;return new Promise((function(e){if(t&&"complete"!==t.readyState){var n=function(){"complete"===t.readyState&&(t.removeEventListener("readystatechange",n),e())};t.addEventListener("readystatechange",n)}else e()}))}function ft(){at=3} 945/** 946 * @license 947 * Copyright 2019 Google LLC 948 * 949 * Licensed under the Apache License, Version 2.0 (the "License"); 950 * you may not use this file except in compliance with the License. 951 * You may obtain a copy of the License at 952 * 953 * http://www.apache.org/licenses/LICENSE-2.0 954 * 955 * Unless required by applicable law or agreed to in writing, software 956 * distributed under the License is distributed on an "AS IS" BASIS, 957 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 958 * See the License for the specific language governing permissions and 959 * limitations under the License. 960 */var pt,dt=1e4,vt=5500,gt=3,yt=gt,mt=[],_t=!1;function bt(){_t||(wt(vt),_t=!0)}function wt(t){setTimeout((function(){if(0!==yt)return mt.length?void Et():wt(dt)}),t)}function Et(){var t=i.__spreadArrays(mt);mt=[];var e=t.map((function(t){return{source_extension_json_proto3:t.message,event_time_ms:String(t.eventTime)}})),n={request_time_ms:String(Date.now()),client_info:{client_type:1,js_client_info:{}},log_source:j.getInstance().logSource,log_event:e};It(n,t).catch((function(){mt=i.__spreadArrays(t,mt),yt--,A.info("Tries left: "+yt+"."),wt(dt)}))}function It(t,e){return Tt(t).then((function(t){return t.ok||A.info("Call to Firebase backend failed."),t.json()})).then((function(t){var n=Number(t.nextRequestWaitMillis),r=dt;isNaN(n)||(r=Math.max(n,r));var o=t.logResponseDetails;Array.isArray(o)&&o.length>0&&"RETRY_REQUEST_LATER"===o[0].responseAction&&(mt=i.__spreadArrays(e,mt),A.info("Retry transport request later.")),yt=gt,wt(r)}))}function Tt(t){var e=j.getInstance().getFlTransportFullUrl();return fetch(e,{method:"POST",body:JSON.stringify(t)})}function Ct(t){if(!t.eventTime||!t.message)throw N.create("invalid cc log");mt=i.__spreadArrays(mt,[t])}function St(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(void 0,e);Ct({message:r,eventTime:Date.now()})}} 961/** 962 * @license 963 * Copyright 2019 Google LLC 964 * 965 * Licensed under the Apache License, Version 2.0 (the "License"); 966 * you may not use this file except in compliance with the License. 967 * You may obtain a copy of the License at 968 * 969 * http://www.apache.org/licenses/LICENSE-2.0 970 * 971 * Unless required by applicable law or agreed to in writing, software 972 * distributed under the License is distributed on an "AS IS" BASIS, 973 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 974 * See the License for the specific language governing permissions and 975 * limitations under the License. 976 */function Ot(t,e){pt||(pt=St(Rt)),pt(t,e)}function Nt(t){var e=j.getInstance();!e.instrumentationEnabled&&t.isAuto||(e.dataCollectionEnabled||t.isAuto)&&R.getInstance().requiredApisAvailable()&&(t.isAuto&&H()!==L.VISIBLE||(ct()?At(t):ut().then((function(){return At(t)}),(function(){return At(t)}))))}function At(t){if(F()){var e=j.getInstance();e.loggingEnabled&&e.logTraceAfterSampling&&setTimeout((function(){return Ot(t,1)}),0)}}function kt(t){var e=j.getInstance();if(e.instrumentationEnabled){var n=t.url,r=e.logEndPointUrl.split("?")[0],i=e.flTransportEndpointUrl.split("?")[0];n!==r&&n!==i&&e.loggingEnabled&&e.logNetworkAfterSampling&&setTimeout((function(){return Ot(t,0)}),0)}}function Rt(t,e){return 0===e?Pt(t):xt(t)}function Pt(t){var e={url:t.url,http_method:t.httpMethod||0,http_response_code:200,response_payload_bytes:t.responsePayloadBytes,client_start_time_us:t.startTimeUs,time_to_response_initiated_us:t.timeToResponseInitiatedUs,time_to_response_completed_us:t.timeToResponseCompletedUs},n={application_info:Dt(),network_request_metric:e};return JSON.stringify(n)}function xt(t){var e={name:t.name,is_auto:t.isAuto,client_start_time_us:t.startTimeUs,duration_us:t.durationUs};0!==Object.keys(t.counters).length&&(e.counters=t.counters);var n=t.getAttributes();0!==Object.keys(n).length&&(e.custom_attributes=n);var r={application_info:Dt(),trace_metric:e};return JSON.stringify(r)}function Dt(){return{google_app_id:j.getInstance().getAppId(),app_instance_id:F(),web_app_info:{sdk_version:v,page_url:R.getInstance().getUrl(),service_worker_status:G(),visibility_state:H(),effective_connection_type:K()},application_process_state:0}} 977/** 978 * @license 979 * Copyright 2019 Google LLC 980 * 981 * Licensed under the Apache License, Version 2.0 (the "License");
982 * you may not use this file except in compliance with the License. 983 * You may obtain a copy of the License at 984 * 985 * http://www.apache.org/licenses/LICENSE-2.0 986 * 987 * Unless required by applicable law or agreed to in writing, software 988 * distributed under the License is distributed on an "AS IS" BASIS, 989 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 990 * See the License for the specific language governing permissions and 991 * limitations under the License. 992 */var Lt=100,jt="_",Mt=[b,w,E];function Ft(t,e){return!(0===t.length||t.length>Lt)&&(e&&e.startsWith(_)&&Mt.indexOf(t)>-1||!t.startsWith(jt))}function Ut(t){var e=Math.floor(t);return e<t&&A.info("Metric value should be an Integer, setting the value as : "+e+"."),e} 993/** 994 * @license 995 * Copyright 2019 Google LLC 996 * 997 * Licensed under the Apache License, Version 2.0 (the "License"); 998 * you may not use this file except in compliance with the License. 999 * You may obtain a copy of the License at 1000 * 1001 * http://www.apache.org/licenses/LICENSE-2.0 1002 * 1003 * Unless required by applicable law or agreed to in writing, software 1004 * distributed under the License is distributed on an "AS IS" BASIS, 1005 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1006 * See the License for the specific language governing permissions and 1007 * limitations under the License. 1008 */var Vt=function(){function t(t,e,n){void 0===e&&(e=!1),this.name=t,this.isAuto=e,this.state=1,this.customAttributes={},this.counters={},this.api=R.getInstance(),this.randomId=Math.floor(1e6*Math.random()),this.isAuto||(this.traceStartMark=g+"-"+this.randomId+"-"+this.name,this.traceStopMark=y+"-"+this.randomId+"-"+this.name,this.traceMeasure=n||m+"-"+this.randomId+"-"+this.name,n&&this.calculateTraceMetrics())}return t.prototype.start=function(){if(1!==this.state)throw N.create("trace started",{traceName:this.name});this.api.mark(this.traceStartMark),this.state=2},t.prototype.stop=function(){if(2!==this.state)throw N.create("trace stopped",{traceName:this.name});this.state=3,this.api.mark(this.traceStopMark),this.api.measure(this.traceMeasure,this.traceStartMark,this.traceStopMark),this.calculateTraceMetrics(),Nt(this)},t.prototype.record=function(t,e,n){if(t<=0)throw N.create("nonpositive trace startTime",{traceName:this.name});if(e<=0)throw N.create("nonpositive trace duration",{traceName:this.name});if(this.durationUs=Math.floor(1e3*e),this.startTimeUs=Math.floor(1e3*t),n&&n.attributes&&(this.customAttributes=i.__assign({},n.attributes)),n&&n.metrics)for(var r=0,o=Object.keys(n.metrics);r<o.length;r++){var s=o[r];isNaN(Number(n.metrics[s]))||(this.counters[s]=Number(Math.floor(n.metrics[s])))}Nt(this)},t.prototype.incrementMetric=function(t,e){void 0===e&&(e=1),void 0===this.counters[t]?this.putMetric(t,e):this.putMetric(t,this.counters[t]+e)},t.prototype.putMetric=function(t,e){if(!Ft(t,this.name))throw N.create("invalid custom metric name",{customMetricName:t});this.counters[t]=Ut(e)},t.prototype.getMetric=function(t){return this.counters[t]||0},t.prototype.putAttribute=function(t,e){var n=z(t),r=Q(e);if(n&&r)this.customAttributes[t]=e;else{if(!n)throw N.create("invalid attribute name",{attributeName:t});if(!r)throw N.create("invalid attribute value",{attributeValue:e})}},t.prototype.getAttribute=function(t){return this.customAttributes[t]},t.prototype.removeAttribute=function(t){void 0!==this.customAttributes[t]&&delete this.customAttributes[t]},t.prototype.getAttributes=function(){return i.__assign({},this.customAttributes)},t.prototype.setStartTime=function(t){this.startTimeUs=t},t.prototype.setDuration=function(t){this.durationUs=t},t.prototype.calculateTraceMetrics=function(){var t=this.api.getEntriesByName(this.traceMeasure),e=t&&t[0];e&&(this.durationUs=Math.floor(1e3*e.duration),this.startTimeUs=Math.floor(1e3*(e.startTime+this.api.getTimeOrigin())))},t.createOobTrace=function(e,n,r){var i=R.getInstance().getUrl();if(i){var o=new t(_+i,!0),s=Math.floor(1e3*R.getInstance().getTimeOrigin());o.setStartTime(s),e&&e[0]&&(o.setDuration(Math.floor(1e3*e[0].duration)),o.putMetric("domInteractive",Math.floor(1e3*e[0].domInteractive)),o.putMetric("domContentLoadedEventEnd",Math.floor(1e3*e[0].domContentLoadedEventEnd)),o.putMetric("loadEventEnd",Math.floor(1e3*e[0].loadEventEnd)));var a="first-paint",u="first-contentful-paint";if(n){var c=n.find((function(t){return t.name===a}));c&&c.startTime&&o.putMetric(b,Math.floor(1e3*c.startTime));var h=n.find((function(t){return t.name===u}));h&&h.startTime&&o.putMetric(w,Math.floor(1e3*h.startTime)),r&&o.putMetric(E,Math.floor(1e3*r))}Nt(o)}},t.createUserTimingTrace=function(e){var n=new t(e,!1,e);Nt(n)},t}(); 1009/** 1010 * @license 1011 * Copyright 2019 Google LLC 1012 * 1013 * Licensed under the Apache License, Version 2.0 (the "License");
1014 * you may not use this file except in compliance with the License. 1015 * You may obtain a copy of the License at 1016 * 1017 * http://www.apache.org/licenses/LICENSE-2.0 1018 * 1019 * Unless required by applicable law or agreed to in writing, software 1020 * distributed under the License is distributed on an "AS IS" BASIS, 1021 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1022 * See the License for the specific language governing permissions and 1023 * limitations under the License. 1024 */function qt(t){var e=t;if(e&&void 0!==e.responseStart){var n=R.getInstance().getTimeOrigin(),r=Math.floor(1e3*(e.startTime+n)),i=e.responseStart?Math.floor(1e3*(e.responseStart-e.startTime)):void 0,o=Math.floor(1e3*(e.responseEnd-e.startTime)),s=e.name&&e.name.split("?")[0],a={url:s,responsePayloadBytes:e.transferSize,startTimeUs:r,timeToResponseInitiatedUs:i,timeToResponseCompletedUs:o};kt(a)}} 1025/** 1026 * @license 1027 * Copyright 2019 Google LLC 1028 * 1029 * Licensed under the Apache License, Version 2.0 (the "License"); 1030 * you may not use this file except in compliance with the License. 1031 * You may obtain a copy of the License at 1032 * 1033 * http://www.apache.org/licenses/LICENSE-2.0 1034 * 1035 * Unless required by applicable law or agreed to in writing, software 1036 * distributed under the License is distributed on an "AS IS" BASIS, 1037 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1038 * See the License for the specific language governing permissions and 1039 * limitations under the License. 1040 */var Bt=5e3;function Wt(){F()&&(setTimeout((function(){return Ht()}),0),setTimeout((function(){return Gt()}),0),setTimeout((function(){return Kt()}),0))}function Gt(){for(var t=R.getInstance(),e=t.getEntriesByType("resource"),n=0,r=e;n<r.length;n++){var i=r[n];qt(i)}t.setupObserver("resource",qt)}function Ht(){var t=R.getInstance(),e=t.getEntriesByType("navigation"),n=t.getEntriesByType("paint");if(t.onFirstInputDelay){var r=setTimeout((function(){Vt.createOobTrace(e,n),r=void 0}),Bt);t.onFirstInputDelay((function(t){r&&(clearTimeout(r),Vt.createOobTrace(e,n,t))}))}else Vt.createOobTrace(e,n)}function Kt(){for(var t=R.getInstance(),e=t.getEntriesByType("measure"),n=0,r=e;n<r.length;n++){var i=r[n];zt(i)}t.setupObserver("measure",zt)}function zt(t){var e=t.name;e.substring(0,m.length)!==m&&Vt.createUserTimingTrace(e)} 1041/** 1042 * @license 1043 * Copyright 2019 Google LLC 1044 * 1045 * Licensed under the Apache License, Version 2.0 (the "License"); 1046 * you may not use this file except in compliance with the License. 1047 * You may obtain a copy of the License at 1048 * 1049 * http://www.apache.org/licenses/LICENSE-2.0 1050 * 1051 * Unless required by applicable law or agreed to in writing, software 1052 * distributed under the License is distributed on an "AS IS" BASIS, 1053 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1054 * See the License for the specific language governing permissions and 1055 * limitations under the License. 1056 */var Qt=function(){function t(t){this.app=t,R.getInstance().requiredApisAvailable()&&o.validateIndexedDBOpenable().then((function(t){t&&(bt(),ut().then(Wt,Wt))})).catch((function(t){A.info("Environment doesn't support IndexedDB: "+t)}))}return t.prototype.trace=function(t){return new Vt(t)},Object.defineProperty(t.prototype,"instrumentationEnabled",{get:function(){return j.getInstance().instrumentationEnabled},set:function(t){j.getInstance().instrumentationEnabled=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataCollectionEnabled",{get:function(){return j.getInstance().dataCollectionEnabled},set:function(t){j.getInstance().dataCollectionEnabled=t},enumerable:!1,configurable:!0}),t}(),Yt="[DEFAULT]"; 1057/** 1058 * @license 1059 * Copyright 2019 Google LLC 1060 * 1061 * Licensed under the Apache License, Version 2.0 (the "License"); 1062 * you may not use this file except in compliance with the License. 1063 * You may obtain a copy of the License at 1064 * 1065 * http://www.apache.org/licenses/LICENSE-2.0 1066 * 1067 * Unless required by applicable law or agreed to in writing, software 1068 * distributed under the License is distributed on an "AS IS" BASIS, 1069 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1070 * See the License for the specific language governing permissions and 1071 * limitations under the License. 1072 */function Xt(t){var e=function(t,e){if(t.name!==Yt)throw N.create("FB not default");if("undefined"===typeof window)throw N.create("no window");return P(window),j.getInstance().firebaseAppInstance=t,j.getInstance().installationsService=e,new Qt(t)}
1072;t.INTERNAL.registerComponent(new a.Component("performance",(function(t){var n=t.getProvider("app").getImmediate(),r=t.getProvider("installations").getImmediate();return e(n,r)}),"PUBLIC")),t.registerVersion(p,d)}Xt(f["default"]),e.registerPerformance=Xt},7149:function(t,e,n){"use strict";var r=n("23e7"),i=n("d066"),o=n("c430"),s=n("d256"),a=n("4738").CONSTRUCTOR,u=n("cdf9"),c=i("Promise"),h=o&&!a;r({target:"Promise",stat:!0,forced:o||a},{resolve:function(t){return u(h&&this===c?s:this,t)}})},7418:function(t,e){e.f=Object.getOwnPropertySymbols},7839:function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7a23":function(t,e,n){"use strict";n.d(e,"h",(function(){return r["K"]})),n.d(e,"b",(function(){return Me})),n.d(e,"c",(function(){return We})),n.d(e,"d",(function(){return De})),n.d(e,"e",(function(){return be})),n.d(e,"f",(function(){return _e})),n.d(e,"g",(function(){return Te})),n.d(e,"i",(function(){return we})),n.d(e,"a",(function(){return Li}));var r=n("9ff4");const i=new WeakMap,o=[];let s;const a=Symbol(""),u=Symbol("");function c(t){return t&&!0===t._isEffect}function h(t,e=r["b"]){c(t)&&(t=t.raw);const n=p(t,e);return e.lazy||n(),n}function l(t){t.active&&(d(t),t.options.onStop&&t.options.onStop(),t.active=!1)}let f=0;function p(t,e){const n=function(){if(!n.active)return e.scheduler?void 0:t();if(!o.includes(n)){d(n);try{return m(),o.push(n),s=n,t()}finally{o.pop(),_(),s=o[o.length-1]}}};return n.id=f++,n._isEffect=!0,n.active=!0,n.raw=t,n.deps=[],n.options=e,n}function d(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}let v=!0;const g=[];function y(){g.push(v),v=!1}function m(){g.push(v),v=!0}function _(){const t=g.pop();v=void 0===t||t}function b(t,e,n){if(!v||void 0===s)return;let r=i.get(t);r||i.set(t,r=new Map);let o=r.get(n);o||r.set(n,o=new Set),o.has(s)||(o.add(s),s.deps.push(o))}function w(t,e,n,o,c,h){const l=i.get(t);if(!l)return;const f=new Set,p=t=>{t&&t.forEach(t=>{(t!==s||t.options.allowRecurse)&&f.add(t)})};if("clear"===e)l.forEach(p);else if("length"===n&&Object(r["n"])(t))l.forEach((t,e)=>{("length"===e||e>=o)&&p(t)});else switch(void 0!==n&&p(l.get(n)),e){case"add":Object(r["n"])(t)?Object(r["r"])(n)&&p(l.get("length")):(p(l.get(a)),Object(r["s"])(t)&&p(l.get(u)));break;case"delete":Object(r["n"])(t)||(p(l.get(a)),Object(r["s"])(t)&&p(l.get(u)));break;case"set":Object(r["s"])(t)&&p(l.get(a));break}const d=t=>{t.options.scheduler?t.options.scheduler(t):t()};f.forEach(d)}const E=new Set(Object.getOwnPropertyNames(Symbol).map(t=>Symbol[t]).filter(r["C"])),I=N(),T=N(!1,!0),C=N(!0),S=N(!0,!0),O={};function N(t=!1,e=!1){return function(n,i,o){if("__v_isReactive"===i)return!t;if("__v_isReadonly"===i)return t;if("__v_raw"===i&&o===(t?at:st).get(n))return n;const s=Object(r["n"])(n);if(s&&Object(r["k"])(O,i))return Reflect.get(O,i,o);const a=Reflect.get(n,i,o),u=Object(r["C"])(i);if(u?E.has(i):"__proto__"===i||"__v_isRef"===i)return a;if(t||b(n,"get",i),e)return a;
1072if(mt(a)){const t=!s||!Object(r["r"])(i);return t?a.value:a}return Object(r["u"])(a)?t?ft(a):ht(a):a}}["includes","indexOf","lastIndexOf"].forEach(t=>{const e=Array.prototype[t];O[t]=function(...t){const n=yt(this);for(let e=0,i=this.length;e<i;e++)b(n,"get",e+"");const r=e.apply(n,t);return-1===r||!1===r?e.apply(n,t.map(yt)):r}}),["push","pop","shift","unshift","splice"].forEach(t=>{const e=Array.prototype[t];O[t]=function(...t){y();const n=e.apply(this,t);return m(),n}});const A=R(),k=R(!0);function R(t=!1){return function(e,n,i,o){const s=e[n];if(!t&&(i=yt(i),!Object(r["n"])(e)&&mt(s)&&!mt(i)))return s.value=i,!0;const a=Object(r["n"])(e)&&Object(r["r"])(n)?Number(n)<e.length:Object(r["k"])(e,n),u=Reflect.set(e,n,i,o);return e===yt(o)&&(a?Object(r["j"])(i,s)&&w(e,"set",n,i,s):w(e,"add",n,i)),u}}function P(t,e){const n=Object(r["k"])(t,e),i=t[e],o=Reflect.deleteProperty(t,e);return o&&n&&w(t,"delete",e,void 0,i),o}function x(t,e){const n=Reflect.has(t,e);return Object(r["C"])(e)&&E.has(e)||b(t,"has",e),n}function D(t){return b(t,"iterate",a),Reflect.ownKeys(t)}const L={get:I,set:A,deleteProperty:P,has:x,ownKeys:D},j={get:C,set(t,e){return!0},deleteProperty(t,e){return!0}},M=Object(r["h"])({},L,{get:T,set:k}),F=(Object(r["h"])({},j,{get:S}),t=>Object(r["u"])(t)?ht(t):t),U=t=>Object(r["u"])(t)?ft(t):t,V=t=>t,q=t=>Reflect.getPrototypeOf(t);function B(t,e,n=!1,r=!1){t=t["__v_raw"];const i=yt(t),o=yt(e);e!==o&&!n&&b(i,"get",e),!n&&b(i,"get",o);const{has:s}=q(i),a=n?U:r?V:F;return s.call(i,e)?a(t.get(e)):s.call(i,o)?a(t.get(o)):void 0}function W(t,e=!1){const n=this["__v_raw"],r=yt(n),i=yt(t);return t!==i&&!e&&b(r,"has",t),!e&&b(r,"has",i),t===i?n.has(t):n.has(t)||n.has(i)}function G(t,e=!1){return t=t["__v_raw"],!e&&b(yt(t),"iterate",a),Reflect.get(t,"size",t)}function H(t){t=yt(t);const e=yt(this),n=q(e),r=n.has.call(e,t),i=e.add(t);return r||w(e,"add",t,t),i}function K(t,e){e=yt(e);const n=yt(this),{has:i,get:o}=q(n);let s=i.call(n,t);s||(t=yt(t),s=i.call(n,t));const a=o.call(n,t),u=n.set(t,e);return s?Object(r["j"])(e,a)&&w(n,"set",t,e,a):w(n,"add",t,e),u}function z(t){const e=yt(this),{has:n,get:r}=q(e);let i=n.call(e,t);i||(t=yt(t),i=n.call(e,t));const o=r?r.call(e,t):void 0,s=e.delete(t);return i&&w(e,"delete",t,void 0,o),s}function Q(){const t=yt(this),e=0!==t.size,n=void 0,r=t.clear();return e&&w(t,"clear",void 0,void 0,n),r}function Y(t,e){return function(n,r){const i=this,o=i["__v_raw"],s=yt(o),u=t?U:e?V:F;return!t&&b(s,"iterate",a),o.forEach((t,e)=>n.call(r,u(t),u(e),i))}}function X(t,e,n){return function(...i){const o=this["__v_raw"],s=yt(o),c=Object(r["s"])(s),h="entries"===t||t===Symbol.iterator&&c,l="keys"===t&&c,f=o[t](...i),p=e?U:n?V:F;return!e&&b(s,"iterate",l?u:a),{next(){const{value:t,done:e}=f.next();return e?{value:t,done:e}:{value:h?[p(t[0]),p(t[1])]:p(t),done:e}},[Symbol.iterator](){return this}}}}function $(t){return function(...e){return"delete"!==t&&this}}const J={get(t){return B(this,t)},get size(){return G(this)},has:W,add:H,set:K,delete:z,clear:Q,forEach:Y(!1,!1)},Z={get(t){return B(this,t,!1,!0)},get size(){return G(this)},has:W,add:H,set:K,delete:z,clear:Q,forEach:Y(!1,!0)},tt={get(t){return B(this,t,!0)},get size(){return G(this,!0)},has(t){return W.call(this,t,!0)},add:$("add"),set:$("set"),delete:$("delete"),clear:$("clear"),forEach:Y(!0,!1)},et=["keys","values","entries",Symbol.iterator];function nt(t,e){const n=e?Z:t?tt:J;return(e,i,o)=>"__v_isReactive"===i?!t:"__v_isReadonly"===i?t:"__v_raw"===i?e:Reflect.get(Object(r["k"])(n,i)&&i in e?n:e,i,o)}et.forEach(t=>{J[t]=X(t,!1,!1),tt[t]=X(t,!0,!1),Z[t]=X(t,!1,!0)});const rt={get:nt(!1,!1)},it={get:nt(!1,!0)},ot={get:nt(!0,!1)};const st=new WeakMap,at=new WeakMap;function ut(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ct(t){return t["__v_skip"]||!Object.isExtensible(t)?0:ut(Object(r["M"])(t))}function ht(t){return t&&t["__v_isReadonly"]?t:pt(t,!1,L,rt)}function lt(t){return pt(t,!1,M,it)}function ft(t){return pt(t,!0,j,ot)}function pt(t,e,n,i){if(!Object(r["u"])(t))return t;if(t["__v_raw"]&&(!e||!t["__v_isReactive"]))return t;const o=e?at:st,s=o.get(t);if(s)return s;const a=ct(t);if(0===a)return t;const u=new Proxy(t,2===a?i:n);return o.set(t,u),u}function dt(t){return vt(t)?dt(t["__v_raw"]):!(!t||!t["__v_isReactive"])}function vt(t){return!(!t||!t["__v_isReadonly"])}function gt(t){return dt(t)||vt(t)}function yt(t){return t&&yt(t["__v_raw"])||t}function mt(t){return Boolean(t&&!0===t.__v_isRef)}function _t(t){return mt(t)?t.value:t}const bt={get:(t,e,n)=>_t(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const i=t[e];return mt(i)&&!mt(n)?(i.value=n,!0):Reflect.set(t,e,n,r)}};function wt(t){return dt(t)?t:new Proxy(t,bt)}class Et{constructor(t,e,n){this._setter=e,this._dirty=!0,this.__v_isRef=!0,this.effect=h(t,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,w(yt(this),"set","value"))}}),this["__v_isReadonly"]=n}get value(){return this._dirty&&(this._value=this.effect(),this._dirty=!1),b(yt(this),"get","value"),this._value}set value(t){this._setter(t)}}function It(t){let e,n;return Object(r["o"])(t)?(e=t,n=r["d"]):(e=t.get,n=t.set),new Et(e,n,Object(r["o"])(t)||!t.set)}function Tt(t,e,n,r){let i;try{i=r?t(...r):t()}catch(o){St(o,e,n)}return i}function Ct(t,e,n,i){if(Object(r["o"])(t)){const o=Tt(t,e,n,i);return o&&Object(r["w"])(o)&&o.catch(t=>{St(t,e,n)}),o}const o=[];for(let r=0;r<t.length;r++)o.push(Ct(t[r],e,n,i));return o}function St(t,e,n,r=!0){const i=e?e.vnode:null;if(e){let r=e.parent;const i=e.proxy,o=n;while(r){const e=r.ec;if(e)for(let n=0;n<e.length;n++)if(e[n](t,i,o))return;r=r.parent}const s=e.appContext.config.errorHandler;if(s)return void Tt(s,null,10,[t,i,o])}Ot(t,n,i,r)}function Ot(t,e,n,r=!0){console.error(t)}let Nt=!1,At=!1;const kt=[];let Rt=0;const Pt=[];let xt=null,Dt=0;const Lt=[];let jt=null,Mt=0;const Ft=Promise.resolve();let Ut=null,Vt=null;function qt(t){const e=Ut||Ft;return t?e.then(t):e}function Bt(t){kt.length&&kt.includes(t,Nt&&t.allowRecurse?Rt+1:Rt)||t===Vt||(kt.push(t),Wt())}function Wt(){Nt||At||(At=!0,Ut=Ft.then($t))}function Gt(t){const e=kt.indexOf(t);e>-1&&(kt[e]=null)}function Ht(t,e,n,i){Object(r["n"])(t)?n.push(...t):e&&e.includes(t,t.allowRecurse?i+1:i)||n.push(t),Wt()}function Kt(t){Ht(t,xt,Pt,Dt)}function zt(t){Ht(t,jt,Lt,Mt)}function Qt(t,e=null){if(Pt.length){for(Vt=e,xt=[...new Set(Pt)],Pt.length=0,Dt=0;Dt<xt.length;
1072Dt++)xt[Dt]();xt=null,Dt=0,Vt=null,Qt(t,e)}}function Yt(t){if(Lt.length){const t=[...new Set(Lt)];if(Lt.length=0,jt)return void jt.push(...t);for(jt=t,jt.sort((t,e)=>Xt(t)-Xt(e)),Mt=0;Mt<jt.length;Mt++)jt[Mt]();jt=null,Mt=0}}const Xt=t=>null==t.id?1/0:t.id;function $t(t){At=!1,Nt=!0,Qt(t),kt.sort((t,e)=>Xt(t)-Xt(e));try{for(Rt=0;Rt<kt.length;Rt++){const t=kt[Rt];t&&Tt(t,null,14)}}finally{Rt=0,kt.length=0,Yt(t),Nt=!1,Ut=null,(kt.length||Lt.length)&&$t(t)}}new Set;new Map;function Jt(t,e,...n){const i=t.vnode.props||r["b"];let o="on"+Object(r["f"])(e),s=i[o];if(!s&&e.startsWith("update:")&&(o="on"+Object(r["f"])(Object(r["l"])(e)),s=i[o]),!s)if(s=i[o+"Once"],t.emitted){if(t.emitted[o])return}else(t.emitted={})[o]=!0;s&&Ct(s,t,6,n)}function Zt(t,e,n=!1){const i=e.app?e.app._uid:-1,o=t.__emits||(t.__emits={}),s=o[i];if(void 0!==s)return s;const a=t.emits;let u={},c=!1;if(!Object(r["o"])(t)){const i=t=>{c=!0,Object(r["h"])(u,Zt(t,e,!0))};!n&&e.mixins.length&&e.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}return a||c?(Object(r["n"])(a)?a.forEach(t=>u[t]=null):Object(r["h"])(u,a),o[i]=u):o[i]=null}function te(t,e){return!(!t||!Object(r["v"])(e))&&(e=e.replace(/Once$/,""),Object(r["k"])(t,e[2].toLowerCase()+e.slice(3))||Object(r["k"])(t,e.slice(2)))}let ee=null;function ne(t){ee=t}function re(t){const{type:e,vnode:n,proxy:i,withProxy:o,props:s,propsOptions:[a],slots:u,attrs:c,emit:h,render:l,renderCache:f,data:p,setupState:d,ctx:v}=t;let g;ee=t;try{let t;if(4&n.shapeFlag){const e=o||i;g=ze(l.call(e,e,f,s,d,p,v)),t=c}else{const n=e;0,g=ze(n.length>1?n(s,{attrs:c,slots:u,emit:h}):n(s,null)),t=e.props?c:oe(c)}let y=g;if(!1!==e.inheritAttrs&&t){const e=Object.keys(t),{shapeFlag:n}=y;e.length&&(1&n||6&n)&&(a&&e.some(r["t"])&&(t=se(t,a)),y=He(y,t))}n.dirs&&(y.dirs=n.dirs),n.transition&&(y.transition=n.transition),g=y}catch(y){St(y,t,1),g=We(ke)}return ee=null,g}function ie(t){const e=t.filter(t=>!(Fe(t)&&t.type===ke&&"v-if"!==t.children));return 1===e.length&&Fe(e[0])?e[0]:null}const oe=t=>{let e;for(const n in t)("class"===n||"style"===n||Object(r["v"])(n))&&((e||(e={}))[n]=t[n]);return e},se=(t,e)=>{const n={};for(const i in t)Object(r["t"])(i)&&i.slice(9)in e||(n[i]=t[i]);return n};function ae(t,e,n){const{props:r,children:i,component:o}=t,{props:s,children:a,patchFlag:u}=e,c=o.emitsOptions;if(e.dirs||e.transition)return!0;if(!(n&&u>0))return!(!i&&!a||a&&a.$stable)||r!==s&&(r?!s||ue(r,s,c):!!s);if(1024&u)return!0;if(16&u)return r?ue(r,s,c):!!s;if(8&u){const t=e.dynamicProps;for(let e=0;e<t.length;e++){const n=t[e];if(s[n]!==r[n]&&!te(c,n))return!0}}return!1}function ue(t,e,n){const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!0;for(let i=0;i<r.length;i++){const o=r[i];if(e[o]!==t[o]&&!te(n,o))return!0}return!1}function ce({vnode:t,parent:e},n){while(e&&e.subTree===t)(t=e.vnode).el=n,e=e.parent}const he=t=>t.__isSuspense;function le(t){const{shapeFlag:e,children:n}=t;let r,i;return 32&e?(r=fe(n.default),i=fe(n.fallback)):(r=fe(n),i=ze(null)),{content:r,fallback:i}}function fe(t){if(Object(r["o"])(t)&&(t=t()),Object(r["n"])(t)){const e=ie(t);0,t=e}return ze(t)}function pe(t,e){e&&e.pendingBranch?Object(r["n"])(t)?e.effects.push(...t):e.effects.push(t):zt(t)}let de=0;const ve=t=>de+=t;function ge(t,e=ee){if(!e)return t;const n=(...n)=>{de||De(!0);const r=ee;ne(e);const i=t(...n);return ne(r),de||Le(),i};return n._c=!0,n}let ye=null;const me=[];function _e(t){me.push(ye=t)}function be(){me.pop(),ye=me[me.length-1]||null}function we(t){return e=>ge((function(){_e(t);const n=e.apply(this,arguments);return be(),n}))}const Ee=t=>t.__isTeleport;const Ie="components";function Te(t){return Se(Ie,t)||t}const Ce=Symbol();function Se(t,e,n=!0){const i=ee||Sr;if(i){const n=i.type;if(t===Ie){const t=n.displayName||n.name;if(t&&(t===e||t===Object(r["e"])(e)||t===Object(r["f"])(Object(r["e"])(e))))return n}const o=Oe(i[t]||n[t],e)||Oe(i.appContext[t],e);return o}}function Oe(t,e){return t&&(t[e]||t[Object(r["e"])(e)]||t[Object(r["f"])(Object(r["e"])(e))])}const Ne=Symbol(void 0),Ae=Symbol(void 0),ke=Symbol(void 0),Re=Symbol(void 0),Pe=[];let xe=null;function De(t=!1){Pe.push(xe=t?null:[])}function Le(){Pe.pop(),xe=Pe[Pe.length-1]||null}let je=1;function Me(t,e,n,i,o){const s=We(t,e,n,i,o,!0);return s.dynamicChildren=xe||r["a"],Le(),je>0&&xe&&xe.push(s),s}function Fe(t){return!!t&&!0===t.__v_isVNode}function Ue(t,e){return t.type===e.type&&t.key===e.key}const Ve="__vInternal",qe=({key:t})=>null!=t?t:null,Be=({ref:t})=>null!=t?Object(r["n"])(t)?t:{i:ee,r:t}:null,We=Ge;function Ge(t,e=null,n=null,i=0,o=null,s=!1){if(t&&t!==Ce||(t=ke),Fe(t)){const r=He(t,e,!0);return n&&Ye(r,n),r}if(Mr(t)&&(t=t.__vccOpts),e){(gt(e)||Ve in e)&&(e=Object(r["h"])({},e));let{class:t,style:n}=e;t&&!Object(r["B"])(t)&&(e.class=Object(r["H"])(t)),Object(r["u"])(n)&&(gt(n)&&!Object(r["n"])(n)&&(n=Object(r["h"])({},n)),e.style=Object(r["I"])(n))}const a=Object(r["B"])(t)?1:he(t)?128:Ee(t)?64:Object(r["u"])(t)?4:Object(r["o"])(t)?2:0;const u={__v_isVNode:!0,["__v_skip"]:!0,type:t,props:e,key:e&&qe(e),ref:e&&Be(e),scopeId:ye,children:null,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:i,dynamicProps:o,dynamicChildren:null,appContext:null};if(Ye(u,n),128&a){const{content:t,fallback:e}=le(u);u.ssContent=t,u.ssFallback=e}return je>0&&!s&&xe&&(i>0||6&a)&&32!==i&&xe.push(u),u}function He(t,e,n=!1){const{props:i,ref:o,patchFlag:s}=t,a=e?Xe(i||{},e):i;return{__v_isVNode:!0,["__v_skip"]:!0,type:t.type,props:a,key:a&&qe(a),ref:e&&e.ref?n&&o?Object(r["n"])(o)?o.concat(Be(e)):[o,Be(e)]:Be(e):o,scopeId:t.scopeId,children:t.children,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Ne?-1===s?16:16|s:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&He(t.ssContent),ssFallback:t.ssFallback&&He(t.ssFallback),el:t.el,anchor:t.anchor}}function Ke(t=" ",e=0){return We(Ae,null,t,e)}function ze(t){return null==t||"boolean"===typeof t?We(ke):Object(r["n"])(t)?We(Ne,null,t):"object"===typeof t?null===t.el?t:He(t):We(Ae,null,String(t))}function Qe(t){return null===t.el?t:He(t)}function Ye(t,e){let n=0;const{shapeFlag:i}=t;if(null==e)e=null;else if(Object(r["n"])(e))n=16;else if("object"===typeof e){if(1&i||64&i){const n=e.default;return void(n&&(n._c&&ve(1),Ye(t,n()),n._c&&ve(-1)))}{n=32;const r=e._;r||Ve in e?3===r&&ee&&(1024&ee.vnode.patchFlag?(e._=2,t.patchFlag|=1024):e._=1):e._ctx=ee}}else Object(r["o"])(e)?(e={default:e,_ctx:ee},n=32):(e=String(e),64&i?(n=16,e=[Ke(e)]):n=8);t.children=e,t.shapeFlag|=n}function Xe(...t){const e=Object(r["h"])({},t[0]);for(let n=1;n<t.length;n++){const i=t[n];for(const t in i)if("class"===t)e.class!==i.class&&(e.class=Object(r["H"])([e.class,i.class]));else if("style"===t)e.style=Object(r["I"])([e.style,i.style]);else if(Object(r["v"])(t)){const n=e[t],r=i[t];n!==r&&(e[t]=n?[].concat(n,i[t]):r)}else e[t]=i[t]}return e}function $e(t,e,n,i=!1){const o={},s={};Object(r["g"])(s,Ve,1),Ze(t,e,o,s),n?t.props=i?o:lt(o):t.type.props?t.props=o:t.props=s,t.attrs=s}function Je(t,e,n,i){const{props:o,attrs:s,vnode:{patchFlag:a}}=t,u=yt(o),[c]=t.propsOptions;if(!(i||a>0)||16&a){let i;Ze(t,e,o,s);for(const s in u)e&&(Object(r["k"])(e,s)||(i=Object(r["l"])(s))!==s&&Object(r["k"])(e,i))||(c?!n||void 0===n[s]&&void 0===n[i]||(o[s]=tn(c,e||r["b"],s,void 0,t)):delete o[s]);if(s!==u)for(const t in s)e&&Object(r["k"])(e,t)||delete s[t]}else if(8&a){const n=t.vnode.dynamicProps;for(let i=0;i<n.length;i++){const a=n[i],h=e[a];if(c)if(Object(r["k"])(s,a))s[a]=h;else{const e=Object(r["e"])(a);o[e]=tn(c,u,e,h,t)}else s[a]=h}}w(t,"set","$attrs")}function Ze(t,e,n,i){const[o,s]=t.propsOptions;if(e)for(const a in e){const s=e[a];
1072if(Object(r["x"])(a))continue;let u;o&&Object(r["k"])(o,u=Object(r["e"])(a))?n[u]=s:te(t.emitsOptions,a)||(i[a]=s)}if(s){const e=yt(n);for(let r=0;r<s.length;r++){const i=s[r];n[i]=tn(o,e,i,e[i],t)}}}function tn(t,e,n,i,o){const s=t[n];if(null!=s){const t=Object(r["k"])(s,"default");if(t&&void 0===i){const t=s.default;s.type!==Function&&Object(r["o"])(t)?(Nr(o),i=t(e),Nr(null)):i=t}s[0]&&(Object(r["k"])(e,n)||t?!s[1]||""!==i&&i!==Object(r["l"])(n)||(i=!0):i=!1)}return i}function en(t,e,n=!1){const i=e.app?e.app._uid:-1,o=t.__props||(t.__props={}),s=o[i];if(s)return s;const a=t.props,u={},c=[];let h=!1;if(!Object(r["o"])(t)){const i=t=>{h=!0;const[n,i]=en(t,e,!0);Object(r["h"])(u,n),i&&c.push(...i)};!n&&e.mixins.length&&e.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}if(!a&&!h)return o[i]=r["a"];if(Object(r["n"])(a))for(let l=0;l<a.length;l++){0;const t=Object(r["e"])(a[l]);sn(t)&&(u[t]=r["b"])}else if(a){0;for(const t in a){const e=Object(r["e"])(t);if(sn(e)){const n=a[t],i=u[e]=Object(r["n"])(n)||Object(r["o"])(n)?{type:n}:n;if(i){const t=on(Boolean,i.type),n=on(String,i.type);i[0]=t>-1,i[1]=n<0||t<n,(t>-1||Object(r["k"])(i,"default"))&&c.push(e)}}}}return o[i]=[u,c]}function nn(t){const e=t&&t.toString().match(/^\s*function (\w+)/);return e?e[1]:""}function rn(t,e){return nn(t)===nn(e)}function on(t,e){if(Object(r["n"])(e)){for(let n=0,r=e.length;n<r;n++)if(rn(e[n],t))return n}else if(Object(r["o"])(e))return rn(e,t)?0:-1;return-1}function sn(t){return"$"!==t[0]}function an(t,e,n=Sr,r=!1){if(n){const i=n[t]||(n[t]=[]),o=e.__weh||(e.__weh=(...r)=>{if(n.isUnmounted)return;y(),Nr(n);const i=Ct(e,n,t,r);return Nr(null),_(),i});return r?i.unshift(o):i.push(o),o}}const un=t=>(e,n=Sr)=>!kr&&an(t,e,n),cn=un("bm"),hn=un("m"),ln=un("bu"),fn=un("u"),pn=un("bum"),dn=un("um"),vn=un("rtg"),gn=un("rtc"),yn=(t,e=Sr)=>{an("ec",t,e)};function mn(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return hn(()=>{t.isMounted=!0}),pn(()=>{t.isUnmounting=!0}),t}const _n=[Function,Array],bn={name:"BaseTransition",props:{mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:_n,onEnter:_n,onAfterEnter:_n,onEnterCancelled:_n,onBeforeLeave:_n,onLeave:_n,onAfterLeave:_n,onLeaveCancelled:_n,onBeforeAppear:_n,onAppear:_n,onAfterAppear:_n,onAppearCancelled:_n},setup(t,{slots:e}){const n=Or(),r=mn();let i;return()=>{const o=e.default&&On(e.default(),!0);if(!o||!o.length)return;const s=yt(t),{mode:a}=s;const u=o[0];if(r.isLeaving)return Tn(u);const c=Cn(u);if(!c)return Tn(u);const h=In(c,s,r,n);Sn(c,h);const l=n.subTree,f=l&&Cn(l);let p=!1;const{getTransitionKey:d}=c.type;if(d){const t=d();void 0===i?i=t:t!==i&&(i=t,p=!0)}if(f&&f.type!==ke&&(!Ue(c,f)||p)){const t=In(f,s,r,n);if(Sn(f,t),"out-in"===a)return r.isLeaving=!0,t.afterLeave=()=>{r.isLeaving=!1,n.update()},Tn(u);"in-out"===a&&(t.delayLeave=(t,e,n)=>{const i=En(r,f);i[String(f.key)]=f,t._leaveCb=()=>{e(),t._leaveCb=void 0,delete h.delayedLeave},h.delayedLeave=n})}return u}}},wn=bn;function En(t,e){const{leavingVNodes:n}=t;let r=n.get(e.type);return r||(r=Object.create(null),n.set(e.type,r)),r}function In(t,e,n,r){const{appear:i,mode:o,persisted:s=!1,onBeforeEnter:a,onEnter:u,onAfterEnter:c,onEnterCancelled:h,onBeforeLeave:l,onLeave:f,onAfterLeave:p,onLeaveCancelled:d,onBeforeAppear:v,onAppear:g,onAfterAppear:y,onAppearCancelled:m}=e,_=String(t.key),b=En(n,t),w=(t,e)=>{t&&Ct(t,r,9,e)},E={mode:o,persisted:s,beforeEnter(e){let r=a;if(!n.isMounted){if(!i)return;r=v||a}e._leaveCb&&e._leaveCb(!0);const o=b[_];o&&Ue(t,o)&&o.el._leaveCb&&o.el._leaveCb(),w(r,[e])},enter(t){let e=u,r=c,o=h;if(!n.isMounted){if(!i)return;e=g||u,r=y||c,o=m||h}let s=!1;const a=t._enterCb=e=>{s||(s=!0,w(e?o:r,[t]),E.delayedLeave&&E.delayedLeave(),t._enterCb=void 0)};e?(e(t,a),e.length<=1&&a()):a()},leave(e,r){const i=String(t.key);if(e._enterCb&&e._enterCb(!0),n.isUnmounting)return r();w(l,[e]);let o=!1;const s=e._leaveCb=n=>{o||(o=!0,r(),w(n?d:p,[e]),e._leaveCb=void 0,b[i]===t&&delete b[i])};b[i]=t,f?(f(e,s),f.length<=1&&s()):s()},clone(t){return In(t,e,n,r)}};return E}function Tn(t){if(Nn(t))return t=He(t),t.children=null,t}function Cn(t){return Nn(t)?t.children?t.children[0]:void 0:t}function Sn(t,e){6&t.shapeFlag&&t.component?Sn(t.component.subTree,e):128&t.shapeFlag?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function On(t,e=!1){let n=[],r=0;for(let i=0;i<t.length;i++){const o=t[i];o.type===Ne?(128&o.patchFlag&&r++,n=n.concat(On(o.children,e))):(e||o.type!==ke)&&n.push(o)}if(r>1)for(let i=0;i<n.length;i++)n[i].patchFlag=-2;return n}const Nn=t=>t.type.__isKeepAlive;RegExp,RegExp;function An(t){return t.displayName||t.name}function kn(t,e){return Object(r["n"])(t)?t.some(t=>kn(t,e)):Object(r["B"])(t)?t.split(",").indexOf(e)>-1:!!t.test&&t.test(e)}function Rn(t,e){xn(t,"a",e)}function Pn(t,e){xn(t,"da",e)}function xn(t,e,n=Sr){const r=t.__wdc||(t.__wdc=()=>{let e=n;while(e){if(e.isDeactivated)return;e=e.parent}t()});if(an(e,r,n),n){let t=n.parent;while(t&&t.parent)Nn(t.parent.vnode)&&Dn(r,e,n,t),t=t.parent}}function Dn(t,e,n,i){const o=an(e,t,i,!0);dn(()=>{Object(r["J"])(i[e],o)},n)}function Ln(t){let e=t.shapeFlag;256&e&&(e-=256),512&e&&(e-=512),t.shapeFlag=e}function jn(t){return 128&t.shapeFlag?t.ssContent:t}const Mn=t=>"_"===t[0]||"$stable"===t,Fn=t=>Object(r["n"])(t)?t.map(ze):[ze(t)],Un=(t,e,n)=>ge(t=>Fn(e(t)),n),Vn=(t,e)=>{const n=t._ctx;for(const i in t){if(Mn(i))continue;const o=t[i];if(Object(r["o"])(o))e[i]=Un(i,o,n);else if(null!=o){0;const t=Fn(o);e[i]=()=>t}}},qn=(t,e)=>{const n=Fn(e);t.slots.default=()=>n},Bn=(t,e)=>{if(32&t.vnode.shapeFlag){const n=e._;n?(t.slots=e,Object(r["g"])(e,"_",n)):Vn(e,t.slots={})}else t.slots={},e&&qn(t,e);Object(r["g"])(t.slots,Ve,1)},Wn=(t,e)=>{const{vnode:n,slots:i}=t;let o=!0,s=r["b"];if(32&n.shapeFlag){const t=e._;t?1===t?o=!1:Object(r["h"])(i,e):(o=!e.$stable,Vn(e,i)),s=e}else e&&(qn(t,e),s={default:1});if(o)for(const r in i)Mn(r)||r in s||delete i[r]};function Gn(t,e,n,r){const i=t.dirs,o=e&&e.dirs;for(let s=0;s<i.length;s++){const a=i[s];o&&(a.oldValue=o[s].value);const u=a.dir[r];u&&Ct(u,n,8,[t.el,a,t,e])}}function Hn(){return{app:null,config:{isNativeTag:r["c"],performance:!1,globalProperties:{},optionMergeStrategies:{}
1072,isCustomElement:r["c"],errorHandler:void 0,warnHandler:void 0},mixins:[],components:{},directives:{},provides:Object.create(null)}}let Kn=0;function zn(t,e){return function(n,i=null){null==i||Object(r["u"])(i)||(i=null);const o=Hn(),s=new Set;let a=!1;const u=o.app={_uid:Kn++,_component:n,_props:i,_container:null,_context:o,version:Vr,get config(){return o.config},set config(t){0},use(t,...e){return s.has(t)||(t&&Object(r["o"])(t.install)?(s.add(t),t.install(u,...e)):Object(r["o"])(t)&&(s.add(t),t(u,...e))),u},mixin(t){return o.mixins.includes(t)||o.mixins.push(t),u},component(t,e){return e?(o.components[t]=e,u):o.components[t]},directive(t,e){return e?(o.directives[t]=e,u):o.directives[t]},mount(r,s){if(!a){const c=We(n,i);return c.appContext=o,s&&e?e(c,r):t(c,r),a=!0,u._container=r,r.__vue_app__=u,c.component.proxy}},unmount(){a&&t(null,u._container)},provide(t,e){return o.provides[t]=e,u}};return u}}function Qn(){}const Yn={scheduler:Bt,allowRecurse:!0};const Xn=pe,$n=(t,e,n,i,o)=>{if(Object(r["n"])(t))return void t.forEach((t,s)=>$n(t,e&&(Object(r["n"])(e)?e[s]:e),n,i,o));let s;s=o?4&o.shapeFlag?o.component.proxy:o.el:null;const{i:a,r:u}=t;const c=e&&e.r,h=a.refs===r["b"]?a.refs={}:a.refs,l=a.setupState;if(null!=c&&c!==u&&(Object(r["B"])(c)?(h[c]=null,Object(r["k"])(l,c)&&(l[c]=null)):mt(c)&&(c.value=null)),Object(r["B"])(u)){const t=()=>{h[u]=s,Object(r["k"])(l,u)&&(l[u]=s)};s?(t.id=-1,Xn(t,i)):t()}else if(mt(u)){const t=()=>{u.value=s};s?(t.id=-1,Xn(t,i)):t()}else Object(r["o"])(u)&&Tt(u,n,12,[s,h])};function Jn(t){return Zn(t)}function Zn(t,e){Qn();const{insert:n,remove:i,patchProp:o,forcePatchProp:s,createElement:a,createText:u,createComment:c,setText:f,setElementText:p,parentNode:d,nextSibling:v,setScopeId:g=r["d"],cloneNode:y,insertStaticContent:m}=t,_=(t,e,n,r=null,i=null,o=null,s=!1,a=!1)=>{t&&!Ue(t,e)&&(r=H(t),V(t,i,o,!0),t=null),-2===e.patchFlag&&(a=!1,e.dynamicChildren=null);const{type:u,ref:c,shapeFlag:h}=e;switch(u){case Ae:b(t,e,n,r);break;case ke:w(t,e,n,r);break;case Re:null==t&&E(e,n,r,s);break;case Ne:k(t,e,n,r,i,o,s,a);break;default:1&h?I(t,e,n,r,i,o,s,a):6&h?R(t,e,n,r,i,o,s,a):(64&h||128&h)&&u.process(t,e,n,r,i,o,s,a,Q)}null!=c&&i&&$n(c,t&&t.ref,i,o,e)},b=(t,e,r,i)=>{if(null==t)n(e.el=u(e.children),r,i);else{const n=e.el=t.el;e.children!==t.children&&f(n,e.children)}},w=(t,e,r,i)=>{null==t?n(e.el=c(e.children||""),r,i):e.el=t.el},E=(t,e,n,r)=>{[t.el,t.anchor]=m(t.children,e,n,r)},I=(t,e,n,r,i,o,s,a)=>{s=s||"svg"===e.type,null==t?T(e,n,r,i,o,s,a):O(t,e,i,o,s,a)},T=(t,e,i,s,u,c,h)=>{let l,f;const{type:d,props:v,shapeFlag:g,transition:m,scopeId:_,patchFlag:b,dirs:w}=t;if(t.el&&void 0!==y&&-1===b)l=t.el=y(t.el);else{if(l=t.el=a(t.type,c,v&&v.is),8&g?p(l,t.children):16&g&&S(t.children,l,null,s,u,c&&"foreignObject"!==d,h||!!t.dynamicChildren),w&&Gn(t,null,s,"created"),v){for(const e in v)Object(r["x"])(e)||o(l,e,null,v[e],c,t.children,s,u,G);(f=v.onVnodeBeforeMount)&&tr(f,s,t)}C(l,_,t,s)}w&&Gn(t,null,s,"beforeMount");const E=(!u||u&&!u.pendingBranch)&&m&&!m.persisted;E&&m.beforeEnter(l),n(l,e,i),((f=v&&v.onVnodeMounted)||E||w)&&Xn(()=>{f&&tr(f,s,t),E&&m.enter(l),w&&Gn(t,null,s,"mounted")},u)},C=(t,e,n,r)=>{if(e&&g(t,e),r){const i=r.type.__scopeId;i&&i!==e&&g(t,i+"-s");let o=r.subTree;0,n===o&&C(t,r.vnode.scopeId,r.vnode,r.parent)}},S=(t,e,n,r,i,o,s,a=0)=>{for(let u=a;u<t.length;u++){const a=t[u]=s?Qe(t[u]):ze(t[u]);_(null,a,e,n,r,i,o,s)}},O=(t,e,n,i,a,u)=>{const c=e.el=t.el;let{patchFlag:h,dynamicChildren:l,dirs:f}=e;h|=16&t.patchFlag;const d=t.props||r["b"],v=e.props||r["b"];let g;if((g=v.onVnodeBeforeUpdate)&&tr(g,n,e,t),f&&Gn(e,t,n,"beforeUpdate"),h>0){if(16&h)A(c,e,d,v,n,i,a);else if(2&h&&d.class!==v.class&&o(c,"class",null,v.class,a),4&h&&o(c,"style",d.style,v.style,a),8&h){const r=e.dynamicProps;for(let e=0;e<r.length;e++){const u=r[e],h=d[u],l=v[u];(l!==h||s&&s(c,u))&&o(c,u,h,l,a,t.children,n,i,G)}}1&h&&t.children!==e.children&&p(c,e.children)}else u||null!=l||A(c,e,d,v,n,i,a);const y=a&&"foreignObject"!==e.type;l?N(t.dynamicChildren,l,c,n,i,y):u||j(t,e,c,null,n,i,y),((g=v.onVnodeUpdated)||f)&&Xn(()=>{g&&tr(g,n,e,t),f&&Gn(e,t,n,"updated")},i)},N=(t,e,n,r,i,o)=>{for(let s=0;s<e.length;s++){const a=t[s],u=e[s],c=a.type===Ne||!Ue(a,u)||6&a.shapeFlag||64&a.shapeFlag?d(a.el):n;_(a,u,c,null,r,i,o,!0)}},A=(t,e,n,i,a,u,c)=>{if(n!==i){for(const h in i){if(Object(r["x"])(h))continue;const l=i[h],f=n[h];(l!==f||s&&s(t,h))&&o(t,h,f,l,c,e.children,a,u,G)}if(n!==r["b"])for(const s in n)Object(r["x"])(s)||s in i||o(t,s,n[s],null,c,e.children,a,u,G)}},k=(t,e,r,i,o,s,a,c)=>{const h=e.el=t?t.el:u(""),l=e.anchor=t?t.anchor:u("");let{patchFlag:f,dynamicChildren:p}=e;f>0&&(c=!0),null==t?(n(h,r,i),n(l,r,i),S(e.children,r,l,o,s,a,c)):f>0&&64&f&&p?(N(t.dynamicChildren,p,r,o,s,a),(null!=e.key||o&&e===o.subTree)&&K(t,e,!0)):j(t,e,r,l,o,s,a,c)},R=(t,e,n,r,i,o,s,a)=>{null==t?512&e.shapeFlag?i.ctx.activate(e,n,r,s,a):P(e,n,r,i,o,s,a):x(t,e,a)},P=(t,e,n,r,i,o,s)=>{const a=t.component=Cr(t,r,i);if(Nn(t)&&(a.ctx.renderer=Q),Rr(a),a.asyncDep){if(i&&i.registerDep(a,D),!t.el){const t=a.subTree=We(ke);w(null,t,e,n)}}else D(a,t,e,n,i,o,s)},x=(t,e,n)=>{const r=e.component=t.component;if(ae(t,e,n)){if(r.asyncDep&&!r.asyncResolved)return void L(r,e,n);
1072r.next=e,Gt(r.update),r.update()}else e.component=t.component,e.el=t.el,r.vnode=e},D=(t,e,n,i,o,s,a)=>{t.update=h((function(){if(t.isMounted){let e,{next:n,bu:i,u:u,parent:c,vnode:h}=t,l=n;0,n?L(t,n,a):n=h,n.el=h.el,i&&Object(r["m"])(i),(e=n.props&&n.props.onVnodeBeforeUpdate)&&tr(e,c,n,h);const f=re(t);0;const p=t.subTree;t.subTree=f,t.refs!==r["b"]&&(t.refs={}),_(p,f,d(p.el),H(p),t,o,s),n.el=f.el,null===l&&ce(t,f.el),u&&Xn(u,o),(e=n.props&&n.props.onVnodeUpdated)&&Xn(()=>{tr(e,c,n,h)},o)}else{let a;const{el:u,props:c}=e,{bm:h,m:l,parent:f}=t;h&&Object(r["m"])(h),(a=c&&c.onVnodeBeforeMount)&&tr(a,f,e);const p=t.subTree=re(t);0,u&&X?X(e.el,p,t,o):(_(null,p,n,i,t,o,s),e.el=p.el),l&&Xn(l,o),(a=c&&c.onVnodeMounted)&&Xn(()=>{tr(a,f,e)},o);const{a:d}=t;d&&256&e.shapeFlag&&Xn(d,o),t.isMounted=!0}}),Yn)},L=(t,e,n)=>{e.component=t;const r=t.vnode.props;t.vnode=e,t.next=null,Je(t,e.props,r,n),Wn(t,e.children),Qt(void 0,t.update)},j=(t,e,n,r,i,o,s,a=!1)=>{const u=t&&t.children,c=t?t.shapeFlag:0,h=e.children,{patchFlag:l,shapeFlag:f}=e;if(l>0){if(128&l)return void F(u,h,n,r,i,o,s,a);if(256&l)return void M(u,h,n,r,i,o,s,a)}8&f?(16&c&&G(u,i,o),h!==u&&p(n,h)):16&c?16&f?F(u,h,n,r,i,o,s,a):G(u,i,o,!0):(8&c&&p(n,""),16&f&&S(h,n,r,i,o,s,a))},M=(t,e,n,i,o,s,a,u)=>{t=t||r["a"],e=e||r["a"];const c=t.length,h=e.length,l=Math.min(c,h);let f;for(f=0;f<l;f++){const r=e[f]=u?Qe(e[f]):ze(e[f]);_(t[f],r,n,null,o,s,a,u)}c>h?G(t,o,s,!0,l):S(e,n,i,o,s,a,u,l)},F=(t,e,n,i,o,s,a,u)=>{let c=0;const h=e.length;let l=t.length-1,f=h-1;while(c<=l&&c<=f){const r=t[c],i=e[c]=u?Qe(e[c]):ze(e[c]);if(!Ue(r,i))break;_(r,i,n,null,o,s,a,u),c++}while(c<=l&&c<=f){const r=t[l],i=e[f]=u?Qe(e[f]):ze(e[f]);if(!Ue(r,i))break;_(r,i,n,null,o,s,a,u),l--,f--}if(c>l){if(c<=f){const t=f+1,r=t<h?e[t].el:i;while(c<=f)_(null,e[c]=u?Qe(e[c]):ze(e[c]),n,r,o,s,a),c++}}else if(c>f)while(c<=l)V(t[c],o,s,!0),c++;else{const p=c,d=c,v=new Map;for(c=d;c<=f;c++){const t=e[c]=u?Qe(e[c]):ze(e[c]);null!=t.key&&v.set(t.key,c)}let g,y=0;const m=f-d+1;let b=!1,w=0;const E=new Array(m);for(c=0;c<m;c++)E[c]=0;for(c=p;c<=l;c++){const r=t[c];if(y>=m){V(r,o,s,!0);continue}let i;if(null!=r.key)i=v.get(r.key);else for(g=d;g<=f;g++)if(0===E[g-d]&&Ue(r,e[g])){i=g;break}void 0===i?V(r,o,s,!0):(E[i-d]=c+1,i>=w?w=i:b=!0,_(r,e[i],n,null,o,s,a,u),y++)}const I=b?er(E):r["a"];for(g=I.length-1,c=m-1;c>=0;c--){const t=d+c,r=e[t],u=t+1<h?e[t+1].el:i;0===E[c]?_(null,r,n,u,o,s,a):b&&(g<0||c!==I[g]?U(r,n,u,2):g--)}}},U=(t,e,r,i,o=null)=>{const{el:s,type:a,transition:u,children:c,shapeFlag:h}=t;if(6&h)return void U(t.component.subTree,e,r,i);if(128&h)return void t.suspense.move(e,r,i);if(64&h)return void a.move(t,e,r,Q);if(a===Ne){n(s,e,r);for(let t=0;t<c.length;t++)U(c[t],e,r,i);return void n(t.anchor,e,r)}const l=2!==i&&1&h&&u;if(l)if(0===i)u.beforeEnter(s),n(s,e,r),Xn(()=>u.enter(s),o);else{const{leave:t,delayLeave:i,afterLeave:o}=u,a=()=>n(s,e,r),c=()=>{t(s,()=>{a(),o&&o()})};i?i(s,a,c):c()}else n(s,e,r)},V=(t,e,n,r=!1)=>{const{type:i,props:o,ref:s,children:a,dynamicChildren:u,shapeFlag:c,patchFlag:h,dirs:l}=t;if(null!=s&&e&&$n(s,null,e,n,null),256&c)return void e.ctx.deactivate(t);const f=1&c&&l;let p;if((p=o&&o.onVnodeBeforeUnmount)&&tr(p,e,t),6&c)W(t.component,n,r);else{if(128&c)return void t.suspense.unmount(n,r);f&&Gn(t,null,e,"beforeUnmount"),u&&(i!==Ne||h>0&&64&h)?G(u,e,n):16&c&&G(a,e,n),64&c&&t.type.remove(t,Q),r&&q(t)}((p=o&&o.onVnodeUnmounted)||f)&&Xn(()=>{p&&tr(p,e,t),f&&Gn(t,null,e,"unmounted")},n)},q=t=>{const{type:e,el:n,anchor:r,transition:o}=t;if(e===Ne)return void B(n,r);const s=()=>{i(n),o&&!o.persisted&&o.afterLeave&&o.afterLeave()};if(1&t.shapeFlag&&o&&!o.persisted){const{leave:e,delayLeave:r}=o,i=()=>e(n,s);r?r(t.el,s,i):i()}else s()},B=(t,e)=>{let n;while(t!==e)n=v(t),i(t),t=n;i(e)},W=(t,e,n)=>{const{bum:i,effects:o,update:s,subTree:a,um:u}=t;if(i&&Object(r["m"])(i),o)for(let r=0;r<o.length;r++)l(o[r]);s&&(l(s),V(a,t,e,n)),u&&Xn(u,e),Xn(()=>{t.isUnmounted=!0},e),e&&e.pendingBranch&&!e.isUnmounted&&t.asyncDep&&!t.asyncResolved&&t.suspenseId===e.pendingId&&(e.deps--,0===e.deps&&e.resolve())},G=(t,e,n,r=!1,i=0)=>{for(let o=i;o<t.length;o++)V(t[o],e,n,r)},H=t=>6&t.shapeFlag?H(t.component.subTree):128&t.shapeFlag?t.suspense.next():v(t.anchor||t.el),K=(t,e,n=!1)=>{const i=t.children,o=e.children;if(Object(r["n"])(i)&&Object(r["n"])(o))for(let r=0;r<i.length;r++){const t=i[r],e=o[r]=Qe(o[r]);1&e.shapeFlag&&!e.dynamicChildren&&((e.patchFlag<=0||32===e.patchFlag)&&(e.el=t.el),n||K(t,e))}},z=(t,e)=>{null==t?e._vnode&&V(e._vnode,null,null,!0):_(e._vnode||null,t,e),Yt(),e._vnode=t}
1072,Q={p:_,um:V,m:U,r:q,mt:P,mc:S,pc:j,pbc:N,n:H,o:t};let Y,X;return e&&([Y,X]=e(Q)),{render:z,hydrate:Y,createApp:zn(z,Y)}}function tr(t,e,n,r=null){Ct(t,e,7,[n,r])}function er(t){const e=t.slice(),n=[0];let r,i,o,s,a;const u=t.length;for(r=0;r<u;r++){const u=t[r];if(0!==u){if(i=n[n.length-1],t[i]<u){e[r]=i,n.push(r);continue}o=0,s=n.length-1;while(o<s)a=(o+s)/2|0,t[n[a]]<u?o=a+1:s=a;u<t[n[o]]&&(o>0&&(e[r]=n[o-1]),n[o]=r)}}o=n.length,s=n[o-1];while(o-- >0)n[o]=s,s=e[s];return n}const nr={};function rr(t,e,n){return ir(t,e,n)}function ir(t,e,{immediate:n,deep:i,flush:o,onTrack:s,onTrigger:a}=r["b"],u=Sr){let c;const f=mt(t);if(f?c=()=>t.value:dt(t)?(c=()=>t,i=!0):c=Object(r["n"])(t)?()=>t.map(t=>mt(t)?t.value:dt(t)?sr(t):Object(r["o"])(t)?Tt(t,u,2):void 0):Object(r["o"])(t)?e?()=>Tt(t,u,2):()=>{if(!u||!u.isUnmounted)return p&&p(),Tt(t,u,3,[d])}:r["d"],e&&i){const t=c;c=()=>sr(t())}let p;const d=t=>{p=m.options.onStop=()=>{Tt(t,u,4)}};let v=Object(r["n"])(t)?[]:nr;const g=()=>{if(m.active)if(e){const t=m();(i||f||Object(r["j"])(t,v))&&(p&&p(),Ct(e,u,3,[t,v===nr?void 0:v,d]),v=t)}else m()};let y;g.allowRecurse=!!e,y="sync"===o?g:"post"===o?()=>Xn(g,u&&u.suspense):()=>{!u||u.isMounted?Kt(g):g()};const m=h(c,{lazy:!0,onTrack:s,onTrigger:a,scheduler:y});return jr(m),e?n?g():v=m():"post"===o?Xn(m,u&&u.suspense):m(),()=>{l(m),u&&Object(r["J"])(u.effects,m)}}function or(t,e,n){const i=this.proxy,o=Object(r["B"])(t)?()=>i[t]:t.bind(i);return ir(o,e.bind(i),n,this)}function sr(t,e=new Set){if(!Object(r["u"])(t)||e.has(t))return t;if(e.add(t),mt(t))sr(t.value,e);else if(Object(r["n"])(t))for(let n=0;n<t.length;n++)sr(t[n],e);else if(Object(r["s"])(t))t.forEach((n,r)=>{sr(t.get(r),e)});else if(Object(r["z"])(t))t.forEach(t=>{sr(t,e)});else for(const n in t)sr(t[n],e);return t}function ar(t,e){if(Sr){let n=Sr.provides;const r=Sr.parent&&Sr.parent.provides;r===n&&(n=Sr.provides=Object.create(r)),n[t]=e}else 0}function ur(t,e,n=!1){const i=Sr||ee;if(i){const o=i.provides;if(t in o)return o[t];if(arguments.length>1)return n&&Object(r["o"])(e)?e():e}else 0}let cr=!1;function hr(t,e,n=[],i=[],o=!1){const{mixins:s,extends:a,data:u,computed:c,methods:h,watch:l,provide:f,inject:p,components:d,directives:v,beforeMount:g,mounted:y,beforeUpdate:m,updated:_,activated:b,deactivated:w,beforeDestroy:E,beforeUnmount:I,destroyed:T,unmounted:C,render:S,renderTracked:O,renderTriggered:N,errorCaptured:A}=e,k=t.proxy,R=t.ctx,P=t.appContext.mixins;o&&S&&t.render===r["d"]&&(t.render=S),o||(cr=!0,lr("beforeCreate",e,k,P),cr=!1,dr(t,P,n,i)),a&&hr(t,a,n,i,!0),s&&dr(t,s,n,i);if(p)if(Object(r["n"])(p))for(let r=0;r<p.length;r++){const t=p[r];R[t]=ur(t)}else for(const x in p){const t=p[x];Object(r["u"])(t)?R[x]=ur(t.from||x,t.default,!0):R[x]=ur(t)}if(h)for(const x in h){const t=h[x];Object(r["o"])(t)&&(R[x]=t.bind(k))}if(o?u&&n.push(u):(n.length&&n.forEach(e=>vr(t,e,k)),u&&vr(t,u,k)),c)for(const x in c){const t=c[x],e=Object(r["o"])(t)?t.bind(k,k):Object(r["o"])(t.get)?t.get.bind(k,k):r["d"];0;const n=!Object(r["o"])(t)&&Object(r["o"])(t.set)?t.set.bind(k):r["d"],i=Fr({get:e,set:n});Object.defineProperty(R,x,{enumerable:!0,configurable:!0,get:()=>i.value,set:t=>i.value=t})}if(l&&i.push(l),!o&&i.length&&i.forEach(t=>{for(const e in t)gr(t[e],R,k,e)}),f){const t=Object(r["o"])(f)?f.call(k):f;for(const e in t)ar(e,t[e])}o&&(d&&Object(r["h"])(t.components||(t.components=Object(r["h"])({},t.type.components)),d),v&&Object(r["h"])(t.directives||(t.directives=Object(r["h"])({},t.type.directives)),v)),o||lr("created",e,k,P),g&&cn(g.bind(k)),y&&hn(y.bind(k)),m&&ln(m.bind(k)),_&&fn(_.bind(k)),b&&Rn(b.bind(k)),w&&Pn(w.bind(k)),A&&yn(A.bind(k)),O&&gn(O.bind(k)),N&&vn(N.bind(k)),I&&pn(I.bind(k)),C&&dn(C.bind(k))}function lr(t,e,n,r){pr(t,r,n);const{extends:i,mixins:o}=e;i&&fr(t,i,n),o&&pr(t,o,n);const s=e[t];s&&s.call(n)}function fr(t,e,n){e.extends&&fr(t,e.extends,n);const r=e[t];r&&r.call(n)}function pr(t,e,n){for(let r=0;r<e.length;r++){const i=e[r].mixins;i&&pr(t,i,n);const o=e[r][t];o&&o.call(n)}}function dr(t,e,n,r){for(let i=0;i<e.length;i++)hr(t,e[i],n,r,!0)}function vr(t,e,n){const i=e.call(n,n);Object(r["u"])(i)&&(t.data===r["b"]?t.data=ht(i):Object(r["h"])(t.data,i))}function gr(t,e,n,i){const o=i.includes(".")?yr(n,i):()=>n[i];if(Object(r["B"])(t)){const n=e[t];Object(r["o"])(n)&&rr(o,n)}else if(Object(r["o"])(t))rr(o,t.bind(n));else if(Object(r["u"])(t))if(Object(r["n"])(t))t.forEach(t=>gr(t,e,n,i));else{const i=Object(r["o"])(t.handler)?t.handler.bind(n):e[t.handler];Object(r["o"])(i)&&rr(o,i,t)}else 0}function yr(t,e){const n=e.split(".");return()=>{let e=t;for(let t=0;t<n.length&&e;t++)e=e[n[t]];return e}}function mr(t){const e=t.type,{__merged:n,mixins:r,extends:i}=e;if(n)return n;const o=t.appContext.mixins;if(!o.length&&!r&&!i)return e;const s={};
1072return o.forEach(e=>_r(s,e,t)),_r(s,e,t),e.__merged=s}function _r(t,e,n){const i=n.appContext.config.optionMergeStrategies,{mixins:o,extends:s}=e;s&&_r(t,s,n),o&&o.forEach(e=>_r(t,e,n));for(const a in e)i&&Object(r["k"])(i,a)?t[a]=i[a](t[a],e[a],n.proxy,a):t[a]=e[a]}const br=Object(r["h"])(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>t.parent&&t.parent.proxy,$root:t=>t.root&&t.root.proxy,$emit:t=>t.emit,$options:t=>mr(t),$forceUpdate:t=>()=>Bt(t.update),$nextTick:()=>qt,$watch:t=>or.bind(t)}),wr={get({_:t},e){const{ctx:n,setupState:i,data:o,props:s,accessCache:a,type:u,appContext:c}=t;if("__v_skip"===e)return!0;let h;if("$"!==e[0]){const u=a[e];if(void 0!==u)switch(u){case 0:return i[e];case 1:return o[e];case 3:return n[e];case 2:return s[e]}else{if(i!==r["b"]&&Object(r["k"])(i,e))return a[e]=0,i[e];if(o!==r["b"]&&Object(r["k"])(o,e))return a[e]=1,o[e];if((h=t.propsOptions[0])&&Object(r["k"])(h,e))return a[e]=2,s[e];if(n!==r["b"]&&Object(r["k"])(n,e))return a[e]=3,n[e];cr||(a[e]=4)}}const l=br[e];let f,p;return l?("$attrs"===e&&b(t,"get",e),l(t)):(f=u.__cssModules)&&(f=f[e])?f:n!==r["b"]&&Object(r["k"])(n,e)?(a[e]=3,n[e]):(p=c.config.globalProperties,Object(r["k"])(p,e)?p[e]:void 0)},set({_:t},e,n){const{data:i,setupState:o,ctx:s}=t;if(o!==r["b"]&&Object(r["k"])(o,e))o[e]=n;else if(i!==r["b"]&&Object(r["k"])(i,e))i[e]=n;else if(e in t.props)return!1;return("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:i,appContext:o,propsOptions:s}},a){let u;return void 0!==n[a]||t!==r["b"]&&Object(r["k"])(t,a)||e!==r["b"]&&Object(r["k"])(e,a)||(u=s[0])&&Object(r["k"])(u,a)||Object(r["k"])(i,a)||Object(r["k"])(br,a)||Object(r["k"])(o.config.globalProperties,a)}};const Er=Object(r["h"])({},wr,{get(t,e){if(e!==Symbol.unscopables)return wr.get(t,e,t)},has(t,e){const n="_"!==e[0]&&!Object(r["p"])(e);return n}});const Ir=Hn();let Tr=0;function Cr(t,e,n){const i=t.type,o=(e?e.appContext:t.appContext)||Ir,s={uid:Tr++,vnode:t,type:i,parent:e,appContext:o,root:null,next:null,subTree:null,update:null,render:null,proxy:null,withProxy:null,effects:null,provides:e?e.provides:Object.create(o.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:en(i,o),emitsOptions:Zt(i,o),emit:null,emitted:null,ctx:r["b"],data:r["b"],props:r["b"],attrs:r["b"],slots:r["b"],refs:r["b"],setupState:r["b"],setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null};return s.ctx={_:s},s.root=e?e.root:s,s.emit=Jt.bind(null,s),s}let Sr=null;const Or=()=>Sr||ee,Nr=t=>{Sr=t};let Ar,kr=!1;function Rr(t,e=!1){kr=e;const{props:n,children:r,shapeFlag:i}=t.vnode,o=4&i;$e(t,n,o,e),Bn(t,r);const s=o?Pr(t,e):void 0;return kr=!1,s}function Pr(t,e){const n=t.type;t.accessCache={},t.proxy=new Proxy(t.ctx,wr);const{setup:i}=n;if(i){const n=t.setupContext=i.length>1?Lr(t):null;Sr=t,y();const o=Tt(i,t,0,[t.props,n]);if(_(),Sr=null,Object(r["w"])(o)){if(e)return o.then(e=>{xr(t,e)});t.asyncDep=o}else xr(t,o)}else Dr(t)}function xr(t,e,n){Object(r["o"])(e)?t.render=e:Object(r["u"])(e)&&(t.setupState=wt(e)),Dr(t)}function Dr(t,e){const n=t.type;t.render||(Ar&&n.template&&!n.render&&(n.render=Ar(n.template,{isCustomElement:t.appContext.config.isCustomElement,delimiters:n.delimiters})),t.render=n.render||r["d"],t.render._rc&&(t.withProxy=new Proxy(t.ctx,Er))),Sr=t,hr(t,n),Sr=null}function Lr(t){return{attrs:t.attrs,slots:t.slots,emit:t.emit}}function jr(t){Sr&&(Sr.effects||(Sr.effects=[])).push(t)}function Mr(t){return Object(r["o"])(t)&&"__vccOpts"in t}function Fr(t){const e=It(t);return jr(e.effect),e}function Ur(t,e,n){const i=arguments.length;return 2===i?Object(r["u"])(e)&&!Object(r["n"])(e)?Fe(e)?We(t,null,[e]):We(t,e):We(t,null,e):(i>3?n=Array.prototype.slice.call(arguments,2):3===i&&Fe(n)&&(n=[n]),We(t,e,n))}Symbol("");const Vr="3.0.0",qr="http://www.w3.org/2000/svg",Br="undefined"!==typeof document?document:null;let Wr,Gr;const Hr={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n)=>e?Br.createElementNS(qr,t):Br.createElement(t,n?{is:n}:void 0),createText:t=>Br.createTextNode(t),createComment:t=>Br.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Br.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},cloneNode(t){return t.cloneNode(!0)},insertStaticContent(t,e,n,r){const i=r?Gr||(Gr=Br.createElementNS(qr,"svg")):Wr||(Wr=Br.createElement("div"));i.innerHTML=t;const o=i.firstChild;let s=o,a=s;while(s)a=s,Hr.insert(s,e,n),s=i.firstChild;return[o,a]}};function Kr(t,e,n){if(null==e&&(e=""),n)t.setAttribute("class",e);else{const n=t._vtc;n&&(e=(e?[e,...n]:[...n]).join(" ")),t.className=e}}function zr(t,e,n){const i=t.style;if(n)if(Object(r["B"])(n))e!==n&&(i.cssText=n);else{for(const t in n)Yr(i,t,n[t]);if(e&&!Object(r["B"])(e))for(const t in e)null==n[t]&&Yr(i,t,"")}else t.removeAttribute("style")}const Qr=/\s*!important$/;function Yr(t,e,n){if(Object(r["n"])(n))n.forEach(n=>Yr(t,e,n));else if(e.startsWith("--"))t.setProperty(e,n);else{const i=Jr(t,e);Qr.test(n)?t.setProperty(Object(r["l"])(i),n.replace(Qr,""),"important"):t[i]=n}}const Xr=["Webkit","Moz","ms"],$r={};function Jr(t,e){const n=$r[e];
1072if(n)return n;let i=Object(r["e"])(e);if("filter"!==i&&i in t)return $r[e]=i;i=Object(r["f"])(i);for(let r=0;r<Xr.length;r++){const n=Xr[r]+i;if(n in t)return $r[e]=n}return e}const Zr="http://www.w3.org/1999/xlink";function ti(t,e,n,i){if(i&&e.startsWith("xlink:"))null==n?t.removeAttributeNS(Zr,e.slice(6,e.length)):t.setAttributeNS(Zr,e,n);else{const i=Object(r["A"])(e);null==n||i&&!1===n?t.removeAttribute(e):t.setAttribute(e,i?"":n)}}function ei(t,e,n,r,i,o,s){if("innerHTML"===e||"textContent"===e)return r&&s(r,i,o),void(t[e]=null==n?"":n);if("value"!==e||"PROGRESS"===t.tagName)if(""===n&&"boolean"===typeof t[e])t[e]=!0;else if(null==n&&"string"===typeof t[e])t[e]="",t.removeAttribute(e);else try{t[e]=n}catch(a){0}else{t._value=n;const e=null==n?"":n;t.value!==e&&(t.value=e)}}let ni=Date.now;"undefined"!==typeof document&&ni()>document.createEvent("Event").timeStamp&&(ni=()=>performance.now());let ri=0;const ii=Promise.resolve(),oi=()=>{ri=0},si=()=>ri||(ii.then(oi),ri=ni());function ai(t,e,n,r){t.addEventListener(e,n,r)}function ui(t,e,n,r){t.removeEventListener(e,n,r)}function ci(t,e,n,r,i=null){const o=t._vei||(t._vei={}),s=o[e];if(r&&s)s.value=r;else{const[n,a]=li(e);if(r){const s=o[e]=fi(r,i);ai(t,n,s,a)}else s&&(ui(t,n,s,a),o[e]=void 0)}}const hi=/(?:Once|Passive|Capture)$/;function li(t){let e;if(hi.test(t)){let n;e={};while(n=t.match(hi))t=t.slice(0,t.length-n[0].length),e[n[0].toLowerCase()]=!0}return[t.slice(2).toLowerCase(),e]}function fi(t,e){const n=t=>{const r=t.timeStamp||ni();r>=n.attached-1&&Ct(pi(t,n.value),e,5,[t])};return n.value=t,n.attached=si(),n}function pi(t,e){if(Object(r["n"])(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(t=>e=>!e._stopped&&t(e))}return e}const di=/^on[a-z]/,vi=(t,e)=>"value"===e,gi=(t,e,n,i,o=!1,s,a,u,c)=>{switch(e){case"class":Kr(t,i,o);break;case"style":zr(t,n,i);break;default:Object(r["v"])(e)?Object(r["t"])(e)||ci(t,e,n,i,a):yi(t,e,i,o)?ei(t,e,i,s,a,u,c):("true-value"===e?t._trueValue=i:"false-value"===e&&(t._falseValue=i),ti(t,e,i,o));break}};function yi(t,e,n,i){return i?"innerHTML"===e||!!(e in t&&di.test(e)&&Object(r["o"])(n)):"spellcheck"!==e&&"draggable"!==e&&(("form"!==e||"string"!==typeof n)&&(("list"!==e||"INPUT"!==t.tagName)&&((!di.test(e)||!Object(r["B"])(n))&&e in t)))}const mi="transition",_i="animation",bi=(t,{slots:e})=>Ur(wn,Ei(t),e);bi.displayName="Transition";const wi={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};bi.props=Object(r["h"])({},wn.props,wi);function Ei(t){let{name:e="v",type:n,css:i=!0,duration:o,enterFromClass:s=e+"-enter-from",enterActiveClass:a=e+"-enter-active",enterToClass:u=e+"-enter-to",appearFromClass:c=s,appearActiveClass:h=a,appearToClass:l=u,leaveFromClass:f=e+"-leave-from",leaveActiveClass:p=e+"-leave-active",leaveToClass:d=e+"-leave-to"}=t;const v={};for(const r in t)r in wi||(v[r]=t[r]);if(!i)return v;const g=Ii(o),y=g&&g[0],m=g&&g[1],{onBeforeEnter:_,onEnter:b,onEnterCancelled:w,onLeave:E,onLeaveCancelled:I,onBeforeAppear:T=_,onAppear:C=b,onAppearCancelled:S=w}=v,O=(t,e,n)=>{Si(t,e?l:u),Si(t,e?h:a),n&&n()},N=(t,e)=>{Si(t,d),Si(t,p),e&&e()},A=t=>(e,r)=>{const i=t?C:b,o=()=>O(e,t,r);i&&i(e,o),Oi(()=>{Si(e,t?c:s),Ci(e,t?l:u),i&&i.length>1||(y?setTimeout(o,y):Ni(e,n,o))})};return Object(r["h"])(v,{onBeforeEnter(t){_&&_(t),Ci(t,a),Ci(t,s)},onBeforeAppear(t){T&&T(t),Ci(t,h),Ci(t,c)},onEnter:A(!1),onAppear:A(!0),onLeave(t,e){const r=()=>N(t,e);Ci(t,p),Ci(t,f),Oi(()=>{Si(t,f),Ci(t,d),E&&E.length>1||(m?setTimeout(r,m):Ni(t,n,r))}),E&&E(t,r)},onEnterCancelled(t){O(t,!1),w&&w(t)},onAppearCancelled(t){O(t,!0),S&&S(t)},onLeaveCancelled(t){N(t),I&&I(t)}})}function Ii(t){if(null==t)return null;if(Object(r["u"])(t))return[Ti(t.enter),Ti(t.leave)];{const e=Ti(t);return[e,e]}}function Ti(t){const e=Object(r["L"])(t);return e}
1072function Ci(t,e){e.split(/\s+/).forEach(e=>e&&t.classList.add(e)),(t._vtc||(t._vtc=new Set)).add(e)}function Si(t,e){e.split(/\s+/).forEach(e=>e&&t.classList.remove(e));const{_vtc:n}=t;n&&(n.delete(e),n.size||(t._vtc=void 0))}function Oi(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}function Ni(t,e,n){const{type:r,timeout:i,propCount:o}=Ai(t,e);if(!r)return n();const s=r+"end";let a=0;const u=()=>{t.removeEventListener(s,c),n()},c=e=>{e.target===t&&++a>=o&&u()};setTimeout(()=>{a<o&&u()},i+1),t.addEventListener(s,c)}function Ai(t,e){const n=window.getComputedStyle(t),r=t=>(n[t]||"").split(", "),i=r(mi+"Delay"),o=r(mi+"Duration"),s=ki(i,o),a=r(_i+"Delay"),u=r(_i+"Duration"),c=ki(a,u);let h=null,l=0,f=0;e===mi?s>0&&(h=mi,l=s,f=o.length):e===_i?c>0&&(h=_i,l=c,f=u.length):(l=Math.max(s,c),h=l>0?s>c?mi:_i:null,f=h?h===mi?o.length:u.length:0);const p=h===mi&&/\b(transform|all)(,|$)/.test(n[mi+"Property"]);return{type:h,timeout:l,propCount:f,hasTransform:p}}function ki(t,e){while(t.length<e.length)t=t.concat(t);return Math.max(...e.map((e,n)=>Ri(e)+Ri(t[n])))}function Ri(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}new WeakMap,new WeakMap;const Pi=Object(r["h"])({patchProp:gi,forcePatchProp:vi},Hr);let xi;function Di(){return xi||(xi=Jn(Pi))}const Li=(...t)=>{const e=Di().createApp(...t);const{mount:n}=e;return e.mount=t=>{const i=ji(t);if(!i)return;const o=e._component;Object(r["o"])(o)||o.render||o.template||(o.template=i.innerHTML),i.innerHTML="";const s=n(i);return i.removeAttribute("v-cloak"),i.setAttribute("data-v-app",""),s},e};function ji(t){if(Object(r["B"])(t)){const e=document.querySelector(t);return e}return t}},"7b0b":function(t,e,n){var r=n("1d80"),i=Object;t.exports=function(t){return i(r(t))}},"7c73":function(t,e,n){var r,i=n("825a"),o=n("37e8"),s=n("7839"),a=n("d012"),u=n("1be4"),c=n("cc12"),h=n("f772"),l=">",f="<",p="prototype",d="script",v=h("IE_PROTO"),g=function(){},y=function(t){return f+d+l+t+f+"/"+d+l},m=function(t){t.write(y("")),t.close();var e=t.parentWindow.Object;return t=null,e},_=function(){var t,e=c("iframe"),n="java"+d+":";return e.style.display="none",u.appendChild(e),e.src=String(n),t=e.contentWindow.document,t.open(),t.write(y("document.F=Object")),t.close(),t.F},b=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}b="undefined"!=typeof document?document.domain&&r?m(r):_():m(r);var t=s.length;while(t--)delete b[p][s[t]];return b()};a[v]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(g[p]=i(t),n=new g,g[p]=null,n[v]=t):n=b(),void 0===e?n:o.f(n,e)}},"7d28":function(t,e,n){"use strict";n.r(e),n.d(e,"registerInstallations",(function(){return At}));var r,i=n("c23d"),o=n.n(i),s=n("4be4"),a=n("9ab4"),u=n("cd51"),c=n("9dbb"),h="@firebase/installations",l="0.4.17",f=1e4,p="w:"+l,d="FIS_v2",v="https://firebaseinstallations.googleapis.com/v1",g=36e5,y="installations",m="Installations",_=(r={},r["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',r["not-registered"]="Firebase Installation is not registered.",r["installation-not-found"]="Firebase Installation not found.",r["request-failed"]='{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',r["app-offline"]="Could not process request. Application offline.",r["delete-pending-registration"]="Can't delete installation while there is a pending registration request.",r),b=new u["ErrorFactory"](y,m,_);function w(t){return t instanceof u["FirebaseError"]&&t.code.includes("request-failed")} 1073/** 1074 * @license 1075 * Copyright 2019 Google LLC 1076 * 1077 * Licensed under the Apache License, Version 2.0 (the "License"); 1078 * you may not use this file except in compliance with the License. 1079 * You may obtain a copy of the License at 1080 * 1081 * http://www.apache.org/licenses/LICENSE-2.0 1082 * 1083 * Unless required by applicable law or agreed to in writing, software 1084 * distributed under the License is distributed on an "AS IS" BASIS, 1085 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1086 * See the License for the specific language governing permissions and 1087 * limitations under the License. 1088 */function E(t){var e=t.projectId;return v+"/projects/"+e+"/installations"}
1088function I(t){return{token:t.token,requestStatus:2,expiresIn:N(t.expiresIn),creationTime:Date.now()}}function T(t,e){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n,r;return Object(a["__generator"])(this,(function(i){switch(i.label){case 0:return[4,e.json()];case 1:return n=i.sent(),r=n.error,[2,b.create("request-failed",{requestName:t,serverCode:r.code,serverMessage:r.message,serverStatus:r.status})]}}))}))}function C(t){var e=t.apiKey;return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function S(t,e){var n=e.refreshToken,r=C(t);return r.append("Authorization",A(n)),r}function O(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var e;return Object(a["__generator"])(this,(function(n){switch(n.label){case 0:return[4,t()];case 1:return e=n.sent(),e.status>=500&&e.status<600?[2,t()]:[2,e]}}))}))}function N(t){return Number(t.replace("s","000"))}function A(t){return d+" "+t} 1089/** 1090 * @license 1091 * Copyright 2019 Google LLC 1092 * 1093 * Licensed under the Apache License, Version 2.0 (the "License"); 1094 * you may not use this file except in compliance with the License. 1095 * You may obtain a copy of the License at 1096 * 1097 * http://www.apache.org/licenses/LICENSE-2.0 1098 * 1099 * Unless required by applicable law or agreed to in writing, software 1100 * distributed under the License is distributed on an "AS IS" BASIS, 1101 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1102 * See the License for the specific language governing permissions and 1103 * limitations under the License. 1104 */function k(t,e){var n=e.fid;return Object(a["__awaiter"])(this,void 0,void 0,(function(){var e,r,i,o,s,u,c;return Object(a["__generator"])(this,(function(a){switch(a.label){case 0:return e=E(t),r=C(t),i={fid:n,authVersion:d,appId:t.appId,sdkVersion:p},o={method:"POST",headers:r,body:JSON.stringify(i)},[4,O((function(){return fetch(e,o)}))];case 1:return s=a.sent(),s.ok?[4,s.json()]:[3,3];case 2:return u=a.sent(),c={fid:u.fid||n,registrationStatus:2,refreshToken:u.refreshToken,authToken:I(u.authToken)},[2,c];case 3:return[4,T("Create Installation",s)];case 4:throw a.sent()}}))}))} 1105/** 1106 * @license 1107 * Copyright 2019 Google LLC 1108 * 1109 * Licensed under the Apache License, Version 2.0 (the "License"); 1110 * you may not use this file except in compliance with the License. 1111 * You may obtain a copy of the License at 1112 * 1113 * http://www.apache.org/licenses/LICENSE-2.0 1114 * 1115 * Unless required by applicable law or agreed to in writing, software 1116 * distributed under the License is distributed on an "AS IS" BASIS, 1117 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1118 * See the License for the specific language governing permissions and 1119 * limitations under the License. 1120 */function R(t){return new Promise((function(e){setTimeout(e,t)}))} 1121/** 1122 * @license 1123 * Copyright 2019 Google LLC 1124 * 1125 * Licensed under the Apache License, Version 2.0 (the "License"); 1126 * you may not use this file except in compliance with the License. 1127 * You may obtain a copy of the License at 1128 * 1129 * http://www.apache.org/licenses/LICENSE-2.0 1130 * 1131 * Unless required by applicable law or agreed to in writing, software 1132 * distributed under the License is distributed on an "AS IS" BASIS, 1133 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1134 * See the License for the specific language governing permissions and 1135 * limitations under the License. 1136 */function P(t){var e=btoa(String.fromCharCode.apply(String,Object(a["__spread"])(t)));return e.replace(/\+/g,"-").replace(/\//g,"_")} 1137/** 1138 * @license 1139 * Copyright 2019 Google LLC 1140 * 1141 * Licensed under the Apache License, Version 2.0 (the "License"); 1142 * you may not use this file except in compliance with the License. 1143 * You may obtain a copy of the License at 1144 * 1145 * http://www.apache.org/licenses/LICENSE-2.0 1146 * 1147 * Unless required by applicable law or agreed to in writing, software 1148 * distributed under the License is distributed on an "AS IS" BASIS, 1149 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1150 * See the License for the specific language governing permissions and 1151 * limitations under the License. 1152 */var x=/^[cdef][\w-]{21}$/,D="";function L(){try{var t=new Uint8Array(17),e=self.crypto||self.msCrypto;e.getRandomValues(t),t[0]=112+t[0]%16;var n=j(t);return x.test(n)?n:D}catch(r){return D}}function j(t){var e=P(t);return e.substr(0,22)} 1153/** 1154 * @license 1155 * Copyright 2019 Google LLC 1156 * 1157 * Licensed under the Apache License, Version 2.0 (the "License");
1158 * you may not use this file except in compliance with the License. 1159 * You may obtain a copy of the License at 1160 * 1161 * http://www.apache.org/licenses/LICENSE-2.0 1162 * 1163 * Unless required by applicable law or agreed to in writing, software 1164 * distributed under the License is distributed on an "AS IS" BASIS, 1165 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1166 * See the License for the specific language governing permissions and 1167 * limitations under the License. 1168 */function M(t){return t.appName+"!"+t.appId} 1169/** 1170 * @license 1171 * Copyright 2019 Google LLC 1172 * 1173 * Licensed under the Apache License, Version 2.0 (the "License"); 1174 * you may not use this file except in compliance with the License. 1175 * You may obtain a copy of the License at 1176 * 1177 * http://www.apache.org/licenses/LICENSE-2.0 1178 * 1179 * Unless required by applicable law or agreed to in writing, software 1180 * distributed under the License is distributed on an "AS IS" BASIS, 1181 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1182 * See the License for the specific language governing permissions and 1183 * limitations under the License. 1184 */var F=new Map;function U(t,e){var n=M(t);B(n,e),W(n,e)}function V(t,e){H();var n=M(t),r=F.get(n);r||(r=new Set,F.set(n,r)),r.add(e)}function q(t,e){var n=M(t),r=F.get(n);r&&(r.delete(e),0===r.size&&F.delete(n),K())}function B(t,e){var n,r,i=F.get(t);if(i)try{for(var o=Object(a["__values"])(i),s=o.next();!s.done;s=o.next()){var u=s.value;u(e)}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}function W(t,e){var n=H();n&&n.postMessage({key:t,fid:e}),K()}var G=null;function H(){return!G&&"BroadcastChannel"in self&&(G=new BroadcastChannel("[Firebase] FID Change"),G.onmessage=function(t){B(t.data.key,t.data.fid)}),G}function K(){0===F.size&&G&&(G.close(),G=null)} 1185/** 1186 * @license 1187 * Copyright 2019 Google LLC 1188 * 1189 * Licensed under the Apache License, Version 2.0 (the "License"); 1190 * you may not use this file except in compliance with the License. 1191 * You may obtain a copy of the License at 1192 * 1193 * http://www.apache.org/licenses/LICENSE-2.0 1194 * 1195 * Unless required by applicable law or agreed to in writing, software 1196 * distributed under the License is distributed on an "AS IS" BASIS, 1197 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1198 * See the License for the specific language governing permissions and 1199 * limitations under the License. 1200 */var z="firebase-installations-database",Q=1,Y="firebase-installations-store",X=null;function $(){return X||(X=Object(c["openDb"])(z,Q,(function(t){switch(t.oldVersion){case 0:t.createObjectStore(Y)}}))),X}function J(t,e){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n,r,i,o,s;return Object(a["__generator"])(this,(function(a){switch(a.label){case 0:return n=M(t),[4,$()];case 1:return r=a.sent(),i=r.transaction(Y,"readwrite"),o=i.objectStore(Y),[4,o.get(n)];case 2:return s=a.sent(),[4,o.put(e,n)];case 3:return a.sent(),[4,i.complete];case 4:return a.sent(),s&&s.fid===e.fid||U(t,e.fid),[2,e]}}))}))}function Z(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var e,n,r;return Object(a["__generator"])(this,(function(i){switch(i.label){case 0:return e=M(t),[4,$()];case 1:return n=i.sent(),r=n.transaction(Y,"readwrite"),[4,r.objectStore(Y).delete(e)];case 2:return i.sent(),[4,r.complete];case 3:return i.sent(),[2]}}))}))}function tt(t,e){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n,r,i,o,s,u;return Object(a["__generator"])(this,(function(a){switch(a.label){case 0:return n=M(t),[4,$()];case 1:return r=a.sent(),i=r.transaction(Y,"readwrite"),o=i.objectStore(Y),[4,o.get(n)];case 2:return s=a.sent(),u=e(s),void 0!==u?[3,4]:[4,o.delete(n)];case 3:return a.sent(),[3,6];case 4:return[4,o.put(u,n)];case 5:a.sent(),a.label=6;case 6:return[4,i.complete];case 7:return a.sent(),!u||s&&s.fid===u.fid||U(t,u.fid),[2,u]}}))}))} 1201/** 1202 * @license 1203 * Copyright 2019 Google LLC 1204 * 1205 * Licensed under the Apache License, Version 2.0 (the "License"); 1206 * you may not use this file except in compliance with the License. 1207 * You may obtain a copy of the License at 1208 * 1209 * http://www.apache.org/licenses/LICENSE-2.0 1210 * 1211 * Unless required by applicable law or agreed to in writing, softw
1211are 1212 * distributed under the License is distributed on an "AS IS" BASIS, 1213 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1214 * See the License for the specific language governing permissions and 1215 * limitations under the License. 1216 */function et(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var e,n,r;return Object(a["__generator"])(this,(function(i){switch(i.label){case 0:return[4,tt(t,(function(n){var r=nt(n),i=rt(t,r);return e=i.registrationPromise,i.installationEntry}))];case 1:return n=i.sent(),n.fid!==D?[3,3]:(r={},[4,e]);case 2:return[2,(r.installationEntry=i.sent(),r)];case 3:return[2,{installationEntry:n,registrationPromise:e}]}}))}))}function nt(t){var e=t||{fid:L(),registrationStatus:0};return at(e)}function rt(t,e){if(0===e.registrationStatus){if(!navigator.onLine){var n=Promise.reject(b.create("app-offline"));return{installationEntry:e,registrationPromise:n}}var r={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},i=it(t,r);return{installationEntry:r,registrationPromise:i}}return 1===e.registrationStatus?{installationEntry:e,registrationPromise:ot(t)}:{installationEntry:e}}function it(t,e){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n,r;return Object(a["__generator"])(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,7]),[4,k(t,e)];case 1:return n=i.sent(),[2,J(t,n)];case 2:return r=i.sent(),w(r)&&409===r.serverCode?[4,Z(t)]:[3,4];case 3:return i.sent(),[3,6];case 4:return[4,J(t,{fid:e.fid,registrationStatus:0})];case 5:i.sent(),i.label=6;case 6:throw r;case 7:return[2]}}
1216))}))}function ot(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var e,n,r,i;return Object(a["__generator"])(this,(function(o){switch(o.label){case 0:return[4,st(t)];case 1:e=o.sent(),o.label=2;case 2:return 1!==e.registrationStatus?[3,5]:[4,R(100)];case 3:return o.sent(),[4,st(t)];case 4:return e=o.sent(),[3,2];case 5:return 0!==e.registrationStatus?[3,7]:[4,et(t)];case 6:return n=o.sent(),r=n.installationEntry,i=n.registrationPromise,i?[2,i]:[2,r];case 7:return[2,e]}}))}))}function st(t){return tt(t,(function(t){if(!t)throw b.create("installation-not-found");return at(t)}))}function at(t){return ut(t)?{fid:t.fid,registrationStatus:0}:t}function ut(t){return 1===t.registrationStatus&&t.registrationTime+f<Date.now()} 1217/** 1218 * @license 1219 * Copyright 2019 Google LLC 1220 * 1221 * Licensed under the Apache License, Version 2.0 (the "License"); 1222 * you may not use this file except in compliance with the License. 1223 * You may obtain a copy of the License at 1224 * 1225 * http://www.apache.org/licenses/LICENSE-2.0 1226 * 1227 * Unless required by applicable law or agreed to in writing, software 1228 * distributed under the License is distributed on an "AS IS" BASIS, 1229 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1230 * See the License for the specific language governing permissions and 1231 * limitations under the License. 1232 */function ct(t,e){var n=t.appConfig,r=t.platformLoggerProvider;return Object(a["__awaiter"])(this,void 0,void 0,(function(){var t,i,o,s,u,c,h,l;return Object(a["__generator"])(this,(function(a){switch(a.label){case 0:return t=ht(n,e),i=S(n,e),o=r.getImmediate({optional:!0}),o&&i.append("x-firebase-client",o.getPlatformInfoString()),s={installation:{sdkVersion:p}},u={method:"POST",headers:i,body:JSON.stringify(s)},[4,O((function(){return fetch(t,u)}))];case 1:return c=a.sent(),c.ok?[4,c.json()]:[3,3];case 2:return h=a.sent(),l=I(h),[2,l];case 3:return[4,T("Generate Auth Token",c)];case 4:throw a.sent()}}))}))}function ht(t,e){var n=e.fid;return E(t)+"/"+n+"/authTokens:generate"} 1233/** 1234 * @license 1235 * Copyright 2019 Google LLC 1236 * 1237 * Licensed under the Apache License, Version 2.0 (the "License"); 1238 * you may not use this file except in compliance with the License. 1239 * You may obtain a copy of the License at 1240 * 1241 * http://www.apache.org/licenses/LICENSE-2.0 1242 * 1243 * Unless required by applicable law or agreed to in writing, software 1244 * distributed under the License is distributed on an "AS IS" BASIS, 1245 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1246 * See the License for the specific language governing permissions and 1247 * limitations under the License. 1248 */function lt(t,e){return void 0===e&&(e=!1),Object(a["__awaiter"])(this,void 0,void 0,(function(){var n,r,i,o;return Object(a["__generator"])(this,(function(s){switch(s.label){case 0:return[4,tt(t.appConfig,(function(r){if(!vt(r))throw b.create("not-registered");var i=r.authToken;if(!e&>(i))return r;if(1===i.requestStatus)return n=ft(t,e),r;if(!navigator.onLine)throw b.create("app-offline");var o=mt(r);return n=dt(t,o),o}))];case 1:return r=s.sent(),n?[4,n]:[3,3];case 2:return o=s.sent(),[3,4];case 3:o=r.authToken,s.label=4;case 4:return i=o,[2,i]}}))}))}function ft(t,e){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n,r;return Object(a["__generator"])(this,(function(i){switch(i.label){case 0:return[4,pt(t.appConfig)];case 1:n=i.sent(),i.label=2;case 2:return 1!==n.authToken.requestStatus?[3,5]:[4,R(100)];case 3:return i.sent(),[4,pt(t.appConfig)];case 4:return n=i.sent(),[3,2];case 5:return r=n.authToken,0===r.requestStatus?[2,lt(t,e)]:[2,r]}}))}))}function pt(t){return tt(t,(function(t){if(!vt(t))throw b.create("not-registered");var e=t.authToken;return _t(e)?Object(a["__assign"])(Object(a["__assign"])({},t),{authToken:{requestStatus:0}}):t}))}function dt(t,e){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n,r,i;return Object(a["__generator"])(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,8]),[4,ct(t,e)];case 1:return n=o.sent(),i=Object(a["__assign"])(Object(a["__assign"])({},e),{authToken:n}),[4,J(t.appConfig,i)];case 2:return o.sent(),[2,n];case 3:return r=o.sent(),!w(r)||401!==r.serverCode&&404!==r.serverCode?[3,5]:[4,Z(t.appConfig)];case 4:return o.sent(),[3,7];case 5:return i=Object(a["__assign"])(Object(a["__assign"])({},e),{authToken:{requestStatus:0}}),[4,J(t.appConfig,i)];case 6:o.sent(),o.label=7;case 7:throw r;case 8:return[2]}}
1248))}))}function vt(t){return void 0!==t&&2===t.registrationStatus}function gt(t){return 2===t.requestStatus&&!yt(t)}function yt(t){var e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+g}function mt(t){var e={requestStatus:1,requestTime:Date.now()};return Object(a["__assign"])(Object(a["__assign"])({},t),{authToken:e})}function _t(t){return 1===t.requestStatus&&t.requestTime+f<Date.now()} 1249/** 1250 * @license 1251 * Copyright 2019 Google LLC 1252 * 1253 * Licensed under the Apache License, Version 2.0 (the "License"); 1254 * you may not use this file except in compliance with the License. 1255 * You may obtain a copy of the License at 1256 * 1257 * http://www.apache.org/licenses/LICENSE-2.0 1258 * 1259 * Unless required by applicable law or agreed to in writing, software 1260 * distributed under the License is distributed on an "AS IS" BASIS, 1261 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1262 * See the License for the specific language governing permissions and 1263 * limitations under the License. 1264 */function bt(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var e,n,r;return Object(a["__generator"])(this,(function(i){switch(i.label){case 0:return[4,et(t.appConfig)];case 1:return e=i.sent(),n=e.installationEntry,r=e.registrationPromise,r?r.catch(console.error):lt(t).catch(console.error),[2,n.fid]}}))}))} 1265/** 1266 * @license 1267 * Copyright 2019 Google LLC 1268 * 1269 * Licensed under the Apache License, Version 2.0 (the "License"); 1270 * you may not use this file except in compliance with the License. 1271 * You may obtain a copy of the License at 1272 * 1273 * http://www.apache.org/licenses/LICENSE-2.0 1274 * 1275 * Unless required by applicable law or agreed to in writing, software 1276 * distributed under the License is distributed on an "AS IS" BASIS, 1277 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1278 * See the License for the specific language governing permissions and 1279 * limitations under the License. 1280 */function wt(t,e){return void 0===e&&(e=!1),Object(a["__awaiter"])(this,void 0,void 0,(function(){var n;return Object(a["__generator"])(this,(function(r){switch(r.label){case 0:return[4,Et(t.appConfig)];case 1:return r.sent(),[4,lt(t,e)];case 2:return n=r.sent(),[2,n.token]}}))}))}function Et(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var e;return Object(a["__generator"])(this,(function(n){switch(n.label){case 0:return[4,et(t)];case 1:return e=n.sent().registrationPromise,e?[4,e]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}
1280))}))} 1281/** 1282 * @license 1283 * Copyright 2019 Google LLC 1284 * 1285 * Licensed under the Apache License, Version 2.0 (the "License"); 1286 * you may not use this file except in compliance with the License. 1287 * You may obtain a copy of the License at 1288 * 1289 * http://www.apache.org/licenses/LICENSE-2.0 1290 * 1291 * Unless required by applicable law or agreed to in writing, software 1292 * distributed under the License is distributed on an "AS IS" BASIS, 1293 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1294 * See the License for the specific language governing permissions and 1295 * limitations under the License. 1296 */function It(t,e){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n,r,i,o;return Object(a["__generator"])(this,(function(s){switch(s.label){case 0:return n=Tt(t,e),r=S(t,e),i={method:"DELETE",headers:r},[4,O((function(){return fetch(n,i)}))];case 1:return o=s.sent(),o.ok?[3,3]:[4,T("Delete Installation",o)];case 2:throw s.sent();case 3:return[2]}}))}))}function Tt(t,e){var n=e.fid;return E(t)+"/"+n} 1297/** 1298 * @license 1299 * Copyright 2019 Google LLC 1300 * 1301 * Licensed under the Apache License, Version 2.0 (the "License"); 1302 * you may not use this file except in compliance with the License. 1303 * You may obtain a copy of the License at 1304 * 1305 * http://www.apache.org/licenses/LICENSE-2.0 1306 * 1307 * Unless required by applicable law or agreed to in writing, software 1308 * distributed under the License is distributed on an "AS IS" BASIS, 1309 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1310 * See the License for the specific language governing permissions and 1311 * limitations under the License. 1312 */function Ct(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var e,n;return Object(a["__generator"])(this,(function(r){switch(r.label){case 0:return e=t.appConfig,[4,tt(e,(function(t){if(!t||0!==t.registrationStatus)return t}))];case 1:if(n=r.sent(),!n)return[3,6];if(1!==n.registrationStatus)return[3,2];throw b.create("delete-pending-registration");case 2:if(2!==n.registrationStatus)return[3,6];if(navigator.onLine)return[3,3];throw b.create("app-offline");case 3:return[4,It(e,n)];case 4:return r.sent(),[4,Z(e)];case 5:r.sent(),r.label=6;case 6:return[2]}}
1312))}))} 1313/** 1314 * @license 1315 * Copyright 2019 Google LLC 1316 * 1317 * Licensed under the Apache License, Version 2.0 (the "License"); 1318 * you may not use this file except in compliance with the License. 1319 * You may obtain a copy of the License at 1320 * 1321 * http://www.apache.org/licenses/LICENSE-2.0 1322 * 1323 * Unless required by applicable law or agreed to in writing, software 1324 * distributed under the License is distributed on an "AS IS" BASIS, 1325 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1326 * See the License for the specific language governing permissions and 1327 * limitations under the License. 1328 */function St(t,e){var n=t.appConfig;return V(n,e),function(){q(n,e)}} 1329/** 1330 * @license 1331 * Copyright 2019 Google LLC 1332 * 1333 * Licensed under the Apache License, Version 2.0 (the "License"); 1334 * you may not use this file except in compliance with the License. 1335 * You may obtain a copy of the License at 1336 * 1337 * http://www.apache.org/licenses/LICENSE-2.0 1338 * 1339 * Unless required by applicable law or agreed to in writing, software 1340 * distributed under the License is distributed on an "AS IS" BASIS, 1341 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1342 * See the License for the specific language governing permissions and 1343 * limitations under the License. 1344 */function Ot(t){var e,n;if(!t||!t.options)throw Nt("App Configuration");if(!t.name)throw Nt("App Name");var r=["projectId","apiKey","appId"];try{for(var i=Object(a["__values"])(r),o=i.next();!o.done;o=i.next()){var s=o.value;if(!t.options[s])throw Nt(s)}}catch(u){e={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}function Nt(t){return b.create("missing-app-config-values",{valueName:t})} 1345/** 1346 * @license 1347 * Copyright 2019 Google LLC 1348 * 1349 * Licensed under the Apache License, Version 2.0 (the "License"); 1350 * you may not use this file except in compliance with the License. 1351 * You may obtain a copy of the License at 1352 * 1353 * http://www.apache.org/licenses/LICENSE-2.0 1354 * 1355 * Unless required by applicable law or agreed to in writing, software 1356 * distributed under the License is distributed on an "AS IS" BASIS, 1357 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1358 * See the License for the specific language governing permissions and 1359 * limitations under the License. 1360 */function At(t){var e="installations";t.INTERNAL.registerComponent(new s["Component"](e,(function(t){var e=t.getProvider("app").getImmediate(),n=Ot(e),r=t.getProvider("platform-logger"),i={appConfig:n,platformLoggerProvider:r},o={app:e,getId:function(){return bt(i)},getToken:function(t){return wt(i,t)},delete:function(){return Ct(i)},onIdChange:function(t){return St(i,t)}};return o}
1360),"PUBLIC")),t.registerVersion(h,l)}At(o.a)},"7dd0":function(t,e,n){"use strict";var r=n("23e7"),i=n("c65b"),o=n("c430"),s=n("5e77"),a=n("1626"),u=n("9ed3"),c=n("e163"),h=n("d2bb"),l=n("d44e"),f=n("9112"),p=n("cb2d"),d=n("b622"),v=n("3f8c"),g=n("ae93"),y=s.PROPER,m=s.CONFIGURABLE,_=g.IteratorPrototype,b=g.BUGGY_SAFARI_ITERATORS,w=d("iterator"),E="keys",I="values",T="entries",C=function(){return this};t.exports=function(t,e,n,s,d,g,S){u(n,e,s);var O,N,A,k=function(t){if(t===d&&L)return L;if(!b&&t in x)return x[t];switch(t){case E:return function(){return new n(this,t)};case I:return function(){return new n(this,t)};case T:return function(){return new n(this,t)}}return function(){return new n(this)}},R=e+" Iterator",P=!1,x=t.prototype,D=x[w]||x["@@iterator"]||d&&x[d],L=!b&&D||k(d),j="Array"==e&&x.entries||D;if(j&&(O=c(j.call(new t)),O!==Object.prototype&&O.next&&(o||c(O)===_||(h?h(O,_):a(O[w])||p(O,w,C)),l(O,R,!0,!0),o&&(v[R]=C))),y&&d==I&&D&&D.name!==I&&(!o&&m?f(x,"name",I):(P=!0,L=function(){return i(D,this)})),d)if(N={values:k(I),keys:g?L:k(E),entries:k(T)},S)for(A in N)(b||P||!(A in x))&&p(x,A,N[A]);else r({target:e,proto:!0,forced:b||P},N);return o&&!S||x[w]===L||p(x,w,L,{name:d}),v[e]=L,N}},"7f9a":function(t,e,n){var r=n("da84"),i=n("1626"),o=n("8925"),s=r.WeakMap;t.exports=i(s)&&/native code/.test(o(s))},8071:function(t,e,n){"use strict";n.r(e);n("7d28");var r,i,o=n("4be4"),s=n("cd51"),a=n("9ab4"),u=n("9dbb"),c=n("c23d"),h=n.n(c),l=(r={},r["missing-app-config-values"]='Missing App configuration value: "{$valueName}"',r["only-available-in-window"]="This method is available in a Window context.",r["only-available-in-sw"]="This method is available in a service worker context.",r["permission-default"]="The notification permission was not granted and dismissed instead.",r["permission-blocked"]="The notification permission was not granted and blocked instead.",r["unsupported-browser"]="This browser doesn't support the API's required to use the firebase SDK.",r["failed-service-worker-registration"]="We are unable to register the default service worker. {$browserErrorMessage}",r["token-subscribe-failed"]="A problem occurred while subscribing the user to FCM: {$errorInfo}",r["token-subscribe-no-token"]="FCM returned no token when subscribing the user to push.",r["token-unsubscribe-failed"]="A problem occurred while unsubscribing the user from FCM: {$errorInfo}",r["token-update-failed"]="A problem occurred while updating the user from FCM: {$errorInfo}",r["token-update-no-token"]="FCM returned no token when updating the user to push.",r["use-sw-after-get-token"]="The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.",r["invalid-sw-registration"]="The input to useServiceWorker() must be a ServiceWorkerRegistration.",r["invalid-bg-handler"]="The input to setBackgroundMessageHandler() must be a function.",r["invalid-vapid-key"]="The public VAPID key must be a string.",r["use-vapid-key-after-get-token"]="The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used.",r),f=new s["ErrorFactory"]("messaging","Messaging",l),p="/firebase-messaging-sw.js",d="/firebase-cloud-messaging-push-scope",v="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",g="https://fcmregistrations.googleapis.com/v1",y="FCM_MSG",m="google.c.a.c_id",_="google.c.a.c_l",b="google.c.a.ts",w="google.c.a.e",E="FirebaseMessaging: "; 1361/** 1362 * @license 1363 * Copyright 2017 Google LLC 1364 * 1365 * Licensed under the Apache License, Version 2.0 (the "License"); 1366 * you may not use this file except in compliance with the License. 1367 * You may obtain a copy of the License at 1368 * 1369 * http://www.apache.org/licenses/LICENSE-2.0 1370 * 1371 * Unless required by applicable law or agreed to in writing, software 1372 * distributed under the License is distributed on an "AS IS" BASIS, 1373 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1374 * See the License for the specific language governing permissions and 1375 * limitations under the License. 1376 */ 1377function I(t){var e=new Uint8Array(t),n=btoa(String.fromCharCode.apply(String,Object(a["__spread"])(e)));return n.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function T(t){for(var e="=".repeat((4-t.length%4)%4),n=(t+e).replace(/\-/g,"+").replace(/_/g,"/"),r=atob(n),i=new Uint8Array(r.length),o=0;o<r.length;++o)i[o]=r.charCodeAt(o);return i} 1378/** 1379 * @license 1380 * Copyright 2019 Google LLC 1381 * 1382 * Licensed under the Apache License, Version 2.0 (the "License");
1383 * you may not use this file except in compliance with the License. 1384 * You may obtain a copy of the License at 1385 * 1386 * http://www.apache.org/licenses/LICENSE-2.0 1387 * 1388 * Unless required by applicable law or agreed to in writing, software 1389 * distributed under the License is distributed on an "AS IS" BASIS, 1390 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1391 * See the License for the specific language governing permissions and 1392 * limitations under the License. 1393 */(function(t){t["PUSH_RECEIVED"]="push-received",t["NOTIFICATION_CLICKED"]="notification-clicked"})(i||(i={}));var C="fcm_token_details_db",S=5,O="fcm_token_object_Store";function N(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var e,n,r,i,o=this;return Object(a["__generator"])(this,(function(s){switch(s.label){case 0:return"databases"in indexedDB?[4,indexedDB.databases()]:[3,2];case 1:if(e=s.sent(),n=e.map((function(t){return t.name})),!n.includes(C))return[2,null];s.label=2;case 2:return r=null,[4,Object(u["openDb"])(C,S,(function(e){return Object(a["__awaiter"])(o,void 0,void 0,(function(){var n,i,o,s;return Object(a["__generator"])(this,(function(a){switch(a.label){case 0:return e.oldVersion<2?[2]:e.objectStoreNames.contains(O)?(n=e.transaction.objectStore(O),[4,n.index("fcmSenderId").get(t)]):[2];case 1:return i=a.sent(),[4,n.clear()];case 2:if(a.sent(),!i)return[2];if(2===e.oldVersion){if(o=i,!o.auth||!o.p256dh||!o.endpoint)return[2];r={token:o.fcmToken,createTime:null!==(s=o.createTime)&&void 0!==s?s:Date.now(),subscriptionOptions:{auth:o.auth,p256dh:o.p256dh,endpoint:o.endpoint,swScope:o.swScope,vapidKey:"string"===typeof o.vapidKey?o.vapidKey:I(o.vapidKey)}}}else(3===e.oldVersion||4===e.oldVersion)&&(o=i,r={token:o.fcmToken,createTime:o.createTime,subscriptionOptions:{auth:I(o.auth),p256dh:I(o.p256dh),endpoint:o.endpoint,swScope:o.swScope,vapidKey:I(o.vapidKey)}});return[2]}}))}))}))];case 3:return i=s.sent(),i.close(),[4,Object(u["deleteDb"])(C)];case 4:return s.sent(),[4,Object(u["deleteDb"])("fcm_vapid_details_db")];case 5:return s.sent(),[4,Object(u["deleteDb"])("undefined")];case 6:return s.sent(),[2,A(r)?r:null]}}))}))}function A(t){if(!t||!t.subscriptionOptions)return!1;var e=t.subscriptionOptions;return"number"===typeof t.createTime&&t.createTime>0&&"string"===typeof t.token&&t.token.length>0&&"string"===typeof e.auth&&e.auth.length>0&&"string"===typeof e.p256dh&&e.p256dh.length>0&&"string"===typeof e.endpoint&&e.endpoint.length>0&&"string"===typeof e.swScope&&e.swScope.length>0&&"string"===typeof e.vapidKey&&e.vapidKey.length>0} 1394/** 1395 * @license 1396 * Copyright 2019 Google LLC 1397 * 1398 * Licensed under the Apache License, Version 2.0 (the "License"); 1399 * you may not use this file except in compliance with the License. 1400 * You may obtain a copy of the License at 1401 * 1402 * http://www.apache.org/licenses/LICENSE-2.0 1403 * 1404 * Unless required by applicable law or agreed to in writing, software 1405 * distributed under the License is distributed on an "AS IS" BASIS, 1406 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1407 * See the License for the specific language governing permissions and 1408 * limitations under the License. 1409 */var k="firebase-messaging-database",R=1,P="firebase-messaging-store",x=null;function D(){return x||(x=Object(u["openDb"])(k,R,(function(t){switch(t.oldVersion){case 0:t.createObjectStore(P)}}))),x}function L(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var e,n,r,i;return Object(a["__generator"])(this,(function(o){switch(o.label){case 0:return e=F(t),[4,D()];case 1:return n=o.sent(),[4,n.transaction(P).objectStore(P).get(e)];case 2:return r=o.sent(),r?[2,r]:[3,3];case 3:return[4,N(t.appConfig.senderId)];case 4:return i=o.sent(),i?[4,j(t,i)]:[3,6];case 5:return o.sent(),[2,i];case 6:return[2]}}
1409))}))}function j(t,e){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n,r,i;return Object(a["__generator"])(this,(function(o){switch(o.label){case 0:return n=F(t),[4,D()];case 1:return r=o.sent(),i=r.transaction(P,"readwrite"),[4,i.objectStore(P).put(e,n)];case 2:return o.sent(),[4,i.complete];case 3:return o.sent(),[2,e]}}))}))}function M(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var e,n,r;return Object(a["__generator"])(this,(function(i){switch(i.label){case 0:return e=F(t),[4,D()];case 1:return n=i.sent(),r=n.transaction(P,"readwrite"),[4,r.objectStore(P).delete(e)];case 2:return i.sent(),[4,r.complete];case 3:return i.sent(),[2]}}))}))}function F(t){var e=t.appConfig;return e.appId} 1410/** 1411 * @license 1412 * Copyright 2019 Google LLC 1413 * 1414 * Licensed under the Apache License, Version 2.0 (the "License"); 1415 * you may not use this file except in compliance with the License. 1416 * You may obtain a copy of the License at 1417 * 1418 * http://www.apache.org/licenses/LICENSE-2.0 1419 * 1420 * Unless required by applicable law or agreed to in writing, software 1421 * distributed under the License is distributed on an "AS IS" BASIS, 1422 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1423 * See the License for the specific language governing permissions and 1424 * limitations under the License. 1425 */function U(t,e){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n,r,i,o,s,u,c;return Object(a["__generator"])(this,(function(a){switch(a.label){case 0:return[4,W(t)];case 1:n=a.sent(),r=G(e),i={method:"POST",headers:n,body:JSON.stringify(r)},a.label=2;case 2:return a.trys.push([2,5,,6]),[4,fetch(B(t.appConfig),i)];case 3:return s=a.sent(),[4,s.json()];case 4:return o=a.sent(),[3,6];case 5:throw u=a.sent(),f.create("token-subscribe-failed",{errorInfo:u});case 6:if(o.error)throw c=o.error.message,f.create("token-subscribe-failed",{errorInfo:c});if(!o.token)throw f.create("token-subscribe-no-token");return[2,o.token]}}))}))}function V(t,e){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n,r,i,o,s,u,c;return Object(a["__generator"])(this,(function(a){switch(a.label){case 0:return[4,W(t)];case 1:n=a.sent(),r=G(e.subscriptionOptions),i={method:"PATCH",headers:n,body:JSON.stringify(r)},a.label=2;case 2:return a.trys.push([2,5,,6]),[4,fetch(B(t.appConfig)+"/"+e.token,i)];case 3:return s=a.sent(),[4,s.json()];case 4:return o=a.sent(),[3,6];case 5:throw u=a.sent(),f.create("token-update-failed",{errorInfo:u});case 6:if(o.error)throw c=o.error.message,f.create("token-update-failed",{errorInfo:c});if(!o.token)throw f.create("token-update-no-token");return[2,o.token]}}))}))}function q(t,e){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n,r,i,o,s,u;return Object(a["__generator"])(this,(function(a){switch(a.label){case 0:return[4,W(t)];case 1:n=a.sent(),r={method:"DELETE",headers:n},a.label=2;case 2:return a.trys.push([2,5,,6]),[4,fetch(B(t.appConfig)+"/"+e,r)];case 3:return i=a.sent(),[4,i.json()];case 4:if(o=a.sent(),o.error)throw s=o.error.message,f.create("token-unsubscribe-failed",{errorInfo:s});return[3,6];case 5:throw u=a.sent(),f.create("token-unsubscribe-failed",{errorInfo:u});case 6:return[2]}}
1425))}))}function B(t){var e=t.projectId;return g+"/projects/"+e+"/registrations"}function W(t){var e=t.appConfig,n=t.installations;return Object(a["__awaiter"])(this,void 0,void 0,(function(){var t;return Object(a["__generator"])(this,(function(r){switch(r.label){case 0:return[4,n.getToken()];case 1:return t=r.sent(),[2,new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":"FIS "+t})]}}))}))}function G(t){var e=t.p256dh,n=t.auth,r=t.endpoint,i=t.vapidKey,o={web:{endpoint:r,auth:n,p256dh:e}};return i!==v&&(o.web.applicationPubKey=i),o} 1426/** 1427 * @license 1428 * Copyright 2019 Google LLC 1429 * 1430 * Licensed under the Apache License, Version 2.0 (the "License"); 1431 * you may not use this file except in compliance with the License. 1432 * You may obtain a copy of the License at 1433 * 1434 * http://www.apache.org/licenses/LICENSE-2.0 1435 * 1436 * Unless required by applicable law or agreed to in writing, software 1437 * distributed under the License is distributed on an "AS IS" BASIS, 1438 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1439 * See the License for the specific language governing permissions and 1440 * limitations under the License. 1441 */var H=6048e5;function K(t,e,n){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var r,i,o,s;return Object(a["__generator"])(this,(function(a){switch(a.label){case 0:if("granted"!==Notification.permission)throw f.create("permission-blocked");return[4,X(e,n)];case 1:return r=a.sent(),[4,L(t)];case 2:return i=a.sent(),o={vapidKey:n,swScope:e.scope,endpoint:r.endpoint,auth:I(r.getKey("auth")),p256dh:I(r.getKey("p256dh"))},i?[3,3]:[2,Y(t,o)];case 3:if($(i.subscriptionOptions,o))return[3,8];a.label=4;case 4:return a.trys.push([4,6,,7]),[4,q(t,i.token)];case 5:return a.sent(),[3,7];case 6:return s=a.sent(),console.warn(s),[3,7];case 7:return[2,Y(t,o)];case 8:return Date.now()>=i.createTime+H?[2,Q({token:i.token,createTime:Date.now(),subscriptionOptions:o},t,e)]:[2,i.token];case 9:return[2]}}
1441))}))}function z(t,e){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n,r;return Object(a["__generator"])(this,(function(i){switch(i.label){case 0:return[4,L(t)];case 1:return n=i.sent(),n?[4,q(t,n.token)]:[3,4];case 2:return i.sent(),[4,M(t)];case 3:i.sent(),i.label=4;case 4:return[4,e.pushManager.getSubscription()];case 5:return r=i.sent(),r?[2,r.unsubscribe()]:[2,!0]}}))}))}function Q(t,e,n){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var r,i,o;return Object(a["__generator"])(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,5]),[4,V(e,t)];case 1:return r=s.sent(),i=Object(a["__assign"])(Object(a["__assign"])({},t),{token:r,createTime:Date.now()}),[4,j(e,i)];case 2:return s.sent(),[2,r];case 3:return o=s.sent(),[4,z(e,n)];case 4:throw s.sent(),o;case 5:return[2]}}))}))}function Y(t,e){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n,r;return Object(a["__generator"])(this,(function(i){switch(i.label){case 0:return[4,U(t,e)];case 1:return n=i.sent(),r={token:n,createTime:Date.now(),subscriptionOptions:e},[4,j(t,r)];case 2:return i.sent(),[2,r.token]}}))}))}function X(t,e){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n;return Object(a["__generator"])(this,(function(r){switch(r.label){case 0:return[4,t.pushManager.getSubscription()];case 1:return n=r.sent(),n?[2,n]:[2,t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:T(e)})]}}))}))}function $(t,e){var n=e.vapidKey===t.vapidKey,r=e.endpoint===t.endpoint,i=e.auth===t.auth,o=e.p256dh===t.p256dh;return n&&r&&i&&o} 1442/** 1443 * @license 1444 * Copyright 2020 Google LLC 1445 * 1446 * Licensed under the Apache License, Version 2.0 (the "License"); 1447 * you may not use this file except in compliance with the License. 1448 * You may obtain a copy of the License at 1449 * 1450 * http://www.apache.org/licenses/LICENSE-2.0 1451 * 1452 * Unless required by applicable law or agreed to in writing, software 1453 * distributed under the License is distributed on an "AS IS" BASIS, 1454 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1455 * See the License for the specific language governing permissions and 1456 * limitations under the License. 1457 */function J(t){var e={from:t.from,collapseKey:t.collapse_key};return Z(e,t),tt(e,t),et(e,t),e}function Z(t,e){if(e.notification){t.notification={};var n=e.notification.title;n&&(t.notification.title=n);var r=e.notification.body;r&&(t.notification.body=r);var i=e.notification.image;i&&(t.notification.image=i)}}function tt(t,e){e.data&&(t.data=e.data)}function et(t,e){if(e.fcmOptions){t.fcmOptions={};var n=e.fcmOptions.link;n&&(t.fcmOptions.link=n);var r=e.fcmOptions.analytics_label;r&&(t.fcmOptions.analyticsLabel=r)}} 1458/** 1459 * @license 1460 * Copyright 2019 Google LLC 1461 * 1462 * Licensed under the Apache License, Version 2.0 (the "License"); 1463 * you may not use this file except in compliance with the License. 1464 * You may obtain a copy of the License at 1465 * 1466 * http://www.apache.org/licenses/LICENSE-2.0 1467 * 1468 * Unless required by applicable law or agreed to in writing, software 1469 * distributed under the License is distributed on an "AS IS" BASIS, 1470 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1471 * See the License for the specific language governing permissions and 1472 * limitations under the License. 1473 */function nt(t){return"object"===typeof t&&!!t&&m in t} 1474/** 1475 * @license 1476 * Copyright 2019 Google LLC 1477 * 1478 * Licensed under the Apache License, Version 2.0 (the "License"); 1479 * you may not use this file except in compliance with the License. 1480 * You may obtain a copy of the License at 1481 * 1482 * http://www.apache.org/licenses/LICENSE-2.0 1483 * 1484 * Unless required by applicable law or agreed to in writing, software 1485 * distributed under the License is distributed on an "AS IS" BASIS, 1486 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1487 * See the License for the specific language governing permissions and 1488 * limitations under the License. 1489 */function rt(t){return new Promise((function(e){setTimeout(e,t)}))} 1490/** 1491 * @license 1492 * Copyright 2017 Google LLC 1493 * 1494 * Licensed under the Apache License, Version 2.0 (the "License");
1495 * you may not use this file except in compliance with the License. 1496 * You may obtain a copy of the License at 1497 * 1498 * http://www.apache.org/licenses/LICENSE-2.0 1499 * 1500 * Unless required by applicable law or agreed to in writing, software 1501 * distributed under the License is distributed on an "AS IS" BASIS, 1502 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1503 * See the License for the specific language governing permissions and 1504 * limitations under the License. 1505 */var it=function(){function t(t){var e=this;this.firebaseDependencies=t,this.isOnBackgroundMessageUsed=null,this.vapidKey=null,this.bgMessageHandler=null,self.addEventListener("push",(function(t){t.waitUntil(e.onPush(t))})),self.addEventListener("pushsubscriptionchange",(function(t){t.waitUntil(e.onSubChange(t))})),self.addEventListener("notificationclick",(function(t){t.waitUntil(e.onNotificationClick(t))}))}return Object.defineProperty(t.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),t.prototype.setBackgroundMessageHandler=function(t){if(this.isOnBackgroundMessageUsed=!1,!t||"function"!==typeof t)throw f.create("invalid-bg-handler");this.bgMessageHandler=t},t.prototype.onBackgroundMessage=function(t){var e=this;return this.isOnBackgroundMessageUsed=!0,this.bgMessageHandler=t,function(){e.bgMessageHandler=null}},t.prototype.getToken=function(){var t,e;return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n;return Object(a["__generator"])(this,(function(r){switch(r.label){case 0:return this.vapidKey?[3,2]:[4,L(this.firebaseDependencies)];case 1:n=r.sent(),this.vapidKey=null!==(e=null===(t=null===n||void 0===n?void 0:n.subscriptionOptions)||void 0===t?void 0:t.vapidKey)&&void 0!==e?e:v,r.label=2;case 2:return[2,K(this.firebaseDependencies,self.registration,this.vapidKey)]}}))}))},t.prototype.deleteToken=function(){return z(this.firebaseDependencies,self.registration)},t.prototype.requestPermission=function(){throw f.create("only-available-in-window")},t.prototype.usePublicVapidKey=function(t){if(null!==this.vapidKey)throw f.create("use-vapid-key-after-get-token");if("string"!==typeof t||0===t.length)throw f.create("invalid-vapid-key");this.vapidKey=t},t.prototype.useServiceWorker=function(){throw f.create("only-available-in-window")},t.prototype.onMessage=function(){throw f.create("only-available-in-window")},t.prototype.onTokenRefresh=function(){throw f.create("only-available-in-window")},t.prototype.onPush=function(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var e,n,r,i;return Object(a["__generator"])(this,(function(o){switch(o.label){case 0:return e=st(t),e?[4,ht()]:(console.debug(E+"failed to get parsed MessagePayload from the PushEvent. Skip handling the push."),[2]);case 1:return n=o.sent(),ut(n)?[2,ct(n,e)]:(r=!1,e.notification?[4,lt(ot(e))]:[3,3]);case 2:o.sent(),r=!0,o.label=3;case 3:return!0===r&&!1===this.isOnBackgroundMessageUsed||this.bgMessageHandler&&(i=J(e),"function"===typeof this.bgMessageHandler?this.bgMessageHandler(i):this.bgMessageHandler.next(i)),[2]}}))}))},t.prototype.onSubChange=function(t){var e,n;return Object(a["__awaiter"])(this,void 0,void 0,(function(){var r,i;return Object(a["__generator"])(this,(function(o){switch(o.label){case 0:return r=t.newSubscription,r?[3,2]:[4,z(this.firebaseDependencies,self.registration)];case 1:return o.sent(),[2];case 2:return[4,L(this.firebaseDependencies)];case 3:return i=o.sent(),[4,z(this.firebaseDependencies,self.registration)];case 4:return o.sent(),[4,K(this.firebaseDependencies,self.registration,null!==(n=null===(e=null===i||void 0===i?void 0:i.subscriptionOptions)||void 0===e?void 0:e.vapidKey)&&void 0!==n?n:v)];case 5:return o.sent(),[2]}}))}))},t.prototype.onNotificationClick=function(t){var e,n;return Object(a["__awaiter"])(this,void 0,void 0,(function(){var r,o,s,u,c;return Object(a["__generator"])(this,(function(a){switch(a.label){case 0:return r=null===(n=null===(e=t.notification)||void 0===e?void 0:e.data)||void 0===n?void 0:n[y],r?t.action?[2]:(t.stopImmediatePropagation(),t.notification.close(),o=ft(r),o?(s=new URL(o,self.location.href),u=new URL(self.location.origin),s.host!==u.host?[2]:[4,at(s)]):[2]):[2];case 1:return c=a.sent(),c?[3,4]:[4,self.clients.openWindow(o)];case 2:return c=a.sent(),[4,rt(3e3)];case 3:return a.sent(),[3,6];case 4:return[4,c.focus()];case 5:c=a.sent(),a.label=6;case 6:return c?(r.messageType=i.NOTIFICATION_CLICKED,r.isFirebaseMessaging=!0,[2,c.postMessage(r)]):[2]}}))}))},t}();function ot(t){var e,n=Object(a["__assign"])({},t.notification);return n.data=(e={},e[y]=t,e),n}function st(t){var e=t.data;if(!e)return null;try{return e.json()}catch(n){return null}}function at(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var e,n,r,i,o,s,u;return Object(a["__generator"])(this,(function(c){switch(c.label){case 0:return[4,ht()];case 1:e=c.sent();try{for(n=Object(a["__values"])(e),r=n.next();!r.done;r=n.next())if(i=r.value,o=new URL(i.url,self.location.href),t.host===o.host)return[2,i]}catch(h){s={error:h}}finally{try{r&&!r.done&&(u=n.return)&&u.call(n)}finally{if(s)throw s.error}}return[2,null]}}))}))}function ut(t){return t.some((function(t){return"visible"===t.visibilityState&&!t.url.
1505startsWith("chrome-extension://")}))}function ct(t,e){var n,r;e.isFirebaseMessaging=!0,e.messageType=i.PUSH_RECEIVED;try{for(var o=Object(a["__values"])(t),s=o.next();!s.done;s=o.next()){var u=s.value;u.postMessage(e)}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}function ht(){return self.clients.matchAll({type:"window",includeUncontrolled:!0})}function lt(t){var e,n=t.actions,r=Notification.maxActions;return n&&r&&n.length>r&&console.warn("This browser only supports "+r+" actions. The remaining actions will not be displayed."),self.registration.showNotification(null!==(e=t.title)&&void 0!==e?e:"",t)}function ft(t){var e,n,r,i=null!==(n=null===(e=t.fcmOptions)||void 0===e?void 0:e.link)&&void 0!==n?n:null===(r=t.notification)||void 0===r?void 0:r.click_action;return i||(nt(t.data)?self.location.origin:null)} 1506/** 1507 * @license 1508 * Copyright 2017 Google LLC 1509 * 1510 * Licensed under the Apache License, Version 2.0 (the "License"); 1511 * you may not use this file except in compliance with the License. 1512 * You may obtain a copy of the License at 1513 * 1514 * http://www.apache.org/licenses/LICENSE-2.0 1515 * 1516 * Unless required by applicable law or agreed to in writing, software 1517 * distributed under the License is distributed on an "AS IS" BASIS, 1518 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1519 * See the License for the specific language governing permissions and 1520 * limitations under the License. 1521 */var pt=function(){function t(t){var e=this;this.firebaseDependencies=t,this.vapidKey=null,this.onMessageCallback=null,navigator.serviceWorker.addEventListener("message",(function(t){return e.messageEventListener(t)}))}return Object.defineProperty(t.prototype,"app",{get:function(){return this.firebaseDependencies.app},enumerable:!1,configurable:!0}),t.prototype.messageEventListener=function(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var e,n;return Object(a["__generator"])(this,(function(r){switch(r.label){case 0:return e=t.data,e.isFirebaseMessaging?(this.onMessageCallback&&e.messageType===i.PUSH_RECEIVED&&("function"===typeof this.onMessageCallback?this.onMessageCallback(vt(Object.assign({},e))):this.onMessageCallback.next(Object.assign({},e))),n=e.data,nt(n)&&"1"===n[w]?[4,this.logEvent(e.messageType,n)]:[3,2]):[2];case 1:r.sent(),r.label=2;case 2:return[2]}}
1521))}))},t.prototype.getVapidKey=function(){return this.vapidKey},t.prototype.getSwReg=function(){return this.swRegistration},t.prototype.getToken=function(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){return Object(a["__generator"])(this,(function(e){switch(e.label){case 0:return"default"!==Notification.permission?[3,2]:[4,Notification.requestPermission()];case 1:e.sent(),e.label=2;case 2:if("granted"!==Notification.permission)throw f.create("permission-blocked");return[4,this.updateVapidKey(null===t||void 0===t?void 0:t.vapidKey)];case 3:return e.sent(),[4,this.updateSwReg(null===t||void 0===t?void 0:t.serviceWorkerRegistration)];case 4:return e.sent(),[2,K(this.firebaseDependencies,this.swRegistration,this.vapidKey)]}}))}))},t.prototype.updateVapidKey=function(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){return Object(a["__generator"])(this,(function(e){return t?this.vapidKey=t:this.vapidKey||(this.vapidKey=v),[2]}))}))},t.prototype.updateSwReg=function(t){return Object(a["__awaiter"])(this,void 0,void 0,(function(){return Object(a["__generator"])(this,(function(e){switch(e.label){case 0:return t||this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:e.sent(),e.label=2;case 2:if(!t&&this.swRegistration)return[2];if(!(t instanceof ServiceWorkerRegistration))throw f.create("invalid-sw-registration");return this.swRegistration=t,[2]}}))}))},t.prototype.registerDefaultSw=function(){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var t,e;return Object(a["__generator"])(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),t=this,[4,navigator.serviceWorker.register(p,{scope:d})];case 1:return t.swRegistration=n.sent(),this.swRegistration.update().catch((function(){})),[3,3];case 2:throw e=n.sent(),f.create("failed-service-worker-registration",{browserErrorMessage:e.message});case 3:return[2]}}
1521))}))},t.prototype.deleteToken=function(){return Object(a["__awaiter"])(this,void 0,void 0,(function(){return Object(a["__generator"])(this,(function(t){switch(t.label){case 0:return this.swRegistration?[3,2]:[4,this.registerDefaultSw()];case 1:t.sent(),t.label=2;case 2:return[2,z(this.firebaseDependencies,this.swRegistration)]}}))}))},t.prototype.requestPermission=function(){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var t;return Object(a["__generator"])(this,(function(e){switch(e.label){case 0:return"granted"===Notification.permission?[2]:[4,Notification.requestPermission()];case 1:if(t=e.sent(),"granted"===t)return[2];throw"denied"===t?f.create("permission-blocked"):f.create("permission-default")}}))}))},t.prototype.usePublicVapidKey=function(t){if(null!==this.vapidKey)throw f.create("use-vapid-key-after-get-token");if("string"!==typeof t||0===t.length)throw f.create("invalid-vapid-key");this.vapidKey=t},t.prototype.useServiceWorker=function(t){if(!(t instanceof ServiceWorkerRegistration))throw f.create("invalid-sw-registration");if(this.swRegistration)throw f.create("use-sw-after-get-token");this.swRegistration=t},t.prototype.onMessage=function(t){var e=this;return this.onMessageCallback=t,function(){e.onMessageCallback=null}},t.prototype.setBackgroundMessageHandler=function(){throw f.create("only-available-in-sw")},t.prototype.onBackgroundMessage=function(){throw f.create("only-available-in-sw")},t.prototype.onTokenRefresh=function(){return function(){}},t.prototype.logEvent=function(t,e){return Object(a["__awaiter"])(this,void 0,void 0,(function(){var n,r;return Object(a["__generator"])(this,(function(i){switch(i.label){case 0:return n=dt(t),[4,this.firebaseDependencies.analyticsProvider.get()];case 1:return r=i.sent(),r.logEvent(n,{message_id:e[m],message_name:e[_],message_time:e[b],message_device_time:Math.floor(Date.now()/1e3)}),[2]}}))}))},t}();function dt(t){switch(t){case i.NOTIFICATION_CLICKED:return"notification_open";case i.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}function vt(t){return delete t.messageType,delete t.isFirebaseMessaging,t} 1522/** 1523 * @license 1524 * Copyright 2019 Google LLC 1525 * 1526 * Licensed under the Apache License, Version 2.0 (the "License"); 1527 * you may not use this file except in compliance with the License. 1528 * You may obtain a copy of the License at 1529 * 1530 * http://www.apache.org/licenses/LICENSE-2.0 1531 * 1532 * Unless required by applicable law or agreed to in writing, software 1533 * distributed under the License is distributed on an "AS IS" BASIS, 1534 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1535 * See the License for the specific language governing permissions and 1536 * limitations under the License. 1537 */function gt(t){var e,n;if(!t||!t.options)throw yt("App Configuration Object");if(!t.name)throw yt("App Name");var r=["projectId","apiKey","appId","messagingSenderId"],i=t.options;try{for(var o=Object(a["__values"])(r),s=o.next();!s.done;s=o.next()){var u=s.value;if(!i[u])throw yt(u)}}catch(c){e={error:c}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return{appName:t.name,projectId:i.projectId,apiKey:i.apiKey,appId:i.appId,senderId:i.messagingSenderId}}function yt(t){return f.create("missing-app-config-values",{valueName:t})} 1538/** 1539 * @license 1540 * Copyright 2017 Google LLC 1541 * 1542 * Licensed under the Apache License, Version 2.0 (the "License"); 1543 * you may not use this file except in compliance with the License. 1544 * You may obtain a copy of the License at 1545 * 1546 * http://www.apache.org/licenses/LICENSE-2.0 1547 * 1548 * Unless required by applicable law or agreed to in writing, software 1549 * distributed under the License is distributed on an "AS IS" BASIS, 1550 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1551 * See the License for the specific language governing permissions and 1552 * limitations under the License. 1553 */var mt="messaging";function _t(t){var e=t.getProvider("app").getImmediate(),n=gt(e),r=t.getProvider("installations").getImmediate(),i=t.getProvider("analytics-internal"),o={app:e,appConfig:n,installations:r,analyticsProvider:i};if(!wt())throw f.create("unsupported-browser");return self&&"ServiceWorkerGlobalScope"in self?new it(o):new pt(o)}var bt={isSupported:wt};function wt(){return self&&"ServiceWorkerGlobalScope"in self?It():Et()}function Et(){return"indexedDB"in window&&null!==indexedDB&&navigator.cookieEnabled&&"serviceWorker"
1553in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}function It(){return"indexedDB"in self&&null!==indexedDB&&"PushManager"in self&&"Notification"in self&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}h.a.INTERNAL.registerComponent(new o["Component"](mt,_t,"PUBLIC").setServiceProps(bt))},"825a":function(t,e,n){var r=n("861d"),i=String,o=TypeError;t.exports=function(t){if(r(t))return t;throw o(i(t)+" is not an object")}},"83ab":function(t,e,n){var r=n("d039");t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"861d":function(t,e,n){var r=n("1626");t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},8925:function(t,e,n){var r=n("e330"),i=n("1626"),o=n("c6cd"),s=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(t){return s(t)}),t.exports=o.inspectSource},"8aa5":function(t,e,n){"use strict";var r=n("c23d");function i(t){return t&&"object"===typeof t&&"default"in t?t:{default:t}}n("2ce1"),n("3523"),n("e89a"),n("001a"),n("8071"),n("2e66"),n("6d09"),n("dcaa"),n("3b59");var o=i(r),s="firebase",a="7.23.0"; 1554/** 1555 * @license 1556 * Copyright 2018 Google LLC 1557 * 1558 * Licensed under the Apache License, Version 2.0 (the "License"); 1559 * you may not use this file except in compliance with the License. 1560 * You may obtain a copy of the License at 1561 * 1562 * http://www.apache.org/licenses/LICENSE-2.0 1563 * 1564 * Unless required by applicable law or agreed to in writing, software 1565 * distributed under the License is distributed on an "AS IS" BASIS, 1566 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1567 * See the License for the specific language governing permissions and 1568 * limitations under the License. 1569 */ 1570o["default"].registerVersion(s,a,"app");var u="firebase",c="7.23.0"; 1571/** 1572 * @license 1573 * Copyright 2017 Google LLC 1574 * 1575 * Licensed under the Apache License, Version 2.0 (the "License"); 1576 * you may not use this file except in compliance with the License. 1577 * You may obtain a copy of the License at 1578 * 1579 * http://www.apache.org/licenses/LICENSE-2.0 1580 * 1581 * Unless required by applicable law or agreed to in writing, software 1582 * distributed under the License is distributed on an "AS IS" BASIS, 1583 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1584 * See the License for the specific language governing permissions and 1585 * limitations under the License. 1586 */ 1587console.warn("\nIt looks like you're using the development build of the Firebase JS SDK.\nWhen deploying Firebase apps to production, it is advisable to only import\nthe individual SDK components you intend to use.\n\nFor the module builds, these are available in the following manner\n(replace <PACKAGE> with the name of a component - i.e. auth, database, etc):\n\nCommonJS Modules:\nconst firebase = require('firebase/app');\nrequire('firebase/<PACKAGE>');\n\nES Modules:\nimport firebase from 'firebase/app';\nimport 'firebase/<PACKAGE>';\n\nTypescript:\nimport * as firebase from 'firebase/app';\nimport 'firebase/<PACKAGE>';\n"),o["default"].registerVersion(u,c),t.exports=o["default"]},"90e3":function(t,e,n){var r=n("e330"),i=0,o=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++i+o,36)}},9112:function(t,e,n){var r=n("83ab"),i=n("9bf2"),o=n("5c6c");t.exports=r?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},"94ca":function(t,e,n){var r=n("d039"),i=n("1626"),o=/#|\.prototype\./,s=function(t,e){var n=u[a(t)];return n==h||n!=c&&(i(e)?r(e):!!e)},a=s.normalize=function(t){return String(t).replace(o,".").toLowerCase()},u=s.data={},c=s.NATIVE="N",h=s.POLYFILL="P";t.exports=s},"9a1f":function(t,e,n){var r=n("c65b"),i=n("59ed"),o=n("825a"),s=n("0d51"),a=n("35a1"),u=TypeError;t.exports=function(t,e){var n=arguments.length<2?a(t):e;if(i(n))return o(r(n,t));throw u(s(t)+" is not iterable")}},"9ab4":function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o}
1587)),n.d(e,"__rest",(function(){return s})),n.d(e,"__decorate",(function(){return a})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return h})),n.d(e,"__generator",(function(){return l})),n.d(e,"__createBinding",(function(){return f})),n.d(e,"__exportStar",(function(){return p})),n.d(e,"__values",(function(){return d})),n.d(e,"__read",(function(){return v})),n.d(e,"__spread",(function(){return g})),n.d(e,"__spreadArrays",(function(){return y})),n.d(e,"__await",(function(){return m})),n.d(e,"__asyncGenerator",(function(){return _})),n.d(e,"__asyncDelegator",(function(){return b})),n.d(e,"__asyncValues",(function(){return w})),n.d(e,"__makeTemplateObject",(function(){return E})),n.d(e,"__importStar",(function(){return I})),n.d(e,"__importDefault",(function(){return T})),n.d(e,"__classPrivateFieldGet",(function(){return C})),n.d(e,"__classPrivateFieldSet",(function(){return S})); 1588/*! ***************************************************************************** 1589Copyright (c) Microsoft Corporation. 1590 1591Permission to use, copy, modify, and/or distribute this software for any 1592purpose with or without fee is hereby granted. 1593 1594THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 1595REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 1596AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 1597INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 1598LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 1599OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 1600PERFORMANCE OF THIS SOFTWARE. 1601***************************************************************************** */ 1602var 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])},r(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],e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.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 u(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"===typeof Reflect&&"function"===typeof Reflect.metadata)return Reflect.metadata(t,e)}function h(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function s(t){try{u(r.next(t))}catch(e){o(e)}}function a(t){try{u(r["throw"](t))}catch(e){o(e)}}function u(t){t.done?n(t.value):i(t.value).then(s,a)}u((r=r.apply(t,e||[])).next())}))}function l(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(t){return function(e){return u([t,e])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(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=s.trys,!(i=i.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(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}function f(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function p(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function d(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{while((void 0===e||e-- >0)&&!(r=o.next()).done)s.push(r.value)}catch(a){i={error:a}}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 y(){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 m(t){return this instanceof m?(this.v=t,this):new m(t)}function _(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{u(i[t](e))}catch(n){l(o[0][3],n)}}function u(t){t.value instanceof m?Promise.resolve(t.value.v).then(c,h):l(o[0][2],t)}function c(t){a("next",t)}function h(t){a("throw",t)}function l(t,e){t(e),o.shift(),o.length&&a(o[0][0],o[0][1])}}function b(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:m(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="function"===typeof d?d(t):t[Symbol.iterator](),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,o){e=t[n](e),i(r,o,e.done,e.value)}))}}function i(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)}}function E(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function I(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 T(t){return t&&t.__esModule?t:{default:t}}function C(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function S(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},"9bf2":function(t,e,n){var r=n("83ab"),i=n("0cfb"),o=n("aed9"),s=n("825a"),a=n("a04b"),u=TypeError,c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,l="enumerable",f="configurable",p="writable";e.f=r?o?function(t,e,n){if(s(t),e=a(e),s(n),"function"===typeof t&&"prototype"===e&&"value"in n&&p in n&&!n[p]){var r=h(t,e);
1602r&&r[p]&&(t[e]=n.value,n={configurable:f in n?n[f]:r[f],enumerable:l in n?n[l]:r[l],writable:!1})}return c(t,e,n)}:c:function(t,e,n){if(s(t),e=a(e),s(n),i)try{return c(t,e,n)}catch(r){}if("get"in n||"set"in n)throw u("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},"9dbb":function(t,e,n){(function(t,n){n(e)})(0,(function(t){"use strict";function e(t){return Array.prototype.slice.call(t)}function n(t){return new Promise((function(e,n){t.onsuccess=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function r(t,e,r){var i,o=new Promise((function(o,s){i=t[e].apply(t,r),n(i).then(o,s)}));return o.request=i,o}function i(t,e,n){var i=r(t,e,n);return i.then((function(t){if(t)return new h(t,i.request)}))}function o(t,e,n){n.forEach((function(n){Object.defineProperty(t.prototype,n,{get:function(){return this[e][n]},set:function(t){this[e][n]=t}})}))}function s(t,e,n,i){i.forEach((function(i){i in n.prototype&&(t.prototype[i]=function(){return r(this[e],i,arguments)})}))}function a(t,e,n,r){r.forEach((function(r){r in n.prototype&&(t.prototype[r]=function(){return this[e][r].apply(this[e],arguments)})}))}function u(t,e,n,r){r.forEach((function(r){r in n.prototype&&(t.prototype[r]=function(){return i(this[e],r,arguments)})}))}function c(t){this._index=t}function h(t,e){this._cursor=t,this._request=e}function l(t){this._store=t}function f(t){this._tx=t,this.complete=new Promise((function(e,n){t.oncomplete=function(){e()},t.onerror=function(){n(t.error)},t.onabort=function(){n(t.error)}}))}function p(t,e,n){this._db=t,this.oldVersion=e,this.transaction=new f(n)}function d(t){this._db=t}function v(t,e,n){var i=r(indexedDB,"open",[t,e]),o=i.request;return o&&(o.onupgradeneeded=function(t){n&&n(new p(o.result,t.oldVersion,o.transaction))}),i.then((function(t){return new d(t)}))}function g(t){return r(indexedDB,"deleteDatabase",[t])}o(c,"_index",["name","keyPath","multiEntry","unique"]),s(c,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),u(c,"_index",IDBIndex,["openCursor","o
1602penKeyCursor"]),o(h,"_cursor",["direction","key","primaryKey","value"]),s(h,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach((function(t){t in IDBCursor.prototype&&(h.prototype[t]=function(){var e=this,r=arguments;return Promise.resolve().then((function(){return e._cursor[t].apply(e._cursor,r),n(e._request).then((function(t){if(t)return new h(t,e._request)}))}))})})),l.prototype.createIndex=function(){return new c(this._store.createIndex.apply(this._store,arguments))},l.prototype.index=function(){return new c(this._store.index.apply(this._store,arguments))},o(l,"_store",["name","keyPath","indexNames","autoIncrement"]),s(l,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),u(l,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),a(l,"_store",IDBObjectStore,["deleteIndex"]),f.prototype.objectStore=function(){return new l(this._tx.objectStore.apply(this._tx,arguments))},o(f,"_tx",["objectStoreNames","mode"]),a(f,"_tx",IDBTransaction,["abort"]),p.prototype.createObjectStore=function(){return new l(this._db.createObjectStore.apply(this._db,arguments))},o(p,"_db",["name","version","objectStoreNames"]),a(p,"_db",IDBDatabase,["deleteObjectStore","close"]),d.prototype.transaction=function(){return new f(this._db.transaction.apply(this._db,arguments))},o(d,"_db",["name","version","objectStoreNames"]),a(d,"_db",IDBDatabase,["close"]),["openCursor","o
1602penKeyCursor"].forEach((function(t){[l,c].forEach((function(n){t in n.prototype&&(n.prototype[t.replace("open","iterate")]=function(){var n=e(arguments),r=n[n.length-1],i=this._store||this._index,o=i[t].apply(i,n.slice(0,-1));o.onsuccess=function(){r(o.result)}})}))})),[c,l].forEach((function(t){t.prototype.getAll||(t.prototype.getAll=function(t,e){var n=this,r=[];return new Promise((function(i){n.iterateCursor(t,(function(t){t?(r.push(t.value),void 0===e||r.length!=e?t.continue():i(r)):i(r)}))}))})})),t.openDb=v,t.deleteDb=g,Object.defineProperty(t,"__esModule",{value:!0})}))},"9ed3":function(t,e,n){"use strict";var r=n("ae93").IteratorPrototype,i=n("7c73"),o=n("5c6c"),s=n("d44e"),a=n("3f8c"),u=function(){return this};t.exports=function(t,e,n,c){var h=e+" Iterator";return t.prototype=i(r,{next:o(+!c,n)}),s(t,h,!1,!0),a[h]=u,t}},"9ff4":function(t,e,n){"use strict";(function(t){function r(t,e){const n=Object.create(null),r=t.split(",");for(let i=0;i<r.length;i++)n[r[i]]=!0;return e?t=>!!n[t.toLowerCase()]:t=>!!n[t]}n.d(e,"a",(function(){return T})),n.d(e,"b",(function(){return I})),n.d(e,"c",(function(){return S})),n.d(e,"d",(function(){return C})),n.d(e,"e",(function(){return $})),n.d(e,"f",(function(){return tt})),n.d(e,"g",(function(){return rt})),n.d(e,"h",(function(){return k})),n.d(e,"i",(function(){return st})),n.d(e,"j",(function(){return et})),n.d(e,"k",(function(){return x})),n.d(e,"l",(function(){return Z})),n.d(e,"m",(function(){return nt})),n.d(e,"n",(function(){return D})),n.d(e,"o",(function(){return F})),n.d(e,"p",(function(){return o})),n.d(e,"q",(function(){return v})),n.d(e,"r",(function(){return z})),n.d(e,"s",(function(){return L})),n.d(e,"t",(function(){return A})),n.d(e,"u",(function(){return q})),n.d(e,"v",(function(){return N})),n.d(e,"w",(function(){return B})),n.d(e,"x",(function(){return Q})),n.d(e,"y",(function(){return g})),n.d(e,"z",(function(){return j})),n.d(e,"A",(function(){return a})),n.d(e,"B",(function(){return U})),n.d(e,"C",(function(){return V})),n.d(e,"D",(function(){return m})),n.d(e,"E",(function(){return b})),n.d(e,"F",(function(){return _})),n.d(e,"G",(function(){return r})),n.d(e,"H",(function(){return f})),n.d(e,"I",(function(){return u})),n.d(e,"J",(function(){return R})),n.d(e,"K",(function(){return w})),n.d(e,"L",(function(){return it})),n.d(e,"M",(function(){return H}));const i="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl",o=r(i);const s="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",a=r(s);function u(t){if(D(t)){const e={};for(let n=0;n<t.length;n++){const r=t[n],i=u(U(r)?l(r):r);if(i)for(const t in i)e[t]=i[t]}return e}if(q(t))return t}const c=/;(?![^(]*\))/g,h=/:(.+)/;function l(t){const e={};return t.split(c).forEach(t=>{if(t){const n=t.split(h);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function f(t){let e="";if(U(t))e=t;else if(D(t))for(let n=0;n<t.length;n++)e+=f(t[n])+" ";else if(q(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const p="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",d="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",v=r(p),g=r(d);function y(t,e){if(t.length!==e.length)return!1;let n=!0;for(let r=0;n&&r<t.length;r++)n=m(t[r],e[r]);return n}function m(t,e){if(t===e)return!0;let n=M(t),r=M(e);if(n||r)return!(!n||!r)&&t.getTime()===e.getTime();if(n=D(t),r=D(e),n||r)return!(!n||!r)&&y(t,e);if(n=q(t),r=q(e),n||r){if(!n||!r)return!1;const i=Object.keys(t).length,o=Object.keys(e).length;if(i!==o)return!1;for(const n in t){const r=t.hasOwnProperty(n),i=e.hasOwnProperty(n);if(r&&!i||!r&&i||!m(t[n],e[n]))return!1}}return String(t)===String(e)}function _(t,e){return t.findIndex(t=>m(t,e))}function b(t,e){for(let n of t)if(m(n,e))return!0;return!1}const w=t=>null==t?"":q(t)?JSON.stringify(t,E,2):String(t),E=(t,e)=>L(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[e,n])=>(t[e+" =>"]=n,t),{})}:j(e)?{[`Set(${e.size})`]:[...e.values()]}:!q(e)||D(e)||K(e)?e:String(e),I={},T=[],C=()=>{},S=()=>!1,O=/^on[^a-z]/,N=t=>O.test(t),A=t=>t.startsWith("onUpdate:"),k=Object.assign,R=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},P=Object.prototype.hasOwnProperty,x=(t,e)=>P.call(t,e),D=Array.isArray,L=t=>"[object Map]"===G(t),j=t=>"[object Set]"===G(t),M=t=>t instanceof Date,F=t=>"function"===typeof t,U=t=>"string"===typeof t,V=t=>"symbol"===typeof t,q=t=>null!==t&&"object"===typeof t,B=t=>q(t)&&F(t.then)&&F(t.catch),W=Object.prototype.toString,G=t=>W.call(t),H=t=>
1602G(t).slice(8,-1),K=t=>"[object Object]"===G(t),z=t=>U(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,Q=r("key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Y=t=>{const e=Object.create(null);return n=>{const r=e[n];return r||(e[n]=t(n))}},X=/-(\w)/g,$=Y(t=>t.replace(X,(t,e)=>e?e.toUpperCase():"")),J=/\B([A-Z])/g,Z=Y(t=>t.replace(J,"-$1").toLowerCase()),tt=Y(t=>t.charAt(0).toUpperCase()+t.slice(1)),et=(t,e)=>t!==e&&(t===t||e===e),nt=(t,e)=>{for(let n=0;n<t.length;n++)t[n](e)},rt=(t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})},it=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let ot;const st=()=>ot||(ot="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof t?t:{})}).call(this,n("c8ba"))},a04b:function(t,e,n){var r=n("c04e"),i=n("d9b5");t.exports=function(t){var e=r(t,"string");return i(e)?e:e+""}},a4b4:function(t,e,n){var r=n("342f");t.exports=/web0s(?!.*chrome)/i.test(r)},a79d:function(t,e,n){"use strict";var r=n("23e7"),i=n("c430"),o=n("d256"),s=n("d039"),a=n("d066"),u=n("1626"),c=n("4840"),h=n("cdf9"),l=n("cb2d"),f=o&&o.prototype,p=!!o&&s((function(){f["finally"].call({then:function(){}},(function(){}))}));if(r({target:"Promise",proto:!0,real:!0,forced:p},{finally:function(t){var e=c(this,a("Promise")),n=u(t);return this.then(n?function(n){return h(e,t()).then((function(){return n}))}:t,n?function(n){return h(e,t()).then((function(){throw n}))}:t)}}),!i&&u(o)){var d=a("Promise").prototype["finally"];f["finally"]!==d&&l(f,"finally",d,{unsafe:!0})}},abfd:function(t,e,n){"use strict"; 1603/*! ***************************************************************************** 1604Copyright (c) Microsoft Corporation. All rights reserved. 1605Licensed under the Apache License, Version 2.0 (the "License"); you may not use 1606this file except in compliance with the License. You may obtain a copy of the 1607License at http://www.apache.org/licenses/LICENSE-2.0 1608 1609THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 1610KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 1611WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 1612MERCHANTABLITY OR NON-INFRINGEMENT. 1613 1614See the Apache Version 2.0 License for specific language governing permissions 1615and limitations under the License. 1616***************************************************************************** */ 1617function 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} 1618/** 1619 * @license 1620 * Copyright 2017 Google LLC 1621 * 1622 * Licensed under the Apache License, Version 2.0 (the "License"); 1623 * you may not use this file except in compliance with the License. 1624 * You may obtain a copy of the License at 1625 * 1626 * http://www.apache.org/licenses/LICENSE-2.0 1627 * 1628 * Unless required by applicable law or agreed to in writing, software 1629 * distributed under the License is distributed on an "AS IS" BASIS, 1630 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1631 * See the License for the specific language governing permissions and 1632 * limitations under the License. 1633 */var i;n.r(e),n.d(e,"LogLevel",(function(){return o})),n.d(e,"Logger",(function(){return l})),n.d(e,"setLogLevel",(function(){return f})),n.d(e,"setUserLogHandler",(function(){return p}));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},u=o.INFO,c=(i={},i[o.DEBUG]="log",i[o.VERBOSE]="log",i[o.INFO]="info",i[o.WARN]="warn",i[o.ERROR]="error",i),h=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=c[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))}},l=function(){function t(t){this.name=t,this._logLevel=u,this._logHandler=h,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}
1633,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}();function f(t){s.forEach((function(e){e.setLogLevel(t)}))}function p(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(e){return null}})).filter((function(t){return t})).join(" ");n>=(null!==r&&void 0!==r?r:e.logLevel)&&t({level:o[n].toLowerCase(),message:a,args:i,type:e.name})}},r=0,i=s;r<i.length;r++){var u=i[r];n(u)}}},ae93:function(t,e,n){"use strict";var r,i,o,s=n("d039"),a=n("1626"),u=n("7c73"),c=n("e163"),h=n("cb2d"),l=n("b622"),f=n("c430"),p=l("iterator"),d=!1;[].keys&&(o=[].keys(),"next"in o?(i=c(c(o)),i!==Object.prototype&&(r=i)):d=!0);var v=void 0==r||s((function(){var t={};return r[p].call(t)!==t}));v?r={}:f&&(r=u(r)),a(r[p])||h(r,p,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:d}},aed9:function(t,e,n){var r=n("83ab"),i=n("d039");t.exports=r&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},b0c0:function(t,e,n){var r=n("83ab"),i=n("5e77").EXISTS,o=n("e330"),s=n("9bf2").f,a=Function.prototype,u=o(a.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,h=o(c.exec),l="name";r&&!i&&s(a,l,{configurable:!0,get:function(){try{return h(c,u(this))[1]}catch(t){return""}}})},b42e:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?r:n)(e)}},b575:function(t,e,n){var r,i,o,s,a,u,c,h,l=n("da84"),f=n("0366"),p=n("06cf").f,d=n("2cf4").set,v=n("1cdc"),g=n("d4c3"),y=n("a4b4"),m=n("605d"),_=l.MutationObserver||l.WebKitMutationObserver,b=l.document,w=l.process,E=l.Promise,I=p(l,"queueMicrotask"),T=I&&I.value;T||(r=function(){var t,e;m&&(t=w.domain)&&t.exit();while(i){e=i.fn,i=i.next;try{e()}catch(n){throw i?s():o=void 0,n}}o=void 0,t&&t.enter()},v||m||y||!_||!b?!g&&E&&E.resolve?(c=E.resolve(void 0),c.constructor=E,h=f(c.then,c),s=function(){h(r)}):m?s=function(){w.nextTick(r)}:(d=f(d,l),s=function(){d(r)}):(a=!0,u=b.createTextNode(""),new _(r).observe(u,{characterData:!0}),s=function(){u.data=a=!a})),t.exports=T||function(t){var e={fn:t,next:void 0};o&&(o.next=e),i||(i=e,s()),o=e}},b622:function(t,e,n){var r=n("da84"),i=n("5692"),o=n("1a2d"),s=n("90e3"),a=n("4930"),u=n("fdbf"),c=i("wks"),h=r.Symbol,l=h&&h["for"],f=u?h:h&&h.withoutSetter||s;t.exports=function(t){if(!o(c,t)||!a&&"string"!=typeof c[t]){var e="Symbol."+t;a&&o(h,t)?c[t]=h[t]:c[t]=u&&l?l(e):f(e)}return c[t]}},c04e:function(t,e,n){var r=n("c65b"),i=n("861d"),o=n("d9b5"),s=n("dc4a"),a=n("485a"),u=n("b622"),c=TypeError,h=u("toPrimitive");t.exports=function(t,e){if(!i(t)||o(t))return t;var n,u=s(t,h);if(u){if(void 0===e&&(e="default"),n=r(u,t,e),!i(n)||o(n))return n;throw c("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},c23d:function(t,e,n){"use strict";
1633Object.defineProperty(e,"__esModule",{value:!0});var r,i,o=n("9ab4"),s=n("cd51"),a=n("4be4"),u=n("abfd"),c=(r={},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),h=new s.ErrorFactory("app","Firebase",c),l="@firebase/app",f="0.6.11",p="@firebase/analytics",d="@firebase/auth",v="@firebase/database",g="@firebase/functions",y="@firebase/installations",m="@firebase/messaging",_="@firebase/performance",b="@firebase/remote-config",w="@firebase/storage",E="@firebase/firestore",I="firebase-wrapper",T="[DEFAULT]",C=(i={},i[l]="fire-core",i[p]="fire-analytics",i[d]="fire-auth",i[v]="fire-rtdb",i[g]="fire-fn",i[y]="fire-iid",i[m]="fire-fcm",i[_]="fire-perf",i[b]="fire-rc",i[w]="fire-gcs",i[E]="fire-fst",i["fire-js"]="fire-js",i[I]="fire-js-all",i),S=new u.Logger("@firebase/app"),O=function(){function t(t,e,n){var r,i,u=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 u}),"PUBLIC"));try{for(var c=o.__values(this.firebase_.INTERNAL.components.values()),h=c.next();!h.done;h=c.next()){var l=h.value;this._addComponent(l)}}catch(f){r={error:f}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}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=T),this.checkDestroyed_(),this.container.getProvider(t).getImmediate({identifier:e})},t.prototype._removeServiceInstance=function(t,e){void 0===e&&(e=T),this.container.getProvider(t).clearInstance(e)},t.prototype._addComponent=function(t){try{this.container.addComponent(t)}catch(e){S.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 h.create("app-deleted",{appName:this.name_})},t}();O.prototype.name&&O.prototype.options||O.prototype.delete||console.log("dc");var N="7.20.0"; 1634/** 1635 * @license 1636 * Copyright 2019 Google LLC 1637 * 1638 * Licensed under the Apache License, Version 2.0 (the "License"); 1639 * you may not use this file except in compliance with the License. 1640 * You may obtain a copy of the License at 1641 * 1642 * http://www.apache.org/licenses/LICENSE-2.0 1643 * 1644 * Unless required by applicable law or agreed to in writing, software 1645 * distributed under the License is distributed on an "AS IS" BASIS, 1646 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1647 * See the License for the specific language governing permissions and 1648 * limitations under the License. 1649 */function A(t){var e={},n=new Map,r={__esModule:!0,initializeApp:l,app:c,registerVersion:d,setLogLevel:u.setLogLevel,onLog:v,apps:null,SDK_VERSION:N,INTERNAL:{registerComponent:p,removeApp:i,components:n,useAsService:g}};function i(t){delete e[t]}function c(t){if(t=t||T,!s.contains(e,t))throw h.create("no-app",{appName:t});return e[t]}function l(n,i){if(void 0===i&&(i={}),"object"!==typeof i||null===i){var o=i;i={name:o}}var a=i;void 0===a.name&&(a.name=T);var u=a.name;if("string"!==typeof u||!u)throw h.create("bad-app-name",{appName:String(u)});if(s.contains(e,u))throw h.create("duplicate-app",{appName:u});var c=new t(n,a,r);return e[u]=c,c}function f(){return Object.keys(e).map((function(t){return e[t]}))}function p(i){var a,u,l=i.name;if(n.has(l))return S.debug("There were multiple attempts to register component "+l+"."),"PUBLIC"===i.t
1649ype?r[l]:null;if(n.set(l,i),"PUBLIC"===i.type){var f=function(t){if(void 0===t&&(t=c()),"function"!==typeof t[l])throw h.create("invalid-app-argument",{appName:l});return t[l]()};void 0!==i.serviceProps&&s.deepExtend(f,i.serviceProps),r[l]=f,t.prototype[l]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this._getService.bind(this,l);return n.apply(this,i.multipleInstances?t:[])}}try{for(var p=o.__values(Object.keys(e)),d=p.next();!d.done;d=p.next()){var v=d.value;e[v]._addComponent(i)}}catch(g){a={error:g}}finally{try{d&&!d.done&&(u=p.return)&&u.call(p)}finally{if(a)throw a.error}}return"PUBLIC"===i.type?r[l]:null}function d(t,e,n){var r,i=null!==(r=C[t])&&void 0!==r?r:t;n&&(i+="-"+n);var o=i.match(/\s|\//),s=e.match(/\s|\//);if(o||s){var u=['Unable to register library "'+i+'" with version "'+e+'":'];return o&&u.push('library name "'+i+'" contains illegal characters (whitespace or "/")'),o&&s&&u.push("and"),s&&u.push('version name "'+e+'" contains illegal characters (whitespace or "/")'),void S.warn(u.join(" "))}p(new a.Component(i+"-version",(function(){return{library:i,version:e}}),"VERSION"))}function v(t,e){if(null!==t&&"function"!==typeof t)throw h.create("invalid-log-argument",{appName:name});u.setUserLogHandler(t,e)}function g(t,e){if("serverAuth"===e)return null;var n=e;return n}return r["default"]=r,Object.defineProperty(r,"apps",{get:f}),c["App"]=t,r} 1650/** 1651 * @license 1652 * Copyright 2019 Google LLC 1653 * 1654 * Licensed under the Apache License, Version 2.0 (the "License"); 1655 * you may not use this file except in compliance with the License. 1656 * You may obtain a copy of the License at 1657 * 1658 * http://www.apache.org/licenses/LICENSE-2.0 1659 * 1660 * Unless required by applicable law or agreed to in writing, software 1661 * distributed under the License is distributed on an "AS IS" BASIS, 1662 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1663 * See the License for the specific language governing permissions and 1664 * limitations under the License. 1665 */function k(){var t=A(O);function e(e){s.deepExtend(t,e)}return t.INTERNAL=o.__assign(o.__assign({},t.INTERNAL),{createFirebaseNamespace:k,extendNamespace:e,createSubscribe:s.createSubscribe,ErrorFactory:s.ErrorFactory,deepExtend:s.deepExtend}),t}var R=k(),P=function(){function t(t){this.container=t}return t.prototype.getPlatformInfoString=function(){var t=this.container.getProviders();return t.map((function(t){if(x(t)){var e=t.getImmediate();return e.library+"/"+e.version}return null})).filter((function(t){return t})).join(" ")},t}(); 1666/** 1667 * @license 1668 * Copyright 2019 Google LLC 1669 * 1670 * Licensed under the Apache License, Version 2.0 (the "License"); 1671 * you may not use this file except in compliance with the License. 1672 * You may obtain a copy of the License at 1673 * 1674 * http://www.apache.org/licenses/LICENSE-2.0 1675 * 1676 * Unless required by applicable law or agreed to in writing, software 1677 * distributed under the License is distributed on an "AS IS" BASIS, 1678 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1679 * See the License for the specific language governing permissions and 1680 * limitations under the License. 1681 */function x(t){var e=t.getComponent();return"VERSION"===(null===e||void 0===e?void 0:e.type)} 1682/** 1683 * @license 1684 * Copyright 2019 Google LLC 1685 * 1686 * Licensed under the Apache License, Version 2.0 (the "License"); 1687 * you may not use this file except in compliance with the License. 1688 * You may obtain a copy of the License at 1689 * 1690 * http://www.apache.org/licenses/LICENSE-2.0 1691 * 1692 * Unless required by applicable law or agreed to in writing, software 1693 * distributed under the License is distributed on an "AS IS" BASIS, 1694 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1695 * See the License for the specific language governing permissions and 1696 * limitations under the License. 1697 */function D(t,e){t.INTERNAL.registerComponent(new a.Component("platform-logger",(function(t){return new P(t)}),"PRIVATE")),t.registerVersion(l,f,e),t.registerVersion("fire-js","")} 1698/** 1699 * @license 1700 * Copyright 2017 Google LLC 1701 * 1702 * Licensed under the Apache License, Version 2.0 (the "License");
1703 * you may not use this file except in compliance with the License. 1704 * You may obtain a copy of the License at 1705 * 1706 * http://www.apache.org/licenses/LICENSE-2.0 1707 * 1708 * Unless required by applicable law or agreed to in writing, software 1709 * distributed under the License is distributed on an "AS IS" BASIS, 1710 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1711 * See the License for the specific language governing permissions and 1712 * limitations under the License. 1713 */if(s.isBrowser()&&void 0!==self.firebase){S.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n ");var L=self.firebase.SDK_VERSION;L&&L.indexOf("LITE")>=0&&S.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 j=R.initializeApp;R.initializeApp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return s.isNode()&&S.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 '),j.apply(void 0,t)};var M=R;D(M),e.default=M,e.firebase=M},c430:function(t,e){t.exports=!1},c65b:function(t,e,n){var r=n("40d5"),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},c6b6:function(t,e,n){var r=n("e330"),i=r({}.toString),o=r("".slice);t.exports=function(t){return o(i(t),8,-1)}},c6cd:function(t,e,n){var r=n("da84"),i=n("6374"),o="__core-js_shared__",s=r[o]||i(o,{});t.exports=s},c7b2:function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"ErrorCode",(function(){return Ir})),n.d(e,"EventType",(function(){return Tr})),n.d(e,"WebChannel",(function(){return Cr})),n.d(e,"XhrIo",(function(){return Sr})),n.d(e,"createWebChannelTransport",(function(){return Er})); 1714/*! ***************************************************************************** 1715Copyright (c) Microsoft Corporation. 1716 1717Permission to use, copy, modify, and/or distribute this software for any 1718purpose with or without fee is hereby granted. 1719 1720THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 1721REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 1722AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 1723INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 1724LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 1725OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 1726PERFORMANCE OF THIS SOFTWARE. 1727***************************************************************************** */ 1728var 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])},r(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 o(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.")}var s,a="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof t?t:"undefined"!==typeof self?self:{},u=u||{},c=a||self;function h(){}function l(t){var e=typeof t;return"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}function f(t){var e=l(t);return"array"==e||"object"==e&&"number"==typeof t.length}function p(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}function d(t){return Object.prototype.hasOwnProperty.call(t,v)&&t[v]||(t[v]=++g)}var v="closure_uid_"+(1e9*Math.random()>>>0),g=0;function y(t,e,n){return t.call.apply(t.bind,arguments)}function m(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 _(t,e,n){return _=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?y:m,_.apply(null,arguments)}
1728function b(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 w=Date.now;function E(t,e){function n(){}n.prototype=e.prototype,t.S=e.prototype,t.prototype=new n,t.prototype.constructor=t}function I(){this.j=this.j,this.i=this.i}var T=0;I.prototype.j=!1,I.prototype.ja=function(){if(!this.j&&(this.j=!0,this.G(),0!=T))d(this)},I.prototype.G=function(){if(this.i)for(;this.i.length;)this.i.shift()()};var C=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},S=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)};function O(t){t:{for(var e=Fn,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]}function N(t){return Array.prototype.concat.apply([],arguments)}function A(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[]}function k(t){return/^[\s\xa0]*$/.test(t)}var R,P=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]};function x(t,e){return-1!=t.indexOf(e)}function D(t,e){return t<e?-1:t>e?1:0}t:{var L=c.navigator;if(L){var j=L.userAgent;if(j){R=j;break t}}R=""}function M(t,e,n){for(var r in t)e.call(n,t[r],r,t)}function F(t){var e={};for(var n in t)e[n]=t[n];return e}var U="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function V(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i],r)t[n]=r[n];for(var o=0;o<U.length;o++)n=U[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function q(t){return q[" "](t),t}function B(t,e){var n=et;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e(t)}q[" "]=h;var W,G=x(R,"Opera"),H=x(R,"Trident")||x(R,"MSIE"),K=x(R,"Edge"),z=K||H,Q=x(R,"Gecko")&&!(x(R.toLowerCase(),"webkit")&&!x(R,"Edge"))&&!(x(R,"Trident")||x(R,"MSIE"))&&!x(R,"Edge"),Y=x(R.toLowerCase(),"webkit")&&!x(R,"Edge");function X(){var t=c.document;return t?t.documentMode:void 0}t:{var $="",J=function(){var t=R;return Q?/rv:([^\);]+)(\)|;)/.exec(t):K?/Edge\/([\d\.]+)/.exec(t):H?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(t):Y?/WebKit\/(\S+)/.exec(t):G?/(?:Version)[ \/]?(\S+)/.exec(t):void 0}();if(J&&($=J?J[1]:""),H){var Z=X();if(null!=Z&&Z>parseFloat($)){W=String(Z);break t}}W=$}var tt,et={};function nt(t){return B(t,(function(){for(var e=0,n=P(String(W)).split("."),r=P(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=D(0==s[1].length?0:parseInt(s[1],10),0==a[1].length?0:parseInt(a[1],10))||D(0==s[2].length,0==a[2].length)||D(s[2],a[2]),s=s[3],a=a[3]}while(0==e)}return 0<=e}))}if(c.document&&H){var rt=X();tt=rt||(parseInt(W,10)||void 0)}else tt=void 0;var it=tt,ot=!H||9<=Number(it),st=H&&!nt("9"),at=function(){if(!c.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{c.addEventListener("test",h,e),c.removeEventListener("test",h,e)}catch(n){}return t}();function ut(t,e){this.type=t,this.a=this.target=e,this.defaultPrevented=!1}function ct(t,e){if(ut.call(this,t?t.type:""),this.relatedTarget=this.a=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.c=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.a=e,e=t.relatedTarget){if(Q){t:{try{q(e.nodeName);var i=!0;break t}catch(o){}i=!1}i||(e=null)}}
1728else"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:ht[t.pointerType]||"",this.c=t,t.defaultPrevented&&this.b()}}ut.prototype.b=function(){this.defaultPrevented=!0},E(ct,ut);var ht={2:"touch",3:"pen",4:"mouse"};ct.prototype.b=function(){ct.S.b.call(this);var t=this.c;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,st)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}};var lt="closure_listenable_"+(1e6*Math.random()|0),ft=0;function pt(t,e,n,r,i){this.listener=t,this.proxy=null,this.src=e,this.type=n,this.capture=!!r,this.ca=i,this.key=++ft,this.Y=this.Z=!1}function dt(t){t.Y=!0,t.listener=null,t.proxy=null,t.src=null,t.ca=null}function vt(t){this.src=t,this.a={},this.b=0}function gt(t,e){var n=e.type;if(n in t.a){var r,i=t.a[n],o=C(i,e);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(dt(e),0==t.a[n].length&&(delete t.a[n],t.b--))}}function yt(t,e,n,r){for(var i=0;i<t.length;++i){var o=t[i];if(!o.Y&&o.listener==e&&o.capture==!!n&&o.ca==r)return i}return-1}vt.prototype.add=function(t,e,n,r,i){var o=t.toString();t=this.a[o],t||(t=this.a[o]=[],this.b++);var s=yt(t,e,r,i);return-1<s?(e=t[s],n||(e.Z=!1)):(e=new pt(e,this.src,o,!!r,i),e.Z=n,t.push(e)),e};var mt="closure_lm_"+(1e6*Math.random()|0),_t={};function bt(t,e,n,r,i){if(r&&r.once)return It(t,e,n,r,i);if(Array.isArray(e)){for(var o=0;o<e.length;o++)bt(t,e[o],n,r,i);return null}return n=Rt(n),t&&t[lt]?t.va(e,n,p(r)?!!r.capture:!!r,i):wt(t,e,n,!1,r,i)}function wt(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var s=p(i)?!!i.capture:!!i;if(s&&!ot)return null;var a=At(t);if(a||(t[mt]=a=new vt(t)),n=a.add(e,n,r,s,o),n.proxy)return n;if(r=Et(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)at||(i=s),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(St(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}return n}function Et(){var t=Nt,e=ot?function(n){return t.call(e.src,e.listener,n)}:function(n){if(n=t.call(e.src,e.listener,n),!n)return n};return e}function It(t,e,n,r,i){if(Array.isArray(e)){for(var o=0;o<e.length;o++)It(t,e[o],n,r,i);return null}return n=Rt(n),t&&t[lt]?t.wa(e,n,p(r)?!!r.capture:!!r,i):wt(t,e,n,!0,r,i)}function Tt(t,e,n,r,i){if(Array.isArray(e))for(var o=0;o<e.length;o++)Tt(t,e[o],n,r,i);else r=p(r)?!!r.capture:!!r,n=Rt(n),t&&t[lt]?(t=t.c,e=String(e).toString(),e in t.a&&(o=t.a[e],n=yt(o,n,r,i),-1<n&&(dt(o[n]),Array.prototype.splice.call(o,n,1),0==o.length&&(delete t.a[e],t.b--)))):t&&(t=At(t))&&(e=t.a[e.toString()],t=-1,e&&(t=yt(e,n,r,i)),(n=-1<t?e[t]:null)&&Ct(n))}function Ct(t){if("number"!==typeof t&&t&&!t.Y){var e=t.src;if(e&&e[lt])gt(e.c,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(St(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=At(e))?(gt(n,t),0==n.b&&(n.src=null,e[mt]=null)):dt(t)}}}function St(t){return t in _t?_t[t]:_t[t]="on"+t}function Ot(t,e){var n=t.listener,r=t.ca||t.src;return t.Z&&Ct(t),n.call(r,e)}function Nt(t,e){if(t.Y)return!0;if(!ot){if(!e)t:{e=["window","event"];for(var n=c,r=0;r<e.length;r++)if(n=n[e[r]],null==n){e=null;break t}e=n}return e=new ct(e,this),Ot(t,e)}return Ot(t,new ct(e,this))}function At(t){return t=t[mt],t instanceof vt?t:null}var kt="__closure_events_fn_"+(1e9*Math.random()>>>0);function Rt(t){return"function"==l(t)?t:(t[kt]||(t[kt]=function(e){return t.handleEvent(e)}),t[kt])}function Pt(){I.call(this),this.c=new vt(this),this.J=this,this.C=null}function xt(t,e,n,r){if(e=t.c.a[String(e)],!e)return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var s=e[o];if(s&&!s.Y&&s.capture==n){var a=s.listener,u=s.ca||s.src;s.Z&>(t.c,s),i=!1!==a.call(u,r)&&i}}return i&&!r.defaultPrevented}E(Pt,I),Pt.prototype[lt]=!0,s=Pt.prototype,s.addEventListener=function(t,e,n,r){bt(this,t,e,n,r)},s.removeEventListener=function(t,e,n,r){Tt(this,t,e,n,r)},s.dispatchEvent=function(t){var e,n=this.C;if(n)for(e=[];n;n=n.C)e.push(n);n=this.J;var r=t.type||t;if("string"===typeof t)t=new ut(t,n);else if(t instanceof ut)t.target=t.target||n;else{var i=t;t=new ut(r,n),V(t,i)}if(i=!0,e)for(var o=e.length-1;0<=o;o--){var s=t.a=e[o];i=xt(s,r,!0,t)&&i}if(s=t.a=n,i=xt(s,r,!0,t)&&i,i=xt(s,r,!1,t)&&i,e)for(o=0;o<e.length;o++)s=t.a=e[o],i=xt(s,r,!1,t)&&i;return i},s.G=function(){if(Pt.S.G.call(this),this.c){var t,e=this.c;for(t in e.a){for(var n=e.a[t],r=0;r<n.length;r++)dt(n[r]);delete e.a[t],e.b--}}this.C=null},s.va=function(t,e,n,r){return this.c.add(String(t),e,!1,n,r)},s.wa=function(t,e,n,r){return this.c.add(String(t),e,!0,n,r)};var Dt=c.JSON.stringify;function Lt(){this.b=this.a=null}var jt,Mt=new(function(){function t(t,e,n){this.f=n,this.c=t,this.g=e,this.b=0,this.a=null}return t.prototype.get=function(){var t;return 0<this.b?(this.b--,t=this.a,this.a=t.next,t.next=null):t=this.c(),t},t}())((function(){return new Ut}),(function(t){t.reset()}),100);function Ft(){var t=Gt,e=null;
1728return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function Ut(){this.next=this.b=this.a=null}function Vt(t){c.setTimeout((function(){throw t}),0)}function qt(t,e){jt||Bt(),Wt||(jt(),Wt=!0),Gt.add(t,e)}function Bt(){var t=c.Promise.resolve(void 0);jt=function(){t.then(Ht)}}Lt.prototype.add=function(t,e){var n=Mt.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},Ut.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},Ut.prototype.reset=function(){this.next=this.b=this.a=null};var Wt=!1,Gt=new Lt;function Ht(){for(var t;t=Ft();){try{t.a.call(t.b)}catch(n){Vt(n)}var e=Mt;e.g(t),e.b<e.f&&(e.b++,t.next=e.a,e.a=t)}Wt=!1}function Kt(t,e){Pt.call(this),this.b=t||1,this.a=e||c,this.f=_(this.Ya,this),this.g=w()}function zt(t){t.aa=!1,t.M&&(t.a.clearTimeout(t.M),t.M=null)}function Qt(t,e,n){if("function"==l(t))n&&(t=_(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=_(t.handleEvent,t)}return 2147483647<Number(e)?-1:c.setTimeout(t,e||0)}function Yt(t){t.a=Qt((function(){t.a=null,t.c&&(t.c=!1,Yt(t))}),t.h);var e=t.b;t.b=null,t.g.apply(null,e)}E(Kt,Pt),s=Kt.prototype,s.aa=!1,s.M=null,s.Ya=function(){if(this.aa){var t=w()-this.g;0<t&&t<.8*this.b?this.M=this.a.setTimeout(this.f,this.b-t):(this.M&&(this.a.clearTimeout(this.M),this.M=null),this.dispatchEvent("tick"),this.aa&&(zt(this),this.start()))}},s.start=function(){this.aa=!0,this.M||(this.M=this.a.setTimeout(this.f,this.b),this.g=w())},s.G=function(){Kt.S.G.call(this),zt(this),delete this.a};var Xt=function(t){function e(e,n,r){var i=t.call(this)||this;return i.g=null!=r?e.bind(r):e,i.h=n,i.b=null,i.c=!1,i.a=null,i}return i(e,t),e.prototype.f=function(t){this.b=arguments,this.a?this.c=!0:Yt(this)},e.prototype.G=function(){t.prototype.G.call(this),this.a&&(c.clearTimeout(this.a),this.a=null,this.c=!1,this.b=null)},e}(I);function $t(t){I.call(this),this.b=t,this.a={}}E($t,I);var Jt=[];function Zt(t,e,n,r){Array.isArray(n)||(n&&(Jt[0]=n.toString()),n=Jt);for(var i=0;i<n.length;i++){var o=bt(e,n[i],r||t.handleEvent,!1,t.b||t);if(!o)break;t.a[o.key]=o}}function te(t){M(t.a,(function(t,e){this.a.hasOwnProperty(e)&&Ct(t)}),t),t.a={}}function ee(){this.a=!0}function ne(t,e,n,r,i,o){t.info((function(){if(t.a)if(o)for(var s="",a=o.split("&"),u=0;u<a.length;u++){var c=a[u].split("=");if(1<c.length){var h=c[0];c=c[1];var l=h.split("_");s=2<=l.length&&"type"==l[1]?s+(h+"=")+c+"&":s+(h+"=redacted&")}}else s=null;else s=o;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+e+"\n"+n+"\n"+s}))}function re(t,e,n,r,i,o,s){t.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+e+"\n"+n+"\n"+o+" "+s}))}function ie(t,e,n,r){t.info((function(){return"XMLHTTP TEXT ("+e+"): "+se(t,n)+(r?" "+r:"")}))}function oe(t,e){t.info((function(){return"TIMEOUT: "+e}))}function se(t,e){if(!t.a)return e;if(!e)return null;try{var n=JSON.parse(e);if(n)for(t=0;t<n.length;t++)if(Array.isArray(n[t])){var r=n[t];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var o=i[0];if("noop"!=o&&"stop"!=o&&"close"!=o)for(var s=1;s<i.length;s++)i[s]=""}}}return Dt(n)}catch(a){return e}}$t.prototype.G=function(){$t.S.G.call(this),te(this)},$t.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},ee.prototype.info=function(){};var ae=null;function ue(){return ae=ae||new Pt}function ce(t){ut.call(this,"serverreachability",t)}function he(t){var e=ue();e.dispatchEvent(new ce(e,t))}function le(t){ut.call(this,"statevent",t)}function fe(t){var e=ue();e.dispatchEvent(new le(e,t))}function pe(t){ut.call(this,"timingevent",t)}function de(t,e){if("function"!=l(t))throw Error("Fn must not be null and must be a function");return c.setTimeout((function(){t()}),e)}E(ce,ut),E(le,ut),E(pe,ut);var ve={NO_ERROR:0,Za:1,gb:2,fb:3,bb:4,eb:5,hb:6,Da:7,TIMEOUT:8,kb:9},ge={ab:"complete",ob:"success",Ea:"error",Da:"abort",mb:"ready",nb:"readystatechange",TIMEOUT:"timeout",ib:"incrementaldata",lb:"progress",cb:"downloadprogress",pb:"uploadprogress"};function ye(){}function me(t){var e;return(e=t.a)||(e=t.a={}),e}function _e(){}ye.prototype.a=null;var be,we={OPEN:"a",$a:"b",Ea:"c",jb:"d"};function Ee(){ut.call(this,"d")}function Ie(){ut.call(this,"c")}function Te(){}function Ce(t,e,n,r){this.g=t,this.c=e,this.f=n,this.T=r||1,this.J=new $t(this),this.P=Se,t=z?125:void 0,this.R=new Kt(t),this.B=null,this.b=!1,this.j=this.l=this.i=this.H=this.u=this.U=this.o=null,this.s=[],this.a=null,this.D=0,this.h=this.m=null,this.N=-1,this.A=!1,this.O=0,this.F=null,this.W=this.C=this.V=this.I=!1}E(Ee,ut),E(Ie,ut),E(Te,ye),be=new Te;var Se=45e3,Oe={},Ne={};function Ae(t,e,n){t.H=1,t.i=Ze(ze(e)),t.j=n,t.I=!0,ke(t,null)}function ke(t,e){t.u=w(),xe(t),t.l=ze(t.i);var n=t.l,r=t.T;Array.isArray(r)||(r=[String(r)]),vn(n.b,"t",r),t.D=0,t.a=dr(t.g,t.g.C?e:null),0<t.O&&(t.F=new Xt(_(t.Ca,t,t.a),t.O)),Zt(t.J,t.a,"readystatechange",t.Wa),e=t.B?F(t.B):{},t.j?(t.m||(t.m="POST"),e["Content-Type"]="application/x-www-form-urlencoded",t.a.ba(t.l,t.m,t.j,e)):(t.m="GET",t.a.ba(t.l,t.m,null,e)),he(1),ne(t.c,t.m,t.l,t.f,t.T,t.j)}function Re(t,e,n){for(var r=!0;!t.A&&t.D<n.length;){var i=Pe(t,n);if(i==Ne){4==e&&(t.h=4,fe(14),r=!1),ie(t.c,t.f,null,"[Incomplete Response]");break}if(i==Oe){t.h=4,fe(15),ie(t.c,t.f,n,"[Invalid Chunk]"),r=!1;break}ie(t.c,t.f,i,null),Fe(t,i)}4==e&&0==n.length&&(t.h=1,fe(16),r=!1),t.b=t.b&&r,r?0<n.length&&!t.W&&(t.W=!0,e=t.g,e.a==t&&e.V&&!e.F&&(e.c.info("Great, no buffering proxy detected. Bytes received: "+n.length),sr(e),e.F=!0)):(ie(t.c,t.f,n,"[Invalid Chunked Response]"),Me(t),je(t))}function Pe(t,e){var n=t.D,r=e.indexOf("\n",n);return-1==r?Ne:(n=Number(e.substring(n,r)),isNaN(n)?Oe:(r+=1,r+n>e.length?Ne:(e=e.substr(r,n),t.D=r+n,e)))}function xe(t){t.U=w()+t.P,De(t,t.P)}function De(t,e){if(null!=t.o)throw Error("WatchDog timer not null");t.o=de(_(t.Ua,t),e)}function Le(t){t.o&&(c.clearTimeout(t.o),t.o=null)}function je(t){0==t.g.v||t.A||cr(t.g,t)}function Me(t){Le(t);var e=t.F;e&&"function"==typeof e.ja&&e.ja(),t.F=null,zt(t.R),te(t.J),t.a&&(e=t.a,t.a=null,e.abort(),e.ja())}function Fe(t,e){try{var n=t.g;if(0!=n.v&&(n.a==t||In(n.b,t)))if(n.I=t.N,!t.C&&In(n.b,t)&&3==n.v){try{var r=n.ka.a.parse(e)}catch(g){r=null}if(Array.isArray(r)&&3==r.length){var i=r;
vendor: 5,064 bytes, line 1728
1728if(0==i[0]){t:if(!n.j){if(n.a){if(!(n.a.u+3e3<t.u))break t;ur(n),Xn(n)}or(n),fe(18)}}else n.oa=i[1],0<n.oa-n.P&&37500>i[2]&&n.H&&0==n.o&&!n.m&&(n.m=de(_(n.Ra,n),6e3));if(1>=En(n.b)&&n.ea){try{n.ea()}catch(g){}n.ea=void 0}}else lr(n,11)}else if((t.C||n.a==t)&&ur(n),!k(e))for(e=r=n.ka.a.parse(e),r=0;r<e.length;r++)if(i=e[r],n.P=i[0],i=i[1],2==n.v)if("c"==i[0]){n.J=i[1],n.ga=i[2];var o=i[3];null!=o&&(n.ha=o,n.c.info("VER="+n.ha));var s=i[4];null!=s&&(n.pa=s,n.c.info("SVER="+n.pa));var a=i[5];if(null!=a&&"number"===typeof a&&0<a){var u=1.5*a;n.D=u,n.c.info("backChannelRequestTimeoutMs_="+u)}u=n;var c=t.a;if(c){var h=c.a?c.a.getResponseHeader("X-Client-Wire-Protocol"):null;if(h){var l=u.b;!l.a&&(x(h,"spdy")||x(h,"quic")||x(h,"h2"))&&(l.f=l.g,l.a=new Set,l.b&&(Tn(l,l.b),l.b=null))}if(u.A){var f=c.a?c.a.getResponseHeader("X-HTTP-Session-Id"):null;f&&(u.na=f,Je(u.B,u.A,f))}}n.v=3,n.f&&n.f.ta(),n.V&&(n.N=w()-t.u,n.c.info("Handshake RTT: "+n.N+"ms")),u=n;var p=t;if(u.la=pr(u,u.C?u.ga:null,u.fa),p.C){Cn(u.b,p);var d=p,v=u.D;v&&d.setTimeout(v),d.o&&(Le(d),xe(d)),u.a=p}else ir(u);0<n.g.length&&Zn(n)}else"stop"!=i[0]&&"close"!=i[0]||lr(n,7);else 3==n.v&&("stop"==i[0]||"close"==i[0]?"stop"==i[0]?lr(n,7):Yn(n):"noop"!=i[0]&&n.f&&n.f.sa(i),n.o=0);he(4)}catch(g){}}function Ue(t){if(t.K&&"function"==typeof t.K)return t.K();if("string"===typeof t)return t.split("");if(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 Ve(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(f(t)||"string"===typeof t)S(t,e,void 0);else{if(t.L&&"function"==typeof t.L)var n=t.L();else if(t.K&&"function"==typeof t.K)n=void 0;else if(f(t)||"string"===typeof t){n=[];for(var r=t.length,i=0;i<r;i++)n.push(i)}else for(i in n=[],r=0,t)n[r++]=i;r=Ue(t),i=r.length;for(var o=0;o<i;o++)e.call(void 0,r[o],n&&n[o],t)}}function qe(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 qe)for(n=t.L(),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 Be(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];We(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;)r=t.a[e],We(i,r)||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function We(t,e){return Object.prototype.hasOwnProperty.call(t,e)}s=Ce.prototype,s.setTimeout=function(t){this.P=t},s.Wa=function(t){t=t.target;var e=this.F;e&&3==Gn(t)?e.f():this.Ca(t)},s.Ca=function(t){try{if(t==this.a)t:{var e=Gn(this.a),n=this.a.ua(),r=this.a.X();if(!(3>e||3==e&&!z&&!this.a.$())){this.A||4!=e||7==n||he(8==n||0>=r?3:2),Le(this);var i=this.a.X();this.N=i;var o=this.a.$();if(this.b=200==i,re(this.c,this.m,this.l,this.f,this.T,e,i),this.b){if(this.V&&!this.C){e:{if(this.a){var s,a=this.a;if((s=a.a?a.a.getResponseHeader("X-HTTP-Initial-Response"):null)&&!k(s)){var u=s;break e}}u=null}if(!u){this.b=!1,this.h=3,fe(12),Me(this),je(this);break t}ie(this.c,this.f,u,"Initial handshake response via X-HTTP-Initial-Response"),this.C=!0,Fe(this,u)}this.I?(Re(this,e,o),z&&this.b&&3==e&&(Zt(this.J,this.R,"tick",this.Va),this.R.start())):(ie(this.c,this.f,o,null),Fe(this,o)),4==e&&Me(this),this.b&&!this.A&&(4==e?cr(this.g,this):(this.b=!1,xe(this)))}else 400==i&&0<o.indexOf("Unknown SID")?(this.h=3,fe(12)):(this.h=0,fe(13)),Me(this),je(this)}}}catch(c){}},s.Va=function(){if(this.a){var t=Gn(this.a),e=this.a.$();this.D<e.length&&(Le(this),Re(this,t,e),this.b&&4!=t&&xe(this))}},s.cancel=function(){this.A=!0,Me(this)},s.Ua=function(){this.o=null;var t=w();0<=t-this.U?(oe(this.c,this.l),2!=this.H&&(he(3),fe(17)),Me(this),this.h=2,je(this)):De(this,this.U-t)},s=qe.prototype,s.K=function(){Be(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},s.L=function(){return Be(this),this.a.concat()},s.get=function(t,e){return We(this.b,t)?this.b[t]:e},s.set=function(t,e){We(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},s.forEach=function(t,e){for(var n=this.L(),r=0;r<n.length;r++){var i=n[r],o=this.get(i);t.call(e,o,i,this)}};var Ge=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function He(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," ")):"")}}}function Ke(t,e){if(this.c=this.j=this.f="",this.h=null,this.i=this.g="",this.a=!1,t instanceof Ke){this.a=void 0!==e?e:t.a,Qe(this,t.f),this.j=t.j,Ye(this,t.c),Xe(this,t.h),this.g=t.g,e=t.b;var n=new ln;n.c=e.c,e.a&&(n.a=new qe(e.a),n.b=e.b),$e(this,n),this.i=t.i}else t&&(n=String(t).match(Ge))?(this.a=!!e,Qe(this,n[1]||"",!0),this.j=nn(n[2]||""),Ye(this,n[3]||"",!0),Xe(this,n[4]),this.g=nn(n[5]||"",!0),$e(this,n[6]||"",!0),this.i=nn(n[7]||"")):(this.a=!!e,this.b=new ln(null,this.a))}function ze(t){return new Ke(t)}
1728function Qe(t,e,n){t.f=n?nn(e,!0):e,t.f&&(t.f=t.f.replace(/:$/,""))}function Ye(t,e,n){t.c=n?nn(e,!0):e}function Xe(t,e){if(e){if(e=Number(e),isNaN(e)||0>e)throw Error("Bad port number "+e);t.h=e}else t.h=null}function $e(t,e,n){e instanceof ln?(t.b=e,yn(t.b,t.a)):(n||(e=rn(e,cn)),t.b=new ln(e,t.a))}function Je(t,e,n){t.b.set(e,n)}function Ze(t){return Je(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^w()).toString(36)),t}function tn(t){return t instanceof Ke?ze(t):new Ke(t,void 0)}function en(t,e,n,r){var i=new Ke(null,void 0);return t&&Qe(i,t),e&&Ye(i,e),n&&Xe(i,n),r&&(i.g=r),i}function nn(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function rn(t,e,n){return"string"===typeof t?(t=encodeURI(t).replace(e,on),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function on(t){return t=t.charCodeAt(0),"%"+(t>>4&15).toString(16)+(15&t).toString(16)}Ke.prototype.toString=function(){var t=[],e=this.f;e&&t.push(rn(e,sn,!0),":");var n=this.c;return(n||"file"==e)&&(t.push("//"),(e=this.j)&&t.push(rn(e,sn,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),n=this.h,null!=n&&t.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&t.push("/"),t.push(rn(n,"/"==n.charAt(0)?un:an,!0))),(n=this.b.toString())&&t.push("?",n),(n=this.i)&&t.push("#",rn(n,hn)),t.join("")};var sn=/[#\/\?@]/g,an=/[#\?:]/g,un=/[#\?]/g,cn=/[#\?@]/g,hn=/#/g;function ln(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function fn(t){t.a||(t.a=new qe,t.b=0,t.c&&He(t.c,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})))}function pn(t,e){fn(t),e=gn(t,e),We(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,t=t.a,We(t.b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&Be(t)))}function dn(t,e){return fn(t),e=gn(t,e),We(t.a.b,e)}function vn(t,e,n){pn(t,e),0<n.length&&(t.c=null,t.a.set(gn(t,e),A(n)),t.b+=n.length)}function gn(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}function yn(t,e){e&&!t.f&&(fn(t),t.c=null,t.a.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(pn(this,e),vn(this,n,t))}),t)),t.f=e}function mn(t,e){this.b=t,this.a=e}function _n(t){this.g=t||bn,c.PerformanceNavigationTiming?(t=c.performance.getEntriesByType("navigation"),t=0<t.length&&("hq"==t[0].nextHopProtocol||"h2"==t[0].nextHopProtocol)):t=!!(c.ia&&c.ia.ya&&c.ia.ya()&&c.ia.ya().qb),this.f=t?this.g:1,this.a=null,1<this.f&&(this.a=new Set),this.b=null,this.c=[]}s=ln.prototype,s.add=function(t,e){fn(this),this.c=null,t=gn(this,t);var n=this.a.get(t);return n||this.a.set(t,n=[]),n.push(e),this.b+=1,this},s.forEach=function(t,e){fn(this),this.a.forEach((function(n,r){S(n,(function(n){t.call(e,n,r,this)}),this)}),this)},s.L=function(){fn(this);for(var t=this.a.K(),e=this.a.L(),n=[],r=0;r<e.length;r++)for(var i=t[r],o=0;o<i.length;o++)n.push(e[r]);return n},s.K=function(t){fn(this);var e=[];if("string"===typeof t)dn(this,t)&&(e=N(e,this.a.get(gn(this,t))));else{t=this.a.K();for(var n=0;n<t.length;n++)e=N(e,t[n])}return e},s.set=function(t,e){return fn(this),this.c=null,t=gn(this,t),dn(this,t)&&(this.b-=this.a.get(t).length),this.a.set(t,[e]),this.b+=1,this},s.get=function(t,e){return t?(t=this.K(t),0<t.length?String(t[0]):e):e},s.toString=function(){if(this.c)return this.c;if(!this.a)return"";for(var t=[],e=this.a.L(),n=0;n<e.length;n++){var r=e[n],i=encodeURIComponent(String(r));r=this.K(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 bn=10;function wn(t){return!!t.b||!!t.a&&t.a.size>=t.f}function En(t){return t.b?1:t.a?t.a.size:0}function In(t,e){return t.b?t.b==e:!!t.a&&t.a.has(e)}function Tn(t,e){t.a?t.a.add(e):t.b=e}function Cn(t,e){t.b&&t.b==e?t.b=null:t.a&&t.a.has(e)&&t.a.delete(e)}function Sn(t){var e,n;if(null!=t.b)return t.c.concat(t.b.s);if(null!=t.a&&0!==t.a.size){var r=t.c;try{for(var i=o(t.a.values()),s=i.next();!s.done;s=i.next()){var a=s.value;r=r.concat(a.s)}}catch(u){e={error:u}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}return A(t.c)}function On(){}function Nn(){this.a=new On}function An(t,e,n){var r=n||"";try{Ve(t,(function(t,n){var i=t;p(t)&&(i=Dt(t)),e.push(r+n+"="+encodeURIComponent(i))}))}catch(i){throw e.push(r+"type="+encodeURIComponent("_badmap")),i}}function kn(t,e){var n=new ee;if(c.Image){var r=new Image;r.onload=b(Rn,n,r,"TestLoadImage: loaded",!0,e),r.onerror=b(Rn,n,r,"TestLoadImage: error",!1,e),r.onabort=b(Rn,n,r,"TestLoadImage: abort",!1,e),r.ontimeout=b(Rn,n,r,"TestLoadImage: timeout",!1,e),c.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=t}else e(!1)}function Rn(t,e,n,r,i){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(r)}catch(o){}}_n.prototype.cancel=function(){var t,e;if(this.c=Sn(this),this.b)this.b.cancel(),this.b=null;else if(this.a&&0!==this.a.size){try{for(var n=o(this.a.values()),r=n.next();!r.done;r=n.next()){var i=r.value;i.cancel()}}catch(s){t={error:s}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.a.clear()}},On.prototype.stringify=function(t){return c.JSON.stringify(t,void 0)},On.prototype.parse=function(t){return c.JSON.parse(t,void 0)};var Pn=c.JSON.parse;function xn(t){Pt.call(this),this.headers=new qe,this.H=t||null,this.b=!1,this.s=this.a=null,this.B="",this.h=0,this.f="",this.g=this.A=this.l=this.u=!1,this.o=0,this.m=null,this.I=Dn,this.D=this.F=!1}E(xn,Pt);var Dn="",Ln=/^https?$/i,jn=["POST","PUT"];function Mn(t){return H&&nt(9)&&"number"===typeof t.timeout&&void 0!==t.ontimeout}function Fn(t){return"content-type"==t.toLowerCase()}function Un(t,e){t.b=!1,t.a&&(t.g=!0,t.a.abort(),t.g=!1),t.f=e,t.h=5,Vn(t),Bn(t)}function Vn(t){t.u||(t.u=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function qn(t){if(t.b&&"undefined"!=typeof u&&(!t.s[1]||4!=Gn(t)||2!=t.X()))if(t.l&&4==Gn(t))Qt(t.za,0,t);else if(t.dispatchEvent("readystatechange"),4==Gn(t)){t.b=!1;try{var e,n=t.X();t:switch(n){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var r
vendor: 6,823 bytes, line 1728
1728=!0;break t;default:r=!1}if(!(e=r)){var i;if(i=0===n){var o=String(t.B).match(Ge)[1]||null;if(!o&&c.self&&c.self.location){var s=c.self.location.protocol;o=s.substr(0,s.length-1)}i=!Ln.test(o?o.toLowerCase():"")}e=i}if(e)t.dispatchEvent("complete"),t.dispatchEvent("success");else{t.h=6;try{var a=2<Gn(t)?t.a.statusText:""}catch(h){a=""}t.f=a+" ["+t.X()+"]",Vn(t)}}finally{Bn(t)}}}function Bn(t,e){if(t.a){Wn(t);var n=t.a,r=t.s[0]?h:null;t.a=null,t.s=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=r}catch(i){}}}function Wn(t){t.a&&t.D&&(t.a.ontimeout=null),t.m&&(c.clearTimeout(t.m),t.m=null)}function Gn(t){return t.a?t.a.readyState:0}function Hn(t){var e="";return M(t,(function(t,n){e+=n,e+=":",e+=t,e+="\r\n"})),e}function Kn(t,e,n){t:{for(r in n){var r=!1;break t}r=!0}r||(n=Hn(n),"string"===typeof t?null!=n&&encodeURIComponent(String(n)):Je(t,e,n))}function zn(t,e,n){return n&&n.internalChannelParams&&n.internalChannelParams[t]||e}function Qn(t){this.pa=0,this.g=[],this.c=new ee,this.ga=this.la=this.B=this.fa=this.a=this.na=this.A=this.W=this.i=this.O=this.l=null,this.La=this.R=0,this.Ia=zn("failFast",!1,t),this.H=this.m=this.j=this.h=this.f=null,this.T=!0,this.I=this.oa=this.P=-1,this.U=this.o=this.u=0,this.Fa=zn("baseRetryDelayMs",5e3,t),this.Ma=zn("retryDelaySeedMs",1e4,t),this.Ja=zn("forwardChannelMaxRetries",2,t),this.ma=zn("forwardChannelRequestTimeoutMs",2e4,t),this.Ka=t&&t.g||void 0,this.D=void 0,this.C=t&&t.supportsCrossDomainXhr||!1,this.J="",this.b=new _n(t&&t.concurrentRequestLimit),this.ka=new Nn,this.da=t&&t.fastHandshake||!1,this.Ga=t&&t.b||!1,t&&t.f&&(this.c.a=!1),t&&t.forceLongPolling&&(this.T=!1),this.V=!this.da&&this.T&&t&&t.c||!1,this.ea=void 0,this.N=0,this.F=!1,this.s=null}function Yn(t){if($n(t),3==t.v){var e=t.R++,n=ze(t.B);Je(n,"SID",t.J),Je(n,"RID",e),Je(n,"TYPE","terminate"),nr(t,n),e=new Ce(t,t.c,e,void 0),e.H=2,e.i=Ze(ze(n)),n=!1,c.navigator&&c.navigator.sendBeacon&&(n=c.navigator.sendBeacon(e.i.toString(),"")),!n&&c.Image&&((new Image).src=e.i,n=!0),n||(e.a=dr(e.g,null),e.a.ba(e.i)),e.u=w(),xe(e)}fr(t)}function Xn(t){t.a&&(sr(t),t.a.cancel(),t.a=null)}function $n(t){Xn(t),t.j&&(c.clearTimeout(t.j),t.j=null),ur(t),t.b.cancel(),t.h&&("number"===typeof t.h&&c.clearTimeout(t.h),t.h=null)}function Jn(t,e){t.g.push(new mn(t.La++,e)),3==t.v&&Zn(t)}function Zn(t){wn(t.b)||t.h||(t.h=!0,qt(t.Ba,t),t.u=0)}function tr(t,e){return!(En(t.b)>=t.b.f-(t.h?1:0))&&(t.h?(t.g=e.s.concat(t.g),!0):!(1==t.v||2==t.v||t.u>=(t.Ia?0:t.Ja))&&(t.h=de(_(t.Ba,t,e),hr(t,t.u)),t.u++,!0))}function er(t,e){var n;n=e?e.f:t.R++;var r=ze(t.B);Je(r,"SID",t.J),Je(r,"RID",n),Je(r,"AID",t.P),nr(t,r),t.i&&t.l&&Kn(r,t.i,t.l),n=new Ce(t,t.c,n,t.u+1),null===t.i&&(n.B=t.l),e&&(t.g=e.s.concat(t.g)),e=rr(t,n,1e3),n.setTimeout(Math.round(.5*t.ma)+Math.round(.5*t.ma*Math.random())),Tn(t.b,n),Ae(n,r,e)}function nr(t,e){t.f&&Ve({},(function(t,n){Je(e,n,t)}))}function rr(t,e,n){n=Math.min(t.g.length,n);var r=t.f?_(t.f.Ha,t.f,t):null;t:for(var i=t.g,o=-1;;){var s=["count="+n];-1==o?0<n?(o=i[0].b,s.push("ofs="+o)):o=0:s.push("ofs="+o);for(var a=!0,u=0;u<n;u++){var c=i[u].b,h=i[u].a;if(c-=o,0>c)o=Math.max(0,i[u].b-100),a=!1;else try{An(h,s,"req"+c+"_")}catch(l){r&&r(h)}}if(a){r=s.join("&");break t}}return t=t.g.splice(0,n),e.s=t,r}function ir(t){t.a||t.j||(t.U=1,qt(t.Aa,t),t.o=0)}function or(t){return!(t.a||t.j||3<=t.o)&&(t.U++,t.j=de(_(t.Aa,t),hr(t,t.o)),t.o++,!0)}function sr(t){null!=t.s&&(c.clearTimeout(t.s),t.s=null)}function ar(t){t.a=new Ce(t,t.c,"rpc",t.U),null===t.i&&(t.a.B=t.l),t.a.O=0;var e=ze(t.la);Je(e,"RID","rpc"),Je(e,"SID",t.J),Je(e,"CI",t.H?"0":"1"),Je(e,"AID",t.P),nr(t,e),Je(e,"TYPE","xmlhttp"),t.i&&t.l&&Kn(e,t.i,t.l),t.D&&t.a.setTimeout(t.D);var n=t.a;t=t.ga,n.H=1,n.i=Ze(ze(e)),n.j=null,n.I=!0,ke(n,t)}function ur(t){null!=t.m&&(c.clearTimeout(t.m),t.m=null)}function cr(t,e){var n=null;if(t.a==e){ur(t),sr(t),t.a=null;var r=2}else{if(!In(t.b,e))return;n=e.s,Cn(t.b,e),r=1}if(t.I=e.N,0!=t.v)if(e.b)if(1==r){n=e.j?e.j.length:0,e=w()-e.u;var i=t.u;r=ue(),r.dispatchEvent(new pe(r,n,e,i)),Zn(t)}else ir(t);else if(i=e.h,3==i||0==i&&0<t.I||!(1==r&&tr(t,e)||2==r&&or(t)))switch(n&&0<n.length&&(e=t.b,e.c=e.c.concat(n)),i){case 1:lr(t,5);break;case 4:lr(t,10);break;case 3:lr(t,6);break;default:lr(t,2)}}function hr(t,e){var n=t.Fa+Math.floor(Math.random()*t.Ma);return t.f||(n*=2),n*e}function lr(t,e){if(t.c.info("Error code "+e),2==e){var n=null;t.f&&(n=null);var r=_(t.Xa,t);n||(n=new Ke("//www.google.com/images/cleardot.gif"),c.location&&"http"==c.location.protocol||Qe(n,"https"),Ze(n)),kn(n.toString(),r)}else fe(2);t.v=0,t.f&&t.f.ra(e),fr(t),$n(t)}function fr(t){t.v=0,t.I=-1,t.f&&(0==Sn(t.b).length&&0==t.g.length||(t.b.c.length=0,A(t.g),t.g.length=0),t.f.qa())}function pr(t,e,n){var r=tn(n);if(""!=r.c)e&&Ye(r,e+"."+r.c),Xe(r,r.h);else{var i=c.location;r=en(i.protocol,e?e+"."+i.hostname:i.hostname,+i.port,n)}return t.W&&M(t.W,(function(t,e){Je(r,e,t)})),e=t.A,n=t.na,e&&n&&Je(r,e,n),Je(r,"VER",t.ha),nr(t,r),r}function dr(t,e){if(e&&!t.C)throw Error("Can't create secondary domain capable XhrIo object.");return e=new xn(t.Ka),e.F=t.C,e}function vr(){}function gr(){if(H&&!(10<=Number(it)))throw Error("Environmental error: no available transport.")}function yr(t,e){Pt.call(this),this.a=new Qn(e),this.l=t,this.b=e&&e.messageUrlParams||null,t=e&&e.messageHeaders||null,e&&e.clientProtocolHeaderRequired&&(t?t["X-Client-Protocol"]="webchannel":t={"X-Client-Protocol":"webchannel"}),this.a.l=t,t=e&&e.initMessageHeaders||null,e&&e.messageContentType&&(t?t["X-WebChannel-Content-Type"]=e.messageContentType:t={"X-WebChannel-Content-Type":e.messageContentType}),e&&e.a&&(t?t["X-WebChannel-Client-Profile"]=e.a:t={"X-WebChannel-Client-Profile":e.a}),this.a.O=t,(t=e&&e.httpHeadersOverwriteParam)&&!k(t)&&(this.a.i=t),this.h=e&&e.supportsCrossDomainXhr||!1,this.g=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!k(e)&&(this.a.A=e,t=this.b,null!==t&&e in t&&(t=this.b,e in t&&delete t[e])),this.f=new br(this)}function mr(t){Ee.call(this);var e=t.__sm__;if(e){t:{for(var n in e){t=n;break t}t=void 0}(this.c=t)?(t=this.c,this.data=null!==e&&t in e?e[t]:void 0):this.data=e}else this.data=t}function _r(){Ie.call(this),this.status=1}function br(t){this.a=t}s=xn.prototype,s.ba=function(t,e,n,r){if(this.a)throw Error("[goog.net.XhrIo] Object is active with another request="+this.B+"; newUri="+t);e=e?e.toUpperCase():"GET",this.B=t,this.f="",this.h=0,this.u=!1,this.b=!0,this.a=new XMLHttpRequest,this.s=this.H?me(this.H):me(be),this.a.onreadystatechange=_(this.za,this);try{this.A=!0,this.a.open(e,String(t),!0),this.A=!1}catch(o){return void Un(this,o)}t=n||"";var i=new qe(this.headers);r&&Ve(r,(function(t,e){i.set(e,t)})),r=O(i.L()),n=c.FormData&&t instanceof c.FormData,!(0<=C(jn,e))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;
1728charset=utf-8"),i.forEach((function(t,e){this.a.setRequestHeader(e,t)}),this),this.I&&(this.a.responseType=this.I),"withCredentials"in this.a&&this.a.withCredentials!==this.F&&(this.a.withCredentials=this.F);try{Wn(this),0<this.o&&((this.D=Mn(this.a))?(this.a.timeout=this.o,this.a.ontimeout=_(this.xa,this)):this.m=Qt(this.xa,this.o,this)),this.l=!0,this.a.send(t),this.l=!1}catch(o){Un(this,o)}},s.xa=function(){"undefined"!=typeof u&&this.a&&(this.f="Timed out after "+this.o+"ms, aborting",this.h=8,this.dispatchEvent("timeout"),this.abort(8))},s.abort=function(t){this.a&&this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1,this.h=t||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),Bn(this))},s.G=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),Bn(this,!0)),xn.S.G.call(this)},s.za=function(){this.j||(this.A||this.l||this.g?qn(this):this.Ta())},s.Ta=function(){qn(this)},s.X=function(){try{return 2<Gn(this)?this.a.status:-1}catch(t){return-1}},s.$=function(){try{return this.a?this.a.responseText:""}catch(t){return""}},s.Na=function(t){if(this.a){var e=this.a.responseText;return t&&0==e.indexOf(t)&&(e=e.substring(t.length)),Pn(e)}},s.ua=function(){return this.h},s.Qa=function(){return"string"===typeof this.f?this.f:String(this.f)},s=Qn.prototype,s.ha=8,s.v=1,s.Ba=function(t){if(this.h)if(this.h=null,1==this.v){if(!t){this.R=Math.floor(1e5*Math.random()),t=this.R++;var e,n=new Ce(this,this.c,t,void 0),r=this.l;if(this.O&&(r?(r=F(r),V(r,this.O)):r=this.O),null===this.i&&(n.B=r),this.da)t:{for(var i=e=0;i<this.g.length;i++){var o=this.g[i];if(o="__data__"in o.a&&(o=o.a.__data__,"string"===typeof o)?o.length:void 0,void 0===o)break;if(e+=o,4096<e){e=i;break t}if(4096===e||i===this.g.length-1){e=i+1;break t}}e=1e3}else e=1e3;e=rr(this,n,e),i=ze(this.B),Je(i,"RID",t),Je(i,"CVER",22),this.A&&Je(i,"X-HTTP-Session-Id",this.A),nr(this,i),this.i&&r&&Kn(i,this.i,r),Tn(this.b,n),this.Ga&&Je(i,"TYPE","init"),this.da?(Je(i,"$req",e),Je(i,"SID","null"),n.V=!0,Ae(n,i,null)):Ae(n,i,e),this.v=2}}else 3==this.v&&(t?er(this,t):0==this.g.length||wn(this.b)||er(this))},s.Aa=function(){if(this.j=null,ar(this),this.V&&!(this.F||null==this.a||0>=this.N)){var t=2*this.N;this.c.info("BP detection timer enabled: "+t),this.s=de(_(this.Sa,this),t)}},s.Sa=function(){this.s&&(this.s=null,this.c.info("BP detection timeout reached."),this.c.info("Buffering proxy detected and switch to long-polling!"),this.H=!1,this.F=!0,Xn(this),ar(this))},s.Ra=function(){null!=this.m&&(this.m=null,Xn(this),or(this),fe(19))},s.Xa=function(t){t?(this.c.info("Successfully pinged google.com"),fe(2)):(this.c.info("Failed to ping google.com"),fe(1))},s=vr.prototype,s.ta=function(){},s.sa=function(){},s.ra=function(){},s.qa=function(){},s.Ha=function(){},gr.prototype.a=function(t,e){return new yr(t,e)},E(yr,Pt),s=yr.prototype,s.addEventListener=function(t,e,n,r){yr.S.addEventListener.call(this,t,e,n,r)},s.removeEventListener=function(t,e,n,r){yr.S.removeEventListener.call(this,t,e,n,r)},s.Oa=function(){this.a.f=this.f,this.h&&(this.a.C=!0);var t=this.a,e=this.l,n=this.b||void 0;fe(0),t.fa=e,t.W=n||{},t.H=t.T,t.B=pr(t,null,t.fa),Zn(t)},s.close=function(){Yn(this.a)},s.Pa=function(t){if("string"===typeof t){var e={};e.__data__=t,Jn(this.a,e)}else this.g?(e={},e.__data__=Dt(t),Jn(this.a,e)):Jn(this.a,t)},s.G=function(){this.a.f=null,delete this.f,Yn(this.a),delete this.a,yr.S.G.call(this)},E(mr,Ee),E(_r,Ie),E(br,vr),br.prototype.ta=function(){this.a.dispatchEvent("a")},br.prototype.sa=function(t){this.a.dispatchEvent(new mr(t))},br.prototype.ra=function(t){this.a.dispatchEvent(new _r(t))},br.prototype.qa=function(){this.a.dispatchEvent("b")},gr.prototype.createWebChannel=gr.prototype.a,yr.prototype.send=yr.prototype.Pa,yr.prototype.open=yr.prototype.Oa,yr.prototype.close=yr.prototype.close,ve.NO_ERROR=0,ve.TIMEOUT=8,ve.HTTP_ERROR=6,ge.COMPLETE="complete",_e.EventType=we,we.OPEN="a",we.CLOSE="b",we.ERROR="c",we.MESSAGE="d",Pt.prototype.listen=Pt.prototype.va,xn.prototype.listenOnce=xn.prototype.wa,xn.prototype.getLastError=xn.prototype.Qa,xn.prototype.getLastErrorCode=xn.prototype.ua,xn.prototype.getStatus=xn.prototype.X,xn.prototype.getResponseJson=xn.prototype.Na,xn.prototype.getResponseText=xn.prototype.$,xn.prototype.send=xn.prototype.ba;var wr={createWebChannelTransport:function(){return new gr},ErrorCode:ve,EventType:ge,WebChannel:_e,XhrIo:xn},Er=wr.createWebChannelTransport,Ir=wr.ErrorCode,Tr=wr.EventType,Cr=wr.WebChannel,Sr=wr.XhrIo;e["default"]=wr}.call(this,n("c8ba"))},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}t.exports=n},ca84:function(t,e,n){var r=n("e330"),i=n("1a2d"),o=n("fc6a"),s=n("4d64").indexOf,a=n("d012"),u=r([].push);t.exports=function(t,e){var n,r=o(t),c=0,h=[];for(n in r)!i(a,n)&&i(r,n)&&u(h,n);while(e.length>c)i(r,n=e[c++])&&(~s(h,n)||u(h,n));return h}},cb2d:function(t,e,n){var r=n("1626"),i=n("9bf2"),o=n("13d2"),s=n("6374");t.exports=function(t,e,n,a){a||(a={});var u=a.enumerable,c=void 0!==a.name?a.name:e;if(r(n)&&o(n,c,a),a.global)u?t[e]=n:s(e,n);else{try{a.unsafe?t[e]&&(u=!0):delete t[e]}catch(h){}
1728u?t[e]=n:i.f(t,e,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},cc12:function(t,e,n){var r=n("da84"),i=n("861d"),o=r.document,s=i(o)&&i(o.createElement);t.exports=function(t){return s?o.createElement(t):{}}},cc98:function(t,e,n){"use strict";var r=n("23e7"),i=n("c430"),o=n("4738").CONSTRUCTOR,s=n("d256"),a=n("d066"),u=n("1626"),c=n("cb2d"),h=s&&s.prototype;if(r({target:"Promise",proto:!0,forced:o,real:!0},{catch:function(t){return this.then(void 0,t)}}),!i&&u(s)){var l=a("Promise").prototype["catch"];h["catch"]!==l&&c(h,"catch",l,{unsafe:!0})}},cca6:function(t,e,n){var r=n("23e7"),i=n("60da");r({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},cd51:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r=n("9ab4"),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},u=function(t){var e=[],n=0,r=0;while(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){o=t[n++];var s=t[n++],a=t[n++],u=((7&i)<<18|(63&o)<<12|(63&s)<<6|63&a)-65536;e[r++]=String.fromCharCode(55296+(u>>10)),e[r++]=String.fromCharCode(56320+(1023&u))}else{o=t[n++],s=t[n++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return e.join("")},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,u=i+2<t.length,c=u?t[i+2]:0,h=o>>2,l=(3&o)<<4|a>>4,f=(15&a)<<2|c>>6,p=63&c;u||(p=64,s||(f=64)),r.push(n[h],n[l],n[f],n[p])}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):u(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,a=s?n[t.charAt(i)]:0;++i;var u=i<t.length,c=u?n[t.charAt(i)]:64;++i;var h=i<t.length,l=h?n[t.charAt(i)]:64;if(++i,null==o||null==a||null==c||null==l)throw Error();var f=o<<2|a>>4;if(r.push(f),64!==c){var p=a<<4&240|c>>2;if(r.push(p),64!==l){var d=c<<6&192|l;r.push(d)}}}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)}}},h=function(t){var e=a(t);return c.encodeByteArray(e,!0)},l=function(t){try{return c.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null}; 1729/** 1730 * @license 1731 * Copyright 2017 Google LLC 1732 * 1733 * Licensed under the Apache License, Version 2.0 (the "License");
1734 * you may not use this file except in compliance with the License. 1735 * You may obtain a copy of the License at 1736 * 1737 * http://www.apache.org/licenses/LICENSE-2.0 1738 * 1739 * Unless required by applicable law or agreed to in writing, software 1740 * distributed under the License is distributed on an "AS IS" BASIS, 1741 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1742 * See the License for the specific language governing permissions and 1743 * limitations under the License. 1744 */ 1745/** 1746 * @license 1747 * Copyright 2017 Google LLC 1748 * 1749 * Licensed under the Apache License, Version 2.0 (the "License"); 1750 * you may not use this file except in compliance with the License. 1751 * You may obtain a copy of the License at 1752 * 1753 * http://www.apache.org/licenses/LICENSE-2.0 1754 * 1755 * Unless required by applicable law or agreed to in writing, software 1756 * distributed under the License is distributed on an "AS IS" BASIS, 1757 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1758 * See the License for the specific language governing permissions and 1759 * limitations under the License. 1760 */ 1761function f(t){return p(void 0,t)}function p(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:var n=e;return new Date(n.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var r in e)e.hasOwnProperty(r)&&(t[r]=p(t[r],e[r]));return t} 1762/** 1763 * @license 1764 * Copyright 2017 Google LLC 1765 * 1766 * Licensed under the Apache License, Version 2.0 (the "License"); 1767 * you may not use this file except in compliance with the License. 1768 * You may obtain a copy of the License at 1769 * 1770 * http://www.apache.org/licenses/LICENSE-2.0 1771 * 1772 * Unless required by applicable law or agreed to in writing, software 1773 * distributed under the License is distributed on an "AS IS" BASIS, 1774 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1775 * See the License for the specific language governing permissions and 1776 * limitations under the License. 1777 */var d=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}(); 1778/** 1779 * @license 1780 * Copyright 2017 Google LLC 1781 * 1782 * Licensed under the Apache License, Version 2.0 (the "License"); 1783 * you may not use this file except in compliance with the License. 1784 * You may obtain a copy of the License at 1785 * 1786 * http://www.apache.org/licenses/LICENSE-2.0 1787 * 1788 * Unless required by applicable law or agreed to in writing, software 1789 * distributed under the License is distributed on an "AS IS" BASIS, 1790 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1791 * See the License for the specific language governing permissions and 1792 * limitations under the License. 1793 */function v(){return"undefined"!==typeof navigator&&"string"===typeof navigator["userAgent"]?navigator["userAgent"]:""}function g(){return"undefined"!==typeof window&&!!(window["cordova"]||window["ph
1793onegap"]||window["PhoneGap"])&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(v())}function y(){try{return"[object process]"===Object.prototype.toString.call(t.process)}catch(e){return!1}}function m(){return"object"===typeof self&&self.self===self}function _(){var t="object"===typeof chrome?chrome.runtime:"object"===typeof browser?browser.runtime:void 0;return"object"===typeof t&&void 0!==t.id}function b(){return"object"===typeof navigator&&"ReactNative"===navigator["product"]}function w(){return v().indexOf("Electron/")>=0}function E(){var t=v();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function I(){return v().indexOf("MSAppHost/")>=0}function T(){return!0===i.NODE_CLIENT||!0===i.NODE_ADMIN}function C(){return!y()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function S(){return"indexedDB"in self&&null!=indexedDB}function O(){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(o){e(o)}}))}function N(){return!(!navigator||!navigator.cookieEnabled)} 1794/** 1795 * @license 1796 * Copyright 2017 Google LLC 1797 * 1798 * Licensed under the Apache License, Version 2.0 (the "License"); 1799 * you may not use this file except in compliance with the License. 1800 * You may obtain a copy of the License at 1801 * 1802 * http://www.apache.org/licenses/LICENSE-2.0 1803 * 1804 * Unless required by applicable law or agreed to in writing, software 1805 * distributed under the License is distributed on an "AS IS" BASIS, 1806 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1807 * See the License for the specific language governing permissions and 1808 * limitations under the License. 1809 */var A="FirebaseError",k=function(t){function e(n,r){var i=t.call(this,r)||this;return i.code=n,i.name=A,Object.setPrototypeOf(i,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,R.prototype.create),i}return r.__extends(e,t),e}(Error),R=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?P(o,r):"Error",a=this.serviceName+": "+s+" ("+i+").",u=new k(i,a),c=0,h=Object.keys(r);c<h.length;c++){var l=h[c];"_"!==l.slice(-1)&&(l in u&&console.warn('Overwriting FirebaseError base field "'+l+'" can cause unexpected behavior.'),u[l]=r[l])}return u},t}();function P(t,e){return t.replace(x,(function(t,n){var r=e[n];return null!=r?String(r):"<"+n+"?>"}))}var x=/\{\$([^}]+)}/g; 1810/** 1811 * @license 1812 * Copyright 2017 Google LLC 1813 * 1814 * Licensed under the Apache License, Version 2.0 (the "License"); 1815 * you may not use this file except in compliance with the License. 1816 * You may obtain a copy of the License at 1817 * 1818 * http://www.apache.org/licenses/LICENSE-2.0 1819 * 1820 * Unless required by applicable law or agreed to in writing, software 1821 * distributed under the License is distributed on an "AS IS" BASIS, 1822 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1823 * See the License for the specific language governing permissions and 1824 * limitations under the License. 1825 */function D(t){return JSON.parse(t)}function L(t){return JSON.stringify(t)} 1826/** 1827 * @license 1828 * Copyright 2017 Google LLC 1829 * 1830 * Licensed under the Apache License, Version 2.0 (the "License"); 1831 * you may not use this file except in compliance with the License. 1832 * You may obtain a copy of the License at 1833 * 1834 * http://www.apache.org/licenses/LICENSE-2.0 1835 * 1836 * Unless required by applicable law or agreed to in writing, software 1837 * distributed under the License is distributed on an "AS IS" BASIS, 1838 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1839 * See the License for the specific language governing permissions and 1840 * limitations under the License. 1841 */var j=function(t){var e={},n={},r={},i="";try{var o=t.split(".");e=D(l(o[0])||""),n=D(l(o[1])||""),i=o[2],r=n["d"]||{},delete n["d"]}catch(s){}return{header:e,claims:n,data:r,signature:i}},M=function(t){var e=j(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},F=function(t){var e=j(t).claims;return"object"===typeof e&&e.hasOwnProperty("iat")?e["iat"]:null},U=function(t){var e=j(t),n=e.claims;return!!n&&"object"===typeof n&&n.hasOwnProperty("iat")},V=function(t){var e=j(t).claims;return"object"===typeof e&&!0===e["admin"]}; 1842/** 1843 * @license 1844 * Copyright 2017 Google LLC 1845 * 1846 * Licensed under the Apache License, Version 2.0 (the "License");
1847 * you may not use this file except in compliance with the License. 1848 * You may obtain a copy of the License at 1849 * 1850 * http://www.apache.org/licenses/LICENSE-2.0 1851 * 1852 * Unless required by applicable law or agreed to in writing, software 1853 * distributed under the License is distributed on an "AS IS" BASIS, 1854 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1855 * See the License for the specific language governing permissions and 1856 * limitations under the License. 1857 */ 1858function q(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function B(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function W(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function G(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} 1859/** 1860 * @license 1861 * Copyright 2017 Google LLC 1862 * 1863 * Licensed under the Apache License, Version 2.0 (the "License"); 1864 * you may not use this file except in compliance with the License. 1865 * You may obtain a copy of the License at 1866 * 1867 * http://www.apache.org/licenses/LICENSE-2.0 1868 * 1869 * Unless required by applicable law or agreed to in writing, software 1870 * distributed under the License is distributed on an "AS IS" BASIS, 1871 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1872 * See the License for the specific language governing permissions and 1873 * limitations under the License. 1874 */function H(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],s=o[0],a=o[1];n(s,a)}return e.length?"&"+e.join("&"):""}function K(t){var e={},n=t.replace(/^\?/,"").split("&");return n.forEach((function(t){if(t){var n=t.split("=");e[n[0]]=n[1]}})),e} 1875/** 1876 * @license 1877 * Copyright 2017 Google LLC 1878 * 1879 * Licensed under the Apache License, Version 2.0 (the "License"); 1880 * you may not use this file except in compliance with the License. 1881 * You may obtain a copy of the License at 1882 * 1883 * http://www.apache.org/licenses/LICENSE-2.0 1884 * 1885 * Unless required by applicable law or agreed to in writing, software 1886 * distributed under the License is distributed on an "AS IS" BASIS, 1887 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1888 * See the License for the specific language governing permissions and 1889 * limitations under the License. 1890 */var z=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],u=this.chain_[1],c=this.chain_[2],h=this.chain_[3],l=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(o=h^u&(c^h),s=1518500249):(o=u^c^h,s=1859775393):r<60?(o=u&c|h&(u|c),s=2400959708):(o=u^c^h,s=3395469782);i=(a<<5|a>>>27)+o+l+s+n[r]&4294967295;l=h,h=c,c=4294967295&(u<<30|u>>>2),u=a,a=i}this.chain_[0]=this.chain_[0]+a&4294967295,this.chain_[1]=this.chain_[1]+u&4294967295,this.chain_[2]=this.chain_[2]+c&4294967295,this.chain_[3]=this.chain_[3]+h&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295},t.prototype.update=function(t,e){if(null!=t){void 0===e&&(e=t.length);var n=e-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;while(r<e){if(0===o)while(r<=n)this.compress_(t,r),r+=this.blockSize;if("string"===typeof t){while(r<e)if(i[o]=t.charCodeAt(r),++o,++r,o===this.blockSize){this.compress_(i),o=0;break}}else while(r<e)if(i[o]=t[r],++o,++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}();function Q(t,e){var n=new Y(t,e);return n.subscribe.bind(n)}var Y=function(){function t(t,e){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Prom
1890ise.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.");r=$(t,["next","error","complete"])?t:{next:t,error:e,complete:n},void 0===r.next&&(r.next=J),void 0===r.error&&(r.error=J),void 0===r.complete&&(r.complete=J);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(r){"undefined"!==typeof console&&console.error&&console.error(r)}}))},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 X(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)}))}}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}function J(){} 1891/** 1892 * @license 1893 * Copyright 2017 Google LLC 1894 * 1895 * Licensed under the Apache License, Version 2.0 (the "License"); 1896 * you may not use this file except in compliance with the License. 1897 * You may obtain a copy of the License at 1898 * 1899 * http://www.apache.org/licenses/LICENSE-2.0 1900 * 1901 * Unless required by applicable law or agreed to in writing, software 1902 * distributed under the License is distributed on an "AS IS" BASIS, 1903 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1904 * See the License for the specific language governing permissions and 1905 * limitations under the License. 1906 */var Z=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){var o=t+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".";throw new Error(o)}};function tt(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 ",i}function et(t,e,n,r){if((!r||n)&&"string"!==typeof n)throw new Error(tt(t,e,r)+"must be a valid firebase namespace.")}function nt(t,e,n,r){if((!r||n)&&"function"!==typeof n)throw new Error(tt(t,e,r)+"must be a valid function.")}function rt(t,e,n,r){if((!r||n)&&("object"!==typeof n||null===n))throw new Error(tt(t,e,r)+"must be a valid context object.")} 1907/** 1908 * @license 1909 * Copyright 2017 Google LLC 1910 * 1911 * Licensed under the Apache License, Version 2.0 (the "License"); 1912 * you may not use this file except in compliance with the License. 1913 * You may obtain a copy of the License at 1914 * 1915 * http://www.apache.org/licenses/LICENSE-2.0 1916 * 1917 * Unless required by applicable law or agreed to in writing, software 1918 * distributed under the License is distributed on an "AS IS" BASIS, 1919 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1920 * See the License for the specific language governing permissions and 1921 * limitations under the License. 1922 */var it=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.");var a=t.charCodeAt(r)-56320;i=65536+(s<<10)+a}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},ot=function(t){for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);
1922r<128?e++:r<2048?e+=2:r>=55296&&r<=56319?(e+=4,n++):e+=3}return e},st=1e3,at=2,ut=144e5,ct=.5;function ht(t,e,n){void 0===e&&(e=st),void 0===n&&(n=at);var r=e*Math.pow(n,t),i=Math.round(ct*r*(Math.random()-.5)*2);return Math.min(ut,r+i)}e.CONSTANTS=i,e.Deferred=d,e.ErrorFactory=R,e.FirebaseError=k,e.MAX_VALUE_MILLIS=ut,e.RANDOM_FACTOR=ct,e.Sha1=z,e.areCookiesEnabled=N,e.assert=o,e.assertionError=s,e.async=X,e.base64=c,e.base64Decode=l,e.base64Encode=h,e.calculateBackoffMillis=ht,e.contains=q,e.createSubscribe=Q,e.decode=j,e.deepCopy=f,e.deepExtend=p,e.errorPrefix=tt,e.getUA=v,e.isAdmin=V,e.isBrowser=m,e.isBrowserExtension=_,e.isElectron=w,e.isEmpty=W,e.isIE=E,e.isIndexedDBAvailable=S,e.isMobileCordova=g,e.isNode=y,e.isNodeSdk=T,e.isReactNative=b,e.isSafari=C,e.isUWP=I,e.isValidFormat=U,e.isValidTimestamp=M,e.issuedAtTime=F,e.jsonEval=D,e.map=G,e.querystring=H,e.querystringDecode=K,e.safeGet=B,e.stringLength=ot,e.stringToByteArray=it,e.stringify=L,e.validateArgCount=Z,e.validateCallback=nt,e.validateContextObject=rt,e.validateIndexedDBOpenable=O,e.validateNamespace=et}).call(this,n("c8ba"))},cdf9:function(t,e,n){var r=n("825a"),i=n("861d"),o=n("f069");t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t),s=n.resolve;return s(e),n.promise}},d012:function(t,e){t.exports={}},d039:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,n){var r=n("da84"),i=n("1626"),o=function(t){return i(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?o(r[t]):r[t]&&r[t][e]}},d1e7:function(t,e,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!r.call({1:2},1);e.f=o?function(t){var e=i(this,t);return!!e&&e.enumerable}:r},d256:function(t,e,n){var r=n("da84");t.exports=r.Promise},d2bb:function(t,e,n){var r=n("e330"),i=n("825a"),o=n("3bbe");
1922t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),t(n,[]),e=n instanceof Array}catch(s){}return function(n,r){return i(n),o(r),e?t(n,r):n.__proto__=r,n}}():void 0)},d44e:function(t,e,n){var r=n("9bf2").f,i=n("1a2d"),o=n("b622"),s=o("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!i(t,s)&&r(t,s,{configurable:!0,value:e})}},d4c3:function(t,e,n){var r=n("342f"),i=n("da84");t.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==i.Pebble},d6d6:function(t,e){var n=TypeError;t.exports=function(t,e){if(t<e)throw n("Not enough arguments");return t}},d9b5:function(t,e,n){var r=n("d066"),i=n("1626"),o=n("3a9b"),s=n("fdbf"),a=Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return i(e)&&o(e.prototype,a(t))}},da84:function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,n("c8ba"))},dc4a:function(t,e,n){var r=n("59ed");t.exports=function(t,e){var n=t[e];return null==n?void 0:r(n)}},dcaa:function(t,e,n){"use strict";n.r(e),n.d(e,"factory",(function(){return rt})),n.d(e,"getGlobalVars",(function(){return tt})),n.d(e,"registerAnalytics",(function(){return at})),n.d(e,"resetGlobalVars",(function(){return Z})),n.d(e,"settings",(function(){return et}));var r,i,o=n("9ab4"),s=n("c23d"),a=n.n(s),u=(n("7d28"),n("abfd")),c=n("cd51"),h=n("4be4"),l="firebase_id",f="origin",p=6e4,d="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig",v="https://www.googletagmanager.com/gtag/js"; 1923/** 1924 * @license 1925 * Copyright 2019 Google LLC 1926 * 1927 * Licensed under the Apache License, Version 2.0 (the "License"); 1928 * you may not use this file except in compliance with the License. 1929 * You may obtain a copy of the License at 1930 * 1931 * http://www.apache.org/licenses/LICENSE-2.0 1932 * 1933 * Unless required by applicable law or agreed to in writing, software 1934 * distributed under the License is distributed on an "AS IS" BASIS, 1935 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1936 * See the License for the specific language governing permissions and 1937 * limitations under the License. 1938 */ 1939function g(t,e,n,i,s){return Object(o["__awaiter"])(this,void 0,void 0,(function(){var a,u;return Object(o["__generator"])(this,(function(c){switch(c.label){case 0:return s&&s.global?(t(r.EVENT,n,i),[2]):[3,1];case 1:return[4,e];case 2:a=c.sent(),u=Object(o["__assign"])(Object(o["__assign"])({},i),{send_to:a}),t(r.EVENT,n,u),c.label=3;case 3:return[2]}}
1939))}))}function y(t,e,n,i){return Object(o["__awaiter"])(this,void 0,void 0,(function(){var s;return Object(o["__generator"])(this,(function(o){switch(o.label){case 0:return i&&i.global?(t(r.SET,{screen_name:n}),[2,Promise.resolve()]):[3,1];case 1:return[4,e];case 2:s=o.sent(),t(r.CONFIG,s,{update:!0,screen_name:n}),o.label=3;case 3:return[2]}}))}))}function m(t,e,n,i){return Object(o["__awaiter"])(this,void 0,void 0,(function(){var s;return Object(o["__generator"])(this,(function(o){switch(o.label){case 0:return i&&i.global?(t(r.SET,{user_id:n}),[2,Promise.resolve()]):[3,1];case 1:return[4,e];case 2:s=o.sent(),t(r.CONFIG,s,{update:!0,user_id:n}),o.label=3;case 3:return[2]}}))}))}function _(t,e,n,i){return Object(o["__awaiter"])(this,void 0,void 0,(function(){var s,a,u,c,h;return Object(o["__generator"])(this,(function(o){switch(o.label){case 0:if(!i||!i.global)return[3,1];for(s={},a=0,u=Object.keys(n);a<u.length;a++)c=u[a],s["user_properties."+c]=n[c];return t(r.SET,s),[2,Promise.resolve()];case 1:return[4,e];case 2:h=o.sent(),t(r.CONFIG,h,{update:!0,user_properties:n}),o.label=3;case 3:return[2]}}
1939))}))}function b(t,e){return Object(o["__awaiter"])(this,void 0,void 0,(function(){var n;return Object(o["__generator"])(this,(function(r){switch(r.label){case 0:return[4,t];case 1:return n=r.sent(),window["ga-disable-"+n]=!e,[2]}}))}))} 1940/** 1941 * @license 1942 * Copyright 2019 Google LLC 1943 * 1944 * Licensed under the Apache License, Version 2.0 (the "License"); 1945 * you may not use this file except in compliance with the License. 1946 * You may obtain a copy of the License at 1947 * 1948 * http://www.apache.org/licenses/LICENSE-2.0 1949 * 1950 * Unless required by applicable law or agreed to in writing, software 1951 * distributed under the License is distributed on an "AS IS" BASIS, 1952 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1953 * See the License for the specific language governing permissions and 1954 * limitations under the License. 1955 */(function(t){t["EVENT"]="event",t["SET"]="set",t["CONFIG"]="config"})(r||(r={})),function(t){t["ADD_SHIPPING_INFO"]="add_shipping_info",t["ADD_PAYMENT_INFO"]="add_payment_info",t["ADD_TO_CART"]="add_to_cart",t["ADD_TO_WISHLIST"]="add_to_wishlist",t["BEGIN_CHECKOUT"]="begin_checkout",t["CHECKOUT_PROGRESS"]="checkout_progress",t["EXCEPTION"]="exception",t["GENERATE_LEAD"]="generate_lead",t["LOGIN"]="login",t["PAGE_VIEW"]="page_view",t["PURCHASE"]="purchase",t["REFUND"]="refund",t["REMOVE_FROM_CART"]="remove_from_cart",t["SCREEN_VIEW"]="screen_view",t["SEARCH"]="search",t["SELECT_CONTENT"]="select_content",t["SELECT_ITEM"]="select_item",t["SELECT_PROMOTION"]="select_promotion",t["SET_CHECKOUT_OPTION"]="set_checkout_option",t["SHARE"]="share",t["SIGN_UP"]="sign_up",t["TIMING_COMPLETE"]="timing_complete",t["VIEW_CART"]="view_cart",t["VIEW_ITEM"]="view_item",t["VIEW_ITEM_LIST"]="view_item_list",t["VIEW_PROMOTION"]="view_promotion",t["VIEW_SEARCH_RESULTS"]="view_search_results"}(i||(i={}));var w,E=new u["Logger"]("@firebase/analytics"); 1956/** 1957 * @license 1958 * Copyright 2019 Google LLC 1959 * 1960 * Licensed under the Apache License, Version 2.0 (the "License"); 1961 * you may not use this file except in compliance with the License. 1962 * You may obtain a copy of the License at 1963 * 1964 * http://www.apache.org/licenses/LICENSE-2.0 1965 * 1966 * Unless required by applicable law or agreed to in writing, software 1967 * distributed under the License is distributed on an "AS IS" BASIS, 1968 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1969 * See the License for the specific language governing permissions and 1970 * limitations under the License. 1971 */function I(t){var e=document.createElement("script");e.src=v+"?l="+t,e.async=!0,document.head.appendChild(e)}function T(t){var e=[];return Array.isArray(window[t])?e=window[t]:window[t]=e,e}function C(t,e,n,i,s,a){return Object(o["__awaiter"])(this,void 0,void 0,(function(){var u,c,h,l;return Object(o["__generator"])(this,(function(o){switch(o.label){case 0:u=i[s],o.label=1;case 1:return o.trys.push([1,7,,8]),u?[4,e[u]]:[3,3];case 2:return o.sent(),[3,6];case 3:return[4,Promise.all(n)];case 4:return c=o.sent(),h=c.find((function(t){return t.measurementId===s})),h?[4,e[h.appId]]:[3,6];case 5:o.sent(),o.label=6;case 6:return[3,8];case 7:return l=o.sent(),E.error(l),[3,8];case 8:return t(r.CONFIG,s,a),[2]}}))}))}function S(t,e,n,i,s){return Object(o["__awaiter"])(this,void 0,void 0,(function(){var a,u,c,h,l,f,p,d,v;return Object(o["__generator"])(this,(function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),a=[],s&&s["send_to"]?(u=s["send_to"],Array.isArray(u)||(u=[u]),[4,Promise.all(n)]):[3,2];case 1:for(c=o.sent(),h=function(t){var n=c.find((function(e){return e.measurementId===t})),r=n&&e[n.appId];if(!r)return a=[],"break";a.push(r)},l=0,f=u;l<f.length;l++)if(p=f[l],d=h(p),"break"===d)break;o.label=2;case 2:return 0===a.length&&(a=Object.values(e)),[4,Promise.all(a)];case 3:return o.sent(),t(r.EVENT,i,s||{}),[3,5];case 4:return v=o.sent(),E.error(v),[3,5];case 5:return[2]}}
1971))}))}function O(t,e,n,i){function s(s,a,u){return Object(o["__awaiter"])(this,void 0,void 0,(function(){var c;return Object(o["__generator"])(this,(function(o){switch(o.label){case 0:return o.trys.push([0,6,,7]),s!==r.EVENT?[3,2]:[4,S(t,e,n,a,u)];case 1:return o.sent(),[3,5];case 2:return s!==r.CONFIG?[3,4]:[4,C(t,e,n,i,a,u)];case 3:return o.sent(),[3,5];case 4:t(r.SET,a),o.label=5;case 5:return[3,7];case 6:return c=o.sent(),E.error(c),[3,7];case 7:return[2]}}))}))}return s}function N(t,e,n,r,i){var o=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];window[r].push(arguments)};return window[i]&&"function"===typeof window[i]&&(o=window[i]),window[i]=O(o,t,e,n),{gtagCore:o,wrappedGtag:window[i]}}function A(){for(var t=window.document.getElementsByTagName("script"),e=0,n=Object.values(t);e<n.length;e++){var r=n[e];if(r.src&&r.src.includes(v))return r}return null} 1972/** 1973 * @license 1974 * Copyright 2019 Google LLC 1975 * 1976 * Licensed under the Apache License, Version 2.0 (the "License"); 1977 * you may not use this file except in compliance with the License. 1978 * You may obtain a copy of the License at 1979 * 1980 * http://www.apache.org/licenses/LICENSE-2.0 1981 * 1982 * Unless required by applicable law or agreed to in writing, software 1983 * distributed under the License is distributed on an "AS IS" BASIS, 1984 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1985 * See the License for the specific language governing permissions and 1986 * limitations under the License. 1987 */var k=(w={},w["already-exists"]="A Firebase Analytics instance with the appId {$id} already exists. Only one Firebase Analytics instance can be created for each appId.",w["already-initialized"]="Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.",w["interop-component-reg-failed"]="Firebase Analytics Interop Component failed to instantiate: {$reason}",w["invalid-analytics-context"]="Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}",w["indexeddb-unavailable"]="IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}",w["fetch-throttle"]="The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.",w["config-fetch-failed"]="Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}",w["no-api-key"]='The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',w["no-app-id"]='The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',w),R=new c["ErrorFactory"]("analytics","Analytics",k),P=30,x=1e3,D=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=x),this.throttleMetadata=t,this.intervalMillis=e}return t.prototype.getThrottleMetadata=function(t){return this.throttleMetadata[t]},t.prototype.setThrottleMetadata=function(t,e){this.throttleMetadata[t]=e},t.prototype.deleteThrottleMetadata=function(t){delete this.throttleMetadata[t]},t}(),L=new D;function j(t){return new Headers({Accept:"application/json","x-goog-api-key":t})}function M(t){var e;return Object(o["__awaiter"])(this,void 0,void 0,(function(){var n,r,i,s,a,u,c;return Object(o["__generator"])(this,(function(o){switch(o.label){case 0:return n=t.appId,r=t.apiKey,i={method:"GET",headers:j(r)},s=d.replace("{app-id}",n),[4,fetch(s,i)];case 1:if(a=o.sent(),200===a.status||304===a.status)return[3,6];u="",o.label=2;case 2:return o.trys.push([2,4,,5]),[4,a.json()];case 3:return c=o.sent(),(null===(e=c.error)||void 0===e?void 0:e.message)&&(u=c.error.message),[3,5];case 4:return o.sent(),[3,5];case 5:throw R.create("config-fetch-failed",{httpStatus:a.status,responseMessage:u});case 6:return[2,a.json()]}}))}))}function F(t,e,n){return void 0===e&&(e=L),Object(o["__awaiter"])(this,void 0,void 0,(function(){var r,i,s,a,u,c,h=this;return Object(o["__generator"])(this,(function(l){if(r=t.options,i=r.appId,s=r.apiKey,a=r.measurementId,!i)throw R.create("no-app-id");if(!s){if(a)return[2,{measurementId:a,appId:i}];throw R.create("no-api-key")}return u=e.getThrottleMetadata(i)||{backoffCount:0,throttleEndTimeMillis:Date.now()},c=new B,setTimeout((function(){return Object(o["__awaiter"])(h,void 0,void 0,(function(){return Object(o["__generator"])(this,(function(t){return c.abort(),[2]}))}
1987))}),void 0!==n?n:p),[2,U({appId:i,apiKey:s,measurementId:a},u,c,e)]}))}))}function U(t,e,n,r){var i=e.throttleEndTimeMillis,s=e.backoffCount;return void 0===r&&(r=L),Object(o["__awaiter"])(this,void 0,void 0,(function(){var e,a,u,h,l,f,p;return Object(o["__generator"])(this,(function(o){switch(o.label){case 0:e=t.appId,a=t.measurementId,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,V(n,i)];case 2:return o.sent(),[3,4];case 3:if(u=o.sent(),a)return E.warn("Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID "+a+' provided in the "measurementId" field in the local Firebase config. ['+u.message+"]"),[2,{appId:e,measurementId:a}];throw u;case 4:return o.trys.push([4,6,,7]),[4,M(t)];case 5:return h=o.sent(),r.deleteThrottleMetadata(e),[2,h];case 6:if(l=o.sent(),!q(l)){if(r.deleteThrottleMetadata(e),a)return E.warn("Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID "+a+' provided in the "measurementId" field in the local Firebase config. ['+l.message+"]"),[2,{appId:e,measurementId:a}];throw l}return f=503===Number(l.httpStatus)?Object(c["calculateBackoffMillis"])(s,r.intervalMillis,P):Object(c["calculateBackoffMillis"])(s,r.intervalMillis),p={throttleEndTimeMillis:Date.now()+f,backoffCount:s+1},r.setThrottleMetadata(e,p),E.debug("Calling attemptFetch again in "+f+" millis"),[2,U(t,p,n,r)];case 7:return[2]}}
1987))}))}function V(t,e){return new Promise((function(n,r){var i=Math.max(e-Date.now(),0),o=setTimeout(n,i);t.addEventListener((function(){clearTimeout(o),r(R.create("fetch-throttle",{throttleEndTimeMillis:e}))}))}))}function q(t){if(!(t instanceof c["FirebaseError"]))return!1;var e=Number(t["httpStatus"]);return 429===e||500===e||503===e||504===e}var B=function(){function t(){this.listeners=[]}return t.prototype.addEventListener=function(t){this.listeners.push(t)},t.prototype.abort=function(){this.listeners.forEach((function(t){return t()}))},t}(); 1988/** 1989 * @license 1990 * Copyright 2020 Google LLC 1991 * 1992 * Licensed under the Apache License, Version 2.0 (the "License"); 1993 * you may not use this file except in compliance with the License. 1994 * You may obtain a copy of the License at 1995 * 1996 * http://www.apache.org/licenses/LICENSE-2.0 1997 * 1998 * Unless required by applicable law or agreed to in writing, software 1999 * distributed under the License is distributed on an "AS IS" BASIS, 2000 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2001 * See the License for the specific language governing permissions and 2002 * limitations under the License. 2003 */function W(){return Object(o["__awaiter"])(this,void 0,void 0,(function(){var t;return Object(o["__generator"])(this,(function(e){switch(e.label){case 0:return Object(c["isIndexedDBAvailable"])()?[3,1]:(E.warn(R.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),[2,!1]);case 1:return e.trys.push([1,3,,4]),[4,Object(c["validateIndexedDBOpenable"])()];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),E.warn(R.create("indexeddb-unavailable",{errorInfo:t}).message),[2,!1];case 4:return[2,!0]}}))}))}function G(t,e,n,i,s){return Object(o["__awaiter"])(this,void 0,void 0,(function(){var a,u,c,h,p,d,v;return Object(o["__generator"])(this,(function(o){switch(o.label){case 0:return a=F(t),a.then((function(e){n[e.measurementId]=e.appId,t.options.measurementId&&e.measurementId!==t.options.measurementId&&E.warn("The measurement ID in the local Firebase config ("+t.options.measurementId+") does not match the measurement ID fetched from the server ("+e.measurementId+"). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.")})).catch((function(t){return E.error(t)})),e.push(a),u=W().then((function(t){return t?i.getId():void 0})),[4,Promise.all([a,u])];case 1:return c=o.sent(),h=c[0],p=c[1],s("js",new Date),v={},v[f]="firebase",v.update=!0,d=v,null!=p&&(d[l]=p),s(r.CONFIG,h.measurementId,d),[2,h.measurementId]}}))}))} 2004/** 2005 * @license 2006 * Copyright 2019 Google LLC 2007 * 2008 * Licensed under the Apache License, Version 2.0 (the "License"); 2009 * you may not use this file except in compliance with the License. 2010 * You may obtain a copy of the License at 2011 * 2012 * http://www.apache.org/licenses/LICENSE-2.0 2013 * 2014 * Unless required by applicable law or agreed to in writing, software 2015 * distributed under the License is distributed on an "AS IS" BASIS, 2016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2017 * See the License for the specific language governing permissions and 2018 * limitations under the License. 2019 */var H,K,z={},Q=[],Y={},X="dataLayer",$="gtag",J=!1;function Z(t,e,n){void 0===t&&(t=!1),void 0===e&&(e={}),void 0===n&&(n=[]),J=t,z=e,Q=n,X="dataLayer",$="gtag"}function tt(){return{initializationPromisesMap:z,dynamicConfigPromisesList:Q}}function et(t){if(J)throw R.create("already-initialized");t.dataLayerName&&(X=t.dataLayerName),t.gtagName&&($=t.gtagName)}function nt(){var t=[];if(Object(c["isBrowserExtension"])()&&t.push("This is a browser extension environment."),Object(c["areCookiesEnabled"])()||t.push("Cookies are not available."),t.length>0){var e=t.map((function(t,e){return"("+(e+1)+") "+t})).join(" "),n=R.create("invalid-analytics-context",{errorInfo:e});E.warn(n.message)}}function rt(t,e){nt();var n=t.options.appId;if(!n)throw R.create("no-app-id");if(!t.options.apiKey){if(!t.options.measurementId)throw R.create("no-api-key");E.warn('The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID '+t.options.measurementId+' provided in the "measurementId" field in the local Firebase config.')}if(null!=z[n])throw R.create("already-exists",{id:n});if(!J){A()||I(X),T(X);var r=N(z,Q,Y,X,$),i=r.wrappedGtag,o=r.gtagCore;K=i,H=o,J=!0}z[n]=G(t,Q,Y,e,H);
2019var s={app:t,logEvent:function(t,e,r){g(K,z[n],t,e,r).catch((function(t){return E.error(t)}))},setCurrentScreen:function(t,e){y(K,z[n],t,e).catch((function(t){return E.error(t)}))},setUserId:function(t,e){m(K,z[n],t,e).catch((function(t){return E.error(t)}))},setUserProperties:function(t,e){_(K,z[n],t,e).catch((function(t){return E.error(t)}))},setAnalyticsCollectionEnabled:function(t){b(z[n],t).catch((function(t){return E.error(t)}))},INTERNAL:{delete:function(){return delete z[n],Promise.resolve()}}};return s}var it="@firebase/analytics",ot="0.6.0",st="analytics";function at(t){function e(t){try{var e=t.getProvider(st).getImmediate();return{logEvent:e.logEvent}}catch(n){throw R.create("interop-component-reg-failed",{reason:n})}}t.INTERNAL.registerComponent(new h["Component"](st,(function(t){var e=t.getProvider("app").getImmediate(),n=t.getProvider("installations").getImmediate();return rt(e,n)}),"PUBLIC").setServiceProps({settings:et,EventName:i,isSupported:ut})),t.INTERNAL.registerComponent(new h["Component"]("analytics-internal",e,"PRIVATE")),t.registerVersion(it,ot)}function ut(){return Object(o["__awaiter"])(this,void 0,void 0,(function(){var t;return Object(o["__generator"])(this,(function(e){switch(e.label){case 0:if(Object(c["isBrowserExtension"])())return[2,!1];if(!Object(c["areCookiesEnabled"])())return[2,!1];if(!Object(c["isIndexedDBAvailable"])())return[2,!1];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Object(c["validateIndexedDBOpenable"])()];case 2:return t=e.sent(),[2,t];case 3:return e.sent(),[2,!1];case 4:return[2]}}
vendor: 3,581 bytes, line 2019
2019))}))}at(a.a)},df75:function(t,e,n){var r=n("ca84"),i=n("7839");t.exports=Object.keys||function(t){return r(t,i)}},df7c:function(t,e,n){(function(t){function n(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t){"string"!==typeof t&&(t+="");var e,n=0,r=-1,i=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!i){n=e+1;break}}else-1===r&&(i=!1,r=e+1);return-1===r?"":t.slice(n,r)}function i(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r<t.length;r++)e(t[r],r,t)&&n.push(t[r]);return n}e.resolve=function(){for(var e="",r=!1,o=arguments.length-1;o>=-1&&!r;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!==typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(e=s+"/"+e,r="/"===s.charAt(0))}return e=n(i(e.split("/"),(function(t){return!!t})),!r).join("/"),(r?"/":"")+e||"."},e.normalize=function(t){var r=e.isAbsolute(t),s="/"===o(t,-1);return t=n(i(t.split("/"),(function(t){return!!t})),!r).join("/"),t||r||(t="."),t&&s&&(t+="/"),(r?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(i(t,(function(t,e){if("string"!==typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))},e.relative=function(t,n){function r(t){for(var e=0;e<t.length;e++)if(""!==t[e])break;for(var n=t.length-1;n>=0;n--)if(""!==t[n])break;return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var i=r(t.split("/")),o=r(n.split("/")),s=Math.min(i.length,o.length),a=s,u=0;u<s;u++)if(i[u]!==o[u]){a=u;break}var c=[];for(u=a;u<i.length;u++)c.push("..");return c=c.concat(o.slice(a)),c.join("/")},e.sep="/",e.delimiter=":",e.dirname=function(t){if("string"!==typeof t&&(t+=""),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,r=-1,i=!0,o=t.length-1;o>=1;--o)if(e=t.charCodeAt(o),47===e){if(!i){r=o;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":t.slice(0,r)},e.basename=function(t,e){var n=r(t);return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},e.extname=function(t){"string"!==typeof t&&(t+="");for(var e=-1,n=0,r=-1,i=!0,o=0,s=t.length-1;s>=0;--s){var a=t.charCodeAt(s);if(47!==a)-1===r&&(i=!1,r=s+1),46===a?-1===e?e=s:1!==o&&(o=1):-1!==e&&(o=-1);else if(!i){n=s+1;break}}return-1===e||-1===r||0===o||1===o&&e===r-1&&e===n+1?"":t.slice(e,r)};var o="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)}}).call(this,n("4362"))},e163:function(t,e,n){var r=n("1a2d"),i=n("1626"),o=n("7b0b"),s=n("f772"),a=n("e177"),u=s("IE_PROTO"),c=Object,h=c.prototype;t.exports=a?c.getPrototypeOf:function(t){var e=o(t);if(r(e,u))return e[u];var n=e.constructor;return i(n)&&e instanceof n?n.prototype:e instanceof c?h:null}},e177:function(t,e,n){var r=n("d039");t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},e260:function(t,e,n){"use strict";var r=n("fc6a"),i=n("44d2"),o=n("3f8c"),s=n("69f3"),a=n("9bf2").f,u=n("7dd0"),c=n("c430"),h=n("83ab"),l="Array Iterator",f=s.set,p=s.getterFor(l);t.exports=u(Array,"Array",(function(t,e){f(this,{type:l,target:r(t),index:0,kind:e})}),(function(){var t=p(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values");var d=o.Arguments=o.Array;
2019if(i("keys"),i("values"),i("entries"),!c&&h&&"values"!==d.name)try{a(d,"name",{value:"values"})}catch(v){}},e330:function(t,e,n){var r=n("40d5"),i=Function.prototype,o=i.bind,s=i.call,a=r&&o.bind(s,s);t.exports=r?function(t){return t&&a(t)}:function(t){return t&&function(){return s.apply(t,arguments)}}},e667:function(t,e){t.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},e6cf:function(t,e,n){n("5e7e"),n("14e5"),n("cc98"),n("3529"),n("f22b"),n("7149")},e893:function(t,e,n){var r=n("1a2d"),i=n("56ef"),o=n("06cf"),s=n("9bf2");t.exports=function(t,e,n){for(var a=i(e),u=s.f,c=o.f,h=0;h<a.length;h++){var l=a[h];r(t,l)||n&&r(n,l)||u(t,l,c(e,l))}}},e89a:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r=n("9ab4"),i=n("c23d"),o=n("abfd"),s=n("cd51"),a=n("c7b2"),u=n("4be4");function c(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var h=c(i),l={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"},f=function(t){function e(e,n){var r=this;return(r=t.call(this,n)||this).code=e,r.message=n,r.name="FirebaseError",r.toString=function(){return r.name+": [code="+r.code+"]: "+r.message},r}return r.__extends(e,t),e}(Error),p=new o.Logger("@firebase/firestore"); 2020/** 2021 * @license 2022 * Copyright 2020 Google LLC 2023 * 2024 * Licensed under the Apache License, Version 2.0 (the "License"); 2025 * you may not use this file except in compliance with the License. 2026 * You may obtain a copy of the License at 2027 * 2028 * http://www.apache.org/licenses/LICENSE-2.0 2029 * 2030 * Unless required by applicable law or agreed to in writing, software 2031 * distributed under the License is distributed on an "AS IS" BASIS, 2032 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2033 * See the License for the specific language governing permissions and 2034 * limitations under the License. 2035 */ 2036/** 2037 * @license 2038 * Copyright 2017 Google LLC 2039 * 2040 * Licensed under the Apache License, Version 2.0 (the "License"); 2041 * you may not use this file except in compliance with the License. 2042 * You may obtain a copy of the License at 2043 * 2044 * http://www.apache.org/licenses/LICENSE-2.0 2045 * 2046 * Unless required by applicable law or agreed to in writing, software 2047 * distributed under the License is distributed on an "AS IS" BASIS, 2048 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2049 * See the License for the specific language governing permissions and 2050 * limitations under the License. 2051 */function d(){return p.logLevel}function v(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(p.logLevel<=o.LogLevel.DEBUG){var i=e.map(m);p.debug.apply(p,r.__spreadArrays(["Firestore (7.23.0): "+t],i))}}function g(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(p.logLevel<=o.LogLevel.ERROR){var i=e.map(m);p.error.apply(p,r.__spreadArrays(["Firestore (7.23.0): "+t],i))}}function y(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(p.logLevel<=o.LogLevel.WARN){var i=e.map(m);p.warn.apply(p,r.__spreadArrays(["Firestore (7.23.0): "+t],i))}}function m(t){if("string"==typeof t)return t;try{return e=t,JSON.stringify(e)}catch(e){return t} 2052/** 2053 * @license 2054 * Copyright 2020 Google LLC 2055 * 2056 * Licensed under the Apache License, Version 2.0 (the "License"); 2057 * you may not use this file except in compliance with the License. 2058 * You may obtain a copy of the License at 2059 * 2060 * http://www.apache.org/licenses/LICENSE-2.0 2061 * 2062 * Unless required by applicable law or agreed to in writing, software 2063 * distributed under the License is distributed on an "AS IS" BASIS, 2064 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2065 * See the License for the specific language governing permissions and 2066 * limitations under the License. 2067 */var e} 2068/** 2069 * @license 2070 * Copyright 2017 Google LLC 2071 * 2072 * Licensed under the Apache License, Version 2.0 (the "License");
2073 * you may not use this file except in compliance with the License. 2074 * You may obtain a copy of the License at 2075 * 2076 * http://www.apache.org/licenses/LICENSE-2.0 2077 * 2078 * Unless required by applicable law or agreed to in writing, software 2079 * distributed under the License is distributed on an "AS IS" BASIS, 2080 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2081 * See the License for the specific language governing permissions and 2082 * limitations under the License. 2083 */function _(t){void 0===t&&(t="Unexpected state");var e="FIRESTORE (7.23.0) INTERNAL ASSERTION FAILED: "+t;throw g(e),new Error(e)}function b(t,e){t||_()}function w(t,e){return t} 2084/** 2085 * @license 2086 * Copyright 2017 Google LLC 2087 * 2088 * Licensed under the Apache License, Version 2.0 (the "License"); 2089 * you may not use this file except in compliance with the License. 2090 * You may obtain a copy of the License at 2091 * 2092 * http://www.apache.org/licenses/LICENSE-2.0 2093 * 2094 * Unless required by applicable law or agreed to in writing, software 2095 * distributed under the License is distributed on an "AS IS" BASIS, 2096 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2097 * See the License for the specific language governing permissions and 2098 * limitations under the License. 2099 */function E(t){var e=0;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function I(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function T(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0} 2100/** 2101 * @license 2102 * Copyright 2017 Google LLC 2103 * 2104 * Licensed under the Apache License, Version 2.0 (the "License"); 2105 * you may not use this file except in compliance with the License. 2106 * You may obtain a copy of the License at 2107 * 2108 * http://www.apache.org/licenses/LICENSE-2.0 2109 * 2110 * Unless required by applicable law or agreed to in writing, software 2111 * distributed under the License is distributed on an "AS IS" BASIS, 2112 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2113 * See the License for the specific language governing permissions and 2114 * limitations under the License. 2115 */var C=function(){function t(t,e,n){void 0===e?e=0:e>t.length&&_(),void 0===n?n=t.length-e:n>t.length-e&&_(),this.segments=t,this.offset=e,this.t=n}return Object.defineProperty(t.prototype,"length",{get:function(){return this.t},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return 0===t.i(this,e)},t.prototype.child=function(e){var n=this.segments.slice(this.offset,this.limit());return e instanceof t?e.forEach((function(t){n.push(t)})):n.push(e),this.o(n)},t.prototype.limit=function(){return this.offset+this.length},t.prototype.u=function(t){return t=void 0===t?1:t,this.o(this.segments,this.offset+t,this.length-t)},t.prototype.h=function(){return this.o(this.segments,this.offset,this.length-1)},t.prototype.l=function(){return this.segments[this.offset]},t.prototype._=function(){return this.get(this.length-1)},t.prototype.get=function(t){return this.segments[this.offset+t]},t.prototype.m=function(){return 0===this.length},t.prototype.T=function(t){if(t.length<this.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.I=function(t){if(this.length+1!==t.length)return!1;for(var e=0;e<this.length;e++)if(this.get(e)!==t.get(e))return!1;return!0},t.prototype.forEach=function(t){for(var e=this.offset,n=this.limit();e<n;e++)t(this.segments[e])},t.prototype.A=function(){return this.segments.slice(this.offset,this.limit())},t.i=function(t,e){for(var n=Math.min(t.length,e.length),r=0;r<n;r++){var i=t.get(r),o=e.get(r);if(i<o)return-1;if(i>o)return 1}return t.length<e.length?-1:t.length>e.length?1:0},t}(),S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.o=function(t,n,r){return new e(t,n,r)},e.prototype.R=function(){return this.A().join("/")},e.prototype.toString=function(){return this.R()},e.P=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=[],i=0,o=t;i<o.length;i++){var s=o[i];if(s.indexOf("//")>=0)throw new f(l.INVALID_ARGUMENT,"Invalid segment ("+s+"). Paths must not contain // in them.");r.push.apply(r,s.split("/").filter((function(t){return t.length>0})))}return new e(r)},e.g=function(){return new e([])},e}(C),O=/^[_a-zA-Z][_a-zA-Z0-9]*$/,N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.o=function(t,n,r){return new e(t,n,r)},e.V=function(t){return O.test(t)},e.prototype.R=function(){return this.A().map((function(t){return t=t.replace("\\","\\\\").replace("`","\\`"),e.V(t)||(t="`"+t+"`"),t})).join(".")},e.prototype.toString=function(){return this.R()},e.prototype.p=function(){return 1===this.length&&"__name__"===this.get(0)},e.v=function(){return new e(["__name__"])},e.S=function(t){for(var n=[],r="",i=0,o=function(){if(0===r.length)throw new f(l.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'");n.push(r),r=""},s=!1;i<t.length;){var a=t[i];if("\\"===a){if(i+1===t.length)throw new f(l.INVALID_ARGUMENT,"Path has trailing escape character: "+t);var u=t[i+1];if("\\"!==u&&"."!==u&&"`"!==u)throw new f(l.INVALID_ARGUMENT,"Path has invali
2115d escape sequence: "+t);r+=u,i+=2}else"`"===a?(s=!s,i++):"."!==a||s?(r+=a,i++):(o(),i++)}if(o(),s)throw new f(l.INVALID_ARGUMENT,"Unterminated ` in path: "+t);return new e(n)},e.g=function(){return new e([])},e}(C),A=function(){function t(t){this.path=t}return t.D=function(e){return new t(S.P(e))},t.C=function(e){return new t(S.P(e).u(5))},t.prototype.N=function(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t},t.prototype.isEqual=function(t){return null!==t&&0===S.i(this.path,t.path)},t.prototype.toString=function(){return this.path.toString()},t.i=function(t,e){return S.i(t.path,e.path)},t.F=function(t){return t.length%2==0},t.$=function(e){return new t(new S(e.slice()))},t}(); 2116/** 2117 * @license 2118 * Copyright 2017 Google LLC 2119 * 2120 * Licensed under the Apache License, Version 2.0 (the "License"); 2121 * you may not use this file except in compliance with the License. 2122 * You may obtain a copy of the License at 2123 * 2124 * http://www.apache.org/licenses/LICENSE-2.0 2125 * 2126 * Unless required by applicable law or agreed to in writing, software 2127 * distributed under the License is distributed on an "AS IS" BASIS, 2128 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2129 * See the License for the specific language governing permissions and 2130 * limitations under the License. 2131 */function k(t,e){if(0!==e.length)throw new f(l.INVALID_ARGUMENT,"Function "+t+"() does not support arguments, but was called with "+Q(e.length,"argument")+".")}function R(t,e,n){if(e.length!==n)throw new f(l.INVALID_ARGUMENT,"Function "+t+"() requires "+Q(n,"argument")+", but was called with "+Q(e.length,"argument")+".")}function P(t,e,n){if(e.length<n)throw new f(l.INVALID_ARGUMENT,"Function "+t+"() requires at least "+Q(n,"argument")+", but was called with "+Q(e.length,"argument")+".")}function x(t,e,n,r){if(e.length<n||e.length>r)throw new f(l.INVALID_ARGUMENT,"Function "+t+"() requires between "+n+" and "+r+" arguments, but was called with "+Q(e.length,"argument")+".")}function D(t,e,n,r){V(t,e,z(n)+" argument",r)}function L(t,e,n,r){void 0!==r&&D(t,e,n,r)}function j(t,e,n,r){V(t,e,n+" option",r)}function M(t,e,n,r){void 0!==r&&j(t,e,n,r)}function F(t,e,n,r,i){void 0!==r&&function(t,e,n,r,i){for(var o=[],s=0,a=i;s<a.length;s++){var u=a[s];if(u===r)return;o.push(B(u))}var c=B(r);throw new f(l.INVALID_ARGUMENT,"Invalid value "+c+" provided to function "+t+'() for option "'+n+'". Acceptable values: '+o.join(", "))}(t,0,n,r,i)}function U(t,e,n,r){if(!e.some((function(t){return t===r})))throw new f(l.INVALID_ARGUMENT,"Invalid value "+B(r)+" provided to function "+t+"() for its "+z(n)+" argument. Acceptable values: "+e.join(", "));return r}function V(t,e,n,r){if(!("object"===e?q(r):"non-empty string"===e?"string"==typeof r&&""!==r:typeof r===e)){var i=B(r);throw new f(l.INVALID_ARGUMENT,"Function "+t+"() requires its "+n+" to be of type "+e+", but it was: "+i)}}function q(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}function B(t){if(void 0===t)return"undefined";if(null===t)return"null";if("string"==typeof t)return t.length>20&&(t=t.substring(0,20)+"..."),JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return""+t;if("object"==typeof t){if(t instanceof Array)return"an array";var e=function(t){if(t.constructor){var e=/function\s+([^\s(]+)\s*\(/.exec(t.constructor.toString());if(e&&e.length>1)return e[1]}return null}(t);return e?"a custom "+e+" object":"an object"}return"function"==typeof t?"a function":_()}function W(t,e,n){if(void 0===n)throw new f(l.INVALID_ARGUMENT,"Function "+t+"() requires a valid "+z(e)+" argument, but it was undefined.")}function G(t,e,n){I(e,(function(e,r){if(n.indexOf(e)<0)throw new f(l.INVALID_ARGUMENT,"Unknown option '"+e+"' passed to function "+t+"(). Available options: "+n.join(", "))}))}function H(t,e,n,r){var i=B(r);return new f(l.INVALID_ARGUMENT,"Function "+t+"() requires its "+z(n)+" argument to be a "+e+", but it was: "+i)}function K(t,e,n){if(n<=0)throw new f(l.INVALID_ARGUMENT,"Function "+t+"() requires its "+z(e)+" argument to be a positive number, but it was: "+n+".")}function z(t){switch(t){case 1:return"first";
2131case 2:return"second";case 3:return"third";default:return t+"th"}}function Q(t,e){return t+" "+e+(1===t?"":"s")} 2132/** 2133 * @license 2134 * Copyright 2020 Google LLC 2135 * 2136 * Licensed under the Apache License, Version 2.0 (the "License"); 2137 * you may not use this file except in compliance with the License. 2138 * You may obtain a copy of the License at 2139 * 2140 * http://www.apache.org/licenses/LICENSE-2.0 2141 * 2142 * Unless required by applicable law or agreed to in writing, software 2143 * distributed under the License is distributed on an "AS IS" BASIS, 2144 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2145 * See the License for the specific language governing permissions and 2146 * limitations under the License. 2147 */function Y(t){var e="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(n);else for(var r=0;r<t;r++)n[r]=Math.floor(256*Math.random());return n} 2148/** 2149 * @license 2150 * Copyright 2017 Google LLC 2151 * 2152 * Licensed under the Apache License, Version 2.0 (the "License"); 2153 * you may not use this file except in compliance with the License. 2154 * You may obtain a copy of the License at 2155 * 2156 * http://www.apache.org/licenses/LICENSE-2.0 2157 * 2158 * Unless required by applicable law or agreed to in writing, software 2159 * distributed under the License is distributed on an "AS IS" BASIS, 2160 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2161 * See the License for the specific language governing permissions and 2162 * limitations under the License. 2163 */var X=function(){function t(){}return t.k=function(){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=Math.floor(256/t.length)*t.length,n="";n.length<20;)for(var r=Y(40),i=0;i<r.length;++i)n.length<20&&r[i]<e&&(n+=t.charAt(r[i]%t.length));return n},t}();function $(t,e){return t<e?-1:t>e?1:0}function J(t,e,n){return t.length===e.length&&t.every((function(t,r){return n(t,e[r])}))}function Z(t){return t+"\0"} 2164/** 2165 * @license 2166 * Copyright 2020 Google LLC 2167 * 2168 * Licensed under the Apache License, Version 2.0 (the "License"); 2169 * you may not use this file except in compliance with the License. 2170 * You may obtain a copy of the License at 2171 * 2172 * http://www.apache.org/licenses/LICENSE-2.0 2173 * 2174 * Unless required by applicable law or agreed to in writing, software 2175 * distributed under the License is distributed on an "AS IS" BASIS, 2176 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2177 * See the License for the specific language governing permissions and 2178 * limitations under the License. 2179 */var tt=function(){function t(t){this.M=t}return t.fromBase64String=function(e){return new t(atob(e))},t.fromUint8Array=function(e){return new t(function(t){for(var e="",n=0;n<t.length;++n)e+=String.fromCharCode(t[n]);return e}(e))},t.prototype.toBase64=function(){return t=this.M,btoa(t);var t},t.prototype.toUint8Array=function(){return function(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}(this.M)},t.prototype.O=function(){return 2*this.M.length},t.prototype.L=function(t){return $(this.M,t.M)},t.prototype.isEqual=function(t){return this.M===t.M},t}();tt.B=new tt("");var et=function(){function t(t){this.q=t}return t.fromBase64String=function(e){try{return new t(tt.fromBase64String(e))}catch(e){throw new f(l.INVALID_ARGUMENT,"Failed to construct Bytes from Base64 string: "+e)}},t.fromUint8Array=function(e){return new t(tt.fromUint8Array(e))},t.prototype.toBase64=function(){return this.q.toBase64()},t.prototype.toUint8Array=function(){return this.q.toUint8Array()},t.prototype.toString=function(){return"Bytes(base64: "+this.toBase64()+")"},t.prototype.isEqual=function(t){return this.q.isEqual(t.q)},t}(); 2180/** 2181 * @license 2182 * Copyright 2017 Google LLC 2183 * 2184 * Licensed under the Apache License, Version 2.0 (the "License"); 2185 * you may not use this file except in compliance with the License. 2186 * You may obtain a copy of the License at 2187 * 2188 * http://www.apache.org/licenses/LICENSE-2.0 2189 * 2190 * Unless required by applicable law or agreed to in writing, softw
2190are 2191 * distributed under the License is distributed on an "AS IS" BASIS, 2192 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2193 * See the License for the specific language governing permissions and 2194 * limitations under the License. 2195 */function nt(){if("undefined"==typeof Uint8Array)throw new f(l.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function rt(){if("undefined"==typeof atob)throw new f(l.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var it=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.fromBase64String=function(t){R("Blob.fromBase64String",arguments,1),D("Blob.fromBase64String","string",1,t),rt();try{return new e(tt.fromBase64String(t))}catch(t){throw new f(l.INVALID_ARGUMENT,"Failed to construct Blob from Base64 string: "+t)}},e.fromUint8Array=function(t){if(R("Blob.fromUint8Array",arguments,1),nt(),!(t instanceof Uint8Array))throw H("Blob.fromUint8Array","Uint8Array",1,t);return new e(tt.fromUint8Array(t))},e.prototype.toBase64=function(){return R("Blob.toBase64",arguments,0),rt(),t.prototype.toBase64.call(this)},e.prototype.toUint8Array=function(){return R("Blob.toUint8Array",arguments,0),nt(),t.prototype.toUint8Array.call(this)},e.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},e}(et),ot=function(t,e,n,r,i){this.U=t,this.persistenceKey=e,this.host=n,this.ssl=r,this.forceLongPolling=i},st=function(){function t(t,e){this.projectId=t,this.database=e||"(default)"}return Object.defineProperty(t.prototype,"W",{get:function(){return"(default)"===this.database},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){return e instanceof t&&e.projectId===this.projectId&&e.database===this.database},t.prototype.L=function(t){return $(this.projectId,t.projectId)||$(this.database,t.database)},t}(),at=function(){function t(t,e){this.j=t,this.K=e,this.G={}}return t.prototype.get=function(t){var e=this.j(t),n=this.G[e];if(void 0!==n)for(var r=0,i=n;r<i.length;r++){var o=i[r],s=o[0],a=o[1];if(this.K(s,t))return a}},t.prototype.has=function(t){return void 0!==this.get(t)},t.prototype.set=function(t,e){var n=this.j(t),r=this.G[n];if(void 0!==r){for(var i=0;i<r.length;i++)if(this.K(r[i][0],t))return void(r[i]=[t,e]);r.push([t,e])}else this.G[n]=[[t,e]]},t.prototype.delete=function(t){var e=this.j(t),n=this.G[e];if(void 0===n)return!1;for(var r=0;r<n.length;r++)if(this.K(n[r][0],t))return 1===n.length?delete this.G[e]:n.splice(r,1),!0;return!1},t.prototype.forEach=function(t){I(this.G,(function(e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r],s=o[0],a=o[1];t(s,a)}}))},t.prototype.m=function(){return T(this.G)},t}(),ut=function(){function t(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new f(l.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new f(l.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new f(l.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new f(l.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}return t.now=function(){return t.fromMillis(Date.now())},t.fromDate=function(e){return t.fromMillis(e.getTime())},t.fromMillis=function(e){var n=Math.floor(e/1e3);return new t(n,1e6*(e-1e3*n))},t.prototype.toDate=function(){return new Date(this.toMillis())},t.prototype.toMillis=function(){return 1e3*this.seconds+this.nanoseconds/1e6},t.prototype.H=function(t){return this.seconds===t.seconds?$(this.nanoseconds,t.nanoseconds):$(this.seconds,t.seconds)},t.prototype.isEqual=function(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds},t.prototype.toString=function(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"},t.prototype.toJSON=function(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}},t.prototype.valueOf=function(){var t=this.seconds- -62135596800;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")},t}(),ct=function(){function t(t){this.timestamp=t}return t.Y=function(e){return new t(e)},t.min=function(){return new t(new ut(0,0))},t.prototype.L=function(t){return this.timestamp.H(t.timestamp)},t.prototype.isEqual=function(t){return this.timestamp.isEqual(t.timestamp)},t.prototype.J=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},t.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},t.prototype.X=function(){return this.timestamp},t}(); 2196/** 2197 * @license 2198 * Copyright 2017 Google LLC 2199 * 2200 * Licensed under the Apache License, Version 2.0 (the "License");
2201 * you may not use this file except in compliance with the License. 2202 * You may obtain a copy of the License at 2203 * 2204 * http://www.apache.org/licenses/LICENSE-2.0 2205 * 2206 * Unless required by applicable law or agreed to in writing, software 2207 * distributed under the License is distributed on an "AS IS" BASIS, 2208 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2209 * See the License for the specific language governing permissions and 2210 * limitations under the License. 2211 */ 2212/** 2213 * @license 2214 * Copyright 2017 Google LLC 2215 * 2216 * Licensed under the Apache License, Version 2.0 (the "License"); 2217 * you may not use this file except in compliance with the License. 2218 * You may obtain a copy of the License at 2219 * 2220 * http://www.apache.org/licenses/LICENSE-2.0 2221 * 2222 * Unless required by applicable law or agreed to in writing, software 2223 * distributed under the License is distributed on an "AS IS" BASIS, 2224 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2225 * See the License for the specific language governing permissions and 2226 * limitations under the License. 2227 */function ht(t){return null==t}function lt(t){return 0===t&&1/t==-1/0}function ft(t){return"number"==typeof t&&Number.isInteger(t)&&!lt(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER} 2228/** 2229 * @license 2230 * Copyright 2019 Google LLC 2231 * 2232 * Licensed under the Apache License, Version 2.0 (the "License"); 2233 * you may not use this file except in compliance with the License. 2234 * You may obtain a copy of the License at 2235 * 2236 * http://www.apache.org/licenses/LICENSE-2.0 2237 * 2238 * Unless required by applicable law or agreed to in writing, software 2239 * distributed under the License is distributed on an "AS IS" BASIS, 2240 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2241 * See the License for the specific language governing permissions and 2242 * limitations under the License. 2243 */var pt=function(t,e,n,r,i,o,s){void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o=null),void 0===s&&(s=null),this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=o,this.endAt=s,this.Z=null};function dt(t,e,n,r,i,o,s){return void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o=null),void 0===s&&(s=null),new pt(t,e,n,r,i,o,s)}function vt(t){var e=w(t);if(null===e.Z){var n=e.path.R();null!==e.collectionGroup&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map((function(t){return function(t){return t.field.R()+t.op.toString()+se(t.value)}(t)})).join(","),n+="|ob:",n+=e.orderBy.map((function(t){return(e=t).field.R()+e.dir;var e})).join(","),ht(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=lr(e.startAt)),e.endAt&&(n+="|ub:",n+=lr(e.endAt)),e.Z=n}return e.Z}function gt(t,e){if(t.limit!==e.limit)return!1;if(t.orderBy.length!==e.orderBy.length)return!1;for(var n=0;n<t.orderBy.length;n++)if(!gr(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(var r=0;r<t.filters.length;r++)if(i=t.filters[r],o=e.filters[r],i.op!==o.op||!i.field.isEqual(o.field)||!ne(i.value,o.value))return!1;var i,o;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!pr(t.startAt,e.startAt)&&pr(t.endAt,e.endAt)}function yt(t){return A.F(t.path)&&null===t.collectionGroup&&0===t.filters.length} 2244/** 2245 * @license 2246 * Copyright 2017 Google LLC 2247 * 2248 * Licensed under the Apache License, Version 2.0 (the "License"); 2249 * you may not use this file except in compliance with the License. 2250 * You may obtain a copy of the License at 2251 * 2252 * http://www.apache.org/licenses/LICENSE-2.0 2253 * 2254 * Unless required by applicable law or agreed to in writing, software 2255 * distributed under the License is distributed on an "AS IS" BASIS, 2256 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2257 * See the License for the specific language governing permissions and 2258 * limitations under the License. 2259 */var mt,_t,bt=function(){function t(t,e,n,r,i,o,s){void 0===i&&(i=ct.min()),void 0===o&&(o=ct.min()),void 0===s&&(s=tt.B),this.target=t,this.targetId=e,this.tt=n,this.sequenceNumber=r,this.et=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=s}return t.prototype.nt=function(e){return new t(this.target,this.targetId,this.tt,e,this.et,this.lastLimboFreeSnapshotVersion,this.resumeToken)},t.prototype.st=function(e,n){return new t(this.target,this.targetId,this.tt,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e)},t.prototype.it=function(e){return new t(this.target,this.targetId,this.tt,this.sequenceNumber,this.et,e,this.resumeToken)},t}(),wt=function(t){this.count=t}; 2260/** 2261 * @license 2262 * Copyright 2017 Google LLC 2263 * 2264 * Licensed under the Apache License, Version 2.0 (the "License");
2265 * you may not use this file except in compliance with the License. 2266 * You may obtain a copy of the License at 2267 * 2268 * http://www.apache.org/licenses/LICENSE-2.0 2269 * 2270 * Unless required by applicable law or agreed to in writing, software 2271 * distributed under the License is distributed on an "AS IS" BASIS, 2272 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2273 * See the License for the specific language governing permissions and 2274 * limitations under the License. 2275 */function Et(t){switch(t){case l.OK:return _();case l.CANCELLED:case l.UNKNOWN:case l.DEADLINE_EXCEEDED:case l.RESOURCE_EXHAUSTED:case l.INTERNAL:case l.UNAVAILABLE:case l.UNAUTHENTICATED:return!1;case l.INVALID_ARGUMENT:case l.NOT_FOUND:case l.ALREADY_EXISTS:case l.PERMISSION_DENIED:case l.FAILED_PRECONDITION:case l.ABORTED:case l.OUT_OF_RANGE:case l.UNIMPLEMENTED:case l.DATA_LOSS:return!0;default:return _()}}function It(t){if(void 0===t)return g("GRPC error has no .code"),l.UNKNOWN;switch(t){case mt.OK:return l.OK;case mt.CANCELLED:return l.CANCELLED;case mt.UNKNOWN:return l.UNKNOWN;case mt.DEADLINE_EXCEEDED:return l.DEADLINE_EXCEEDED;case mt.RESOURCE_EXHAUSTED:return l.RESOURCE_EXHAUSTED;case mt.INTERNAL:return l.INTERNAL;case mt.UNAVAILABLE:return l.UNAVAILABLE;case mt.UNAUTHENTICATED:return l.UNAUTHENTICATED;case mt.INVALID_ARGUMENT:return l.INVALID_ARGUMENT;case mt.NOT_FOUND:return l.NOT_FOUND;case mt.ALREADY_EXISTS:return l.ALREADY_EXISTS;case mt.PERMISSION_DENIED:return l.PERMISSION_DENIED;case mt.FAILED_PRECONDITION:return l.FAILED_PRECONDITION;case mt.ABORTED:return l.ABORTED;case mt.OUT_OF_RANGE:return l.OUT_OF_RANGE;case mt.UNIMPLEMENTED:return l.UNIMPLEMENTED;case mt.DATA_LOSS:return l.DATA_LOSS;default:return _()}}(_t=mt||(mt={}))[_t.OK=0]="OK",_t[_t.CANCELLED=1]="CANCELLED",_t[_t.UNKNOWN=2]="UNKNOWN",_t[_t.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",_t[_t.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",_t[_t.NOT_FOUND=5]="NOT_FOUND",_t[_t.ALREADY_EXISTS=6]="ALREADY_EXISTS",_t[_t.PERMISSION_DENIED=7]="PERMISSION_DENIED",_t[_t.UNAUTHENTICATED=16]="UNAUTHENTICATED",_t[_t.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",_t[_t.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",_t[_t.ABORTED=10]="ABORTED",_t[_t.OUT_OF_RANGE=11]="OUT_OF_RANGE",_t[_t.UNIMPLEMENTED=12]="UNIMPLEMENTED",_t[_t.INTERNAL=13]="INTERNAL",_t[_t.UNAVAILABLE=14]="UNAVAILABLE",_t[_t.DATA_LOSS=15]="DATA_LOSS"; 2276/** 2277 * @license 2278 * Copyright 2017 Google LLC 2279 * 2280 * Licensed under the Apache License, Version 2.0 (the "License"); 2281 * you may not use this file except in compliance with the License. 2282 * You may obtain a copy of the License at 2283 * 2284 * http://www.apache.org/licenses/LICENSE-2.0 2285 * 2286 * Unless required by applicable law or agreed to in writing, software 2287 * distributed under the License is distributed on an "AS IS" BASIS, 2288 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2289 * See the License for the specific language governing permissions and 2290 * limitations under the License. 2291 */ 2292var Tt=function(){function t(t,e){this.i=t,this.root=e||St.EMPTY}return t.prototype.rt=function(e,n){return new t(this.i,this.root.rt(e,n,this.i).copy(null,null,St.ot,null,null))},t.prototype.remove=function(e){return new t(this.i,this.root.remove(e,this.i).copy(null,null,St.ot,null,null))},t.prototype.get=function(t){for(var e=this.root;!e.m();){var n=this.i(t,e.key);if(0===n)return e.value;n<0?e=e.left:n>0&&(e=e.right)}return null},t.prototype.indexOf=function(t){for(var e=0,n=this.root;!n.m();){var r=this.i(t,n.key);if(0===r)return e+n.left.size;r<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1},t.prototype.m=function(){return this.root.m()},Object.defineProperty(t.prototype,"size",{get:function(){return this.root.size},enumerable:!1,configurable:!0}),t.prototype.at=function(){return this.root.at()},t.prototype.ct=function(){return this.root.ct()},t.prototype.ut=function(t){return this.root.ut(t)},t.prototype.forEach=function(t){this.ut((function(e,n){return t(e,n),!1}))},t.prototype.toString=function(){var t=[];return this.ut((function(e,n){return t.push(e+":"+n),!1})),"{"+t.join(", ")+"}"},t.prototype.ht=function(t){return this.root.ht(t)}
2292,t.prototype.lt=function(){return new Ct(this.root,null,this.i,!1)},t.prototype._t=function(t){return new Ct(this.root,t,this.i,!1)},t.prototype.ft=function(){return new Ct(this.root,null,this.i,!0)},t.prototype.dt=function(t){return new Ct(this.root,t,this.i,!0)},t}(),Ct=function(){function t(t,e,n,r){this.wt=r,this.Tt=[];for(var i=1;!t.m();)if(i=e?n(t.key,e):1,r&&(i*=-1),i<0)t=this.wt?t.left:t.right;else{if(0===i){this.Tt.push(t);break}this.Tt.push(t),t=this.wt?t.right:t.left}}return t.prototype.Et=function(){var t=this.Tt.pop(),e={key:t.key,value:t.value};if(this.wt)for(t=t.left;!t.m();)this.Tt.push(t),t=t.right;else for(t=t.right;!t.m();)this.Tt.push(t),t=t.left;return e},t.prototype.It=function(){return this.Tt.length>0},t.prototype.At=function(){if(0===this.Tt.length)return null;var t=this.Tt[this.Tt.length-1];return{key:t.key,value:t.value}},t}(),St=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:t.EMPTY,this.right=null!=o?o:t.EMPTY,this.size=this.left.size+1+this.right.size}return t.prototype.copy=function(e,n,r,i,o){return new t(null!=e?e:this.key,null!=n?n:this.value,null!=r?r:this.color,null!=i?i:this.left,null!=o?o:this.right)},t.prototype.m=function(){return!1},t.prototype.ut=function(t){return this.left.ut(t)||t(this.key,this.value)||this.right.ut(t)},t.prototype.ht=function(t){return this.right.ht(t)||t(this.key,this.value)||this.left.ht(t)},t.prototype.min=function(){return this.left.m()?this:this.left.min()},t.prototype.at=function(){return this.min().key},t.prototype.ct=function(){return this.right.m()?this.key:this.right.ct()},t.prototype.rt=function(t,e,n){var r=this,i=n(t,r.key);return(r=i<0?r.copy(null,null,null,r.left.rt(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.rt(t,e,n))).Rt()},t.prototype.Pt=function(){if(this.left.m())return t.EMPTY;var e=this;return e.left.gt()||e.left.left.gt()||(e=e.yt()),(e=e.copy(null,null,null,e.left.Pt(),null)).Rt()},t.prototype.remove=function(e,n){var r,i=this;if(n(e,i.key)<0)i.left.m()||i.left.gt()||i.left.left.gt()||(i=i.yt()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.gt()&&(i=i.Vt()),i.right.m()||i.right.gt()||i.right.left.gt()||(i=i.bt()),0===n(e,i.key)){if(i.right.m())return t.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.Pt())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.Rt()},t.prototype.gt=function(){return this.color},t.prototype.Rt=function(){var t=this;return t.right.gt()&&!t.left.gt()&&(t=t.vt()),t.left.gt()&&t.left.left.gt()&&(t=t.Vt()),t.left.gt()&&t.right.gt()&&(t=t.St()),t},t.prototype.yt=function(){var t=this.St();return t.right.left.gt()&&(t=(t=(t=t.copy(null,null,null,null,t.right.Vt())).vt()).St()),t},t.prototype.bt=function(){var t=this.St();return t.left.left.gt()&&(t=(t=t.Vt()).St()),t},t.prototype.vt=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.Vt=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.St=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.Dt=function(){var t=this.Ct();return Math.pow(2,t)<=this.size+1},t.prototype.Ct=function(){if(this.gt()&&this.left.gt())throw _();if(this.right.gt())throw _();var t=this.left.Ct();if(t!==this.right.Ct())throw _();return t+(this.gt()?0:1)},t}();St.EMPTY=null,St.RED=!0,St.ot=!1,St.EMPTY=new(function(){function t(){this.size=0}return Object.defineProperty(t.prototype,"key",{get:function(){throw _()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){throw _()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){throw _()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){throw _()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){throw _()}
2292,enumerable:!1,configurable:!0}),t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.rt=function(t,e,n){return new St(t,e)},t.prototype.remove=function(t,e){return this},t.prototype.m=function(){return!0},t.prototype.ut=function(t){return!1},t.prototype.ht=function(t){return!1},t.prototype.at=function(){return null},t.prototype.ct=function(){return null},t.prototype.gt=function(){return!1},t.prototype.Dt=function(){return!0},t.prototype.Ct=function(){return 0},t}()); 2293/** 2294 * @license 2295 * Copyright 2017 Google LLC 2296 * 2297 * Licensed under the Apache License, Version 2.0 (the "License"); 2298 * you may not use this file except in compliance with the License. 2299 * You may obtain a copy of the License at 2300 * 2301 * http://www.apache.org/licenses/LICENSE-2.0 2302 * 2303 * Unless required by applicable law or agreed to in writing, software 2304 * distributed under the License is distributed on an "AS IS" BASIS, 2305 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2306 * See the License for the specific language governing permissions and 2307 * limitations under the License. 2308 */ 2309var Ot=function(){function t(t){this.i=t,this.data=new Tt(this.i)}return t.prototype.has=function(t){return null!==this.data.get(t)},t.prototype.first=function(){return this.data.at()},t.prototype.last=function(){return this.data.ct()},Object.defineProperty(t.prototype,"size",{get:function(){return this.data.size},enumerable:!1,configurable:!0}),t.prototype.indexOf=function(t){return this.data.indexOf(t)},t.prototype.forEach=function(t){this.data.ut((function(e,n){return t(e),!1}))},t.prototype.Nt=function(t,e){for(var n=this.data._t(t[0]);n.It();){var r=n.Et();if(this.i(r.key,t[1])>=0)return;e(r.key)}},t.prototype.Ft=function(t,e){var n;for(n=void 0!==e?this.data._t(e):this.data.lt();n.It();)if(!t(n.Et().key))return},t.prototype.$t=function(t){var e=this.data._t(t);return e.It()?e.Et().key:null},t.prototype.lt=function(){return new Nt(this.data.lt())},t.prototype._t=function(t){return new Nt(this.data._t(t))},t.prototype.add=function(t){return this.copy(this.data.remove(t).rt(t,!0))},t.prototype.delete=function(t){return this.has(t)?this.copy(this.data.remove(t)):this},t.prototype.m=function(){return this.data.m()},t.prototype.xt=function(t){var e=this;return e.size<t.size&&(e=t,t=this),t.forEach((function(t){e=e.add(t)})),e},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.data.lt(),r=e.data.lt();n.It();){var i=n.Et().key,o=r.Et().key;if(0!==this.i(i,o))return!1}return!0},t.prototype.A=function(){var t=[];return this.forEach((function(e){t.push(e)})),t},t.prototype.toString=function(){var t=[];return this.forEach((function(e){return t.push(e)})),"SortedSet("+t.toString()+")"},t.prototype.copy=function(e){var n=new t(this.i);return n.data=e,n},t}(),Nt=function(){function t(t){this.kt=t}return t.prototype.Et=function(){return this.kt.Et().key},t.prototype.It=function(){return this.kt.It()},t}(),At=new Tt(A.i);function kt(){return At}function Rt(){return kt()}var Pt=new Tt(A.i);function xt(){return Pt}var Dt=new Tt(A.i),Lt=new Ot(A.i);function jt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=Lt,r=0,i=t;r<i.length;r++){var o=i[r];n=n.add(o)}return n}var Mt=new Ot($);function Ft(){return Mt} 2310/** 2311 * @license 2312 * Copyright 2017 Google LLC 2313 * 2314 * Licensed under the Apache License, Version 2.0 (the "License"); 2315 * you may not use this file except in compliance with the License. 2316 * You may obtain a copy of the License at 2317 * 2318 * http://www.apache.org/licenses/LICENSE-2.0 2319 * 2320 * Unless required by applicable law or agreed to in writing, software 2321 * distributed under the License is distributed on an "AS IS" BASIS, 2322 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2323 * See the License for the specific language governing permissions and 2324 * limitations under the License. 2325 */var Ut=function(){function t(t){this.i=t?function(e,n){return t(e,n)||A.i(e.key,n.key)}:function(t,e){return A.i(t.key,e.key)},this.Mt=xt(),this.Ot=new Tt(this.i)}return t.Lt=function(e){return new t(e.i)},t.prototype.has=function(t){return null!=this.Mt.get(t)},t.prototype.get=function(t){return this.Mt.get(t)},t.prototype.first=function(){return this.Ot.at()},t.prototype.last=function(){return this.Ot.ct()},t.prototype.m=function(){return this.Ot.m()},t.prototype.indexOf=function(t){var e=this.Mt.get(t);return e?this.Ot.indexOf(e):-1},Object.defineProperty(t.prototype,"size",{get:function(){return this.Ot.size}
2325,enumerable:!1,configurable:!0}),t.prototype.forEach=function(t){this.Ot.ut((function(e,n){return t(e),!1}))},t.prototype.add=function(t){var e=this.delete(t.key);return e.copy(e.Mt.rt(t.key,t),e.Ot.rt(t,null))},t.prototype.delete=function(t){var e=this.get(t);return e?this.copy(this.Mt.remove(t),this.Ot.remove(e)):this},t.prototype.isEqual=function(e){if(!(e instanceof t))return!1;if(this.size!==e.size)return!1;for(var n=this.Ot.lt(),r=e.Ot.lt();n.It();){var i=n.Et().key,o=r.Et().key;if(!i.isEqual(o))return!1}return!0},t.prototype.toString=function(){var t=[];return this.forEach((function(e){t.push(e.toString())})),0===t.length?"DocumentSet ()":"DocumentSet (\n "+t.join(" \n")+"\n)"},t.prototype.copy=function(e,n){var r=new t;return r.i=this.i,r.Mt=e,r.Ot=n,r},t}(),Vt=function(){function t(){this.Bt=new Tt(A.i)}return t.prototype.track=function(t){var e=t.doc.key,n=this.Bt.get(e);n?0!==t.type&&3===n.type?this.Bt=this.Bt.rt(e,t):3===t.type&&1!==n.type?this.Bt=this.Bt.rt(e,{type:n.type,doc:t.doc}):2===t.type&&2===n.type?this.Bt=this.Bt.rt(e,{type:2,doc:t.doc}):2===t.type&&0===n.type?this.Bt=this.Bt.rt(e,{type:0,doc:t.doc}):1===t.type&&0===n.type?this.Bt=this.Bt.remove(e):1===t.type&&2===n.type?this.Bt=this.Bt.rt(e,{type:1,doc:n.doc}):0===t.type&&1===n.type?this.Bt=this.Bt.rt(e,{type:2,doc:t.doc}):_():this.Bt=this.Bt.rt(e,t)},t.prototype.qt=function(){var t=[];return this.Bt.ut((function(e,n){t.push(n)})),t},t}(),qt=function(){function t(t,e,n,r,i,o,s,a){this.query=t,this.docs=e,this.Ut=n,this.docChanges=r,this.Qt=i,this.fromCache=o,this.Wt=s,this.jt=a}return t.Kt=function(e,n,r,i){var o=[];return n.forEach((function(t){o.push({type:0,doc:t})})),new t(e,n,Ut.Lt(n),o,r,i,!0,!1)},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return!this.Qt.m()},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){if(!(this.fromCache===t.fromCache&&this.Wt===t.Wt&&this.Qt.isEqual(t.Qt)&&Xn(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.Ut.isEqual(t.Ut)))return!1;var e=this.docChanges,n=t.docChanges;if(e.length!==n.length)return!1;for(var r=0;r<e.length;r++)if(e[r].type!==n[r].type||!e[r].doc.isEqual(n[r].doc))return!1;return!0},t}(),Bt=function(){function t(t,e,n,r,i){this.et=t,this.Gt=e,this.zt=n,this.Ht=r,this.Yt=i}return t.Jt=function(e,n){var r=new Map;return r.set(e,Wt.Xt(e,n)),new t(ct.min(),r,Ft(),kt(),jt())},t}(),Wt=function(){function t(t,e,n,r,i){this.resumeToken=t,this.Zt=e,this.te=n,this.ee=r,this.ne=i}return t.Xt=function(e,n){return new t(tt.B,n,jt(),jt(),jt())},t}(),Gt=function(t,e,n,r){this.se=t,this.removedTargetIds=e,this.key=n,this.ie=r},Ht=function(t,e){this.targetId=t,this.re=e},Kt=function(t,e,n,r){void 0===n&&(n=tt.B),void 0===r&&(r=null),this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=r},zt=function(){function t(){this.oe=0,this.ae=Xt(),this.ce=tt.B,this.ue=!1,this.he=!0}return Object.defineProperty(t.prototype,"Zt",{get:function(){return this.ue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resumeToken",{get:function(){return this.ce},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"le",{get:function(){return 0!==this.oe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_e",{get:function(){return this.he},enumerable:!1,configurable:!0}),t.prototype.fe=function(t){t.O()>0&&(this.he=!0,this.ce=t)},t.prototype.de=function(){var t=jt(),e=jt(),n=jt();return this.ae.forEach((function(r,i){switch(i){case 0:t=t.add(r);break;case 2:e=e.add(r);break;case 1:n=n.add(r);break;default:_()}})),new Wt(this.ce,this.ue,t,e,n)},t.prototype.we=function(){this.he=!1,this.ae=Xt()},t.prototype.me=function(t,e){this.he=!0,this.ae=this.ae.rt(t,e)},t.prototype.Te=function(t){this.he=!0,this.ae=this.ae.remove(t)},t.prototype.Ee=function(){this.oe+=1},t.prototype.Ie=function(){this.oe-=1},t.prototype.Ae=function(){this.he=!0,this.ue=!0},t}(),Qt=function(){function t(t){this.Re=t,this.Pe=new Map,this.ge=kt(),this.ye=Yt(),this.Ve=new Ot($)}return t.prototype.pe=function(t){for(var e=0,n=t.se;e<n.length;e++){var r=n[e];t.ie instanceof Dn?this.be(r,t.ie):t.ie instanceof Ln&&this.ve(r,t.key,t.ie)}for(var i=0,o=t.removedTargetIds;i<o.length;i++){var s=o[i];this.ve(s,t.key,t.ie)}},t.prototype.Se=function(t){var e=this;this.De(t,(function(n){var r=e.Ce(n);switch(t.state){case 0:e.Ne(n)&&r.fe(t.resumeToken);break;case 1:r.Ie(),r.le||r.we(),r.fe(t.resumeToken);break;case 2:r.Ie(),r.le||e.removeTarget(n);break;case 3:e.Ne(n)&&(r.Ae(),r.fe(t.resumeToken));break;case 4:e.Ne(n)&&(e.Fe(n),r.fe(t.resumeToken));break;default:_()}}))},t.prototype.De=function(t,e){var n=this;t.targetIds.length>0?t.targetIds.forEach(e):this.Pe.forEach((function(t,r){n.Ne(r)&&e(r)}))},t.prototype.$e=function(t){var e=t.targetId,n=t.re.count,r=this.xe(e);if(r){var i=r.target;if(yt(i))if(0===n){var o=new A(i.path);this.ve(e,o,new Ln(o,ct.min()))}else b(1===n);else this.ke(e)!==n&&(this.Fe(e),this.Ve=this.Ve.add(e))}},t.prototype.Me=function(t){var e=this,n=new Map;this.Pe.forEach((function(r,i){var o=e.xe(i);if(o){if(r.Zt&&yt(o.target)){var s=new A(o.target.path);null!==e.ge.get(s)||e.Oe(i,s)||e.ve(i,s,new Ln(s,t))}r._e&&(n.set(i,r.de()),r.we())}}));var r=jt();this.ye.forEach((function(t,n){var i=!0;n.Ft((function(t){var n=e.xe(t);return!n||2===n.tt||(i=!1,!1)})),i&&(r=r.add(t))}));var i=new Bt(t,n,this.Ve,this.ge,r);return this.ge=kt(),this.ye=Yt(),this.Ve=new Ot($),i},t.prototype.be=function(t,e){if(this.Ne(t)){var n=this.Oe(t,e.key)?2:0;this.Ce(t).me(e.key,n),this.ge=this.ge.rt(e.key,e),this.ye=this.ye.rt(e.key,this.Le(e.key).add(t))}},t.prototype.ve=function(t,e,n){if(this.Ne(t)){var r=this.Ce(t);this.Oe(t,e)?r.me(e,1):r.Te(e),this.ye=this.ye.rt(e,this.Le(e).delete(t)),n&&(this.ge=this.ge.rt(e,n))}},t.prototype.removeTarget=function(t){this.Pe.delete(t)},t.prototype.ke=function(t){var e=this.Ce(t).de();return this.Re.Be(t).size+e.te.size-e.ne.size},t.prototype.Ee=function(t){this.Ce(t).Ee()},t.prototype.Ce=function(t){var e=this.Pe.get(t);return e||(e=new zt,this.Pe.set(t,e)),e},t.prototype.Le=function(t){var e=this.ye.get(t);return e||(e=new Ot($),this.ye=this.ye.rt(t,e)),e},t.prototype.Ne=function(t){var e=null!==this.xe(t);return e||v("WatchChangeAggregator","Detected inactive target",t),e},t.prototype.xe=function(t){var e=this.Pe.get(t);return e&&e.le?null:this.Re.qe(t)},t.prototype.Fe=function(t){var e=this;this.Pe.set(t,new zt),this.Re.Be(t).forEach((function(n){e.ve(t,n,null)}))},t.prototype.Oe=function(t,e){return this.Re.Be(t).has(e)},t}(); 2326/** 2327 * @license 2328 * Copyright 2017 Google LLC 2329 * 2330 * Licensed under the Apache License, Version 2.0 (the "License");
2331 * you may not use this file except in compliance with the License. 2332 * You may obtain a copy of the License at 2333 * 2334 * http://www.apache.org/licenses/LICENSE-2.0 2335 * 2336 * Unless required by applicable law or agreed to in writing, software 2337 * distributed under the License is distributed on an "AS IS" BASIS, 2338 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2339 * See the License for the specific language governing permissions and 2340 * limitations under the License. 2341 */function Yt(){return new Tt(A.i)}function Xt(){return new Tt(A.i)} 2342/** 2343 * @license 2344 * Copyright 2020 Google LLC 2345 * 2346 * Licensed under the Apache License, Version 2.0 (the "License"); 2347 * you may not use this file except in compliance with the License. 2348 * You may obtain a copy of the License at 2349 * 2350 * http://www.apache.org/licenses/LICENSE-2.0 2351 * 2352 * Unless required by applicable law or agreed to in writing, software 2353 * distributed under the License is distributed on an "AS IS" BASIS, 2354 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2355 * See the License for the specific language governing permissions and 2356 * limitations under the License. 2357 */function $t(t){var e,n;return"server_timestamp"===(null===(n=((null===(e=null==t?void 0:t.mapValue)||void 0===e?void 0:e.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function Jt(t){var e=t.mapValue.fields.__previous_value__;return $t(e)?Jt(e):e}function Zt(t){var e=ue(t.mapValue.fields.__local_write_time__.timestampValue);return new ut(e.seconds,e.nanos)} 2358/** 2359 * @license 2360 * Copyright 2020 Google LLC 2361 * 2362 * Licensed under the Apache License, Version 2.0 (the "License"); 2363 * you may not use this file except in compliance with the License. 2364 * You may obtain a copy of the License at 2365 * 2366 * http://www.apache.org/licenses/LICENSE-2.0 2367 * 2368 * Unless required by applicable law or agreed to in writing, software 2369 * distributed under the License is distributed on an "AS IS" BASIS, 2370 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2371 * See the License for the specific language governing permissions and 2372 * limitations under the License. 2373 */var te=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function ee(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?$t(t)?4:10:_()}function ne(t,e){var n=ee(t);if(n!==ee(e))return!1;switch(n){case 0:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return Zt(t).isEqual(Zt(e));case 3:return function(t,e){if("string"==typeof t.timestampValue&&"string"==typeof e.timestampValue&&t.timestampValue.length===e.timestampValue.length)return t.timestampValue===e.timestampValue;var n=ue(t.timestampValue),r=ue(e.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(t,e){return he(t.bytesValue).isEqual(he(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return ce(t.geoPointValue.latitude)===ce(e.geoPointValue.latitude)&&ce(t.geoPointValue.longitude)===ce(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return ce(t.integerValue)===ce(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){var n=ce(t.doubleValue),r=ce(e.doubleValue);return n===r?lt(n)===lt(r):isNaN(n)&&isNaN(r)}return!1}(t,e);case 9:return J(t.arrayValue.values||[],e.arrayValue.values||[],ne);case 10:return function(t,e){var n=t.mapValue.fields||{},r=e.mapValue.fields||{};if(E(n)!==E(r))return!1;for(var i in n)if(n.hasOwnProperty(i)&&(void 0===r[i]||!ne(n[i],r[i])))return!1;return!0}(t,e);default:return _()}}function re(t,e){return void 0!==(t.values||[]).find((function(t){return ne(t,e)}))}function ie(t,e){var n=ee(t),r=ee(e);if(n!==r)return $(n,r);switch(n){case 0:return 0;case 1:return $(t.booleanValue,e.booleanValue);case 2:return function(t,e){var n=ce(t.integerValue||t.doubleValue),r=ce(e.integerValue||e.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(t,e);case 3:return oe(t.timestampValue,e.timestampValue);case 4:return oe(Zt(t),Zt(e));case 5:return $(t.stringValue,e.stringValue);case 6:return function(t,e){var n=he(t),r=he(e);return n.L(r)}(t.bytesValue,e.bytesValue);case 7:return function(t,e){for(var n=t.split("/"),r=e.split("/"),i=0;i<n.length&&i<r.length;i++){var o=$(n[i],r[i]);if(0!==o)return o}return $(n.length,r.length)}(t.referenceValue,e.referenceValue);case 8:return function(t,e){var n=$(ce(t.latitude),ce(e.latitude));return 0!==n?n:$(ce(t.longitude),ce(e.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return function(t,e){for(var n=t.values||[],r=e.values||[],i=0;i<n.length&&i<r.length;++i){var o=ie(n[i],r[i]);if(o)return o}return $(n.length,r.length)}(t.arrayValue,e.arrayValue);case 10:return function(t,e){var n=t.fields||{},r=Object.keys(n),i=e.fields||{},o=Object.keys(i);r.sort(),o.sort();for(var s=0;s<r.length&&s<o.length;++s){var a=$(r[s],o[s]);if(0!==a)return a;var u=ie(n[r[s]],i[o[s]]);if(0!==u)return u}return $(r.length,o.length)}(t.mapValue,e.mapValue);default:throw _()}}function oe(t,e){if("string"==typeof t&&"string"==typeof e&&t.length===e.length)return $(t,e);var n=ue(t),r=ue(e),i=$(n.seconds,r.seconds);return 0!==i?i:$(n.nanos,r.nanos)}function se(t){return ae(t)}function ae(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(t){var e=ue(t);return"time("+e.seconds+","+e.nanos+")"}
2373(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?he(t.bytesValue).toBase64():"referenceValue"in t?(n=t.referenceValue,A.C(n).toString()):"geoPointValue"in t?"geo("+(e=t.geoPointValue).latitude+","+e.longitude+")":"arrayValue"in t?function(t){for(var e="[",n=!0,r=0,i=t.values||[];r<i.length;r++)n?n=!1:e+=",",e+=ae(i[r]);return e+"]"}(t.arrayValue):"mapValue"in t?function(t){for(var e="{",n=!0,r=0,i=Object.keys(t.fields||{}).sort();r<i.length;r++){var o=i[r];n?n=!1:e+=",",e+=o+":"+ae(t.fields[o])}return e+"}"}(t.mapValue):_();var e,n}function ue(t){if(b(!!t),"string"==typeof t){var e=0,n=te.exec(t);if(b(!!n),n[1]){var r=n[1];r=(r+"000000000").substr(0,9),e=Number(r)}var i=new Date(t);return{seconds:Math.floor(i.getTime()/1e3),nanos:e}}return{seconds:ce(t.seconds),nanos:ce(t.nanos)}}function ce(t){return"number"==typeof t?t:"string"==typeof t?Number(t):0}function he(t){return"string"==typeof t?tt.fromBase64String(t):tt.fromUint8Array(t)}function le(t,e){return{referenceValue:"projects/"+t.projectId+"/databases/"+t.database+"/documents/"+e.path.R()}}function fe(t){return!!t&&"integerValue"in t}function pe(t){return!!t&&"arrayValue"in t}function de(t){return!!t&&"nullValue"in t}function ve(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function ge(t){return!!t&&"mapValue"in t} 2374/** 2375 * @license 2376 * Copyright 2017 Google LLC 2377 * 2378 * Licensed under the Apache License, Version 2.0 (the "License"); 2379 * you may not use this file except in compliance with the License. 2380 * You may obtain a copy of the License at 2381 * 2382 * http://www.apache.org/licenses/LICENSE-2.0 2383 * 2384 * Unless required by applicable law or agreed to in writing, software 2385 * distributed under the License is distributed on an "AS IS" BASIS, 2386 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2387 * See the License for the specific language governing permissions and 2388 * limitations under the License. 2389 */var ye={asc:"ASCENDING",desc:"DESCENDING"},me={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},_e=function(t,e){this.U=t,this.Ue=e};function be(t){return{integerValue:""+t}}function we(t,e){if(t.Ue){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:lt(e)?"-0":e}}function Ee(t,e){return ft(e)?be(e):we(t,e)}function Ie(t,e){return t.Ue?new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+e.nanoseconds).slice(-9)+"Z":{seconds:""+e.seconds,nanos:e.nanoseconds}}function Te(t,e){return t.Ue?e.toBase64():e.toUint8Array()}function Ce(t,e){return Ie(t,e.X())}function Se(t){return b(!!t),ct.Y(function(t){var e=ue(t);return new ut(e.seconds,e.nanos)}(t))}function Oe(t,e){return function(t){return new S(["projects",t.projectId,"databases",t.database])}(t).child("documents").child(e).R()}function Ne(t){var e=S.P(t);return b($e(e)),e}function Ae(t,e){return Oe(t.U,e.path)}function ke(t,e){var n=Ne(e);return b(n.get(1)===t.U.projectId),b(!n.get(3)&&!t.U.database||n.get(3)===t.U.database),new A(De(n))}function Re(t,e){return Oe(t.U,e)}function Pe(t){var e=Ne(t);return 4===e.length?S.g():De(e)}function xe(t){return new S(["projects",t.U.projectId,"databases",t.U.database]).R()}function De(t){return b(t.length>4&&"documents"===t.get(4)),t.u(5)}function Le(t,e,n){return{name:Ae(t,e),fields:n.proto.mapValue.fields}}function je(t,e){var n;if(e instanceof En)n={update:Le(t,e.key,e.value)};else if(e instanceof Nn)n={delete:Ae(t,e.key)};else if(e instanceof In)n={update:Le(t,e.key,e.data),updateMask:Xe(e.Qe)};else if(e instanceof Cn)n={transform:{document:Ae(t,e.key),fieldTransforms:e.fieldTransforms.map((function(t){return function(t,e){var n=e.transform;if(n instanceof nn)return{fieldPath:e.field.R(),setToServerValue:"REQUEST_TIME"};if(n instanceof rn)return{fieldPath:e.field.R(),appendMissingElements:{values:n.elements}};if(n instanceof sn)return{fieldPath:e.field.R(),removeAllFromArray:{values:n.elements}};if(n instanceof un)return{fieldPath:e.field.R(),increment:n.We};throw _()}(0,t)}))}};else{if(!(e instanceof An))return _();n={verify:Ae(t,e.key)}}return e.Ke.je||(n.currentDocument=function(t,e){return void 0!==e.updateTime?{updateTime:Ce(t,e.updateTime)}:void 0!==e.exists?{exists:e.exists}:_()}(t,e.Ke)),n}function Me(t,e){var n=e.currentDocument?function(t){return void 0!==t.updateTime?dn.updateTime(Se(t.updateTime)):void 0!==t.exists?dn.exists(t.exists):dn.Ge()}(e.currentDocument):dn.Ge();if(e.update){e.update.name;var r=ke(t,e.update.name),i=new kn({mapValue:{fields:e.update.fields}});if(e.updateMask){var o=function(t){var e=t.fieldPaths||[];return new ln(e.map((function(t){return N.S(t)})))}(e.updateMask);return new In(r,i,o,n)}return new En(r,i,n)}if(e.delete){var s=ke(t,e.delete);return new Nn(s,n)}if(e.transform){var a=ke(t,e.transform.document),u=e.transform.fieldTransforms.map((function(e){return function(t,e){var n=null;if("setToServerValue"in e)b("REQUEST_TIME"===e.setToServerValue),n=new nn;else if("appendMissingElements"in e){var r=e.appendMissingElements.values||[];n=new rn(r)}else if("removeAllFromArray"in e){var i=e.removeAllFromArray.values||[];n=new sn(i)}else"increment"in e?n=new un(t,e.increment):_();var o=N.S(e.fieldPath);return new fn(o,n)}(t,e)}));return b(!0===n.exists),new Cn(a,u)}if(e.verify){var c=ke(t,e.verify);return new An(c,n)}return _()}function Fe(t,e){return{documents:[Re(t,e.path)]}}function Ue(t,e){var n={structuredQuery:{}},r=e.path;null!==e.collectionGroup?(n.parent=Re(t,r),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=Re(t,r.h()),n.structuredQuery.from=[{collectionId:r._()}]);var i=function(t){if(0!==t.length){var e=t.map((function(t){return function(t){if("=="===t.op){if(ve(t.value))return{unaryFilter:{field:Ke(t.field),op:"IS_NAN"}};if(de(t.value))return{unaryFilter:{field:Ke(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(ve(t.value))return{unaryFilter:{field:Ke(t.field),op:"IS_NOT_NA
2389N"}};if(de(t.value))return{unaryFilter:{field:Ke(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Ke(t.field),op:He(t.op),value:t.value}}}(t)}));return 1===e.length?e[0]:{compositeFilter:{op:"AND",filters:e}}}}(e.filters);i&&(n.structuredQuery.where=i);var o=function(t){if(0!==t.length)return t.map((function(t){return function(t){return{field:Ke(t.field),direction:Ge(t.dir)}}(t)}))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);var s=function(t,e){return t.Ue||ht(e)?e:{value:e}}(t,e.limit);return null!==s&&(n.structuredQuery.limit=s),e.startAt&&(n.structuredQuery.startAt=Be(e.startAt)),e.endAt&&(n.structuredQuery.endAt=Be(e.endAt)),n}function Ve(t){var e=Pe(t.parent),n=t.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){b(1===r);var o=n.from[0];o.allDescendants?i=o.collectionId:e=e.child(o.collectionId)}var s=[];n.where&&(s=qe(n.where));var a=[];n.orderBy&&(a=n.orderBy.map((function(t){return function(t){return new dr(ze(t.field),function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction))}(t)})));var u=null;n.limit&&(u=function(t){var e;return ht(e="object"==typeof t?t.value:t)?null:e}(n.limit));var c=null;n.startAt&&(c=We(n.startAt));var h=null;return n.endAt&&(h=We(n.endAt)),Kn(Fn(e,i,a,s,u,"F",c,h))}function qe(t){return t?void 0!==t.unaryFilter?[Ye(t)]:void 0!==t.fieldFilter?[Qe(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((function(t){return qe(t)})).reduce((function(t,e){return t.concat(e)})):_():[]}function Be(t){return{before:t.before,values:t.position}}function We(t){var e=!!t.before,n=t.values||[];return new hr(n,e)}function Ge(t){return ye[t]}function He(t){return me[t]}function Ke(t){return{fieldPath:t.R()}}function ze(t){return N.S(t.fieldPath)}function Qe(t){return er.create(ze(t.fieldFilter.field),function(t){switch(t){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":default:return _()}}(t.fieldFilter.op),t.fieldFilter.value)}function Ye(t){switch(t.unaryFilter.op){case"IS_NAN":var e=ze(t.unaryFilter.field);return er.create(e,"==",{doubleValue:NaN});case"IS_NULL":var n=ze(t.unaryFilter.field);return er.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var r=ze(t.unaryFilter.field);return er.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var i=ze(t.unaryFilter.field);return er.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return _()}}function Xe(t){var e=[];return t.fields.forEach((function(t){return e.push(t.R())})),{fieldPaths:e}}function $e(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)} 2390/** 2391 * @license 2392 * Copyright 2018 Google LLC 2393 * 2394 * Licensed under the Apache License, Version 2.0 (the "License"); 2395 * you may not use this file except in compliance with the License. 2396 * You may obtain a copy of the License at 2397 * 2398 * http://www.apache.org/licenses/LICENSE-2.0 2399 * 2400 * Unless required by applicable law or agreed to in writing, software 2401 * distributed under the License is distributed on an "AS IS" BASIS, 2402 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2403 * See the License for the specific language governing permissions and 2404 * limitations under the License. 2405 */var Je=function(){this.ze=void 0};function Ze(t,e,n){return t instanceof nn?function(t,e){var n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:t.seconds,nanos:t.nanoseconds}}}};return e&&(n.fields.__previous_value__=e),{mapValue:n}}(n,e):t instanceof rn?on(t,e):t instanceof sn?an(t,e):function(t,e){var n=en(t,e),r=cn(n)+cn(t.We);return fe(n)&&fe(t.We)?be(r):we(t.serializer,r)}(t,e)}function tn(t,e,n){return t instanceof rn?on(t,e):t instanceof sn?an(t,e):n}function en(t,e){return t instanceof un?fe(n=e)||function(t){return!!t&&"doubleValue"in t}(n)?e:{integerValue:0}:null;var n}var nn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(Je),rn=function(t){function e(e){var n=this;return(n=t.call(this)||this).elements=e,n}return r.__extends(e,t),e}(Je);function on(t,e){for(var n=hn(e),r=function(t){n.some((function(e){return ne(e,t)}))||n.push(t)},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var sn=function(t){function e(e){var n=this;return(n=t.call(this)||this).elements=e,n}return r.__extends(e,t),e}(Je);function an(t,e){for(var n=hn(e),r=function(t){n=n.filter((function(e){return!ne(e,t)}))},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var un=function(t){function e(e,n){var r=this;
2405return(r=t.call(this)||this).serializer=e,r.We=n,r}return r.__extends(e,t),e}(Je);function cn(t){return ce(t.integerValue||t.doubleValue)}function hn(t){return pe(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]} 2406/** 2407 * @license 2408 * Copyright 2017 Google LLC 2409 * 2410 * Licensed under the Apache License, Version 2.0 (the "License"); 2411 * you may not use this file except in compliance with the License. 2412 * You may obtain a copy of the License at 2413 * 2414 * http://www.apache.org/licenses/LICENSE-2.0 2415 * 2416 * Unless required by applicable law or agreed to in writing, software 2417 * distributed under the License is distributed on an "AS IS" BASIS, 2418 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2419 * See the License for the specific language governing permissions and 2420 * limitations under the License. 2421 */var ln=function(){function t(t){this.fields=t,t.sort(N.i)}return t.prototype.He=function(t){for(var e=0,n=this.fields;e<n.length;e++)if(n[e].T(t))return!0;return!1},t.prototype.isEqual=function(t){return J(this.fields,t.fields,(function(t,e){return t.isEqual(e)}))},t}(),fn=function(t,e){this.field=t,this.transform=e},pn=function(t,e){this.version=t,this.transformResults=e},dn=function(){function t(t,e){this.updateTime=t,this.exists=e}return t.Ge=function(){return new t},t.exists=function(e){return new t(void 0,e)},t.updateTime=function(e){return new t(e)},Object.defineProperty(t.prototype,"je",{get:function(){return void 0===this.updateTime&&void 0===this.exists},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)},t}();function vn(t,e){return void 0!==t.updateTime?e instanceof Dn&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e instanceof Dn}var gn=function(){};function yn(t,e,n){return t instanceof En?function(t,e,n){return new Dn(t.key,n.version,t.value,{hasCommittedMutations:!0})}(t,0,n):t instanceof In?function(t,e,n){if(!vn(t.Ke,e))return new jn(t.key,n.version);var r=Tn(t,e);return new Dn(t.key,n.version,r,{hasCommittedMutations:!0})}(t,e,n):t instanceof Cn?function(t,e,n){if(b(null!=n.transformResults),!vn(t.Ke,e))return new jn(t.key,n.version);var r=Sn(t,e),i=function(t,e,n){var r=[];b(t.length===n.length);for(var i=0;i<n.length;i++){var o=t[i],s=o.transform,a=null;e instanceof Dn&&(a=e.field(o.field)),r.push(tn(s,a,n[i]))}return r}(t.fieldTransforms,e,n.transformResults),o=n.version,s=On(t,r.data(),i);return new Dn(t.key,o,s,{hasCommittedMutations:!0})}(t,e,n):function(t,e,n){return new Ln(t.key,n.version,{hasCommittedMutations:!0})}(t,0,n)}function mn(t,e,n,r){return t instanceof En?function(t,e){if(!vn(t.Ke,e))return e;var n=wn(e);return new Dn(t.key,n,t.value,{Ye:!0})}(t,e):t instanceof In?function(t,e){if(!vn(t.Ke,e))return e;var n=wn(e),r=Tn(t,e);return new Dn(t.key,n,r,{Ye:!0})}(t,e):t instanceof Cn?function(t,e,n,r){if(!vn(t.Ke,e))return e;var i=Sn(t,e),o=function(t,e,n,r){for(var i=[],o=0,s=t;o<s.length;o++){var a=s[o],u=a.transform,c=null;n instanceof Dn&&(c=n.field(a.field)),null===c&&r instanceof Dn&&(c=r.field(a.field)),i.push(Ze(u,c,e))}return i}(t.fieldTransforms,n,e,r),s=On(t,i.data(),o);return new Dn(t.key,i.version,s,{Ye:!0})}(t,e,r,n):function(t,e){return vn(t.Ke,e)?new Ln(t.key,ct.min()):e}(t,e)}function _n(t,e){return t instanceof Cn?function(t,e){for(var n=null,r=0,i=t.fieldTransforms;r<i.length;r++){var o=i[r],s=e instanceof Dn?e.field(o.field):void 0,a=en(o.transform,s||null);null!=a&&(n=null==n?(new Rn).set(o.field,a):n.set(o.field,a))}return n?n.Je():null}(t,e):null}function bn(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.Ke.isEqual(e.Ke)&&(0===t.type?t.value.isEqual(e.value):1===t.type?t.data.isEqual(e.data)&&t.Qe.isEqual(e.Qe):2!==t.type||J(t.fieldTransforms,t.fieldTransforms,(function(t,e){return function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof rn&&e instanceof rn||t instanceof sn&&e instanceof sn?J(t.elements,e.elements,ne):t instanceof un&&e instanceof un?ne(t.We,e.We):t instanceof nn&&e instanceof nn}(t.transform,e.transform)}(t,e)})))}function wn(t){return t instanceof Dn?t.version:ct.min()}var En=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).key=e,i.value=n,i.Ke=r,i.type=0,i}return r.__extends(e,t),e}(gn),In=function(t){function e(e,n,r,i){var o=this;return(o=t.call(this)||this).key=e,o.data=n,o.Qe=r,o.Ke=i,o.type=1,o}return r.__extends(e,t),e}(gn);function Tn(t,e){return function(t,e){var n=new Rn(e);
2421return t.Qe.fields.forEach((function(e){if(!e.m()){var r=t.data.field(e);null!==r?n.set(e,r):n.delete(e)}})),n.Je()}(t,e instanceof Dn?e.data():kn.empty())}var Cn=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.fieldTransforms=n,r.type=2,r.Ke=dn.exists(!0),r}return r.__extends(e,t),e}(gn);function Sn(t,e){return e}function On(t,e,n){for(var r=new Rn(e),i=0;i<t.fieldTransforms.length;i++){var o=t.fieldTransforms[i];r.set(o.field,n[i])}return r.Je()}var Nn=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.Ke=n,r.type=3,r}return r.__extends(e,t),e}(gn),An=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.Ke=n,r.type=4,r}return r.__extends(e,t),e}(gn),kn=function(){function t(t){this.proto=t}return t.empty=function(){return new t({mapValue:{}})},t.prototype.field=function(t){if(t.m())return this.proto;for(var e=this.proto,n=0;n<t.length-1;++n){if(!e.mapValue.fields)return null;if(!ge(e=e.mapValue.fields[t.get(n)]))return null}return(e=(e.mapValue.fields||{})[t._()])||null},t.prototype.isEqual=function(t){return ne(this.proto,t.proto)},t}(),Rn=function(){function t(t){void 0===t&&(t=kn.empty()),this.Xe=t,this.Ze=new Map}return t.prototype.set=function(t,e){return this.tn(t,e),this},t.prototype.delete=function(t){return this.tn(t,null),this},t.prototype.tn=function(t,e){for(var n=this.Ze,r=0;r<t.length-1;++r){var i=t.get(r),o=n.get(i);o instanceof Map?n=o:o&&10===ee(o)?(o=new Map(Object.entries(o.mapValue.fields||{})),n.set(i,o),n=o):(o=new Map,n.set(i,o),n=o)}n.set(t._(),e)},t.prototype.Je=function(){var t=this.en(N.g(),this.Ze);return null!=t?new kn(t):this.Xe},t.prototype.en=function(t,e){var n=this,r=!1,i=this.Xe.field(t),o=ge(i)?Object.assign({},i.mapValue.fields):{};return e.forEach((function(e,i){if(e instanceof Map){var s=n.en(t.child(i),e);null!=s&&(o[i]=s,r=!0)}else null!==e?(o[i]=e,r=!0):o.hasOwnProperty(i)&&(delete o[i],r=!0)})),r?{mapValue:{fields:o}}:null},t}();function Pn(t){var e=[];return I(t.fields||{},(function(t,n){var r=new N([t]);if(ge(n)){var i=Pn(n.mapValue).fields;if(0===i.length)e.push(r);else for(var o=0,s=i;o<s.length;o++){var a=s[o];e.push(r.child(a))}}else e.push(r)})),new ln(e) 2422/** 2423 * @license 2424 * Copyright 2017 Google LLC 2425 * 2426 * Licensed under the Apache License, Version 2.0 (the "License"); 2427 * you may not use this file except in compliance with the License. 2428 * You may obtain a copy of the License at 2429 * 2430 * http://www.apache.org/licenses/LICENSE-2.0 2431 * 2432 * Unless required by applicable law or agreed to in writing, software 2433 * distributed under the License is distributed on an "AS IS" BASIS, 2434 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2435 * See the License for the specific language governing permissions and 2436 * limitations under the License. 2437 */}var xn=function(t,e){this.key=t,this.version=e},Dn=function(t){function e(e,n,r,i){var o=this;return(o=t.call(this,e,n)||this).nn=r,o.Ye=!!i.Ye,o.hasCommittedMutations=!!i.hasCommittedMutations,o}return r.__extends(e,t),e.prototype.field=function(t){return this.nn.field(t)},e.prototype.data=function(){return this.nn},e.prototype.sn=function(){return this.nn.proto},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.Ye===t.Ye&&this.hasCommittedMutations===t.hasCommittedMutations&&this.nn.isEqual(t.nn)},e.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+this.nn.toString()+", {hasLocalMutations: "+this.Ye+"}), {hasCommittedMutations: "+this.hasCommittedMutations+"})"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return this.Ye||this.hasCommittedMutations},enumerable:!1,configurable:!0}),e}(xn),Ln=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n)||this).hasCommittedMutations=!(!r||!r.hasCommittedMutations),i}return r.__extends(e,t),e.prototype.toString=function(){return"NoDocument("+this.key+", "+this.version+")"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return this.hasCommittedMutations}
2437,enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.hasCommittedMutations===this.hasCommittedMutations&&t.version.isEqual(this.version)&&t.key.isEqual(this.key)},e}(xn),jn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.toString=function(){return"UnknownDocument("+this.key+", "+this.version+")"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.isEqual=function(t){return t instanceof e&&t.version.isEqual(this.version)&&t.key.isEqual(this.key)},e}(xn),Mn=function(t,e,n,r,i,o,s,a){void 0===e&&(e=null),void 0===n&&(n=[]),void 0===r&&(r=[]),void 0===i&&(i=null),void 0===o&&(o="F"),void 0===s&&(s=null),void 0===a&&(a=null),this.path=t,this.collectionGroup=e,this.rn=n,this.filters=r,this.limit=i,this.on=o,this.startAt=s,this.endAt=a,this.an=null,this.cn=null,this.startAt,this.endAt};function Fn(t,e,n,r,i,o,s,a){return new Mn(t,e,n,r,i,o,s,a)}function Un(t){return new Mn(t)}function Vn(t){return!ht(t.limit)&&"F"===t.on}function qn(t){return!ht(t.limit)&&"L"===t.on}function Bn(t){return t.rn.length>0?t.rn[0].field:null}function Wn(t){for(var e=0,n=t.filters;e<n.length;e++){var r=n[e];if(r.un())return r.field}return null}function Gn(t){return null!==t.collectionGroup}function Hn(t){var e=w(t);if(null===e.an){e.an=[];var n=Wn(e),r=Bn(e);if(null!==n&&null===r)n.p()||e.an.push(new dr(n)),e.an.push(new dr(N.v(),"asc"));else{for(var i=!1,o=0,s=e.rn;o<s.length;o++){var a=s[o];e.an.push(a),a.field.p()&&(i=!0)}if(!i){var u=e.rn.length>0?e.rn[e.rn.length-1].dir:"asc";e.an.push(new dr(N.v(),u))}}}return e.an}function Kn(t){var e=w(t);if(!e.cn)if("F"===e.on)e.cn=dt(e.path,e.collectionGroup,Hn(e),e.filters,e.limit,e.startAt,e.endAt);else{for(var n=[],r=0,i=Hn(e);r<i.length;r++){var o=i[r],s="desc"===o.dir?"asc":"desc";n.push(new dr(o.field,s))}var a=e.endAt?new hr(e.endAt.position,!e.endAt.before):null,u=e.startAt?new hr(e.startAt.position,!e.startAt.before):null;e.cn=dt(e.path,e.collectionGroup,n,e.filters,e.limit,a,u)}return e.cn}function zn(t,e,n){return new Mn(t.path,t.collectionGroup,t.rn.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function Qn(t,e){return new Mn(t.path,t.collectionGroup,t.rn.slice(),t.filters.slice(),t.limit,t.on,e,t.endAt)}function Yn(t,e){return new Mn(t.path,t.collectionGroup,t.rn.slice(),t.filters.slice(),t.limit,t.on,t.startAt,e)}function Xn(t,e){return gt(Kn(t),Kn(e))&&t.on===e.on}function $n(t){return vt(Kn(t))+"|lt:"+t.on}function Jn(t){return"Query(target="+function(t){var e=t.path.R();return null!==t.collectionGroup&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=", filters: ["+t.filters.map((function(t){return(e=t).field.R()+" "+e.op+" "+se(e.value);var e})).join(", ")+"]"),ht(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=", orderBy: ["+t.orderBy.map((function(t){return(e=t).field.R()+" ("+e.dir+")";var e})).join(", ")+"]"),t.startAt&&(e+=", startAt: "+lr(t.startAt)),t.endAt&&(e+=", endAt: "+lr(t.endAt)),"Target("+e+")"}(Kn(t))+"; limitType="+t.on+")"}function Zn(t,e){return function(t,e){var n=e.key.path;return null!==t.collectionGroup?e.key.N(t.collectionGroup)&&t.path.T(n):A.F(t.path)?t.path.isEqual(n):t.path.I(n)}(t,e)&&function(t,e){for(var n=0,r=t.rn;n<r.length;n++){var i=r[n];if(!i.field.p()&&null===e.field(i.field))return!1}return!0}(t,e)&&function(t,e){for(var n=0,r=t.filters;n<r.length;n++)if(!r[n].matches(e))return!1;return!0}(t,e)&&function(t,e){return!(t.startAt&&!fr(t.startAt,Hn(t),e))&&(!t.endAt||!fr(t.endAt,Hn(t),e))}(t,e)}function tr(t){return function(e,n){for(var r=!1,i=0,o=Hn(t);i<o.length;i++){var s=o[i],a=vr(s,e,n);if(0!==a)return a;r=r||s.field.p()}return 0}}var er=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).field=e,i.op=n,i.value=r,i}return r.__extends(e,t),e.create=function(t,n,r){if(t.p())return"in"===n||"not-in"===n?this.hn(t,n,r):new nr(t,n,r);if(de(r)){if("=="!==n&&"!="!==n)throw new f(l.INVALID_ARGUMENT,"Invalid query. Null only supports '==' and '!=' comparisons.");return new e(t,n,r)}if(ve(r)){if("=="!==n&&"!="!==n)throw new f(l.INVALID_ARGUMENT,"Invalid query. NaN only supports '==' and '!=' comparisons.");return new e(t,n,r)}return"array-contains"===n?new sr(t,r):"in"===n?new ar(t,r):"not-in"===n?new ur(t,r):"array-contains-any"===n?new cr(t,r):new e(t,n,r)},e.hn=function(t,e,n){return"in"===e?new rr(t,n):new ir(t,n)},e.prototype.matches=function(t){var e=t.field(this.field);return"!="===this.op?null!==e&&this.ln(ie(e,this.value)):null!==e&&ee(this.value)===ee(e)&&this.ln(ie(e,this.value))},e.prototype.ln=function(t){switch(this.op){case"<":return t<0;case"<=":return t<=0;case"==":return 0===t;case"!=":return 0!==t;case">":return t>0;case">=":return t>=0;default:return _()}},e.prototype.un=function(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0},e}((function(){})),nr=function(t){function e(e,n,r){var i=this;return(i=t.call(this,e,n,r)||this).key=A.C(r.referenceValue),i}return r.__extends(e,t),e.prototype.matches=function(t){var e=A.i(t.key,this.key);return this.ln(e)},e}(er),rr=function(t){function e(e,n){var r=this;return(r=t.call(this,e,"in",n)||this).keys=or("in",n),r}return r.__extends(e,t),e.prototype.matches=function(t){return this.keys.some((function(e){return e.isEqual(t.key)}))},e}(er),ir=function(t){function e(e,n){var r=this;return(r=t.call(this,e,"not-in",n)||this).keys=or("not-in",n),r}return r.__extends(e,t),e.prototype.matches=function(t){return!this.keys.some((function(e){return e.isEqual(t.key)}))},e}(er);function or(t,e){var n;return((null===(n=e.arrayValue)||void 0===n?void 0:n.values)||[]).map((function(t){return A.C(t.referenceValue)}))}var sr=function(t){function e(e,n){return t.call(this,e,"array-contains",n)||this}return r.__extends(e,t),e.prototype.matches=function(t){var e=t.field(this.field);return pe(e)&&re(e.arrayValue,this.value)},e}(er),ar=function(t){function e(e,n){return t.call(this,e,"in",n)||this}return r.__extends(e,t),e.prototype.matches=function(t){var e=t.field(this.field);return null!==e&&re(this.value.arrayValue,e)},e}(er),ur=function(t){function e(e,n){return t.call(this,e,"not-in",n)||this}return r.__extends(e,t),e.prototype.matches=function(t){if(re(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;var e=t.field(this.field);return null!==e&&!re(this.value.arrayValue,e)},e}(er),cr=function(t){function e(e,n){return t.call(this,e,"array-contains-any",n)||this}return r.__extends(e,t),e.prototype.matches=function(t){var e=this,n=t.field(this.field);return!(!pe(n)||!n.arrayValue.values)&&n.arrayValue.values.some((function(t){return re(e.value.arrayValue,t)}))},e}(er),hr=function(t,e){this.position=t,this.before=e};function lr(t){return(t.before?"b":"a")+":"+t.position.map((function(t){return se(t)})).join(",")}function fr(t,e,n){for(var r=0,i=0;i<t.position.length;i++){var o=e[i],s=t.position[i];if(r=o.field.p()?A.i(A.C(s.referenceValue),n.key):ie(s,n.field(o.field)),"desc"===o.dir&&(r*=-1),0!==r)break}return t.before?r<=0:r<0}function pr(t,e){if(null===t)return null===e;if(null===e)return!1;if(t.before!==e.before||t.position.length!==e.position.length)return!1;for(var n=0;n<t.position.length;n++)if(!ne(t.position[n],e.position[n]))return!1;return!0}var dr=function(t,e){void 0===e&&(e="asc"),this.field=t,this.dir=e};
2437function vr(t,e,n){var r=t.field.p()?A.i(e.key,n.key):function(t,e,n){var r=e.field(t),i=n.field(t);return null!==r&&null!==i?ie(r,i):_()}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return _()}}function gr(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)} 2438/** 2439 * @license 2440 * Copyright 2017 Google LLC 2441 * 2442 * Licensed under the Apache License, Version 2.0 (the "License"); 2443 * you may not use this file except in compliance with the License. 2444 * You may obtain a copy of the License at 2445 * 2446 * http://www.apache.org/licenses/LICENSE-2.0 2447 * 2448 * Unless required by applicable law or agreed to in writing, software 2449 * distributed under the License is distributed on an "AS IS" BASIS, 2450 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2451 * See the License for the specific language governing permissions and 2452 * limitations under the License. 2453 */var yr=function(){var t=this;this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},mr=function(){function t(t,e,n,r,i){void 0===n&&(n=1e3),void 0===r&&(r=1.5),void 0===i&&(i=6e4),this._n=t,this.fn=e,this.dn=n,this.wn=r,this.mn=i,this.Tn=0,this.En=null,this.In=Date.now(),this.reset()}return t.prototype.reset=function(){this.Tn=0},t.prototype.An=function(){this.Tn=this.mn},t.prototype.Rn=function(t){var e=this;this.cancel();var n=Math.floor(this.Tn+this.Pn()),r=Math.max(0,Date.now()-this.In),i=Math.max(0,n-r);i>0&&v("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.Tn+" ms, delay with jitter: "+n+" ms, last attempt: "+r+" ms ago)"),this.En=this._n.gn(this.fn,i,(function(){return e.In=Date.now(),t()})),this.Tn*=this.wn,this.Tn<this.dn&&(this.Tn=this.dn),this.Tn>this.mn&&(this.Tn=this.mn)},t.prototype.yn=function(){null!==this.En&&(this.En.Vn(),this.En=null)},t.prototype.cancel=function(){null!==this.En&&(this.En.cancel(),this.En=null)},t.prototype.Pn=function(){return(Math.random()-.5)*this.Tn},t}(),_r=function(){function t(t){var e=this;this.pn=null,this.bn=null,this.result=void 0,this.error=void 0,this.vn=!1,this.Sn=!1,t((function(t){e.vn=!0,e.result=t,e.pn&&e.pn(t)}),(function(t){e.vn=!0,e.error=t,e.bn&&e.bn(t)}))}return t.prototype.catch=function(t){return this.next(void 0,t)},t.prototype.next=function(e,n){var r=this;return this.Sn&&_(),this.Sn=!0,this.vn?this.error?this.Dn(n,this.error):this.Cn(e,this.result):new t((function(t,i){r.pn=function(n){r.Cn(e,n).next(t,i)},r.bn=function(e){r.Dn(n,e).next(t,i)}}))},t.prototype.Nn=function(){var t=this;return new Promise((function(e,n){t.next(e,n)}))},t.prototype.Fn=function(e){try{var n=e();return n instanceof t?n:t.resolve(n)}catch(e){return t.reject(e)}},t.prototype.Cn=function(e,n){return e?this.Fn((function(){return e(n)})):t.resolve(n)},t.prototype.Dn=function(e,n){return e?this.Fn((function(){return e(n)})):t.reject(n)},t.resolve=function(e){return new t((function(t,n){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.$n=function(e){return new t((function(t,n){var r=0,i=0,o=!1;e.forEach((function(e){++r,e.next((function(){++i,o&&i===r&&t()}),(function(t){return n(t)}))})),o=!0,i===r&&t()}))},t.xn=function(e){for(var n=t.resolve(!1),r=function(e){n=n.next((function(n){return n?t.resolve(n):e()}))},i=0,o=e;i<o.length;i++)r(o[i]);return n},t.forEach=function(t,e){var n=this,r=[];return t.forEach((function(t,i){r.push(e.call(n,t,i))})),this.$n(r)},t}(),br=function(){function e(t,n,r){this.name=t,this.version=n,this.kn=r,12.2===e.Mn(s.getUA())&&g("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}return e.delete=function(t){return v("SimpleDb","Removing database:",t),Sr(window.indexedDB.deleteDatabase(t)).Nn()},e.On=function(){if("undefined"==typeof indexedDB)return!1;if(e.Ln())return!0;var t=s.getUA(),n=e.Mn(t),r=0<n&&n<10,i=e.Bn(t),o=0<i&&i<4.5;return!(t.indexOf("MSIE ")>0||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0||r||o)},e.Ln=function(){var e;return"undefined"!=typeof t&&"YES"===(null===(e=Object({NODE_ENV:"production",BASE_URL:""}))||void 0===e?void 0:e.qn)},e.Un=function(t,e){return t.store(e)},e.Mn=function(t){var e=t.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=e?e[1].split("_").slice(0,2).join("."):"-1";return Number(n)},e.Bn=function(t){var e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)},e.prototype.Qn=function(t){return r.__awaiter(this,void 0,void 0,(function(){var e,n=this;return r.__generator(this,(function(r){switch(r.label){case 0:return this.db?[3,2]:(v("SimpleDb","Opening database:",this.name),e=this,[4,new Promise((function(e,r){var i=indexedDB.open(n.name,n.version);i.onsuccess=function(t){var n=t.target.result;e(n)},i.onblocked=function(){r(new Er(t,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},i.onerror=function(e){var n=e.target.error;"VersionError"===n.name?r(new f(l.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):r(new Er(t,n))},i.onupgradeneeded=function(t){v("SimpleDb",'Database "'+n.name+'" requires upgrade from version:',t.oldVersion);var e=t.target.result;n.kn.createOrUpgrade(e,i.transaction,t.oldVersion,n.version).next((function(){v("SimpleDb","Database upgrade to version "+n.version+" complete")}
2453))}}))]);case 1:e.db=r.sent(),r.label=2;case 2:return[2,(this.Wn&&(this.db.onversionchange=function(t){return n.Wn(t)}),this.db)]}}))}))},e.prototype.jn=function(t){this.Wn=t,this.db&&(this.db.onversionchange=function(e){return t(e)})},e.prototype.runTransaction=function(t,e,n,i){return r.__awaiter(this,void 0,void 0,(function(){var o,s,a,u,c;return r.__generator(this,(function(h){switch(h.label){case 0:o="readonly"===e,s=0,a=function(){var e,a,c,h,l;return r.__generator(this,(function(r){switch(r.label){case 0:++s,r.label=1;case 1:return r.trys.push([1,4,,5]),[4,u.Qn(t)];case 2:return u.db=r.sent(),e=Tr.open(u.db,t,o?"readonly":"readwrite",n),a=i(e).catch((function(t){return e.abort(t),_r.reject(t)})).Nn(),c={},a.catch((function(){})),[4,e.Kn];case 3:return[2,(c.value=(r.sent(),a),c)];case 4:return h=r.sent(),l="FirebaseError"!==h.name&&s<3,v("SimpleDb","Transaction failed with error:",h.message,"Retrying:",l),u.close(),l?[3,5]:[2,{value:Promise.reject(h)}];case 5:return[2]}}))},u=this,h.label=1;case 1:return[5,a()];case 2:if("object"==typeof(c=h.sent()))return[2,c.value];h.label=3;case 3:return[3,1];case 4:return[2]}}
2453))}))},e.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},e}(),wr=function(){function t(t){this.Gn=t,this.zn=!1,this.Hn=null}return Object.defineProperty(t.prototype,"vn",{get:function(){return this.zn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Yn",{get:function(){return this.Hn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{set:function(t){this.Gn=t},enumerable:!1,configurable:!0}),t.prototype.done=function(){this.zn=!0},t.prototype.Jn=function(t){this.Hn=t},t.prototype.delete=function(){return Sr(this.Gn.delete())},t}(),Er=function(t){function e(e,n){var r=this;return(r=t.call(this,l.UNAVAILABLE,"IndexedDB transaction '"+e+"' failed: "+n)||this).name="IndexedDbTransactionError",r}return r.__extends(e,t),e}(f); 2454/** 2455 * @license 2456 * Copyright 2017 Google LLC 2457 * 2458 * Licensed under the Apache License, Version 2.0 (the "License"); 2459 * you may not use this file except in compliance with the License. 2460 * You may obtain a copy of the License at 2461 * 2462 * http://www.apache.org/licenses/LICENSE-2.0 2463 * 2464 * Unless required by applicable law or agreed to in writing, software 2465 * distributed under the License is distributed on an "AS IS" BASIS, 2466 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2467 * See the License for the specific language governing permissions and 2468 * limitations under the License. 2469 */function Ir(t){return"IndexedDbTransactionError"===t.name}var Tr=function(){function t(t,e){var n=this;this.action=t,this.transaction=e,this.aborted=!1,this.Xn=new yr,this.transaction.oncomplete=function(){n.Xn.resolve()},this.transaction.onabort=function(){e.error?n.Xn.reject(new Er(t,e.error)):n.Xn.resolve()},this.transaction.onerror=function(e){var r=Nr(e.target.error);n.Xn.reject(new Er(t,r))}}return t.open=function(e,n,r,i){try{return new t(n,e.transaction(i,r))}catch(e){throw new Er(n,e)}},Object.defineProperty(t.prototype,"Kn",{get:function(){return this.Xn.promise},enumerable:!1,configurable:!0}),t.prototype.abort=function(t){t&&this.Xn.reject(t),this.aborted||(v("SimpleDb","Aborting transaction:",t?t.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())},t.prototype.store=function(t){var e=this.transaction.objectStore(t);return new Cr(e)},t}(),Cr=function(){function t(t){this.store=t}return t.prototype.put=function(t,e){var n;return void 0!==e?(v("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(v("SimpleDb","PUT",this.store.name,"<auto-key>",t),n=this.store.put(t)),Sr(n)},t.prototype.add=function(t){return v("SimpleDb","ADD",this.store.name,t,t),Sr(this.store.add(t))},t.prototype.get=function(t){var e=this;return Sr(this.store.get(t)).next((function(n){return void 0===n&&(n=null),v("SimpleDb","GET",e.store.name,t,n),n}))},t.prototype.delete=function(t){return v("SimpleDb","DELETE",this.store.name,t),Sr(this.store.delete(t))},t.prototype.count=function(){return v("SimpleDb","COUNT",this.store.name),Sr(this.store.count())},t.prototype.Zn=function(t,e){var n=this.cursor(this.options(t,e)),r=[];return this.ts(n,(function(t,e){r.push(e)})).next((function(){return r}))},t.prototype.es=function(t,e){v("SimpleDb","DELETE ALL",this.store.name);var n=this.options(t,e);n.ns=!1;var r=this.cursor(n);return this.ts(r,(function(t,e,n){return n.delete()}))},t.prototype.ss=function(t,e){var n;e?n=t:(n={},e=t);var r=this.cursor(n);return this.ts(r,e)},t.prototype.rs=function(t){var e=this.cursor({});return new _r((function(n,r){e.onerror=function(t){var e=Nr(t.target.error);r(e)},e.onsuccess=function(e){var r=e.target.result;r?t(r.primaryKey,r.value).next((function(t){t?r.continue():n()})):n()}}))},t.prototype.ts=function(t,e){var n=[];return new _r((function(r,i){t.onerror=function(t){i(t.target.error)},t.onsuccess=function(t){var i=t.target.result;if(i){var o=new wr(i),s=e(i.primaryKey,i.value,o);if(s instanceof _r){var a=s.catch((function(t){return o.done(),_r.reject(t)}));n.push(a)}o.vn?r():null===o.Yn?i.continue():i.continue(o.Yn)}else r()}}
2469)).next((function(){return _r.$n(n)}))},t.prototype.options=function(t,e){var n=void 0;return void 0!==t&&("string"==typeof t?n=t:e=t),{index:n,range:e}},t.prototype.cursor=function(t){var e="next";if(t.reverse&&(e="prev"),t.index){var n=this.store.index(t.index);return t.ns?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)},t}();function Sr(t){return new _r((function(e,n){t.onsuccess=function(t){var n=t.target.result;e(n)},t.onerror=function(t){var e=Nr(t.target.error);n(e)}}))}var Or=!1;function Nr(t){var e=br.Mn(s.getUA());if(e>=12.2&&e<13){var n="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(n)>=0){var r=new f("internal","IOS_INDEXEDDB_BUG1: IndexedDb has thrown '"+n+"'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.");return Or||(Or=!0,setTimeout((function(){throw r}),0)),r}}return t} 2470/** 2471 * @license 2472 * Copyright 2020 Google LLC 2473 * 2474 * Licensed under the Apache License, Version 2.0 (the "License"); 2475 * you may not use this file except in compliance with the License. 2476 * You may obtain a copy of the License at 2477 * 2478 * http://www.apache.org/licenses/LICENSE-2.0 2479 * 2480 * Unless required by applicable law or agreed to in writing, software 2481 * distributed under the License is distributed on an "AS IS" BASIS, 2482 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2483 * See the License for the specific language governing permissions and 2484 * limitations under the License. 2485 */function Ar(){return"undefined"!=typeof window?window:null}function kr(){return"undefined"!=typeof document?document:null} 2486/** 2487 * @license 2488 * Copyright 2017 Google LLC 2489 * 2490 * Licensed under the Apache License, Version 2.0 (the "License"); 2491 * you may not use this file except in compliance with the License. 2492 * You may obtain a copy of the License at 2493 * 2494 * http://www.apache.org/licenses/LICENSE-2.0 2495 * 2496 * Unless required by applicable law or agreed to in writing, software 2497 * distributed under the License is distributed on an "AS IS" BASIS, 2498 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2499 * See the License for the specific language governing permissions and 2500 * limitations under the License. 2501 */var Rr=function(){function t(t,e,n,r,i){this.os=t,this.fn=e,this.cs=n,this.op=r,this.us=i,this.hs=new yr,this.then=this.hs.promise.then.bind(this.hs.promise),this.hs.promise.catch((function(t){}))}return t.ls=function(e,n,r,i,o){var s=new t(e,n,Date.now()+r,i,o);return s.start(r),s},t.prototype.start=function(t){var e=this;this._s=setTimeout((function(){return e.fs()}),t)},t.prototype.Vn=function(){return this.fs()},t.prototype.cancel=function(t){null!==this._s&&(this.clearTimeout(),this.hs.reject(new f(l.CANCELLED,"Operation cancelled"+(t?": "+t:"")))
2501)},t.prototype.fs=function(){var t=this;this.os.ds((function(){return null!==t._s?(t.clearTimeout(),t.op().then((function(e){return t.hs.resolve(e)}))):Promise.resolve()}))},t.prototype.clearTimeout=function(){null!==this._s&&(this.us(this),clearTimeout(this._s),this._s=null)},t}(),Pr=function(){function t(){var t=this;this.ws=Promise.resolve(),this.Ts=[],this.Es=!1,this.Is=[],this.As=null,this.Rs=!1,this.Ps=[],this.gs=new mr(this,"async_queue_retry"),this.ys=function(){var e=kr();e&&v("AsyncQueue","Visibility state changed to ",e.visibilityState),t.gs.yn()};var e=kr();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.ys)}return Object.defineProperty(t.prototype,"Vs",{get:function(){return this.Es},enumerable:!1,configurable:!0}),t.prototype.ds=function(t){this.enqueue(t)},t.prototype.ps=function(t){this.bs(),this.vs(t)},t.prototype.Ss=function(){if(!this.Es){this.Es=!0;var t=kr();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.ys)}},t.prototype.enqueue=function(t){return this.bs(),this.Es?new Promise((function(t){})):this.vs(t)},t.prototype.Ds=function(t){var e=this;this.Ts.push(t),this.ds((function(){return e.Cs()}))},t.prototype.Cs=function(){return r.__awaiter(this,void 0,void 0,(function(){var t,e=this;return r.__generator(this,(function(n){switch(n.label){case 0:if(0===this.Ts.length)return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.Ts[0]()];case 2:return n.sent(),this.Ts.shift(),this.gs.reset(),[3,4];case 3:if(!Ir(t=n.sent()))throw t;return v("AsyncQueue","Operation failed with retryable error: "+t),[3,4];case 4:this.Ts.length>0&&this.gs.Rn((function(){return e.Cs()})),n.label=5;case 5:return[2]}}
2501))}))},t.prototype.vs=function(t){var e=this,n=this.ws.then((function(){return e.Rs=!0,t().catch((function(t){throw e.As=t,e.Rs=!1,g("INTERNAL UNHANDLED ERROR: ",function(t){var e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+"\n"+t.stack),e}(t)),t})).then((function(t){return e.Rs=!1,t}))}));return this.ws=n,n},t.prototype.gn=function(t,e,n){var r=this;this.bs(),this.Ps.indexOf(t)>-1&&(e=0);var i=Rr.ls(this,t,e,n,(function(t){return r.Ns(t)}));return this.Is.push(i),i},t.prototype.bs=function(){this.As&&_()},t.prototype.Fs=function(){},t.prototype.$s=function(){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(e){switch(e.label){case 0:return[4,t=this.ws];case 1:e.sent(),e.label=2;case 2:if(t!==this.ws)return[3,0];e.label=3;case 3:return[2]}}))}))},t.prototype.xs=function(t){for(var e=0,n=this.Is;e<n.length;e++)if(n[e].fn===t)return!0;return!1},t.prototype.ks=function(t){var e=this;return this.$s().then((function(){e.Is.sort((function(t,e){return t.cs-e.cs}));for(var n=0,r=e.Is;n<r.length;n++){var i=r[n];if(i.Vn(),"all"!==t&&i.fn===t)break}return e.$s()}))},t.prototype.Ms=function(t){this.Ps.push(t)},t.prototype.Ns=function(t){var e=this.Is.indexOf(t);this.Is.splice(e,1)},t}();function xr(t,e){if(g("AsyncQueue",e+": "+t),Ir(t))return new f(l.UNAVAILABLE,e+": "+t);throw t}var Dr=function(){this.Os=void 0,this.listeners=[]},Lr=function(){this.Ls=new at((function(t){return $n(t)}),Xn),this.onlineState="Unknown",this.Bs=new Set};function jr(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o,s,a,u,c;return r.__generator(this,(function(r){switch(r.label){case 0:if(n=w(t),i=e.query,o=!1,(s=n.Ls.get(i))||(o=!0,s=new Dr),!o)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),a=s,[4,n.qs(i)];case 2:return a.Os=r.sent(),[3,4];case 3:return u=r.sent(),c=xr(u,"Initialization of query '"+Jn(e.query)+"' failed"),[2,void e.onError(c)];case 4:return n.Ls.set(i,s),s.listeners.push(e),e.Us(n.onlineState),s.Os&&e.Qs(s.Os)&&Vr(n),[2]}}))}))}function Mr(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o,s,a;return r.__generator(this,(function(r){return n=w(t),i=e.query,o=!1,(s=n.Ls.get(i))&&(a=s.listeners.indexOf(e))>=0&&(s.listeners.splice(a,1),o=0===s.listeners.length),o?[2,(n.Ls.delete(i),n.Ws(i))]:[2]}))}))}function Fr(t,e){for(var n=w(t),r=!1,i=0,o=e;i<o.length;i++){var s=o[i],a=s.query,u=n.Ls.get(a);if(u){for(var c=0,h=u.listeners;c<h.length;c++)h[c].Qs(s)&&(r=!0);u.Os=s}}r&&Vr(n)}function Ur(t,e,n){var r=w(t),i=r.Ls.get(e);if(i)for(var o=0,s=i.listeners;o<s.length;o++)s[o].onError(n);r.Ls.delete(e)}function Vr(t){t.Bs.forEach((function(t){t.next()}))}var qr=function(){function t(t,e,n){this.query=t,this.js=e,this.Ks=!1,this.Gs=null,this.onlineState="Unknown",this.options=n||{}}return t.prototype.Qs=function(t){if(!this.options.includeMetadataChanges){for(var e=[],n=0,r=t.docChanges;n<r.length;n++){var i=r[n];3!==i.type&&e.push(i)}t=new qt(t.query,t.docs,t.Ut,e,t.Qt,t.fromCache,t.Wt,!0)}var o=!1;return this.Ks?this.zs(t)&&(this.js.next(t),o=!0):this.Hs(t,this.onlineState)&&(this.Ys(t),o=!0),this.Gs=t,o},t.prototype.onError=function(t){this.js.error(t)},t.prototype.Us=function(t){this.onlineState=t;var e=!1;return this.Gs&&!this.Ks&&this.Hs(this.Gs,t)&&(this.Ys(this.Gs),e=!0),e},t.prototype.Hs=function(t,e){if(!t.fromCache)return!0;var n="Offline"!==e;return!(this.options.Js&&n||t.docs.m()&&"Offline"!==e)},t.prototype.zs=function(t){if(t.docChanges.length>0)return!0;var e=this.Gs&&this.Gs.hasPendingWrites!==t.hasPendingWrites;return!(!t.Wt&&!e)&&!0===this.options.includeMetadataChanges},t.prototype.Ys=function(t){t=qt.Kt(t.query,t.docs,t.Qt,t.fromCache),this.Ks=!0,this.js.next(t)},t}(),Br=function(){function t(t){this.uid=t}return t.prototype.Xs=function(){return null!=this.uid},t.prototype.Zs=function(){return this.Xs()?"uid:"+this.uid:"anonymous-user"},t.prototype.isEqual=function(t){return t.uid===this.uid},t}(); 2502/** 2503 * @license 2504 * Copyright 2017 Google LLC 2505 * 2506 * Licensed under the Apache License, Version 2.0 (the "License");
2507 * you may not use this file except in compliance with the License. 2508 * You may obtain a copy of the License at 2509 * 2510 * http://www.apache.org/licenses/LICENSE-2.0 2511 * 2512 * Unless required by applicable law or agreed to in writing, software 2513 * distributed under the License is distributed on an "AS IS" BASIS, 2514 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2515 * See the License for the specific language governing permissions and 2516 * limitations under the License. 2517 */Br.UNAUTHENTICATED=new Br(null),Br.ti=new Br("google-credentials-uid"),Br.ei=new Br("first-party-uid"); 2518/** 2519 * @license 2520 * Copyright 2018 Google LLC 2521 * 2522 * Licensed under the Apache License, Version 2.0 (the "License"); 2523 * you may not use this file except in compliance with the License. 2524 * You may obtain a copy of the License at 2525 * 2526 * http://www.apache.org/licenses/LICENSE-2.0 2527 * 2528 * Unless required by applicable law or agreed to in writing, software 2529 * distributed under the License is distributed on an "AS IS" BASIS, 2530 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2531 * See the License for the specific language governing permissions and 2532 * limitations under the License. 2533 */ 2534var Wr=function(){function t(t,e){var n=this;this.previousValue=t,e&&(e.ni=function(t){return n.si(t)},this.ii=function(t){return e.ri(t)})}return t.prototype.si=function(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue},t.prototype.next=function(){var t=++this.previousValue;return this.ii&&this.ii(t),t},t}();function Gr(t,e){return"firestore_clients_"+t+"_"+e}function Hr(t,e,n){var r="firestore_mutations_"+t+"_"+n;return e.Xs()&&(r+="_"+e.uid),r}function Kr(t,e){return"firestore_targets_"+t+"_"+e}Wr.oi=-1;var zr=function(){function t(t,e,n,r){this.user=t,this.batchId=e,this.state=n,this.error=r}return t.ai=function(e,n,r){var i=JSON.parse(r),o="object"==typeof i&&-1!==["pending","acknowledged","rejected"].indexOf(i.state)&&(void 0===i.error||"object"==typeof i.error),s=void 0;return o&&i.error&&(o="string"==typeof i.error.message&&"string"==typeof i.error.code)&&(s=new f(i.error.code,i.error.message)),o?new t(e,n,i.state,s):(g("SharedClientState","Failed to parse mutation state for ID '"+n+"': "+r),null)},t.prototype.ci=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},t}(),Qr=function(){function t(t,e,n){this.targetId=t,this.state=e,this.error=n}return t.ai=function(e,n){var r=JSON.parse(n),i="object"==typeof r&&-1!==["not-current","current","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error),o=void 0;return i&&r.error&&(i="string"==typeof r.error.message&&"string"==typeof r.error.code)&&(o=new f(r.error.code,r.error.message)),i?new t(e,r.state,o):(g("SharedClientState","Failed to parse target state for ID '"+e+"': "+n),null)},t.prototype.ci=function(){var t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)},t}(),Yr=function(){function t(t,e){this.clientId=t,this.activeTargetIds=e}return t.ai=function(e,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,o=Ft(),s=0;i&&s<r.activeTargetIds.length;++s)i=ft(r.activeTargetIds[s]),o=o.add(r.activeTargetIds[s]);return i?new t(e,o):(g("SharedClientState","Failed to parse client data for instance '"+e+"': "+n),null)},t}(),Xr=function(){function t(t,e){this.clientId=t,this.onlineState=e}return t.ai=function(e){var n=JSON.parse(e);return"object"==typeof n&&-1!==["Unknown","Online","Offline"].indexOf(n.onlineState)&&"string"==typeof n.clientId?new t(n.clientId,n.onlineState):(g("SharedClientState","Failed to parse online state: "+e),null)},t}(),$r=function(){function t(){this.activeTargetIds=Ft()}return t.prototype.ui=function(t){this.activeTargetIds=this.activeTargetIds.add(t)},t.prototype.hi=function(t){this.activeTargetIds=this.activeTargetIds.delete(t)},t.prototype.ci=function(){var t={activeTargetIds:this.activeTargetIds.A(),updateTimeMs:Date.now()};return JSON.stringify(t)},t}(),Jr=function(){function t(t,e,n,r,i){this.window=t,this._n=e,this.persistenceKey=n,this.li=r,this._i=null,this.fi=null,this.ni=null,this.di=this.wi.bind(this),this.mi=new Tt($),this.Ti=!1,this.Ei=[];var o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.Ii=Gr(this.persistenceKey,this.li),this.Ai=function(t){return"firestore_sequence_number_"+t}(this.persistenceKey),this.mi=this.mi.rt(this.li,new $r),this.Ri=new RegExp("^firestore_clients_"+o+"_([^_]*)$"),this.Pi=new RegExp("^firestore_mutations_"+o+"_(\\d+)(?:_(.*))?$"),this.gi=new RegExp("^firestore_targets_"+o+"_(\\d+)$"),this.yi=function(t){return"firestore_online_state_"+t}(this.persistenceKey),this.window.addEventListener("storage",this.di)}return t.On=function(t){return!(!t||!t.localStorage)},t.prototype.start=function(){return r.__awaiter(this,void 0,void 0,(function(){var t,e,n,i,o,s,a,u,c,h,l,f=this;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,this._i.Vi()];case 1:for(t=r.sent(),e=0,n=t;e<n.length;e++)(i=n[e])!==this.li&&(o=this.getItem(Gr(this.persistenceKey,i)))&&
2534(s=Yr.ai(i,o))&&(this.mi=this.mi.rt(s.clientId,s));for(this.pi(),(a=this.storage.getItem(this.yi))&&(u=this.bi(a))&&this.vi(u),c=0,h=this.Ei;c<h.length;c++)l=h[c],this.wi(l);return this.Ei=[],this.window.addEventListener("unload",(function(){return f.Si()})),this.Ti=!0,[2]}}))}))},t.prototype.ri=function(t){this.setItem(this.Ai,JSON.stringify(t))},t.prototype.Di=function(){return this.Ci(this.mi)},t.prototype.Ni=function(t){var e=!1;return this.mi.forEach((function(n,r){r.activeTargetIds.has(t)&&(e=!0)})),e},t.prototype.Fi=function(t){this.$i(t,"pending")},t.prototype.xi=function(t,e,n){this.$i(t,e,n),this.ki(t)},t.prototype.Mi=function(t){var e="not-current";if(this.Ni(t)){var n=this.storage.getItem(Kr(this.persistenceKey,t));if(n){var r=Qr.ai(t,n);r&&(e=r.state)}}return this.Oi.ui(t),this.pi(),e},t.prototype.Li=function(t){this.Oi.hi(t),this.pi()},t.prototype.Bi=function(t){return this.Oi.activeTargetIds.has(t)},t.prototype.qi=function(t){this.removeItem(Kr(this.persistenceKey,t))},t.prototype.Ui=function(t,e,n){this.Qi(t,e,n)},t.prototype.Wi=function(t,e,n){var r=this;e.forEach((function(t){r.ki(t)})),this.currentUser=t,n.forEach((function(t){r.Fi(t)}))},t.prototype.ji=function(t){this.Ki(t)},t.prototype.Si=function(){this.Ti&&(this.window.removeEventListener("storage",this.di),this.removeItem(this.Ii),this.Ti=!1)},t.prototype.getItem=function(t){var e=this.storage.getItem(t);return v("SharedClientState","READ",t,e),e},t.prototype.setItem=function(t,e){v("SharedClientState","SET",t,e),this.storage.setItem(t,e)},t.prototype.removeItem=function(t){v("SharedClientState","REMOVE",t),this.storage.removeItem(t)},t.prototype.wi=function(t){var e=this,n=t;if(n.storageArea===this.storage){if(v("SharedClientState","EVENT",n.key,n.newValue),n.key===this.Ii)return void g("Received WebStorage notification for local change. Another client might have garbage-collected our state");this._n.Ds((function(){return r.__awaiter(e,void 0,void 0,(function(){var t,e,i,o,s,a;return r.__generator(this,(function(r){if(this.Ti){if(null!==n.key)if(this.Ri.test(n.key)){if(null==n.newValue)return t=this.Gi(n.key),[2,this.zi(t,null)];if(e=this.Hi(n.key,n.newValue))return[2,this.zi(e.clientId,e)]}else if(this.Pi.test(n.key)){if(null!==n.newValue&&(i=this.Yi(n.key,n.newValue)))return[2,this.Ji(i)]}else if(this.gi.test(n.key)){if(null!==n.newValue&&(o=this.Xi(n.key,n.newValue)))return[2,this.Zi(o)]}else if(n.key===this.yi){if(null!==n.newValue&&(s=this.bi(n.newValue)))return[2,this.vi(s)]}else n.key===this.Ai&&(a=function(t){var e=Wr.oi;if(null!=t)try{var n=JSON.parse(t);b("number"==typeof n),e=n}catch(t){g("SharedClientState","Failed to read sequence number from WebStorage",t)}return e}(n.newValue))!==Wr.oi&&this.ni(a)}else this.Ei.push(n);return[2]}))}))}))}},Object.defineProperty(t.prototype,"Oi",{get:function(){return this.mi.get(this.li)},enumerable:!1,configurable:!0}),t.prototype.pi=function(){this.setItem(this.Ii,this.Oi.ci())},t.prototype.$i=function(t,e,n){var r=new zr(this.currentUser,t,e,n),i=Hr(this.persistenceKey,this.currentUser,t);this.setItem(i,r.ci())},t.prototype.ki=function(t){var e=Hr(this.persistenceKey,this.currentUser,t);this.removeItem(e)},t.prototype.Ki=function(t){var e={clientId:this.li,onlineState:t};this.storage.setItem(this.yi,JSON.stringify(e))},t.prototype.Qi=function(t,e,n){var r=Kr(this.persistenceKey,t),i=new Qr(t,e,n);this.setItem(r,i.ci())},t.prototype.Gi=function(t){var e=this.Ri.exec(t);return e?e[1]:null},t.prototype.Hi=function(t,e){var n=this.Gi(t);return Yr.ai(n,e)},t.prototype.Yi=function(t,e){var n=this.Pi.exec(t),r=Number(n[1]),i=void 0!==n[2]?n[2]:null;return zr.ai(new Br(i),r,e)},t.prototype.Xi=function(t,e){var n=this.gi.exec(t),r=Number(n[1]);return Qr.ai(r,e)},t.prototype.bi=function(t){return Xr.ai(t)},t.prototype.Ji=function(t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return t.user.uid===this.currentUser.uid?[2,this._i.tr(t.batchId,t.state,t.error)]:(v("SharedClientState","Ignoring mutation for non-active user "+t.user.uid),[2])}))}))},t.prototype.Zi=function(t){return this._i.er(t.targetId,t.state,t.error)},t.prototype.zi=function(t,e){var n=this,r=e?this.mi.rt(t,e):this.mi.remove(t),i=this.Ci(this.mi),o=this.Ci(r),s=[],a=[];return o.forEach((function(t){i.has(t)||s.push(t)}
2534)),i.forEach((function(t){o.has(t)||a.push(t)})),this._i.nr(s,a).then((function(){n.mi=r}))},t.prototype.vi=function(t){this.mi.get(t.clientId)&&this.fi(t.onlineState)},t.prototype.Ci=function(t){var e=Ft();return t.forEach((function(t,n){e=e.xt(n.activeTargetIds)})),e},t}(),Zr=function(){function t(){this.sr=new $r,this.ir={},this.fi=null,this.ni=null}return t.prototype.Fi=function(t){},t.prototype.xi=function(t,e,n){},t.prototype.Mi=function(t){return this.sr.ui(t),this.ir[t]||"not-current"},t.prototype.Ui=function(t,e,n){this.ir[t]=e},t.prototype.Li=function(t){this.sr.hi(t)},t.prototype.Bi=function(t){return this.sr.activeTargetIds.has(t)},t.prototype.qi=function(t){delete this.ir[t]},t.prototype.Di=function(){return this.sr.activeTargetIds},t.prototype.Ni=function(t){return this.sr.activeTargetIds.has(t)},t.prototype.start=function(){return this.sr=new $r,Promise.resolve()},t.prototype.Wi=function(t,e,n){},t.prototype.ji=function(t){},t.prototype.Si=function(){},t.prototype.ri=function(t){},t}(),ti=function(){function t(t,e,n,r){this.batchId=t,this.rr=e,this.baseMutations=n,this.mutations=r}return t.prototype.ar=function(t,e,n){for(var r=n.cr,i=0;i<this.mutations.length;i++){var o=this.mutations[i];o.key.isEqual(t)&&(e=yn(o,e,r[i]))}return e},t.prototype.ur=function(t,e){for(var n=0,r=this.baseMutations;n<r.length;n++){var i=r[n];i.key.isEqual(t)&&(e=mn(i,e,e,this.rr))}for(var o=e,s=0,a=this.mutations;s<a.length;s++){var u=a[s];u.key.isEqual(t)&&(e=mn(u,e,o,this.rr))}return e},t.prototype.hr=function(t){var e=this,n=t;return this.mutations.forEach((function(r){var i=e.ur(r.key,t.get(r.key));i&&(n=n.rt(r.key,i))})),n},t.prototype.keys=function(){return this.mutations.reduce((function(t,e){return t.add(e.key)}),jt())},t.prototype.isEqual=function(t){return this.batchId===t.batchId&&J(this.mutations,t.mutations,(function(t,e){return bn(t,e)}))&&J(this.baseMutations,t.baseMutations,(function(t,e){return bn(t,e)}))},t}(),ei=function(){function t(t,e,n,r){this.batch=t,this.lr=e,this.cr=n,this._r=r}return t.from=function(e,n,r){b(e.mutations.length===r.length);for(var i=Dt,o=e.mutations,s=0;s<o.length;s++)i=i.rt(o[s].key,r[s].version);return new t(e,n,r,i)},t}(),ni=function(){function t(){this.dr=new at((function(t){return t.toString()}),(function(t,e){return t.isEqual(e)})),this.wr=!1}return Object.defineProperty(t.prototype,"readTime",{get:function(){return this.mr},set:function(t){this.mr=t},enumerable:!1,configurable:!0}),t.prototype.Tr=function(t,e){this.Er(),this.readTime=e,this.dr.set(t.key,t)},t.prototype.Ir=function(t,e){this.Er(),e&&(this.readTime=e),this.dr.set(t,null)},t.prototype.Ar=function(t,e){this.Er();var n=this.dr.get(e);return void 0!==n?_r.resolve(n):this.Rr(t,e)},t.prototype.getEntries=function(t,e){return this.Pr(t,e)},t.prototype.apply=function(t){return this.Er(),this.wr=!0,this.gr(t)},t.prototype.Er=function(){},t}(),ri="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",ii=function(){function t(){this.yr=[]}return t.prototype.Vr=function(t){this.yr.push(t)},t.prototype.pr=function(){this.yr.forEach((function(t){return t()}))},t}(),oi=function(){function t(t,e,n){this.br=t,this.vr=e,this.Sr=n}return t.prototype.Dr=function(t,e){var n=this;return this.vr.Cr(t,e).next((function(r){return n.Nr(t,e,r)}))},t.prototype.Nr=function(t,e,n){return this.br.Ar(t,e).next((function(t){for(var r=0,i=n;r<i.length;r++)t=i[r].ur(e,t);return t}))},t.prototype.Fr=function(t,e,n){var r=Rt();return e.forEach((function(t,e){for(var i=0,o=n;i<o.length;i++)e=o[i].ur(t,e);r=r.rt(t,e)})),r},t.prototype.$r=function(t,e){var n=this;return this.br.getEntries(t,e).next((function(e){return n.kr(t,e)}))},t.prototype.kr=function(t,e){var n=this;return this.vr.Mr(t,e).next((function(r){var i=n.Fr(t,e,r),o=kt();return i.forEach((function(t,e){e||(e=new Ln(t,ct.min())),o=o.rt(t,e)})),o}))},t.prototype.Or=function(t,e,n){return function(t){return A.F(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.Lr(t,e.path):Gn(e)?this.Br(t,e,n):this.qr(t,e,n)},t.prototype.Lr=function(t,e){return this.Dr(t,new A(e)).next((function(t){var e=xt();return t instanceof Dn&&(e=e.rt(t.key,t)),e}))},t.prototype.Br=function(t,e,n){var r=this,i=e.collectionGroup,o=xt();return this.Sr.Ur(t,i).next((function(s){return _r.forEach(s,(function(s){var a=function(t,e){return new Mn(e,null,t.rn.slice(),t.filters.slice(),t.limit,t.on,t.startAt,t.endAt)}(e,s.child(i));return r.qr(t,a,n).next((function(t){t.forEach((function(t,e){o=o.rt(t,e)}))}
2534))})).next((function(){return o}))}))},t.prototype.qr=function(t,e,n){var r,i,o=this;return this.br.Or(t,e,n).next((function(n){return r=n,o.vr.Qr(t,e)})).next((function(e){return i=e,o.Wr(t,i,r).next((function(t){r=t;for(var e=0,n=i;e<n.length;e++)for(var o=n[e],s=0,a=o.mutations;s<a.length;s++){var u=a[s],c=u.key,h=r.get(c),l=mn(u,h,h,o.rr);r=l instanceof Dn?r.rt(c,l):r.remove(c)}}))})).next((function(){return r.forEach((function(t,n){Zn(e,n)||(r=r.remove(t))})),r}))},t.prototype.Wr=function(t,e,n){for(var r=jt(),i=0,o=e;i<o.length;i++)for(var s=0,a=o[i].mutations;s<a.length;s++){var u=a[s];u instanceof In&&null===n.get(u.key)&&(r=r.add(u.key))}var c=n;return this.br.getEntries(t,r).next((function(t){return t.forEach((function(t,e){null!==e&&e instanceof Dn&&(c=c.rt(t,e))})),c}))},t}(),si=function(){function t(t,e,n,r){this.targetId=t,this.fromCache=e,this.jr=n,this.Kr=r}return t.Gr=function(e,n){for(var r=jt(),i=jt(),o=0,s=n.docChanges;o<s.length;o++){var a=s[o];switch(a.type){case 0:r=r.add(a.doc.key);break;case 1:i=i.add(a.doc.key)}}return new t(e,n.fromCache,r,i)},t}(); 2535/** 2536 * @license 2537 * Copyright 2018 Google LLC 2538 * 2539 * Licensed under the Apache License, Version 2.0 (the "License"); 2540 * you may not use this file except in compliance with the License. 2541 * You may obtain a copy of the License at 2542 * 2543 * http://www.apache.org/licenses/LICENSE-2.0 2544 * 2545 * Unless required by applicable law or agreed to in writing, software 2546 * distributed under the License is distributed on an "AS IS" BASIS, 2547 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2548 * See the License for the specific language governing permissions and 2549 * limitations under the License. 2550 */function ai(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],s=$(n,i);return 0===s?$(r,o):s}var ui=function(){function t(t){this.zr=t,this.buffer=new Ot(ai),this.Hr=0}return t.prototype.Yr=function(){return++this.Hr},t.prototype.Jr=function(t){var e=[t,this.Yr()];if(this.buffer.size<this.zr)this.buffer=this.buffer.add(e);else{var n=this.buffer.last();ai(e,n)<0&&(this.buffer=this.buffer.delete(n).add(e))}},Object.defineProperty(t.prototype,"maxValue",{get:function(){return this.buffer.last()[0]},enumerable:!1,configurable:!0}),t}(),ci={Xr:!1,Zr:0,eo:0,no:0},hi=function(){function t(t,e,n){this.so=t,this.io=e,this.ro=n}return t.oo=function(e){return new t(e,t.ao,t.co)},t}();hi.uo=-1,hi.ho=1048576,hi.lo=41943040,hi.ao=10,hi.co=1e3,hi._o=new hi(hi.lo,hi.ao,hi.co),hi.fo=new hi(hi.uo,0,0);var li=function(){function t(t,e){this.do=t,this.os=e,this.wo=!1,this.mo=null}return t.prototype.start=function(t){this.do.params.so!==hi.uo&&this.To(t)},t.prototype.stop=function(){this.mo&&(this.mo.cancel(),this.mo=null)},Object.defineProperty(t.prototype,"Ti",{get:function(){return null!==this.mo},enumerable:!1,configurable:!0}),t.prototype.To=function(t){var e=this,n=this.wo?3e5:6e4;v("LruGarbageCollector","Garbage collection scheduled in "+n+"ms"),this.mo=this.os.gn("lru_garbage_collection",n,(function(){return r.__awaiter(e,void 0,void 0,(function(){var e;return r.__generator(this,(function(n){switch(n.label){case 0:this.mo=null,this.wo=!0,n.label=1;case 1:return n.trys.push([1,3,,7]),[4,t.Eo(this.do)];case 2:return n.sent(),[3,7];case 3:return Ir(e=n.sent())?(v("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",e),[3,6]):[3,4];case 4:return[4,Ro(e)];case 5:n.sent(),n.label=6;case 6:return[3,7];case 7:return[4,this.To(t)];case 8:return n.sent(),[2]}}))}))}))},t}(),fi=function(){function t(t,e){this.Io=t,this.params=e}return t.prototype.Ao=function(t,e){return this.Io.Ro(t).next((function(t){return Math.floor(e/100*t)}))},t.prototype.Po=function(t,e){var n=this;if(0===e)return _r.resolve(Wr.oi);var r=new ui(e);return this.Io.De(t,(function(t){return r.Jr(t.sequenceNumber)})).next((function(){return n.Io.yo(t,(function(t){return r.Jr(t)}))})).next((function(){return r.maxValue}))},t.prototype.Vo=function(t,e,n){return this.Io.Vo(t,e,n)},t.prototype.po=function(t,e){return this.Io.po(t,e)},t.prototype.bo=function(t,e){var n=this;return this.params.so===hi.uo?(v("LruGarbageCollector","Garbage collection skipped; disabled"),_r.resolve(ci)):this.vo(t).next((function(r){return r<n.params.so?(v("LruGarbageCollector","Garbage collection skipped; Cache size "+r+" is lower than threshold "+n.params.so),ci):n.So(t,e)}))},t.prototype.vo=function(t){return this.Io.vo(t)},t.prototype.So=function(t,e){var n,r,i,s,a,u,c,h=this,l=Date.now();return this.Ao(t,this.params.io).next((function(e){return e>h.params.ro?(v("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+h.params.ro+" from "+e),r=h.params.ro):r=e,s=Date.now(),h.Po(t,r)})).next((function(r){return n=r,a=Date.now(),h.Vo(t,n,e)})).next((function(e){return i=e,u=Date.now(),h.po(t,n)})).next((function(t){return c=Date.now(),d()<=o.LogLevel.DEBUG&&v("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(s-l)+"ms\n\tDetermined least recently used "+r+" in "+(a-s)+"ms\n\tRemoved "+i+" targets in "+(u-a)+"ms\n\tRemoved "+t+" documents in "+(c-u)+"ms\nTotal Duration: "+(c-l)+"ms"),_r.resolve({Xr:!0,Zr:r,eo:i,no:t})}))},t}(); 2551/** 2552 * @license 2553 * Copyright 2017 Google LLC 2554 * 2555 * Licensed under the Apache License, Version 2.0 (the "License");
2556 * you may not use this file except in compliance with the License. 2557 * You may obtain a copy of the License at 2558 * 2559 * http://www.apache.org/licenses/LICENSE-2.0 2560 * 2561 * Unless required by applicable law or agreed to in writing, software 2562 * distributed under the License is distributed on an "AS IS" BASIS, 2563 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2564 * See the License for the specific language governing permissions and 2565 * limitations under the License. 2566 */function pi(t){for(var e="",n=0;n<t.length;n++)e.length>0&&(e=vi(e)),e=di(t.get(n),e);return vi(e)}function di(t,e){for(var n=e,r=t.length,i=0;i<r;i++){var o=t.charAt(i);switch(o){case"\0":n+="��";break;case"�":n+="��";break;default:n+=o}}return n}function vi(t){return t+"��"}function gi(t){var e=t.length;if(b(e>=2),2===e)return b("�"===t.charAt(0)&&"�"===t.charAt(1)),S.g();for(var n=e-2,r=[],i="",o=0;o<e;){var s=t.indexOf("�",o);switch((s<0||s>n)&&_(),t.charAt(s+1)){case"�":var a=t.substring(o,s),u=void 0;0===i.length?u=a:(u=i+=a,i=""),r.push(u);break;case"�":i+=t.substring(o,s),i+="\0";break;case"�":i+=t.substring(o,s+1);break;default:_()}o=s+2}return new S(r)} 2567/** 2568 * @license 2569 * Copyright 2017 Google LLC 2570 * 2571 * Licensed under the Apache License, Version 2.0 (the "License"); 2572 * you may not use this file except in compliance with the License. 2573 * You may obtain a copy of the License at 2574 * 2575 * http://www.apache.org/licenses/LICENSE-2.0 2576 * 2577 * Unless required by applicable law or agreed to in writing, software 2578 * distributed under the License is distributed on an "AS IS" BASIS, 2579 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2580 * See the License for the specific language governing permissions and 2581 * limitations under the License. 2582 */var yi=function(t){this.Do=t};function mi(t,e){if(e.document)return function(t,e,n){var r=ke(t,e.name),i=Se(e.updateTime),o=new kn({mapValue:{fields:e.fields}});return new Dn(r,i,o,{hasCommittedMutations:!!n})}(t.Do,e.document,!!e.hasCommittedMutations);if(e.noDocument){var n=A.$(e.noDocument.path),r=Ii(e.noDocument.readTime);return new Ln(n,r,{hasCommittedMutations:!!e.hasCommittedMutations})}if(e.unknownDocument){var i=A.$(e.unknownDocument.path),o=Ii(e.unknownDocument.version);return new jn(i,o)}return _()}function _i(t,e,n){var r=bi(n),i=e.key.path.h().A();if(e instanceof Dn){var o=function(t,e){return{name:Ae(t,e.key),fields:e.sn().mapValue.fields,updateTime:Ie(t,e.version.X())}}(t.Do,e),s=e.hasCommittedMutations;return new Yi(null,null,o,s,r,i)}if(e instanceof Ln){var a=e.key.path.A(),u=Ei(e.version),c=e.hasCommittedMutations;return new Yi(null,new zi(a,u),null,c,r,i)}if(e instanceof jn){var h=e.key.path.A(),l=Ei(e.version);return new Yi(new Qi(h,l),null,null,!0,r,i)}return _()}function bi(t){var e=t.X();return[e.seconds,e.nanoseconds]}function wi(t){var e=new ut(t[0],t[1]);return ct.Y(e)}function Ei(t){var e=t.X();return new Bi(e.seconds,e.nanoseconds)}
2582function Ii(t){var e=new ut(t.seconds,t.nanoseconds);return ct.Y(e)}function Ti(t,e){var n=(e.baseMutations||[]).map((function(e){return Me(t.Do,e)})),r=e.mutations.map((function(e){return Me(t.Do,e)})),i=ut.fromMillis(e.localWriteTimeMs);return new ti(e.batchId,i,n,r)}function Ci(t){var e,n,r=Ii(t.readTime),i=void 0!==t.lastLimboFreeSnapshotVersion?Ii(t.lastLimboFreeSnapshotVersion):ct.min();return void 0!==t.query.documents?(b(1===(n=t.query).documents.length),e=Kn(Un(Pe(n.documents[0])))):e=Ve(t.query),new bt(e,t.targetId,0,t.lastListenSequenceNumber,r,i,tt.fromBase64String(t.resumeToken))}function Si(t,e){var n,r=Ei(e.et),i=Ei(e.lastLimboFreeSnapshotVersion);n=yt(e.target)?Fe(t.Do,e.target):Ue(t.Do,e.target);var o=e.resumeToken.toBase64();return new $i(e.targetId,vt(e.target),r,o,e.sequenceNumber,i,n)} 2583/** 2584 * @license 2585 * Copyright 2017 Google LLC 2586 * 2587 * Licensed under the Apache License, Version 2.0 (the "License"); 2588 * you may not use this file except in compliance with the License. 2589 * You may obtain a copy of the License at 2590 * 2591 * http://www.apache.org/licenses/LICENSE-2.0 2592 * 2593 * Unless required by applicable law or agreed to in writing, software 2594 * distributed under the License is distributed on an "AS IS" BASIS, 2595 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2596 * See the License for the specific language governing permissions and 2597 * limitations under the License. 2598 */var Oi=function(){function t(t,e,n,r){this.userId=t,this.serializer=e,this.Sr=n,this.Co=r,this.No={}}return t.Fo=function(e,n,r,i){return b(""!==e.uid),new t(e.Xs()?e.uid:"",n,r,i)},t.prototype.$o=function(t){var e=!0,n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return ki(t).ss({index:Hi.userMutationsIndex,range:n},(function(t,n,r){e=!1,r.done()})).next((function(){return e}))},t.prototype.xo=function(t,e,n,r){var i=this,o=Ri(t),s=ki(t);return s.add({}).next((function(a){b("number"==typeof a);for(var u=new ti(a,e,n,r),c=function(t,e,n){var r=n.baseMutations.map((function(e){return je(t.Do,e)})),i=n.mutations.map((function(e){return je(t.Do,e)}));return new Hi(e,n.batchId,n.rr.toMillis(),r,i)}(i.serializer,i.userId,u),h=[],l=new Ot((function(t,e){return $(t.R(),e.R())})),f=0,p=r;f<p.length;f++){var d=p[f],v=Ki.key(i.userId,d.key.path,a);l=l.add(d.key.path.h()),h.push(s.put(c)),h.push(o.put(v,Ki.PLACEHOLDER))}return l.forEach((function(e){h.push(i.Sr.ko(t,e))})),t.Vr((function(){i.No[a]=u.keys()})),_r.$n(h).next((function(){return u}))}))},t.prototype.Mo=function(t,e){var n=this;return ki(t).get(e).next((function(t){return t?(b(t.userId===n.userId),Ti(n.serializer,t)):null}))},t.prototype.Oo=function(t,e){var n=this;return this.No[e]?_r.resolve(this.No[e]):this.Mo(t,e).next((function(t){if(t){var r=t.keys();return n.No[e]=r,r}return null}))},t.prototype.Lo=function(t,e){var n=this,r=e+1,i=IDBKeyRange.lowerBound([this.userId,r]),o=null;return ki(t).ss({index:Hi.userMutationsIndex,range:i},(function(t,e,i){e.userId===n.userId&&(b(e.batchId>=r),o=Ti(n.serializer,e)),i.done()})).next((function(){return o}))},t.prototype.Bo=function(t){var e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),n=-1;return ki(t).ss({index:Hi.userMutationsIndex,range:e,reverse:!0},(function(t,e,r){n=e.batchId,r.done()})).next((function(){return n}))},t.prototype.qo=function(t){var e=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return ki(t).Zn(Hi.userMutationsIndex,n).next((function(t){return t.map((function(t){return Ti(e.serializer,t)}))}))},t.prototype.Cr=function(t,e){var n=this,r=Ki.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=[];return Ri(t).ss({range:i},(function(r,i,s){var a=r[0],u=r[1],c=r[2],h=gi(u);if(a===n.userId&&e.path.isEqual(h))return ki(t).get(c).next((function(t){if(!t)throw _();b(t.userId===n.userId),o.push(Ti(n.serializer,t))}));s.done()})).next((function(){return o}))},t.prototype.Mr=function(t,e){var n=this,r=new Ot($),i=[];return e.forEach((function(e){var o=Ki.prefixForPath(n.userId,e.path),s=IDBKeyRange.lowerBound(o),a=Ri(t).ss({range:s},(function(t,i,o){var s=t[0],a=t[1],u=t[2],c=gi(a);s===n.userId&&e.path.isEqual(c)?r=r.add(u):o.done()}));i.push(a)})),_r.$n(i).next((function(){return n.Uo(t,r)}
2598))},t.prototype.Qr=function(t,e){var n=this,r=e.path,i=r.length+1,o=Ki.prefixForPath(this.userId,r),s=IDBKeyRange.lowerBound(o),a=new Ot($);return Ri(t).ss({range:s},(function(t,e,o){var s=t[0],u=t[1],c=t[2],h=gi(u);s===n.userId&&r.T(h)?h.length===i&&(a=a.add(c)):o.done()})).next((function(){return n.Uo(t,a)}))},t.prototype.Uo=function(t,e){var n=this,r=[],i=[];return e.forEach((function(e){i.push(ki(t).get(e).next((function(t){if(null===t)throw _();b(t.userId===n.userId),r.push(Ti(n.serializer,t))})))})),_r.$n(i).next((function(){return r}))},t.prototype.Qo=function(t,e){var n=this;return Ai(t.Wo,this.userId,e).next((function(r){return t.Vr((function(){n.jo(e.batchId)})),_r.forEach(r,(function(e){return n.Co.Ko(t,e)}))}))},t.prototype.jo=function(t){delete this.No[t]},t.prototype.Go=function(t){var e=this;return this.$o(t).next((function(n){if(!n)return _r.resolve();var r=IDBKeyRange.lowerBound(Ki.prefixForUser(e.userId)),i=[];return Ri(t).ss({range:r},(function(t,n,r){if(t[0]===e.userId){var o=gi(t[1]);i.push(o)}else r.done()})).next((function(){b(0===i.length)}))}))},t.prototype.zo=function(t,e){return Ni(t,this.userId,e)},t.prototype.Ho=function(t){var e=this;return Pi(t).get(this.userId).next((function(t){return t||new Gi(e.userId,-1,"")}))},t}();function Ni(t,e,n){var r=Ki.prefixForPath(e,n.path),i=r[1],o=IDBKeyRange.lowerBound(r),s=!1;return Ri(t).ss({range:o,ns:!0},(function(t,n,r){var o=t[0],a=t[1];t[2],o===e&&a===i&&(s=!0),r.done()})).next((function(){return s}))}function Ai(t,e,n){var r=t.store(Hi.store),i=t.store(Ki.store),o=[],s=IDBKeyRange.only(n.batchId),a=0,u=r.ss({range:s},(function(t,e,n){return a++,n.delete()}));o.push(u.next((function(){b(1===a)})));for(var c=[],h=0,l=n.mutations;h<l.length;h++){var f=l[h],p=Ki.key(e,f.key.path,n.batchId);o.push(i.delete(p)),c.push(f.key)}return _r.$n(o).next((function(){return c}))}function ki(t){return po.Un(t,Hi.store)}function Ri(t){return po.Un(t,Ki.store)}function Pi(t){return po.Un(t,Gi.store)} 2599/** 2600 * @license 2601 * Copyright 2017 Google LLC 2602 * 2603 * Licensed under the Apache License, Version 2.0 (the "License"); 2604 * you may not use this file except in compliance with the License. 2605 * You may obtain a copy of the License at 2606 * 2607 * http://www.apache.org/licenses/LICENSE-2.0 2608 * 2609 * Unless required by applicable law or agreed to in writing, software 2610 * distributed under the License is distributed on an "AS IS" BASIS, 2611 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2612 * See the License for the specific language governing permissions and 2613 * limitations under the License. 2614 */var xi=function(){function t(t,e){this.serializer=t,this.Sr=e}return t.prototype.Tr=function(t,e,n){return ji(t).put(Mi(e),n)},t.prototype.Ir=function(t,e){var n=ji(t),r=Mi(e);return n.delete(r)},t.prototype.updateMetadata=function(t,e){var n=this;return this.getMetadata(t).next((function(r){return r.byteSize+=e,n.Yo(t,r)}))},t.prototype.Ar=function(t,e){var n=this;return ji(t).get(Mi(e)).next((function(t){return n.Jo(t)}))},t.prototype.Xo=function(t,e){var n=this;return ji(t).get(Mi(e)).next((function(t){var e=n.Jo(t);return e?{Zo:e,size:Fi(t)}:null}))},t.prototype.getEntries=function(t,e){var n=this,r=Rt();return this.ta(t,e,(function(t,e){var i=n.Jo(e);r=r.rt(t,i)})).next((function(){return r}))},t.prototype.ea=function(t,e){var n=this,r=Rt(),i=new Tt(A.i);return this.ta(t,e,(function(t,e){var o=n.Jo(e);o?(r=r.rt(t,o),i=i.rt(t,Fi(e))):(r=r.rt(t,null),i=i.rt(t,0))})).next((function(){return{na:r,sa:i}}))},t.prototype.ta=function(t,e,n){if(e.m())return _r.resolve();var r=IDBKeyRange.bound(e.first().path.A(),e.last().path.A()),i=e.lt(),o=i.Et();return ji(t).ss({range:r},(function(t,e,r){for(var s=A.$(t);o&&A.i(o,s)<0;)n(o,null),o=i.Et();o&&o.isEqual(s)&&(n(o,e),o=i.It()?i.Et():null),o?r.Jn(o.path.A()):r.done()})).next((function(){for(;o;)n(o,null),o=i.It()?i.Et():null}))},t.prototype.Or=function(t,e,n){var r=this,i=xt(),o=e.path.length+1,s={};if(n.isEqual(ct.min())){var a=e.path.A();s.range=IDBKeyRange.lowerBound(a)}else{var u=e.path.A(),c=bi(n);s.range=IDBKeyRange.lowerBound([u,c],!0),s.index=Yi.collectionReadTimeIndex}return ji(t).ss(s,(function(t,n,s){if(t.length===o){var a=mi(r.serializer,n);e.path.T(a.key.path)?a instanceof Dn&&Zn(e,a)&&(i=i.rt(a.key,a)):s.done()}})).next((function(){return i}))},t.prototype.ia=function(t){return new Di(this,!!t&&t.ra)},t.prototype.oa=function(t){return this.getMetadata(t).next((function(t){return t.byteSize}))},t.prototype.getMetadata=function(t){return Li(t).get(Xi.key).next((function(t){return b(!!t),t}))},t.prototype.Yo=function(t,e){return Li(t).put(Xi.key,e)},t.prototype.Jo=function(t){if(t){var e=mi(this.serializer,t);return e instanceof Ln&&e.version.isEqual(ct.min())?null:e}return null},t}(),Di=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).aa=e,r.ra=n,r.ca=new at((function(t){return t.toString()}),(function(t,e){return t.isEqual(e)})),r}return r.__extends(e,t),e.prototype.gr=function(t){var e=this,n=[],r=0,i=new Ot((function(t,e){return $(t.R(),e.R())}));return this.dr.forEach((function(o,s){var a=e.ca.get(o);if(s){var u=_i(e.aa.serializer,s,e.readTime);i=i.add(o.path.h());var c=Fi(u);r+=c-a,n.push(e.aa.Tr(t,o,u))}else if(r-=a,e.ra){var h=_i(e.aa.serializer,new Ln(o,ct.min()),e.readTime);n.push(e.aa.Tr(t,o,h))}else n.push(e.aa.Ir(t,o))}
2614)),i.forEach((function(r){n.push(e.aa.Sr.ko(t,r))})),n.push(this.aa.updateMetadata(t,r)),_r.$n(n)},e.prototype.Rr=function(t,e){var n=this;return this.aa.Xo(t,e).next((function(t){return null===t?(n.ca.set(e,0),null):(n.ca.set(e,t.size),t.Zo)}))},e.prototype.Pr=function(t,e){var n=this;return this.aa.ea(t,e).next((function(t){var e=t.na;return t.sa.forEach((function(t,e){n.ca.set(t,e)})),e}))},e}(ni);function Li(t){return po.Un(t,Xi.store)}function ji(t){return po.Un(t,Yi.store)}function Mi(t){return t.path.A()}function Fi(t){var e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw _();e=t.noDocument}return JSON.stringify(e).length} 2615/** 2616 * @license 2617 * Copyright 2019 Google LLC 2618 * 2619 * Licensed under the Apache License, Version 2.0 (the "License"); 2620 * you may not use this file except in compliance with the License. 2621 * You may obtain a copy of the License at 2622 * 2623 * http://www.apache.org/licenses/LICENSE-2.0 2624 * 2625 * Unless required by applicable law or agreed to in writing, software 2626 * distributed under the License is distributed on an "AS IS" BASIS, 2627 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2628 * See the License for the specific language governing permissions and 2629 * limitations under the License. 2630 */var Ui=function(){function t(){this.ua=new Vi}return t.prototype.ko=function(t,e){return this.ua.add(e),_r.resolve()},t.prototype.Ur=function(t,e){return _r.resolve(this.ua.getEntries(e))},t}(),Vi=function(){function t(){this.index={}}return t.prototype.add=function(t){var e=t._(),n=t.h(),r=this.index[e]||new Ot(S.i),i=!r.has(n);return this.index[e]=r.add(n),i},t.prototype.has=function(t){var e=t._(),n=t.h(),r=this.index[e];return r&&r.has(n)},t.prototype.getEntries=function(t){return(this.index[t]||new Ot(S.i)).A()},t}(),qi=function(){function t(t){this.serializer=t}return t.prototype.createOrUpgrade=function(t,e,n,r){var i=this;b(n<r&&n>=0&&r<=10);var o=new Tr("createOrUpgrade",e);n<1&&r>=1&&(function(t){t.createObjectStore(Wi.store)}(t),function(t){t.createObjectStore(Gi.store,{keyPath:Gi.keyPath}),t.createObjectStore(Hi.store,{keyPath:Hi.keyPath,autoIncrement:!0}).createIndex(Hi.userMutationsIndex,Hi.userMutationsKeyPath,{unique:!0}),t.createObjectStore(Ki.store)}(t),eo(t),function(t){t.createObjectStore(Yi.store)}(t));var s=_r.resolve();return n<3&&r>=3&&(0!==n&&(function(t){t.deleteObjectStore(Ji.store),t.deleteObjectStore($i.store),t.deleteObjectStore(Zi.store)}(t),eo(t)),s=s.next((function(){return function(t){var e=t.store(Zi.store),n=new Zi(0,0,ct.min().X(),0);return e.put(Zi.key,n)}(o)}))),n<4&&r>=4&&(0!==n&&(s=s.next((function(){return function(t,e){return e.store(Hi.store).Zn().next((function(n){t.deleteObjectStore(Hi.store),t.createObjectStore(Hi.store,{keyPath:Hi.keyPath,autoIncrement:!0}).createIndex(Hi.userMutationsIndex,Hi.userMutationsKeyPath,{unique:!0});var r=e.store(Hi.store),i=n.map((function(t){return r.put(t)}));
2630return _r.$n(i)}))}(t,o)}))),s=s.next((function(){!function(t){t.createObjectStore(no.store,{keyPath:no.keyPath})}(t)}))),n<5&&r>=5&&(s=s.next((function(){return i.removeAcknowledgedMutations(o)}))),n<6&&r>=6&&(s=s.next((function(){return function(t){t.createObjectStore(Xi.store)}(t),i.addDocumentGlobal(o)}))),n<7&&r>=7&&(s=s.next((function(){return i.ensureSequenceNumbers(o)}))),n<8&&r>=8&&(s=s.next((function(){return i.createCollectionParentIndex(t,o)}))),n<9&&r>=9&&(s=s.next((function(){!function(t){t.objectStoreNames.contains("remoteDocumentChanges")&&t.deleteObjectStore("remoteDocumentChanges")}(t),function(t){var e=t.objectStore(Yi.store);e.createIndex(Yi.readTimeIndex,Yi.readTimeIndexPath,{unique:!1}),e.createIndex(Yi.collectionReadTimeIndex,Yi.collectionReadTimeIndexPath,{unique:!1})}(e)}))),n<10&&r>=10&&(s=s.next((function(){return i.rewriteCanonicalIds(o)}))),s},t.prototype.addDocumentGlobal=function(t){var e=0;return t.store(Yi.store).ss((function(t,n){e+=Fi(n)})).next((function(){var n=new Xi(e);return t.store(Xi.store).put(Xi.key,n)}))},t.prototype.removeAcknowledgedMutations=function(t){var e=this,n=t.store(Gi.store),r=t.store(Hi.store);return n.Zn().next((function(n){return _r.forEach(n,(function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.Zn(Hi.userMutationsIndex,i).next((function(r){return _r.forEach(r,(function(r){b(r.userId===n.userId);var i=Ti(e.serializer,r);return Ai(t,n.userId,i).next((function(){}))}))}))}))}))},t.prototype.ensureSequenceNumbers=function(t){var e=t.store(Ji.store),n=t.store(Yi.store);return t.store(Zi.store).get(Zi.key).next((function(t){var r=[];return n.ss((function(n,i){var o=new S(n),s=function(t){return[0,pi(t)]}(o);r.push(e.get(s).next((function(n){return n?_r.resolve():function(n){return e.put(new Ji(0,pi(n),t.highestListenSequenceNumber))}(o)})))}
2630)).next((function(){return _r.$n(r)}))}))},t.prototype.createCollectionParentIndex=function(t,e){t.createObjectStore(to.store,{keyPath:to.keyPath});var n=e.store(to.store),r=new Vi,i=function(t){if(r.add(t)){var e=t._(),i=t.h();return n.put({collectionId:e,parent:pi(i)})}};return e.store(Yi.store).ss({ns:!0},(function(t,e){var n=new S(t);return i(n.h())})).next((function(){return e.store(Ki.store).ss({ns:!0},(function(t,e){t[0];var n=t[1],r=(t[2],gi(n));return i(r.h())}))}))},t.prototype.rewriteCanonicalIds=function(t){var e=this,n=t.store($i.store);return n.ss((function(t,r){var i=Ci(r),o=Si(e.serializer,i);return n.put(o)}))},t}(),Bi=function(t,e){this.seconds=t,this.nanoseconds=e},Wi=function(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n};Wi.store="owner",Wi.key="owner";var Gi=function(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n};Gi.store="mutationQueues",Gi.keyPath="userId";var Hi=function(t,e,n,r,i){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i};Hi.store="mutations",Hi.keyPath="batchId",Hi.userMutationsIndex="userMutationsIndex",Hi.userMutationsKeyPath=["userId","batchId"];var Ki=function(){function t(){}return t.prefixForUser=function(t){return[t]},t.prefixForPath=function(t,e){return[t,pi(e)]},t.key=function(t,e,n){return[t,pi(e),n]},t}();Ki.store="documentMutations",Ki.PLACEHOLDER=new Ki;var zi=function(t,e){this.path=t,this.readTime=e},Qi=function(t,e){this.path=t,this.version=e},Yi=function(t,e,n,r,i,o){this.unknownDocument=t,this.noDocument=e,this.document=n,this.hasCommittedMutations=r,this.readTime=i,this.parentPath=o};Yi.store="remoteDocuments",Yi.readTimeIndex="readTimeIndex",Yi.readTimeIndexPath="readTime",Yi.collectionReadTimeIndex="collectionReadTimeIndex",Yi.collectionReadTimeIndexPath=["parentPath","readTime"];var Xi=function(t){this.byteSize=t};Xi.store="remoteDocumentGlobal",Xi.key="remoteDocumentGlobalKey";var $i=function(t,e,n,r,i,o,s){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=r,this.lastListenSequenceNumber=i,this.lastLimboFreeSnapshotVersion=o,this.query=s};$i.store="targets",$i.keyPath="targetId",$i.queryTargetsIndexName="queryTargetsIndex",$i.queryTargetsKeyPath=["canonicalId","targetId"];var Ji=function(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n};Ji.store="targetDocuments",Ji.keyPath=["targetId","path"],Ji.documentTargetsIndex="documentTargetsIndex",Ji.documentTargetsKeyPath=["path","targetId"];var Zi=function(t,e,n,r){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=r};Zi.key="targetGlobalKey",Zi.store="targetGlobal";var to=function(t,e){this.collectionId=t,this.parent=e};function eo(t){t.createObjectStore(Ji.store,{keyPath:Ji.keyPath}).createIndex(Ji.documentTargetsIndex,Ji.documentTargetsKeyPath,{unique:!0}),t.createObjectStore($i.store,{keyPath:$i.keyPath}).createIndex($i.queryTargetsIndexName,$i.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(Zi.store)}to.store="collectionParents",to.keyPath=["collectionId","parent"];var no=function(t,e,n,r){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=r};no.store="clientMetadata",no.keyPath="clientId";var ro=r.__spreadArrays(r.__spreadArrays(r.__spreadArrays([Gi.store,Hi.store,Ki.store,Yi.store,$i.store,Wi.store,Zi.store,Ji.store],[no.store]),[Xi.store]),[to.store]),io=function(){function t(){this.ha=new Vi}return t.prototype.ko=function(t,e){var n=this;if(!this.ha.has(e)){var r=e._(),i=e.h();t.Vr((function(){n.ha.add(e)}));var o={collectionId:r,parent:pi(i)};return oo(t).put(o)}return _r.resolve()},t.prototype.Ur=function(t,e){var n=[],r=IDBKeyRange.bound([e,""],[Z(e),""],!1,!0);return oo(t).Zn(r).next((function(t){for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.collectionId!==e)break;n.push(gi(o.parent))}return n}))},t}(); 2631/** 2632 * @license 2633 * Copyright 2019 Google LLC 2634 * 2635 * Licensed under the Apache License, Version 2.0 (the "License"); 2636 * you may not use this file except in compliance with the License. 2637 * You may obtain a copy of the License at 2638 * 2639 * http://www.apache.org/licenses/LICENSE-2.0 2640 * 2641 * Unless required by applicable law or agreed to in writing, softw
2641are 2642 * distributed under the License is distributed on an "AS IS" BASIS, 2643 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2644 * See the License for the specific language governing permissions and 2645 * limitations under the License. 2646 */function oo(t){return po.Un(t,to.store)} 2647/** 2648 * @license 2649 * Copyright 2017 Google LLC 2650 * 2651 * Licensed under the Apache License, Version 2.0 (the "License"); 2652 * you may not use this file except in compliance with the License. 2653 * You may obtain a copy of the License at 2654 * 2655 * http://www.apache.org/licenses/LICENSE-2.0 2656 * 2657 * Unless required by applicable law or agreed to in writing, software 2658 * distributed under the License is distributed on an "AS IS" BASIS, 2659 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2660 * See the License for the specific language governing permissions and 2661 * limitations under the License. 2662 */var so=function(){function t(t){this.la=t}return t.prototype.next=function(){return this.la+=2,this.la},t._a=function(){return new t(0)},t.fa=function(){return new t(-1)},t}(),ao=function(){function t(t,e){this.Co=t,this.serializer=e}return t.prototype.da=function(t){var e=this;return this.wa(t).next((function(n){var r=new so(n.highestTargetId);return n.highestTargetId=r.next(),e.ma(t,n).next((function(){return n.highestTargetId}))}))},t.prototype.Ta=function(t){return this.wa(t).next((function(t){return ct.Y(new ut(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))}))},t.prototype.Ea=function(t){return this.wa(t).next((function(t){return t.highestListenSequenceNumber}))},t.prototype.Ia=function(t,e,n){var r=this;return this.wa(t).next((function(i){return i.highestListenSequenceNumber=e,n&&(i.lastRemoteSnapshotVersion=n.X()),e>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=e),r.ma(t,i)}))},t.prototype.Aa=function(t,e){var n=this;return this.Ra(t,e).next((function(){return n.wa(t).next((function(r){return r.targetCount+=1,n.Pa(e,r),n.ma(t,r)}))}))},t.prototype.ga=function(t,e){return this.Ra(t,e)},t.prototype.ya=function(t,e){var n=this;return this.Va(t,e.targetId).next((function(){return uo(t).delete(e.targetId)})).next((function(){return n.wa(t)})).next((function(e){return b(e.targetCount>0),e.targetCount-=1,n.ma(t,e)}))},t.prototype.Vo=function(t,e,n){var r=this,i=0,o=[];return uo(t).ss((function(s,a){var u=Ci(a);u.sequenceNumber<=e&&null===n.get(u.targetId)&&(i++,o.push(r.ya(t,u)))}
2662)).next((function(){return _r.$n(o)})).next((function(){return i}))},t.prototype.De=function(t,e){return uo(t).ss((function(t,n){var r=Ci(n);e(r)}))},t.prototype.wa=function(t){return co(t).get(Zi.key).next((function(t){return b(null!==t),t}))},t.prototype.ma=function(t,e){return co(t).put(Zi.key,e)},t.prototype.Ra=function(t,e){return uo(t).put(Si(this.serializer,e))},t.prototype.Pa=function(t,e){var n=!1;return t.targetId>e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n},t.prototype.pa=function(t){return this.wa(t).next((function(t){return t.targetCount}))},t.prototype.ba=function(t,e){var n=vt(e),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]),i=null;return uo(t).ss({range:r,index:$i.queryTargetsIndexName},(function(t,n,r){var o=Ci(n);gt(e,o.target)&&(i=o,r.done())})).next((function(){return i}))},t.prototype.va=function(t,e,n){var r=this,i=[],o=ho(t);return e.forEach((function(e){var s=pi(e.path);i.push(o.put(new Ji(n,s))),i.push(r.Co.Sa(t,n,e))})),_r.$n(i)},t.prototype.Da=function(t,e,n){var r=this,i=ho(t);return _r.forEach(e,(function(e){var o=pi(e.path);
2662return _r.$n([i.delete([n,o]),r.Co.Ca(t,n,e)])}))},t.prototype.Va=function(t,e){var n=ho(t),r=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(r)},t.prototype.Na=function(t,e){var n=IDBKeyRange.bound([e],[e+1],!1,!0),r=ho(t),i=jt();return r.ss({range:n,ns:!0},(function(t,e,n){var r=gi(t[1]),o=new A(r);i=i.add(o)})).next((function(){return i}))},t.prototype.zo=function(t,e){var n=pi(e.path),r=IDBKeyRange.bound([n],[Z(n)],!1,!0),i=0;return ho(t).ss({index:Ji.documentTargetsIndex,ns:!0,range:r},(function(t,e,n){var r=t[0];t[1],0!==r&&(i++,n.done())})).next((function(){return i>0}))},t.prototype.qe=function(t,e){return uo(t).get(e).next((function(t){return t?Ci(t):null}))},t}(); 2663/** 2664 * @license 2665 * Copyright 2017 Google LLC 2666 * 2667 * Licensed under the Apache License, Version 2.0 (the "License"); 2668 * you may not use this file except in compliance with the License. 2669 * You may obtain a copy of the License at 2670 * 2671 * http://www.apache.org/licenses/LICENSE-2.0 2672 * 2673 * Unless required by applicable law or agreed to in writing, software 2674 * distributed under the License is distributed on an "AS IS" BASIS, 2675 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2676 * See the License for the specific language governing permissions and 2677 * limitations under the License. 2678 */function uo(t){return po.Un(t,$i.store)}function co(t){return po.Un(t,Zi.store)}function ho(t){return po.Un(t,Ji.store)} 2679/** 2680 * @license 2681 * Copyright 2017 Google LLC 2682 * 2683 * Licensed under the Apache License, Version 2.0 (the "License"); 2684 * you may not use this file except in compliance with the License. 2685 * You may obtain a copy of the License at 2686 * 2687 * http://www.apache.org/licenses/LICENSE-2.0 2688 * 2689 * Unless required by applicable law or agreed to in writing, software 2690 * distributed under the License is distributed on an "AS IS" BASIS, 2691 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2692 * See the License for the specific language governing permissions and 2693 * limitations under the License. 2694 */var lo="Failed to obtain exclusive access to the persistence layer. To allow shared access, make sure to invoke `enablePersistence()` with `synchronizeTabs:true` in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",fo=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).Wo=e,r.Fa=n,r}return r.__extends(e,t),e}(ii),po=function(){function t(e,n,r,i,o,s,a,u,c,h){if(this.allowTabSynchronization=e,this.persistenceKey=n,this.clientId=r,this._n=o,this.window=s,this.document=a,this.$a=c,this.xa=h,this.ka=null,this.Ma=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Oa=null,this.inForeground=!1,this.La=null,this.Ba=null,this.qa=Number.NEGATIVE_INFINITY,this.Ua=function(t){return Promise.resolve()},!t.On())throw new f(l.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.Co=new yo(this,i),this.Qa=n+"main",this.serializer=new yi(u),this.Wa=new br(this.Qa,10,new qi(this.serializer)),this.ja=new ao(this.Co,this.serializer),this.Sr=new io,this.br=function(t,e){return new xi(t,e)}(this.serializer,this.Sr),this.window&&this.window.localStorage?this.Ka=this.window.localStorage:(this.Ka=null,!1===h&&g("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}return t.Un=function(t,e){if(t instanceof fo)return br.Un(t.Wo,e);throw _()},t.prototype.start=function(){var t=this;return this.Ga().then((function(){if(!t.isPrimary&&!t.allowTabSynchronization)throw new f(l.FAILED_PRECONDITION,lo);return t.za(),t.Ha(),t.Ya(),t.runTransaction("getHighestListenSequenceNumber","readonly",(function(e){return t.ja.Ea(e)}))})).then((function(e){t.ka=new Wr(e,t.$a)})).then((function(){t.Ma=!0})).catch((function(e){return t.Wa&&t.Wa.close(),Promise.reject(e)}))},t.prototype.Ja=function(t){var e=this;return this.Ua=function(n){return r.__awaiter(e,void 0,void 0,(function(){return r.__generator(this,(function(e){return this.Ti?[2,t(n)]:[2]}))}))},t(this.isPrimary)},t.prototype.Xa=function(t){var e=this;this.Wa.jn((function(n){return r.__awaiter(e,void 0,void 0,(function(){return r.__generator(this,(function(e){switch(e.label){case 0:return null===n.newVersion?[4,t()]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}
2694))}))}))},t.prototype.Za=function(t){var e=this;this.networkEnabled!==t&&(this.networkEnabled=t,this._n.ds((function(){return r.__awaiter(e,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return this.Ti?[4,this.Ga()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))})))},t.prototype.Ga=function(){var t=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(function(e){return go(e).put(new no(t.clientId,Date.now(),t.networkEnabled,t.inForeground)).next((function(){if(t.isPrimary)return t.tc(e).next((function(e){e||(t.isPrimary=!1,t._n.Ds((function(){return t.Ua(!1)})))}))})).next((function(){return t.ec(e)})).next((function(n){return t.isPrimary&&!n?t.nc(e).next((function(){return!1})):!!n&&t.sc(e).next((function(){return!0}))}))})).catch((function(e){if(Ir(e))return v("IndexedDbPersistence","Failed to extend owner lease: ",e),t.isPrimary;if(!t.allowTabSynchronization)throw e;return v("IndexedDbPersistence","Releasing owner lease after error during lease refresh",e),!1})).then((function(e){t.isPrimary!==e&&t._n.Ds((function(){return t.Ua(e)})),t.isPrimary=e}))},t.prototype.tc=function(t){var e=this;return vo(t).get(Wi.key).next((function(t){return _r.resolve(e.ic(t))}))},t.prototype.rc=function(t){return go(t).delete(this.clientId)},t.prototype.oc=function(){return r.__awaiter(this,void 0,void 0,(function(){var e,n,i,o,s=this;return r.__generator(this,(function(r){switch(r.label){case 0:return!this.isPrimary||this.ac(this.qa,18e5)?[3,2]:(this.qa=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(e){var n=t.Un(e,no.store);return n.Zn().next((function(t){var e=s.cc(t,18e5),r=t.filter((function(t){return-1===e.indexOf(t)}));return _r.forEach(r,(function(t){return n.delete(t.clientId)})).next((function(){return r}))}))})).catch((function(){return[]}))]);case 1:if(e=r.sent(),this.Ka)for(n=0,i=e;n<i.length;n++)o=i[n],this.Ka.removeItem(this.uc(o.clientId));r.label=2;case 2:return[2]}}
2694))}))},t.prototype.Ya=function(){var t=this;this.Ba=this._n.gn("client_metadata_refresh",4e3,(function(){return t.Ga().then((function(){return t.oc()})).then((function(){return t.Ya()}))}))},t.prototype.ic=function(t){return!!t&&t.ownerId===this.clientId},t.prototype.ec=function(t){var e=this;return this.xa?_r.resolve(!0):vo(t).get(Wi.key).next((function(n){if(null!==n&&e.ac(n.leaseTimestampMs,5e3)&&!e.hc(n.ownerId)){if(e.ic(n)&&e.networkEnabled)return!0;if(!e.ic(n)){if(!n.allowTabSynchronization)throw new f(l.FAILED_PRECONDITION,lo);return!1}}return!(!e.networkEnabled||!e.inForeground)||go(t).Zn().next((function(t){return void 0===e.cc(t,5e3).find((function(t){if(e.clientId!==t.clientId){var n=!e.networkEnabled&&t.networkEnabled,r=!e.inForeground&&t.inForeground,i=e.networkEnabled===t.networkEnabled;if(n||r&&i)return!0}return!1}))}))})).next((function(t){return e.isPrimary!==t&&v("IndexedDbPersistence","Client "+(t?"is":"is not")+" eligible for a primary lease."),t}))},t.prototype.Si=function(){return r.__awaiter(this,void 0,void 0,(function(){var t=this;return r.__generator(this,(function(e){switch(e.label){case 0:return this.Ma=!1,this.lc(),this.Ba&&(this.Ba.cancel(),this.Ba=null),this._c(),this.fc(),[4,this.Wa.runTransaction("shutdown","readwrite",[Wi.store,no.store],(function(e){var n=new fo(e,Wr.oi);return t.nc(n).next((function(){return t.rc(n)}))}))];case 1:return e.sent(),this.Wa.close(),this.dc(),[2]}}))}))},t.prototype.cc=function(t,e){var n=this;return t.filter((function(t){return n.ac(t.updateTimeMs,e)&&!n.hc(t.clientId)}))},t.prototype.Vi=function(){var t=this;return this.runTransaction("getActiveClients","readonly",(function(e){return go(e).Zn().next((function(e){return t.cc(e,18e5).map((function(t){return t.clientId}))}))}))},Object.defineProperty(t.prototype,"Ti",{get:function(){return this.Ma},enumerable:!1,configurable:!0}),t.prototype.wc=function(t){return Oi.Fo(t,this.serializer,this.Sr,this.Co)},t.prototype.mc=function(){return this.ja},t.prototype.Tc=function(){return this.br},t.prototype.Ec=function(){return this.Sr},t.prototype.runTransaction=function(t,e,n){var r=this;v("IndexedDbPersistence","Starting transaction:",t);var i,o="readonly"===e?"readonly":"readwrite";return this.Wa.runTransaction(t,o,ro,(function(o){return i=new fo(o,r.ka?r.ka.next():Wr.oi),"readwrite-primary"===e?r.tc(i).next((function(t){return!!t||r.ec(i)})).next((function(e){if(!e)throw g("Failed to obtain primary lease for action '"+t+"'."),r.isPrimary=!1,r._n.Ds((function(){return r.Ua(!1)})),new f(l.FAILED_PRECONDITION,ri);return n(i)})).next((function(t){return r.sc(i).next((function(){return t}))})):r.Ic(i).next((function(){return n(i)}))})).then((function(t){return i.pr(),t}))},t.prototype.Ic=function(t){var e=this;return vo(t).get(Wi.key).next((function(t){if(null!==t&&e.ac(t.leaseTimestampMs,5e3)&&!e.hc(t.ownerId)&&!e.ic(t)&&!(e.xa||e.allowTabSynchronization&&t.allowTabSynchronization))throw new f(l.FAILED_PRECONDITION,lo)}))},t.prototype.sc=function(t){var e=new Wi(this.clientId,this.allowTabSynchronization,Date.now());return vo(t).put(Wi.key,e)},t.On=function(){return br.On()},t.prototype.nc=function(t){var e=this,n=vo(t);return n.get(Wi.key).next((function(t){return e.ic(t)?(v("IndexedDbPersistence","Releasing primary lease."),n.delete(Wi.key)):_r.resolve()}))},t.prototype.ac=function(t,e){var n=Date.now();return!(t<n-e||t>n&&(g("Detected an update time that is in the future: "+t+" > "+n),1))},t.prototype.za=function(){var t=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.La=function(){t._n.ds((function(){return t.inForeground="visible"===t.document.visibilityState,t.Ga()}))},this.document.addEventListener("visibilitychange",this.La),this.inForeground="visible"===this.document.visibilityState)},t.prototype._c=function(){this.La&&(this.document.removeEventListener("visibilitychange",this.La),this.La=null)},t.prototype.Ha=function(){var t,e=this;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.Oa=function(){e.lc(),e._n.ds((function(){return e.Si()}))},this.window.addEventListener("unload",this.Oa))},t.prototype.fc=function(){this.Oa&&(this.window.removeEventListener("unload",this.Oa),this.Oa=null)},t.prototype.hc=function(t){var e;try{var n=null!==(null===(e=this.Ka)||void 0===e?void 0:e.getItem(this.uc(t)));return v("IndexedDbPersistence","Client '"+t+"' "+(n?"is":"is not")+" zombied in LocalStorage"),n}catch(t){return g("IndexedDbPersistence","Failed to get zombied client id.",t),!1}},t.prototype.lc=function(){if(this.Ka)try{this.Ka.setItem(this.uc(this.clientId),String(Date.now()))}catch(r){g("Failed to set zombie client id.",r)}},t.prototype.dc=function(){if(this.Ka)try{this.Ka.removeItem(this.uc(this.clientId))}catch(r){}},t.prototype.uc=function(t){return"firestore_zombie_"+this.persistenceKey+"_"+t},t}();function vo(t){return po.Un(t,Wi.store)}function go(t){return po.Un(t,no.store)}var yo=function(){function t(t,e){this.db=t,this.do=new fi(this,e)}return t.prototype.Ro=function(t){var e=this.Ac(t);return this.db.mc().pa(t).next((function(t){return e.next((function(e){return t+e}))}))},t.prototype.Ac=function(t){var e=0;return this.yo(t,(function(t){e++})).next((function(){return e}))},t.prototype.De=function(t,e){return this.db.mc().De(t,e)},t.prototype.yo=function(t,e){return this.Rc(t,(function(t,n){return e(n)}))},t.prototype.Sa=function(t,e,n){return mo(t,n)},t.prototype.Ca=function(t,e,n){return mo(t,n)},t.prototype.Vo=function(t,e,n){return this.db.mc().Vo(t,e,n)},t.prototype.Ko=function(t,e){return mo(t,e)},t.prototype.Pc=function(t,e){return function(t,e){var n=!1;return Pi(t).rs((function(r){return Ni(t,r,e).next((function(t){return t&&(n=!0),_r.resolve(!t)}))})).next((function(){return n}))}(t,e)},t.prototype.po=function(t,e){var n=this,r=this.db.Tc().ia(),i=[],o=0;return this.Rc(t,(function(s,a){if(a<=e){var u=n.Pc(t,s).next((function(e){if(!e)return o++,r.Ar(t,s).next((function(){return r.Ir(s),ho(t).delete([0,pi(s.path)])}))}));i.push(u)}}
2694)).next((function(){return _r.$n(i)})).next((function(){return r.apply(t)})).next((function(){return o}))},t.prototype.removeTarget=function(t,e){var n=e.nt(t.Fa);return this.db.mc().ga(t,n)},t.prototype.gc=function(t,e){return mo(t,e)},t.prototype.Rc=function(t,e){var n,r=ho(t),i=Wr.oi;return r.ss({index:Ji.documentTargetsIndex},(function(t,r){var o=t[0],s=(t[1],r.path),a=r.sequenceNumber;0===o?(i!==Wr.oi&&e(new A(gi(n)),i),i=a,n=s):i=Wr.oi})).next((function(){i!==Wr.oi&&e(new A(gi(n)),i)}))},t.prototype.vo=function(t){return this.db.Tc().oa(t)},t}();function mo(t,e){return ho(t).put(function(t,e){return new Ji(0,pi(t.path),e)}(e,t.Fa))}function _o(t,e){var n=t.projectId;return t.W||(n+="."+t.database),"firestore/"+e+"/"+n+"/"}var bo=function(){function t(t,e,n){this.persistence=t,this.yc=e,this.Vc=new Tt($),this.bc=new at((function(t){return vt(t)}),gt),this.vc=ct.min(),this.vr=t.wc(n),this.Sc=t.Tc(),this.ja=t.mc(),this.Dc=new oi(this.Sc,this.vr,this.persistence.Ec()),this.yc.Cc(this.Dc)}return t.prototype.Eo=function(t){var e=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(n){return t.bo(n,e.Vc)}))},t}();function wo(t,e){var n=w(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(function(t){var r=e.batch.keys(),i=n.Sc.ia({ra:!0});return function(t,e,n,r){var i=n.batch,o=i.keys(),s=_r.resolve();return o.forEach((function(t){s=s.next((function(){return r.Ar(e,t)})).next((function(e){var o=e,s=n._r.get(t);b(null!==s),(!o||o.version.L(s)<0)&&(o=i.ar(t,o,n))&&r.Tr(o,n.lr)}))})),s.next((function(){return t.vr.Qo(e,i)}))}(n,t,e,i).next((function(){return i.apply(t)})).next((function(){return n.vr.Go(t)})).next((function(){return n.Dc.$r(t,r)}))}))}function Eo(t){var e=w(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(function(t){return e.ja.Ta(t)}))}function Io(t,e){var n=w(t),r=e.et,i=n.Vc;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(function(t){var o=n.Sc.ia({ra:!0});i=n.Vc;var s=[];e.Gt.forEach((function(e,o){var a=i.get(o);if(a){s.push(n.ja.Da(t,e.ne,o).next((function(){return n.ja.va(t,e.te,o)})));var u=e.resumeToken;if(u.O()>0){var c=a.st(u,r).nt(t.Fa);i=i.rt(o,c),function(t,e,n){return b(e.resumeToken.O()>0),0===t.resumeToken.O()||e.et.J()-t.et.J()>=3e8||n.te.size+n.ee.size+n.ne.size>0}(a,c,e)&&s.push(n.ja.ga(t,c))}}}));var a=kt(),u=jt();if(e.Ht.forEach((function(t,e){u=u.add(t)})),s.push(o.getEntries(t,u).next((function(i){e.Ht.forEach((function(u,c){var h=i.get(u);c instanceof Ln&&c.version.isEqual(ct.min())?(o.Ir(u,r),a=a.rt(u,c)):null==h||c.version.L(h.version)>0||0===c.version.L(h.version)&&h.hasPendingWrites?(o.Tr(c,r),a=a.rt(u,c)):v("LocalStore","Ignoring outdated watch update for ",u,". Current version:",h.version," Watch version:",c.version),e.Yt.has(u)&&s.push(n.persistence.Co.gc(t,u))}))}))),!r.isEqual(ct.min())){var c=n.ja.Ta(t).next((function(e){return n.ja.Ia(t,t.Fa,r)}));s.push(c)}return _r.$n(s).next((function(){return o.apply(t)})).next((function(){return n.Dc.kr(t,a)}))})).then((function(t){return n.Vc=i,t}))}function To(t,e){var n=w(t);return n.persistence.runTransaction("Get next mutation batch","readonly",(function(t){return void 0===e&&(e=-1),n.vr.Lo(t,e)}))}function Co(t,e){var n=w(t);return n.persistence.runTransaction("Allocate target","readwrite",(function(t){var r;return n.ja.ba(t,e).next((function(i){return i?(r=i,_r.resolve(r)):n.ja.da(t).next((function(i){return r=new bt(e,i,0,t.Fa),n.ja.Aa(t,r).next((function(){return r}))}))}))})).then((function(t){var r=n.Vc.get(t.targetId);return(null===r||t.et.L(r.et)>0)&&(n.Vc=n.Vc.rt(t.targetId,t),n.bc.set(e,t.targetId)),t}))}function So(t,e,n){return r.__awaiter(this,void 0,void 0,(function(){var i,o,s,a;return r.__generator(this,(function(r){switch(r.label){case 0:i=w(t),o=i.Vc.get(e),s=n?"readwrite":"readwrite-primary",r.label=1;case 1:return r.trys.push([1,4,,5]),n?[3,3]:[4,i.persistence.runTransaction("Release target",s,(function(t){return i.persistence.Co.removeTarget(t,o)}))];case 2:r.sent(),r.label=3;case 3:return[3,5];case 4:if(!Ir(a=r.sent()))throw a;return v("LocalStore","Failed to update sequence numbers for target "+e+": "+a),[3,5];case 5:return i.Vc=i.Vc.remove(e),i.bc.delete(o.target),[2]}}))}))}function Oo(t,e,n){var r=w(t),i=ct.min(),o=jt();
2694return r.persistence.runTransaction("Execute query","readonly",(function(t){return function(t,e,n){var r=w(t),i=r.bc.get(n);return void 0!==i?_r.resolve(r.Vc.get(i)):r.ja.ba(e,n)}(r,t,Kn(e)).next((function(e){if(e)return i=e.lastLimboFreeSnapshotVersion,r.ja.Na(t,e.targetId).next((function(t){o=t}))})).next((function(){return r.yc.Or(t,e,n?i:ct.min(),n?o:jt())})).next((function(t){return{documents:t,Nc:o}}))}))}function No(t,e){var n=w(t),r=w(n.ja),i=n.Vc.get(e);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",(function(t){return r.qe(t,e).next((function(t){return t?t.target:null}))}))}function Ao(t){var e=w(t);return e.persistence.runTransaction("Get new document changes","readonly",(function(t){return function(t,e,n){var r=w(t),i=kt(),o=bi(n),s=ji(e),a=IDBKeyRange.lowerBound(o,!0);return s.ss({index:Yi.readTimeIndex,range:a},(function(t,e){var n=mi(r.serializer,e);i=i.rt(n.key,n),o=e.readTime})).next((function(){return{Fc:i,readTime:wi(o)}}))}(e.Sc,t,e.vc)})).then((function(t){var n=t.Fc,r=t.readTime;return e.vc=r,n}))}function ko(t){return r.__awaiter(this,void 0,void 0,(function(){var e;return r.__generator(this,(function(n){return[2,(e=w(t)).persistence.runTransaction("Synchronize last document change read time","readonly",(function(t){return function(t){var e=ji(t),n=ct.min();return e.ss({index:Yi.readTimeIndex,reverse:!0},(function(t,e,r){e.readTime&&(n=wi(e.readTime)),r.done()})).next((function(){return n}))}(t)})).then((function(t){e.vc=t}))]}))}))}function Ro(t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){if(t.code!==l.FAILED_PRECONDITION||t.message!==ri)throw t;return v("LocalStore","Unexpectedly lost primary lease"),[2]}))}))} 2695/** 2696 * @license 2697 * Copyright 2017 Google LLC 2698 * 2699 * Licensed under the Apache License, Version 2.0 (the "License"); 2700 * you may not use this file except in compliance with the License. 2701 * You may obtain a copy of the License at 2702 * 2703 * http://www.apache.org/licenses/LICENSE-2.0 2704 * 2705 * Unless required by applicable law or agreed to in writing, software 2706 * distributed under the License is distributed on an "AS IS" BASIS, 2707 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2708 * See the License for the specific language governing permissions and 2709 * limitations under the License. 2710 */var Po=function(){function t(){this.$c=new Ot(xo.xc),this.kc=new Ot(xo.Mc)}return t.prototype.m=function(){return this.$c.m()},t.prototype.Sa=function(t,e){var n=new xo(t,e);this.$c=this.$c.add(n),this.kc=this.kc.add(n)},t.prototype.Oc=function(t,e){var n=this;t.forEach((function(t){return n.Sa(t,e)}))},t.prototype.Ca=function(t,e){this.Lc(new xo(t,e))},t.prototype.Bc=function(t,e){var n=this;t.forEach((function(t){return n.Ca(t,e)}))},t.prototype.qc=function(t){var e=this,n=new A(new S([])),r=new xo(n,t),i=new xo(n,t+1),o=[];return this.kc.Nt([r,i],(function(t){e.Lc(t),o.push(t.key)})),o},t.prototype.Uc=function(){var t=this;this.$c.forEach((function(e){return t.Lc(e)}))},t.prototype.Lc=function(t){this.$c=this.$c.delete(t),this.kc=this.kc.delete(t)},t.prototype.Qc=function(t){var e=new A(new S([])),n=new xo(e,t),r=new xo(e,t+1),i=jt();return this.kc.Nt([n,r],(function(t){i=i.add(t.key)})),i},t.prototype.zo=function(t){var e=new xo(t,0),n=this.$c.$t(e);return null!==n&&t.isEqual(n.key)},t}(),xo=function(){function t(t,e){this.key=t,this.Wc=e}return t.xc=function(t,e){return A.i(t.key,e.key)||$(t.Wc,e.Wc)},t.Mc=function(t,e){return $(t.Wc,e.Wc)||A.i(t.key,e.key)},t}(),Do=function(t,e){this.user=e,this.type="OAuth",this.jc={},this.jc.Authorization="Bearer "+t},Lo=function(){function t(){this.Kc=null}return t.prototype.getToken=function(){return Promise.resolve(null)},t.prototype.Gc=function(){},t.prototype.zc=function(t){this.Kc=t,t(Br.UNAUTHENTICATED)},t.prototype.Hc=function(){this.Kc=null},t}(),jo=function(){function t(t){var e=this;this.Yc=null,this.currentUser=Br.UNAUTHENTICATED,this.Jc=!1,this.Xc=0,this.Kc=null,this.forceRefresh=!1,this.Yc=function(){e.Xc++,e.currentUser=e.Zc(),e.Jc=!0,e.Kc&&e.Kc(e.currentUser)},this.Xc=0,this.auth=t.getImmediate({optional:!0}),this.auth?this.auth.addAuthTokenListener(this.Yc):(this.Yc(null),t.get().then((function(t){e.auth=t,e.Yc&&e.auth.addAuthTokenListener(e.Yc
2710)}),(function(){})))}return t.prototype.getToken=function(){var t=this,e=this.Xc,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((function(n){return t.Xc!==e?(v("FirebaseCredentialsProvider","getToken aborted due to token change."),t.getToken()):n?(b("string"==typeof n.accessToken),new Do(n.accessToken,t.currentUser)):null})):Promise.resolve(null)},t.prototype.Gc=function(){this.forceRefresh=!0},t.prototype.zc=function(t){this.Kc=t,this.Jc&&t(this.currentUser)},t.prototype.Hc=function(){this.auth&&this.auth.removeAuthTokenListener(this.Yc),this.Yc=null,this.Kc=null},t.prototype.Zc=function(){var t=this.auth&&this.auth.getUid();return b(null===t||"string"==typeof t),new Br(t)},t}(),Mo=function(){function t(t,e){this.tu=t,this.eu=e,this.type="FirstParty",this.user=Br.ei}return Object.defineProperty(t.prototype,"jc",{get:function(){var t={"X-Goog-AuthUser":this.eu},e=this.tu.auth.getAuthHeaderValueForFirstParty([]);return e&&(t.Authorization=e),t},enumerable:!1,configurable:!0}),t}(),Fo=function(){function t(t,e){this.tu=t,this.eu=e}return t.prototype.getToken=function(){return Promise.resolve(new Mo(this.tu,this.eu))},t.prototype.zc=function(t){t(Br.ei)},t.prototype.Hc=function(){},t.prototype.Gc=function(){},t}(),Uo=function(){function t(t,e,n,r,i,o){this._n=t,this.nu=n,this.su=r,this.iu=i,this.listener=o,this.state=0,this.ru=0,this.ou=null,this.stream=null,this.gs=new mr(t,e)}return t.prototype.au=function(){return 1===this.state||2===this.state||4===this.state},t.prototype.cu=function(){return 2===this.state},t.prototype.start=function(){3!==this.state?this.auth():this.uu()},t.prototype.stop=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return this.au()?[4,this.close(0)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}
2710))}))},t.prototype.hu=function(){this.state=0,this.gs.reset()},t.prototype.lu=function(){var t=this;this.cu()&&null===this.ou&&(this.ou=this._n.gn(this.nu,6e4,(function(){return t._u()})))},t.prototype.fu=function(t){this.du(),this.stream.send(t)},t.prototype._u=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return this.cu()?[2,this.close(0)]:[2]}))}))},t.prototype.du=function(){this.ou&&(this.ou.cancel(),this.ou=null)},t.prototype.close=function(t,e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){switch(n.label){case 0:return this.du(),this.gs.cancel(),this.ru++,3!==t?this.gs.reset():e&&e.code===l.RESOURCE_EXHAUSTED?(g(e.toString()),g("Using maximum backoff delay to prevent overloading the backend."),this.gs.An()):e&&e.code===l.UNAUTHENTICATED&&this.iu.Gc(),null!==this.stream&&(this.wu(),this.stream.close(),this.stream=null),this.state=t,[4,this.listener.mu(e)];case 1:return n.sent(),[2]}}))}))},t.prototype.wu=function(){},t.prototype.auth=function(){var t=this;this.state=1;var e=this.Tu(this.ru),n=this.ru;this.iu.getToken().then((function(e){t.ru===n&&t.Eu(e)}),(function(n){e((function(){var e=new f(l.UNKNOWN,"Fetching auth token failed: "+n.message);return t.Iu(e)}))}))},t.prototype.Eu=function(t){var e=this,n=this.Tu(this.ru);this.stream=this.Au(t),this.stream.Ru((function(){n((function(){return e.state=2,e.listener.Ru()}))})),this.stream.mu((function(t){n((function(){return e.Iu(t)}))})),this.stream.onMessage((function(t){n((function(){return e.onMessage(t)}))}))},t.prototype.uu=function(){var t=this;this.state=4,this.gs.Rn((function(){return r.__awaiter(t,void 0,void 0,(function(){return r.__generator(this,(function(t){return this.state=0,this.start(),[2]}))}))}))},t.prototype.Iu=function(t){return v("PersistentStream","close with error: "+t),this.stream=null,this.close(3,t)},t.prototype.Tu=function(t){var e=this;return function(n){e._n.ds((function(){return e.ru===t?n():(v("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},t}(),Vo=function(t){function e(e,n,r,i,o){var s=this;return(s=t.call(this,e,"listen_stream_connection_backoff","listen_stream_idle",n,r,o)||this).serializer=i,s}return r.__extends(e,t),e.prototype.Au=function(t){return this.su.Pu("Listen",t)},e.prototype.onMessage=function(t){this.gs.reset();var e=function(t,e){var n;if("targetChange"in e){e.targetChange;var r=function(t){return"NO_CHANGE"===t?0:"ADD"===t?1:"REMOVE"===t?2:"CURRENT"===t?3:"RESET"===t?4:_()}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],o=function(t,e){return t.Ue?(b(void 0===e||"string"==typeof e),tt.fromBase64String(e||"")):(b(void 0===e||e instanceof Uint8Array),tt.fromUint8Array(e||new Uint8Array))}(t,e.targetChange.resumeToken),s=e.targetChange.cause,a=s&&function(t){var e=void 0===t.code?l.UNKNOWN:It(t.code);return new f(e,t.message||"")}(s);n=new Kt(r,i,o,a||null)}else if("documentChange"in e){e.documentChange;var u=e.documentChange;u.document,u.document.name,u.document.updateTime;var c=ke(t,u.document.name),h=Se(u.document.updateTime),p=new kn({mapValue:{fields:u.document.fields}}),d=new Dn(c,h,p,{}),v=u.targetIds||[],g=u.removedTargetIds||[];n=new Gt(v,g,d.key,d)}else if("documentDelete"in e){e.documentDelete;var y=e.documentDelete;y.document;var m=ke(t,y.document),w=y.readTime?Se(y.readTime):ct.min(),E=new Ln(m,w),I=y.removedTargetIds||[];n=new Gt([],I,E.key,E)}else if("documentRemove"in e){e.documentRemove;var T=e.documentRemove;T.document;var C=ke(t,T.document),S=T.removedTargetIds||[];n=new Gt([],S,C,null)}else{if(!("filter"in e))return _();e.filter;var O=e.filter;O.targetId;var N=O.count||0,A=new wt(N),k=O.targetId;n=new Ht(k,A)}return n}(this.serializer,t),n=function(t){if(!("targetChange"in t))return ct.min();var e=t.targetChange;return e.targetIds&&e.targetIds.length?ct.min():e.readTime?Se(e.readTime):ct.min()}(t);return this.listener.gu(e,n)},e.prototype.yu=function(t){var e={};e.database=xe(this.serializer),e.addTarget=function(t,e){var n,r=e.target;return(n=yt(r)?{documents:Fe(t,r)}:{query:Ue(t,r)}).targetId=e.targetId,e.resumeToken.O()>0&&(n.resumeToken=Te(t,e.resumeToken)),n}(this.serializer,t);var n=function(t,e){var n=function(t,e){switch(e){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return _()}}(0,e.tt);return null==n?null:{"goog-listen-tags":n}}(this.serializer,t);n&&(e.labels=n),this.fu(e)},e.prototype.Vu=function(t){var e={};e.database=xe(this.serializer),e.removeTarget=t,this.fu(e)},e}(Uo),qo=function(t){function e(e,n,r,i,o){var s=this;return(s=t.call(this,e,"write_stream_connection_backoff","write_stream_idle",n,r,o)||this).serializer
2710=i,s.pu=!1,s}return r.__extends(e,t),Object.defineProperty(e.prototype,"bu",{get:function(){return this.pu},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.pu=!1,this.lastStreamToken=void 0,t.prototype.start.call(this)},e.prototype.wu=function(){this.pu&&this.vu([])},e.prototype.Au=function(t){return this.su.Pu("Write",t)},e.prototype.onMessage=function(t){if(b(!!t.streamToken),this.lastStreamToken=t.streamToken,this.pu){this.gs.reset();var e=function(t,e){return t&&t.length>0?(b(void 0!==e),t.map((function(t){return function(t,e){var n=t.updateTime?Se(t.updateTime):Se(e);n.isEqual(ct.min())&&(n=Se(e));var r=null;return t.transformResults&&t.transformResults.length>0&&(r=t.transformResults),new pn(n,r)}(t,e)}))):[]}(t.writeResults,t.commitTime),n=Se(t.commitTime);return this.listener.Su(n,e)}return b(!t.writeResults||0===t.writeResults.length),this.pu=!0,this.listener.Du()},e.prototype.Cu=function(){var t={};t.database=xe(this.serializer),this.fu(t)},e.prototype.vu=function(t){var e=this,n={streamToken:this.lastStreamToken,writes:t.map((function(t){return je(e.serializer,t)}))};this.fu(n)},e}(Uo),Bo=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).credentials=e,i.su=n,i.serializer=r,i.Nu=!1,i}return r.__extends(e,t),e.prototype.Fu=function(){if(this.Nu)throw new f(l.FAILED_PRECONDITION,"The client has already been terminated.")},e.prototype.$u=function(t,e,n){var r=this;return this.Fu(),this.credentials.getToken().then((function(i){return r.su.$u(t,e,n,i)})).catch((function(t){throw t.code===l.UNAUTHENTICATED&&r.credentials.Gc(),t}))},e.prototype.xu=function(t,e,n){var r=this;return this.Fu(),this.credentials.getToken().then((function(i){return r.su.xu(t,e,n,i)})).catch((function(t){throw t.code===l.UNAUTHENTICATED&&r.credentials.Gc(),t}))},e.prototype.terminate=function(){this.Nu=!1},e}((function(){})),Wo=function(){function t(t,e){this.os=t,this.fi=e,this.state="Unknown",this.ku=0,this.Mu=null,this.Ou=!0}return t.prototype.Lu=function(){var t=this;0===this.ku&&(this.Bu("Unknown"),this.Mu=this.os.gn("online_state_timeout",1e4,(function(){return t.Mu=null,t.qu("Backend didn't respond within 10 seconds."),t.Bu("Offline"),Promise.resolve()})))},t.prototype.Uu=function(t){"Online"===this.state?this.Bu("Unknown"):(this.ku++,this.ku>=1&&(this.Qu(),this.qu("Connection failed 1 times. Most recent error: "+t.toString()),this.Bu("Offline")))},t.prototype.set=function(t){this.Qu(),this.ku=0,"Online"===t&&(this.Ou=!1),this.Bu(t)},t.prototype.Bu=function(t){t!==this.state&&(this.state=t,this.fi(t))},t.prototype.qu=function(t){var e="Could not reach Cloud Firestore backend. "+t+"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.";this.Ou?(g(e),this.Ou=!1):v("OnlineStateTracker",e)},t.prototype.Qu=function(){null!==this.Mu&&(this.Mu.cancel(),this.Mu=null)},t}(),Go=function(t,e,n,i,o){var s=this;this.Wu=t,this.ju=e,this.os=n,this.Ku={},this.Gu=[],this.zu=new Map,this.Hu=new Set,this.Yu=[],this.Ju=o,this.Ju.Xu((function(t){n.ds((function(){return r.__awaiter(s,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return ts(this)?(v("RemoteStore","Restarting streams for network reachability change."),[4,function(t){return r.__awaiter(this,void 0,void 0,(function(){var e;return r.__generator(this,(function(n){switch(n.label){case 0:return(e=w(t)).Hu.add(4),[4,Ko(e)];case 1:return n.sent(),e.Zu.set("Unknown"),e.Hu.delete(4),[4,Ho(e)];case 2:return n.sent(),[2]}}))}))}(this)]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}
2710))}))}))})),this.Zu=new Wo(n,i)};function Ho(t){return r.__awaiter(this,void 0,void 0,(function(){var e,n;return r.__generator(this,(function(r){switch(r.label){case 0:if(!ts(t))return[3,4];e=0,n=t.Yu,r.label=1;case 1:return e<n.length?[4,(0,n[e])(!0)]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))}function Ko(t){return r.__awaiter(this,void 0,void 0,(function(){var e,n;return r.__generator(this,(function(r){switch(r.label){case 0:e=0,n=t.Yu,r.label=1;case 1:return e<n.length?[4,(0,n[e])(!1)]:[3,4];case 2:r.sent(),r.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))}function zo(t){return r.__awaiter(this,void 0,void 0,(function(){var e;return r.__generator(this,(function(n){switch(n.label){case 0:return e=w(t),v("RemoteStore","RemoteStore shutting down."),e.Hu.add(5),[4,Ko(e)];case 1:return n.sent(),e.Ju.Si(),e.Zu.set("Unknown"),[2]}}))}))}function Qo(t,e){var n=w(t);n.zu.has(e.targetId)||(n.zu.set(e.targetId,e),Zo(n)?Jo(n):vs(n).cu()&&Xo(n,e))}function Yo(t,e){var n=w(t),r=vs(n);n.zu.delete(e),r.cu()&&$o(n,e),0===n.zu.size&&(r.cu()?r.lu():ts(n)&&n.Zu.set("Unknown"))}function Xo(t,e){t.th.Ee(e.targetId),vs(t).yu(e)}function $o(t,e){t.th.Ee(e),vs(t).Vu(e)}function Jo(t){t.th=new Qt({Be:function(e){return t.Ku.Be(e)},qe:function(e){return t.zu.get(e)||null}}),vs(t).start(),t.Zu.Lu()}function Zo(t){return ts(t)&&!vs(t).au()&&t.zu.size>0}function ts(t){return 0===w(t).Hu.size}function es(t){t.th=void 0}function ns(t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return t.zu.forEach((function(e,n){Xo(t,e)})),[2]}))}))}function rs(t,e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return es(t),Zo(t)?(t.Zu.Uu(e),Jo(t)):t.Zu.set("Unknown"),[2]}))}))}function is(t,e,n){return r.__awaiter(this,void 0,void 0,(function(){var i,o,s;return r.__generator(this,(function(a){switch(a.label){case 0:if(t.Zu.set("Online"),!(e instanceof Kt&&2===e.state&&e.cause))return[3,6];a.label=1;case 1:return a.trys.push([1,3,,5]),[4,function(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o,s;return r.__generator(this,(function(r){switch(r.label){case 0:n=e.cause,i=0,o=e.targetIds,r.label=1;case 1:return i<o.length?(s=o[i],t.zu.has(s)?[4,t.Ku.eh(s,n)]:[3,3]):[3,5];case 2:r.sent(),t.zu.delete(s),t.th.removeTarget(s),r.label=3;case 3:r.label=4;case 4:return i++,[3,1];case 5:return[2]}}
2710))}))}(t,e)];case 2:return a.sent(),[3,5];case 3:return i=a.sent(),v("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),i),[4,os(t,i)];case 4:return a.sent(),[3,5];case 5:return[3,13];case 6:if(e instanceof Gt?t.th.pe(e):e instanceof Ht?t.th.$e(e):t.th.Se(e),n.isEqual(ct.min()))return[3,13];a.label=7;case 7:return a.trys.push([7,11,,13]),[4,Eo(t.Wu)];case 8:return o=a.sent(),n.L(o)>=0?[4,function(t,e){var n=t.th.Me(e);return n.Gt.forEach((function(n,r){if(n.resumeToken.O()>0){var i=t.zu.get(r);i&&t.zu.set(r,i.st(n.resumeToken,e))}})),n.zt.forEach((function(e){var n=t.zu.get(e);if(n){t.zu.set(e,n.st(tt.B,n.et)),$o(t,e);var r=new bt(n.target,e,1,n.sequenceNumber);Xo(t,r)}})),t.Ku.nh(n)}(t,n)]:[3,10];case 9:a.sent(),a.label=10;case 10:return[3,13];case 11:return v("RemoteStore","Failed to raise snapshot:",s=a.sent()),[4,os(t,s)];case 12:return a.sent(),[3,13];case 13:return[2]}}))}))}function os(t,e,n){return r.__awaiter(this,void 0,void 0,(function(){var i=this;return r.__generator(this,(function(o){switch(o.label){case 0:if(!Ir(e))throw e;return t.Hu.add(1),[4,Ko(t)];case 1:return o.sent(),t.Zu.set("Offline"),n||(n=function(){return Eo(t.Wu)}),t.os.Ds((function(){return r.__awaiter(i,void 0,void 0,(function(){return r.__generator(this,(function(e){switch(e.label){case 0:return v("RemoteStore","Retrying IndexedDB access"),[4,n()];case 1:return e.sent(),t.Hu.delete(1),[4,Ho(t)];case 2:return e.sent(),[2]}}))}))})),[2]}}))}))}function ss(t,e){return e().catch((function(n){return os(t,n,e)}))}function as(t){return r.__awaiter(this,void 0,void 0,(function(){var e,n,i,o,s;return r.__generator(this,(function(r){switch(r.label){case 0:e=w(t),n=gs(e),i=e.Gu.length>0?e.Gu[e.Gu.length-1].batchId:-1,r.label=1;case 1:if(!function(t){return ts(t)&&t.Gu.length<10}(e))return[3,7];r.label=2;case 2:return r.trys.push([2,4,,6]),[4,To(e.Wu,i)];case 3:return null===(o=r.sent())?(0===e.Gu.length&&n.lu(),[3,7]):(i=o.batchId,function(t,e){t.Gu.push(e);var n=gs(t);n.cu()&&n.bu&&n.vu(e.mutations)}(e,o),[3,6]);case 4:return s=r.sent(),[4,os(e,s)];case 5:return r.sent(),[3,6];case 6:return[3,1];case 7:return us(e)&&cs(e),[2]}}))}))}function us(t){return ts(t)&&!gs(t).au()&&t.Gu.length>0}function cs(t){gs(t).start()}function hs(t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return gs(t).Cu(),[2]}))}))}function ls(t){return r.__awaiter(this,void 0,void 0,(function(){var e,n,i,o;return r.__generator(this,(function(r){for(e=gs(t),n=0,i=t.Gu;n<i.length;n++)o=i[n],e.vu(o.mutations);return[2]}))}))}function fs(t,e,n){return r.__awaiter(this,void 0,void 0,(function(){var i,o;return r.__generator(this,(function(r){switch(r.label){case 0:return i=t.Gu.shift(),o=ei.from(i,e,n),[4,ss(t,(function(){return t.Ku.sh(o)}))];case 1:return r.sent(),[4,as(t)];case 2:return r.sent(),[2]}}))}))}function ps(t,e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){switch(n.label){case 0:return e&&gs(t).bu?[4,function(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i;return r.__generator(this,(function(r){switch(r.label){case 0:return Et(i=e.code)&&i!==l.ABORTED?(n=t.Gu.shift(),gs(t).hu(),[4,ss(t,(function(){return t.Ku.ih(n.batchId,e)}))]):[3,3];case 1:return r.sent(),[4,as(t)];case 2:r.sent(),r.label=3;case 3:return[2]}}
2710))}))}(t,e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return us(t)&&cs(t),[2]}}))}))}function ds(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n;return r.__generator(this,(function(r){switch(r.label){case 0:return n=w(t),e?(n.Hu.delete(2),[4,Ho(n)]):[3,2];case 1:return r.sent(),[3,5];case 2:return e?[3,4]:(n.Hu.add(2),[4,Ko(n)]);case 3:r.sent(),n.Zu.set("Unknown"),r.label=4;case 4:r.label=5;case 5:return[2]}}))}))}function vs(t){var e=this;return t.rh||(t.rh=function(t,e,n){var r=w(t);return r.Fu(),new Vo(e,r.su,r.credentials,r.serializer,n)}(t.ju,t.os,{Ru:ns.bind(null,t),mu:rs.bind(null,t),gu:is.bind(null,t)}),t.Yu.push((function(n){return r.__awaiter(e,void 0,void 0,(function(){return r.__generator(this,(function(e){switch(e.label){case 0:return n?(t.rh.hu(),Zo(t)?Jo(t):t.Zu.set("Unknown"),[3,3]):[3,1];case 1:return[4,t.rh.stop()];case 2:e.sent(),es(t),e.label=3;case 3:return[2]}}))}))}))),t.rh}function gs(t){var e=this;return t.oh||(t.oh=function(t,e,n){var r=w(t);return r.Fu(),new qo(e,r.su,r.credentials,r.serializer,n)}(t.ju,t.os,{Ru:hs.bind(null,t),mu:ps.bind(null,t),Du:ls.bind(null,t),Su:fs.bind(null,t)}),t.Yu.push((function(n){return r.__awaiter(e,void 0,void 0,(function(){return r.__generator(this,(function(e){switch(e.label){case 0:return n?(t.oh.hu(),[4,as(t)]):[3,2];case 1:return e.sent(),[3,4];case 2:return[4,t.oh.stop()];case 3:e.sent(),t.Gu.length>0&&(v("RemoteStore","Stopping write stream with "+t.Gu.length+" pending writes"),t.Gu=[]),e.label=4;case 4:return[2]}}
2710))}))}))),t.oh 2711/** 2712 * @license 2713 * Copyright 2017 Google LLC 2714 * 2715 * Licensed under the Apache License, Version 2.0 (the "License"); 2716 * you may not use this file except in compliance with the License. 2717 * You may obtain a copy of the License at 2718 * 2719 * http://www.apache.org/licenses/LICENSE-2.0 2720 * 2721 * Unless required by applicable law or agreed to in writing, software 2722 * distributed under the License is distributed on an "AS IS" BASIS, 2723 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2724 * See the License for the specific language governing permissions and 2725 * limitations under the License. 2726 */}var ys=function(t){this.key=t},ms=function(t){this.key=t},_s=function(){function t(t,e){this.query=t,this.ah=e,this.uh=null,this.Zt=!1,this.hh=jt(),this.Qt=jt(),this.lh=tr(t),this._h=new Ut(this.lh)}return Object.defineProperty(t.prototype,"fh",{get:function(){return this.ah},enumerable:!1,configurable:!0}),t.prototype.dh=function(t,e){var n=this,r=e?e.wh:new Vt,i=e?e._h:this._h,o=e?e.Qt:this.Qt,s=i,a=!1,u=Vn(this.query)&&i.size===this.query.limit?i.last():null,c=qn(this.query)&&i.size===this.query.limit?i.first():null;if(t.ut((function(t,e){var h=i.get(t),l=e instanceof Dn?e:null;l&&(l=Zn(n.query,l)?l:null);var f=!!h&&n.Qt.has(h.key),p=!!l&&(l.Ye||n.Qt.has(l.key)&&l.hasCommittedMutations),d=!1;h&&l?h.data().isEqual(l.data())?f!==p&&(r.track({type:3,doc:l}),d=!0):n.mh(h,l)||(r.track({type:2,doc:l}),d=!0,(u&&n.lh(l,u)>0||c&&n.lh(l,c)<0)&&(a=!0)):!h&&l?(r.track({type:0,doc:l}),d=!0):h&&!l&&(r.track({type:1,doc:h}),d=!0,(u||c)&&(a=!0)),d&&(l?(s=s.add(l),o=p?o.add(t):o.delete(t)):(s=s.delete(t),o=o.delete(t)))})),Vn(this.query)||qn(this.query))for(;s.size>this.query.limit;){var h=Vn(this.query)?s.last():s.first();s=s.delete(h.key),o=o.delete(h.key),r.track({type:1,doc:h})}return{_h:s,wh:r,Th:a,Qt:o}},t.prototype.mh=function(t,e){return t.Ye&&e.hasCommittedMutations&&!e.Ye},t.prototype.gr=function(t,e,n){var r=this,i=this._h;this._h=t._h,this.Qt=t.Qt;var o=t.wh.qt();o.sort((function(t,e){return function(t,e){var n=function(t){switch(t){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return _()}};return n(t)-n(e)}(t.type,e.type)||r.lh(t.doc,e.doc)})),this.Eh(n);var s=e?this.Ih():[],a=0===this.hh.size&&this.Zt?1:0,u=a!==this.uh;return this.uh=a,0!==o.length||u?{snapshot:new qt(this.query,t._h,i,o,t.Qt,0===a,u,!1),Ah:s}:{Ah:s}},t.prototype.Us=function(t){return this.Zt&&"Offline"===t?(this.Zt=!1,this.gr({_h:this._h,wh:new Vt,Qt:this.Qt,Th:!1},!1)):{Ah:[]}},t.prototype.Rh=function(t){return!this.ah.has(t)&&!!this._h.has(t)&&!this._h.get(t).Ye},t.prototype.Eh=function(t){var e=this;t&&(t.te.forEach((function(t){return e.ah=e.ah.add(t)})),t.ee.forEach((function(t){})),t.ne.forEach((function(t){return e.ah=e.ah.delete(t)})),this.Zt=t.Zt)},t.prototype.Ih=function(){var t=this;if(!this.Zt)return[];var e=this.hh;this.hh=jt(),this._h.forEach((function(e){t.Rh(e.key)&&(t.hh=t.hh.add(e.key))}));var n=[];return e.forEach((function(e){t.hh.has(e)||n.push(new ms(e))})),this.hh.forEach((function(t){e.has(t)||n.push(new ys(t))})),n},t.prototype.Ph=function(t){this.ah=t.Nc,this.hh=jt();var e=this.dh(t.documents);return this.gr(e,!0)},t.prototype.gh=function(){return qt.Kt(this.query,this._h,this.Qt,0===this.uh)},t}(),bs=function(t,e,n){this.query=t,this.targetId=e,this.view=n},ws=function(t){this.key=t,this.yh=!1},Es=function(){function t(t,e,n,r,i,o){this.Wu=t,this.Vh=e,this.ph=n,this.bh=r,this.currentUser=i,this.Sh=o,this.Dh={},this.Ch=new at((function(t){return $n(t)}),Xn),this.Nh=new Map,this.Fh=[],this.$h=new Tt(A.i),this.xh=new Map,this.kh=new Po,this.Mh={},this.Oh=new Map,this.Lh=so.fa(),this.onlineState="Unknown",this.Bh=void 0}return Object.defineProperty(t.prototype,"qh",{get:function(){return!0===this.Bh},enumerable:!1,configurable:!0}),t}();function Is(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o,s,a,u;return r.__generator(this,(function(r){switch(r.label){case 0:return n=Ys(t),(s=n.Ch.get(e))?(i=s.targetId,n.bh.Mi(i),o=s.view.gh(),[3,4]):[3,1];case 1:return[4,Co(n.Wu,Kn(e))];case 2:return a=r.sent(),u=n.bh.Mi(a.targetId),i=a.targetId,[4,Ts(n,e,i,"current"===u)];case 3:o=r.sent(),n.qh&&Qo(n.Vh,a),r.label=4;case 4:return[2,o]}}))}))}function Ts(t,e,n,i){return r.__awaiter(this,void 0,void 0,(function(){var o,s,a,u,c,h;return r.__generator(this,(function(l){switch(l.label){case 0:return t.Uh=function(e,n,i){return function(t,e,n,i){return r.__awaiter(this,void 0,void 0,(function(){var o,s,a;return r.__generator(this,(function(r){switch(r.label){case 0:return o=e.view.dh(n),o.Th?[4,Oo(t.Wu,e.query,!1).then((function(t){var n=t.documents;return e.view.dh(n,o)}))]:[3,2];case 1:o=r.sent(),r.label=2;case 2:return s=i&&i.Gt.get(e.targetId),a=e.view.gr(o,t.qh,s),[2,(Ls(t,e.targetId,a.Ah),a.snapshot)]}}))}))}(t,e,n,i)},[4,Oo(t.Wu,e,!0)];case 1:return o=l.sent(),s=new _s(e,o.Nc),a=s.dh(o.documents),u=Wt.Xt(n,i&&"Offline"!==t.onlineState),c=s.gr(a,t.qh,u),Ls(t,n,c.Ah),h=new bs(e,n,s),[2,(t.Ch.set(e,h),t.Nh.has(n)?t.Nh.get(n).push(e):t.Nh.set(n,[e]),c.snapshot)]}}))}))}function Cs(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o;return r.__generator(this,(function(r){switch(r.label){case 0:return n=w(t),i=n.Ch.get(e),(o=n.Nh.get(i.targetId)).length>1?[2,(n.Nh.set(i.targetId,o.filter((function(t){return!Xn(t,e)}))),void n.Ch.delete(e))]:n.qh?(n.bh.Li(i.targetId),n.bh.Ni(i.targetId)?[3,2]:[4,So(n.Wu,i.targetId,!1).then((function(){n.bh.qi(i.targetId),Yo(n.Vh,i.targetId),xs(n,i.targetId)})).catch(Ro)]):[3,3];case 1:r.sent(),r.label=2;case 2:return[3,5];case 3:return xs(n,i.targetId),[4,So(n.Wu,i.targetId,!0)];case 4:r.sent(),r.label=5;case 5:return[2]}}
2726))}))}function Ss(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i;return r.__generator(this,(function(r){switch(r.label){case 0:n=w(t),r.label=1;case 1:return r.trys.push([1,4,,6]),[4,Io(n.Wu,e)];case 2:return i=r.sent(),e.Gt.forEach((function(t,e){var r=n.xh.get(e);r&&(b(t.te.size+t.ee.size+t.ne.size<=1),t.te.size>0?r.yh=!0:t.ee.size>0?b(r.yh):t.ne.size>0&&(b(r.yh),r.yh=!1))})),[4,Fs(n,i,e)];case 3:return r.sent(),[3,6];case 4:return[4,Ro(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))}function Os(t,e,n){var r=w(t);if(r.qh&&0===n||!r.qh&&1===n){var i=[];r.Ch.forEach((function(t,n){var r=n.view.Us(e);r.snapshot&&i.push(r.snapshot)})),function(t,e){var n=w(t);n.onlineState=e;var r=!1;n.Ls.forEach((function(t,n){for(var i=0,o=n.listeners;i<o.length;i++)o[i].Us(e)&&(r=!0)})),r&&Vr(n)}(r.ph,e),i.length&&r.Dh.gu(i),r.onlineState=e,r.qh&&r.bh.ji(e)}}function Ns(t,e,n){return r.__awaiter(this,void 0,void 0,(function(){var i,o,s,a,u,c;return r.__generator(this,(function(r){switch(r.label){case 0:return(i=w(t)).bh.Ui(e,"rejected",n),o=i.xh.get(e),(s=o&&o.key)?(a=(a=new Tt(A.i)).rt(s,new Ln(s,ct.min())),u=jt().add(s),c=new Bt(ct.min(),new Map,new Ot($),a,u),[4,Ss(i,c)]):[3,2];case 1:return r.sent(),i.$h=i.$h.remove(s),i.xh.delete(e),Ms(i),[3,4];case 2:return[4,So(i.Wu,e,!1).then((function(){return xs(i,e,n)})).catch(Ro)];case 3:r.sent(),r.label=4;case 4:return[2]}}
2726))}))}function As(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o;return r.__generator(this,(function(r){switch(r.label){case 0:n=w(t),i=e.batch.batchId,r.label=1;case 1:return r.trys.push([1,4,,6]),[4,wo(n.Wu,e)];case 2:return o=r.sent(),Ps(n,i,null),Rs(n,i),n.bh.xi(i,"acknowledged"),[4,Fs(n,o)];case 3:return r.sent(),[3,6];case 4:return[4,Ro(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))}function ks(t,e,n){return r.__awaiter(this,void 0,void 0,(function(){var i,o;return r.__generator(this,(function(r){switch(r.label){case 0:i=w(t),r.label=1;case 1:return r.trys.push([1,4,,6]),[4,function(t,e){var n=w(t);return n.persistence.runTransaction("Reject batch","readwrite-primary",(function(t){var r;return n.vr.Mo(t,e).next((function(e){return b(null!==e),r=e.keys(),n.vr.Qo(t,e)})).next((function(){return n.vr.Go(t)})).next((function(){return n.Dc.$r(t,r)}))}))}(i.Wu,e)];case 2:return o=r.sent(),Ps(i,e,n),Rs(i,e),i.bh.xi(e,"rejected",n),[4,Fs(i,o)];case 3:return r.sent(),[3,6];case 4:return[4,Ro(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}
2726))}))}function Rs(t,e){(t.Oh.get(e)||[]).forEach((function(t){t.resolve()})),t.Oh.delete(e)}function Ps(t,e,n){var r=w(t),i=r.Mh[r.currentUser.Zs()];if(i){var o=i.get(e);o&&(n?o.reject(n):o.resolve(),i=i.remove(e)),r.Mh[r.currentUser.Zs()]=i}}function xs(t,e,n){void 0===n&&(n=null),t.bh.Li(e);for(var r=0,i=t.Nh.get(e);r<i.length;r++){var o=i[r];t.Ch.delete(o),n&&t.Dh.Qh(o,n)}t.Nh.delete(e),t.qh&&t.kh.qc(e).forEach((function(e){t.kh.zo(e)||Ds(t,e)}))}function Ds(t,e){var n=t.$h.get(e);null!==n&&(Yo(t.Vh,n),t.$h=t.$h.remove(e),t.xh.delete(n),Ms(t))}function Ls(t,e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r];o instanceof ys?(t.kh.Sa(o.key,e),js(t,o)):o instanceof ms?(v("SyncEngine","Document no longer in limbo: "+o.key),t.kh.Ca(o.key,e),t.kh.zo(o.key)||Ds(t,o.key)):_()}}function js(t,e){var n=e.key;t.$h.get(n)||(v("SyncEngine","New document in limbo: "+n),t.Fh.push(n),Ms(t))}function Ms(t){for(;t.Fh.length>0&&t.$h.size<t.Sh;){var e=t.Fh.shift(),n=t.Lh.next();t.xh.set(n,new ws(e)),t.$h=t.$h.rt(e,n),Qo(t.Vh,new bt(Kn(Un(e.path)),n,2,Wr.oi))}}function Fs(t,e,n){return r.__awaiter(this,void 0,void 0,(function(){var i,o,s,a;return r.__generator(this,(function(u){switch(u.label){case 0:return i=w(t),o=[],s=[],a=[],i.Ch.m()?[3,3]:(i.Ch.forEach((function(t,r){a.push(i.Uh(r,e,n).then((function(t){if(t){i.qh&&i.bh.Ui(r.targetId,t.fromCache?"not-current":"current"),o.push(t);var e=si.Gr(r.targetId,t);s.push(e)}})))})),[4,Promise.all(a)]);case 1:return u.sent(),i.Dh.gu(o),[4,function(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o,s,a,u,c,h,l;return r.__generator(this,(function(r){switch(r.label){case 0:n=w(t),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(function(t){return _r.forEach(e,(function(e){return _r.forEach(e.jr,(function(r){return n.persistence.Co.Sa(t,e.targetId,r)})).next((function(){return _r.forEach(e.Kr,(function(r){return n.persistence.Co.Ca(t,e.targetId,r)}))}))}))}))];case 2:return r.sent(),[3,4];case 3:if(!Ir(i=r.sent()))throw i;return v("LocalStore","Failed to update sequence numbers: "+i),[3,4];case 4:for(o=0,s=e;o<s.length;o++)a=s[o],u=a.targetId,a.fromCache||(c=n.Vc.get(u),h=c.et,l=c.it(h),n.Vc=n.Vc.rt(u,l));return[2]}}))}))}(i.Wu,s)];case 2:u.sent(),u.label=3;case 3:return[2]}}
2726))}))}function Us(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i;return r.__generator(this,(function(o){switch(o.label){case 0:return(n=w(t)).currentUser.isEqual(e)?[3,3]:(v("SyncEngine","User change. New user:",e.Zs()),[4,function(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o,s;return r.__generator(this,(function(r){switch(r.label){case 0:return n=w(t),i=n.vr,o=n.Dc,[4,n.persistence.runTransaction("Handle user change","readonly",(function(t){var r;return n.vr.qo(t).next((function(s){return r=s,i=n.persistence.wc(e),o=new oi(n.Sc,i,n.persistence.Ec()),i.qo(t)})).next((function(e){for(var n=[],i=[],s=jt(),a=0,u=r;a<u.length;a++){var c=u[a];n.push(c.batchId);for(var h=0,l=c.mutations;h<l.length;h++){var f=l[h];s=s.add(f.key)}}for(var p=0,d=e;p<d.length;p++){var v=d[p];i.push(v.batchId);for(var g=0,y=v.mutations;g<y.length;g++){var m=y[g];s=s.add(m.key)}}return o.$r(t,s).next((function(t){return{Wh:t,jh:n,Kh:i}}))}))}))];case 1:return s=r.sent(),[2,(n.vr=i,n.Dc=o,n.yc.Cc(n.Dc),s)]}}))}))}(n.Wu,e)]);case 1:return i=o.sent(),n.currentUser=e,function(t,e){t.Oh.forEach((function(t){t.forEach((function(t){t.reject(new f(l.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),t.Oh.clear()}(n),n.bh.Wi(e,i.jh,i.Kh),[4,Fs(n,i.Wh)];case 2:o.sent(),o.label=3;case 3:return[2]}}
2726))}))}function Vs(t,e){var n=w(t),r=n.xh.get(e);if(r&&r.yh)return jt().add(r.key);var i=jt(),o=n.Nh.get(e);if(!o)return i;for(var s=0,a=o;s<a.length;s++){var u=a[s],c=n.Ch.get(u);i=i.xt(c.view.fh)}return i}function qs(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,Oo((n=w(t)).Wu,e.query,!0)];case 1:return i=r.sent(),o=e.view.Ph(i),[2,(n.qh&&Ls(n,e.targetId,o.Ah),o)]}}))}))}function Bs(t,e,n,i){return r.__awaiter(this,void 0,void 0,(function(){var o,s;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,function(t,e){var n=w(t),r=w(n.vr);return n.persistence.runTransaction("Lookup mutation documents","readonly",(function(t){return r.Oo(t,e).next((function(e){return e?n.Dc.$r(t,e):_r.resolve(null)}))}))}((o=w(t)).Wu,e)];case 1:return null===(s=r.sent())?[3,6]:"pending"!==n?[3,3]:[4,as(o.Vh)];case 2:return r.sent(),[3,4];case 3:"acknowledged"===n||"rejected"===n?(Ps(o,e,i||null),Rs(o,e),function(t,e){w(w(t).vr).jo(e)}(o.Wu,e)):_(),r.label=4;case 4:return[4,Fs(o,s)];case 5:return r.sent(),[3,7];case 6:v("SyncEngine","Cannot apply mutation batch with id: "+e),r.label=7;case 7:return[2]}}
2726))}))}function Ws(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o,s,a,u,c,h;return r.__generator(this,(function(r){switch(r.label){case 0:return Ys(n=w(t)),Xs(n),!0!==e||!0===n.Bh?[3,3]:(i=n.bh.Di(),[4,Gs(n,i.A())]);case 1:return o=r.sent(),n.Bh=!0,[4,ds(n.Vh,!0)];case 2:for(r.sent(),s=0,a=o;s<a.length;s++)u=a[s],Qo(n.Vh,u);return[3,7];case 3:return!1!==e||!1===n.Bh?[3,7]:(c=[],h=Promise.resolve(),n.Nh.forEach((function(t,e){n.bh.Bi(e)?c.push(e):h=h.then((function(){return xs(n,e),So(n.Wu,e,!0)})),Yo(n.Vh,e)})),[4,h]);case 4:return r.sent(),[4,Gs(n,c)];case 5:return r.sent(),function(t){var e=w(t);e.xh.forEach((function(t,n){Yo(e.Vh,n)})),e.kh.Uc(),e.xh=new Map,e.$h=new Tt(A.i)}(n),n.Bh=!1,[4,ds(n.Vh,!1)];case 6:r.sent(),r.label=7;case 7:return[2]}}))}))}function Gs(t,e,n){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o,s,a,u,c,h,l,f,p,d,v,g;return r.__generator(this,(function(r){switch(r.label){case 0:n=w(t),i=[],o=[],s=0,a=e,r.label=1;case 1:return s<a.length?(u=a[s],c=void 0,(h=n.Nh.get(u))&&0!==h.length?[4,Co(n.Wu,Kn(h[0]))]:[3,7]):[3,13];case 2:c=r.sent(),l=0,f=h,r.label=3;case 3:return l<f.length?(p=f[l],d=n.Ch.get(p),[4,qs(n,d)]):[3,6];case 4:(v=r.sent()).snapshot&&o.push(v.snapshot),r.label=5;case 5:return l++,[3,3];case 6:return[3,11];case 7:return[4,No(n.Wu,u)];case 8:return g=r.sent(),[4,Co(n.Wu,g)];case 9:return c=r.sent(),[4,Ts(n,Hs(g),u,!1)];case 10:r.sent(),r.label=11;case 11:i.push(c),r.label=12;case 12:return s++,[3,1];case 13:return[2,(n.Dh.gu(o),i)]}}))}))}function Hs(t){return Fn(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function Ks(t){var e=w(t);return w(w(e.Wu).persistence).Vi()}function zs(t,e,n,i){return r.__awaiter(this,void 0,void 0,(function(){var o,s,a;return r.__generator(this,(function(r){switch(r.label){case 0:return(o=w(t)).Bh?(v("SyncEngine","Ignoring unexpected query state notification."),[3,8]):[3,1];case 1:if(!o.Nh.has(e))return[3,8];switch(n){case"current":case"not-current":return[3,2];case"rejected":return[3,5]}return[3,7];case 2:return[4,Ao(o.Wu)];case 3:return s=r.sent(),a=Bt.Jt(e,"current"===n),[4,Fs(o,s,a)];case 4:return r.sent(),[3,8];case 5:return[4,So(o.Wu,e,!0)];case 6:return r.sent(),xs(o,e,i),[3,8];case 7:_(),r.label=8;case 8:return[2]}}
2726))}))}function Qs(t,e,n){return r.__awaiter(this,void 0,void 0,(function(){var i,o,s,a,u,c,h,l,f,p;return r.__generator(this,(function(d){switch(d.label){case 0:if(!(i=Ys(t)).Bh)return[3,10];o=0,s=e,d.label=1;case 1:return o<s.length?(a=s[o],i.Nh.has(a)?(v("SyncEngine","Adding an already active target "+a),[3,5]):[4,No(i.Wu,a)]):[3,6];case 2:return u=d.sent(),[4,Co(i.Wu,u)];case 3:return c=d.sent(),[4,Ts(i,Hs(u),c.targetId,!1)];case 4:d.sent(),Qo(i.Vh,c),d.label=5;case 5:return o++,[3,1];case 6:h=function(t){return r.__generator(this,(function(e){switch(e.label){case 0:return i.Nh.has(t)?[4,So(i.Wu,t,!1).then((function(){Yo(i.Vh,t),xs(i,t)})).catch(Ro)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))},l=0,f=n,d.label=7;case 7:return l<f.length?(p=f[l],[5,h(p)]):[3,10];case 8:d.sent(),d.label=9;case 9:return l++,[3,7];case 10:return[2]}}))}))}function Ys(t){var e=w(t);return e.Vh.Ku.nh=Ss.bind(null,e),e.Vh.Ku.Be=Vs.bind(null,e),e.Vh.Ku.eh=Ns.bind(null,e),e.Dh.gu=Fr.bind(null,e.ph),e.Dh.Qh=Ur.bind(null,e.ph),e}function Xs(t){var e=w(t);return e.Vh.Ku.sh=As.bind(null,e),e.Vh.Ku.ih=ks.bind(null,e),e} 2727/** 2728 * @license 2729 * Copyright 2019 Google LLC 2730 * 2731 * Licensed under the Apache License, Version 2.0 (the "License"); 2732 * you may not use this file except in compliance with the License. 2733 * You may obtain a copy of the License at 2734 * 2735 * http://www.apache.org/licenses/LICENSE-2.0 2736 * 2737 * Unless required by applicable law or agreed to in writing, software 2738 * distributed under the License is distributed on an "AS IS" BASIS, 2739 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2740 * See the License for the specific language governing permissions and 2741 * limitations under the License. 2742 */var $s=function(){function t(){}return t.prototype.Cc=function(t){this.Gh=t},t.prototype.Or=function(t,e,n,r){var i=this;return function(t){return 0===t.filters.length&&null===t.limit&&null==t.startAt&&null==t.endAt&&(0===t.rn.length||1===t.rn.length&&t.rn[0].field.p())}(e)||n.isEqual(ct.min())?this.zh(t,e):this.Gh.$r(t,r).next((function(s){var a=i.Hh(e,s);return(Vn(e)||qn(e))&&i.Th(e.on,a,r,n)?i.zh(t,e):(d()<=o.LogLevel.DEBUG&&v("IndexFreeQueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),Jn(e)),i.Gh.Or(t,e,n).next((function(t){return a.forEach((function(e){t=t.rt(e.key,e)})),t})))}))},t.prototype.Hh=function(t,e){var n=new Ot(tr(t));return e.forEach((function(e,r){r instanceof Dn&&Zn(t,r)&&(n=n.add(r))})),n},t.prototype.Th=function(t,e,n,r){if(n.size!==e.size)return!0;var i="F"===t?e.last():e.first();return!!i&&(i.hasPendingWrites||i.version.L(r)>0)},t.prototype.zh=function(t,e){return d()<=o.LogLevel.DEBUG&&v("IndexFreeQueryEngine","Using full collection scan to execute query:",Jn(e)),this.Gh.Or(t,e,ct.min())},t}(),Js=function(){function t(t,e){this.Sr=t,this.Co=e,this.vr=[],this.Yh=1,this.Jh=new Ot(xo.xc)}return t.prototype.$o=function(t){return _r.resolve(0===this.vr.length)},t.prototype.xo=function(t,e,n,r){var i=this.Yh;this.Yh++,this.vr.length>0&&this.vr[this.vr.length-1];var o=new ti(i,e,n,r);this.vr.push(o);for(var s=0,a=r;s<a.length;s++){var u=a[s];this.Jh=this.Jh.add(new xo(u.key,i)),this.Sr.ko(t,u.key.path.h())}return _r.resolve(o)},t.prototype.Mo=function(t,e){return _r.resolve(this.Xh(e))},t.prototype.Lo=function(t,e){var n=e+1,r=this.Zh(n),i=r<0?0:r;return _r.resolve(this.vr.length>i?this.vr[i]:null)},t.prototype.Bo=function(){return _r.resolve(0===this.vr.length?-1:this.Yh-1)},t.prototype.qo=function(t){return _r.resolve(this.vr.slice())},t.prototype.Cr=function(t,e){var n=this,r=new xo(e,0),i=new xo(e,Number.POSITIVE_INFINITY),o=[];return this.Jh.Nt([r,i],(function(t){var e=n.Xh(t.Wc);o.push(e)})),_r.resolve(o)},t.prototype.Mr=function(t,e){var n=this,r=new Ot($);return e.forEach((function(t){var e=new xo(t,0),i=new xo(t,Number.POSITIVE_INFINITY);n.Jh.Nt([e,i],(function(t){r=r.add(t.Wc)}))})),_r.resolve(this.tl(r))},t.prototype.Qr=function(t,e){var n=e.path,r=n.length+1,i=n;A.F(i)||(i=i.child(""));var o=new xo(new A(i),0),s=new Ot($);return this.Jh.Ft((function(t){var e=t.key.path;return!!n.T(e)&&(e.length===r&&(s=s.add(t.Wc)),!0)}),o),_r.resolve(this.tl(s))},t.prototype.tl=function(t){var e=this,n=[];return t.forEach((function(t){var r=e.Xh(t);null!==r&&n.push(r)})),n},t.prototype.Qo=function(t,e){var n=this;b(0===this.el(e.batchId,"removed")),this.vr.shift();var r=this.Jh;return _r.forEach(e.mutations,(function(i){var o=new xo(i.key,e.batchId);return r=r.delete(o),n.Co.Ko(t,i.key)})).next((function(){n.Jh=r}))},t.prototype.jo=function(t){},t.prototype.zo=function(t,e){var n=new xo(e,0),r=this.Jh.$t(n);return _r.resolve(e.isEqual(r&&r.key))},t.prototype.Go=function(t){return this.vr.length,_r.resolve()},t.prototype.el=function(t,e){return this.Zh(t)},t.prototype.Zh=function(t){return 0===this.vr.length?0:t-this.vr[0].batchId},t.prototype.Xh=function(t){var e=this.Zh(t);return e<0||e>=this.vr.length?null:this.vr[e]},t}(),Zs=function(){function t(t,e){this.Sr=t,this.nl=e,this.docs=new Tt(A.i),this.size=0}return t.prototype.Tr=function(t,e,n){var r=e.key,i=this.docs.get(r),o=i?i.size:0,s=this.nl(e);return this.docs=this.docs.rt(r,{Zo:e,size:s,readTime:n}),this.size+=s-o,this.Sr.ko(t,r.path.h())},t.prototype.Ir=function(t){var e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)},t.prototype.Ar=function(t,e){var n=this.docs.get(e);return _r.resolve(n?n.Zo:null)},t.prototype.getEntries=function(t,e){var n=this,r=Rt();return e.forEach((function(t){var e=n.docs.get(t);r=r.rt(t,e?e.Zo:null)})),_r.resolve(r)},t.prototype.Or=function(t,e,n){for(var r=xt(),i=new A(e.path.child("")),o=this.docs._t(i);o.It();){var s=o.Et(),a=s.key,u=s.value,c=u.Zo,h=u.readTime;if(!e.path.T(a.path))break;h.L(n)<=0||c instanceof Dn&&Zn(e,c)&&(r=r.rt(c.key,c))}return _r.resolve(r)},t.prototype.sl=function(t,e){return _r.forEach(this.docs,(function(t){return e(t)}))},t.prototype.ia=function(t){return new ta(this)},t.prototype.oa=function(t){return _r.resolve(this.size)},t}(),ta=function(t){function e(e){var n=this;return(n=t.call(this)||this).aa=e,n}return r.__extends(e,t),e.prototype.gr=function(t){var e=this,n=[];return this.dr.forEach((function(r,i){i?n.push(e.aa.Tr(t,i,e.readTime)):e.aa.Ir(r)})),_r.$n(n)},e.prototype.Rr=function(t,e){return this.aa.Ar(t,e)},e.prototype.Pr=function(t,e){return this.aa.getEntries(t,e)},e}(ni),ea=function(){function t(t){this.persistence=t,this.il=new at((function(t){return vt(t)}),gt),this.lastRemoteSnapshotVersion=ct.min(),this.highestTargetId=0,this.rl=0,this.ol=new Po,this.targetCount=0,this.al=so._a()}return t.prototype.De=function(t,e){return this.il.forEach((function(t,n){return e(n)})),_r.resolve()},t.prototype.Ta=function(t){return _r.resolve(this.lastRemoteSnapshotVersion)},t.prototype.Ea=function(t){return _r.resolve(this.rl)},t.prototype.da=function(t){return this.highestTargetId=this.al.next(),_r.resolve(this.highestTargetId)},t.prototype.Ia=function(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.rl&&(this.rl=e),_r.resolve()},t.prototype.Ra=function(t){this.il.set(t.target,t);var e=t.targetId;e>this.highestTargetId&&(this.al=new so(e),this.highestTargetId=e),t.sequenceNumber>this.rl&&(this.rl=t.sequenceNumber)},t.prototype.Aa=function(t,e){return this.Ra(e),this.targetCount+=1,_r.resolve()},t.prototype.ga=function(t,e){return this.Ra(e),_r.resolve()},t.prototype.ya=function(t,e){return this.il.delete(e.target),this.ol.qc(e.targetId),this.targetCount-=1,_r.resolve()},t.prototype.Vo=function(t,e,n){var r=this,i=0,o=[];return this.il.forEach((function(s,a){a.sequenceNumber<=e&&null===n.get(a.targetId)&&(r.il.delete(s),o.push(r.Va(t,a.targetId)),i++)})),_r.$n(o).next((function(){return i}))},t.prototype.pa=function(t){return _r.resolve(this.targetCount)},t.prototype.ba=function(t,e){var n=this.il.get(e)||null;return _r.resolve(n)},t.prototype.va=function(t,e,n){return this.ol.Oc(e,n),_r.resolve()},t.prototype.Da=function(t,e,n){this.ol.Bc(e,n);var r=this.persistence.Co,i=[];return r&&e.forEach((function(e){i.push(r.Ko(t,e))})),_r.$n(i)},t.prototype.Va=function(t,e){return this.ol.qc(e),_r.resolve()},t.prototype.Na=function(t,e){var n=this.ol.Qc(e);return _r.resolve(n)},t.prototype.zo=function(t,e){return _r.resolve(this.ol.zo(e))},t}(),na=function(){function t(t){var e=this;this.cl={},this.ka=new Wr(0),this.Ma=!1,this.Ma=!0,this.Co=t(this),this.ja=new ea(this),this.Sr=new Ui,this.br=function(t,n){return new Zs(t,(function(t){return e.Co.ul(t)}))}(this.Sr)}return t.prototype.start=function(){return Promise.resolve()},t.prototype.Si=function(){return this.Ma=!1,Promise.resolve()},Object.defineProperty(t.prototype,"Ti",{get:function(){return this.Ma}
2742,enumerable:!1,configurable:!0}),t.prototype.Xa=function(){},t.prototype.Za=function(){},t.prototype.Ec=function(){return this.Sr},t.prototype.wc=function(t){var e=this.cl[t.Zs()];return e||(e=new Js(this.Sr,this.Co),this.cl[t.Zs()]=e),e},t.prototype.mc=function(){return this.ja},t.prototype.Tc=function(){return this.br},t.prototype.runTransaction=function(t,e,n){var r=this;v("MemoryPersistence","Starting transaction:",t);var i=new ra(this.ka.next());return this.Co.hl(),n(i).next((function(t){return r.Co.ll(i).next((function(){return t}))})).Nn().then((function(t){return i.pr(),t}))},t.prototype._l=function(t,e){return _r.xn(Object.values(this.cl).map((function(n){return function(){return n.zo(t,e)}})))},t}(),ra=function(t){function e(e){var n=this;return(n=t.call(this)||this).Fa=e,n}return r.__extends(e,t),e}(ii),ia=function(){function t(t){this.persistence=t,this.fl=new Po,this.dl=null}return t.wl=function(e){return new t(e)},Object.defineProperty(t.prototype,"ml",{get:function(){if(this.dl)return this.dl;throw _()},enumerable:!1,configurable:!0}),t.prototype.Sa=function(t,e,n){return this.fl.Sa(n,e),this.ml.delete(n.toString()),_r.resolve()},t.prototype.Ca=function(t,e,n){return this.fl.Ca(n,e),this.ml.add(n.toString()),_r.resolve()},t.prototype.Ko=function(t,e){return this.ml.add(e.toString()),_r.resolve()},t.prototype.removeTarget=function(t,e){var n=this;this.fl.qc(e.targetId).forEach((function(t){return n.ml.add(t.toString())}));var r=this.persistence.mc();return r.Na(t,e.targetId).next((function(t){t.forEach((function(t){return n.ml.add(t.toString())}))})).next((function(){return r.ya(t,e)}))},t.prototype.hl=function(){this.dl=new Set},t.prototype.ll=function(t){var e=this,n=this.persistence.Tc().ia();return _r.forEach(this.ml,(function(r){var i=A.D(r);return e.Tl(t,i).next((function(t){t||n.Ir(i)}))})).next((function(){return e.dl=null,n.apply(t)}))},t.prototype.gc=function(t,e){var n=this;return this.Tl(t,e).next((function(t){t?n.ml.delete(e.toString()):n.ml.add(e.toString())}))},t.prototype.ul=function(t){return 0},t.prototype.Tl=function(t,e){var n=this;return _r.xn([function(){return _r.resolve(n.fl.zo(e))},function(){return n.persistence.mc().zo(t,e)},function(){return n.persistence._l(t,e)}])},t}(),oa=function(){function t(t){this.El=t.El,this.Il=t.Il}return t.prototype.Ru=function(t){this.Al=t},t.prototype.mu=function(t){this.Rl=t},t.prototype.onMessage=function(t){this.Pl=t},t.prototype.close=function(){this.Il()},t.prototype.send=function(t){this.El(t)},t.prototype.gl=function(){this.Al()},t.prototype.yl=function(t){this.Rl(t)},t.prototype.Vl=function(t){this.Pl(t)},t}(),sa={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"},aa=function(t){function e(e){var n=this;return(n=t.call(this,e)||this).forceLongPolling=e.forceLongPolling,n}return r.__extends(e,t),e.prototype.Cl=function(t,e,n,r){return new Promise((function(i,o){var s=new a.XhrIo;s.listenOnce(a.EventType.COMPLETE,(function(){try{switch(s.getLastErrorCode()){case a.ErrorCode.NO_ERROR:var e=s.getResponseJson();v("Connection","XHR received:",JSON.stringify(e)),i(e);break;case a.ErrorCode.TIMEOUT:v("Connection",'RPC "'+t+'" timed out'),o(new f(l.DEADLINE_EXCEEDED,"Request time out"));break;case a.ErrorCode.HTTP_ERROR:var n=s.getStatus();if(v("Connection",'RPC "'+t+'" failed with status:',n,"response text:",s.getResponseText()),n>0){var r=s.getResponseJson().error;if(r&&r.status&&r.message){var u=function(t){var e=t.toLowerCase().replace("_","-");return Object.values(l).indexOf(e)>=0?e:l.UNKNOWN}(r.status);o(new f(u,r.message))}else o(new f(l.UNKNOWN,"Server responded with status "+s.getStatus()))}else o(new f(l.UNAVAILABLE,"Connection failed."));break;default:_()}}finally{v("Connection",'RPC "'+t+'" completed.')}}));var u=JSON.stringify(r);s.send(e,"POST",u,n,15)}))},e.prototype.Pu=function(t,e){var n=[this.bl,"/","google.firestore.v1.Firestore","/",t,"/channel"],r=a.createWebChannelTransport(),i={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.U.projectId+"/databases/"+this.U.database}
2742,sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling};this.Dl(i.initMessageHeaders,e),s.isMobileCordova()||s.isReactNative()||s.isElectron()||s.isIE()||s.isUWP()||s.isBrowserExtension()||(i.httpHeadersOverwriteParam="$httpHeaders");var o=n.join("");v("Connection","Creating WebChannel: "+o,i);var u=r.createWebChannel(o,i),c=!1,h=!1,p=new oa({El:function(t){h?v("Connection","Not sending because WebChannel is closed:",t):(c||(v("Connection","Opening WebChannel transport."),u.open(),c=!0),v("Connection","WebChannel sending:",t),u.send(t))},Il:function(){return u.close()}}),d=function(t,e){u.listen(t,(function(t){try{e(t)}catch(t){setTimeout((function(){throw t}),0)}}))};return d(a.WebChannel.EventType.OPEN,(function(){h||v("Connection","WebChannel transport opened.")})),d(a.WebChannel.EventType.CLOSE,(function(){h||(h=!0,v("Connection","WebChannel transport closed"),p.yl())})),d(a.WebChannel.EventType.ERROR,(function(t){h||(h=!0,y("Connection","WebChannel transport errored:",t),p.yl(new f(l.UNAVAILABLE,"The operation could not be completed")))})),d(a.WebChannel.EventType.MESSAGE,(function(t){var e;if(!h){var n=t.data[0];b(!!n);var r=n,i=r.error||(null===(e=r[0])||void 0===e?void 0:e.error);if(i){v("Connection","WebChannel received error:",i);var o=i.status,s=function(t){var e=mt[t];if(void 0!==e)return It(e)}(o),a=i.message;void 0===s&&(s=l.INTERNAL,a="Unknown error status: "+o+" with message "+i.message),h=!0,p.yl(new f(s,a)),u.close()}else v("Connection","WebChannel received:",n),p.Vl(n)}})),setTimeout((function(){p.gl()}),0),p},e}(function(){function t(t){this.pl=t,this.U=t.U;var e=t.ssl?"https":"http";this.bl=e+"://"+t.host,this.vl="projects/"+this.U.projectId+"/databases/"+this.U.database+"/documents"}return t.prototype.$u=function(t,e,n,r){var i=this.Sl(t,e);v("RestConnection","Sending: ",i,n);var o={};return this.Dl(o,r),this.Cl(t,i,o,n).then((function(t){return v("RestConnection","Received: ",t),t}),(function(e){throw y("RestConnection",t+" failed with error: ",e,"url: ",i,"request:",n),e}))},t.prototype.xu=function(t,e,n,r){return this.$u(t,e,n,r)},t.prototype.Dl=function(t,e){if(t["X-Goog-Api-Client"]="gl-js/ fire/7.23.0",t["Content-Type"]="text/plain",e)for(var n in e.jc)e.jc.hasOwnProperty(n)&&(t[n]=e.jc[n])},t.prototype.Sl=function(t,e){var n=sa[t];return this.bl+"/v1/"+e+":"+n},t}()),ua=function(){function t(){var t=this;this.Nl=function(){return t.Fl()},this.$l=function(){return t.xl()},this.kl=[],this.Ml()}return t.prototype.Xu=function(t){this.kl.push(t)},t.prototype.Si=function(){window.removeEventListener("online",this.Nl),window.removeEventListener("offline",this.$l)},t.prototype.Ml=function(){window.addEventListener("online",this.Nl),window.addEventListener("offline",this.$l)},t.prototype.Fl=function(){v("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(var t=0,e=this.kl;t<e.length;t++)(0,e[t])(0)},t.prototype.xl=function(){v("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(var t=0,e=this.kl;t<e.length;t++)(0,e[t])(1)},t.On=function(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener},t}(),ca=function(){function t(){}return t.prototype.Xu=function(t){},t.prototype.Si=function(){},t}(); 2743/** 2744 * @license 2745 * Copyright 2017 Google LLC 2746 * 2747 * Licensed under the Apache License, Version 2.0 (the "License"); 2748 * you may not use this file except in compliance with the License. 2749 * You may obtain a copy of the License at 2750 * 2751 * http://www.apache.org/licenses/LICENSE-2.0 2752 * 2753 * Unless required by applicable law or agreed to in writing, software 2754 * distributed under the License is distributed on an "AS IS" BASIS, 2755 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2756 * See the License for the specific language governing permissions and 2757 * limitations under the License. 2758 */ 2759/** 2760 * @license 2761 * Copyright 2020 Google LLC 2762 * 2763 * Licensed under the Apache License, Version 2.0 (the "License"); 2764 * you may not use this file except in compliance with the License. 2765 * You may obtain a copy of the License at 2766 * 2767 * http://www.apache.org/licenses/LICENSE-2.0 2768 * 2769 * Unless required by applicable law or agreed to in writing, softw
2769are 2770 * distributed under the License is distributed on an "AS IS" BASIS, 2771 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2772 * See the License for the specific language governing permissions and 2773 * limitations under the License. 2774 */ 2775/** 2776 * @license 2777 * Copyright 2020 Google LLC 2778 * 2779 * Licensed under the Apache License, Version 2.0 (the "License"); 2780 * you may not use this file except in compliance with the License. 2781 * You may obtain a copy of the License at 2782 * 2783 * http://www.apache.org/licenses/LICENSE-2.0 2784 * 2785 * Unless required by applicable law or agreed to in writing, software 2786 * distributed under the License is distributed on an "AS IS" BASIS, 2787 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2788 * See the License for the specific language governing permissions and 2789 * limitations under the License. 2790 */function ha(t){return new _e(t,!0)} 2791/** 2792 * @license 2793 * Copyright 2020 Google LLC 2794 * 2795 * Licensed under the Apache License, Version 2.0 (the "License"); 2796 * you may not use this file except in compliance with the License. 2797 * You may obtain a copy of the License at 2798 * 2799 * http://www.apache.org/licenses/LICENSE-2.0 2800 * 2801 * Unless required by applicable law or agreed to in writing, software 2802 * distributed under the License is distributed on an "AS IS" BASIS, 2803 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2804 * See the License for the specific language governing permissions and 2805 * limitations under the License. 2806 */var la="You are using the memory-only build of Firestore. Persistence support is only available via the @firebase/firestore bundle or the firebase-firestore.js build.",fa=function(){function t(){}return t.prototype.initialize=function(t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){switch(e.label){case 0:return this.bh=this.Ol(t),this.persistence=this.Ll(t),[4,this.persistence.start()];case 1:return e.sent(),this.Bl=this.ql(t),this.Wu=this.Ul(t),[2]}}))}))},t.prototype.ql=function(t){return null},t.prototype.Ul=function(t){return e=this.persistence,n=new $s,r=t.Ql,new bo(e,n,r);var e,n,r},t.prototype.Ll=function(t){if(t.persistenceSettings.Wl)throw new f(l.FAILED_PRECONDITION,la);return new na(ia.wl)},t.prototype.Ol=function(t){return new Zr},t.prototype.terminate=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return this.Bl&&this.Bl.stop(),[4,this.bh.Si()];case 1:return t.sent(),[4,this.persistence.Si()];case 2:return t.sent(),[2]}}))}))},t.prototype.clearPersistence=function(t,e){throw new f(l.FAILED_PRECONDITION,la)},t}(),pa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.initialize=function(e){return r.__awaiter(this,void 0,void 0,(function(){var n,i=this;return r.__generator(this,(function(o){switch(o.label){case 0:return[4,t.prototype.initialize.call(this,e)];case 1:return o.sent(),n=this.jl._i,this.bh instanceof Jr?(this.bh._i={tr:Bs.bind(null,n),er:zs.bind(null,n),nr:Qs.bind(null,n),Vi:Ks.bind(null,n)},[4,this.bh.start()]):[3,3];case 2:o.sent(),o.label=3;case 3:return[4,this.persistence.Ja((function(t){return r.__awaiter(i,void 0,void 0,(function(){return r.__generator(this,(function(e){switch(e.label){case 0:return[4,Ws(this.jl._i,t)];case 1:return e.sent(),this.Bl&&(t&&!this.Bl.Ti?this.Bl.start(this.Wu):t||this.Bl.stop()),[2]}}))}))}))];case 4:return o.sent(),[2]}}))}))},e.prototype.Ol=function(t){if(t.persistenceSettings.Wl&&t.persistenceSettings.synchronizeTabs){var e=Ar();if(!Jr.On(e))throw new f(l.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var n=_o(t.pl.U,t.pl.persistenceKey);return new Jr(e,t.os,n,t.clientId,t.Ql)}return new Zr},e}(function(t){function e(e){var n=this;return(n=t.call(this)||this).jl=e,n}return r.__extends(e,t),e.prototype.initialize=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.initialize.call(this,e)];case 1:return n.sent(),[4,ko(this.Wu)];case 2:return n.sent(),[4,this.jl.initialize(this,e)];case 3:return n.sent(),[4,Xs(this.jl._i)];case 4:return n.sent(),[4,as(this.jl.Vh)];case 5:return n.sent(),[2]}}))}))},e.prototype.ql=function(t){var e=this.persistence.Co.do;return new li(e,t.os)},e.prototype.Ll=function(t){var e=_o(t.pl.U,t.pl.persistenceKey),n=ha(t.pl.U);return new po(t.persistenceSettings.synchronizeTabs,e,t.clientId,hi.oo(t.persistenceSettings.cacheSizeBytes),t.os,Ar(),kr(),n,this.bh,t.persistenceSettings.xa)},e.prototype.Ol=function(t){return new Zr},e.prototype.clearPersistence=function(t,e){return function(t){return r.__awaiter(this,void 0,void 0,(function(){var e;return r.__generator(this,(function(n){switch(n.label){case 0:return br.On()?(e=t+"main",[4,br.delete(e)]):[2,Promise.resolve()];case 1:return n.sent(),[2]}}))}))}(_o(t,e))},e}(fa)),da=function(){function t(){}return t.prototype.initialize=function(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n=this;return r.__generator(this,(function(r){switch(r.label){case 0:return this.Wu?[3,2]:(this.Wu=t.Wu,this.bh=t.bh,this.ju=this.Kl(e),this.Vh=this.Gl(e),this.ph=this.zl(e),this._i=this.Hl(e),this.bh.fi=function(t){return Os(n._i,t,1)},this.Vh.Ku.Yl=Us.bind(null,this._i),[4,ds(this.Vh,this._i.qh)]);case 1:r.sent(),r.label=2;case 2:return[2]}}
2806))}))},t.prototype.zl=function(t){return new Lr},t.prototype.Kl=function(t){var e,n=ha(t.pl.U),r=(e=t.pl,new aa(e));return function(t,e,n){return new Bo(t,e,n)}(t.credentials,r,n)},t.prototype.Gl=function(t){var e,n,r,i,o,s=this;return e=this.Wu,n=this.ju,r=t.os,i=function(t){return Os(s._i,t,0)},o=ua.On()?new ua:new ca,new Go(e,n,r,i,o)},t.prototype.Hl=function(t){return function(t,e,n,r,i,o,s){var a=new Es(t,e,n,r,i,o);return s&&(a.Bh=!0),a}(this.Wu,this.Vh,this.ph,this.bh,t.Ql,t.Sh,!t.persistenceSettings.Wl||!t.persistenceSettings.synchronizeTabs)},t.prototype.terminate=function(){return zo(this.Vh)},t}(),va=function(){function t(t){this.observer=t,this.muted=!1}return t.prototype.next=function(t){this.observer.next&&this.Jl(this.observer.next,t)},t.prototype.error=function(t){this.observer.error?this.Jl(this.observer.error,t):console.error("Uncaught Error in snapshot listener:",t)},t.prototype.Xl=function(){this.muted=!0},t.prototype.Jl=function(t,e){var n=this;this.muted||setTimeout((function(){n.muted||t(e)}),0)},t}(),ga=function(t){!function(t,e,n,r){if(!(e instanceof Array)||e.length<1)throw new f(l.INVALID_ARGUMENT,"Function FieldPath() requires its fieldNames argument to be an array with at least "+Q(1,"element")+".")}(0,t);for(var e=0;e<t.length;++e)if(D("FieldPath","string",e,t[e]),0===t[e].length)throw new f(l.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this.Zl=new N(t)},ya=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.call(this,e)||this}return r.__extends(e,t),e.documentId=function(){return new e(N.v().R())},e.prototype.isEqual=function(t){if(!(t instanceof e))throw H("isEqual","FieldPath",1,t);return this.Zl.isEqual(t.Zl)},e}(ga),ma=new RegExp("[~\\*/\\[\\]]"),_a=function(t){this.t_=t},ba=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.e_=function(t){if(2!==t.n_)throw 1===t.n_?t.s_(this.t_+"() can only appear at the top level of your update data"):t.s_(this.t_+"() cannot be used with set() unless you pass {merge:true}");return t.Qe.push(t.path),null},e.prototype.isEqual=function(t){return t instanceof e},e}(_a);function wa(t,e,n){return new xa({n_:3,i_:e.settings.i_,methodName:t.t_,r_:n},e.U,e.serializer,e.ignoreUndefinedProperties)}var Ea=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.e_=function(t){return new fn(t.path,new nn)},e.prototype.isEqual=function(t){return t instanceof e},e}(_a),Ia=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).o_=n,r}return r.__extends(e,t),e.prototype.e_=function(t){var e=wa(this,t,!0),n=this.o_.map((function(t){return Ua(t,e)})),r=new rn(n);return new fn(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(_a),Ta=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).o_=n,r}return r.__extends(e,t),e.prototype.e_=function(t){var e=wa(this,t,!0),n=this.o_.map((function(t){return Ua(t,e)})),r=new sn(n);return new fn(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(_a),Ca=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).a_=n,r}return r.__extends(e,t),e.prototype.e_=function(t){var e=new un(t.serializer,Ee(t.serializer,this.a_));return new fn(t.path,e)},e.prototype.isEqual=function(t){return this===t},e}(_a),Sa=function(){function t(t,e){if(R("GeoPoint",arguments,2),D("GeoPoint","number",1,t),D("GeoPoint","number",2,e),!isFinite(t)||t<-90||t>90)throw new f(l.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new f(l.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this.c_=t,this.u_=e}return Object.defineProperty(t.prototype,"latitude",{get:function(){return this.c_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"longitude",{get:function(){return this.u_},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this.c_===t.c_&&this.u_===t.u_},t.prototype.toJSON=function(){return{latitude:this.c_,longitude:this.u_}},t.prototype.H=function(t){return $(this.c_,t.c_)||$(this.u_,t.u_)},t}(),Oa=function(t){this.h_=t},Na=/^__.*__$/,Aa=function(t,e,n){this.l_=t,this.__=e,this.f_=n},ka=function(){function t(t,e,n){this.data=t,this.Qe=e,this.fieldTransforms=n}return t.prototype.d_=function(t,e){var n=[];return null!==this.Qe?n.push(new In(t,this.data,this.Qe,e)):n.push(new En(t,this.data,e)),this.fieldTransforms.length>0&&n.push(new Cn(t,this.fieldTransforms)),n},t}(),Ra=function(){function t(t,e,n){this.data=t,this.Qe=e,this.fieldTransforms=n}return t.prototype.d_=function(t,e){var n=[new In(t,this.data,this.Qe,e)];return this.fieldTransforms.length>0&&n.push(new Cn(t,this.fieldTransforms)),n},t}();function Pa(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw _()}}var xa=function(){function t(t,e,n,r,i,o){this.settings=t,this.U=e,this.serializer
2806=n,this.ignoreUndefinedProperties=r,void 0===i&&this.w_(),this.fieldTransforms=i||[],this.Qe=o||[]}return Object.defineProperty(t.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"n_",{get:function(){return this.settings.n_},enumerable:!1,configurable:!0}),t.prototype.m_=function(e){return new t(Object.assign(Object.assign({},this.settings),e),this.U,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.Qe)},t.prototype.T_=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.m_({path:n,r_:!1});return r.E_(t),r},t.prototype.I_=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.m_({path:n,r_:!1});return r.w_(),r},t.prototype.A_=function(t){return this.m_({path:void 0,r_:!0})},t.prototype.s_=function(t){return Ha(t,this.settings.methodName,this.settings.R_||!1,this.path,this.settings.i_)},t.prototype.contains=function(t){return void 0!==this.Qe.find((function(e){return t.T(e)}))||void 0!==this.fieldTransforms.find((function(e){return t.T(e.field)}))},t.prototype.w_=function(){if(this.path)for(var t=0;t<this.path.length;t++)this.E_(this.path.get(t))},t.prototype.E_=function(t){if(0===t.length)throw this.s_("Document fields must not be empty");if(Pa(this.n_)&&Na.test(t))throw this.s_('Document fields cannot begin and end with "__"')},t}(),Da=function(){function t(t,e,n){this.U=t,this.ignoreUndefinedProperties=e,this.serializer=n||ha(t)}return t.prototype.P_=function(t,e,n,r){return void 0===r&&(r=!1),new xa({n_:t,methodName:e,i_:n,path:N.g(),r_:!1,R_:r},this.U,this.serializer,this.ignoreUndefinedProperties)},t}();function La(t,e,n,r,i,o){void 0===o&&(o={});var s=t.P_(o.merge||o.mergeFields?2:0,e,n,i);Ba("Data must be an object, but it was:",s,r);var a,u,c=Va(r,s);if(o.merge)a=new ln(s.Qe),u=s.fieldTransforms;else if(o.mergeFields){for(var h=[],p=0,d=o.mergeFields;p<d.length;p++){var v=d[p],g=void 0;if(v instanceof ga)g=v.Zl;else{if("string"!=typeof v)throw _();g=Ga(e,v,n)}if(!s.contains(g))throw new f(l.INVALID_ARGUMENT,"Field '"+g+"' is specified in your field mask but missing from your input data.");Ka(h,g)||h.push(g)}a=new ln(h),u=s.fieldTransforms.filter((function(t){return a.He(t.field)}))}else a=null,u=s.fieldTransforms;return new ka(new kn(c),a,u)}function ja(t,e,n,r){var i=t.P_(1,e,n);Ba("Data must be an object, but it was:",i,r);var o=[],s=new Rn;I(r,(function(t,r){var a=Ga(e,t,n),u=i.I_(a);if(r instanceof ba||r instanceof Oa&&r.h_ instanceof ba)o.push(a);else{var c=Ua(r,u);null!=c&&(o.push(a),s.set(a,c))}}));var a=new ln(o);return new Ra(s.Je(),a,i.fieldTransforms)}function Ma(t,e,n,r,i,o){var s=t.P_(1,e,n),a=[Wa(e,r,n)],u=[i];if(o.length%2!=0)throw new f(l.INVALID_ARGUMENT,"Function "+e+"() needs to be called with an even number of arguments that alternate between field names and values.");for(var c=0;c<o.length;c+=2)a.push(Wa(e,o[c])),u.push(o[c+1]);for(var h=[],p=new Rn,d=a.length-1;d>=0;--d)if(!Ka(h,a[d])){var v=a[d],g=u[d],y=s.I_(v);if(g instanceof ba||g instanceof Oa&&g.h_ instanceof ba)h.push(v);else{var m=Ua(g,y);null!=m&&(h.push(v),p.set(v,m))}}var _=new ln(h);return new Ra(p.Je(),_,s.fieldTransforms)}function Fa(t,e,n,r){return void 0===r&&(r=!1),Ua(n,t.P_(r?4:3,e))}function Ua(t,e){if(t instanceof Oa&&(t=t.h_),qa(t))return Ba("Unsupported field value:",e,t),Va(t,e);if(t instanceof _a)return function(t,e){if(!Pa(e.n_))throw e.s_(t.t_+"() can only be used with update() and set()");if(!e.path)throw e.s_(t.t_+"() is not currently supported inside arrays");var n=t.e_(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(e.path&&e.Qe.push(e.path),t instanceof Array){if(e.settings.r_&&4!==e.n_)throw e.s_("Nested arrays are not supported");return function(t,e){for(var n=[],r=0,i=0,o=t;i<o.length;i++){var s=Ua(o[i],e.A_(r));null==s&&(s={nullValue:"NULL_VALUE"}),n.push(s),r++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(null===t)return{nullValue:"NULL_VALUE"};if("number"==typeof t)return Ee(e.serializer,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){var n=ut.fromDate(t);return{timestampValue:Ie(e.serializer,n)}}
2806if(t instanceof ut){var r=new ut(t.seconds,1e3*Math.floor(t.nanoseconds/1e3));return{timestampValue:Ie(e.serializer,r)}}if(t instanceof Sa)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof et)return{bytesValue:Te(e.serializer,t.q)};if(t instanceof Aa){var i=e.U,o=t.l_;if(!o.isEqual(i))throw e.s_("Document reference is for database "+o.projectId+"/"+o.database+" but should be for database "+i.projectId+"/"+i.database);return{referenceValue:Oe(t.l_||e.U,t.__.path)}}if(void 0===t&&e.ignoreUndefinedProperties)return null;throw e.s_("Unsupported field value: "+B(t))}(t,e)}function Va(t,e){var n={};return T(t)?e.path&&e.path.length>0&&e.Qe.push(e.path):I(t,(function(t,r){var i=Ua(r,e.T_(t));null!=i&&(n[t]=i)})),{mapValue:{fields:n}}}function qa(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof ut||t instanceof Sa||t instanceof et||t instanceof Aa||t instanceof _a)}function Ba(t,e,n){if(!qa(n)||!q(n)){var r=B(n);throw"an object"===r?e.s_(t+" a custom object"):e.s_(t+" "+r)}}function Wa(t,e,n){if(e instanceof ga)return e.Zl;if("string"==typeof e)return Ga(t,e);throw Ha("Field path arguments must be of type string or FieldPath.",t,!1,void 0,n)}function Ga(t,e,n){try{return function(t){if(t.search(ma)>=0)throw new f(l.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not contain '~', '*', '/', '[', or ']'");try{return new(ya.bind.apply(ya,r.__spreadArrays([void 0],t.split("."))))}catch(r){throw new f(l.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'")}}(e).Zl}catch(e){throw Ha((i=e)instanceof Error?i.message:i.toString(),t,!1,void 0,n)}var i}function Ha(t,e,n,r,i){var o=r&&!r.m(),s=void 0!==i,a="Function "+e+"() called with invalid data";n&&(a+=" (via `toFirestore()`)");var u="";return(o||s)&&(u+=" (found",o&&(u+=" in field "+r),s&&(u+=" in document "+i),u+=")"),new f(l.INVALID_ARGUMENT,(a+=". ")+t+u)}function Ka(t,e){return t.some((function(t){return t.isEqual(e)}))} 2807/** 2808 * @license 2809 * Copyright 2017 Google LLC 2810 * 2811 * Licensed under the Apache License, Version 2.0 (the "License"); 2812 * you may not use this file except in compliance with the License. 2813 * You may obtain a copy of the License at 2814 * 2815 * http://www.apache.org/licenses/LICENSE-2.0 2816 * 2817 * Unless required by applicable law or agreed to in writing, software 2818 * distributed under the License is distributed on an "AS IS" BASIS, 2819 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2820 * See the License for the specific language governing permissions and 2821 * limitations under the License. 2822 */var za=function(){function t(t){this.ju=t,this.g_=new Map,this.mutations=[],this.y_=!1,this.V_=null,this.p_=new Set}return t.prototype.b_=function(t){return r.__awaiter(this,void 0,void 0,(function(){var e,n=this;return r.__generator(this,(function(i){switch(i.label){case 0:if(this.v_(),this.mutations.length>0)throw new f(l.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");return[4,function(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o,s,a,u;return r.__generator(this,(function(r){switch(r.label){case 0:return n=w(t),i=xe(n.serializer)+"/documents",o={documents:e.map((function(t){return Ae(n.serializer,t)}))},[4,n.xu("BatchGetDocuments",i,o)];
2822case 1:return s=r.sent(),a=new Map,s.forEach((function(t){var e=function(t,e){return"found"in e?function(t,e){b(!!e.found),e.found.name,e.found.updateTime;var n=ke(t,e.found.name),r=Se(e.found.updateTime),i=new kn({mapValue:{fields:e.found.fields}});return new Dn(n,r,i,{})}(t,e):"missing"in e?function(t,e){b(!!e.missing),b(!!e.readTime);var n=ke(t,e.missing),r=Se(e.readTime);return new Ln(n,r)}(t,e):_()}(n.serializer,t);a.set(e.key.toString(),e)})),u=[],[2,(e.forEach((function(t){var e=a.get(t.toString());b(!!e),u.push(e)})),u)]}}))}))}(this.ju,t)];case 1:return[2,((e=i.sent()).forEach((function(t){t instanceof Ln||t instanceof Dn?n.S_(t):_()})),e)]}}))}))},t.prototype.set=function(t,e){this.write(e.d_(t,this.Ke(t))),this.p_.add(t.toString())},t.prototype.update=function(t,e){try{this.write(e.d_(t,this.D_(t)))}catch(t){this.V_=t}this.p_.add(t.toString())},t.prototype.delete=function(t){this.write([new Nn(t,this.Ke(t))]),this.p_.add(t.toString())},t.prototype.commit=function(){return r.__awaiter(this,void 0,void 0,(function(){var t,e=this;return r.__generator(this,(function(n){switch(n.label){case 0:if(this.v_(),this.V_)throw this.V_;return t=this.g_,this.mutations.forEach((function(e){t.delete(e.key.toString())})),t.forEach((function(t,n){var r=A.D(n);e.mutations.push(new An(r,e.Ke(r)))})),[4,function(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o;return r.__generator(this,(function(r){switch(r.label){case 0:return n=w(t),i=xe(n.serializer)+"/documents",o={writes:e.map((function(t){return je(n.serializer,t)}))},[4,n.$u("Commit",i,o)];case 1:return r.sent(),[2]}}))}))}(this.ju,this.mutations)];case 1:return n.sent(),this.y_=!0,[2]}}))}))},t.prototype.S_=function(t){var e;if(t instanceof Dn)e=t.version;else{if(!(t instanceof Ln))throw _();e=ct.min()}var n=this.g_.get(t.key.toString());if(n){if(!e.isEqual(n))throw new f(l.ABORTED,"Document version changed between two reads.")}else this.g_.set(t.key.toString(),e)},t.prototype.Ke=function(t){var e=this.g_.get(t.toString());return!this.p_.has(t.toString())&&e?dn.updateTime(e):dn.Ge()},t.prototype.D_=function(t){var e=this.g_.get(t.toString());if(!this.p_.has(t.toString())&&e){if(e.isEqual(ct.min()))throw new f(l.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return dn.updateTime(e)}return dn.exists(!0)},t.prototype.write=function(t){this.v_(),this.mutations=this.mutations.concat(t)},t.prototype.v_=function(){},t}(),Qa=function(){function t(t,e,n,r){this.os=t,this.ju=e,this.updateFunction=n,this.hs=r,this.C_=5,this.gs=new mr(this.os,"transaction_retry")}return t.prototype.run=function(){this.N_()},t.prototype.N_=function(){var t=this;this.gs.Rn((function(){return r.__awaiter(t,void 0,void 0,(function(){var t,e,n=this;return r.__generator(this,(function(r){return t=new za(this.ju),(e=this.F_(t))&&e.then((function(e){n.os.ds((function(){return t.commit().then((function(){n.hs.resolve(e)})).catch((function(t){n.x_(t)}))}))})).catch((function(t){n.x_(t)})),[2]}))}))}))},t.prototype.F_=function(t){try{var e=this.updateFunction(t);return!ht(e)&&e.catch&&e.then?e:(this.hs.reject(Error("Transaction callback must return a Promise")),null)}catch(t){return this.hs.reject(t),null}},t.prototype.x_=function(t){var e=this;this.C_>0&&this.k_(t)?(this.C_-=1,this.os.ds((function(){return e.N_(),Promise.resolve()}))):this.hs.reject(t)},t.prototype.k_=function(t){if("FirebaseError"===t.name){var e=t.code;return"aborted"===e||"failed-precondition"===e||!Et(e)}return!1},t}(),Ya=function(){function t(t,e){this.credentials=t,this.os=e,this.clientId=X.k(),this.M_=new yr}return t.prototype.start=function(t,e,n,i){var o=this;this.O_(),this.pl=t;var s=new yr,a=!1;return this.credentials.zc((function(t){if(!a)return a=!0,v("FirestoreClient","Initializing. user=",t.uid),o.L_(e,n,i,t,s).then(o.M_.resolve,o.M_.reject);o.os.Ds((function(){return function(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i;return r.__generator(this,(function(r){switch(r.label){case 0:return(n=w(t)).os.Fs(),v("RemoteStore","RemoteStore received new credentials"),i=ts(n),n.Hu.add(3),[4,Ko(n)];case 1:return r.sent(),i&&n.Zu.set("Unknown"),[4,n.Ku.Yl(e)];case 2:return r.sent(),n.Hu.delete(3),[4,Ho(n)];case 3:return r.sent(),[2]}}))}))}(o.Vh,t)}))})),this.os.ds((function(){return o.M_.promise})),s.promise},t.prototype.enableNetwork=function(){var t=this;return this.O_(),this.os.enqueue((function(){return t.persistence.Za(!0),function(t){var e=w(t);return e.Hu.delete(0),Ho(e)}(t.Vh)}))},t.prototype.L_=function(t,e,n,i,o){return r.__awaiter(this,void 0,void 0,(function(){var s,a,u=this;return r.__generator(this,(function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),s={os:this.os,pl:this.pl,clientId:this.clientId,credentials:this.credentials,Ql:i,Sh:100,persistenceSettings:n},[4,t.initialize(s)];case 1:return c.sent(),[4,e.initialize(t,s)];case 2:return c.sent(),this.persistence=t.persistence,this.bh=t.bh,this.Wu=t.Wu,this.Bl=t.Bl,this.ju=e.ju,this.Vh=e.Vh,this._i=e._i,this.B_=e.ph,this.B_.qs=Is.bind(null,this._i),this.B_.Ws=Cs.bind(null,this._i),this.persistence.Xa((function(){return r.__awaiter(u,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return[4,this.terminate()];case 1:return t.sent(),[2]}}))}))})),o.resolve(),[3,4];case 3:if(a=c.sent(),o.reject(a),!this.q_(a))throw a;return[2,(console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+a),this.L_(new fa,new da,{Wl:!1},i,o))];case 4:return[2]}}
2822))}))},t.prototype.q_=function(t){return"FirebaseError"===t.name?t.code===l.FAILED_PRECONDITION||t.code===l.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||22===t.code||20===t.code||11===t.code},t.prototype.O_=function(){if(this.os.Vs)throw new f(l.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.disableNetwork=function(){var t=this;return this.O_(),this.os.enqueue((function(){return t.persistence.Za(!1),function(t){return r.__awaiter(this,void 0,void 0,(function(){var e;return r.__generator(this,(function(n){switch(n.label){case 0:return(e=w(t)).Hu.add(0),[4,Ko(e)];case 1:return n.sent(),e.Zu.set("Offline"),[2]}}))}))}(t.Vh)}))},t.prototype.terminate=function(){var t=this;this.os.Ss();var e=new yr;return this.os.ps((function(){return r.__awaiter(t,void 0,void 0,(function(){var t,n;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),this.Bl&&this.Bl.stop(),[4,zo(this.Vh)];case 1:return r.sent(),[4,this.bh.Si()];case 2:return r.sent(),[4,this.persistence.Si()];case 3:return r.sent(),this.credentials.Hc(),e.resolve(),[3,5];case 4:return t=r.sent(),n=xr(t,"Failed to shutdown persistence"),e.reject(n),[3,5];case 5:return[2]}}
2822))}))})),e.promise},t.prototype.waitForPendingWrites=function(){var t=this;this.O_();var e=new yr;return this.os.ds((function(){return function(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o,s,a;return r.__generator(this,(function(r){switch(r.label){case 0:ts((n=w(t)).Vh)||v("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled."),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,function(t){var e=w(t);return e.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(function(t){return e.vr.Bo(t)}))}(n.Wu)];case 2:return-1===(i=r.sent())?[2,void e.resolve()]:((o=n.Oh.get(i)||[]).push(e),n.Oh.set(i,o),[3,4]);case 3:return s=r.sent(),a=xr(s,"Initialization of waitForPendingWrites() operation failed"),e.reject(a),[3,4];case 4:return[2]}}))}))}(t._i,e)})),e.promise},t.prototype.listen=function(t,e,n){var r=this;this.O_();var i=new va(n),o=new qr(t,i,e);return this.os.ds((function(){return jr(r.B_,o)})),function(){i.Xl(),r.os.ds((function(){return Mr(r.B_,o)}))}},t.prototype.U_=function(t){return r.__awaiter(this,void 0,void 0,(function(){var e,n=this;return r.__generator(this,(function(i){switch(i.label){case 0:return this.O_(),[4,this.M_.promise];case 1:return i.sent(),e=new yr,[2,(this.os.ds((function(){return function(t,e,n){return r.__awaiter(this,void 0,void 0,(function(){var i,o,s;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,function(t,e){var n=w(t);return n.persistence.runTransaction("read document","readonly",(function(t){return n.Dc.Dr(t,e)}))}(t,e)];case 1:return(i=r.sent())instanceof Dn?n.resolve(i):i instanceof Ln?n.resolve(null):n.reject(new f(l.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)")),[3,3];case 2:return o=r.sent(),s=xr(o,"Failed to get document '"+e+" from cache"),n.reject(s),[3,3];case 3:return[2]}}
2822))}))}(n.Wu,t,e)})),e.promise)]}}))}))},t.prototype.Q_=function(t,e){return void 0===e&&(e={}),r.__awaiter(this,void 0,void 0,(function(){var n,i=this;return r.__generator(this,(function(r){switch(r.label){case 0:return this.O_(),[4,this.M_.promise];case 1:return r.sent(),n=new yr,[2,(this.os.ds((function(){return function(t,e,n,r,i){var o=new va({next:function(o){e.ds((function(){return Mr(t,s)}));var a=o.docs.has(n);!a&&o.fromCache?i.reject(new f(l.UNAVAILABLE,"Failed to get document because the client is offline.")):a&&o.fromCache&&r&&"server"===r.source?i.reject(new f(l.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):i.resolve(o)},error:function(t){return i.reject(t)}}),s=new qr(Un(n.path),o,{includeMetadataChanges:!0,Js:!0});return jr(t,s)}(i.B_,i.os,t,e,n)})),n.promise)]}}))}))},t.prototype.W_=function(t){return r.__awaiter(this,void 0,void 0,(function(){var e,n=this;return r.__generator(this,(function(i){switch(i.label){case 0:return this.O_(),[4,this.M_.promise];case 1:return i.sent(),e=new yr,[2,(this.os.ds((function(){return function(t,e,n){return r.__awaiter(this,void 0,void 0,(function(){var i,o,s,a,u,c;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,Oo(t,e,!0)];case 1:return i=r.sent(),o=new _s(e,i.Nc),s=o.dh(i.documents),a=o.gr(s,!1),n.resolve(a.snapshot),[3,3];case 2:return u=r.sent(),c=xr(u,"Failed to execute query '"+e+" against cache"),n.reject(c),[3,3];case 3:return[2]}}
2822))}))}(n.Wu,t,e)})),e.promise)]}}))}))},t.prototype.j_=function(t,e){return void 0===e&&(e={}),r.__awaiter(this,void 0,void 0,(function(){var n,i=this;return r.__generator(this,(function(r){switch(r.label){case 0:return this.O_(),[4,this.M_.promise];case 1:return r.sent(),n=new yr,[2,(this.os.ds((function(){return function(t,e,n,r,i){var o=new va({next:function(n){e.ds((function(){return Mr(t,s)})),n.fromCache&&"server"===r.source?i.reject(new f(l.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):i.resolve(n)},error:function(t){return i.reject(t)}}),s=new qr(n,o,{includeMetadataChanges:!0,Js:!0});return jr(t,s)}(i.B_,i.os,t,e,n)})),n.promise)]}}))}))},t.prototype.write=function(t){var e=this;this.O_();var n=new yr;return this.os.ds((function(){return function(t,e,n){return r.__awaiter(this,void 0,void 0,(function(){var i,o,s,a;return r.__generator(this,(function(r){switch(r.label){case 0:i=Xs(t),r.label=1;case 1:return r.trys.push([1,5,,6]),[4,function(t,e){var n,r=w(t),i=ut.now(),o=e.reduce((function(t,e){return t.add(e.key)}),jt());return r.persistence.runTransaction("Locally write mutations","readwrite",(function(t){return r.Dc.$r(t,o).next((function(o){n=o;for(var s=[],a=0,u=e;a<u.length;a++){var c=u[a],h=_n(c,n.get(c.key));null!=h&&s.push(new In(c.key,h,Pn(h.proto.mapValue),dn.exists(!0)))}return r.vr.xo(t,i,s,e)}))})).then((function(t){var e=t.hr(n);return{batchId:t.batchId,dr:e}}))}(i.Wu,e)];case 2:return o=r.sent(),i.bh.Fi(o.batchId),function(t,e,n){var r=t.Mh[t.currentUser.Zs()];r||(r=new Tt($)),r=r.rt(e,n),t.Mh[t.currentUser.Zs()]=r}(i,o.batchId,n),[4,Fs(i,o.dr)];case 3:return r.sent(),[4,as(i.Vh)];case 4:return r.sent(),[3,6];case 5:return s=r.sent(),a=xr(s,"Failed to persist write"),n.reject(a),[3,6];case 6:return[2]}}
2822))}))}(e._i,t,n)})),n.promise},t.prototype.U=function(){return this.pl.U},t.prototype.K_=function(t){var e=this;this.O_();var n=new va(t);return this.os.ds((function(){return r.__awaiter(e,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,function(t,e){w(t).Bs.add(e),e.next()}(this.B_,n)]}))}))})),function(){n.Xl(),e.os.ds((function(){return r.__awaiter(e,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,function(t,e){w(t).Bs.delete(e)}(this.B_,n)]}))}))}))}},Object.defineProperty(t.prototype,"G_",{get:function(){return this.os.Vs},enumerable:!1,configurable:!0}),t.prototype.transaction=function(t){var e=this;this.O_();var n=new yr;return this.os.ds((function(){return new Qa(e.os,e.ju,t,n).run(),Promise.resolve()})),n.promise},t}(); 2823/** 2824 * @license 2825 * Copyright 2019 Google LLC 2826 * 2827 * Licensed under the Apache License, Version 2.0 (the "License"); 2828 * you may not use this file except in compliance with the License. 2829 * You may obtain a copy of the License at 2830 * 2831 * http://www.apache.org/licenses/LICENSE-2.0 2832 * 2833 * Unless required by applicable law or agreed to in writing, software 2834 * distributed under the License is distributed on an "AS IS" BASIS, 2835 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2836 * See the License for the specific language governing permissions and 2837 * limitations under the License. 2838 */function Xa(t){return function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=t,r=0,i=["next","error","complete"];r<i.length;r++){var o=i[r];if(o in n&&"function"==typeof n[o])return!0}return!1}(t)}var $a=function(){function t(t,e,n,r,i){this.U=t,this.timestampsInSnapshots=e,this.z_=n,this.H_=r,this.Y_=i}return t.prototype.J_=function(t){switch(ee(t)){case 0:return null;case 1:return t.booleanValue;case 2:return ce(t.integerValue||t.doubleValue);case 3:return this.X_(t.timestampValue);case 4:return this.Z_(t);case 5:return t.stringValue;case 6:return this.Y_(he(t.bytesValue));case 7:return this.tf(t.referenceValue);case 8:return this.ef(t.geoPointValue);case 9:return this.nf(t.arrayValue);case 10:return this.sf(t.mapValue);default:throw _()}},t.prototype.sf=function(t){var e=this,n={};return I(t.fields||{},(function(t,r){n[t]=e.J_(r)})),n},t.prototype.ef=function(t){return new Sa(ce(t.latitude),ce(t.longitude))},t.prototype.nf=function(t){var e=this;return(t.values||[]).map((function(t){return e.J_(t)}))},t.prototype.Z_=function(t){switch(this.z_){case"previous":var e=Jt(t);return null==e?null:this.J_(e);case"estimate":return this.X_(Zt(t));default:return null}},t.prototype.X_=function(t){var e=ue(t),n=new ut(e.seconds,e.nanos);return this.timestampsInSnapshots?n:n.toDate()},t.prototype.tf=function(t){var e=S.P(t);b($e(e));var n=new st(e.get(1),e.get(3)),r=new A(e.u(5));return n.isEqual(this.U)||g("Document "+r+" contains a document reference within a different database ("+n.projectId+"/"+n.database+") which is not supported. It will be treated as a reference in the current database ("+this.U.projectId+"/"+this.U.database+") instead."),this.H_(r)},t}(),Ja=hi.uo,Za=function(){function t(t){var e,n,r,i;if(void 0===t.host){if(void 0!==t.ssl)throw new f(l.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else j("settings","non-empty string","host",t.host),this.host=t.host,M("settings","boolean","ssl",t.ssl),this.ssl=null===(e=t.ssl)||void 0===e||e;if(G("settings",t,["host","ssl","credentials","timestampsInSnapshots","cacheSizeBytes","experimentalForceLongPolling","ignoreUndefinedProperties"]),M("settings","object","credentials",t.credentials),this.credentials=t.credentials,M("settings","boolean","timestampsInSnapshots",t.timestampsInSnapshots),M("settings","boolean","ignoreUndefinedProperties",t.ignoreUndefinedProperties),!0===t.timestampsInSnapshots?g("The setting 'timestampsInSnapshots: true' is no longer required and should be removed."):!1===t.timestampsInSnapshots&&g("Support for 'timestampsInSnapshots: false' will be removed soon. You must update your code to handle Timestamp objects."),this.timestampsInSnapshots=null===(n=t.timestampsInSnapshots)||void 0===n||n,this.ignoreUndefinedProperties=null!==(r=t.ignoreUndefinedProperties)&&void 0!==r&&r,M("settings","number","cacheSizeBytes",t.cacheSizeBytes),void 0===t.cacheSizeBytes)this.cacheSizeBytes=hi.lo;else{if(t.cacheSizeBytes!==Ja&&t.cacheSizeBytes<hi.ho)throw new f(l.INVALID_ARGUMENT,"cacheSizeBytes must be at least "+hi.ho);this.cacheSizeBytes=t.cacheSizeBytes}M("settings","boolean","experimentalForceLongPolling",t.experimentalForceLongPolling),this.experimentalForceLongPolling=null!==(i=t.experimentalForceLongPolling)&&void 0!==i&&i}return t.prototype.isEqual=function(t){return this.host===t.host&&this.ssl===t.ssl&&this.timestampsInSnapshots===t.timestampsInSnapshots&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties},t}(),tu=function(){function t(e,n,i,o){var s=this;if(void 0===i&&(i=new fa),void 0===o&&(o=new da),this.if=i,this.rf=o,this.af=null,this.cf=new Pr,this.INTERNAL={delete:function(){return r.__awaiter(s,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return this.uf(),[4,this.hf.terminate()];case 1:return t.sent(),[2]}}))}))}}
2838,"object"==typeof e.options){var a=e;this.af=a,this.l_=t.lf(a),this._f=a.name,this.ff=new jo(n)}else{var u=e;if(!u.projectId)throw new f(l.INVALID_ARGUMENT,"Must provide projectId");this.l_=new st(u.projectId,u.database),this._f="[DEFAULT]",this.ff=new Lo}this.df=new Za({})}return Object.defineProperty(t.prototype,"wf",{get:function(){return this.mf||(this.mf=new Da(this.l_,this.df.ignoreUndefinedProperties)),this.mf},enumerable:!1,configurable:!0}),t.prototype.settings=function(t){R("Firestore.settings",arguments,1),D("Firestore.settings","object",1,t),t.merge&&delete(t=Object.assign(Object.assign({},this.df),t)).merge;var e=new Za(t);if(this.hf&&!this.df.isEqual(e))throw new f(l.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only call settings() before calling any other methods on a Firestore object.");this.df=e,void 0!==e.credentials&&(this.ff=function(t){if(!t)return new Lo;switch(t.type){case"gapi":var e=t.client;return b(!("object"!=typeof e||null===e||!e.auth||!e.auth.getAuthHeaderValueForFirstParty)),new Fo(e,t.sessionIndex||"0");case"provider":return t.client;default:throw new f(l.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(e.credentials))},t.prototype.enableNetwork=function(){return this.uf(),this.hf.enableNetwork()},t.prototype.disableNetwork=function(){return this.uf(),this.hf.disableNetwork()},t.prototype.enablePersistence=function(t){var e,n;if(this.hf)throw new f(l.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only call enablePersistence() before calling any other methods on a Firestore object.");var r=!1,i=!1;if(t&&(void 0!==t.experimentalTabSynchronization&&g("The 'experimentalTabSynchronization' setting will be removed. Use 'synchronizeTabs' instead."),r=null!==(n=null!==(e=t.synchronizeTabs)&&void 0!==e?e:t.experimentalTabSynchronization)&&void 0!==n&&n,i=!!t.experimentalForceOwningTab&&t.experimentalForceOwningTab,r&&i))throw new f(l.INVALID_ARGUMENT,"The 'experimentalForceOwningTab' setting cannot be used with 'synchronizeTabs'.");return this.Tf(this.if,this.rf,{Wl:!0,cacheSizeBytes:this.df.cacheSizeBytes,synchronizeTabs:r,xa:i})},t.prototype.clearPersistence=function(){return r.__awaiter(this,void 0,void 0,(function(){var t,e=this;return r.__generator(this,(function(n){if(void 0!==this.hf&&!this.hf.G_)throw new f(l.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");return t=new yr,[2,(this.cf.ps((function(){return r.__awaiter(e,void 0,void 0,(function(){var e;return r.__generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.if.clearPersistence(this.l_,this._f)];case 1:return n.sent(),t.resolve(),[3,3];case 2:return e=n.sent(),t.reject(e),[3,3];case 3:return[2]}}
2838))}))})),t.promise)]}))}))},t.prototype.terminate=function(){return this.app._removeServiceInstance("firestore"),this.INTERNAL.delete()},Object.defineProperty(t.prototype,"Ef",{get:function(){return this.uf(),this.hf.G_},enumerable:!1,configurable:!0}),t.prototype.waitForPendingWrites=function(){return this.uf(),this.hf.waitForPendingWrites()},t.prototype.onSnapshotsInSync=function(t){if(this.uf(),Xa(t))return this.hf.K_(t);D("Firestore.onSnapshotsInSync","function",1,t);var e={next:t};return this.hf.K_(e)},t.prototype.uf=function(){return this.hf||this.Tf(new fa,new da,{Wl:!1}),this.hf},t.prototype.If=function(){return new ot(this.l_,this._f,this.df.host,this.df.ssl,this.df.experimentalForceLongPolling)},t.prototype.Tf=function(t,e,n){var r=this.If();return this.hf=new Ya(this.ff,this.cf),this.hf.start(r,t,e,n)},t.lf=function(t){if(e=t.options,!Object.prototype.hasOwnProperty.call(e,"projectId"))throw new f(l.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');var e,n=t.options.projectId;if(!n||"string"!=typeof n)throw new f(l.INVALID_ARGUMENT,"projectId must be a string in FirebaseApp.options");return new st(n)},Object.defineProperty(t.prototype,"app",{get:function(){if(!this.af)throw new f(l.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.af},enumerable:!1,configurable:!0}),t.prototype.collection=function(t){return R("Firestore.collection",arguments,1),D("Firestore.collection","non-empty string",1,t),this.uf(),new vu(S.P(t),this,null)},t.prototype.doc=function(t){return R("Firestore.doc",arguments,1),D("Firestore.doc","non-empty string",1,t),this.uf(),ru.Af(S.P(t),this,null)},t.prototype.collectionGroup=function(t){if(R("Firestore.collectionGroup",arguments,1),D("Firestore.collectionGroup","non-empty string",1,t),t.indexOf("/")>=0)throw new f(l.INVALID_ARGUMENT,"Invalid collection ID '"+t+"' passed to function Firestore.collectionGroup(). Collection IDs must not contain '/'.");return this.uf(),new pu(function(t){return new Mn(S.g(),t)}(t),this,null)},t.prototype.runTransaction=function(t){var e=this;return R("Firestore.runTransaction",arguments,1),D("Firestore.runTransaction","function",1,t),this.uf().transaction((function(n){return t(new eu(e,n))}))},t.prototype.batch=function(){return this.uf(),new nu(this)},Object.defineProperty(t,"logLevel",{get:function(){switch(d()){case o.LogLevel.DEBUG:return"debug";case o.LogLevel.ERROR:return"error";case o.LogLevel.SILENT:return"silent";case o.LogLevel.WARN:return"warn";case o.LogLevel.INFO:return"info";case o.LogLevel.VERBOSE:return"verbose";default:return"error"}},enumerable:!1,configurable:!0}),t.setLogLevel=function(t){var e;R("Firestore.setLogLevel",arguments,1),U("setLogLevel",["debug","error","silent","warn","info","verbose"],1,t),e=t,p.setLogLevel(e)},t.prototype.Rf=function(){return this.df.timestampsInSnapshots},t.prototype.Pf=function(){return this.df},t}(),eu=function(){function t(t,e){this.gf=t,this.yf=e}return t.prototype.get=function(t){var e=this;R("Transaction.get",arguments,1);var n=_u("Transaction.get",t,this.gf);return this.yf.b_([n.__]).then((function(t){if(!t||1!==t.length)return _();var r=t[0];if(r instanceof Ln)return new ou(e.gf,n.__,null,!1,!1,n.f_);if(r instanceof Dn)return new ou(e.gf,n.__,r,!1,!1,n.f_);throw _()}))},t.prototype.set=function(t,e,n){x("Transaction.set",arguments,2,3);var r=_u("Transaction.set",t,this.gf);n=gu("Transaction.set",n);var i=wu(r.f_,e,n),o=La(this.gf.wf,"Transaction.set",r.__,i,null!==r.f_,n);return this.yf.set(r.__,o),this},t.prototype.update=function(t,e,n){for(var r,i,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];return"string"==typeof e||e instanceof ya?(P("Transaction.update",arguments,3),r=_u("Transaction.update",t,this.gf),i=Ma(this.gf.wf,"Transaction.update",r.__,e,n,o)):(R("Transaction.update",arguments,2),r=_u("Transaction.update",t,this.gf),i=ja(this.gf.wf,"Transaction.update",r.__,e)),this.yf.update(r.__,i),this},t.prototype.delete=function(t){R("Transaction.delete",arguments,1);var e=_u("Transaction.delete",t,this.gf);return this.yf.delete(e.__),this},t}(),nu=function(){function t(t){this.gf=t,this.Vf=[],this.pf=!1}return t.prototype.set=function(t,e,n){x("WriteBatch.set",arguments,2,3),this.bf();var r=_u("WriteBatch.set",t,this.gf);n=gu("WriteBatch.set",n);var i=wu(r.f_,e,n),o=La(this.gf.wf,"WriteBatch.set",r.__,i,null!==r.f_,n);return this.Vf=this.Vf.concat(o.d_(r.__,dn.Ge())),this},t.prototype.update=function(t,e,n){for(var r,i,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];return this.bf(),"string"==typeof e||e instanceof ya?(P("WriteBatch.update",arguments,3),r=_u("WriteBatch.update",t,this.gf),i=Ma(this.gf.wf,"WriteBatch.update",r.__,e,n,o)):(R("WriteBatch.update",arguments,2),r=_u("WriteBatch.update",t,this.gf),i=ja(this.gf.wf,"WriteBatch.update",r.__,e)),this.Vf=this.Vf.concat(i.d_(r.__,dn.exists(!0))),this},t.prototype.delete=function(t){R("WriteBatch.delete",arguments,1
2838),this.bf();var e=_u("WriteBatch.delete",t,this.gf);return this.Vf=this.Vf.concat(new Nn(e.__,dn.Ge())),this},t.prototype.commit=function(){return this.bf(),this.pf=!0,this.Vf.length>0?this.gf.uf().write(this.Vf):Promise.resolve()},t.prototype.bf=function(){if(this.pf)throw new f(l.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},t}(),ru=function(t){function e(e,n,r){var i=this;return(i=t.call(this,n.l_,e,r)||this).__=e,i.firestore=n,i.f_=r,i.hf=i.firestore.uf(),i}return r.__extends(e,t),e.Af=function(t,n,r){if(t.length%2!=0)throw new f(l.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but "+t.R()+" has "+t.length);return new e(new A(t),n,r)},Object.defineProperty(e.prototype,"id",{get:function(){return this.__.path._()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return new vu(this.__.path.h(),this.firestore,this.f_)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.__.path.R()},enumerable:!1,configurable:!0}),e.prototype.collection=function(t){if(R("DocumentReference.collection",arguments,1),D("DocumentReference.collection","non-empty string",1,t),!t)throw new f(l.INVALID_ARGUMENT,"Must provide a non-empty collection name to collection()");var e=S.P(t);return new vu(this.__.path.child(e),this.firestore,null)},e.prototype.isEqual=function(t){if(!(t instanceof e))throw H("isEqual","DocumentReference",1,t);return this.firestore===t.firestore&&this.__.isEqual(t.__)&&this.f_===t.f_},e.prototype.set=function(t,e){x("DocumentReference.set",arguments,1,2),e=gu("DocumentReference.set",e);var n=wu(this.f_,t,e),r=La(this.firestore.wf,"DocumentReference.set",this.__,n,null!==this.f_,e);return this.hf.write(r.d_(this.__,dn.Ge()))},e.prototype.update=function(t,e){for(var n,r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return"string"==typeof t||t instanceof ya?(P("DocumentReference.update",arguments,2),n=Ma(this.firestore.wf,"DocumentReference.update",this.__,t,e,r)):(R("DocumentReference.update",arguments,1),n=ja(this.firestore.wf,"DocumentReference.update",this.__,t)),this.hf.write(n.d_(this.__,dn.exists(!0)))},e.prototype.delete=function(){return R("DocumentReference.delete",arguments,0),this.hf.write([new Nn(this.__,dn.Ge())])},e.prototype.onSnapshot=function(){for(var t,e,n,r=this,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];x("DocumentReference.onSnapshot",arguments,1,4);var s={includeMetadataChanges:!1},a=0;"object"!=typeof i[a]||Xa(i[a])||(G("DocumentReference.onSnapshot",s=i[a],["includeMetadataChanges"]),M("DocumentReference.onSnapshot","boolean","includeMetadataChanges",s.includeMetadataChanges),a++);var u={includeMetadataChanges:s.includeMetadataChanges};if(Xa(i[a])){var c=i[a];i[a]=null===(t=c.next)||void 0===t?void 0:t.bind(c),i[a+1]=null===(e=c.error)||void 0===e?void 0:e.bind(c),i[a+2]=null===(n=c.complete)||void 0===n?void 0:n.bind(c)}else D("DocumentReference.onSnapshot","function",a,i[a]),L("DocumentReference.onSnapshot","function",a+1,i[a+1]),L("DocumentReference.onSnapshot","function",a+2,i[a+2]);var h={next:function(t){i[a]&&i[a](r.vf(t))},error:i[a+1],complete:i[a+2]};return this.hf.listen(Un(this.__.path),u,h)},e.prototype.get=function(t){var e=this;x("DocumentReference.get",arguments,0,1),mu("DocumentReference.get",t);var n=this.firestore.uf();return t&&"cache"===t.source?n.U_(this.__).then((function(t){return new ou(e.firestore,e.__,t,!0,t instanceof Dn&&t.Ye,e.f_)})):n.Q_(this.__,t).then((function(t){return e.vf(t)}))},e.prototype.withConverter=function(t){return new e(this.__,this.firestore,t)},e.prototype.vf=function(t){var e=t.docs.get(this.__);return new ou(this.firestore,this.__,e,t.fromCache,t.hasPendingWrites,this.f_)},e}(Aa),iu=function(){function t(t,e){this.hasPendingWrites=t,this.fromCache=e}return t.prototype.isEqual=function(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache},t}(),ou=function(){function t(t,e,n,r,i,o){this.gf=t,this.__=e,this.Sf=n,this.Df=r,this.Cf=i,this.f_=o}return t.prototype.data=function(t){var e=this;if(x("DocumentSnapshot.data",arguments,0,1),t=yu("DocumentSnapshot.data",t),this.Sf){if(this.f_){var n=new su(this.gf,this.__,this.Sf,this.Df,this.Cf,null);return this.f_.fromFirestore(n,t)}return new $a(this.gf.l_,this.gf.Rf(),t.serverTimestamps||"none",(function(t){return new ru(t,e.gf,null)}),(function(t){return new it(t)})).J_(this.Sf.sn())}},t.prototype.get=function(t,e){var n=this;if(x("DocumentSnapshot.get",arguments,1,2),e=yu("DocumentSnapshot.get",e),this.Sf){var r=this.Sf.data().field(Wa("DocumentSnapshot.get",t,this.__));if(null!==r)return new $a(this.gf.l_,this.gf.Rf(),e.serverTimestamps||"none",(function(t){return new ru(t,n.gf,n.f_)}
2838),(function(t){return new it(t)})).J_(r)}},Object.defineProperty(t.prototype,"id",{get:function(){return this.__.path._()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new ru(this.__,this.gf,this.f_)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exists",{get:function(){return null!==this.Sf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return new iu(this.Cf,this.Df)},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){if(!(e instanceof t))throw H("isEqual","DocumentSnapshot",1,e);return this.gf===e.gf&&this.Df===e.Df&&this.__.isEqual(e.__)&&(null===this.Sf?null===e.Sf:this.Sf.isEqual(e.Sf))&&this.f_===e.f_},t}(),su=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.data=function(e){return t.prototype.data.call(this,e)},e}(ou); 2839/** 2840 * @license 2841 * Copyright 2017 Google LLC 2842 * 2843 * Licensed under the Apache License, Version 2.0 (the "License"); 2844 * you may not use this file except in compliance with the License. 2845 * You may obtain a copy of the License at 2846 * 2847 * http://www.apache.org/licenses/LICENSE-2.0 2848 * 2849 * Unless required by applicable law or agreed to in writing, software 2850 * distributed under the License is distributed on an "AS IS" BASIS, 2851 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2852 * See the License for the specific language governing permissions and 2853 * limitations under the License. 2854 */function au(t,e,n,r,i,o,s){var a;if(i.p()){if("array-contains"===o||"array-contains-any"===o)throw new f(l.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+o+"' queries on FieldPath.documentId().");if("in"===o||"not-in"===o){hu(s,o);for(var u=[],c=0,h=s;c<h.length;c++){var p=h[c];u.push(cu(r,t,p))}a={arrayValue:{values:u}}}else a=cu(r,t,s)}else"in"!==o&&"not-in"!==o&&"array-contains-any"!==o||hu(s,o),a=Fa(n,e,s,"in"===o||"not-in"===o);var d=er.create(i,o,a);return function(t,e){if(e.un()){var n=Wn(t);if(null!==n&&!n.isEqual(e.field))throw new f(l.INVALID_ARGUMENT,"Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on '"+n.toString()+"' and '"+e.field.toString()+"'");var r=Bn(t);null!==r&&lu(t,e.field,r)}var i=function(t,e){for(var n=0,r=t.filters;n<r.length;n++){var i=r[n];if(e.indexOf(i.op)>=0)return i.op}return null}(t,function(t){switch(t){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(null!==i)throw i===e.op?new f(l.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '"+e.op.toString()+"' filter."):new f(l.INVALID_ARGUMENT,"Invalid query. You cannot use '"+e.op.toString()+"' filters with '"+i.toString()+"' filters.")}(t,d),d}function uu(t,e,n){if(null!==t.startAt)throw new f(l.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==t.endAt)throw new f(l.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var r=new dr(e,n);return function(t,e){if(null===Bn(t)){var n=Wn(t);null!==n&&lu(t,n,e.field)}}(t,r),r}function cu(t,e,n){if("string"==typeof n){if(""===n)throw new f(l.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!Gn(e)&&-1!==n.indexOf("/"))throw new f(l.INVALID_ARGUMENT,"Invalid query. When querying a collection by FieldPath.documentId(), you must provide a plain document ID, but '"+n+"' contains a '/' character.");var r=e.path.child(S.P(n));if(!A.F(r))throw new f(l.INVALID_ARGUMENT,"Invalid query. When querying a collection group by FieldPath.documentId(), the value provided must result in a valid document path, but '"+r+"' is not because it has an odd number of segments ("+r.length+").");return le(t,new A(r))}if(n instanceof Aa)return le(t,n.__);throw new f(l.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+B(n)+".")}function hu(t,e){if(!Array.isArray(t)||0===t.length)throw new f(l.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+e.toString()+"' filters.");if(t.length>10)throw new f(l.INVALID_ARGUMENT,"Invalid Query. '"+e.toString()+"' filters support a maximum of 10 elements in the value array.");if("in"===e||"array-contains-any"===e){if(t.indexOf(null)>=0)throw new f(l.INVALID_ARGUMENT,"Invalid Query. '"+e.toString()+"' filters cannot contain 'null' in the value array.");if(t.filter((function(t){return Number.isNaN(t)})).length>0)throw new f(l.INVALID_ARGUMENT,"Invalid Query. '"+e.toString()+"' filters cannot contain 'NaN' in the value array.")}}function lu(t,e,n){if(!n.isEqual(e))throw new f(l.INVALID_ARGUMENT,"Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field '"+e.toString()+"' and so you must also use '"+e.toString()+"' as your first orderBy(), but your first orderBy() is on field '"+n.toString()+"' instead.")}function fu(t){if(qn(t)&&0===t.rn.length)throw new f(l.UNIMPLEMENT
2854ED,"limitToLast() queries require specifying at least one orderBy() clause")}var pu=function(){function t(t,e,n){this.Nf=t,this.firestore=e,this.f_=n}return t.prototype.where=function(e,n,r){R("Query.where",arguments,3),W("Query.where",3,r);var i=U("Query.where",["<","<=","==","!=",">=",">","array-contains","in","array-contains-any","not-in"],2,n),o=Wa("Query.where",e),s=au(this.Nf,"Query.where",this.firestore.wf,this.firestore.l_,o,i,r);return new t(function(t,e){var n=t.filters.concat([e]);return new Mn(t.path,t.collectionGroup,t.rn.slice(),n,t.limit,t.on,t.startAt,t.endAt)}(this.Nf,s),this.firestore,this.f_)},t.prototype.orderBy=function(e,n){var r;if(x("Query.orderBy",arguments,1,2),L("Query.orderBy","non-empty string",2,n),void 0===n||"asc"===n)r="asc";else{if("desc"!==n)throw new f(l.INVALID_ARGUMENT,"Function Query.orderBy() has unknown direction '"+n+"', expected 'asc' or 'desc'.");r="desc"}var i=Wa("Query.orderBy",e),o=uu(this.Nf,i,r);return new t(function(t,e){var n=t.rn.concat([e]);return new Mn(t.path,t.collectionGroup,n,t.filters.slice(),t.limit,t.on,t.startAt,t.endAt)}(this.Nf,o),this.firestore,this.f_)},t.prototype.limit=function(e){return R("Query.limit",arguments,1),D("Query.limit","number",1,e),K("Query.limit",1,e),new t(zn(this.Nf,e,"F"),this.firestore,this.f_)},t.prototype.limitToLast=function(e){return R("Query.limitToLast",arguments,1),D("Query.limitToLast","number",1,e),K("Query.limitToLast",1,e),new t(zn(this.Nf,e,"L"),this.firestore,this.f_)},t.prototype.startAt=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];P("Query.startAt",arguments,1);var i=this.Ff("Query.startAt",e,n,!0);return new t(Qn(this.Nf,i),this.firestore,this.f_)},t.prototype.startAfter=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];P("Query.startAfter",arguments,1);var i=this.Ff("Query.startAfter",e,n,!1);return new t(Qn(this.Nf,i),this.firestore,this.f_)},t.prototype.endBefore=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];P("Query.endBefore",arguments,1);var i=this.Ff("Query.endBefore",e,n,!0);return new t(Yn(this.Nf,i),this.firestore,this.f_)},t.prototype.endAt=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];P("Query.endAt",arguments,1);var i=this.Ff("Query.endAt",e,n,!1);return new t(Yn(this.Nf,i),this.firestore,this.f_)},t.prototype.isEqual=function(e){if(!(e instanceof t))throw H("isEqual","Query",1,e);return this.firestore===e.firestore&&Xn(this.Nf,e.Nf)&&this.f_===e.f_},t.prototype.withConverter=function(e){return new t(this.Nf,this.firestore,e)},t.prototype.Ff=function(t,e,n,i){if(W(t,1,e),e instanceof ou)return R(t,r.__spreadArrays([e],n),1),function(t,e,n,r,i){if(!r)throw new f(l.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+n+"().");for(var o=[],s=0,a=Hn(t);s<a.length;s++){var u=a[s];if(u.field.p())o.push(le(e,r.key));else{var c=r.field(u.field);if($t(c))throw new f(l.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+u.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===c){var h=u.field.R();throw new f(l.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+h+"' (used as the orderBy) does not exist.")}o.push(c)}}return new hr(o,i)}(this.Nf,this.firestore.l_,t,e.Sf,i);var o=[e].concat(n);return function(t,e,n,r,i,o){var s=t.rn;if(i.length>s.length)throw new f(l.INVALID_ARGUMENT,"Too many arguments provided to "+r+"(). The number of arguments must be less than or equal to the number of orderBy() clauses");for(var a=[],u=0;u<i.length;u++){var c=i[u];if(s[u].field.p()){if("string"!=typeof c)throw new f(l.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+r+"(), but got a "+typeof c);if(!Gn(t)&&-1!==c.indexOf("/"))throw new f(l.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by FieldPath.documentId(), the value passed to "+r+"() must be a plain document ID, but '"+c+"' contains a slash.");var h=t.path.child(S.P(c));if(!A.F(h))throw new f(l.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by FieldPath.documentId(), the value passed to "+r+"() must result in a valid document path, but '"+h+"' is not because it c
2854ontains an odd number of segments.");var p=new A(h);a.push(le(e,p))}else{var d=Fa(n,r,c);a.push(d)}}return new hr(a,o)}(this.Nf,this.firestore.l_,this.firestore.wf,t,o,i)},t.prototype.onSnapshot=function(){for(var t,e,n,r=this,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];x("Query.onSnapshot",arguments,1,4);var s={},a=0;if("object"!=typeof i[a]||Xa(i[a])||(G("Query.onSnapshot",s=i[a],["includeMetadataChanges"]),M("Query.onSnapshot","boolean","includeMetadataChanges",s.includeMetadataChanges),a++),Xa(i[a])){var u=i[a];i[a]=null===(t=u.next)||void 0===t?void 0:t.bind(u),i[a+1]=null===(e=u.error)||void 0===e?void 0:e.bind(u),i[a+2]=null===(n=u.complete)||void 0===n?void 0:n.bind(u)}else D("Query.onSnapshot","function",a,i[a]),L("Query.onSnapshot","function",a+1,i[a+1]),L("Query.onSnapshot","function",a+2,i[a+2]);var c={next:function(t){i[a]&&i[a](new du(r.firestore,r.Nf,t,r.f_))},error:i[a+1],complete:i[a+2]};return fu(this.Nf),this.firestore.uf().listen(this.Nf,s,c)},t.prototype.get=function(t){var e=this;x("Query.get",arguments,0,1),mu("Query.get",t),fu(this.Nf);var n=this.firestore.uf();return(t&&"cache"===t.source?n.W_(this.Nf):n.j_(this.Nf,t)).then((function(t){return new du(e.firestore,e.Nf,t,e.f_)}))},t}(),du=function(){function t(t,e,n,r){this.gf=t,this.$f=e,this.xf=n,this.f_=r,this.kf=null,this.Mf=null,this.metadata=new iu(n.hasPendingWrites,n.fromCache)}return Object.defineProperty(t.prototype,"docs",{get:function(){var t=[];return this.forEach((function(e){return t.push(e)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"empty",{get:function(){return this.xf.docs.m()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.xf.docs.size},enumerable:!1,configurable:!0}),t.prototype.forEach=function(t,e){var n=this;x("QuerySnapshot.forEach",arguments,1,2),D("QuerySnapshot.forEach","function",1,t),this.xf.docs.forEach((function(r){t.call(e,n.Of(r,n.metadata.fromCache,n.xf.Qt.has(r.key)))}))},Object.defineProperty(t.prototype,"query",{get:function(){return new pu(this.$f,this.gf,this.f_)},enumerable:!1,configurable:!0}),t.prototype.docChanges=function(t){t&&(G("QuerySnapshot.docChanges",t,["includeMetadataChanges"]),M("QuerySnapshot.docChanges","boolean","includeMetadataChanges",t.includeMetadataChanges));var e=!(!t||!t.includeMetadataChanges);if(e&&this.xf.jt)throw new f(l.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this.kf&&this.Mf===e||(this.kf=function(t,e,n){if(t.Ut.m()){var r=0;return t.docChanges.map((function(e){var i=n(e.doc,t.fromCache,t.Qt.has(e.doc.key));return e.doc,{type:"added",doc:i,oldIndex:-1,newIndex:r++}}))}var i=t.Ut;return t.docChanges.filter((function(t){return e||3!==t.type})).map((function(e){var r=n(e.doc,t.fromCache,t.Qt.has(e.doc.key)),o=-1,s=-1;return 0!==e.type&&(o=i.indexOf(e.doc.key),i=i.delete(e.doc.key)),1!==e.type&&(s=(i=i.add(e.doc)).indexOf(e.doc.key)),{type:bu(e.type),doc:r,oldIndex:o,newIndex:s}}))}(this.xf,e,this.Of.bind(this)),this.Mf=e),this.kf},t.prototype.isEqual=function(e){if(!(e instanceof t))throw H("isEqual","QuerySnapshot",1,e);return this.gf===e.gf&&Xn(this.$f,e.$f)&&this.xf.isEqual(e.xf)&&this.f_===e.f_},t.prototype.Of=function(t,e,n){return new su(this.gf,t.key,t,e,n,this.f_)},t}(),vu=function(t){function e(e,n,r){var i=this;if((i=t.call(this,Un(e),n,r)||this).Lf=e,e.length%2!=1)throw new f(l.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but "+e.R()+" has "+e.length);return i}return r.__extends(e,t),Object.defineProperty(e.prototype,"id",{get:function(){return this.Nf.path._()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this.Nf.path.h();return t.m()?null:new ru(new A(t),this.firestore,null)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.Nf.path.R()},enumerable:!1,configurable:!0}),e.prototype.doc=function(t){x("CollectionReference.doc",arguments,0,1),0===arguments.length&&(t=X.k()),D("CollectionReference.doc","non-empty string",1,t);var e=S.P(t);return ru.Af(this.Nf.path.child(e),this.firestore,this.f_)},e.prototype.add=function(t){R("CollectionReference.add",arguments,1
2854);var e=this.f_?this.f_.toFirestore(t):t;D("CollectionReference.add","object",1,e);var n=this.doc();return new ru(n.__,this.firestore,null).set(e).then((function(){return n}))},e.prototype.withConverter=function(t){return new e(this.Lf,this.firestore,t)},e}(pu);function gu(t,e){if(void 0===e)return{merge:!1};if(G(t,e,["merge","mergeFields"]),M(t,"boolean","merge",e.merge),function(t,e,n,r,i){void 0!==r&&function(t,e,n,r,i){if(!(r instanceof Array))throw new f(l.INVALID_ARGUMENT,"Function "+t+"() requires its "+e+" option to be an array, but it was: "+B(r));for(var o=0;o<r.length;++o)if(!i(r[o]))throw new f(l.INVALID_ARGUMENT,"Function "+t+"() requires all "+e+" elements to be "+n+", but the value at index "+o+" was: "+B(r[o]))}(t,e,n,r,i)}(t,"mergeFields","a string or a FieldPath",e.mergeFields,(function(t){return"string"==typeof t||t instanceof ya})),void 0!==e.mergeFields&&void 0!==e.merge)throw new f(l.INVALID_ARGUMENT,"Invalid options passed to function "+t+'(): You cannot specify both "merge" and "mergeFields".');return e}function yu(t,e){return void 0===e?{}:(G(t,e,["serverTimestamps"]),F(t,0,"serverTimestamps",e.serverTimestamps,["estimate","previous","none"]),e)}function mu(t,e){L(t,"object",1,e),e&&(G(t,e,["source"]),F(t,0,"source",e.source,["default","server","cache"]))}function _u(t,e,n){if(e instanceof Aa){if(e.firestore!==n)throw new f(l.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}throw H(t,"DocumentReference",1,e)}function bu(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return _()}}function wu(t,e,n){return t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e} 2855/** 2856 * @license 2857 * Copyright 2020 Google LLC 2858 * 2859 * Licensed under the Apache License, Version 2.0 (the "License"); 2860 * you may not use this file except in compliance with the License. 2861 * You may obtain a copy of the License at 2862 * 2863 * http://www.apache.org/licenses/LICENSE-2.0 2864 * 2865 * Unless required by applicable law or agreed to in writing, software 2866 * distributed under the License is distributed on an "AS IS" BASIS, 2867 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2868 * See the License for the specific language governing permissions and 2869 * limitations under the License. 2870 */var Eu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.serverTimestamp=function(){k("FieldValue.serverTimestamp",arguments);var t=new Ea("serverTimestamp");return t.t_="FieldValue.serverTimestamp",new e(t)},e.delete=function(){k("FieldValue.delete",arguments);var t=new ba("deleteField");return t.t_="FieldValue.delete",new e(t)},e.arrayUnion=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];P("FieldValue.arrayUnion",arguments,1);var r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return P("arrayUnion()",arguments,1),new Ia("arrayUnion",t)}.apply(void 0,t);return r.t_="FieldValue.arrayUnion",new e(r)},e.arrayRemove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];P("FieldValue.arrayRemove",arguments,1);var r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return P("arrayRemove()",arguments,1),new Ta("arrayRemove",t)}.apply(void 0,t);return r.t_="FieldValue.arrayRemove",new e(r)},e.increment=function(t){D("FieldValue.increment","number",1,t),R("FieldValue.increment",arguments,1);var n=function(t){return new Ca("increment",t)}(t);return n.t_="FieldValue.increment",new e(n)},e.prototype.isEqual=function(t){return this.h_.isEqual(t.h_)},e}(Oa),Iu={Firestore:tu,GeoPoint:Sa,Timestamp:ut,Blob:it,Transaction:eu,WriteBatch:nu,DocumentReference:ru,DocumentSnapshot:ou,Query:pu,QueryDocumentSnapshot:su,QuerySnapshot:du,CollectionReference:vu,FieldPath:ya,FieldValue:Eu,setLogLevel:tu.setLogLevel,CACHE_SIZE_UNLIMITED:Ja}; 2871/** 2872 * @license 2873 * Copyright 2017 Google LLC 2874 * 2875 * Licensed under the Apache License, Version 2.0 (the "License"); 2876 * you may not use this file except in compliance with the License. 2877 * You may obtain a copy of the License at 2878 * 2879 * http://www.apache.org/licenses/LICENSE-2.0 2880 * 2881 * Unless required by applicable law or agreed to in writing, softw
2881are 2882 * distributed under the License is distributed on an "AS IS" BASIS, 2883 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2884 * See the License for the specific language governing permissions and 2885 * limitations under the License. 2886 */ 2887/** 2888 * @license 2889 * Copyright 2017 Google LLC 2890 * 2891 * Licensed under the Apache License, Version 2.0 (the "License"); 2892 * you may not use this file except in compliance with the License. 2893 * You may obtain a copy of the License at 2894 * 2895 * http://www.apache.org/licenses/LICENSE-2.0 2896 * 2897 * Unless required by applicable law or agreed to in writing, software 2898 * distributed under the License is distributed on an "AS IS" BASIS, 2899 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2900 * See the License for the specific language governing permissions and 2901 * limitations under the License. 2902 */function Tu(t){!function(t,e){t.INTERNAL.registerComponent(new u.Component("firestore",(function(t){return function(t,e){var n=new da,r=new pa(n);return new tu(t,e,r,n)}(t.getProvider("app").getImmediate(),t.getProvider("auth-internal"))}),"PUBLIC").setServiceProps(Object.assign({},Iu)))}(t),t.registerVersion("@firebase/firestore","1.17.3")}Tu(h.default),e.__PRIVATE_registerFirestore=Tu}).call(this,n("4362"))},e95a:function(t,e,n){var r=n("b622"),i=n("3f8c"),o=r("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||s[o]===t)}},f069:function(t,e,n){"use strict";var r=n("59ed"),i=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new i(t)}},f22b:function(t,e,n){"use strict";var r=n("23e7"),i=n("c65b"),o=n("f069"),s=n("4738").CONSTRUCTOR;r({target:"Promise",stat:!0,forced:s},{reject:function(t){var e=o.f(this);return i(e.reject,void 0,t),e.promise}})},f36a:function(t,e,n){var r=n("e330");t.exports=r([].slice)},f5df:function(t,e,n){var r=n("00ee"),i=n("1626"),o=n("c6b6"),s=n("b622"),a=s("toStringTag"),u=Object,c="Arguments"==o(function(){return arguments}()),h=function(t,e){try{return t[e]}catch(n){}};t.exports=r?o:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=h(e=u(t),a))?n:c?o(e):"Object"==(r=o(e))&&i(e.callee)?"Arguments":r}},f772:function(t,e,n){var r=n("5692"),i=n("90e3"),o=r("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},fc6a:function(t,e,n){var r=n("44ad"),i=n("1d80");t.exports=function(t){return r(i(t))}},fdbf:function(t,e,n){var r=n("4930");t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}}]); 2903//# sourceMappingURL=chunk-vendors.c49ebcb3.js.map
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.