text: /*! For license information please see main-es2015.36ad636c929d95f62ae2.js.LICENSE.txt */
  (window.webpackJsonp=window.webpackJsonp||[]).push([[1],{0:function(t,e,n){t.exports=n("zUnb")},"6Joi":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("mrSG"),i=n("wj3C"),o=n("q/0M"),s=n("zVF4"),a=n("x7I3"),u=n("S+S0"),c=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(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"},h=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),f=new o.Logger("@firebase/firestore");function d(){return f.logLevel}function p(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(f.logLevel<=o.LogLevel.DEBUG){var i=e.map(m);f.debug.apply(f,r.__spreadArrays(["Firestore (7.24.0): "+t],i))}}function g(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(f.logLevel<=o.LogLevel.ERROR){var i=e.map(m);f.error.apply(f,r.__spreadArrays(["Firestore (7.24.0): "+t],i))}}function v(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(f.logLevel<=o.LogLevel.WARN){var i=e.map(m);f.warn.apply(f,r.__spreadArrays(["Firestore (7.24.0): "+t],i))}}function m(t){if("string"==typeof t)return t;try{return JSON.stringify(t)}catch(i){return t}}function y(t){void 0===t&&(t="Unexpected state");var e="FIRESTORE (7.24.0) INTERNAL ASSERTION FAILED: "+t;throw g(e),new Error(e)}function w(t,e){t||y()}function b(t,e){return t}function _(t){var e=0;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function E(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function S(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}var I=function(){function t(t,e,n){void 0===e?e=0:e>t.length&&y(),void 0===n?n=t.length-e:n>t.length-e&&y(),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 this.o(this.segments,this.offset+(t=void 0===t?1: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}(),T=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.g=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 h(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.P=function(){return new e([])},e}(I),x=/^[_a-zA-Z][_a-zA-Z0-9]*$/,C=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 x.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 h(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 h(l.INVALID_ARGUMENT,"Path has trailing escape character: "+t);var u=t[i+1];if("\\"!==u&&"."!==u&&"`"!==u)throw new h(l.INVALID_ARGUMENT,"Path has invalid escape sequence: "+t);r+=u,i+=2}else"`"===a?(s=!s,i++):"."!==a||s?(r+=a,i++):(o(),i++)}if(o(),s)throw new h(l.INVALID_ARGUMENT,"Unterminated ` in path: "+t);return new e(n)},e.P=function(){return new e([])},e}(I),A=function(){function t(t){this.path=t}return t.D=function(e){return new t(T.g(e))},t.C=function(e){return new t(T.g(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===T.i(this.path,t.path)},t.prototype.toString=function(){return this.path.toString()},t.i=function(t,e){return T.i(t.path,e.path)},t.F=function(t){return t.length%2==0},t.$=function(e){return new t(new T(e.slice()))},t}();function N(t,e){if(0!==e.length)throw new h(l.INVALID_ARGUMENT,"Function "+t+"() does not support arguments, but was called with "+W(e.length,"argument")+".")}function k(t,e,n){if(e.length!==n)throw new h(l.INVALID_ARGUMENT,"Function "+t+"() requires "+W(n,"argument")+", but was called with "+W(e.length,"argument")+".")}function R(t,e,n){if(e.length<n)throw new h(l.INVALID_ARGUMENT,"Function "+t+"() requires at least "+W(n,"argument")+", but was called with "+W(e.length,"argument")+".")}function D(t,e,n,r){if(e.length<n||e.length>r)throw new h(l.INVALID_ARGUMENT,"Function "+t+"() requires between "+n+" and "+r+" arguments, but was called with "+W(e.length,"argument")+".")}function O(t,e,n,r){j(t,e,$(n)+" argument",r)}function P(t,e,n,r){void 0!==r&&O(t,e,n,r)}function L(t,e,n,r){j(t,e,n+" option",r)}function U(t,e,n,r){void 0!==r&&L(t,e,n,r)}function M(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(q(u))}var c=q(r);throw new h(l.INVALID_ARGUMENT,"Invalid value "+c+" provided to function "+t+'() for option "'+n+'". Acceptable values: '+o.join(", "))}(t,0,n,r,i)}function V(t,e,n,r){if(!e.some((function(t){return t===r})))throw new h(l.INVALID_ARGUMENT,"Invalid value "+q(r)+" provided to function "+t+"() for its "+$(n)+" argument. Acceptable values: "+e.join(", "));return r}function j(t,e,n,r){if(!("object"===e?F(r):"non-empty string"===e?"string"==typeof r&&""!==r:typeof r===e)){var i=q(r);throw new h(l.INVALID_ARGUMENT,"Function "+t+"() requires its "+n+" to be of type "+e+", but it was: "+i)}}function F(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}function q(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":y()}function z(t,e,n){if(void 0===n)throw new h(l.INVALID_ARGUMENT,"Function "+t+"() requires a valid "+$(e)+" argument, but it was undefined.")}function B(t,e,n){E(e,(function(e,r){if(n.indexOf(e)<0)throw new h(l.INVALID_ARGUMENT,"Unknown option '"+e+"' passed to function "+t+"(). Available options: "+n.join(", "))}))}function H(t,e,n,r){var i=q(r);return new h(l.INVALID_ARGUMENT,"Function "+t+"() requires its "+$(n)+" argument to be a "+e+", but it was: "+i)}function G(t,e,n){if(n<=0)throw new h(l.INVALID_ARGUMENT,"Function "+t+"() requires its "+$(e)+" argument to be a positive number, but it was: "+n+".")}function $(t){switch(t){case 1:return"first";case 2:return"second";case 3:return"third";default:return t+"th"}}function W(t,e){return t+" "+e+(1===t?"":"s")}function K(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}var Q=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=K(40),i=0;i<r.length;++i)n.length<20&&r[i]<e&&(n+=t.charAt(r[i]%t.length));return n},t}();function Z(t,e){return t<e?-1:t>e?1:0}function Y(t,e,n){return t.length===e.length&&t.every((function(t,r){return n(t,e[r])}))}function X(t){return t+"\0"}var J=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 btoa(this.M)},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 Z(this.M,t.M)},t.prototype.isEqual=function(t){return this.M===t.M},t}();J.B=new J("");var tt=function(){function t(t){this.q=t}return t.fromBase64String=function(e){try{return new t(J.fromBase64String(e))}catch(e){throw new h(l.INVALID_ARGUMENT,"Failed to construct Bytes from Base64 string: "+e)}},t.fromUint8Array=function(e){return new t(J.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}();function et(){if("undefined"==typeof Uint8Array)throw new h(l.UNIMPLEMENTED,"Uint8Arrays are not available in this environment.")}function nt(){if("undefined"==typeof atob)throw new h(l.UNIMPLEMENTED,"Blobs are unavailable in Firestore in this environment.")}var rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.fromBase64String=function(t){k("Blob.fromBase64String",arguments,1),O("Blob.fromBase64String","string",1,t),nt();try{return new e(J.fromBase64String(t))}catch(t){throw new h(l.INVALID_ARGUMENT,"Failed to construct Blob from Base64 string: "+t)}},e.fromUint8Array=function(t){if(k("Blob.fromUint8Array",arguments,1),et(),!(t instanceof Uint8Array))throw H("Blob.fromUint8Array","Uint8Array",1,t);return new e(J.fromUint8Array(t))},e.prototype.toBase64=function(){return k("Blob.toBase64",arguments,0),nt(),t.prototype.toBase64.call(this)},e.prototype.toUint8Array=function(){return k("Blob.toUint8Array",arguments,0),et(),t.prototype.toUint8Array.call(this)},e.prototype.toString=function(){return"Blob(base64: "+this.toBase64()+")"},e}(tt),it=function(t,e,n,r,i,o){this.U=t,this.persistenceKey=e,this.host=n,this.ssl=r,this.forceLongPolling=i,this.W=o},ot=function(){function t(t,e){this.projectId=t,this.database=e||"(default)"}return Object.defineProperty(t.prototype,"j",{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 Z(this.projectId,t.projectId)||Z(this.database,t.database)},t}(),st=function(){function t(t,e){this.K=t,this.G=e,this.H={}}return t.prototype.get=function(t){var e=this.K(t),n=this.H[e];if(void 0!==n)for(var r=0,i=n;r<i.length;r++){var o=i[r],s=o[1];if(this.G(o[0],t))return s}},t.prototype.has=function(t){return void 0!==this.get(t)},t.prototype.set=function(t,e){var n=this.K(t),r=this.H[n];if(void 0!==r){for(var i=0;i<r.length;i++)if(this.G(r[i][0],t))return void(r[i]=[t,e]);r.push([t,e])}else this.H[n]=[[t,e]]},t.prototype.delete=function(t){var e=this.K(t),n=this.H[e];if(void 0===n)return!1;for(var r=0;r<n.length;r++)if(this.G(n[r][0],t))return 1===n.length?delete this.H[e]:n.splice(r,1),!0;return!1},t.prototype.forEach=function(t){E(this.H,(function(e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r];t(o[0],o[1])}}))},t.prototype.m=function(){return S(this.H)},t}(),at=function(){function t(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new h(l.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new h(l.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new h(l.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new h(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.Y=function(t){return this.seconds===t.seconds?Z(this.nanoseconds,t.nanoseconds):Z(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(){return String(this.seconds- -62135596800).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")},t}(),ut=function(){function t(t){this.timestamp=t}return t.J=function(e){return new t(e)},t.min=function(){return new t(new at(0,0))},t.prototype.L=function(t){return this.timestamp.Y(t.timestamp)},t.prototype.isEqual=function(t){return this.timestamp.isEqual(t.timestamp)},t.prototype.X=function(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3},t.prototype.toString=function(){return"SnapshotVersion("+this.timestamp.toString()+")"},t.prototype.Z=function(){return this.timestamp},t}();function ct(t){return null==t}function lt(t){return 0===t&&1/t==-1/0}function ht(t){return"number"==typeof t&&Number.isInteger(t)&&!lt(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}var ft=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.tt=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 ft(t,e,n,r,i,o,s)}function pt(t){var e=b(t);if(null===e.tt){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()+ie(t.value)}(t)})).join(","),n+="|ob:",n+=e.orderBy.map((function(t){return(e=t).field.R()+e.dir;var e})).join(","),ct(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=sr(e.startAt)),e.endAt&&(n+="|ub:",n+=sr(e.endAt)),e.tt=n}return e.tt}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(!hr(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]).op!==(o=e.filters[r]).op||!i.field.isEqual(o.field)||!te(i.value,o.value))return!1;var i,o;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!ur(t.startAt,e.startAt)&&ur(t.endAt,e.endAt)}function vt(t){return A.F(t.path)&&null===t.collectionGroup&&0===t.filters.length}var mt,yt,wt=function(){function t(t,e,n,r,i,o,s){void 0===i&&(i=ut.min()),void 0===o&&(o=ut.min()),void 0===s&&(s=J.B),this.target=t,this.targetId=e,this.et=n,this.sequenceNumber=r,this.nt=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=s}return t.prototype.st=function(e){return new t(this.target,this.targetId,this.et,e,this.nt,this.lastLimboFreeSnapshotVersion,this.resumeToken)},t.prototype.it=function(e,n){return new t(this.target,this.targetId,this.et,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e)},t.prototype.rt=function(e){return new t(this.target,this.targetId,this.et,this.sequenceNumber,this.nt,e,this.resumeToken)},t}(),bt=function(t){this.count=t};function _t(t){switch(t){case l.OK:return y();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 y()}}function Et(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 y()}}(yt=mt||(mt={}))[yt.OK=0]="OK",yt[yt.CANCELLED=1]="CANCELLED",yt[yt.UNKNOWN=2]="UNKNOWN",yt[yt.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",yt[yt.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",yt[yt.NOT_FOUND=5]="NOT_FOUND",yt[yt.ALREADY_EXISTS=6]="ALREADY_EXISTS",yt[yt.PERMISSION_DENIED=7]="PERMISSION_DENIED",yt[yt.UNAUTHENTICATED=16]="UNAUTHENTICATED",yt[yt.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",yt[yt.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",yt[yt.ABORTED=10]="ABORTED",yt[yt.OUT_OF_RANGE=11]="OUT_OF_RANGE",yt[yt.UNIMPLEMENTED=12]="UNIMPLEMENTED",yt[yt.INTERNAL=13]="INTERNAL",yt[yt.UNAVAILABLE=14]="UNAVAILABLE",yt[yt.DATA_LOSS=15]="DATA_LOSS";var St=function(){function t(t,e){this.i=t,this.root=e||Tt.EMPTY}return t.prototype.ot=function(e,n){return new t(this.i,this.root.ot(e,n,this.i).copy(null,null,Tt.at,null,null))},t.prototype.remove=function(e){return new t(this.i,this.root.remove(e,this.i).copy(null,null,Tt.at,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.ct=function(){return this.root.ct()},t.prototype.ut=function(){return this.root.ut()},t.prototype.ht=function(t){return this.root.ht(t)},t.prototype.forEach=function(t){this.ht((function(e,n){return t(e,n),!1}))},t.prototype.toString=function(){var t=[];return this.ht((function(e,n){return t.push(e+":"+n),!1})),"{"+t.join(", ")+"}"},t.prototype.lt=function(t){return this.root.lt(t)},t.prototype._t=function(){return new It(this.root,null,this.i,!1)},t.prototype.ft=function(t){return new It(this.root,t,this.i,!1)},t.prototype.dt=function(){return new It(this.root,null,this.i,!0)},t.prototype.wt=function(t){return new It(this.root,t,this.i,!0)},t}(),It=function(){function t(t,e,n,r){this.Tt=r,this.Et=[];for(var i=1;!t.m();)if(i=e?n(t.key,e):1,r&&(i*=-1),i<0)t=this.Tt?t.left:t.right;else{if(0===i){this.Et.push(t);break}this.Et.push(t),t=this.Tt?t.right:t.left}}return t.prototype.It=function(){var t=this.Et.pop(),e={key:t.key,value:t.value};if(this.Tt)for(t=t.left;!t.m();)this.Et.push(t),t=t.right;else for(t=t.right;!t.m();)this.Et.push(t),t=t.left;return e},t.prototype.At=function(){return this.Et.length>0},t.prototype.Rt=function(){if(0===this.Et.length)return null;var t=this.Et[this.Et.length-1];return{key:t.key,value:t.value}},t}(),Tt=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.ht=function(t){return this.left.ht(t)||t(this.key,this.value)||this.right.ht(t)},t.prototype.lt=function(t){return this.right.lt(t)||t(this.key,this.value)||this.left.lt(t)},t.prototype.min=function(){return this.left.m()?this:this.left.min()},t.prototype.ct=function(){return this.min().key},t.prototype.ut=function(){return this.right.m()?this.key:this.right.ut()},t.prototype.ot=function(t,e,n){var r=this,i=n(t,r.key);return(r=i<0?r.copy(null,null,null,r.left.ot(t,e,n),null):0===i?r.copy(null,e,null,null,null):r.copy(null,null,null,null,r.right.ot(t,e,n))).gt()},t.prototype.Pt=function(){if(this.left.m())return t.EMPTY;var e=this;return e.left.yt()||e.left.left.yt()||(e=e.Vt()),(e=e.copy(null,null,null,e.left.Pt(),null)).gt()},t.prototype.remove=function(e,n){var r,i=this;if(n(e,i.key)<0)i.left.m()||i.left.yt()||i.left.left.yt()||(i=i.Vt()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.yt()&&(i=i.bt()),i.right.m()||i.right.yt()||i.right.left.yt()||(i=i.vt()),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.gt()},t.prototype.yt=function(){return this.color},t.prototype.gt=function(){var t=this;return t.right.yt()&&!t.left.yt()&&(t=t.St()),t.left.yt()&&t.left.left.yt()&&(t=t.bt()),t.left.yt()&&t.right.yt()&&(t=t.Dt()),t},t.prototype.Vt=function(){var t=this.Dt();return t.right.left.yt()&&(t=(t=(t=t.copy(null,null,null,null,t.right.bt())).St()).Dt()),t},t.prototype.vt=function(){var t=this.Dt();return t.left.left.yt()&&(t=(t=t.bt()).Dt()),t},t.prototype.St=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.bt=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.Dt=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.Ct=function(){var t=this.Nt();return Math.pow(2,t)<=this.size+1},t.prototype.Nt=function(){if(this.yt()&&this.left.yt())throw y();if(this.right.yt())throw y();var t=this.left.Nt();if(t!==this.right.Nt())throw y();return t+(this.yt()?0:1)},t}();Tt.EMPTY=null,Tt.RED=!0,Tt.at=!1,Tt.EMPTY=new(function(){function t(){this.size=0}return Object.defineProperty(t.prototype,"key",{get:function(){throw y()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){throw y()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){throw y()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){throw y()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){throw y()},enumerable:!1,configurable:!0}),t.prototype.copy=function(t,e,n,r,i){return this},t.prototype.ot=function(t,e,n){return new Tt(t,e)},t.prototype.remove=function(t,e){return this},t.prototype.m=function(){return!0},t.prototype.ht=function(t){return!1},t.prototype.lt=function(t){return!1},t.prototype.ct=function(){return null},t.prototype.ut=function(){return null},t.prototype.yt=function(){return!1},t.prototype.Ct=function(){return!0},t.prototype.Nt=function(){return 0},t}());var xt=function(){function t(t){this.i=t,this.data=new St(this.i)}return t.prototype.has=function(t){return null!==this.data.get(t)},t.prototype.first=function(){return this.data.ct()},t.prototype.last=function(){return this.data.ut()},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.ht((function(e,n){return t(e),!1}))},t.prototype.Ft=function(t,e){for(var n=this.data.ft(t[0]);n.At();){var r=n.It();if(this.i(r.key,t[1])>=0)return;e(r.key)}},t.prototype.xt=function(t,e){var n;for(n=void 0!==e?this.data.ft(e):this.data._t();n.At();)if(!t(n.It().key))return},t.prototype.$t=function(t){var e=this.data.ft(t);return e.At()?e.It().key:null},t.prototype._t=function(){return new Ct(this.data._t())},t.prototype.ft=function(t){return new Ct(this.data.ft(t))},t.prototype.add=function(t){return this.copy(this.data.remove(t).ot(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.kt=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._t(),r=e.data._t();n.At();){var i=n.It().key,o=r.It().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}(),Ct=function(){function t(t){this.Mt=t}return t.prototype.It=function(){return this.Mt.It().key},t.prototype.At=function(){return this.Mt.At()},t}(),At=new St(A.i);function Nt(){return At}function kt(){return Nt()}var Rt=new St(A.i);function Dt(){return Rt}var Ot=new St(A.i),Pt=new xt(A.i);function Lt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=Pt,r=0,i=t;r<i.length;r++){var o=i[r];n=n.add(o)}return n}var Ut=new xt(Z);function Mt(){return Ut}var Vt=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.Ot=Dt(),this.Lt=new St(this.i)}return t.Bt=function(e){return new t(e.i)},t.prototype.has=function(t){return null!=this.Ot.get(t)},t.prototype.get=function(t){return this.Ot.get(t)},t.prototype.first=function(){return this.Lt.ct()},t.prototype.last=function(){return this.Lt.ut()},t.prototype.m=function(){return this.Lt.m()},t.prototype.indexOf=function(t){var e=this.Ot.get(t);return e?this.Lt.indexOf(e):-1},Object.defineProperty(t.prototype,"size",{get:function(){return this.Lt.size},enumerable:!1,configurable:!0}),t.prototype.forEach=function(t){this.Lt.ht((function(e,n){return t(e),!1}))},t.prototype.add=function(t){var e=this.delete(t.key);return e.copy(e.Ot.ot(t.key,t),e.Lt.ot(t,null))},t.prototype.delete=function(t){var e=this.get(t);return e?this.copy(this.Ot.remove(t),this.Lt.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.Lt._t(),r=e.Lt._t();n.At();){var i=n.It().key,o=r.It().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.Ot=e,r.Lt=n,r},t}(),jt=function(){function t(){this.qt=new St(A.i)}return t.prototype.track=function(t){var e=t.doc.key,n=this.qt.get(e);n?0!==t.type&&3===n.type?this.qt=this.qt.ot(e,t):3===t.type&&1!==n.type?this.qt=this.qt.ot(e,{type:n.type,doc:t.doc}):2===t.type&&2===n.type?this.qt=this.qt.ot(e,{type:2,doc:t.doc}):2===t.type&&0===n.type?this.qt=this.qt.ot(e,{type:0,doc:t.doc}):1===t.type&&0===n.type?this.qt=this.qt.remove(e):1===t.type&&2===n.type?this.qt=this.qt.ot(e,{type:1,doc:n.doc}):0===t.type&&1===n.type?this.qt=this.qt.ot(e,{type:2,doc:t.doc}):y():this.qt=this.qt.ot(e,t)},t.prototype.Ut=function(){var t=[];return this.qt.ht((function(e,n){t.push(n)})),t},t}(),Ft=function(){function t(t,e,n,r,i,o,s,a){this.query=t,this.docs=e,this.Qt=n,this.docChanges=r,this.Wt=i,this.fromCache=o,this.jt=s,this.Kt=a}return t.Gt=function(e,n,r,i){var o=[];return n.forEach((function(t){o.push({type:0,doc:t})})),new t(e,n,Vt.Bt(n),o,r,i,!0,!1)},Object.defineProperty(t.prototype,"hasPendingWrites",{get:function(){return!this.Wt.m()},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){if(!(this.fromCache===t.fromCache&&this.jt===t.jt&&this.Wt.isEqual(t.Wt)&&Gn(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.Qt.isEqual(t.Qt)))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}(),qt=function(){function t(t,e,n,r,i){this.nt=t,this.zt=e,this.Ht=n,this.Yt=r,this.Jt=i}return t.Xt=function(e,n){var r=new Map;return r.set(e,zt.Zt(e,n)),new t(ut.min(),r,Mt(),Nt(),Lt())},t}(),zt=function(){function t(t,e,n,r,i){this.resumeToken=t,this.te=e,this.ee=n,this.ne=r,this.se=i}return t.Zt=function(e,n){return new t(J.B,n,Lt(),Lt(),Lt())},t}(),Bt=function(t,e,n,r){this.ie=t,this.removedTargetIds=e,this.key=n,this.re=r},Ht=function(t,e){this.targetId=t,this.oe=e},Gt=function(t,e,n,r){void 0===n&&(n=J.B),void 0===r&&(r=null),this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=r},$t=function(){function t(){this.ae=0,this.ce=Qt(),this.ue=J.B,this.he=!1,this.le=!0}return Object.defineProperty(t.prototype,"te",{get:function(){return this.he},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resumeToken",{get:function(){return this.ue},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_e",{get:function(){return 0!==this.ae},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fe",{get:function(){return this.le},enumerable:!1,configurable:!0}),t.prototype.de=function(t){t.O()>0&&(this.le=!0,this.ue=t)},t.prototype.we=function(){var t=Lt(),e=Lt(),n=Lt();return this.ce.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:y()}})),new zt(this.ue,this.he,t,e,n)},t.prototype.me=function(){this.le=!1,this.ce=Qt()},t.prototype.Te=function(t,e){this.le=!0,this.ce=this.ce.ot(t,e)},t.prototype.Ee=function(t){this.le=!0,this.ce=this.ce.remove(t)},t.prototype.Ie=function(){this.ae+=1},t.prototype.Ae=function(){this.ae-=1},t.prototype.Re=function(){this.le=!0,this.he=!0},t}(),Wt=function(){function t(t){this.ge=t,this.Pe=new Map,this.ye=Nt(),this.Ve=Kt(),this.pe=new xt(Z)}return t.prototype.be=function(t){for(var e=0,n=t.ie;e<n.length;e++){var r=n[e];t.re instanceof Nn?this.ve(r,t.re):t.re instanceof kn&&this.Se(r,t.key,t.re)}for(var i=0,o=t.removedTargetIds;i<o.length;i++)this.Se(o[i],t.key,t.re)},t.prototype.De=function(t){var e=this;this.Ce(t,(function(n){var r=e.Ne(n);switch(t.state){case 0:e.Fe(n)&&r.de(t.resumeToken);break;case 1:r.Ae(),r._e||r.me(),r.de(t.resumeToken);break;case 2:r.Ae(),r._e||e.removeTarget(n);break;case 3:e.Fe(n)&&(r.Re(),r.de(t.resumeToken));break;case 4:e.Fe(n)&&(e.xe(n),r.de(t.resumeToken));break;default:y()}}))},t.prototype.Ce=function(t,e){var n=this;t.targetIds.length>0?t.targetIds.forEach(e):this.Pe.forEach((function(t,r){n.Fe(r)&&e(r)}))},t.prototype.$e=function(t){var e=t.targetId,n=t.oe.count,r=this.ke(e);if(r){var i=r.target;if(vt(i))if(0===n){var o=new A(i.path);this.Se(e,o,new kn(o,ut.min()))}else w(1===n);else this.Me(e)!==n&&(this.xe(e),this.pe=this.pe.add(e))}},t.prototype.Oe=function(t){var e=this,n=new Map;this.Pe.forEach((function(r,i){var o=e.ke(i);if(o){if(r.te&&vt(o.target)){var s=new A(o.target.path);null!==e.ye.get(s)||e.Le(i,s)||e.Se(i,s,new kn(s,t))}r.fe&&(n.set(i,r.we()),r.me())}}));var r=Lt();this.Ve.forEach((function(t,n){var i=!0;n.xt((function(t){var n=e.ke(t);return!n||2===n.et||(i=!1,!1)})),i&&(r=r.add(t))}));var i=new qt(t,n,this.pe,this.ye,r);return this.ye=Nt(),this.Ve=Kt(),this.pe=new xt(Z),i},t.prototype.ve=function(t,e){if(this.Fe(t)){var n=this.Le(t,e.key)?2:0;this.Ne(t).Te(e.key,n),this.ye=this.ye.ot(e.key,e),this.Ve=this.Ve.ot(e.key,this.Be(e.key).add(t))}},t.prototype.Se=function(t,e,n){if(this.Fe(t)){var r=this.Ne(t);this.Le(t,e)?r.Te(e,1):r.Ee(e),this.Ve=this.Ve.ot(e,this.Be(e).delete(t)),n&&(this.ye=this.ye.ot(e,n))}},t.prototype.removeTarget=function(t){this.Pe.delete(t)},t.prototype.Me=function(t){var e=this.Ne(t).we();return this.ge.qe(t).size+e.ee.size-e.se.size},t.prototype.Ie=function(t){this.Ne(t).Ie()},t.prototype.Ne=function(t){var e=this.Pe.get(t);return e||(e=new $t,this.Pe.set(t,e)),e},t.prototype.Be=function(t){var e=this.Ve.get(t);return e||(e=new xt(Z),this.Ve=this.Ve.ot(t,e)),e},t.prototype.Fe=function(t){var e=null!==this.ke(t);return e||p("WatchChangeAggregator","Detected inactive target",t),e},t.prototype.ke=function(t){var e=this.Pe.get(t);return e&&e._e?null:this.ge.Ue(t)},t.prototype.xe=function(t){var e=this;this.Pe.set(t,new $t),this.ge.qe(t).forEach((function(n){e.Se(t,n,null)}))},t.prototype.Le=function(t,e){return this.ge.qe(t).has(e)},t}();function Kt(){return new St(A.i)}function Qt(){return new St(A.i)}function Zt(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 Yt(t){var e=oe(t.mapValue.fields.__local_write_time__.timestampValue);return new at(e.seconds,e.nanos)}var Xt=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Jt(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?Zt(t)?4:10:y()}function te(t,e){var n=Jt(t);if(n!==Jt(e))return!1;switch(n){case 0:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return Yt(t).isEqual(Yt(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=oe(t.timestampValue),r=oe(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 ae(t.bytesValue).isEqual(ae(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return se(t.geoPointValue.latitude)===se(e.geoPointValue.latitude)&&se(t.geoPointValue.longitude)===se(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return se(t.integerValue)===se(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){var n=se(t.doubleValue),r=se(e.doubleValue);return n===r?lt(n)===lt(r):isNaN(n)&&isNaN(r)}return!1}(t,e);case 9:return Y(t.arrayValue.values||[],e.arrayValue.values||[],te);case 10:return function(t,e){var n=t.mapValue.fields||{},r=e.mapValue.fields||{};if(_(n)!==_(r))return!1;for(var i in n)if(n.hasOwnProperty(i)&&(void 0===r[i]||!te(n[i],r[i])))return!1;return!0}(t,e);default:return y()}}function ee(t,e){return void 0!==(t.values||[]).find((function(t){return te(t,e)}))}function ne(t,e){var n=Jt(t),r=Jt(e);if(n!==r)return Z(n,r);switch(n){case 0:return 0;case 1:return Z(t.booleanValue,e.booleanValue);case 2:return function(t,e){var n=se(t.integerValue||t.doubleValue),r=se(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 re(t.timestampValue,e.timestampValue);case 4:return re(Yt(t),Yt(e));case 5:return Z(t.stringValue,e.stringValue);case 6:return function(t,e){var n=ae(t),r=ae(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=Z(n[i],r[i]);if(0!==o)return o}return Z(n.length,r.length)}(t.referenceValue,e.referenceValue);case 8:return function(t,e){var n=Z(se(t.latitude),se(e.latitude));return 0!==n?n:Z(se(t.longitude),se(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=ne(n[i],r[i]);if(o)return o}return Z(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=Z(r[s],o[s]);if(0!==a)return a;var u=ne(n[r[s]],i[o[s]]);if(0!==u)return u}return Z(r.length,o.length)}(t.mapValue,e.mapValue);default:throw y()}}function re(t,e){if("string"==typeof t&&"string"==typeof e&&t.length===e.length)return Z(t,e);var n=oe(t),r=oe(e),i=Z(n.seconds,r.seconds);return 0!==i?i:Z(n.nanos,r.nanos)}function ie(t){return function t(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(t){var e=oe(t);return"time("+e.seconds+","+e.nanos+")"}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?ae(e.bytesValue).toBase64():"referenceValue"in e?A.C(e.referenceValue).toString():"geoPointValue"in e?"geo("+(n=e.geoPointValue).latitude+","+n.longitude+")":"arrayValue"in e?function(e){for(var n="[",r=!0,i=0,o=e.values||[];i<o.length;i++)r?r=!1:n+=",",n+=t(o[i]);return n+"]"}(e.arrayValue):"mapValue"in e?function(e){for(var n="{",r=!0,i=0,o=Object.keys(e.fields||{}).sort();i<o.length;i++){var s=o[i];r?r=!1:n+=",",n+=s+":"+t(e.fields[s])}return n+"}"}(e.mapValue):y();var n}(t)}function oe(t){if(w(!!t),"string"==typeof t){var e=0,n=Xt.exec(t);if(w(!!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:se(t.seconds),nanos:se(t.nanos)}}function se(t){return"number"==typeof t?t:"string"==typeof t?Number(t):0}function ae(t){return"string"==typeof t?J.fromBase64String(t):J.fromUint8Array(t)}function ue(t,e){return{referenceValue:"projects/"+t.projectId+"/databases/"+t.database+"/documents/"+e.path.R()}}function ce(t){return!!t&&"integerValue"in t}function le(t){return!!t&&"arrayValue"in t}function he(t){return!!t&&"nullValue"in t}function fe(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function de(t){return!!t&&"mapValue"in t}var pe={asc:"ASCENDING",desc:"DESCENDING"},ge={"<":"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"},ve=function(t,e){this.U=t,this.Qe=e};function me(t){return{integerValue:""+t}}function ye(t,e){if(t.Qe){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 we(t,e){return ht(e)?me(e):ye(t,e)}function be(t,e){return t.Qe?new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")+"."+("000000000"+e.nanoseconds).slice(-9)+"Z":{seconds:""+e.seconds,nanos:e.nanoseconds}}function _e(t,e){return t.Qe?e.toBase64():e.toUint8Array()}function Ee(t,e){return be(t,e.Z())}function Se(t){return w(!!t),ut.J(function(t){var e=oe(t);return new at(e.seconds,e.nanos)}(t))}function Ie(t,e){return function(t){return new T(["projects",t.projectId,"databases",t.database])}(t).child("documents").child(e).R()}function Te(t){var e=T.g(t);return w($e(e)),e}function xe(t,e){return Ie(t.U,e.path)}function Ce(t,e){var n=Te(e);return w(n.get(1)===t.U.projectId),w(!n.get(3)&&!t.U.database||n.get(3)===t.U.database),new A(Re(n))}function Ae(t,e){return Ie(t.U,e)}function Ne(t){var e=Te(t);return 4===e.length?T.P():Re(e)}function ke(t){return new T(["projects",t.U.projectId,"databases",t.U.database]).R()}function Re(t){return w(t.length>4&&"documents"===t.get(4)),t.u(5)}function De(t,e,n){return{name:xe(t,e),fields:n.proto.mapValue.fields}}function Oe(t,e){var n;if(e instanceof mn)n={update:De(t,e.key,e.value)};else if(e instanceof Sn)n={delete:xe(t,e.key)};else if(e instanceof yn)n={update:De(t,e.key,e.data),updateMask:Ge(e.We)};else if(e instanceof bn)n={transform:{document:xe(t,e.key),fieldTransforms:e.fieldTransforms.map((function(t){return function(t,e){var n=e.transform;if(n instanceof Ye)return{fieldPath:e.field.R(),setToServerValue:"REQUEST_TIME"};if(n instanceof Xe)return{fieldPath:e.field.R(),appendMissingElements:{values:n.elements}};if(n instanceof tn)return{fieldPath:e.field.R(),removeAllFromArray:{values:n.elements}};if(n instanceof nn)return{fieldPath:e.field.R(),increment:n.je};throw y()}(0,t)}))}};else{if(!(e instanceof In))return y();n={verify:xe(t,e.key)}}return e.Ge.Ke||(n.currentDocument=function(t,e){return void 0!==e.updateTime?{updateTime:Ee(t,e.updateTime)}:void 0!==e.exists?{exists:e.exists}:y()}(t,e.Ge)),n}function Pe(t,e){var n=e.currentDocument?function(t){return void 0!==t.updateTime?cn.updateTime(Se(t.updateTime)):void 0!==t.exists?cn.exists(t.exists):cn.ze()}(e.currentDocument):cn.ze();if(e.update){var r=Ce(t,e.update.name),i=new Tn({mapValue:{fields:e.update.fields}});if(e.updateMask){var o=function(t){return new sn((t.fieldPaths||[]).map((function(t){return C.S(t)})))}(e.updateMask);return new yn(r,i,o,n)}return new mn(r,i,n)}if(e.delete){var s=Ce(t,e.delete);return new Sn(s,n)}if(e.transform){var a=Ce(t,e.transform.document),u=e.transform.fieldTransforms.map((function(e){return function(t,e){var n=null;"setToServerValue"in e?(w("REQUEST_TIME"===e.setToServerValue),n=new Ye):"appendMissingElements"in e?n=new Xe(e.appendMissingElements.values||[]):"removeAllFromArray"in e?n=new tn(e.removeAllFromArray.values||[]):"increment"in e?n=new nn(t,e.increment):y();var r=C.S(e.fieldPath);return new an(r,n)}(t,e)}));return w(!0===n.exists),new bn(a,u)}if(e.verify){var c=Ce(t,e.verify);return new In(c,n)}return y()}function Le(t,e){return{documents:[Ae(t,e.path)]}}function Ue(t,e){var n={structuredQuery:{}},r=e.path;null!==e.collectionGroup?(n.parent=Ae(t,r),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=Ae(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(fe(t.value))return{unaryFilter:{field:qe(t.field),op:"IS_NAN"}};if(he(t.value))return{unaryFilter:{field:qe(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(fe(t.value))return{unaryFilter:{field:qe(t.field),op:"IS_NOT_NAN"}};if(he(t.value))return{unaryFilter:{field:qe(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:qe(t.field),op:Fe(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:qe(t.field),direction:je(t.dir)}}(t)}))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);var s=function(t,e){return t.Qe||ct(e)?e:{value:e}}(t,e.limit);return null!==s&&(n.structuredQuery.limit=s),e.startAt&&(n.structuredQuery.startAt=Me(e.startAt)),e.endAt&&(n.structuredQuery.endAt=Me(e.endAt)),n}function Me(t){return{before:t.before,values:t.position}}function Ve(t){return new or(t.values||[],!!t.before)}function je(t){return pe[t]}function Fe(t){return ge[t]}function qe(t){return{fieldPath:t.R()}}function ze(t){return C.S(t.fieldPath)}function Be(t){return Zn.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 y()}}(t.fieldFilter.op),t.fieldFilter.value)}function He(t){switch(t.unaryFilter.op){case"IS_NAN":var e=ze(t.unaryFilter.field);return Zn.create(e,"==",{doubleValue:NaN});case"IS_NULL":var n=ze(t.unaryFilter.field);return Zn.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":var r=ze(t.unaryFilter.field);return Zn.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":var i=ze(t.unaryFilter.field);return Zn.create(i,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":default:return y()}}function Ge(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)}var We=function(){this.He=void 0};function Ke(t,e,n){return t instanceof Ye?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 Xe?Je(t,e):t instanceof tn?en(t,e):function(t,e){var n=Ze(t,e),r=rn(n)+rn(t.je);return ce(n)&&ce(t.je)?me(r):ye(t.serializer,r)}(t,e)}function Qe(t,e,n){return t instanceof Xe?Je(t,e):t instanceof tn?en(t,e):n}function Ze(t,e){return t instanceof nn?ce(n=e)||function(t){return!!t&&"doubleValue"in t}(n)?e:{integerValue:0}:null;var n}var Ye=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(We),Xe=function(t){function e(e){var n=this;return(n=t.call(this)||this).elements=e,n}return r.__extends(e,t),e}(We);function Je(t,e){for(var n=on(e),r=function(t){n.some((function(e){return te(e,t)}))||n.push(t)},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var tn=function(t){function e(e){var n=this;return(n=t.call(this)||this).elements=e,n}return r.__extends(e,t),e}(We);function en(t,e){for(var n=on(e),r=function(t){n=n.filter((function(e){return!te(e,t)}))},i=0,o=t.elements;i<o.length;i++)r(o[i]);return{arrayValue:{values:n}}}var nn=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).serializer=e,r.je=n,r}return r.__extends(e,t),e}(We);function rn(t){return se(t.integerValue||t.doubleValue)}function on(t){return le(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}var sn=function(){function t(t){this.fields=t,t.sort(C.i)}return t.prototype.Ye=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 Y(this.fields,t.fields,(function(t,e){return t.isEqual(e)}))},t}(),an=function(t,e){this.field=t,this.transform=e},un=function(t,e){this.version=t,this.transformResults=e},cn=function(){function t(t,e){this.updateTime=t,this.exists=e}return t.ze=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,"Ke",{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 ln(t,e){return void 0!==t.updateTime?e instanceof Nn&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e instanceof Nn}var hn=function(){};function fn(t,e,n){return t instanceof mn?function(t,e,n){return new Nn(t.key,n.version,t.value,{hasCommittedMutations:!0})}(t,0,n):t instanceof yn?function(t,e,n){if(!ln(t.Ge,e))return new Rn(t.key,n.version);var r=wn(t,e);return new Nn(t.key,n.version,r,{hasCommittedMutations:!0})}(t,e,n):t instanceof bn?function(t,e,n){if(w(null!=n.transformResults),!ln(t.Ge,e))return new Rn(t.key,n.version);var r=_n(0,e),i=function(t,e,n){var r=[];w(t.length===n.length);for(var i=0;i<n.length;i++){var o=t[i],s=o.transform,a=null;e instanceof Nn&&(a=e.field(o.field)),r.push(Qe(s,a,n[i]))}return r}(t.fieldTransforms,e,n.transformResults),o=n.version,s=En(t,r.data(),i);return new Nn(t.key,o,s,{hasCommittedMutations:!0})}(t,e,n):function(t,e,n){return new kn(t.key,n.version,{hasCommittedMutations:!0})}(t,0,n)}function dn(t,e,n,r){return t instanceof mn?function(t,e){if(!ln(t.Ge,e))return e;var n=vn(e);return new Nn(t.key,n,t.value,{Je:!0})}(t,e):t instanceof yn?function(t,e){if(!ln(t.Ge,e))return e;var n=vn(e),r=wn(t,e);return new Nn(t.key,n,r,{Je:!0})}(t,e):t instanceof bn?function(t,e,n,r){if(!ln(t.Ge,e))return e;var i=_n(0,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 Nn&&(c=n.field(a.field)),null===c&&r instanceof Nn&&(c=r.field(a.field)),i.push(Ke(u,c,e))}return i}(t.fieldTransforms,n,e,r),s=En(t,i.data(),o);return new Nn(t.key,i.version,s,{Je:!0})}(t,e,r,n):function(t,e){return ln(t.Ge,e)?new kn(t.key,ut.min()):e}(t,e)}function pn(t,e){return t instanceof bn?function(t,e){for(var n=null,r=0,i=t.fieldTransforms;r<i.length;r++){var o=i[r],s=e instanceof Nn?e.field(o.field):void 0,a=Ze(o.transform,s||null);null!=a&&(n=null==n?(new xn).set(o.field,a):n.set(o.field,a))}return n?n.Xe():null}(t,e):null}function gn(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.Ge.isEqual(e.Ge)&&(0===t.type?t.value.isEqual(e.value):1===t.type?t.data.isEqual(e.data)&&t.We.isEqual(e.We):2!==t.type||Y(t.fieldTransforms,t.fieldTransforms,(function(t,e){return function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof Xe&&e instanceof Xe||t instanceof tn&&e instanceof tn?Y(t.elements,e.elements,te):t instanceof nn&&e instanceof nn?te(t.je,e.je):t instanceof Ye&&e instanceof Ye}(t.transform,e.transform)}(t,e)})))}function vn(t){return t instanceof Nn?t.version:ut.min()}var mn=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).key=e,i.value=n,i.Ge=r,i.type=0,i}return r.__extends(e,t),e}(hn),yn=function(t){function e(e,n,r,i){var o=this;return(o=t.call(this)||this).key=e,o.data=n,o.We=r,o.Ge=i,o.type=1,o}return r.__extends(e,t),e}(hn);function wn(t,e){return function(t,e){var n=new xn(e);return t.We.fields.forEach((function(e){if(!e.m()){var r=t.data.field(e);null!==r?n.set(e,r):n.delete(e)}})),n.Xe()}(t,e instanceof Nn?e.data():Tn.empty())}var bn=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.fieldTransforms=n,r.type=2,r.Ge=cn.exists(!0),r}return r.__extends(e,t),e}(hn);function _n(t,e){return e}function En(t,e,n){for(var r=new xn(e),i=0;i<t.fieldTransforms.length;i++)r.set(t.fieldTransforms[i].field,n[i]);return r.Xe()}var Sn=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.Ge=n,r.type=3,r}return r.__extends(e,t),e}(hn),In=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).key=e,r.Ge=n,r.type=4,r}return r.__extends(e,t),e}(hn),Tn=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(!de(e=e.mapValue.fields[t.get(n)]))return null}return(e=(e.mapValue.fields||{})[t._()])||null},t.prototype.isEqual=function(t){return te(this.proto,t.proto)},t}(),xn=function(){function t(t){void 0===t&&(t=Tn.empty()),this.Ze=t,this.tn=new Map}return t.prototype.set=function(t,e){return this.en(t,e),this},t.prototype.delete=function(t){return this.en(t,null),this},t.prototype.en=function(t,e){for(var n=this.tn,r=0;r<t.length-1;++r){var i=t.get(r),o=n.get(i);o instanceof Map?n=o:o&&10===Jt(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.Xe=function(){var t=this.nn(C.P(),this.tn);return null!=t?new Tn(t):this.Ze},t.prototype.nn=function(t,e){var n=this,r=!1,i=this.Ze.field(t),o=de(i)?Object.assign({},i.mapValue.fields):{};return e.forEach((function(e,i){if(e instanceof Map){var s=n.nn(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 Cn(t){var e=[];return E(t.fields||{},(function(t,n){var r=new C([t]);if(de(n)){var i=Cn(n.mapValue).fields;if(0===i.length)e.push(r);else for(var o=0,s=i;o<s.length;o++)e.push(r.child(s[o]))}else e.push(r)})),new sn(e)}var An=function(t,e){this.key=t,this.version=e},Nn=function(t){function e(e,n,r,i){var o=this;return(o=t.call(this,e,n)||this).sn=r,o.Je=!!i.Je,o.hasCommittedMutations=!!i.hasCommittedMutations,o}return r.__extends(e,t),e.prototype.field=function(t){return this.sn.field(t)},e.prototype.data=function(){return this.sn},e.prototype.rn=function(){return this.sn.proto},e.prototype.isEqual=function(t){return t instanceof e&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.Je===t.Je&&this.hasCommittedMutations===t.hasCommittedMutations&&this.sn.isEqual(t.sn)},e.prototype.toString=function(){return"Document("+this.key+", "+this.version+", "+this.sn.toString()+", {hasLocalMutations: "+this.Je+"}), {hasCommittedMutations: "+this.hasCommittedMutations+"})"},Object.defineProperty(e.prototype,"hasPendingWrites",{get:function(){return this.Je||this.hasCommittedMutations},enumerable:!1,configurable:!0}),e}(An),kn=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},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}(An),Rn=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}(An),Dn=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.on=n,this.filters=r,this.limit=i,this.an=o,this.startAt=s,this.endAt=a,this.cn=null,this.un=null};function On(t,e,n,r,i,o,s,a){return new Dn(t,e,n,r,i,o,s,a)}function Pn(t){return new Dn(t)}function Ln(t){return!ct(t.limit)&&"F"===t.an}function Un(t){return!ct(t.limit)&&"L"===t.an}function Mn(t){return t.on.length>0?t.on[0].field:null}function Vn(t){for(var e=0,n=t.filters;e<n.length;e++){var r=n[e];if(r.hn())return r.field}return null}function jn(t){return null!==t.collectionGroup}function Fn(t){var e=b(t);if(null===e.cn){e.cn=[];var n=Vn(e),r=Mn(e);if(null!==n&&null===r)n.p()||e.cn.push(new cr(n)),e.cn.push(new cr(C.v(),"asc"));else{for(var i=!1,o=0,s=e.on;o<s.length;o++){var a=s[o];e.cn.push(a),a.field.p()&&(i=!0)}if(!i){var u=e.on.length>0?e.on[e.on.length-1].dir:"asc";e.cn.push(new cr(C.v(),u))}}}return e.cn}function qn(t){var e=b(t);if(!e.un)if("F"===e.an)e.un=dt(e.path,e.collectionGroup,Fn(e),e.filters,e.limit,e.startAt,e.endAt);else{for(var n=[],r=0,i=Fn(e);r<i.length;r++){var o=i[r];n.push(new cr(o.field,"desc"===o.dir?"asc":"desc"))}var s=e.endAt?new or(e.endAt.position,!e.endAt.before):null,a=e.startAt?new or(e.startAt.position,!e.startAt.before):null;e.un=dt(e.path,e.collectionGroup,n,e.filters,e.limit,s,a)}return e.un}function zn(t,e,n){return new Dn(t.path,t.collectionGroup,t.on.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function Bn(t,e){return new Dn(t.path,t.collectionGroup,t.on.slice(),t.filters.slice(),t.limit,t.an,e,t.endAt)}function Hn(t,e){return new Dn(t.path,t.collectionGroup,t.on.slice(),t.filters.slice(),t.limit,t.an,t.startAt,e)}function Gn(t,e){return gt(qn(t),qn(e))&&t.an===e.an}function $n(t){return pt(qn(t))+"|lt:"+t.an}function Wn(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+" "+ie(e.value);var e})).join(", ")+"]"),ct(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: "+sr(t.startAt)),t.endAt&&(e+=", endAt: "+sr(t.endAt)),"Target("+e+")"}(qn(t))+"; limitType="+t.an+")"}function Kn(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.on;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&&!ar(t.startAt,Fn(t),e)||t.endAt&&ar(t.endAt,Fn(t),e))}(t,e)}function Qn(t){return function(e,n){for(var r=!1,i=0,o=Fn(t);i<o.length;i++){var s=o[i],a=lr(s,e,n);if(0!==a)return a;r=r||s.field.p()}return 0}}var Zn=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.ln(t,n,r):new Yn(t,n,r);if(he(r)){if("=="!==n&&"!="!==n)throw new h(l.INVALID_ARGUMENT,"Invalid query. Null only supports '==' and '!=' comparisons.");return new e(t,n,r)}if(fe(r)){if("=="!==n&&"!="!==n)throw new h(l.INVALID_ARGUMENT,"Invalid query. NaN only supports '==' and '!=' comparisons.");return new e(t,n,r)}return"array-contains"===n?new er(t,r):"in"===n?new nr(t,r):"not-in"===n?new rr(t,r):"array-contains-any"===n?new ir(t,r):new e(t,n,r)},e.ln=function(t,e,n){return"in"===e?new Xn(t,n):new Jn(t,n)},e.prototype.matches=function(t){var e=t.field(this.field);return"!="===this.op?null!==e&&this._n(ne(e,this.value)):null!==e&&Jt(this.value)===Jt(e)&&this._n(ne(e,this.value))},e.prototype._n=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 y()}},e.prototype.hn=function(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0},e}((function(){})),Yn=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._n(e)},e}(Zn),Xn=function(t){function e(e,n){var r=this;return(r=t.call(this,e,"in",n)||this).keys=tr(0,n),r}return r.__extends(e,t),e.prototype.matches=function(t){return this.keys.some((function(e){return e.isEqual(t.key)}))},e}(Zn),Jn=function(t){function e(e,n){var r=this;return(r=t.call(this,e,"not-in",n)||this).keys=tr(0,n),r}return r.__extends(e,t),e.prototype.matches=function(t){return!this.keys.some((function(e){return e.isEqual(t.key)}))},e}(Zn);function tr(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 er=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 le(e)&&ee(e.arrayValue,this.value)},e}(Zn),nr=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&&ee(this.value.arrayValue,e)},e}(Zn),rr=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(ee(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;var e=t.field(this.field);return null!==e&&!ee(this.value.arrayValue,e)},e}(Zn),ir=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!(!le(n)||!n.arrayValue.values)&&n.arrayValue.values.some((function(t){return ee(e.value.arrayValue,t)}))},e}(Zn),or=function(t,e){this.position=t,this.before=e};function sr(t){return(t.before?"b":"a")+":"+t.position.map((function(t){return ie(t)})).join(",")}function ar(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):ne(s,n.field(o.field)),"desc"===o.dir&&(r*=-1),0!==r)break}return t.before?r<=0:r<0}function ur(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(!te(t.position[n],e.position[n]))return!1;return!0}var cr=function(t,e){void 0===e&&(e="asc"),this.field=t,this.dir=e};function lr(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?ne(r,i):y()}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return y()}}function hr(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}var fr=function(){var t=this;this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},dr=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.fn=t,this.dn=e,this.wn=n,this.mn=r,this.Tn=i,this.En=0,this.In=null,this.An=Date.now(),this.reset()}return t.prototype.reset=function(){this.En=0},t.prototype.Rn=function(){this.En=this.Tn},t.prototype.gn=function(t){var e=this;this.cancel();var n=Math.floor(this.En+this.Pn()),r=Math.max(0,Date.now()-this.An),i=Math.max(0,n-r);i>0&&p("ExponentialBackoff","Backing off for "+i+" ms (base delay: "+this.En+" ms, delay with jitter: "+n+" ms, last attempt: "+r+" ms ago)"),this.In=this.fn.yn(this.dn,i,(function(){return e.An=Date.now(),t()})),this.En*=this.mn,this.En<this.wn&&(this.En=this.wn),this.En>this.Tn&&(this.En=this.Tn)},t.prototype.Vn=function(){null!==this.In&&(this.In.pn(),this.In=null)},t.prototype.cancel=function(){null!==this.In&&(this.In.cancel(),this.In=null)},t.prototype.Pn=function(){return(Math.random()-.5)*this.En},t}(),pr=function(){function t(t){var e=this;this.bn=null,this.vn=null,this.result=void 0,this.error=void 0,this.Sn=!1,this.Dn=!1,t((function(t){e.Sn=!0,e.result=t,e.bn&&e.bn(t)}),(function(t){e.Sn=!0,e.error=t,e.vn&&e.vn(t)}))}return t.prototype.catch=function(t){return this.next(void 0,t)},t.prototype.next=function(e,n){var r=this;return this.Dn&&y(),this.Dn=!0,this.Sn?this.error?this.Cn(n,this.error):this.Nn(e,this.result):new t((function(t,i){r.bn=function(n){r.Nn(e,n).next(t,i)},r.vn=function(e){r.Cn(n,e).next(t,i)}}))},t.prototype.Fn=function(){var t=this;return new Promise((function(e,n){t.next(e,n)}))},t.prototype.xn=function(e){try{var n=e();return n instanceof t?n:t.resolve(n)}catch(e){return t.reject(e)}},t.prototype.Nn=function(e,n){return e?this.xn((function(){return e(n)})):t.resolve(n)},t.prototype.Cn=function(e,n){return e?this.xn((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.kn=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}(),gr=function(){function t(e,n,r){this.name=e,this.version=n,this.Mn=r,12.2===t.On(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 t.delete=function(t){return p("SimpleDb","Removing database:",t),_r(window.indexedDB.deleteDatabase(t)).Fn()},t.Ln=function(){if("undefined"==typeof indexedDB)return!1;if(t.Bn())return!0;var e=s.getUA(),n=t.On(e),r=0<n&&n<10,i=t.qn(e),o=0<i&&i<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||o)},t.Bn=function(){var t;return"undefined"!=typeof process&&"YES"===(null===(t=process.env)||void 0===t?void 0:t.Un)},t.Qn=function(t,e){return t.store(e)},t.On=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)},t.qn=function(t){var e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)},t.prototype.Wn=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]:(p("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){e(t.target.result)},i.onblocked=function(){r(new mr(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;r("VersionError"===n.name?new h(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."):new mr(t,n))},i.onupgradeneeded=function(t){p("SimpleDb",'Database "'+n.name+'" requires upgrade from version:',t.oldVersion),n.Mn.createOrUpgrade(t.target.result,i.transaction,t.oldVersion,n.version).next((function(){p("SimpleDb","Database upgrade to version "+n.version+" complete")}))}}))]);case 1:e.db=r.sent(),r.label=2;case 2:return[2,(this.jn&&(this.db.onversionchange=function(t){return n.jn(t)}),this.db)]}}))}))},t.prototype.Kn=function(t){this.jn=t,this.db&&(this.db.onversionchange=function(e){return t(e)})},t.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(l){switch(l.label){case 0:o="readonly"===e,s=0,a=function(){var e,a,c,l,h;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.Wn(t)];case 2:return u.db=r.sent(),e=wr.open(u.db,t,o?"readonly":"readwrite",n),a=i(e).catch((function(t){return e.abort(t),pr.reject(t)})).Fn(),c={},a.catch((function(){})),[4,e.Gn];case 3:return[2,(c.value=(r.sent(),a),c)];case 4:return p("SimpleDb","Transaction failed with error:",(l=r.sent()).message,"Retrying:",h="FirebaseError"!==l.name&&s<3),u.close(),h?[3,5]:[2,{value:Promise.reject(l)}];case 5:return[2]}}))},u=this,l.label=1;case 1:return[5,a()];case 2:if("object"==typeof(c=l.sent()))return[2,c.value];l.label=3;case 3:return[3,1];case 4:return[2]}}))}))},t.prototype.close=function(){this.db&&this.db.close(),this.db=void 0},t}(),vr=function(){function t(t){this.zn=t,this.Hn=!1,this.Yn=null}return Object.defineProperty(t.prototype,"Sn",{get:function(){return this.Hn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Jn",{get:function(){return this.Yn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursor",{set:function(t){this.zn=t},enumerable:!1,configurable:!0}),t.prototype.done=function(){this.Hn=!0},t.prototype.Xn=function(t){this.Yn=t},t.prototype.delete=function(){return _r(this.zn.delete())},t}(),mr=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}(h);function yr(t){return"IndexedDbTransactionError"===t.name}var wr=function(){function t(t,e){var n=this;this.action=t,this.transaction=e,this.aborted=!1,this.Zn=new fr,this.transaction.oncomplete=function(){n.Zn.resolve()},this.transaction.onabort=function(){e.error?n.Zn.reject(new mr(t,e.error)):n.Zn.resolve()},this.transaction.onerror=function(e){var r=Sr(e.target.error);n.Zn.reject(new mr(t,r))}}return t.open=function(e,n,r,i){try{return new t(n,e.transaction(i,r))}catch(e){throw new mr(n,e)}},Object.defineProperty(t.prototype,"Gn",{get:function(){return this.Zn.promise},enumerable:!1,configurable:!0}),t.prototype.abort=function(t){t&&this.Zn.reject(t),this.aborted||(p("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 br(e)},t}(),br=function(){function t(t){this.store=t}return t.prototype.put=function(t,e){var n;return void 0!==e?(p("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(p("SimpleDb","PUT",this.store.name,"<auto-key>",t),n=this.store.put(t)),_r(n)},t.prototype.add=function(t){return p("SimpleDb","ADD",this.store.name,t,t),_r(this.store.add(t))},t.prototype.get=function(t){var e=this;return _r(this.store.get(t)).next((function(n){return void 0===n&&(n=null),p("SimpleDb","GET",e.store.name,t,n),n}))},t.prototype.delete=function(t){return p("SimpleDb","DELETE",this.store.name,t),_r(this.store.delete(t))},t.prototype.count=function(){return p("SimpleDb","COUNT",this.store.name),_r(this.store.count())},t.prototype.ts=function(t,e){var n=this.cursor(this.options(t,e)),r=[];return this.es(n,(function(t,e){r.push(e)})).next((function(){return r}))},t.prototype.ns=function(t,e){p("SimpleDb","DELETE ALL",this.store.name);var n=this.options(t,e);n.ss=!1;var r=this.cursor(n);return this.es(r,(function(t,e,n){return n.delete()}))},t.prototype.rs=function(t,e){var n;e?n=t:(n={},e=t);var r=this.cursor(n);return this.es(r,e)},t.prototype.os=function(t){var e=this.cursor({});return new pr((function(n,r){e.onerror=function(t){var e=Sr(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.es=function(t,e){var n=[];return new pr((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 vr(i),s=e(i.primaryKey,i.value,o);if(s instanceof pr){var a=s.catch((function(t){return o.done(),pr.reject(t)}));n.push(a)}o.Sn?r():null===o.Jn?i.continue():i.continue(o.Jn)}else r()}})).next((function(){return pr.$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.ss?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)},t}();function _r(t){return new pr((function(e,n){t.onsuccess=function(t){e(t.target.result)},t.onerror=function(t){var e=Sr(t.target.error);n(e)}}))}var Er=!1;function Sr(t){var e=gr.On(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 h("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 Er||(Er=!0,setTimeout((function(){throw r}),0)),r}}return t}function Ir(){return"undefined"!=typeof window?window:null}function Tr(){return"undefined"!=typeof document?document:null}var xr=function(){function t(t,e,n,r,i){this.cs=t,this.dn=e,this.us=n,this.op=r,this.hs=i,this.ls=new fr,this.then=this.ls.promise.then.bind(this.ls.promise),this.ls.promise.catch((function(t){}))}return t._s=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.fs=setTimeout((function(){return e.ds()}),t)},t.prototype.pn=function(){return this.ds()},t.prototype.cancel=function(t){null!==this.fs&&(this.clearTimeout(),this.ls.reject(new h(l.CANCELLED,"Operation cancelled"+(t?": "+t:""))))},t.prototype.ds=function(){var t=this;this.cs.ws((function(){return null!==t.fs?(t.clearTimeout(),t.op().then((function(e){return t.ls.resolve(e)}))):Promise.resolve()}))},t.prototype.clearTimeout=function(){null!==this.fs&&(this.hs(this),clearTimeout(this.fs),this.fs=null)},t}(),Cr=function(){function t(){var t=this;this.Ts=Promise.resolve(),this.Es=[],this.Is=!1,this.As=[],this.Rs=null,this.gs=!1,this.Ps=[],this.ys=new dr(this,"async_queue_retry"),this.Vs=function(){var e=Tr();e&&p("AsyncQueue","Visibility state changed to  ",e.visibilityState),t.ys.Vn()};var e=Tr();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.Vs)}return Object.defineProperty(t.prototype,"ps",{get:function(){return this.Is},enumerable:!1,configurable:!0}),t.prototype.ws=function(t){this.enqueue(t)},t.prototype.bs=function(t){this.vs(),this.Ss(t)},t.prototype.Ds=function(){if(!this.Is){this.Is=!0;var t=Tr();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.Vs)}},t.prototype.enqueue=function(t){return this.vs(),this.Is?new Promise((function(t){})):this.Ss(t)},t.prototype.Cs=function(t){var e=this;this.ws((function(){return e.Es.push(t),e.Ns()}))},t.prototype.Ns=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.Es.length)return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.Es[0]()];case 2:return n.sent(),this.Es.shift(),this.ys.reset(),[3,4];case 3:if(!yr(t=n.sent()))throw t;return p("AsyncQueue","Operation failed with retryable error: "+t),[3,4];case 4:this.Es.length>0&&this.ys.gn((function(){return e.Ns()})),n.label=5;case 5:return[2]}}))}))},t.prototype.Ss=function(t){var e=this,n=this.Ts.then((function(){return e.gs=!0,t().catch((function(t){throw e.Rs=t,e.gs=!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.gs=!1,t}))}));return this.Ts=n,n},t.prototype.yn=function(t,e,n){var r=this;this.vs(),this.Ps.indexOf(t)>-1&&(e=0);var i=xr._s(this,t,e,n,(function(t){return r.Fs(t)}));return this.As.push(i),i},t.prototype.vs=function(){this.Rs&&y()},t.prototype.xs=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.Ts];case 1:e.sent(),e.label=2;case 2:if(t!==this.Ts)return[3,0];e.label=3;case 3:return[2]}}))}))},t.prototype.ks=function(t){for(var e=0,n=this.As;e<n.length;e++)if(n[e].dn===t)return!0;return!1},t.prototype.Ms=function(t){var e=this;return this.$s().then((function(){e.As.sort((function(t,e){return t.us-e.us}));for(var n=0,r=e.As;n<r.length;n++){var i=r[n];if(i.pn(),"all"!==t&&i.dn===t)break}return e.$s()}))},t.prototype.Os=function(t){this.Ps.push(t)},t.prototype.Fs=function(t){var e=this.As.indexOf(t);this.As.splice(e,1)},t}();function Ar(t,e){if(g("AsyncQueue",e+": "+t),yr(t))return new h(l.UNAVAILABLE,e+": "+t);throw t}var Nr=function(){this.Ls=void 0,this.listeners=[]},kr=function(){this.Bs=new st((function(t){return $n(t)}),Gn),this.onlineState="Unknown",this.qs=new Set};function Rr(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=b(t),o=!1,(s=n.Bs.get(i=e.query))||(o=!0,s=new Nr),!o)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),a=s,[4,n.Us(i)];case 2:return a.Ls=r.sent(),[3,4];case 3:return u=r.sent(),c=Ar(u,"Initialization of query '"+Wn(e.query)+"' failed"),[2,void e.onError(c)];case 4:return n.Bs.set(i,s),s.listeners.push(e),e.Qs(n.onlineState),s.Ls&&e.Ws(s.Ls)&&Lr(n),[2]}}))}))}function Dr(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=b(t),o=!1,(s=n.Bs.get(i=e.query))&&(a=s.listeners.indexOf(e))>=0&&(s.listeners.splice(a,1),o=0===s.listeners.length),o?[2,(n.Bs.delete(i),n.js(i))]:[2]}))}))}function Or(t,e){for(var n=b(t),r=!1,i=0,o=e;i<o.length;i++){var s=o[i],a=n.Bs.get(s.query);if(a){for(var u=0,c=a.listeners;u<c.length;u++)c[u].Ws(s)&&(r=!0);a.Ls=s}}r&&Lr(n)}function Pr(t,e,n){var r=b(t),i=r.Bs.get(e);if(i)for(var o=0,s=i.listeners;o<s.length;o++)s[o].onError(n);r.Bs.delete(e)}function Lr(t){t.qs.forEach((function(t){t.next()}))}var Ur=function(){function t(t,e,n){this.query=t,this.Ks=e,this.Gs=!1,this.zs=null,this.onlineState="Unknown",this.options=n||{}}return t.prototype.Ws=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 Ft(t.query,t.docs,t.Qt,e,t.Wt,t.fromCache,t.jt,!0)}var o=!1;return this.Gs?this.Hs(t)&&(this.Ks.next(t),o=!0):this.Ys(t,this.onlineState)&&(this.Js(t),o=!0),this.zs=t,o},t.prototype.onError=function(t){this.Ks.error(t)},t.prototype.Qs=function(t){this.onlineState=t;var e=!1;return this.zs&&!this.Gs&&this.Ys(this.zs,t)&&(this.Js(this.zs),e=!0),e},t.prototype.Ys=function(t,e){return!t.fromCache||!(this.options.Xs&&"Offline"!==e||t.docs.m()&&"Offline"!==e)},t.prototype.Hs=function(t){return t.docChanges.length>0||!!(t.jt||this.zs&&this.zs.hasPendingWrites!==t.hasPendingWrites)&&!0===this.options.includeMetadataChanges},t.prototype.Js=function(t){t=Ft.Gt(t.query,t.docs,t.Wt,t.fromCache),this.Gs=!0,this.Ks.next(t)},t}(),Mr=function(){function t(t){this.uid=t}return t.prototype.Zs=function(){return null!=this.uid},t.prototype.ti=function(){return this.Zs()?"uid:"+this.uid:"anonymous-user"},t.prototype.isEqual=function(t){return t.uid===this.uid},t}();Mr.UNAUTHENTICATED=new Mr(null),Mr.ei=new Mr("google-credentials-uid"),Mr.ni=new Mr("first-party-uid");var Vr=function(){function t(t,e){var n=this;this.previousValue=t,e&&(e.si=function(t){return n.ii(t)},this.ri=function(t){return e.oi(t)})}return t.prototype.ii=function(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue},t.prototype.next=function(){var t=++this.previousValue;return this.ri&&this.ri(t),t},t}();function jr(t,e){return"firestore_clients_"+t+"_"+e}function Fr(t,e,n){var r="firestore_mutations_"+t+"_"+n;return e.Zs()&&(r+="_"+e.uid),r}function qr(t,e){return"firestore_targets_"+t+"_"+e}Vr.ai=-1;var zr=function(){function t(t,e,n,r){this.user=t,this.batchId=e,this.state=n,this.error=r}return t.ci=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 h(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.ui=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}(),Br=function(){function t(t,e,n){this.targetId=t,this.state=e,this.error=n}return t.ci=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 h(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.ui=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}(),Hr=function(){function t(t,e){this.clientId=t,this.activeTargetIds=e}return t.ci=function(e,n){for(var r=JSON.parse(n),i="object"==typeof r&&r.activeTargetIds instanceof Array,o=Mt(),s=0;i&&s<r.activeTargetIds.length;++s)i=ht(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}(),Gr=function(){function t(t,e){this.clientId=t,this.onlineState=e}return t.ci=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=Mt()}return t.prototype.hi=function(t){this.activeTargetIds=this.activeTargetIds.add(t)},t.prototype.li=function(t){this.activeTargetIds=this.activeTargetIds.delete(t)},t.prototype.ui=function(){var t={activeTargetIds:this.activeTargetIds.A(),updateTimeMs:Date.now()};return JSON.stringify(t)},t}(),Wr=function(){function t(t,e,n,r,i){this.window=t,this.fn=e,this.persistenceKey=n,this._i=r,this.fi=null,this.di=null,this.si=null,this.wi=this.mi.bind(this),this.Ti=new St(Z),this.Ei=!1,this.Ii=[];var o=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.Ai=jr(this.persistenceKey,this._i),this.Ri=function(t){return"firestore_sequence_number_"+t}(this.persistenceKey),this.Ti=this.Ti.ot(this._i,new $r),this.gi=new RegExp("^firestore_clients_"+o+"_([^_]*)$"),this.Pi=new RegExp("^firestore_mutations_"+o+"_(\\d+)(?:_(.*))?$"),this.yi=new RegExp("^firestore_targets_"+o+"_(\\d+)$"),this.Vi=function(t){return"firestore_online_state_"+t}(this.persistenceKey),this.window.addEventListener("storage",this.wi)}return t.Ln=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,l,h=this;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,this.fi.pi()];case 1:for(t=r.sent(),e=0,n=t;e<n.length;e++)(i=n[e])!==this._i&&(o=this.getItem(jr(this.persistenceKey,i)))&&(s=Hr.ci(i,o))&&(this.Ti=this.Ti.ot(s.clientId,s));for(this.bi(),(a=this.storage.getItem(this.Vi))&&(u=this.vi(a))&&this.Si(u),c=0,l=this.Ii;c<l.length;c++)this.mi(l[c]);return this.Ii=[],this.window.addEventListener("unload",(function(){return h.Di()})),this.Ei=!0,[2]}}))}))},t.prototype.oi=function(t){this.setItem(this.Ri,JSON.stringify(t))},t.prototype.Ci=function(){return this.Ni(this.Ti)},t.prototype.Fi=function(t){var e=!1;return this.Ti.forEach((function(n,r){r.activeTargetIds.has(t)&&(e=!0)})),e},t.prototype.xi=function(t){this.$i(t,"pending")},t.prototype.ki=function(t,e,n){this.$i(t,e,n),this.Mi(t)},t.prototype.Oi=function(t){var e="not-current";if(this.Fi(t)){var n=this.storage.getItem(qr(this.persistenceKey,t));if(n){var r=Br.ci(t,n);r&&(e=r.state)}}return this.Li.hi(t),this.bi(),e},t.prototype.Bi=function(t){this.Li.li(t),this.bi()},t.prototype.qi=function(t){return this.Li.activeTargetIds.has(t)},t.prototype.Ui=function(t){this.removeItem(qr(this.persistenceKey,t))},t.prototype.Qi=function(t,e,n){this.Wi(t,e,n)},t.prototype.ji=function(t,e,n){var r=this;e.forEach((function(t){r.Mi(t)})),this.currentUser=t,n.forEach((function(t){r.xi(t)}))},t.prototype.Ki=function(t){this.Gi(t)},t.prototype.Di=function(){this.Ei&&(this.window.removeEventListener("storage",this.wi),this.removeItem(this.Ai),this.Ei=!1)},t.prototype.getItem=function(t){var e=this.storage.getItem(t);return p("SharedClientState","READ",t,e),e},t.prototype.setItem=function(t,e){p("SharedClientState","SET",t,e),this.storage.setItem(t,e)},t.prototype.removeItem=function(t){p("SharedClientState","REMOVE",t),this.storage.removeItem(t)},t.prototype.mi=function(t){var e=this,n=t;if(n.storageArea===this.storage){if(p("SharedClientState","EVENT",n.key,n.newValue),n.key===this.Ai)return void g("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.fn.Cs((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.Ei){if(null!==n.key)if(this.gi.test(n.key)){if(null==n.newValue)return t=this.zi(n.key),[2,this.Hi(t,null)];if(e=this.Yi(n.key,n.newValue))return[2,this.Hi(e.clientId,e)]}else if(this.Pi.test(n.key)){if(null!==n.newValue&&(i=this.Ji(n.key,n.newValue)))return[2,this.Xi(i)]}else if(this.yi.test(n.key)){if(null!==n.newValue&&(o=this.Zi(n.key,n.newValue)))return[2,this.tr(o)]}else if(n.key===this.Vi){if(null!==n.newValue&&(s=this.vi(n.newValue)))return[2,this.Si(s)]}else n.key===this.Ri&&(a=function(t){var e=Vr.ai;if(null!=t)try{var n=JSON.parse(t);w("number"==typeof n),e=n}catch(t){g("SharedClientState","Failed to read sequence number from WebStorage",t)}return e}(n.newValue))!==Vr.ai&&this.si(a)}else this.Ii.push(n);return[2]}))}))}))}},Object.defineProperty(t.prototype,"Li",{get:function(){return this.Ti.get(this._i)},enumerable:!1,configurable:!0}),t.prototype.bi=function(){this.setItem(this.Ai,this.Li.ui())},t.prototype.$i=function(t,e,n){var r=new zr(this.currentUser,t,e,n),i=Fr(this.persistenceKey,this.currentUser,t);this.setItem(i,r.ui())},t.prototype.Mi=function(t){var e=Fr(this.persistenceKey,this.currentUser,t);this.removeItem(e)},t.prototype.Gi=function(t){this.storage.setItem(this.Vi,JSON.stringify({clientId:this._i,onlineState:t}))},t.prototype.Wi=function(t,e,n){var r=qr(this.persistenceKey,t),i=new Br(t,e,n);this.setItem(r,i.ui())},t.prototype.zi=function(t){var e=this.gi.exec(t);return e?e[1]:null},t.prototype.Yi=function(t,e){var n=this.zi(t);return Hr.ci(n,e)},t.prototype.Ji=function(t,e){var n=this.Pi.exec(t),r=Number(n[1]);return zr.ci(new Mr(void 0!==n[2]?n[2]:null),r,e)},t.prototype.Zi=function(t,e){var n=this.yi.exec(t),r=Number(n[1]);return Br.ci(r,e)},t.prototype.vi=function(t){return Gr.ci(t)},t.prototype.Xi=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.fi.er(t.batchId,t.state,t.error)]:(p("SharedClientState","Ignoring mutation for non-active user "+t.user.uid),[2])}))}))},t.prototype.tr=function(t){return this.fi.nr(t.targetId,t.state,t.error)},t.prototype.Hi=function(t,e){var n=this,r=e?this.Ti.ot(t,e):this.Ti.remove(t),i=this.Ni(this.Ti),o=this.Ni(r),s=[],a=[];return o.forEach((function(t){i.has(t)||s.push(t)})),i.forEach((function(t){o.has(t)||a.push(t)})),this.fi.sr(s,a).then((function(){n.Ti=r}))},t.prototype.Si=function(t){this.Ti.get(t.clientId)&&this.di(t.onlineState)},t.prototype.Ni=function(t){var e=Mt();return t.forEach((function(t,n){e=e.kt(n.activeTargetIds)})),e},t}(),Kr=function(){function t(){this.ir=new $r,this.rr={},this.di=null,this.si=null}return t.prototype.xi=function(t){},t.prototype.ki=function(t,e,n){},t.prototype.Oi=function(t){return this.ir.hi(t),this.rr[t]||"not-current"},t.prototype.Qi=function(t,e,n){this.rr[t]=e},t.prototype.Bi=function(t){this.ir.li(t)},t.prototype.qi=function(t){return this.ir.activeTargetIds.has(t)},t.prototype.Ui=function(t){delete this.rr[t]},t.prototype.Ci=function(){return this.ir.activeTargetIds},t.prototype.Fi=function(t){return this.ir.activeTargetIds.has(t)},t.prototype.start=function(){return this.ir=new $r,Promise.resolve()},t.prototype.ji=function(t,e,n){},t.prototype.Ki=function(t){},t.prototype.Di=function(){},t.prototype.oi=function(t){},t}(),Qr=function(){function t(t,e,n,r){this.batchId=t,this.ar=e,this.baseMutations=n,this.mutations=r}return t.prototype.cr=function(t,e,n){for(var r=n.ur,i=0;i<this.mutations.length;i++){var o=this.mutations[i];o.key.isEqual(t)&&(e=fn(o,e,r[i]))}return e},t.prototype.hr=function(t,e){for(var n=0,r=this.baseMutations;n<r.length;n++){var i=r[n];i.key.isEqual(t)&&(e=dn(i,e,e,this.ar))}for(var o=e,s=0,a=this.mutations;s<a.length;s++){var u=a[s];u.key.isEqual(t)&&(e=dn(u,e,o,this.ar))}return e},t.prototype.lr=function(t){var e=this,n=t;return this.mutations.forEach((function(r){var i=e.hr(r.key,t.get(r.key));i&&(n=n.ot(r.key,i))})),n},t.prototype.keys=function(){return this.mutations.reduce((function(t,e){return t.add(e.key)}),Lt())},t.prototype.isEqual=function(t){return this.batchId===t.batchId&&Y(this.mutations,t.mutations,(function(t,e){return gn(t,e)}))&&Y(this.baseMutations,t.baseMutations,(function(t,e){return gn(t,e)}))},t}(),Zr=function(){function t(t,e,n,r){this.batch=t,this._r=e,this.ur=n,this.dr=r}return t.from=function(e,n,r){w(e.mutations.length===r.length);for(var i=Ot,o=e.mutations,s=0;s<o.length;s++)i=i.ot(o[s].key,r[s].version);return new t(e,n,r,i)},t}(),Yr=function(){function t(){this.wr=new st((function(t){return t.toString()}),(function(t,e){return t.isEqual(e)})),this.mr=!1}return Object.defineProperty(t.prototype,"readTime",{get:function(){return this.Tr},set:function(t){this.Tr=t},enumerable:!1,configurable:!0}),t.prototype.Er=function(t,e){this.Ir(),this.readTime=e,this.wr.set(t.key,t)},t.prototype.Ar=function(t,e){this.Ir(),e&&(this.readTime=e),this.wr.set(t,null)},t.prototype.Rr=function(t,e){this.Ir();var n=this.wr.get(e);return void 0!==n?pr.resolve(n):this.gr(t,e)},t.prototype.getEntries=function(t,e){return this.Pr(t,e)},t.prototype.apply=function(t){return this.Ir(),this.mr=!0,this.yr(t)},t.prototype.Ir=function(){},t}(),Xr="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.",Jr=function(){function t(){this.Vr=[]}return t.prototype.pr=function(t){this.Vr.push(t)},t.prototype.br=function(){this.Vr.forEach((function(t){return t()}))},t}(),ti=function(){function t(t,e,n){this.vr=t,this.Sr=e,this.Dr=n}return t.prototype.Cr=function(t,e){var n=this;return this.Sr.Nr(t,e).next((function(r){return n.Fr(t,e,r)}))},t.prototype.Fr=function(t,e,n){return this.vr.Rr(t,e).next((function(t){for(var r=0,i=n;r<i.length;r++)t=i[r].hr(e,t);return t}))},t.prototype.$r=function(t,e,n){var r=kt();return e.forEach((function(t,e){for(var i=0,o=n;i<o.length;i++)e=o[i].hr(t,e);r=r.ot(t,e)})),r},t.prototype.kr=function(t,e){var n=this;return this.vr.getEntries(t,e).next((function(e){return n.Mr(t,e)}))},t.prototype.Mr=function(t,e){var n=this;return this.Sr.Or(t,e).next((function(r){var i=n.$r(t,e,r),o=Nt();return i.forEach((function(t,e){e||(e=new kn(t,ut.min())),o=o.ot(t,e)})),o}))},t.prototype.Lr=function(t,e,n){return function(t){return A.F(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.Br(t,e.path):jn(e)?this.qr(t,e,n):this.Ur(t,e,n)},t.prototype.Br=function(t,e){return this.Cr(t,new A(e)).next((function(t){var e=Dt();return t instanceof Nn&&(e=e.ot(t.key,t)),e}))},t.prototype.qr=function(t,e,n){var r=this,i=e.collectionGroup,o=Dt();return this.Dr.Qr(t,i).next((function(s){return pr.forEach(s,(function(s){var a=function(t,e){return new Dn(e,null,t.on.slice(),t.filters.slice(),t.limit,t.an,t.startAt,t.endAt)}(e,s.child(i));return r.Ur(t,a,n).next((function(t){t.forEach((function(t,e){o=o.ot(t,e)}))}))})).next((function(){return o}))}))},t.prototype.Ur=function(t,e,n){var r,i,o=this;return this.vr.Lr(t,e,n).next((function(n){return r=n,o.Sr.Wr(t,e)})).next((function(e){return o.jr(t,i=e,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,l=r.get(c),h=dn(u,l,l,o.ar);r=h instanceof Nn?r.ot(c,h):r.remove(c)}}))})).next((function(){return r.forEach((function(t,n){Kn(e,n)||(r=r.remove(t))})),r}))},t.prototype.jr=function(t,e,n){for(var r=Lt(),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 yn&&null===n.get(u.key)&&(r=r.add(u.key))}var c=n;return this.vr.getEntries(t,r).next((function(t){return t.forEach((function(t,e){null!==e&&e instanceof Nn&&(c=c.ot(t,e))})),c}))},t}(),ei=function(){function t(t,e,n,r){this.targetId=t,this.fromCache=e,this.Kr=n,this.Gr=r}return t.zr=function(e,n){for(var r=Lt(),i=Lt(),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}();function ni(t,e){var n=t[1],r=e[1],i=Z(t[0],e[0]);return 0===i?Z(n,r):i}var ri=function(){function t(t){this.Hr=t,this.buffer=new xt(ni),this.Yr=0}return t.prototype.Jr=function(){return++this.Yr},t.prototype.Xr=function(t){var e=[t,this.Jr()];if(this.buffer.size<this.Hr)this.buffer=this.buffer.add(e);else{var n=this.buffer.last();ni(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}(),ii={Zr:!1,eo:0,no:0,so:0},oi=function(){function t(t,e,n){this.io=t,this.ro=e,this.oo=n}return t.ao=function(e){return new t(e,t.co,t.uo)},t}();oi.ho=-1,oi.lo=1048576,oi._o=41943040,oi.co=10,oi.uo=1e3,oi.fo=new oi(oi._o,oi.co,oi.uo),oi.do=new oi(oi.ho,0,0);var si=function(){function t(t,e){this.wo=t,this.cs=e,this.mo=!1,this.To=null}return t.prototype.start=function(t){this.wo.params.io!==oi.ho&&this.Eo(t)},t.prototype.stop=function(){this.To&&(this.To.cancel(),this.To=null)},Object.defineProperty(t.prototype,"Ei",{get:function(){return null!==this.To},enumerable:!1,configurable:!0}),t.prototype.Eo=function(t){var e=this,n=this.mo?3e5:6e4;p("LruGarbageCollector","Garbage collection scheduled in "+n+"ms"),this.To=this.cs.yn("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.To=null,this.mo=!0,n.label=1;case 1:return n.trys.push([1,3,,7]),[4,t.Io(this.wo)];case 2:return n.sent(),[3,7];case 3:return yr(e=n.sent())?(p("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",e),[3,6]):[3,4];case 4:return[4,xo(e)];case 5:n.sent(),n.label=6;case 6:return[3,7];case 7:return[4,this.Eo(t)];case 8:return n.sent(),[2]}}))}))}))},t}(),ai=function(){function t(t,e){this.Ao=t,this.params=e}return t.prototype.Ro=function(t,e){return this.Ao.Po(t).next((function(t){return Math.floor(e/100*t)}))},t.prototype.yo=function(t,e){var n=this;if(0===e)return pr.resolve(Vr.ai);var r=new ri(e);return this.Ao.Ce(t,(function(t){return r.Xr(t.sequenceNumber)})).next((function(){return n.Ao.Vo(t,(function(t){return r.Xr(t)}))})).next((function(){return r.maxValue}))},t.prototype.po=function(t,e,n){return this.Ao.po(t,e,n)},t.prototype.bo=function(t,e){return this.Ao.bo(t,e)},t.prototype.vo=function(t,e){var n=this;return this.params.io===oi.ho?(p("LruGarbageCollector","Garbage collection skipped; disabled"),pr.resolve(ii)):this.So(t).next((function(r){return r<n.params.io?(p("LruGarbageCollector","Garbage collection skipped; Cache size "+r+" is lower than threshold "+n.params.io),ii):n.Do(t,e)}))},t.prototype.So=function(t){return this.Ao.So(t)},t.prototype.Do=function(t,e){var n,r,i,s,a,u,c,l=this,h=Date.now();return this.Ro(t,this.params.ro).next((function(e){return e>l.params.oo?(p("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of "+l.params.oo+" from "+e),r=l.params.oo):r=e,s=Date.now(),l.yo(t,r)})).next((function(r){return n=r,a=Date.now(),l.po(t,n,e)})).next((function(e){return i=e,u=Date.now(),l.bo(t,n)})).next((function(t){return c=Date.now(),d()<=o.LogLevel.DEBUG&&p("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in "+(s-h)+"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-h)+"ms"),pr.resolve({Zr:!0,eo:r,no:i,so:t})}))},t}();function ui(t){for(var e="",n=0;n<t.length;n++)e.length>0&&(e=li(e)),e=ci(t.get(n),e);return li(e)}function ci(t,e){for(var n=e,r=t.length,i=0;i<r;i++){var o=t.charAt(i);switch(o){case"\0":n+="\x01\x10";break;case"\x01":n+="\x01\x11";break;default:n+=o}}return n}function li(t){return t+"\x01\x01"}function hi(t){var e=t.length;if(w(e>=2),2===e)return w("\x01"===t.charAt(0)&&"\x01"===t.charAt(1)),T.P();for(var n=e-2,r=[],i="",o=0;o<e;){var s=t.indexOf("\x01",o);switch((s<0||s>n)&&y(),t.charAt(s+1)){case"\x01":var a=t.substring(o,s),u=void 0;0===i.length?u=a:(u=i+=a,i=""),r.push(u);break;case"\x10":i+=t.substring(o,s),i+="\0";break;case"\x11":i+=t.substring(o,s+1);break;default:y()}o=s+2}return new T(r)}var fi=function(t){this.Co=t};function di(t,e){if(e.document)return function(t,e,n){var r=Ce(t,e.name),i=Se(e.updateTime),o=new Tn({mapValue:{fields:e.fields}});return new Nn(r,i,o,{hasCommittedMutations:!!n})}(t.Co,e.document,!!e.hasCommittedMutations);if(e.noDocument){var n=A.$(e.noDocument.path),r=yi(e.noDocument.readTime);return new kn(n,r,{hasCommittedMutations:!!e.hasCommittedMutations})}if(e.unknownDocument){var i=A.$(e.unknownDocument.path),o=yi(e.unknownDocument.version);return new Rn(i,o)}return y()}function pi(t,e,n){var r=gi(n),i=e.key.path.h().A();if(e instanceof Nn){var o=function(t,e){return{name:xe(t,e.key),fields:e.rn().mapValue.fields,updateTime:be(t,e.version.Z())}}(t.Co,e);return new Hi(null,null,o,e.hasCommittedMutations,r,i)}if(e instanceof kn){var s=e.key.path.A(),a=mi(e.version),u=e.hasCommittedMutations;return new Hi(null,new zi(s,a),null,u,r,i)}if(e instanceof Rn){var c=e.key.path.A(),l=mi(e.version);return new Hi(new Bi(c,l),null,null,!0,r,i)}return y()}function gi(t){var e=t.Z();return[e.seconds,e.nanoseconds]}function vi(t){var e=new at(t[0],t[1]);return ut.J(e)}function mi(t){var e=t.Z();return new Mi(e.seconds,e.nanoseconds)}function yi(t){var e=new at(t.seconds,t.nanoseconds);return ut.J(e)}function wi(t,e){var n=(e.baseMutations||[]).map((function(e){return Pe(t.Co,e)})),r=e.mutations.map((function(e){return Pe(t.Co,e)})),i=at.fromMillis(e.localWriteTimeMs);return new Qr(e.batchId,i,n,r)}function bi(t){var e,n,r=yi(t.readTime),i=void 0!==t.lastLimboFreeSnapshotVersion?yi(t.lastLimboFreeSnapshotVersion):ut.min();return void 0!==t.query.documents?(w(1===(n=t.query).documents.length),e=qn(Pn(Ne(n.documents[0])))):e=function(t){var e=Ne(t.parent),n=t.structuredQuery,r=n.from?n.from.length:0,i=null;if(r>0){w(1===r);var o=n.from[0];o.allDescendants?i=o.collectionId:e=e.child(o.collectionId)}var s=[];n.where&&(s=function t(e){return e?void 0!==e.unaryFilter?[He(e)]:void 0!==e.fieldFilter?[Be(e)]:void 0!==e.compositeFilter?e.compositeFilter.filters.map((function(e){return t(e)})).reduce((function(t,e){return t.concat(e)})):y():[]}(n.where));var a=[];n.orderBy&&(a=n.orderBy.map((function(t){return function(t){return new cr(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 ct(e="object"==typeof t?t.value:t)?null:e}(n.limit));var c=null;n.startAt&&(c=Ve(n.startAt));var l=null;return n.endAt&&(l=Ve(n.endAt)),qn(On(e,i,a,s,u,"F",c,l))}(t.query),new wt(e,t.targetId,0,t.lastListenSequenceNumber,r,i,J.fromBase64String(t.resumeToken))}function _i(t,e){var n,r=mi(e.nt),i=mi(e.lastLimboFreeSnapshotVersion);n=vt(e.target)?Le(t.Co,e.target):Ue(t.Co,e.target);var o=e.resumeToken.toBase64();return new $i(e.targetId,pt(e.target),r,o,e.sequenceNumber,i,n)}var Ei=function(){function t(t,e,n,r){this.userId=t,this.serializer=e,this.Dr=n,this.No=r,this.Fo={}}return t.xo=function(e,n,r,i){return w(""!==e.uid),new t(e.Zs()?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 Ti(t).rs({index:Fi.userMutationsIndex,range:n},(function(t,n,r){e=!1,r.done()})).next((function(){return e}))},t.prototype.ko=function(t,e,n,r){var i=this,o=xi(t),s=Ti(t);return s.add({}).next((function(a){w("number"==typeof a);for(var u=new Qr(a,e,n,r),c=function(t,e,n){var r=n.baseMutations.map((function(e){return Oe(t.Co,e)})),i=n.mutations.map((function(e){return Oe(t.Co,e)}));return new Fi(e,n.batchId,n.ar.toMillis(),r,i)}(i.serializer,i.userId,u),l=[],h=new xt((function(t,e){return Z(t.R(),e.R())})),f=0,d=r;f<d.length;f++){var p=d[f],g=qi.key(i.userId,p.key.path,a);h=h.add(p.key.path.h()),l.push(s.put(c)),l.push(o.put(g,qi.PLACEHOLDER))}return h.forEach((function(e){l.push(i.Dr.Mo(t,e))})),t.pr((function(){i.Fo[a]=u.keys()})),pr.$n(l).next((function(){return u}))}))},t.prototype.Oo=function(t,e){var n=this;return Ti(t).get(e).next((function(t){return t?(w(t.userId===n.userId),wi(n.serializer,t)):null}))},t.prototype.Lo=function(t,e){var n=this;return this.Fo[e]?pr.resolve(this.Fo[e]):this.Oo(t,e).next((function(t){if(t){var r=t.keys();return n.Fo[e]=r,r}return null}))},t.prototype.Bo=function(t,e){var n=this,r=e+1,i=IDBKeyRange.lowerBound([this.userId,r]),o=null;return Ti(t).rs({index:Fi.userMutationsIndex,range:i},(function(t,e,i){e.userId===n.userId&&(w(e.batchId>=r),o=wi(n.serializer,e)),i.done()})).next((function(){return o}))},t.prototype.qo=function(t){var e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),n=-1;return Ti(t).rs({index:Fi.userMutationsIndex,range:e,reverse:!0},(function(t,e,r){n=e.batchId,r.done()})).next((function(){return n}))},t.prototype.Uo=function(t){var e=this,n=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return Ti(t).ts(Fi.userMutationsIndex,n).next((function(t){return t.map((function(t){return wi(e.serializer,t)}))}))},t.prototype.Nr=function(t,e){var n=this,r=qi.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=[];return xi(t).rs({range:i},(function(r,i,s){var a=r[0],u=r[2],c=hi(r[1]);if(a===n.userId&&e.path.isEqual(c))return Ti(t).get(u).next((function(t){if(!t)throw y();w(t.userId===n.userId),o.push(wi(n.serializer,t))}));s.done()})).next((function(){return o}))},t.prototype.Or=function(t,e){var n=this,r=new xt(Z),i=[];return e.forEach((function(e){var o=qi.prefixForPath(n.userId,e.path),s=IDBKeyRange.lowerBound(o),a=xi(t).rs({range:s},(function(t,i,o){var s=t[0],a=t[2],u=hi(t[1]);s===n.userId&&e.path.isEqual(u)?r=r.add(a):o.done()}));i.push(a)})),pr.$n(i).next((function(){return n.Qo(t,r)}))},t.prototype.Wr=function(t,e){var n=this,r=e.path,i=r.length+1,o=qi.prefixForPath(this.userId,r),s=IDBKeyRange.lowerBound(o),a=new xt(Z);return xi(t).rs({range:s},(function(t,e,o){var s=t[0],u=t[2],c=hi(t[1]);s===n.userId&&r.T(c)?c.length===i&&(a=a.add(u)):o.done()})).next((function(){return n.Qo(t,a)}))},t.prototype.Qo=function(t,e){var n=this,r=[],i=[];return e.forEach((function(e){i.push(Ti(t).get(e).next((function(t){if(null===t)throw y();w(t.userId===n.userId),r.push(wi(n.serializer,t))})))})),pr.$n(i).next((function(){return r}))},t.prototype.Wo=function(t,e){var n=this;return Ii(t.jo,this.userId,e).next((function(r){return t.pr((function(){n.Ko(e.batchId)})),pr.forEach(r,(function(e){return n.No.Go(t,e)}))}))},t.prototype.Ko=function(t){delete this.Fo[t]},t.prototype.zo=function(t){var e=this;return this.$o(t).next((function(n){if(!n)return pr.resolve();var r=IDBKeyRange.lowerBound(qi.prefixForUser(e.userId)),i=[];return xi(t).rs({range:r},(function(t,n,r){if(t[0]===e.userId){var o=hi(t[1]);i.push(o)}else r.done()})).next((function(){w(0===i.length)}))}))},t.prototype.Ho=function(t,e){return Si(t,this.userId,e)},t.prototype.Yo=function(t){var e=this;return Ci(t).get(this.userId).next((function(t){return t||new ji(e.userId,-1,"")}))},t}();function Si(t,e,n){var r=qi.prefixForPath(e,n.path),i=r[1],o=IDBKeyRange.lowerBound(r),s=!1;return xi(t).rs({range:o,ss:!0},(function(t,n,r){t[0]===e&&t[1]===i&&(s=!0),r.done()})).next((function(){return s}))}function Ii(t,e,n){var r=t.store(Fi.store),i=t.store(qi.store),o=[],s=IDBKeyRange.only(n.batchId),a=0,u=r.rs({range:s},(function(t,e,n){return a++,n.delete()}));o.push(u.next((function(){w(1===a)})));for(var c=[],l=0,h=n.mutations;l<h.length;l++){var f=h[l],d=qi.key(e,f.key.path,n.batchId);o.push(i.delete(d)),c.push(f.key)}return pr.$n(o).next((function(){return c}))}function Ti(t){return uo.Qn(t,Fi.store)}function xi(t){return uo.Qn(t,qi.store)}function Ci(t){return uo.Qn(t,ji.store)}var Ai=function(){function t(t,e){this.serializer=t,this.Dr=e}return t.prototype.Er=function(t,e,n){return Ri(t).put(Di(e),n)},t.prototype.Ar=function(t,e){var n=Ri(t),r=Di(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.Jo(t,r)}))},t.prototype.Rr=function(t,e){var n=this;return Ri(t).get(Di(e)).next((function(t){return n.Xo(t)}))},t.prototype.Zo=function(t,e){var n=this;return Ri(t).get(Di(e)).next((function(t){var e=n.Xo(t);return e?{ta:e,size:Oi(t)}:null}))},t.prototype.getEntries=function(t,e){var n=this,r=kt();return this.ea(t,e,(function(t,e){var i=n.Xo(e);r=r.ot(t,i)})).next((function(){return r}))},t.prototype.na=function(t,e){var n=this,r=kt(),i=new St(A.i);return this.ea(t,e,(function(t,e){var o=n.Xo(e);o?(r=r.ot(t,o),i=i.ot(t,Oi(e))):(r=r.ot(t,null),i=i.ot(t,0))})).next((function(){return{sa:r,ia:i}}))},t.prototype.ea=function(t,e,n){if(e.m())return pr.resolve();var r=IDBKeyRange.bound(e.first().path.A(),e.last().path.A()),i=e._t(),o=i.It();return Ri(t).rs({range:r},(function(t,e,r){for(var s=A.$(t);o&&A.i(o,s)<0;)n(o,null),o=i.It();o&&o.isEqual(s)&&(n(o,e),o=i.At()?i.It():null),o?r.Xn(o.path.A()):r.done()})).next((function(){for(;o;)n(o,null),o=i.At()?i.It():null}))},t.prototype.Lr=function(t,e,n){var r=this,i=Dt(),o=e.path.length+1,s={};if(n.isEqual(ut.min())){var a=e.path.A();s.range=IDBKeyRange.lowerBound(a)}else{var u=e.path.A(),c=gi(n);s.range=IDBKeyRange.lowerBound([u,c],!0),s.index=Hi.collectionReadTimeIndex}return Ri(t).rs(s,(function(t,n,s){if(t.length===o){var a=di(r.serializer,n);e.path.T(a.key.path)?a instanceof Nn&&Kn(e,a)&&(i=i.ot(a.key,a)):s.done()}})).next((function(){return i}))},t.prototype.ra=function(t){return new Ni(this,!!t&&t.oa)},t.prototype.aa=function(t){return this.getMetadata(t).next((function(t){return t.byteSize}))},t.prototype.getMetadata=function(t){return ki(t).get(Gi.key).next((function(t){return w(!!t),t}))},t.prototype.Jo=function(t,e){return ki(t).put(Gi.key,e)},t.prototype.Xo=function(t){if(t){var e=di(this.serializer,t);return e instanceof kn&&e.version.isEqual(ut.min())?null:e}return null},t}(),Ni=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).ca=e,r.oa=n,r.ua=new st((function(t){return t.toString()}),(function(t,e){return t.isEqual(e)})),r}return r.__extends(e,t),e.prototype.yr=function(t){var e=this,n=[],r=0,i=new xt((function(t,e){return Z(t.R(),e.R())}));return this.wr.forEach((function(o,s){var a=e.ua.get(o);if(s){var u=pi(e.ca.serializer,s,e.readTime);i=i.add(o.path.h());var c=Oi(u);r+=c-a,n.push(e.ca.Er(t,o,u))}else if(r-=a,e.oa){var l=pi(e.ca.serializer,new kn(o,ut.min()),e.readTime);n.push(e.ca.Er(t,o,l))}else n.push(e.ca.Ar(t,o))})),i.forEach((function(r){n.push(e.ca.Dr.Mo(t,r))})),n.push(this.ca.updateMetadata(t,r)),pr.$n(n)},e.prototype.gr=function(t,e){var n=this;return this.ca.Zo(t,e).next((function(t){return null===t?(n.ua.set(e,0),null):(n.ua.set(e,t.size),t.ta)}))},e.prototype.Pr=function(t,e){var n=this;return this.ca.na(t,e).next((function(t){var e=t.sa;return t.ia.forEach((function(t,e){n.ua.set(t,e)})),e}))},e}(Yr);function ki(t){return uo.Qn(t,Gi.store)}function Ri(t){return uo.Qn(t,Hi.store)}function Di(t){return t.path.A()}function Oi(t){var e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw y();e=t.noDocument}return JSON.stringify(e).length}var Pi=function(){function t(){this.ha=new Li}return t.prototype.Mo=function(t,e){return this.ha.add(e),pr.resolve()},t.prototype.Qr=function(t,e){return pr.resolve(this.ha.getEntries(e))},t}(),Li=function(){function t(){this.index={}}return t.prototype.add=function(t){var e=t._(),n=t.h(),r=this.index[e]||new xt(T.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 xt(T.i)).A()},t}(),Ui=function(){function t(t){this.serializer=t}return t.prototype.createOrUpgrade=function(t,e,n,r){var i=this;w(n<r&&n>=0&&r<=10);var o=new wr("createOrUpgrade",e);n<1&&r>=1&&(function(t){t.createObjectStore(Vi.store)}(t),function(t){t.createObjectStore(ji.store,{keyPath:ji.keyPath}),t.createObjectStore(Fi.store,{keyPath:Fi.keyPath,autoIncrement:!0}).createIndex(Fi.userMutationsIndex,Fi.userMutationsKeyPath,{unique:!0}),t.createObjectStore(qi.store)}(t),Zi(t),function(t){t.createObjectStore(Hi.store)}(t));var s=pr.resolve();return n<3&&r>=3&&(0!==n&&(function(t){t.deleteObjectStore(Wi.store),t.deleteObjectStore($i.store),t.deleteObjectStore(Ki.store)}(t),Zi(t)),s=s.next((function(){return function(t){var e=t.store(Ki.store),n=new Ki(0,0,ut.min().Z(),0);return e.put(Ki.key,n)}(o)}))),n<4&&r>=4&&(0!==n&&(s=s.next((function(){return function(t,e){return e.store(Fi.store).ts().next((function(n){t.deleteObjectStore(Fi.store),t.createObjectStore(Fi.store,{keyPath:Fi.keyPath,autoIncrement:!0}).createIndex(Fi.userMutationsIndex,Fi.userMutationsKeyPath,{unique:!0});var r=e.store(Fi.store),i=n.map((function(t){return r.put(t)}));return pr.$n(i)}))}(t,o)}))),s=s.next((function(){!function(t){t.createObjectStore(Yi.store,{keyPath:Yi.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(Gi.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(Hi.store);e.createIndex(Hi.readTimeIndex,Hi.readTimeIndexPath,{unique:!1}),e.createIndex(Hi.collectionReadTimeIndex,Hi.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(Hi.store).rs((function(t,n){e+=Oi(n)})).next((function(){var n=new Gi(e);return t.store(Gi.store).put(Gi.key,n)}))},t.prototype.removeAcknowledgedMutations=function(t){var e=this,n=t.store(ji.store),r=t.store(Fi.store);return n.ts().next((function(n){return pr.forEach(n,(function(n){var i=IDBKeyRange.bound([n.userId,-1],[n.userId,n.lastAcknowledgedBatchId]);return r.ts(Fi.userMutationsIndex,i).next((function(r){return pr.forEach(r,(function(r){w(r.userId===n.userId);var i=wi(e.serializer,r);return Ii(t,n.userId,i).next((function(){}))}))}))}))}))},t.prototype.ensureSequenceNumbers=function(t){var e=t.store(Wi.store),n=t.store(Hi.store);return t.store(Ki.store).get(Ki.key).next((function(t){var r=[];return n.rs((function(n,i){var o=new T(n),s=function(t){return[0,ui(t)]}(o);r.push(e.get(s).next((function(n){return n?pr.resolve():function(n){return e.put(new Wi(0,ui(n),t.highestListenSequenceNumber))}(o)})))})).next((function(){return pr.$n(r)}))}))},t.prototype.createCollectionParentIndex=function(t,e){t.createObjectStore(Qi.store,{keyPath:Qi.keyPath});var n=e.store(Qi.store),r=new Li,i=function(t){if(r.add(t)){var e=t._(),i=t.h();return n.put({collectionId:e,parent:ui(i)})}};return e.store(Hi.store).rs({ss:!0},(function(t,e){var n=new T(t);return i(n.h())})).next((function(){return e.store(qi.store).rs({ss:!0},(function(t,e){var n=hi(t[1]);return i(n.h())}))}))},t.prototype.rewriteCanonicalIds=function(t){var e=this,n=t.store($i.store);return n.rs((function(t,r){var i=bi(r),o=_i(e.serializer,i);return n.put(o)}))},t}(),Mi=function(t,e){this.seconds=t,this.nanoseconds=e},Vi=function(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n};Vi.store="owner",Vi.key="owner";var ji=function(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n};ji.store="mutationQueues",ji.keyPath="userId";var Fi=function(t,e,n,r,i){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.baseMutations=r,this.mutations=i};Fi.store="mutations",Fi.keyPath="batchId",Fi.userMutationsIndex="userMutationsIndex",Fi.userMutationsKeyPath=["userId","batchId"];var qi=function(){function t(){}return t.prefixForUser=function(t){return[t]},t.prefixForPath=function(t,e){return[t,ui(e)]},t.key=function(t,e,n){return[t,ui(e),n]},t}();qi.store="documentMutations",qi.PLACEHOLDER=new qi;var zi=function(t,e){this.path=t,this.readTime=e},Bi=function(t,e){this.path=t,this.version=e},Hi=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};Hi.store="remoteDocuments",Hi.readTimeIndex="readTimeIndex",Hi.readTimeIndexPath="readTime",Hi.collectionReadTimeIndex="collectionReadTimeIndex",Hi.collectionReadTimeIndexPath=["parentPath","readTime"];var Gi=function(t){this.byteSize=t};Gi.store="remoteDocumentGlobal",Gi.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 Wi=function(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n};Wi.store="targetDocuments",Wi.keyPath=["targetId","path"],Wi.documentTargetsIndex="documentTargetsIndex",Wi.documentTargetsKeyPath=["path","targetId"];var Ki=function(t,e,n,r){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=r};Ki.key="targetGlobalKey",Ki.store="targetGlobal";var Qi=function(t,e){this.collectionId=t,this.parent=e};function Zi(t){t.createObjectStore(Wi.store,{keyPath:Wi.keyPath}).createIndex(Wi.documentTargetsIndex,Wi.documentTargetsKeyPath,{unique:!0}),t.createObjectStore($i.store,{keyPath:$i.keyPath}).createIndex($i.queryTargetsIndexName,$i.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(Ki.store)}Qi.store="collectionParents",Qi.keyPath=["collectionId","parent"];var Yi=function(t,e,n,r){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=r};Yi.store="clientMetadata",Yi.keyPath="clientId";var Xi=r.__spreadArrays(r.__spreadArrays(r.__spreadArrays([ji.store,Fi.store,qi.store,Hi.store,$i.store,Vi.store,Ki.store,Wi.store],[Yi.store]),[Gi.store]),[Qi.store]),Ji=function(){function t(){this.la=new Li}return t.prototype.Mo=function(t,e){var n=this;if(!this.la.has(e)){var r=e._(),i=e.h();t.pr((function(){n.la.add(e)}));var o={collectionId:r,parent:ui(i)};return to(t).put(o)}return pr.resolve()},t.prototype.Qr=function(t,e){var n=[],r=IDBKeyRange.bound([e,""],[X(e),""],!1,!0);return to(t).ts(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(hi(o.parent))}return n}))},t}();function to(t){return uo.Qn(t,Qi.store)}var eo=function(){function t(t){this._a=t}return t.prototype.next=function(){return this._a+=2,this._a},t.fa=function(){return new t(0)},t.da=function(){return new t(-1)},t}(),no=function(){function t(t,e){this.No=t,this.serializer=e}return t.prototype.wa=function(t){var e=this;return this.ma(t).next((function(n){var r=new eo(n.highestTargetId);return n.highestTargetId=r.next(),e.Ta(t,n).next((function(){return n.highestTargetId}))}))},t.prototype.Ea=function(t){return this.ma(t).next((function(t){return ut.J(new at(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))}))},t.prototype.Ia=function(t){return this.ma(t).next((function(t){return t.highestListenSequenceNumber}))},t.prototype.Aa=function(t,e,n){var r=this;return this.ma(t).next((function(i){return i.highestListenSequenceNumber=e,n&&(i.lastRemoteSnapshotVersion=n.Z()),e>i.highestListenSequenceNumber&&(i.highestListenSequenceNumber=e),r.Ta(t,i)}))},t.prototype.Ra=function(t,e){var n=this;return this.ga(t,e).next((function(){return n.ma(t).next((function(r){return r.targetCount+=1,n.Pa(e,r),n.Ta(t,r)}))}))},t.prototype.ya=function(t,e){return this.ga(t,e)},t.prototype.Va=function(t,e){var n=this;return this.pa(t,e.targetId).next((function(){return ro(t).delete(e.targetId)})).next((function(){return n.ma(t)})).next((function(e){return w(e.targetCount>0),e.targetCount-=1,n.Ta(t,e)}))},t.prototype.po=function(t,e,n){var r=this,i=0,o=[];return ro(t).rs((function(s,a){var u=bi(a);u.sequenceNumber<=e&&null===n.get(u.targetId)&&(i++,o.push(r.Va(t,u)))})).next((function(){return pr.$n(o)})).next((function(){return i}))},t.prototype.Ce=function(t,e){return ro(t).rs((function(t,n){var r=bi(n);e(r)}))},t.prototype.ma=function(t){return io(t).get(Ki.key).next((function(t){return w(null!==t),t}))},t.prototype.Ta=function(t,e){return io(t).put(Ki.key,e)},t.prototype.ga=function(t,e){return ro(t).put(_i(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.ba=function(t){return this.ma(t).next((function(t){return t.targetCount}))},t.prototype.va=function(t,e){var n=pt(e),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]),i=null;return ro(t).rs({range:r,index:$i.queryTargetsIndexName},(function(t,n,r){var o=bi(n);gt(e,o.target)&&(i=o,r.done())})).next((function(){return i}))},t.prototype.Sa=function(t,e,n){var r=this,i=[],o=oo(t);return e.forEach((function(e){var s=ui(e.path);i.push(o.put(new Wi(n,s))),i.push(r.No.Da(t,n,e))})),pr.$n(i)},t.prototype.Ca=function(t,e,n){var r=this,i=oo(t);return pr.forEach(e,(function(e){var o=ui(e.path);return pr.$n([i.delete([n,o]),r.No.Na(t,n,e)])}))},t.prototype.pa=function(t,e){var n=oo(t),r=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(r)},t.prototype.Fa=function(t,e){var n=IDBKeyRange.bound([e],[e+1],!1,!0),r=oo(t),i=Lt();return r.rs({range:n,ss:!0},(function(t,e,n){var r=hi(t[1]),o=new A(r);i=i.add(o)})).next((function(){return i}))},t.prototype.Ho=function(t,e){var n=ui(e.path),r=IDBKeyRange.bound([n],[X(n)],!1,!0),i=0;return oo(t).rs({index:Wi.documentTargetsIndex,ss:!0,range:r},(function(t,e,n){0!==t[0]&&(i++,n.done())})).next((function(){return i>0}))},t.prototype.Ue=function(t,e){return ro(t).get(e).next((function(t){return t?bi(t):null}))},t}();function ro(t){return uo.Qn(t,$i.store)}function io(t){return uo.Qn(t,Ki.store)}function oo(t){return uo.Qn(t,Wi.store)}var so="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.",ao=function(t){function e(e,n){var r=this;return(r=t.call(this)||this).jo=e,r.xa=n,r}return r.__extends(e,t),e}(Jr),uo=function(){function t(e,n,r,i,o,s,a,u,c,f){if(this.allowTabSynchronization=e,this.persistenceKey=n,this.clientId=r,this.fn=o,this.window=s,this.document=a,this.$a=c,this.ka=f,this.Ma=null,this.Oa=!1,this.isPrimary=!1,this.networkEnabled=!0,this.La=null,this.inForeground=!1,this.Ba=null,this.qa=null,this.Ua=Number.NEGATIVE_INFINITY,this.Qa=function(t){return Promise.resolve()},!t.Ln())throw new h(l.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.No=new ho(this,i),this.Wa=n+"main",this.serializer=new fi(u),this.ja=new gr(this.Wa,10,new Ui(this.serializer)),this.Ka=new no(this.No,this.serializer),this.Dr=new Ji,this.vr=function(t,e){return new Ai(t,e)}(this.serializer,this.Dr),this.window&&this.window.localStorage?this.Ga=this.window.localStorage:(this.Ga=null,!1===f&&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.Qn=function(t,e){if(t instanceof ao)return gr.Qn(t.jo,e);throw y()},t.prototype.start=function(){var t=this;return this.za().then((function(){if(!t.isPrimary&&!t.allowTabSynchronization)throw new h(l.FAILED_PRECONDITION,so);return t.Ha(),t.Ya(),t.Ja(),t.runTransaction("getHighestListenSequenceNumber","readonly",(function(e){return t.Ka.Ia(e)}))})).then((function(e){t.Ma=new Vr(e,t.$a)})).then((function(){t.Oa=!0})).catch((function(e){return t.ja&&t.ja.close(),Promise.reject(e)}))},t.prototype.Xa=function(t){var e=this;return this.Qa=function(n){return r.__awaiter(e,void 0,void 0,(function(){return r.__generator(this,(function(e){return this.Ei?[2,t(n)]:[2]}))}))},t(this.isPrimary)},t.prototype.Za=function(t){var e=this;this.ja.Kn((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]}}))}))}))},t.prototype.tc=function(t){var e=this;this.networkEnabled!==t&&(this.networkEnabled=t,this.fn.ws((function(){return r.__awaiter(e,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return this.Ei?[4,this.za()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))})))},t.prototype.za=function(){var t=this;return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(function(e){return lo(e).put(new Yi(t.clientId,Date.now(),t.networkEnabled,t.inForeground)).next((function(){if(t.isPrimary)return t.ec(e).next((function(e){e||(t.isPrimary=!1,t.fn.Cs((function(){return t.Qa(!1)})))}))})).next((function(){return t.nc(e)})).next((function(n){return t.isPrimary&&!n?t.sc(e).next((function(){return!1})):!!n&&t.ic(e).next((function(){return!0}))}))})).catch((function(e){if(yr(e))return p("IndexedDbPersistence","Failed to extend owner lease: ",e),t.isPrimary;if(!t.allowTabSynchronization)throw e;return p("IndexedDbPersistence","Releasing owner lease after error during lease refresh",e),!1})).then((function(e){t.isPrimary!==e&&t.fn.Cs((function(){return t.Qa(e)})),t.isPrimary=e}))},t.prototype.ec=function(t){var e=this;return co(t).get(Vi.key).next((function(t){return pr.resolve(e.rc(t))}))},t.prototype.oc=function(t){return lo(t).delete(this.clientId)},t.prototype.ac=function(){return r.__awaiter(this,void 0,void 0,(function(){var e,n,i,o=this;return r.__generator(this,(function(r){switch(r.label){case 0:return!this.isPrimary||this.cc(this.Ua,18e5)?[3,2]:(this.Ua=Date.now(),[4,this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(function(e){var n=t.Qn(e,Yi.store);return n.ts().next((function(t){var e=o.uc(t,18e5),r=t.filter((function(t){return-1===e.indexOf(t)}));return pr.forEach(r,(function(t){return n.delete(t.clientId)})).next((function(){return r}))}))})).catch((function(){return[]}))]);case 1:if(e=r.sent(),this.Ga)for(n=0,i=e;n<i.length;n++)this.Ga.removeItem(this.hc(i[n].clientId));r.label=2;case 2:return[2]}}))}))},t.prototype.Ja=function(){var t=this;this.qa=this.fn.yn("client_metadata_refresh",4e3,(function(){return t.za().then((function(){return t.ac()})).then((function(){return t.Ja()}))}))},t.prototype.rc=function(t){return!!t&&t.ownerId===this.clientId},t.prototype.nc=function(t){var e=this;return this.ka?pr.resolve(!0):co(t).get(Vi.key).next((function(n){if(null!==n&&e.cc(n.leaseTimestampMs,5e3)&&!e.lc(n.ownerId)){if(e.rc(n)&&e.networkEnabled)return!0;if(!e.rc(n)){if(!n.allowTabSynchronization)throw new h(l.FAILED_PRECONDITION,so);return!1}}return!(!e.networkEnabled||!e.inForeground)||lo(t).ts().next((function(t){return void 0===e.uc(t,5e3).find((function(t){return!(e.clientId===t.clientId||!(!e.networkEnabled&&t.networkEnabled||!e.inForeground&&t.inForeground&&e.networkEnabled===t.networkEnabled))}))}))})).next((function(t){return e.isPrimary!==t&&p("IndexedDbPersistence","Client "+(t?"is":"is not")+" eligible for a primary lease."),t}))},t.prototype.Di=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.Oa=!1,this._c(),this.qa&&(this.qa.cancel(),this.qa=null),this.fc(),this.dc(),[4,this.ja.runTransaction("shutdown","readwrite",[Vi.store,Yi.store],(function(e){var n=new ao(e,Vr.ai);return t.sc(n).next((function(){return t.oc(n)}))}))];case 1:return e.sent(),this.ja.close(),this.wc(),[2]}}))}))},t.prototype.uc=function(t,e){var n=this;return t.filter((function(t){return n.cc(t.updateTimeMs,e)&&!n.lc(t.clientId)}))},t.prototype.pi=function(){var t=this;return this.runTransaction("getActiveClients","readonly",(function(e){return lo(e).ts().next((function(e){return t.uc(e,18e5).map((function(t){return t.clientId}))}))}))},Object.defineProperty(t.prototype,"Ei",{get:function(){return this.Oa},enumerable:!1,configurable:!0}),t.prototype.mc=function(t){return Ei.xo(t,this.serializer,this.Dr,this.No)},t.prototype.Tc=function(){return this.Ka},t.prototype.Ec=function(){return this.vr},t.prototype.Ic=function(){return this.Dr},t.prototype.runTransaction=function(t,e,n){var r,i=this;return p("IndexedDbPersistence","Starting transaction:",t),this.ja.runTransaction(t,"readonly"===e?"readonly":"readwrite",Xi,(function(o){return r=new ao(o,i.Ma?i.Ma.next():Vr.ai),"readwrite-primary"===e?i.ec(r).next((function(t){return!!t||i.nc(r)})).next((function(e){if(!e)throw g("Failed to obtain primary lease for action '"+t+"'."),i.isPrimary=!1,i.fn.Cs((function(){return i.Qa(!1)})),new h(l.FAILED_PRECONDITION,Xr);return n(r)})).next((function(t){return i.ic(r).next((function(){return t}))})):i.Ac(r).next((function(){return n(r)}))})).then((function(t){return r.br(),t}))},t.prototype.Ac=function(t){var e=this;return co(t).get(Vi.key).next((function(t){if(null!==t&&e.cc(t.leaseTimestampMs,5e3)&&!e.lc(t.ownerId)&&!e.rc(t)&&!(e.ka||e.allowTabSynchronization&&t.allowTabSynchronization))throw new h(l.FAILED_PRECONDITION,so)}))},t.prototype.ic=function(t){var e=new Vi(this.clientId,this.allowTabSynchronization,Date.now());return co(t).put(Vi.key,e)},t.Ln=function(){return gr.Ln()},t.prototype.sc=function(t){var e=this,n=co(t);return n.get(Vi.key).next((function(t){return e.rc(t)?(p("IndexedDbPersistence","Releasing primary lease."),n.delete(Vi.key)):pr.resolve()}))},t.prototype.cc=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.Ha=function(){var t=this;null!==this.document&&"function"==typeof this.document.addEventListener&&(this.Ba=function(){t.fn.ws((function(){return t.inForeground="visible"===t.document.visibilityState,t.za()}))},this.document.addEventListener("visibilitychange",this.Ba),this.inForeground="visible"===this.document.visibilityState)},t.prototype.fc=function(){this.Ba&&(this.document.removeEventListener("visibilitychange",this.Ba),this.Ba=null)},t.prototype.Ya=function(){var t,e=this;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.La=function(){e._c(),e.fn.ws((function(){return e.Di()}))},this.window.addEventListener("unload",this.La))},t.prototype.dc=function(){this.La&&(this.window.removeEventListener("unload",this.La),this.La=null)},t.prototype.lc=function(t){var e;try{var n=null!==(null===(e=this.Ga)||void 0===e?void 0:e.getItem(this.hc(t)));return p("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._c=function(){if(this.Ga)try{this.Ga.setItem(this.hc(this.clientId),String(Date.now()))}catch(r){g("Failed to set zombie client id.",r)}},t.prototype.wc=function(){if(this.Ga)try{this.Ga.removeItem(this.hc(this.clientId))}catch(r){}},t.prototype.hc=function(t){return"firestore_zombie_"+this.persistenceKey+"_"+t},t}();function co(t){return uo.Qn(t,Vi.store)}function lo(t){return uo.Qn(t,Yi.store)}var ho=function(){function t(t,e){this.db=t,this.wo=new ai(this,e)}return t.prototype.Po=function(t){var e=this.Rc(t);return this.db.Tc().ba(t).next((function(t){return e.next((function(e){return t+e}))}))},t.prototype.Rc=function(t){var e=0;return this.Vo(t,(function(t){e++})).next((function(){return e}))},t.prototype.Ce=function(t,e){return this.db.Tc().Ce(t,e)},t.prototype.Vo=function(t,e){return this.gc(t,(function(t,n){return e(n)}))},t.prototype.Da=function(t,e,n){return fo(t,n)},t.prototype.Na=function(t,e,n){return fo(t,n)},t.prototype.po=function(t,e,n){return this.db.Tc().po(t,e,n)},t.prototype.Go=function(t,e){return fo(t,e)},t.prototype.Pc=function(t,e){return function(t,e){var n=!1;return Ci(t).os((function(r){return Si(t,r,e).next((function(t){return t&&(n=!0),pr.resolve(!t)}))})).next((function(){return n}))}(t,e)},t.prototype.bo=function(t,e){var n=this,r=this.db.Ec().ra(),i=[],o=0;return this.gc(t,(function(s,a){if(a<=e){var u=n.Pc(t,s).next((function(e){if(!e)return o++,r.Rr(t,s).next((function(){return r.Ar(s),oo(t).delete([0,ui(s.path)])}))}));i.push(u)}})).next((function(){return pr.$n(i)})).next((function(){return r.apply(t)})).next((function(){return o}))},t.prototype.removeTarget=function(t,e){var n=e.st(t.xa);return this.db.Tc().ya(t,n)},t.prototype.yc=function(t,e){return fo(t,e)},t.prototype.gc=function(t,e){var n,r=oo(t),i=Vr.ai;return r.rs({index:Wi.documentTargetsIndex},(function(t,r){var o=r.path,s=r.sequenceNumber;0===t[0]?(i!==Vr.ai&&e(new A(hi(n)),i),i=s,n=o):i=Vr.ai})).next((function(){i!==Vr.ai&&e(new A(hi(n)),i)}))},t.prototype.So=function(t){return this.db.Ec().aa(t)},t}();function fo(t,e){return oo(t).put(function(t,e){return new Wi(0,ui(t.path),e)}(e,t.xa))}function po(t,e){var n=t.projectId;return t.j||(n+="."+t.database),"firestore/"+e+"/"+n+"/"}var go=function(){function t(t,e,n){this.persistence=t,this.Vc=e,this.bc=new St(Z),this.vc=new st((function(t){return pt(t)}),gt),this.Sc=ut.min(),this.Sr=t.mc(n),this.Dc=t.Ec(),this.Ka=t.Tc(),this.Cc=new ti(this.Dc,this.Sr,this.persistence.Ic()),this.Vc.Nc(this.Cc)}return t.prototype.Io=function(t){var e=this;return this.persistence.runTransaction("Collect garbage","readwrite-primary",(function(n){return t.vo(n,e.bc)}))},t}();function vo(t,e){var n=b(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(function(t){var r=e.batch.keys(),i=n.Dc.ra({oa:!0});return function(t,e,n,r){var i=n.batch,o=i.keys(),s=pr.resolve();return o.forEach((function(t){s=s.next((function(){return r.Rr(e,t)})).next((function(e){var o=e,s=n.dr.get(t);w(null!==s),(!o||o.version.L(s)<0)&&(o=i.cr(t,o,n))&&r.Er(o,n._r)}))})),s.next((function(){return t.Sr.Wo(e,i)}))}(n,t,e,i).next((function(){return i.apply(t)})).next((function(){return n.Sr.zo(t)})).next((function(){return n.Cc.kr(t,r)}))}))}function mo(t){var e=b(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(function(t){return e.Ka.Ea(t)}))}function yo(t,e){var n=b(t),r=e.nt,i=n.bc;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(function(t){var o=n.Dc.ra({oa:!0});i=n.bc;var s=[];e.zt.forEach((function(e,o){var a=i.get(o);if(a){s.push(n.Ka.Ca(t,e.se,o).next((function(){return n.Ka.Sa(t,e.ee,o)})));var u=e.resumeToken;if(u.O()>0){var c=a.it(u,r).st(t.xa);i=i.ot(o,c),function(t,e,n){return w(e.resumeToken.O()>0),0===t.resumeToken.O()||e.nt.X()-t.nt.X()>=3e8||n.ee.size+n.ne.size+n.se.size>0}(a,c,e)&&s.push(n.Ka.ya(t,c))}}}));var a=Nt(),u=Lt();if(e.Yt.forEach((function(t,e){u=u.add(t)})),s.push(o.getEntries(t,u).next((function(i){e.Yt.forEach((function(u,c){var l=i.get(u);c instanceof kn&&c.version.isEqual(ut.min())?(o.Ar(u,r),a=a.ot(u,c)):null==l||c.version.L(l.version)>0||0===c.version.L(l.version)&&l.hasPendingWrites?(o.Er(c,r),a=a.ot(u,c)):p("LocalStore","Ignoring outdated watch update for ",u,". Current version:",l.version," Watch version:",c.version),e.Jt.has(u)&&s.push(n.persistence.No.yc(t,u))}))}))),!r.isEqual(ut.min())){var c=n.Ka.Ea(t).next((function(e){return n.Ka.Aa(t,t.xa,r)}));s.push(c)}return pr.$n(s).next((function(){return o.apply(t)})).next((function(){return n.Cc.Mr(t,a)}))})).then((function(t){return n.bc=i,t}))}function wo(t,e){var n=b(t);return n.persistence.runTransaction("Get next mutation batch","readonly",(function(t){return void 0===e&&(e=-1),n.Sr.Bo(t,e)}))}function bo(t,e){var n=b(t);return n.persistence.runTransaction("Allocate target","readwrite",(function(t){var r;return n.Ka.va(t,e).next((function(i){return i?pr.resolve(r=i):n.Ka.wa(t).next((function(i){return r=new wt(e,i,0,t.xa),n.Ka.Ra(t,r).next((function(){return r}))}))}))})).then((function(t){var r=n.bc.get(t.targetId);return(null===r||t.nt.L(r.nt)>0)&&(n.bc=n.bc.ot(t.targetId,t),n.vc.set(e,t.targetId)),t}))}function _o(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=b(t),o=i.bc.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.No.removeTarget(t,o)}))];case 2:r.sent(),r.label=3;case 3:return[3,5];case 4:if(!yr(a=r.sent()))throw a;return p("LocalStore","Failed to update sequence numbers for target "+e+": "+a),[3,5];case 5:return i.bc=i.bc.remove(e),i.vc.delete(o.target),[2]}}))}))}function Eo(t,e,n){var r=b(t),i=ut.min(),o=Lt();return r.persistence.runTransaction("Execute query","readonly",(function(t){return function(t,e,n){var r=b(t),i=r.vc.get(n);return void 0!==i?pr.resolve(r.bc.get(i)):r.Ka.va(e,n)}(r,t,qn(e)).next((function(e){if(e)return i=e.lastLimboFreeSnapshotVersion,r.Ka.Fa(t,e.targetId).next((function(t){o=t}))})).next((function(){return r.Vc.Lr(t,e,n?i:ut.min(),n?o:Lt())})).next((function(t){return{documents:t,Fc:o}}))}))}function So(t,e){var n=b(t),r=b(n.Ka),i=n.bc.get(e);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",(function(t){return r.Ue(t,e).next((function(t){return t?t.target:null}))}))}function Io(t){var e=b(t);return e.persistence.runTransaction("Get new document changes","readonly",(function(t){return function(t,e,n){var r=b(t),i=Nt(),o=gi(n),s=Ri(e),a=IDBKeyRange.lowerBound(o,!0);return s.rs({index:Hi.readTimeIndex,range:a},(function(t,e){var n=di(r.serializer,e);i=i.ot(n.key,n),o=e.readTime})).next((function(){return{xc:i,readTime:vi(o)}}))}(e.Dc,t,e.Sc)})).then((function(t){var n=t.xc;return e.Sc=t.readTime,n}))}function To(t){return r.__awaiter(this,void 0,void 0,(function(){var e;return r.__generator(this,(function(n){return[2,(e=b(t)).persistence.runTransaction("Synchronize last document change read time","readonly",(function(t){return function(t){var e=Ri(t),n=ut.min();return e.rs({index:Hi.readTimeIndex,reverse:!0},(function(t,e,r){e.readTime&&(n=vi(e.readTime)),r.done()})).next((function(){return n}))}(t)})).then((function(t){e.Sc=t}))]}))}))}function xo(t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){if(t.code!==l.FAILED_PRECONDITION||t.message!==Xr)throw t;return p("LocalStore","Unexpectedly lost primary lease"),[2]}))}))}var Co=function(){function t(){this.$c=new xt(Ao.kc),this.Mc=new xt(Ao.Oc)}return t.prototype.m=function(){return this.$c.m()},t.prototype.Da=function(t,e){var n=new Ao(t,e);this.$c=this.$c.add(n),this.Mc=this.Mc.add(n)},t.prototype.Lc=function(t,e){var n=this;t.forEach((function(t){return n.Da(t,e)}))},t.prototype.Na=function(t,e){this.Bc(new Ao(t,e))},t.prototype.qc=function(t,e){var n=this;t.forEach((function(t){return n.Na(t,e)}))},t.prototype.Uc=function(t){var e=this,n=new A(new T([])),r=new Ao(n,t),i=new Ao(n,t+1),o=[];return this.Mc.Ft([r,i],(function(t){e.Bc(t),o.push(t.key)})),o},t.prototype.Qc=function(){var t=this;this.$c.forEach((function(e){return t.Bc(e)}))},t.prototype.Bc=function(t){this.$c=this.$c.delete(t),this.Mc=this.Mc.delete(t)},t.prototype.Wc=function(t){var e=new A(new T([])),n=new Ao(e,t),r=new Ao(e,t+1),i=Lt();return this.Mc.Ft([n,r],(function(t){i=i.add(t.key)})),i},t.prototype.Ho=function(t){var e=new Ao(t,0),n=this.$c.$t(e);return null!==n&&t.isEqual(n.key)},t}(),Ao=function(){function t(t,e){this.key=t,this.jc=e}return t.kc=function(t,e){return A.i(t.key,e.key)||Z(t.jc,e.jc)},t.Oc=function(t,e){return Z(t.jc,e.jc)||A.i(t.key,e.key)},t}(),No=function(t,e){this.user=e,this.type="OAuth",this.Kc={},this.Kc.Authorization="Bearer "+t},ko=function(){function t(){this.Gc=null}return t.prototype.getToken=function(){return Promise.resolve(null)},t.prototype.zc=function(){},t.prototype.Hc=function(t){this.Gc=t,t(Mr.UNAUTHENTICATED)},t.prototype.Yc=function(){this.Gc=null},t}(),Ro=function(){function t(t){var e=this;this.Jc=null,this.currentUser=Mr.UNAUTHENTICATED,this.Xc=!1,this.Zc=0,this.Gc=null,this.forceRefresh=!1,this.Jc=function(){e.Zc++,e.currentUser=e.tu(),e.Xc=!0,e.Gc&&e.Gc(e.currentUser)},this.Zc=0,this.auth=t.getImmediate({optional:!0}),this.auth?this.auth.addAuthTokenListener(this.Jc):(this.Jc(null),t.get().then((function(t){e.auth=t,e.Jc&&e.auth.addAuthTokenListener(e.Jc)}),(function(){})))}return t.prototype.getToken=function(){var t=this,e=this.Zc,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((function(n){return t.Zc!==e?(p("FirebaseCredentialsProvider","getToken aborted due to token change."),t.getToken()):n?(w("string"==typeof n.accessToken),new No(n.accessToken,t.currentUser)):null})):Promise.resolve(null)},t.prototype.zc=function(){this.forceRefresh=!0},t.prototype.Hc=function(t){this.Gc=t,this.Xc&&t(this.currentUser)},t.prototype.Yc=function(){this.auth&&this.auth.removeAuthTokenListener(this.Jc),this.Jc=null,this.Gc=null},t.prototype.tu=function(){var t=this.auth&&this.auth.getUid();return w(null===t||"string"==typeof t),new Mr(t)},t}(),Do=function(){function t(t,e){this.eu=t,this.nu=e,this.type="FirstParty",this.user=Mr.ni}return Object.defineProperty(t.prototype,"Kc",{get:function(){var t={"X-Goog-AuthUser":this.nu},e=this.eu.auth.getAuthHeaderValueForFirstParty([]);return e&&(t.Authorization=e),t},enumerable:!1,configurable:!0}),t}(),Oo=function(){function t(t,e){this.eu=t,this.nu=e}return t.prototype.getToken=function(){return Promise.resolve(new Do(this.eu,this.nu))},t.prototype.Hc=function(t){t(Mr.ni)},t.prototype.Yc=function(){},t.prototype.zc=function(){},t}(),Po=function(){function t(t,e,n,r,i,o){this.fn=t,this.su=n,this.iu=r,this.ru=i,this.listener=o,this.state=0,this.ou=0,this.au=null,this.stream=null,this.ys=new dr(t,e)}return t.prototype.cu=function(){return 1===this.state||2===this.state||4===this.state},t.prototype.uu=function(){return 2===this.state},t.prototype.start=function(){3!==this.state?this.auth():this.hu()},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.cu()?[4,this.close(0)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.lu=function(){this.state=0,this.ys.reset()},t.prototype._u=function(){var t=this;this.uu()&&null===this.au&&(this.au=this.fn.yn(this.su,6e4,(function(){return t.fu()})))},t.prototype.du=function(t){this.wu(),this.stream.send(t)},t.prototype.fu=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return this.uu()?[2,this.close(0)]:[2]}))}))},t.prototype.wu=function(){this.au&&(this.au.cancel(),this.au=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.wu(),this.ys.cancel(),this.ou++,3!==t?this.ys.reset():e&&e.code===l.RESOURCE_EXHAUSTED?(g(e.toString()),g("Using maximum backoff delay to prevent overloading the backend."),this.ys.Rn()):e&&e.code===l.UNAUTHENTICATED&&this.ru.zc(),null!==this.stream&&(this.mu(),this.stream.close(),this.stream=null),this.state=t,[4,this.listener.Tu(e)];case 1:return n.sent(),[2]}}))}))},t.prototype.mu=function(){},t.prototype.auth=function(){var t=this;this.state=1;var e=this.Eu(this.ou),n=this.ou;this.ru.getToken().then((function(e){t.ou===n&&t.Iu(e)}),(function(n){e((function(){var e=new h(l.UNKNOWN,"Fetching auth token failed: "+n.message);return t.Au(e)}))}))},t.prototype.Iu=function(t){var e=this,n=this.Eu(this.ou);this.stream=this.Ru(t),this.stream.gu((function(){n((function(){return e.state=2,e.listener.gu()}))})),this.stream.Tu((function(t){n((function(){return e.Au(t)}))})),this.stream.onMessage((function(t){n((function(){return e.onMessage(t)}))}))},t.prototype.hu=function(){var t=this;this.state=4,this.ys.gn((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.Au=function(t){return p("PersistentStream","close with error: "+t),this.stream=null,this.close(3,t)},t.prototype.Eu=function(t){var e=this;return function(n){e.fn.ws((function(){return e.ou===t?n():(p("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())}))}},t}(),Lo=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.Ru=function(t){return this.iu.Pu("Listen",t)},e.prototype.onMessage=function(t){this.ys.reset();var e=function(t,e){var n;if("targetChange"in e){var r=function(t){return"NO_CHANGE"===t?0:"ADD"===t?1:"REMOVE"===t?2:"CURRENT"===t?3:"RESET"===t?4:y()}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],o=function(t,e){return t.Qe?(w(void 0===e||"string"==typeof e),J.fromBase64String(e||"")):(w(void 0===e||e instanceof Uint8Array),J.fromUint8Array(e||new Uint8Array))}(t,e.targetChange.resumeToken),s=e.targetChange.cause,a=s&&function(t){var e=void 0===t.code?l.UNKNOWN:Et(t.code);return new h(e,t.message||"")}(s);n=new Gt(r,i,o,a||null)}else if("documentChange"in e){var u=e.documentChange,c=Ce(t,u.document.name),f=Se(u.document.updateTime),d=new Tn({mapValue:{fields:u.document.fields}}),p=new Nn(c,f,d,{});n=new Bt(u.targetIds||[],u.removedTargetIds||[],p.key,p)}else if("documentDelete"in e){var g=e.documentDelete,v=Ce(t,g.document),m=g.readTime?Se(g.readTime):ut.min(),b=new kn(v,m);n=new Bt([],g.removedTargetIds||[],b.key,b)}else if("documentRemove"in e){var _=e.documentRemove,E=Ce(t,_.document);n=new Bt([],_.removedTargetIds||[],E,null)}else{if(!("filter"in e))return y();var S=e.filter,I=new bt(S.count||0);n=new Ht(S.targetId,I)}return n}(this.serializer,t),n=function(t){if(!("targetChange"in t))return ut.min();var e=t.targetChange;return e.targetIds&&e.targetIds.length?ut.min():e.readTime?Se(e.readTime):ut.min()}(t);return this.listener.yu(e,n)},e.prototype.Vu=function(t){var e={};e.database=ke(this.serializer),e.addTarget=function(t,e){var n,r=e.target;return(n=vt(r)?{documents:Le(t,r)}:{query:Ue(t,r)}).targetId=e.targetId,e.resumeToken.O()>0&&(n.resumeToken=_e(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 y()}}(0,e.et);return null==n?null:{"goog-listen-tags":n}}(0,t);n&&(e.labels=n),this.du(e)},e.prototype.pu=function(t){var e={};e.database=ke(this.serializer),e.removeTarget=t,this.du(e)},e}(Po),Uo=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=i,s.bu=!1,s}return r.__extends(e,t),Object.defineProperty(e.prototype,"vu",{get:function(){return this.bu},enumerable:!1,configurable:!0}),e.prototype.start=function(){this.bu=!1,this.lastStreamToken=void 0,t.prototype.start.call(this)},e.prototype.mu=function(){this.bu&&this.Su([])},e.prototype.Ru=function(t){return this.iu.Pu("Write",t)},e.prototype.onMessage=function(t){if(w(!!t.streamToken),this.lastStreamToken=t.streamToken,this.bu){this.ys.reset();var e=function(t,e){return t&&t.length>0?(w(void 0!==e),t.map((function(t){return function(t,e){var n=Se(t.updateTime?t.updateTime:e);n.isEqual(ut.min())&&(n=Se(e));var r=null;return t.transformResults&&t.transformResults.length>0&&(r=t.transformResults),new un(n,r)}(t,e)}))):[]}(t.writeResults,t.commitTime),n=Se(t.commitTime);return this.listener.Du(n,e)}return w(!t.writeResults||0===t.writeResults.length),this.bu=!0,this.listener.Cu()},e.prototype.Nu=function(){var t={};t.database=ke(this.serializer),this.du(t)},e.prototype.Su=function(t){var e=this,n={streamToken:this.lastStreamToken,writes:t.map((function(t){return Oe(e.serializer,t)}))};this.du(n)},e}(Po),Mo=function(t){function e(e,n,r){var i=this;return(i=t.call(this)||this).credentials=e,i.iu=n,i.serializer=r,i.Fu=!1,i}return r.__extends(e,t),e.prototype.xu=function(){if(this.Fu)throw new h(l.FAILED_PRECONDITION,"The client has already been terminated.")},e.prototype.$u=function(t,e,n){var r=this;return this.xu(),this.credentials.getToken().then((function(i){return r.iu.$u(t,e,n,i)})).catch((function(t){throw t.code===l.UNAUTHENTICATED&&r.credentials.zc(),t}))},e.prototype.ku=function(t,e,n){var r=this;return this.xu(),this.credentials.getToken().then((function(i){return r.iu.ku(t,e,n,i)})).catch((function(t){throw t.code===l.UNAUTHENTICATED&&r.credentials.zc(),t}))},e.prototype.terminate=function(){this.Fu=!1},e}((function(){})),Vo=function(){function t(t,e){this.cs=t,this.di=e,this.state="Unknown",this.Mu=0,this.Ou=null,this.Lu=!0}return t.prototype.Bu=function(){var t=this;0===this.Mu&&(this.qu("Unknown"),this.Ou=this.cs.yn("online_state_timeout",1e4,(function(){return t.Ou=null,t.Uu("Backend didn't respond within 10 seconds."),t.qu("Offline"),Promise.resolve()})))},t.prototype.Qu=function(t){"Online"===this.state?this.qu("Unknown"):(this.Mu++,this.Mu>=1&&(this.Wu(),this.Uu("Connection failed 1 times. Most recent error: "+t.toString()),this.qu("Offline")))},t.prototype.set=function(t){this.Wu(),this.Mu=0,"Online"===t&&(this.Lu=!1),this.qu(t)},t.prototype.qu=function(t){t!==this.state&&(this.state=t,this.di(t))},t.prototype.Uu=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.Lu?(g(e),this.Lu=!1):p("OnlineStateTracker",e)},t.prototype.Wu=function(){null!==this.Ou&&(this.Ou.cancel(),this.Ou=null)},t}(),jo=function(t,e,n,i,o){var s=this;this.ju=t,this.Ku=e,this.cs=n,this.Gu={},this.zu=[],this.Hu=new Map,this.Yu=new Set,this.Ju=[],this.Xu=o,this.Xu.Zu((function(t){n.ws((function(){return r.__awaiter(s,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return Qo(this)?(p("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=b(t)).Yu.add(4),[4,qo(e)];case 1:return n.sent(),e.th.set("Unknown"),e.Yu.delete(4),[4,Fo(e)];case 2:return n.sent(),[2]}}))}))}(this)]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))}))})),this.th=new Vo(n,i)};function Fo(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(!Qo(t))return[3,4];e=0,n=t.Ju,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 qo(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.Ju,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=b(t),p("RemoteStore","RemoteStore shutting down."),e.Yu.add(5),[4,qo(e)];case 1:return n.sent(),e.Xu.Di(),e.th.set("Unknown"),[2]}}))}))}function Bo(t,e){var n=b(t);n.Hu.has(e.targetId)||(n.Hu.set(e.targetId,e),Ko(n)?Wo(n):ls(n).uu()&&Go(n,e))}function Ho(t,e){var n=b(t),r=ls(n);n.Hu.delete(e),r.uu()&&$o(n,e),0===n.Hu.size&&(r.uu()?r._u():Qo(n)&&n.th.set("Unknown"))}function Go(t,e){t.eh.Ie(e.targetId),ls(t).Vu(e)}function $o(t,e){t.eh.Ie(e),ls(t).pu(e)}function Wo(t){t.eh=new Wt({qe:function(e){return t.Gu.qe(e)},Ue:function(e){return t.Hu.get(e)||null}}),ls(t).start(),t.th.Bu()}function Ko(t){return Qo(t)&&!ls(t).cu()&&t.Hu.size>0}function Qo(t){return 0===b(t).Yu.size}function Zo(t){t.eh=void 0}function Yo(t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return t.Hu.forEach((function(e,n){Go(t,e)})),[2]}))}))}function Xo(t,e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){return Zo(t),Ko(t)?(t.th.Qu(e),Wo(t)):t.th.set("Unknown"),[2]}))}))}function Jo(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.th.set("Online"),!(e instanceof Gt&&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?t.Hu.has(s=o[i])?[4,t.Gu.nh(s,n)]:[3,3]:[3,5];case 2:r.sent(),t.Hu.delete(s),t.eh.removeTarget(s),r.label=3;case 3:r.label=4;case 4:return i++,[3,1];case 5:return[2]}}))}))}(t,e)];case 2:return a.sent(),[3,5];case 3:return i=a.sent(),p("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),i),[4,ts(t,i)];case 4:return a.sent(),[3,5];case 5:return[3,13];case 6:if(e instanceof Bt?t.eh.be(e):e instanceof Ht?t.eh.$e(e):t.eh.De(e),n.isEqual(ut.min()))return[3,13];a.label=7;case 7:return a.trys.push([7,11,,13]),[4,mo(t.ju)];case 8:return o=a.sent(),n.L(o)>=0?[4,function(t,e){var n=t.eh.Oe(e);return n.zt.forEach((function(n,r){if(n.resumeToken.O()>0){var i=t.Hu.get(r);i&&t.Hu.set(r,i.it(n.resumeToken,e))}})),n.Ht.forEach((function(e){var n=t.Hu.get(e);if(n){t.Hu.set(e,n.it(J.B,n.nt)),$o(t,e);var r=new wt(n.target,e,1,n.sequenceNumber);Go(t,r)}})),t.Gu.sh(n)}(t,n)]:[3,10];case 9:a.sent(),a.label=10;case 10:return[3,13];case 11:return p("RemoteStore","Failed to raise snapshot:",s=a.sent()),[4,ts(t,s)];case 12:return a.sent(),[3,13];case 13:return[2]}}))}))}function ts(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(!yr(e))throw e;return t.Yu.add(1),[4,qo(t)];case 1:return o.sent(),t.th.set("Offline"),n||(n=function(){return mo(t.ju)}),t.cs.Cs((function(){return r.__awaiter(i,void 0,void 0,(function(){return r.__generator(this,(function(e){switch(e.label){case 0:return p("RemoteStore","Retrying IndexedDB access"),[4,n()];case 1:return e.sent(),t.Yu.delete(1),[4,Fo(t)];case 2:return e.sent(),[2]}}))}))})),[2]}}))}))}function es(t,e){return e().catch((function(n){return ts(t,n,e)}))}function ns(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=b(t),n=hs(e),i=e.zu.length>0?e.zu[e.zu.length-1].batchId:-1,r.label=1;case 1:if(!function(t){return Qo(t)&&t.zu.length<10}(e))return[3,7];r.label=2;case 2:return r.trys.push([2,4,,6]),[4,wo(e.ju,i)];case 3:return null===(o=r.sent())?(0===e.zu.length&&n._u(),[3,7]):(i=o.batchId,function(t,e){t.zu.push(e);var n=hs(t);n.uu()&&n.vu&&n.Su(e.mutations)}(e,o),[3,6]);case 4:return s=r.sent(),[4,ts(e,s)];case 5:return r.sent(),[3,6];case 6:return[3,1];case 7:return rs(e)&&is(e),[2]}}))}))}function rs(t){return Qo(t)&&!hs(t).cu()&&t.zu.length>0}function is(t){hs(t).start()}function os(t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return hs(t).Nu(),[2]}))}))}function ss(t){return r.__awaiter(this,void 0,void 0,(function(){var e,n,i;return r.__generator(this,(function(r){for(e=hs(t),n=0,i=t.zu;n<i.length;n++)e.Su(i[n].mutations);return[2]}))}))}function as(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.zu.shift(),o=Zr.from(i,e,n),[4,es(t,(function(){return t.Gu.ih(o)}))];case 1:return r.sent(),[4,ns(t)];case 2:return r.sent(),[2]}}))}))}function us(t,e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(n){switch(n.label){case 0:return e&&hs(t).vu?[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 _t(i=e.code)&&i!==l.ABORTED?(n=t.zu.shift(),hs(t).lu(),[4,es(t,(function(){return t.Gu.rh(n.batchId,e)}))]):[3,3];case 1:return r.sent(),[4,ns(t)];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))}(t,e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return rs(t)&&is(t),[2]}}))}))}function cs(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=b(t),e?(n.Yu.delete(2),[4,Fo(n)]):[3,2];case 1:return r.sent(),[3,5];case 2:return e?[3,4]:(n.Yu.add(2),[4,qo(n)]);case 3:r.sent(),n.th.set("Unknown"),r.label=4;case 4:r.label=5;case 5:return[2]}}))}))}function ls(t){var e=this;return t.oh||(t.oh=function(t,e,n){var r=b(t);return r.xu(),new Lo(e,r.iu,r.credentials,r.serializer,n)}(t.Ku,t.cs,{gu:Yo.bind(null,t),Tu:Xo.bind(null,t),yu:Jo.bind(null,t)}),t.Ju.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.lu(),Ko(t)?Wo(t):t.th.set("Unknown"),[3,3]):[3,1];case 1:return[4,t.oh.stop()];case 2:e.sent(),Zo(t),e.label=3;case 3:return[2]}}))}))}))),t.oh}function hs(t){var e=this;return t.ah||(t.ah=function(t,e,n){var r=b(t);return r.xu(),new Uo(e,r.iu,r.credentials,r.serializer,n)}(t.Ku,t.cs,{gu:os.bind(null,t),Tu:us.bind(null,t),Cu:ss.bind(null,t),Du:as.bind(null,t)}),t.Ju.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.ah.lu(),[4,ns(t)]):[3,2];case 1:return e.sent(),[3,4];case 2:return[4,t.ah.stop()];case 3:e.sent(),t.zu.length>0&&(p("RemoteStore","Stopping write stream with "+t.zu.length+" pending writes"),t.zu=[]),e.label=4;case 4:return[2]}}))}))}))),t.ah}var fs=function(t){this.key=t},ds=function(t){this.key=t},ps=function(){function t(t,e){this.query=t,this.uh=e,this.hh=null,this.te=!1,this.lh=Lt(),this.Wt=Lt(),this._h=Qn(t),this.fh=new Vt(this._h)}return Object.defineProperty(t.prototype,"dh",{get:function(){return this.uh},enumerable:!1,configurable:!0}),t.prototype.wh=function(t,e){var n=this,r=e?e.mh:new jt,i=e?e.fh:this.fh,o=e?e.Wt:this.Wt,s=i,a=!1,u=Ln(this.query)&&i.size===this.query.limit?i.last():null,c=Un(this.query)&&i.size===this.query.limit?i.first():null;if(t.ht((function(t,e){var l=i.get(t),h=e instanceof Nn?e:null;h&&(h=Kn(n.query,h)?h:null);var f=!!l&&n.Wt.has(l.key),d=!!h&&(h.Je||n.Wt.has(h.key)&&h.hasCommittedMutations),p=!1;l&&h?l.data().isEqual(h.data())?f!==d&&(r.track({type:3,doc:h}),p=!0):n.Th(l,h)||(r.track({type:2,doc:h}),p=!0,(u&&n._h(h,u)>0||c&&n._h(h,c)<0)&&(a=!0)):!l&&h?(r.track({type:0,doc:h}),p=!0):l&&!h&&(r.track({type:1,doc:l}),p=!0,(u||c)&&(a=!0)),p&&(h?(s=s.add(h),o=d?o.add(t):o.delete(t)):(s=s.delete(t),o=o.delete(t)))})),Ln(this.query)||Un(this.query))for(;s.size>this.query.limit;){var l=Ln(this.query)?s.last():s.first();s=s.delete(l.key),o=o.delete(l.key),r.track({type:1,doc:l})}return{fh:s,mh:r,Eh:a,Wt:o}},t.prototype.Th=function(t,e){return t.Je&&e.hasCommittedMutations&&!e.Je},t.prototype.yr=function(t,e,n){var r=this,i=this.fh;this.fh=t.fh,this.Wt=t.Wt;var o=t.mh.Ut();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 y()}};return n(t)-n(e)}(t.type,e.type)||r._h(t.doc,e.doc)})),this.Ih(n);var s=e?this.Ah():[],a=0===this.lh.size&&this.te?1:0,u=a!==this.hh;return this.hh=a,0!==o.length||u?{snapshot:new Ft(this.query,t.fh,i,o,t.Wt,0===a,u,!1),Rh:s}:{Rh:s}},t.prototype.Qs=function(t){return this.te&&"Offline"===t?(this.te=!1,this.yr({fh:this.fh,mh:new jt,Wt:this.Wt,Eh:!1},!1)):{Rh:[]}},t.prototype.gh=function(t){return!this.uh.has(t)&&!!this.fh.has(t)&&!this.fh.get(t).Je},t.prototype.Ih=function(t){var e=this;t&&(t.ee.forEach((function(t){return e.uh=e.uh.add(t)})),t.ne.forEach((function(t){})),t.se.forEach((function(t){return e.uh=e.uh.delete(t)})),this.te=t.te)},t.prototype.Ah=function(){var t=this;if(!this.te)return[];var e=this.lh;this.lh=Lt(),this.fh.forEach((function(e){t.gh(e.key)&&(t.lh=t.lh.add(e.key))}));var n=[];return e.forEach((function(e){t.lh.has(e)||n.push(new ds(e))})),this.lh.forEach((function(t){e.has(t)||n.push(new fs(t))})),n},t.prototype.Ph=function(t){this.uh=t.Fc,this.lh=Lt();var e=this.wh(t.documents);return this.yr(e,!0)},t.prototype.yh=function(){return Ft.Gt(this.query,this.fh,this.Wt,0===this.hh)},t}(),gs=function(t,e,n){this.query=t,this.targetId=e,this.view=n},vs=function(t){this.key=t,this.Vh=!1},ms=function(){function t(t,e,n,r,i,o){this.ju=t,this.ph=e,this.bh=n,this.Sh=r,this.currentUser=i,this.Dh=o,this.Ch={},this.Nh=new st((function(t){return $n(t)}),Gn),this.Fh=new Map,this.xh=[],this.$h=new St(A.i),this.kh=new Map,this.Mh=new Co,this.Oh={},this.Lh=new Map,this.Bh=eo.da(),this.onlineState="Unknown",this.qh=void 0}return Object.defineProperty(t.prototype,"Uh",{get:function(){return!0===this.qh},enumerable:!1,configurable:!0}),t}();function ys(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:return n=Hs(t),(o=n.Nh.get(e))?(n.Sh.Oi(o.targetId),i=o.view.yh(),[3,4]):[3,1];case 1:return[4,bo(n.ju,qn(e))];case 2:return s=r.sent(),a=n.Sh.Oi(s.targetId),[4,ws(n,e,s.targetId,"current"===a)];case 3:i=r.sent(),n.Uh&&Bo(n.ph,s),r.label=4;case 4:return[2,i]}}))}))}function ws(t,e,n,i){return r.__awaiter(this,void 0,void 0,(function(){var o,s,a,u,c,l;return r.__generator(this,(function(h){switch(h.label){case 0:return t.Qh=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.wh(n)).Eh?[4,Eo(t.ju,e.query,!1).then((function(t){return e.view.wh(t.documents,o)}))]:[3,2];case 1:o=r.sent(),r.label=2;case 2:return s=i&&i.zt.get(e.targetId),a=e.view.yr(o,t.Uh,s),[2,(ks(t,e.targetId,a.Rh),a.snapshot)]}}))}))}(t,e,n,i)},[4,Eo(t.ju,e,!0)];case 1:return o=h.sent(),s=new ps(e,o.Fc),a=s.wh(o.documents),u=zt.Zt(n,i&&"Offline"!==t.onlineState),c=s.yr(a,t.Uh,u),ks(t,n,c.Rh),l=new gs(e,n,s),[2,(t.Nh.set(e,l),t.Fh.has(n)?t.Fh.get(n).push(e):t.Fh.set(n,[e]),c.snapshot)]}}))}))}function bs(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=b(t),i=n.Nh.get(e),(o=n.Fh.get(i.targetId)).length>1?[2,(n.Fh.set(i.targetId,o.filter((function(t){return!Gn(t,e)}))),void n.Nh.delete(e))]:n.Uh?(n.Sh.Bi(i.targetId),n.Sh.Fi(i.targetId)?[3,2]:[4,_o(n.ju,i.targetId,!1).then((function(){n.Sh.Ui(i.targetId),Ho(n.ph,i.targetId),As(n,i.targetId)})).catch(xo)]):[3,3];case 1:r.sent(),r.label=2;case 2:return[3,5];case 3:return As(n,i.targetId),[4,_o(n.ju,i.targetId,!0)];case 4:r.sent(),r.label=5;case 5:return[2]}}))}))}function _s(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=b(t),r.label=1;case 1:return r.trys.push([1,4,,6]),[4,yo(n.ju,e)];case 2:return i=r.sent(),e.zt.forEach((function(t,e){var r=n.kh.get(e);r&&(w(t.ee.size+t.ne.size+t.se.size<=1),t.ee.size>0?r.Vh=!0:t.ne.size>0?w(r.Vh):t.se.size>0&&(w(r.Vh),r.Vh=!1))})),[4,Os(n,i,e)];case 3:return r.sent(),[3,6];case 4:return[4,xo(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))}function Es(t,e,n){var r=b(t);if(r.Uh&&0===n||!r.Uh&&1===n){var i=[];r.Nh.forEach((function(t,n){var r=n.view.Qs(e);r.snapshot&&i.push(r.snapshot)})),function(t,e){var n=b(t);n.onlineState=e;var r=!1;n.Bs.forEach((function(t,n){for(var i=0,o=n.listeners;i<o.length;i++)o[i].Qs(e)&&(r=!0)})),r&&Lr(n)}(r.bh,e),i.length&&r.Ch.yu(i),r.onlineState=e,r.Uh&&r.Sh.Ki(e)}}function Ss(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=b(t)).Sh.Qi(e,"rejected",n),o=i.kh.get(e),(s=o&&o.key)?(a=(a=new St(A.i)).ot(s,new kn(s,ut.min())),u=Lt().add(s),c=new qt(ut.min(),new Map,new xt(Z),a,u),[4,_s(i,c)]):[3,2];case 1:return r.sent(),i.$h=i.$h.remove(s),i.kh.delete(e),Ds(i),[3,4];case 2:return[4,_o(i.ju,e,!1).then((function(){return As(i,e,n)})).catch(xo)];case 3:r.sent(),r.label=4;case 4:return[2]}}))}))}function Is(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=b(t),i=e.batch.batchId,r.label=1;case 1:return r.trys.push([1,4,,6]),[4,vo(n.ju,e)];case 2:return o=r.sent(),Cs(n,i,null),xs(n,i),n.Sh.ki(i,"acknowledged"),[4,Os(n,o)];case 3:return r.sent(),[3,6];case 4:return[4,xo(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))}function Ts(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=b(t),r.label=1;case 1:return r.trys.push([1,4,,6]),[4,function(t,e){var n=b(t);return n.persistence.runTransaction("Reject batch","readwrite-primary",(function(t){var r;return n.Sr.Oo(t,e).next((function(e){return w(null!==e),r=e.keys(),n.Sr.Wo(t,e)})).next((function(){return n.Sr.zo(t)})).next((function(){return n.Cc.kr(t,r)}))}))}(i.ju,e)];case 2:return o=r.sent(),Cs(i,e,n),xs(i,e),i.Sh.ki(e,"rejected",n),[4,Os(i,o)];case 3:return r.sent(),[3,6];case 4:return[4,xo(r.sent())];case 5:return r.sent(),[3,6];case 6:return[2]}}))}))}function xs(t,e){(t.Lh.get(e)||[]).forEach((function(t){t.resolve()})),t.Lh.delete(e)}function Cs(t,e,n){var r=b(t),i=r.Oh[r.currentUser.ti()];if(i){var o=i.get(e);o&&(n?o.reject(n):o.resolve(),i=i.remove(e)),r.Oh[r.currentUser.ti()]=i}}function As(t,e,n){void 0===n&&(n=null),t.Sh.Bi(e);for(var r=0,i=t.Fh.get(e);r<i.length;r++){var o=i[r];t.Nh.delete(o),n&&t.Ch.Wh(o,n)}t.Fh.delete(e),t.Uh&&t.Mh.Uc(e).forEach((function(e){t.Mh.Ho(e)||Ns(t,e)}))}function Ns(t,e){var n=t.$h.get(e);null!==n&&(Ho(t.ph,n),t.$h=t.$h.remove(e),t.kh.delete(n),Ds(t))}function ks(t,e,n){for(var r=0,i=n;r<i.length;r++){var o=i[r];o instanceof fs?(t.Mh.Da(o.key,e),Rs(t,o)):o instanceof ds?(p("SyncEngine","Document no longer in limbo: "+o.key),t.Mh.Na(o.key,e),t.Mh.Ho(o.key)||Ns(t,o.key)):y()}}function Rs(t,e){var n=e.key;t.$h.get(n)||(p("SyncEngine","New document in limbo: "+n),t.xh.push(n),Ds(t))}function Ds(t){for(;t.xh.length>0&&t.$h.size<t.Dh;){var e=t.xh.shift(),n=t.Bh.next();t.kh.set(n,new vs(e)),t.$h=t.$h.ot(e,n),Bo(t.ph,new wt(qn(Pn(e.path)),n,2,Vr.ai))}}function Os(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=b(t),o=[],s=[],a=[],i.Nh.m()?[3,3]:(i.Nh.forEach((function(t,r){a.push(i.Qh(r,e,n).then((function(t){if(t){i.Uh&&i.Sh.Qi(r.targetId,t.fromCache?"not-current":"current"),o.push(t);var e=ei.zr(r.targetId,t);s.push(e)}})))})),[4,Promise.all(a)]);case 1:return u.sent(),i.Ch.yu(o),[4,function(t,e){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o,s,a,u,c,l;return r.__generator(this,(function(r){switch(r.label){case 0:n=b(t),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(function(t){return pr.forEach(e,(function(e){return pr.forEach(e.Kr,(function(r){return n.persistence.No.Da(t,e.targetId,r)})).next((function(){return pr.forEach(e.Gr,(function(r){return n.persistence.No.Na(t,e.targetId,r)}))}))}))}))];case 2:return r.sent(),[3,4];case 3:if(!yr(i=r.sent()))throw i;return p("LocalStore","Failed to update sequence numbers: "+i),[3,4];case 4:for(o=0,s=e;o<s.length;o++)u=(a=s[o]).targetId,a.fromCache||(c=n.bc.get(u),l=c.rt(c.nt),n.bc=n.bc.ot(u,l));return[2]}}))}))}(i.ju,s)];case 2:u.sent(),u.label=3;case 3:return[2]}}))}))}function Ps(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=b(t)).currentUser.isEqual(e)?[3,3]:(p("SyncEngine","User change. New user:",e.ti()),[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=b(t),i=n.Sr,o=n.Cc,[4,n.persistence.runTransaction("Handle user change","readonly",(function(t){var r;return n.Sr.Uo(t).next((function(s){return r=s,i=n.persistence.mc(e),o=new ti(n.Dc,i,n.persistence.Ic()),i.Uo(t)})).next((function(e){for(var n=[],i=[],s=Lt(),a=0,u=r;a<u.length;a++){var c=u[a];n.push(c.batchId);for(var l=0,h=c.mutations;l<h.length;l++)s=s.add(h[l].key)}for(var f=0,d=e;f<d.length;f++){var p=d[f];i.push(p.batchId);for(var g=0,v=p.mutations;g<v.length;g++)s=s.add(v[g].key)}return o.kr(t,s).next((function(t){return{jh:t,Kh:n,Gh:i}}))}))}))];case 1:return s=r.sent(),[2,(n.Sr=i,n.Cc=o,n.Vc.Nc(n.Cc),s)]}}))}))}(n.ju,e)]);case 1:return i=o.sent(),n.currentUser=e,function(t,e){t.Lh.forEach((function(t){t.forEach((function(t){t.reject(new h(l.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),t.Lh.clear()}(n),n.Sh.ji(e,i.Kh,i.Gh),[4,Os(n,i.jh)];case 2:o.sent(),o.label=3;case 3:return[2]}}))}))}function Ls(t,e){var n=b(t),r=n.kh.get(e);if(r&&r.Vh)return Lt().add(r.key);var i=Lt(),o=n.Fh.get(e);if(!o)return i;for(var s=0,a=o;s<a.length;s++){var u=n.Nh.get(a[s]);i=i.kt(u.view.dh)}return i}function Us(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,Eo((n=b(t)).ju,e.query,!0)];case 1:return i=r.sent(),o=e.view.Ph(i),[2,(n.Uh&&ks(n,e.targetId,o.Rh),o)]}}))}))}function Ms(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=b(t),r=b(n.Sr);return n.persistence.runTransaction("Lookup mutation documents","readonly",(function(t){return r.Lo(t,e).next((function(e){return e?n.Cc.kr(t,e):pr.resolve(null)}))}))}((o=b(t)).ju,e)];case 1:return null===(s=r.sent())?[3,6]:"pending"!==n?[3,3]:[4,ns(o.ph)];case 2:return r.sent(),[3,4];case 3:"acknowledged"===n||"rejected"===n?(Cs(o,e,i||null),xs(o,e),function(t,e){b(b(t).Sr).Ko(e)}(o.ju,e)):y(),r.label=4;case 4:return[4,Os(o,s)];case 5:return r.sent(),[3,7];case 6:p("SyncEngine","Cannot apply mutation batch with id: "+e),r.label=7;case 7:return[2]}}))}))}function Vs(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:return Hs(n=b(t)),Gs(n),!0!==e||!0===n.qh?[3,3]:(i=n.Sh.Ci(),[4,js(n,i.A())]);case 1:return o=r.sent(),n.qh=!0,[4,cs(n.ph,!0)];case 2:for(r.sent(),s=0,a=o;s<a.length;s++)Bo(n.ph,a[s]);return[3,7];case 3:return!1!==e||!1===n.qh?[3,7]:(u=[],c=Promise.resolve(),n.Fh.forEach((function(t,e){n.Sh.qi(e)?u.push(e):c=c.then((function(){return As(n,e),_o(n.ju,e,!0)})),Ho(n.ph,e)})),[4,c]);case 4:return r.sent(),[4,js(n,u)];case 5:return r.sent(),function(t){var e=b(t);e.kh.forEach((function(t,n){Ho(e.ph,n)})),e.Mh.Qc(),e.kh=new Map,e.$h=new St(A.i)}(n),n.qh=!1,[4,cs(n.ph,!1)];case 6:r.sent(),r.label=7;case 7:return[2]}}))}))}function js(t,e,n){return r.__awaiter(this,void 0,void 0,(function(){var n,i,o,s,a,u,c,l,h,f,d,p,g;return r.__generator(this,(function(r){switch(r.label){case 0:n=b(t),i=[],o=[],s=0,a=e,r.label=1;case 1:return s<a.length?(c=void 0,(l=n.Fh.get(u=a[s]))&&0!==l.length?[4,bo(n.ju,qn(l[0]))]:[3,7]):[3,13];case 2:c=r.sent(),h=0,f=l,r.label=3;case 3:return h<f.length?(d=n.Nh.get(f[h]),[4,Us(n,d)]):[3,6];case 4:(p=r.sent()).snapshot&&o.push(p.snapshot),r.label=5;case 5:return h++,[3,3];case 6:return[3,11];case 7:return[4,So(n.ju,u)];case 8:return g=r.sent(),[4,bo(n.ju,g)];case 9:return c=r.sent(),[4,ws(n,Fs(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.Ch.yu(o),i)]}}))}))}function Fs(t){return On(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function qs(t){var e=b(t);return b(b(e.ju).persistence).pi()}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=b(t)).qh?(p("SyncEngine","Ignoring unexpected query state notification."),[3,8]):[3,1];case 1:if(!o.Fh.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,Io(o.ju)];case 3:return s=r.sent(),a=qt.Xt(e,"current"===n),[4,Os(o,s,a)];case 4:return r.sent(),[3,8];case 5:return[4,_o(o.ju,e,!0)];case 6:return r.sent(),As(o,e,i),[3,8];case 7:y(),r.label=8;case 8:return[2]}}))}))}function Bs(t,e,n){return r.__awaiter(this,void 0,void 0,(function(){var i,o,s,a,u,c,l,h,f;return r.__generator(this,(function(d){switch(d.label){case 0:if(!(i=Hs(t)).qh)return[3,10];o=0,s=e,d.label=1;case 1:return o<s.length?i.Fh.has(a=s[o])?(p("SyncEngine","Adding an already active target "+a),[3,5]):[4,So(i.ju,a)]:[3,6];case 2:return u=d.sent(),[4,bo(i.ju,u)];case 3:return c=d.sent(),[4,ws(i,Fs(u),c.targetId,!1)];case 4:d.sent(),Bo(i.ph,c),d.label=5;case 5:return o++,[3,1];case 6:l=function(t){return r.__generator(this,(function(e){switch(e.label){case 0:return i.Fh.has(t)?[4,_o(i.ju,t,!1).then((function(){Ho(i.ph,t),As(i,t)})).catch(xo)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))},h=0,f=n,d.label=7;case 7:return h<f.length?[5,l(f[h])]:[3,10];case 8:d.sent(),d.label=9;case 9:return h++,[3,7];case 10:return[2]}}))}))}function Hs(t){var e=b(t);return e.ph.Gu.sh=_s.bind(null,e),e.ph.Gu.qe=Ls.bind(null,e),e.ph.Gu.nh=Ss.bind(null,e),e.Ch.yu=Or.bind(null,e.bh),e.Ch.Wh=Pr.bind(null,e.bh),e}function Gs(t){var e=b(t);return e.ph.Gu.ih=Is.bind(null,e),e.ph.Gu.rh=Ts.bind(null,e),e}var $s=function(){function t(){}return t.prototype.Nc=function(t){this.zh=t},t.prototype.Lr=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.on.length||1===t.on.length&&t.on[0].field.p())}(e)||n.isEqual(ut.min())?this.Hh(t,e):this.zh.kr(t,r).next((function(s){var a=i.Yh(e,s);return(Ln(e)||Un(e))&&i.Eh(e.an,a,r,n)?i.Hh(t,e):(d()<=o.LogLevel.DEBUG&&p("IndexFreeQueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),Wn(e)),i.zh.Lr(t,e,n).next((function(t){return a.forEach((function(e){t=t.ot(e.key,e)})),t})))}))},t.prototype.Yh=function(t,e){var n=new xt(Qn(t));return e.forEach((function(e,r){r instanceof Nn&&Kn(t,r)&&(n=n.add(r))})),n},t.prototype.Eh=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.Hh=function(t,e){return d()<=o.LogLevel.DEBUG&&p("IndexFreeQueryEngine","Using full collection scan to execute query:",Wn(e)),this.zh.Lr(t,e,ut.min())},t}(),Ws=function(){function t(t,e){this.Dr=t,this.No=e,this.Sr=[],this.Jh=1,this.Xh=new xt(Ao.kc)}return t.prototype.$o=function(t){return pr.resolve(0===this.Sr.length)},t.prototype.ko=function(t,e,n,r){var i=this.Jh;this.Jh++;var o=new Qr(i,e,n,r);this.Sr.push(o);for(var s=0,a=r;s<a.length;s++){var u=a[s];this.Xh=this.Xh.add(new Ao(u.key,i)),this.Dr.Mo(t,u.key.path.h())}return pr.resolve(o)},t.prototype.Oo=function(t,e){return pr.resolve(this.Zh(e))},t.prototype.Bo=function(t,e){var n=this.tl(e+1),r=n<0?0:n;return pr.resolve(this.Sr.length>r?this.Sr[r]:null)},t.prototype.qo=function(){return pr.resolve(0===this.Sr.length?-1:this.Jh-1)},t.prototype.Uo=function(t){return pr.resolve(this.Sr.slice())},t.prototype.Nr=function(t,e){var n=this,r=new Ao(e,0),i=new Ao(e,Number.POSITIVE_INFINITY),o=[];return this.Xh.Ft([r,i],(function(t){var e=n.Zh(t.jc);o.push(e)})),pr.resolve(o)},t.prototype.Or=function(t,e){var n=this,r=new xt(Z);return e.forEach((function(t){var e=new Ao(t,0),i=new Ao(t,Number.POSITIVE_INFINITY);n.Xh.Ft([e,i],(function(t){r=r.add(t.jc)}))})),pr.resolve(this.el(r))},t.prototype.Wr=function(t,e){var n=e.path,r=n.length+1,i=n;A.F(i)||(i=i.child(""));var o=new Ao(new A(i),0),s=new xt(Z);return this.Xh.xt((function(t){var e=t.key.path;return!!n.T(e)&&(e.length===r&&(s=s.add(t.jc)),!0)}),o),pr.resolve(this.el(s))},t.prototype.el=function(t){var e=this,n=[];return t.forEach((function(t){var r=e.Zh(t);null!==r&&n.push(r)})),n},t.prototype.Wo=function(t,e){var n=this;w(0===this.nl(e.batchId,"removed")),this.Sr.shift();var r=this.Xh;return pr.forEach(e.mutations,(function(i){var o=new Ao(i.key,e.batchId);return r=r.delete(o),n.No.Go(t,i.key)})).next((function(){n.Xh=r}))},t.prototype.Ko=function(t){},t.prototype.Ho=function(t,e){var n=new Ao(e,0),r=this.Xh.$t(n);return pr.resolve(e.isEqual(r&&r.key))},t.prototype.zo=function(t){return pr.resolve()},t.prototype.nl=function(t,e){return this.tl(t)},t.prototype.tl=function(t){return 0===this.Sr.length?0:t-this.Sr[0].batchId},t.prototype.Zh=function(t){var e=this.tl(t);return e<0||e>=this.Sr.length?null:this.Sr[e]},t}(),Ks=function(){function t(t,e){this.Dr=t,this.sl=e,this.docs=new St(A.i),this.size=0}return t.prototype.Er=function(t,e,n){var r=e.key,i=this.docs.get(r),o=i?i.size:0,s=this.sl(e);return this.docs=this.docs.ot(r,{ta:e,size:s,readTime:n}),this.size+=s-o,this.Dr.Mo(t,r.path.h())},t.prototype.Ar=function(t){var e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)},t.prototype.Rr=function(t,e){var n=this.docs.get(e);return pr.resolve(n?n.ta:null)},t.prototype.getEntries=function(t,e){var n=this,r=kt();return e.forEach((function(t){var e=n.docs.get(t);r=r.ot(t,e?e.ta:null)})),pr.resolve(r)},t.prototype.Lr=function(t,e,n){for(var r=Dt(),i=new A(e.path.child("")),o=this.docs.ft(i);o.At();){var s=o.It(),a=s.value,u=a.ta,c=a.readTime;if(!e.path.T(s.key.path))break;c.L(n)<=0||u instanceof Nn&&Kn(e,u)&&(r=r.ot(u.key,u))}return pr.resolve(r)},t.prototype.il=function(t,e){return pr.forEach(this.docs,(function(t){return e(t)}))},t.prototype.ra=function(t){return new Qs(this)},t.prototype.aa=function(t){return pr.resolve(this.size)},t}(),Qs=function(t){function e(e){var n=this;return(n=t.call(this)||this).ca=e,n}return r.__extends(e,t),e.prototype.yr=function(t){var e=this,n=[];return this.wr.forEach((function(r,i){i?n.push(e.ca.Er(t,i,e.readTime)):e.ca.Ar(r)})),pr.$n(n)},e.prototype.gr=function(t,e){return this.ca.Rr(t,e)},e.prototype.Pr=function(t,e){return this.ca.getEntries(t,e)},e}(Yr),Zs=function(){function t(t){this.persistence=t,this.rl=new st((function(t){return pt(t)}),gt),this.lastRemoteSnapshotVersion=ut.min(),this.highestTargetId=0,this.ol=0,this.al=new Co,this.targetCount=0,this.cl=eo.fa()}return t.prototype.Ce=function(t,e){return this.rl.forEach((function(t,n){return e(n)})),pr.resolve()},t.prototype.Ea=function(t){return pr.resolve(this.lastRemoteSnapshotVersion)},t.prototype.Ia=function(t){return pr.resolve(this.ol)},t.prototype.wa=function(t){return this.highestTargetId=this.cl.next(),pr.resolve(this.highestTargetId)},t.prototype.Aa=function(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.ol&&(this.ol=e),pr.resolve()},t.prototype.ga=function(t){this.rl.set(t.target,t);var e=t.targetId;e>this.highestTargetId&&(this.cl=new eo(e),this.highestTargetId=e),t.sequenceNumber>this.ol&&(this.ol=t.sequenceNumber)},t.prototype.Ra=function(t,e){return this.ga(e),this.targetCount+=1,pr.resolve()},t.prototype.ya=function(t,e){return this.ga(e),pr.resolve()},t.prototype.Va=function(t,e){return this.rl.delete(e.target),this.al.Uc(e.targetId),this.targetCount-=1,pr.resolve()},t.prototype.po=function(t,e,n){var r=this,i=0,o=[];return this.rl.forEach((function(s,a){a.sequenceNumber<=e&&null===n.get(a.targetId)&&(r.rl.delete(s),o.push(r.pa(t,a.targetId)),i++)})),pr.$n(o).next((function(){return i}))},t.prototype.ba=function(t){return pr.resolve(this.targetCount)},t.prototype.va=function(t,e){var n=this.rl.get(e)||null;return pr.resolve(n)},t.prototype.Sa=function(t,e,n){return this.al.Lc(e,n),pr.resolve()},t.prototype.Ca=function(t,e,n){this.al.qc(e,n);var r=this.persistence.No,i=[];return r&&e.forEach((function(e){i.push(r.Go(t,e))})),pr.$n(i)},t.prototype.pa=function(t,e){return this.al.Uc(e),pr.resolve()},t.prototype.Fa=function(t,e){var n=this.al.Wc(e);return pr.resolve(n)},t.prototype.Ho=function(t,e){return pr.resolve(this.al.Ho(e))},t}(),Ys=function(){function t(t){var e=this;this.ul={},this.Ma=new Vr(0),this.Oa=!1,this.Oa=!0,this.No=t(this),this.Ka=new Zs(this),this.Dr=new Pi,this.vr=function(t,n){return new Ks(t,(function(t){return e.No.hl(t)}))}(this.Dr)}return t.prototype.start=function(){return Promise.resolve()},t.prototype.Di=function(){return this.Oa=!1,Promise.resolve()},Object.defineProperty(t.prototype,"Ei",{get:function(){return this.Oa},enumerable:!1,configurable:!0}),t.prototype.Za=function(){},t.prototype.tc=function(){},t.prototype.Ic=function(){return this.Dr},t.prototype.mc=function(t){var e=this.ul[t.ti()];return e||(e=new Ws(this.Dr,this.No),this.ul[t.ti()]=e),e},t.prototype.Tc=function(){return this.Ka},t.prototype.Ec=function(){return this.vr},t.prototype.runTransaction=function(t,e,n){var r=this;p("MemoryPersistence","Starting transaction:",t);var i=new Xs(this.Ma.next());return this.No.ll(),n(i).next((function(t){return r.No._l(i).next((function(){return t}))})).Fn().then((function(t){return i.br(),t}))},t.prototype.fl=function(t,e){return pr.kn(Object.values(this.ul).map((function(n){return function(){return n.Ho(t,e)}})))},t}(),Xs=function(t){function e(e){var n=this;return(n=t.call(this)||this).xa=e,n}return r.__extends(e,t),e}(Jr),Js=function(){function t(t){this.persistence=t,this.dl=new Co,this.wl=null}return t.ml=function(e){return new t(e)},Object.defineProperty(t.prototype,"Tl",{get:function(){if(this.wl)return this.wl;throw y()},enumerable:!1,configurable:!0}),t.prototype.Da=function(t,e,n){return this.dl.Da(n,e),this.Tl.delete(n.toString()),pr.resolve()},t.prototype.Na=function(t,e,n){return this.dl.Na(n,e),this.Tl.add(n.toString()),pr.resolve()},t.prototype.Go=function(t,e){return this.Tl.add(e.toString()),pr.resolve()},t.prototype.removeTarget=function(t,e){var n=this;this.dl.Uc(e.targetId).forEach((function(t){return n.Tl.add(t.toString())}));var r=this.persistence.Tc();return r.Fa(t,e.targetId).next((function(t){t.forEach((function(t){return n.Tl.add(t.toString())}))})).next((function(){return r.Va(t,e)}))},t.prototype.ll=function(){this.wl=new Set},t.prototype._l=function(t){var e=this,n=this.persistence.Ec().ra();return pr.forEach(this.Tl,(function(r){var i=A.D(r);return e.El(t,i).next((function(t){t||n.Ar(i)}))})).next((function(){return e.wl=null,n.apply(t)}))},t.prototype.yc=function(t,e){var n=this;return this.El(t,e).next((function(t){t?n.Tl.delete(e.toString()):n.Tl.add(e.toString())}))},t.prototype.hl=function(t){return 0},t.prototype.El=function(t,e){var n=this;return pr.kn([function(){return pr.resolve(n.dl.Ho(e))},function(){return n.persistence.Tc().Ho(t,e)},function(){return n.persistence.fl(t,e)}])},t}(),ta=function(){function t(t){this.Il=t.Il,this.Al=t.Al}return t.prototype.gu=function(t){this.Rl=t},t.prototype.Tu=function(t){this.gl=t},t.prototype.onMessage=function(t){this.Pl=t},t.prototype.close=function(){this.Al()},t.prototype.send=function(t){this.Il(t)},t.prototype.yl=function(){this.Rl()},t.prototype.Vl=function(t){this.gl(t)},t.prototype.pl=function(t){this.Pl(t)},t}(),ea={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"},na=function(t){function e(e){var n=this;return(n=t.call(this,e)||this).forceLongPolling=e.forceLongPolling,n.W=e.W,n}return r.__extends(e,t),e.prototype.Nl=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();p("Connection","XHR received:",JSON.stringify(e)),i(e);break;case a.ErrorCode.TIMEOUT:p("Connection",'RPC "'+t+'" timed out'),o(new h(l.DEADLINE_EXCEEDED,"Request time out"));break;case a.ErrorCode.HTTP_ERROR:var n=s.getStatus();if(p("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 h(u,r.message))}else o(new h(l.UNKNOWN,"Server responded with status "+s.getStatus()))}else o(new h(l.UNAVAILABLE,"Connection failed."));break;default:y()}}finally{p("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.vl,"/","google.firestore.v1.Firestore","/",t,"/channel"],r=a.createWebChannelTransport(),i={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/"+this.U.projectId+"/databases/"+this.U.database},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.W};this.Cl(i.initMessageHeaders,e),s.isMobileCordova()||s.isReactNative()||s.isElectron()||s.isIE()||s.isUWP()||s.isBrowserExtension()||(i.httpHeadersOverwriteParam="$httpHeaders");var o=n.join("");p("Connection","Creating WebChannel: "+o,i);var u=r.createWebChannel(o,i),c=!1,f=!1,d=new ta({Il:function(t){f?p("Connection","Not sending because WebChannel is closed:",t):(c||(p("Connection","Opening WebChannel transport."),u.open(),c=!0),p("Connection","WebChannel sending:",t),u.send(t))},Al:function(){return u.close()}}),g=function(t,e){u.listen(t,(function(t){try{e(t)}catch(t){setTimeout((function(){throw t}),0)}}))};return g(a.WebChannel.EventType.OPEN,(function(){f||p("Connection","WebChannel transport opened.")})),g(a.WebChannel.EventType.CLOSE,(function(){f||(f=!0,p("Connection","WebChannel transport closed"),d.Vl())})),g(a.WebChannel.EventType.ERROR,(function(t){f||(f=!0,v("Connection","WebChannel transport errored:",t),d.Vl(new h(l.UNAVAILABLE,"The operation could not be completed")))})),g(a.WebChannel.EventType.MESSAGE,(function(t){var e;if(!f){var n=t.data[0];w(!!n);var r=n.error||(null===(e=n[0])||void 0===e?void 0:e.error);if(r){p("Connection","WebChannel received error:",r);var i=r.status,o=function(t){var e=mt[t];if(void 0!==e)return Et(e)}(i),s=r.message;void 0===o&&(o=l.INTERNAL,s="Unknown error status: "+i+" with message "+r.message),f=!0,d.Vl(new h(o,s)),u.close()}else p("Connection","WebChannel received:",n),d.pl(n)}})),setTimeout((function(){d.yl()}),0),d},e}(function(){function t(t){this.bl=t,this.U=t.U,this.vl=(t.ssl?"https":"http")+"://"+t.host,this.Sl="projects/"+this.U.projectId+"/databases/"+this.U.database+"/documents"}return t.prototype.$u=function(t,e,n,r){var i=this.Dl(t,e);p("RestConnection","Sending: ",i,n);var o={};return this.Cl(o,r),this.Nl(t,i,o,n).then((function(t){return p("RestConnection","Received: ",t),t}),(function(e){throw v("RestConnection",t+" failed with error: ",e,"url: ",i,"request:",n),e}))},t.prototype.ku=function(t,e,n,r){return this.$u(t,e,n,r)},t.prototype.Cl=function(t,e){if(t["X-Goog-Api-Client"]="gl-js/ fire/7.24.0",t["Content-Type"]="text/plain",e)for(var n in e.Kc)e.Kc.hasOwnProperty(n)&&(t[n]=e.Kc[n])},t.prototype.Dl=function(t,e){return this.vl+"/v1/"+e+":"+ea[t]},t}()),ra=function(){function t(){var t=this;this.Fl=function(){return t.xl()},this.$l=function(){return t.kl()},this.Ml=[],this.Ol()}return t.prototype.Zu=function(t){this.Ml.push(t)},t.prototype.Di=function(){window.removeEventListener("online",this.Fl),window.removeEventListener("offline",this.$l)},t.prototype.Ol=function(){window.addEventListener("online",this.Fl),window.addEventListener("offline",this.$l)},t.prototype.xl=function(){p("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(var t=0,e=this.Ml;t<e.length;t++)(0,e[t])(0)},t.prototype.kl=function(){p("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(var t=0,e=this.Ml;t<e.length;t++)(0,e[t])(1)},t.Ln=function(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener},t}(),ia=function(){function t(){}return t.prototype.Zu=function(t){},t.prototype.Di=function(){},t}();function oa(t){return new ve(t,!0)}var sa="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.",aa=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.Sh=this.Ll(t),this.persistence=this.Bl(t),[4,this.persistence.start()];case 1:return e.sent(),this.ql=this.Ul(t),this.ju=this.Ql(t),[2]}}))}))},t.prototype.Ul=function(t){return null},t.prototype.Ql=function(t){return e=this.persistence,n=new $s,new go(e,n,t.Wl);var e,n},t.prototype.Bl=function(t){if(t.persistenceSettings.jl)throw new h(l.FAILED_PRECONDITION,sa);return new Ys(Js.ml)},t.prototype.Ll=function(t){return new Kr},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.ql&&this.ql.stop(),[4,this.Sh.Di()];case 1:return t.sent(),[4,this.persistence.Di()];case 2:return t.sent(),[2]}}))}))},t.prototype.clearPersistence=function(t,e){throw new h(l.FAILED_PRECONDITION,sa)},t}(),ua=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.Kl.fi,this.Sh instanceof Wr?(this.Sh.fi={er:Ms.bind(null,n),nr:zs.bind(null,n),sr:Bs.bind(null,n),pi:qs.bind(null,n)},[4,this.Sh.start()]):[3,3];case 2:o.sent(),o.label=3;case 3:return[4,this.persistence.Xa((function(t){return r.__awaiter(i,void 0,void 0,(function(){return r.__generator(this,(function(e){switch(e.label){case 0:return[4,Vs(this.Kl.fi,t)];case 1:return e.sent(),this.ql&&(t&&!this.ql.Ei?this.ql.start(this.ju):t||this.ql.stop()),[2]}}))}))}))];case 4:return o.sent(),[2]}}))}))},e.prototype.Ll=function(t){if(t.persistenceSettings.jl&&t.persistenceSettings.synchronizeTabs){var e=Ir();if(!Wr.Ln(e))throw new h(l.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");var n=po(t.bl.U,t.bl.persistenceKey);return new Wr(e,t.cs,n,t.clientId,t.Wl)}return new Kr},e}(function(t){function e(e){var n=this;return(n=t.call(this)||this).Kl=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,To(this.ju)];case 2:return n.sent(),[4,this.Kl.initialize(this,e)];case 3:return n.sent(),[4,Gs(this.Kl.fi)];case 4:return n.sent(),[4,ns(this.Kl.ph)];case 5:return n.sent(),[2]}}))}))},e.prototype.Ul=function(t){return new si(this.persistence.No.wo,t.cs)},e.prototype.Bl=function(t){var e=po(t.bl.U,t.bl.persistenceKey),n=oa(t.bl.U);return new uo(t.persistenceSettings.synchronizeTabs,e,t.clientId,oi.ao(t.persistenceSettings.cacheSizeBytes),t.cs,Ir(),Tr(),n,this.Sh,t.persistenceSettings.ka)},e.prototype.Ll=function(t){return new Kr},e.prototype.clearPersistence=function(t,e){return function(t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){switch(e.label){case 0:return gr.Ln()?[4,gr.delete(t+"main")]:[2,Promise.resolve()];case 1:return e.sent(),[2]}}))}))}(po(t,e))},e}(aa)),ca=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.ju?[3,2]:(this.ju=t.ju,this.Sh=t.Sh,this.Ku=this.Gl(e),this.ph=this.zl(e),this.bh=this.Hl(e),this.fi=this.Yl(e),this.Sh.di=function(t){return Es(n.fi,t,1)},this.ph.Gu.Jl=Ps.bind(null,this.fi),[4,cs(this.ph,this.fi.Uh)]);case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},t.prototype.Hl=function(t){return new kr},t.prototype.Gl=function(t){var e=oa(t.bl.U),n=new na(t.bl);return function(t,e,n){return new Mo(t,e,n)}(t.credentials,n,e)},t.prototype.zl=function(t){var e,n,r,i,o,s=this;return e=this.ju,n=this.Ku,r=t.cs,i=function(t){return Es(s.fi,t,0)},o=ra.Ln()?new ra:new ia,new jo(e,n,r,i,o)},t.prototype.Yl=function(t){return function(t,e,n,r,i,o,s){var a=new ms(t,e,n,r,i,o);return s&&(a.qh=!0),a}(this.ju,this.ph,this.bh,this.Sh,t.Wl,t.Dh,!t.persistenceSettings.jl||!t.persistenceSettings.synchronizeTabs)},t.prototype.terminate=function(){return zo(this.ph)},t}(),la=function(){function t(t){this.observer=t,this.muted=!1}return t.prototype.next=function(t){this.observer.next&&this.Xl(this.observer.next,t)},t.prototype.error=function(t){this.observer.error?this.Xl(this.observer.error,t):console.error("Uncaught Error in snapshot listener:",t)},t.prototype.Zl=function(){this.muted=!0},t.prototype.Xl=function(t,e){var n=this;this.muted||setTimeout((function(){n.muted||t(e)}),0)},t}(),ha=function(t){!function(t,e,n,r){if(!(e instanceof Array)||e.length<1)throw new h(l.INVALID_ARGUMENT,"Function FieldPath() requires its fieldNames argument to be an array with at least "+W(1,"element")+".")}(0,t);for(var e=0;e<t.length;++e)if(O("FieldPath","string",e,t[e]),0===t[e].length)throw new h(l.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this.t_=new C(t)},fa=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(C.v().R())},e.prototype.isEqual=function(t){if(!(t instanceof e))throw H("isEqual","FieldPath",1,t);return this.t_.isEqual(t.t_)},e}(ha),da=new RegExp("[~\\*/\\[\\]]"),pa=function(t){this.e_=t},ga=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.n_=function(t){if(2!==t.s_)throw t.i_(1===t.s_?this.e_+"() can only appear at the top level of your update data":this.e_+"() cannot be used with set() unless you pass {merge:true}");return t.We.push(t.path),null},e.prototype.isEqual=function(t){return t instanceof e},e}(pa);function va(t,e,n){return new Aa({s_:3,r_:e.settings.r_,methodName:t.e_,o_:n},e.U,e.serializer,e.ignoreUndefinedProperties)}var ma=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.n_=function(t){return new an(t.path,new Ye)},e.prototype.isEqual=function(t){return t instanceof e},e}(pa),ya=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.n_=function(t){var e=va(this,t,!0),n=this.a_.map((function(t){return Pa(t,e)})),r=new Xe(n);return new an(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(pa),wa=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.n_=function(t){var e=va(this,t,!0),n=this.a_.map((function(t){return Pa(t,e)})),r=new tn(n);return new an(t.path,r)},e.prototype.isEqual=function(t){return this===t},e}(pa),ba=function(t){function e(e,n){var r=this;return(r=t.call(this,e)||this).c_=n,r}return r.__extends(e,t),e.prototype.n_=function(t){var e=new nn(t.serializer,we(t.serializer,this.c_));return new an(t.path,e)},e.prototype.isEqual=function(t){return this===t},e}(pa),_a=function(){function t(t,e){if(k("GeoPoint",arguments,2),O("GeoPoint","number",1,t),O("GeoPoint","number",2,e),!isFinite(t)||t<-90||t>90)throw new h(l.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new h(l.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this.u_=t,this.h_=e}return Object.defineProperty(t.prototype,"latitude",{get:function(){return this.u_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"longitude",{get:function(){return this.h_},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this.u_===t.u_&&this.h_===t.h_},t.prototype.toJSON=function(){return{latitude:this.u_,longitude:this.h_}},t.prototype.Y=function(t){return Z(this.u_,t.u_)||Z(this.h_,t.h_)},t}(),Ea=function(t){this.l_=t},Sa=/^__.*__$/,Ia=function(t,e,n){this.__=t,this.f_=e,this.d_=n},Ta=function(){function t(t,e,n){this.data=t,this.We=e,this.fieldTransforms=n}return t.prototype.w_=function(t,e){var n=[];return n.push(null!==this.We?new yn(t,this.data,this.We,e):new mn(t,this.data,e)),this.fieldTransforms.length>0&&n.push(new bn(t,this.fieldTransforms)),n},t}(),xa=function(){function t(t,e,n){this.data=t,this.We=e,this.fieldTransforms=n}return t.prototype.w_=function(t,e){var n=[new yn(t,this.data,this.We,e)];return this.fieldTransforms.length>0&&n.push(new bn(t,this.fieldTransforms)),n},t}();function Ca(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw y()}}var Aa=function(){function t(t,e,n,r,i,o){this.settings=t,this.U=e,this.serializer=n,this.ignoreUndefinedProperties=r,void 0===i&&this.m_(),this.fieldTransforms=i||[],this.We=o||[]}return Object.defineProperty(t.prototype,"path",{get:function(){return this.settings.path},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"s_",{get:function(){return this.settings.s_},enumerable:!1,configurable:!0}),t.prototype.T_=function(e){return new t(Object.assign(Object.assign({},this.settings),e),this.U,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.We)},t.prototype.E_=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.T_({path:n,o_:!1});return r.I_(t),r},t.prototype.A_=function(t){var e,n=null===(e=this.path)||void 0===e?void 0:e.child(t),r=this.T_({path:n,o_:!1});return r.m_(),r},t.prototype.R_=function(t){return this.T_({path:void 0,o_:!0})},t.prototype.i_=function(t){return Fa(t,this.settings.methodName,this.settings.g_||!1,this.path,this.settings.r_)},t.prototype.contains=function(t){return void 0!==this.We.find((function(e){return t.T(e)}))||void 0!==this.fieldTransforms.find((function(e){return t.T(e.field)}))},t.prototype.m_=function(){if(this.path)for(var t=0;t<this.path.length;t++)this.I_(this.path.get(t))},t.prototype.I_=function(t){if(0===t.length)throw this.i_("Document fields must not be empty");if(Ca(this.s_)&&Sa.test(t))throw this.i_('Document fields cannot begin and end with "__"')},t}(),Na=function(){function t(t,e,n){this.U=t,this.ignoreUndefinedProperties=e,this.serializer=n||oa(t)}return t.prototype.P_=function(t,e,n,r){return void 0===r&&(r=!1),new Aa({s_:t,methodName:e,r_:n,path:C.P(),o_:!1,g_:r},this.U,this.serializer,this.ignoreUndefinedProperties)},t}();function ka(t,e,n,r,i,o){void 0===o&&(o={});var s=t.P_(o.merge||o.mergeFields?2:0,e,n,i);Ma("Data must be an object, but it was:",s,r);var a,u,c=La(r,s);if(o.merge)a=new sn(s.We),u=s.fieldTransforms;else if(o.mergeFields){for(var f=[],d=0,p=o.mergeFields;d<p.length;d++){var g=p[d],v=void 0;if(g instanceof ha)v=g.t_;else{if("string"!=typeof g)throw y();v=ja(e,g,n)}if(!s.contains(v))throw new h(l.INVALID_ARGUMENT,"Field '"+v+"' is specified in your field mask but missing from your input data.");qa(f,v)||f.push(v)}a=new sn(f),u=s.fieldTransforms.filter((function(t){return a.Ye(t.field)}))}else a=null,u=s.fieldTransforms;return new Ta(new Tn(c),a,u)}function Ra(t,e,n,r){var i=t.P_(1,e,n);Ma("Data must be an object, but it was:",i,r);var o=[],s=new xn;E(r,(function(t,r){var a=ja(e,t,n),u=i.A_(a);if(r instanceof ga||r instanceof Ea&&r.l_ instanceof ga)o.push(a);else{var c=Pa(r,u);null!=c&&(o.push(a),s.set(a,c))}}));var a=new sn(o);return new xa(s.Xe(),a,i.fieldTransforms)}function Da(t,e,n,r,i,o){var s=t.P_(1,e,n),a=[Va(e,r,n)],u=[i];if(o.length%2!=0)throw new h(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(Va(e,o[c])),u.push(o[c+1]);for(var f=[],d=new xn,p=a.length-1;p>=0;--p)if(!qa(f,a[p])){var g=a[p],v=u[p],m=s.A_(g);if(v instanceof ga||v instanceof Ea&&v.l_ instanceof ga)f.push(g);else{var y=Pa(v,m);null!=y&&(f.push(g),d.set(g,y))}}var w=new sn(f);return new xa(d.Xe(),w,s.fieldTransforms)}function Oa(t,e,n,r){return void 0===r&&(r=!1),Pa(n,t.P_(r?4:3,e))}function Pa(t,e){if(t instanceof Ea&&(t=t.l_),Ua(t))return Ma("Unsupported field value:",e,t),La(t,e);if(t instanceof pa)return function(t,e){if(!Ca(e.s_))throw e.i_(t.e_+"() can only be used with update() and set()");if(!e.path)throw e.i_(t.e_+"() is not currently supported inside arrays");var n=t.n_(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(e.path&&e.We.push(e.path),t instanceof Array){if(e.settings.o_&&4!==e.s_)throw e.i_("Nested arrays are not supported");return function(t,e){for(var n=[],r=0,i=0,o=t;i<o.length;i++){var s=Pa(o[i],e.R_(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 we(e.serializer,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){var n=at.fromDate(t);return{timestampValue:be(e.serializer,n)}}if(t instanceof at){var r=new at(t.seconds,1e3*Math.floor(t.nanoseconds/1e3));return{timestampValue:be(e.serializer,r)}}if(t instanceof _a)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof tt)return{bytesValue:_e(e.serializer,t.q)};if(t instanceof Ia){var i=e.U,o=t.__;if(!o.isEqual(i))throw e.i_("Document reference is for database "+o.projectId+"/"+o.database+" but should be for database "+i.projectId+"/"+i.database);return{referenceValue:Ie(t.__||e.U,t.f_.path)}}if(void 0===t&&e.ignoreUndefinedProperties)return null;throw e.i_("Unsupported field value: "+q(t))}(t,e)}function La(t,e){var n={};return S(t)?e.path&&e.path.length>0&&e.We.push(e.path):E(t,(function(t,r){var i=Pa(r,e.E_(t));null!=i&&(n[t]=i)})),{mapValue:{fields:n}}}function Ua(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof at||t instanceof _a||t instanceof tt||t instanceof Ia||t instanceof pa)}function Ma(t,e,n){if(!Ua(n)||!F(n)){var r=q(n);throw e.i_("an object"===r?t+" a custom object":t+" "+r)}}function Va(t,e,n){if(e instanceof ha)return e.t_;if("string"==typeof e)return ja(t,e);throw Fa("Field path arguments must be of type string or FieldPath.",t,!1,void 0,n)}function ja(t,e,n){try{return function(t){if(t.search(da)>=0)throw new h(l.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not contain '~', '*', '/', '[', or ']'");try{return new(fa.bind.apply(fa,r.__spreadArrays([void 0],t.split("."))))}catch(r){throw new h(l.INVALID_ARGUMENT,"Invalid field path ("+t+"). Paths must not be empty, begin with '.', end with '.', or contain '..'")}}(e).t_}catch(e){throw Fa((i=e)instanceof Error?i.message:i.toString(),t,!1,void 0,n)}var i}function Fa(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 h(l.INVALID_ARGUMENT,(a+=". ")+t+u)}function qa(t,e){return t.some((function(t){return t.isEqual(e)}))}var za=function(){function t(t){this.Ku=t,this.y_=new Map,this.mutations=[],this.V_=!1,this.p_=null,this.b_=new Set}return t.prototype.v_=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.S_(),this.mutations.length>0)throw new h(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=b(t),i=ke(n.serializer)+"/documents",o={documents:e.map((function(t){return xe(n.serializer,t)}))},[4,n.ku("BatchGetDocuments",i,o)];case 1:return s=r.sent(),a=new Map,s.forEach((function(t){var e=function(t,e){return"found"in e?function(t,e){w(!!e.found);var n=Ce(t,e.found.name),r=Se(e.found.updateTime),i=new Tn({mapValue:{fields:e.found.fields}});return new Nn(n,r,i,{})}(t,e):"missing"in e?function(t,e){w(!!e.missing),w(!!e.readTime);var n=Ce(t,e.missing),r=Se(e.readTime);return new kn(n,r)}(t,e):y()}(n.serializer,t);a.set(e.key.toString(),e)})),u=[],[2,(e.forEach((function(t){var e=a.get(t.toString());w(!!e),u.push(e)})),u)]}}))}))}(this.Ku,t)];case 1:return[2,((e=i.sent()).forEach((function(t){t instanceof kn||t instanceof Nn?n.D_(t):y()})),e)]}}))}))},t.prototype.set=function(t,e){this.write(e.w_(t,this.Ge(t))),this.b_.add(t.toString())},t.prototype.update=function(t,e){try{this.write(e.w_(t,this.C_(t)))}catch(t){this.p_=t}this.b_.add(t.toString())},t.prototype.delete=function(t){this.write([new Sn(t,this.Ge(t))]),this.b_.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.S_(),this.p_)throw this.p_;return t=this.y_,this.mutations.forEach((function(e){t.delete(e.key.toString())})),t.forEach((function(t,n){var r=A.D(n);e.mutations.push(new In(r,e.Ge(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=b(t),i=ke(n.serializer)+"/documents",o={writes:e.map((function(t){return Oe(n.serializer,t)}))},[4,n.$u("Commit",i,o)];case 1:return r.sent(),[2]}}))}))}(this.Ku,this.mutations)];case 1:return n.sent(),this.V_=!0,[2]}}))}))},t.prototype.D_=function(t){var e;if(t instanceof Nn)e=t.version;else{if(!(t instanceof kn))throw y();e=ut.min()}var n=this.y_.get(t.key.toString());if(n){if(!e.isEqual(n))throw new h(l.ABORTED,"Document version changed between two reads.")}else this.y_.set(t.key.toString(),e)},t.prototype.Ge=function(t){var e=this.y_.get(t.toString());return!this.b_.has(t.toString())&&e?cn.updateTime(e):cn.ze()},t.prototype.C_=function(t){var e=this.y_.get(t.toString());if(!this.b_.has(t.toString())&&e){if(e.isEqual(ut.min()))throw new h(l.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return cn.updateTime(e)}return cn.exists(!0)},t.prototype.write=function(t){this.S_(),this.mutations=this.mutations.concat(t)},t.prototype.S_=function(){},t}(),Ba=function(){function t(t,e,n,r){this.cs=t,this.Ku=e,this.updateFunction=n,this.ls=r,this.N_=5,this.ys=new dr(this.cs,"transaction_retry")}return t.prototype.run=function(){this.F_()},t.prototype.F_=function(){var t=this;this.ys.gn((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.Ku),(e=this.x_(t))&&e.then((function(e){n.cs.ws((function(){return t.commit().then((function(){n.ls.resolve(e)})).catch((function(t){n.k_(t)}))}))})).catch((function(t){n.k_(t)})),[2]}))}))}))},t.prototype.x_=function(t){try{var e=this.updateFunction(t);return!ct(e)&&e.catch&&e.then?e:(this.ls.reject(Error("Transaction callback must return a Promise")),null)}catch(t){return this.ls.reject(t),null}},t.prototype.k_=function(t){var e=this;this.N_>0&&this.M_(t)?(this.N_-=1,this.cs.ws((function(){return e.F_(),Promise.resolve()}))):this.ls.reject(t)},t.prototype.M_=function(t){if("FirebaseError"===t.name){var e=t.code;return"aborted"===e||"failed-precondition"===e||!_t(e)}return!1},t}(),Ha=function(){function t(t,e){this.credentials=t,this.cs=e,this.clientId=Q.k(),this.O_=new fr}return t.prototype.start=function(t,e,n,i){var o=this;this.L_(),this.bl=t;var s=new fr,a=!1;return this.credentials.Hc((function(t){if(!a)return a=!0,p("FirestoreClient","Initializing. user=",t.uid),o.B_(e,n,i,t,s).then(o.O_.resolve,o.O_.reject);o.cs.Cs((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=b(t)).cs.xs(),p("RemoteStore","RemoteStore received new credentials"),i=Qo(n),n.Yu.add(3),[4,qo(n)];case 1:return r.sent(),i&&n.th.set("Unknown"),[4,n.Gu.Jl(e)];case 2:return r.sent(),n.Yu.delete(3),[4,Fo(n)];case 3:return r.sent(),[2]}}))}))}(o.ph,t)}))})),this.cs.ws((function(){return o.O_.promise})),s.promise},t.prototype.enableNetwork=function(){var t=this;return this.L_(),this.cs.enqueue((function(){return t.persistence.tc(!0),function(t){var e=b(t);return e.Yu.delete(0),Fo(e)}(t.ph)}))},t.prototype.B_=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]),[4,t.initialize(s={cs:this.cs,bl:this.bl,clientId:this.clientId,credentials:this.credentials,Wl:i,Dh:100,persistenceSettings:n})];case 1:return c.sent(),[4,e.initialize(t,s)];case 2:return c.sent(),this.persistence=t.persistence,this.Sh=t.Sh,this.ju=t.ju,this.ql=t.ql,this.Ku=e.Ku,this.ph=e.ph,this.fi=e.fi,this.q_=e.bh,this.q_.Us=ys.bind(null,this.fi),this.q_.js=bs.bind(null,this.fi),this.persistence.Za((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.U_(a))throw a;return[2,(console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+a),this.B_(new aa,new ca,{jl:!1},i,o))];case 4:return[2]}}))}))},t.prototype.U_=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.L_=function(){if(this.cs.ps)throw new h(l.FAILED_PRECONDITION,"The client has already been terminated.")},t.prototype.disableNetwork=function(){var t=this;return this.L_(),this.cs.enqueue((function(){return t.persistence.tc(!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=b(t)).Yu.add(0),[4,qo(e)];case 1:return n.sent(),e.th.set("Offline"),[2]}}))}))}(t.ph)}))},t.prototype.terminate=function(){var t=this;this.cs.Ds();var e=new fr;return this.cs.bs((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.ql&&this.ql.stop(),[4,zo(this.ph)];case 1:return r.sent(),[4,this.Sh.Di()];case 2:return r.sent(),[4,this.persistence.Di()];case 3:return r.sent(),this.credentials.Yc(),e.resolve(),[3,5];case 4:return t=r.sent(),n=Ar(t,"Failed to shutdown persistence"),e.reject(n),[3,5];case 5:return[2]}}))}))})),e.promise},t.prototype.waitForPendingWrites=function(){var t=this;this.L_();var e=new fr;return this.cs.ws((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:Qo((n=b(t)).ph)||p("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=b(t);return e.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(function(t){return e.Sr.qo(t)}))}(n.ju)];case 2:return-1===(i=r.sent())?[2,void e.resolve()]:((o=n.Lh.get(i)||[]).push(e),n.Lh.set(i,o),[3,4]);case 3:return s=r.sent(),a=Ar(s,"Initialization of waitForPendingWrites() operation failed"),e.reject(a),[3,4];case 4:return[2]}}))}))}(t.fi,e)})),e.promise},t.prototype.listen=function(t,e,n){var r=this;this.L_();var i=new la(n),o=new Ur(t,i,e);return this.cs.ws((function(){return Rr(r.q_,o)})),function(){i.Zl(),r.cs.ws((function(){return Dr(r.q_,o)}))}},t.prototype.Q_=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.L_(),[4,this.O_.promise];case 1:return i.sent(),e=new fr,[2,(this.cs.ws((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=b(t);return n.persistence.runTransaction("read document","readonly",(function(t){return n.Cc.Cr(t,e)}))}(t,e)];case 1:return(i=r.sent())instanceof Nn?n.resolve(i):i instanceof kn?n.resolve(null):n.reject(new h(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=Ar(o,"Failed to get document '"+e+" from cache"),n.reject(s),[3,3];case 3:return[2]}}))}))}(n.ju,t,e)})),e.promise)]}}))}))},t.prototype.W_=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.L_(),[4,this.O_.promise];case 1:return r.sent(),n=new fr,[2,(this.cs.ws((function(){return function(t,e,n,r,i){var o=new la({next:function(o){e.ws((function(){return Dr(t,s)}));var a=o.docs.has(n);!a&&o.fromCache?i.reject(new h(l.UNAVAILABLE,"Failed to get document because the client is offline.")):a&&o.fromCache&&r&&"server"===r.source?i.reject(new h(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 Ur(Pn(n.path),o,{includeMetadataChanges:!0,Xs:!0});return Rr(t,s)}(i.q_,i.cs,t,e,n)})),n.promise)]}}))}))},t.prototype.j_=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.L_(),[4,this.O_.promise];case 1:return i.sent(),e=new fr,[2,(this.cs.ws((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,Eo(t,e,!0)];case 1:return i=r.sent(),o=new ps(e,i.Fc),s=o.wh(i.documents),a=o.yr(s,!1),n.resolve(a.snapshot),[3,3];case 2:return u=r.sent(),c=Ar(u,"Failed to execute query '"+e+" against cache"),n.reject(c),[3,3];case 3:return[2]}}))}))}(n.ju,t,e)})),e.promise)]}}))}))},t.prototype.K_=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.L_(),[4,this.O_.promise];case 1:return r.sent(),n=new fr,[2,(this.cs.ws((function(){return function(t,e,n,r,i){var o=new la({next:function(n){e.ws((function(){return Dr(t,s)})),n.fromCache&&"server"===r.source?i.reject(new h(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 Ur(n,o,{includeMetadataChanges:!0,Xs:!0});return Rr(t,s)}(i.q_,i.cs,t,e,n)})),n.promise)]}}))}))},t.prototype.write=function(t){var e=this;this.L_();var n=new fr;return this.cs.ws((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=Gs(t),r.label=1;case 1:return r.trys.push([1,5,,6]),[4,function(t,e){var n,r=b(t),i=at.now(),o=e.reduce((function(t,e){return t.add(e.key)}),Lt());return r.persistence.runTransaction("Locally write mutations","readwrite",(function(t){return r.Cc.kr(t,o).next((function(o){n=o;for(var s=[],a=0,u=e;a<u.length;a++){var c=u[a],l=pn(c,n.get(c.key));null!=l&&s.push(new yn(c.key,l,Cn(l.proto.mapValue),cn.exists(!0)))}return r.Sr.ko(t,i,s,e)}))})).then((function(t){var e=t.lr(n);return{batchId:t.batchId,wr:e}}))}(i.ju,e)];case 2:return o=r.sent(),i.Sh.xi(o.batchId),function(t,e,n){var r=t.Oh[t.currentUser.ti()];r||(r=new St(Z)),r=r.ot(e,n),t.Oh[t.currentUser.ti()]=r}(i,o.batchId,n),[4,Os(i,o.wr)];case 3:return r.sent(),[4,ns(i.ph)];case 4:return r.sent(),[3,6];case 5:return s=r.sent(),a=Ar(s,"Failed to persist write"),n.reject(a),[3,6];case 6:return[2]}}))}))}(e.fi,t,n)})),n.promise},t.prototype.U=function(){return this.bl.U},t.prototype.G_=function(t){var e=this;this.L_();var n=new la(t);return this.cs.ws((function(){return r.__awaiter(e,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,function(t,e){b(t).qs.add(e),e.next()}(this.q_,n)]}))}))})),function(){n.Zl(),e.cs.ws((function(){return r.__awaiter(e,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,function(t,e){b(t).qs.delete(e)}(this.q_,n)]}))}))}))}},Object.defineProperty(t.prototype,"z_",{get:function(){return this.cs.ps},enumerable:!1,configurable:!0}),t.prototype.transaction=function(t){var e=this;this.L_();var n=new fr;return this.cs.ws((function(){return new Ba(e.cs,e.Ku,t,n).run(),Promise.resolve()})),n.promise},t}();function Ga(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.H_=n,this.Y_=r,this.J_=i}return t.prototype.X_=function(t){switch(Jt(t)){case 0:return null;case 1:return t.booleanValue;case 2:return se(t.integerValue||t.doubleValue);case 3:return this.Z_(t.timestampValue);case 4:return this.tf(t);case 5:return t.stringValue;case 6:return this.J_(ae(t.bytesValue));case 7:return this.ef(t.referenceValue);case 8:return this.nf(t.geoPointValue);case 9:return this.sf(t.arrayValue);case 10:return this.if(t.mapValue);default:throw y()}},t.prototype.if=function(t){var e=this,n={};return E(t.fields||{},(function(t,r){n[t]=e.X_(r)})),n},t.prototype.nf=function(t){return new _a(se(t.latitude),se(t.longitude))},t.prototype.sf=function(t){var e=this;return(t.values||[]).map((function(t){return e.X_(t)}))},t.prototype.tf=function(t){switch(this.H_){case"previous":var e=function t(e){var n=e.mapValue.fields.__previous_value__;return Zt(n)?t(n):n}(t);return null==e?null:this.X_(e);case"estimate":return this.Z_(Yt(t));default:return null}},t.prototype.Z_=function(t){var e=oe(t),n=new at(e.seconds,e.nanos);return this.timestampsInSnapshots?n:n.toDate()},t.prototype.ef=function(t){var e=T.g(t);w($e(e));var n=new ot(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.Y_(r)},t}(),Wa=oi.ho,Ka=function(){function t(t){var e,n,r,i,o;if(void 0===t.host){if(void 0!==t.ssl)throw new h(l.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else L("settings","non-empty string","host",t.host),this.host=t.host,U("settings","boolean","ssl",t.ssl),this.ssl=null===(e=t.ssl)||void 0===e||e;if(B("settings",t,["host","ssl","credentials","timestampsInSnapshots","cacheSizeBytes","experimentalForceLongPolling","experimentalAutoDetectLongPolling","ignoreUndefinedProperties"]),U("settings","object","credentials",t.credentials),this.credentials=t.credentials,U("settings","boolean","timestampsInSnapshots",t.timestampsInSnapshots),U("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,U("settings","number","cacheSizeBytes",t.cacheSizeBytes),void 0===t.cacheSizeBytes)this.cacheSizeBytes=oi._o;else{if(t.cacheSizeBytes!==Wa&&t.cacheSizeBytes<oi.lo)throw new h(l.INVALID_ARGUMENT,"cacheSizeBytes must be at least "+oi.lo);this.cacheSizeBytes=t.cacheSizeBytes}U("settings","boolean","experimentalForceLongPolling",t.experimentalForceLongPolling),this.experimentalForceLongPolling=null!==(i=t.experimentalForceLongPolling)&&void 0!==i&&i,U("settings","boolean","experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling),this.experimentalAutoDetectLongPolling=null!==(o=t.experimentalAutoDetectLongPolling)&&void 0!==o&&o,function(t,e,n,r){if(!0===e&&!0===r)throw new h(l.INVALID_ARGUMENT,"experimentalForceLongPolling and experimentalAutoDetectLongPolling cannot be used together.")}(0,t.experimentalForceLongPolling,0,t.experimentalAutoDetectLongPolling)}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.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties},t}(),Qa=function(){function t(e,n,i,o){var s=this;if(void 0===i&&(i=new aa),void 0===o&&(o=new ca),this.rf=i,this.af=o,this.cf=null,this.uf=new Cr,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.hf(),[4,this.lf.terminate()];case 1:return t.sent(),[2]}}))}))}},"object"==typeof e.options){var a=e;this.cf=a,this.__=t._f(a),this.ff=a.name,this.df=new Ro(n)}else{var u=e;if(!u.projectId)throw new h(l.INVALID_ARGUMENT,"Must provide projectId");this.__=new ot(u.projectId,u.database),this.ff="[DEFAULT]",this.df=new ko}this.wf=new Ka({})}return Object.defineProperty(t.prototype,"mf",{get:function(){return this.Tf||(this.Tf=new Na(this.__,this.wf.ignoreUndefinedProperties)),this.Tf},enumerable:!1,configurable:!0}),t.prototype.settings=function(t){k("Firestore.settings",arguments,1),O("Firestore.settings","object",1,t),t.merge&&delete(t=Object.assign(Object.assign({},this.wf),t)).merge;var e=new Ka(t);if(this.lf&&!this.wf.isEqual(e))throw new h(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.wf=e,void 0!==e.credentials&&(this.df=function(t){if(!t)return new ko;switch(t.type){case"gapi":var e=t.client;return w(!("object"!=typeof e||null===e||!e.auth||!e.auth.getAuthHeaderValueForFirstParty)),new Oo(e,t.sessionIndex||"0");case"provider":return t.client;default:throw new h(l.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(e.credentials))},t.prototype.enableNetwork=function(){return this.hf(),this.lf.enableNetwork()},t.prototype.disableNetwork=function(){return this.hf(),this.lf.disableNetwork()},t.prototype.enablePersistence=function(t){var e,n;if(this.lf)throw new h(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 h(l.INVALID_ARGUMENT,"The 'experimentalForceOwningTab' setting cannot be used with 'synchronizeTabs'.");return this.Ef(this.rf,this.af,{jl:!0,cacheSizeBytes:this.wf.cacheSizeBytes,synchronizeTabs:r,ka: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.lf&&!this.lf.z_)throw new h(l.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");return t=new fr,[2,(this.uf.bs((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.rf.clearPersistence(this.__,this.ff)];case 1:return n.sent(),t.resolve(),[3,3];case 2:return e=n.sent(),t.reject(e),[3,3];case 3:return[2]}}))}))})),t.promise)]}))}))},t.prototype.terminate=function(){return this.app._removeServiceInstance("firestore"),this.INTERNAL.delete()},Object.defineProperty(t.prototype,"If",{get:function(){return this.hf(),this.lf.z_},enumerable:!1,configurable:!0}),t.prototype.waitForPendingWrites=function(){return this.hf(),this.lf.waitForPendingWrites()},t.prototype.onSnapshotsInSync=function(t){return this.hf(),Ga(t)?this.lf.G_(t):(O("Firestore.onSnapshotsInSync","function",1,t),this.lf.G_({next:t}))},t.prototype.hf=function(){return this.lf||this.Ef(new aa,new ca,{jl:!1}),this.lf},t.prototype.Af=function(){return new it(this.__,this.ff,this.wf.host,this.wf.ssl,this.wf.experimentalForceLongPolling,this.wf.experimentalAutoDetectLongPolling)},t.prototype.Ef=function(t,e,n){var r=this.Af();return this.lf=new Ha(this.df,this.uf),this.lf.start(r,t,e,n)},t._f=function(t){if(!Object.prototype.hasOwnProperty.call(t.options,"projectId"))throw new h(l.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');var e=t.options.projectId;if(!e||"string"!=typeof e)throw new h(l.INVALID_ARGUMENT,"projectId must be a string in FirebaseApp.options");return new ot(e)},Object.defineProperty(t.prototype,"app",{get:function(){if(!this.cf)throw new h(l.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this.cf},enumerable:!1,configurable:!0}),t.prototype.collection=function(t){return k("Firestore.collection",arguments,1),O("Firestore.collection","non-empty string",1,t),this.hf(),new lu(T.g(t),this,null)},t.prototype.doc=function(t){return k("Firestore.doc",arguments,1),O("Firestore.doc","non-empty string",1,t),this.hf(),Xa.Rf(T.g(t),this,null)},t.prototype.collectionGroup=function(t){if(k("Firestore.collectionGroup",arguments,1),O("Firestore.collectionGroup","non-empty string",1,t),t.indexOf("/")>=0)throw new h(l.INVALID_ARGUMENT,"Invalid collection ID '"+t+"' passed to function Firestore.collectionGroup(). Collection IDs must not contain '/'.");return this.hf(),new uu(function(t){return new Dn(T.P(),t)}(t),this,null)},t.prototype.runTransaction=function(t){var e=this;return k("Firestore.runTransaction",arguments,1),O("Firestore.runTransaction","function",1,t),this.hf().transaction((function(n){return t(new Za(e,n))}))},t.prototype.batch=function(){return this.hf(),new Ya(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){k("Firestore.setLogLevel",arguments,1),V("setLogLevel",["debug","error","silent","warn","info","verbose"],1,t),f.setLogLevel(t)},t.prototype.gf=function(){return this.wf.timestampsInSnapshots},t.prototype.Pf=function(){return this.wf},t}(),Za=function(){function t(t,e){this.yf=t,this.Vf=e}return t.prototype.get=function(t){var e=this;k("Transaction.get",arguments,1);var n=pu("Transaction.get",t,this.yf);return this.Vf.v_([n.f_]).then((function(t){if(!t||1!==t.length)return y();var r=t[0];if(r instanceof kn)return new tu(e.yf,n.f_,null,!1,!1,n.d_);if(r instanceof Nn)return new tu(e.yf,n.f_,r,!1,!1,n.d_);throw y()}))},t.prototype.set=function(t,e,n){D("Transaction.set",arguments,2,3);var r=pu("Transaction.set",t,this.yf);n=hu("Transaction.set",n);var i=vu(r.d_,e,n),o=ka(this.yf.mf,"Transaction.set",r.f_,i,null!==r.d_,n);return this.Vf.set(r.f_,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 fa?(R("Transaction.update",arguments,3),r=pu("Transaction.update",t,this.yf),i=Da(this.yf.mf,"Transaction.update",r.f_,e,n,o)):(k("Transaction.update",arguments,2),r=pu("Transaction.update",t,this.yf),i=Ra(this.yf.mf,"Transaction.update",r.f_,e)),this.Vf.update(r.f_,i),this},t.prototype.delete=function(t){k("Transaction.delete",arguments,1);var e=pu("Transaction.delete",t,this.yf);return this.Vf.delete(e.f_),this},t}(),Ya=function(){function t(t){this.yf=t,this.pf=[],this.bf=!1}return t.prototype.set=function(t,e,n){D("WriteBatch.set",arguments,2,3),this.vf();var r=pu("WriteBatch.set",t,this.yf);n=hu("WriteBatch.set",n);var i=vu(r.d_,e,n),o=ka(this.yf.mf,"WriteBatch.set",r.f_,i,null!==r.d_,n);return this.pf=this.pf.concat(o.w_(r.f_,cn.ze())),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.vf(),"string"==typeof e||e instanceof fa?(R("WriteBatch.update",arguments,3),r=pu("WriteBatch.update",t,this.yf),i=Da(this.yf.mf,"WriteBatch.update",r.f_,e,n,o)):(k("WriteBatch.update",arguments,2),r=pu("WriteBatch.update",t,this.yf),i=Ra(this.yf.mf,"WriteBatch.update",r.f_,e)),this.pf=this.pf.concat(i.w_(r.f_,cn.exists(!0))),this},t.prototype.delete=function(t){k("WriteBatch.delete",arguments,1),this.vf();var e=pu("WriteBatch.delete",t,this.yf);return this.pf=this.pf.concat(new Sn(e.f_,cn.ze())),this},t.prototype.commit=function(){return this.vf(),this.bf=!0,this.pf.length>0?this.yf.hf().write(this.pf):Promise.resolve()},t.prototype.vf=function(){if(this.bf)throw new h(l.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")},t}(),Xa=function(t){function e(e,n,r){var i=this;return(i=t.call(this,n.__,e,r)||this).f_=e,i.firestore=n,i.d_=r,i.lf=i.firestore.hf(),i}return r.__extends(e,t),e.Rf=function(t,n,r){if(t.length%2!=0)throw new h(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.f_.path._()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return new lu(this.f_.path.h(),this.firestore,this.d_)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.f_.path.R()},enumerable:!1,configurable:!0}),e.prototype.collection=function(t){if(k("DocumentReference.collection",arguments,1),O("DocumentReference.collection","non-empty string",1,t),!t)throw new h(l.INVALID_ARGUMENT,"Must provide a non-empty collection name to collection()");var e=T.g(t);return new lu(this.f_.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.f_.isEqual(t.f_)&&this.d_===t.d_},e.prototype.set=function(t,e){D("DocumentReference.set",arguments,1,2),e=hu("DocumentReference.set",e);var n=vu(this.d_,t,e),r=ka(this.firestore.mf,"DocumentReference.set",this.f_,n,null!==this.d_,e);return this.lf.write(r.w_(this.f_,cn.ze()))},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 fa?(R("DocumentReference.update",arguments,2),n=Da(this.firestore.mf,"DocumentReference.update",this.f_,t,e,r)):(k("DocumentReference.update",arguments,1),n=Ra(this.firestore.mf,"DocumentReference.update",this.f_,t)),this.lf.write(n.w_(this.f_,cn.exists(!0)))},e.prototype.delete=function(){return k("DocumentReference.delete",arguments,0),this.lf.write([new Sn(this.f_,cn.ze())])},e.prototype.onSnapshot=function(){for(var t,e,n,r=this,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];D("DocumentReference.onSnapshot",arguments,1,4);var s={includeMetadataChanges:!1},a=0;"object"!=typeof i[a]||Ga(i[a])||(B("DocumentReference.onSnapshot",s=i[a],["includeMetadataChanges"]),U("DocumentReference.onSnapshot","boolean","includeMetadataChanges",s.includeMetadataChanges),a++);var u={includeMetadataChanges:s.includeMetadataChanges};if(Ga(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 O("DocumentReference.onSnapshot","function",a,i[a]),P("DocumentReference.onSnapshot","function",a+1,i[a+1]),P("DocumentReference.onSnapshot","function",a+2,i[a+2]);var l={next:function(t){i[a]&&i[a](r.Sf(t))},error:i[a+1],complete:i[a+2]};return this.lf.listen(Pn(this.f_.path),u,l)},e.prototype.get=function(t){var e=this;D("DocumentReference.get",arguments,0,1),du("DocumentReference.get",t);var n=this.firestore.hf();return t&&"cache"===t.source?n.Q_(this.f_).then((function(t){return new tu(e.firestore,e.f_,t,!0,t instanceof Nn&&t.Je,e.d_)})):n.W_(this.f_,t).then((function(t){return e.Sf(t)}))},e.prototype.withConverter=function(t){return new e(this.f_,this.firestore,t)},e.prototype.Sf=function(t){var e=t.docs.get(this.f_);return new tu(this.firestore,this.f_,e,t.fromCache,t.hasPendingWrites,this.d_)},e}(Ia),Ja=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}(),tu=function(){function t(t,e,n,r,i,o){this.yf=t,this.f_=e,this.Df=n,this.Cf=r,this.Nf=i,this.d_=o}return t.prototype.data=function(t){var e=this;if(D("DocumentSnapshot.data",arguments,0,1),t=fu("DocumentSnapshot.data",t),this.Df){if(this.d_){var n=new eu(this.yf,this.f_,this.Df,this.Cf,this.Nf,null);return this.d_.fromFirestore(n,t)}return new $a(this.yf.__,this.yf.gf(),t.serverTimestamps||"none",(function(t){return new Xa(t,e.yf,null)}),(function(t){return new rt(t)})).X_(this.Df.rn())}},t.prototype.get=function(t,e){var n=this;if(D("DocumentSnapshot.get",arguments,1,2),e=fu("DocumentSnapshot.get",e),this.Df){var r=this.Df.data().field(Va("DocumentSnapshot.get",t,this.f_));if(null!==r)return new $a(this.yf.__,this.yf.gf(),e.serverTimestamps||"none",(function(t){return new Xa(t,n.yf,n.d_)}),(function(t){return new rt(t)})).X_(r)}},Object.defineProperty(t.prototype,"id",{get:function(){return this.f_.path._()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ref",{get:function(){return new Xa(this.f_,this.yf,this.d_)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exists",{get:function(){return null!==this.Df},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"metadata",{get:function(){return new Ja(this.Nf,this.Cf)},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(e){if(!(e instanceof t))throw H("isEqual","DocumentSnapshot",1,e);return this.yf===e.yf&&this.Cf===e.Cf&&this.f_.isEqual(e.f_)&&(null===this.Df?null===e.Df:this.Df.isEqual(e.Df))&&this.d_===e.d_},t}(),eu=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}(tu);function nu(t,e,n,r,i,o,s){var a;if(i.p()){if("array-contains"===o||"array-contains-any"===o)throw new h(l.INVALID_ARGUMENT,"Invalid Query. You can't perform '"+o+"' queries on FieldPath.documentId().");if("in"===o||"not-in"===o){ou(s,o);for(var u=[],c=0,f=s;c<f.length;c++)u.push(iu(r,t,f[c]));a={arrayValue:{values:u}}}else a=iu(r,t,s)}else"in"!==o&&"not-in"!==o&&"array-contains-any"!==o||ou(s,o),a=Oa(n,e,s,"in"===o||"not-in"===o);var d=Zn.create(i,o,a);return function(t,e){if(e.hn()){var n=Vn(t);if(null!==n&&!n.isEqual(e.field))throw new h(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=Mn(t);null!==r&&su(0,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 new h(l.INVALID_ARGUMENT,i===e.op?"Invalid query. You cannot use more than one '"+e.op.toString()+"' filter.":"Invalid query. You cannot use '"+e.op.toString()+"' filters with '"+i.toString()+"' filters.")}(t,d),d}function ru(t,e,n){if(null!==t.startAt)throw new h(l.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==t.endAt)throw new h(l.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");var r=new cr(e,n);return function(t,e){if(null===Mn(t)){var n=Vn(t);null!==n&&su(0,n,e.field)}}(t,r),r}function iu(t,e,n){if("string"==typeof n){if(""===n)throw new h(l.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid document ID, but it was an empty string.");if(!jn(e)&&-1!==n.indexOf("/"))throw new h(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(T.g(n));if(!A.F(r))throw new h(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 ue(t,new A(r))}if(n instanceof Ia)return ue(t,n.f_);throw new h(l.INVALID_ARGUMENT,"Invalid query. When querying with FieldPath.documentId(), you must provide a valid string or a DocumentReference, but it was: "+q(n)+".")}function ou(t,e){if(!Array.isArray(t)||0===t.length)throw new h(l.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '"+e.toString()+"' filters.");if(t.length>10)throw new h(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 h(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 h(l.INVALID_ARGUMENT,"Invalid Query. '"+e.toString()+"' filters cannot contain 'NaN' in the value array.")}}function su(t,e,n){if(!n.isEqual(e))throw new h(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 au(t){if(Un(t)&&0===t.on.length)throw new h(l.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}var uu=function(){function t(t,e,n){this.Ff=t,this.firestore=e,this.d_=n}return t.prototype.where=function(e,n,r){k("Query.where",arguments,3),z("Query.where",3,r);var i=V("Query.where",["<","<=","==","!=",">=",">","array-contains","in","array-contains-any","not-in"],2,n),o=Va("Query.where",e),s=nu(this.Ff,"Query.where",this.firestore.mf,this.firestore.__,o,i,r);return new t(function(t,e){var n=t.filters.concat([e]);return new Dn(t.path,t.collectionGroup,t.on.slice(),n,t.limit,t.an,t.startAt,t.endAt)}(this.Ff,s),this.firestore,this.d_)},t.prototype.orderBy=function(e,n){var r;if(D("Query.orderBy",arguments,1,2),P("Query.orderBy","non-empty string",2,n),void 0===n||"asc"===n)r="asc";else{if("desc"!==n)throw new h(l.INVALID_ARGUMENT,"Function Query.orderBy() has unknown direction '"+n+"', expected 'asc' or 'desc'.");r="desc"}var i=Va("Query.orderBy",e),o=ru(this.Ff,i,r);return new t(function(t,e){var n=t.on.concat([e]);return new Dn(t.path,t.collectionGroup,n,t.filters.slice(),t.limit,t.an,t.startAt,t.endAt)}(this.Ff,o),this.firestore,this.d_)},t.prototype.limit=function(e){return k("Query.limit",arguments,1),O("Query.limit","number",1,e),G("Query.limit",1,e),new t(zn(this.Ff,e,"F"),this.firestore,this.d_)},t.prototype.limitToLast=function(e){return k("Query.limitToLast",arguments,1),O("Query.limitToLast","number",1,e),G("Query.limitToLast",1,e),new t(zn(this.Ff,e,"L"),this.firestore,this.d_)},t.prototype.startAt=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];R("Query.startAt",arguments,1);var i=this.xf("Query.startAt",e,n,!0);return new t(Bn(this.Ff,i),this.firestore,this.d_)},t.prototype.startAfter=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];R("Query.startAfter",arguments,1);var i=this.xf("Query.startAfter",e,n,!1);return new t(Bn(this.Ff,i),this.firestore,this.d_)},t.prototype.endBefore=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];R("Query.endBefore",arguments,1);var i=this.xf("Query.endBefore",e,n,!0);return new t(Hn(this.Ff,i),this.firestore,this.d_)},t.prototype.endAt=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];R("Query.endAt",arguments,1);var i=this.xf("Query.endAt",e,n,!1);return new t(Hn(this.Ff,i),this.firestore,this.d_)},t.prototype.isEqual=function(e){if(!(e instanceof t))throw H("isEqual","Query",1,e);return this.firestore===e.firestore&&Gn(this.Ff,e.Ff)&&this.d_===e.d_},t.prototype.withConverter=function(e){return new t(this.Ff,this.firestore,e)},t.prototype.xf=function(t,e,n,i){if(z(t,1,e),e instanceof tu)return k(t,r.__spreadArrays([e],n),1),function(t,e,n,r,i){if(!r)throw new h(l.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for "+n+"().");for(var o=[],s=0,a=Fn(t);s<a.length;s++){var u=a[s];if(u.field.p())o.push(ue(e,r.key));else{var c=r.field(u.field);if(Zt(c))throw new h(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 f=u.field.R();throw new h(l.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '"+f+"' (used as the orderBy) does not exist.")}o.push(c)}}return new or(o,i)}(this.Ff,this.firestore.__,t,e.Df,i);var o=[e].concat(n);return function(t,e,n,r,i,o){var s=t.on;if(i.length>s.length)throw new h(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 h(l.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in "+r+"(), but got a "+typeof c);if(!jn(t)&&-1!==c.indexOf("/"))throw new h(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 f=t.path.child(T.g(c));if(!A.F(f))throw new h(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 '"+f+"' is not because it contains an odd number of segments.");var d=new A(f);a.push(ue(e,d))}else{var p=Oa(n,r,c);a.push(p)}}return new or(a,o)}(this.Ff,this.firestore.__,this.firestore.mf,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];D("Query.onSnapshot",arguments,1,4);var s={},a=0;if("object"!=typeof i[a]||Ga(i[a])||(B("Query.onSnapshot",s=i[a],["includeMetadataChanges"]),U("Query.onSnapshot","boolean","includeMetadataChanges",s.includeMetadataChanges),a++),Ga(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 O("Query.onSnapshot","function",a,i[a]),P("Query.onSnapshot","function",a+1,i[a+1]),P("Query.onSnapshot","function",a+2,i[a+2]);var c={next:function(t){i[a]&&i[a](new cu(r.firestore,r.Ff,t,r.d_))},error:i[a+1],complete:i[a+2]};return au(this.Ff),this.firestore.hf().listen(this.Ff,s,c)},t.prototype.get=function(t){var e=this;D("Query.get",arguments,0,1),du("Query.get",t),au(this.Ff);var n=this.firestore.hf();return(t&&"cache"===t.source?n.j_(this.Ff):n.K_(this.Ff,t)).then((function(t){return new cu(e.firestore,e.Ff,t,e.d_)}))},t}(),cu=function(){function t(t,e,n,r){this.yf=t,this.$f=e,this.kf=n,this.d_=r,this.Mf=null,this.Of=null,this.metadata=new Ja(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.kf.docs.m()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.kf.docs.size},enumerable:!1,configurable:!0}),t.prototype.forEach=function(t,e){var n=this;D("QuerySnapshot.forEach",arguments,1,2),O("QuerySnapshot.forEach","function",1,t),this.kf.docs.forEach((function(r){t.call(e,n.Lf(r,n.metadata.fromCache,n.kf.Wt.has(r.key)))}))},Object.defineProperty(t.prototype,"query",{get:function(){return new uu(this.$f,this.yf,this.d_)},enumerable:!1,configurable:!0}),t.prototype.docChanges=function(t){t&&(B("QuerySnapshot.docChanges",t,["includeMetadataChanges"]),U("QuerySnapshot.docChanges","boolean","includeMetadataChanges",t.includeMetadataChanges));var e=!(!t||!t.includeMetadataChanges);if(e&&this.kf.Kt)throw new h(l.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this.Mf&&this.Of===e||(this.Mf=function(t,e,n){if(t.Qt.m()){var r=0;return t.docChanges.map((function(e){return{type:"added",doc:n(e.doc,t.fromCache,t.Wt.has(e.doc.key)),oldIndex:-1,newIndex:r++}}))}var i=t.Qt;return t.docChanges.filter((function(t){return e||3!==t.type})).map((function(e){var r=n(e.doc,t.fromCache,t.Wt.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:gu(e.type),doc:r,oldIndex:o,newIndex:s}}))}(this.kf,e,this.Lf.bind(this)),this.Of=e),this.Mf},t.prototype.isEqual=function(e){if(!(e instanceof t))throw H("isEqual","QuerySnapshot",1,e);return this.yf===e.yf&&Gn(this.$f,e.$f)&&this.kf.isEqual(e.kf)&&this.d_===e.d_},t.prototype.Lf=function(t,e,n){return new eu(this.yf,t.key,t,e,n,this.d_)},t}(),lu=function(t){function e(e,n,r){var i=this;if((i=t.call(this,Pn(e),n,r)||this).Bf=e,e.length%2!=1)throw new h(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.Ff.path._()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){var t=this.Ff.path.h();return t.m()?null:new Xa(new A(t),this.firestore,null)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this.Ff.path.R()},enumerable:!1,configurable:!0}),e.prototype.doc=function(t){D("CollectionReference.doc",arguments,0,1),0===arguments.length&&(t=Q.k()),O("CollectionReference.doc","non-empty string",1,t);var e=T.g(t);return Xa.Rf(this.Ff.path.child(e),this.firestore,this.d_)},e.prototype.add=function(t){k("CollectionReference.add",arguments,1);var e=this.d_?this.d_.toFirestore(t):t;O("CollectionReference.add","object",1,e);var n=this.doc();return new Xa(n.f_,this.firestore,null).set(e).then((function(){return n}))},e.prototype.withConverter=function(t){return new e(this.Bf,this.firestore,t)},e}(uu);function hu(t,e){if(void 0===e)return{merge:!1};if(B(t,e,["merge","mergeFields"]),U(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 h(l.INVALID_ARGUMENT,"Function "+t+"() requires its "+e+" option to be an array, but it was: "+q(r));for(var o=0;o<r.length;++o)if(!i(r[o]))throw new h(l.INVALID_ARGUMENT,"Function "+t+"() requires all "+e+" elements to be a string or a FieldPath, but the value at index "+o+" was: "+q(r[o]))}(t,"mergeFields",0,r,(function(t){return"string"==typeof t||t instanceof fa}))}(t,0,0,e.mergeFields),void 0!==e.mergeFields&&void 0!==e.merge)throw new h(l.INVALID_ARGUMENT,"Invalid options passed to function "+t+'(): You cannot specify both "merge" and "mergeFields".');return e}function fu(t,e){return void 0===e?{}:(B(t,e,["serverTimestamps"]),M(t,0,"serverTimestamps",e.serverTimestamps,["estimate","previous","none"]),e)}function du(t,e){P(t,"object",1,e),e&&(B(t,e,["source"]),M(t,0,"source",e.source,["default","server","cache"]))}function pu(t,e,n){if(e instanceof Ia){if(e.firestore!==n)throw new h(l.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}throw H(t,"DocumentReference",1,e)}function gu(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return y()}}function vu(t,e,n){return t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e}var mu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.serverTimestamp=function(){N("FieldValue.serverTimestamp",arguments);var t=new ma("serverTimestamp");return t.e_="FieldValue.serverTimestamp",new e(t)},e.delete=function(){N("FieldValue.delete",arguments);var t=new ga("deleteField");return t.e_="FieldValue.delete",new e(t)},e.arrayUnion=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];R("FieldValue.arrayUnion",arguments,1);var r=(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return R("arrayUnion()",arguments,1),new ya("arrayUnion",t)}).apply(void 0,t);return r.e_="FieldValue.arrayUnion",new e(r)},e.arrayRemove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];R("FieldValue.arrayRemove",arguments,1);var r=(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return R("arrayRemove()",arguments,1),new wa("arrayRemove",t)}).apply(void 0,t);return r.e_="FieldValue.arrayRemove",new e(r)},e.increment=function(t){O("FieldValue.increment","number",1,t),k("FieldValue.increment",arguments,1);var n=function(t){return new ba("increment",t)}(t);return n.e_="FieldValue.increment",new e(n)},e.prototype.isEqual=function(t){return this.l_.isEqual(t.l_)},e}(Ea),yu={Firestore:Qa,GeoPoint:_a,Timestamp:at,Blob:rt,Transaction:Za,WriteBatch:Ya,DocumentReference:Xa,DocumentSnapshot:tu,Query:uu,QueryDocumentSnapshot:eu,QuerySnapshot:cu,CollectionReference:lu,FieldPath:fa,FieldValue:mu,setLogLevel:Qa.setLogLevel,CACHE_SIZE_UNLIMITED:Wa};function wu(t){!function(t,e){t.INTERNAL.registerComponent(new u.Component("firestore",(function(t){return function(t,e){var n=new ca,r=new ua(n);return new Qa(t,e,r,n)}(t.getProvider("app").getImmediate(),t.getProvider("auth-internal"))}),"PUBLIC").setServiceProps(Object.assign({},yu)))}(t),t.registerVersion("@firebase/firestore","1.18.0")}wu(c.default),e.__PRIVATE_registerFirestore=wu},"S+S0":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("mrSG"),i=n("zVF4"),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=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="[DEFAULT]");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:"[DEFAULT]",optional:!1},t),n=e.optional,i=this.normalizeInstanceIdentifier(e.identifier);try{var o=this.getOrInitializeService(i);if(!o){if(n)return null;throw Error("Service "+this.name+" is not available")}return o}catch(s){if(n)return null;throw s}},t.prototype.getComponent=function(){return this.component},t.prototype.setComponent=function(t){var e,n;if(t.name!==this.name)throw Error("Mismatching Component "+t.name+" for Provider "+this.name+".");if(this.component)throw Error("Component for "+this.name+" has already been provided");if(this.component=t,function(t){return"EAGER"===t.instantiationMode}(t))try{this.getOrInitializeService("[DEFAULT]")}catch(l){}try{for(var i=r.__values(this.instancesDeferred.entries()),o=i.next();!o.done;o=i.next()){var s=r.__read(o.value,2),a=s[1],u=this.normalizeInstanceIdentifier(s[0]);try{var c=this.getOrInitializeService(u);a.resolve(c)}catch(l){}}}catch(h){e={error:h}}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="[DEFAULT]"),this.instancesDeferred.delete(t),this.instances.delete(t)},t.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(e){switch(e.label){case 0:return t=Array.from(this.instances.values()),[4,Promise.all(r.__spread(t.filter((function(t){return"INTERNAL"in t})).map((function(t){return t.INTERNAL.delete()})),t.filter((function(t){return"_delete"in t})).map((function(t){return t._delete()}))))];case 1:return e.sent(),[2]}}))}))},t.prototype.isComponentSet=function(){return null!=this.component},t.prototype.getOrInitializeService=function(t){var e=this.instances.get(t);return!e&&this.component&&(e=this.component.instanceFactory(this.container,function(t){return"[DEFAULT]"===t?void 0:t}(t)),this.instances.set(t,e)),e||null},t.prototype.normalizeInstanceIdentifier=function(t){return this.component?this.component.multipleInstances?t:"[DEFAULT]":t},t}(),a=function(){function t(t){this.name=t,this.providers=new Map}return t.prototype.addComponent=function(t){var e=this.getProvider(t.name);if(e.isComponentSet())throw new Error("Component "+t.name+" has already been registered with "+this.name);e.setComponent(t)},t.prototype.addOrOverwriteComponent=function(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)},t.prototype.getProvider=function(t){if(this.providers.has(t))return this.providers.get(t);var e=new s(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=a,e.Provider=s},Wcq6:function(t,e,n){"use strict";function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=r(n("wj3C"));i.default.registerVersion("firebase","7.24.0","app"),t.exports=i.default},mrSG:function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return i})),n.d(e,"__assign",(function(){return o})),n.d(e,"__rest",(function(){return s})),n.d(e,"__decorate",(function(){return a})),n.d(e,"__param",(function(){return u})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return l})),n.d(e,"__generator",(function(){return h})),n.d(e,"__createBinding",(function(){return f})),n.d(e,"__exportStar",(function(){return d})),n.d(e,"__values",(function(){return p})),n.d(e,"__read",(function(){return g})),n.d(e,"__spread",(function(){return v})),n.d(e,"__spreadArrays",(function(){return m})),n.d(e,"__await",(function(){return y})),n.d(e,"__asyncGenerator",(function(){return w})),n.d(e,"__asyncDelegator",(function(){return b})),n.d(e,"__asyncValues",(function(){return _})),n.d(e,"__makeTemplateObject",(function(){return E})),n.d(e,"__importStar",(function(){return S})),n.d(e,"__importDefault",(function(){return I})),n.d(e,"__classPrivateFieldGet",(function(){return T})),n.d(e,"__classPrivateFieldSet",(function(){return x}));var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function a(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function 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 l(t,e,n,r){return new(n||(n=Promise))((function(i,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){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))}function h(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(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}}([o,a])}}}function f(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}function d(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function p(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 g(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function v(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(g(arguments[e]));return t}function m(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}function y(t){return this instanceof y?(this.v=t,this):new y(t)}function w(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||a(t,e)}))})}function a(t,e){try{(n=i[t](e)).value instanceof y?Promise.resolve(n.value.v).then(u,c):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function u(t){a("next",t)}function c(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:y(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function _(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=p(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){!function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)}(r,i,(e=t[n](e)).done,e.value)}))}}}function E(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function S(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 I(t){return t&&t.__esModule?t:{default:t}}function T(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function x(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},"q/0M":function(t,e,n){"use strict";function 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}var i;n.r(e),n.d(e,"LogLevel",(function(){return s})),n.d(e,"Logger",(function(){return h})),n.d(e,"setLogLevel",(function(){return f})),n.d(e,"setUserLogHandler",(function(){return d}));var o=[],s=function(t){return 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",t}({}),a={debug:s.DEBUG,verbose:s.VERBOSE,info:s.INFO,warn:s.WARN,error:s.ERROR,silent:s.SILENT},u=s.INFO,c=((i={})[s.DEBUG]="log",i[s.VERBOSE]="log",i[s.INFO]="info",i[s.WARN]="warn",i[s.ERROR]="error",i),l=function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(!(e<t.logLevel)){var o=(new Date).toISOString(),s=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))}},h=function(){function t(t){this.name=t,this._logLevel=u,this._logHandler=l,this._userLogHandler=null,o.push(this)}return Object.defineProperty(t.prototype,"logLevel",{get:function(){return this._logLevel},set:function(t){if(!(t in s))throw new TypeError('Invalid value "'+t+'" assigned to `logLevel`');this._logLevel=t},enumerable:!1,configurable:!0}),t.prototype.setLogLevel=function(t){this._logLevel="string"==typeof t?a[t]:t},Object.defineProperty(t.prototype,"logHandler",{get:function(){return this._logHandler},set:function(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(t){this._userLogHandler=t},enumerable:!1,configurable:!0}),t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._userLogHandler&&this._userLogHandler.apply(this,r([this,s.DEBUG],t)),this._logHandler.apply(this,r([this,s.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,s.VERBOSE],t)),this._logHandler.apply(this,r([this,s.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,s.INFO],t)),this._logHandler.apply(this,r([this,s.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,s.WARN],t)),this._logHandler.apply(this,r([this,s.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,s.ERROR],t)),this._logHandler.apply(this,r([this,s.ERROR],t))},t}();function f(t){o.forEach((function(e){e.setLogLevel(t)}))}function d(t,e){for(var n=function(n){var r=null;e&&e.level&&(r=a[e.level]),n.userLogHandler=null===t?null:function(e,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];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?r:e.logLevel)&&t({level:s[n].toLowerCase(),message:a,args:i,type:e.name})}},r=0,i=o;r<i.length;r++)n(i[r])}},wj3C:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i,o=n("mrSG"),s=n("zVF4"),a=n("S+S0"),u=n("q/0M"),c=((r={})["no-app"]="No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()",r["bad-app-name"]="Illegal App name: '{$appName}",r["duplicate-app"]="Firebase App named '{$appName}' already exists",r["app-deleted"]="Firebase App named '{$appName}' already deleted",r["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",r["invalid-log-argument"]="First argument to `onLog` must be null or a function.",r),l=new s.ErrorFactory("app","Firebase",c),h=((i={})["@firebase/app"]="fire-core",i["@firebase/analytics"]="fire-analytics",i["@firebase/auth"]="fire-auth",i["@firebase/database"]="fire-rtdb",i["@firebase/functions"]="fire-fn",i["@firebase/installations"]="fire-iid",i["@firebase/messaging"]="fire-fcm",i["@firebase/performance"]="fire-perf",i["@firebase/remote-config"]="fire-rc",i["@firebase/storage"]="fire-gcs",i["@firebase/firestore"]="fire-fst",i["fire-js"]="fire-js",i["firebase-wrapper"]="fire-js-all",i),f=new u.Logger("@firebase/app"),d=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()),l=c.next();!l.done;l=c.next())this._addComponent(l.value)}catch(h){r={error:h}}finally{try{l&&!l.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="[DEFAULT]"),this.checkDestroyed_(),this.container.getProvider(t).getImmediate({identifier:e})},t.prototype._removeServiceInstance=function(t,e){void 0===e&&(e="[DEFAULT]"),this.container.getProvider(t).clearInstance(e)},t.prototype._addComponent=function(t){try{this.container.addComponent(t)}catch(e){f.debug("Component "+t.name+" failed to register with FirebaseApp "+this.name,e)}},t.prototype._addOrOverwriteComponent=function(t){this.container.addOrOverwriteComponent(t)},t.prototype.checkDestroyed_=function(){if(this.isDeleted_)throw l.create("app-deleted",{appName:this.name_})},t}();d.prototype.name&&d.prototype.options||d.prototype.delete||console.log("dc");var p=function t(){var e=function(t){var e={},n=new Map,r={__esModule:!0,initializeApp:function(n,i){void 0===i&&(i={}),"object"==typeof i&&null!==i||(i={name:i});var o=i;void 0===o.name&&(o.name="[DEFAULT]");var a=o.name;if("string"!=typeof a||!a)throw l.create("bad-app-name",{appName:String(a)});if(s.contains(e,a))throw l.create("duplicate-app",{appName:a});var u=new t(n,o,r);return e[a]=u,u},app:i,registerVersion:function(t,e,n){var r,i=null!==(r=h[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 f.warn(u.join(" "))}c(new a.Component(i+"-version",(function(){return{library:i,version:e}}),"VERSION"))},setLogLevel:u.setLogLevel,onLog:function(t,e){if(null!==t&&"function"!=typeof t)throw l.create("invalid-log-argument",{appName:name});u.setUserLogHandler(t,e)},apps:null,SDK_VERSION:"7.20.0",INTERNAL:{registerComponent:c,removeApp:function(t){delete e[t]},components:n,useAsService:function(t,e){return"serverAuth"===e?null:e}}};function i(t){if(!s.contains(e,t=t||"[DEFAULT]"))throw l.create("no-app",{appName:t});return e[t]}function c(a){var u,c,h=a.name;if(n.has(h))return f.debug("There were multiple attempts to register component "+h+"."),"PUBLIC"===a.type?r[h]:null;if(n.set(h,a),"PUBLIC"===a.type){var d=function(t){if(void 0===t&&(t=i()),"function"!=typeof t[h])throw l.create("invalid-app-argument",{appName:h});return t[h]()};void 0!==a.serviceProps&&s.deepExtend(d,a.serviceProps),r[h]=d,t.prototype[h]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this._getService.bind(this,h);return n.apply(this,a.multipleInstances?t:[])}}try{for(var p=o.__values(Object.keys(e)),g=p.next();!g.done;g=p.next())e[g.value]._addComponent(a)}catch(v){u={error:v}}finally{try{g&&!g.done&&(c=p.return)&&c.call(p)}finally{if(u)throw u.error}}return"PUBLIC"===a.type?r[h]:null}return r.default=r,Object.defineProperty(r,"apps",{get:function(){return Object.keys(e).map((function(t){return e[t]}))}}),i.App=t,r}(d);return e.INTERNAL=o.__assign(o.__assign({},e.INTERNAL),{createFirebaseNamespace:t,extendNamespace:function(t){s.deepExtend(e,t)},createSubscribe:s.createSubscribe,ErrorFactory:s.ErrorFactory,deepExtend:s.deepExtend}),e}(),g=function(){function t(t){this.container=t}return t.prototype.getPlatformInfoString=function(){return this.container.getProviders().map((function(t){if(function(t){var e=t.getComponent();return"VERSION"===(null==e?void 0:e.type)}(t)){var e=t.getImmediate();return e.library+"/"+e.version}return null})).filter((function(t){return t})).join(" ")},t}();if(s.isBrowser()&&void 0!==self.firebase){f.warn("\n    Warning: Firebase is already defined in the global scope. Please make sure\n    Firebase library is only loaded once.\n  ");var v=self.firebase.SDK_VERSION;v&&v.indexOf("LITE")>=0&&f.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 m=p.initializeApp;p.initializeApp=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return s.isNode()&&f.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      '),m.apply(void 0,t)};var y=p;!function(t,e){t.INTERNAL.registerComponent(new a.Component("platform-logger",(function(t){return new g(t)}),"PRIVATE")),t.registerVersion("@firebase/app","0.6.11",void 0),t.registerVersion("fire-js","")}(y),e.default=y,e.firebase=y},x7I3:function(t,e,n){"use strict";n.r(e),n.d(e,"ErrorCode",(function(){return Xn})),n.d(e,"EventType",(function(){return Jn})),n.d(e,"WebChannel",(function(){return tr})),n.d(e,"XhrIo",(function(){return er})),n.d(e,"createWebChannelTransport",(function(){return Yn}));var 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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(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 o,s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a=a||{},u=s||self;function c(){}function l(t){var e=typeof t;return"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}function h(t){var e=l(t);return"array"==e||"object"==e&&"number"==typeof t.length}function f(t){var e=typeof t;return"object"==e&&null!=t||"function"==e}var d="closure_uid_"+(1e9*Math.random()>>>0),p=0;function g(t,e,n){return t.call.apply(t.bind,arguments)}function v(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 m(t,e,n){return(m=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?g:v).apply(null,arguments)}function y(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 b(t,e){function n(){}n.prototype=e.prototype,t.S=e.prototype,t.prototype=new n,t.prototype.constructor=t}function _(){this.j=this.j,this.i=this.i}_.prototype.j=!1,_.prototype.ja=function(){!this.j&&(this.j=!0,this.G(),0)&&function(t){Object.prototype.hasOwnProperty.call(t,d)&&t[d]||(t[d]=++p)}(this)},_.prototype.G=function(){if(this.i)for(;this.i.length;)this.i.shift()()};var E=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 I(t){return Array.prototype.concat.apply([],arguments)}function T(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 x(t){return/^[\s\xa0]*$/.test(t)}var C,A=String.prototype.trim?function(t){return t.trim()}:function(t){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(t)[1]};function N(t,e){return-1!=t.indexOf(e)}function k(t,e){return t<e?-1:t>e?1:0}t:{var R=u.navigator;if(R){var D=R.userAgent;if(D){C=D;break t}}C=""}function O(t,e,n){for(var r in t)e.call(n,t[r],r,t)}function P(t){var e={};for(var n in t)e[n]=t[n];return e}var L="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function U(t,e){for(var n,r,i=1;i<arguments.length;i++){for(n in r=arguments[i])t[n]=r[n];for(var o=0;o<L.length;o++)n=L[o],Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}}function M(t){return M[" "](t),t}M[" "]=c;var V,j,F=N(C,"Opera"),q=N(C,"Trident")||N(C,"MSIE"),z=N(C,"Edge"),B=z||q,H=N(C,"Gecko")&&!(N(C.toLowerCase(),"webkit")&&!N(C,"Edge"))&&!(N(C,"Trident")||N(C,"MSIE"))&&!N(C,"Edge"),G=N(C.toLowerCase(),"webkit")&&!N(C,"Edge");function $(){var t=u.document;return t?t.documentMode:void 0}t:{var W="",K=(j=C,H?/rv:([^\);]+)(\)|;)/.exec(j):z?/Edge\/([\d\.]+)/.exec(j):q?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(j):G?/WebKit\/(\S+)/.exec(j):F?/(?:Version)[ \/]?(\S+)/.exec(j):void 0);if(K&&(W=K?K[1]:""),q){var Q=$();if(null!=Q&&Q>parseFloat(W)){V=String(Q);break t}}V=W}var Z={};function Y(t){return function(t,e){var n=Z;return Object.prototype.hasOwnProperty.call(n,t)?n[t]:n[t]=e()}(t,(function(){for(var e=0,n=A(String(V)).split("."),r=A(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=k(0==s[1].length?0:parseInt(s[1],10),0==a[1].length?0:parseInt(a[1],10))||k(0==s[2].length,0==a[2].length)||k(s[2],a[2]),s=s[3],a=a[3]}while(0==e)}return 0<=e}))}var X=u.document&&q&&($()||parseInt(V,10))||void 0,J=!q||9<=Number(X),tt=q&&!Y("9"),et=function(){if(!u.addEventListener||!Object.defineProperty)return!1;var t=!1,e=Object.defineProperty({},"passive",{get:function(){t=!0}});try{u.addEventListener("test",c,e),u.removeEventListener("test",c,e)}catch(n){}return t}();function nt(t,e){this.type=t,this.a=this.target=e,this.defaultPrevented=!1}function rt(t,e){if(nt.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(H){t:{try{M(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:it[t.pointerType]||"",this.c=t,t.defaultPrevented&&this.b()}}nt.prototype.b=function(){this.defaultPrevented=!0},b(rt,nt);var it={2:"touch",3:"pen",4:"mouse"};rt.prototype.b=function(){rt.S.b.call(this);var t=this.c;if(t.preventDefault)t.preventDefault();else if(t.returnValue=!1,tt)try{(t.ctrlKey||112<=t.keyCode&&123>=t.keyCode)&&(t.keyCode=-1)}catch(e){}};var ot="closure_listenable_"+(1e6*Math.random()|0),st=0;function at(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=++st,this.Y=this.Z=!1}function ut(t){t.Y=!0,t.listener=null,t.proxy=null,t.src=null,t.ca=null}function ct(t){this.src=t,this.a={},this.b=0}function lt(t,e){var n=e.type;if(n in t.a){var r,i=t.a[n],o=E(i,e);(r=0<=o)&&Array.prototype.splice.call(i,o,1),r&&(ut(e),0==t.a[n].length&&(delete t.a[n],t.b--))}}function ht(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}ct.prototype.add=function(t,e,n,r,i){var o=t.toString();(t=this.a[o])||(t=this.a[o]=[],this.b++);var s=ht(t,e,r,i);return-1<s?(e=t[s],n||(e.Z=!1)):((e=new at(e,this.src,o,!!r,i)).Z=n,t.push(e)),e};var ft="closure_lm_"+(1e6*Math.random()|0),dt={};function pt(t,e,n,r,i){if(r&&r.once)return function t(e,n,r,i,o){if(Array.isArray(n)){for(var s=0;s<n.length;s++)t(e,n[s],r,i,o);return null}return r=Et(r),e&&e[ot]?e.wa(n,r,f(i)?!!i.capture:!!i,o):gt(e,n,r,!0,i,o)}(t,e,n,r,i);if(Array.isArray(e)){for(var o=0;o<e.length;o++)pt(t,e[o],n,r,i);return null}return n=Et(n),t&&t[ot]?t.va(e,n,f(r)?!!r.capture:!!r,i):gt(t,e,n,!1,r,i)}function gt(t,e,n,r,i,o){if(!e)throw Error("Invalid event type");var s=f(i)?!!i.capture:!!i;if(s&&!J)return null;var a=bt(t);if(a||(t[ft]=a=new ct(t)),(n=a.add(e,n,r,s,o)).proxy)return n;if(r=function(){var t=wt,e=J?function(n){return t.call(e.src,e.listener,n)}:function(n){if(!(n=t.call(e.src,e.listener,n)))return n};return e}(),n.proxy=r,r.src=t,r.listener=n,t.addEventListener)et||(i=s),void 0===i&&(i=!1),t.addEventListener(e.toString(),r,i);else if(t.attachEvent)t.attachEvent(mt(e.toString()),r);else{if(!t.addListener||!t.removeListener)throw Error("addEventListener and attachEvent are unavailable.");t.addListener(r)}return n}function vt(t){if("number"!=typeof t&&t&&!t.Y){var e=t.src;if(e&&e[ot])lt(e.c,t);else{var n=t.type,r=t.proxy;e.removeEventListener?e.removeEventListener(n,r,t.capture):e.detachEvent?e.detachEvent(mt(n),r):e.addListener&&e.removeListener&&e.removeListener(r),(n=bt(e))?(lt(n,t),0==n.b&&(n.src=null,e[ft]=null)):ut(t)}}}function mt(t){return t in dt?dt[t]:dt[t]="on"+t}function yt(t,e){var n=t.listener,r=t.ca||t.src;return t.Z&&vt(t),n.call(r,e)}function wt(t,e){if(t.Y)return!0;if(!J){if(!e)t:{e=["window","event"];for(var n=u,r=0;r<e.length;r++)if(null==(n=n[e[r]])){e=null;break t}e=n}return yt(t,e=new rt(e,this))}return yt(t,new rt(e,this))}function bt(t){return(t=t[ft])instanceof ct?t:null}var _t="__closure_events_fn_"+(1e9*Math.random()>>>0);function Et(t){return"function"==l(t)?t:(t[_t]||(t[_t]=function(e){return t.handleEvent(e)}),t[_t])}function St(){_.call(this),this.c=new ct(this),this.J=this,this.C=null}function It(t,e,n,r){if(!(e=t.c.a[String(e)]))return!0;e=e.concat();for(var i=!0,o=0;o<e.length;++o){var s=e[o];if(s&&!s.Y&&s.capture==n){var a=s.listener,u=s.ca||s.src;s.Z&&lt(t.c,s),i=!1!==a.call(u,r)&&i}}return i&&!r.defaultPrevented}b(St,_),St.prototype[ot]=!0,(o=St.prototype).addEventListener=function(t,e,n,r){pt(this,t,e,n,r)},o.removeEventListener=function(t,e,n,r){!function t(e,n,r,i,o){if(Array.isArray(n))for(var s=0;s<n.length;s++)t(e,n[s],r,i,o);else i=f(i)?!!i.capture:!!i,r=Et(r),e&&e[ot]?(e=e.c,(n=String(n).toString())in e.a&&-1<(r=ht(s=e.a[n],r,i,o))&&(ut(s[r]),Array.prototype.splice.call(s,r,1),0==s.length&&(delete e.a[n],e.b--))):e&&(e=bt(e))&&(n=e.a[n.toString()],e=-1,n&&(e=ht(n,r,i,o)),(r=-1<e?n[e]:null)&&vt(r))}(this,t,e,n,r)},o.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 nt(t,n);else if(t instanceof nt)t.target=t.target||n;else{var i=t;U(t=new nt(r,n),i)}if(i=!0,e)for(var o=e.length-1;0<=o;o--){var s=t.a=e[o];i=It(s,r,!0,t)&&i}if(i=It(s=t.a=n,r,!0,t)&&i,i=It(s,r,!1,t)&&i,e)for(o=0;o<e.length;o++)i=It(s=t.a=e[o],r,!1,t)&&i;return i},o.G=function(){if(St.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++)ut(n[r]);delete e.a[t],e.b--}}this.C=null},o.va=function(t,e,n,r){return this.c.add(String(t),e,!1,n,r)},o.wa=function(t,e,n,r){return this.c.add(String(t),e,!0,n,r)};var Tt=u.JSON.stringify;function xt(){this.b=this.a=null}var Ct,At=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--,this.a=(t=this.a).next,t.next=null):t=this.c(),t},t}())((function(){return new kt}),(function(t){t.reset()}),100);function Nt(){var t=Pt,e=null;return t.a&&(e=t.a,t.a=t.a.next,t.a||(t.b=null),e.next=null),e}function kt(){this.next=this.b=this.a=null}function Rt(t){u.setTimeout((function(){throw t}),0)}function Dt(t,e){Ct||function(){var t=u.Promise.resolve(void 0);Ct=function(){t.then(Lt)}}(),Ot||(Ct(),Ot=!0),Pt.add(t,e)}xt.prototype.add=function(t,e){var n=At.get();n.set(t,e),this.b?this.b.next=n:this.a=n,this.b=n},kt.prototype.set=function(t,e){this.a=t,this.b=e,this.next=null},kt.prototype.reset=function(){this.next=this.b=this.a=null};var Ot=!1,Pt=new xt;function Lt(){for(var t;t=Nt();){try{t.a.call(t.b)}catch(n){Rt(n)}var e=At;e.g(t),e.b<e.f&&(e.b++,t.next=e.a,e.a=t)}Ot=!1}function Ut(t,e){St.call(this),this.b=t||1,this.a=e||u,this.f=m(this.Ya,this),this.g=w()}function Mt(t){t.aa=!1,t.M&&(t.a.clearTimeout(t.M),t.M=null)}function Vt(t,e,n){if("function"==l(t))n&&(t=m(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=m(t.handleEvent,t)}return 2147483647<Number(e)?-1:u.setTimeout(t,e||0)}function jt(t){t.a=Vt((function(){t.a=null,t.c&&(t.c=!1,jt(t))}),t.h);var e=t.b;t.b=null,t.g.apply(null,e)}b(Ut,St),(o=Ut.prototype).aa=!1,o.M=null,o.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&&(Mt(this),this.start()))}},o.start=function(){this.aa=!0,this.M||(this.M=this.a.setTimeout(this.f,this.b),this.g=w())},o.G=function(){Ut.S.G.call(this),Mt(this),delete this.a};var Ft=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 function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.f=function(t){this.b=arguments,this.a?this.c=!0:jt(this)},e.prototype.G=function(){t.prototype.G.call(this),this.a&&(u.clearTimeout(this.a),this.a=null,this.c=!1,this.b=null)},e}(_);function qt(t){_.call(this),this.b=t,this.a={}}b(qt,_);var zt=[];function Bt(t,e,n,r){Array.isArray(n)||(n&&(zt[0]=n.toString()),n=zt);for(var i=0;i<n.length;i++){var o=pt(e,n[i],r||t.handleEvent,!1,t.b||t);if(!o)break;t.a[o.key]=o}}function Ht(t){O(t.a,(function(t,e){this.a.hasOwnProperty(e)&&vt(t)}),t),t.a={}}function Gt(){this.a=!0}function $t(t,e,n,r){t.info((function(){return"XMLHTTP TEXT ("+e+"): "+function(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 Tt(n)}catch(a){return e}}(t,n)+(r?" "+r:"")}))}qt.prototype.G=function(){qt.S.G.call(this),Ht(this)},qt.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Gt.prototype.info=function(){};var Wt=null;function Kt(){return Wt=Wt||new St}function Qt(t){nt.call(this,"serverreachability",t)}function Zt(t){var e=Kt();e.dispatchEvent(new Qt(e,t))}function Yt(t){nt.call(this,"statevent",t)}function Xt(t){var e=Kt();e.dispatchEvent(new Yt(e,t))}function Jt(t){nt.call(this,"timingevent",t)}function te(t,e){if("function"!=l(t))throw Error("Fn must not be null and must be a function");return u.setTimeout((function(){t()}),e)}b(Qt,nt),b(Yt,nt),b(Jt,nt);var ee={NO_ERROR:0,Za:1,gb:2,fb:3,bb:4,eb:5,hb:6,Da:7,TIMEOUT:8,kb:9},ne={ab:"complete",ob:"success",Ea:"error",Da:"abort",mb:"ready",nb:"readystatechange",TIMEOUT:"timeout",ib:"incrementaldata",lb:"progress",cb:"downloadprogress",pb:"uploadprogress"};function re(){}function ie(){}re.prototype.a=null;var oe,se={OPEN:"a",$a:"b",Ea:"c",jb:"d"};function ae(){nt.call(this,"d")}function ue(){nt.call(this,"c")}function ce(){}function le(t,e,n,r){this.g=t,this.c=e,this.f=n,this.T=r||1,this.J=new qt(this),this.P=he,this.R=new Ut(t=B?125:void 0),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}b(ae,nt),b(ue,nt),b(ce,re),oe=new ce;var he=45e3,fe={},de={};function pe(t,e,n){t.H=1,t.i=Ue(ke(e)),t.j=n,t.I=!0,ge(t,null)}function ge(t,e){t.u=w(),ye(t),t.l=ke(t.i);var n=t.l,r=t.T;Array.isArray(r)||(r=[String(r)]),Qe(n.b,"t",r),t.D=0,t.a=Hn(t.g,t.g.C?e:null),0<t.O&&(t.F=new Ft(m(t.Ca,t,t.a),t.O)),Bt(t.J,t.a,"readystatechange",t.Wa),e=t.B?P(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)),Zt(1),function(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 l=c[0];c=c[1];var h=l.split("_");s=2<=h.length&&"type"==h[1]?s+(l+"=")+c+"&":s+(l+"=redacted&")}}else s=null;else s=o;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+e+"\n"+n+"\n"+s}))}(t.c,t.m,t.l,t.f,t.T,t.j)}function ve(t,e,n){for(var r=!0;!t.A&&t.D<n.length;){var i=me(t,n);if(i==de){4==e&&(t.h=4,Xt(14),r=!1),$t(t.c,t.f,null,"[Incomplete Response]");break}if(i==fe){t.h=4,Xt(15),$t(t.c,t.f,n,"[Invalid Chunk]"),r=!1;break}$t(t.c,t.f,i,null),Se(t,i)}4==e&&0==n.length&&(t.h=1,Xt(16),r=!1),t.b=t.b&&r,r?0<n.length&&!t.W&&(t.W=!0,(e=t.g).a==t&&e.V&&!e.F&&(e.c.info("Great, no buffering proxy detected. Bytes received: "+n.length),Un(e),e.F=!0)):($t(t.c,t.f,n,"[Invalid Chunked Response]"),Ee(t),_e(t))}function me(t,e){var n=t.D,r=e.indexOf("\n",n);return-1==r?de:(n=Number(e.substring(n,r)),isNaN(n)?fe:(r+=1)+n>e.length?de:(e=e.substr(r,n),t.D=r+n,e))}function ye(t){t.U=w()+t.P,we(t,t.P)}function we(t,e){if(null!=t.o)throw Error("WatchDog timer not null");t.o=te(m(t.Ua,t),e)}function be(t){t.o&&(u.clearTimeout(t.o),t.o=null)}function _e(t){0==t.g.v||t.A||jn(t.g,t)}function Ee(t){be(t);var e=t.F;e&&"function"==typeof e.ja&&e.ja(),t.F=null,Mt(t.R),Ht(t.J),t.a&&(e=t.a,t.a=null,e.abort(),e.ja())}function Se(t,e){try{var n=t.g;if(0!=n.v&&(n.a==t||nn(n.b,t)))if(n.I=t.N,!t.C&&nn(n.b,t)&&3==n.v){try{var r=n.ka.a.parse(e)}catch(v){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){t:if(!n.j){if(n.a){if(!(n.a.u+3e3<t.u))break t;Vn(n),Cn(n)}Ln(n),Xt(18)}}else n.oa=i[1],0<n.oa-n.P&&37500>i[2]&&n.H&&0==n.o&&!n.m&&(n.m=te(m(n.Ra,n),6e3));if(1>=en(n.b)&&n.ea){try{n.ea()}catch(v){}n.ea=void 0}}else qn(n,11)}else if((t.C||n.a==t)&&Vn(n),!x(e))for(e=r=n.ka.a.parse(e),r=0;r<e.length;r++)if(n.P=(i=e[r])[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 l=c.a?c.a.getResponseHeader("X-Client-Wire-Protocol"):null;if(l){var h=u.b;!h.a&&(N(l,"spdy")||N(l,"quic")||N(l,"h2"))&&(h.f=h.g,h.a=new Set,h.b&&(rn(h,h.b),h.b=null))}if(u.A){var f=c.a?c.a.getResponseHeader("X-HTTP-Session-Id"):null;f&&(u.na=f,Le(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"));var d=t;if((u=n).la=Bn(u,u.C?u.ga:null,u.fa),d.C){on(u.b,d);var p=d,g=u.D;g&&p.setTimeout(g),p.o&&(be(p),ye(p)),u.a=d}else Pn(u);0<n.g.length&&kn(n)}else"stop"!=i[0]&&"close"!=i[0]||qn(n,7);else 3==n.v&&("stop"==i[0]||"close"==i[0]?"stop"==i[0]?qn(n,7):xn(n):"noop"!=i[0]&&n.f&&n.f.sa(i),n.o=0);Zt(4)}catch(v){}}function Ie(t,e){if(t.forEach&&"function"==typeof t.forEach)t.forEach(e,void 0);else if(h(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(h(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;i=(r=function(t){if(t.K&&"function"==typeof t.K)return t.K();if("string"==typeof t)return t.split("");if(h(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}(t)).length;for(var o=0;o<i;o++)e.call(void 0,r[o],n&&n[o],t)}}function Te(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 Te)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 xe(t){if(t.c!=t.a.length){for(var e=0,n=0;e<t.a.length;){var r=t.a[e];Ce(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;)Ce(i,r=t.a[e])||(t.a[n++]=r,i[r]=1),e++;t.a.length=n}}function Ce(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(o=le.prototype).setTimeout=function(t){this.P=t},o.Wa=function(t){t=t.target;var e=this.F;e&&3==En(t)?e.f():this.Ca(t)},o.Ca=function(t){try{if(t==this.a)t:{var e=En(this.a),n=this.a.ua(),r=this.a.X();if(!(3>e||3==e&&!B&&!this.a.$())){this.A||4!=e||7==n||Zt(8==n||0>=r?3:2),be(this);var i=this.a.X();this.N=i;var o=this.a.$();if(this.b=200==i,function(t,e,n,r,i,o,s){t.info((function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+e+"\n"+n+"\n"+o+" "+s}))}(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)&&!x(s)){var u=s;break e}}u=null}if(!u){this.b=!1,this.h=3,Xt(12),Ee(this),_e(this);break t}$t(this.c,this.f,u,"Initial handshake response via X-HTTP-Initial-Response"),this.C=!0,Se(this,u)}this.I?(ve(this,e,o),B&&this.b&&3==e&&(Bt(this.J,this.R,"tick",this.Va),this.R.start())):($t(this.c,this.f,o,null),Se(this,o)),4==e&&Ee(this),this.b&&!this.A&&(4==e?jn(this.g,this):(this.b=!1,ye(this)))}else 400==i&&0<o.indexOf("Unknown SID")?(this.h=3,Xt(12)):(this.h=0,Xt(13)),Ee(this),_e(this)}}}catch(c){}},o.Va=function(){if(this.a){var t=En(this.a),e=this.a.$();this.D<e.length&&(be(this),ve(this,t,e),this.b&&4!=t&&ye(this))}},o.cancel=function(){this.A=!0,Ee(this)},o.Ua=function(){this.o=null;var t=w();0<=t-this.U?(function(t,e){t.info((function(){return"TIMEOUT: "+e}))}(this.c,this.l),2!=this.H&&(Zt(3),Xt(17)),Ee(this),this.h=2,_e(this)):we(this,this.U-t)},(o=Te.prototype).K=function(){xe(this);for(var t=[],e=0;e<this.a.length;e++)t.push(this.b[this.a[e]]);return t},o.L=function(){return xe(this),this.a.concat()},o.get=function(t,e){return Ce(this.b,t)?this.b[t]:e},o.set=function(t,e){Ce(this.b,t)||(this.c++,this.a.push(t)),this.b[t]=e},o.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 Ae=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^\\/?#]*)@)?([^\\/?#]*?)(?::([0-9]+))?(?=[\\/?#]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;function Ne(t,e){if(this.c=this.j=this.f="",this.h=null,this.i=this.g="",this.a=!1,t instanceof Ne){this.a=void 0!==e?e:t.a,Re(this,t.f),this.j=t.j,De(this,t.c),Oe(this,t.h),this.g=t.g,e=t.b;var n=new Ge;n.c=e.c,e.a&&(n.a=new Te(e.a),n.b=e.b),Pe(this,n),this.i=t.i}else t&&(n=String(t).match(Ae))?(this.a=!!e,Re(this,n[1]||"",!0),this.j=Me(n[2]||""),De(this,n[3]||"",!0),Oe(this,n[4]),this.g=Me(n[5]||"",!0),Pe(this,n[6]||"",!0),this.i=Me(n[7]||"")):(this.a=!!e,this.b=new Ge(null,this.a))}function ke(t){return new Ne(t)}function Re(t,e,n){t.f=n?Me(e,!0):e,t.f&&(t.f=t.f.replace(/:$/,""))}function De(t,e,n){t.c=n?Me(e,!0):e}function Oe(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 Pe(t,e,n){e instanceof Ge?(t.b=e,function(t,e){e&&!t.f&&($e(t),t.c=null,t.a.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(We(this,e),Qe(this,n,t))}),t)),t.f=e}(t.b,t.a)):(n||(e=Ve(e,Be)),t.b=new Ge(e,t.a))}function Le(t,e,n){t.b.set(e,n)}function Ue(t){return Le(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^w()).toString(36)),t}function Me(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function Ve(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,je),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function je(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Ne.prototype.toString=function(){var t=[],e=this.f;e&&t.push(Ve(e,Fe,!0),":");var n=this.c;return(n||"file"==e)&&(t.push("//"),(e=this.j)&&t.push(Ve(e,Fe,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.h)&&t.push(":",String(n))),(n=this.g)&&(this.c&&"/"!=n.charAt(0)&&t.push("/"),t.push(Ve(n,"/"==n.charAt(0)?ze:qe,!0))),(n=this.b.toString())&&t.push("?",n),(n=this.i)&&t.push("#",Ve(n,He)),t.join("")};var Fe=/[#\/\?@]/g,qe=/[#\?:]/g,ze=/[#\?]/g,Be=/[#\?@]/g,He=/#/g;function Ge(t,e){this.b=this.a=null,this.c=t||null,this.f=!!e}function $e(t){t.a||(t.a=new Te,t.b=0,t.c&&function(t,e){if(t){t=t.split("&");for(var n=0;n<t.length;n++){var r=t[n].indexOf("="),i=null;if(0<=r){var o=t[n].substring(0,r);i=t[n].substring(r+1)}else o=t[n];e(o,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(t.c,(function(e,n){t.add(decodeURIComponent(e.replace(/\+/g," ")),n)})))}function We(t,e){$e(t),e=Ze(t,e),Ce(t.a.b,e)&&(t.c=null,t.b-=t.a.get(e).length,Ce((t=t.a).b,e)&&(delete t.b[e],t.c--,t.a.length>2*t.c&&xe(t)))}function Ke(t,e){return $e(t),e=Ze(t,e),Ce(t.a.b,e)}function Qe(t,e,n){We(t,e),0<n.length&&(t.c=null,t.a.set(Ze(t,e),T(n)),t.b+=n.length)}function Ze(t,e){return e=String(e),t.f&&(e=e.toLowerCase()),e}function Ye(t,e){this.b=t,this.a=e}function Xe(t){this.g=t||Je,t=u.PerformanceNavigationTiming?0<(t=u.performance.getEntriesByType("navigation")).length&&("hq"==t[0].nextHopProtocol||"h2"==t[0].nextHopProtocol):!!(u.ia&&u.ia.ya&&u.ia.ya()&&u.ia.ya().qb),this.f=t?this.g:1,this.a=null,1<this.f&&(this.a=new Set),this.b=null,this.c=[]}(o=Ge.prototype).add=function(t,e){$e(this),this.c=null,t=Ze(this,t);var n=this.a.get(t);return n||this.a.set(t,n=[]),n.push(e),this.b+=1,this},o.forEach=function(t,e){$e(this),this.a.forEach((function(n,r){S(n,(function(n){t.call(e,n,r,this)}),this)}),this)},o.L=function(){$e(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},o.K=function(t){$e(this);var e=[];if("string"==typeof t)Ke(this,t)&&(e=I(e,this.a.get(Ze(this,t))));else{t=this.a.K();for(var n=0;n<t.length;n++)e=I(e,t[n])}return e},o.set=function(t,e){return $e(this),this.c=null,Ke(this,t=Ze(this,t))&&(this.b-=this.a.get(t).length),this.a.set(t,[e]),this.b+=1,this},o.get=function(t,e){return t&&0<(t=this.K(t)).length?String(t[0]):e},o.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 Je=10;function tn(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 nn(t,e){return t.b?t.b==e:!!t.a&&t.a.has(e)}function rn(t,e){t.a?t.a.add(e):t.b=e}function on(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 o=i(t.a.values()),s=o.next();!s.done;s=o.next())r=r.concat(s.value.s)}catch(a){e={error:a}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r}return T(t.c)}function an(){}function un(){this.a=new an}function cn(t,e,n){var r=n||"";try{Ie(t,(function(t,n){var i=t;f(t)&&(i=Tt(t)),e.push(r+n+"="+encodeURIComponent(i))}))}catch(i){throw e.push(r+"type="+encodeURIComponent("_badmap")),i}}function ln(t,e,n,r,i){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,i(r)}catch(o){}}Xe.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=i(this.a.values()),r=n.next();!r.done;r=n.next())r.value.cancel()}catch(o){t={error:o}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.a.clear()}},an.prototype.stringify=function(t){return u.JSON.stringify(t,void 0)},an.prototype.parse=function(t){return u.JSON.parse(t,void 0)};var hn=u.JSON.parse;function fn(t){St.call(this),this.headers=new Te,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}b(fn,St);var dn="",pn=/^https?$/i,gn=["POST","PUT"];function vn(t){return"content-type"==t.toLowerCase()}function mn(t,e){t.b=!1,t.a&&(t.g=!0,t.a.abort(),t.g=!1),t.f=e,t.h=5,yn(t),bn(t)}function yn(t){t.u||(t.u=!0,t.dispatchEvent("complete"),t.dispatchEvent("error"))}function wn(t){if(t.b&&void 0!==a&&(!t.s[1]||4!=En(t)||2!=t.X()))if(t.l&&4==En(t))Vt(t.za,0,t);else if(t.dispatchEvent("readystatechange"),4==En(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=!0;break t;default:r=!1}if(!(e=r)){var i;if(i=0===n){var o=String(t.B).match(Ae)[1]||null;if(!o&&u.self&&u.self.location){var s=u.self.location.protocol;o=s.substr(0,s.length-1)}i=!pn.test(o?o.toLowerCase():"")}e=i}if(e)t.dispatchEvent("complete"),t.dispatchEvent("success");else{t.h=6;try{var c=2<En(t)?t.a.statusText:""}catch(l){c=""}t.f=c+" ["+t.X()+"]",yn(t)}}finally{bn(t)}}}function bn(t,e){if(t.a){_n(t);var n=t.a,r=t.s[0]?c:null;t.a=null,t.s=null,e||t.dispatchEvent("ready");try{n.onreadystatechange=r}catch(i){}}}function _n(t){t.a&&t.D&&(t.a.ontimeout=null),t.m&&(u.clearTimeout(t.m),t.m=null)}function En(t){return t.a?t.a.readyState:0}function Sn(t,e,n){t:{for(r in n){var r=!1;break t}r=!0}r||(n=function(t){var e="";return O(t,(function(t,n){e+=n,e+=":",e+=t,e+="\r\n"})),e}(n),"string"==typeof t?null!=n&&encodeURIComponent(String(n)):Le(t,e,n))}function In(t,e,n){return n&&n.internalChannelParams&&n.internalChannelParams[t]||e}function Tn(t){this.pa=0,this.g=[],this.c=new Gt,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=In("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=In("baseRetryDelayMs",5e3,t),this.Ma=In("retryDelaySeedMs",1e4,t),this.Ja=In("forwardChannelMaxRetries",2,t),this.ma=In("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 Xe(t&&t.concurrentRequestLimit),this.ka=new un,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 xn(t){if(An(t),3==t.v){var e=t.R++,n=ke(t.B);Le(n,"SID",t.J),Le(n,"RID",e),Le(n,"TYPE","terminate"),Dn(t,n),(e=new le(t,t.c,e,void 0)).H=2,e.i=Ue(ke(n)),n=!1,u.navigator&&u.navigator.sendBeacon&&(n=u.navigator.sendBeacon(e.i.toString(),"")),!n&&u.Image&&((new Image).src=e.i,n=!0),n||(e.a=Hn(e.g,null),e.a.ba(e.i)),e.u=w(),ye(e)}zn(t)}function Cn(t){t.a&&(Un(t),t.a.cancel(),t.a=null)}function An(t){Cn(t),t.j&&(u.clearTimeout(t.j),t.j=null),Vn(t),t.b.cancel(),t.h&&("number"==typeof t.h&&u.clearTimeout(t.h),t.h=null)}function Nn(t,e){t.g.push(new Ye(t.La++,e)),3==t.v&&kn(t)}function kn(t){tn(t.b)||t.h||(t.h=!0,Dt(t.Ba,t),t.u=0)}function Rn(t,e){var n;n=e?e.f:t.R++;var r=ke(t.B);Le(r,"SID",t.J),Le(r,"RID",n),Le(r,"AID",t.P),Dn(t,r),t.i&&t.l&&Sn(r,t.i,t.l),n=new le(t,t.c,n,t.u+1),null===t.i&&(n.B=t.l),e&&(t.g=e.s.concat(t.g)),e=On(t,n,1e3),n.setTimeout(Math.round(.5*t.ma)+Math.round(.5*t.ma*Math.random())),rn(t.b,n),pe(n,r,e)}function Dn(t,e){t.f&&Ie({},(function(t,n){Le(e,n,t)}))}function On(t,e,n){n=Math.min(t.g.length,n);var r=t.f?m(t.f.Ha,t.f,t):null;t:for(var i=t.g,o=-1;;){var s=["count="+n];-1==o?0<n?s.push("ofs="+(o=i[0].b)):o=0:s.push("ofs="+o);for(var a=!0,u=0;u<n;u++){var c=i[u].b,l=i[u].a;if(0>(c-=o))o=Math.max(0,i[u].b-100),a=!1;else try{cn(l,s,"req"+c+"_")}catch(h){r&&r(l)}}if(a){r=s.join("&");break t}}return t=t.g.splice(0,n),e.s=t,r}function Pn(t){t.a||t.j||(t.U=1,Dt(t.Aa,t),t.o=0)}function Ln(t){return!(t.a||t.j||3<=t.o||(t.U++,t.j=te(m(t.Aa,t),Fn(t,t.o)),t.o++,0))}function Un(t){null!=t.s&&(u.clearTimeout(t.s),t.s=null)}function Mn(t){t.a=new le(t,t.c,"rpc",t.U),null===t.i&&(t.a.B=t.l),t.a.O=0;var e=ke(t.la);Le(e,"RID","rpc"),Le(e,"SID",t.J),Le(e,"CI",t.H?"0":"1"),Le(e,"AID",t.P),Dn(t,e),Le(e,"TYPE","xmlhttp"),t.i&&t.l&&Sn(e,t.i,t.l),t.D&&t.a.setTimeout(t.D);var n=t.a;t=t.ga,n.H=1,n.i=Ue(ke(e)),n.j=null,n.I=!0,ge(n,t)}function Vn(t){null!=t.m&&(u.clearTimeout(t.m),t.m=null)}function jn(t,e){var n=null;if(t.a==e){Vn(t),Un(t),t.a=null;var r=2}else{if(!nn(t.b,e))return;n=e.s,on(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=Kt()).dispatchEvent(new Jt(r,n,e,i)),kn(t)}else Pn(t);else if(3==(i=e.h)||0==i&&0<t.I||!(1==r&&function(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=te(m(t.Ba,t,e),Fn(t,t.u)),t.u++,0)))}(t,e)||2==r&&Ln(t)))switch(n&&0<n.length&&(e=t.b,e.c=e.c.concat(n)),i){case 1:qn(t,5);break;case 4:qn(t,10);break;case 3:qn(t,6);break;default:qn(t,2)}}function Fn(t,e){var n=t.Fa+Math.floor(Math.random()*t.Ma);return t.f||(n*=2),n*e}function qn(t,e){if(t.c.info("Error code "+e),2==e){var n=null;t.f&&(n=null);var r=m(t.Xa,t);n||(n=new Ne("//www.google.com/images/cleardot.gif"),u.location&&"http"==u.location.protocol||Re(n,"https"),Ue(n)),function(t,e){var n=new Gt;if(u.Image){var r=new Image;r.onload=y(ln,n,r,"TestLoadImage: loaded",!0,e),r.onerror=y(ln,n,r,"TestLoadImage: error",!1,e),r.onabort=y(ln,n,r,"TestLoadImage: abort",!1,e),r.ontimeout=y(ln,n,r,"TestLoadImage: timeout",!1,e),u.setTimeout((function(){r.ontimeout&&r.ontimeout()}),1e4),r.src=t}else e(!1)}(n.toString(),r)}else Xt(2);t.v=0,t.f&&t.f.ra(e),zn(t),An(t)}function zn(t){t.v=0,t.I=-1,t.f&&(0==sn(t.b).length&&0==t.g.length||(t.b.c.length=0,T(t.g),t.g.length=0),t.f.qa())}function Bn(t,e,n){var r=function(t){return t instanceof Ne?ke(t):new Ne(t,void 0)}(n);if(""!=r.c)e&&De(r,e+"."+r.c),Oe(r,r.h);else{var i=u.location;r=function(t,e,n,r){var i=new Ne(null,void 0);return t&&Re(i,t),e&&De(i,e),n&&Oe(i,n),r&&(i.g=r),i}(i.protocol,e?e+"."+i.hostname:i.hostname,+i.port,n)}return t.W&&O(t.W,(function(t,e){Le(r,e,t)})),n=t.na,(e=t.A)&&n&&Le(r,e,n),Le(r,"VER",t.ha),Dn(t,r),r}function Hn(t,e){if(e&&!t.C)throw Error("Can't create secondary domain capable XhrIo object.");return(e=new fn(t.Ka)).F=t.C,e}function Gn(){}function $n(){if(q&&!(10<=Number(X)))throw Error("Environmental error: no available transport.")}function Wn(t,e){St.call(this),this.a=new Tn(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)&&!x(t)&&(this.a.i=t),this.h=e&&e.supportsCrossDomainXhr||!1,this.g=e&&e.sendRawJson||!1,(e=e&&e.httpSessionIdParam)&&!x(e)&&(this.a.A=e,null!==(t=this.b)&&e in t&&e in(t=this.b)&&delete t[e]),this.f=new Zn(this)}function Kn(t){ae.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 Qn(){ue.call(this),this.status=1}function Zn(t){this.a=t}(o=fn.prototype).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=function(t){var e;return(e=t.a)||(e=t.a={}),e}(this.H?this.H:oe),this.a.onreadystatechange=m(this.za,this);try{this.A=!0,this.a.open(e,String(t),!0),this.A=!1}catch(o){return void mn(this,o)}t=n||"";var i=new Te(this.headers);r&&Ie(r,(function(t,e){i.set(e,t)})),r=function(t){t:{for(var e=vn,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]}(i.L()),n=u.FormData&&t instanceof u.FormData,!(0<=E(gn,e))||r||n||i.set("Content-Type","application/x-www-form-urlencoded;charset=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{_n(this),0<this.o&&((this.D=function(t){return q&&Y(9)&&"number"==typeof t.timeout&&void 0!==t.ontimeout}(this.a))?(this.a.timeout=this.o,this.a.ontimeout=m(this.xa,this)):this.m=Vt(this.xa,this.o,this)),this.l=!0,this.a.send(t),this.l=!1}catch(o){mn(this,o)}},o.xa=function(){void 0!==a&&this.a&&(this.f="Timed out after "+this.o+"ms, aborting",this.h=8,this.dispatchEvent("timeout"),this.abort(8))},o.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))},o.G=function(){this.a&&(this.b&&(this.b=!1,this.g=!0,this.a.abort(),this.g=!1),bn(this,!0)),fn.S.G.call(this)},o.za=function(){this.j||(this.A||this.l||this.g?wn(this):this.Ta())},o.Ta=function(){wn(this)},o.X=function(){try{return 2<En(this)?this.a.status:-1}catch(j){return-1}},o.$=function(){try{return this.a?this.a.responseText:""}catch(j){return""}},o.Na=function(t){if(this.a){var e=this.a.responseText;return t&&0==e.indexOf(t)&&(e=e.substring(t.length)),hn(e)}},o.ua=function(){return this.h},o.Qa=function(){return"string"==typeof this.f?this.f:String(this.f)},(o=Tn.prototype).ha=8,o.v=1,o.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 le(this,this.c,t,void 0),r=this.l;if(this.O&&(r?U(r=P(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(void 0===(o="__data__"in o.a&&"string"==typeof(o=o.a.__data__)?o.length:void 0))break;if(4096<(e+=o)){e=i;break t}if(4096===e||i===this.g.length-1){e=i+1;break t}}e=1e3}else e=1e3;e=On(this,n,e),Le(i=ke(this.B),"RID",t),Le(i,"CVER",22),this.A&&Le(i,"X-HTTP-Session-Id",this.A),Dn(this,i),this.i&&r&&Sn(i,this.i,r),rn(this.b,n),this.Ga&&Le(i,"TYPE","init"),this.da?(Le(i,"$req",e),Le(i,"SID","null"),n.V=!0,pe(n,i,null)):pe(n,i,e),this.v=2}}else 3==this.v&&(t?Rn(this,t):0==this.g.length||tn(this.b)||Rn(this))},o.Aa=function(){if(this.j=null,Mn(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=te(m(this.Sa,this),t)}},o.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,Cn(this),Mn(this))},o.Ra=function(){null!=this.m&&(this.m=null,Cn(this),Ln(this),Xt(19))},o.Xa=function(t){t?(this.c.info("Successfully pinged google.com"),Xt(2)):(this.c.info("Failed to ping google.com"),Xt(1))},(o=Gn.prototype).ta=function(){},o.sa=function(){},o.ra=function(){},o.qa=function(){},o.Ha=function(){},$n.prototype.a=function(t,e){return new Wn(t,e)},b(Wn,St),(o=Wn.prototype).addEventListener=function(t,e,n,r){Wn.S.addEventListener.call(this,t,e,n,r)},o.removeEventListener=function(t,e,n,r){Wn.S.removeEventListener.call(this,t,e,n,r)},o.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;Xt(0),t.fa=e,t.W=n||{},t.H=t.T,t.B=Bn(t,null,t.fa),kn(t)},o.close=function(){xn(this.a)},o.Pa=function(t){if("string"==typeof t){var e={};e.__data__=t,Nn(this.a,e)}else this.g?((e={}).__data__=Tt(t),Nn(this.a,e)):Nn(this.a,t)},o.G=function(){this.a.f=null,delete this.f,xn(this.a),delete this.a,Wn.S.G.call(this)},b(Kn,ae),b(Qn,ue),b(Zn,Gn),Zn.prototype.ta=function(){this.a.dispatchEvent("a")},Zn.prototype.sa=function(t){this.a.dispatchEvent(new Kn(t))},Zn.prototype.ra=function(t){this.a.dispatchEvent(new Qn(t))},Zn.prototype.qa=function(){this.a.dispatchEvent("b")},$n.prototype.createWebChannel=$n.prototype.a,Wn.prototype.send=Wn.prototype.Pa,Wn.prototype.open=Wn.prototype.Oa,Wn.prototype.close=Wn.prototype.close,ee.NO_ERROR=0,ee.TIMEOUT=8,ee.HTTP_ERROR=6,ne.COMPLETE="complete",ie.EventType=se,se.OPEN="a",se.CLOSE="b",se.ERROR="c",se.MESSAGE="d",St.prototype.listen=St.prototype.va,fn.prototype.listenOnce=fn.prototype.wa,fn.prototype.getLastError=fn.prototype.Qa,fn.prototype.getLastErrorCode=fn.prototype.ua,fn.prototype.getStatus=fn.prototype.X,fn.prototype.getResponseJson=fn.prototype.Na,fn.prototype.getResponseText=fn.prototype.$,fn.prototype.send=fn.prototype.ba;var Yn=function(){return new $n},Xn=ee,Jn=ne,tr=ie,er=fn;e.default={createWebChannelTransport:Yn,ErrorCode:Xn,EventType:Jn,WebChannel:tr,XhrIo:er}},zUnb:function(t,e,n){"use strict";function r(t){return"function"==typeof t}n.r(e);let i=!1;const o={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){const t=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+t.stack)}else i&&console.log("RxJS: Back to a better error behavior. Thank you. <3");i=t},get useDeprecatedSynchronousErrorHandling(){return i}};function s(t){setTimeout(()=>{throw t})}const a={closed:!0,next(t){},error(t){if(o.useDeprecatedSynchronousErrorHandling)throw t;s(t)},complete(){}},u=Array.isArray||(t=>t&&"number"==typeof t.length);function c(t){return null!==t&&"object"==typeof t}function l(t){return Error.call(this),this.message=t?`${t.length} errors occurred during unsubscription:\n${t.map((t,e)=>`${e+1}) ${t.toString()}`).join("\n  ")}`:"",this.name="UnsubscriptionError",this.errors=t,this}l.prototype=Object.create(Error.prototype);const h=l;let f=(()=>{class t{constructor(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}unsubscribe(){let t,e=!1;if(this.closed)return;let{_parent:n,_parents:i,_unsubscribe:o,_subscriptions:s}=this;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;let a=-1,l=i?i.length:0;for(;n;)n.remove(this),n=++a<l&&i[a]||null;if(r(o))try{o.call(this)}catch(f){e=!0,t=f instanceof h?d(f.errors):[f]}if(u(s))for(a=-1,l=s.length;++a<l;){const n=s[a];if(c(n))try{n.unsubscribe()}catch(f){e=!0,t=t||[],f instanceof h?t=t.concat(d(f.errors)):t.push(f)}}if(e)throw new h(t)}add(e){let n=e;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){const e=n;n=new t,n._subscriptions=[e]}break;default:if(!e)return t.EMPTY;throw new Error("unrecognized teardown "+e+" added to Subscription.")}if(n._addParent(this)){const t=this._subscriptions;t?t.push(n):this._subscriptions=[n]}return n}remove(t){const e=this._subscriptions;if(e){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}}_addParent(t){let{_parent:e,_parents:n}=this;return e!==t&&(e?n?-1===n.indexOf(t)&&(n.push(t),!0):(this._parents=[t],!0):(this._parent=t,!0))}}return t.EMPTY=function(t){return t.closed=!0,t}(new t),t})();function d(t){return t.reduce((t,e)=>t.concat(e instanceof h?e.errors:e),[])}const p="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random();class g extends f{constructor(t,e,n){switch(super(),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=a;break;case 1:if(!t){this.destination=a;break}if("object"==typeof t){t instanceof g?(this.syncErrorThrowable=t.syncErrorThrowable,this.destination=t,t.add(this)):(this.syncErrorThrowable=!0,this.destination=new v(this,t));break}default:this.syncErrorThrowable=!0,this.destination=new v(this,t,e,n)}}[p](){return this}static create(t,e,n){const r=new g(t,e,n);return r.syncErrorThrowable=!1,r}next(t){this.isStopped||this._next(t)}error(t){this.isStopped||(this.isStopped=!0,this._error(t))}complete(){this.isStopped||(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe())}_next(t){this.destination.next(t)}_error(t){this.destination.error(t),this.unsubscribe()}_complete(){this.destination.complete(),this.unsubscribe()}_unsubscribeAndRecycle(){const{_parent:t,_parents:e}=this;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=e,this}}class v extends g{constructor(t,e,n,i){let o;super(),this._parentSubscriber=t;let s=this;r(e)?o=e:e&&(o=e.next,n=e.error,i=e.complete,e!==a&&(s=Object.create(e),r(s.unsubscribe)&&this.add(s.unsubscribe.bind(s)),s.unsubscribe=this.unsubscribe.bind(this))),this._context=s,this._next=o,this._error=n,this._complete=i}next(t){if(!this.isStopped&&this._next){const{_parentSubscriber:e}=this;o.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}}error(t){if(!this.isStopped){const{_parentSubscriber:e}=this,{useDeprecatedSynchronousErrorHandling:n}=o;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):s(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;s(t)}}}complete(){if(!this.isStopped){const{_parentSubscriber:t}=this;if(this._complete){const e=()=>this._complete.call(this._context);o.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,e),this.unsubscribe()):(this.__tryOrUnsub(e),this.unsubscribe())}else this.unsubscribe()}}__tryOrUnsub(t,e){try{t.call(this._context,e)}catch(n){if(this.unsubscribe(),o.useDeprecatedSynchronousErrorHandling)throw n;s(n)}}__tryOrSetError(t,e,n){if(!o.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(r){return o.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=r,t.syncErrorThrown=!0,!0):(s(r),!0)}return!1}_unsubscribe(){const{_parentSubscriber:t}=this;this._context=null,this._parentSubscriber=null,t.unsubscribe()}}const m="function"==typeof Symbol&&Symbol.observable||"@@observable";function y(){}function w(...t){return b(t)}function b(t){return t?1===t.length?t[0]:function(e){return t.reduce((t,e)=>e(t),e)}:y}let _=(()=>{class t{constructor(t){this._isScalar=!1,t&&(this._subscribe=t)}lift(e){const n=new t;return n.source=this,n.operator=e,n}subscribe(t,e,n){const{operator:r}=this,i=function(t,e,n){if(t){if(t instanceof g)return t;if(t[p])return t[p]()}return t||e||n?new g(t,e,n):new g(a)}(t,e,n);if(i.add(r?r.call(i,this.source):this.source||o.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),o.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i}_trySubscribe(t){try{return this._subscribe(t)}catch(e){o.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){const{closed:e,destination:n,isStopped:r}=t;if(e||r)return!1;t=n&&n instanceof g?n:null}return!0}(t)?t.error(e):console.warn(e)}}forEach(t,e){return new(e=E(e))((e,n)=>{let r;r=this.subscribe(e=>{try{t(e)}catch(i){n(i),r&&r.unsubscribe()}},n,e)})}_subscribe(t){const{source:e}=this;return e&&e.subscribe(t)}[m](){return this}pipe(...t){return 0===t.length?this:b(t)(this)}toPromise(t){return new(t=E(t))((t,e)=>{let n;this.subscribe(t=>n=t,t=>e(t),()=>t(n))})}}return t.create=e=>new t(e),t})();function E(t){if(t||(t=o.Promise||Promise),!t)throw new Error("no Promise impl found");return t}function S(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}S.prototype=Object.create(Error.prototype);const I=S;class T extends f{constructor(t,e){super(),this.subject=t,this.subscriber=e,this.closed=!1}unsubscribe(){if(this.closed)return;this.closed=!0;const t=this.subject,e=t.observers;if(this.subject=null,!e||0===e.length||t.isStopped||t.closed)return;const n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}class x extends g{constructor(t){super(t),this.destination=t}}let C=(()=>{class t extends _{constructor(){super(),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}[p](){return new x(this)}lift(t){const e=new A(this,this);return e.operator=t,e}next(t){if(this.closed)throw new I;if(!this.isStopped){const{observers:e}=this,n=e.length,r=e.slice();for(let i=0;i<n;i++)r[i].next(t)}}error(t){if(this.closed)throw new I;this.hasError=!0,this.thrownError=t,this.isStopped=!0;const{observers:e}=this,n=e.length,r=e.slice();for(let i=0;i<n;i++)r[i].error(t);this.observers.length=0}complete(){if(this.closed)throw new I;this.isStopped=!0;const{observers:t}=this,e=t.length,n=t.slice();for(let r=0;r<e;r++)n[r].complete();this.observers.length=0}unsubscribe(){this.isStopped=!0,this.closed=!0,this.observers=null}_trySubscribe(t){if(this.closed)throw new I;return super._trySubscribe(t)}_subscribe(t){if(this.closed)throw new I;return this.hasError?(t.error(this.thrownError),f.EMPTY):this.isStopped?(t.complete(),f.EMPTY):(this.observers.push(t),new T(this,t))}asObservable(){const t=new _;return t.source=this,t}}return t.create=(t,e)=>new A(t,e),t})();class A extends C{constructor(t,e){super(),this.destination=t,this.source=e}next(t){const{destination:e}=this;e&&e.next&&e.next(t)}error(t){const{destination:e}=this;e&&e.error&&this.destination.error(t)}complete(){const{destination:t}=this;t&&t.complete&&this.destination.complete()}_subscribe(t){const{source:e}=this;return e?this.source.subscribe(t):f.EMPTY}}function N(t){return t&&"function"==typeof t.schedule}class k extends g{constructor(t,e,n){super(),this.parent=t,this.outerValue=e,this.outerIndex=n,this.index=0}_next(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)}_error(t){this.parent.notifyError(t,this),this.unsubscribe()}_complete(){this.parent.notifyComplete(this),this.unsubscribe()}}const R=t=>e=>{for(let n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.closed||e.complete()},D=t=>e=>(t.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,s),e);function O(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}const P=O(),L=t=>e=>{const n=t[P]();for(;;){const t=n.next();if(t.done){e.complete();break}if(e.next(t.value),e.closed)break}return"function"==typeof n.return&&e.add(()=>{n.return&&n.return()}),e},U=t=>e=>{const n=t[m]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(e)},M=t=>t&&"number"==typeof t.length&&"function"!=typeof t;function V(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}const j=t=>{if(t instanceof _)return e=>t._isScalar?(e.next(t.value),void e.complete()):t.subscribe(e);if(t&&"function"==typeof t[m])return U(t);if(M(t))return R(t);if(V(t))return D(t);if(t&&"function"==typeof t[P])return L(t);{const e=c(t)?"an invalid object":`'${t}'`;throw new TypeError(`You provided ${e} where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.`)}};function F(t,e,n,r,i=new k(t,n,r)){if(!i.closed)return j(e)(i)}class q extends g{notifyNext(t,e,n,r,i){this.destination.next(e)}notifyError(t,e){this.destination.error(t)}notifyComplete(t){this.destination.complete()}}function z(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new B(t,e))}}class B{constructor(t,e){this.project=t,this.thisArg=e}call(t,e){return e.subscribe(new H(t,this.project,this.thisArg))}}class H extends g{constructor(t,e,n){super(t),this.project=e,this.count=0,this.thisArg=n||this}_next(t){let e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}function G(t,e){return new _(e?n=>{const r=new f;let i=0;return r.add(e.schedule((function(){i!==t.length?(n.next(t[i++]),n.closed||r.add(this.schedule())):n.complete()}))),r}:R(t))}function $(t,e){if(!e)return t instanceof _?t:new _(j(t));if(null!=t){if(function(t){return t&&"function"==typeof t[m]}(t))return function(t,e){return new _(e?n=>{const r=new f;return r.add(e.schedule(()=>{const i=t[m]();r.add(i.subscribe({next(t){r.add(e.schedule(()=>n.next(t)))},error(t){r.add(e.schedule(()=>n.error(t)))},complete(){r.add(e.schedule(()=>n.complete()))}}))})),r}:U(t))}(t,e);if(V(t))return function(t,e){return new _(e?n=>{const r=new f;return r.add(e.schedule(()=>t.then(t=>{r.add(e.schedule(()=>{n.next(t),r.add(e.schedule(()=>n.complete()))}))},t=>{r.add(e.schedule(()=>n.error(t)))}))),r}:D(t))}(t,e);if(M(t))return G(t,e);if(function(t){return t&&"function"==typeof t[P]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new _(e?n=>{const r=new f;let i;return r.add(()=>{i&&"function"==typeof i.return&&i.return()}),r.add(e.schedule(()=>{i=t[P](),r.add(e.schedule((function(){if(n.closed)return;let t,e;try{const n=i.next();t=n.value,e=n.done}catch(r){return void n.error(r)}e?n.complete():(n.next(t),this.schedule())})))})),r}:L(t))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}function W(t,e,n=Number.POSITIVE_INFINITY){return"function"==typeof e?r=>r.pipe(W((n,r)=>$(t(n,r)).pipe(z((t,i)=>e(n,t,r,i))),n)):("number"==typeof e&&(n=e),e=>e.lift(new K(t,n)))}class K{constructor(t,e=Number.POSITIVE_INFINITY){this.project=t,this.concurrent=e}call(t,e){return e.subscribe(new Q(t,this.project,this.concurrent))}}class Q extends q{constructor(t,e,n=Number.POSITIVE_INFINITY){super(t),this.project=e,this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}_next(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)}_tryNext(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(r){return void this.destination.error(r)}this.active++,this._innerSub(e,t,n)}_innerSub(t,e,n){const r=new k(this,void 0,void 0);this.destination.add(r),F(this,t,e,n,r)}_complete(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()}notifyNext(t,e,n,r,i){this.destination.next(e)}notifyComplete(t){const e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()}}function Z(t){return t}function Y(t=Number.POSITIVE_INFINITY){return W(Z,t)}function X(){return function(t){return t.lift(new J(t))}}class J{constructor(t){this.connectable=t}call(t,e){const{connectable:n}=this;n._refCount++;const r=new tt(t,n),i=e.subscribe(r);return r.closed||(r.connection=n.connect()),i}}class tt extends g{constructor(t,e){super(t),this.connectable=e}_unsubscribe(){const{connectable:t}=this;if(!t)return void(this.connection=null);this.connectable=null;const e=t._refCount;if(e<=0)return void(this.connection=null);if(t._refCount=e-1,e>1)return void(this.connection=null);const{connection:n}=this,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}const et=class extends _{constructor(t,e){super(),this.source=t,this.subjectFactory=e,this._refCount=0,this._isComplete=!1}_subscribe(t){return this.getSubject().subscribe(t)}getSubject(){const t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject}connect(){let t=this._connection;return t||(this._isComplete=!1,t=this._connection=new f,t.add(this.source.subscribe(new rt(this.getSubject(),this))),t.closed?(this._connection=null,t=f.EMPTY):this._connection=t),t}refCount(){return X()(this)}}.prototype,nt={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:et._subscribe},_isComplete:{value:et._isComplete,writable:!0},getSubject:{value:et.getSubject},connect:{value:et.connect},refCount:{value:et.refCount}};class rt extends x{constructor(t,e){super(t),this.connectable=e}_error(t){this._unsubscribe(),super._error(t)}_complete(){this.connectable._isComplete=!0,this._unsubscribe(),super._complete()}_unsubscribe(){const t=this.connectable;if(t){this.connectable=null;const e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}}}function it(){return new C}function ot(t,e,n){const r=function(t){return function(...e){if(t){const n=t(...e);for(const t in n)this[t]=n[t]}}}(e);function i(...t){if(this instanceof i)return r.apply(this,t),this;const e=new i(...t);return n.annotation=e,n;function n(t,n,r){const i=t.hasOwnProperty("__parameters__")?t.__parameters__:Object.defineProperty(t,"__parameters__",{value:[]}).__parameters__;for(;i.length<=r;)i.push(null);return(i[r]=i[r]||[]).push(e),t}}return n&&(i.prototype=Object.create(n.prototype)),i.prototype.ngMetadataName=t,i.annotationCls=i,i}const st=ot("Inject",t=>({token:t})),at=ot("Optional"),ut=ot("Self"),ct=ot("SkipSelf");var lt=function(t){return t[t.Default=0]="Default",t[t.Host=1]="Host",t[t.Self=2]="Self",t[t.SkipSelf=4]="SkipSelf",t[t.Optional=8]="Optional",t}({});function ht(t){for(let e in t)if(t[e]===ht)return e;throw Error("Could not find renamed property on target object.")}function ft(t){return{token:t.token,providedIn:t.providedIn||null,factory:t.factory,value:void 0}}function dt(t){const e=t[pt];return e&&e.token===t?e:null}const pt=ht({ngInjectableDef:ht});function gt(t){if("string"==typeof t)return t;if(t instanceof Array)return"["+t.map(gt).join(", ")+"]";if(null==t)return""+t;if(t.overriddenName)return""+t.overriddenName;if(t.name)return""+t.name;const e=t.toString();if(null==e)return""+e;const n=e.indexOf("\n");return-1===n?e:e.substring(0,n)}const vt=ht({__forward_ref__:ht});function mt(t){return t.__forward_ref__=mt,t.toString=function(){return gt(this())},t}function yt(t){const e=t;return"function"==typeof e&&e.hasOwnProperty(vt)&&e.__forward_ref__===mt?e():t}const wt="undefined"!=typeof globalThis&&globalThis,bt="undefined"!=typeof window&&window,_t="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Et="undefined"!=typeof global&&global,St=wt||Et||bt||_t;class It{constructor(t,e){this._desc=t,this.ngMetadataName="InjectionToken",this.ngInjectableDef=void 0,"number"==typeof e?this.__NG_ELEMENT_ID__=e:void 0!==e&&(this.ngInjectableDef=ft({token:this,providedIn:e.providedIn||"root",factory:e.factory}))}toString(){return"InjectionToken "+this._desc}}const Tt=new It("INJECTOR",-1),xt=new Object,Ct=/\n/gm,At=ht({provide:String,useValue:ht});let Nt=void 0;function kt(t){const e=Nt;return Nt=t,e}function Rt(t,e=lt.Default){return function(t,e=lt.Default){if(void 0===Nt)throw new Error("inject() must be called from an injection context");return null===Nt?function(t,e,n){const r=dt(t);if(r&&"root"==r.providedIn)return void 0===r.value?r.value=r.factory():r.value;if(n&lt.Optional)return null;throw new Error(`Injector: NOT_FOUND [${gt(t)}]`)}(t,0,e):Nt.get(t,e&lt.Optional?null:void 0,e)}(t,e)}class Dt{get(t,e=xt){if(e===xt){const e=new Error(`NullInjectorError: No provider for ${gt(t)}!`);throw e.name="NullInjectorError",e}return e}}function Ot(t,e,n,r=null){t=t&&"\n"===t.charAt(0)&&"\u0275"==t.charAt(1)?t.substr(2):t;let i=gt(e);if(e instanceof Array)i=e.map(gt).join(" -> ");else if("object"==typeof e){let t=[];for(let n in e)if(e.hasOwnProperty(n)){let r=e[n];t.push(n+":"+("string"==typeof r?JSON.stringify(r):gt(r)))}i=`{${t.join(", ")}}`}return`${n}${r?"("+r+")":""}[${i}]: ${t.replace(Ct,"\n  ")}`}class Pt{}class Lt{}function Ut(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function Mt(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}const Vt=function(){var t={Emulated:0,Native:1,None:2,ShadowDom:3};return t[t.Emulated]="Emulated",t[t.Native]="Native",t[t.None]="None",t[t.ShadowDom]="ShadowDom",t}(),jt=(()=>("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(St))();function Ft(t){return t.ngDebugContext}function qt(t){return t.ngOriginalError}function zt(t,...e){t.error(...e)}class Bt{constructor(){this._console=console}handleError(t){const e=this._findOriginalError(t),n=this._findContext(t),r=function(t){return t.ngErrorLogger||zt}(t);r(this._console,"ERROR",t),e&&r(this._console,"ORIGINAL ERROR",e),n&&r(this._console,"ERROR CONTEXT",n)}_findContext(t){return t?Ft(t)?Ft(t):this._findContext(qt(t)):null}_findOriginalError(t){let e=qt(t);for(;e&&qt(e);)e=qt(e);return e}}let Ht=!0,Gt=!1;function $t(){return Gt=!0,Ht}class Wt{constructor(t){if(this.defaultDoc=t,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert"),this.inertBodyElement=this.inertDocument.body,null==this.inertBodyElement){const t=this.inertDocument.createElement("html");this.inertDocument.appendChild(t),this.inertBodyElement=this.inertDocument.createElement("body"),t.appendChild(this.inertBodyElement)}this.inertBodyElement.innerHTML='<svg><g onload="this.parentNode.remove()"></g></svg>',!this.inertBodyElement.querySelector||this.inertBodyElement.querySelector("svg")?(this.inertBodyElement.innerHTML='<svg><p><style><img src="</style><img src=x onerror=alert(1)//">',this.getInertBodyElement=this.inertBodyElement.querySelector&&this.inertBodyElement.querySelector("svg img")&&function(){try{return!!window.DOMParser}catch(t){return!1}}()?this.getInertBodyElement_DOMParser:this.getInertBodyElement_InertDocument):this.getInertBodyElement=this.getInertBodyElement_XHR}getInertBodyElement_XHR(t){t="<body><remove></remove>"+t+"</body>";try{t=encodeURI(t)}catch(r){return null}const e=new XMLHttpRequest;e.responseType="document",e.open("GET","data:text/html;charset=utf-8,"+t,!1),e.send(void 0);const n=e.response.body;return n.removeChild(n.firstChild),n}getInertBodyElement_DOMParser(t){t="<body><remove></remove>"+t+"</body>";try{const e=(new window.DOMParser).parseFromString(t,"text/html").body;return e.removeChild(e.firstChild),e}catch(e){return null}}getInertBodyElement_InertDocument(t){const e=this.inertDocument.createElement("template");return"content"in e?(e.innerHTML=t,e):(this.inertBodyElement.innerHTML=t,this.defaultDoc.documentMode&&this.stripCustomNsAttrs(this.inertBodyElement),this.inertBodyElement)}stripCustomNsAttrs(t){const e=t.attributes;for(let r=e.length-1;0<r;r--){const n=e.item(r).name;"xmlns:ns1"!==n&&0!==n.indexOf("ns1:")||t.removeAttribute(n)}let n=t.firstChild;for(;n;)n.nodeType===Node.ELEMENT_NODE&&this.stripCustomNsAttrs(n),n=n.nextSibling}}const Kt=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,Qt=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i;function Zt(t){return(t=String(t)).match(Kt)||t.match(Qt)?t:($t()&&console.warn(`WARNING: sanitizing unsafe URL value ${t} (see http://g.co/ng/security#xss)`),"unsafe:"+t)}function Yt(t){const e={};for(const n of t.split(","))e[n]=!0;return e}function Xt(...t){const e={};for(const n of t)for(const t in n)n.hasOwnProperty(t)&&(e[t]=!0);return e}const Jt=Yt("area,br,col,hr,img,wbr"),te=Yt("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),ee=Yt("rp,rt"),ne=Xt(ee,te),re=Xt(Jt,Xt(te,Yt("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Xt(ee,Yt("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),ne),ie=Yt("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),oe=Yt("srcset"),se=Xt(ie,oe,Yt("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),Yt("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext")),ae=Yt("script,style,template");class ue{constructor(){this.sanitizedSomething=!1,this.buf=[]}sanitizeChildren(t){let e=t.firstChild,n=!0;for(;e;)if(e.nodeType===Node.ELEMENT_NODE?n=this.startElement(e):e.nodeType===Node.TEXT_NODE?this.chars(e.nodeValue):this.sanitizedSomething=!0,n&&e.firstChild)e=e.firstChild;else for(;e;){e.nodeType===Node.ELEMENT_NODE&&this.endElement(e);let t=this.checkClobberedElement(e,e.nextSibling);if(t){e=t;break}e=this.checkClobberedElement(e,e.parentNode)}return this.buf.join("")}startElement(t){const e=t.nodeName.toLowerCase();if(!re.hasOwnProperty(e))return this.sanitizedSomething=!0,!ae.hasOwnProperty(e);this.buf.push("<"),this.buf.push(e);const n=t.attributes;for(let i=0;i<n.length;i++){const t=n.item(i),e=t.name,o=e.toLowerCase();if(!se.hasOwnProperty(o)){this.sanitizedSomething=!0;continue}let s=t.value;ie[o]&&(s=Zt(s)),oe[o]&&(r=s,s=(r=String(r)).split(",").map(t=>Zt(t.trim())).join(", ")),this.buf.push(" ",e,'="',he(s),'"')}var r;return this.buf.push(">"),!0}endElement(t){const e=t.nodeName.toLowerCase();re.hasOwnProperty(e)&&!Jt.hasOwnProperty(e)&&(this.buf.push("</"),this.buf.push(e),this.buf.push(">"))}chars(t){this.buf.push(he(t))}checkClobberedElement(t,e){if(e&&(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error("Failed to sanitize html because the element is clobbered: "+t.outerHTML);return e}}const ce=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,le=/([^\#-~ |!])/g;function he(t){return t.replace(/&/g,"&amp;").replace(ce,(function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"})).replace(le,(function(t){return"&#"+t.charCodeAt(0)+";"})).replace(/</g,"&lt;").replace(/>/g,"&gt;")}let fe;function de(t){return"content"in t&&function(t){return t.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===t.nodeName}(t)?t.content:null}const pe=function(){var t={NONE:0,HTML:1,STYLE:2,SCRIPT:3,URL:4,RESOURCE_URL:5};return t[t.NONE]="NONE",t[t.HTML]="HTML",t[t.STYLE]="STYLE",t[t.SCRIPT]="SCRIPT",t[t.URL]="URL",t[t.RESOURCE_URL]="RESOURCE_URL",t}();class ge{}const ve=new RegExp("^([-,.\"'%_!# a-zA-Z0-9]+|(?:(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|Z|3d)?|(?:rgb|hsl)a?|(?:repeating-)?(?:linear|radial)-gradient|(?:calc|attr))\\([-0-9.%, #a-zA-Z]+\\))$","g"),me=/^url\(([^)]+)\)$/;function ye(t){return"ng-reflect-"+t.replace(/[$@]/g,"_").replace(we,(...t)=>"-"+t[1].toLowerCase())}const we=/([A-Z])/g;function be(t){try{return null!=t?t.toString().slice(0,30):t}catch(e){return"[ERROR] Exception while trying to serialize the value"}}let _e=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>Ee(),t})();const Ee=(...t)=>{},Se=new It("The presence of this token marks an injector as being the root injector."),Ie=function(t,e,n){return new ke(t,e,n)};let Te=(()=>{class t{static create(t,e){return Array.isArray(t)?Ie(t,e,""):Ie(t.providers,t.parent,t.name||"")}}return t.THROW_IF_NOT_FOUND=xt,t.NULL=new Dt,t.ngInjectableDef=ft({token:t,providedIn:"any",factory:()=>Rt(Tt)}),t.__NG_ELEMENT_ID__=-1,t})();const xe=function(t){return t},Ce=[],Ae=xe,Ne=function(){return Array.prototype.slice.call(arguments)};class ke{constructor(t,e=Te.NULL,n=null){this.parent=e,this.source=n;const r=this._records=new Map;r.set(Te,{token:Te,fn:xe,deps:Ce,value:this,useNew:!1}),r.set(Tt,{token:Tt,fn:xe,deps:Ce,value:this,useNew:!1}),function t(e,n){if(n)if((n=yt(n))instanceof Array)for(let r=0;r<n.length;r++)t(e,n[r]);else{if("function"==typeof n)throw De("Function/Class not supported",n);if(!n||"object"!=typeof n||!n.provide)throw De("Unexpected provider",n);{let t=yt(n.provide);const r=function(t){const e=function(t){let e=Ce;const n=t.deps;if(n&&n.length){e=[];for(let t=0;t<n.length;t++){let r=6,i=yt(n[t]);if(i instanceof Array)for(let t=0,e=i;t<e.length;t++){const n=e[t];n instanceof at||n==at?r|=1:n instanceof ct||n==ct?r&=-3:n instanceof ut||n==ut?r&=-5:i=n instanceof st?n.token:yt(n)}e.push({token:i,options:r})}}else if(t.useExisting)e=[{token:yt(t.useExisting),options:6}];else if(!n&&!(At in t))throw De("'deps' required",t);return e}(t);let n=xe,r=Ce,i=!1,o=yt(t.provide);if(At in t)r=t.useValue;else if(t.useFactory)n=t.useFactory;else if(t.useExisting);else if(t.useClass)i=!0,n=yt(t.useClass);else{if("function"!=typeof o)throw De("StaticProvider does not have [useValue|useFactory|useExisting|useClass] or [provide] is not newable",t);i=!0,n=o}return{deps:e,fn:n,useNew:i,value:r}}(n);if(!0===n.multi){let r=e.get(t);if(r){if(r.fn!==Ne)throw Re(t)}else e.set(t,r={token:n.provide,deps:[],useNew:!1,fn:Ne,value:Ce});t=n,r.deps.push({token:t,options:6})}const i=e.get(t);if(i&&i.fn==Ne)throw Re(t);e.set(t,r)}}}(r,t)}get(t,e,n=lt.Default){const r=this._records.get(t);try{return function t(e,n,r,i,o,s){try{return function(e,n,r,i,o,s){let a;if(!n||s&lt.SkipSelf)s&lt.Self||(a=i.get(e,o,lt.Default));else{if(a=n.value,a==Ae)throw Error("\u0275Circular dependency");if(a===Ce){n.value=Ae;let e=void 0,o=n.useNew,s=n.fn,u=n.deps,c=Ce;if(u.length){c=[];for(let e=0;e<u.length;e++){const n=u[e],o=n.options,s=2&o?r.get(n.token):void 0;c.push(t(n.token,s,r,s||4&o?i:Te.NULL,1&o?null:Te.THROW_IF_NOT_FOUND,lt.Default))}}n.value=a=o?new s(...c):s.apply(e,c)}}return a}(e,n,r,i,o,s)}catch(a){throw a instanceof Error||(a=new Error(a)),(a.ngTempTokenPath=a.ngTempTokenPath||[]).unshift(e),n&&n.value==Ae&&(n.value=Ce),a}}(t,r,this._records,this.parent,e,n)}catch(i){return function(t,e,n,r){const i=t.ngTempTokenPath;throw e.__source&&i.unshift(e.__source),t.message=Ot("\n"+t.message,i,"StaticInjectorError",r),t.ngTokenPath=i,t.ngTempTokenPath=null,t}(i,t,0,this.source)}}toString(){const t=[];return this._records.forEach((e,n)=>t.push(gt(n))),`StaticInjector[${t.join(", ")}]`}}function Re(t){return De("Cannot mix multi providers and regular providers",t)}function De(t,e){return new Error(Ot(t,e,"StaticInjectorError"))}const Oe=new It("AnalyzeForEntryComponents");let Pe=null;function Le(){if(!Pe){const t=St.Symbol;if(t&&t.iterator)Pe=t.iterator;else{const t=Object.getOwnPropertyNames(Map.prototype);for(let e=0;e<t.length;++e){const n=t[e];"entries"!==n&&"size"!==n&&Map.prototype[n]===Map.prototype.entries&&(Pe=n)}}}return Pe}function Ue(t,e){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)}function Me(t,e){const n=je(t),r=je(e);if(n&&r)return function(t,e,n){const r=t[Le()](),i=e[Le()]();for(;;){const t=r.next(),e=i.next();if(t.done&&e.done)return!0;if(t.done||e.done)return!1;if(!n(t.value,e.value))return!1}}(t,e,Me);{const i=t&&("object"==typeof t||"function"==typeof t),o=e&&("object"==typeof e||"function"==typeof e);return!(n||!i||r||!o)||Ue(t,e)}}class Ve{constructor(t){this.wrapped=t}static wrap(t){return new Ve(t)}static unwrap(t){return Ve.isWrapped(t)?t.wrapped:t}static isWrapped(t){return t instanceof Ve}}function je(t){return!!Fe(t)&&(Array.isArray(t)||!(t instanceof Map)&&Le()in t)}function Fe(t){return null!==t&&("function"==typeof t||"object"==typeof t)}function qe(t){return!!t&&"function"==typeof t.then}function ze(t){return!!t&&"function"==typeof t.subscribe}class Be{constructor(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}isFirstChange(){return this.firstChange}}class He{}function Ge(t){const e=Error(`No component factory found for ${gt(t)}. Did you add it to @NgModule.entryComponents?`);return e[$e]=t,e}const $e="ngComponent";class We{resolveComponentFactory(t){throw Ge(t)}}let Ke=(()=>{class t{}return t.NULL=new We,t})();class Qe{constructor(t,e,n){this._parent=e,this._ngModule=n,this._factories=new Map;for(let r=0;r<t.length;r++){const e=t[r];this._factories.set(e.componentType,e)}}resolveComponentFactory(t){let e=this._factories.get(t);if(!e&&this._parent&&(e=this._parent.resolveComponentFactory(t)),!e)throw Ge(t);return new Ze(e,this._ngModule)}}class Ze extends He{constructor(t,e){super(),this.factory=t,this.ngModule=e,this.selector=t.selector,this.componentType=t.componentType,this.ngContentSelectors=t.ngContentSelectors,this.inputs=t.inputs,this.outputs=t.outputs}create(t,e,n,r){return this.factory.create(t,e,n,r||this.ngModule)}}function Ye(...t){}let Xe=(()=>{class t{constructor(t){this.nativeElement=t}}return t.__NG_ELEMENT_ID__=()=>Je(t),t})();const Je=Ye;class tn{}class en{}const nn=function(){var t={Important:1,DashCase:2};return t[t.Important]="Important",t[t.DashCase]="DashCase",t}();let rn=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>on(),t})();const on=Ye;class sn{constructor(t){this.full=t,this.major=t.split(".")[0],this.minor=t.split(".")[1],this.patch=t.split(".").slice(2).join(".")}}const an=new sn("8.2.14");class un{constructor(){}supports(t){return je(t)}create(t){return new ln(t)}}const cn=(t,e)=>e;class ln{constructor(t){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=t||cn}forEachItem(t){let e;for(e=this._itHead;null!==e;e=e._next)t(e)}forEachOperation(t){let e=this._itHead,n=this._removalsHead,r=0,i=null;for(;e||n;){const o=!n||e&&e.currentIndex<pn(n,r,i)?e:n,s=pn(o,r,i),a=o.currentIndex;if(o===n)r--,n=n._nextRemoved;else if(e=e._next,null==o.previousIndex)r++;else{i||(i=[]);const t=s-r,e=a-r;if(t!=e){for(let n=0;n<t;n++){const r=n<i.length?i[n]:i[n]=0,o=r+n;e<=o&&o<t&&(i[n]=r+1)}i[o.previousIndex]=e-t}}s!==a&&t(o,s,a)}}forEachPreviousItem(t){let e;for(e=this._previousItHead;null!==e;e=e._nextPrevious)t(e)}forEachAddedItem(t){let e;for(e=this._additionsHead;null!==e;e=e._nextAdded)t(e)}forEachMovedItem(t){let e;for(e=this._movesHead;null!==e;e=e._nextMoved)t(e)}forEachRemovedItem(t){let e;for(e=this._removalsHead;null!==e;e=e._nextRemoved)t(e)}forEachIdentityChange(t){let e;for(e=this._identityChangesHead;null!==e;e=e._nextIdentityChange)t(e)}diff(t){if(null==t&&(t=[]),!je(t))throw new Error(`Error trying to diff '${gt(t)}'. Only arrays and iterables are allowed`);return this.check(t)?this:null}onDestroy(){}check(t){this._reset();let e,n,r,i=this._itHead,o=!1;if(Array.isArray(t)){this.length=t.length;for(let e=0;e<this.length;e++)n=t[e],r=this._trackByFn(e,n),null!==i&&Ue(i.trackById,r)?(o&&(i=this._verifyReinsertion(i,n,r,e)),Ue(i.item,n)||this._addIdentityChange(i,n)):(i=this._mismatch(i,n,r,e),o=!0),i=i._next}else e=0,function(t,e){if(Array.isArray(t))for(let n=0;n<t.length;n++)e(t[n]);else{const n=t[Le()]();let r;for(;!(r=n.next()).done;)e(r.value)}}(t,t=>{r=this._trackByFn(e,t),null!==i&&Ue(i.trackById,r)?(o&&(i=this._verifyReinsertion(i,t,r,e)),Ue(i.item,t)||this._addIdentityChange(i,t)):(i=this._mismatch(i,t,r,e),o=!0),i=i._next,e++}),this.length=e;return this._truncate(i),this.collection=t,this.isDirty}get isDirty(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead}_reset(){if(this.isDirty){let t,e;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=e)t.previousIndex=t.currentIndex,e=t._nextMoved;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(t,e,n,r){let i;return null===t?i=this._itTail:(i=t._prev,this._remove(t)),null!==(t=null===this._linkedRecords?null:this._linkedRecords.get(n,r))?(Ue(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,i,r)):null!==(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null))?(Ue(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,i,r)):t=this._addAfter(new hn(e,n),i,r),t}_verifyReinsertion(t,e,n,r){let i=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==i?t=this._reinsertAfter(i,t._prev,r):t.currentIndex!=r&&(t.currentIndex=r,this._addToMoves(t,r)),t}_truncate(t){for(;null!==t;){const e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(t,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);const r=t._prevRemoved,i=t._nextRemoved;return null===r?this._removalsHead=i:r._nextRemoved=i,null===i?this._removalsTail=r:i._prevRemoved=r,this._insertAfter(t,e,n),this._addToMoves(t,n),t}_moveAfter(t,e,n){return this._unlink(t),this._insertAfter(t,e,n),this._addToMoves(t,n),t}_addAfter(t,e,n){return this._insertAfter(t,e,n),this._additionsTail=null===this._additionsTail?this._additionsHead=t:this._additionsTail._nextAdded=t,t}_insertAfter(t,e,n){const r=null===e?this._itHead:e._next;return t._next=r,t._prev=e,null===r?this._itTail=t:r._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new dn),this._linkedRecords.put(t),t.currentIndex=n,t}_remove(t){return this._addToRemovals(this._unlink(t))}_unlink(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);const e=t._prev,n=t._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,t}_addToMoves(t,e){return t.previousIndex===e||(this._movesTail=null===this._movesTail?this._movesHead=t:this._movesTail._nextMoved=t),t}_addToRemovals(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new dn),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t}_addIdentityChange(t,e){return t.item=e,this._identityChangesTail=null===this._identityChangesTail?this._identityChangesHead=t:this._identityChangesTail._nextIdentityChange=t,t}}class hn{constructor(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}}class fn{constructor(){this._head=null,this._tail=null}add(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)}get(t,e){let n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<=n.currentIndex)&&Ue(n.trackById,t))return n;return null}remove(t){const e=t._prevDup,n=t._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head}}class dn{constructor(){this.map=new Map}put(t){const e=t.trackById;let n=this.map.get(e);n||(n=new fn,this.map.set(e,n)),n.add(t)}get(t,e){const n=this.map.get(t);return n?n.get(t,e):null}remove(t){const e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t}get isEmpty(){return 0===this.map.size}clear(){this.map.clear()}}function pn(t,e,n){const r=t.previousIndex;if(null===r)return r;let i=0;return n&&r<n.length&&(i=n[r]),r+e+i}class gn{constructor(){}supports(t){return t instanceof Map||Fe(t)}create(){return new vn}}class vn{constructor(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}get isDirty(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead}forEachItem(t){let e;for(e=this._mapHead;null!==e;e=e._next)t(e)}forEachPreviousItem(t){let e;for(e=this._previousMapHead;null!==e;e=e._nextPrevious)t(e)}forEachChangedItem(t){let e;for(e=this._changesHead;null!==e;e=e._nextChanged)t(e)}forEachAddedItem(t){let e;for(e=this._additionsHead;null!==e;e=e._nextAdded)t(e)}forEachRemovedItem(t){let e;for(e=this._removalsHead;null!==e;e=e._nextRemoved)t(e)}diff(t){if(t){if(!(t instanceof Map||Fe(t)))throw new Error(`Error trying to diff '${gt(t)}'. Only maps and objects are allowed`)}else t=new Map;return this.check(t)?this:null}onDestroy(){}check(t){this._reset();let e=this._mapHead;if(this._appendAfter=null,this._forEach(t,(t,n)=>{if(e&&e.key===n)this._maybeAddToChanges(e,t),this._appendAfter=e,e=e._next;else{const r=this._getOrCreateRecordForKey(n,t);e=this._insertBeforeOrAppend(e,r)}}),e){e._prev&&(e._prev._next=null),this._removalsHead=e;for(let t=e;null!==t;t=t._nextRemoved)t===this._mapHead&&(this._mapHead=null),this._records.delete(t.key),t._nextRemoved=t._next,t.previousValue=t.currentValue,t.currentValue=null,t._prev=null,t._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty}_insertBeforeOrAppend(t,e){if(t){const n=t._prev;return e._next=t,e._prev=n,t._prev=e,n&&(n._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null}_getOrCreateRecordForKey(t,e){if(this._records.has(t)){const n=this._records.get(t);this._maybeAddToChanges(n,e);const r=n._prev,i=n._next;return r&&(r._next=i),i&&(i._prev=r),n._next=null,n._prev=null,n}const n=new mn(t);return this._records.set(t,n),n.currentValue=e,this._addToAdditions(n),n}_reset(){if(this.isDirty){let t;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}}_maybeAddToChanges(t,e){Ue(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))}_addToAdditions(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)}_addToChanges(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)}_forEach(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach(n=>e(t[n],n))}}class mn{constructor(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}}let yn=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(null!=n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>{if(!n)throw new Error("Cannot extend IterableDiffers without a parent injector");return t.create(e,n)},deps:[[t,new ct,new at]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(null!=e)return e;throw new Error(`Cannot find a differ supporting object '${t}' of type '${n=t,n.name||typeof n}'`);var n}}return t.ngInjectableDef=ft({token:t,providedIn:"root",factory:()=>new t([new un])}),t})(),wn=(()=>{class t{constructor(t){this.factories=t}static create(e,n){if(n){const t=n.factories.slice();e=e.concat(t)}return new t(e)}static extend(e){return{provide:t,useFactory:n=>{if(!n)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return t.create(e,n)},deps:[[t,new ct,new at]]}}find(t){const e=this.factories.find(e=>e.supports(t));if(e)return e;throw new Error(`Cannot find a differ supporting object '${t}'`)}}return t.ngInjectableDef=ft({token:t,providedIn:"root",factory:()=>new t([new gn])}),t})();const bn=[new gn],_n=new yn([new un]),En=new wn(bn);let Sn=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>In(t,Xe),t})();const In=Ye;let Tn=(()=>{class t{}return t.__NG_ELEMENT_ID__=()=>xn(t,Xe),t})();const xn=Ye;function Cn(t,e,n,r){let i=`ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '${e}'. Current value: '${n}'.`;return r&&(i+=" It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook ?"),function(t,e){const n=new Error(t);return An(n,e),n}(i,t)}function An(t,e){t.ngDebugContext=e,t.ngErrorLogger=e.logError.bind(e)}function Nn(t){return new Error("ViewDestroyedError: Attempt to use a destroyed view: "+t)}function kn(t,e,n){const r=t.state,i=1792&r;return i===e?(t.state=-1793&r|n,t.initIndex=-1,!0):i===n}function Rn(t,e,n){return(1792&t.state)===e&&t.initIndex<=n&&(t.initIndex=n+1,!0)}function Dn(t,e){return t.nodes[e]}function On(t,e){return t.nodes[e]}function Pn(t,e){return t.nodes[e]}function Ln(t,e){return t.nodes[e]}function Un(t,e){return t.nodes[e]}const Mn={setCurrentNode:void 0,createRootView:void 0,createEmbeddedView:void 0,createComponentView:void 0,createNgModuleRef:void 0,overrideProvider:void 0,overrideComponentView:void 0,clearOverrides:void 0,checkAndUpdateView:void 0,checkNoChangesView:void 0,destroyView:void 0,resolveDep:void 0,createDebugContext:void 0,handleEvent:void 0,updateDirectives:void 0,updateRenderer:void 0,dirtyParentQueries:void 0},Vn=()=>{},jn=new Map;function Fn(t){let e=jn.get(t);return e||(e=gt(t)+"_"+jn.size,jn.set(t,e)),e}function qn(t){return{id:"$$undefined",styles:t.styles,encapsulation:t.encapsulation,data:t.data}}let zn=0;function Bn(t,e,n,r){return!(!(2&t.state)&&Ue(t.oldValues[e.bindingIndex+n],r))}function Hn(t,e,n,r){return!!Bn(t,e,n,r)&&(t.oldValues[e.bindingIndex+n]=r,!0)}function Gn(t,e,n,r){const i=t.oldValues[e.bindingIndex+n];if(1&t.state||!Me(i,r)){const o=e.bindings[n].name;throw Cn(Mn.createDebugContext(t,e.nodeIndex),`${o}: ${i}`,`${o}: ${r}`,0!=(1&t.state))}}function $n(t){let e=t;for(;e;)2&e.def.flags&&(e.state|=8),e=e.viewContainerParent||e.parent}function Wn(t,e){let n=t;for(;n&&n!==e;)n.state|=64,n=n.viewContainerParent||n.parent}function Kn(t,e,n,r){try{return $n(33554432&t.def.nodes[e].flags?On(t,e).componentView:t),Mn.handleEvent(t,e,n,r)}catch(i){t.root.errorHandler.handleError(i)}}function Qn(t){return t.parent?On(t.parent,t.parentNodeDef.nodeIndex):null}function Zn(t){return t.parent?t.parentNodeDef.parent:null}function Yn(t,e){switch(201347067&e.flags){case 1:return On(t,e.nodeIndex).renderElement;case 2:return Dn(t,e.nodeIndex).renderText}}function Xn(t,e){return t?`${t}:${e}`:e}function Jn(t){return!!t.parent&&!!(32768&t.parentNodeDef.flags)}function tr(t){return!(!t.parent||32768&t.parentNodeDef.flags)}function er(t){const e={};let n=0;const r={};return t&&t.forEach(([t,i])=>{"number"==typeof t?(e[t]=i,n|=function(t){return 1<<t%32}(t)):r[t]=i}),{matchedQueries:e,references:r,matchedQueryIds:n}}function nr(t,e){return t.map(t=>{let n,r;return Array.isArray(t)?[r,n]=t:(r=0,n=t),n&&("function"==typeof n||"object"==typeof n)&&e&&Object.defineProperty(n,"__source",{value:e,configurable:!0}),{flags:r,token:n,tokenKey:Fn(n)}})}function rr(t,e,n){let r=n.renderParent;return r?0==(1&r.flags)||0==(33554432&r.flags)||r.element.componentRendererType&&r.element.componentRendererType.encapsulation===Vt.Native?On(t,n.renderParent.nodeIndex).renderElement:void 0:e}const ir=new WeakMap;function or(t){let e=ir.get(t);return e||(e=t(()=>Vn),e.factory=t,ir.set(t,e)),e}function sr(t,e,n,r,i){3===e&&(n=t.renderer.parentNode(Yn(t,t.def.lastRenderRootNode))),ar(t,e,0,t.def.nodes.length-1,n,r,i)}function ar(t,e,n,r,i,o,s){for(let a=n;a<=r;a++){const n=t.def.nodes[a];11&n.flags&&cr(t,n,e,i,o,s),a+=n.childCount}}function ur(t,e,n,r,i,o){let s=t;for(;s&&!Jn(s);)s=s.parent;const a=s.parent,u=Zn(s),c=u.nodeIndex+u.childCount;for(let l=u.nodeIndex+1;l<=c;l++){const t=a.def.nodes[l];t.ngContentIndex===e&&cr(a,t,n,r,i,o),l+=t.childCount}if(!a.parent){const s=t.root.projectableNodes[e];if(s)for(let e=0;e<s.length;e++)lr(t,s[e],n,r,i,o)}}function cr(t,e,n,r,i,o){if(8&e.flags)ur(t,e.ngContent.index,n,r,i,o);else{const s=Yn(t,e);if(3===n&&33554432&e.flags&&48&e.bindingFlags?(16&e.bindingFlags&&lr(t,s,n,r,i,o),32&e.bindingFlags&&lr(On(t,e.nodeIndex).componentView,s,n,r,i,o)):lr(t,s,n,r,i,o),16777216&e.flags){const s=On(t,e.nodeIndex).viewContainer._embeddedViews;for(let t=0;t<s.length;t++)sr(s[t],n,r,i,o)}1&e.flags&&!e.element.name&&ar(t,n,e.nodeIndex+1,e.nodeIndex+e.childCount,r,i,o)}}function lr(t,e,n,r,i,o){const s=t.renderer;switch(n){case 1:s.appendChild(r,e);break;case 2:s.insertBefore(r,e,i);break;case 3:s.removeChild(r,e);break;case 0:o.push(e)}}const hr=/^:([^:]+):(.+)$/;function fr(t){if(":"===t[0]){const e=t.match(hr);return[e[1],e[2]]}return["",t]}function dr(t){let e=0;for(let n=0;n<t.length;n++)e|=t[n].flags;return e}const pr=new Object,gr=Fn(Te),vr=Fn(Tt),mr=Fn(Pt);function yr(t,e,n,r){return n=yt(n),{index:-1,deps:nr(r,gt(e)),flags:t,token:e,value:n}}function wr(t,e,n=Te.THROW_IF_NOT_FOUND){const r=kt(t);try{if(8&e.flags)return e.token;if(2&e.flags&&(n=null),1&e.flags)return t._parent.get(e.token,n);const s=e.tokenKey;switch(s){case gr:case vr:case mr:return t}const a=t._def.providersByKey[s];let u;if(a){let e=t._providers[a.index];return void 0===e&&(e=t._providers[a.index]=br(t,a)),e===pr?void 0:e}if((u=dt(e.token))&&(i=t,null!=(o=u).providedIn&&(function(t,e){return t._def.modules.indexOf(e)>-1}(i,o.providedIn)||"root"===o.providedIn&&i._def.isRoot))){const n=t._providers.length;return t._def.providers[n]=t._def.providersByKey[e.tokenKey]={flags:5120,value:u.factory,deps:[],index:n,token:e.token},t._providers[n]=pr,t._providers[n]=br(t,t._def.providersByKey[e.tokenKey])}return 4&e.flags?n:t._parent.get(e.token,n)}finally{kt(r)}var i,o}function br(t,e){let n;switch(201347067&e.flags){case 512:n=function(t,e,n){const r=n.length;switch(r){case 0:return new e;case 1:return new e(wr(t,n[0]));case 2:return new e(wr(t,n[0]),wr(t,n[1]));case 3:return new e(wr(t,n[0]),wr(t,n[1]),wr(t,n[2]));default:const i=new Array(r);for(let e=0;e<r;e++)i[e]=wr(t,n[e]);return new e(...i)}}(t,e.value,e.deps);break;case 1024:n=function(t,e,n){const r=n.length;switch(r){case 0:return e();case 1:return e(wr(t,n[0]));case 2:return e(wr(t,n[0]),wr(t,n[1]));case 3:return e(wr(t,n[0]),wr(t,n[1]),wr(t,n[2]));default:const i=Array(r);for(let e=0;e<r;e++)i[e]=wr(t,n[e]);return e(...i)}}(t,e.value,e.deps);break;case 2048:n=wr(t,e.deps[0]);break;case 256:n=e.value}return n===pr||null===n||"object"!=typeof n||131072&e.flags||"function"!=typeof n.ngOnDestroy||(e.flags|=131072),void 0===n?pr:n}function _r(t,e){const n=t.viewContainer._embeddedViews;if((null==e||e>=n.length)&&(e=n.length-1),e<0)return null;const r=n[e];return r.viewContainerParent=null,Mt(n,e),Mn.dirtyParentQueries(r),Sr(r),r}function Er(t,e,n){const r=e?Yn(e,e.def.lastRenderRootNode):t.renderElement,i=n.renderer.parentNode(r),o=n.renderer.nextSibling(r);sr(n,2,i,o,void 0)}function Sr(t){sr(t,3,null,null,void 0)}const Ir=new Object;function Tr(t,e,n,r,i,o){return new xr(t,e,n,r,i,o)}class xr extends He{constructor(t,e,n,r,i,o){super(),this.selector=t,this.componentType=e,this._inputs=r,this._outputs=i,this.ngContentSelectors=o,this.viewDefFactory=n}get inputs(){const t=[],e=this._inputs;for(let n in e)t.push({propName:n,templateName:e[n]});return t}get outputs(){const t=[];for(let e in this._outputs)t.push({propName:e,templateName:this._outputs[e]});return t}create(t,e,n,r){if(!r)throw new Error("ngModule should be provided");const i=or(this.viewDefFactory),o=i.nodes[0].element.componentProvider.nodeIndex,s=Mn.createRootView(t,e||[],n,i,r,Ir),a=Pn(s,o).instance;return n&&s.renderer.setAttribute(On(s,0).renderElement,"ng-version",an.full),new Cr(s,new Rr(s),a)}}class Cr extends class{}{constructor(t,e,n){super(),this._view=t,this._viewRef=e,this._component=n,this._elDef=this._view.def.nodes[0],this.hostView=e,this.changeDetectorRef=e,this.instance=n}get location(){return new Xe(On(this._view,this._elDef.nodeIndex).renderElement)}get injector(){return new Lr(this._view,this._elDef)}get componentType(){return this._component.constructor}destroy(){this._viewRef.destroy()}onDestroy(t){this._viewRef.onDestroy(t)}}function Ar(t,e,n){return new Nr(t,e,n)}class Nr{constructor(t,e,n){this._view=t,this._elDef=e,this._data=n,this._embeddedViews=[]}get element(){return new Xe(this._data.renderElement)}get injector(){return new Lr(this._view,this._elDef)}get parentInjector(){let t=this._view,e=this._elDef.parent;for(;!e&&t;)e=Zn(t),t=t.parent;return t?new Lr(t,e):new Lr(this._view,null)}clear(){for(let t=this._embeddedViews.length-1;t>=0;t--){const e=_r(this._data,t);Mn.destroyView(e)}}get(t){const e=this._embeddedViews[t];if(e){const t=new Rr(e);return t.attachToViewContainerRef(this),t}return null}get length(){return this._embeddedViews.length}createEmbeddedView(t,e,n){const r=t.createEmbeddedView(e||{});return this.insert(r,n),r}createComponent(t,e,n,r,i){const o=n||this.parentInjector;i||t instanceof Ze||(i=o.get(Pt));const s=t.create(o,r,void 0,i);return this.insert(s.hostView,e),s}insert(t,e){if(t.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");const n=t;return function(t,e,n,r){let i=e.viewContainer._embeddedViews;null==n&&(n=i.length),r.viewContainerParent=t,Ut(i,n,r),function(t,e){const n=Qn(e);if(!n||n===t||16&e.state)return;e.state|=16;let r=n.template._projectedViews;r||(r=n.template._projectedViews=[]),r.push(e),function(t,e){if(4&e.flags)return;t.nodeFlags|=4,e.flags|=4;let n=e.parent;for(;n;)n.childFlags|=4,n=n.parent}(e.parent.def,e.parentNodeDef)}(e,r),Mn.dirtyParentQueries(r),Er(e,n>0?i[n-1]:null,r)}(this._view,this._data,e,n._view),n.attachToViewContainerRef(this),t}move(t,e){if(t.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");const n=this._embeddedViews.indexOf(t._view);return function(t,e,n){const r=t.viewContainer._embeddedViews,i=r[e];Mt(r,e),null==n&&(n=r.length),Ut(r,n,i),Mn.dirtyParentQueries(i),Sr(i),Er(t,n>0?r[n-1]:null,i)}(this._data,n,e),t}indexOf(t){return this._embeddedViews.indexOf(t._view)}remove(t){const e=_r(this._data,t);e&&Mn.destroyView(e)}detach(t){const e=_r(this._data,t);return e?new Rr(e):null}}function kr(t){return new Rr(t)}class Rr{constructor(t){this._view=t,this._viewContainerRef=null,this._appRef=null}get rootNodes(){return function(t){const e=[];return sr(t,0,void 0,void 0,e),e}(this._view)}get context(){return this._view.context}get destroyed(){return 0!=(128&this._view.state)}markForCheck(){$n(this._view)}detach(){this._view.state&=-5}detectChanges(){const t=this._view.root.rendererFactory;t.begin&&t.begin();try{Mn.checkAndUpdateView(this._view)}finally{t.end&&t.end()}}checkNoChanges(){Mn.checkNoChangesView(this._view)}reattach(){this._view.state|=4}onDestroy(t){this._view.disposables||(this._view.disposables=[]),this._view.disposables.push(t)}destroy(){this._appRef?this._appRef.detachView(this):this._viewContainerRef&&this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),Mn.destroyView(this._view)}detachFromAppRef(){this._appRef=null,Sr(this._view),Mn.dirtyParentQueries(this._view)}attachToAppRef(t){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t}attachToViewContainerRef(t){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=t}}function Dr(t,e){return new Or(t,e)}class Or extends Sn{constructor(t,e){super(),this._parentView=t,this._def=e}createEmbeddedView(t){return new Rr(Mn.createEmbeddedView(this._parentView,this._def,this._def.element.template,t))}get elementRef(){return new Xe(On(this._parentView,this._def.nodeIndex).renderElement)}}function Pr(t,e){return new Lr(t,e)}class Lr{constructor(t,e){this.view=t,this.elDef=e}get(t,e=Te.THROW_IF_NOT_FOUND){return Mn.resolveDep(this.view,this.elDef,!!this.elDef&&0!=(33554432&this.elDef.flags),{flags:0,token:t,tokenKey:Fn(t)},e)}}function Ur(t){return new Mr(t.renderer)}class Mr{constructor(t){this.delegate=t}selectRootElement(t){return this.delegate.selectRootElement(t)}createElement(t,e){const[n,r]=fr(e),i=this.delegate.createElement(r,n);return t&&this.delegate.appendChild(t,i),i}createViewRoot(t){return t}createTemplateAnchor(t){const e=this.delegate.createComment("");return t&&this.delegate.appendChild(t,e),e}createText(t,e){const n=this.delegate.createText(e);return t&&this.delegate.appendChild(t,n),n}projectNodes(t,e){for(let n=0;n<e.length;n++)this.delegate.appendChild(t,e[n])}attachViewAfter(t,e){const n=this.delegate.parentNode(t),r=this.delegate.nextSibling(t);for(let i=0;i<e.length;i++)this.delegate.insertBefore(n,e[i],r)}detachView(t){for(let e=0;e<t.length;e++){const n=t[e],r=this.delegate.parentNode(n);this.delegate.removeChild(r,n)}}destroyView(t,e){for(let n=0;n<e.length;n++)this.delegate.destroyNode(e[n])}listen(t,e,n){return this.delegate.listen(t,e,n)}listenGlobal(t,e,n){return this.delegate.listen(t,e,n)}setElementProperty(t,e,n){this.delegate.setProperty(t,e,n)}setElementAttribute(t,e,n){const[r,i]=fr(e);null!=n?this.delegate.setAttribute(t,i,n,r):this.delegate.removeAttribute(t,i,r)}setBindingDebugInfo(t,e,n){}setElementClass(t,e,n){n?this.delegate.addClass(t,e):this.delegate.removeClass(t,e)}setElementStyle(t,e,n){null!=n?this.delegate.setStyle(t,e,n):this.delegate.removeStyle(t,e)}invokeElementMethod(t,e,n){t[e].apply(t,n)}setText(t,e){this.delegate.setValue(t,e)}animate(){throw new Error("Renderer.animate is no longer supported!")}}function Vr(t,e,n,r){return new jr(t,e,n,r)}class jr{constructor(t,e,n,r){this._moduleType=t,this._parent=e,this._bootstrapComponents=n,this._def=r,this._destroyListeners=[],this._destroyed=!1,this.injector=this,function(t){const e=t._def,n=t._providers=new Array(e.providers.length);for(let r=0;r<e.providers.length;r++){const i=e.providers[r];4096&i.flags||void 0===n[r]&&(n[r]=br(t,i))}}(this)}get(t,e=Te.THROW_IF_NOT_FOUND,n=lt.Default){let r=0;return n&lt.SkipSelf?r|=1:n&lt.Self&&(r|=4),wr(this,{token:t,tokenKey:Fn(t),flags:r},e)}get instance(){return this.get(this._moduleType)}get componentFactoryResolver(){return this.get(Ke)}destroy(){if(this._destroyed)throw new Error(`The ng module ${gt(this.instance.constructor)} has already been destroyed.`);this._destroyed=!0,function(t,e){const n=t._def,r=new Set;for(let i=0;i<n.providers.length;i++)if(131072&n.providers[i].flags){const e=t._providers[i];if(e&&e!==pr){const t=e.ngOnDestroy;"function"!=typeof t||r.has(e)||(t.apply(e),r.add(e))}}}(this),this._destroyListeners.forEach(t=>t())}onDestroy(t){this._destroyListeners.push(t)}}const Fr=Fn(tn),qr=Fn(rn),zr=Fn(Xe),Br=Fn(Tn),Hr=Fn(Sn),Gr=Fn(_e),$r=Fn(Te),Wr=Fn(Tt);function Kr(t,e,n,r,i,o,s,a){const u=[];if(s)for(let l in s){const[t,e]=s[l];u[t]={flags:8,name:l,nonMinifiedName:e,ns:null,securityContext:null,suffix:null}}const c=[];if(a)for(let l in a)c.push({type:1,propName:l,target:null,eventName:a[l]});return Qr(t,e|=16384,n,r,i,i,o,u,c)}function Qr(t,e,n,r,i,o,s,a,u){const{matchedQueries:c,references:l,matchedQueryIds:h}=er(n);u||(u=[]),a||(a=[]),o=yt(o);const f=nr(s,gt(i));return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:t,flags:e,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:c,matchedQueryIds:h,references:l,ngContentIndex:-1,childCount:r,bindings:a,bindingFlags:dr(a),outputs:u,element:null,provider:{token:i,value:o,deps:f},text:null,query:null,ngContent:null}}function Zr(t,e){return ti(t,e)}function Yr(t,e){let n=t;for(;n.parent&&!Jn(n);)n=n.parent;return ei(n.parent,Zn(n),!0,e.provider.value,e.provider.deps)}function Xr(t,e){const n=ei(t,e.parent,(32768&e.flags)>0,e.provider.value,e.provider.deps);if(e.outputs.length)for(let r=0;r<e.outputs.length;r++){const i=e.outputs[r],o=n[i.propName];if(!ze(o))throw new Error(`@Output ${i.propName} not initialized in '${n.constructor.name}'.`);{const n=o.subscribe(Jr(t,e.parent.nodeIndex,i.eventName));t.disposables[e.outputIndex+r]=n.unsubscribe.bind(n)}}return n}function Jr(t,e,n){return r=>Kn(t,e,n,r)}function ti(t,e){const n=(8192&e.flags)>0,r=e.provider;switch(201347067&e.flags){case 512:return ei(t,e.parent,n,r.value,r.deps);case 1024:return function(t,e,n,r,i){const o=i.length;switch(o){case 0:return r();case 1:return r(ri(t,e,n,i[0]));case 2:return r(ri(t,e,n,i[0]),ri(t,e,n,i[1]));case 3:return r(ri(t,e,n,i[0]),ri(t,e,n,i[1]),ri(t,e,n,i[2]));default:const s=Array(o);for(let r=0;r<o;r++)s[r]=ri(t,e,n,i[r]);return r(...s)}}(t,e.parent,n,r.value,r.deps);case 2048:return ri(t,e.parent,n,r.deps[0]);case 256:return r.value}}function ei(t,e,n,r,i){const o=i.length;switch(o){case 0:return new r;case 1:return new r(ri(t,e,n,i[0]));case 2:return new r(ri(t,e,n,i[0]),ri(t,e,n,i[1]));case 3:return new r(ri(t,e,n,i[0]),ri(t,e,n,i[1]),ri(t,e,n,i[2]));default:const s=new Array(o);for(let r=0;r<o;r++)s[r]=ri(t,e,n,i[r]);return new r(...s)}}const ni={};function ri(t,e,n,r,i=Te.THROW_IF_NOT_FOUND){if(8&r.flags)return r.token;const o=t;2&r.flags&&(i=null);const s=r.tokenKey;s===Gr&&(n=!(!e||!e.element.componentView)),e&&1&r.flags&&(n=!1,e=e.parent);let a=t;for(;a;){if(e)switch(s){case Fr:return Ur(ii(a,e,n));case qr:return ii(a,e,n).renderer;case zr:return new Xe(On(a,e.nodeIndex).renderElement);case Br:return On(a,e.nodeIndex).viewContainer;case Hr:if(e.element.template)return On(a,e.nodeIndex).template;break;case Gr:return kr(ii(a,e,n));case $r:case Wr:return Pr(a,e);default:const t=(n?e.element.allProviders:e.element.publicProviders)[s];if(t){let e=Pn(a,t.nodeIndex);return e||(e={instance:ti(a,t)},a.nodes[t.nodeIndex]=e),e.instance}}n=Jn(a),e=Zn(a),a=a.parent,4&r.flags&&(a=null)}const u=o.root.injector.get(r.token,ni);return u!==ni||i===ni?u:o.root.ngModule.injector.get(r.token,i)}function ii(t,e,n){let r;if(n)r=On(t,e.nodeIndex).componentView;else for(r=t;r.parent&&!Jn(r);)r=r.parent;return r}function oi(t,e,n,r,i,o){if(32768&n.flags){const e=On(t,n.parent.nodeIndex).componentView;2&e.def.flags&&(e.state|=8)}if(e.instance[n.bindings[r].name]=i,524288&n.flags){o=o||{};const e=Ve.unwrap(t.oldValues[n.bindingIndex+r]);o[n.bindings[r].nonMinifiedName]=new Be(e,i,0!=(2&t.state))}return t.oldValues[n.bindingIndex+r]=i,o}function si(t,e){if(!(t.def.nodeFlags&e))return;const n=t.def.nodes;let r=0;for(let i=0;i<n.length;i++){const o=n[i];let s=o.parent;for(!s&&o.flags&e&&ui(t,i,o.flags&e,r++),0==(o.childFlags&e)&&(i+=o.childCount);s&&1&s.flags&&i===s.nodeIndex+s.childCount;)s.directChildFlags&e&&(r=ai(t,s,e,r)),s=s.parent}}function ai(t,e,n,r){for(let i=e.nodeIndex+1;i<=e.nodeIndex+e.childCount;i++){const e=t.def.nodes[i];e.flags&n&&ui(t,i,e.flags&n,r++),i+=e.childCount}return r}function ui(t,e,n,r){const i=Pn(t,e);if(!i)return;const o=i.instance;o&&(Mn.setCurrentNode(t,e),1048576&n&&Rn(t,512,r)&&o.ngAfterContentInit(),2097152&n&&o.ngAfterContentChecked(),4194304&n&&Rn(t,768,r)&&o.ngAfterViewInit(),8388608&n&&o.ngAfterViewChecked(),131072&n&&o.ngOnDestroy())}const ci=new It("SCHEDULER_TOKEN",{providedIn:"root",factory:()=>jt}),li={},hi=function(){var t={LocaleId:0,DayPeriodsFormat:1,DayPeriodsStandalone:2,DaysFormat:3,DaysStandalone:4,MonthsFormat:5,MonthsStandalone:6,Eras:7,FirstDayOfWeek:8,WeekendRange:9,DateFormat:10,TimeFormat:11,DateTimeFormat:12,NumberSymbols:13,NumberFormats:14,CurrencySymbol:15,CurrencyName:16,Currencies:17,PluralCase:18,ExtraData:19};return t[t.LocaleId]="LocaleId",t[t.DayPeriodsFormat]="DayPeriodsFormat",t[t.DayPeriodsStandalone]="DayPeriodsStandalone",t[t.DaysFormat]="DaysFormat",t[t.DaysStandalone]="DaysStandalone",t[t.MonthsFormat]="MonthsFormat",t[t.MonthsStandalone]="MonthsStandalone",t[t.Eras]="Eras",t[t.FirstDayOfWeek]="FirstDayOfWeek",t[t.WeekendRange]="WeekendRange",t[t.DateFormat]="DateFormat",t[t.TimeFormat]="TimeFormat",t[t.DateTimeFormat]="DateTimeFormat",t[t.NumberSymbols]="NumberSymbols",t[t.NumberFormats]="NumberFormats",t[t.CurrencySymbol]="CurrencySymbol",t[t.CurrencyName]="CurrencyName",t[t.Currencies]="Currencies",t[t.PluralCase]="PluralCase",t[t.ExtraData]="ExtraData",t}(),fi=void 0;var di=["en",[["a","p"],["AM","PM"],fi],[["AM","PM"],fi,fi],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],fi,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],fi,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",fi,"{1} 'at' {0}",fi],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"$","US Dollar",{},function(t){let e=Math.floor(Math.abs(t)),n=t.toString().replace(/^[^.]*\.?/,"").length;return 1===e&&0===n?1:5}];class pi extends C{constructor(t=!1){super(),this.__isAsync=t}emit(t){super.next(t)}subscribe(t,e,n){let r,i=t=>null,o=()=>null;t&&"object"==typeof t?(r=this.__isAsync?e=>{setTimeout(()=>t.next(e))}:e=>{t.next(e)},t.error&&(i=this.__isAsync?e=>{setTimeout(()=>t.error(e))}:e=>{t.error(e)}),t.complete&&(o=this.__isAsync?()=>{setTimeout(()=>t.complete())}:()=>{t.complete()})):(r=this.__isAsync?e=>{setTimeout(()=>t(e))}:e=>{t(e)},e&&(i=this.__isAsync?t=>{setTimeout(()=>e(t))}:t=>{e(t)}),n&&(o=this.__isAsync?()=>{setTimeout(()=>n())}:()=>{n()}));const s=super.subscribe(r,i,o);return t instanceof f&&t.add(s),s}}function gi(){return this._results[Le()]()}class vi{constructor(){this.dirty=!0,this._results=[],this.changes=new pi,this.length=0;const t=Le(),e=vi.prototype;e[t]||(e[t]=gi)}map(t){return this._results.map(t)}filter(t){return this._results.filter(t)}find(t){return this._results.find(t)}reduce(t,e){return this._results.reduce(t,e)}forEach(t){this._results.forEach(t)}some(t){return this._results.some(t)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(t){this._results=function t(e,n){void 0===n&&(n=e);for(let r=0;r<e.length;r++){let i=e[r];Array.isArray(i)?(n===e&&(n=e.slice(0,r)),t(i,n)):n!==e&&n.push(i)}return n}(t),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]}notifyOnChanges(){this.changes.emit(this)}setDirty(){this.dirty=!0}destroy(){this.changes.complete(),this.changes.unsubscribe()}}const mi=new It("Application Initializer");class yi{constructor(t){this.appInits=t,this.initialized=!1,this.done=!1,this.donePromise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}runInitializers(){if(this.initialized)return;const t=[],e=()=>{this.done=!0,this.resolve()};if(this.appInits)for(let n=0;n<this.appInits.length;n++){const e=this.appInits[n]();qe(e)&&t.push(e)}Promise.all(t).then(()=>{e()}).catch(t=>{this.reject(t)}),0===t.length&&e(),this.initialized=!0}}const wi=new It("AppId");function bi(){return`${_i()}${_i()}${_i()}`}function _i(){return String.fromCharCode(97+Math.floor(25*Math.random()))}const Ei=new It("Platform Initializer"),Si=new It("Platform ID"),Ii=new It("appBootstrapListener");class Ti{log(t){console.log(t)}warn(t){console.warn(t)}}const xi=new It("LocaleId");function Ci(){throw new Error("Runtime compiler is not loaded")}const Ai=Ci,Ni=Ci,ki=Ci,Ri=Ci;class Di{constructor(){this.compileModuleSync=Ai,this.compileModuleAsync=Ni,this.compileModuleAndAllComponentsSync=ki,this.compileModuleAndAllComponentsAsync=Ri}clearCache(){}clearCacheFor(t){}getModuleId(t){}}class Oi{}let Pi,Li;function Ui(){const t=St.wtf;return!(!t||(Pi=t.trace,!Pi)||(Li=Pi.events,0))}const Mi=Ui();function Vi(t,e){return null}const ji=Mi?function(t,e=null){return Li.createScope(t,e)}:(t,e)=>Vi,Fi=Mi?function(t,e){return Pi.leaveScope(t,e),e}:(t,e)=>e,qi=(()=>Promise.resolve(0))();function zi(t){"undefined"==typeof Zone?qi.then(()=>{t&&t.apply(null,null)}):Zone.current.scheduleMicroTask("scheduleMicrotask",t)}class Bi{constructor({enableLongStackTrace:t=!1}){if(this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new pi(!1),this.onMicrotaskEmpty=new pi(!1),this.onStable=new pi(!1),this.onError=new pi(!1),"undefined"==typeof Zone)throw new Error("In this configuration Angular requires Zone.js");var e;Zone.assertZonePatched(),this._nesting=0,this._outer=this._inner=Zone.current,Zone.wtfZoneSpec&&(this._inner=this._inner.fork(Zone.wtfZoneSpec)),Zone.TaskTrackingZoneSpec&&(this._inner=this._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(this._inner=this._inner.fork(Zone.longStackTraceZoneSpec)),(e=this)._inner=e._inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:(t,n,r,i,o,s)=>{try{return Wi(e),t.invokeTask(r,i,o,s)}finally{Ki(e)}},onInvoke:(t,n,r,i,o,s,a)=>{try{return Wi(e),t.invoke(r,i,o,s,a)}finally{Ki(e)}},onHasTask:(t,n,r,i)=>{t.hasTask(r,i),n===r&&("microTask"==i.change?(e.hasPendingMicrotasks=i.microTask,$i(e)):"macroTask"==i.change&&(e.hasPendingMacrotasks=i.macroTask))},onHandleError:(t,n,r,i)=>(t.handleError(r,i),e.runOutsideAngular(()=>e.onError.emit(i)),!1)})}static isInAngularZone(){return!0===Zone.current.get("isAngularZone")}static assertInAngularZone(){if(!Bi.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")}static assertNotInAngularZone(){if(Bi.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")}run(t,e,n){return this._inner.run(t,e,n)}runTask(t,e,n,r){const i=this._inner,o=i.scheduleEventTask("NgZoneEvent: "+r,t,Gi,Hi,Hi);try{return i.runTask(o,e,n)}finally{i.cancelTask(o)}}runGuarded(t,e,n){return this._inner.runGuarded(t,e,n)}runOutsideAngular(t){return this._outer.run(t)}}function Hi(){}const Gi={};function $i(t){if(0==t._nesting&&!t.hasPendingMicrotasks&&!t.isStable)try{t._nesting++,t.onMicrotaskEmpty.emit(null)}finally{if(t._nesting--,!t.hasPendingMicrotasks)try{t.runOutsideAngular(()=>t.onStable.emit(null))}finally{t.isStable=!0}}}function Wi(t){t._nesting++,t.isStable&&(t.isStable=!1,t.onUnstable.emit(null))}function Ki(t){t._nesting--,$i(t)}class Qi{constructor(){this.hasPendingMicrotasks=!1,this.hasPendingMacrotasks=!1,this.isStable=!0,this.onUnstable=new pi,this.onMicrotaskEmpty=new pi,this.onStable=new pi,this.onError=new pi}run(t){return t()}runGuarded(t){return t()}runOutsideAngular(t){return t()}runTask(t){return t()}}class Zi{constructor(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this.taskTrackingZone=null,this._watchAngularEvents(),t.run(()=>{this.taskTrackingZone="undefined"==typeof Zone?null:Zone.current.get("TaskTrackingZone")})}_watchAngularEvents(){this._ngZone.onUnstable.subscribe({next:()=>{this._didWork=!0,this._isZoneStable=!1}}),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.subscribe({next:()=>{Bi.assertNotInAngularZone(),zi(()=>{this._isZoneStable=!0,this._runCallbacksIfReady()})}})})}increasePendingRequestCount(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount}decreasePendingRequestCount(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount}isStable(){return this._isZoneStable&&0===this._pendingCount&&!this._ngZone.hasPendingMacrotasks}_runCallbacksIfReady(){if(this.isStable())zi(()=>{for(;0!==this._callbacks.length;){let t=this._callbacks.pop();clearTimeout(t.timeoutId),t.doneCb(this._didWork)}this._didWork=!1});else{let t=this.getPendingTasks();this._callbacks=this._callbacks.filter(e=>!e.updateCb||!e.updateCb(t)||(clearTimeout(e.timeoutId),!1)),this._didWork=!0}}getPendingTasks(){return this.taskTrackingZone?this.taskTrackingZone.macroTasks.map(t=>({source:t.source,creationLocation:t.creationLocation,data:t.data})):[]}addCallback(t,e,n){let r=-1;e&&e>0&&(r=setTimeout(()=>{this._callbacks=this._callbacks.filter(t=>t.timeoutId!==r),t(this._didWork,this.getPendingTasks())},e)),this._callbacks.push({doneCb:t,timeoutId:r,updateCb:n})}whenStable(t,e,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');this.addCallback(t,e,n),this._runCallbacksIfReady()}getPendingRequestCount(){return this._pendingCount}findProviders(t,e,n){return[]}}class Yi{constructor(){this._applications=new Map,to.addToWindow(this)}registerApplication(t,e){this._applications.set(t,e)}unregisterApplication(t){this._applications.delete(t)}unregisterAllApplications(){this._applications.clear()}getTestability(t){return this._applications.get(t)||null}getAllTestabilities(){return Array.from(this._applications.values())}getAllRootElements(){return Array.from(this._applications.keys())}findTestabilityInTree(t,e=!0){return to.findTestabilityInTree(this,t,e)}}class Xi{addToWindow(t){}findTestabilityInTree(t,e,n){return null}}let Ji,to=new Xi;const eo=new It("AllowMultipleToken");class no{constructor(t,e){this.name=t,this.token=e}}function ro(t,e,n=[]){const r="Platform: "+e,i=new It(r);return(e=[])=>{let o=io();if(!o||o.injector.get(eo,!1))if(t)t(n.concat(e).concat({provide:i,useValue:!0}));else{const t=n.concat(e).concat({provide:i,useValue:!0});!function(t){if(Ji&&!Ji.destroyed&&!Ji.injector.get(eo,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");Ji=t.get(oo);const e=t.get(Ei,null);e&&e.forEach(t=>t())}(Te.create({providers:t,name:r}))}return function(t){const e=io();if(!e)throw new Error("No platform exists!");if(!e.injector.get(t,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(i)}}function io(){return Ji&&!Ji.destroyed?Ji:null}class oo{constructor(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}bootstrapModuleFactory(t,e){const n=function(t){let e;return e="noop"===t?new Qi:("zone.js"===t?void 0:t)||new Bi({enableLongStackTrace:$t()}),e}(e?e.ngZone:void 0),r=[{provide:Bi,useValue:n}];return n.run(()=>{const e=Te.create({providers:r,parent:this.injector,name:t.moduleType.name}),i=t.create(e),o=i.injector.get(Bt,null);if(!o)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return i.onDestroy(()=>uo(this._modules,i)),n.runOutsideAngular(()=>n.onError.subscribe({next:t=>{o.handleError(t)}})),function(t,e,n){try{const r=n();return qe(r)?r.catch(n=>{throw e.runOutsideAngular(()=>t.handleError(n)),n}):r}catch(r){throw e.runOutsideAngular(()=>t.handleError(r)),r}}(o,n,()=>{const t=i.injector.get(yi);return t.runInitializers(),t.donePromise.then(()=>(this._moduleDoBootstrap(i),i))})})}bootstrapModule(t,e=[]){const n=so({},e);return function(t,e,n){return t.get(Oi).createCompiler([e]).compileModuleAsync(n)}(this.injector,n,t).then(t=>this.bootstrapModuleFactory(t,n))}_moduleDoBootstrap(t){const e=t.injector.get(ao);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(t=>e.bootstrap(t));else{if(!t.instance.ngDoBootstrap)throw new Error(`The module ${gt(t.instance.constructor)} was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.`);t.instance.ngDoBootstrap(e)}this._modules.push(t)}onDestroy(t){this._destroyListeners.push(t)}get injector(){return this._injector}destroy(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(t=>t.destroy()),this._destroyListeners.forEach(t=>t()),this._destroyed=!0}get destroyed(){return this._destroyed}}function so(t,e){return Array.isArray(e)?e.reduce(so,t):Object.assign({},t,e)}let ao=(()=>{class t{constructor(t,e,n,r,i,o){this._zone=t,this._console=e,this._injector=n,this._exceptionHandler=r,this._componentFactoryResolver=i,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._enforceNoNewChanges=$t(),this._zone.onMicrotaskEmpty.subscribe({next:()=>{this._zone.run(()=>{this.tick()})}});const s=new _(t=>{this._stable=this._zone.isStable&&!this._zone.hasPendingMacrotasks&&!this._zone.hasPendingMicrotasks,this._zone.runOutsideAngular(()=>{t.next(this._stable),t.complete()})}),a=new _(t=>{let e;this._zone.runOutsideAngular(()=>{e=this._zone.onStable.subscribe(()=>{Bi.assertNotInAngularZone(),zi(()=>{this._stable||this._zone.hasPendingMacrotasks||this._zone.hasPendingMicrotasks||(this._stable=!0,t.next(!0))})})});const n=this._zone.onUnstable.subscribe(()=>{Bi.assertInAngularZone(),this._stable&&(this._stable=!1,this._zone.runOutsideAngular(()=>{t.next(!1)}))});return()=>{e.unsubscribe(),n.unsubscribe()}});this.isStable=function(...t){let e=Number.POSITIVE_INFINITY,n=null,r=t[t.length-1];return N(r)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(e=t.pop())):"number"==typeof r&&(e=t.pop()),null===n&&1===t.length&&t[0]instanceof _?t[0]:Y(e)(G(t,n))}(s,a.pipe(t=>{return X()((e=it,function(t){let n;n="function"==typeof e?e:function(){return e};const r=Object.create(t,nt);return r.source=t,r.subjectFactory=n,r})(t));var e}))}bootstrap(t,e){if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");let n;n=t instanceof He?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);const r=n instanceof Ze?null:this._injector.get(Pt),i=n.create(Te.NULL,[],e||n.selector,r);i.onDestroy(()=>{this._unloadComponent(i)});const o=i.injector.get(Zi,null);return o&&i.injector.get(Yi).registerApplication(i.location.nativeElement,o),this._loadComponent(i),$t()&&this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode."),i}tick(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");const e=t._tickScope();try{this._runningTick=!0;for(let t of this._views)t.detectChanges();if(this._enforceNoNewChanges)for(let t of this._views)t.checkNoChanges()}catch(n){this._zone.runOutsideAngular(()=>this._exceptionHandler.handleError(n))}finally{this._runningTick=!1,Fi(e)}}attachView(t){const e=t;this._views.push(e),e.attachToAppRef(this)}detachView(t){const e=t;uo(this._views,e),e.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Ii,[]).concat(this._bootstrapListeners).forEach(e=>e(t))}_unloadComponent(t){this.detachView(t.hostView),uo(this.components,t)}ngOnDestroy(){this._views.slice().forEach(t=>t.destroy())}get viewCount(){return this._views.length}}return t._tickScope=ji("ApplicationRef#tick()"),t})();function uo(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class co{}class lo{}const ho={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"};class fo{constructor(t,e){this._compiler=t,this._config=e||ho}load(t){return this._compiler instanceof Di?this.loadFactory(t):this.loadAndCompile(t)}loadAndCompile(t){let[e,r]=t.split("#");return void 0===r&&(r="default"),n("zn8P")(e).then(t=>t[r]).then(t=>po(t,e,r)).then(t=>this._compiler.compileModuleAsync(t))}loadFactory(t){let[e,r]=t.split("#"),i="NgFactory";return void 0===r&&(r="default",i=""),n("zn8P")(this._config.factoryPathPrefix+e+this._config.factoryPathSuffix).then(t=>t[r+i]).then(t=>po(t,e,r))}}function po(t,e,n){if(!t)throw new Error(`Cannot find '${n}' in '${e}'`);return t}class go{constructor(t,e){this.name=t,this.callback=e}}class vo{constructor(t,e,n){this.listeners=[],this.parent=null,this._debugContext=n,this.nativeNode=t,e&&e instanceof mo&&e.addChild(this)}get injector(){return this._debugContext.injector}get componentInstance(){return this._debugContext.component}get context(){return this._debugContext.context}get references(){return this._debugContext.references}get providerTokens(){return this._debugContext.providerTokens}}class mo extends vo{constructor(t,e,n){super(t,e,n),this.properties={},this.attributes={},this.classes={},this.styles={},this.childNodes=[],this.nativeElement=t}addChild(t){t&&(this.childNodes.push(t),t.parent=this)}removeChild(t){const e=this.childNodes.indexOf(t);-1!==e&&(t.parent=null,this.childNodes.splice(e,1))}insertChildrenAfter(t,e){const n=this.childNodes.indexOf(t);-1!==n&&(this.childNodes.splice(n+1,0,...e),e.forEach(e=>{e.parent&&e.parent.removeChild(e),t.parent=this}))}insertBefore(t,e){const n=this.childNodes.indexOf(t);-1===n?this.addChild(e):(e.parent&&e.parent.removeChild(e),e.parent=this,this.childNodes.splice(n,0,e))}query(t){return this.queryAll(t)[0]||null}queryAll(t){const e=[];return function t(e,n,r){e.childNodes.forEach(e=>{e instanceof mo&&(n(e)&&r.push(e),t(e,n,r))})}(this,t,e),e}queryAllNodes(t){const e=[];return function t(e,n,r){e instanceof mo&&e.childNodes.forEach(e=>{n(e)&&r.push(e),e instanceof mo&&t(e,n,r)})}(this,t,e),e}get children(){return this.childNodes.filter(t=>t instanceof mo)}triggerEventHandler(t,e){this.listeners.forEach(n=>{n.name==t&&n.callback(e)})}}const yo=new Map,wo=function(t){return yo.get(t)||null};function bo(t){yo.set(t.nativeNode,t)}const _o=ro(null,"core",[{provide:Si,useValue:"unknown"},{provide:oo,deps:[Te]},{provide:Yi,deps:[]},{provide:Ti,deps:[]}]);function Eo(){return _n}function So(){return En}function Io(t){return t||"en-US"}function To(t){let e=[];return t.onStable.subscribe(()=>{for(;e.length;)e.pop()()}),function(t){e.push(t)}}class xo{constructor(t){}}function Co(t,e,n,r,i,o){t|=1;const{matchedQueries:s,references:a,matchedQueryIds:u}=er(e);return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,flags:t,checkIndex:-1,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:s,matchedQueryIds:u,references:a,ngContentIndex:n,childCount:r,bindings:[],bindingFlags:0,outputs:[],element:{ns:null,name:null,attrs:null,template:o?or(o):null,componentProvider:null,componentView:null,componentRendererType:null,publicProviders:null,allProviders:null,handleEvent:i||Vn},provider:null,text:null,query:null,ngContent:null}}function Ao(t,e,n,r,i,o,s=[],a,u,c,l,h){c||(c=Vn);const{matchedQueries:f,references:d,matchedQueryIds:p}=er(n);let g=null,v=null;o&&([g,v]=fr(o)),a=a||[];const m=new Array(a.length);for(let b=0;b<a.length;b++){const[t,e,n]=a[b],[r,i]=fr(e);let o=void 0,s=void 0;switch(15&t){case 4:s=n;break;case 1:case 8:o=n}m[b]={flags:t,ns:r,name:i,nonMinifiedName:i,securityContext:o,suffix:s}}u=u||[];const y=new Array(u.length);for(let b=0;b<u.length;b++){const[t,e]=u[b];y[b]={type:0,target:t,eventName:e,propName:null}}const w=(s=s||[]).map(([t,e])=>{const[n,r]=fr(t);return[n,r,e]});return h=function(t){if(t&&"$$undefined"===t.id){const e=null!=t.encapsulation&&t.encapsulation!==Vt.None||t.styles.length||Object.keys(t.data).length;t.id=e?"c"+zn++:"$$empty"}return t&&"$$empty"===t.id&&(t=null),t||null}(h),l&&(e|=33554432),{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:t,flags:e|=1,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:f,matchedQueryIds:p,references:d,ngContentIndex:r,childCount:i,bindings:m,bindingFlags:dr(m),outputs:y,element:{ns:g,name:v,attrs:w,template:null,componentProvider:null,componentView:l||null,componentRendererType:h,publicProviders:null,allProviders:null,handleEvent:c||Vn},provider:null,text:null,query:null,ngContent:null}}function No(t,e,n){const r=n.element,i=t.root.selectorOrNode,o=t.renderer;let s;if(t.parent||!i){s=r.name?o.createElement(r.name,r.ns):o.createComment("");const i=rr(t,e,n);i&&o.appendChild(i,s)}else s=o.selectRootElement(i,!!r.componentRendererType&&r.componentRendererType.encapsulation===Vt.ShadowDom);if(r.attrs)for(let a=0;a<r.attrs.length;a++){const[t,e,n]=r.attrs[a];o.setAttribute(s,e,n,t)}return s}function ko(t,e,n,r){for(let i=0;i<n.outputs.length;i++){const o=n.outputs[i],s=Ro(t,n.nodeIndex,Xn(o.target,o.eventName));let a=o.target,u=t;"component"===o.target&&(a=null,u=e);const c=u.renderer.listen(a||r,o.eventName,s);t.disposables[n.outputIndex+i]=c}}function Ro(t,e,n){return r=>Kn(t,e,n,r)}function Do(t,e,n,r){if(!Hn(t,e,n,r))return!1;const i=e.bindings[n],o=On(t,e.nodeIndex),s=o.renderElement,a=i.name;switch(15&i.flags){case 1:!function(t,e,n,r,i,o){const s=e.securityContext;let a=s?t.root.sanitizer.sanitize(s,o):o;a=null!=a?a.toString():null;const u=t.renderer;null!=o?u.setAttribute(n,i,a,r):u.removeAttribute(n,i,r)}(t,i,s,i.ns,a,r);break;case 2:!function(t,e,n,r){const i=t.renderer;r?i.addClass(e,n):i.removeClass(e,n)}(t,s,a,r);break;case 4:!function(t,e,n,r,i){let o=t.root.sanitizer.sanitize(pe.STYLE,i);if(null!=o){o=o.toString();const t=e.suffix;null!=t&&(o+=t)}else o=null;const s=t.renderer;null!=o?s.setStyle(n,r,o):s.removeStyle(n,r)}(t,i,s,a,r);break;case 8:!function(t,e,n,r,i){const o=e.securityContext;let s=o?t.root.sanitizer.sanitize(o,i):i;t.renderer.setProperty(n,r,s)}(33554432&e.flags&&32&i.flags?o.componentView:t,i,s,a,r)}return!0}function Oo(t){const e=t.def.nodeMatchedQueries;for(;t.parent&&tr(t);){let n=t.parentNodeDef;t=t.parent;const r=n.nodeIndex+n.childCount;for(let i=0;i<=r;i++){const r=t.def.nodes[i];67108864&r.flags&&536870912&r.flags&&(r.query.filterId&e)===r.query.filterId&&Un(t,i).setDirty(),!(1&r.flags&&i+r.childCount<n.nodeIndex)&&67108864&r.childFlags&&536870912&r.childFlags||(i+=r.childCount)}}if(134217728&t.def.nodeFlags)for(let n=0;n<t.def.nodes.length;n++){const e=t.def.nodes[n];134217728&e.flags&&536870912&e.flags&&Un(t,n).setDirty(),n+=e.childCount}}function Po(t,e){const n=Un(t,e.nodeIndex);if(!n.dirty)return;let r,i=void 0;if(67108864&e.flags){const n=e.parent.parent;i=Lo(t,n.nodeIndex,n.nodeIndex+n.childCount,e.query,[]),r=Pn(t,e.parent.nodeIndex).instance}else 134217728&e.flags&&(i=Lo(t,0,t.def.nodes.length-1,e.query,[]),r=t.component);n.reset(i);const o=e.query.bindings;let s=!1;for(let a=0;a<o.length;a++){const t=o[a];let e;switch(t.bindingType){case 0:e=n.first;break;case 1:e=n,s=!0}r[t.propName]=e}s&&n.notifyOnChanges()}function Lo(t,e,n,r,i){for(let o=e;o<=n;o++){const e=t.def.nodes[o],n=e.matchedQueries[r.id];if(null!=n&&i.push(Uo(t,e,n)),1&e.flags&&e.element.template&&(e.element.template.nodeMatchedQueries&r.filterId)===r.filterId){const n=On(t,o);if((e.childMatchedQueries&r.filterId)===r.filterId&&(Lo(t,o+1,o+e.childCount,r,i),o+=e.childCount),16777216&e.flags){const t=n.viewContainer._embeddedViews;for(let e=0;e<t.length;e++){const o=t[e],s=Qn(o);s&&s===n&&Lo(o,0,o.def.nodes.length-1,r,i)}}const s=n.template._projectedViews;if(s)for(let t=0;t<s.length;t++){const e=s[t];Lo(e,0,e.def.nodes.length-1,r,i)}}(e.childMatchedQueries&r.filterId)!==r.filterId&&(o+=e.childCount)}return i}function Uo(t,e,n){if(null!=n)switch(n){case 1:return On(t,e.nodeIndex).renderElement;case 0:return new Xe(On(t,e.nodeIndex).renderElement);case 2:return On(t,e.nodeIndex).template;case 3:return On(t,e.nodeIndex).viewContainer;case 4:return Pn(t,e.nodeIndex).instance}}function Mo(t,e,n){const r=rr(t,e,n);r&&ur(t,n.ngContent.index,1,r,null,void 0)}function Vo(t,e,n){const r=new Array(n.length-1);for(let i=1;i<n.length;i++)r[i-1]={flags:8,name:null,ns:null,nonMinifiedName:null,securityContext:null,suffix:n[i]};return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:t,flags:2,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:e,childCount:0,bindings:r,bindingFlags:8,outputs:[],element:null,provider:null,text:{prefix:n[0]},query:null,ngContent:null}}function jo(t,e,n){let r;const i=t.renderer;r=i.createText(n.text.prefix);const o=rr(t,e,n);return o&&i.appendChild(o,r),{renderText:r}}function Fo(t,e){return(null!=t?t.toString():"")+e.suffix}function qo(t,e,n,r){let i=0,o=0,s=0,a=0,u=0,c=null,l=null,h=!1,f=!1,d=null;for(let p=0;p<e.length;p++){const t=e[p];if(t.nodeIndex=p,t.parent=c,t.bindingIndex=i,t.outputIndex=o,t.renderParent=l,s|=t.flags,u|=t.matchedQueryIds,t.element){const e=t.element;e.publicProviders=c?c.element.publicProviders:Object.create(null),e.allProviders=e.publicProviders,h=!1,f=!1,t.element.template&&(u|=t.element.template.nodeMatchedQueries)}if(Bo(c,t,e.length),i+=t.bindings.length,o+=t.outputs.length,!l&&3&t.flags&&(d=t),20224&t.flags){h||(h=!0,c.element.publicProviders=Object.create(c.element.publicProviders),c.element.allProviders=c.element.publicProviders);const e=0!=(32768&t.flags);0==(8192&t.flags)||e?c.element.publicProviders[Fn(t.provider.token)]=t:(f||(f=!0,c.element.allProviders=Object.create(c.element.publicProviders)),c.element.allProviders[Fn(t.provider.token)]=t),e&&(c.element.componentProvider=t)}if(c?(c.childFlags|=t.flags,c.directChildFlags|=t.flags,c.childMatchedQueries|=t.matchedQueryIds,t.element&&t.element.template&&(c.childMatchedQueries|=t.element.template.nodeMatchedQueries)):a|=t.flags,t.childCount>0)c=t,zo(t)||(l=t);else for(;c&&p===c.nodeIndex+c.childCount;){const t=c.parent;t&&(t.childFlags|=c.childFlags,t.childMatchedQueries|=c.childMatchedQueries),c=t,l=c&&zo(c)?c.renderParent:c}}return{factory:null,nodeFlags:s,rootNodeFlags:a,nodeMatchedQueries:u,flags:t,nodes:e,updateDirectives:n||Vn,updateRenderer:r||Vn,handleEvent:(t,n,r,i)=>e[n].element.handleEvent(t,r,i),bindingCount:i,outputCount:o,lastRenderRootNode:d}}function zo(t){return 0!=(1&t.flags)&&null===t.element.name}function Bo(t,e,n){const r=e.element&&e.element.template;if(r){if(!r.lastRenderRootNode)throw new Error("Illegal State: Embedded templates without nodes are not allowed!");if(r.lastRenderRootNode&&16777216&r.lastRenderRootNode.flags)throw new Error(`Illegal State: Last root node of a template can't have embedded views, at index ${e.nodeIndex}!`)}if(20224&e.flags&&0==(1&(t?t.flags:0)))throw new Error(`Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index ${e.nodeIndex}!`);if(e.query){if(67108864&e.flags&&(!t||0==(16384&t.flags)))throw new Error(`Illegal State: Content Query nodes need to be children of directives, at index ${e.nodeIndex}!`);if(134217728&e.flags&&t)throw new Error(`Illegal State: View Query nodes have to be top level nodes, at index ${e.nodeIndex}!`)}if(e.childCount){const r=t?t.nodeIndex+t.childCount:n-1;if(e.nodeIndex<=r&&e.nodeIndex+e.childCount>r)throw new Error(`Illegal State: childCount of node leads outside of parent, at index ${e.nodeIndex}!`)}}function Ho(t,e,n,r){const i=Wo(t.root,t.renderer,t,e,n);return Ko(i,t.component,r),Qo(i),i}function Go(t,e,n){const r=Wo(t,t.renderer,null,null,e);return Ko(r,n,n),Qo(r),r}function $o(t,e,n,r){const i=e.element.componentRendererType;let o;return o=i?t.root.rendererFactory.createRenderer(r,i):t.root.renderer,Wo(t.root,o,t,e.element.componentProvider,n)}function Wo(t,e,n,r,i){const o=new Array(i.nodes.length),s=i.outputCount?new Array(i.outputCount):null;return{def:i,parent:n,viewContainerParent:null,parentNodeDef:r,context:null,component:null,nodes:o,state:13,root:t,renderer:e,oldValues:new Array(i.bindingCount),disposables:s,initIndex:-1}}function Ko(t,e,n){t.component=e,t.context=n}function Qo(t){let e;Jn(t)&&(e=On(t.parent,t.parentNodeDef.parent.nodeIndex).renderElement);const n=t.def,r=t.nodes;for(let i=0;i<n.nodes.length;i++){const o=n.nodes[i];let s;switch(Mn.setCurrentNode(t,i),201347067&o.flags){case 1:const n=No(t,e,o);let a=void 0;if(33554432&o.flags){const e=or(o.element.componentView);a=Mn.createComponentView(t,o,e,n)}ko(t,a,o,n),s={renderElement:n,componentView:a,viewContainer:null,template:o.element.template?Dr(t,o):void 0},16777216&o.flags&&(s.viewContainer=Ar(t,o,s));break;case 2:s=jo(t,e,o);break;case 512:case 1024:case 2048:case 256:s=r[i],s||4096&o.flags||(s={instance:Zr(t,o)});break;case 16:s={instance:Yr(t,o)};break;case 16384:s=r[i],s||(s={instance:Xr(t,o)}),32768&o.flags&&Ko(On(t,o.parent.nodeIndex).componentView,s.instance,s.instance);break;case 32:case 64:case 128:s={value:void 0};break;case 67108864:case 134217728:s=new vi;break;case 8:Mo(t,e,o),s=void 0}r[i]=s}is(t,rs.CreateViewNodes),us(t,201326592,268435456,0)}function Zo(t){Jo(t),Mn.updateDirectives(t,1),os(t,rs.CheckNoChanges),Mn.updateRenderer(t,1),is(t,rs.CheckNoChanges),t.state&=-97}function Yo(t){1&t.state?(t.state&=-2,t.state|=2):t.state&=-3,kn(t,0,256),Jo(t),Mn.updateDirectives(t,0),os(t,rs.CheckAndUpdate),us(t,67108864,536870912,0);let e=kn(t,256,512);si(t,2097152|(e?1048576:0)),Mn.updateRenderer(t,0),is(t,rs.CheckAndUpdate),us(t,134217728,536870912,0),e=kn(t,512,768),si(t,8388608|(e?4194304:0)),2&t.def.flags&&(t.state&=-9),t.state&=-97,kn(t,768,1024)}function Xo(t,e,n,r,i,o,s,a,u,c,l,h,f){return 0===n?function(t,e,n,r,i,o,s,a,u,c,l,h){switch(201347067&e.flags){case 1:return function(t,e,n,r,i,o,s,a,u,c,l,h){const f=e.bindings.length;let d=!1;return f>0&&Do(t,e,0,n)&&(d=!0),f>1&&Do(t,e,1,r)&&(d=!0),f>2&&Do(t,e,2,i)&&(d=!0),f>3&&Do(t,e,3,o)&&(d=!0),f>4&&Do(t,e,4,s)&&(d=!0),f>5&&Do(t,e,5,a)&&(d=!0),f>6&&Do(t,e,6,u)&&(d=!0),f>7&&Do(t,e,7,c)&&(d=!0),f>8&&Do(t,e,8,l)&&(d=!0),f>9&&Do(t,e,9,h)&&(d=!0),d}(t,e,n,r,i,o,s,a,u,c,l,h);case 2:return function(t,e,n,r,i,o,s,a,u,c,l,h){let f=!1;const d=e.bindings,p=d.length;if(p>0&&Hn(t,e,0,n)&&(f=!0),p>1&&Hn(t,e,1,r)&&(f=!0),p>2&&Hn(t,e,2,i)&&(f=!0),p>3&&Hn(t,e,3,o)&&(f=!0),p>4&&Hn(t,e,4,s)&&(f=!0),p>5&&Hn(t,e,5,a)&&(f=!0),p>6&&Hn(t,e,6,u)&&(f=!0),p>7&&Hn(t,e,7,c)&&(f=!0),p>8&&Hn(t,e,8,l)&&(f=!0),p>9&&Hn(t,e,9,h)&&(f=!0),f){let f=e.text.prefix;p>0&&(f+=Fo(n,d[0])),p>1&&(f+=Fo(r,d[1])),p>2&&(f+=Fo(i,d[2])),p>3&&(f+=Fo(o,d[3])),p>4&&(f+=Fo(s,d[4])),p>5&&(f+=Fo(a,d[5])),p>6&&(f+=Fo(u,d[6])),p>7&&(f+=Fo(c,d[7])),p>8&&(f+=Fo(l,d[8])),p>9&&(f+=Fo(h,d[9]));const g=Dn(t,e.nodeIndex).renderText;t.renderer.setValue(g,f)}return f}(t,e,n,r,i,o,s,a,u,c,l,h);case 16384:return function(t,e,n,r,i,o,s,a,u,c,l,h){const f=Pn(t,e.nodeIndex),d=f.instance;let p=!1,g=void 0;const v=e.bindings.length;return v>0&&Bn(t,e,0,n)&&(p=!0,g=oi(t,f,e,0,n,g)),v>1&&Bn(t,e,1,r)&&(p=!0,g=oi(t,f,e,1,r,g)),v>2&&Bn(t,e,2,i)&&(p=!0,g=oi(t,f,e,2,i,g)),v>3&&Bn(t,e,3,o)&&(p=!0,g=oi(t,f,e,3,o,g)),v>4&&Bn(t,e,4,s)&&(p=!0,g=oi(t,f,e,4,s,g)),v>5&&Bn(t,e,5,a)&&(p=!0,g=oi(t,f,e,5,a,g)),v>6&&Bn(t,e,6,u)&&(p=!0,g=oi(t,f,e,6,u,g)),v>7&&Bn(t,e,7,c)&&(p=!0,g=oi(t,f,e,7,c,g)),v>8&&Bn(t,e,8,l)&&(p=!0,g=oi(t,f,e,8,l,g)),v>9&&Bn(t,e,9,h)&&(p=!0,g=oi(t,f,e,9,h,g)),g&&d.ngOnChanges(g),65536&e.flags&&Rn(t,256,e.nodeIndex)&&d.ngOnInit(),262144&e.flags&&d.ngDoCheck(),p}(t,e,n,r,i,o,s,a,u,c,l,h);case 32:case 64:case 128:return function(t,e,n,r,i,o,s,a,u,c,l,h){const f=e.bindings;let d=!1;const p=f.length;if(p>0&&Hn(t,e,0,n)&&(d=!0),p>1&&Hn(t,e,1,r)&&(d=!0),p>2&&Hn(t,e,2,i)&&(d=!0),p>3&&Hn(t,e,3,o)&&(d=!0),p>4&&Hn(t,e,4,s)&&(d=!0),p>5&&Hn(t,e,5,a)&&(d=!0),p>6&&Hn(t,e,6,u)&&(d=!0),p>7&&Hn(t,e,7,c)&&(d=!0),p>8&&Hn(t,e,8,l)&&(d=!0),p>9&&Hn(t,e,9,h)&&(d=!0),d){const d=Ln(t,e.nodeIndex);let g;switch(201347067&e.flags){case 32:g=new Array(f.length),p>0&&(g[0]=n),p>1&&(g[1]=r),p>2&&(g[2]=i),p>3&&(g[3]=o),p>4&&(g[4]=s),p>5&&(g[5]=a),p>6&&(g[6]=u),p>7&&(g[7]=c),p>8&&(g[8]=l),p>9&&(g[9]=h);break;case 64:g={},p>0&&(g[f[0].name]=n),p>1&&(g[f[1].name]=r),p>2&&(g[f[2].name]=i),p>3&&(g[f[3].name]=o),p>4&&(g[f[4].name]=s),p>5&&(g[f[5].name]=a),p>6&&(g[f[6].name]=u),p>7&&(g[f[7].name]=c),p>8&&(g[f[8].name]=l),p>9&&(g[f[9].name]=h);break;case 128:const t=n;switch(p){case 1:g=t.transform(n);break;case 2:g=t.transform(r);break;case 3:g=t.transform(r,i);break;case 4:g=t.transform(r,i,o);break;case 5:g=t.transform(r,i,o,s);break;case 6:g=t.transform(r,i,o,s,a);break;case 7:g=t.transform(r,i,o,s,a,u);break;case 8:g=t.transform(r,i,o,s,a,u,c);break;case 9:g=t.transform(r,i,o,s,a,u,c,l);break;case 10:g=t.transform(r,i,o,s,a,u,c,l,h)}}d.value=g}return d}(t,e,n,r,i,o,s,a,u,c,l,h);default:throw"unreachable"}}(t,e,r,i,o,s,a,u,c,l,h,f):function(t,e,n){switch(201347067&e.flags){case 1:return function(t,e,n){let r=!1;for(let i=0;i<n.length;i++)Do(t,e,i,n[i])&&(r=!0);return r}(t,e,n);case 2:return function(t,e,n){const r=e.bindings;let i=!1;for(let o=0;o<n.length;o++)Hn(t,e,o,n[o])&&(i=!0);if(i){let i="";for(let t=0;t<n.length;t++)i+=Fo(n[t],r[t]);i=e.text.prefix+i;const o=Dn(t,e.nodeIndex).renderText;t.renderer.setValue(o,i)}return i}(t,e,n);case 16384:return function(t,e,n){const r=Pn(t,e.nodeIndex),i=r.instance;let o=!1,s=void 0;for(let a=0;a<n.length;a++)Bn(t,e,a,n[a])&&(o=!0,s=oi(t,r,e,a,n[a],s));return s&&i.ngOnChanges(s),65536&e.flags&&Rn(t,256,e.nodeIndex)&&i.ngOnInit(),262144&e.flags&&i.ngDoCheck(),o}(t,e,n);case 32:case 64:case 128:return function(t,e,n){const r=e.bindings;let i=!1;for(let o=0;o<n.length;o++)Hn(t,e,o,n[o])&&(i=!0);if(i){const i=Ln(t,e.nodeIndex);let o;switch(201347067&e.flags){case 32:o=n;break;case 64:o={};for(let i=0;i<n.length;i++)o[r[i].name]=n[i];break;case 128:const t=n[0],e=n.slice(1);o=t.transform(...e)}i.value=o}return i}(t,e,n);default:throw"unreachable"}}(t,e,r)}function Jo(t){const e=t.def;if(4&e.nodeFlags)for(let n=0;n<e.nodes.length;n++){const r=e.nodes[n];if(4&r.flags){const e=On(t,n).template._projectedViews;if(e)for(let n=0;n<e.length;n++){const r=e[n];r.state|=32,Wn(r,t)}}else 0==(4&r.childFlags)&&(n+=r.childCount)}}function ts(t,e,n,r,i,o,s,a,u,c,l,h,f){return 0===n?function(t,e,n,r,i,o,s,a,u,c,l,h){const f=e.bindings.length;f>0&&Gn(t,e,0,n),f>1&&Gn(t,e,1,r),f>2&&Gn(t,e,2,i),f>3&&Gn(t,e,3,o),f>4&&Gn(t,e,4,s),f>5&&Gn(t,e,5,a),f>6&&Gn(t,e,6,u),f>7&&Gn(t,e,7,c),f>8&&Gn(t,e,8,l),f>9&&Gn(t,e,9,h)}(t,e,r,i,o,s,a,u,c,l,h,f):function(t,e,n){for(let r=0;r<n.length;r++)Gn(t,e,r,n[r])}(t,e,r),!1}function es(t,e){if(Un(t,e.nodeIndex).dirty)throw Cn(Mn.createDebugContext(t,e.nodeIndex),`Query ${e.query.id} not dirty`,`Query ${e.query.id} dirty`,0!=(1&t.state))}function ns(t){if(!(128&t.state)){if(os(t,rs.Destroy),is(t,rs.Destroy),si(t,131072),t.disposables)for(let e=0;e<t.disposables.length;e++)t.disposables[e]();!function(t){if(!(16&t.state))return;const e=Qn(t);if(e){const n=e.template._projectedViews;n&&(Mt(n,n.indexOf(t)),Mn.dirtyParentQueries(t))}}(t),t.renderer.destroyNode&&function(t){const e=t.def.nodes.length;for(let n=0;n<e;n++){const e=t.def.nodes[n];1&e.flags?t.renderer.destroyNode(On(t,n).renderElement):2&e.flags?t.renderer.destroyNode(Dn(t,n).renderText):(67108864&e.flags||134217728&e.flags)&&Un(t,n).destroy()}}(t),Jn(t)&&t.renderer.destroy(),t.state|=128}}const rs=function(){var t={CreateViewNodes:0,CheckNoChanges:1,CheckNoChangesProjectedViews:2,CheckAndUpdate:3,CheckAndUpdateProjectedViews:4,Destroy:5};return t[t.CreateViewNodes]="CreateViewNodes",t[t.CheckNoChanges]="CheckNoChanges",t[t.CheckNoChangesProjectedViews]="CheckNoChangesProjectedViews",t[t.CheckAndUpdate]="CheckAndUpdate",t[t.CheckAndUpdateProjectedViews]="CheckAndUpdateProjectedViews",t[t.Destroy]="Destroy",t}();function is(t,e){const n=t.def;if(33554432&n.nodeFlags)for(let r=0;r<n.nodes.length;r++){const i=n.nodes[r];33554432&i.flags?ss(On(t,r).componentView,e):0==(33554432&i.childFlags)&&(r+=i.childCount)}}function os(t,e){const n=t.def;if(16777216&n.nodeFlags)for(let r=0;r<n.nodes.length;r++){const i=n.nodes[r];if(16777216&i.flags){const n=On(t,r).viewContainer._embeddedViews;for(let t=0;t<n.length;t++)ss(n[t],e)}else 0==(16777216&i.childFlags)&&(r+=i.childCount)}}function ss(t,e){const n=t.state;switch(e){case rs.CheckNoChanges:0==(128&n)&&(12==(12&n)?Zo(t):64&n&&as(t,rs.CheckNoChangesProjectedViews));break;case rs.CheckNoChangesProjectedViews:0==(128&n)&&(32&n?Zo(t):64&n&&as(t,e));break;case rs.CheckAndUpdate:0==(128&n)&&(12==(12&n)?Yo(t):64&n&&as(t,rs.CheckAndUpdateProjectedViews));break;case rs.CheckAndUpdateProjectedViews:0==(128&n)&&(32&n?Yo(t):64&n&&as(t,e));break;case rs.Destroy:ns(t);break;case rs.CreateViewNodes:Qo(t)}}function as(t,e){os(t,e),is(t,e)}function us(t,e,n,r){if(!(t.def.nodeFlags&e&&t.def.nodeFlags&n))return;const i=t.def.nodes.length;for(let o=0;o<i;o++){const i=t.def.nodes[o];if(i.flags&e&&i.flags&n)switch(Mn.setCurrentNode(t,i.nodeIndex),r){case 0:Po(t,i);break;case 1:es(t,i)}i.childFlags&e&&i.childFlags&n||(o+=i.childCount)}}let cs=!1;function ls(t,e,n,r,i,o){const s=i.injector.get(en);return Go(fs(t,i,s,e,n),r,o)}function hs(t,e,n,r,i,o){const s=i.injector.get(en),a=fs(t,i,new Hs(s),e,n),u=Es(r);return zs(As.create,Go,null,[a,u,o])}function fs(t,e,n,r,i){const o=e.injector.get(ge),s=e.injector.get(Bt),a=n.createRenderer(null,null);return{ngModule:e,injector:t,projectableNodes:r,selectorOrNode:i,sanitizer:o,rendererFactory:n,renderer:a,errorHandler:s}}function ds(t,e,n,r){const i=Es(n);return zs(As.create,Ho,null,[t,e,i,r])}function ps(t,e,n,r){return n=ys.get(e.element.componentProvider.provider.token)||Es(n),zs(As.create,$o,null,[t,e,n,r])}function gs(t,e,n,r){return Vr(t,e,n,function(t){const{hasOverrides:e,hasDeprecatedOverrides:n}=function(t){let e=!1,n=!1;return 0===vs.size||(t.providers.forEach(t=>{const r=vs.get(t.token);3840&t.flags&&r&&(e=!0,n=n||r.deprecatedBehavior)}),t.modules.forEach(t=>{ms.forEach((r,i)=>{dt(i).providedIn===t&&(e=!0,n=n||r.deprecatedBehavior)})})),{hasOverrides:e,hasDeprecatedOverrides:n}}(t);return e?(function(t){for(let e=0;e<t.providers.length;e++){const r=t.providers[e];n&&(r.flags|=4096);const i=vs.get(r.token);i&&(r.flags=-3841&r.flags|i.flags,r.deps=nr(i.deps),r.value=i.value)}if(ms.size>0){let e=new Set(t.modules);ms.forEach((r,i)=>{if(e.has(dt(i).providedIn)){let e={token:i,flags:r.flags|(n?4096:0),deps:nr(r.deps),value:r.value,index:t.providers.length};t.providers.push(e),t.providersByKey[Fn(i)]=e}})}}(t=t.factory(()=>Vn)),t):t}(r))}const vs=new Map,ms=new Map,ys=new Map;function ws(t){let e;vs.set(t.token,t),"function"==typeof t.token&&(e=dt(t.token))&&"function"==typeof e.providedIn&&ms.set(t.token,t)}function bs(t,e){const n=or(e.viewDefFactory),r=or(n.nodes[0].element.componentView);ys.set(t,r)}function _s(){vs.clear(),ms.clear(),ys.clear()}function Es(t){if(0===vs.size)return t;const e=function(t){const e=[];let n=null;for(let r=0;r<t.nodes.length;r++){const i=t.nodes[r];1&i.flags&&(n=i),n&&3840&i.flags&&vs.has(i.provider.token)&&(e.push(n.nodeIndex),n=null)}return e}(t);if(0===e.length)return t;t=t.factory(()=>Vn);for(let r=0;r<e.length;r++)n(t,e[r]);return t;function n(t,e){for(let n=e+1;n<t.nodes.length;n++){const e=t.nodes[n];if(1&e.flags)return;if(3840&e.flags){const t=e.provider,n=vs.get(t.token);n&&(e.flags=-3841&e.flags|n.flags,t.deps=nr(n.deps),t.value=n.value)}}}}function Ss(t,e,n,r,i,o,s,a,u,c,l,h,f){const d=t.def.nodes[e];return Xo(t,d,n,r,i,o,s,a,u,c,l,h,f),224&d.flags?Ln(t,e).value:void 0}function Is(t,e,n,r,i,o,s,a,u,c,l,h,f){const d=t.def.nodes[e];return ts(t,d,n,r,i,o,s,a,u,c,l,h,f),224&d.flags?Ln(t,e).value:void 0}function Ts(t){return zs(As.detectChanges,Yo,null,[t])}function xs(t){return zs(As.checkNoChanges,Zo,null,[t])}function Cs(t){return zs(As.destroy,ns,null,[t])}const As=function(){var t={create:0,detectChanges:1,checkNoChanges:2,destroy:3,handleEvent:4};return t[t.create]="create",t[t.detectChanges]="detectChanges",t[t.checkNoChanges]="checkNoChanges",t[t.destroy]="destroy",t[t.handleEvent]="handleEvent",t}();let Ns,ks,Rs;function Ds(t,e){ks=t,Rs=e}function Os(t,e,n,r){return Ds(t,e),zs(As.handleEvent,t.def.handleEvent,null,[t,e,n,r])}function Ps(t,e){if(128&t.state)throw Nn(As[Ns]);return Ds(t,Vs(t,0)),t.def.updateDirectives((function(t,n,r,...i){const o=t.def.nodes[n];return 0===e?Us(t,o,r,i):Ms(t,o,r,i),16384&o.flags&&Ds(t,Vs(t,n)),224&o.flags?Ln(t,o.nodeIndex).value:void 0}),t)}function Ls(t,e){if(128&t.state)throw Nn(As[Ns]);return Ds(t,js(t,0)),t.def.updateRenderer((function(t,n,r,...i){const o=t.def.nodes[n];return 0===e?Us(t,o,r,i):Ms(t,o,r,i),3&o.flags&&Ds(t,js(t,n)),224&o.flags?Ln(t,o.nodeIndex).value:void 0}),t)}function Us(t,e,n,r){if(Xo(t,e,n,...r)){const i=1===n?r[0]:r;if(16384&e.flags){const n={};for(let t=0;t<e.bindings.length;t++){const r=e.bindings[t],o=i[t];8&r.flags&&(n[ye(r.nonMinifiedName)]=be(o))}const r=e.parent,o=On(t,r.nodeIndex).renderElement;if(r.element.name)for(let e in n){const r=n[e];null!=r?t.renderer.setAttribute(o,e,r):t.renderer.removeAttribute(o,e)}else t.renderer.setValue(o,"bindings="+JSON.stringify(n,null,2))}}}function Ms(t,e,n,r){ts(t,e,n,...r)}function Vs(t,e){for(let n=e;n<t.def.nodes.length;n++){const e=t.def.nodes[n];if(16384&e.flags&&e.bindings&&e.bindings.length)return n}return null}function js(t,e){for(let n=e;n<t.def.nodes.length;n++){const e=t.def.nodes[n];if(3&e.flags&&e.bindings&&e.bindings.length)return n}return null}class Fs{constructor(t,e){this.view=t,this.nodeIndex=e,null==e&&(this.nodeIndex=e=0),this.nodeDef=t.def.nodes[e];let n=this.nodeDef,r=t;for(;n&&0==(1&n.flags);)n=n.parent;if(!n)for(;!n&&r;)n=Zn(r),r=r.parent;this.elDef=n,this.elView=r}get elOrCompView(){return On(this.elView,this.elDef.nodeIndex).componentView||this.view}get injector(){return Pr(this.elView,this.elDef)}get component(){return this.elOrCompView.component}get context(){return this.elOrCompView.context}get providerTokens(){const t=[];if(this.elDef)for(let e=this.elDef.nodeIndex+1;e<=this.elDef.nodeIndex+this.elDef.childCount;e++){const n=this.elView.def.nodes[e];20224&n.flags&&t.push(n.provider.token),e+=n.childCount}return t}get references(){const t={};if(this.elDef){qs(this.elView,this.elDef,t);for(let e=this.elDef.nodeIndex+1;e<=this.elDef.nodeIndex+this.elDef.childCount;e++){const n=this.elView.def.nodes[e];20224&n.flags&&qs(this.elView,n,t),e+=n.childCount}}return t}get componentRenderElement(){const t=function(t){for(;t&&!Jn(t);)t=t.parent;return t.parent?On(t.parent,Zn(t).nodeIndex):null}(this.elOrCompView);return t?t.renderElement:void 0}get renderNode(){return 2&this.nodeDef.flags?Yn(this.view,this.nodeDef):Yn(this.elView,this.elDef)}logError(t,...e){let n,r;2&this.nodeDef.flags?(n=this.view.def,r=this.nodeDef.nodeIndex):(n=this.elView.def,r=this.elDef.nodeIndex);const i=function(t,e){let n=-1;for(let r=0;r<=e;r++)3&t.nodes[r].flags&&n++;return n}(n,r);let o=-1;n.factory(()=>(o++,o===i?t.error.bind(t,...e):Vn)),o<i&&(t.error("Illegal state: the ViewDefinitionFactory did not call the logger!"),t.error(...e))}}function qs(t,e,n){for(let r in e.references)n[r]=Uo(t,e,e.references[r])}function zs(t,e,n,r){const i=Ns,o=ks,s=Rs;try{Ns=t;const a=e.apply(n,r);return ks=o,Rs=s,Ns=i,a}catch(a){if(Ft(a)||!ks)throw a;throw function(t,e){return t instanceof Error||(t=new Error(t.toString())),An(t,e),t}(a,Bs())}}function Bs(){return ks?new Fs(ks,Rs):null}class Hs{constructor(t){this.delegate=t}createRenderer(t,e){return new Gs(this.delegate.createRenderer(t,e))}begin(){this.delegate.begin&&this.delegate.begin()}end(){this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.delegate.whenRenderingDone?this.delegate.whenRenderingDone():Promise.resolve(null)}}class Gs{constructor(t){this.delegate=t,this.debugContextFactory=Bs,this.data=this.delegate.data}createDebugContext(t){return this.debugContextFactory(t)}destroyNode(t){const e=wo(t);!function(t){yo.delete(t.nativeNode)}(e),e instanceof vo&&(e.listeners.length=0),this.delegate.destroyNode&&this.delegate.destroyNode(t)}destroy(){this.delegate.destroy()}createElement(t,e){const n=this.delegate.createElement(t,e),r=this.createDebugContext(n);if(r){const e=new mo(n,null,r);e.name=t,bo(e)}return n}createComment(t){const e=this.delegate.createComment(t),n=this.createDebugContext(e);return n&&bo(new vo(e,null,n)),e}createText(t){const e=this.delegate.createText(t),n=this.createDebugContext(e);return n&&bo(new vo(e,null,n)),e}appendChild(t,e){const n=wo(t),r=wo(e);n&&r&&n instanceof mo&&n.addChild(r),this.delegate.appendChild(t,e)}insertBefore(t,e,n){const r=wo(t),i=wo(e),o=wo(n);r&&i&&r instanceof mo&&r.insertBefore(o,i),this.delegate.insertBefore(t,e,n)}removeChild(t,e){const n=wo(t),r=wo(e);n&&r&&n instanceof mo&&n.removeChild(r),this.delegate.removeChild(t,e)}selectRootElement(t,e){const n=this.delegate.selectRootElement(t,e),r=Bs();return r&&bo(new mo(n,null,r)),n}setAttribute(t,e,n,r){const i=wo(t);i&&i instanceof mo&&(i.attributes[r?r+":"+e:e]=n),this.delegate.setAttribute(t,e,n,r)}removeAttribute(t,e,n){const r=wo(t);r&&r instanceof mo&&(r.attributes[n?n+":"+e:e]=null),this.delegate.removeAttribute(t,e,n)}addClass(t,e){const n=wo(t);n&&n instanceof mo&&(n.classes[e]=!0),this.delegate.addClass(t,e)}removeClass(t,e){const n=wo(t);n&&n instanceof mo&&(n.classes[e]=!1),this.delegate.removeClass(t,e)}setStyle(t,e,n,r){const i=wo(t);i&&i instanceof mo&&(i.styles[e]=n),this.delegate.setStyle(t,e,n,r)}removeStyle(t,e,n){const r=wo(t);r&&r instanceof mo&&(r.styles[e]=null),this.delegate.removeStyle(t,e,n)}setProperty(t,e,n){const r=wo(t);r&&r instanceof mo&&(r.properties[e]=n),this.delegate.setProperty(t,e,n)}listen(t,e,n){if("string"!=typeof t){const r=wo(t);r&&r.listeners.push(new go(e,n))}return this.delegate.listen(t,e,n)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setValue(t,e){return this.delegate.setValue(t,e)}}function $s(t,e,n){return new Ws(t,e,n)}class Ws extends Lt{constructor(t,e,n){super(),this.moduleType=t,this._bootstrapComponents=e,this._ngModuleDefFactory=n}create(t){!function(){if(cs)return;cs=!0;const t=$t()?{setCurrentNode:Ds,createRootView:hs,createEmbeddedView:ds,createComponentView:ps,createNgModuleRef:gs,overrideProvider:ws,overrideComponentView:bs,clearOverrides:_s,checkAndUpdateView:Ts,checkNoChangesView:xs,destroyView:Cs,createDebugContext:(t,e)=>new Fs(t,e),handleEvent:Os,updateDirectives:Ps,updateRenderer:Ls}:{setCurrentNode:()=>{},createRootView:ls,createEmbeddedView:Ho,createComponentView:$o,createNgModuleRef:Vr,overrideProvider:Vn,overrideComponentView:Vn,clearOverrides:Vn,checkAndUpdateView:Yo,checkNoChangesView:Zo,destroyView:ns,createDebugContext:(t,e)=>new Fs(t,e),handleEvent:(t,e,n,r)=>t.def.handleEvent(t,e,n,r),updateDirectives:(t,e)=>t.def.updateDirectives(0===e?Ss:Is,t),updateRenderer:(t,e)=>t.def.updateRenderer(0===e?Ss:Is,t)};Mn.setCurrentNode=t.setCurrentNode,Mn.createRootView=t.createRootView,Mn.createEmbeddedView=t.createEmbeddedView,Mn.createComponentView=t.createComponentView,Mn.createNgModuleRef=t.createNgModuleRef,Mn.overrideProvider=t.overrideProvider,Mn.overrideComponentView=t.overrideComponentView,Mn.clearOverrides=t.clearOverrides,Mn.checkAndUpdateView=t.checkAndUpdateView,Mn.checkNoChangesView=t.checkNoChangesView,Mn.destroyView=t.destroyView,Mn.resolveDep=ri,Mn.createDebugContext=t.createDebugContext,Mn.handleEvent=t.handleEvent,Mn.updateDirectives=t.updateDirectives,Mn.updateRenderer=t.updateRenderer,Mn.dirtyParentQueries=Oo}();const e=function(t){const e=Array.from(t.providers),n=Array.from(t.modules),r={};for(const i in t.providersByKey)r[i]=t.providersByKey[i];return{factory:t.factory,isRoot:t.isRoot,providers:e,modules:n,providersByKey:r}}(or(this._ngModuleDefFactory));return Mn.createNgModuleRef(this.moduleType,t||Te.NULL,this._bootstrapComponents,e)}}class Ks{}class Qs{constructor(t){this.title="yuting-podcast",this.items=t.collection("daily-seed-data").valueChanges(),t.collection("daily-seed-data").valueChanges().subscribe(t=>{})}}class Zs{}const Ys=new It("Location Initialized");class Xs{}const Js=new It("appBaseHref");class ta{constructor(t,e){this._subject=new pi,this._urlChangeListeners=[],this._platformStrategy=t;const n=this._platformStrategy.getBaseHref();this._platformLocation=e,this._baseHref=ta.stripTrailingSlash(ea(n)),this._platformStrategy.onPopState(t=>{this._subject.emit({url:this.path(!0),pop:!0,state:t.state,type:t.type})})}path(t=!1){return this.normalize(this._platformStrategy.path(t))}getState(){return this._platformLocation.getState()}isCurrentPathEqualTo(t,e=""){return this.path()==this.normalize(t+ta.normalizeQueryParams(e))}normalize(t){return ta.stripTrailingSlash(function(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}(this._baseHref,ea(t)))}prepareExternalUrl(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)}go(t,e="",n=null){this._platformStrategy.pushState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ta.normalizeQueryParams(e)),n)}replaceState(t,e="",n=null){this._platformStrategy.replaceState(n,"",t,e),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+ta.normalizeQueryParams(e)),n)}forward(){this._platformStrategy.forward()}back(){this._platformStrategy.back()}onUrlChange(t){this._urlChangeListeners.push(t),this.subscribe(t=>{this._notifyUrlChangeListeners(t.url,t.state)})}_notifyUrlChangeListeners(t="",e){this._urlChangeListeners.forEach(n=>n(t,e))}subscribe(t,e,n){return this._subject.subscribe({next:t,error:e,complete:n})}static normalizeQueryParams(t){return t&&"?"!==t[0]?"?"+t:t}static joinWithSlash(t,e){if(0==t.length)return e;if(0==e.length)return t;let n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e}static stripTrailingSlash(t){const e=t.match(/#|\?|$/),n=e&&e.index||t.length;return t.slice(0,n-("/"===t[n-1]?1:0))+t.slice(n)}}function ea(t){return t.replace(/\/index.html$/,"")}class na extends Xs{constructor(t,e){super(),this._platformLocation=t,this._baseHref="",null!=e&&(this._baseHref=e)}onPopState(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)}getBaseHref(){return this._baseHref}path(t=!1){let e=this._platformLocation.hash;return null==e&&(e="#"),e.length>0?e.substring(1):e}prepareExternalUrl(t){const e=ta.joinWithSlash(this._baseHref,t);return e.length>0?"#"+e:e}pushState(t,e,n,r){let i=this.prepareExternalUrl(n+ta.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.pushState(t,e,i)}replaceState(t,e,n,r){let i=this.prepareExternalUrl(n+ta.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.replaceState(t,e,i)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}class ra extends Xs{constructor(t,e){if(super(),this._platformLocation=t,null==e&&(e=this._platformLocation.getBaseHrefFromDOM()),null==e)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");this._baseHref=e}onPopState(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return ta.joinWithSlash(this._baseHref,t)}path(t=!1){const e=this._platformLocation.pathname+ta.normalizeQueryParams(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?`${e}${n}`:e}pushState(t,e,n,r){const i=this.prepareExternalUrl(n+ta.normalizeQueryParams(r));this._platformLocation.pushState(t,e,i)}replaceState(t,e,n,r){const i=this.prepareExternalUrl(n+ta.normalizeQueryParams(r));this._platformLocation.replaceState(t,e,i)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}}const ia=function(){var t={Zero:0,One:1,Two:2,Few:3,Many:4,Other:5};return t[t.Zero]="Zero",t[t.One]="One",t[t.Two]="Two",t[t.Few]="Few",t[t.Many]="Many",t[t.Other]="Other",t}(),oa=new It("UseV4Plurals");class sa{}class aa extends sa{constructor(t,e){super(),this.locale=t,this.deprecatedPluralFn=e}getPluralCategory(t,e){switch(this.deprecatedPluralFn?this.deprecatedPluralFn(e||this.locale,t):function(t){return function(t){const e=t.toLowerCase().replace(/_/g,"-");let n=li[e];if(n)return n;const r=e.split("-")[0];if(n=li[r],n)return n;if("en"===r)return di;throw new Error(`Missing locale data for the locale "${t}".`)}(t)[hi.PluralCase]}(e||this.locale)(t)){case ia.Zero:return"zero";case ia.One:return"one";case ia.Two:return"two";case ia.Few:return"few";case ia.Many:return"many";default:return"other"}}}class ua{constructor(t,e,n,r){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=r}get first(){return 0===this.index}get last(){return this.index===this.count-1}get even(){return this.index%2==0}get odd(){return!this.even}}class ca{constructor(t,e,n){this._viewContainer=t,this._template=e,this._differs=n,this._ngForOfDirty=!0,this._differ=null}set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){$t()&&null!=t&&"function"!=typeof t&&console&&console.warn&&console.warn(`trackBy must be a function, but received ${JSON.stringify(t)}. See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information.`),this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;const n=this._ngForOf;if(!this._differ&&n)try{this._differ=this._differs.find(n).create(this.ngForTrackBy)}catch(e){throw new Error(`Cannot find a differ supporting object '${n}' of type '${t=n,t.name||typeof t}'. NgFor only supports binding to Iterables such as Arrays.`)}}var t;if(this._differ){const t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){const e=[];t.forEachOperation((t,n,r)=>{if(null==t.previousIndex){const n=this._viewContainer.createEmbeddedView(this._template,new ua(null,this._ngForOf,-1,-1),null===r?void 0:r),i=new la(t,n);e.push(i)}else if(null==r)this._viewContainer.remove(null===n?void 0:n);else if(null!==n){const i=this._viewContainer.get(n);this._viewContainer.move(i,r);const o=new la(t,i);e.push(o)}});for(let n=0;n<e.length;n++)this._perViewChange(e[n].view,e[n].record);for(let n=0,r=this._viewContainer.length;n<r;n++){const t=this._viewContainer.get(n);t.context.index=n,t.context.count=r,t.context.ngForOf=this._ngForOf}t.forEachIdentityChange(t=>{this._viewContainer.get(t.currentIndex).context.$implicit=t.item})}_perViewChange(t,e){t.context.$implicit=e.item}static ngTemplateContextGuard(t,e){return!0}}class la{constructor(t,e){this.record=t,this.view=e}}class ha{createSubscription(t,e){return t.subscribe({next:e,error:t=>{throw t}})}dispose(t){t.unsubscribe()}onDestroy(t){t.unsubscribe()}}class fa{createSubscription(t,e){return t.then(e,t=>{throw t})}dispose(t){}onDestroy(t){}}const da=new fa,pa=new ha;class ga{constructor(t){this._ref=t,this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null,this._strategy=null}ngOnDestroy(){this._subscription&&this._dispose()}transform(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):Ue(this._latestValue,this._latestReturnedValue)?this._latestReturnedValue:(this._latestReturnedValue=this._latestValue,Ve.wrap(this._latestValue)):(t&&this._subscribe(t),this._latestReturnedValue=this._latestValue,this._latestValue)}_subscribe(t){this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,e=>this._updateLatestValue(t,e))}_selectStrategy(t){if(qe(t))return da;if(ze(t))return pa;throw Error(`InvalidPipeArgument: '${t}' for pipe '${gt(ga)}'`)}_dispose(){this._strategy.dispose(this._subscription),this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null}_updateLatestValue(t,e){t===this._obj&&(this._latestValue=e,this._ref.markForCheck())}}class va{}const ma=new It("DocumentToken");function ya(t){return"server"===t}let wa=(()=>{class t{}return t.ngInjectableDef=ft({token:t,providedIn:"root",factory:()=>new ba(Rt(ma),window,Rt(Bt))}),t})();class ba{constructor(t,e,n){this.document=t,this.window=e,this.errorHandler=n,this.offset=()=>[0,0]}setOffset(t){this.offset=Array.isArray(t)?()=>t:t}getScrollPosition(){return this.supportScrollRestoration()?[this.window.scrollX,this.window.scrollY]:[0,0]}scrollToPosition(t){this.supportScrollRestoration()&&this.window.scrollTo(t[0],t[1])}scrollToAnchor(t){if(this.supportScrollRestoration()){t=this.window.CSS&&this.window.CSS.escape?this.window.CSS.escape(t):t.replace(/(\"|\'\ |:|\.|\[|\]|,|=)/g,"\\$1");try{const e=this.document.querySelector("#"+t);if(e)return void this.scrollToElement(e);const n=this.document.querySelector(`[name='${t}']`);if(n)return void this.scrollToElement(n)}catch(e){this.errorHandler.handleError(e)}}}setHistoryScrollRestoration(t){if(this.supportScrollRestoration()){const e=this.window.history;e&&e.scrollRestoration&&(e.scrollRestoration=t)}}scrollToElement(t){const e=t.getBoundingClientRect(),n=e.left+this.window.pageXOffset,r=e.top+this.window.pageYOffset,i=this.offset();this.window.scrollTo(n-i[0],r-i[1])}supportScrollRestoration(){try{return!!this.window&&!!this.window.scrollTo}catch(t){return!1}}}const _a=new _(t=>t.complete());function Ea(t){return t?function(t){return new _(e=>t.schedule(()=>e.complete()))}(t):_a}function Sa(t){const e=new _(e=>{e.next(t),e.complete()});return e._isScalar=!0,e.value=t,e}function Ia(...t){let e=t[t.length-1];switch(N(e)?t.pop():e=void 0,t.length){case 0:return Ea(e);case 1:return e?G(t,e):Sa(t[0]);default:return G(t,e)}}class Ta extends C{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){const e=super._subscribe(t);return e&&!e.closed&&t.next(this._value),e}getValue(){if(this.hasError)throw this.thrownError;if(this.closed)throw new I;return this._value}next(t){super.next(this._value=t)}}function xa(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}xa.prototype=Object.create(Error.prototype);const Ca=xa,Aa={};class Na{constructor(t){this.resultSelector=t}call(t,e){return e.subscribe(new ka(t,this.resultSelector))}}class ka extends q{constructor(t,e){super(t),this.resultSelector=e,this.active=0,this.values=[],this.observables=[]}_next(t){this.values.push(Aa),this.observables.push(t)}_complete(){const t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(let n=0;n<e;n++){const e=t[n];this.add(F(this,e,e,n))}}}notifyComplete(t){0==(this.active-=1)&&this.destination.complete()}notifyNext(t,e,n,r,i){const o=this.values,s=this.toRespond?o[n]===Aa?--this.toRespond:this.toRespond:0;o[n]=e,0===s&&(this.resultSelector?this._tryResultSelector(o):this.destination.next(o.slice()))}_tryResultSelector(t){let e;try{e=this.resultSelector.apply(this,t)}catch(n){return void this.destination.error(n)}this.destination.next(e)}}function Ra(t){return new _(e=>{let n;try{n=t()}catch(r){return void e.error(r)}return(n?$(n):Ea()).subscribe(e)})}function Da(){return Y(1)}function Oa(t,e){return function(n){return n.lift(new Pa(t,e))}}class Pa{constructor(t,e){this.predicate=t,this.thisArg=e}call(t,e){return e.subscribe(new La(t,this.predicate,this.thisArg))}}class La extends g{constructor(t,e,n){super(t),this.predicate=e,this.thisArg=n,this.count=0}_next(t){let e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(n){return void this.destination.error(n)}e&&this.destination.next(t)}}function Ua(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}Ua.prototype=Object.create(Error.prototype);const Ma=Ua;function Va(t){return function(e){return 0===t?Ea():e.lift(new ja(t))}}class ja{constructor(t){if(this.total=t,this.total<0)throw new Ma}call(t,e){return e.subscribe(new Fa(t,this.total))}}class Fa extends g{constructor(t,e){super(t),this.total=e,this.ring=new Array,this.count=0}_next(t){const e=this.ring,n=this.total,r=this.count++;e.length<n?e.push(t):e[r%n]=t}_complete(){const t=this.destination;let e=this.count;if(e>0){const n=this.count>=this.total?this.total:this.count,r=this.ring;for(let i=0;i<n;i++){const i=e++%n;t.next(r[i])}}t.complete()}}function qa(t,e,n){return function(r){return r.lift(new za(t,e,n))}}class za{constructor(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}call(t,e){return e.subscribe(new Ba(t,this.nextOrObserver,this.error,this.complete))}}class Ba extends g{constructor(t,e,n,i){super(t),this._tapNext=y,this._tapError=y,this._tapComplete=y,this._tapError=n||y,this._tapComplete=i||y,r(e)?(this._context=this,this._tapNext=e):e&&(this._context=e,this._tapNext=e.next||y,this._tapError=e.error||y,this._tapComplete=e.complete||y)}_next(t){try{this._tapNext.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.next(t)}_error(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)}_complete(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()}}const Ha=(t=Ga)=>qa({hasValue:!1,next(){this.hasValue=!0},complete(){if(!this.hasValue)throw t()}});function Ga(){return new Ca}function $a(t=null){return e=>e.lift(new Wa(t))}class Wa{constructor(t){this.defaultValue=t}call(t,e){return e.subscribe(new Ka(t,this.defaultValue))}}class Ka extends g{constructor(t,e){super(t),this.defaultValue=e,this.isEmpty=!0}_next(t){this.isEmpty=!1,this.destination.next(t)}_complete(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()}}function Qa(t,e){const n=arguments.length>=2;return r=>r.pipe(t?Oa((e,n)=>t(e,n,r)):Z,Va(1),n?$a(e):Ha(()=>new Ca))}function Za(t){return function(e){const n=new Ya(t),r=e.lift(n);return n.caught=r}}class Ya{constructor(t){this.selector=t}call(t,e){return e.subscribe(new Xa(t,this.selector,this.caught))}}class Xa extends q{constructor(t,e,n){super(t),this.selector=e,this.caught=n}error(t){if(!this.isStopped){let n;try{n=this.selector(t,this.caught)}catch(e){return void super.error(e)}this._unsubscribeAndRecycle();const r=new k(this,void 0,void 0);this.add(r),F(this,n,void 0,void 0,r)}}}function Ja(t){return e=>0===t?Ea():e.lift(new tu(t))}class tu{constructor(t){if(this.total=t,this.total<0)throw new Ma}call(t,e){return e.subscribe(new eu(t,this.total))}}class eu extends g{constructor(t,e){super(t),this.total=e,this.count=0}_next(t){const e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))}}function nu(t,e){const n=arguments.length>=2;return r=>r.pipe(t?Oa((e,n)=>t(e,n,r)):Z,Ja(1),n?$a(e):Ha(()=>new Ca))}class ru{constructor(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}call(t,e){return e.subscribe(new iu(t,this.predicate,this.thisArg,this.source))}}class iu extends g{constructor(t,e,n,r){super(t),this.predicate=e,this.thisArg=n,this.source=r,this.index=0,this.thisArg=n||this}notifyComplete(t){this.destination.next(t),this.destination.complete()}_next(t){let e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(n){return void this.destination.error(n)}e||this.notifyComplete(!1)}_complete(){this.notifyComplete(!0)}}function ou(t,e){return"function"==typeof e?n=>n.pipe(ou((n,r)=>$(t(n,r)).pipe(z((t,i)=>e(n,t,r,i))))):e=>e.lift(new su(t))}class su{constructor(t){this.project=t}call(t,e){return e.subscribe(new au(t,this.project))}}class au extends q{constructor(t,e){super(t),this.project=e,this.index=0}_next(t){let e;const n=this.index++;try{e=this.project(t,n)}catch(r){return void this.destination.error(r)}this._innerSub(e,t,n)}_innerSub(t,e,n){const r=this.innerSubscription;r&&r.unsubscribe();const i=new k(this,void 0,void 0);this.destination.add(i),this.innerSubscription=F(this,t,e,n,i)}_complete(){const{innerSubscription:t}=this;t&&!t.closed||super._complete(),this.unsubscribe()}_unsubscribe(){this.innerSubscription=null}notifyComplete(t){this.destination.remove(t),this.innerSubscription=null,this.isStopped&&super._complete()}notifyNext(t,e,n,r,i){this.destination.next(e)}}function uu(t,e){let n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new cu(t,e,n))}}class cu{constructor(t,e,n=!1){this.accumulator=t,this.seed=e,this.hasSeed=n}call(t,e){return e.subscribe(new lu(t,this.accumulator,this.seed,this.hasSeed))}}class lu extends g{constructor(t,e,n,r){super(t),this.accumulator=e,this._seed=n,this.hasSeed=r,this.index=0}get seed(){return this._seed}set seed(t){this.hasSeed=!0,this._seed=t}_next(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)}_tryNext(t){const e=this.index++;let n;try{n=this.accumulator(this.seed,t,e)}catch(r){this.destination.error(r)}this.seed=n,this.destination.next(n)}}function hu(t,e){return W(t,e,1)}class fu{constructor(t){this.callback=t}call(t,e){return e.subscribe(new du(t,this.callback))}}class du extends g{constructor(t,e){super(t),this.add(new f(e))}}let pu=null;function gu(){return pu}const vu={class:"className",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"},mu={"\b":"Backspace","\t":"Tab","\x7f":"Delete","\x1b":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},yu={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","\x90":"NumLock"},wu=(()=>{if(St.Node)return St.Node.prototype.contains||function(t){return!!(16&this.compareDocumentPosition(t))}})();class bu extends class extends class{constructor(){this.resourceLoaderType=null}get attrToPropMap(){return this._attrToPropMap}set attrToPropMap(t){this._attrToPropMap=t}}{constructor(){super(),this._animationPrefix=null,this._transitionEnd=null;try{const t=this.createElement("div",document);if(null!=this.getStyle(t,"animationName"))this._animationPrefix="";else{const e=["Webkit","Moz","O","ms"];for(let n=0;n<e.length;n++)if(null!=this.getStyle(t,e[n]+"AnimationName")){this._animationPrefix="-"+e[n].toLowerCase()+"-";break}}const e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};Object.keys(e).forEach(n=>{null!=this.getStyle(t,n)&&(this._transitionEnd=e[n])})}catch(t){this._animationPrefix=null,this._transitionEnd=null}}getDistributedNodes(t){return t.getDistributedNodes()}resolveAndSetHref(t,e,n){t.href=null==n?e:e+"/../"+n}supportsDOMEvents(){return!0}supportsNativeShadowDOM(){return"function"==typeof document.body.createShadowRoot}getAnimationPrefix(){return this._animationPrefix?this._animationPrefix:""}getTransitionEnd(){return this._transitionEnd?this._transitionEnd:""}supportsAnimation(){return null!=this._animationPrefix&&null!=this._transitionEnd}}{parse(t){throw new Error("parse not implemented")}static makeCurrent(){var t;t=new bu,pu||(pu=t)}hasProperty(t,e){return e in t}setProperty(t,e,n){t[e]=n}getProperty(t,e){return t[e]}invoke(t,e,n){t[e](...n)}logError(t){window.console&&(console.error?console.error(t):console.log(t))}log(t){window.console&&window.console.log&&window.console.log(t)}logGroup(t){window.console&&window.console.group&&window.console.group(t)}logGroupEnd(){window.console&&window.console.groupEnd&&window.console.groupEnd()}get attrToPropMap(){return vu}contains(t,e){return wu.call(t,e)}querySelector(t,e){return t.querySelector(e)}querySelectorAll(t,e){return t.querySelectorAll(e)}on(t,e,n){t.addEventListener(e,n,!1)}onAndCancel(t,e,n){return t.addEventListener(e,n,!1),()=>{t.removeEventListener(e,n,!1)}}dispatchEvent(t,e){t.dispatchEvent(e)}createMouseEvent(t){const e=this.getDefaultDocument().createEvent("MouseEvent");return e.initEvent(t,!0,!0),e}createEvent(t){const e=this.getDefaultDocument().createEvent("Event");return e.initEvent(t,!0,!0),e}preventDefault(t){t.preventDefault(),t.returnValue=!1}isPrevented(t){return t.defaultPrevented||null!=t.returnValue&&!t.returnValue}getInnerHTML(t){return t.innerHTML}getTemplateContent(t){return"content"in t&&this.isTemplateElement(t)?t.content:null}getOuterHTML(t){return t.outerHTML}nodeName(t){return t.nodeName}nodeValue(t){return t.nodeValue}type(t){return t.type}content(t){return this.hasProperty(t,"content")?t.content:t}firstChild(t){return t.firstChild}nextSibling(t){return t.nextSibling}parentElement(t){return t.parentNode}childNodes(t){return t.childNodes}childNodesAsList(t){const e=t.childNodes,n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[r];return n}clearNodes(t){for(;t.firstChild;)t.removeChild(t.firstChild)}appendChild(t,e){t.appendChild(e)}removeChild(t,e){t.removeChild(e)}replaceChild(t,e,n){t.replaceChild(e,n)}remove(t){return t.parentNode&&t.parentNode.removeChild(t),t}insertBefore(t,e,n){t.insertBefore(n,e)}insertAllBefore(t,e,n){n.forEach(n=>t.insertBefore(n,e))}insertAfter(t,e,n){t.insertBefore(n,e.nextSibling)}setInnerHTML(t,e){t.innerHTML=e}getText(t){return t.textContent}setText(t,e){t.textContent=e}getValue(t){return t.value}setValue(t,e){t.value=e}getChecked(t){return t.checked}setChecked(t,e){t.checked=e}createComment(t){return this.getDefaultDocument().createComment(t)}createTemplate(t){const e=this.getDefaultDocument().createElement("template");return e.innerHTML=t,e}createElement(t,e){return(e=e||this.getDefaultDocument()).createElement(t)}createElementNS(t,e,n){return(n=n||this.getDefaultDocument()).createElementNS(t,e)}createTextNode(t,e){return(e=e||this.getDefaultDocument()).createTextNode(t)}createScriptTag(t,e,n){const r=(n=n||this.getDefaultDocument()).createElement("SCRIPT");return r.setAttribute(t,e),r}createStyleElement(t,e){const n=(e=e||this.getDefaultDocument()).createElement("style");return this.appendChild(n,this.createTextNode(t,e)),n}createShadowRoot(t){return t.createShadowRoot()}getShadowRoot(t){return t.shadowRoot}getHost(t){return t.host}clone(t){return t.cloneNode(!0)}getElementsByClassName(t,e){return t.getElementsByClassName(e)}getElementsByTagName(t,e){return t.getElementsByTagName(e)}classList(t){return Array.prototype.slice.call(t.classList,0)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}hasClass(t,e){return t.classList.contains(e)}setStyle(t,e,n){t.style[e]=n}removeStyle(t,e){t.style[e]=""}getStyle(t,e){return t.style[e]}hasStyle(t,e,n){const r=this.getStyle(t,e)||"";return n?r==n:r.length>0}tagName(t){return t.tagName}attributeMap(t){const e=new Map,n=t.attributes;for(let r=0;r<n.length;r++){const t=n.item(r);e.set(t.name,t.value)}return e}hasAttribute(t,e){return t.hasAttribute(e)}hasAttributeNS(t,e,n){return t.hasAttributeNS(e,n)}getAttribute(t,e){return t.getAttribute(e)}getAttributeNS(t,e,n){return t.getAttributeNS(e,n)}setAttribute(t,e,n){t.setAttribute(e,n)}setAttributeNS(t,e,n,r){t.setAttributeNS(e,n,r)}removeAttribute(t,e){t.removeAttribute(e)}removeAttributeNS(t,e,n){t.removeAttributeNS(e,n)}templateAwareRoot(t){return this.isTemplateElement(t)?this.content(t):t}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}getBoundingClientRect(t){try{return t.getBoundingClientRect()}catch(e){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}}getTitle(t){return t.title}setTitle(t,e){t.title=e||""}elementMatches(t,e){return!!this.isElementNode(t)&&(t.matches&&t.matches(e)||t.msMatchesSelector&&t.msMatchesSelector(e)||t.webkitMatchesSelector&&t.webkitMatchesSelector(e))}isTemplateElement(t){return this.isElementNode(t)&&"TEMPLATE"===t.nodeName}isTextNode(t){return t.nodeType===Node.TEXT_NODE}isCommentNode(t){return t.nodeType===Node.COMMENT_NODE}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}hasShadowRoot(t){return null!=t.shadowRoot&&t instanceof HTMLElement}isShadowRoot(t){return t instanceof DocumentFragment}importIntoDoc(t){return document.importNode(this.templateAwareRoot(t),!0)}adoptNode(t){return document.adoptNode(t)}getHref(t){return t.getAttribute("href")}getEventKey(t){let e=t.key;if(null==e){if(e=t.keyIdentifier,null==e)return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),3===t.location&&yu.hasOwnProperty(e)&&(e=yu[e]))}return mu[e]||e}getGlobalEventTarget(t,e){return"window"===e?window:"document"===e?t:"body"===e?t.body:null}getHistory(){return window.history}getLocation(){return window.location}getBaseHref(t){const e=Eu||(Eu=document.querySelector("base"),Eu)?Eu.getAttribute("href"):null;return null==e?null:(n=e,_u||(_u=document.createElement("a")),_u.setAttribute("href",n),"/"===_u.pathname.charAt(0)?_u.pathname:"/"+_u.pathname);var n}resetBaseElement(){Eu=null}getUserAgent(){return window.navigator.userAgent}setData(t,e,n){this.setAttribute(t,"data-"+e,n)}getData(t,e){return this.getAttribute(t,"data-"+e)}getComputedStyle(t){return getComputedStyle(t)}supportsWebAnimation(){return"function"==typeof Element.prototype.animate}performanceNow(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()}supportsCookies(){return!0}getCookie(t){return function(t,e){e=encodeURIComponent(e);for(const n of t.split(";")){const t=n.indexOf("="),[r,i]=-1==t?[n,""]:[n.slice(0,t),n.slice(t+1)];if(r.trim()===e)return decodeURIComponent(i)}return null}(document.cookie,t)}setCookie(t,e){document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)}}let _u,Eu=null;function Su(){return!!window.history.pushState}const Iu=new It("TRANSITION_ID"),Tu=[{provide:mi,useFactory:function(t,e,n){return()=>{n.get(yi).donePromise.then(()=>{const n=gu();Array.prototype.slice.apply(n.querySelectorAll(e,"style[ng-transition]")).filter(e=>n.getAttribute(e,"ng-transition")===t).forEach(t=>n.remove(t))})}},deps:[Iu,ma,Te],multi:!0}];class xu{static init(){var t;t=new xu,to=t}addToWindow(t){St.getAngularTestability=(e,n=!0)=>{const r=t.findTestabilityInTree(e,n);if(null==r)throw new Error("Could not find testability for element.");return r},St.getAllAngularTestabilities=()=>t.getAllTestabilities(),St.getAllAngularRootElements=()=>t.getAllRootElements(),St.frameworkStabilizers||(St.frameworkStabilizers=[]),St.frameworkStabilizers.push(t=>{const e=St.getAllAngularTestabilities();let n=e.length,r=!1;const i=function(e){r=r||e,n--,0==n&&t(r)};e.forEach((function(t){t.whenStable(i)}))})}findTestabilityInTree(t,e,n){if(null==e)return null;const r=t.getTestability(e);return null!=r?r:n?gu().isShadowRoot(e)?this.findTestabilityInTree(t,gu().getHost(e),!0):this.findTestabilityInTree(t,gu().parentElement(e),!0):null}}function Cu(t,e){"undefined"!=typeof COMPILED&&COMPILED||((St.ng=St.ng||{})[t]=e)}const Au=(()=>({ApplicationRef:ao,NgZone:Bi}))();function Nu(t){return wo(t)}const ku=new It("EventManagerPlugins");class Ru{constructor(t,e){this._zone=e,this._eventNameToPlugin=new Map,t.forEach(t=>t.manager=this),this._plugins=t.slice().reverse()}addEventListener(t,e,n){return this._findPluginFor(e).addEventListener(t,e,n)}addGlobalEventListener(t,e,n){return this._findPluginFor(e).addGlobalEventListener(t,e,n)}getZone(){return this._zone}_findPluginFor(t){const e=this._eventNameToPlugin.get(t);if(e)return e;const n=this._plugins;for(let r=0;r<n.length;r++){const e=n[r];if(e.supports(t))return this._eventNameToPlugin.set(t,e),e}throw new Error("No event manager plugin found for event "+t)}}class Du{constructor(t){this._doc=t}addGlobalEventListener(t,e,n){const r=gu().getGlobalEventTarget(this._doc,t);if(!r)throw new Error(`Unsupported event target ${r} for event ${e}`);return this.addEventListener(r,e,n)}}class Ou{constructor(){this._stylesSet=new Set}addStyles(t){const e=new Set;t.forEach(t=>{this._stylesSet.has(t)||(this._stylesSet.add(t),e.add(t))}),this.onStylesAdded(e)}onStylesAdded(t){}getAllStyles(){return Array.from(this._stylesSet)}}class Pu extends Ou{constructor(t){super(),this._doc=t,this._hostNodes=new Set,this._styleNodes=new Set,this._hostNodes.add(t.head)}_addStylesToHost(t,e){t.forEach(t=>{const n=this._doc.createElement("style");n.textContent=t,this._styleNodes.add(e.appendChild(n))})}addHost(t){this._addStylesToHost(this._stylesSet,t),this._hostNodes.add(t)}removeHost(t){this._hostNodes.delete(t)}onStylesAdded(t){this._hostNodes.forEach(e=>this._addStylesToHost(t,e))}ngOnDestroy(){this._styleNodes.forEach(t=>gu().remove(t))}}const Lu={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Uu=/%COMP%/g;function Mu(t,e,n){for(let r=0;r<e.length;r++){let i=e[r];Array.isArray(i)?Mu(t,i,n):(i=i.replace(Uu,t),n.push(i))}return n}function Vu(t){return e=>{!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}class ju{constructor(t,e,n){this.eventManager=t,this.sharedStylesHost=e,this.appId=n,this.rendererByCompId=new Map,this.defaultRenderer=new Fu(t)}createRenderer(t,e){if(!t||!e)return this.defaultRenderer;switch(e.encapsulation){case Vt.Emulated:{let n=this.rendererByCompId.get(e.id);return n||(n=new Bu(this.eventManager,this.sharedStylesHost,e,this.appId),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n}case Vt.Native:case Vt.ShadowDom:return new Hu(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){const t=Mu(e.id,e.styles,[]);this.sharedStylesHost.addStyles(t),this.rendererByCompId.set(e.id,this.defaultRenderer)}return this.defaultRenderer}}begin(){}end(){}}class Fu{constructor(t){this.eventManager=t,this.data=Object.create(null)}destroy(){}createElement(t,e){return e?document.createElementNS(Lu[e]||e,t):document.createElement(t)}createComment(t){return document.createComment(t)}createText(t){return document.createTextNode(t)}appendChild(t,e){t.appendChild(e)}insertBefore(t,e,n){t&&t.insertBefore(e,n)}removeChild(t,e){t&&t.removeChild(e)}selectRootElement(t,e){let n="string"==typeof t?document.querySelector(t):t;if(!n)throw new Error(`The selector "${t}" did not match any elements`);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,r){if(r){e=r+":"+e;const i=Lu[r];i?t.setAttributeNS(i,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){const r=Lu[n];r?t.removeAttributeNS(r,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,r){r&nn.DashCase?t.style.setProperty(e,n,r&nn.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&nn.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){zu(e,"property"),t[e]=n}setValue(t,e){t.nodeValue=e}listen(t,e,n){return zu(e,"listener"),"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,Vu(n)):this.eventManager.addEventListener(t,e,Vu(n))}}const qu=(()=>"@".charCodeAt(0))();function zu(t,e){if(t.charCodeAt(0)===qu)throw new Error(`Found the synthetic ${e} ${t}. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.`)}class Bu extends Fu{constructor(t,e,n,r){super(t),this.component=n;const i=Mu(r+"-"+n.id,n.styles,[]);e.addStyles(i),this.contentAttr="_ngcontent-%COMP%".replace(Uu,r+"-"+n.id),this.hostAttr=function(t){return"_nghost-%COMP%".replace(Uu,t)}(r+"-"+n.id)}applyToHost(t){super.setAttribute(t,this.hostAttr,"")}createElement(t,e){const n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}}class Hu extends Fu{constructor(t,e,n,r){super(t),this.sharedStylesHost=e,this.hostEl=n,this.component=r,this.shadowRoot=r.encapsulation===Vt.ShadowDom?n.attachShadow({mode:"open"}):n.createShadowRoot(),this.sharedStylesHost.addHost(this.shadowRoot);const i=Mu(r.id,r.styles,[]);for(let o=0;o<i.length;o++){const t=document.createElement("style");t.textContent=i[o],this.shadowRoot.appendChild(t)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}appendChild(t,e){return super.appendChild(this.nodeOrShadowRoot(t),e)}insertBefore(t,e,n){return super.insertBefore(this.nodeOrShadowRoot(t),e,n)}removeChild(t,e){return super.removeChild(this.nodeOrShadowRoot(t),e)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}}const Gu=(()=>"undefined"!=typeof Zone&&Zone.__symbol__||function(t){return"__zone_symbol__"+t})(),$u=Gu("addEventListener"),Wu=Gu("removeEventListener"),Ku={},Qu="__zone_symbol__propagationStopped",Zu=(()=>{const t="undefined"!=typeof Zone&&Zone[Gu("BLACK_LISTED_EVENTS")];if(t){const e={};return t.forEach(t=>{e[t]=t}),e}})(),Yu=function(t){return!!Zu&&Zu.hasOwnProperty(t)},Xu=function(t){const e=Ku[t.type];if(!e)return;const n=this[e];if(!n)return;const r=[t];if(1===n.length){const t=n[0];return t.zone!==Zone.current?t.zone.run(t.handler,this,r):t.handler.apply(this,r)}{const e=n.slice();for(let n=0;n<e.length&&!0!==t[Qu];n++){const t=e[n];t.zone!==Zone.current?t.zone.run(t.handler,this,r):t.handler.apply(this,r)}}};class Ju extends Du{constructor(t,e,n){super(t),this.ngZone=e,n&&ya(n)||this.patchEvent()}patchEvent(){if("undefined"==typeof Event||!Event||!Event.prototype)return;if(Event.prototype.__zone_symbol__stopImmediatePropagation)return;const t=Event.prototype.__zone_symbol__stopImmediatePropagation=Event.prototype.stopImmediatePropagation;Event.prototype.stopImmediatePropagation=function(){this&&(this[Qu]=!0),t&&t.apply(this,arguments)}}supports(t){return!0}addEventListener(t,e,n){let r=n;if(!t[$u]||Bi.isInAngularZone()&&!Yu(e))t.addEventListener(e,r,!1);else{let n=Ku[e];n||(n=Ku[e]=Gu("ANGULAR"+e+"FALSE"));let i=t[n];const o=i&&i.length>0;i||(i=t[n]=[]);const s=Yu(e)?Zone.root:Zone.current;if(0===i.length)i.push({zone:s,handler:r});else{let t=!1;for(let e=0;e<i.length;e++)if(i[e].handler===r){t=!0;break}t||i.push({zone:s,handler:r})}o||t[$u](e,Xu,!1)}return()=>this.removeEventListener(t,e,r)}removeEventListener(t,e,n){let r=t[Wu];if(!r)return t.removeEventListener.apply(t,[e,n,!1]);let i=Ku[e],o=i&&t[i];if(!o)return t.removeEventListener.apply(t,[e,n,!1]);let s=!1;for(let a=0;a<o.length;a++)if(o[a].handler===n){s=!0,o.splice(a,1);break}s?0===o.length&&r.apply(t,[e,Xu,!1]):t.removeEventListener.apply(t,[e,n,!1])}}const tc={pan:!0,panstart:!0,panmove:!0,panend:!0,pancancel:!0,panleft:!0,panright:!0,panup:!0,pandown:!0,pinch:!0,pinchstart:!0,pinchmove:!0,pinchend:!0,pinchcancel:!0,pinchin:!0,pinchout:!0,press:!0,pressup:!0,rotate:!0,rotatestart:!0,rotatemove:!0,rotateend:!0,rotatecancel:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,tap:!0},ec=new It("HammerGestureConfig"),nc=new It("HammerLoader");class rc{constructor(){this.events=[],this.overrides={}}buildHammer(t){const e=new Hammer(t,this.options);e.get("pinch").set({enable:!0}),e.get("rotate").set({enable:!0});for(const n in this.overrides)e.get(n).set(this.overrides[n]);return e}}class ic extends Du{constructor(t,e,n,r){super(t),this._config=e,this.console=n,this.loader=r}supports(t){return!(!tc.hasOwnProperty(t.toLowerCase())&&!this.isCustomEvent(t)||!window.Hammer&&!this.loader&&(this.console.warn(`The "${t}" event cannot be bound because Hammer.JS is not loaded and no custom loader has been specified.`),1))}addEventListener(t,e,n){const r=this.manager.getZone();if(e=e.toLowerCase(),!window.Hammer&&this.loader){let r=!1,i=()=>{r=!0};return this.loader().then(()=>{if(!window.Hammer)return this.console.warn("The custom HAMMER_LOADER completed, but Hammer.JS is not present."),void(i=()=>{});r||(i=this.addEventListener(t,e,n))}).catch(()=>{this.console.warn(`The "${e}" event cannot be bound because the custom Hammer.JS loader failed.`),i=()=>{}}),()=>{i()}}return r.runOutsideAngular(()=>{const i=this._config.buildHammer(t),o=function(t){r.runGuarded((function(){n(t)}))};return i.on(e,o),()=>{i.off(e,o),"function"==typeof i.destroy&&i.destroy()}})}isCustomEvent(t){return this._config.events.indexOf(t)>-1}}const oc=["alt","control","meta","shift"],sc={alt:t=>t.altKey,control:t=>t.ctrlKey,meta:t=>t.metaKey,shift:t=>t.shiftKey};class ac extends Du{constructor(t){super(t)}supports(t){return null!=ac.parseEventName(t)}addEventListener(t,e,n){const r=ac.parseEventName(e),i=ac.eventCallback(r.fullKey,n,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>gu().onAndCancel(t,r.domEventName,i))}static parseEventName(t){const e=t.toLowerCase().split("."),n=e.shift();if(0===e.length||"keydown"!==n&&"keyup"!==n)return null;const r=ac._normalizeKey(e.pop());let i="";if(oc.forEach(t=>{const n=e.indexOf(t);n>-1&&(e.splice(n,1),i+=t+".")}),i+=r,0!=e.length||0===r.length)return null;const o={};return o.domEventName=n,o.fullKey=i,o}static getEventFullKey(t){let e="",n=gu().getEventKey(t);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),oc.forEach(r=>{r!=n&&(0,sc[r])(t)&&(e+=r+".")}),e+=n,e}static eventCallback(t,e,n){return r=>{ac.getEventFullKey(r)===t&&n.runGuarded(()=>e(r))}}static _normalizeKey(t){switch(t){case"esc":return"escape";default:return t}}}class uc{}class cc extends uc{constructor(t){super(),this._doc=t}sanitize(t,e){if(null==e)return null;switch(t){case pe.NONE:return e;case pe.HTML:return e instanceof hc?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"HTML"),function(t,e){let n=null;try{fe=fe||new Wt(t);let r=e?String(e):"";n=fe.getInertBodyElement(r);let i=5,o=r;do{if(0===i)throw new Error("Failed to sanitize html because the input is unstable");i--,r=o,o=n.innerHTML,n=fe.getInertBodyElement(r)}while(r!==o);const s=new ue,a=s.sanitizeChildren(de(n)||n);return $t()&&s.sanitizedSomething&&console.warn("WARNING: sanitizing HTML stripped some content, see http://g.co/ng/security#xss"),a}finally{if(n){const t=de(n)||n;for(;t.firstChild;)t.removeChild(t.firstChild)}}}(this._doc,String(e)));case pe.STYLE:return e instanceof fc?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"Style"),function(t){if(!(t=String(t).trim()))return"";const e=t.match(me);return e&&Zt(e[1])===e[1]||t.match(ve)&&function(t){let e=!0,n=!0;for(let r=0;r<t.length;r++){const i=t.charAt(r);"'"===i&&n?e=!e:'"'===i&&e&&(n=!n)}return e&&n}(t)?t:($t()&&console.warn(`WARNING: sanitizing unsafe style value ${t} (see http://g.co/ng/security#xss).`),"unsafe")}(e));case pe.SCRIPT:if(e instanceof dc)return e.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(e,"Script"),new Error("unsafe value used in a script context");case pe.URL:return e instanceof gc||e instanceof pc?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"URL"),Zt(String(e)));case pe.RESOURCE_URL:if(e instanceof gc)return e.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(e,"ResourceURL"),new Error("unsafe value used in a resource URL context (see http://g.co/ng/security#xss)");default:throw new Error(`Unexpected SecurityContext ${t} (see http://g.co/ng/security#xss)`)}}checkNotSafeValue(t,e){if(t instanceof lc)throw new Error(`Required a safe ${e}, got a ${t.getTypeName()} (see http://g.co/ng/security#xss)`)}bypassSecurityTrustHtml(t){return new hc(t)}bypassSecurityTrustStyle(t){return new fc(t)}bypassSecurityTrustScript(t){return new dc(t)}bypassSecurityTrustUrl(t){return new pc(t)}bypassSecurityTrustResourceUrl(t){return new gc(t)}}class lc{constructor(t){this.changingThisBreaksApplicationSecurity=t}toString(){return"SafeValue must use [property]=binding: "+this.changingThisBreaksApplicationSecurity+" (see http://g.co/ng/security#xss)"}}class hc extends lc{getTypeName(){return"HTML"}}class fc extends lc{getTypeName(){return"Style"}}class dc extends lc{getTypeName(){return"Script"}}class pc extends lc{getTypeName(){return"URL"}}class gc extends lc{getTypeName(){return"ResourceURL"}}const vc=ro(_o,"browser",[{provide:Si,useValue:"browser"},{provide:Ei,useValue:function(){bu.makeCurrent(),xu.init()},multi:!0},{provide:Zs,useClass:class extends Zs{constructor(t){super(),this._doc=t,this._init()}_init(){this.location=gu().getLocation(),this._history=gu().getHistory()}getBaseHrefFromDOM(){return gu().getBaseHref(this._doc)}onPopState(t){gu().getGlobalEventTarget(this._doc,"window").addEventListener("popstate",t,!1)}onHashChange(t){gu().getGlobalEventTarget(this._doc,"window").addEventListener("hashchange",t,!1)}get href(){return this.location.href}get protocol(){return this.location.protocol}get hostname(){return this.location.hostname}get port(){return this.location.port}get pathname(){return this.location.pathname}get search(){return this.location.search}get hash(){return this.location.hash}set pathname(t){this.location.pathname=t}pushState(t,e,n){Su()?this._history.pushState(t,e,n):this.location.hash=n}replaceState(t,e,n){Su()?this._history.replaceState(t,e,n):this.location.hash=n}forward(){this._history.forward()}back(){this._history.back()}getState(){return this._history.state}},deps:[ma]},{provide:ma,useFactory:function(){return document},deps:[]}]);function mc(){return new Bt}class yc{constructor(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}static withServerTransition(t){return{ngModule:yc,providers:[{provide:wi,useValue:t.appId},{provide:Iu,useExisting:wi},Tu]}}}"undefined"!=typeof window&&window;class wc{constructor(t,e){this.id=t,this.url=e}}class bc extends wc{constructor(t,e,n="imperative",r=null){super(t,e),this.navigationTrigger=n,this.restoredState=r}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}}class _c extends wc{constructor(t,e,n){super(t,e),this.urlAfterRedirects=n}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}}class Ec extends wc{constructor(t,e,n){super(t,e),this.reason=n}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}}class Sc extends wc{constructor(t,e,n){super(t,e),this.error=n}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}}class Ic extends wc{constructor(t,e,n,r){super(t,e),this.urlAfterRedirects=n,this.state=r}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Tc extends wc{constructor(t,e,n,r){super(t,e),this.urlAfterRedirects=n,this.state=r}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class xc extends wc{constructor(t,e,n,r,i){super(t,e),this.urlAfterRedirects=n,this.state=r,this.shouldActivate=i}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}}class Cc extends wc{constructor(t,e,n,r){super(t,e),this.urlAfterRedirects=n,this.state=r}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Ac extends wc{constructor(t,e,n,r){super(t,e),this.urlAfterRedirects=n,this.state=r}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}}class Nc{constructor(t){this.route=t}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}}class kc{constructor(t){this.route=t}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}}class Rc{constructor(t){this.snapshot=t}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Dc{constructor(t){this.snapshot=t}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Oc{constructor(t){this.snapshot=t}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Pc{constructor(t){this.snapshot=t}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}}class Lc{constructor(t,e,n){this.routerEvent=t,this.position=e,this.anchor=n}toString(){return`Scroll(anchor: '${this.anchor}', position: '${this.position?`${this.position[0]}, ${this.position[1]}`:null}')`}}class Uc{}class Mc{constructor(t){this.params=t||{}}has(t){return this.params.hasOwnProperty(t)}get(t){if(this.has(t)){const e=this.params[t];return Array.isArray(e)?e[0]:e}return null}getAll(t){if(this.has(t)){const e=this.params[t];return Array.isArray(e)?e:[e]}return[]}get keys(){return Object.keys(this.params)}}function Vc(t){return new Mc(t)}function jc(t){const e=Error("NavigationCancelingError: "+t);return e.ngNavigationCancelingError=!0,e}function Fc(t,e,n){const r=n.path.split("/");if(r.length>t.length)return null;if("full"===n.pathMatch&&(e.hasChildren()||r.length<t.length))return null;const i={};for(let o=0;o<r.length;o++){const e=r[o],n=t[o];if(e.startsWith(":"))i[e.substring(1)]=n;else if(e!==n.path)return null}return{consumed:t.slice(0,r.length),posParams:i}}class qc{constructor(t,e){this.routes=t,this.module=e}}function zc(t,e=""){for(let n=0;n<t.length;n++){const r=t[n];Bc(r,Hc(e,r))}}function Bc(t,e){if(!t)throw new Error(`\n      Invalid configuration of route '${e}': Encountered undefined route.\n      The reason might be an extra comma.\n\n      Example:\n      const routes: Routes = [\n        { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\n        { path: 'dashboard',  component: DashboardComponent },, << two commas\n        { path: 'detail/:id', component: HeroDetailComponent }\n      ];\n    `);if(Array.isArray(t))throw new Error(`Invalid configuration of route '${e}': Array cannot be specified`);if(!t.component&&!t.children&&!t.loadChildren&&t.outlet&&"primary"!==t.outlet)throw new Error(`Invalid configuration of route '${e}': a componentless route without children or loadChildren cannot have a named outlet set`);if(t.redirectTo&&t.children)throw new Error(`Invalid configuration of route '${e}': redirectTo and children cannot be used together`);if(t.redirectTo&&t.loadChildren)throw new Error(`Invalid configuration of route '${e}': redirectTo and loadChildren cannot be used together`);if(t.children&&t.loadChildren)throw new Error(`Invalid configuration of route '${e}': children and loadChildren cannot be used together`);if(t.redirectTo&&t.component)throw new Error(`Invalid configuration of route '${e}': redirectTo and component cannot be used together`);if(t.path&&t.matcher)throw new Error(`Invalid configuration of route '${e}': path and matcher cannot be used together`);if(void 0===t.redirectTo&&!t.component&&!t.children&&!t.loadChildren)throw new Error(`Invalid configuration of route '${e}'. One of the following must be provided: component, redirectTo, children or loadChildren`);if(void 0===t.path&&void 0===t.matcher)throw new Error(`Invalid configuration of route '${e}': routes must have either a path or a matcher specified`);if("string"==typeof t.path&&"/"===t.path.charAt(0))throw new Error(`Invalid configuration of route '${e}': path cannot start with a slash`);if(""===t.path&&void 0!==t.redirectTo&&void 0===t.pathMatch)throw new Error(`Invalid configuration of route '{path: "${e}", redirectTo: "${t.redirectTo}"}': please provide 'pathMatch'. The default value of 'pathMatch' is 'prefix', but often the intent is to use 'full'.`);if(void 0!==t.pathMatch&&"full"!==t.pathMatch&&"prefix"!==t.pathMatch)throw new Error(`Invalid configuration of route '${e}': pathMatch can only be set to 'prefix' or 'full'`);t.children&&zc(t.children,e)}function Hc(t,e){return e?t||e.path?t&&!e.path?t+"/":!t&&e.path?e.path:`${t}/${e.path}`:"":t}function Gc(t){const e=t.children&&t.children.map(Gc),n=e?Object.assign({},t,{children:e}):Object.assign({},t);return!n.component&&(e||n.loadChildren)&&n.outlet&&"primary"!==n.outlet&&(n.component=Uc),n}function $c(t,e){const n=Object.keys(t),r=Object.keys(e);if(!n||!r||n.length!=r.length)return!1;let i;for(let o=0;o<n.length;o++)if(i=n[o],t[i]!==e[i])return!1;return!0}function Wc(t){return Array.prototype.concat.apply([],t)}function Kc(t){return t.length>0?t[t.length-1]:null}function Qc(t,e){for(const n in t)t.hasOwnProperty(n)&&e(t[n],n)}function Zc(t){return ze(t)?t:qe(t)?$(Promise.resolve(t)):Ia(t)}function Yc(t,e,n){return n?function(t,e){return $c(t,e)}(t.queryParams,e.queryParams)&&function t(e,n){if(!el(e.segments,n.segments))return!1;if(e.numberOfChildren!==n.numberOfChildren)return!1;for(const r in n.children){if(!e.children[r])return!1;if(!t(e.children[r],n.children[r]))return!1}return!0}(t.root,e.root):function(t,e){return Object.keys(e).length<=Object.keys(t).length&&Object.keys(e).every(n=>e[n]===t[n])}(t.queryParams,e.queryParams)&&function t(e,n){return function e(n,r,i){if(n.segments.length>i.length)return!!el(n.segments.slice(0,i.length),i)&&!r.hasChildren();if(n.segments.length===i.length){if(!el(n.segments,i))return!1;for(const e in r.children){if(!n.children[e])return!1;if(!t(n.children[e],r.children[e]))return!1}return!0}{const t=i.slice(0,n.segments.length),o=i.slice(n.segments.length);return!!el(n.segments,t)&&!!n.children.primary&&e(n.children.primary,r,o)}}(e,n,n.segments)}(t.root,e.root)}class Xc{constructor(t,e,n){this.root=t,this.queryParams=e,this.fragment=n}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Vc(this.queryParams)),this._queryParamMap}toString(){return ol.serialize(this)}}class Jc{constructor(t,e){this.segments=t,this.children=e,this.parent=null,Qc(e,(t,e)=>t.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return sl(this)}}class tl{constructor(t,e){this.path=t,this.parameters=e}get parameterMap(){return this._parameterMap||(this._parameterMap=Vc(this.parameters)),this._parameterMap}toString(){return fl(this)}}function el(t,e){return t.length===e.length&&t.every((t,n)=>t.path===e[n].path)}function nl(t,e){let n=[];return Qc(t.children,(t,r)=>{"primary"===r&&(n=n.concat(e(t,r)))}),Qc(t.children,(t,r)=>{"primary"!==r&&(n=n.concat(e(t,r)))}),n}class rl{}class il{parse(t){const e=new ml(t);return new Xc(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())}serialize(t){return`${"/"+function t(e,n){if(!e.hasChildren())return sl(e);if(n){const n=e.children.primary?t(e.children.primary,!1):"",r=[];return Qc(e.children,(e,n)=>{"primary"!==n&&r.push(`${n}:${t(e,!1)}`)}),r.length>0?`${n}(${r.join("//")})`:n}{const n=nl(e,(n,r)=>"primary"===r?[t(e.children.primary,!1)]:[`${r}:${t(n,!1)}`]);return`${sl(e)}/(${n.join("//")})`}}(t.root,!0)}${function(t){const e=Object.keys(t).map(e=>{const n=t[e];return Array.isArray(n)?n.map(t=>`${ul(e)}=${ul(t)}`).join("&"):`${ul(e)}=${ul(n)}`});return e.length?"?"+e.join("&"):""}(t.queryParams)}${"string"==typeof t.fragment?"#"+encodeURI(t.fragment):""}`}}const ol=new il;function sl(t){return t.segments.map(t=>fl(t)).join("/")}function al(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function ul(t){return al(t).replace(/%3B/gi,";")}function cl(t){return al(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function ll(t){return decodeURIComponent(t)}function hl(t){return ll(t.replace(/\+/g,"%20"))}function fl(t){return`${cl(t.path)}${e=t.parameters,Object.keys(e).map(t=>`;${cl(t)}=${cl(e[t])}`).join("")}`;var e}const dl=/^[^\/()?;=#]+/;function pl(t){const e=t.match(dl);return e?e[0]:""}const gl=/^[^=?&#]+/,vl=/^[^?&#]+/;class ml{constructor(t){this.url=t,this.remaining=t}parseRootSegment(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Jc([],{}):new Jc([],this.parseChildren())}parseQueryParams(){const t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(""===this.remaining)return{};this.consumeOptional("/");const t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());let e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));let n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(n.primary=new Jc(t,e)),n}parseSegment(){const t=pl(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error(`Empty path url segment cannot have parameters: '${this.remaining}'.`);return this.capture(t),new tl(ll(t),this.parseMatrixParams())}parseMatrixParams(){const t={};for(;this.consumeOptional(";");)this.parseParam(t);return t}parseParam(t){const e=pl(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){const t=pl(this.remaining);t&&(n=t,this.capture(n))}t[ll(e)]=ll(n)}parseQueryParam(t){const e=function(t){const e=t.match(gl);return e?e[0]:""}(this.remaining);if(!e)return;this.capture(e);let n="";if(this.consumeOptional("=")){const t=function(t){const e=t.match(vl);return e?e[0]:""}(this.remaining);t&&(n=t,this.capture(n))}const r=hl(e),i=hl(n);if(t.hasOwnProperty(r)){let e=t[r];Array.isArray(e)||(e=[e],t[r]=e),e.push(i)}else t[r]=i}parseParens(t){const e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){const n=pl(this.remaining),r=this.remaining[n.length];if("/"!==r&&")"!==r&&";"!==r)throw new Error(`Cannot parse url '${this.url}'`);let i=void 0;n.indexOf(":")>-1?(i=n.substr(0,n.indexOf(":")),this.capture(i),this.capture(":")):t&&(i="primary");const o=this.parseChildren();e[i]=1===Object.keys(o).length?o.primary:new Jc([],o),this.consumeOptional("//")}return e}peekStartsWith(t){return this.remaining.startsWith(t)}consumeOptional(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)}capture(t){if(!this.consumeOptional(t))throw new Error(`Expected "${t}".`)}}class yl{constructor(t){this._root=t}get root(){return this._root.value}parent(t){const e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null}children(t){const e=wl(t,this._root);return e?e.children.map(t=>t.value):[]}firstChild(t){const e=wl(t,this._root);return e&&e.children.length>0?e.children[0].value:null}siblings(t){const e=bl(t,this._root);return e.length<2?[]:e[e.length-2].children.map(t=>t.value).filter(e=>e!==t)}pathFromRoot(t){return bl(t,this._root).map(t=>t.value)}}function wl(t,e){if(t===e.value)return e;for(const n of e.children){const e=wl(t,n);if(e)return e}return null}function bl(t,e){if(t===e.value)return[e];for(const n of e.children){const r=bl(t,n);if(r.length)return r.unshift(e),r}return[]}class _l{constructor(t,e){this.value=t,this.children=e}toString(){return`TreeNode(${this.value})`}}function El(t){const e={};return t&&t.children.forEach(t=>e[t.value.outlet]=t),e}class Sl extends yl{constructor(t,e){super(t),this.snapshot=e,Nl(this,t)}toString(){return this.snapshot.toString()}}function Il(t,e){const n=function(t,e){const n=new Cl([],{},{},"",{},"primary",e,null,t.root,-1,{});return new Al("",new _l(n,[]))}(t,e),r=new Ta([new tl("",{})]),i=new Ta({}),o=new Ta({}),s=new Ta({}),a=new Ta(""),u=new Tl(r,i,s,a,o,"primary",e,n.root);return u.snapshot=n.root,new Sl(new _l(u,[]),n)}class Tl{constructor(t,e,n,r,i,o,s,a){this.url=t,this.params=e,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=s,this._futureSnapshot=a}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=this.params.pipe(z(t=>Vc(t)))),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(z(t=>Vc(t)))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}}function xl(t,e="emptyOnly"){const n=t.pathFromRoot;let r=0;if("always"!==e)for(r=n.length-1;r>=1;){const t=n[r],e=n[r-1];if(t.routeConfig&&""===t.routeConfig.path)r--;else{if(e.component)break;r--}}return function(t){return t.reduce((t,e)=>({params:Object.assign({},t.params,e.params),data:Object.assign({},t.data,e.data),resolve:Object.assign({},t.resolve,e._resolvedData)}),{params:{},data:{},resolve:{}})}(n.slice(r))}class Cl{constructor(t,e,n,r,i,o,s,a,u,c,l){this.url=t,this.params=e,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=s,this.routeConfig=a,this._urlSegment=u,this._lastPathIndex=c,this._resolve=l}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap||(this._paramMap=Vc(this.params)),this._paramMap}get queryParamMap(){return this._queryParamMap||(this._queryParamMap=Vc(this.queryParams)),this._queryParamMap}toString(){return`Route(url:'${this.url.map(t=>t.toString()).join("/")}', path:'${this.routeConfig?this.routeConfig.path:""}')`}}class Al extends yl{constructor(t,e){super(e),this.url=t,Nl(this,e)}toString(){return kl(this._root)}}function Nl(t,e){e.value._routerState=t,e.children.forEach(e=>Nl(t,e))}function kl(t){const e=t.children.length>0?` { ${t.children.map(kl).join(", ")} } `:"";return`${t.value}${e}`}function Rl(t){if(t.snapshot){const e=t.snapshot,n=t._futureSnapshot;t.snapshot=n,$c(e.queryParams,n.queryParams)||t.queryParams.next(n.queryParams),e.fragment!==n.fragment&&t.fragment.next(n.fragment),$c(e.params,n.params)||t.params.next(n.params),function(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;++n)if(!$c(t[n],e[n]))return!1;return!0}(e.url,n.url)||t.url.next(n.url),$c(e.data,n.data)||t.data.next(n.data)}else t.snapshot=t._futureSnapshot,t.data.next(t._futureSnapshot.data)}function Dl(t,e){var n,r;return $c(t.params,e.params)&&el(n=t.url,r=e.url)&&n.every((t,e)=>$c(t.parameters,r[e].parameters))&&!(!t.parent!=!e.parent)&&(!t.parent||Dl(t.parent,e.parent))}function Ol(t){return"object"==typeof t&&null!=t&&!t.outlets&&!t.segmentPath}function Pl(t,e,n,r,i){let o={};return r&&Qc(r,(t,e)=>{o[e]=Array.isArray(t)?t.map(t=>""+t):""+t}),new Xc(n.root===t?e:function t(e,n,r){const i={};return Qc(e.children,(e,o)=>{i[o]=e===n?r:t(e,n,r)}),new Jc(e.segments,i)}(n.root,t,e),o,i)}class Ll{constructor(t,e,n){if(this.isAbsolute=t,this.numberOfDoubleDots=e,this.commands=n,t&&n.length>0&&Ol(n[0]))throw new Error("Root segment cannot have matrix parameters");const r=n.find(t=>"object"==typeof t&&null!=t&&t.outlets);if(r&&r!==Kc(n))throw new Error("{outlets:{}} has to be the last command")}toRoot(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]}}class Ul{constructor(t,e,n){this.segmentGroup=t,this.processChildren=e,this.index=n}}function Ml(t){return"object"==typeof t&&null!=t&&t.outlets?t.outlets.primary:""+t}function Vl(t,e,n){if(t||(t=new Jc([],{})),0===t.segments.length&&t.hasChildren())return jl(t,e,n);const r=function(t,e,n){let r=0,i=e;const o={match:!1,pathIndex:0,commandIndex:0};for(;i<t.segments.length;){if(r>=n.length)return o;const e=t.segments[i],s=Ml(n[r]),a=r<n.length-1?n[r+1]:null;if(i>0&&void 0===s)break;if(s&&a&&"object"==typeof a&&void 0===a.outlets){if(!Bl(s,a,e))return o;r+=2}else{if(!Bl(s,{},e))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(t,e,n),i=n.slice(r.commandIndex);if(r.match&&r.pathIndex<t.segments.length){const e=new Jc(t.segments.slice(0,r.pathIndex),{});return e.children.primary=new Jc(t.segments.slice(r.pathIndex),t.children),jl(e,0,i)}return r.match&&0===i.length?new Jc(t.segments,{}):r.match&&!t.hasChildren()?Fl(t,e,n):r.match?jl(t,0,i):Fl(t,e,n)}function jl(t,e,n){if(0===n.length)return new Jc(t.segments,{});{const r=function(t){return"object"!=typeof t[0]||void 0===t[0].outlets?{primary:t}:t[0].outlets}(n),i={};return Qc(r,(n,r)=>{null!==n&&(i[r]=Vl(t.children[r],e,n))}),Qc(t.children,(t,e)=>{void 0===r[e]&&(i[e]=t)}),new Jc(t.segments,i)}}function Fl(t,e,n){const r=t.segments.slice(0,e);let i=0;for(;i<n.length;){if("object"==typeof n[i]&&void 0!==n[i].outlets){const t=ql(n[i].outlets);return new Jc(r,t)}if(0===i&&Ol(n[0])){r.push(new tl(t.segments[e].path,n[0])),i++;continue}const o=Ml(n[i]),s=i<n.length-1?n[i+1]:null;o&&s&&Ol(s)?(r.push(new tl(o,zl(s))),i+=2):(r.push(new tl(o,{})),i++)}return new Jc(r,{})}function ql(t){const e={};return Qc(t,(t,n)=>{null!==t&&(e[n]=Fl(new Jc([],{}),0,t))}),e}function zl(t){const e={};return Qc(t,(t,n)=>e[n]=""+t),e}function Bl(t,e,n){return t==n.path&&$c(e,n.parameters)}class Hl{constructor(t,e,n,r){this.routeReuseStrategy=t,this.futureState=e,this.currState=n,this.forwardEvent=r}activate(t){const e=this.futureState._root,n=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,n,t),Rl(this.futureState.root),this.activateChildRoutes(e,n,t)}deactivateChildRoutes(t,e,n){const r=El(e);t.children.forEach(t=>{const e=t.value.outlet;this.deactivateRoutes(t,r[e],n),delete r[e]}),Qc(r,(t,e)=>{this.deactivateRouteAndItsChildren(t,n)})}deactivateRoutes(t,e,n){const r=t.value,i=e?e.value:null;if(r===i)if(r.component){const i=n.getContext(r.outlet);i&&this.deactivateChildRoutes(t,e,i.children)}else this.deactivateChildRoutes(t,e,n);else i&&this.deactivateRouteAndItsChildren(e,n)}deactivateRouteAndItsChildren(t,e){this.routeReuseStrategy.shouldDetach(t.value.snapshot)?this.detachAndStoreRouteSubtree(t,e):this.deactivateRouteAndOutlet(t,e)}detachAndStoreRouteSubtree(t,e){const n=e.getContext(t.value.outlet);if(n&&n.outlet){const e=n.outlet.detach(),r=n.children.onOutletDeactivated();this.routeReuseStrategy.store(t.value.snapshot,{componentRef:e,route:t,contexts:r})}}deactivateRouteAndOutlet(t,e){const n=e.getContext(t.value.outlet);if(n){const r=El(t),i=t.value.component?n.children:e;Qc(r,(t,e)=>this.deactivateRouteAndItsChildren(t,i)),n.outlet&&(n.outlet.deactivate(),n.children.onOutletDeactivated())}}activateChildRoutes(t,e,n){const r=El(e);t.children.forEach(t=>{this.activateRoutes(t,r[t.value.outlet],n),this.forwardEvent(new Pc(t.value.snapshot))}),t.children.length&&this.forwardEvent(new Dc(t.value.snapshot))}activateRoutes(t,e,n){const r=t.value,i=e?e.value:null;if(Rl(r),r===i)if(r.component){const i=n.getOrCreateContext(r.outlet);this.activateChildRoutes(t,e,i.children)}else this.activateChildRoutes(t,e,n);else if(r.component){const e=n.getOrCreateContext(r.outlet);if(this.routeReuseStrategy.shouldAttach(r.snapshot)){const t=this.routeReuseStrategy.retrieve(r.snapshot);this.routeReuseStrategy.store(r.snapshot,null),e.children.onOutletReAttached(t.contexts),e.attachRef=t.componentRef,e.route=t.route.value,e.outlet&&e.outlet.attach(t.componentRef,t.route.value),Gl(t.route)}else{const n=function(t){for(let e=t.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig;if(t&&t.component)return null}return null}(r.snapshot),i=n?n.module.componentFactoryResolver:null;e.attachRef=null,e.route=r,e.resolver=i,e.outlet&&e.outlet.activateWith(r,i),this.activateChildRoutes(t,null,e.children)}}else this.activateChildRoutes(t,null,n)}}function Gl(t){Rl(t.value),t.children.forEach(Gl)}function $l(t){return"function"==typeof t}function Wl(t){return t instanceof Xc}class Kl{constructor(t){this.segmentGroup=t||null}}class Ql{constructor(t){this.urlTree=t}}function Zl(t){return new _(e=>e.error(new Kl(t)))}function Yl(t){return new _(e=>e.error(new Ql(t)))}function Xl(t){return new _(e=>e.error(new Error(`Only absolute redirects can have named outlets. redirectTo: '${t}'`)))}class Jl{constructor(t,e,n,r,i){this.configLoader=e,this.urlSerializer=n,this.urlTree=r,this.config=i,this.allowRedirects=!0,this.ngModule=t.get(Pt)}apply(){return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,"primary").pipe(z(t=>this.createUrlTree(t,this.urlTree.queryParams,this.urlTree.fragment))).pipe(Za(t=>{if(t instanceof Ql)return this.allowRedirects=!1,this.match(t.urlTree);if(t instanceof Kl)throw this.noMatchError(t);throw t}))}match(t){return this.expandSegmentGroup(this.ngModule,this.config,t.root,"primary").pipe(z(e=>this.createUrlTree(e,t.queryParams,t.fragment))).pipe(Za(t=>{if(t instanceof Kl)throw this.noMatchError(t);throw t}))}noMatchError(t){return new Error(`Cannot match any routes. URL Segment: '${t.segmentGroup}'`)}createUrlTree(t,e,n){const r=t.segments.length>0?new Jc([],{primary:t}):t;return new Xc(r,e,n)}expandSegmentGroup(t,e,n,r){return 0===n.segments.length&&n.hasChildren()?this.expandChildren(t,e,n).pipe(z(t=>new Jc([],t))):this.expandSegment(t,n,e,n.segments,r,!0)}expandChildren(t,e,n){return function(t,e){if(0===Object.keys(t).length)return Ia({});const n=[],r=[],i={};return Qc(t,(t,o)=>{const s=e(o,t).pipe(z(t=>i[o]=t));"primary"===o?n.push(s):r.push(s)}),Ia.apply(null,n.concat(r)).pipe(Da(),Qa(),z(()=>i))}(n.children,(n,r)=>this.expandSegmentGroup(t,e,r,n))}expandSegment(t,e,n,r,i,o){return Ia(...n).pipe(z(s=>this.expandSegmentAgainstRoute(t,e,n,s,r,i,o).pipe(Za(t=>{if(t instanceof Kl)return Ia(null);throw t}))),Da(),nu(t=>!!t),Za((t,n)=>{if(t instanceof Ca||"EmptyError"===t.name){if(this.noLeftoversInUrl(e,r,i))return Ia(new Jc([],{}));throw new Kl(e)}throw t}))}noLeftoversInUrl(t,e,n){return 0===e.length&&!t.children[n]}expandSegmentAgainstRoute(t,e,n,r,i,o,s){return rh(r)!==o?Zl(e):void 0===r.redirectTo?this.matchSegmentAgainstRoute(t,e,r,i):s&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,e,n,r,i,o):Zl(e)}expandSegmentAgainstRouteUsingRedirect(t,e,n,r,i,o){return"**"===r.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,n,r,o):this.expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,r,i,o)}expandWildCardWithParamsAgainstRouteUsingRedirect(t,e,n,r){const i=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?Yl(i):this.lineralizeSegments(n,i).pipe(W(n=>{const i=new Jc(n,{});return this.expandSegment(t,i,e,n,r,!1)}))}expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,r,i,o){const{matched:s,consumedSegments:a,lastChild:u,positionalParamSegments:c}=th(e,r,i);if(!s)return Zl(e);const l=this.applyRedirectCommands(a,r.redirectTo,c);return r.redirectTo.startsWith("/")?Yl(l):this.lineralizeSegments(r,l).pipe(W(r=>this.expandSegment(t,e,n,r.concat(i.slice(u)),o,!1)))}matchSegmentAgainstRoute(t,e,n,r){if("**"===n.path)return n.loadChildren?this.configLoader.load(t.injector,n).pipe(z(t=>(n._loadedConfig=t,new Jc(r,{})))):Ia(new Jc(r,{}));const{matched:i,consumedSegments:o,lastChild:s}=th(e,n,r);if(!i)return Zl(e);const a=r.slice(s);return this.getChildConfig(t,n,r).pipe(W(t=>{const n=t.module,r=t.routes,{segmentGroup:i,slicedSegments:s}=function(t,e,n,r){return n.length>0&&function(t,e,n){return n.some(n=>nh(t,e,n)&&"primary"!==rh(n))}(t,n,r)?{segmentGroup:eh(new Jc(e,function(t,e){const n={};n.primary=e;for(const r of t)""===r.path&&"primary"!==rh(r)&&(n[rh(r)]=new Jc([],{}));return n}(r,new Jc(n,t.children)))),slicedSegments:[]}:0===n.length&&function(t,e,n){return n.some(n=>nh(t,e,n))}(t,n,r)?{segmentGroup:eh(new Jc(t.segments,function(t,e,n,r){const i={};for(const o of n)nh(t,e,o)&&!r[rh(o)]&&(i[rh(o)]=new Jc([],{}));return Object.assign({},r,i)}(t,n,r,t.children))),slicedSegments:n}:{segmentGroup:t,slicedSegments:n}}(e,o,a,r);return 0===s.length&&i.hasChildren()?this.expandChildren(n,r,i).pipe(z(t=>new Jc(o,t))):0===r.length&&0===s.length?Ia(new Jc(o,{})):this.expandSegment(n,i,r,s,"primary",!0).pipe(z(t=>new Jc(o.concat(t.segments),t.children)))}))}getChildConfig(t,e,n){return e.children?Ia(new qc(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?Ia(e._loadedConfig):function(t,e,n){const r=e.canLoad;return r&&0!==r.length?$(r).pipe(z(r=>{const i=t.get(r);let o;if(function(t){return t&&$l(t.canLoad)}(i))o=i.canLoad(e,n);else{if(!$l(i))throw new Error("Invalid CanLoad guard");o=i(e,n)}return Zc(o)})).pipe(Da(),(i=t=>!0===t,t=>t.lift(new ru(i,void 0,t)))):Ia(!0);var i}(t.injector,e,n).pipe(W(n=>n?this.configLoader.load(t.injector,e).pipe(z(t=>(e._loadedConfig=t,t))):function(t){return new _(e=>e.error(jc(`Cannot load children because the guard of the route "path: '${t.path}'" returned false`)))}(e))):Ia(new qc([],t))}lineralizeSegments(t,e){let n=[],r=e.root;for(;;){if(n=n.concat(r.segments),0===r.numberOfChildren)return Ia(n);if(r.numberOfChildren>1||!r.children.primary)return Xl(t.redirectTo);r=r.children.primary}}applyRedirectCommands(t,e,n){return this.applyRedirectCreatreUrlTree(e,this.urlSerializer.parse(e),t,n)}applyRedirectCreatreUrlTree(t,e,n,r){const i=this.createSegmentGroup(t,e.root,n,r);return new Xc(i,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)}createQueryParams(t,e){const n={};return Qc(t,(t,r)=>{if("string"==typeof t&&t.startsWith(":")){const i=t.substring(1);n[r]=e[i]}else n[r]=t}),n}createSegmentGroup(t,e,n,r){const i=this.createSegments(t,e.segments,n,r);let o={};return Qc(e.children,(e,i)=>{o[i]=this.createSegmentGroup(t,e,n,r)}),new Jc(i,o)}createSegments(t,e,n,r){return e.map(e=>e.path.startsWith(":")?this.findPosParam(t,e,r):this.findOrReturn(e,n))}findPosParam(t,e,n){const r=n[e.path.substring(1)];if(!r)throw new Error(`Cannot redirect to '${t}'. Cannot find '${e.path}'.`);return r}findOrReturn(t,e){let n=0;for(const r of e){if(r.path===t.path)return e.splice(n),r;n++}return t}}function th(t,e,n){if(""===e.path)return"full"===e.pathMatch&&(t.hasChildren()||n.length>0)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:[],lastChild:0,positionalParamSegments:{}};const r=(e.matcher||Fc)(n,t,e);return r?{matched:!0,consumedSegments:r.consumed,lastChild:r.consumed.length,positionalParamSegments:r.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function eh(t){if(1===t.numberOfChildren&&t.children.primary){const e=t.children.primary;return new Jc(t.segments.concat(e.segments),e.children)}return t}function nh(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0!==n.redirectTo}function rh(t){return t.outlet||"primary"}class ih{constructor(t){this.path=t,this.route=this.path[this.path.length-1]}}class oh{constructor(t,e){this.component=t,this.route=e}}function sh(t,e,n){const r=t._root;return function t(e,n,r,i,o={canDeactivateChecks:[],canActivateChecks:[]}){const s=El(n);return e.children.forEach(e=>{!function(e,n,r,i,o={canDeactivateChecks:[],canActivateChecks:[]}){const s=e.value,a=n?n.value:null,u=r?r.getContext(e.value.outlet):null;if(a&&s.routeConfig===a.routeConfig){const c=function(t,e,n){if("function"==typeof n)return n(t,e);switch(n){case"pathParamsChange":return!el(t.url,e.url);case"pathParamsOrQueryParamsChange":return!el(t.url,e.url)||!$c(t.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!Dl(t,e)||!$c(t.queryParams,e.queryParams);case"paramsChange":default:return!Dl(t,e)}}(a,s,s.routeConfig.runGuardsAndResolvers);c?o.canActivateChecks.push(new ih(i)):(s.data=a.data,s._resolvedData=a._resolvedData),t(e,n,s.component?u?u.children:null:r,i,o),c&&o.canDeactivateChecks.push(new oh(u&&u.outlet&&u.outlet.component||null,a))}else a&&uh(n,u,o),o.canActivateChecks.push(new ih(i)),t(e,null,s.component?u?u.children:null:r,i,o)}(e,s[e.value.outlet],r,i.concat([e.value]),o),delete s[e.value.outlet]}),Qc(s,(t,e)=>uh(t,r.getContext(e),o)),o}(r,e?e._root:null,n,[r.value])}function ah(t,e,n){const r=function(t){if(!t)return null;for(let e=t.parent;e;e=e.parent){const t=e.routeConfig;if(t&&t._loadedConfig)return t._loadedConfig}return null}(e);return(r?r.module.injector:n).get(t)}function uh(t,e,n){const r=El(t),i=t.value;Qc(r,(t,r)=>{uh(t,i.component?e?e.children.getContext(r):null:e,n)}),n.canDeactivateChecks.push(new oh(i.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,i))}const ch=Symbol("INITIAL_VALUE");function lh(){return ou(t=>function(...t){let e=null,n=null;return N(t[t.length-1])&&(n=t.pop()),"function"==typeof t[t.length-1]&&(e=t.pop()),1===t.length&&u(t[0])&&(t=t[0]),G(t,n).lift(new Na(e))}(...t.map(t=>t.pipe(Ja(1),function(...t){return e=>{let n=t[t.length-1];N(n)?t.pop():n=null;const r=t.length;return function(...t){return Da()(Ia(...t))}(1!==r||n?r>0?G(t,n):Ea(n):Sa(t[0]),e)}}(ch)))).pipe(uu((t,e)=>{let n=!1;return e.reduce((t,r,i)=>{if(t!==ch)return t;if(r===ch&&(n=!0),!n){if(!1===r)return r;if(i===e.length-1||Wl(r))return r}return t},t)},ch),Oa(t=>t!==ch),z(t=>Wl(t)?t:!0===t),Ja(1)))}function hh(t,e){return null!==t&&e&&e(new Oc(t)),Ia(!0)}function fh(t,e){return null!==t&&e&&e(new Rc(t)),Ia(!0)}function dh(t,e,n){const r=e.routeConfig?e.routeConfig.canActivate:null;return r&&0!==r.length?Ia(r.map(r=>Ra(()=>{const i=ah(r,e,n);let o;if(function(t){return t&&$l(t.canActivate)}(i))o=Zc(i.canActivate(e,t));else{if(!$l(i))throw new Error("Invalid CanActivate guard");o=Zc(i(e,t))}return o.pipe(nu())}))).pipe(lh()):Ia(!0)}function ph(t,e,n){const r=e[e.length-1],i=e.slice(0,e.length-1).reverse().map(t=>function(t){const e=t.routeConfig?t.routeConfig.canActivateChild:null;return e&&0!==e.length?{node:t,guards:e}:null}(t)).filter(t=>null!==t).map(e=>Ra(()=>Ia(e.guards.map(i=>{const o=ah(i,e.node,n);let s;if(function(t){return t&&$l(t.canActivateChild)}(o))s=Zc(o.canActivateChild(r,t));else{if(!$l(o))throw new Error("Invalid CanActivateChild guard");s=Zc(o(r,t))}return s.pipe(nu())})).pipe(lh())));return Ia(i).pipe(lh())}class gh{}class vh{constructor(t,e,n,r,i,o){this.rootComponentType=t,this.config=e,this.urlTree=n,this.url=r,this.paramsInheritanceStrategy=i,this.relativeLinkResolution=o}recognize(){try{const t=wh(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,e=this.processSegmentGroup(this.config,t,"primary"),n=new Cl([],Object.freeze({}),Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,{},"primary",this.rootComponentType,null,this.urlTree.root,-1,{}),r=new _l(n,e),i=new Al(this.url,r);return this.inheritParamsAndData(i._root),Ia(i)}catch(t){return new _(e=>e.error(t))}}inheritParamsAndData(t){const e=t.value,n=xl(e,this.paramsInheritanceStrategy);e.params=Object.freeze(n.params),e.data=Object.freeze(n.data),t.children.forEach(t=>this.inheritParamsAndData(t))}processSegmentGroup(t,e,n){return 0===e.segments.length&&e.hasChildren()?this.processChildren(t,e):this.processSegment(t,e,e.segments,n)}processChildren(t,e){const n=nl(e,(e,n)=>this.processSegmentGroup(t,e,n));return function(t){const e={};t.forEach(t=>{const n=e[t.value.outlet];if(n){const e=n.url.map(t=>t.toString()).join("/"),r=t.value.url.map(t=>t.toString()).join("/");throw new Error(`Two segments cannot have the same outlet name: '${e}' and '${r}'.`)}e[t.value.outlet]=t.value})}(n),n.sort((t,e)=>"primary"===t.value.outlet?-1:"primary"===e.value.outlet?1:t.value.outlet.localeCompare(e.value.outlet)),n}processSegment(t,e,n,r){for(const o of t)try{return this.processSegmentAgainstRoute(o,e,n,r)}catch(i){if(!(i instanceof gh))throw i}if(this.noLeftoversInUrl(e,n,r))return[];throw new gh}noLeftoversInUrl(t,e,n){return 0===e.length&&!t.children[n]}processSegmentAgainstRoute(t,e,n,r){if(t.redirectTo)throw new gh;if((t.outlet||"primary")!==r)throw new gh;let i,o=[],s=[];if("**"===t.path){const o=n.length>0?Kc(n).parameters:{};i=new Cl(n,o,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,Eh(t),r,t.component,t,mh(e),yh(e)+n.length,Sh(t))}else{const a=function(t,e,n){if(""===e.path){if("full"===e.pathMatch&&(t.hasChildren()||n.length>0))throw new gh;return{consumedSegments:[],lastChild:0,parameters:{}}}const r=(e.matcher||Fc)(n,t,e);if(!r)throw new gh;const i={};Qc(r.posParams,(t,e)=>{i[e]=t.path});const o=r.consumed.length>0?Object.assign({},i,r.consumed[r.consumed.length-1].parameters):i;return{consumedSegments:r.consumed,lastChild:r.consumed.length,parameters:o}}(e,t,n);o=a.consumedSegments,s=n.slice(a.lastChild),i=new Cl(o,a.parameters,Object.freeze(Object.assign({},this.urlTree.queryParams)),this.urlTree.fragment,Eh(t),r,t.component,t,mh(e),yh(e)+o.length,Sh(t))}const a=function(t){return t.children?t.children:t.loadChildren?t._loadedConfig.routes:[]}(t),{segmentGroup:u,slicedSegments:c}=wh(e,o,s,a,this.relativeLinkResolution);if(0===c.length&&u.hasChildren()){const t=this.processChildren(a,u);return[new _l(i,t)]}if(0===a.length&&0===c.length)return[new _l(i,[])];const l=this.processSegment(a,u,c,"primary");return[new _l(i,l)]}}function mh(t){let e=t;for(;e._sourceSegment;)e=e._sourceSegment;return e}function yh(t){let e=t,n=e._segmentIndexShift?e._segmentIndexShift:0;for(;e._sourceSegment;)e=e._sourceSegment,n+=e._segmentIndexShift?e._segmentIndexShift:0;return n-1}function wh(t,e,n,r,i){if(n.length>0&&function(t,e,n){return n.some(n=>bh(t,e,n)&&"primary"!==_h(n))}(t,n,r)){const i=new Jc(e,function(t,e,n,r){const i={};i.primary=r,r._sourceSegment=t,r._segmentIndexShift=e.length;for(const o of n)if(""===o.path&&"primary"!==_h(o)){const n=new Jc([],{});n._sourceSegment=t,n._segmentIndexShift=e.length,i[_h(o)]=n}return i}(t,e,r,new Jc(n,t.children)));return i._sourceSegment=t,i._segmentIndexShift=e.length,{segmentGroup:i,slicedSegments:[]}}if(0===n.length&&function(t,e,n){return n.some(n=>bh(t,e,n))}(t,n,r)){const o=new Jc(t.segments,function(t,e,n,r,i,o){const s={};for(const a of r)if(bh(t,n,a)&&!i[_h(a)]){const n=new Jc([],{});n._sourceSegment=t,n._segmentIndexShift="legacy"===o?t.segments.length:e.length,s[_h(a)]=n}return Object.assign({},i,s)}(t,e,n,r,t.children,i));return o._sourceSegment=t,o._segmentIndexShift=e.length,{segmentGroup:o,slicedSegments:n}}const o=new Jc(t.segments,t.children);return o._sourceSegment=t,o._segmentIndexShift=e.length,{segmentGroup:o,slicedSegments:n}}function bh(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0===n.redirectTo}function _h(t){return t.outlet||"primary"}function Eh(t){return t.data||{}}function Sh(t){return t.resolve||{}}function Ih(t,e,n,r){const i=ah(t,e,r);return Zc(i.resolve?i.resolve(e,n):i(e,n))}function Th(t){return function(e){return e.pipe(ou(e=>{const n=t(e);return n?$(n).pipe(z(()=>e)):$([e])}))}}class xh{}class Ch{shouldDetach(t){return!1}store(t,e){}shouldAttach(t){return!1}retrieve(t){return null}shouldReuseRoute(t,e){return t.routeConfig===e.routeConfig}}const Ah=new It("ROUTES");class Nh{constructor(t,e,n,r){this.loader=t,this.compiler=e,this.onLoadStartListener=n,this.onLoadEndListener=r}load(t,e){return this.onLoadStartListener&&this.onLoadStartListener(e),this.loadModuleFactory(e.loadChildren).pipe(z(n=>{this.onLoadEndListener&&this.onLoadEndListener(e);const r=n.create(t);return new qc(Wc(r.injector.get(Ah)).map(Gc),r)}))}loadModuleFactory(t){return"string"==typeof t?$(this.loader.load(t)):Zc(t()).pipe(W(t=>t instanceof Lt?Ia(t):$(this.compiler.compileModuleAsync(t))))}}class kh{}class Rh{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,e){return t}}function Dh(t){throw t}function Oh(t,e,n){return e.parse("/")}function Ph(t,e){return Ia(null)}class Lh{constructor(t,e,n,r,i,o,s,a){this.rootComponentType=t,this.urlSerializer=e,this.rootContexts=n,this.location=r,this.config=a,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new C,this.errorHandler=Dh,this.malformedUriErrorHandler=Oh,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:Ph,afterPreactivation:Ph},this.urlHandlingStrategy=new Rh,this.routeReuseStrategy=new Ch,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="legacy",this.ngModule=i.get(Pt),this.console=i.get(Ti);const u=i.get(Bi);this.isNgZoneEnabled=u instanceof Bi,this.resetConfig(a),this.currentUrlTree=new Xc(new Jc([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new Nh(o,s,t=>this.triggerEvent(new Nc(t)),t=>this.triggerEvent(new kc(t))),this.routerState=Il(this.currentUrlTree,this.rootComponentType),this.transitions=new Ta({id:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}setupNavigations(t){const e=this.events;return t.pipe(Oa(t=>0!==t.id),z(t=>Object.assign({},t,{extractedUrl:this.urlHandlingStrategy.extract(t.rawUrl)})),ou(t=>{let n=!1,r=!1;return Ia(t).pipe(qa(t=>{this.currentNavigation={id:t.id,initialUrl:t.currentRawUrl,extractedUrl:t.extractedUrl,trigger:t.source,extras:t.extras,previousNavigation:this.lastSuccessfulNavigation?Object.assign({},this.lastSuccessfulNavigation,{previousNavigation:null}):null}}),ou(t=>{const n=!this.navigated||t.extractedUrl.toString()!==this.browserUrlTree.toString();if(("reload"===this.onSameUrlNavigation||n)&&this.urlHandlingStrategy.shouldProcessUrl(t.rawUrl))return Ia(t).pipe(ou(t=>{const n=this.transitions.getValue();return e.next(new bc(t.id,this.serializeUrl(t.extractedUrl),t.source,t.restoredState)),n!==this.transitions.getValue()?_a:[t]}),ou(t=>Promise.resolve(t)),(r=this.ngModule.injector,i=this.configLoader,o=this.urlSerializer,s=this.config,function(t){return t.pipe(ou(t=>function(t,e,n,r,i){return new Jl(t,e,n,r,i).apply()}(r,i,o,t.extractedUrl,s).pipe(z(e=>Object.assign({},t,{urlAfterRedirects:e})))))}),qa(t=>{this.currentNavigation=Object.assign({},this.currentNavigation,{finalUrl:t.urlAfterRedirects})}),function(t,e,n,r,i){return function(o){return o.pipe(W(o=>function(t,e,n,r,i="emptyOnly",o="legacy"){return new vh(t,e,n,r,i,o).recognize()}(t,e,o.urlAfterRedirects,n(o.urlAfterRedirects),r,i).pipe(z(t=>Object.assign({},o,{targetSnapshot:t})))))}}(this.rootComponentType,this.config,t=>this.serializeUrl(t),this.paramsInheritanceStrategy,this.relativeLinkResolution),qa(t=>{"eager"===this.urlUpdateStrategy&&(t.extras.skipLocationChange||this.setBrowserUrl(t.urlAfterRedirects,!!t.extras.replaceUrl,t.id,t.extras.state),this.browserUrlTree=t.urlAfterRedirects)}),qa(t=>{const n=new Ic(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.next(n)}));var r,i,o,s;if(n&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)){const{id:n,extractedUrl:r,source:i,restoredState:o,extras:s}=t,a=new bc(n,this.serializeUrl(r),i,o);e.next(a);const u=Il(r,this.rootComponentType).snapshot;return Ia(Object.assign({},t,{targetSnapshot:u,urlAfterRedirects:r,extras:Object.assign({},s,{skipLocationChange:!1,replaceUrl:!1})}))}return this.rawUrlTree=t.rawUrl,this.browserUrlTree=t.urlAfterRedirects,t.resolve(null),_a}),Th(t=>{const{targetSnapshot:e,id:n,extractedUrl:r,rawUrl:i,extras:{skipLocationChange:o,replaceUrl:s}}=t;return this.hooks.beforePreactivation(e,{navigationId:n,appliedUrlTree:r,rawUrlTree:i,skipLocationChange:!!o,replaceUrl:!!s})}),qa(t=>{const e=new Tc(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}),z(t=>Object.assign({},t,{guards:sh(t.targetSnapshot,t.currentSnapshot,this.rootContexts)})),function(t,e){return function(n){return n.pipe(W(n=>{const{targetSnapshot:r,currentSnapshot:i,guards:{canActivateChecks:o,canDeactivateChecks:s}}=n;return 0===s.length&&0===o.length?Ia(Object.assign({},n,{guardsResult:!0})):function(t,e,n,r){return $(t).pipe(W(t=>function(t,e,n,r,i){const o=e&&e.routeConfig?e.routeConfig.canDeactivate:null;return o&&0!==o.length?Ia(o.map(o=>{const s=ah(o,e,i);let a;if(function(t){return t&&$l(t.canDeactivate)}(s))a=Zc(s.canDeactivate(t,e,n,r));else{if(!$l(s))throw new Error("Invalid CanDeactivate guard");a=Zc(s(t,e,n,r))}return a.pipe(nu())})).pipe(lh()):Ia(!0)}(t.component,t.route,n,e,r)),nu(t=>!0!==t,!0))}(s,r,i,t).pipe(W(n=>n&&"boolean"==typeof n?function(t,e,n,r){return $(e).pipe(hu(e=>$([fh(e.route.parent,r),hh(e.route,r),ph(t,e.path,n),dh(t,e.route,n)]).pipe(Da(),nu(t=>!0!==t,!0))),nu(t=>!0!==t,!0))}(r,o,t,e):Ia(n)),z(t=>Object.assign({},n,{guardsResult:t})))}))}}(this.ngModule.injector,t=>this.triggerEvent(t)),qa(t=>{if(Wl(t.guardsResult)){const e=jc(`Redirecting to "${this.serializeUrl(t.guardsResult)}"`);throw e.url=t.guardsResult,e}}),qa(t=>{const e=new xc(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot,!!t.guardsResult);this.triggerEvent(e)}),Oa(t=>{if(!t.guardsResult){this.resetUrlToCurrentUrlTree();const n=new Ec(t.id,this.serializeUrl(t.extractedUrl),"");return e.next(n),t.resolve(!1),!1}return!0}),Th(t=>{if(t.guards.canActivateChecks.length)return Ia(t).pipe(qa(t=>{const e=new Cc(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}),(e=this.paramsInheritanceStrategy,n=this.ngModule.injector,function(t){return t.pipe(W(t=>{const{targetSnapshot:r,guards:{canActivateChecks:i}}=t;return i.length?$(i).pipe(hu(t=>function(t,e,n,r){return function(t,e,n,r){const i=Object.keys(t);if(0===i.length)return Ia({});if(1===i.length){const o=i[0];return Ih(t[o],e,n,r).pipe(z(t=>({[o]:t})))}const o={};return $(i).pipe(W(i=>Ih(t[i],e,n,r).pipe(z(t=>(o[i]=t,t))))).pipe(Qa(),z(()=>o))}(t._resolve,t,e,r).pipe(z(e=>(t._resolvedData=e,t.data=Object.assign({},t.data,xl(t,n).resolve),null)))}(t.route,r,e,n)),function(t,e){return arguments.length>=2?function(n){return w(uu(t,e),Va(1),$a(e))(n)}:function(e){return w(uu((e,n,r)=>t(e,n,r+1)),Va(1))(e)}}((t,e)=>t),z(e=>t)):Ia(t)}))}),qa(t=>{const e=new Ac(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);this.triggerEvent(e)}));var e,n}),Th(t=>{const{targetSnapshot:e,id:n,extractedUrl:r,rawUrl:i,extras:{skipLocationChange:o,replaceUrl:s}}=t;return this.hooks.afterPreactivation(e,{navigationId:n,appliedUrlTree:r,rawUrlTree:i,skipLocationChange:!!o,replaceUrl:!!s})}),z(t=>{const e=function(t,e,n){const r=function t(e,n,r){if(r&&e.shouldReuseRoute(n.value,r.value.snapshot)){const i=r.value;i._futureSnapshot=n.value;const o=function(e,n,r){return n.children.map(n=>{for(const i of r.children)if(e.shouldReuseRoute(i.value.snapshot,n.value))return t(e,n,i);return t(e,n)})}(e,n,r);return new _l(i,o)}{const r=e.retrieve(n.value);if(r){const t=r.route;return function t(e,n){if(e.value.routeConfig!==n.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(e.children.length!==n.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");n.value._futureSnapshot=e.value;for(let r=0;r<e.children.length;++r)t(e.children[r],n.children[r])}(n,t),t}{const r=new Tl(new Ta((i=n.value).url),new Ta(i.params),new Ta(i.queryParams),new Ta(i.fragment),new Ta(i.data),i.outlet,i.component,i),o=n.children.map(n=>t(e,n));return new _l(r,o)}}var i}(t,e._root,n?n._root:void 0);return new Sl(r,e)}(this.routeReuseStrategy,t.targetSnapshot,t.currentRouterState);return Object.assign({},t,{targetRouterState:e})}),qa(t=>{this.currentUrlTree=t.urlAfterRedirects,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t.rawUrl),this.routerState=t.targetRouterState,"deferred"===this.urlUpdateStrategy&&(t.extras.skipLocationChange||this.setBrowserUrl(this.rawUrlTree,!!t.extras.replaceUrl,t.id,t.extras.state),this.browserUrlTree=t.urlAfterRedirects)}),(o=this.rootContexts,s=this.routeReuseStrategy,a=t=>this.triggerEvent(t),z(t=>(new Hl(s,t.targetRouterState,t.currentRouterState,a).activate(o),t))),qa({next(){n=!0},complete(){n=!0}}),(i=()=>{if(!n&&!r){this.resetUrlToCurrentUrlTree();const n=new Ec(t.id,this.serializeUrl(t.extractedUrl),`Navigation ID ${t.id} is not equal to the current navigation id ${this.navigationId}`);e.next(n),t.resolve(!1)}this.currentNavigation=null},t=>t.lift(new fu(i))),Za(n=>{if(r=!0,(i=n)&&i.ngNavigationCancelingError){const r=Wl(n.url);r||(this.navigated=!0,this.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl));const i=new Ec(t.id,this.serializeUrl(t.extractedUrl),n.message);e.next(i),t.resolve(!1),r&&this.navigateByUrl(n.url)}else{this.resetStateAndUrl(t.currentRouterState,t.currentUrlTree,t.rawUrl);const r=new Sc(t.id,this.serializeUrl(t.extractedUrl),n);e.next(r);try{t.resolve(this.errorHandler(n))}catch(o){t.reject(o)}}var i;return _a}));var i,o,s,a}))}resetRootComponentType(t){this.rootComponentType=t,this.routerState.root.component=this.rootComponentType}getTransition(){const t=this.transitions.value;return t.urlAfterRedirects=this.browserUrlTree,t}setTransition(t){this.transitions.next(Object.assign({},this.getTransition(),t))}initialNavigation(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})}setUpLocationChangeListener(){this.locationSubscription||(this.locationSubscription=this.location.subscribe(t=>{let e=this.parseUrl(t.url);const n="popstate"===t.type?"popstate":"hashchange",r=t.state&&t.state.navigationId?t.state:null;setTimeout(()=>{this.scheduleNavigation(e,n,r,{replaceUrl:!0})},0)}))}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.currentNavigation}triggerEvent(t){this.events.next(t)}resetConfig(t){zc(t),this.config=t.map(Gc),this.navigated=!1,this.lastSuccessfulId=-1}ngOnDestroy(){this.dispose()}dispose(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=null)}createUrlTree(t,e={}){const{relativeTo:n,queryParams:r,fragment:i,preserveQueryParams:o,queryParamsHandling:s,preserveFragment:a}=e;$t()&&o&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead.");const u=n||this.routerState.root,c=a?this.currentUrlTree.fragment:i;let l=null;if(s)switch(s){case"merge":l=Object.assign({},this.currentUrlTree.queryParams,r);break;case"preserve":l=this.currentUrlTree.queryParams;break;default:l=r||null}else l=o?this.currentUrlTree.queryParams:r||null;return null!==l&&(l=this.removeEmptyProps(l)),function(t,e,n,r,i){if(0===n.length)return Pl(e.root,e.root,e,r,i);const o=function(t){if("string"==typeof t[0]&&1===t.length&&"/"===t[0])return new Ll(!0,0,t);let e=0,n=!1;const r=t.reduce((t,r,i)=>{if("object"==typeof r&&null!=r){if(r.outlets){const e={};return Qc(r.outlets,(t,n)=>{e[n]="string"==typeof t?t.split("/"):t}),[...t,{outlets:e}]}if(r.segmentPath)return[...t,r.segmentPath]}return"string"!=typeof r?[...t,r]:0===i?(r.split("/").forEach((r,i)=>{0==i&&"."===r||(0==i&&""===r?n=!0:".."===r?e++:""!=r&&t.push(r))}),t):[...t,r]},[]);return new Ll(n,e,r)}(n);if(o.toRoot())return Pl(e.root,new Jc([],{}),e,r,i);const s=function(t,e,n){if(t.isAbsolute)return new Ul(e.root,!0,0);if(-1===n.snapshot._lastPathIndex)return new Ul(n.snapshot._urlSegment,!0,0);const r=Ol(t.commands[0])?0:1;return function(t,e,n){let r=t,i=e,o=n;for(;o>i;){if(o-=i,r=r.parent,!r)throw new Error("Invalid number of '../'");i=r.segments.length}return new Ul(r,!1,i-o)}(n.snapshot._urlSegment,n.snapshot._lastPathIndex+r,t.numberOfDoubleDots)}(o,e,t),a=s.processChildren?jl(s.segmentGroup,s.index,o.commands):Vl(s.segmentGroup,s.index,o.commands);return Pl(s.segmentGroup,a,e,r,i)}(u,this.currentUrlTree,t,l,c)}navigateByUrl(t,e={skipLocationChange:!1}){$t()&&this.isNgZoneEnabled&&!Bi.isInAngularZone()&&this.console.warn("Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?");const n=Wl(t)?t:this.parseUrl(t),r=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(r,"imperative",null,e)}navigate(t,e={skipLocationChange:!1}){return function(t){for(let e=0;e<t.length;e++){const n=t[e];if(null==n)throw new Error(`The requested path contains ${n} segment at index ${e}`)}}(t),this.navigateByUrl(this.createUrlTree(t,e),e)}serializeUrl(t){return this.urlSerializer.serialize(t)}parseUrl(t){let e;try{e=this.urlSerializer.parse(t)}catch(n){e=this.malformedUriErrorHandler(n,this.urlSerializer,t)}return e}isActive(t,e){if(Wl(t))return Yc(this.currentUrlTree,t,e);const n=this.parseUrl(t);return Yc(this.currentUrlTree,n,e)}removeEmptyProps(t){return Object.keys(t).reduce((e,n)=>{const r=t[n];return null!=r&&(e[n]=r),e},{})}processNavigations(){this.navigations.subscribe(t=>{this.navigated=!0,this.lastSuccessfulId=t.id,this.events.next(new _c(t.id,this.serializeUrl(t.extractedUrl),this.serializeUrl(this.currentUrlTree))),this.lastSuccessfulNavigation=this.currentNavigation,this.currentNavigation=null,t.resolve(!0)},t=>{this.console.warn("Unhandled Navigation Error: ")})}scheduleNavigation(t,e,n,r){const i=this.getTransition();if(i&&"imperative"!==e&&"imperative"===i.source&&i.rawUrl.toString()===t.toString())return Promise.resolve(!0);if(i&&"hashchange"==e&&"popstate"===i.source&&i.rawUrl.toString()===t.toString())return Promise.resolve(!0);if(i&&"popstate"==e&&"hashchange"===i.source&&i.rawUrl.toString()===t.toString())return Promise.resolve(!0);let o=null,s=null;const a=new Promise((t,e)=>{o=t,s=e}),u=++this.navigationId;return this.setTransition({id:u,source:e,restoredState:n,currentUrlTree:this.currentUrlTree,currentRawUrl:this.rawUrlTree,rawUrl:t,extras:r,resolve:o,reject:s,promise:a,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),a.catch(t=>Promise.reject(t))}setBrowserUrl(t,e,n,r){const i=this.urlSerializer.serialize(t);r=r||{},this.location.isCurrentPathEqualTo(i)||e?this.location.replaceState(i,"",Object.assign({},r,{navigationId:n})):this.location.go(i,"",Object.assign({},r,{navigationId:n}))}resetStateAndUrl(t,e,n){this.routerState=t,this.currentUrlTree=e,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,n),this.resetUrlToCurrentUrlTree()}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.rawUrlTree),"",{navigationId:this.lastSuccessfulId})}}class Uh{constructor(){this.outlet=null,this.route=null,this.resolver=null,this.children=new Mh,this.attachRef=null}}class Mh{constructor(){this.contexts=new Map}onChildOutletCreated(t,e){const n=this.getOrCreateContext(t);n.outlet=e,this.contexts.set(t,n)}onChildOutletDestroyed(t){const e=this.getContext(t);e&&(e.outlet=null)}onOutletDeactivated(){const t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let e=this.getContext(t);return e||(e=new Uh,this.contexts.set(t,e)),e}getContext(t){return this.contexts.get(t)||null}}class Vh{constructor(t,e,n,r,i){this.parentContexts=t,this.location=e,this.resolver=n,this.changeDetector=i,this.activated=null,this._activatedRoute=null,this.activateEvents=new pi,this.deactivateEvents=new pi,this.name=r||"primary",t.onChildOutletCreated(this.name,this)}ngOnDestroy(){this.parentContexts.onChildOutletDestroyed(this.name)}ngOnInit(){if(!this.activated){const t=this.parentContexts.getContext(this.name);t&&t.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.resolver||null))}}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new Error("Outlet is not activated");return this.activated.instance}get activatedRoute(){if(!this.activated)throw new Error("Outlet is not activated");return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new Error("Outlet is not activated");this.location.detach();const t=this.activated;return this.activated=null,this._activatedRoute=null,t}attach(t,e){this.activated=t,this._activatedRoute=e,this.location.insert(t.hostView)}deactivate(){if(this.activated){const t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,e){if(this.isActivated)throw new Error("Cannot activate an already activated outlet");this._activatedRoute=t;const n=(e=e||this.resolver).resolveComponentFactory(t._futureSnapshot.routeConfig.component),r=this.parentContexts.getOrCreateContext(this.name).children,i=new jh(t,r,this.location.injector);this.activated=this.location.createComponent(n,this.location.length,i),this.changeDetector.markForCheck(),this.activateEvents.emit(this.activated.instance)}}class jh{constructor(t,e,n){this.route=t,this.childContexts=e,this.parent=n}get(t,e){return t===Tl?this.route:t===Mh?this.childContexts:this.parent.get(t,e)}}class Fh{}class qh{preload(t,e){return e().pipe(Za(()=>Ia(null)))}}class zh{preload(t,e){return Ia(null)}}class Bh{constructor(t,e,n,r,i){this.router=t,this.injector=r,this.preloadingStrategy=i,this.loader=new Nh(e,n,e=>t.triggerEvent(new Nc(e)),e=>t.triggerEvent(new kc(e)))}setUpPreloading(){this.subscription=this.router.events.pipe(Oa(t=>t instanceof _c),hu(()=>this.preload())).subscribe(()=>{})}preload(){const t=this.injector.get(Pt);return this.processRoutes(t,this.router.config)}ngOnDestroy(){this.subscription.unsubscribe()}processRoutes(t,e){const n=[];for(const r of e)if(r.loadChildren&&!r.canLoad&&r._loadedConfig){const t=r._loadedConfig;n.push(this.processRoutes(t.module,t.routes))}else r.loadChildren&&!r.canLoad?n.push(this.preloadConfig(t,r)):r.children&&n.push(this.processRoutes(t,r.children));return $(n).pipe(Y(),z(t=>{}))}preloadConfig(t,e){return this.preloadingStrategy.preload(e,()=>this.loader.load(t.injector,e).pipe(W(t=>(e._loadedConfig=t,this.processRoutes(t.module,t.routes)))))}}class Hh{constructor(t,e,n={}){this.router=t,this.viewportScroller=e,this.options=n,this.lastId=0,this.lastSource="imperative",this.restoredId=0,this.store={},n.scrollPositionRestoration=n.scrollPositionRestoration||"disabled",n.anchorScrolling=n.anchorScrolling||"disabled"}init(){"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.router.events.subscribe(t=>{t instanceof bc?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=t.navigationTrigger,this.restoredId=t.restoredState?t.restoredState.navigationId:0):t instanceof _c&&(this.lastId=t.id,this.scheduleScrollEvent(t,this.router.parseUrl(t.urlAfterRedirects).fragment))})}consumeScrollEvents(){return this.router.events.subscribe(t=>{t instanceof Lc&&(t.position?"top"===this.options.scrollPositionRestoration?this.viewportScroller.scrollToPosition([0,0]):"enabled"===this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition(t.position):t.anchor&&"enabled"===this.options.anchorScrolling?this.viewportScroller.scrollToAnchor(t.anchor):"disabled"!==this.options.scrollPositionRestoration&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(t,e){this.router.triggerEvent(new Lc(t,"popstate"===this.lastSource?this.store[this.restoredId]:null,e))}ngOnDestroy(){this.routerEventsSubscription&&this.routerEventsSubscription.unsubscribe(),this.scrollEventsSubscription&&this.scrollEventsSubscription.unsubscribe()}}const Gh=new It("ROUTER_CONFIGURATION"),$h=new It("ROUTER_FORROOT_GUARD"),Wh=[ta,{provide:rl,useClass:il},{provide:Lh,useFactory:tf,deps:[ao,rl,Mh,ta,Te,co,Di,Ah,Gh,[kh,new at],[xh,new at]]},Mh,{provide:Tl,useFactory:ef,deps:[Lh]},{provide:co,useClass:fo},Bh,zh,qh,{provide:Gh,useValue:{enableTracing:!1}}];function Kh(){return new no("Router",Lh)}class Qh{constructor(t,e){}static forRoot(t,e){return{ngModule:Qh,providers:[Wh,Jh(t),{provide:$h,useFactory:Xh,deps:[[Lh,new at,new ct]]},{provide:Gh,useValue:e||{}},{provide:Xs,useFactory:Yh,deps:[Zs,[new st(Js),new at],Gh]},{provide:Hh,useFactory:Zh,deps:[Lh,wa,Gh]},{provide:Fh,useExisting:e&&e.preloadingStrategy?e.preloadingStrategy:zh},{provide:no,multi:!0,useFactory:Kh},[nf,{provide:mi,multi:!0,useFactory:rf,deps:[nf]},{provide:sf,useFactory:of,deps:[nf]},{provide:Ii,multi:!0,useExisting:sf}]]}}static forChild(t){return{ngModule:Qh,providers:[Jh(t)]}}}function Zh(t,e,n){return n.scrollOffset&&e.setOffset(n.scrollOffset),new Hh(t,e,n)}function Yh(t,e,n={}){return n.useHash?new na(t,e):new ra(t,e)}function Xh(t){if(t)throw new Error("RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.");return"guarded"}function Jh(t){return[{provide:Oe,multi:!0,useValue:t},{provide:Ah,multi:!0,useValue:t}]}function tf(t,e,n,r,i,o,s,a,u={},c,l){const h=new Lh(null,e,n,r,i,o,s,Wc(a));if(c&&(h.urlHandlingStrategy=c),l&&(h.routeReuseStrategy=l),u.errorHandler&&(h.errorHandler=u.errorHandler),u.malformedUriErrorHandler&&(h.malformedUriErrorHandler=u.malformedUriErrorHandler),u.enableTracing){const t=gu();h.events.subscribe(e=>{t.logGroup("Router Event: "+e.constructor.name),t.log(e.toString()),t.log(e),t.logGroupEnd()})}return u.onSameUrlNavigation&&(h.onSameUrlNavigation=u.onSameUrlNavigation),u.paramsInheritanceStrategy&&(h.paramsInheritanceStrategy=u.paramsInheritanceStrategy),u.urlUpdateStrategy&&(h.urlUpdateStrategy=u.urlUpdateStrategy),u.relativeLinkResolution&&(h.relativeLinkResolution=u.relativeLinkResolution),h}function ef(t){return t.routerState.root}class nf{constructor(t){this.injector=t,this.initNavigation=!1,this.resultOfPreactivationDone=new C}appInitializer(){return this.injector.get(Ys,Promise.resolve(null)).then(()=>{let t=null;const e=new Promise(e=>t=e),n=this.injector.get(Lh),r=this.injector.get(Gh);if(this.isLegacyDisabled(r)||this.isLegacyEnabled(r))t(!0);else if("disabled"===r.initialNavigation)n.setUpLocationChangeListener(),t(!0);else{if("enabled"!==r.initialNavigation)throw new Error(`Invalid initialNavigation options: '${r.initialNavigation}'`);n.hooks.afterPreactivation=()=>this.initNavigation?Ia(null):(this.initNavigation=!0,t(!0),this.resultOfPreactivationDone),n.initialNavigation()}return e})}bootstrapListener(t){const e=this.injector.get(Gh),n=this.injector.get(Bh),r=this.injector.get(Hh),i=this.injector.get(Lh),o=this.injector.get(ao);t===o.components[0]&&(this.isLegacyEnabled(e)?i.initialNavigation():this.isLegacyDisabled(e)&&i.setUpLocationChangeListener(),n.setUpPreloading(),r.init(),i.resetRootComponentType(o.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())}isLegacyEnabled(t){return"legacy_enabled"===t.initialNavigation||!0===t.initialNavigation||void 0===t.initialNavigation}isLegacyDisabled(t){return"legacy_disabled"===t.initialNavigation||!1===t.initialNavigation}}function rf(t){return t.appInitializer.bind(t)}function of(t){return t.bootstrapListener.bind(t)}const sf=new It("Router Initializer");var af=qn({encapsulation:2,styles:[],data:{}});function uf(t){return qo(0,[(t()(),Ao(0,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),Kr(1,212992,null,0,Vh,[Mh,Tn,Ke,[8,null],_e],null,null)],(function(t,e){t(e,1,0)}),null)}function cf(t){return qo(0,[(t()(),Ao(0,0,null,null,1,"ng-component",[],null,null,null,uf,af)),Kr(1,49152,null,0,Uc,[],null,null)],null,null)}var lf=Tr("ng-component",Uc,cf,{},{},[]);class hf extends f{constructor(t,e){super()}schedule(t,e=0){return this}}class ff extends hf{constructor(t,e){super(t,e),this.scheduler=t,this.work=e,this.pending=!1}schedule(t,e=0){if(this.closed)return this;this.state=t;const n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this}requestAsyncId(t,e,n=0){return setInterval(t.flush.bind(t,this),n)}recycleAsyncId(t,e,n=0){if(null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)}execute(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;const n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,e){let n=!1,r=void 0;try{this.work(t)}catch(i){n=!0,r=!!i&&i||new Error(i)}if(n)return this.unsubscribe(),r}_unsubscribe(){const t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null}}let df=(()=>{class t{constructor(e,n=t.now){this.SchedulerAction=e,this.now=n}schedule(t,e=0,n){return new this.SchedulerAction(this,t).schedule(n,e)}}return t.now=()=>Date.now(),t})();class pf extends df{constructor(t,e=df.now){super(t,()=>pf.delegate&&pf.delegate!==this?pf.delegate.now():e()),this.actions=[],this.active=!1,this.scheduled=void 0}schedule(t,e=0,n){return pf.delegate&&pf.delegate!==this?pf.delegate.schedule(t,e,n):super.schedule(t,e,n)}flush(t){const{actions:e}=this;if(this.active)return void e.push(t);let n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}}const gf=new pf(ff);function vf(t,e){return function(t,e=gf){return new _(n=>{let r;return null!=e?e.schedule(()=>{r=t.onSnapshot(n)}):r=t.onSnapshot(n),function(){null!=r&&r()}})}(t,e)}function mf(t,e){return vf(t,e).pipe(z(t=>({payload:t,type:"query"})))}let yf=(()=>{class t{constructor(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}observe(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}}do(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}}accept(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)}toObservable(){switch(this.kind){case"N":return Ia(this.value);case"E":return t=this.error,new _(e=>e.error(t));case"C":return Ea()}var t;throw new Error("unexpected notification kind value")}static createNext(e){return void 0!==e?new t("N",e):t.undefinedValueNotification}static createError(e){return new t("E",void 0,e)}static createComplete(){return t.completeNotification}}return t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t})();function wf(t,e=0){return function(n){return n.lift(new bf(t,e))}}class bf{constructor(t,e=0){this.scheduler=t,this.delay=e}call(t,e){return e.subscribe(new _f(t,this.scheduler,this.delay))}}class _f extends g{constructor(t,e,n=0){super(t),this.scheduler=e,this.delay=n}static dispatch(t){const{notification:e,destination:n}=t;e.observe(n),this.unsubscribe()}scheduleMessage(t){this.destination.add(this.scheduler.schedule(_f.dispatch,this.delay,new Ef(t,this.destination)))}_next(t){this.scheduleMessage(yf.createNext(t))}_error(t){this.scheduleMessage(yf.createError(t)),this.unsubscribe()}_complete(){this.scheduleMessage(yf.createComplete()),this.unsubscribe()}}class Ef{constructor(t,e){this.notification=t,this.destination=e}}function Sf(t,e){return mf(t,e).pipe(z(t=>t.payload.docChanges().map(t=>({type:t.type,payload:t}))))}function If(t,e,n){return mf(t,n).pipe(z(t=>t.payload.docChanges()),uu((t,n)=>function(t,e,n){return e.forEach(e=>{n.indexOf(e.type)>-1&&(t=function(t,e){switch(e.type){case"added":t[e.newIndex]&&t[e.newIndex].doc.ref.isEqual(e.doc.ref)||t.splice(e.newIndex,0,e);break;case"modified":(null==t[e.oldIndex]||t[e.oldIndex].doc.ref.isEqual(e.doc.ref))&&(e.oldIndex!==e.newIndex?(t.splice(e.oldIndex,1),t.splice(e.newIndex,0,e)):t.splice(e.newIndex,1,e));break;case"removed":t[e.oldIndex]&&t[e.oldIndex].doc.ref.isEqual(e.doc.ref)&&t.splice(e.oldIndex,1)}return t}(t,e))}),t}(t,n,e),[]),z(t=>t.map(t=>({type:t.type,payload:t}))))}function Tf(t){return t&&0!==t.length||(t=["added","removed","modified"]),t}class xf{constructor(t,e,n){this.ref=t,this.query=e,this.afs=n}stateChanges(t){return t&&0!==t.length?Sf(this.query,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst,z(e=>e.filter(e=>t.indexOf(e.type)>-1)),Oa(t=>t.length>0)):Sf(this.query,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst)}auditTrail(t){return this.stateChanges(t).pipe(uu((t,e)=>[...t,...e],[]))}snapshotChanges(t){const e=Tf(t);return If(this.query,e,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst)}valueChanges(t={}){return mf(this.query,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst,z(e=>e.payload.docs.map(e=>t.idField?Object.assign({},e.data(),{[t.idField]:e.id}):e.data())))}get(t){return $(this.query.get(t)).pipe(wf(this.afs.schedulers.insideAngular))}add(t){return this.ref.add(t)}doc(t){return new Cf(this.ref.doc(t),this.afs)}}class Cf{constructor(t,e){this.ref=t,this.afs=e}set(t,e){return this.ref.set(t,e)}update(t){return this.ref.update(t)}delete(){return this.ref.delete()}collection(t,e){const n=this.ref.collection(t),{ref:r,query:i}=sd(n,e);return new xf(r,i,this.afs)}snapshotChanges(){return vf(this.ref,this.afs.schedulers.outsideAngular).pipe(z(t=>({payload:t,type:"value"}))).pipe(this.afs.keepUnstableUntilFirst)}valueChanges(){return this.snapshotChanges().pipe(z(t=>t.payload.data()))}get(t){return $(this.ref.get(t)).pipe(wf(this.afs.schedulers.insideAngular))}}class Af{constructor(t,e){this.query=t,this.afs=e}stateChanges(t){return t&&0!==t.length?Sf(this.query,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst,z(e=>e.filter(e=>t.indexOf(e.type)>-1)),Oa(t=>t.length>0)):Sf(this.query,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst)}auditTrail(t){return this.stateChanges(t).pipe(uu((t,e)=>[...t,...e],[]))}snapshotChanges(t){const e=Tf(t);return If(this.query,e,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst)}valueChanges(){return mf(this.query,this.afs.schedulers.outsideAngular).pipe(this.afs.keepUnstableUntilFirst,z(t=>t.payload.docs.map(t=>t.data())))}get(t){return $(this.query.get(t)).pipe(wf(this.afs.schedulers.insideAngular))}}class Nf extends ff{constructor(t,e){super(t,e),this.scheduler=t,this.work=e}schedule(t,e=0){return e>0?super.schedule(t,e):(this.delay=e,this.state=t,this.scheduler.flush(this),this)}execute(t,e){return e>0||this.closed?super.execute(t,e):this._execute(t,e)}requestAsyncId(t,e,n=0){return null!==n&&n>0||null===n&&this.delay>0?super.requestAsyncId(t,e,n):t.flush(this)}}class kf extends pf{}const Rf=new kf(Nf);let Df=1;const Of={},Pf={setImmediate(t){const e=Df++;return Of[e]=t,Promise.resolve().then(()=>function(t){const e=Of[t];e&&e()}(e)),e},clearImmediate(t){delete Of[t]}};class Lf extends ff{constructor(t,e){super(t,e),this.scheduler=t,this.work=e}requestAsyncId(t,e,n=0){return null!==n&&n>0?super.requestAsyncId(t,e,n):(t.actions.push(this),t.scheduled||(t.scheduled=Pf.setImmediate(t.flush.bind(t,null))))}recycleAsyncId(t,e,n=0){if(null!==n&&n>0||null===n&&this.delay>0)return super.recycleAsyncId(t,e,n);0===t.actions.length&&(Pf.clearImmediate(e),t.scheduled=void 0)}}class Uf extends pf{flush(t){this.active=!0,this.scheduled=void 0;const{actions:e}=this;let n,r=-1,i=e.length;t=t||e.shift();do{if(n=t.execute(t.state,t.delay))break}while(++r<i&&(t=e.shift()));if(this.active=!1,n){for(;++r<i&&(t=e.shift());)t.unsubscribe();throw n}}}const Mf=new Uf(Lf);class Vf extends _{constructor(t,e=0,n=Mf){var r;super(),this.source=t,this.delayTime=e,this.scheduler=n,(u(r=e)||!(r-parseFloat(r)+1>=0)||e<0)&&(this.delayTime=0),n&&"function"==typeof n.schedule||(this.scheduler=Mf)}static create(t,e=0,n=Mf){return new Vf(t,e,n)}static dispatch(t){const{source:e,subscriber:n}=t;return this.add(e.subscribe(n))}_subscribe(t){return this.scheduler.schedule(Vf.dispatch,this.delayTime,{source:this.source,subscriber:t})}}class jf{constructor(t,e){this.scheduler=t,this.delay=e}call(t,e){return new Vf(e,this.delay,this.scheduler).subscribe(t)}}function Ff(){}class qf{constructor(t,e=Rf){this.zone=t,this.delegate=e}now(){return this.delegate.now()}schedule(t,e,n){const r=this.zone;return this.delegate.schedule((function(e){r.runGuarded(()=>{t.apply(this,[e])})}),e,n)}}class zf{constructor(t){this.zone=t,this.task=null}call(t,e){const n=this.unscheduleTask.bind(this);return this.task=this.zone.run(()=>Zone.current.scheduleMacroTask("firebaseZoneBlock",Ff,{},Ff,Ff)),e.pipe(qa(n,n,n)).subscribe(t).add(n)}unscheduleTask(){null!=this.task&&"scheduled"===this.task.state&&(this.task.invoke(),this.task=null)}}class Bf{constructor(t){this.ngZone=t,this.outsideAngular=t.runOutsideAngular(()=>new qf(Zone.current)),this.insideAngular=t.run(()=>new qf(Zone.current,gf))}}var Hf,Gf=n("Wcq6"),$f=n.n(Gf);const Wf=new It("angularfire2.app.options"),Kf=new It("angularfire2.app.nameOrConfig"),Qf=Wf,Zf=Kf;class Yf{}const Xf=new sn("5.4.2");function Jf(t,e,n){const r="object"==typeof n&&n||{};return r.name=r.name||"string"==typeof n&&n||"[DEFAULT]",$f.a.apps.filter(t=>t&&t.name===r.name)[0]||e.runOutsideAngular(()=>$f.a.initializeApp(t,r))}let td=Hf=class{constructor(t){$f.a.registerVersion&&($f.a.registerVersion("angularfire",Xf.full,t.toString()),$f.a.registerVersion("angular",an.full))}static initializeApp(t,e){return{ngModule:Hf,providers:[{provide:Qf,useValue:t},{provide:Zf,useValue:e}]}}};const ed=new It("angularfire2.enableFirestorePersistence"),nd=new It("angularfire2.firestore.persistenceSettings"),rd=new It("angularfire2.firestore.settings"),id=parseInt($f.a.SDK_VERSION.split(".")[0]),od=id<5||5==id&&parseInt($f.a.SDK_VERSION.split(".")[1])<8?{timestampsInSnapshots:!0}:{};function sd(t,e=(t=>t)){return{query:e(t),ref:t}}let ad=class{constructor(t,e,n,r,i,o,s){this.schedulers=new Bf(o),this.keepUnstableUntilFirst=function(t,e){return function(n){return ya(e)&&(n=n.lift(new zf(t.ngZone))),n.pipe(function(t,e=0){return function(n){return n.lift(new jf(t,e))}}(t.outsideAngular),wf(t.insideAngular))}}(this.schedulers,i),this.firestore=o.runOutsideAngular(()=>{const n=Jf(t,o,e).firestore();return n.settings(r||od),n}),this.persistenceEnabled$=n&&!ya(i)?o.runOutsideAngular(()=>{try{return $(this.firestore.enablePersistence(s||void 0).then(()=>!0,()=>!1))}catch(t){return Ia(!1)}}):Ia(!1)}collection(t,e){let n;n="string"==typeof t?this.firestore.collection(t):t;const{ref:r,query:i}=sd(n,e);return new xf(r,i,this)}collectionGroup(t,e){if(id<6)throw"collection group queries require Firebase JS SDK >= 6.0";const n=e||(t=>t),r=this.firestore.collectionGroup(t);return new Af(n(r),this)}doc(t){let e;return e="string"==typeof t?this.firestore.doc(t):t,new Cf(e,this)}createId(){return this.firestore.collection("_").doc().id}};var ud=qn({encapsulation:0,styles:[[""]],data:{}});function cd(t){return qo(0,[(t()(),Ao(0,0,null,null,1,"li",[["class","text"]],null,null,null,null,null)),(t()(),Vo(1,null,[" "," "]))],null,(function(t,e){t(e,1,0,e.context.$implicit.saySomting)}))}function ld(t){return qo(0,[(t()(),Ao(0,0,null,null,3,"ul",[],null,null,null,null,null)),(t()(),Co(16777216,null,null,2,null,cd)),Kr(2,278528,null,0,ca,[Tn,Sn,yn],{ngForOf:[0,"ngForOf"]},null),(e=131072,n=ga,r=[_e],Qr(-1,e|=16,null,0,n,n,r))],(function(t,e){var n=e.component;t(e,2,0,function(t,e,n,r){if(Ve.isWrapped(r)){r=Ve.unwrap(r);const e=t.def.nodes[2].bindingIndex+0,n=Ve.unwrap(t.oldValues[e]);t.oldValues[e]=new Ve(n)}return r}(e,0,0,function(t,e){const n=t.def.nodes[3];if(1&n.flags){const e=On(t,n.nodeIndex);return n.element.template?e.template:e.renderElement}if(2&n.flags)return Dn(t,n.nodeIndex).renderText;if(20240&n.flags)return Pn(t,n.nodeIndex).instance;throw new Error("Illegal state: read nodeValue for node index 3")}(e).transform(n.items)))}),null);var e,n,r}function hd(t){return qo(0,[(t()(),Ao(0,0,null,null,1,"app-root",[],null,null,null,ld,ud)),Kr(1,49152,null,0,Qs,[ad],null,null)],null,null)}var fd,dd=Tr("app-root",Qs,hd,{},{},[]);n("6Joi");let pd=fd=class{static enablePersistence(t){return{ngModule:fd,providers:[{provide:ed,useValue:!0},{provide:nd,useValue:t}]}}};class gd{}var vd=$s(Ks,[Qs],(function(t){return function(t){const e={},n=[];let r=!1;for(let i=0;i<t.length;i++){const o=t[i];o.token===Se&&!0===o.value&&(r=!0),1073741824&o.flags&&n.push(o.token),o.index=i,e[Fn(o.token)]=o}return{factory:null,providersByKey:e,providers:t,modules:n,isRoot:r}}([yr(512,Ke,Qe,[[8,[lf,dd]],[3,Ke],Pt]),yr(5120,xi,Io,[[3,xi]]),yr(4608,sa,aa,[xi,[2,oa]]),yr(5120,ci,To,[Bi]),yr(5120,wi,bi,[]),yr(5120,yn,Eo,[]),yr(5120,wn,So,[]),yr(4608,uc,cc,[ma]),yr(6144,ge,null,[uc]),yr(4608,ec,rc,[]),yr(5120,ku,(function(t,e,n,r,i,o,s,a){return[new Ju(t,e,n),new ac(r),new ic(i,o,s,a)]}),[ma,Bi,Si,ma,ma,ec,Ti,[2,nc]]),yr(4608,Ru,Ru,[ku,Bi]),yr(135680,Pu,Pu,[ma]),yr(4608,ju,ju,[Ru,Pu,wi]),yr(6144,en,null,[ju]),yr(6144,Ou,null,[Pu]),yr(4608,Zi,Zi,[Bi]),yr(5120,Tl,ef,[Lh]),yr(4608,zh,zh,[]),yr(6144,Fh,null,[zh]),yr(135680,Bh,Bh,[Lh,co,Di,Te,Fh]),yr(4608,qh,qh,[]),yr(5120,Hh,Zh,[Lh,wa,Gh]),yr(5120,sf,of,[nf]),yr(5120,Ii,(function(t){return[t]}),[sf]),yr(5120,Yf,Jf,[Wf,Bi,[2,Kf]]),yr(4608,ad,ad,[Wf,[2,Kf],[2,ed],[2,rd],Si,Bi,[2,nd]]),yr(1073742336,va,va,[]),yr(1024,Bt,mc,[]),yr(1024,no,(function(){return[Kh()]}),[]),yr(512,nf,nf,[Te]),yr(1024,mi,(function(t,e){return[(n=t,Cu("probe",Nu),Cu("coreTokens",Object.assign({},Au,(n||[]).reduce((t,e)=>(t[e.name]=e.token,t),{}))),()=>Nu),rf(e)];var n}),[[2,no],nf]),yr(512,yi,yi,[[2,mi]]),yr(131584,ao,ao,[Bi,Ti,Te,Bt,Ke,yi]),yr(1073742336,xo,xo,[ao]),yr(1073742336,yc,yc,[[3,yc]]),yr(1024,$h,Xh,[[3,Lh]]),yr(512,rl,il,[]),yr(512,Mh,Mh,[]),yr(256,Gh,{},[]),yr(1024,Xs,Yh,[Zs,[2,Js],Gh]),yr(512,ta,ta,[Xs,Zs]),yr(512,Di,Di,[]),yr(512,co,fo,[Di,[2,lo]]),yr(1024,Ah,(function(){return[[]]}),[]),yr(1024,Lh,tf,[ao,rl,Mh,ta,Te,co,Di,Ah,Gh,[2,kh],[2,xh]]),yr(1073742336,Qh,Qh,[[2,$h],[2,Lh]]),yr(1073742336,gd,gd,[]),yr(1073742336,td,td,[Si]),yr(1073742336,pd,pd,[]),yr(1073742336,Ks,Ks,[]),yr(256,Se,!0,[]),yr(256,Wf,{apiKey:"AIzaSyCYwOFIlU4omT_kHFBGHPLm6NZ93qNVB9A",authDomain:"daily-seed.firebaseapp.com",databaseURL:"https://daily-seed.firebaseio.com",projectId:"daily-seed",storageBucket:"daily-seed.appspot.com",messagingSenderId:"117907424185"},[]),yr(256,Kf,void 0,[])])}));(function(){if(Gt)throw new Error("Cannot enable prod mode after platform setup.");Ht=!1})(),vc().bootstrapModuleFactory(vd).catch(t=>console.error(t))},zVF4:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("mrSG"),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={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,l=(15&a)<<2|c>>6,h=63&c;u||(h=64,s||(l=64)),r.push(n[o>>2],n[(3&o)<<4|a>>4],n[l],n[h])}return r.join("")},encodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(a(t),e)},decodeString:function(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){for(var e=[],n=0,r=0;n<t.length;){var i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){var o=t[n++];e[r++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){var s=((7&i)<<18|(63&(o=t[n++]))<<12|(63&(a=t[n++]))<<6|63&t[n++])-65536;e[r++]=String.fromCharCode(55296+(s>>10)),e[r++]=String.fromCharCode(56320+(1023&s))}else{o=t[n++];var a=t[n++];e[r++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&a)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray:function(t,e){this.init_();for(var n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[],i=0;i<t.length;){var o=n[t.charAt(i++)],s=i<t.length?n[t.charAt(i)]:0,a=++i<t.length?n[t.charAt(i)]:64,u=++i<t.length?n[t.charAt(i)]:64;if(++i,null==o||null==s||null==a||null==u)throw Error();r.push(o<<2|s>>4),64!==a&&(r.push(s<<4&240|a>>2),64!==u&&r.push(a<<6&192|u))}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)}}},c=function(t){try{return u.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function l(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:return new Date(e.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return e}for(var n in e)e.hasOwnProperty(n)&&(t[n]=l(t[n],e[n]));return t}var h=function(){function t(){var t=this;this.reject=function(){},this.resolve=function(){},this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))}return t.prototype.wrapCallback=function(t){var e=this;return function(n,r){n?e.reject(n):e.resolve(r),"function"==typeof t&&(e.promise.catch((function(){})),1===t.length?t(n):t(n,r))}},t}();function f(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function d(){try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(t){return!1}}var p=function(t){function e(n,r){var i=t.call(this,r)||this;return i.code=n,i.name="FirebaseError",Object.setPrototypeOf(i,e.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,g.prototype.create),i}return r.__extends(e,t),e}(Error),g=function(){function t(t,e,n){this.service=t,this.serviceName=e,this.errors=n}return t.prototype.create=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=e[0]||{},i=this.service+"/"+t,o=this.errors[t],s=o?v(o,r):"Error",a=this.serviceName+": "+s+" ("+i+").",u=new p(i,a),c=0,l=Object.keys(r);c<l.length;c++){var h=l[c];"_"!==h.slice(-1)&&(h in u&&console.warn('Overwriting FirebaseError base field "'+h+'" can cause unexpected behavior.'),u[h]=r[h])}return u},t}();function v(t,e){return t.replace(m,(function(t,n){var r=e[n];return null!=r?String(r):"<"+n+"?>"}))}var m=/\{\$([^}]+)}/g;function y(t){return JSON.parse(t)}var w=function(t){var e={},n={},r={},i="";try{var o=t.split(".");e=y(c(o[0])||""),n=y(c(o[1])||""),i=o[2],r=n.d||{},delete n.d}catch(s){}return{header:e,claims:n,data:r,signature:i}},b=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++)n[r]=4294967295&((h=n[r-3]^n[r-8]^n[r-14]^n[r-16])<<1|h>>>31);var i,o,s=this.chain_[0],a=this.chain_[1],u=this.chain_[2],c=this.chain_[3],l=this.chain_[4];for(r=0;r<80;r++){r<40?r<20?(i=c^a&(u^c),o=1518500249):(i=a^u^c,o=1859775393):r<60?(i=a&u|c&(a|u),o=2400959708):(i=a^u^c,o=3395469782);var h=(s<<5|s>>>27)+i+l+o+n[r]&4294967295;l=c,c=u,u=4294967295&(a<<30|a>>>2),a=s,s=h}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+a&4294967295,this.chain_[2]=this.chain_[2]+u&4294967295,this.chain_[3]=this.chain_[3]+c&4294967295,this.chain_[4]=this.chain_[4]+l&4294967295},t.prototype.update=function(t,e){if(null!=t){void 0===e&&(e=t.length);for(var n=e-this.blockSize,r=0,i=this.buf_,o=this.inbuf_;r<e;){if(0===o)for(;r<=n;)this.compress_(t,r),r+=this.blockSize;if("string"==typeof t){for(;r<e;)if(i[o]=t.charCodeAt(r),++r,++o===this.blockSize){this.compress_(i),o=0;break}}else for(;r<e;)if(i[o]=t[r],++r,++o===this.blockSize){this.compress_(i),o=0;break}}this.inbuf_=o,this.total_+=e}},t.prototype.digest=function(){var t=[],e=8*this.total_;this.update(this.pad_,this.inbuf_<56?56-this.inbuf_: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(){function t(t,e){var n=this;this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then((function(){t(n)})).catch((function(t){n.error(t)}))}return t.prototype.next=function(t){this.forEachObserver((function(e){e.next(t)}))},t.prototype.error=function(t){this.forEachObserver((function(e){e.error(t)})),this.close(t)},t.prototype.complete=function(){this.forEachObserver((function(t){t.complete()})),this.close()},t.prototype.subscribe=function(t,e,n){var r,i=this;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");void 0===(r=function(t,e){if("object"!=typeof t||null===t)return!1;for(var n=0,r=["next","error","complete"];n<r.length;n++){var i=r[n];if(i in t&&"function"==typeof t[i])return!0}return!1}(t)?t:{next:t,error:e,complete:n}).next&&(r.next=E),void 0===r.error&&(r.error=E),void 0===r.complete&&(r.complete=E);var o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((function(){try{i.finalError?r.error(i.finalError):r.complete()}catch(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 E(){}function S(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?")}return t+" failed: "+r+" argument "}e.CONSTANTS=i,e.Deferred=h,e.ErrorFactory=g,e.FirebaseError=p,e.MAX_VALUE_MILLIS=144e5,e.RANDOM_FACTOR=.5,e.Sha1=b,e.areCookiesEnabled=function(){return!(!navigator||!navigator.cookieEnabled)},e.assert=o,e.assertionError=s,e.async=function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Promise.resolve(!0).then((function(){t.apply(void 0,n)})).catch((function(t){e&&e(t)}))}},e.base64=u,e.base64Decode=c,e.base64Encode=function(t){var e=a(t);return u.encodeByteArray(e,!0)},e.calculateBackoffMillis=function(t,e,n){void 0===e&&(e=1e3),void 0===n&&(n=2);var r=e*Math.pow(n,t),i=Math.round(.5*r*(Math.random()-.5)*2);return Math.min(144e5,r+i)},e.contains=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.createSubscribe=function(t,e){var n=new _(t,e);return n.subscribe.bind(n)},e.decode=w,e.deepCopy=function(t){return l(void 0,t)},e.deepExtend=l,e.errorPrefix=S,e.getUA=f,e.isAdmin=function(t){var e=w(t).claims;return"object"==typeof e&&!0===e.admin},e.isBrowser=function(){return"object"==typeof self&&self.self===self},e.isBrowserExtension=function(){var t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id},e.isElectron=function(){return f().indexOf("Electron/")>=0},e.isEmpty=function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0},e.isIE=function(){var t=f();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0},e.isIndexedDBAvailable=function(){return"indexedDB"in self&&null!=indexedDB},e.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(f())},e.isNode=d,e.isNodeSdk=function(){return!0===i.NODE_CLIENT||!0===i.NODE_ADMIN},e.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},e.isSafari=function(){return!d()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")},e.isUWP=function(){return f().indexOf("MSAppHost/")>=0},e.isValidFormat=function(t){var e=w(t).claims;return!!e&&"object"==typeof e&&e.hasOwnProperty("iat")},e.isValidTimestamp=function(t){var e=w(t).claims,n=Math.floor((new Date).getTime()/1e3),r=0,i=0;return"object"==typeof e&&(e.hasOwnProperty("nbf")?r=e.nbf:e.hasOwnProperty("iat")&&(r=e.iat),i=e.hasOwnProperty("exp")?e.exp:r+86400),!!n&&!!r&&!!i&&n>=r&&n<=i},e.issuedAtTime=function(t){var e=w(t).claims;return"object"==typeof e&&e.hasOwnProperty("iat")?e.iat:null},e.jsonEval=y,e.map=function(t,e,n){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=e.call(n,t[i],i,t));return r},e.querystring=function(t){for(var e=[],n=function(t,n){Array.isArray(n)?n.forEach((function(n){e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))})):e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))},r=0,i=Object.entries(t);r<i.length;r++){var o=i[r];n(o[0],o[1])}return e.length?"&"+e.join("&"):""},e.querystringDecode=function(t){var e={};return t.replace(/^\?/,"").split("&").forEach((function(t){if(t){var n=t.split("=");e[n[0]]=n[1]}})),e},e.safeGet=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0},e.stringLength=function(t){for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);r<128?e++:r<2048?e+=2:r>=55296&&r<=56319?(e+=4,n++):e+=3}return e},e.stringToByteArray=function(t){for(var e=[],n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);if(i>=55296&&i<=56319){var s=i-55296;r++,o(r<t.length,"Surrogate pair missing trail surrogate."),i=65536+(s<<10)+(t.charCodeAt(r)-56320)}i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=63&i|128):i<65536?(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=63&i|128):(e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=63&i|128)}return e},e.stringify=function(t){return JSON.stringify(t)},e.validateArgCount=function(t,e,n,r){var i;if(r<e?i="at least "+e:r>n&&(i=0===n?"none":"no more than "+n),i)throw new Error(t+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")},e.validateCallback=function(t,e,n,r){if((!r||n)&&"function"!=typeof n)throw new Error(S(t,e,r)+"must be a valid function.")},e.validateContextObject=function(t,e,n,r){if((!r||n)&&("object"!=typeof n||null===n))throw new Error(S(t,e,r)+"must be a valid context object.")},e.validateIndexedDBOpenable=function(){return new Promise((function(t,e){try{var n=!0,r="validate-browser-context-for-indexeddb-analytics-module",i=window.indexedDB.open(r);i.onsuccess=function(){i.result.close(),n||window.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=function(){n=!1},i.onerror=function(){var t;e((null===(t=i.error)||void 0===t?void 0:t.message)||"")}}catch(o){e(o)}}))},e.validateNamespace=function(t,e,n,r){if((!r||n)&&"string"!=typeof n)throw new Error(S(t,e,r)+"must be a valid firebase namespace.")}},zn8P:function(t,e){function n(t){return Promise.resolve().then((function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}))}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id="zn8P"}},[[0,0]]]);